Salome HOME
Documentation update
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Box.h
1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D -->
2
3 // File:        PrimitivesAPI_Box.h
4 // Created:     28 June 2016
5 // Author:      Clarisse Genrault (CEA)
6
7 #ifndef PrimitivesAPI_Box_H_
8 #define PrimitivesAPI_Box_H_
9
10 #include "PrimitivesAPI.h"
11
12 #include <PrimitivesPlugin_Box.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Selection;
19
20 /// \class PrimitivesAPI_Box
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for primitive Box feature.
23 class PrimitivesAPI_Box: public ModelHighAPI_Interface
24 {
25 public:
26   /// Constructor without values.
27   PRIMITIVESAPI_EXPORT
28   explicit PrimitivesAPI_Box(const std::shared_ptr<ModelAPI_Feature>& theFeature);
29   
30   /// Constructor with values.
31   PRIMITIVESAPI_EXPORT
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);
36   
37   /// Constructor with values.
38   PRIMITIVESAPI_EXPORT
39   explicit PrimitivesAPI_Box(const std::shared_ptr<ModelAPI_Feature>& theFeature,
40                              const ModelHighAPI_Selection& theFirstPoint,
41                              const ModelHighAPI_Selection& theSecondPoint);
42   
43   /// Destructor.
44   PRIMITIVESAPI_EXPORT
45   virtual ~PrimitivesAPI_Box();
46   
47   INTERFACE_6(PrimitivesPlugin_Box::ID(), 
48              creationMethod, PrimitivesPlugin_Box::CREATION_METHOD(),
49              ModelAPI_AttributeString, /** Creation method */,
50              dx, PrimitivesPlugin_Box::DX_ID(), ModelAPI_AttributeDouble, /** Dimension in X */,
51              dy, PrimitivesPlugin_Box::DY_ID(), ModelAPI_AttributeDouble, /** Dimension in Y */,
52              dz, PrimitivesPlugin_Box::DZ_ID(), ModelAPI_AttributeDouble, /** Dimension in Z */,
53              firstPoint, PrimitivesPlugin_Box::POINT_FIRST_ID(), ModelAPI_AttributeSelection, /** First point */,
54              secondPoint, PrimitivesPlugin_Box::POINT_SECOND_ID(), ModelAPI_AttributeSelection, /** Second point */)
55   
56   /// Set dimensions
57   PRIMITIVESAPI_EXPORT
58   void setDimensions(const ModelHighAPI_Double& theDx,
59                      const ModelHighAPI_Double& theDy,
60                      const ModelHighAPI_Double& theDz);
61   
62   /// Set points
63   PRIMITIVESAPI_EXPORT
64   void setPoints(const ModelHighAPI_Selection& theFirstPoint,
65                  const ModelHighAPI_Selection& theSecondPoint);
66 };
67
68 /// Pointer on primitive Box object
69 typedef std::shared_ptr<PrimitivesAPI_Box> BoxPtr;
70
71 /// \ingroup CPPHighAPI
72 /// \brief Create primitive Box feature.
73 PRIMITIVESAPI_EXPORT
74 BoxPtr addBox(const std::shared_ptr<ModelAPI_Document>& thePart,
75               const ModelHighAPI_Double& theDx,
76               const ModelHighAPI_Double& theDy,
77               const ModelHighAPI_Double& theDz);
78
79 /// \ingroup CPPHighAPI
80 /// \brief Create primitive Box feature.
81 PRIMITIVESAPI_EXPORT
82 BoxPtr addBox(const std::shared_ptr<ModelAPI_Document>& thePart,
83               const ModelHighAPI_Selection& theFirstPoint,
84               const ModelHighAPI_Selection& theSecondPoint);
85
86 #endif // PrimitivesAPI_Box_H_