class AIS_InteractiveObject;
+class GeomAPI_AISObject;
+
class ModuleBase_IWorkshop;
class ModuleBase_ListView;
/// \param theIsActive state whether the panel should be activated or deactivated
void setActivePanel(const bool theIsActive);
+ /// Returns true if transparency choice is checked
+ /// \return boolean value
+ bool useTransparency() const;
+
/// Returns true if the object is in internal container of hidden objects by this panel
/// \param theObject a checked object
/// \return boolean value
/// If the object is displayed, all panel faces selected on it will be moved into presentation
/// or, if redisplayed, fuction return if the object should be redisplayed or not
/// \param theObject a customized object
- /// \param isDisplayed state if the object is displayed or redisplayed
+ /// \param thePresentation visualized presentation of the object
/// \return true if the presentation is customized
- bool customizeObject(const std::shared_ptr<ModelAPI_Object>& theObject, const bool isDisplayed);
+ bool customizeObject(const std::shared_ptr<ModelAPI_Object>& theObject,
+ const std::shared_ptr<GeomAPI_AISObject>& thePresentation);
protected:
/// Add panel selection filters to the current viewer
/// Activate or deactivate selection and selection filters
void activateSelection(bool toActivate);
- /// Redisplay or display objects. The viewer is not updated after redisplay.
+ /// Redisplay objects.
/// \param theObjects container of objects
/// \param isToFlushRedisplay flag if redisplay should be flushed immediatelly
- /// \return true if some of objects was redisplayed to update viewer
+ /// \return true if some of objects was redisplayed
bool redisplayObjects(const std::set<std::shared_ptr<ModelAPI_Object> >& theObjects,
const bool isToFlushRedisplay);
- /// Change the presentation to have the selected presentation hidden
- /// \param theIndex an index of selected item that should be hidden
- /// \return true if presentation is changed
- bool hideFace(const int theIndex);
+ /// Display objects if the objects are in a container of hidden by this pane.
+ /// \param theObjects container of objects
+ /// \param isToFlushRedisplay flag if redisplay should be flushed immediatelly
+ /// \return true if some of objects was redisplayed
+ bool displayHiddenObjects(const std::set<std::shared_ptr<ModelAPI_Object> >& theObjects,
+ const bool isToFlushRedisplay);
+
+ /// Iterates by items and hide objects where all sub-shapes are hidden
+ /// \return true if some of objects was redisplayed
+ bool hideEmptyObjects();
+
+ /// Container of objects participating in the panel, it is filled by internal container
+ /// \param theItems container of selected values
+ /// \param theObjects [out] container of objects
+ static void updateProcessedObjects(QMap<int, std::shared_ptr<ModuleBase_ViewerPrs> > theItems,
+ std::set<std::shared_ptr<ModelAPI_Object> >& theObjects);
/// Generates a presentation name in form: <object_name>/<face>_<face_index>
/// \param thePrs a presentation
/// Deletes element in list of items
void onDeleteItem();
+ /// Upates hidden faces to be hidden or transparent
+ void onTransparencyChanged();
+
/// Closes faces panel restore all hidden faces by calling reset()
void onClosed();
int myLastItemIndex; ///< last index to be used in the map of items for the next added item
QMap<int, std::shared_ptr<ModuleBase_ViewerPrs> > myItems; ///< selected face items
+ std::set<std::shared_ptr<ModelAPI_Object> > myItemObjects; ///< cached objects of myItems
std::set<std::shared_ptr<ModelAPI_Object> > myHiddenObjects; ///< hidden objects
};