From: Clarisse Genrault Date: Fri, 1 Jul 2016 10:09:49 +0000 (+0200) Subject: Renaming the direct API high level. X-Git-Tag: V_2.5.0~221 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7311abb70485616ce87c3589f0d1b5e8f20e728a;p=modules%2Fshaper.git Renaming the direct API high level. --- diff --git a/src/GeomAlgoAPI/CMakeLists.txt b/src/GeomAlgoAPI/CMakeLists.txt index ee42e2a90..bb0ce3fe4 100644 --- a/src/GeomAlgoAPI/CMakeLists.txt +++ b/src/GeomAlgoAPI/CMakeLists.txt @@ -39,7 +39,7 @@ SET(PROJECT_HEADERS GeomAlgoAPI_WireBuilder.h GeomAlgoAPI_Sewing.h GeomAlgoAPI_ShapeBuilder.h - GeomAlgoAPI_DirectAPI.h + GeomAlgoAPI_ShapeAPI.h GeomAlgoAPI_Exception.h GeomAlgoAPI_Box.h GeomAlgoAPI_BoxPoints.h @@ -80,7 +80,7 @@ SET(PROJECT_SOURCES GeomAlgoAPI_WireBuilder.cpp GeomAlgoAPI_Sewing.cpp GeomAlgoAPI_ShapeBuilder.cpp - GeomAlgoAPI_DirectAPI.cpp + GeomAlgoAPI_ShapeAPI.cpp GeomAlgoAPI_Exception.cpp GeomAlgoAPI_Box.cpp GeomAlgoAPI_BoxPoints.cpp diff --git a/src/GeomAlgoAPI/GeomAlgoAPI.i b/src/GeomAlgoAPI/GeomAlgoAPI.i index 9391a720c..762d6b44f 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI.i +++ b/src/GeomAlgoAPI/GeomAlgoAPI.i @@ -69,7 +69,7 @@ %include "GeomAlgoAPI_Sewing.h" %include "GeomAlgoAPI_ShapeBuilder.h" %include "GeomAlgoAPI_Exception.h" -%include "GeomAlgoAPI_DirectAPI.h" +%include "GeomAlgoAPI_ShapeAPI.h" %typemap(out) std::list< std::shared_ptr< GeomAPI_Shape > >::value_type & { $result = SWIG_NewPointerObj(SWIG_as_voidptr(new std::shared_ptr(*$1)), $descriptor(std::shared_ptr *), SWIG_POINTER_OWN | 0 ); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_DirectAPI.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_DirectAPI.cpp deleted file mode 100644 index f621478fd..000000000 --- a/src/GeomAlgoAPI/GeomAlgoAPI_DirectAPI.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (C) 2014-2016 CEA/DEN, EDF R&D - -// File: GeomAlgoAPI_DirectAPI.cpp -// Created: 17 Mar 2016 -// Author: Clarisse Genrault (CEA) - -#include "GeomAlgoAPI_DirectAPI.h" -#include -#include - -#include -#include -#include - -#include - -namespace GeomAlgoAPI_DirectAPI -{ - //========================================================================================================= - std::shared_ptr GeomAlgoAPI_DirectAPI::makeBox(const double theDx, const double theDy, - const double theDz) throw (GeomAlgoAPI_Exception) - { - GeomAlgoAPI_Box aBoxAlgo(theDx,theDy,theDz); - - if (!aBoxAlgo.check()) { - throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); - } - - aBoxAlgo.build(); - - if(!aBoxAlgo.isDone()) { - throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); - } - if (!aBoxAlgo.checkValid("Box builder with dimensions")) { - throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); - } - return aBoxAlgo.shape(); - } - - //========================================================================================================= - std::shared_ptr GeomAlgoAPI_DirectAPI::makeBox(std::shared_ptr theFirstPoint, - std::shared_ptr theSecondPoint) throw (GeomAlgoAPI_Exception) - { - GeomAlgoAPI_BoxPoints aBoxAlgo(theFirstPoint, theSecondPoint); - - if (!aBoxAlgo.check()) { - throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); - } - - aBoxAlgo.build(); - - if(!aBoxAlgo.isDone()) { - throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); - } - if (!aBoxAlgo.checkValid("Box builder with two points")) { - throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); - } - return aBoxAlgo.shape(); - } -} diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_DirectAPI.h b/src/GeomAlgoAPI/GeomAlgoAPI_DirectAPI.h deleted file mode 100644 index ef804ed78..000000000 --- a/src/GeomAlgoAPI/GeomAlgoAPI_DirectAPI.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) 2014-2016 CEA/DEN, EDF R&D - -// File: GeomAlgoAPI_DirectAPI.h -// Created: 17 Mar 2016 -// Author: Clarisse Genrault (CEA) - -#ifndef GEOMALGOAPI_DIRECTAPI_H -#define GEOMALGOAPI_DIRECTAPI_H - -#include -#include -#include - -#include - -namespace GeomAlgoAPI_DirectAPI -{ -/**\class GeomAlgoAPI_DirectAPI - * \ingroup DataAlgo - * \brief Allows to access the direct API - */ -class GEOMALGOAPI_EXPORT GeomAlgoAPI_DirectAPI -{ -public: - /// Creates a box using the dimensions. - /// \param theDx The dimension on X - /// \param theDy The dimension on Y - /// \param theDz The dimension on Z - /// \return a shape - static std::shared_ptr makeBox(const double theDx, const double theDy, const double theDz) throw (GeomAlgoAPI_Exception); - - /// 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 - /// \return a shape - static std::shared_ptr makeBox(std::shared_ptr theFirstPoint, - std::shared_ptr theSecondPoint) throw (GeomAlgoAPI_Exception); -}; -} -#endif diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp new file mode 100644 index 000000000..6945ee370 --- /dev/null +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp @@ -0,0 +1,60 @@ +// Copyright (C) 2014-2016 CEA/DEN, EDF R&D + +// File: GeomAlgoAPI_ShapeAPI.cpp +// Created: 17 Mar 2016 +// Author: Clarisse Genrault (CEA) + +#include "GeomAlgoAPI_ShapeAPI.h" +#include +#include + +#include +#include +#include + +#include + +namespace GeomAlgoAPI_ShapeAPI +{ + //========================================================================================================= + std::shared_ptr GeomAlgoAPI_ShapeAPI::makeBox(const double theDx, const double theDy, + const double theDz) throw (GeomAlgoAPI_Exception) + { + GeomAlgoAPI_Box aBoxAlgo(theDx,theDy,theDz); + + if (!aBoxAlgo.check()) { + throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); + } + + aBoxAlgo.build(); + + if(!aBoxAlgo.isDone()) { + throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); + } + if (!aBoxAlgo.checkValid("Box builder with dimensions")) { + throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); + } + return aBoxAlgo.shape(); + } + + //========================================================================================================= + std::shared_ptr GeomAlgoAPI_ShapeAPI::makeBox(std::shared_ptr theFirstPoint, + std::shared_ptr theSecondPoint) throw (GeomAlgoAPI_Exception) + { + GeomAlgoAPI_BoxPoints aBoxAlgo(theFirstPoint, theSecondPoint); + + if (!aBoxAlgo.check()) { + throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); + } + + aBoxAlgo.build(); + + if(!aBoxAlgo.isDone()) { + throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); + } + if (!aBoxAlgo.checkValid("Box builder with two points")) { + throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); + } + return aBoxAlgo.shape(); + } +} diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h new file mode 100644 index 000000000..4f626e577 --- /dev/null +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h @@ -0,0 +1,40 @@ +// Copyright (C) 2014-2016 CEA/DEN, EDF R&D + +// File: GeomAlgoAPI_ShapeAPI.h +// Created: 17 Mar 2016 +// Author: Clarisse Genrault (CEA) + +#ifndef GEOMALGOAPI_DIRECTAPI_H +#define GEOMALGOAPI_DIRECTAPI_H + +#include +#include +#include + +#include + +namespace GeomAlgoAPI_ShapeAPI +{ +/**\class GeomAlgoAPI_ShapeAPI + * \ingroup DataAlgo + * \brief Allows to access the direct API + */ +class GEOMALGOAPI_EXPORT GeomAlgoAPI_ShapeAPI +{ +public: + /// Creates a box using the dimensions. + /// \param theDx The dimension on X + /// \param theDy The dimension on Y + /// \param theDz The dimension on Z + /// \return a shape + static std::shared_ptr makeBox(const double theDx, const double theDy, const double theDz) throw (GeomAlgoAPI_Exception); + + /// 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 + /// \return a shape + static std::shared_ptr makeBox(std::shared_ptr theFirstPoint, + std::shared_ptr theSecondPoint) throw (GeomAlgoAPI_Exception); +}; +} +#endif diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_swig.h b/src/GeomAlgoAPI/GeomAlgoAPI_swig.h index b742d88e8..668a5d1b0 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_swig.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_swig.h @@ -42,7 +42,7 @@ #include "GeomAlgoAPI_Sewing.h" #include "GeomAlgoAPI_ShapeBuilder.h" #include "GeomAlgoAPI_Exception.h" - #include "GeomAlgoAPI_DirectAPI.h" + #include "GeomAlgoAPI_ShapeAPI.h" #include "GeomAlgoAPI_Box.h" #include "GeomAlgoAPI_BoxPoints.h" diff --git a/src/PrimitivesPlugin/Test/APIDirectTestBox.py b/src/PrimitivesPlugin/Test/APIDirectTestBox.py index 247a3f82e..57927ac00 100644 --- a/src/PrimitivesPlugin/Test/APIDirectTestBox.py +++ b/src/PrimitivesPlugin/Test/APIDirectTestBox.py @@ -1,4 +1,4 @@ -from GeomAlgoAPI import GeomAlgoAPI_DirectAPI as shaperpy +from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept from GeomAPI import GeomAPI_Pnt as pnt