From: spo Date: Thu, 26 Nov 2015 11:20:48 +0000 (+0300) Subject: Fix Warning in GeomAlgoAPI_MakeShape X-Git-Tag: V_2.1.0~233 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2f39954195cdecf37033e742c29b1362fd3f17b2;p=modules%2Fshaper.git Fix Warning in GeomAlgoAPI_MakeShape --- 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.