00001 #ifndef __VECTOREDITOR_H 00002 #define __VECTOREDITOR_H 00003 00004 #include <qobject.h> 00005 #include <qmessagebox.h> 00006 #include <qapplication.h> 00007 00008 #include "vectorlayerset.h" 00009 #include "viewset.h" 00010 00011 #include <algorithm> 00012 00043 class VectorEditor : public QObject { 00044 Q_OBJECT 00045 protected: 00046 VectorLayerSet *mLayerSet ; 00051 ViewSet *mViewSet ; 00056 VectorData *mData ; 00066 SelectionSet *mSelSet; 00071 // SelectionSet mLastSelSet; 00072 bool mInObject; 00073 bool mCtrlDown; 00074 bool mShiftDown; 00075 bool mMovingNode; 00076 00077 std::vector<SelectionSet::SelObj> mOverNode; 00078 00079 std::vector<SelectionSet::SelObj> overSelNode( double x, double y ); 00080 00081 // HAS INTERSECT? 00085 bool hasIntersect( Node p1, Node p2, Node p3, Node p4 ); 00086 00087 00088 // IS SELected LINE? 00098 int isSelLine( int iline ); 00099 00100 // IS SELected POINT? 00120 bool isSelPoint( int &iline, int &inode ); 00121 00122 void init( ); 00123 00124 int _int_min( int v1, int v2 ) { 00125 return( v1 < v2 ) ? v1 : v2; 00126 } 00127 00128 int _int_max( int v1, int v2 ) { 00129 return( v1 > v2 ) ? v1 : v2; 00130 } 00131 00132 public: 00133 VectorEditor( VectorLayerSet *, ViewSet * ); 00134 virtual ~VectorEditor( ); 00135 00136 void addView( View *view ); 00137 void removeView( View *view ); 00141 void clearAllLayerSelections () ; 00142 00143 public slots: 00144 void viewMousePress( QMouseEvent *me, View::MouseState &ms ); 00145 void viewMouseMove( QMouseEvent *me, View::MouseState &ms ); 00146 void viewMouseRelease( QMouseEvent *me, View::MouseState &ms ); 00147 void viewKeyPress( QKeyEvent *ke ); 00148 void viewKeyRelease( QKeyEvent *ke ); 00149 00150 // VIEW SELection CHANGED 00166 void viewSelChanged( SelectionSet::SelBox &box ); 00167 void breakLine( ); 00168 void joinLine( ); 00169 void contLine( ); 00170 void delSel( ); 00171 void activeLayerChanged( int ); 00172 00173 signals: 00174 void repaint( bool ); 00175 void selBoxChanged( Rect & ); 00176 void selectionChanged() ; 00177 }; 00178 00179 #endif 00180 00181 00182 00183 00184
Home |
Search |
Disclaimers & Privacy |
Contact Us GLIMSView Maintainer: dsoltesz@usgs.gov |