/***********************************************************************
**
**   isohypse.cpp
**
**   This file is part of KFLog.
**
************************************************************************
**
**   Copyright (c):  2000 by Heiner Lamprecht, Florian Ehinger
**
**   This file is distributed under the terms of the General Public
**   Licence. See the file COPYING for more information.
**
**   $Id: isohypse.cpp,v 1.20 2004/06/18 22:02:26 axel Exp $
**
***********************************************************************/
#include "targets.h"

#include "isohypse.h"

#include "mapmatrix.h"
#include <qarray.h>

Isohypse::Isohypse(QPointArray pA, unsigned int elev, bool isV, unsigned int secID)
        : LineElement(0, BaseMapElement::Isohypse, pA, isV, secID),
        elevation(elev)
{
}

Isohypse::~Isohypse()
{
}

QRegion* Isohypse::drawRegion(QPainter* targetP, QPainter* maskP, bool really_draw, bool isolines)
{
  if(glMapMatrix->isVisible(bBox, getTypeID())) {
        QRegion *qr=0;
        QPointArray tA( glMapMatrix->map(projPointArray) );
        if (glMapMatrix->isInProjCenterArea(bBox)) {
          qr = new QRegion( tA );
        }
        if(really_draw) {  
            targetP->drawPolygon(tA,true);
            if( isolines )
                targetP->drawPolyline(tA);
        }
        return qr;
    }
    return 0;
}




