Correct use of BRepPrimAPI_MakeXXXX : calling Shape() ?

Hallo !

Is the following line correct :
                   TopoDS_Shape    myShape     =       BRepPrimAPI_MakeRevol (  myWire,   RevolAxis,  2.0*M_PI );

Or is it mandatory to use some kind of intermediate object to be able to call  the  Shape() method, like this:
                BRepPrimAPI_MakeRevol            myRevolMaker ( myWire,   RevolAxis,  2.0*M_PI );
                TopoDS_Shape       myShape = myRevolMaker.Shape()
;

Thanks !

 

Kirill Gavrilov's picture

BRepBuilderAPI_MakeShape defines TopoDS_Shape cast operator as a shortcut to BRepBuilderAPI_MakeShape::Shape() method returning result - so both return the same thing.
There is no need creating a temporary object, but it is a good practice to check BRepBuilderAPI_MakeShape::IsDone() method before requesting result shape and handle failures (normally - due to wrong user input).

mail.chiot_166953's picture

Hallo Kirill !

OK, understood !
Thanks for that clarification.

BR
Karl