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
68 CurveCreator_Operation();
73 ~CurveCreator_Operation();
76 * This method initializes the object with an operation without parameters.
77 * It is applicable to the following operations:
80 * <LI>Join (without arguments)</LI>
82 * @return true in case of success; false otherwise.
84 bool init(const Type theType);
87 * This method initializes the object with an operation with one integer
88 * parameter. It is applicable to the following operations:
90 * <LI>RemoveSection</LI>
92 * @return true in case of success; false otherwise.
94 bool init(const Type theType, const int theIntParam);
97 * This method initializes the object with an operation with two integer
98 * parameters. It is applicable to the following operations:
102 * <LI>MoveSection</LI>
103 * <LI>Join (with 2 int arguments)</LI>
105 * @return true in case of success; false otherwise.
107 bool init(const Type theType, const int theIntParam1,
108 const int theIntParam2);
111 * This method initializes the object with an operation with three integer
112 * parameters. It is applicable to the following operations:
114 * <LI>RemovePoints</LI>
116 * @return true in case of success; false otherwise.
118 bool init(const Type theType, const int theIntParam1,
119 const int theIntParam2, const int theIntParam3);
122 * This method initializes the object with an operation with one
123 * CurveCreator::Coordinates parameter and one integer parameter.
124 * It is applicable to the following operations:
128 * @return true in case of success; false otherwise.
130 bool init(const Type theType, const CurveCreator::Coordinates &theCoords,
131 const int theIntParam);
134 * This method initializes the object with an operation with one
135 * CurveCreator::Coordinates parameter and two integer parameters.
136 * It is applicable to the following operations:
138 * <LI>AddSection</LI>
139 * <LI>InsertPoints</LI>
140 * <LI>SetCoordinates</LI>
142 * @return true in case of success; false otherwise.
144 bool init(const Type theType, const CurveCreator::Coordinates &theCoords,
145 const int theIntParam1, const int theIntParam2);
148 * This method applies the current operation to theCurve.
150 void apply(CurveCreator_Curve *theCurve);
155 * This method allocates required memory for the operation data.
156 * Returns myPData for convenience purpose.
158 void *allocate(const size_t theSize);
161 * This method clears initialized data pointers.
166 * This method returns the coordinates read from thePInt.
168 void getCoords(int *thePInt, CurveCreator::Coordinates &theCoords) const;