Salome HOME
Fit All after was added stream selection and displaying in embedded viewer.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CurveCreatorProfile.h
1 // Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef HYDROGUI_CurveCreator_Profile_HeaderFile
24 #define HYDROGUI_CurveCreator_Profile_HeaderFile
25
26 #include "CurveCreator_Curve.hxx"
27
28 /**
29  *  The CurveCreator_Curve object is represented as one or more sets of
30  *  connected points; thus CurveCreator_Curve object can contain several
31  *  not connected curves (polylines or b-splines), each such curve has two
32  *  only ends start and end points in other words non-manifold curves
33  *  are not supported.
34  */
35 class HYDROGUI_CurveCreatorProfile : public CurveCreator_Curve
36 {
37
38 public:
39
40   //! Constructor of the curve.
41   HYDROGUI_CurveCreatorProfile();
42
43   //! Destructor.
44   virtual ~HYDROGUI_CurveCreatorProfile();
45
46 public:
47
48   /***********************************************/
49   /***           Section methods               ***/
50   /***********************************************/
51
52   //! For internal use only! Undo/Redo are not used here.
53   virtual bool clearInternal();
54
55   //! For internal use only! Undo/Redo are not used here.
56   virtual bool joinInternal( const std::list<int>& theSections );
57
58   //! For internal use only! Undo/Redo are not used here.
59   virtual bool moveSectionInternal( const int theISection,
60                                     const int theNewIndex);
61   //! Move section to new position in list
62   virtual bool moveSection( const int theISection,
63                             const int theNewIndex );
64   //! Join list of sections to one section (join all if the list is empty)
65   // The first section in the list is a leader, another sections are joined to it
66   virtual bool join( const std::list<int>& theSections );
67
68   //! For internal use only! Undo/Redo are not used here.
69   virtual int addSectionInternal( const std::string &theName, 
70                                   const CurveCreator::SectionType theType,
71                                   const bool theIsClosed,
72                                   const CurveCreator::Coordinates &thePoints);
73   //! Add a new section.
74   virtual int addSection( const std::string &theName, 
75                            const CurveCreator::SectionType theType,
76                            const bool theIsClosed );
77   //! Add a new section.
78   virtual int addSection( const std::string &theName, 
79                            const CurveCreator::SectionType theType,
80                            const bool theIsClosed,
81                            const CurveCreator::Coordinates &thePoints);
82   
83   
84   //! For internal use only! Undo/Redo are not used here.
85   virtual bool removeSectionInternal( const int theISection );
86
87   //! Removes the given sections.
88   virtual bool removeSection( const int theISection );
89
90   
91   //! For internal use only! Undo/Redo are not used here.
92   virtual bool setClosedInternal( const int theISection, 
93                                   const bool theIsClosed );
94   /**
95    *  Set "closed" flag of the specified section (all sections if
96    *  \a theISection is -1).
97    */
98   virtual bool setClosed( const int theISection, 
99                           const bool theIsClosed );
100
101   /***********************************************/
102   /***           Point methods                 ***/
103   /***********************************************/
104
105   //! For internal use only! Undo/Redo are not used here.
106   virtual bool addPointsInternal( const CurveCreator::SectionsMap &theSectionsMap );
107   /**
108    *  Add one point to the specified section starting from the given theIPnt index
109    *  (or at the end of points if \a theIPnt is -1).
110    */
111   //! For internal use only! Undo/Redo are not used here.
112   virtual bool setPointInternal( const CurveCreator::SectionsMap &theSectionsMap );
113
114   /**
115    *  Add one point to the specified section starting from the given theIPnt index.
116    *  Contrary to CurveCreator_Curve::addPoints(...) if \a theIPnt is -1 the right index
117    *  will be calculated automatically in accordance with X coordinate value of the point.
118    */
119   virtual bool addPoints( const CurveCreator::Coordinates &theCoords,
120                           const int theISection,
121                           const int theIPnt = -1 );
122
123   /**
124    * Indicates whether the points can be sorted.
125    */
126   virtual bool canPointsBeSorted();
127
128 protected:
129   /**
130    * Converts the list of custom point position objects into a list of point indices
131    * \param thePoints an source list
132    * \param theConvPoints a converted list
133    */
134   void convert( const CurveCreator::PosPointsList& thePoints,
135                 std::list<int>& theConvPoints );
136
137 };
138
139 #endif