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, Center = 0x002, Ignore = 0x004,
  Start = 0x008, End = 0x010, Arrow = 0x020

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 isStart () const
 RRefPoint ()
 RRefPoint (const RVector &v, RRefPoint::Flags f)
 RRefPoint (const RVector &v)
 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 setStart (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 RVector &v) const
 binary - operator. More...
RVector operator- () const
 unary - 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 RLine &axis, double rotation)
RVector rotate3D (const QQuaternion &quaternion)
 RVector ()
 Constructor for a valid null vector (0/0/0). More...
 RVector (double vx, double vy, double vz=0.0, bool valid_in=true)
 Constructor for a point with given valid flag. More...
 RVector (const QList< double > &tuples)
RVector scale (double factor, const RVector &center=nullVector)
 Scales this vector by the given factor with the given center. More...
RVector scale (const RVector &factors, const RVector &center=nullVector)
 Scales this vector by the given factors 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 RVector &v1, const RVector &v2)
 Convenience function. More...
static RVector getAverage (const QList< RVector > &vectors)
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, double factor, const RVector &center=nullVector)
static void scaleList (QList< RVector > &list, const RVector &factors, const RVector &center=nullVector)

Private Attributes

Flags flags

Additional Inherited Members

- Public Attributes inherited from RVector
bool valid
 Getter function for this property: isValid. More...
double x
 Getter function for this property: getX. More...
double y
 Getter function for this property: getY. More...
double z
 Getter function for this property: getZ. More...
- 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.

This class is available in script environments.
Objects are cleaned up automatically by the garbage collector of the script engine.

Constructor & Destructor Documentation

RRefPoint::RRefPoint ( )
RRefPoint::RRefPoint ( const RVector v,
RRefPoint::Flags  f 
RRefPoint::RRefPoint ( const RVector v)
RRefPoint::RRefPoint ( double  vx,
double  vy,
double  vz = 0.0,
bool  valid_in = true 

Member Function Documentation

bool RRefPoint::getFlag ( RRefPoint::Flag  flag) const
RRefPoint::Flags RRefPoint::getFlags ( ) const
bool RRefPoint::isArrow ( ) const
bool RRefPoint::isCenter ( ) const
bool RRefPoint::isEnd ( ) const
bool RRefPoint::isIgnore ( ) const
bool RRefPoint::isSecondary ( ) const
bool RRefPoint::isStart ( ) const
void RRefPoint::setArrow ( bool  on)
void RRefPoint::setCenter ( bool  on)
void RRefPoint::setEnd ( bool  on)
void RRefPoint::setFlag ( RRefPoint::Flag  flag,
bool  on 
void RRefPoint::setFlags ( RRefPoint::Flags  f)
void RRefPoint::setIgnore ( bool  on)
void RRefPoint::setSecondary ( bool  on)
void RRefPoint::setStart ( bool  on)
static QList<RRefPoint> RRefPoint::toRefPointList ( const QList< RVector > &  list,
RRefPoint::Flags  flags = RRefPoint::NoFlags 
static QList<RVector> RRefPoint::toVectorList ( const QList< RRefPoint > &  list)

Member Data Documentation

Flags RRefPoint::flags

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