}
if (aView.IsNull())
return;
- double aLen = aView->Convert(SketcherPrs_Tools::getDefaultArrowSize());
+ double aLen = aView->Convert(SketcherPrs_Tools::getConfigArrowSize());
double aPrevLen = SketcherPrs_Tools::getArrowSize();
SketcherPrs_Tools::setArrowSize(aLen);
- const double aPrevScale = aViewer->Scale(aViewer->activeView());
const double aCurScale = aViewer->activeView()->Camera()->Scale();
aViewer->SetScale(aViewer->activeView(), aCurScale);
- SketcherPrs_Tools::setTextHeight (aCurScale / aPrevScale * SketcherPrs_Tools::getTextHeight());
+ double aTextHeight = SketcherPrs_Tools::getConfigTextHeight();
+ SketcherPrs_Tools::setTextHeight (aTextHeight);
bool isModified = false;
QList<AISObjectPtr> aPrsList = aDisplayer->displayedPresentations();
foreach (AISObjectPtr aAIS, aPrsList) {
Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(aAisObj);
if (!aDim.IsNull()) {
aDim->DimensionAspect()->ArrowAspect()->SetLength(aLen);
+ aDim->DimensionAspect()->TextAspect()->SetHeight(aTextHeight);
aContext->Redisplay(aDim, false);
isModified = true;
}
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);
anAspect->MakeText3d(false);
anAspect->MakeTextShaded(false);
anAspect->MakeUnitsDisplayed(false);
- anAspect->TextAspect()->SetHeight(SketcherPrs_Tools::getDefaultTextHeight());
+ anAspect->TextAspect()->SetHeight(SketcherPrs_Tools::getConfigTextHeight());
anAspect->ArrowAspect()->SetLength(SketcherPrs_Tools::getArrowSize());
return anAspect;
if (theLocationType == SketcherPrs_Tools::LOCATION_AUTOMATIC) {
double anArrowLength = theDimAspect->ArrowAspect()->Length();
// This is not realy correct way to get viewer scale.
- double aViewerScale = (double) SketcherPrs_Tools::getDefaultArrowSize() / anArrowLength;
+ double aViewerScale = (double) SketcherPrs_Tools::getConfigArrowSize() / anArrowLength;
if(theTextSize > ((theDimValue - 3 * SketcherPrs_Tools::getArrowSize()) * aViewerScale)) {
theDimAspect->SetTextHorizontalPosition(Prs3d_DTHP_Left);
double anArrowLength = theDimAspect->ArrowAspect()->Length();
// This is not realy correct way to get viewer scale.
- double aViewerScale = (double) SketcherPrs_Tools::getDefaultArrowSize() / anArrowLength;
+ double aViewerScale = (double) SketcherPrs_Tools::getConfigArrowSize() / anArrowLength;
theDimAspect->SetExtensionSize(
(theTextSize / aViewerScale + SketcherPrs_Tools::getArrowSize()) / 2.0);
}
return 20;
}
+int getConfigArrowSize()
+{
+ return Config_PropManager::integer(SKETCH_TAB_NAME, "dimension_arrow_size");
+}
+
static double MyTextHeight = 16;
double getTextHeight()
{
return 16;
}
+double getConfigTextHeight()
+{
+ return Config_PropManager::integer(SKETCH_TAB_NAME, "dimension_value_size");
+}
+
double getFlyoutDistance(const ModelAPI_Feature* theConstraint)
{
std::shared_ptr<GeomDataAPI_Point2D> aFlyoutPoint =
/// Returns default value of dimension arrows size
SKETCHERPRS_EXPORT int getDefaultArrowSize();
+ /// Returns value of dimension arrows size set in preferences
+ SKETCHERPRS_EXPORT int getConfigArrowSize();
+
/// Set value of dimension text height
/// \param theHeight a height value
SKETCHERPRS_EXPORT void setTextHeight(double theHeight);
/// Returns default value of dimension text height
SKETCHERPRS_EXPORT double getDefaultTextHeight();
+ /// Returns value of dimension text height set in preferences
+ SKETCHERPRS_EXPORT double getConfigTextHeight();
+
/// Get flayout distance of the dimension constraint
/// \param theConstraint a dimension constraint object
SKETCHERPRS_EXPORT double getFlyoutDistance(const ModelAPI_Feature* theConstraint);