X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_OperationPrs.h;h=ea645140ce9f0f9810db282dd36088ffb186010e;hb=6e73ccbe5ba45c2f6c1c7513ea20b502b245e2c8;hp=9d2cc93b03bc1ea3272bca9b6bfff9b67f2e3056;hpb=1599bc97cf8f4eb2b4154586fe16c2f3b7a3895e;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_OperationPrs.h b/src/PartSet/PartSet_OperationPrs.h index 9d2cc93b0..ea645140c 100755 --- a/src/PartSet/PartSet_OperationPrs.h +++ b/src/PartSet/PartSet_OperationPrs.h @@ -9,27 +9,56 @@ #include "PartSet.h" -#include +#include #include +#include + +#include + +#include #include #include +#include +#include + DEFINE_STANDARD_HANDLE(PartSet_OperationPrs, ViewerData_AISShape) +class XGUI_Workshop; +class XGUI_Displayer; + /** * \ingroup GUI -* A redefinition of standard AIS Interactive Object in order to provide specific behaviour -* for wire presentations based in a one plane +* A redefinition of standard AIS Interactive Object in order to provide colored presentation of +* a list of shapes. It contains a shapes where the parameter feature refers. It processes the following +* types of attributes: ModelAPI_AttributeSelectionList, ModelAPI_AttributeRefAttr, +* ModelAPI_AttributeSelection and ModelAPI_AttributeReference. +* The selection for this presentation is absent. */ class PartSet_OperationPrs : public ViewerData_AISShape { public: /// Constructor - /// \param theResult a result object - Standard_EXPORT PartSet_OperationPrs(FeaturePtr theFeature); + Standard_EXPORT PartSet_OperationPrs(ModuleBase_IWorkshop* theWorkshop); + + /// Returns true if the feature contains attributes, which has references to other features + /// \param theFeature a feature + /// \return boolean result + bool canActivate(const FeaturePtr& theFeature); + + /// Sets the operation feature. It is used in Compute method to group the feature parameter shapes + /// theFeature a feature + void setFeature(const FeaturePtr& theFeature); + + /// Returns true if the presentation + bool dependOn(const ObjectPtr& theObject); + + // Recompute internal list of shaped dependent on the current feature + void updateShapes(); DEFINE_STANDARD_RTTI(PartSet_OperationPrs) + protected: /// Redefinition of virtual function Standard_EXPORT virtual void Compute( @@ -40,8 +69,31 @@ protected: Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) ; private: - /// Reference to a feature object - FeaturePtr myFeature; + /// Return true if the object is visible. If the object is feature, it returns true + /// if all results of the feature are shown + /// \param theDisplayer a displayer + /// \param theObject an object + /// \return a boolean value + bool isVisible(XGUI_Displayer* theDislayer, const ObjectPtr& theObject); + + /// Fills the map by the feature object and shapes, which should be visuaziled + /// Gets the feature attribute, collect objects to whom the attribute refers + /// \param theObjectShape an output map of objects + void getFeatureShapes(QMap >& theObjectShapes); + + /// Returns true if the attribute type belong to reference attribute + /// \param theAttribute an attribute + /// \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; + +private: + ModuleBase_IWorkshop* myWorkshop; + FeaturePtr myFeature; /// Reference to a feature object + QMap > myFeatureShapes; };