Salome HOME
Update the names of Regions and Zones if case name changed (Bug #110).
[modules/hydro.git] / src / HYDROData / HYDROData_IPolyline.h
1
2 #ifndef HYDROData_IPolyline_HeaderFile
3 #define HYDROData_IPolyline_HeaderFile
4
5 #include "HYDROData_Entity.h"
6
7 #include <CurveCreator.hxx>
8 #include <CurveCreator_ICurve.hxx>
9
10 DEFINE_STANDARD_HANDLE(HYDROData_IPolyline, HYDROData_Entity)
11
12 class TopoDS_Wire;
13 class Handle(TDataStd_RealList);
14 class Handle(TDataStd_ExtStringList);
15 class Handle(TDataStd_IntegerList);
16 class Handle(TDataStd_BooleanList);
17
18 /**\class HYDROData_IPolyline
19  * \brief Base class that stores/retreives information about the 2D points.
20  */
21 class HYDROData_IPolyline : public HYDROData_Entity, public CurveCreator_ICurve
22 {
23
24 protected:
25   /**
26    * Enumeration of tags corresponding to the persistent object parameters.
27    */
28   enum DataTag
29   {
30     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
31     DataTag_Sections,
32     DataTag_Points,
33     DataTag_Operations
34   };
35
36   /**
37    * Enumeration of tags corresponding to the operations child lable
38    */
39   enum OperationsTag
40   {
41     OperationsTag_Commited,
42     OperationsTag_Undoed
43   };
44
45 public:
46   DEFINE_STANDARD_RTTI(HYDROData_IPolyline);
47
48   /**
49    * Returns the 3D presentation of all points.
50    */
51   HYDRODATA_EXPORT virtual ListAISObjects constructWire() const = 0;
52
53
54 public:
55
56   // Implementation of ICurvePolyline interface
57   
58   /***********************************************/
59   /***          Undo/Redo methods              ***/
60   /***********************************************/
61
62   //! Get number of available undo operations
63   HYDRODATA_EXPORT virtual int getNbUndo() const;
64
65   //! Undo previous operation
66   HYDRODATA_EXPORT virtual bool undo();
67
68   //! Get number of available redo operations
69   HYDRODATA_EXPORT virtual int getNbRedo() const;
70
71   //! Redo last previously "undone" operation
72   HYDRODATA_EXPORT virtual bool redo();
73
74
75   /***********************************************/
76   /***           Point methods                 ***/
77   /***********************************************/
78
79   //! Get the dimension.
80   HYDRODATA_EXPORT virtual CurveCreator::Dimension getDimension() const;
81
82
83   //! Get coordinates of specified point
84   HYDRODATA_EXPORT virtual CurveCreator::Coordinates getPoint( const int theISection, 
85                                                                const int theIPnt ) const;
86
87   /**
88    *  Get number of points in specified section or (the total number of points
89    *  in Curve if theISection is equal to -1).
90    */
91   HYDRODATA_EXPORT virtual int getNbPoints( const int theISection = -1 ) const;
92
93
94 protected:
95
96   void startOperation();
97
98   void commitOperation();
99
100   void abortOperation();
101
102
103   void setNbOperations( const int theNb );
104
105   int  getNbOperations() const;
106
107   
108   void setNbUndoedOperations( const int theNb );
109
110   int  getNbUndoedOperations() const;
111
112
113   void getSectionsLists( Handle(TDataStd_ExtStringList)& theNamesList,
114                          Handle(TDataStd_IntegerList)&   theTypesList,
115                          Handle(TDataStd_BooleanList)&   theClosuresList,
116                          const bool                      theIsCreate = true ) const;
117
118   void removeSectionsLists();
119
120
121   void getPointsLists( const int                  theSectionIndex,
122                        Handle(TDataStd_RealList)& theListX,
123                        Handle(TDataStd_RealList)& theListY,
124                        const bool                 theIsCreate = true ) const;
125
126   void removePointsLists( const int theSectionIndex = -1 );
127
128 protected:
129
130   /**
131    * Creates new object in the internal data structure. Use higher level objects 
132    * to create objects with real content.
133    */
134   HYDRODATA_EXPORT HYDROData_IPolyline();
135
136   /**
137    * Destructs properties of the object and object itself, removes it from the document.
138    */
139   HYDRODATA_EXPORT ~HYDROData_IPolyline();
140
141 protected:
142
143   bool myIsOperation;
144 };
145
146 #endif