TechDrawGui::QGIViewDimension Class Reference

#include <QGIViewDimension.h>

Public Types

enum  { Type = QGraphicsItem::UserType + 106 }
 
- Public Types inherited from TechDrawGui::QGIView
enum  { Type = QGraphicsItem::UserType + 101 }
 

Public Slots

void datumLabelDragFinished (void)
 
void datumLabelDragged (bool ctrl)
 
void hover (bool state)
 
void onPrettyChanged (int state)
 
void select (bool state)
 
void updateDim ()
 
- Public Slots inherited from TechDrawGui::QGIView
virtual void onSourceChange (TechDraw::DrawView *newParent)
 

Public Member Functions

virtual QRectF boundingRect () const override
 
virtual void drawBorder () override
 
virtual QGIDatumLabelgetDatumLabel (void)
 
QString getLabelText (void)
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
 
virtual QColor prefNormalColor (void)
 
 QGIViewDimension ()
 
virtual void setGroupSelection (bool b) override
 
void setNormalColorAll (void)
 
void setPrettyNormal (void)
 
void setPrettyPre (void)
 
void setPrettySel (void)
 
void setViewPartFeature (TechDraw::DrawViewDimension *obj)
 
int type () const override
 
virtual void updateView (bool update=false) override
 
 ~QGIViewDimension ()=default
 
- Public Member Functions inherited from TechDrawGui::QGIView
virtual void addArbitraryItem (QGraphicsItem *qgi)
 
void alignTo (QGraphicsItem *, const QString &alignment)
 
virtual QRectF boundingRect () const override
 
virtual void draw (void)
 
virtual void drawBorder (void)
 
virtual void drawCaption (void)
 
QGIViewClipgetClipGroup (void)
 
virtual QColor getCurrentColor (void)
 
virtual bool getFrameState (void)
 
MDIViewPagegetMDIViewPage (void) const
 
virtual QColor getNormalColor (void)
 
virtual QColor getPreColor (void)
 
double getScale (void)
 
virtual QColor getSelectColor (void)
 
virtual QColor getSettingColor (void)
 
const char * getViewName () const
 
const std::string getViewNameAsString () const
 
TechDraw::DrawViewgetViewObject () const
 
virtual void isVisible (bool state)
 
virtual bool isVisible (void)
 
void makeMark (Base::Vector3d v, QColor c=Qt::red)
 
void makeMark (double x, double y, QColor c=Qt::red)
 
void makeMark (QPointF p, QColor c=Qt::red)
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
 
 QGIView ()
 
virtual void removeChild (QGIView *child)
 
virtual void rotateView (void)
 
virtual void setGroupSelection (bool b)
 
void setLocked (bool b)
 
virtual void setSettingColor (QColor c)
 
void setViewFeature (TechDraw::DrawView *obj)
 
virtual void toggleCache (bool state)
 
int type () const override
 
virtual void updateView (bool update=false)
 
virtual ~QGIView ()
 
void setPosition (qreal x, qreal y)
 Methods to ensure that Y-Coordinates are orientated correctly. More...
 
qreal getY ()
 
bool isInnerView ()
 
void isInnerView (bool state)
 
double getYInClip (double y)
 

Public Attributes

TechDraw::DrawViewDimensiondvDimension
 
- Public Attributes inherited from TechDrawGui::QGIView
boost::signals2::signal< void(QGIView *, QPointF)> signalSelectPoint
 

Protected Member Functions

void arrowPositionsToFeature (const Base::Vector2d positions[]) const
 
bool constructDimensionArc (const Base::Vector2d &arcCenter, double arcRadius, double endAngle, double startRotation, double handednessFactor, double jointRotation, const Base::BoundBox2d &labelRectangle, int arrowCount, int standardStyle, bool flipArrows, std::vector< std::pair< double, bool > > &outputMarking) const
 
bool constructDimensionLine (const Base::Vector2d &targetPoint, double lineAngle, double startPosition, double jointPosition, const Base::BoundBox2d &labelRectangle, int arrowCount, int standardStyle, bool flipArrows, std::vector< std::pair< double, bool > > &outputMarking) const
 
void draw () override
 
void drawAngle (TechDraw::DrawViewDimension *dimension, ViewProviderDimension *viewProvider) const
 
void drawArrows (int count, const Base::Vector2d positions[], double angles[], bool flipped) const
 
void drawDiameter (TechDraw::DrawViewDimension *dimension, ViewProviderDimension *viewProvider) const
 
void drawDimensionArc (QPainterPath &painterPath, const Base::Vector2d &arcCenter, double arcRadius, double endAngle, double startRotation, double jointAngle, const Base::BoundBox2d &labelRectangle, int arrowCount, int standardStyle, bool flipArrows) const
 
void drawDimensionLine (QPainterPath &painterPath, const Base::Vector2d &targetPoint, double lineAngle, double startPosition, double jointPosition, const Base::BoundBox2d &labelRectangle, int arrowCount, int standardStyle, bool flipArrows) const
 
void drawDistance (TechDraw::DrawViewDimension *dimension, ViewProviderDimension *viewProvider) const
 
void drawDistanceExecutive (const Base::Vector2d &startPoint, const Base::Vector2d &endPoint, double lineAngle, const Base::BoundBox2d &labelRectangle, int standardStyle, int renderExtent, bool flipArrows) const
 
void drawDistanceOverride (const Base::Vector2d &startPoint, const Base::Vector2d &endPoint, double lineAngle, const Base::BoundBox2d &labelRectangle, int standardStyle, int renderExtent, bool flipArrows, double extensionAngle) const
 
void drawMultiArc (QPainterPath &painterPath, const Base::Vector2d &arcCenter, double arcRadius, const std::vector< std::pair< double, bool > > &drawMarking) const
 
void drawMultiLine (QPainterPath &painterPath, const Base::Vector2d &lineOrigin, double lineAngle, const std::vector< std::pair< double, bool > > &drawMarking) const
 
void drawRadius (TechDraw::DrawViewDimension *dimension, ViewProviderDimension *viewProvider) const
 
void drawRadiusExecutive (const Base::Vector2d &centerPoint, const Base::Vector2d &midPoint, double radius, double endAngle, double startRotation, const Base::BoundBox2d &labelRectangle, double centerOverhang, int standardStyle, int renderExtent, bool flipArrow) const
 
void drawSingleArc (QPainterPath &painterPath, const Base::Vector2d &arcCenter, double arcRadius, double startAngle, double endAngle) const
 
void drawSingleLine (QPainterPath &painterPath, const Base::Vector2d &lineOrigin, double lineAngle, double startPosition, double endPosition) const
 
Base::Vector3d findIsoDir (Base::Vector3d ortho) const
 find the closest isometric axis given an ortho vector More...
 
Base::Vector3d findIsoExt (Base::Vector3d isoDir) const
 find the iso extension direction corresponding to an iso dist direction More...
 
Base::Vector2d getAsmeRefJointPoint (const Base::BoundBox2d &labelRectangle, bool right) const
 
Base::Vector2d getAsmeRefOutsetPoint (const Base::BoundBox2d &labelRectangle, bool right) const
 
Base::Vector2d getIsoRefJointPoint (const Base::BoundBox2d &labelRectangle, bool right) const
 
Base::Vector2d getIsoRefOutsetPoint (const Base::BoundBox2d &labelRectangle, bool right) const
 
QString getPrecision (void)
 
virtual QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 
void makeMarkC (double x, double y, QColor c=Qt::red) const
 
virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event) override
 
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 
void resetArrows (void) const
 
virtual void setPens (void)
 
virtual void setSvgPens (void)
 
- Protected Member Functions inherited from TechDrawGui::QGIView
virtual QRectF customChildrenBoundingRect (void) const
 
void dumpRect (const char *text, QRectF r)
 
Base::Reference< ParameterGrpgetParmGroupCol (void)
 
QGIViewgetQGIVByName (std::string name)
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override
 
QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 

Static Protected Member Functions

static int compareAngleStraightness (double straightAngle, double leftAngle, double rightAngle, double leftStrikeFactor, double rightStrikeFactor)
 
static double computeArcStrikeFactor (const Base::BoundBox2d &labelRectangle, const Base::Vector2d &arcCenter, double arcRadius, const std::vector< std::pair< double, bool > > &drawMarking)
 
static Base::Vector2d computeExtensionLinePoints (const Base::Vector2d &originPoint, const Base::Vector2d &linePoint, double hintAngle, double overhangSize, double gapSize, Base::Vector2d &startPoint)
 
static double computeLineAndLabelAngles (const Base::Vector2d &rotationCenter, const Base::Vector2d &labelCenter, double lineLabelDistance, double &lineAngle, double &labelAngle)
 
static double computeLineStrikeFactor (const Base::BoundBox2d &labelRectangle, const Base::Vector2d &lineOrigin, double lineAngle, const std::vector< std::pair< double, bool > > &drawMarking)
 
static Base::Vector2d computePerpendicularIntersection (const Base::Vector2d &linePoint, const Base::Vector2d &perpendicularPoint, double lineAngle)
 
static double getAnglePlacementFactor (double testAngle, double endAngle, double startRotation)
 
static double getIsoStandardLinePlacement (double labelAngle)
 
static double normalizeStartPosition (double &startPosition, double &lineAngle)
 
static double normalizeStartRotation (double &startRotation)
 

Protected Attributes

QGIArrowaHead1
 
QGIArrowaHead2
 
QGIDatumLabeldatumLabel
 
QGIDimLinesdimLines
 
bool hasHover
 
double m_lineWidth
 
- Protected Attributes inherited from TechDrawGui::QGIView
QHash< QString, QGraphicsItem * > alignHash
 
QGCustomBorderm_border
 
QBrush m_brush
 
QGICaptionm_caption
 
QColor m_colCurrent
 
QColor m_colNormal
 
QColor m_colPre
 
QColor m_colSel
 
QColor m_colSetting
 
QPen m_decorPen
 
int m_dragState
 
QFont m_font
 
bool m_innerView
 
QGCustomLabelm_label
 
QGCustomImagem_lock
 
bool m_locked
 
double m_lockHeight
 
double m_lockWidth
 
QPen m_pen
 
std::string viewName
 
TechDraw::DrawViewviewObj
 

Additional Inherited Members

- Static Public Member Functions inherited from TechDrawGui::QGIView
static int calculateFontPixelSize (double sizeInMillimetres)
 
static int calculateFontPixelWidth (const QFont &font)
 
static double getDimFontSize (void)
 
static QGSPagegetGraphicsScene (TechDraw::DrawView *dv)
 
static QGVPagegetGraphicsView (TechDraw::DrawView *dv)
 
static QString getPrefFont (void)
 
static double getPrefFontSize (void)
 
static Gui::ViewProvidergetViewProvider (App::DocumentObject *obj)
 
- Static Public Attributes inherited from TechDrawGui::QGIView
static const double DefaultFontSizeInMM = 5.0
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Constructor & Destructor Documentation

◆ QGIViewDimension()

◆ ~QGIViewDimension()

TechDrawGui::QGIViewDimension::~QGIViewDimension ( )
default

Member Function Documentation

◆ arrowPositionsToFeature()

void QGIViewDimension::arrowPositionsToFeature ( const Base::Vector2d  positions[]) const
protected

◆ boundingRect()

QRectF QGIViewDimension::boundingRect ( ) const
overridevirtual

◆ compareAngleStraightness()

int QGIViewDimension::compareAngleStraightness ( double  straightAngle,
double  leftAngle,
double  rightAngle,
double  leftStrikeFactor,
double  rightStrikeFactor 
)
staticprotected

◆ computeArcStrikeFactor()

double QGIViewDimension::computeArcStrikeFactor ( const Base::BoundBox2d labelRectangle,
const Base::Vector2d arcCenter,
double  arcRadius,
const std::vector< std::pair< double, bool > > &  drawMarking 
)
staticprotected

Referenced by drawAngle().

◆ computeExtensionLinePoints()

Base::Vector2d QGIViewDimension::computeExtensionLinePoints ( const Base::Vector2d originPoint,
const Base::Vector2d linePoint,
double  hintAngle,
double  overhangSize,
double  gapSize,
Base::Vector2d startPoint 
)
staticprotected

◆ computeLineAndLabelAngles()

double QGIViewDimension::computeLineAndLabelAngles ( const Base::Vector2d rotationCenter,
const Base::Vector2d labelCenter,
double  lineLabelDistance,
double &  lineAngle,
double &  labelAngle 
)
staticprotected

◆ computeLineStrikeFactor()

double QGIViewDimension::computeLineStrikeFactor ( const Base::BoundBox2d labelRectangle,
const Base::Vector2d lineOrigin,
double  lineAngle,
const std::vector< std::pair< double, bool > > &  drawMarking 
)
staticprotected

◆ computePerpendicularIntersection()

Base::Vector2d QGIViewDimension::computePerpendicularIntersection ( const Base::Vector2d linePoint,
const Base::Vector2d perpendicularPoint,
double  lineAngle 
)
staticprotected

◆ constructDimensionArc()

bool QGIViewDimension::constructDimensionArc ( const Base::Vector2d arcCenter,
double  arcRadius,
double  endAngle,
double  startRotation,
double  handednessFactor,
double  jointRotation,
const Base::BoundBox2d labelRectangle,
int  arrowCount,
int  standardStyle,
bool  flipArrows,
std::vector< std::pair< double, bool > > &  outputMarking 
) const
protected

◆ constructDimensionLine()

bool QGIViewDimension::constructDimensionLine ( const Base::Vector2d targetPoint,
double  lineAngle,
double  startPosition,
double  jointPosition,
const Base::BoundBox2d labelRectangle,
int  arrowCount,
int  standardStyle,
bool  flipArrows,
std::vector< std::pair< double, bool > > &  outputMarking 
) const
protected

◆ datumLabelDragFinished

◆ datumLabelDragged

void QGIViewDimension::datumLabelDragged ( bool  ctrl)
slot

References draw().

Referenced by QGIViewDimension().

◆ draw()

◆ drawAngle()

void QGIViewDimension::drawAngle ( TechDraw::DrawViewDimension dimension,
ViewProviderDimension viewProvider 
) const
protected

◆ drawArrows()

◆ drawBorder()

void QGIViewDimension::drawBorder ( void  )
overridevirtual

Reimplemented from TechDrawGui::QGIView.

◆ drawDiameter()

void QGIViewDimension::drawDiameter ( TechDraw::DrawViewDimension dimension,
ViewProviderDimension viewProvider 
) const
protected

◆ drawDimensionArc()

void QGIViewDimension::drawDimensionArc ( QPainterPath &  painterPath,
const Base::Vector2d arcCenter,
double  arcRadius,
double  endAngle,
double  startRotation,
double  jointAngle,
const Base::BoundBox2d labelRectangle,
int  arrowCount,
int  standardStyle,
bool  flipArrows 
) const
protected

◆ drawDimensionLine()

void QGIViewDimension::drawDimensionLine ( QPainterPath &  painterPath,
const Base::Vector2d targetPoint,
double  lineAngle,
double  startPosition,
double  jointPosition,
const Base::BoundBox2d labelRectangle,
int  arrowCount,
int  standardStyle,
bool  flipArrows 
) const
protected

◆ drawDistance()

◆ drawDistanceExecutive()

◆ drawDistanceOverride()

◆ drawMultiArc()

void QGIViewDimension::drawMultiArc ( QPainterPath &  painterPath,
const Base::Vector2d arcCenter,
double  arcRadius,
const std::vector< std::pair< double, bool > > &  drawMarking 
) const
protected

References drawSingleArc().

Referenced by drawDimensionArc().

◆ drawMultiLine()

void QGIViewDimension::drawMultiLine ( QPainterPath &  painterPath,
const Base::Vector2d lineOrigin,
double  lineAngle,
const std::vector< std::pair< double, bool > > &  drawMarking 
) const
protected

References drawSingleLine().

Referenced by drawDimensionLine().

◆ drawRadius()

◆ drawRadiusExecutive()

◆ drawSingleArc()

void QGIViewDimension::drawSingleArc ( QPainterPath &  painterPath,
const Base::Vector2d arcCenter,
double  arcRadius,
double  startAngle,
double  endAngle 
) const
protected

References Base::Vector2d::x, and Base::Vector2d::y.

Referenced by drawMultiArc().

◆ drawSingleLine()

void QGIViewDimension::drawSingleLine ( QPainterPath &  painterPath,
const Base::Vector2d lineOrigin,
double  lineAngle,
double  startPosition,
double  endPosition 
) const
protected

References Base::Vector2d::FromPolar().

Referenced by drawMultiLine().

◆ findIsoDir()

Base::Vector3d QGIViewDimension::findIsoDir ( Base::Vector3d  ortho) const
protected

find the closest isometric axis given an ortho vector

References Base::Vector3< _Precision >::GetAngle().

◆ findIsoExt()

Base::Vector3d QGIViewDimension::findIsoExt ( Base::Vector3d  isoDir) const
protected

find the iso extension direction corresponding to an iso dist direction

References Base::Console(), TechDrawGui::QGIView::getViewObject(), Base::Vector3< _Precision >::IsEqual(), and Base::ConsoleSingleton::Message().

◆ getAnglePlacementFactor()

double QGIViewDimension::getAnglePlacementFactor ( double  testAngle,
double  endAngle,
double  startRotation 
)
staticprotected

Referenced by drawRadiusExecutive().

◆ getAsmeRefJointPoint()

Base::Vector2d QGIViewDimension::getAsmeRefJointPoint ( const Base::BoundBox2d labelRectangle,
bool  right 
) const
protected

◆ getAsmeRefOutsetPoint()

Base::Vector2d QGIViewDimension::getAsmeRefOutsetPoint ( const Base::BoundBox2d labelRectangle,
bool  right 
) const
protected

◆ getDatumLabel()

virtual QGIDatumLabel * TechDrawGui::QGIViewDimension::getDatumLabel ( void  )
virtual

◆ getIsoRefJointPoint()

Base::Vector2d QGIViewDimension::getIsoRefJointPoint ( const Base::BoundBox2d labelRectangle,
bool  right 
) const
protected

◆ getIsoRefOutsetPoint()

Base::Vector2d QGIViewDimension::getIsoRefOutsetPoint ( const Base::BoundBox2d labelRectangle,
bool  right 
) const
protected

◆ getIsoStandardLinePlacement()

double QGIViewDimension::getIsoStandardLinePlacement ( double  labelAngle)
staticprotected

◆ getLabelText()

◆ getPrecision()

QString TechDrawGui::QGIViewDimension::getPrecision ( void  )
protected

◆ hover

void QGIViewDimension::hover ( bool  state)
slot

References draw(), and hasHover.

Referenced by QGIViewDimension().

◆ itemChange()

QVariant QGIViewDimension::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
overrideprotectedvirtual

◆ makeMarkC()

◆ mouseMoveEvent()

void QGIViewDimension::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotectedvirtual

◆ mousePressEvent()

void QGIViewDimension::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotectedvirtual

◆ mouseReleaseEvent()

void QGIViewDimension::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotectedvirtual

◆ normalizeStartPosition()

double QGIViewDimension::normalizeStartPosition ( double &  startPosition,
double &  lineAngle 
)
staticprotected

◆ normalizeStartRotation()

double QGIViewDimension::normalizeStartRotation ( double &  startRotation)
staticprotected

Referenced by drawAngle(), and drawDimensionArc().

◆ onPrettyChanged

void QGIViewDimension::onPrettyChanged ( int  state)
slot

◆ paint()

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

Reimplemented from TechDrawGui::QGIView.

References setPens(), and setSvgPens().

◆ prefNormalColor()

◆ resetArrows()

void QGIViewDimension::resetArrows ( void  ) const
protected

◆ select

void QGIViewDimension::select ( bool  state)
slot

Referenced by QGIViewDimension().

◆ setGroupSelection()

void QGIViewDimension::setGroupSelection ( bool  b)
overridevirtual

Reimplemented from TechDrawGui::QGIView.

References aHead1, aHead2, datumLabel, and dimLines.

◆ setNormalColorAll()

◆ setPens()

void QGIViewDimension::setPens ( void  )
protectedvirtual

◆ setPrettyNormal()

void QGIViewDimension::setPrettyNormal ( void  )

◆ setPrettyPre()

void QGIViewDimension::setPrettyPre ( void  )

◆ setPrettySel()

void QGIViewDimension::setPrettySel ( void  )

◆ setSvgPens()

void QGIViewDimension::setSvgPens ( void  )
protectedvirtual

◆ setViewPartFeature()

◆ type()

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

◆ updateDim

◆ updateView()

Member Data Documentation

◆ aHead1

◆ aHead2

◆ datumLabel

◆ dimLines

◆ dvDimension

TechDraw::DrawViewDimension* TechDrawGui::QGIViewDimension::dvDimension

◆ hasHover

bool TechDrawGui::QGIViewDimension::hasHover
protected

Referenced by hover().

◆ m_lineWidth

double TechDrawGui::QGIViewDimension::m_lineWidth
protected

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