#include <TopTools_ListIteratorOfListOfShape.hxx>
//=================================================================================================
-void GeomAlgoAPI_MakeShape::initialize() {
- switch (myBuilderType) {
- case OCCT_BRepBuilderAPI_MakeShape: {
- myDone = implPtr<BRepBuilderAPI_MakeShape>()->IsDone() == Standard_True;
- myShape->setImpl(new TopoDS_Shape(implPtr<BRepBuilderAPI_MakeShape>()->Shape()));
- break;
- }
- case OCCT_BOPAlgo_Builder: {
- myDone = true;
- myShape->setImpl(new TopoDS_Shape(implPtr<BOPAlgo_Builder>()->Shape()));
- break;
- }
- }
+GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape()
+: myBuilderType(OCCT_BRepBuilderAPI_MakeShape),
+ myDone(false)
+{
}
//=================================================================================================
return isDeleted;
}
-
-//=================================================================================================
-GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape()
-: myBuilderType(OCCT_BRepBuilderAPI_MakeShape),
- myDone(false),
- myShape(new GeomAPI_Shape())
-{
-}
-
//=================================================================================================
void GeomAlgoAPI_MakeShape::setBuilderType(const BuilderType theBuilderType)
{
{
myShape = theShape;
}
+
+//=================================================================================================
+void GeomAlgoAPI_MakeShape::initialize() {
+ switch (myBuilderType) {
+ case OCCT_BRepBuilderAPI_MakeShape: {
+ myDone = implPtr<BRepBuilderAPI_MakeShape>()->IsDone() == Standard_True;
+ myShape.reset(new GeomAPI_Shape());
+ myShape->setImpl(new TopoDS_Shape(implPtr<BRepBuilderAPI_MakeShape>()->Shape()));
+ break;
+ }
+ case OCCT_BOPAlgo_Builder: {
+ myDone = true;
+ myShape.reset(new GeomAPI_Shape());
+ myShape->setImpl(new TopoDS_Shape(implPtr<BOPAlgo_Builder>()->Shape()));
+ break;
+ }
+ }
+}
};
public:
+ /// \brief Empty constructor.
+ GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape();
+
/** \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, const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape)
: GeomAPI_Interface(theBuilder),
- myBuilderType(theBuilderType),
- myShape(new GeomAPI_Shape())
+ myBuilderType(theBuilderType)
{
initialize();
}
+ /** \brief Initializes internals.
+ * \param[in] theBuilder pointer to the builder.
+ * \param[in] theBuilderType builder type.
+ */
+ template<class T> void initialize(T* theBuilder, const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape)
+ {
+ setImpl(theBuilder);
+ myBuilderType = theBuilder;
+ initialize();
+ }
/// \return status of builder.
GEOMALGOAPI_EXPORT bool isDone() const;
GEOMALGOAPI_EXPORT virtual bool isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
protected:
- /// \brief Default constructor.
- GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape();
-
/** \brief Sets builder type.
* \param[in] theBuilderType new builder type.
*/
*/
GEOMALGOAPI_EXPORT void setShape(const std::shared_ptr<GeomAPI_Shape> theShape);
+private:
/// \brief Initializes internals.
- GEOMALGOAPI_EXPORT void initialize();
+ void initialize();
private:
GeomAlgoAPI_MakeShape::BuilderType myBuilderType; ///< Type of make shape builder.