Salome HOME
#1119 Confirmation box for deleting parts
[modules/shaper.git] / src / PartSet / PartSet_OperationPrs.h
index 89d2c252ed795adcab9a8ae1a817b510a775e9ed..adafbdfb81573cd8a2fcfecf6ab51cd20cba914e 100755 (executable)
@@ -30,7 +30,6 @@
 
 DEFINE_STANDARD_HANDLE(PartSet_OperationPrs, ViewerData_AISShape)
 
-class XGUI_Workshop;
 class XGUI_Displayer;
 
 /**
@@ -47,20 +46,12 @@ public:
   /// Constructor
   Standard_EXPORT PartSet_OperationPrs(ModuleBase_IWorkshop* theWorkshop);
 
-  /// Sets the operation feature. It is used in Compute method to group the feature parameter shapes
-  /// theFeature a feature
-  void setFeature(const FeaturePtr& theFeature);
-
-  // Recompute internal list of shaped dependent on the current feature
-  void updateShapes();
-
   /// Returns true if the feature contains shapes or results
   bool hasShapes();
 
   /// Sets the colors for the presentation compute
-  /// \param theShapeColor an argument shapes color
-  /// \param theResultColor a color for operation result
-  void setColors(const Quantity_Color& theShapeColor, const Quantity_Color& theResultColor);
+  /// \param theColor an argument shapes color
+  void setShapeColor(const Quantity_Color& theColor);
 
   /// Switch on using of the AIS presentation with of the shape object increased on the delta
   void useAISWidth();
@@ -78,9 +69,6 @@ protected:
                                                 const Standard_Integer aMode) ;
 
 protected:
-  /// Reference to a feature object
-  FeaturePtr getFeature() { return myFeature; }
-
   /// Returns map of feature shapes to be able to fill it outside this class, e.g. in friend
   /// \return a map of object to shape
   QMap<ObjectPtr, QList<GeomShapePtr> >& featureShapes() { return myFeatureShapes; }
@@ -91,7 +79,7 @@ private:
   /// \param theDisplayer a displayer
   /// \param theObject an object
   /// \return a boolean value
-  bool isVisible(XGUI_Displayer* theDislayer, const ObjectPtr& theObject);
+  static bool isVisible(XGUI_Displayer* theDislayer, const ObjectPtr& theObject);
 
   /// Fills the map by the feature object and shapes, which should be visuaziled
   /// Gets feature attributes, collect objects to whom the attributes refer
@@ -103,6 +91,17 @@ private:
                                ModuleBase_IWorkshop* theWorkshop,
                                QMap<ObjectPtr, QList<GeomShapePtr> >& theObjectShapes);
 
+  /// Fills the map by the feature object and shapes, which should be visuaziled
+  /// Gets feature attributes, collect objects to whom the attributes refer
+  /// \param theFeature a current feature
+  /// \param theWorkshop a current workshop
+  /// \param theObjectShapes an output map
+  /// \param theObjectShape an output map of objects
+  static void getResultShapes(const FeaturePtr& theFeature,
+                              ModuleBase_IWorkshop* theWorkshop,
+                              QMap<ObjectPtr, QList<GeomShapePtr> >& theObjectShapes,
+                              const bool theListShouldBeCleared = true);
+
   /// Fills the map by the feature object and shapes, which should be visuaziled
   /// Gets the active widget, obtain the highlighted presentations if it has such and
   /// fill map by object and shapes
@@ -116,19 +115,32 @@ private:
   /// \return a boolean value
   static bool isSelectionAttribute(const AttributePtr& theAttribute);
 
-  /// Converts the current workshop to XGUI workshop
-  /// \return a workshop instance
-  XGUI_Workshop* workshop() const;
+  /// Appends the shape for the result into the container if the result is visible and
+  /// the shape is not null.
+  /// \param theWorkshop a current workshop
+  /// \param theResult an object to be appended
+  /// \param theGeomShape a shape to be appended
+  /// \param theObjectShapes a filled container
+  static void addValue(const ObjectPtr& theObject, const GeomShapePtr& theShape,
+                const FeaturePtr& theFeature, ModuleBase_IWorkshop* theWorkshop,
+                QMap<ObjectPtr, QList<GeomShapePtr> >& theObjectShapes);
+
+  /// Appends the shape for the result into the container if the result is visible and
+  /// the shape is not null.
+  /// \param theWorkshop a current workshop
+  /// \param theObject an object to be appended
+  /// \param theGeomShape a shape to be appended
+  /// \param theObjectShapes a filled container
+  static void appendShapeIfVisible(ModuleBase_IWorkshop* theWorkshop,
+                                   const ObjectPtr& theObject,
+                                   GeomShapePtr theGeomShape,
+                                   QMap<ObjectPtr, QList<GeomShapePtr> >& theObjectShapes);
 
 private:
-  ModuleBase_IWorkshop* myWorkshop;
-  FeaturePtr myFeature; /// Reference to a feature object
   QMap<ObjectPtr, QList<GeomShapePtr> > myFeatureShapes; /// visualized shapes
-  std::list<ResultPtr> myFeatureResults; /// visualized feature results
 
+  ModuleBase_IWorkshop* myWorkshop; /// current workshop
   Quantity_Color myShapeColor; /// color of feature depended shapes
-  Quantity_Color myResultColor; /// color of feature result
-
   bool myUseAISWidth; /// flag if the width of a shape object should be used for the shape visualization
 
   friend class PartSet_CustomPrs;