KiCad PCB EDA Suite
Loading...
Searching...
No Matches
CADSTAR_ARCHIVE_PARSER::POINT Struct Reference

Represent a point in x,y coordinates. More...

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::POINT:
VECTOR2< int32_t > CADSTAR_ARCHIVE_PARSER::PARSER

Public Types

typedef VECTOR2_TRAITS< int32_t >::extended_type extended_type
 
typedef int32_t coord_type
 

Public Member Functions

 POINT ()
 
 POINT (int aX, int aY)
 
void Parse (XNODE *aNode, PARSER_CONTEXT *aContext) override
 
constexpr VECTOR2< U > operator() () const
 Cast a vector to another specialized subclass. Beware of rounding issues.
 
constexpr VECTOR2< U > operator() () const
 Cast a vector to another specialized subclass. Beware of rounding issues.
 
int32_t EuclideanNorm () const
 Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
 
int32_t EuclideanNorm () const
 Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
 
constexpr extended_type SquaredEuclideanNorm () const
 Compute the squared euclidean norm of the vector, which is defined as (x ** 2 + y ** 2).
 
constexpr extended_type SquaredEuclideanNorm () const
 Compute the squared euclidean norm of the vector, which is defined as (x ** 2 + y ** 2).
 
constexpr VECTOR2< int32_t > Perpendicular () const
 Compute the perpendicular vector.
 
constexpr VECTOR2< int32_t > Perpendicular () const
 Compute the perpendicular vector.
 
VECTOR2< int32_t > Resize (int32_t aNewLength) const
 Return a vector of the same direction, but length specified in aNewLength.
 
VECTOR2< int32_t > Resize (int32_t aNewLength) const
 Return a vector of the same direction, but length specified in aNewLength.
 
const std::string Format () const
 Return the vector formatted as a string.
 
const std::string Format () const
 Return the vector formatted as a string.
 
constexpr extended_type Cross (const VECTOR2< int32_t > &aVector) const
 Compute cross product of self with aVector.
 
constexpr extended_type Cross (const VECTOR2< int32_t > &aVector) const
 Compute cross product of self with aVector.
 
constexpr extended_type Dot (const VECTOR2< int32_t > &aVector) const
 Compute dot product of self with aVector.
 
constexpr extended_type Dot (const VECTOR2< int32_t > &aVector) const
 Compute dot product of self with aVector.
 
double Distance (const VECTOR2< extended_type > &aVector) const
 Compute the distance between two vectors.
 
double Distance (const VECTOR2< extended_type > &aVector) const
 Compute the distance between two vectors.
 
constexpr extended_type SquaredDistance (const VECTOR2< int32_t > &aVector) const
 Compute the squared distance between two vectors.
 
constexpr extended_type SquaredDistance (const VECTOR2< int32_t > &aVector) const
 Compute the squared distance between two vectors.
 
constexpr VECTOR2< int32_t > & operator+= (const VECTOR2< int32_t > &aVector)
 Compound assignment operator.
 
constexpr VECTOR2< int32_t > & operator+= (const int32_t &aScalar)
 Compound assignment operator.
 
constexpr VECTOR2< int32_t > & operator+= (const VECTOR2< int32_t > &aVector)
 Compound assignment operator.
 
constexpr VECTOR2< int32_t > & operator+= (const int32_t &aScalar)
 Compound assignment operator.
 
constexpr VECTOR2< int32_t > & operator*= (const VECTOR2< int32_t > &aVector)
 Compound assignment operator.
 
constexpr VECTOR2< int32_t > & operator*= (const int32_t &aScalar)
 
constexpr VECTOR2< int32_t > & operator*= (const VECTOR2< int32_t > &aVector)
 Compound assignment operator.
 
constexpr VECTOR2< int32_t > & operator*= (const int32_t &aScalar)
 
constexpr VECTOR2< int32_t > & operator-= (const VECTOR2< int32_t > &aVector)
 Compound assignment operator.
 
constexpr VECTOR2< int32_t > & operator-= (const int32_t &aScalar)
 Compound assignment operator.
 
constexpr VECTOR2< int32_t > & operator-= (const VECTOR2< int32_t > &aVector)
 Compound assignment operator.
 
constexpr VECTOR2< int32_t > & operator-= (const int32_t &aScalar)
 Compound assignment operator.
 
constexpr VECTOR2< int32_t > operator- ()
 Negate Vector operator.
 
constexpr VECTOR2< int32_t > operator- ()
 Negate Vector operator.
 
constexpr VECTOR2< int32_t > operator/ (double aFactor) const
 Division with a factor.
 
constexpr VECTOR2< int32_t > operator/ (double aFactor) const
 Division with a factor.
 
constexpr bool operator== (const VECTOR2< int32_t > &aVector) const
 Equality operator.
 
constexpr bool operator== (const VECTOR2< int32_t > &aVector) const
 Equality operator.
 
constexpr bool operator!= (const VECTOR2< int32_t > &aVector) const
 Not equality operator.
 
constexpr bool operator!= (const VECTOR2< int32_t > &aVector) const
 Not equality operator.
 
constexpr bool operator< (const VECTOR2< int32_t > &aVector) const
 Smaller than operator.
 
constexpr bool operator< (const VECTOR2< int32_t > &aVector) const
 Smaller than operator.
 
constexpr bool operator<= (const VECTOR2< int32_t > &aVector) const
 
constexpr bool operator<= (const VECTOR2< int32_t > &aVector) const
 
constexpr bool operator> (const VECTOR2< int32_t > &aVector) const
 Greater than operator.
 
constexpr bool operator> (const VECTOR2< int32_t > &aVector) const
 Greater than operator.
 
constexpr bool operator>= (const VECTOR2< int32_t > &aVector) const
 
constexpr bool operator>= (const VECTOR2< int32_t > &aVector) const
 

Public Attributes

int32_t x
 
int32_t x
 
int32_t y
 
int32_t y
 

Static Public Attributes

static constexpr extended_type ECOORD_MAX
 
static constexpr extended_type ECOORD_MAX
 
static constexpr extended_type ECOORD_MIN
 
static constexpr extended_type ECOORD_MIN
 

Detailed Description

Represent a point in x,y coordinates.

Definition at line 417 of file cadstar_archive_parser.h.

Member Typedef Documentation

◆ coord_type

typedef int32_t VECTOR2< int32_t >::coord_type
inherited

Definition at line 70 of file vector2d.h.

◆ extended_type

typedef VECTOR2_TRAITS<int32_t>::extended_type VECTOR2< int32_t >::extended_type
inherited

Definition at line 69 of file vector2d.h.

Constructor & Destructor Documentation

◆ POINT() [1/2]

CADSTAR_ARCHIVE_PARSER::POINT::POINT ( )
inline

Definition at line 419 of file cadstar_archive_parser.h.

References CADSTAR_ARCHIVE_PARSER::UNDEFINED_VALUE.

◆ POINT() [2/2]

CADSTAR_ARCHIVE_PARSER::POINT::POINT ( int aX,
int aY )
inline

Definition at line 420 of file cadstar_archive_parser.h.

Member Function Documentation

◆ Cross() [1/2]

extended_type VECTOR2< int32_t >::Cross ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Compute cross product of self with aVector.

◆ Cross() [2/2]

VECTOR2< int32_t >::extended_type VECTOR2< int32_t >::Cross ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Compute cross product of self with aVector.

Definition at line 200 of file vector2d.h.

◆ Distance() [1/2]

double VECTOR2< int32_t >::Distance ( const VECTOR2< extended_type > & aVector) const
inherited

Compute the distance between two vectors.

This is a double precision value because the distance is frequently non-integer.

◆ Distance() [2/2]

double VECTOR2< int32_t >::Distance ( const VECTOR2< extended_type > & aVector) const
inherited

Compute the distance between two vectors.

This is a double precision value because the distance is frequently non-integer.

Definition at line 211 of file vector2d.h.

◆ Dot() [1/2]

extended_type VECTOR2< int32_t >::Dot ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Compute dot product of self with aVector.

◆ Dot() [2/2]

VECTOR2< int32_t >::extended_type VECTOR2< int32_t >::Dot ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Compute dot product of self with aVector.

Definition at line 205 of file vector2d.h.

◆ EuclideanNorm() [1/2]

int32_t VECTOR2< int32_t >::EuclideanNorm ( ) const
inherited

Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).

It is used to calculate the length of the vector.

For signed integer types the result is exactly rounded to nearest and saturates at the type maximum.

Returns
Scalar, the euclidean norm

◆ EuclideanNorm() [2/2]

int32_t VECTOR2< int32_t >::EuclideanNorm ( ) const
inherited

Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).

It is used to calculate the length of the vector.

For signed integer types the result is exactly rounded to nearest and saturates at the type maximum.

Returns
Scalar, the euclidean norm

Definition at line 163 of file vector2d.h.

◆ Format() [1/2]

const std::string VECTOR2< int32_t >::Format ( ) const
inherited

Return the vector formatted as a string.

Returns
the formatted string

◆ Format() [2/2]

const std::string VECTOR2< int32_t >::Format ( ) const
inherited

Return the vector formatted as a string.

Returns
the formatted string

Definition at line 195 of file vector2d.h.

◆ operator!=() [1/2]

bool VECTOR2< int32_t >::operator!= ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Not equality operator.

◆ operator!=() [2/2]

bool VECTOR2< int32_t >::operator!= ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Not equality operator.

Definition at line 250 of file vector2d.h.

◆ operator()() [1/2]

VECTOR2< U > VECTOR2< int32_t >::operator() ( ) const
inlineconstexprinherited

Cast a vector to another specialized subclass. Beware of rounding issues.

Definition at line 124 of file vector2d.h.

◆ operator()() [2/2]

VECTOR2< U > VECTOR2< int32_t >::operator() ( ) const
inlineconstexprinherited

Cast a vector to another specialized subclass. Beware of rounding issues.

Definition at line 124 of file vector2d.h.

◆ operator*=() [1/4]

VECTOR2< int32_t > & VECTOR2< int32_t >::operator*= ( const int32_t & aScalar)
constexprinherited

◆ operator*=() [2/4]

VECTOR2< int32_t > & VECTOR2< int32_t >::operator*= ( const int32_t & aScalar)
constexprinherited

Definition at line 229 of file vector2d.h.

◆ operator*=() [3/4]

VECTOR2< int32_t > & VECTOR2< int32_t >::operator*= ( const VECTOR2< int32_t > & aVector)
constexprinherited

Compound assignment operator.

◆ operator*=() [4/4]

VECTOR2< int32_t > & VECTOR2< int32_t >::operator*= ( const VECTOR2< int32_t > & aVector)
constexprinherited

Compound assignment operator.

Definition at line 227 of file vector2d.h.

◆ operator+=() [1/4]

VECTOR2< int32_t > & VECTOR2< int32_t >::operator+= ( const int32_t & aScalar)
constexprinherited

Compound assignment operator.

◆ operator+=() [2/4]

VECTOR2< int32_t > & VECTOR2< int32_t >::operator+= ( const int32_t & aScalar)
constexprinherited

Compound assignment operator.

Definition at line 232 of file vector2d.h.

◆ operator+=() [3/4]

VECTOR2< int32_t > & VECTOR2< int32_t >::operator+= ( const VECTOR2< int32_t > & aVector)
constexprinherited

Compound assignment operator.

◆ operator+=() [4/4]

VECTOR2< int32_t > & VECTOR2< int32_t >::operator+= ( const VECTOR2< int32_t > & aVector)
constexprinherited

Compound assignment operator.

Definition at line 224 of file vector2d.h.

◆ operator-() [1/2]

VECTOR2< int32_t > VECTOR2< int32_t >::operator- ( )
constexprinherited

Negate Vector operator.

◆ operator-() [2/2]

VECTOR2< int32_t > VECTOR2< int32_t >::operator- ( )
constexprinherited

Negate Vector operator.

Definition at line 241 of file vector2d.h.

◆ operator-=() [1/4]

VECTOR2< int32_t > & VECTOR2< int32_t >::operator-= ( const int32_t & aScalar)
constexprinherited

Compound assignment operator.

◆ operator-=() [2/4]

VECTOR2< int32_t > & VECTOR2< int32_t >::operator-= ( const int32_t & aScalar)
constexprinherited

Compound assignment operator.

Definition at line 238 of file vector2d.h.

◆ operator-=() [3/4]

VECTOR2< int32_t > & VECTOR2< int32_t >::operator-= ( const VECTOR2< int32_t > & aVector)
constexprinherited

Compound assignment operator.

◆ operator-=() [4/4]

VECTOR2< int32_t > & VECTOR2< int32_t >::operator-= ( const VECTOR2< int32_t > & aVector)
constexprinherited

Compound assignment operator.

Definition at line 235 of file vector2d.h.

◆ operator/() [1/2]

VECTOR2< int32_t > VECTOR2< int32_t >::operator/ ( double aFactor) const
constexprinherited

Division with a factor.

◆ operator/() [2/2]

VECTOR2< int32_t > VECTOR2< int32_t >::operator/ ( double aFactor) const
constexprinherited

Division with a factor.

Definition at line 244 of file vector2d.h.

◆ operator<() [1/2]

bool VECTOR2< int32_t >::operator< ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Smaller than operator.

◆ operator<() [2/2]

bool VECTOR2< int32_t >::operator< ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Smaller than operator.

Definition at line 253 of file vector2d.h.

◆ operator<=() [1/2]

bool VECTOR2< int32_t >::operator<= ( const VECTOR2< int32_t > & aVector) const
constexprinherited

◆ operator<=() [2/2]

bool VECTOR2< int32_t >::operator<= ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Definition at line 254 of file vector2d.h.

◆ operator==() [1/2]

bool VECTOR2< int32_t >::operator== ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Equality operator.

◆ operator==() [2/2]

bool VECTOR2< int32_t >::operator== ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Equality operator.

Definition at line 247 of file vector2d.h.

◆ operator>() [1/2]

bool VECTOR2< int32_t >::operator> ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Greater than operator.

◆ operator>() [2/2]

bool VECTOR2< int32_t >::operator> ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Greater than operator.

Definition at line 257 of file vector2d.h.

◆ operator>=() [1/2]

bool VECTOR2< int32_t >::operator>= ( const VECTOR2< int32_t > & aVector) const
constexprinherited

◆ operator>=() [2/2]

bool VECTOR2< int32_t >::operator>= ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Definition at line 258 of file vector2d.h.

◆ Parse()

void CADSTAR_ARCHIVE_PARSER::POINT::Parse ( XNODE * aNode,
PARSER_CONTEXT * aContext )
overridevirtual

◆ Perpendicular() [1/2]

VECTOR2< int32_t > VECTOR2< int32_t >::Perpendicular ( ) const
constexprinherited

Compute the perpendicular vector.

Returns
Perpendicular vector

◆ Perpendicular() [2/2]

VECTOR2< int32_t > VECTOR2< int32_t >::Perpendicular ( ) const
constexprinherited

Compute the perpendicular vector.

Returns
Perpendicular vector

Definition at line 180 of file vector2d.h.

◆ Resize() [1/2]

VECTOR2< int32_t > VECTOR2< int32_t >::Resize ( int32_t aNewLength) const
inherited

Return a vector of the same direction, but length specified in aNewLength.

Parameters
aNewLengthis the length of the rescaled vector.
Returns
the rescaled vector.

◆ Resize() [2/2]

VECTOR2< int32_t > VECTOR2< int32_t >::Resize ( int32_t aNewLength) const
inherited

Return a vector of the same direction, but length specified in aNewLength.

Parameters
aNewLengthis the length of the rescaled vector.
Returns
the rescaled vector.

Definition at line 188 of file vector2d.h.

◆ SquaredDistance() [1/2]

extended_type VECTOR2< int32_t >::SquaredDistance ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Compute the squared distance between two vectors.

◆ SquaredDistance() [2/2]

VECTOR2< int32_t >::extended_type VECTOR2< int32_t >::SquaredDistance ( const VECTOR2< int32_t > & aVector) const
constexprinherited

Compute the squared distance between two vectors.

Definition at line 216 of file vector2d.h.

◆ SquaredEuclideanNorm() [1/2]

extended_type VECTOR2< int32_t >::SquaredEuclideanNorm ( ) const
constexprinherited

Compute the squared euclidean norm of the vector, which is defined as (x ** 2 + y ** 2).

It is used to calculate the length of the vector. For int and int64_t it saturates at the extended type maximum.

Returns
Scalar, the euclidean norm

◆ SquaredEuclideanNorm() [2/2]

VECTOR2< int32_t >::extended_type VECTOR2< int32_t >::SquaredEuclideanNorm ( ) const
constexprinherited

Compute the squared euclidean norm of the vector, which is defined as (x ** 2 + y ** 2).

It is used to calculate the length of the vector. For int and int64_t it saturates at the extended type maximum.

Returns
Scalar, the euclidean norm

Definition at line 172 of file vector2d.h.

Member Data Documentation

◆ ECOORD_MAX [1/2]

◆ ECOORD_MAX [2/2]

extended_type VECTOR2< int32_t >::ECOORD_MAX
staticconstexprinherited

Definition at line 72 of file vector2d.h.

◆ ECOORD_MIN [1/2]

extended_type VECTOR2< int32_t >::ECOORD_MIN
staticconstexprinherited

Definition at line 73 of file vector2d.h.

◆ ECOORD_MIN [2/2]

extended_type VECTOR2< int32_t >::ECOORD_MIN
staticconstexprinherited

Definition at line 73 of file vector2d.h.

◆ x [1/2]

int32_t VECTOR2< int32_t >::x
inherited

Definition at line 75 of file vector2d.h.

Referenced by CADSTAR_ARCHIVE_PARSER::POINT::Parse().

◆ x [2/2]

int32_t VECTOR2< int32_t >::x
inherited

Definition at line 75 of file vector2d.h.

◆ y [1/2]

int32_t VECTOR2< int32_t >::y
inherited

Definition at line 75 of file vector2d.h.

Referenced by CADSTAR_ARCHIVE_PARSER::POINT::Parse().

◆ y [2/2]

int32_t VECTOR2< int32_t >::y
inherited

Definition at line 75 of file vector2d.h.


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