1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef HYDROGUI_CurveCreator_Profile_HeaderFile
20 #define HYDROGUI_CurveCreator_Profile_HeaderFile
22 #include "CurveCreator_Curve.hxx"
23 #include <Quantity_Color.hxx>
26 * The CurveCreator_Curve object is represented as one or more sets of
27 * connected points; thus CurveCreator_Curve object can contain several
28 * not connected curves (polylines or b-splines), each such curve has two
29 * only ends start and end points in other words non-manifold curves
32 class HYDROGUI_CurveCreatorProfile : public CurveCreator_Curve
37 //! Constructor of the curve.
38 HYDROGUI_CurveCreatorProfile();
41 virtual ~HYDROGUI_CurveCreatorProfile();
45 /***********************************************/
46 /*** Section methods ***/
47 /***********************************************/
49 //! For internal use only! Undo/Redo are not used here.
50 virtual bool clearInternal();
52 //! For internal use only! Undo/Redo are not used here.
53 virtual bool joinInternal( const std::list<int>& theSections );
55 //! For internal use only! Undo/Redo are not used here.
56 virtual bool moveSectionInternal( const int theISection,
57 const int theNewIndex);
58 //! Move section to new position in list
59 virtual bool moveSection( const int theISection,
60 const int theNewIndex );
61 //! Join list of sections to one section (join all if the list is empty)
62 // The first section in the list is a leader, another sections are joined to it
63 virtual bool join( const std::list<int>& theSections );
65 //! For internal use only! Undo/Redo are not used here.
66 virtual int addSectionInternal( const std::string &theName,
67 const CurveCreator::SectionType theType,
68 const bool theIsClosed,
69 const CurveCreator::Coordinates &thePoints);
70 //! Add a new section.
71 virtual int addSection( const std::string &theName,
72 const CurveCreator::SectionType theType,
73 const bool theIsClosed );
74 //! Add a new section.
75 virtual int addSection( const std::string &theName,
76 const CurveCreator::SectionType theType,
77 const bool theIsClosed,
78 const CurveCreator::Coordinates &thePoints);
81 //! For internal use only! Undo/Redo are not used here.
82 virtual bool removeSectionInternal( const int theISection );
84 //! Removes the given sections.
85 virtual bool removeSection( const int theISection );
88 //! For internal use only! Undo/Redo are not used here.
89 virtual bool setClosedInternal( const int theISection,
90 const bool theIsClosed );
92 * Set "closed" flag of the specified section (all sections if
93 * \a theISection is -1).
95 virtual bool setClosed( const int theISection,
96 const bool theIsClosed );
98 /***********************************************/
99 /*** Point methods ***/
100 /***********************************************/
102 //! For internal use only! Undo/Redo are not used here.
103 virtual bool addPointsInternal( const CurveCreator::SectionsMap &theSectionsMap );
105 * Add one point to the specified section starting from the given theIPnt index
106 * (or at the end of points if \a theIPnt is -1).
108 //! For internal use only! Undo/Redo are not used here.
109 virtual bool setPointInternal( const CurveCreator::SectionsMap &theSectionsMap );
112 * Add one point to the specified section starting from the given theIPnt index.
113 * Contrary to CurveCreator_Curve::addPoints(...) if \a theIPnt is -1 the right index
114 * will be calculated automatically in accordance with X coordinate value of the point.
116 virtual bool addPoints( const CurveCreator::Coordinates &theCoords,
117 const int theISection,
118 const int theIPnt = -1 );
120 * Indicates whether the points can be sorted.
122 virtual bool canPointsBeSorted();
124 virtual Handle(TColgp_HArray1OfPnt) GetDifferentPoints( int theISection = -1 ) const;
128 * Converts the list of custom point position objects into a list of point indices
129 * \param thePoints an source list
130 * \param theConvPoints a converted list
132 void convert( const CurveCreator::PosPointsList& thePoints,
133 std::list<int>& theConvPoints );
135 //virtual void constructAISObject();
137 Quantity_Color myCurveColor;