#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::BaseGeom *base, TechDraw::LineSet &ls) |
QGraphicsPathItem * | geomToStubbyLine (TechDraw::BaseGeom *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=0) 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 () |
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) |
void | setStyle (int s) |
void | setStyle (Qt::PenStyle s) |
virtual void | setWidth (double w) |
int | type () const override |
~QGIPrimPath () | |
Protected Member Functions | |
double | calcOffset (TechDraw::BaseGeom *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 |
QGCustomSvg * | m_svg |
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 |
Member Enumeration Documentation
◆ anonymous enum
◆ fillMode
Constructor & Destructor Documentation
◆ QGIFace()
|
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_svg, m_svgCol, NoFill, PlainFill, TechDrawGui::QGIPrimPath::setFill(), setFillMode(), setLineWeight(), setPrettyNormal(), TechDrawGui::QGIPrimPath::setStyle(), and TechDrawGui::SVGCOLDEFAULT.
◆ ~QGIFace()
QGIFace::~QGIFace | ( | ) |
Member Function Documentation
◆ addLineSet()
void QGIFace::addLineSet | ( | TechDraw::LineSet & | ls | ) |
References m_lineSets.
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
◆ boundingRect()
|
override |
References shape().
◆ buildPixHatch()
void QGIFace::buildPixHatch | ( | ) |
References TechDrawGui::QGCustomRect::centerAt(), TechDrawGui::QGCustomImage::centerAt(), Base::Console(), Base::ConsoleSingleton::Error(), TechDrawGui::QGCustomImage::load(), m_fillScale, m_image, m_maxTile, m_rect, m_svgCol, m_svgXML, TechDrawGui::SVGCOLDEFAULT, TechDrawGui::SVGCOLPREFIX, TechDrawGui::SVGSIZEH, TechDrawGui::SVGSIZEW, and Base::ConsoleSingleton::Warning().
Referenced by draw().
◆ buildSvgHatch()
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, TechDrawGui::SVGCOLPREFIX, TechDrawGui::SVGSIZEH, TechDrawGui::SVGSIZEW, and Base::ConsoleSingleton::Warning().
Referenced by draw().
◆ calcOffset()
|
protected |
◆ clearFillItems()
void QGIFace::clearFillItems | ( | void | ) |
References m_fillItems.
Referenced by clearLineSets().
◆ clearLineSets()
void QGIFace::clearLineSets | ( | void | ) |
References clearFillItems(), and m_dashSpecs.
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
◆ clearSvg()
void QGIFace::clearSvg | ( | void | ) |
References hideSvg().
◆ dashedPPath()
|
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().
◆ dashRemain()
|
protected |
find remaining length of a dash pattern after offset
Referenced by lineSetToFillItems().
◆ decodeDashSpec()
|
protected |
convert from mm to scene units
References TechDraw::DashSpec::get(), TechDrawGui::Rez::guiX(), and m_fillScale.
Referenced by geomToLine(), geomToStubbyLine(), lineFromPoints(), and lineSetToFillItems().
◆ draw()
void QGIFace::draw | ( | ) |
References BitmapFill, buildPixHatch(), buildSvgHatch(), FromFile, 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(), setFillMode(), SvgFill, and textureFromBitmap().
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
◆ geomToLine()
QGraphicsPathItem * QGIFace::geomToLine | ( | TechDraw::BaseGeom * | base, |
TechDraw::LineSet & | ls | ||
) |
References dashedPPath(), decodeDashSpec(), TechDraw::LineSet::getDashSpec(), and TechDrawGui::Rez::guiX().
Referenced by lineSetToFillItems().
◆ geomToStubbyLine()
QGraphicsPathItem * QGIFace::geomToStubbyLine | ( | TechDraw::BaseGeom * | 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().
◆ getParameters()
|
protected |
◆ getProjIndex()
int TechDrawGui::QGIFace::getProjIndex | ( | ) | const |
◆ getXForm()
|
protected |
get zoom level (scale) from QGraphicsView
◆ hideSvg()
void QGIFace::hideSvg | ( | bool | b | ) |
References m_hideSvgTiles.
Referenced by clearSvg(), TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
◆ isHatched() [1/2]
void TechDrawGui::QGIFace::isHatched | ( | bool | s | ) |
◆ isHatched() [2/2]
bool TechDrawGui::QGIFace::isHatched | ( | void | ) |
Referenced by draw(), QGIFace(), setFillMode(), and setPrettyNormal().
◆ lineFromPoints()
QGraphicsPathItem * QGIFace::lineFromPoints | ( | Base::Vector3d | start, |
Base::Vector3d | end, | ||
TechDraw::DashSpec | ds | ||
) |
References dashedPPath(), decodeDashSpec(), and TechDrawGui::Rez::guiX().
Referenced by lineSetToFillItems().
◆ 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().
◆ loadSvgHatch()
void QGIFace::loadSvgHatch | ( | std::string | fileSpec | ) |
References Base::Console(), Base::ConsoleSingleton::Error(), TechDrawGui::QGCustomSvg::load(), m_svg, and m_svgXML.
Referenced by draw().
◆ makeMark()
|
protected |
References TechDrawGui::QGICMark::setSize(), TechDrawGui::QGICMark::setThick(), and ZVALUE::VERTEX.
◆ offsetDash()
|
protected |
convert a dash pattern to an offset dash pattern (ie offset -> end)
Referenced by geomToStubbyLine().
◆ paint()
|
overridevirtual |
Reimplemented from TechDrawGui::QGIPrimPath.
References TechDrawGui::QGIPrimPath::paint().
◆ setDrawEdges()
void QGIFace::setDrawEdges | ( | bool | b | ) |
References TechDrawGui::QGIPrimPath::setStyle().
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
◆ setFillMode()
void QGIFace::setFillMode | ( | QGIFace::fillMode | m | ) |
References isHatched(), m_mode, NoFill, and PlainFill.
Referenced by draw(), TechDrawGui::QGIViewSection::drawSectionFace(), TechDrawGui::QGIViewPart::drawViewPart(), and QGIFace().
◆ setGeomHatchWeight()
void TechDrawGui::QGIFace::setGeomHatchWeight | ( | double | w | ) |
◆ setGeomPen()
|
protected |
References TechDrawGui::Rez::guiX().
Referenced by lineSetToFillItems().
◆ setHatchColor()
void QGIFace::setHatchColor | ( | App::Color | c | ) |
References m_svgCol.
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
◆ setHatchFile()
void QGIFace::setHatchFile | ( | std::string | fileSpec | ) |
References m_fileSpec.
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
◆ setHatchScale()
void QGIFace::setHatchScale | ( | double | s | ) |
References m_fillScale.
Referenced by TechDrawGui::QGIViewSection::drawSectionFace(), and TechDrawGui::QGIViewPart::drawViewPart().
◆ setLineWeight()
void QGIFace::setLineWeight | ( | double | w | ) |
◆ setOutline()
|
virtual |
Referenced by TechDrawGui::QGIViewPart::drawFace().
◆ setPrettyNormal()
|
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().
◆ setPrettyPre()
|
overridevirtual |
Reimplemented from TechDrawGui::QGIPrimPath.
References TechDrawGui::QGIPrimPath::m_brush, and TechDrawGui::QGIPrimPath::setPrettyPre().
◆ setPrettySel()
|
overridevirtual |
Reimplemented from TechDrawGui::QGIPrimPath.
References TechDrawGui::QGIPrimPath::m_brush, and TechDrawGui::QGIPrimPath::setPrettySel().
◆ shape()
|
overridevirtual |
Reimplemented from TechDrawGui::QGIPrimPath.
Referenced by boundingRect().
◆ textureFromBitmap()
QPixmap QGIFace::textureFromBitmap | ( | std::string | fileSpec | ) |
References TechDrawGui::Rez::guiX(), and m_fillScale.
Referenced by draw().
◆ textureFromSvg()
QPixmap QGIFace::textureFromSvg | ( | std::string | fillSpec | ) |
References m_fillScale.
◆ type()
|
override |
Member Data Documentation
◆ m_dashSpecs
|
protected |
Referenced by clearLineSets().
◆ m_fileSpec
|
protected |
Referenced by draw(), and setHatchFile().
◆ m_fillItems
|
protected |
Referenced by clearFillItems(), geomToStubbyLine(), and lineSetToFillItems().
◆ m_fillScale
|
protected |
◆ m_hideSvgTiles
◆ m_image
|
protected |
Referenced by buildPixHatch(), draw(), and QGIFace().
◆ m_isHatched
|
protected |
◆ m_lineSets
|
protected |
Referenced by addLineSet(), and draw().
◆ m_maxSeg
|
protected |
Referenced by getParameters(), and lineSetToFillItems().
◆ m_maxTile
|
protected |
Referenced by buildPixHatch(), buildSvgHatch(), and getParameters().
◆ m_mode
|
protected |
Referenced by draw(), setFillMode(), and setPrettyNormal().
◆ m_rect
|
protected |
Referenced by buildPixHatch(), buildSvgHatch(), draw(), and QGIFace().
◆ m_segCount
|
protected |
Referenced by dashedPPath(), lineSetToFillItems(), and QGIFace().
◆ m_svg
|
protected |
Referenced by loadSvgHatch(), and QGIFace().
◆ m_svgCol
|
protected |
Referenced by buildPixHatch(), buildSvgHatch(), QGIFace(), and setHatchColor().
◆ m_svgXML
|
protected |
Referenced by buildPixHatch(), buildSvgHatch(), and loadSvgHatch().
◆ projIndex
|
protected |
The documentation for this class was generated from the following files:
- src/Mod/TechDraw/Gui/QGIFace.h
- src/Mod/TechDraw/Gui/QGIFace.cpp