/// \brief Constructor by builder and builder type.
/// \param[in] theBuilder pointer to the builder.
/// \param[in] theBuilderType builder type.
- template<class T> explicit GeomAlgoAPI_MakeShape(T* theBuilder,
+ template<class T> explicit GeomAlgoAPI_MakeShape(
+ T* theBuilder,
const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape)
: GeomAPI_Interface(theBuilder),
myBuilderType(theBuilderType)
/// \brief Initializes internals.
/// \param[in] theBuilder pointer to the builder.
/// \param[in] theBuilderType builder type.
- template<class T> void initialize(T* theBuilder,
+ template<class T> void initialize(
+ T* theBuilder,
const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape)
{
setImpl(theBuilder);
GEOMALGOAPI_EXPORT bool isDone() const;
/// \return a shape built by the shape construction algorithm.
- GEOMALGOAPI_EXPORT virtual const std::shared_ptr<GeomAPI_Shape> shape() const;
+ GEOMALGOAPI_EXPORT virtual const GeomShapePtr shape() const;
/// \return true if resulting shape is valid.
GEOMALGOAPI_EXPORT bool isValid() const;
GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfSubShapes() const;
/// \return the list of shapes generated from the shape \a theShape.
- /// \param[in] theShape base shape.
- /// \param[out] theHistory generated shapes.
- GEOMALGOAPI_EXPORT virtual void generated(const std::shared_ptr<GeomAPI_Shape> theShape,
- ListOfShape& theHistory);
+ /// \param[in] theOldShape base shape.
+ /// \param[out] theNewShapes shapes generated from \a theShape. Does not cleared!
+ GEOMALGOAPI_EXPORT virtual void generated(const GeomShapePtr theOldShape,
+ ListOfShape& theNewShapes);
/// \return the list of shapes modified from the shape \a theShape.
- /// \param[in] theShape base shape.
- /// \param[out] theHistory modified shapes. Does not cleared!
- GEOMALGOAPI_EXPORT virtual void modified(const std::shared_ptr<GeomAPI_Shape> theShape,
- ListOfShape& theHistory);
+ /// \param[in] theOldShape base shape.
+ /// \param[out] theNewShapes shapes modified from \a theShape. Does not cleared!
+ GEOMALGOAPI_EXPORT virtual void modified(const GeomShapePtr theOldShape,
+ ListOfShape& theNewShapes);
/// \return true if theShape was deleted.
- /// \param[in] theShape base shape.
- GEOMALGOAPI_EXPORT virtual bool isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
+ /// \param[in] theOldShape base shape.
+ GEOMALGOAPI_EXPORT virtual bool isDeleted(const GeomShapePtr theOldShape);
/// \return true if the data were correct.
GEOMALGOAPI_EXPORT virtual bool check() { return true; };
+ /// \brief Prepare the naming of faces.
+ GEOMALGOAPI_EXPORT virtual void prepareNamingFaces();
+
/// \return the list of created faces.
- GEOMALGOAPI_EXPORT std::map< std::string, std::shared_ptr<GeomAPI_Shape> > getCreatedFaces()
- {return myCreatedFaces;}
+ GEOMALGOAPI_EXPORT std::map< std::string, GeomShapePtr > getCreatedFaces() {
+ return myCreatedFaces;
+ }
/// \return the error.
GEOMALGOAPI_EXPORT std::string getError() { return myError; }
- /// \brief Prepare the naming of faces.
- GEOMALGOAPI_EXPORT virtual void prepareNamingFaces();
-
/// \brief Check the validity of the produced shape.
GEOMALGOAPI_EXPORT bool checkValid(std::string theMessage);
/// \param theWholeOld the whole old shape
/// \param theShapeType type of the sub-shapes that is used for optimization
/// \returns true if optimization containers are already filled
- GEOMALGOAPI_EXPORT bool newShapesCollected(
- std::shared_ptr<GeomAPI_Shape> theWholeOld, const int theShapeType);
+ GEOMALGOAPI_EXPORT bool isNewShapesCollected(GeomShapePtr theWholeOld,
+ const int theShapeType);
/// Optimization of access the new shapes by old shapes for the limited set of needed new shapes.
/// \param theWholeOld the whole old shape
/// \param theShapeType type of the sub-shapes that is used for optimization
/// \returns true if optimization containers are already filled
- GEOMALGOAPI_EXPORT void collectNewShapes(
- std::shared_ptr<GeomAPI_Shape> theWholeOld, const int theShapeType);
+ GEOMALGOAPI_EXPORT void collectNewShapes(GeomShapePtr theWholeOld,
+ const int theShapeType);
/// Optimization of access the new shapes by old shapes for the limited set of needed new shapes.
/// \param theWholeOld the whole old shape
/// \param theNewShape the whole new shape
/// \param theShapeType type of the old sub-shapes
/// \returns compound of all old shapes that were used for creation of the given new
- GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Shape> oldShapesForNew(
- std::shared_ptr<GeomAPI_Shape> theWholeOld,
- std::shared_ptr<GeomAPI_Shape> theNewShape, const int theShapeType);
+ GEOMALGOAPI_EXPORT GeomShapePtr oldShapesForNew(GeomShapePtr theWholeOld,
+ GeomShapePtr theNewShape,
+ const int theShapeType);
protected:
/// \brief Sets builder type.
/// \brief Sets result shape.
/// \param[in] theShape new shape.
- void setShape(const std::shared_ptr<GeomAPI_Shape> theShape);
+ void setShape(const GeomShapePtr theShape);
+
+ /// \return true if passed shape is valid for history.
+ bool isValidForHistory(const GeomShapePtr theShape);
+
+ /// Replaces \a theShape with shape from \a myMap.
+ void fixOrientation(GeomShapePtr& theShape);
protected:
/// Data map to keep correct orientation of sub-shapes.
/// Error occurred during the execution of an algorithm.
std::string myError;
/// Map of created faces with their name for naming.
- std::map< std::string, std::shared_ptr<GeomAPI_Shape> > myCreatedFaces;
+ std::map< std::string, GeomShapePtr > myCreatedFaces;
private:
/// \brief Initializes internals.
private:
GeomAlgoAPI_MakeShape::BuilderType myBuilderType; ///< Type of make shape builder.
bool myDone; ///< Builder status.
- std::shared_ptr<GeomAPI_Shape> myShape; ///< Resulting shape.
+ GeomShapePtr myShape; ///< Resulting shape.
/// map that is used to keep the optimization structure for access to the history
/// kind of sub-shapes -> whole old shape -> new shape -> list of old shapes that create this new
void* myHist;
};
-typedef std::list<std::shared_ptr<GeomAlgoAPI_MakeShape> > ListOfMakeShape;
+typedef std::shared_ptr<GeomAlgoAPI_MakeShape> GeomMakeShapePtr;
+typedef std::list<GeomMakeShapePtr> ListOfMakeShape;
#endif