Version: 9.16.0
CurveCreator_Diff.hxx
Go to the documentation of this file.
1// Copyright (C) 2013-2026 CEA, EDF, 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_Diff.hxx
21// Author: Sergey KHROMOV
22
23#ifndef _CurveCreator_Diff_HeaderFile
24#define _CurveCreator_Diff_HeaderFile
25
27
29
30
38{
39
40private:
41
42public:
43
48
53
61 bool init(const CurveCreator_Curve *theCurve);
62
70 bool init(const CurveCreator_Curve *theCurve,
71 const CurveCreator_Operation::Type theType,
72 const int theIntParam);
73
83 bool init(const CurveCreator_Curve *theCurve,
84 const CurveCreator_Operation::Type theType,
85 const int theIntParam1,
86 const int theIntParam2);
87
95 bool init(const CurveCreator_Curve *theCurve,
96 const CurveCreator_Operation::Type theType,
97 const std::list<int>& theParams);
98
107 bool init(const CurveCreator_Curve *theCurve,
108 const CurveCreator_Operation::Type theType,
109 const std::string& theName,
110 const CurveCreator::Coordinates &theCoords,
111 const int theIntParam1,
112 const int theIntParam2);
113
122 bool init(const CurveCreator_Curve *theCurve,
123 const CurveCreator_Operation::Type theType,
124 const std::string &theName,
125 const int theIntParam1 );
126
135 bool init(const CurveCreator_Curve *theCurve,
136 const CurveCreator_Operation::Type theType,
137 const CurveCreator_ICurve::SectionToPointList &theParamList);
138
147 bool init(const CurveCreator_Curve *theCurve,
148 const CurveCreator_Operation::Type theType,
150
157 bool init(const CurveCreator_Curve *theCurve,
158 const CurveCreator_ICurve::SectionToPointCoordsList &theOldParamList);
159
160
169 bool init(const CurveCreator_Curve *theCurve,
170 const CurveCreator_Operation::Type theType,
171 const int theIntParam1,
172 const int theIntParam2[3]);
173
177 void applyUndo(CurveCreator_Curve *theCurve);
178
182 void applyRedo(CurveCreator_Curve *theCurve);
183
184private:
185
189 void clear();
190
195 void setNbUndos(const int theNbUndos);
196
201 int getSectionIndex(const CurveCreator_Curve *theCurve,
202 const int theIndex) const;
203
209 bool addSectionToUndo(const CurveCreator_Curve *theCurve,
210 const int theIndex,
211 CurveCreator_Operation &theOperation) const;
212
219 bool setTypeOrClosedToUndo(const CurveCreator_Curve *theCurve,
220 const CurveCreator_Operation::Type theType,
221 const int theIntParam1,
222 const int theIntParam2);
223
224private:
225
229
230};
231
232#endif
The CurveCreator_Curve object is represented as one or more sets of connected points; thus CurveCreat...
Definition: CurveCreator_Curve.hxx:51
This is the support class for store/retrieve differences of undo/redo operations.
Definition: CurveCreator_Diff.hxx:38
int getSectionIndex(const CurveCreator_Curve *theCurve, const int theIndex) const
This method returns the section index.
Definition: CurveCreator_Diff.cxx:549
int myNbUndos
Definition: CurveCreator_Diff.hxx:226
CurveCreator_Operation * myPUndo
Definition: CurveCreator_Diff.hxx:227
CurveCreator_Operation * myPRedo
Definition: CurveCreator_Diff.hxx:228
bool addSectionToUndo(const CurveCreator_Curve *theCurve, const int theIndex, CurveCreator_Operation &theOperation) const
Convert theIndex'th section of theCurve into AddSection command and store it in theOperation.
Definition: CurveCreator_Diff.cxx:560
void applyRedo(CurveCreator_Curve *theCurve)
This method applies redo operation to theCurve.
Definition: CurveCreator_Diff.cxx:509
~CurveCreator_Diff()
Destructor.
Definition: CurveCreator_Diff.cxx:45
bool setTypeOrClosedToUndo(const CurveCreator_Curve *theCurve, const CurveCreator_Operation::Type theType, const int theIntParam1, const int theIntParam2)
Construct undos for SetType and SetClosed operations.
Definition: CurveCreator_Diff.cxx:580
void setNbUndos(const int theNbUndos)
This method sets the number of undos and allocates the required space for myPUndo.
Definition: CurveCreator_Diff.cxx:539
bool init(const CurveCreator_Curve *theCurve)
This method initializes the difference with an operation without parameters.
Definition: CurveCreator_Diff.cxx:54
CurveCreator_Diff()
Constructor.
Definition: CurveCreator_Diff.cxx:34
void clear()
This method clears initialized data pointers.
Definition: CurveCreator_Diff.cxx:520
void applyUndo(CurveCreator_Curve *theCurve)
This method applies undo operation to theCurve.
Definition: CurveCreator_Diff.cxx:496
std::deque< SectionToPoint > SectionToPointList
Definition: CurveCreator_ICurve.hxx:76
std::deque< std::pair< SectionToPoint, CurveCreator::Coordinates > > SectionToPointCoordsList
Definition: CurveCreator_ICurve.hxx:78
This is the support class that describes a modification operation that can be applied to CurveCreator...
Definition: CurveCreator_Operation.hxx:41
Type
This is a type of CurveCreator_Curve modification operation.
Definition: CurveCreator_Operation.hxx:49
std::deque< TypeCoord > Coordinates
List of coordinates in format depends on section dimension: 2D: [x1, y1, x2, y2, x3,...
Definition: CurveCreator.hxx:42