Skip to content

Commit

Permalink
TechDraw: small corrections for line sizes
Browse files Browse the repository at this point in the history
changeing the line weight for dimensions to a thin line
and get the font size for detail view labels from the configuration
rather than using a hardcoded value.
Also removing a duplicate method, as it is already implemend in the
parent class.
  • Loading branch information
reox authored and yorikvanhavre committed Mar 2, 2018
1 parent dd49ee2 commit efa8ceb
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 15 deletions.
11 changes: 2 additions & 9 deletions src/Mod/TechDraw/Gui/QGIViewPart.cpp
Expand Up @@ -742,6 +742,7 @@ void QGIViewPart::drawHighlight(TechDraw::DrawViewDetail* viewDetail, bool b)
}

if (b) {
double fontSize = getPrefFontSize();
QGIHighlight* highlight = new QGIHighlight();
addToGroup(highlight);
highlight->setPos(0.0,0.0); //sb setPos(center.x,center.y)?
Expand All @@ -750,7 +751,7 @@ void QGIViewPart::drawHighlight(TechDraw::DrawViewDetail* viewDetail, bool b)
double radius = viewDetail->Radius.getValue() * viewPart->getScale();
highlight->setBounds(center.x - radius, center.y + radius,center.x + radius, center.y - radius);
highlight->setWidth(Rez::guiX(vp->IsoWidth.getValue()));
highlight->setFont(m_font,Rez::guiX(6.0));
highlight->setFont(m_font, fontSize);
highlight->setZValue(ZVALUE::HIGHLIGHT);
highlight->draw();
}
Expand Down Expand Up @@ -1004,11 +1005,3 @@ bool QGIViewPart::getFaceEdgesPref(void)
result = hGrp->GetBool("DrawFaceEdges", 0l);
return result;
}

double QGIViewPart::getPrefFontSize()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Labels");
double fontSize = hGrp->GetFloat("LabelSize", 5.0);
return Rez::guiX(fontSize);
}
1 change: 0 additions & 1 deletion src/Mod/TechDraw/Gui/QGIViewPart.h
Expand Up @@ -100,7 +100,6 @@ class TechDrawGuiExport QGIViewPart : public QGIView
void removePrimitives(void);
void removeDecorations(void);
bool getFaceEdgesPref(void);
double getPrefFontSize(void);

private:
QList<QGraphicsItem*> deleteItems;
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/Gui/ViewProviderDimension.cpp
Expand Up @@ -67,7 +67,7 @@ ViewProviderDimension::ViewProviderDimension()
hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
std::string lgName = hGrp->GetASCII("LineGroup","FC 0.70mm");
auto lg = TechDraw::LineGroup::lineGroupFactory(lgName);
double weight = lg->getWeight("Graphic");
double weight = lg->getWeight("Thin");
ADD_PROPERTY_TYPE(LineWidth,(weight) ,group,(App::PropertyType)(App::Prop_None),"Dimension line weight");

hGrp = App::GetApplication().GetUserParameter()
Expand Down
34 changes: 30 additions & 4 deletions src/Mod/TechDraw/LineGroup/LineGroup.csv
@@ -1,15 +1,41 @@
;FreeCAD LineGroup Definitions
;Format: *GroupName,thin,graphic,thick,extra
;thin: hidden lines
;graphic: dimensions, centerlines
;thick: visible lines
;follows the specifications from DIN EN ISO 128-20
;which defines 5 different base types of lines
;in two different thicknesses:
; * 01: full line, freehand line / zickzack line
: * 02: dash line
; * 04: dash-dot line
; * 05: dash-dot-dot line
; type .1: thin
; type .2: thick
;for example: 04.1 is a thin dash-dot line
;
;The size of the lines can be computed by this rule:
;l = linegroup
;thick = 1 * l
;thin = 1/2 * l
;graphic = 5/7 * l
;extra = 2 * l
;
;Linegroup 0.50 and 0.70 shall be used preferable,
;where 0.50 shall be used for A4 to A2 and
;0.70 shall be used for A1 and A0
;
;FreeCAD applies these thicknesses:
;thin: hidden lines, dimensions, centerlines
;graphic: graphical symbols, text
;thick: visible lines, section lines
;extra: not implemented
;
;Format of this file: *GroupName,thin,graphic,thick,extra

*FC 0.25mm,0.13,0.18,0.25,0.50
*FC 0.35mm,0.18,0.25,0.35,0.70
*FC 0.50mm,0.25,0.35,0.50,1.0
*FC 0.70mm,0.35,0.50,0.70,1.4
*FC 1.00mm,0.50,0.70,1.00,2.00
*FC 1.40mm,0.70,1.00,1.40,2.80
*FC 2.00mm,1.00,1.40,2.00,4.00



0 comments on commit efa8ceb

Please sign in to comment.