]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix Warning in GeomAlgoAPI_MakeShape
authorspo <sergey.pokhodenko@opencascade.com>
Thu, 26 Nov 2015 11:20:48 +0000 (14:20 +0300)
committerdbv <dbv@opencascade.com>
Tue, 8 Dec 2015 08:45:26 +0000 (11:45 +0300)
src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp
src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h

index 900a80ddb1923e25fed0031720dcb3834747ddde..e01f7d7a97e9aa23d8687e05ed211d26117e8038 100644 (file)
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 
 //=================================================================================================
-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<BRepBuilderAPI_MakeShape>()->IsDone() == Standard_True;
index 8d6c83aab18d921f9ffdd2747456c4e3111ebe2f..07e618263ddc989055203569c8a86f47459abd1b 100644 (file)
@@ -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<class T> 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<GeomAPI_Shape> theShape);
 
+  /// \brief Initializes internals.
+  GEOMALGOAPI_EXPORT void initialize();
+
 private:
   GeomAlgoAPI_MakeShape::BuilderType myBuilderType; ///< Type of make shape builder.
   bool myDone; ///< Builder status.