-// Copyright (C) 2014-2019 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 "SketcherPrs_Radius.h"
#include "SketcherPrs_Tools.h"
-#include "SketcherPrs_DimensionStyleListener.h"
+#include "SketcherPrs_DimensionStyle.h"
#include <SketchPlugin_ConstraintRadius.h>
#include <SketchPlugin_Constraint.h>
static const gp_Circ MyDefCirc(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1)), 1);
-IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Radius, AIS_RadiusDimension);
+IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Radius, PrsDim_RadiusDimension);
SketcherPrs_Radius::SketcherPrs_Radius(ModelAPI_Feature* theConstraint,
- const std::shared_ptr<GeomAPI_Ax3>& thePlane)
-: AIS_RadiusDimension(MyDefCirc), myConstraint(theConstraint), mySketcherPlane(thePlane),
+ SketchPlugin_Sketch* theSketcher)
+: PrsDim_RadiusDimension(MyDefCirc), myConstraint(theConstraint), mySketcher(theSketcher),
myCircle(MyDefCirc),
myAnchorPoint(gp_Pnt(0, 0, 2)),
myValue(1, false, "")
{
SetDimensionAspect(createDimensionAspect());
- myStyleListener = new SketcherPrs_DimensionStyleListener();
+ myStyleListener = new SketcherPrs_DimensionStyle();
}
SketcherPrs_Radius::~SketcherPrs_Radius()
const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Integer theMode)
{
+ if (!plane().get())
+ return;
gp_Circ aCircle;
gp_Pnt anAnchorPoint;
- bool aReadyToDisplay = readyToDisplay(myConstraint, mySketcherPlane, aCircle, anAnchorPoint);
+ bool aReadyToDisplay = readyToDisplay(myConstraint, plane(), aCircle, anAnchorPoint);
if (aReadyToDisplay) {
myCircle = aCircle;
myAnchorPoint = anAnchorPoint;
(SketcherPrs_Tools::LocationType)(aLocAttr->value()) : SketcherPrs_Tools::LOCATION_AUTOMATIC;
updateArrows(DimensionAspect(), GetValue(), aTextSize, aLocationType);
- AIS_RadiusDimension::Compute(thePresentationManager, thePresentation, theMode);
+ PrsDim_RadiusDimension::Compute(thePresentationManager, thePresentation, theMode);
if (!aReadyToDisplay)
SketcherPrs_Tools::sendEmptyPresentationError(myConstraint,
}
}
SetSelToleranceForText2d(SketcherPrs_Tools::getArrowSize()/5.);
- AIS_RadiusDimension::ComputeSelection(aSelection, aMode);
+ PrsDim_RadiusDimension::ComputeSelection(aSelection, aMode);
}