From 2f39954195cdecf37033e742c29b1362fd3f17b2 Mon Sep 17 00:00:00 2001 From: spo Date: Thu, 26 Nov 2015 14:20:48 +0300 Subject: [PATCH] Fix Warning in GeomAlgoAPI_MakeShape --- src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp | 6 +----- src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h | 12 +++++++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp index 900a80ddb..e01f7d7a9 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp @@ -14,11 +14,7 @@ #include //================================================================================================= -GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape(void* theMkShape, const BuilderType theBuilderType) -: GeomAPI_Interface(theMkShape), - myBuilderType(theBuilderType), - myShape(new GeomAPI_Shape()) -{ +void GeomAlgoAPI_MakeShape::initialize() { switch (myBuilderType) { case OCCT_BRepBuilderAPI_MakeShape: { myDone = implPtr()->IsDone() == Standard_True; diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h index 8d6c83aab..07e618263 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h @@ -30,7 +30,14 @@ public: * \param[in] theBuilder pointer to the builder. * \param[in] theBuilderType builder type. */ - GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape(void* theBuilder, const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape); + template explicit GeomAlgoAPI_MakeShape(T* theBuilder, const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape) + : GeomAPI_Interface(theBuilder), + myBuilderType(theBuilderType), + myShape(new GeomAPI_Shape()) + { + initialize(); + } + /// \return status of builder. GEOMALGOAPI_EXPORT bool isDone() const; @@ -76,6 +83,9 @@ protected: */ GEOMALGOAPI_EXPORT void setShape(const std::shared_ptr theShape); + /// \brief Initializes internals. + GEOMALGOAPI_EXPORT void initialize(); + private: GeomAlgoAPI_MakeShape::BuilderType myBuilderType; ///< Type of make shape builder. bool myDone; ///< Builder status. -- 2.39.2