1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File: CurveCreator_Operation.hxx
24 // Created: Wed Jun 26 13:06:51 2013
25 // Author: Sergey KHROMOV
28 #ifndef _CurveCreator_Operation_HeaderFile
29 #define _CurveCreator_Operation_HeaderFile
32 #include <CurveCreator.hxx>
34 class CurveCreator_Curve;
38 * This is the support class that describes a modification operation that
39 * can be applied to CurveCreator_Curve.
41 class CurveCreator_Operation
47 * This is a type of CurveCreator_Curve modification operation.
51 Unknown = 0, //!< Unknown method.
52 AddPoints, //!< Method CurveCreator_Curve::addPoints
53 RemovePoints, //!< Method CurveCreator_Curve::removePoints
54 InsertPoints, //!< Method CurveCreator_Curve::insertPoints
55 SetType, //!< Method CurveCreator_Curve::setType
56 Clear, //!< Method CurveCreator_Curve::clear
57 SetCoordinates, //!< Method CurveCreator_Curve::setCoordinates
58 SetClosed, //!< Method CurveCreator_Curve::setClosed
59 MoveSection, //!< Method CurveCreator_Curve::moveSection
60 Join, //!< Method CurveCreator_Curve::join
61 AddSection, //!< Method CurveCreator_Curve::addSection
62 RemoveSection, //!< Method CurveCreator_Curve::removeSection
63 RenameCurve //!< Method CurveCreator_Curve::renameCurve
69 CurveCreator_Operation();
74 ~CurveCreator_Operation();
77 * This method initializes the object with an operation without parameters.
78 * It is applicable to the following operations:
81 * <LI>Join (without arguments)</LI>
83 * @return true in case of success; false otherwise.
85 bool init(const Type theType);
88 * This method initializes the object with an operation with one integer
89 * parameter. It is applicable to the following operations:
91 * <LI>RemoveSection</LI>
93 * @return true in case of success; false otherwise.
95 bool init(const Type theType, const int theIntParam);
98 * This method initializes the object with an operation with two integer
99 * parameters. It is applicable to the following operations:
103 * <LI>MoveSection</LI>
104 * <LI>Join (with 2 int arguments)</LI>
106 * @return true in case of success; false otherwise.
108 bool init(const Type theType, const int theIntParam1,
109 const int theIntParam2);
112 * This method initializes the object with an operation with three integer
113 * parameters. It is applicable to the following operations:
115 * <LI>RemovePoints</LI>
117 * @return true in case of success; false otherwise.
119 bool init(const Type theType, const int theIntParam1,
120 const int theIntParam2, const int theIntParam3);
123 * This method initializes the object with an operation with one
124 * CurveCreator::Coordinates parameter and one integer parameter.
125 * It is applicable to the following operations:
129 * @return true in case of success; false otherwise.
131 bool init(const Type theType, const CurveCreator::Coordinates &theCoords,
132 const int theIntParam);
135 * This method initializes the object with an operation with one
136 * CurveCreator::Coordinates parameter and two integer parameters.
137 * It is applicable to the following operations:
139 * <LI>AddSection</LI>
140 * <LI>InsertPoints</LI>
141 * <LI>SetCoordinates</LI>
143 * @return true in case of success; false otherwise.
145 bool init(const Type theType, const CurveCreator::Coordinates &theCoords,
146 const int theIntParam1, const int theIntParam2);
149 * This method applies the current operation to theCurve.
151 void apply(CurveCreator_Curve *theCurve);
156 * This method allocates required memory for the operation data.
157 * Returns myPData for convenience purpose.
159 void *allocate(const size_t theSize);
162 * This method clears initialized data pointers.
167 * This method returns the coordinates read from thePInt.
169 void getCoords(int *thePInt, CurveCreator::Coordinates &theCoords) const;