return Handle(AIS_InteractiveObject)();
}
+bool ModuleBase_IModule::canBeShaded(Handle(AIS_InteractiveObject) theAIS) const
+{
+ return true;
+}
+
QString ModuleBase_IModule::getFeatureError(const FeaturePtr& theFeature)
{
return ModelAPI_Tools::getFeatureError(theFeature).c_str();
//! Returns data object by AIS\r
virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;\r
\r
+ //! Returns true if the presentation can be shown in shading mode\r
+ //! \param theAIS presentation to be checked\r
+ //! \return boolean value\r
+ virtual bool canBeShaded(Handle(AIS_InteractiveObject) theAIS) const;\r
+\r
/// Update state of pop-up menu items in object browser\r
/// \param theStdActions - a map of standard actions\r
virtual void updateObjectBrowserMenu(const QMap<QString, QAction*>& theStdActions) {}\r
/// Returns result object
Standard_EXPORT ResultPtr getResult() const { return myResult; }
- /// Returns True if the presentation is in sketch mode
- Standard_EXPORT bool isSketchMode() const { return false; }
-
DEFINE_STANDARD_RTTI(ModuleBase_ResultPrs)
protected:
/// Redefinition of virtual function
#include "PartSet_WidgetSketchCreator.h"
#include "PartSet_SketcherMgr.h"
#include "PartSet_SketcherReetntrantMgr.h"
+#include "PartSet_ResultSketchPrs.h"
#include "PartSet_MenuMgr.h"
#include "PartSet_CustomPrs.h"
#include "PartSet_IconFactory.h"
return anObject;
}
+bool PartSet_Module::canBeShaded(Handle(AIS_InteractiveObject) theAIS) const
+{
+ bool aCanBeShaged = true;
+
+ Handle(PartSet_ResultSketchPrs) aPrs = Handle(PartSet_ResultSketchPrs)::DownCast(theAIS);
+ if (!aPrs.IsNull())
+ aCanBeShaged = false;
+
+ return aCanBeShaged;
+}
+
void PartSet_Module::addObjectBrowserMenu(QMenu* theMenu) const
{
QObjectPtrList aObjects = myWorkshop->selection()->selectedObjects();
//! Returns data object by AIS
virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const;
+ //! Returns true if the presentation can be shown in shading mode
+ //! \param theAIS presentation to be checked
+ //! \return boolean value
+ virtual bool canBeShaded(Handle(AIS_InteractiveObject) theAIS) const;
+
/// Update state of pop-up menu items in viewer
/// \param theStdActions - a map of standard actions
virtual void updateViewerMenu(const QMap<QString, QAction*>& theStdActions);
return aDisplayed;
}
-bool canBeShaded(Handle(AIS_InteractiveObject) theAIS)
+bool canBeShaded(Handle(AIS_InteractiveObject) theAIS, ModuleBase_IModule* theModule)
{
Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast(theAIS);
if (!aShapePrs.IsNull()) {
return false;
else {
// Check that the presentation is not a sketch
- Handle(ModuleBase_ResultPrs) aPrs = Handle(ModuleBase_ResultPrs)::DownCast(theAIS);
- if (!aPrs.IsNull())
- return !aPrs->isSketchMode();
- return true;
+ return theModule->canBeShaded(theAIS);
}
}
return false;
return false;
Handle(AIS_InteractiveObject) anAIS = aAISObj->impl<Handle(AIS_InteractiveObject)>();
- return ::canBeShaded(anAIS);
+ return ::canBeShaded(anAIS, myWorkshop->module());
}
bool XGUI_Displayer::activate(const Handle(AIS_InteractiveObject)& theIO,