1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PartSet_ExternalObjectsMgr.h
4 // Created: 15 Apr 2015
5 // Author: Natalia Ermolaeva
8 #ifndef PartSet_ExternalObjectsMgr_H
9 #define PartSet_ExternalObjectsMgr_H
13 #include <ModelAPI_CompositeFeature.h>
14 #include <ModelAPI_Object.h>
15 #include <GeomAPI_Shape.h>
17 #include <ModuleBase_Definitions.h>
23 * Customosation of ModuleBase_WidgetShapeSelector in order to provide
24 * working with sketch specific objects.
26 class PARTSET_EXPORT PartSet_ExternalObjectsMgr
30 /// \param theExternal the external state
31 /// \param theDefaultValue the default value for the external object using
32 PartSet_ExternalObjectsMgr(const std::string& theExternal, const bool theDefaultValue);
34 virtual ~PartSet_ExternalObjectsMgr() {}
36 /// Returns the state whether the external object is used
37 bool useExternal() const { return myUseExternal; }
39 /// Finds or create and external object
40 /// \param theSelectedObject an object
41 /// \param theShape a selected shape, which is used in the selection attribute
42 /// \param theSketch a current sketch
43 /// \return the object
44 ObjectPtr externalObject(const ObjectPtr& theSelectedObject, const GeomShapePtr& theShape,
45 const CompositeFeaturePtr& theSketch);
47 ObjectPtr externalObjectValidated(const ObjectPtr& theSelectedObject, const GeomShapePtr& theShape,
48 const CompositeFeaturePtr& theSketch);
51 // Removes the external presentation from the model
52 /// \param theSketch a current sketch
53 /// \param theFeature a current feature
54 void removeExternal(const CompositeFeaturePtr& theSketch,
55 const FeaturePtr& theFeature);
57 void removeExternalValidated(const CompositeFeaturePtr& theSketch,
58 const FeaturePtr& theFeature);
60 void removeUnusedExternalObjects(const QObjectPtrList& theIgnoreObjects,
61 const CompositeFeaturePtr& theSketch,
62 const FeaturePtr& theFeature);
65 void removeExternalObject(const ObjectPtr& theObject,
66 const CompositeFeaturePtr& theSketch,
67 const FeaturePtr& theFeature);
70 /// An external object
71 QObjectPtrList myExternalObjects;
73 /// An external object
74 ObjectPtr myExternalObjectValidated;
76 /// Boolean value about the neccessity of the external object use