Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CurveCreator_ICurve.hxx
Go to the documentation of this file.
1 // Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
2 //
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, or (at your option) any later version.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 // File: CurveCreator_ICurve.hxx
21 // Author: Alexander KOVALEV and Alexander SOLOVYOV
22 
23 #ifndef _CurveCreator_ICurve_HeaderFile
24 #define _CurveCreator_ICurve_HeaderFile
25 
26 #include "CurveCreator.hxx"
27 #include "CurveCreator_Macro.hxx"
28 
29 #include <TColgp_HArray1OfPnt.hxx>
30 #include <AIS_InteractiveObject.hxx>
31 
32 #include <deque>
33 #include <vector>
34 #include <string>
35 #include <list>
36 
37 namespace CurveCreator
38 {
41  {
44  };
45 
47  enum Dimension
48  {
49  Dim2d = 2,
50  Dim3d = 3
51  };
52 
53 };
54 
57 {
60 
62  virtual void GetDifferentPoints(
63  const int theDimension, Handle(TColgp_HArray1OfPnt)& thePoints) const = 0;
64 };
65 
74 {
75 public:
76  typedef std::pair<int,int> SectionToPoint;
77  typedef std::deque<SectionToPoint> SectionToPointList;
78 
79  typedef std::deque< std::pair< SectionToPoint, CurveCreator::Coordinates > > SectionToPointCoordsList;
80 
81 public:
82  /***********************************************/
83  /*** Undo/Redo methods ***/
84  /***********************************************/
85 
87  virtual ~CurveCreator_ICurve() {}
88 
90  virtual int getNbUndo() const = 0;
91 
93  virtual bool undo() = 0;
94 
96  virtual int getNbRedo() const = 0;
97 
99  virtual bool redo() = 0;
100 
101 
102  /***********************************************/
103  /*** Section methods ***/
104  /***********************************************/
105 
107  virtual bool clear() = 0;
108 
110  // The first section in the list is a leader, another sections are joined to it
111  virtual bool join( const std::list<int>& theSections ) = 0;
112 
114  virtual int getNbSections() const = 0;
115 
117  virtual int addSection( const std::string& theName,
118  const CurveCreator::SectionType theType,
119  const bool theIsClosed ) = 0;
120 
122  virtual bool removeSection( const int theISection ) = 0;
123 
125  virtual bool isClosed( const int theISection ) const = 0;
126 
131  virtual bool setClosed( const int theISection,
132  const bool theIsClosed ) = 0;
133 
135  virtual std::string getSectionName( const int theISection ) const = 0;
136 
138  virtual bool setSectionName( const int theISection,
139  const std::string& theName ) = 0;
140 
142  virtual CurveCreator::SectionType getSectionType( const int theISection ) const = 0;
143 
148  virtual bool setSectionType( const int theISection,
149  const CurveCreator::SectionType theType ) = 0;
150 
152  virtual const CurveCreator_ISection* getSection(
153  const int theSectionIndex) const = 0;
154 
156  virtual CurveCreator_ISection* getSection(const int theSectionIndex) = 0;
157 
158 
159  /***********************************************/
160  /*** Point methods ***/
161  /***********************************************/
162 
164  virtual CurveCreator::Dimension getDimension() const = 0;
165 
170  virtual bool addPoints( const CurveCreator::Coordinates& theCoords,
171  const int theISection,
172  const int theIPnt = -1 ) = 0;
173 
175  virtual bool setPoint( const int theISection,
176  const int theIPnt,
177  const CurveCreator::Coordinates& theNewCoords ) = 0;
178 
180  virtual bool setSeveralPoints( const SectionToPointCoordsList &theSectionToPntCoords,
181  const bool theIsToSaveDiff = true ) = 0;
182 
184  virtual bool removePoint( const int theISection, const int theIPnt = -1 ) = 0;
186  virtual bool removeSeveralPoints( const SectionToPointList &theSectionToPntIDs) = 0;
187 
189  virtual CurveCreator::Coordinates getPoint( const int theISection,
190  const int theIPnt ) const = 0;
191 
195  virtual CurveCreator::Coordinates getPoints( const int theISection = -1 ) const = 0;
196 
201  virtual int getNbPoints( const int theISection ) const = 0;
202 
206  virtual void setSkipSorting( const bool ) = 0;
207 
211  virtual bool canPointsBeSorted() = 0;
212 
217  virtual void saveCoordDiff( const SectionToPointCoordsList &theOldCoords ) = 0;
218 
219  /***********************************************/
220  /*** Presentation methods ***/
221  /***********************************************/
222 
223  virtual Handle(AIS_InteractiveObject) getAISObject( const bool theNeedToBuild = false ) const = 0;
224 
225 protected:
226  virtual void constructAISObject() = 0;
227 
228 };
229 
230 #endif