- /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
- /// Returns true if the Feature succesfully displayed
- void display(ObjectPtr theObject, AISObjectPtr theAIS, bool isShading,
- bool isUpdateViewer = true);
-
- /// Display the shape and activate selection of sub-shapes
- /// \param theFeature a feature instance
- /// \param theAIS an AIS object
- /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
- /// \returns true if the presentation is created
- //bool redisplay(ObjectPtr theObject,
- // AISObjectPtr theAIS,
- // const bool isUpdateViewer = true);
-
- /** Redisplay the shape if it was displayed
- * \param theFeature a feature instance
- * \param isUpdateViewer the parameter whether the viewer should be update immediatelly
- */
- void redisplay(ObjectPtr theObject, bool isUpdateViewer = true);
-
- /// Opens local context. Does nothing if it is already opened.
- void openLocalContext();
+ /// \param isShading flag to show in shading mode
+ /// \param theUpdateViewer the parameter whether the viewer should be update immediatelly
+ /// \return true if the object visibility state is changed
+ bool display(ObjectPtr theObject, AISObjectPtr theAIS, bool isShading,
+ bool theUpdateViewer = true);
+
+private:
+ /// Activates the interactive object in the local context.
+ /// \param theIO an interactive object
+ /// \param theModes - modes on which it has to be activated (can be empty)
+ /// \return a flag is object activated or not
+ bool activate(const Handle(AIS_InteractiveObject)& theIO, const QIntList& theModes,
+ const bool theUpdateViewer) const;
+
+ /// Deactivates the given object (not allow selection)
+ /// \param theObject object to deactivate
+ void deactivate(ObjectPtr theObject, const bool theUpdateViewer);
+
+ /// Find a trihedron in a list of displayed presentations and deactivate it.
+ /// \param theUpdateViewer an update viewer flag
+ void deactivateTrihedron(const bool theUpdateViewer) const;
+
+ /// Update the object presentable properties such as color, lines width and other
+ /// If the object is result with the color attribute value set, it is used,
+ /// otherwise the customize is applyed to the object's feature if it is a custom prs
+ /// \param theObject an object instance
+ /// \return the true state if there is changes and the presentation is customized
+ bool customizeObject(ObjectPtr theObject);
+
+ /// Append the objects in the internal map. Checks whether the map already contains the object
+ /// \param theObject an object to display
+ /// \param theAIS AIOS object to display
+ void appendResultObject(ObjectPtr theObject, AISObjectPtr theAIS);
+
+#ifdef _DEBUG
+ /// Returns an information about alredy displayed objects
+ /// \return a string representation
+ std::string getResult2AISObjectMapInfo() const;
+#endif
+
+ /// Returns container of visible presentations for the object. For a feature object,
+ /// the feature results are processed also. The presentations map is not cleared inside.
+ /// \param theObject a feature or result
+ /// \param thePresentations result map of presentations
+ void getPresentations(const ObjectPtr& theObject,
+ NCollection_Map<Handle(AIS_InteractiveObject)>& thePresentations);
+
+ /// Sets the shapes selected in the context. It contains logic of the similar method
+ /// in OCCT but improved for performance. The modification is to iterates by a list
+ /// of owners in the context only once.
+ /// \param theContext a viewer context. It has opened local context
+ /// \param theShapesToBeSelected a map of shapes. Owner's shape is searched in the map and the
+ /// owner is selected if it is found there.
+ /// Only first owner is processed(according to OCCT logic)
+ static void AddOrRemoveSelectedShapes(Handle(AIS_InteractiveContext) theContext,
+ const NCollection_DataMap<TopoDS_Shape,
+ NCollection_Map<Handle(AIS_InteractiveObject)>>& theShapesToBeSelected);