1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
20 #ifndef PRIMITIVESAPI_BOX_H_
21 #define PRIMITIVESAPI_BOX_H_
23 #include "PrimitivesAPI.h"
25 #include <PrimitivesPlugin_Box.h>
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
30 class ModelHighAPI_Double;
31 class ModelHighAPI_Selection;
33 /// \class PrimitivesAPI_Box
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for primitive Box feature.
36 class PrimitivesAPI_Box: public ModelHighAPI_Interface
39 /// Constructor without values.
41 explicit PrimitivesAPI_Box(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 /// Constructor with values.
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);
50 /// Constructor with values.
52 explicit PrimitivesAPI_Box(const std::shared_ptr<ModelAPI_Feature>& theFeature,
53 const ModelHighAPI_Selection& theFirstPoint,
54 const ModelHighAPI_Selection& theSecondPoint);
58 virtual ~PrimitivesAPI_Box();
60 INTERFACE_6(PrimitivesPlugin_Box::ID(),
61 creationMethod, PrimitivesPlugin_Box::CREATION_METHOD(),
62 ModelAPI_AttributeString, /** Creation method */,
63 dx, PrimitivesPlugin_Box::DX_ID(),
64 ModelAPI_AttributeDouble, /** Dimension in X */,
65 dy, PrimitivesPlugin_Box::DY_ID(),
66 ModelAPI_AttributeDouble, /** Dimension in Y */,
67 dz, PrimitivesPlugin_Box::DZ_ID(),
68 ModelAPI_AttributeDouble, /** Dimension in Z */,
69 firstPoint, PrimitivesPlugin_Box::POINT_FIRST_ID(),
70 ModelAPI_AttributeSelection, /** First point */,
71 secondPoint, PrimitivesPlugin_Box::POINT_SECOND_ID(),
72 ModelAPI_AttributeSelection, /** Second point */)
76 void setDimensions(const ModelHighAPI_Double& theDx,
77 const ModelHighAPI_Double& theDy,
78 const ModelHighAPI_Double& theDz);
82 void setPoints(const ModelHighAPI_Selection& theFirstPoint,
83 const ModelHighAPI_Selection& theSecondPoint);
85 /// Dump wrapped feature
87 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
90 /// Pointer on primitive Box object
91 typedef std::shared_ptr<PrimitivesAPI_Box> BoxPtr;
93 /// \ingroup CPPHighAPI
94 /// \brief Create primitive Box feature.
96 BoxPtr addBox(const std::shared_ptr<ModelAPI_Document>& thePart,
97 const ModelHighAPI_Double& theDx,
98 const ModelHighAPI_Double& theDy,
99 const ModelHighAPI_Double& theDz);
101 /// \ingroup CPPHighAPI
102 /// \brief Create primitive Box feature.
104 BoxPtr addBox(const std::shared_ptr<ModelAPI_Document>& thePart,
105 const ModelHighAPI_Selection& theFirstPoint,
106 const ModelHighAPI_Selection& theSecondPoint);
108 #endif // PRIMITIVESAPI_BOX_H_