[TD]ANSI/ASME section line conformance

This commit is contained in:
wandererfan
2024-02-19 08:48:56 -05:00
committed by WandererFan
parent 23741ffa77
commit 289c386f6b
10 changed files with 30 additions and 65 deletions

View File

@@ -33,6 +33,8 @@
#include <Base/Parameter.h>
#include <Base/Tools.h>
#include <Mod/TechDraw/App/Preferences.h>
#include "QGISectionLine.h"
#include "PreferencesGui.h"
#include "QGIArrow.h"
@@ -73,7 +75,6 @@ QGISectionLine::QGISectionLine() :
addToGroup(m_symbol2);
setWidth(Rez::guiX(0.75)); //a default?
setStyle(getSectionStyle());
setColor(getSectionColor());
}
@@ -81,7 +82,7 @@ QGISectionLine::QGISectionLine() :
void QGISectionLine::draw()
{
prepareGeometryChange();
int format = getPrefSectionStandard();
int format = Preferences::sectionLineConvention();
if (format == ANSISTANDARD) { //"ASME"/"ANSI"
extensionEndsTrad();
} else {
@@ -128,7 +129,7 @@ void QGISectionLine::makeSectionLine()
void QGISectionLine::makeArrows()
{
int format = getPrefSectionStandard();
int format = Preferences::sectionLineConvention();
if (format == ANSISTANDARD) {
makeArrowsTrad();
} else {
@@ -193,7 +194,7 @@ void QGISectionLine::makeArrowsTrad()
void QGISectionLine::makeSymbols()
{
int format = getPrefSectionStandard();
int format = Preferences::sectionLineConvention();
if (format == ANSISTANDARD) {
makeSymbolsTrad();
} else {
@@ -471,25 +472,6 @@ QColor QGISectionLine::getSectionColor()
return PreferencesGui::sectionLineQColor();
}
//SectionLineStyle
void QGISectionLine::setSectionStyle(int style)
{
Qt::PenStyle sectStyle = static_cast<Qt::PenStyle> (style);
setStyle(sectStyle);
}
Qt::PenStyle QGISectionLine::getSectionStyle()
{
return PreferencesGui::sectionLineStyle();
}
//ASME("traditional") vs ISO("reference arrow method") arrows
int QGISectionLine::getPrefSectionStandard()
{
return Preferences::getPreferenceGroup("Standards")->GetInt("SectionLineStandard", ISOSTANDARD);
}
void QGISectionLine::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) {
QStyleOptionGraphicsItem myOption(*option);
myOption.state &= ~QStyle::State_Selected;