#include <TopExp.hxx>
#include <BRep_Tool.hxx>
+/// Update variable aspect parameters (depending on viewer scale)
+/// \param theDimAspect an aspect to be changed
+/// \param theDimValue an arrow value
+/// \param theTextSize an arrow value
+extern void updateArrows(Handle(Prs3d_DimensionAspect) theDimAspect,
+ double theDimValue, double theTextSize, SketcherPrs_Tools::LocationType theLocationType);
+
#define PI 3.1415926535897932
//#ifndef WNT
myAspect->MakeText3d(false);
myAspect->MakeTextShaded(false);
myAspect->MakeUnitsDisplayed(false);
- myAspect->TextAspect()->SetHeight(SketcherPrs_Tools::getDefaultTextHeight());
+ myAspect->TextAspect()->SetHeight(SketcherPrs_Tools::getConfigTextHeight());
myAspect->ArrowAspect()->SetLength(SketcherPrs_Tools::getArrowSize());
SetDimensionAspect(myAspect);
// Update text visualization: parameter value or parameter text
myStyleListener->updateDimensions(this, myValue);
- myAspect->SetExtensionSize(myAspect->ArrowAspect()->Length());
- myAspect->SetArrowTailSize(myAspect->ArrowAspect()->Length());
+ double aTextSize = 0.0;
+ GetValueString(aTextSize);
+ AttributeIntegerPtr aLocAttr = std::dynamic_pointer_cast<ModelAPI_AttributeInteger>
+ (myConstraint->data()->attribute(SketchPlugin_ConstraintAngle::LOCATION_TYPE_ID()));
+ SketcherPrs_Tools::LocationType aLocationType = aLocAttr->isInitialized() ?
+ (SketcherPrs_Tools::LocationType)(aLocAttr->value()) : SketcherPrs_Tools::LOCATION_AUTOMATIC;
+
+ double aRadius = myCenterPoint.Translated(
+ gp_Vec(myCenterPoint, myFirstPoint).Normalized()*aDist).Distance(myCenterPoint);
+ double anAngleValue = myValue.myDoubleValue;
+ double anAngleCircleLength = aRadius * anAngleValue * PI / 180.;
+
+ updateArrows(myAspect, anAngleCircleLength, aTextSize, aLocationType);
AIS_AngleDimension::Compute(thePresentationManager, thePresentation, theMode);
return;
}
}
- SetSelToleranceForText2d(SketcherPrs_Tools::getTextHeight());
+ SetSelToleranceForText2d(SketcherPrs_Tools::getArrowSize()/5.);
AIS_AngleDimension::ComputeSelection(aSelection, aMode);
}