QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
RToleranceData Class Reference

Tolerance entity data class. More...

#include <RToleranceData.h>

Inheritance diagram for RToleranceData:
REntityData

Public Member Functions

virtual RShapecastToShape ()
 
void clearStyleOverrides ()
 
virtual bool flipHorizontal ()
 
virtual bool flipVertical ()
 
QList< RVectorgetCorners () const
 
double getDimscale () const
 
double getDimtxt (bool scale=true) const
 
RVector getDirection () const
 
QList< QSharedPointer< RShape > > getExploded (int segments=RDEFAULT_MIN1) const
 
QList< QStringList > getFields () const
 
QList< RLinegetFrame () const
 
RVector getLocation () const
 
QList< RVectorgetMiddels () const
 
RVector getPointOnEntity () const
 
virtual QList< RRefPointgetReferencePoints (RS::ProjectionRenderingHint hint=RS::RenderTop) const
 
int getRows () 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
 
QList< RTextDatagetTextLabels () const
 
virtual RS::EntityType getType () const
 
virtual RVector getVectorTo (const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) 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.
 
virtual bool rotate (double rotation, const RVector &center)
 
 RToleranceData ()
 Copyright (c) 2011-2018 by Andrew Mustun.
 
virtual bool scale (const RVector &scaleFactors, const RVector &center)
 
virtual void scaleVisualProperties (double scaleFactor)
 
void setDimscale (double f)
 
void setDimtxt (double f)
 
void setDirection (const RVector &d)
 
void setLocation (const RVector &l)
 
void setText (const QString &t)
 
virtual void update () const
 Entities can reimplement this function to invalidate any internal cache (mark the entity as dirty).
 
- Public Member Functions inherited from REntityData
virtual const RShapecastToConstShape () const
 
virtual bool clickReferencePoint (const RVector &referencePoint)
 Called when user clicks a reference point.
 
virtual bool cloneOnChange () const
 Reimplement to force clone on change in transactions.
 
void copyAttributesFrom (const REntityData &entityData, bool copyBlockId=true)
 
virtual QList< RVectorgetArcReferencePoints (const RBox &queryBox=RDEFAULT_RBOX) const
 
bool getAutoUpdatesBlocked () const
 
RObject::Id getBlockId () const
 
QString getBlockName () const
 
virtual RBox getBoundingBox (bool ignoreEmpty=false) const
 
virtual QList< RBoxgetBoundingBoxes (bool ignoreEmpty=false) const
 
virtual QList< RVectorgetCenterPoints (const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const
 
virtual RVector getClosestPointOnEntity (const RVector &point, double range=RNANDOUBLE, bool limited=true, RObject::Id *subEntityId=NULL) const
 
virtual QSharedPointer< RShapegetClosestShape (const RVector &pos, double range=RNANDOUBLE, bool ignoreComplex=false, RObject::Id *subEntityId=NULL) const
 
RObject::Id getClosestSubEntityId (const RVector &pos, double range, bool ignoreComplex) const
 Convenience function for scripts.
 
virtual RColor getColor () const
 
virtual RColor getColor (bool resolve, const QStack< QSharedPointer< REntity > > &blockRefStack) const
 
virtual RColor getColor (const RColor &unresolvedColor, const QStack< QSharedPointer< REntity > > &blockRefStack) const
 
virtual RColor getDisplayColor ()
 
virtual double getDistanceTo (const RVector &point, bool limited=true, double range=0.0, bool draft=false, double strictRange=RMAXDOUBLE) const
 
RDocumentgetDocument ()
 
const RDocumentgetDocument () const
 
virtual int getDrawOrder () const
 
virtual QList< RVectorgetEndPoints (const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const
 
virtual RPolyline getHull (double offset) const
 
virtual QList< RRefPointgetInternalReferencePoints (RS::ProjectionRenderingHint hint=RS::RenderTop, QList< RObject::Id > *subEntityIds=NULL) const
 Can be overwritten to return internal, resolved reference points.
 
virtual QList< RVectorgetIntersectionPoints (const REntityData &other, bool limited=true, bool same=false, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true, QList< QPair< RObject::Id, RObject::Id > > *entityIds=NULL) const
 
virtual QList< RVectorgetIntersectionPoints (const RShape &shape, bool limited=true, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true) const
 
RObject::Id getLayerId () const
 
QString getLayerName () const
 
virtual RObject::Id getLinetypeId () const
 
virtual RObject::Id getLinetypeId (bool resolve, const QStack< QSharedPointer< REntity > > &blockRefStack) const
 
virtual RLinetypePattern getLinetypePattern () const
 
virtual double getLinetypeScale () const
 
virtual RLineweight::Lineweight getLineweight () const
 
virtual RLineweight::Lineweight getLineweight (bool resolve, const QStack< QSharedPointer< REntity > > &blockRefStack) const
 
double getLineweightInUnits (const QStack< QSharedPointer< REntity > > &blockRefStack) const
 
virtual QList< RVectorgetMiddlePoints (const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const
 
RObject::Id getParentId () const
 
virtual QList< RVectorgetPointsWithDistanceToEnd (double distance, int from=RS::FromAny, const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const
 
virtual bool intersectsWith (const RShape &shape) const
 
virtual bool isInside (const RBox &box) const
 
virtual bool isOnEntity (const RVector &point, bool limited=true, double tolerance=RDEFAULT_TOLERANCE_1E_MIN4) const
 
virtual bool isPointType () const
 
virtual bool isSane () const
 
virtual bool isSelected () const
 
virtual bool isSelectedWorkingSet () const
 
virtual bool isUpdatesEnabled () const
 
virtual bool isValid () const
 
virtual bool mirror (const RVector &axis1, const RVector &axis2)
 
 REntityData (RDocument *document=NULL)
 Copyright (c) 2011-2018 by Andrew Mustun.
 
virtual bool scale (double scaleFactor, const RVector &center=RDEFAULT_RVECTOR)
 
void setAutoUpdatesBlocked (bool on)
 
virtual void setBlockId (RObject::Id blockId)
 
void setColor (const RColor &color)
 
void setDocument (RDocument *document)
 
virtual void setDrawOrder (int drawOrder)
 Sets the draw order of this entity.
 
virtual void setLayerId (RObject::Id layerId)
 
void setLayerName (const QString &layerName)
 
virtual void setLinetypeId (RObject::Id linetypeId)
 Sets the linetype of this entity to the given linetype ID.
 
virtual void setLinetypePattern (const RLinetypePattern &p)
 
virtual void setLinetypeScale (double linetypeScale)
 
void setLineweight (RLineweight::Lineweight lineweight)
 
virtual void setParentId (RObject::Id parentId)
 
virtual void setSelected (bool on)
 Selects or deselects this entity.
 
virtual void setSelectedWorkingSet (bool on)
 Selects or deselects this entity for addition to the current working set.
 
void setUpdatesEnabled (bool on)
 Enables / disables cache updates.
 
virtual void setZ (double z)
 
virtual bool stretch (const RPolyline &area, const RVector &offset)
 Stretches the end points of this entity that are inside area by offset.
 
virtual void to2D ()
 
virtual ~REntityData ()
 

Protected Member Functions

 RToleranceData (RDocument *document, const RToleranceData &data)
 

Private Attributes

double dimscale
 
RObject::Id dimToleranceBlockId
 Dimension scale.
 
double dimtxt
 
RVector direction
 
QList< QList< double > > divisions
 
bool joinFirstField
 
RVector location
 
QString text
 Text code, e.g.
 

Friends

class RToleranceEntity
 

Additional Inherited Members

- Static Public Member Functions inherited from REntityData
static int getDefaultDrawOrder ()
 
- Protected Attributes inherited from REntityData
bool autoUpdatesBlocked
 Block auto updates is true during imports, undo and redo.
 
RObject::Id blockId
 
RColor color
 
RDocumentdocument
 
int drawOrder
 
RObject::Id layerId
 
RObject::Id linetypeId
 
double linetypeScale
 
RLineweight::Lineweight lineweight
 
RObject::Id parentId
 
bool selectionStatus
 
bool selectionStatusWorkingSet
 
bool updatesEnabled
 

Detailed Description

Tolerance entity data class.

Scriptable:\nThis class is available in script environments.\n
Copyable:\nObjects are cleaned up automatically by the garbage collector of the script engine.\n

Constructor & Destructor Documentation

◆ RToleranceData() [1/2]

RToleranceData::RToleranceData ( RDocument * document,
const RToleranceData & data )
protected

◆ RToleranceData() [2/2]

RToleranceData::RToleranceData ( )

Copyright (c) 2011-2018 by Andrew Mustun.

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.

Member Function Documentation

◆ castToShape()

virtual RShape * RToleranceData::castToShape ( )
inlinevirtual

Reimplemented from REntityData.

◆ clearStyleOverrides()

void RToleranceData::clearStyleOverrides ( )
inline

◆ flipHorizontal()

bool RToleranceData::flipHorizontal ( )
virtual

Reimplemented from REntityData.

◆ flipVertical()

bool RToleranceData::flipVertical ( )
virtual

Reimplemented from REntityData.

◆ getCorners()

QList< RVector > RToleranceData::getCorners ( ) const

◆ getDimscale()

double RToleranceData::getDimscale ( ) const

◆ getDimtxt()

double RToleranceData::getDimtxt ( bool scale = true) const

◆ getDirection()

RVector RToleranceData::getDirection ( ) const
inline

◆ getExploded()

QList< QSharedPointer< RShape > > RToleranceData::getExploded ( int segments = RDEFAULT_MIN1) const
inline

◆ getFields()

QList< QStringList > RToleranceData::getFields ( ) const

◆ getFrame()

QList< RLine > RToleranceData::getFrame ( ) const

◆ getLocation()

RVector RToleranceData::getLocation ( ) const
inline

◆ getMiddels()

QList< RVector > RToleranceData::getMiddels ( ) const

◆ getPointOnEntity()

RVector RToleranceData::getPointOnEntity ( ) const
virtual
Returns
A point that is on the entity. Used to check if an entity is inside a polygon.

Reimplemented from REntityData.

◆ getReferencePoints()

QList< RRefPoint > RToleranceData::getReferencePoints ( RS::ProjectionRenderingHint hint = RS::RenderTop) const
virtual
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.

Implements REntityData.

◆ getRows()

int RToleranceData::getRows ( ) const
inline

◆ getShapes()

QList< QSharedPointer< RShape > > RToleranceData::getShapes ( const RBox & queryBox = RDEFAULT_RBOX,
bool ignoreComplex = false,
bool segment = false,
QList< RObject::Id > * entityIds = NULL ) const
virtual
Returns
Shapes that represent the geometry of this entity.
Parameters
queryBoxLimit returned shapes to query box
ignoreComplexIgnore complex shapes and explode those into simple shapes
segmentSplit up splines into spline segments

Reimplemented from REntityData.

◆ getText()

QString RToleranceData::getText ( ) const
inline

◆ getTextLabels()

QList< RTextData > RToleranceData::getTextLabels ( ) const

◆ getType()

virtual RS::EntityType RToleranceData::getType ( ) const
inlinevirtual

Reimplemented from REntityData.

◆ getVectorTo()

RVector RToleranceData::getVectorTo ( const RVector & point,
bool limited = true,
double strictRange = RMAXDOUBLE ) const
virtual
Returns
The distance vector from this entity to the given point.
Parameters
pointthe point to which the distance was measured
limitedIf true, an invalid vector is returned if the closest point on the entity is outside of the entity (e.g. in the extension line of a line or outside the start / end angle of an arc).

Reimplemented from REntityData.

◆ mirror()

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

Reimplemented from REntityData.

◆ move()

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

Moves this entity by the given offset.

Reimplemented from REntityData.

◆ moveReferencePoint()

bool RToleranceData::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.

Implements REntityData.

◆ rotate()

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

Reimplemented from REntityData.

◆ scale()

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

Reimplemented from REntityData.

◆ scaleVisualProperties()

void RToleranceData::scaleVisualProperties ( double scaleFactor)
virtual

Reimplemented from REntityData.

◆ setDimscale()

void RToleranceData::setDimscale ( double f)

◆ setDimtxt()

void RToleranceData::setDimtxt ( double f)

◆ setDirection()

void RToleranceData::setDirection ( const RVector & d)
inline

◆ setLocation()

void RToleranceData::setLocation ( const RVector & l)
inline

◆ setText()

void RToleranceData::setText ( const QString & t)
inline

◆ update()

void RToleranceData::update ( ) const
virtual

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

Reimplemented from REntityData.

Friends And Related Symbol Documentation

◆ RToleranceEntity

friend class RToleranceEntity
friend

Member Data Documentation

◆ dimscale

double RToleranceData::dimscale
private

◆ dimToleranceBlockId

RObject::Id RToleranceData::dimToleranceBlockId
private

Dimension scale.

Block to use instead of arrow

◆ dimtxt

double RToleranceData::dimtxt
private

◆ direction

RVector RToleranceData::direction
private

◆ divisions

QList<QList<double> > RToleranceData::divisions
mutableprivate

◆ joinFirstField

bool RToleranceData::joinFirstField
mutableprivate

◆ location

RVector RToleranceData::location
private

◆ text

QString RToleranceData::text
private

Text code, e.g.

{\Fgdt;b}%v0.05%v0.02%vB%v%v


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