Salome HOME
updated copyright message
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Box.h
index c47af8b464356c7cf970613c63946d0232972d74..ea8a9674fba87e46f7ed1e5beab26994eb687f69 100644 (file)
@@ -1,11 +1,24 @@
-// Copyright (C) 2014-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
-// File:        GeomAlgoAPI_Box.h
-// Created:     17 Mar 2016
-// Author:      Clarisse Genrault (CEA)
-
-#ifndef GeomAlgoAPI_Box_H_
-#define GeomAlgoAPI_Box_H_
+#ifndef GEOMALGOAPI_BOX_H_
+#define GEOMALGOAPI_BOX_H_
 
 #include <GeomAPI_Pnt.h>
 #include <GeomAlgoAPI_MakeShape.h>
@@ -21,6 +34,7 @@ class GeomAlgoAPI_Box : public GeomAlgoAPI_MakeShape
   enum MethodType {
     BOX_DIM,   ///< Box with dimensions
     BOX_POINTS,  ///< Box with points
+    BOX_POINT_DIMS, ///<Box with coordinates of a point and dimensions
   };
 
   GEOMALGOAPI_EXPORT GeomAlgoAPI_Box();
@@ -37,6 +51,16 @@ class GeomAlgoAPI_Box : public GeomAlgoAPI_MakeShape
   GEOMALGOAPI_EXPORT GeomAlgoAPI_Box(std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
                                      std::shared_ptr<GeomAPI_Pnt> theSecondPoint);
 
+  /// Creates a box using coordinates of a point (the center of gravity) andthe dimensions.
+  /// \param theOx The X coordinate of the point
+  /// \param theOy The Y coordinate of the point
+  /// \param theOz The Z coordinate of the point
+  /// \param theDx The dimension on X
+  /// \param theDy The dimension on Y
+  /// \param theDz The dimension on Z
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Box(const double theOx, const double theOy, const double theOz,
+                                     const double theDx, const double theDy, const double theDz);
+
   /// Checks if data for the box construction is OK.
   GEOMALGOAPI_EXPORT bool check();
 
@@ -51,14 +75,20 @@ class GeomAlgoAPI_Box : public GeomAlgoAPI_MakeShape
   void buildWithDimensions();
   /// Builds the box with two points
   void buildWithPoints();
+  /// Buils the box with coordinates of a point and dimensions
+  void buildWithPointAndDims();
 
+  double myOx; /// X coordinate of the point to create a box.
+  double myOy; /// Y coordinate of the point to create a box.
+  double myOz; /// Z coordinate of the point to create a box.
   double myDx; /// Dimension on X to create a box.
   double myDy; /// Dimension on Y to create a box.
   double myDz; /// Dimension Z to create a box.
   std::shared_ptr<GeomAPI_Pnt> myFirstPoint; /// First point to create a box.
   std::shared_ptr<GeomAPI_Pnt> mySecondPoint; /// Second point to create a box.
   MethodType myMethodType; /// Type of method used.
+  std::string headError; /// Head of the error message according to the method
 };
 
 
-#endif
+#endif // GEOMALGOAPI_BOX_H_