#include <QGIFace.h>
Public Types | |
enum | { Type = QGraphicsItem::UserType + 104 } |
enum | fillMode { NoFill , FromFile , SvgFill , BitmapFill , GeomHatchFill , PlainFill } |
Public Types inherited from TechDrawGui::QGIPrimPath | |
enum | { Type = QGraphicsItem::UserType + 170 } |
Public Member Functions | |
void | addLineSet (TechDraw::LineSet &ls) |
QRectF | boundingRect () const override |
void | buildPixHatch () |
void | buildSvgHatch (void) |
void | clearFillItems (void) |
void | clearLineSets (void) |
void | clearSvg (void) |
void | draw () |
QGraphicsPathItem * | geomToLine (TechDraw::BaseGeomPtr base, TechDraw::LineSet &ls) |
QGraphicsPathItem * | geomToStubbyLine (TechDraw::BaseGeomPtr base, double offset, TechDraw::LineSet &ls) |
make a fragment (length = remain) of a dashed line, with pattern starting at +offset More... | |
int | getProjIndex () const |
void | hideSvg (bool b) |
void | isHatched (bool s) |
bool | isHatched (void) |
QGraphicsPathItem * | lineFromPoints (Base::Vector3d start, Base::Vector3d end, TechDraw::DashSpec ds) |
void | lineSetToFillItems (TechDraw::LineSet &ls) |
void | loadSvgHatch (std::string fileSpec) |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override |
QGIFace (int index=-1) | |
void | setDrawEdges (bool b) |
void | setFillMode (fillMode m) |
void | setGeomHatchWeight (double w) |
void | setHatchColor (App::Color c) |
void | setHatchFile (std::string fileSpec) |
void | setHatchScale (double s) |
void | setLineWeight (double w) |
virtual void | setOutline (const QPainterPath &path) |
virtual void | setPrettyNormal () override |
virtual void | setPrettyPre () override |
virtual void | setPrettySel () override |
QPainterPath | shape () const override |
QPixmap | textureFromBitmap (std::string fileSpec) |
QPixmap | textureFromSvg (std::string fillSpec) |
int | type () const override |
~QGIFace () | |
Public Member Functions inherited from TechDrawGui::QGIPrimPath | |
QColor | getFillColor (void) |
Qt::BrushStyle | getFillStyle () |
Qt::PenStyle | getStyle () |
virtual double | getWidth () |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override |
QGIPrimPath () | |
void | resetFill () |
virtual void | setCapStyle (Qt::PenCapStyle c) |
void | setFill (QBrush b) |
void | setFill (QColor c, Qt::BrushStyle s) |
void | setFillColor (QColor c) |
void | setFillOverride (bool b) |
void | setFillStyle (Qt::BrushStyle f) |
void | setHighlighted (bool state) |
virtual void | setNormalColor (QColor c) |
virtual void | setPrettyNormal () |
virtual void | setPrettyPre () |
virtual void | setPrettySel () |
void | setStyle (int s) |
void | setStyle (Qt::PenStyle s) |
virtual void | setWidth (double w) |
virtual QPainterPath | shape () const override |
int | type () const override |
~QGIPrimPath () | |
Public Attributes | |
std::string | SVGCOLPREFIX = "" |
Protected Member Functions | |
double | calcOffset (TechDraw::BaseGeomPtr g, TechDraw::LineSet ls) |
QPainterPath | dashedPPath (const std::vector< double > dv, const Base::Vector3d start, const Base::Vector3d end) |
make a dashed QPainterPath from start to end in scene coords More... | |
double | dashRemain (const std::vector< double > dv, const double offset) |
find remaining length of a dash pattern after offset More... | |
std::vector< double > | decodeDashSpec (TechDraw::DashSpec d) |
convert from mm to scene units More... | |
void | getParameters (void) |
double | getXForm (void) |
get zoom level (scale) from QGraphicsView More... | |
void | makeMark (double x, double y) |
std::vector< double > | offsetDash (const std::vector< double > dv, const double offset) |
convert a dash pattern to an offset dash pattern (ie offset -> end) More... | |
QPen | setGeomPen (void) |
Protected Member Functions inherited from TechDrawGui::QGIPrimPath | |
virtual QColor | getNormalColor (void) |
Base::Reference< ParameterGrp > | getParmGroup (void) |
virtual QColor | getPreColor (void) |
virtual QColor | getSelectColor (void) |
virtual void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) override |
virtual void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override |
virtual QVariant | itemChange (GraphicsItemChange change, const QVariant &value) override |
virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event) override |
virtual Qt::PenCapStyle | prefCapStyle (void) |
Protected Attributes | |
std::vector< TechDraw::DashSpec > | m_dashSpecs |
std::string | m_fileSpec |
std::vector< QGraphicsPathItem * > | m_fillItems |
double | m_fillScale |
bool | m_hideSvgTiles |
QGCustomImage * | m_image |
bool | m_isHatched |
std::vector< TechDraw::LineSet > | m_lineSets |
long int | m_maxSeg |
long int | m_maxTile |
QGIFace::fillMode | m_mode |
QGCustomRect * | m_rect |
long int | m_segCount |
std::string | m_svgCol |
QByteArray | m_svgXML |
int | projIndex |
Protected Attributes inherited from TechDrawGui::QGIPrimPath | |
bool | isHighlighted |
QBrush | m_brush |
Qt::PenCapStyle | m_capStyle |
QColor | m_colCurrent |
QColor | m_colDefFill |
QColor | m_colNormal |
QColor | m_colNormalFill |
bool | m_colOverride |
QColor | m_fillColorCurrent |
bool | m_fillOverride |
Qt::BrushStyle | m_fillStyleCurrent |
QPen | m_pen |
Qt::PenStyle | m_styleCurrent |
Qt::BrushStyle | m_styleDef |
Qt::BrushStyle | m_styleNormal |
Qt::BrushStyle | m_styleSelect |
double | m_width |
|
explicit |
References getParameters(), isHatched(), TechDrawGui::QGIPrimPath::m_colDefFill, m_fillScale, m_image, m_rect, m_segCount, TechDrawGui::QGIPrimPath::m_styleDef, TechDrawGui::QGIPrimPath::m_styleSelect, m_svgCol, NoFill, PlainFill, TechDrawGui::QGIPrimPath::setFill(), setFillMode(), setLineWeight(), setPrettyNormal(), TechDrawGui::QGIPrimPath::setStyle(), and TechDrawGui::SVGCOLDEFAULT.
QGIFace::~QGIFace | ( | ) |
void QGIFace::addLineSet | ( | TechDraw::LineSet & | ls | ) |
References m_lineSets.
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
|
override |
References shape().
void QGIFace::buildPixHatch | ( | ) |
References TechDrawGui::QGCustomImage::centerAt(), TechDrawGui::QGCustomRect::centerAt(), Base::Console(), Base::ConsoleSingleton::Error(), TechDrawGui::QGCustomImage::load(), m_fillScale, m_image, m_maxTile, m_rect, m_svgCol, m_svgXML, TechDrawGui::SVGCOLDEFAULT, SVGCOLPREFIX, TechDrawGui::SVGSIZEH, TechDrawGui::SVGSIZEW, and Base::ConsoleSingleton::Warning().
Referenced by draw().
void QGIFace::buildSvgHatch | ( | void | ) |
References TechDrawGui::QGCustomRect::centerAt(), Base::Console(), TechDrawGui::QGCustomSvg::load(), m_fillScale, m_maxTile, m_rect, m_svgCol, m_svgXML, TechDrawGui::SVGCOLDEFAULT, SVGCOLPREFIX, TechDrawGui::SVGSIZEH, TechDrawGui::SVGSIZEW, and Base::ConsoleSingleton::Warning().
Referenced by draw().
|
protected |
void QGIFace::clearFillItems | ( | void | ) |
References m_fillItems.
Referenced by clearLineSets().
void QGIFace::clearLineSets | ( | void | ) |
References clearFillItems(), and m_dashSpecs.
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
void QGIFace::clearSvg | ( | void | ) |
References hideSvg().
|
protected |
make a dashed QPainterPath from start to end in scene coords
References Base::Console(), m_segCount, Base::Vector3< _Precision >::Normalize(), Base::ConsoleSingleton::Warning(), Base::Vector3< _Precision >::x, and Base::Vector3< _Precision >::y.
Referenced by geomToLine(), geomToStubbyLine(), and lineFromPoints().
|
protected |
find remaining length of a dash pattern after offset
References draftfunctions.offset::offset().
Referenced by lineSetToFillItems().
|
protected |
convert from mm to scene units
References TechDraw::DashSpec::get(), TechDrawGui::Rez::guiX(), and m_fillScale.
Referenced by geomToLine(), geomToStubbyLine(), lineFromPoints(), and lineSetToFillItems().
void QGIFace::draw | ( | void | ) |
References BitmapFill, buildPixHatch(), buildSvgHatch(), GeomHatchFill, isHatched(), lineSetToFillItems(), loadSvgHatch(), TechDrawGui::QGIPrimPath::m_brush, TechDrawGui::QGIPrimPath::m_colNormalFill, m_fileSpec, TechDrawGui::QGIPrimPath::m_fillStyleCurrent, m_hideSvgTiles, m_image, m_lineSets, m_mode, m_rect, TechDrawGui::QGIPrimPath::m_styleDef, TechDrawGui::QGIPrimPath::m_styleNormal, PlainFill, TechDrawGui::QGIPrimPath::setFill(), SvgFill, and textureFromBitmap().
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
QGraphicsPathItem * QGIFace::geomToLine | ( | TechDraw::BaseGeomPtr | base, |
TechDraw::LineSet & | ls | ||
) |
References dashedPPath(), decodeDashSpec(), TechDraw::LineSet::getDashSpec(), and TechDrawGui::Rez::guiX().
Referenced by lineSetToFillItems().
QGraphicsPathItem * QGIFace::geomToStubbyLine | ( | TechDraw::BaseGeomPtr | base, |
double | offset, | ||
TechDraw::LineSet & | ls | ||
) |
make a fragment (length = remain) of a dashed line, with pattern starting at +offset
References TechDrawGui::Rez::appX(), dashedPPath(), decodeDashSpec(), TechDraw::LineSet::getDashSpec(), TechDraw::LineSet::getUnitDir(), TechDrawGui::Rez::guiX(), TechDraw::DashSpec::length(), m_fillItems, m_fillScale, and offsetDash().
Referenced by lineSetToFillItems().
|
protected |
|
protected |
get zoom level (scale) from QGraphicsView
void QGIFace::hideSvg | ( | bool | b | ) |
References m_hideSvgTiles.
Referenced by clearSvg(), TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
void TechDrawGui::QGIFace::isHatched | ( | bool | s | ) |
References m_isHatched.
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
bool TechDrawGui::QGIFace::isHatched | ( | void | ) |
References m_isHatched.
Referenced by draw(), QGIFace(), setFillMode(), and setPrettyNormal().
QGraphicsPathItem * QGIFace::lineFromPoints | ( | Base::Vector3d | start, |
Base::Vector3d | end, | ||
TechDraw::DashSpec | ds | ||
) |
References dashedPPath(), decodeDashSpec(), and TechDrawGui::Rez::guiX().
Referenced by lineSetToFillItems().
void QGIFace::lineSetToFillItems | ( | TechDraw::LineSet & | ls | ) |
References Base::Console(), dashRemain(), decodeDashSpec(), geomToLine(), geomToStubbyLine(), TechDraw::LineSet::getDashSpec(), TechDraw::LineSet::getGeoms(), TechDraw::LineSet::getPatternStartPoint(), TechDrawGui::Rez::guiX(), TechDraw::LineSet::isDashed(), Base::Vector3< _Precision >::IsEqual(), lineFromPoints(), m_fillItems, m_fillScale, m_maxSeg, m_segCount, TechDraw::DashSpec::reversed(), setGeomPen(), and Base::ConsoleSingleton::Warning().
Referenced by draw().
void QGIFace::loadSvgHatch | ( | std::string | fileSpec | ) |
References Base::Console(), Base::ConsoleSingleton::Error(), m_svgXML, and SVGCOLPREFIX.
Referenced by draw().
|
protected |
References TechDrawGui::QGICMark::setSize(), TechDrawGui::QGICMark::setThick(), and ZVALUE::VERTEX.
|
protected |
convert a dash pattern to an offset dash pattern (ie offset -> end)
References draftfunctions.offset::offset().
Referenced by geomToStubbyLine().
|
overridevirtual |
Reimplemented from TechDrawGui::QGIPrimPath.
References TechDrawGui::QGIPrimPath::paint().
void QGIFace::setDrawEdges | ( | bool | b | ) |
References TechDrawGui::QGIPrimPath::setStyle().
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
void QGIFace::setFillMode | ( | QGIFace::fillMode | m | ) |
References isHatched(), m_mode, NoFill, and PlainFill.
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), TechDrawGui::QGIViewPart::drawViewPart(), and QGIFace().
void TechDrawGui::QGIFace::setGeomHatchWeight | ( | double | w | ) |
|
protected |
References TechDrawGui::Rez::guiX().
Referenced by lineSetToFillItems().
void QGIFace::setHatchColor | ( | App::Color | c | ) |
References m_svgCol.
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
void QGIFace::setHatchFile | ( | std::string | fileSpec | ) |
References m_fileSpec.
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
void QGIFace::setHatchScale | ( | double | s | ) |
References m_fillScale.
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
void QGIFace::setLineWeight | ( | double | w | ) |
|
virtual |
Referenced by TechDrawGui::QGIViewPart::drawFace().
|
overridevirtual |
Reimplemented from TechDrawGui::QGIPrimPath.
References BitmapFill, isHatched(), TechDrawGui::QGIPrimPath::m_brush, TechDrawGui::QGIPrimPath::m_fillStyleCurrent, m_mode, and TechDrawGui::QGIPrimPath::setPrettyNormal().
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), TechDrawGui::QGIViewPart::drawViewPart(), and QGIFace().
|
overridevirtual |
Reimplemented from TechDrawGui::QGIPrimPath.
References TechDrawGui::QGIPrimPath::m_brush, TechDrawGui::QGIPrimPath::m_fillStyleCurrent, and TechDrawGui::QGIPrimPath::setPrettyPre().
|
overridevirtual |
Reimplemented from TechDrawGui::QGIPrimPath.
References TechDrawGui::QGIPrimPath::m_brush, TechDrawGui::QGIPrimPath::m_fillStyleCurrent, and TechDrawGui::QGIPrimPath::setPrettySel().
|
overridevirtual |
QPixmap QGIFace::textureFromBitmap | ( | std::string | fileSpec | ) |
References Base::Console(), and Base::ConsoleSingleton::Error().
Referenced by draw().
QPixmap QGIFace::textureFromSvg | ( | std::string | fillSpec | ) |
References m_fillScale.
|
override |
References Type.
Referenced by ArchProfile.ProfileTaskPanel::accept(), and ArchProfile.ProfileTaskPanel::retranslateUi().
|
protected |
Referenced by clearLineSets().
|
protected |
Referenced by draw(), and setHatchFile().
|
protected |
Referenced by clearFillItems(), geomToStubbyLine(), and lineSetToFillItems().
|
protected |
Referenced by buildPixHatch(), buildSvgHatch(), decodeDashSpec(), geomToStubbyLine(), lineSetToFillItems(), QGIFace(), setHatchScale(), and textureFromSvg().
|
protected |
Referenced by buildPixHatch(), draw(), and QGIFace().
|
protected |
Referenced by isHatched().
|
protected |
Referenced by addLineSet(), and draw().
|
protected |
Referenced by getParameters(), and lineSetToFillItems().
|
protected |
Referenced by buildPixHatch(), buildSvgHatch(), and getParameters().
|
protected |
Referenced by draw(), setFillMode(), and setPrettyNormal().
|
protected |
Referenced by buildPixHatch(), buildSvgHatch(), draw(), and QGIFace().
|
protected |
Referenced by dashedPPath(), lineSetToFillItems(), and QGIFace().
|
protected |
Referenced by buildPixHatch(), buildSvgHatch(), QGIFace(), and setHatchColor().
|
protected |
Referenced by buildPixHatch(), buildSvgHatch(), and loadSvgHatch().
|
protected |
Referenced by getProjIndex().
std::string TechDrawGui::QGIFace::SVGCOLPREFIX = "" |
Referenced by buildPixHatch(), buildSvgHatch(), and loadSvgHatch().