TechDrawGui::QGIFace Class Reference

#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< ParameterGrpgetParmGroup (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::DashSpecm_dashSpecs
 
std::string m_fileSpec
 
std::vector< QGraphicsPathItem * > m_fillItems
 
double m_fillScale
 
bool m_hideSvgTiles
 
QGCustomImagem_image
 
bool m_isHatched
 
std::vector< TechDraw::LineSetm_lineSets
 
long int m_maxSeg
 
long int m_maxTile
 
QGIFace::fillMode m_mode
 
QGCustomRectm_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
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

◆ fillMode

Enumerator
NoFill 
FromFile 
SvgFill 
BitmapFill 
GeomHatchFill 
PlainFill 

Constructor & Destructor Documentation

◆ QGIFace()

◆ ~QGIFace()

QGIFace::~QGIFace ( )

Member Function Documentation

◆ addLineSet()

◆ boundingRect()

QRectF QGIFace::boundingRect ( ) const
override

References shape().

◆ buildPixHatch()

◆ buildSvgHatch()

◆ calcOffset()

double TechDrawGui::QGIFace::calcOffset ( TechDraw::BaseGeomPtr  g,
TechDraw::LineSet  ls 
)
protected

◆ clearFillItems()

void QGIFace::clearFillItems ( void  )

References m_fillItems.

Referenced by clearLineSets().

◆ clearLineSets()

void QGIFace::clearLineSets ( void  )

◆ clearSvg()

void QGIFace::clearSvg ( void  )

References hideSvg().

◆ dashedPPath()

QPainterPath QGIFace::dashedPPath ( const std::vector< double >  dv,
const Base::Vector3d  start,
const Base::Vector3d  end 
)
protected

◆ dashRemain()

double QGIFace::dashRemain ( const std::vector< double >  dv,
const double  offset 
)
protected

find remaining length of a dash pattern after offset

References draftfunctions.offset::offset().

Referenced by lineSetToFillItems().

◆ decodeDashSpec()

std::vector< double > QGIFace::decodeDashSpec ( TechDraw::DashSpec  d)
protected

◆ draw()

◆ geomToLine()

QGraphicsPathItem * QGIFace::geomToLine ( TechDraw::BaseGeomPtr  base,
TechDraw::LineSet ls 
)

◆ geomToStubbyLine()

QGraphicsPathItem * QGIFace::geomToStubbyLine ( TechDraw::BaseGeomPtr  base,
double  offset,
TechDraw::LineSet ls 
)

◆ getParameters()

◆ getProjIndex()

int TechDrawGui::QGIFace::getProjIndex ( ) const

References projIndex.

◆ getXForm()

double QGIFace::getXForm ( void  )
protected

get zoom level (scale) from QGraphicsView

◆ hideSvg()

◆ isHatched() [1/2]

void TechDrawGui::QGIFace::isHatched ( bool  s)

◆ isHatched() [2/2]

bool TechDrawGui::QGIFace::isHatched ( void  )

References m_isHatched.

Referenced by draw(), QGIFace(), setFillMode(), and setPrettyNormal().

◆ lineFromPoints()

QGraphicsPathItem * QGIFace::lineFromPoints ( Base::Vector3d  start,
Base::Vector3d  end,
TechDraw::DashSpec  ds 
)

◆ lineSetToFillItems()

◆ loadSvgHatch()

void QGIFace::loadSvgHatch ( std::string  fileSpec)

◆ makeMark()

void QGIFace::makeMark ( double  x,
double  y 
)
protected

◆ offsetDash()

std::vector< double > QGIFace::offsetDash ( const std::vector< double >  dv,
const double  offset 
)
protected

convert a dash pattern to an offset dash pattern (ie offset -> end)

References draftfunctions.offset::offset().

Referenced by geomToStubbyLine().

◆ paint()

void QGIFace::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget widget = nullptr 
)
overridevirtual

◆ setDrawEdges()

◆ setFillMode()

◆ setGeomHatchWeight()

void TechDrawGui::QGIFace::setGeomHatchWeight ( double  w)

◆ setGeomPen()

QPen QGIFace::setGeomPen ( void  )
protected

References TechDrawGui::Rez::guiX().

Referenced by lineSetToFillItems().

◆ setHatchColor()

void QGIFace::setHatchColor ( App::Color  c)

◆ setHatchFile()

void QGIFace::setHatchFile ( std::string  fileSpec)

◆ setHatchScale()

void QGIFace::setHatchScale ( double  s)

◆ setLineWeight()

void QGIFace::setLineWeight ( double  w)

◆ setOutline()

void QGIFace::setOutline ( const QPainterPath &  path)
virtual

◆ setPrettyNormal()

◆ setPrettyPre()

void QGIFace::setPrettyPre ( void  )
overridevirtual

◆ setPrettySel()

void QGIFace::setPrettySel ( void  )
overridevirtual

◆ shape()

◆ textureFromBitmap()

QPixmap QGIFace::textureFromBitmap ( std::string  fileSpec)

References Base::Console(), and Base::ConsoleSingleton::Error().

Referenced by draw().

◆ textureFromSvg()

QPixmap QGIFace::textureFromSvg ( std::string  fillSpec)

References m_fillScale.

◆ type()

int TechDrawGui::QGIFace::type ( void  ) const
override

Member Data Documentation

◆ m_dashSpecs

std::vector<TechDraw::DashSpec> TechDrawGui::QGIFace::m_dashSpecs
protected

Referenced by clearLineSets().

◆ m_fileSpec

std::string TechDrawGui::QGIFace::m_fileSpec
protected

Referenced by draw(), and setHatchFile().

◆ m_fillItems

std::vector<QGraphicsPathItem*> TechDrawGui::QGIFace::m_fillItems
protected

◆ m_fillScale

double TechDrawGui::QGIFace::m_fillScale
protected

◆ m_hideSvgTiles

bool TechDrawGui::QGIFace::m_hideSvgTiles
protected

Referenced by draw(), and hideSvg().

◆ m_image

QGCustomImage* TechDrawGui::QGIFace::m_image
protected

Referenced by buildPixHatch(), draw(), and QGIFace().

◆ m_isHatched

bool TechDrawGui::QGIFace::m_isHatched
protected

Referenced by isHatched().

◆ m_lineSets

std::vector<TechDraw::LineSet> TechDrawGui::QGIFace::m_lineSets
protected

Referenced by addLineSet(), and draw().

◆ m_maxSeg

long int TechDrawGui::QGIFace::m_maxSeg
protected

◆ m_maxTile

long int TechDrawGui::QGIFace::m_maxTile
protected

◆ m_mode

QGIFace::fillMode TechDrawGui::QGIFace::m_mode
protected

Referenced by draw(), setFillMode(), and setPrettyNormal().

◆ m_rect

QGCustomRect* TechDrawGui::QGIFace::m_rect
protected

◆ m_segCount

long int TechDrawGui::QGIFace::m_segCount
protected

◆ m_svgCol

std::string TechDrawGui::QGIFace::m_svgCol
protected

◆ m_svgXML

QByteArray TechDrawGui::QGIFace::m_svgXML
protected

◆ projIndex

int TechDrawGui::QGIFace::projIndex
protected

Referenced by getProjIndex().

◆ SVGCOLPREFIX

std::string TechDrawGui::QGIFace::SVGCOLPREFIX = ""

The documentation for this class was generated from the following files: