-// Copyright (C) 2014-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <SelectMgr_IndexedMapOfOwner.hxx>
#include <StdSelect_BRepOwner.hxx>
-//#include <AIS_DimensionSelectionMode.hxx>
#include <AIS_Shape.hxx>
-#include <AIS_Dimension.hxx>
+#include <PrsDim_Dimension.hxx>
#include <ModelAPI_Events.h>
#include <ModelAPI_Session.h>
// Acceptable features;
QStringList aList;
aList << "SketchLine" << "SketchMacroCircle" << "SketchMacroArc" <<
- "SketchMacroEllipse" << "SketchMacroEllipticArc" << "SketchRectangle";
+ "SketchMacroEllipse" << "SketchMacroEllipticArc" << "SketchMacroRectangle";
return aList.contains(aId);
}
}
myPreviousDrawModeEnabled = aViewer->enableDrawMode(false);
launchEditing();
- if (aFeature.get() != NULL) {
- std::shared_ptr<SketchPlugin_Feature> aSPFeature =
- std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
- if (aSPFeature.get() &&
- (aSPFeature->getKind() == SketchPlugin_ConstraintRadius::ID() ||
- aSPFeature->getKind() == SketchPlugin_ConstraintAngle::ID())) {
- DataPtr aData = aSPFeature->data();
- AttributePtr aAttr = aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT());
- std::shared_ptr<GeomDataAPI_Point2D> aFPAttr =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aAttr);
- aFPAttr->setValue(myCurrentPoint.myCurX, myCurrentPoint.myCurY);
- }
- }
} else if (isSketchOpe && isEditing) {
// If selected another object commit current result
bool aPrevLaunchingState = myIsEditLaunching;
myCurrentSketch = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFOperation->feature());
double aSizeOfView = 0;
std::shared_ptr<GeomAPI_Pnt> aCentralPoint;
+ // Reset size of view from previous launches
+ mySketchPlane->setSizeOfView(aSizeOfView, false, aCentralPoint);
if (aFOperation->isEditOperation() &&
mySketchPlane->getDefaultSizeOfView(myCurrentSketch, aSizeOfView, aCentralPoint)) {
mySketchPlane->setSizeOfView(aSizeOfView, true, aCentralPoint);
for (; anIt != aLast; anIt++) {
FeaturePtr aFeature = *anIt;
if (aFeature.get())
- anInvalidFeatureNames.append(aFeature->name().c_str());
+ anInvalidFeatureNames.append(QString::fromStdWString(aFeature->name()));
}
std::string aPrefixInfo = QString("Invalid features of the sketch will be deleted: %1.\n\n").
arg(anInvalidFeatureNames.join(", ")).toStdString().c_str();
anAISIO = anAIS->impl<Handle(AIS_InteractiveObject)>();
if (!anAISIO.IsNull()) {
- Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(anAISIO);
+ Handle(PrsDim_Dimension) aDim = Handle(PrsDim_Dimension)::DownCast(anAISIO);
if (!aDim.IsNull()) {
gp_Pnt aPosition = aDim->GetTextPosition();
if (aOCListener->isConflictingObject(theObject)) {
return Config_PropManager::color("Visualization", "sketch_overconstraint_color");
}
- if (aOCListener->isFullyConstrained()) {
- return Config_PropManager::color("Visualization", "sketch_fully_constrained_color");
- }
if (isDistanceKind(aKind)) {
return Config_PropManager::color("Visualization", "sketch_dimension_color");
}
+ if (isExternal(theFeature))
+ return Config_PropManager::color("Visualization", "sketch_external_color");
+
+ if (aOCListener->isFullyConstrained()) {
+ return Config_PropManager::color("Visualization", "sketch_fully_constrained_color");
+ }
if (aKind == SketchPlugin_ConstraintCoincidence::ID())
return std::vector<int>(3, 0);
- if (isExternal(theFeature))
- return Config_PropManager::color("Visualization", "sketch_external_color");
if (isConstruction)
return Config_PropManager::color("Visualization", "sketch_auxiliary_color");