X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_Box.h;h=69236954fde73a646293be3cb69de413dda78228;hb=6a8195921a1e4dba54e54f75500d7e8c3a942f46;hp=23bcb8d350c40b66532c8cea836d9c20a069129e;hpb=114b72cd99a3a4be9e851be1c4b271b554808897;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Box.h b/src/GeomAlgoAPI/GeomAlgoAPI_Box.h index 23bcb8d35..69236954f 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Box.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Box.h @@ -1,11 +1,24 @@ -// Copyright (C) 2014-2016 CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// +// 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 #include @@ -16,29 +29,49 @@ */ class GeomAlgoAPI_Box : public GeomAlgoAPI_MakeShape { - public: + public: + /// Type of box operation + enum MethodType { + BOX_DIM, ///< Box with dimensions + BOX_POINTS, ///< Box with points + }; + GEOMALGOAPI_EXPORT GeomAlgoAPI_Box(); - + /// Creates a box using the dimensions. /// \param theDx The dimension on X /// \param theDy The dimension on Y /// \param theDz The dimension on Z GEOMALGOAPI_EXPORT GeomAlgoAPI_Box(const double theDx, const double theDy, const double theDz); - - /// Checks if each dimension "Dx", Dy" and "Dz" for the box construction is OK. + + /// Creates a box using the two points that defined a diagonal. + /// \param theFirstPoint One extermity of the diagonal + /// \param theSecondPoint The other extremity of the diagonal + GEOMALGOAPI_EXPORT GeomAlgoAPI_Box(std::shared_ptr theFirstPoint, + std::shared_ptr theSecondPoint); + + /// Checks if data for the box construction is OK. GEOMALGOAPI_EXPORT bool check(); - - /// Builds the box with the dimensions "Dx", "Dy" and "Dz". + + /// Builds the box. GEOMALGOAPI_EXPORT void build(); - + /// Prepare the naming (redifined because it is specific for a box). GEOMALGOAPI_EXPORT void prepareNamingFaces(); - + private: + /// Builds the box with the dimensions "Dx", "Dy" and "Dz". + void buildWithDimensions(); + /// Builds the box with two points + void buildWithPoints(); + 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 myFirstPoint; /// First point to create a box. + std::shared_ptr mySecondPoint; /// Second point to create a box. + MethodType myMethodType; /// Type of method used. }; -#endif +#endif // GEOMALGOAPI_BOX_H_