SHAPER  9.12.0
PartSet_PreviewSketchPlane Class Reference

A class to show/hide sketch preview plane. More...

Public Member Functions

 PartSet_PreviewSketchPlane ()
 Constructor. More...
 
void eraseSketchPlane (ModuleBase_IWorkshop *theWorkshop, const bool isClearPlane=true)
 Erase preview planes. More...
 
void createSketchPlane (const std::shared_ptr< ModelAPI_CompositeFeature > &theSketch, ModuleBase_IWorkshop *theWorkshop)
 Show preview planes. More...
 
bool getDefaultSizeOfView (const std::shared_ptr< ModelAPI_CompositeFeature > &theSketch, double &theSizeOfView, std::shared_ptr< GeomAPI_Pnt > &theCentralPnt)
 Returns bounding box size covered the sketch sub-elements. More...
 
bool isUseSizeOfView () const
 Returns whether custom size of view is set. More...
 
void setSizeOfView (double theSizeOfView, bool isUseSizeOfView, const std::shared_ptr< GeomAPI_Pnt > &theCentralPoint=std::shared_ptr< GeomAPI_Pnt >())
 Sets the size of default created face. More...
 
bool isPlaneCreated () const
 Returns True if the plane preview is already created. More...
 
bool isDisplayed () const
 Returns current state of the plane preview visibility. More...
 
void displaySketchPlane (ModuleBase_IWorkshop *theWorkshop)
 Displays preview planes. More...
 
void clearPlanePreview ()
 Nullyfies current plane preview object. More...
 

Detailed Description

A class to show/hide sketch preview plane.

Constructor & Destructor Documentation

◆ PartSet_PreviewSketchPlane()

PartSet_PreviewSketchPlane::PartSet_PreviewSketchPlane ( )

Constructor.

Member Function Documentation

◆ eraseSketchPlane()

void PartSet_PreviewSketchPlane::eraseSketchPlane ( ModuleBase_IWorkshop theWorkshop,
const bool  isClearPlane = true 
)

Erase preview planes.

Parameters
theWorkshopthe application workshop
isClearPlaneflag whether the plane, origin and normal should be nullified

◆ createSketchPlane()

void PartSet_PreviewSketchPlane::createSketchPlane ( const std::shared_ptr< ModelAPI_CompositeFeature > &  theSketch,
ModuleBase_IWorkshop theWorkshop 
)

Show preview planes.

Parameters
theSketchsource sketch to initialize plane
theWorkshopthe application workshop

◆ getDefaultSizeOfView()

bool PartSet_PreviewSketchPlane::getDefaultSizeOfView ( const std::shared_ptr< ModelAPI_CompositeFeature > &  theSketch,
double &  theSizeOfView,
std::shared_ptr< GeomAPI_Pnt > &  theCentralPnt 
)

Returns bounding box size covered the sketch sub-elements.

If the sketch uses extenal face, it will not have default size and returns false.

Parameters
theSketchsources sketch
[out]theSizeOfViewmaximum value in X, Y or Z direction
theCentralPointcentral point of the sketch sub features
Returns
boolean value

◆ isUseSizeOfView()

bool PartSet_PreviewSketchPlane::isUseSizeOfView ( ) const
inline

Returns whether custom size of view is set.

Returns
boolean value

◆ setSizeOfView()

void PartSet_PreviewSketchPlane::setSizeOfView ( double  theSizeOfView,
bool  isUseSizeOfView,
const std::shared_ptr< GeomAPI_Pnt > &  theCentralPoint = std::shared_ptr<GeomAPI_Pnt>() 
)

Sets the size of default created face.

Parameters
theSizeOfViewvalue
isUseSizeOfViewstate whether the size should be used

◆ isPlaneCreated()

bool PartSet_PreviewSketchPlane::isPlaneCreated ( ) const
inline

Returns True if the plane preview is already created.

◆ isDisplayed()

bool PartSet_PreviewSketchPlane::isDisplayed ( ) const
inline

Returns current state of the plane preview visibility.

◆ displaySketchPlane()

void PartSet_PreviewSketchPlane::displaySketchPlane ( ModuleBase_IWorkshop theWorkshop)

Displays preview planes.

Parameters
theWorkshopthe application workshop

◆ clearPlanePreview()

void PartSet_PreviewSketchPlane::clearPlanePreview ( )

Nullyfies current plane preview object.

Important: Before call of this function the plane has to be erased from viewer