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 bool isValidObject(const ObjectPtr& theObject);
41 /// Finds or create and external object
42 /// \param theSelectedObject an object
43 /// \param theShape a selected shape, which is used in the selection attribute
44 /// \param theSketch a current sketch
45 /// \return the object
46 ObjectPtr externalObject(const ObjectPtr& theSelectedObject, const GeomShapePtr& theShape,
47 const CompositeFeaturePtr& theSketch);
49 ObjectPtr externalObjectValidated(const ObjectPtr& theSelectedObject, const GeomShapePtr& theShape,
50 const CompositeFeaturePtr& theSketch);
52 // Removes the external presentation from the model
53 /// \param theSketch a current sketch
54 /// \param theFeature a current feature
55 void removeExternal(const CompositeFeaturePtr& theSketch,
56 const FeaturePtr& theFeature);
58 void removeExternalValidated(const CompositeFeaturePtr& theSketch,
59 const FeaturePtr& theFeature);
61 void removeUnusedExternalObjects(const QObjectPtrList& theIgnoreObjects,
62 const CompositeFeaturePtr& theSketch,
63 const FeaturePtr& theFeature);
66 void removeExternalObject(const ObjectPtr& theObject,
67 const CompositeFeaturePtr& theSketch,
68 const FeaturePtr& theFeature);
71 /// An external object
72 QObjectPtrList myExternalObjects;
74 /// An external object
75 ObjectPtr myExternalObjectValidated;
77 /// Boolean value about the neccessity of the external object use