#include "PartSet_Tools.h"
#include "PartSet_PreviewPlanes.h"
#include "PartSet_WidgetPoint2d.h"
-#include "PartSet_WidgetPoint2dDistance.h"
#include "PartSet_WidgetPoint2DFlyout.h"
#include "PartSet_WidgetShapeSelector.h"
#include "PartSet_WidgetMultiSelector.h"
#include "PartSet_WidgetFileSelector.h"
#include "PartSet_WidgetSketchCreator.h"
#include "PartSet_SketcherMgr.h"
-#include "PartSet_SketcherReetntrantMgr.h"
+#include "PartSet_SketcherReentrantMgr.h"
#include "PartSet_ResultSketchPrs.h"
#include "PartSet_MenuMgr.h"
#include "PartSet_CustomPrs.h"
new PartSet_IconFactory();
mySketchMgr = new PartSet_SketcherMgr(this);
- mySketchReentrantMgr = new PartSet_SketcherReetntrantMgr(theWshop);
+ mySketchReentrantMgr = new PartSet_SketcherReentrantMgr(theWshop);
XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWshop);
XGUI_Workshop* aWorkshop = aConnector->workshop();
{
bool isEnabledFixed = false;
if (theActionId == XGUI_ActionsMgr::AcceptAll &&
- mySketchReentrantMgr->isInternalEditStarted())
+ mySketchReentrantMgr->isInternalEditActive())
isEnabledFixed = true;
return isEnabledFixed;
}
bool PartSet_Module::isSketchNeutralPointActivated() const
{
bool isNeutralPoint = true;
- if (sketchReentranceMgr()->isInternalEditStarted())
+ if (sketchReentranceMgr()->isInternalEditActive())
isNeutralPoint = false;
if (myIsOperationIsLaunched)
isNeutralPoint = false;
aPointWgt->setSketch(mySketchMgr->activeSketch());
connect(aPointWgt, SIGNAL(vertexSelected()), sketchReentranceMgr(), SLOT(onVertexSelected()));
aWgt = aPointWgt;
- } else if (theType == "point2ddistance") {
- PartSet_WidgetPoint2dDistance* aDistanceWgt = new PartSet_WidgetPoint2dDistance(theParent,
- aWorkshop, theWidgetApi);
- aDistanceWgt->setSketch(mySketchMgr->activeSketch());
- aWgt = aDistanceWgt;
} else if (theType == "sketch_shape_selector") {
PartSet_WidgetShapeSelector* aShapeSelectorWgt =
new PartSet_WidgetShapeSelector(theParent, aWorkshop, theWidgetApi);
return aCustomized;
if (!theResult.get()) {
- bool isConflicting = myOverconstraintListener->isConflictingObject(anObject);
- // customize sketch symbol presentation
- if (thePrs.get()) {
- Handle(AIS_InteractiveObject) anAISIO = thePrs->impl<Handle(AIS_InteractiveObject)>();
- if (!anAISIO.IsNull()) {
- if (!Handle(SketcherPrs_SymbolPrs)::DownCast(anAISIO).IsNull()) {
- Handle(SketcherPrs_SymbolPrs) aPrs = Handle(SketcherPrs_SymbolPrs)::DownCast(anAISIO);
- if (!aPrs.IsNull()) {
- std::vector<int> aColor;
- myOverconstraintListener->getConflictingColor(aColor);
- aPrs->SetConflictingConstraint(isConflicting, aColor);
- aCustomized = true;
- }
- } else if (!Handle(SketcherPrs_Coincident)::DownCast(anAISIO).IsNull()) {
- Handle(SketcherPrs_Coincident) aPrs = Handle(SketcherPrs_Coincident)::DownCast(anAISIO);
- if (!aPrs.IsNull()) {
- std::vector<int> aColor;
- myOverconstraintListener->getConflictingColor(aColor);
- aPrs->SetConflictingConstraint(isConflicting, aColor);
- aCustomized = true;
- }
- }
- }
- }
- // customize sketch dimension constraint presentation
- if (!aCustomized) {
- std::vector<int> aColor;
- if (isConflicting) {
- myOverconstraintListener->getConflictingColor(aColor);
- }
- if (aColor.empty())
- XGUI_CustomPrs::getDefaultColor(anObject, true, aColor);
- if (!aColor.empty()) {
- aCustomized = thePrs->setColor(aColor[0], aColor[1], aColor[2]);
- }
+ std::vector<int> aColor;
+ XGUI_CustomPrs::getDefaultColor(anObject, true, aColor);
+ if (!aColor.empty()) {
+ aCustomized = thePrs->setColor(aColor[0], aColor[1], aColor[2]);
}
}
// customize dimentional constrains
return aCustomized;
}
+bool PartSet_Module::afterCustomisePresentation(std::shared_ptr<ModelAPI_Result> theResult,
+ AISObjectPtr thePrs,
+ GeomCustomPrsPtr theCustomPrs)
+{
+ bool aCustomized = false;
+
+ XGUI_Workshop* aWorkshop = getWorkshop();
+ XGUI_Displayer* aDisplayer = aWorkshop->displayer();
+ ObjectPtr anObject = aDisplayer->getObject(thePrs);
+ if (!anObject)
+ return aCustomized;
+
+ std::vector<int> aColor;
+ bool aUseCustomColor = true;
+ if (aUseCustomColor)
+ myOverconstraintListener->getCustomColor(anObject, aColor);
+ // customize sketch symbol presentation
+ Handle(AIS_InteractiveObject) anAISIO = thePrs->impl<Handle(AIS_InteractiveObject)>();
+ if (!anAISIO.IsNull()) {
+ if (!Handle(SketcherPrs_SymbolPrs)::DownCast(anAISIO).IsNull()) {
+ Handle(SketcherPrs_SymbolPrs) aPrs = Handle(SketcherPrs_SymbolPrs)::DownCast(anAISIO);
+ if (!aPrs.IsNull()) {
+ aPrs->SetCustomColor(aColor);
+ aCustomized = true;
+ }
+ } else if (!Handle(SketcherPrs_Coincident)::DownCast(anAISIO).IsNull()) {
+ Handle(SketcherPrs_Coincident) aPrs = Handle(SketcherPrs_Coincident)::DownCast(anAISIO);
+ if (!aPrs.IsNull()) {
+ aPrs->SetCustomColor(aColor);
+ aCustomized = true;
+ }
+ }
+ }
+ // customize sketch dimension constraint presentation
+ if (!aCustomized) {
+ if (!aColor.empty()) { // otherwise presentation has the default color
+ aCustomized = thePrs->setColor(aColor[0], aColor[1], aColor[2]);
+ }
+ }
+ return aCustomized;
+}
+
bool PartSet_Module::customizeObject(ObjectPtr theObject, const ModuleBase_CustomizeFlag& theFlag,
const bool theUpdateViewer)
{