Salome HOME
Image positioning by two points.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_AISCurve.h
1 #ifndef HYDROGUI_AIS_CURVE_H
2 #define HYDROGUI_AIS_CURVE_H
3
4 #include <vector>
5 #include <list>
6
7 #include <AIS_InteractiveContext.hxx>
8 #include <AIS_Point.hxx>
9 #include <AIS_Line.hxx>
10
11 #include <CurveCreator_Listener.hxx>
12
13 class CurveCreator_Curve;
14
15 class AIS_InteractiveObject;
16 class AIS_Point;
17 class AIS_Line;
18
19 class HYDROGUI_AISCurveSection
20 {
21 public:
22   HYDROGUI_AISCurveSection(  Handle_AIS_InteractiveContext theContext, 
23     CurveCreator_Curve* theCurve, int theSection );
24   virtual ~HYDROGUI_AISCurveSection();
25
26   void Display();
27   void Erase();
28
29   void  highlight( bool isHL );
30
31 protected:
32   virtual void buildSection();
33
34   void    getPoint( int theIndx, double& theX, double& theY, double& theZ );
35
36   Handle_AIS_Point getAISPoint( int theIndx );
37   Handle_AIS_Line  getAISLine( int theIndx1, int theIndx2 );
38
39   Quantity_Color getActiveColor();
40
41 private:
42   CurveCreator_Curve*                                 myCurve;
43   int                                                 mySection;
44   std::vector< Handle_AIS_InteractiveObject >         myObjects;
45   Handle_AIS_InteractiveContext                       myContext;
46   bool                                                myIsHighlight;
47   bool                                                myIsHL;
48 };
49
50 class HYDROGUI_AISCurve : public CurveCreator_Listener
51 {
52 public:
53   HYDROGUI_AISCurve(CurveCreator_Curve* theCurve, Handle_AIS_InteractiveContext theContext );
54   ~HYDROGUI_AISCurve(void);
55
56   void setCurve( CurveCreator_Curve* theCurve );
57
58   void Display();
59   void Erase();
60
61   virtual void pointInserted( int theSection, int theIndx );
62
63   void  highlightSection( int theSection, bool isHL );
64
65   void  clearSelection();
66
67 protected:
68   virtual void  buildCurve();
69   Quantity_Color getActiveColor();
70
71 private:
72   CurveCreator_Curve*                                 myCurve;
73   Handle_AIS_InteractiveContext                       myContext;
74   std::vector< HYDROGUI_AISCurveSection* >            myCurveRepresentation; 
75 };
76
77 #endif