TechDraw: small corrections for line sizes

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.
This commit is contained in:
Sebastian Bachmann
2018-02-27 13:10:41 +01:00
committed by Yorik van Havre
parent dd49ee27fd
commit efa8ceb303
4 changed files with 33 additions and 15 deletions

View File

@@ -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)?
@@ -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();
}
@@ -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);
}

View File

@@ -100,7 +100,6 @@ protected:
void removePrimitives(void);
void removeDecorations(void);
bool getFaceEdgesPref(void);
double getPrefFontSize(void);
private:
QList<QGraphicsItem*> deleteItems;

View File

@@ -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()

View File

@@ -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
1 ;FreeCAD LineGroup Definitions
2 ;Format: *GroupName,thin,graphic,thick,extra ;follows the specifications from DIN EN ISO 128-20
3 ;thin: hidden lines ;which defines 5 different base types of lines
4 ;graphic: dimensions, centerlines ;in two different thicknesses:
5 ;thick: visible lines ; * 01: full line, freehand line / zickzack line
6 : * 02: dash line
7 ; * 04: dash-dot line
8 ; * 05: dash-dot-dot line
9 ; type .1: thin
10 ; type .2: thick
11 ;for example: 04.1 is a thin dash-dot line
12 ;
13 ;The size of the lines can be computed by this rule:
14 ;l = linegroup
15 ;thick = 1 * l
16 ;thin = 1/2 * l
17 ;graphic = 5/7 * l
18 ;extra = 2 * l
19 ;
20 ;Linegroup 0.50 and 0.70 shall be used preferable,
21 ;where 0.50 shall be used for A4 to A2 and
22 ;0.70 shall be used for A1 and A0
23 ;
24 ;FreeCAD applies these thicknesses:
25 ;thin: hidden lines, dimensions, centerlines
26 ;graphic: graphical symbols, text
27 ;thick: visible lines, section lines
28 ;extra: not implemented
29 ;
30 ;Format of this file: *GroupName,thin,graphic,thick,extra
31 *FC 0.25mm,0.13,0.18,0.25,0.50
32 *FC 0.35mm,0.18,0.25,0.35,0.70
33 *FC 0.50mm,0.25,0.35,0.50,1.0
34 *FC 0.70mm,0.35,0.50,0.70,1.4
35 *FC 1.00mm,0.50,0.70,1.00,2.00
36 *FC 1.40mm,0.70,1.00,1.40,2.80
37 *FC 2.00mm,1.00,1.40,2.00,4.00
38
39
40
41