Open Source 2D CAD
RRefPoint Class Reference

Represents a reference point of an entity. More...

#include <RRefPoint.h>

Inheritance diagram for RRefPoint:

Public Types

enum  Flag {
  NoFlags = 0x000, Secondary = 0x001, Tertiary = 0x002, Center = 0x004,
  Ignore = 0x008, Start = 0x010, End = 0x020, Arrow = 0x040,
  Selected = 0x080

Public Member Functions

bool getFlag (RRefPoint::Flag flag) const
RRefPoint::Flags getFlags () const
bool isArrow () const
bool isCenter () const
bool isEnd () const
bool isIgnore () const
bool isSecondary () const
bool isSelected () const
bool isStart () const
bool isTertiary () const
 RRefPoint ()
 RRefPoint (const RVector &v)
 RRefPoint (const RVector &v, RRefPoint::Flags f)
 RRefPoint (double vx, double vy, double vz=0.0, bool valid_in=true)
void setArrow (bool on)
void setCenter (bool on)
void setEnd (bool on)
void setFlag (RRefPoint::Flag flag, bool on)
void setFlags (RRefPoint::Flags f)
void setIgnore (bool on)
void setSecondary (bool on)
void setSelected (bool on)
void setStart (bool on)
void setTertiary (bool on)
- Public Member Functions inherited from RVector
RVector axonometricProjection (RS::IsoProjectionType type)
 Axonometric projection (isometric, dimetric, trimetric). More...
double dot (const RVector &other) const
bool equalsFuzzy (const RVector &v, double tol=RS::PointTolerance) const
bool equalsFuzzy2D (const RVector &v, double tol=RS::PointTolerance) const
RVector flipHorizontal ()
 Mirrors this vector at the Y-axis. More...
RVector flipVertical ()
 Mirrors this vector at the X-axis. More...
RVector get2D () const
RVector getAbsolute () const
double getAngle () const
double getAngleTo (const RVector &v) const
double getAngleToPlaneXY () const
RVector getCeil () const
RVector getClosest (const QList< RVector > &list) const
RVector getClosest2D (const QList< RVector > &list) const
double getClosestDistance (const QList< RVector > &list, int counts)
int getClosestIndex (const QList< RVector > &list, bool ignoreZ=false) const
int getClosestIndex2D (const QList< RVector > &list) const
double getDistanceTo (const RVector &v) const
double getDistanceTo2D (const RVector &v) const
RVector getDividedComponents (const RVector &v) const
RVector getFloor () const
RVector getLerp (const RVector &v, double t) const
 Linear interpolation between this and v by fraction 't'. More...
double getMagnitude () const
double getMagnitude2D () const
RVector getMirrored (const RLine &axis) const
RVector getMultipliedComponents (const RVector &v) const
RVector getNegated () const
RVector getNormalized () const
RVector getRotated (double rotation, const RVector &center) const
RVector getScaled (const RVector &factors, const RVector &center) const
double getSquaredMagnitude () const
RVector getTransformed (const RMatrix &m) const
RVector getTransformed2D (const QTransform &t) const
RVector getTransformed2DM (const RMatrix &m) const
RVector getUnitVector () const
double getX ()
double getY ()
double getZ ()
bool gteXY (const RVector &v) const
bool isInside (const RBox &b) const
bool isInWindow (const RVector &firstCorner, const RVector &secondCorner)
bool isNaN () const
RVector isoProject (RS::IsoProjectionType type)
 Changes this vector into its isometric projection. More...
bool isSane () const
bool isValid () const
bool isZero () const
bool lteXY (const RVector &v) const
RVector mirror (const RLine &axis)
 Mirrors this vector at the given axis. More...
RVector mirror (const RVector &axis1, const RVector &axis2)
RVector move (const RVector &offset)
 Moves this vector by the given offset. More...
RVector normalize ()
 Normalizes this vector and returns a reference to this vector. More...
RVector obliqueProjection (RS::IsoProjectionType type)
bool operator!= (const RVector &v) const
RVector operator* (double s) const
 binary * operator. More...
void operator*= (double s)
 *= operator More...
RVector operator+ (const RVector &v) const
 binary + operator. More...
void operator+= (const RVector &v)
 += operator. More...
RVector operator- () const
 unary - operator. More...
RVector operator- (const RVector &v) const
 binary - operator. More...
void operator-= (const RVector &v)
 -= operator. More...
RVector operator/ (double s) const
 binary / operator. More...
void operator/= (double s)
 /= operator More...
bool operator== (const RVector &v) const
 == operator More...
RVector rotate (double rotation)
 Rotates this vector around 0/0 by the given angle. More...
RVector rotate (double rotation, const RVector &center)
 Rotates this vector around the given center by the given angle. More...
RVector rotate3D (const QQuaternion &quaternion)
RVector rotate3D (const RLine &axis, double rotation)
 RVector ()
 Constructor for a valid null vector (0/0/0). More...
 RVector (const QList< double > &tuples)
 RVector (double vx, double vy, double vz=0.0, bool valid_in=true)
 Constructor for a point with given valid flag. More...
RVector scale (const RVector &factors, const RVector &center=nullVector)
 Scales this vector by the given factors with the given center. More...
RVector scale (double factor, const RVector &center=nullVector)
 Scales this vector by the given factor with the given center. More...
void set (double vx, double vy, double vz=0.0)
 Sets new values for the vector and makes the vector valid. More...
void setAngle (double a)
void setMagnitude2D (double m)
 Sets the vector magnitude without chaning the direction. More...
void setPolar (double radius, double angle)
 Sets a new position for the vector in polar coordinates. More...
void setX (double x)
void setY (double y)
void setZ (double z)
RVector stretch (const RPolyline &area, const RVector &offset)
 Moves this vector by offset if it is inside the given area. More...
RVector transform (const RMatrix &m)
 Generic 3d transformation. More...
RVector transform2D (const QTransform &t)
 Transforms this vector with the given transformation matrix. More...
RVector transform2DM (const RMatrix &m)
 Generic 2d transformation. More...

Static Public Member Functions

static QList< RRefPointtoRefPointList (const QList< RVector > &list, RRefPoint::Flags flags=RRefPoint::NoFlags)
static QList< RVectortoVectorList (const QList< RRefPoint > &list)
- Static Public Member Functions inherited from RVector
static bool containsFuzzy (const QList< RVector > &vectors, const RVector &v, double tol=RS::PointTolerance)
static RVector createPolar (double radius, double angle)
static int findFirstFuzzy (const QList< RVector > &vectors, const RVector &v, double tol=RS::PointTolerance)
static RVector getAverage (const QList< RVector > &vectors)
static RVector getAverage (const RVector &v1, const RVector &v2)
 Convenience function. More...
static RVector getCrossProduct (const RVector &v1, const RVector &v2)
static double getDotProduct (const RVector &v1, const RVector &v2)
 Scalarproduct (dot product). More...
static RVector getMaximum (const QList< RVector > &vectors)
static RVector getMaximum (const RVector &v1, const RVector &v2)
static RVector getMaximumX (const QList< RVector > &vectors)
static RVector getMaximumY (const QList< RVector > &vectors)
static RVector getMinimum (const QList< RVector > &vectors)
static RVector getMinimum (const RVector &v1, const RVector &v2)
static RVector getMinimumX (const QList< RVector > &vectors)
static RVector getMinimumY (const QList< RVector > &vectors)
static QList< RVectorgetSortedByAngle (const QList< RVector > &list, const RVector &center, double angle)
static QList< RVectorgetSortedByDistance (const QList< RVector > &list, const RVector &v)
static QList< RVectorgetSortedLeftRightTopBottom (const QList< RVector > &list)
static QList< RVectorgetUnion (const QList< RVector > &vectorsA, const QList< RVector > &vectorsB, double tol=RS::PointTolerance)
static QList< RVectorgetUnique (const QList< RVector > &vectors, double tol=RS::PointTolerance)
static QList< double > getXList (const QList< RVector > &vectors)
static QList< double > getYList (const QList< RVector > &vectors)
static QList< double > getZList (const QList< RVector > &vectors)
static bool greaterThanEqualXY (const RVector &v1, const RVector &v2)
static bool greaterThanX (const RVector &v1, const RVector &v2)
static bool greaterThanY (const RVector &v1, const RVector &v2)
static bool lessThanEqualXY (const RVector &v1, const RVector &v2)
static bool lessThanX (const RVector &v1, const RVector &v2)
static bool lessThanY (const RVector &v1, const RVector &v2)
static void moveList (QList< RVector > &list, const RVector &offset)
static void rotateList (QList< RVector > &list, double rotation)
static void rotateList (QList< RVector > &list, double rotation, const RVector &center)
static void scaleList (QList< RVector > &list, const RVector &factors, const RVector &center=nullVector)
static void scaleList (QList< RVector > &list, double factor, const RVector &center=nullVector)

Private Attributes

Flags flags

Additional Inherited Members

- Public Attributes inherited from RVector
bool valid
Getter function for this property: isValid
double x
Getter function for this property: getX

Setter function for this property: setX
double y
Getter function for this property: getY

Setter function for this property: setY
double z
Getter function for this property: getZ

Setter function for this property: setZ
- Static Public Attributes inherited from RVector
static const RVector invalid = RVector(0, 0, 0, false)
 invalid vector More...
static const RVector nanVector = RVector(RNANDOUBLE, RNANDOUBLE, RNANDOUBLE, true)
 NaN vector. More...
static const RVector nullVector = RVector(0, 0, 0, true)
 null vector More...

Detailed Description

Represents a reference point of an entity.

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

Member Enumeration Documentation

◆ Flag


Secondary reference point (typically shown with different color)


Tertiary reference point (typically shown with different color)


Reference point is a center point.


Ignore reference point for drag and drop.


Reference point is a start point.


Reference point is a start point.


Reference point is a dimension arrow.


Reference point is selected.

Constructor & Destructor Documentation

◆ RRefPoint() [1/4]

RRefPoint::RRefPoint ( )

◆ RRefPoint() [2/4]

RRefPoint::RRefPoint ( const RVector v,
RRefPoint::Flags  f 

◆ RRefPoint() [3/4]

RRefPoint::RRefPoint ( const RVector v)

◆ RRefPoint() [4/4]

RRefPoint::RRefPoint ( double  vx,
double  vy,
double  vz = 0.0,
bool  valid_in = true 

Member Function Documentation

◆ getFlag()

bool RRefPoint::getFlag ( RRefPoint::Flag  flag) const

◆ getFlags()

RRefPoint::Flags RRefPoint::getFlags ( ) const

◆ isArrow()

bool RRefPoint::isArrow ( ) const

◆ isCenter()

bool RRefPoint::isCenter ( ) const

◆ isEnd()

bool RRefPoint::isEnd ( ) const

◆ isIgnore()

bool RRefPoint::isIgnore ( ) const

◆ isSecondary()

bool RRefPoint::isSecondary ( ) const

◆ isSelected()

bool RRefPoint::isSelected ( ) const

◆ isStart()

bool RRefPoint::isStart ( ) const

◆ isTertiary()

bool RRefPoint::isTertiary ( ) const

◆ setArrow()

void RRefPoint::setArrow ( bool  on)

◆ setCenter()

void RRefPoint::setCenter ( bool  on)

◆ setEnd()

void RRefPoint::setEnd ( bool  on)

◆ setFlag()

void RRefPoint::setFlag ( RRefPoint::Flag  flag,
bool  on 

◆ setFlags()

void RRefPoint::setFlags ( RRefPoint::Flags  f)

◆ setIgnore()

void RRefPoint::setIgnore ( bool  on)

◆ setSecondary()

void RRefPoint::setSecondary ( bool  on)

◆ setSelected()

void RRefPoint::setSelected ( bool  on)

◆ setStart()

void RRefPoint::setStart ( bool  on)

◆ setTertiary()

void RRefPoint::setTertiary ( bool  on)

◆ toRefPointList()

static QList<RRefPoint> RRefPoint::toRefPointList ( const QList< RVector > &  list,
RRefPoint::Flags  flags = RRefPoint::NoFlags 

◆ toVectorList()

static QList<RVector> RRefPoint::toVectorList ( const QList< RRefPoint > &  list)

Member Data Documentation

◆ flags

Flags RRefPoint::flags

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