-class GLVIEWER_EXPORT GLViewer_Object : public QObject
-{
- Q_OBJECT
-
-public:
- GLViewer_Object();
- virtual ~GLViewer_Object();
-
- virtual void compute() = 0;
- virtual GLViewer_Drawer* createDrawer() = 0;
- GLViewer_Drawer* getDrawer(){ return myDrawer; }
- virtual void setDrawer( GLViewer_Drawer* theDrawer ) { myDrawer = theDrawer; }
-
- virtual GLboolean highlight( GLfloat x, GLfloat y, GLfloat tol, GLboolean isCircle = GL_FALSE ) = 0;
- virtual GLboolean unhighlight() = 0;
- virtual GLboolean select( GLfloat x, GLfloat y, GLfloat tol, GLViewer_Rect rect, GLboolean isFull = GL_FALSE,
- GLboolean isCircle = GL_FALSE, GLboolean isShift = GL_FALSE ) = 0;
- virtual GLboolean unselect() = 0;
-
- virtual GLboolean isInside( GLViewer_Rect );
-
- virtual bool portContains( GLViewer_Pnt ) { return false; }
- virtual bool startPulling( GLViewer_Pnt ) { return false; }
- virtual void pull( GLViewer_Pnt, GLViewer_Object* ) {}
- virtual void finishPulling() {}
- virtual bool isPulling() { return false; }
-
- virtual void setRect( GLViewer_Rect* rect) { myRect = rect; }
- virtual GLViewer_Rect* getRect() const { return myRect; }
- virtual GLViewer_Rect* getUpdateRect() = 0;
-
- virtual void setScale( GLfloat xScale, GLfloat yScale ) { myXScale = xScale; myYScale = yScale; }
- virtual void getScale( GLfloat& xScale, GLfloat& yScale ) const { xScale = myXScale; yScale = myYScale;}
-
- virtual GLboolean setZoom( GLfloat zoom, GLboolean = GL_FALSE );
- virtual GLfloat getZoom() const { return myZoom; }
- virtual GLboolean updateZoom( bool zoomIn );
-
- virtual GLboolean isHighlighted() const { return myIsHigh; }
- virtual GLboolean isSelected() const { return myIsSel; }
- virtual void setSelected( GLboolean state ) { myIsSel = state; }
-
- void setGLText( GLViewer_Text* glText ) { myGLText = glText; }
- GLViewer_Text* getGLText() const { return myGLText; }
-
- virtual void setAspectLine ( GLViewer_AspectLine* aspect ) { myAspectLine = aspect; }
- virtual GLViewer_AspectLine* getAspectLine() const { return myAspectLine; }
-
- QString getObjectType() const { return myType; }
-
- void setName( QString name ) { myName = name; }
- QString getName() const { return myName; }
-
- virtual void moveObject( float, float, bool fromGroup = false ) = 0;
- virtual void finishMove() {}
-
- bool getVisible(){ return myIsVisible; }
- void setVisible( bool theStatus ){ myIsVisible = theStatus; }
-
- void setToolTipText( QString str ){ myToolTipText = str; }
- virtual QString getToolTipText(){ return myToolTipText; }
-
- bool isTooTipHTML() const { return isToolTipHTML; }
- void setToolTipFormat( bool isHTML ) { isToolTipHTML = isHTML; }
-
- virtual QByteArray getByteCopy();
- virtual bool initializeFromByteCopy( QByteArray );
-
- virtual bool translateToPS( QFile& hFile, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aPSCS ) = 0;
- virtual bool translateToHPGL( QFile& hFile, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aHPGLCS ) = 0;
-
-#ifdef WIN32
- virtual bool translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aEMFCS ) = 0;
-#endif
-
- GLViewer_Owner* owner() const;
- void setOwner( GLViewer_Owner* );
-
- void setGroup( GLViewer_Group* );
- GLViewer_Group* getGroup() const;
-
-protected:
- QString myName;
- QString myType;
-
- GLViewer_Rect* myRect;
- GLfloat myXScale;
- GLfloat myYScale;
- GLfloat myXGap;
- GLfloat myYGap;
-
- GLfloat myZoom;
-
- GLboolean myIsHigh;
- GLboolean myIsSel;
- GLViewer_Text* myGLText;
-
- GLViewer_Drawer* myDrawer;
- GLViewer_AspectLine* myAspectLine;
- QString myToolTipText;
- bool isToolTipHTML;
-
- bool myIsVisible;
- GLViewer_Owner* myOwner;
- GLViewer_Group* myGroup;
-};
-
-/***************************************************************************
-** Class: GLViewer_Owner
-** Descr:
-** Module: GLViewer
-** Created: UI team, 15.12.04
-****************************************************************************/
-#include <SUIT_DataOwner.h>
-
-class GLVIEWER_EXPORT GLViewer_Owner: public SUIT_DataOwner
-{
-public:
- GLViewer_Owner():SUIT_DataOwner() {};
- ~GLViewer_Owner() {};
-
-public:
- int getIndex() const { return myIndex; }
-
-protected:
- int myIndex;
-};
-
-/***************************************************************************
-** Class: GLViewer_MarkerSet
-** Descr: OpenGL MarkerSet
-** Module: GLViewer
-** Created: UI team, 03.09.02
-****************************************************************************/
-class GLVIEWER_EXPORT GLViewer_MarkerSet: public GLViewer_Object
-{
- Q_OBJECT
-
-public:
- GLViewer_MarkerSet( int number = 1, float size = 5.0, const QString& toolTip = "GLMarker" );
- ~GLViewer_MarkerSet();
-
- virtual void compute();
- virtual GLViewer_Drawer* createDrawer();
-
- virtual GLboolean highlight( GLfloat x, GLfloat y, GLfloat tol = 15.0, GLboolean isCircle = GL_FALSE );
- virtual GLboolean unhighlight();
- virtual GLboolean select( GLfloat x, GLfloat y, GLfloat tol, GLViewer_Rect rect, GLboolean isFull = GL_FALSE,
- GLboolean isCircle = GL_FALSE, GLboolean isShift = GL_FALSE );
- virtual GLboolean unselect();
-
- virtual GLViewer_Rect* getUpdateRect();
-
- void setXCoord( GLfloat* xCoord, int size );
- void setYCoord( GLfloat* yCoord, int size );
- GLfloat* getXCoord() const { return myXCoord; }
- GLfloat* getYCoord() const { return myYCoord; }
- void setNumMarkers( GLint );
- GLint getNumMarkers() const { return myNumber; };
-
- void setMarkerSize( const float size ) { myMarkerSize = size; }
- float getMarkerSize() const { return myMarkerSize; }
-
- void exportNumbers( QValueList<int>&, QValueList<int>& , QValueList<int>&, QValueList<int>& );
-
- QValueList<int> getSelectedElements() { return mySelNumbers; }
- bool addOrRemoveSelected( int index );
- void addSelected( const TColStd_SequenceOfInteger& );
- void setSelected( const TColStd_SequenceOfInteger& );
-
- virtual void moveObject( float, float, bool fromGroup = false );
-
- virtual QByteArray getByteCopy();
- virtual bool initializeFromByteCopy( QByteArray );
-
- virtual bool translateToPS( QFile& hFile, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aPSCS );
- virtual bool translateToHPGL( QFile& hFile, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aHPGLCS );
-
-#ifdef WIN32
- virtual bool translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aEMFCS );
-#endif
-
-protected slots:
- void onSelectionDone( bool );
- void onSelectionCancel();
-
-signals:
- void dvMarkersSelected( const TColStd_SequenceOfInteger& );
-
-protected:
- GLint myNumber;
- GLfloat* myXCoord;
- GLfloat* myYCoord;
- GLfloat myMarkerSize;
- QValueList<int> myHNumbers;
- QValueList<int> myUHNumbers;
- QValueList<int> mySelNumbers;
- QValueList<int> myCurSelNumbers;
- QValueList<int> myUSelNumbers;
- QValueList<int> myPrevHNumbers;
- TColStd_SequenceOfInteger mySelectedIndexes;
-};
-
-/***************************************************************************
-** Class: GLViewer_Polyline
-** Descr: OpenGL Polyline
-** Module: GLViewer
-** Created: UI team, 03.09.02
-****************************************************************************/
-class GLVIEWER_EXPORT GLViewer_Polyline: public GLViewer_Object