1 // Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File: CurveCreator_ICurve.hxx
21 // Author: Alexander KOVALEV and Alexander SOLOVYOV
23 #ifndef _CurveCreator_ICurve_HeaderFile
24 #define _CurveCreator_ICurve_HeaderFile
26 #include "CurveCreator_Macro.hxx"
30 namespace CurveCreator
32 //! Type of the section
39 //! Dimension of the curve
49 * The CurveCreator_ICurve object is represented as one or more sets of
50 * connected points; thus CurveCreator_ICurve object can contain several
51 * not connected curves (polylines or b-splines), each such curve has two
52 * only ends "start and end points" in other words non-manifold curves
55 class CURVECREATOR_EXPORT CurveCreator_ICurve
58 /***********************************************/
59 /*** Undo/Redo methods ***/
60 /***********************************************/
62 //! Get number of available undo operations
63 virtual int getNbUndo() const = 0;
65 //! Undo previous operation
66 virtual bool undo() = 0;
68 //! Get number of available redo operations
69 virtual int getNbRedo() const = 0;
71 //! Redo last previously "undone" operation
72 virtual bool redo() = 0;
75 /***********************************************/
76 /*** Section methods ***/
77 /***********************************************/
79 //! Clear the polyline (remove all sections)
80 virtual bool clear() = 0;
82 //! Join range of sections to one section (join all sections if -1 is passed in one of arguments)
83 virtual bool join( const int theISectionTo = -1,
84 const int theISectionFrom = -1 ) = 0;
86 //! Get number of sections
87 virtual int getNbSections() const = 0;
89 //! Add a new section.
90 virtual int addSection( const std::string& theName,
91 const CurveCreator::SectionType theType,
92 const bool theIsClosed ) = 0;
94 //! Removes the given sections.
95 virtual bool removeSection( const int theISection ) = 0;
97 //! Get "closed" flag of the specified section
98 virtual bool isClosed( const int theISection ) const = 0;
101 * Set "closed" flag of the specified section (all sections if
102 * \a theISection is -1).
104 virtual bool setClosed( const int theISection,
105 const bool theIsClosed ) = 0;
107 //! Returns specifyed section name
108 virtual std::string getSectionName( const int theISection ) const = 0;
110 /** Set name of the specified section */
111 virtual bool setSectionName( const int theISection,
112 const std::string& theName ) = 0;
114 //! Get type of the specified section
115 virtual CurveCreator::SectionType getSectionType( const int theISection ) const = 0;
118 * Set type of the specified section (or all sections
119 * if \a theISection is -1).
121 virtual bool setSectionType( const int theISection,
122 const CurveCreator::SectionType theType ) = 0;
125 /***********************************************/
126 /*** Point methods ***/
127 /***********************************************/
129 //! Get the dimension.
130 virtual CurveCreator::Dimension getDimension() const = 0;
133 * Insert one or several points to the specified section starting from the given theIPnt index
134 * (or add these at the end of section points if \a theIPnt is -1).
136 virtual bool addPoints( const std::deque<float>& theCoords,
137 const int theISection,
138 const int theIPnt = -1 ) = 0;
140 //! Set coordinates of specified point
141 virtual bool setPoint( const int theISection,
143 const std::deque<float>& theNewCoords ) = 0;
145 //! Remove point with given id
146 virtual bool removePoint( const int theISection, const int theIPnt = -1 ) = 0;
148 //! Get coordinates of specified point
149 virtual std::deque<float> getPoint( const int theISection,
150 const int theIPnt ) const = 0;
153 * Get points of a section (the total points in Curve if theISection is equal to -1)..
155 virtual std::deque<float> getPoints( const int theISection = -1 ) const = 0;
158 * Get number of points in specified section or (the total number of points
159 * in Curve if theISection is equal to -1).
161 virtual int getNbPoints( const int theISection ) const = 0;
164 /***********************************************/
165 /*** Presentation methods ***/
166 /***********************************************/
167 // virtual TopoDS_Wire constructWire() const = 0;