X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGLViewer%2FGLViewer_BaseObjects.h;h=fdd1f75fc7e1b67c76de14794abd697a5185062f;hb=3b3dce973acb7299499dd3527ded627940516ab3;hp=53604863f9a6c1563f1339c8e97761c5e702bb92;hpb=4b914be3971471bcd67878b96fbdca12fbc2ac1d;p=modules%2Fgui.git diff --git a/src/GLViewer/GLViewer_BaseObjects.h b/src/GLViewer/GLViewer_BaseObjects.h index 53604863f..fdd1f75fc 100644 --- a/src/GLViewer/GLViewer_BaseObjects.h +++ b/src/GLViewer/GLViewer_BaseObjects.h @@ -18,55 +18,74 @@ #pragma warning( disable:4251 ) #endif -// Class: GLViewer_MarkerSet -// Descr: OpenGL MarkerSet +/*! + * Class GLViewer_MarkerSet + * OpenGL MarkerSet + */ class GLVIEWER_API GLViewer_MarkerSet : public GLViewer_Object { public: + //! A constructor GLViewer_MarkerSet( int number = 1, float size = 5.0, const QString& toolTip = "GLMarker" ); + //! A destructor ~GLViewer_MarkerSet(); - - virtual void compute(); + + // redefined methods + 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, + 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&, QValueList& , QValueList&, QValueList& ); + virtual GLboolean unselect(); - QValueList getSelectedElements() { return mySelNumbers; } - bool addOrRemoveSelected( int index ); - void addSelected( const TColStd_SequenceOfInteger& ); - void setSelected( const TColStd_SequenceOfInteger& ); + virtual GLViewer_Rect* getUpdateRect(); - virtual void moveObject( float, float, bool fromGroup = false ); + virtual void moveObject( float, float, bool fromGroup = false ); - virtual QByteArray getByteCopy(); - virtual bool initializeFromByteCopy( QByteArray ); + 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 ); + 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 ); + virtual bool translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aEMFCS ); #endif + //! Sets array of x coords of markers + void setXCoord( GLfloat* xCoord, int size ); + //! Sets array of y coords of markers + void setYCoord( GLfloat* yCoord, int size ); + //! Returns x coords + GLfloat* getXCoord() const { return myXCoord; } + //! Returns y coords + GLfloat* getYCoord() const { return myYCoord; } + + //! Sets markers number + void setNumMarkers( GLint ); + //! returns markers number + GLint getNumMarkers() const { return myNumber; }; + //! Sets merker radius + void setMarkerSize( const float size ) { myMarkerSize = size; } + //! Returns merker radius + float getMarkerSize() const { return myMarkerSize; } + + //! Export numbers of heghlighted/selected markers + void exportNumbers( QValueList& high, QValueList& unhigh, + QValueList& sel, QValueList& unsel ); + + //! Returns selected numbers + QValueList getSelectedElements() { return mySelNumbers; } + //! Adds or remove selected number + bool addOrRemoveSelected( int index ); + //! Adds selected numbers + void addSelected( const TColStd_SequenceOfInteger& ); + //! Sets selected nembers + void setSelected( const TColStd_SequenceOfInteger& ); + protected: GLint myNumber; GLfloat* myXCoord; @@ -81,15 +100,18 @@ protected: TColStd_SequenceOfInteger mySelectedIndexes; }; -// Class: GLViewer_Polyline -// Descr: OpenGL Polyline +/*! + * Class GLViewer_Polyline + * OpenGL Polyline + */ class GLVIEWER_API GLViewer_Polyline: public GLViewer_Object { public: GLViewer_Polyline( int number = 1, float size = 5.0, const QString& toolTip = "GLPolyline" ); - ~GLViewer_Polyline(); + ~GLViewer_Polyline(); + // redefined methods virtual void compute(); virtual GLViewer_Drawer* createDrawer(); @@ -101,23 +123,6 @@ public: 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 setNumber( GLint ); - GLint getNumber() const { return myNumber; }; - - void setClosed( GLboolean closed ) { myIsClosed = closed; } - GLboolean isClosed() const { return myIsClosed; } - - void setHighSelAll( GLboolean highSelAll ) { myHighSelAll = highSelAll; } - GLboolean isHighSelAll() const { return myHighSelAll; } - - void exportNumbers( QValueList&, QValueList& , QValueList&, QValueList& ); - - QValueList getSelectedElements() { return mySelNumbers; } - virtual void moveObject( float, float, bool fromGroup = false ); virtual QByteArray getByteCopy(); @@ -129,6 +134,37 @@ public: #ifdef WIN32 virtual bool translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aEMFCS ); #endif + + //! Sets array of x coords of points + void setXCoord( GLfloat* xCoord, int size ); + //! Sets array of y coords of points + void setYCoord( GLfloat* yCoord, int size ); + //! Returns x coords + GLfloat* getXCoord() const { return myXCoord; } + //! Returns y coords + GLfloat* getYCoord() const { return myYCoord; } + + //! SetS number of points + void setNumber( GLint ); + //! Returns number of points + GLint getNumber() const { return myNumber; }; + + //! On/off closed status of polyline + void setClosed( GLboolean closed ) { myIsClosed = closed; } + //! Checks closed status of polyline + GLboolean isClosed() const { return myIsClosed; } + + //! On/off highlight as whole object status + void setHighSelAll( GLboolean highSelAll ) { myHighSelAll = highSelAll; } + //! Checks highlight as whole object status + GLboolean isHighSelAll() const { return myHighSelAll; } + + //! Export numbers of heghlighted/selected lines + void exportNumbers( QValueList& high, QValueList& unhigh, + QValueList& sel, QValueList& unsel ); + + //! Returns numbers of selected lines + QValueList getSelectedElements() { return mySelNumbers; } protected: GLfloat* myXCoord;