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"
29 namespace CurveCreator
31 //! Type of the section
38 //! Dimension of the curve
48 * The CurveCreator_ICurve object is represented as one or more sets of
49 * connected points; thus CurveCreator_ICurve object can contain several
50 * not connected curves (polylines or b-splines), each such curve has two
51 * only ends "start and end points" in other words non-manifold curves
54 class CURVECREATOR_EXPORT CurveCreator_ICurve
57 /***********************************************/
58 /*** Undo/Redo methods ***/
59 /***********************************************/
61 //! Get number of available undo operations
62 virtual int getNbUndo() const = 0;
64 //! Undo previous operation
65 virtual bool undo() = 0;
67 //! Get number of available redo operations
68 virtual int getNbRedo() const = 0;
70 //! Redo last previously "undone" operation
71 virtual bool redo() = 0;
74 /***********************************************/
75 /*** Section methods ***/
76 /***********************************************/
78 //! Clear the polyline (remove all sections)
79 virtual bool clear() = 0;
81 //! Join range of sections to one section (join all sections if -1 is passed in one of arguments)
82 virtual bool join( const int theISectionTo = -1,
83 const int theISectionFrom = -1 ) = 0;
85 //! Get number of sections
86 virtual int getNbSections() const = 0;
88 //! Add a new section.
89 virtual int addSection( const std::string& theName,
90 const CurveCreator::SectionType theType,
91 const bool theIsClosed ) = 0;
93 //! Removes the given sections.
94 virtual bool removeSection( const int theISection ) = 0;
96 //! Get "closed" flag of the specified section
97 virtual bool isClosed( const int theISection ) const = 0;
100 * Set "closed" flag of the specified section (all sections if
101 * \a theISection is -1).
103 virtual bool setClosed( const int theISection,
104 const bool theIsClosed ) = 0;
106 //! Returns specifyed section name
107 virtual std::string getSectionName( const int theISection ) const = 0;
109 /** Set name of the specified section */
110 virtual bool setSectionName( const int theISection,
111 const std::string& theName ) = 0;
113 //! Get type of the specified section
114 virtual CurveCreator::SectionType getSectionType( const int theISection ) const = 0;
117 * Set type of the specified section (or all sections
118 * if \a theISection is -1).
120 virtual bool setSectionType( const int theISection,
121 const CurveCreator::SectionType theType ) = 0;
124 /***********************************************/
125 /*** Point methods ***/
126 /***********************************************/
128 //! Get the dimension.
129 virtual CurveCreator::Dimension getDimension() const = 0;
132 * Insert one or several points to the specified section starting from the given theIPnt index
133 * (or add these at the end of section points if \a theIPnt is -1).
135 virtual bool addPoints( const std::deque<float>& theCoords,
136 const int theISection,
137 const int theIPnt = -1 ) = 0;
139 //! Set coordinates of specified point
140 virtual bool setPoint( const int theISection,
142 const std::deque<float>& theNewCoords ) = 0;
144 //! Remove point with given id
145 virtual bool removePoint( const int theISection, const int theIPnt = -1 ) = 0;
147 //! Get coordinates of specified point
148 virtual std::deque<float> getPoint( const int theISection,
149 const int theIPnt ) const = 0;
152 * Get points of a section (the total points in Curve if theISection is equal to -1)..
154 virtual std::deque<float> getPoints( const int theISection = -1 ) const = 0;
157 * Get number of points in specified section or (the total number of points
158 * in Curve if theISection is equal to -1).
160 virtual int getNbPoints( const int theISection ) const = 0;
163 /***********************************************/
164 /*** Presentation methods ***/
165 /***********************************************/
166 // virtual TopoDS_Wire constructWire() const = 0;