00001 #ifndef __GLIMSLINEDATA_H 00002 #define __GLIMSLINEDATA_H 00003 00004 #include <vector> 00005 #include <algorithm> 00006 #include "image.h" 00007 #include "xmlserializeable.h" 00008 #include "simplelinedata.h" 00009 #include "linedefset.h" 00010 #include "glacierline.h" 00011 #include "GlacierLineHistory.h" 00012 #include "ValidationReport.h" 00013 #include "TraceLog.h" 00014 00051 class GLIMSLineData 00052 : public SimpleLineData { 00053 00054 protected: 00055 int mDefGID; 00056 int mDefLDF; 00057 LineDefSet mLDFSet; 00058 00059 GlacierLineHistory mHistory ; 00060 GlacierLineHistory mRedoHistory ; 00061 00062 void setAttr( int iline ); 00063 00084 void pop( GlacierLineHistory * historyUndo, GlacierLineHistory * historyRedo, 00085 std::stack<SelectionSet> * selSetUndo, std::stack<SelectionSet> * selSetRedo) ; 00086 00087 00088 public: 00089 GLIMSLineData( ); 00090 00094 virtual bool toXML( QDomDocument &doc, 00095 QDomElement &elem, 00096 std::string id = "" ); 00097 00101 virtual bool fromXML( QDomElement &elem ); 00102 00106 void setDefGID( int gid ) { 00107 mDefGID = gid; 00108 } 00109 00113 void setDefLDF( int ldf ) { 00114 mDefLDF = ldf; 00115 } 00116 00124 void setLDF( int iline, int ildf ); 00125 00131 void setGID( int iline, int igid ); 00132 00142 virtual void addLine( Node &xynode ); 00143 00144 00164 virtual void restoreLine( GlacierLine &line, int iline = -1 ) ; 00165 00173 virtual void delLine( int iline ); 00174 00187 virtual void removeLine( int iline ) ; 00188 00203 virtual void breakLine( int iline, int inode ); 00204 00240 virtual void restoreJoinedLines(GlacierLine &line1, int iline1, 00241 GlacierLine &line2, int iline2, 00242 GlacierLineHistoryElement * h1, 00243 GlacierLineHistoryElement * h2) ; 00244 00261 virtual void joinLine( int il1, int il2, int in1, int in2 ); 00262 00285 virtual void rejoinLine( GlacierLine & originalLine, 00286 int il1, 00287 int il2, 00288 GlacierLineHistoryElement * h1, 00289 GlacierLineHistoryElement * h2 ) ; 00290 00291 00292 00305 virtual void addLineNode( Node &node, 00306 int iline, 00307 int inode = -1 ); 00308 00324 virtual void restoreLineNode( Node &node, 00325 int iline, 00326 int inode ) ; 00327 00335 virtual void delLineNode( int iline, int inode ); 00336 00346 virtual void removeLineNode( int iline, int inode ); 00347 00360 virtual void moveLineNode( int iline, 00361 int inode, 00362 Node &xynode ) ; 00363 00376 virtual void startMoveLineNode( int iline, 00377 int inode, 00378 Node &xynode ) ; 00379 00392 virtual void restoreMovedLineNode( int iline, 00393 int inode, 00394 Node &xynode ) ; 00395 00396 00409 virtual void insertLineNode( Node &node, 00410 int iline, 00411 int inode=-1 ); 00412 00429 virtual void reinsertLineNode( Node &node, 00430 int iline, 00431 int inode=-1 ); 00432 00437 virtual void pop( ); 00438 00445 virtual void redo( ) ; 00446 00447 00452 virtual void push( ) ; 00453 00454 00459 virtual void pushSelection( ) ; 00460 00461 00467 virtual void addLineNodeLL( Node &n, int iline, int inode=-1 ) { 00468 mImg->getXY( n.x, n.y ); 00469 addLineNode( n, iline, inode ); 00470 } 00471 00476 virtual void addLineLL( Node &n ) { 00477 mImg->getXY( n.x, n.y ); 00478 addLine( n ); 00479 } 00480 00485 virtual void addLineSetLL( std::vector<GlacierLine> &glset ); 00486 00491 void addLDF( LineDef &ldf ) { 00492 mLDFSet.add( ldf ); 00493 emit datasetChanged(); 00494 } 00495 00499 void loadDefaultSet( ) { 00500 LineDefSet &ldfset = GLIMSGlobals::mGlbLDFSet; 00501 for ( unsigned int ildf=0; ildf < ldfset.size(); ildf++ ) { 00502 addLDF( ldfset[ildf] ); 00503 } 00504 } 00505 00509 LineDefSet& getLDFSet( ) { 00510 return mLDFSet; emit datasetChanged(); 00511 } 00512 00518 GlacierLine* toXY( GlacierLine *gl ); 00519 00520 00530 bool validate(ValidationReport * valRep) ; 00531 00532 00533 }; 00534 00535 00536 #endif 00537 00538 00539 00540
Home |
Search |
Disclaimers & Privacy |
Contact Us GLIMSView Maintainer: dsoltesz@usgs.gov |