1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Box.h
4 // Created: 17 Mar 2016
5 // Author: Clarisse Genrault (CEA)
7 #ifndef GEOMALGOAPI_BOX_H_
8 #define GEOMALGOAPI_BOX_H_
10 #include <GeomAPI_Pnt.h>
11 #include <GeomAlgoAPI_MakeShape.h>
13 /**\class GeomAlgoAPI_Box
15 * \brief Allows to create Box Primitives
17 class GeomAlgoAPI_Box : public GeomAlgoAPI_MakeShape
20 /// Type of box operation
22 BOX_DIM, ///< Box with dimensions
23 BOX_POINTS, ///< Box with points
26 GEOMALGOAPI_EXPORT GeomAlgoAPI_Box();
28 /// Creates a box using the dimensions.
29 /// \param theDx The dimension on X
30 /// \param theDy The dimension on Y
31 /// \param theDz The dimension on Z
32 GEOMALGOAPI_EXPORT GeomAlgoAPI_Box(const double theDx, const double theDy, const double theDz);
34 /// Creates a box using the two points that defined a diagonal.
35 /// \param theFirstPoint One extermity of the diagonal
36 /// \param theSecondPoint The other extremity of the diagonal
37 GEOMALGOAPI_EXPORT GeomAlgoAPI_Box(std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
38 std::shared_ptr<GeomAPI_Pnt> theSecondPoint);
40 /// Checks if data for the box construction is OK.
41 GEOMALGOAPI_EXPORT bool check();
44 GEOMALGOAPI_EXPORT void build();
46 /// Prepare the naming (redifined because it is specific for a box).
47 GEOMALGOAPI_EXPORT void prepareNamingFaces();
50 /// Builds the box with the dimensions "Dx", "Dy" and "Dz".
51 void buildWithDimensions();
52 /// Builds the box with two points
53 void buildWithPoints();
55 double myDx; /// Dimension on X to create a box.
56 double myDy; /// Dimension on Y to create a box.
57 double myDz; /// Dimension Z to create a box.
58 std::shared_ptr<GeomAPI_Pnt> myFirstPoint; /// First point to create a box.
59 std::shared_ptr<GeomAPI_Pnt> mySecondPoint; /// Second point to create a box.
60 MethodType myMethodType; /// Type of method used.
64 #endif // GEOMALGOAPI_BOX_H_