Salome HOME
Merging with V7_main branch.
[modules/hydro.git] / src / HYDROData / HYDROData_ProfileUZ.h
1
2 #ifndef HYDROData_ProfileUZ_HeaderFile
3 #define HYDROData_ProfileUZ_HeaderFile
4
5 #include "HYDROData_IPolyline.h"
6
7 DEFINE_STANDARD_HANDLE(HYDROData_ProfileUZ, HYDROData_IPolyline)
8
9 /**\class HYDROData_ProfileUZ
10  * \brief Class that stores/retreives information about the 
11  *        parametric profile points.
12  */
13 class HYDROData_ProfileUZ : public HYDROData_IPolyline
14 {
15 protected:
16   /**
17    * Enumeration of tags corresponding to the persistent object parameters.
18    */
19   enum DataTag
20   {
21     DataTag_First = HYDROData_IPolyline::DataTag_First + 100, ///< first tag, to reserve
22   };
23
24 public:
25   DEFINE_STANDARD_RTTI(HYDROData_ProfileUZ);
26
27
28   /**
29    * Returns the kind of this object. Must be redefined in all objects of known type.
30    */
31   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_PROFILEUZ;}
32
33
34 public:
35
36   // Implementation of IPolyline interface
37
38   /**
39    * Returns the 3D presentation of all points.
40    */
41   HYDRODATA_EXPORT virtual ListAISObjects constructWire() const;
42
43 public:
44
45   // Implementation of ICurve interface
46
47
48   /***********************************************/
49   /***           Section methods               ***/
50   /***********************************************/
51
52   //! Clear the polyline (remove all sections)
53   HYDRODATA_EXPORT virtual bool clear();
54
55   //! Join range of sections to one section (join all sections if -1 is passed in one of arguments)
56   HYDRODATA_EXPORT virtual bool join( const int theISectionTo = -1, 
57                                       const int theISectionFrom = -1 );
58
59   //! Get number of sections
60   HYDRODATA_EXPORT virtual int getNbSections() const;
61
62   //! Add a new section.
63   HYDRODATA_EXPORT virtual int addSection( const std::string&              theName, 
64                                            const CurveCreator::SectionType theType,
65                                            const bool                      theIsClosed );
66
67   //! Removes the given sections.
68   HYDRODATA_EXPORT virtual bool removeSection( const int theISection );
69
70   //! Get "closed" flag of the specified section
71   HYDRODATA_EXPORT virtual bool isClosed( const int theISection ) const;
72
73   /**
74    *  Set "closed" flag of the specified section (all sections if
75    *  \a theISection is -1).
76    */
77   HYDRODATA_EXPORT virtual bool setClosed( const int  theISection, 
78                                            const bool theIsClosed );
79
80   //! Returns specifyed section name
81   HYDRODATA_EXPORT virtual std::string getSectionName( const int theISection ) const;
82
83   /** Set name of the specified section */
84   HYDRODATA_EXPORT virtual bool setSectionName( const int          theISection, 
85                                                 const std::string& theName );
86
87   //! Get type of the specified section
88   HYDRODATA_EXPORT virtual CurveCreator::SectionType getSectionType( const int theISection ) const;
89
90   /**
91    *  Set type of the specified section (or all sections
92    *  if \a theISection is -1).
93    */
94   HYDRODATA_EXPORT virtual bool setSectionType( const int                       theISection, 
95                                                 const CurveCreator::SectionType theType );
96
97
98   /***********************************************/
99   /***           Point methods                 ***/
100   /***********************************************/
101
102   /**
103    *  Insert one or several points to the specified section starting from the given theIPnt index
104    *  (or add these at the end of section points if \a theIPnt is -1).
105    */
106   HYDRODATA_EXPORT virtual bool addPoints( const CurveCreator::Coordinates& theCoords,
107                                            const int                        theISection,
108                                            const int                        theIPnt = -1 );
109
110   //! Set coordinates of specified point
111   HYDRODATA_EXPORT virtual bool setPoint( const int                        theISection,
112                                           const int                        theIPnt,
113                                           const CurveCreator::Coordinates& theCoords );
114
115   //! Remove point with given id
116   HYDRODATA_EXPORT virtual bool removePoint( const int theISection, const int theIPnt = -1 );
117
118   /**
119    * Get points of a section (the total points in Curve if theISection is equal to -1)..
120    */
121   HYDRODATA_EXPORT virtual CurveCreator::Coordinates getPoints( const int theISection = -1 ) const;
122
123 protected:
124
125   /**
126    *  Insert point to the specified section after the given theIPnt index.
127    *  (or add these at the end of section points if \a theIPnt is -1).
128    */
129   HYDRODATA_EXPORT virtual bool addPoint( 
130     const CurveCreator::TypeCoord& theCoordX,
131     const CurveCreator::TypeCoord& theCoordY,
132     const int                      theISection,
133     const int                      theIPnt = -1 );
134
135 protected:
136
137   friend class HYDROData_Profile;
138   friend class HYDROData_Iterator;
139
140   /**
141    * Creates new object in the internal data structure. Use higher level objects 
142    * to create objects with real content.
143    */
144   HYDRODATA_EXPORT HYDROData_ProfileUZ();
145
146   /**
147    * Destructs properties of the object and object itself, removes it from the document.
148    */
149   HYDRODATA_EXPORT ~HYDROData_ProfileUZ();
150 };
151
152 #endif