X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_PrsImage.h;h=1fafe35416c0a4d346e0a3d0509d68cda199d00a;hb=81c9f5cdf82909d0aebd2c491c50fa7516cc80b7;hp=c5d57981ad8c57084b82adb4f98e829d99d06b15;hpb=84f8b4a57d3cdad820bc1333a5066699cd1c8ae3;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_PrsImage.h b/src/HYDROGUI/HYDROGUI_PrsImage.h index c5d57981..1fafe354 100644 --- a/src/HYDROGUI/HYDROGUI_PrsImage.h +++ b/src/HYDROGUI/HYDROGUI_PrsImage.h @@ -37,10 +37,11 @@ public: enum TransformationPointType { None = 0, PointA, PointB, PointC }; struct TransformationPoint { - QPoint Point; - QString Caption; - QGraphicsEllipseItem* PointItem; - QGraphicsSimpleTextItem* CaptionItem; + TransformationPoint() : Point( 0, 0 ), Caption( "" ), GroupItem( 0 ) {} + + QPoint Point; + QString Caption; + QGraphicsItemGroup* GroupItem; }; typedef QMap < int, TransformationPoint > TransformationPointMap; typedef QMapIterator< int, TransformationPoint > TransformationPointMapIterator; @@ -50,7 +51,8 @@ public: virtual ~HYDROGUI_PrsImage(); public: - void setImage( const QImage& theImage ); + void setImage( const QImage& theImage, + const bool theCompute = false ); QImage getImage() const; void setCaption( const QString& theCaption ); @@ -59,6 +61,9 @@ public: void setIsTransformationPointPreview( const bool theState ); bool getIsTransformationPointPreview() const; + void setIsByTwoPoints( const bool theIsByTwoPoints ); + bool getIsByTwoPoints() const; + void setTransformationPointType( const int thePointType ); void setTransformationPointMap( const TransformationPointMap& theMap ); @@ -87,7 +92,20 @@ public: virtual void setSelected( bool theState ); protected: - void computeTransformationPoints(); + void computeTransformationPoints( const bool theObligatoryInit = false ); + + QGraphicsItemGroup* createPointItem( const QString& theCaption, + const QColor& theColor ); + + /** + * Create presentations for transformation points A, B and C or update the presentation + * parameters if it is already created + */ + void initTrsfPoints( const int thePointType ); + /** + * Show/hide a transformation point if necessary. + */ + void updateTrsfPoint( const int thePointType ); protected: QCursor* getTransformationPointCursor() const { return myTransformationPointCursor; } @@ -100,6 +118,7 @@ protected: HYDROGUI_PrsImageFrame* myPrsImageFrame; bool myIsTransformationPointPreview; + bool myIsByTwoPoints; int myTransformationPointType; TransformationPointMap myTransformationPointMap;