X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_Boolean.h;h=5c2059b88f1cf20867e1980b056152be198347dd;hb=86c435d69e7b27d36c037ed028d79d8f32f021ac;hp=ac7b267d0eb4f4c0aba8c772c45b7b5c63d32799;hpb=3874b57fe5aba25ff5aee2a07654fc23c1ee8eb0;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h index ac7b267d0..5c2059b88 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h @@ -8,85 +8,62 @@ #define GeomAlgoAPI_Boolean_H_ #include -#include #include + +#include +#include #include + #include -/**\class GeomAlgoAPI_Boolean - * \ingroup DataAlgo - * \brief Allows to perform of boolean operations +/** \class GeomAlgoAPI_Boolean + * \ingroup DataAlgo + * \brief Allows to perform of boolean operations */ class GeomAlgoAPI_Boolean : public GeomAPI_Interface { - public: - /* \brief Creates cut boolean operation - * \param[in] theShape the main shape - * \param[in] theTool toole shape for boolean - * \return a solid as result of operation - */ - GEOMALGOAPI_EXPORT static std::shared_ptr makeCut( - std::shared_ptr theShape, - std::shared_ptr theTool); - - /* \brief Creates fuse boolean operation - * \param[in] theShape the main shape - * \param[in] theTool second shape - * \return a solid as result of operation - */ - GEOMALGOAPI_EXPORT static std::shared_ptr makeFuse( - std::shared_ptr theShape, - std::shared_ptr theTool); - - /* \brief Creates common boolean operation - * \param[in] theObject the main shape - * \param[in] theTool second shape - * \param[in] theType type of the operation: Fuse, Cut, Common - * \return a solid as result of operation - */ - GEOMALGOAPI_EXPORT static std::shared_ptr makeCommon( - std::shared_ptr theObject, - std::shared_ptr theTool); - - enum { - BOOL_CUT, - BOOL_FUSE, - BOOL_COMMON +public: + /// Type of booelan operation + enum OperationType{ + BOOL_CUT, ///< Cut objects + BOOL_FUSE, ///< Fuse objects + BOOL_COMMON ///< Take common part of objects }; - /// Constructor - GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean (std::shared_ptr theObject, - std::shared_ptr theTool, - int theType); - /// Returns True if algorithm succeed + public: + + /// Constructor. + GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean(const ListOfShape& theObjects, + const ListOfShape& theTools, + const OperationType theOperationType); + + /// \return true if algorithm succeed. GEOMALGOAPI_EXPORT const bool isDone() const; - /// Returns True if resulting shape is valid + /// \return true if resulting shape is valid. GEOMALGOAPI_EXPORT const bool isValid() const; - /// Returns result of the boolean algorithm which may be a Solid or a Face - GEOMALGOAPI_EXPORT const std::shared_ptr& shape () const; - - /// Returns map of sub-shapes of the result. To be used for History keeping - GEOMALGOAPI_EXPORT void mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const; + /// \return result of the boolean algorithm. + GEOMALGOAPI_EXPORT const std::shared_ptr& shape() const; + + /// \return map of sub-shapes of the result. To be used for History keeping. + GEOMALGOAPI_EXPORT std::shared_ptr mapOfShapes() const; - /// Return interface for for History processing - GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape () const; + /// \return interface for for History processing. + GEOMALGOAPI_EXPORT std::shared_ptr makeShape() const; - ///Destructor - GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Boolean(); +private: + /// Builds resulting shape. + void build(const ListOfShape& theObjects, + const ListOfShape& theTools, + const OperationType theOperationType); - private: - /// builds resulting shape - void build(std::shared_ptr theObject, - std::shared_ptr theTool); - /// fields - double mySize; +private: + /// Fields. bool myDone; - int myOperation; - std::shared_ptr myShape; - GeomAPI_DataMapOfShapeShape myMap; - GeomAlgoAPI_MakeShape * myMkShape; + std::shared_ptr myShape; + std::shared_ptr myMap; + std::shared_ptr myMkShape; }; #endif