Skip to content

RDimensionData

Class in Entity Module
Header: #include <src/entity/RDimensionData.h>
Inherits: REntityData
Inherited by: RDimAngularData, RDimDiametricData, RDimLinearData, RDimOrdinateData, RDimRadialData

Base class for dimension entity data classes.

Scriptable: This class is available in script environments.

RDimensionData(const RVector &definitionPoint, const RVector &textPositionCenter, RS::VAlign valign, RS::HAlign halign, RS::TextLineSpacingStyle lineSpacingStyle, double lineSpacingFactor, const QString &text, const QString &fontName, double textRotation)
RDimensionData(RDocument *document=NULL)
void adjustExtensionLineFixLength(RLine &extLine1, RLine &extLine2, bool addDimExe=true) const
void clearStyleOverrides()
virtual bool clickReferencePoint(const RVector &referencePoint)
Called when user clicks a reference point.
QString formatAngleLabel(double textAngle) const
QString formatLabel(double distance) const
virtual QString getAutoLabel() const
bool getBoolOverride(RS::KnownVariable key) const
virtual RBox getBoundingBox(bool ignoreEmpty=false) const
RColor getColorOverride(RS::KnownVariable key) const
RVector getDefinitionPoint() const
int getDimadec() const
double getDimasz() const
int getDimaunit() const
int getDimazin() const
int getDimblk() const
QString getDimblkName() const
QString getDimBlockName() const
RColor getDimclrt() const
int getDimdec() const
double getDimdli() const
int getDimdsep() const
QSharedPointer< RBlockReferenceEntity > getDimensionBlockReference() const
double getDimexe() const
double getDimexo() const
double getDimgap() const
int getDimjust() const
double getDimlfac() const
int getDimlunit() const
double getDimscale() const
int getDimtad() const
bool getDimtih() const
double getDimtsz() const
double getDimtxt() const
bool getDimXBool(RS::KnownVariable key) const
RColor getDimXColor(RS::KnownVariable key) const
double getDimXDouble(RS::KnownVariable key) const
int getDimXInt(RS::KnownVariable key) const
QVariant getDimXVariant(RS::KnownVariable key) const
int getDimzin() const
virtual double getDistanceTo(const RVector &point, bool limited=true, double range=0.0, bool draft=false, double strictRange=RMAXDOUBLE) const
double getDoubleOverride(RS::KnownVariable key) const
double getExtLineFixLength() const
QString getFontName() const
int getIntOverride(RS::KnownVariable key) const
double getLinearFactor() const
double getLineSpacingFactor() const
RS::TextLineSpacingStyle getLineSpacingStyle() const
QString getLowerTolerance() const
virtual double getMeasuredValue() const
virtual QString getMeasurement(bool resolveAutoMeasurement=true) const
RDimStyleData getOverrides() const
virtual RVector getPointOnEntity() const
virtual QList< RRefPoint > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false, QList< RObject::Id > *entityIds=NULL) const
QString getText() const
RTextData & getTextData(bool noRender=false) const
Creates a dimensioning line (line with one, two or no arrows).
virtual RVector getTextPosition() const
double getTextRotation() const
virtual RS::EntityType getType() const
QString getUpperTolerance() const
QVariant getVariantOverride(RS::KnownVariable key) const
bool hasCustomTextPosition() const
bool hasDimensionBlockReference() const
bool hasOverride(RS::KnownVariable key) const
bool hasOverrides() const
bool hasSpaceForArrows() const
RTextData & initTextData() const
Initializes the text data of the text label of this dimension.
virtual bool intersectsWith(const RShape &shape) const
bool isArrow1Flipped() const
bool isArrow2Flipped() const
bool isDimXScaled(RS::KnownVariable var) const
bool isExtLineFix() const
virtual bool isSane() const
virtual bool isValid() const
virtual bool mirror(const RLine &axis)
virtual bool move(const RVector &offset)
Moves this entity by the given offset.
virtual bool moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
Moves the given reference point to the given target point or does nothing if this entity has no reference point as the given location.
void render() const
virtual bool rotate(double rotation, const RVector &center)
virtual bool scale(const RVector &scaleFactors, const RVector &center)
virtual void scaleVisualProperties(double scaleFactor)
void setArrow1Flipped(bool on)
void setArrow2Flipped(bool on)
void setCustomTextPosition(bool on)
virtual void setDefinitionPoint(const RVector &p)
void setDimadec(int v)
void setDimasz(double v)
void setDimaunit(int v)
void setDimazin(int v)
void setDimBlockName(const QString &bn)
void setDimclrt(const RColor &v)
void setDimdec(int v)
void setDimdli(double v)
void setDimdsep(int v)
void setDimexe(double v)
void setDimexo(double v)
void setDimgap(double v)
void setDimlfac(double f)
void setDimlunit(int l)
void setDimscale(double f)
void setDimtad(int v)
void setDimtih(bool v)
void setDimtsz(double t)
void setDimtxt(double t)
void setDimXBool(RS::KnownVariable key, bool v)
void setDimXColor(RS::KnownVariable key, const RColor &v)
void setDimXDouble(RS::KnownVariable key, double v)
void setDimXInt(RS::KnownVariable key, int v)
void setDimXVariant(RS::KnownVariable key, const QVariant &v)
void setDimzin(int v)
void setExtLineFix(bool on)
void setExtLineFixLength(double v)
void setFontName(const QString &fn)
void setLinearFactor(double f)
void setLowerTolerance(const QString &t)
void setText(const QString &t)
void setTextPosition(const RVector &p)
void setTextRotation(double r)
void setUpperTolerance(const QString &t)
virtual void to2D()
virtual void update() const
Entities can reimplement this function to invalidate any internal cache (mark the entity as dirty).
void updateArrowPos1(const RVector &p) const
void updateArrowPos2(const RVector &p) const
void updateBoundingBox(const RBox &box) const
void updateShapes(const QList< QSharedPointer< RShape > > &s) const
void updateTextData(const RTextData &d) const
void updateTextPositionCenter(const RVector &p) const
void updateTextPositionSide(const RVector &p) const
bool useArchTick() const
RDimensionData(RDocument *document, const RDimensionData &data)
bool arrow1Flipped
RVector arrow1Pos
bool arrow2Flipped
RVector arrow2Pos
bool autoTextPos
True if the textPosition should be automatically calculated.
RBox boundingBox
double defaultAngle
RVector definitionPoint
Definition point.
QString dimBlockName
Dimension text color.
double dimLineLength
bool dirty
bool extLineFix
double extLineFixLength
QString fontName
Dimension font name.
RS::HAlign halign
Horizontal alignment.
double lineSpacingFactor
Line spacing factor.
RS::TextLineSpacingStyle lineSpacingStyle
Line spacing style.
QString lowerTolerance
Lower tolerance limit.
RDimStyleData overrides
QList< QSharedPointer< RShape > > shapes
QString text
Text string entered explicitly by user or null or “<>” for the actual measurement or “ “ (one blank space) for suppressing the text.
RTextData textData
RVector textPositionCenter
Middle point of dimension text.
RVector textPositionSide
Middle point of dimension text when automatically moved to the side for lack of space.
double textRotation
Rotation angle of dimension text away from default orientation.
QString upperTolerance
Upper tolerance limit.
RS::VAlign valign
Vertical alignment.
class RDimensionEntity

RDimensionData::RDimensionData(const RVector &definitionPoint, const RVector &textPositionCenter, RS::VAlign valign, RS::HAlign halign, RS::TextLineSpacingStyle lineSpacingStyle, double lineSpacingFactor, const QString &text, const QString &fontName, double textRotation)

Parameters:

  • definitionPoint: Definition point.
  • textPosition: Middle point of dimension text.
  • valign: Vertical alignment.
  • halign: Horizontal alignment.
  • lineSpacingStyle: Line spacing style.
  • lineSpacingFactor: Line spacing factor.
  • text: Text string entered explicitly by user or null or “<>” for the actual measurement or “ “ (one blank space). for suppressing the text.
  • style: Dimension style name.
  • textRotation: Rotation angle of dimension text away from default orientation.

RDimensionData::RDimensionData(RDocument *document=NULL)

All rights reserved.

This file is part of the QCAD project.

QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with QCAD.

void RDimensionData::adjustExtensionLineFixLength(RLine &extLine1, RLine &extLine2, bool addDimExe=true) const

const

void RDimensionData::clearStyleOverrides()

inline

virtual bool RDimensionData::clickReferencePoint(const RVector &referencePoint)

virtual

Called when user clicks a reference point.

Returns: True if clicking the reference point had any immediate effect.

Reimplemented from clickReferencePoint.

QString RDimensionData::formatAngleLabel(double textAngle) const

const

QString RDimensionData::formatLabel(double distance) const

const

virtual QString RDimensionData::getAutoLabel() const

virtual inline const

Reimplemented in getAutoLabel, getAutoLabel, getAutoLabel, getAutoLabel, getAutoLabel, getAutoLabel, getAutoLabel.

bool RDimensionData::getBoolOverride(RS::KnownVariable key) const

const

virtual RBox RDimensionData::getBoundingBox(bool ignoreEmpty=false) const

virtual const

Returns: The bounding box that contains this entity.

Reimplemented from getBoundingBox.

Reimplemented in getBoundingBox, getBoundingBox, getBoundingBox.

RColor RDimensionData::getColorOverride(RS::KnownVariable key) const

const

RVector RDimensionData::getDefinitionPoint() const

inline const

int RDimensionData::getDimadec() const

inline const

double RDimensionData::getDimasz() const

inline const

int RDimensionData::getDimaunit() const

inline const

int RDimensionData::getDimazin() const

inline const

int RDimensionData::getDimblk() const

inline const

QString RDimensionData::getDimblkName() const

const

QString RDimensionData::getDimBlockName() const

inline const

RColor RDimensionData::getDimclrt() const

inline const

int RDimensionData::getDimdec() const

inline const

double RDimensionData::getDimdli() const

inline const

int RDimensionData::getDimdsep() const

inline const

QSharedPointer< RBlockReferenceEntity > RDimensionData::getDimensionBlockReference() const

const

double RDimensionData::getDimexe() const

inline const

double RDimensionData::getDimexo() const

inline const

double RDimensionData::getDimgap() const

inline const

int RDimensionData::getDimjust() const

inline const

double RDimensionData::getDimlfac() const

inline const

int RDimensionData::getDimlunit() const

inline const

double RDimensionData::getDimscale() const

inline const

int RDimensionData::getDimtad() const

inline const

Returns: 0 for text above dimension line, otherwise text on dimension line.

bool RDimensionData::getDimtih() const

inline const

Returns: 0 for aligned, other for horizontal text label.

double RDimensionData::getDimtsz() const

inline const

double RDimensionData::getDimtxt() const

inline const

bool RDimensionData::getDimXBool(RS::KnownVariable key) const

const

RColor RDimensionData::getDimXColor(RS::KnownVariable key) const

const

double RDimensionData::getDimXDouble(RS::KnownVariable key) const

const

int RDimensionData::getDimXInt(RS::KnownVariable key) const

const

QVariant RDimensionData::getDimXVariant(RS::KnownVariable key) const

const

int RDimensionData::getDimzin() const

inline const

virtual double RDimensionData::getDistanceTo(const RVector &point, bool limited=true, double range=0.0, bool draft=false, double strictRange=RMAXDOUBLE) const

virtual const

Returns: The shortest distance from this entity to the given point.

Parameters:

  • limited: Limit lines, arcs at end points, otherwise the orthogonal distance to the unlimited line / circle is returned.
  • range: This is returned for solid filled entities (solid filled or dense hatches, text entities) if the point is on the entity and the distance would be zero.
  • draft: Calculate based on draft mode representation of the entity.
  • strictRange: If limited, this is the maximum range from either end point of the entity. Zero to only return distances that are strictly orthogonal to the entity.

Reimplemented from getDistanceTo.

double RDimensionData::getDoubleOverride(RS::KnownVariable key) const

const

double RDimensionData::getExtLineFixLength() const

inline const

QString RDimensionData::getFontName() const

inline const

int RDimensionData::getIntOverride(RS::KnownVariable key) const

const

double RDimensionData::getLinearFactor() const

inline const

double RDimensionData::getLineSpacingFactor() const

inline const

RS::TextLineSpacingStyle RDimensionData::getLineSpacingStyle() const

inline const

QString RDimensionData::getLowerTolerance() const

inline const

virtual double RDimensionData::getMeasuredValue() const

virtual inline const

Reimplemented in getMeasuredValue, getMeasuredValue, getMeasuredValue, getMeasuredValue, getMeasuredValue, getMeasuredValue, getMeasuredValue.

virtual QString RDimensionData::getMeasurement(bool resolveAutoMeasurement=true) const

virtual const

Reimplemented in getMeasurement.

RDimStyleData RDimensionData::getOverrides() const

inline const

virtual RVector RDimensionData::getPointOnEntity() const

virtual const

Returns: A point that is on the entity. Used to check if an entity is inside a polygon.

Reimplemented from getPointOnEntity.

virtual QList< RRefPoint > RDimensionData::getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const

virtual const

Returns: Vector of reference points of this entity. Reference points can usually be moved around by the user to change the geometry of the entity.

Reimplemented from getReferencePoints.

Reimplemented in getReferencePoints, getReferencePoints, getReferencePoints, getReferencePoints, getReferencePoints, getReferencePoints, getReferencePoints, getReferencePoints, getReferencePoints.

virtual QList< QSharedPointer< RShape > > RDimensionData::getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false, QList< RObject::Id > *entityIds=NULL) const

virtual inline const

Returns: Shapes that represent the geometry of this entity.

Parameters:

  • queryBox: Limit returned shapes to query box
  • ignoreComplex: Ignore complex shapes and explode those into simple shapes
  • segment: Split up splines into spline segments

Reimplemented from getShapes.

QString RDimensionData::getText() const

inline const

RTextData & RDimensionData::getTextData(bool noRender=false) const

const

Creates a dimensioning line (line with one, two or no arrows).

Returns: Text data of the text label.

virtual RVector RDimensionData::getTextPosition() const

virtual inline const

double RDimensionData::getTextRotation() const

inline const

virtual RS::EntityType RDimensionData::getType() const

virtual inline const

Reimplemented from getType.

Reimplemented in getType, getType, getType, getType, getType, getType, getType, getType, getType, getType.

QString RDimensionData::getUpperTolerance() const

inline const

QVariant RDimensionData::getVariantOverride(RS::KnownVariable key) const

const

bool RDimensionData::hasCustomTextPosition() const

const

bool RDimensionData::hasDimensionBlockReference() const

const

bool RDimensionData::hasOverride(RS::KnownVariable key) const

inline const

bool RDimensionData::hasOverrides() const

inline const

bool RDimensionData::hasSpaceForArrows() const

const

RTextData & RDimensionData::initTextData() const

const

Initializes the text data of the text label of this dimension.

The text data is created at 0/0 at an angle or 0. Moving the label to the right position at the right angle is up to the particular dimension implementation.

virtual bool RDimensionData::intersectsWith(const RShape &shape) const

virtual const

Returns: True if this entity intersects with the given shape, false otherwise.

Reimplemented from intersectsWith.

bool RDimensionData::isArrow1Flipped() const

inline const

bool RDimensionData::isArrow2Flipped() const

inline const

bool RDimensionData::isDimXScaled(RS::KnownVariable var) const

inline const

bool RDimensionData::isExtLineFix() const

inline const

virtual bool RDimensionData::isSane() const

virtual const

Reimplemented from isSane.

Reimplemented in isSane, isSane, isSane, isSane, isSane, isSane, isSane, isSane, isSane.

virtual bool RDimensionData::isValid() const

virtual const

Reimplemented from isValid.

Reimplemented in isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid.

virtual bool RDimensionData::mirror(const RLine &axis)

virtual

Reimplemented from mirror.

Reimplemented in mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror.

virtual bool RDimensionData::move(const RVector &offset)

virtual

Moves this entity by the given offset.

Reimplemented from move.

Reimplemented in move, move, move, move, move, move, move.

virtual bool RDimensionData::moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint, Qt::KeyboardModifiers modifiers=Qt::NoModifier)

virtual

Moves the given reference point to the given target point or does nothing if this entity has no reference point as the given location.

Returns: True if a reference point has been moved successfully, false otherwise.

Reimplemented from moveReferencePoint.

Reimplemented in moveReferencePoint, moveReferencePoint, moveReferencePoint, moveReferencePoint, moveReferencePoint, moveReferencePoint, moveReferencePoint, moveReferencePoint, moveReferencePoint, moveReferencePoint.

void RDimensionData::render() const

const

virtual bool RDimensionData::rotate(double rotation, const RVector &center)

virtual

Reimplemented from rotate.

Reimplemented in rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate.

virtual bool RDimensionData::scale(const RVector &scaleFactors, const RVector &center)

virtual

Reimplemented from scale.

Reimplemented in scale, scale, scale, scale, scale, scale, scale.

virtual void RDimensionData::scaleVisualProperties(double scaleFactor)

virtual

Reimplemented from scaleVisualProperties.

void RDimensionData::setArrow1Flipped(bool on)

inline

void RDimensionData::setArrow2Flipped(bool on)

inline

void RDimensionData::setCustomTextPosition(bool on)

virtual void RDimensionData::setDefinitionPoint(const RVector &p)

virtual inline

Reimplemented in setDefinitionPoint.

void RDimensionData::setDimadec(int v)

inline

void RDimensionData::setDimasz(double v)

inline

void RDimensionData::setDimaunit(int v)

inline

void RDimensionData::setDimazin(int v)

inline

void RDimensionData::setDimBlockName(const QString &bn)

inline

void RDimensionData::setDimclrt(const RColor &v)

inline

void RDimensionData::setDimdec(int v)

inline

void RDimensionData::setDimdli(double v)

inline

void RDimensionData::setDimdsep(int v)

inline

void RDimensionData::setDimexe(double v)

inline

void RDimensionData::setDimexo(double v)

inline

void RDimensionData::setDimgap(double v)

inline

void RDimensionData::setDimlfac(double f)

inline

void RDimensionData::setDimlunit(int l)

inline

void RDimensionData::setDimscale(double f)

inline

void RDimensionData::setDimtad(int v)

inline

void RDimensionData::setDimtih(bool v)

inline

void RDimensionData::setDimtsz(double t)

inline

void RDimensionData::setDimtxt(double t)

inline

void RDimensionData::setDimXBool(RS::KnownVariable key, bool v)

void RDimensionData::setDimXColor(RS::KnownVariable key, const RColor &v)

void RDimensionData::setDimXDouble(RS::KnownVariable key, double v)

void RDimensionData::setDimXInt(RS::KnownVariable key, int v)

void RDimensionData::setDimXVariant(RS::KnownVariable key, const QVariant &v)

void RDimensionData::setDimzin(int v)

inline

void RDimensionData::setExtLineFix(bool on)

inline

void RDimensionData::setExtLineFixLength(double v)

inline

void RDimensionData::setFontName(const QString &fn)

inline

void RDimensionData::setLinearFactor(double f)

inline

void RDimensionData::setLowerTolerance(const QString &t)

inline

void RDimensionData::setText(const QString &t)

inline

void RDimensionData::setTextPosition(const RVector &p)

inline

void RDimensionData::setTextRotation(double r)

inline

void RDimensionData::setUpperTolerance(const QString &t)

inline

virtual void RDimensionData::to2D()

virtual

Reimplemented from to2D.

Reimplemented in to2D, to2D, to2D, to2D, to2D, to2D, to2D, to2D.

virtual void RDimensionData::update() const

virtual const

Entities can reimplement this function to invalidate any internal cache (mark the entity as dirty).

Reimplemented from update.

void RDimensionData::updateArrowPos1(const RVector &p) const

inline const

void RDimensionData::updateArrowPos2(const RVector &p) const

inline const

void RDimensionData::updateBoundingBox(const RBox &box) const

inline const

void RDimensionData::updateShapes(const QList< QSharedPointer< RShape > > &s) const

inline const

void RDimensionData::updateTextData(const RTextData &d) const

inline const

void RDimensionData::updateTextPositionCenter(const RVector &p) const

inline const

void RDimensionData::updateTextPositionSide(const RVector &p) const

inline const

bool RDimensionData::useArchTick() const

inline const

RDimensionData::RDimensionData(RDocument *document, const RDimensionData &data)

protected

bool RDimensionData::arrow1Flipped

protected

RVector RDimensionData::arrow1Pos

protected

bool RDimensionData::arrow2Flipped

protected

RVector RDimensionData::arrow2Pos

protected

bool RDimensionData::autoTextPos

protected

True if the textPosition should be automatically calculated.

RBox RDimensionData::boundingBox

protected

double RDimensionData::defaultAngle

protected

RVector RDimensionData::definitionPoint

protected

Definition point.

QString RDimensionData::dimBlockName

protected

Dimension text color.

Dimension appearance is defined in this block

double RDimensionData::dimLineLength

protected

bool RDimensionData::dirty

protected

bool RDimensionData::extLineFix

protected

double RDimensionData::extLineFixLength

protected

QString RDimensionData::fontName

protected

Dimension font name.

RS::HAlign RDimensionData::halign

protected

Horizontal alignment.

double RDimensionData::lineSpacingFactor

protected

Line spacing factor.

RS::TextLineSpacingStyle RDimensionData::lineSpacingStyle

protected

Line spacing style.

QString RDimensionData::lowerTolerance

protected

Lower tolerance limit.

RDimStyleData RDimensionData::overrides

protected

QList<QSharedPointer<RShape> > RDimensionData::shapes

protected

QString RDimensionData::text

protected

Text string entered explicitly by user or null or “<>” for the actual measurement or “ “ (one blank space) for suppressing the text.

RTextData RDimensionData::textData

protected

RVector RDimensionData::textPositionCenter

protected

Middle point of dimension text.

RVector RDimensionData::textPositionSide

protected

Middle point of dimension text when automatically moved to the side for lack of space.

double RDimensionData::textRotation

protected

Rotation angle of dimension text away from default orientation.

QString RDimensionData::upperTolerance

protected

Upper tolerance limit.

RS::VAlign RDimensionData::valign

protected

Vertical alignment.

friend class RDimensionEntity

private