X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_ExternalObjectsMgr.h;h=3d292afceeb485e31d89aaeb0e5c3a8039c7a460;hb=857b1f72d9703c46c6c8c9bb239821d314344c86;hp=45f89a84c90eaab6b444b03a124948ab44c498a5;hpb=292d36fa5dc2657e4c4ea5bfabe9ced407e401e4;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_ExternalObjectsMgr.h b/src/PartSet/PartSet_ExternalObjectsMgr.h old mode 100644 new mode 100755 index 45f89a84c..3d292afce --- a/src/PartSet/PartSet_ExternalObjectsMgr.h +++ b/src/PartSet/PartSet_ExternalObjectsMgr.h @@ -18,6 +18,9 @@ #include +class ModuleBase_IWorkshop; +class XGUI_Workshop; + /** * \ingroup Modules * Customosation of ModuleBase_WidgetShapeSelector in order to provide @@ -36,40 +39,43 @@ class PARTSET_EXPORT PartSet_ExternalObjectsMgr /// Returns the state whether the external object is used bool useExternal() const { return myUseExternal; } + bool isValidObject(const ObjectPtr& theObject); + /// Finds or create and external object /// \param theSelectedObject an object /// \param theShape a selected shape, which is used in the selection attribute /// \param theSketch a current sketch + /// \param theTemporary the created external object is temporary, execute is not performed for it /// \return the object ObjectPtr externalObject(const ObjectPtr& theSelectedObject, const GeomShapePtr& theShape, - const CompositeFeaturePtr& theSketch); - - ObjectPtr externalObjectValidated(const ObjectPtr& theSelectedObject, const GeomShapePtr& theShape, - const CompositeFeaturePtr& theSketch); - + const CompositeFeaturePtr& theSketch, const bool theTemporary = false); // Removes the external presentation from the model /// \param theSketch a current sketch /// \param theFeature a current feature + /// \param theWorkshop a current workshop + /// \param theTemporary if true, a temporary external object is removed overwise all ext objects void removeExternal(const CompositeFeaturePtr& theSketch, - const FeaturePtr& theFeature); - - void removeExternalValidated(const CompositeFeaturePtr& theSketch, - const FeaturePtr& theFeature); - - void removeUnusedExternalObjects(const QObjectPtrList& theIgnoreObjects, - const CompositeFeaturePtr& theSketch, - const FeaturePtr& theFeature); + const FeaturePtr& theFeature, + ModuleBase_IWorkshop* theWorkshop, + const bool theTemporary); 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. + /// \param theObject a removed object + /// \param theSketch a current sketch + /// \param theFeature a current feature + /// \param theWorkshop a current workshop void removeExternalObject(const ObjectPtr& theObject, const CompositeFeaturePtr& theSketch, - const FeaturePtr& theFeature); + const FeaturePtr& theFeature, + ModuleBase_IWorkshop* theWorkshop); -protected: - /// An external object - QObjectPtrList myExternalObjects; + /// Returns the workshop + static XGUI_Workshop* workshop(ModuleBase_IWorkshop* theWorkshop); +protected: /// An external object ObjectPtr myExternalObjectValidated;