#include <viewmode.h>
Collaboration diagram for Layer:
Public Types | |
typedef QPtrList< Database::SecondaryIterator< SpatialFeatureData > > | FeatureList |
Public Member Functions | |
Layer (const QDomElement &elem, SecItDict &) | |
~Layer () | |
TR_PIX | heightInPix (TR_PIX totalheight) |
Public Attributes | |
bool | allowOverlap |
int | height |
FeatureList | featureList |
Definition at line 36 of file viewmode.h.
Definition at line 43 of file viewmode.h.
Layer::Layer | ( | const QDomElement & | elem, | |
SecItDict & | ||||
) |
Definition at line 26 of file viewmode.cpp.
References QDomElement::attribute(), featureList, height, QDomNode::isElement(), QDomNode::isNull(), QDomNode::nextSibling(), QDomNode::nodeName(), QPtrList::prepend(), QPtrList::setAutoDelete(), QDomNode::toElement(), QString::toInt(), and QMessageBox::warning().
00027 { 00028 // cerr << "in layer ctor" << endl; 00029 featureList.setAutoDelete( true ); 00030 00031 QString heightStr = elem.attribute( "height",""); 00032 height = heightStr.toInt(); 00033 // cerr << "height in Layer ctor = " << height << endl; 00034 QDomNode node = elem.firstChild(); 00035 while ( !node.isNull() ) 00036 { 00037 if ( node.isElement() && node.nodeName() == "feature" ) 00038 { 00039 QDomElement featureElem = node.toElement(); 00040 //featureName = "features/"; 00041 // std::string featureName = std::string(featureElem.attribute("name","").ascii() ); 00042 QString featureName = featureElem.attribute("name",""); 00043 // GeneralData * dummy = GeneralMaker::newData( featureName ); 00044 // cerr << "feature=" << featureName << endl; 00045 00046 Database::SecondaryIterator<SpatialFeatureData> * it = secItDict[featureName]; 00047 if ( it ) 00048 { 00049 featureList.prepend( it ); 00050 } 00051 else 00052 { 00053 QMessageBox::warning( 00054 NULL, "Unknown feature specified", 00055 QString( "The feature \n\'%1\' specified in configuration file\n is not of unknown type." ). 00056 arg( featureName ), 00057 "&Ok" ); 00058 } 00059 } 00060 node = node.nextSibling(); 00061 } 00062 }
Layer::~Layer | ( | ) | [inline] |
TR_PIX Layer::heightInPix | ( | TR_PIX | totalheight | ) |
Definition at line 64 of file viewmode.cpp.
References height, and TR_PIX.
Referenced by TrapperView::paintFeatures().
00065 { 00066 // cerr <<"totalheight="<<totalHeight<< endl; 00067 // cerr <<"height="<<height<< endl; 00068 TR_PIX res = ( int ) (( height * totalHeight )/ 100 ); 00069 // cerr <<"res="<<res<<endl; 00070 return res; 00071 }
bool Layer::allowOverlap |
Definition at line 44 of file viewmode.h.
int Layer::height |