SHAPER  9.12.0
PrimitivesAPI_Box.h
1 // Copyright (C) 2014-2023 CEA, EDF
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 #ifndef PRIMITIVESAPI_BOX_H_
21 #define PRIMITIVESAPI_BOX_H_
22 
23 #include "PrimitivesAPI.h"
24 
25 #include <PrimitivesPlugin_Box.h>
26 
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
29 
32 
37 {
38 public:
40  PRIMITIVESAPI_EXPORT
41  explicit PrimitivesAPI_Box(const std::shared_ptr<ModelAPI_Feature>& theFeature);
42 
44  PRIMITIVESAPI_EXPORT
45  explicit PrimitivesAPI_Box(const std::shared_ptr<ModelAPI_Feature>& theFeature,
46  const ModelHighAPI_Double& theDx,
47  const ModelHighAPI_Double& theDy,
48  const ModelHighAPI_Double& theDz);
49 
51  PRIMITIVESAPI_EXPORT
52  explicit PrimitivesAPI_Box(const std::shared_ptr<ModelAPI_Feature>& theFeature,
53  const ModelHighAPI_Selection& theFirstPoint,
54  const ModelHighAPI_Selection& theSecondPoint);
55 
57  PRIMITIVESAPI_EXPORT
58  explicit PrimitivesAPI_Box(const std::shared_ptr<ModelAPI_Feature>& theFeature,
59  const ModelHighAPI_Double& theOx,
60  const ModelHighAPI_Double& theOy,
61  const ModelHighAPI_Double& theOz,
62  const ModelHighAPI_Double& theHalfX,
63  const ModelHighAPI_Double& theHalfY,
64  const ModelHighAPI_Double& theHalfZ);
65 
67  PRIMITIVESAPI_EXPORT
68  virtual ~PrimitivesAPI_Box();
69 
70  INTERFACE_12(PrimitivesPlugin_Box::ID(),
95 
96 
97  PRIMITIVESAPI_EXPORT
98  void setDimensions(const ModelHighAPI_Double& theDx,
99  const ModelHighAPI_Double& theDy,
100  const ModelHighAPI_Double& theDz);
101 
103  PRIMITIVESAPI_EXPORT
104  void setPoints(const ModelHighAPI_Selection& theFirstPoint,
105  const ModelHighAPI_Selection& theSecondPoint);
106 
108  PRIMITIVESAPI_EXPORT
109  void setOrigin(const ModelHighAPI_Double& theOx,
110  const ModelHighAPI_Double& theOy,
111  const ModelHighAPI_Double& theOz);
112 
114  PRIMITIVESAPI_EXPORT
115  void setHalfLengths(const ModelHighAPI_Double& theHalfLengthX,
116  const ModelHighAPI_Double& theHalfLengthY,
117  const ModelHighAPI_Double& theHalfLengthZ);
118 
120  PRIMITIVESAPI_EXPORT
121  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
122 };
123 
125 typedef std::shared_ptr<PrimitivesAPI_Box> BoxPtr;
126 
129 PRIMITIVESAPI_EXPORT
130 BoxPtr addBox(const std::shared_ptr<ModelAPI_Document>& thePart,
131  const ModelHighAPI_Double& theDx,
132  const ModelHighAPI_Double& theDy,
133  const ModelHighAPI_Double& theDz);
134 
137 PRIMITIVESAPI_EXPORT
138 BoxPtr addBox(const std::shared_ptr<ModelAPI_Document>& thePart,
139  const ModelHighAPI_Selection& theFirstPoint,
140  const ModelHighAPI_Selection& theSecondPoint);
141 
144 PRIMITIVESAPI_EXPORT
145 BoxPtr addBox(const std::shared_ptr<ModelAPI_Document>& thePart,
146  const ModelHighAPI_Double& theOx,
147  const ModelHighAPI_Double& theOy,
148  const ModelHighAPI_Double& theOz,
149  const ModelHighAPI_Double& theHalfLengthX,
150  const ModelHighAPI_Double& theHalfLengthY,
151  const ModelHighAPI_Double& theHalfLengthZ);
152 
153 #endif // PRIMITIVESAPI_BOX_H_
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: ModelAPI_AttributeSelection.h:35
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
Document for internal data structure of any object storage.
Definition: ModelAPI_Document.h:52
Class for filling ModelAPI_AttributeDouble.
Definition: ModelHighAPI_Double.h:37
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:42
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
Interface for primitive Box feature.
Definition: PrimitivesAPI_Box.h:37
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: PrimitivesAPI_Box.cpp:131
virtual std::shared_ptr< ModelAPI_AttributeDouble > oz() const
Z coordinate for origin.
Definition: PrimitivesAPI_Box.h:94
virtual std::shared_ptr< ModelAPI_AttributeDouble > dz() const
Dimension in Z.
Definition: PrimitivesAPI_Box.h:94
void setHalfLengths(const ModelHighAPI_Double &theHalfLengthX, const ModelHighAPI_Double &theHalfLengthY, const ModelHighAPI_Double &theHalfLengthZ)
Set half lengths.
Definition: PrimitivesAPI_Box.cpp:119
virtual std::shared_ptr< ModelAPI_AttributeDouble > halfdz() const
Half length in Z.
Definition: PrimitivesAPI_Box.h:94
virtual std::shared_ptr< ModelAPI_AttributeDouble > halfdx() const
Half length in X.
Definition: PrimitivesAPI_Box.h:94
virtual std::shared_ptr< ModelAPI_AttributeSelection > secondPoint() const
Second point.
Definition: PrimitivesAPI_Box.h:94
virtual std::shared_ptr< ModelAPI_AttributeDouble > dy() const
Dimension in Y.
Definition: PrimitivesAPI_Box.h:94
virtual std::shared_ptr< ModelAPI_AttributeDouble > halfdy() const
Half length in Y.
Definition: PrimitivesAPI_Box.h:94
virtual std::shared_ptr< ModelAPI_AttributeDouble > oy() const
Y coordinate for origin.
Definition: PrimitivesAPI_Box.h:94
virtual std::shared_ptr< ModelAPI_AttributeSelection > firstPoint() const
First point.
Definition: PrimitivesAPI_Box.h:94
void setPoints(const ModelHighAPI_Selection &theFirstPoint, const ModelHighAPI_Selection &theSecondPoint)
Set points.
Definition: PrimitivesAPI_Box.cpp:96
virtual std::shared_ptr< ModelAPI_AttributeDouble > ox() const
X coordinate for origin.
Definition: PrimitivesAPI_Box.h:94
void setDimensions(const ModelHighAPI_Double &theDx, const ModelHighAPI_Double &theDy, const ModelHighAPI_Double &theDz)
Set dimensions.
Definition: PrimitivesAPI_Box.cpp:83
PrimitivesAPI_Box(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: PrimitivesAPI_Box.cpp:26
virtual std::shared_ptr< ModelAPI_AttributeDouble > dx() const
Dimension in X.
Definition: PrimitivesAPI_Box.h:94
virtual std::shared_ptr< ModelAPI_AttributeString > creationMethod() const
Creation method.
Definition: PrimitivesAPI_Box.h:94
void setOrigin(const ModelHighAPI_Double &theOx, const ModelHighAPI_Double &theOy, const ModelHighAPI_Double &theOz)
Set origin point.
Definition: PrimitivesAPI_Box.cpp:107
virtual ~PrimitivesAPI_Box()
Destructor.
Definition: PrimitivesAPI_Box.cpp:77
static const std::string & OZ_ID()
Attribute name of the third coordinate of the center.
Definition: PrimitivesPlugin_Box.h:127
static const std::string & OX_ID()
Attribute name of the first coordinate of the center.
Definition: PrimitivesPlugin_Box.h:113
static const std::string & ID()
Box kind.
Definition: PrimitivesPlugin_Box.h:43
static const std::string & CREATION_METHOD()
Attribute name for creation method.
Definition: PrimitivesPlugin_Box.h:50
static const std::string & DY_ID()
Attribute second coordinate.
Definition: PrimitivesPlugin_Box.h:99
static const std::string & OY_ID()
Attribute name of the second coordinate of the center.
Definition: PrimitivesPlugin_Box.h:120
static const std::string & DZ_ID()
Attribute third coordinate.
Definition: PrimitivesPlugin_Box.h:106
static const std::string & HALF_DY_ID()
Attribute name of the half-length on Y axis.
Definition: PrimitivesPlugin_Box.h:141
static const std::string & DX_ID()
Attribute first coordinate.
Definition: PrimitivesPlugin_Box.h:92
static const std::string & HALF_DX_ID()
Attribute name of the half-length on X axis.
Definition: PrimitivesPlugin_Box.h:134
static const std::string & HALF_DZ_ID()
Attribute name of the half-length on Z axis.
Definition: PrimitivesPlugin_Box.h:148
static const std::string & POINT_SECOND_ID()
Attribute name of second point.
Definition: PrimitivesPlugin_Box.h:85
static const std::string & POINT_FIRST_ID()
Attribute name of first point.
Definition: PrimitivesPlugin_Box.h:78
BoxPtr addBox(const std::shared_ptr< ModelAPI_Document > &thePart, const ModelHighAPI_Double &theDx, const ModelHighAPI_Double &theDy, const ModelHighAPI_Double &theDz)
Create primitive Box feature.
Definition: PrimitivesAPI_Box.cpp:167