1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D -->
3 // File: PrimitivesAPI_Box.h
4 // Created: 28 June 2016
5 // Author: Clarisse Genrault (CEA)
7 #ifndef PRIMITIVESAPI_BOX_H_
8 #define PRIMITIVESAPI_BOX_H_
10 #include "PrimitivesAPI.h"
12 #include <PrimitivesPlugin_Box.h>
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Selection;
20 /// \class PrimitivesAPI_Box
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for primitive Box feature.
23 class PrimitivesAPI_Box: public ModelHighAPI_Interface
26 /// Constructor without values.
28 explicit PrimitivesAPI_Box(const std::shared_ptr<ModelAPI_Feature>& theFeature);
30 /// Constructor with values.
32 explicit PrimitivesAPI_Box(const std::shared_ptr<ModelAPI_Feature>& theFeature,
33 const ModelHighAPI_Double& theDx,
34 const ModelHighAPI_Double& theDy,
35 const ModelHighAPI_Double& theDz);
37 /// Constructor with values.
39 explicit PrimitivesAPI_Box(const std::shared_ptr<ModelAPI_Feature>& theFeature,
40 const ModelHighAPI_Selection& theFirstPoint,
41 const ModelHighAPI_Selection& theSecondPoint);
45 virtual ~PrimitivesAPI_Box();
47 INTERFACE_6(PrimitivesPlugin_Box::ID(),
48 creationMethod, PrimitivesPlugin_Box::CREATION_METHOD(),
49 ModelAPI_AttributeString, /** Creation method */,
50 dx, PrimitivesPlugin_Box::DX_ID(),
51 ModelAPI_AttributeDouble, /** Dimension in X */,
52 dy, PrimitivesPlugin_Box::DY_ID(),
53 ModelAPI_AttributeDouble, /** Dimension in Y */,
54 dz, PrimitivesPlugin_Box::DZ_ID(),
55 ModelAPI_AttributeDouble, /** Dimension in Z */,
56 firstPoint, PrimitivesPlugin_Box::POINT_FIRST_ID(),
57 ModelAPI_AttributeSelection, /** First point */,
58 secondPoint, PrimitivesPlugin_Box::POINT_SECOND_ID(),
59 ModelAPI_AttributeSelection, /** Second point */)
63 void setDimensions(const ModelHighAPI_Double& theDx,
64 const ModelHighAPI_Double& theDy,
65 const ModelHighAPI_Double& theDz);
69 void setPoints(const ModelHighAPI_Selection& theFirstPoint,
70 const ModelHighAPI_Selection& theSecondPoint);
72 /// Dump wrapped feature
74 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
77 /// Pointer on primitive Box object
78 typedef std::shared_ptr<PrimitivesAPI_Box> BoxPtr;
80 /// \ingroup CPPHighAPI
81 /// \brief Create primitive Box feature.
83 BoxPtr addBox(const std::shared_ptr<ModelAPI_Document>& thePart,
84 const ModelHighAPI_Double& theDx,
85 const ModelHighAPI_Double& theDy,
86 const ModelHighAPI_Double& theDz);
88 /// \ingroup CPPHighAPI
89 /// \brief Create primitive Box feature.
91 BoxPtr addBox(const std::shared_ptr<ModelAPI_Document>& thePart,
92 const ModelHighAPI_Selection& theFirstPoint,
93 const ModelHighAPI_Selection& theSecondPoint);
95 #endif // PRIMITIVESAPI_BOX_H_