SHAPER  9.12.0
PartSet_ExternalObjectsMgr Class Reference

Customosation of ModuleBase_WidgetShapeSelector in order to provide working with sketch specific objects. More...

Public Member Functions

 PartSet_ExternalObjectsMgr (const std::string &theExternal, const std::string &theCanCreateExternal, const bool theDefaultValue)
 Constructor. More...
 
bool useExternal () const
 Returns the state whether the external object is used. More...
 
bool canCreateExternal ()
 Returns if new external objects can be created. More...
 
bool isValidObject (const ObjectPtr &theObject)
 Checks validity of the given object. More...
 
ObjectPtr externalObject (const ObjectPtr &theSelectedObject, const GeomShapePtr &theShape, const CompositeFeaturePtr &theSketch, const bool theTemporary=false)
 Finds or create and external object. More...
 
ObjectPtr externalCenterObject (const std::shared_ptr< ModuleBase_ViewerPrs > &thePrs, const CompositeFeaturePtr &theSketch, const bool theTemporary)
 Finds or create and external object by selected circle center (PartSet_CenterPrs) More...
 
ObjectPtr getExternalObjectValidated () const
 Returns created external object or NULL. More...
 
void removeExternal (const CompositeFeaturePtr &theSketch, const FeaturePtr &theFeature, ModuleBase_IWorkshop *theWorkshop, const bool theTemporary)
 
virtual void getGeomSelection (const std::shared_ptr< ModuleBase_ViewerPrs > &thePrs, ObjectPtr &theObject, GeomShapePtr &theShape, ModuleBase_IWorkshop *theWorkshop, const CompositeFeaturePtr &theSketch, const bool isInValidate)
 Return an object and geom shape by the viewer presentation. More...
 

Protected Member Functions

void removeExternalObject (const ObjectPtr &theObject, const CompositeFeaturePtr &theSketch, const FeaturePtr &theFeature, ModuleBase_IWorkshop *theWorkshop)
 Delete from the document the feature of the object. More...
 

Static Protected Member Functions

static XGUI_Workshopworkshop (ModuleBase_IWorkshop *theWorkshop)
 Returns the workshop. More...
 

Protected Attributes

ObjectPtr myExternalObjectValidated
 An external object. More...
 
bool myUseExternal
 Boolean value about the neccessity of the external object use. More...
 
bool myCanCreateExternal
 Boolean value about the necessity of a new external object creation. More...
 

Detailed Description

Customosation of ModuleBase_WidgetShapeSelector in order to provide working with sketch specific objects.

Constructor & Destructor Documentation

◆ PartSet_ExternalObjectsMgr()

PartSet_ExternalObjectsMgr::PartSet_ExternalObjectsMgr ( const std::string &  theExternal,
const std::string &  theCanCreateExternal,
const bool  theDefaultValue 
)

Constructor.

Parameters
theExternalthe external state
theCanCreateExternalthe state if it can and should create external features
theDefaultValuethe default value for the external object using

Member Function Documentation

◆ useExternal()

bool PartSet_ExternalObjectsMgr::useExternal ( ) const
inline

Returns the state whether the external object is used.

◆ canCreateExternal()

bool PartSet_ExternalObjectsMgr::canCreateExternal ( )
inline

Returns if new external objects can be created.

Returns
boolean value

◆ isValidObject()

bool PartSet_ExternalObjectsMgr::isValidObject ( const ObjectPtr &  theObject)

Checks validity of the given object.

Parameters
theObjectan object to check
Returns
valid or not valid

◆ externalObject()

ObjectPtr PartSet_ExternalObjectsMgr::externalObject ( const ObjectPtr &  theSelectedObject,
const GeomShapePtr &  theShape,
const CompositeFeaturePtr &  theSketch,
const bool  theTemporary = false 
)

Finds or create and external object.

Parameters
theSelectedObjectan object
theShapea selected shape, which is used in the selection attribute
theSketcha current sketch
theTemporarythe created external object is temporary, execute is not performed for it
Returns
the object

◆ externalCenterObject()

ObjectPtr PartSet_ExternalObjectsMgr::externalCenterObject ( const std::shared_ptr< ModuleBase_ViewerPrs > &  thePrs,
const CompositeFeaturePtr &  theSketch,
const bool  theTemporary 
)

Finds or create and external object by selected circle center (PartSet_CenterPrs)

Parameters
thePrsa selection
theSketcha current sketch
theTemporarythe created external object is temporary, execute is not performed for it
Returns
the object

◆ getExternalObjectValidated()

ObjectPtr PartSet_ExternalObjectsMgr::getExternalObjectValidated ( ) const
inline

Returns created external object or NULL.

Returns
an object instance

◆ removeExternal()

void PartSet_ExternalObjectsMgr::removeExternal ( const CompositeFeaturePtr &  theSketch,
const FeaturePtr &  theFeature,
ModuleBase_IWorkshop theWorkshop,
const bool  theTemporary 
)
Parameters
theSketcha current sketch
theFeaturea current feature
theWorkshopa current workshop
theTemporaryif true, a temporary external object is removed overwise all ext objects

◆ getGeomSelection()

void PartSet_ExternalObjectsMgr::getGeomSelection ( const std::shared_ptr< ModuleBase_ViewerPrs > &  thePrs,
ObjectPtr &  theObject,
GeomShapePtr &  theShape,
ModuleBase_IWorkshop theWorkshop,
const CompositeFeaturePtr &  theSketch,
const bool  isInValidate 
)
virtual

Return an object and geom shape by the viewer presentation.

Parameters
thePrsa selection
theObjectan output object
theShapea shape of the selection

use objects of found selection

the object is null if the selected feature is "external"(not sketch entity feature of the current sketch) and it is not created by object manager

◆ removeExternalObject()

void PartSet_ExternalObjectsMgr::removeExternalObject ( const ObjectPtr &  theObject,
const CompositeFeaturePtr &  theSketch,
const FeaturePtr &  theFeature,
ModuleBase_IWorkshop theWorkshop 
)
protected

Delete from the document the feature of the object.

It deletes all objects, which refers to the deleted one. The parameter feature is ignored even it refer to the deleted object.

Parameters
theObjecta removed object
theSketcha current sketch
theFeaturea current feature
theWorkshopa current workshop

◆ workshop()

XGUI_Workshop * PartSet_ExternalObjectsMgr::workshop ( ModuleBase_IWorkshop theWorkshop)
staticprotected

Returns the workshop.

Field Documentation

◆ myExternalObjectValidated

ObjectPtr PartSet_ExternalObjectsMgr::myExternalObjectValidated
protected

An external object.

◆ myUseExternal

bool PartSet_ExternalObjectsMgr::myUseExternal
protected

Boolean value about the neccessity of the external object use.

◆ myCanCreateExternal

bool PartSet_ExternalObjectsMgr::myCanCreateExternal
protected

Boolean value about the necessity of a new external object creation.