1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef HYDROGUI_CurveCreator_Profile_HeaderFile
24 #define HYDROGUI_CurveCreator_Profile_HeaderFile
26 #include "CurveCreator_Curve.hxx"
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
35 class HYDROGUI_CurveCreatorProfile : public CurveCreator_Curve
40 //! Constructor of the curve.
41 HYDROGUI_CurveCreatorProfile();
44 virtual ~HYDROGUI_CurveCreatorProfile();
48 /***********************************************/
49 /*** Section methods ***/
50 /***********************************************/
52 //! For internal use only! Undo/Redo are not used here.
53 virtual bool clearInternal();
55 //! For internal use only! Undo/Redo are not used here.
56 virtual bool joinInternal( const std::list<int>& theSections );
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 );
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);
84 //! For internal use only! Undo/Redo are not used here.
85 virtual bool removeSectionInternal( const int theISection );
87 //! Removes the given sections.
88 virtual bool removeSection( const int theISection );
91 //! For internal use only! Undo/Redo are not used here.
92 virtual bool setClosedInternal( const int theISection,
93 const bool theIsClosed );
95 * Set "closed" flag of the specified section (all sections if
96 * \a theISection is -1).
98 virtual bool setClosed( const int theISection,
99 const bool theIsClosed );
101 /***********************************************/
102 /*** Point methods ***/
103 /***********************************************/
105 //! For internal use only! Undo/Redo are not used here.
106 virtual bool addPointsInternal( const CurveCreator::SectionsMap &theSectionsMap );
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).
111 //! For internal use only! Undo/Redo are not used here.
112 virtual bool setPointInternal( const CurveCreator::SectionsMap &theSectionsMap );
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.
119 virtual bool addPoints( const CurveCreator::Coordinates &theCoords,
120 const int theISection,
121 const int theIPnt = -1 );
124 * Indicates whether the points can be sorted.
126 virtual bool canPointsBeSorted();
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
134 void convert( const CurveCreator::PosPointsList& thePoints,
135 std::list<int>& theConvPoints );