KiCad PCB EDA Suite
DSN::POINT Struct Reference

A point in the SPECCTRA DSN coordinate system. More...

#include <specctra.h>

Public Member Functions

 POINT ()
 
 POINT (double aX, double aY)
 
bool operator== (const POINT &other) const
 
bool operator!= (const POINT &other) const
 
POINToperator+= (const POINT &other)
 
POINToperator= (const POINT &other)
 
void FixNegativeZero ()
 Change negative zero to positive zero in the IEEE floating point storage format. More...
 
void Format (OUTPUTFORMATTER *out, int nestLevel) const
 Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format. More...
 

Public Attributes

double x
 
double y
 

Detailed Description

A point in the SPECCTRA DSN coordinate system.

It can also be used to hold a distance (vector really) from some origin.

Definition at line 102 of file specctra.h.

Constructor & Destructor Documentation

◆ POINT() [1/2]

DSN::POINT::POINT ( )
inline

Definition at line 107 of file specctra.h.

107 { x=0.0; y=0.0; }
double y
Definition: specctra.h:105
double x
Definition: specctra.h:104

References x, and y.

◆ POINT() [2/2]

DSN::POINT::POINT ( double  aX,
double  aY 
)
inline

Definition at line 109 of file specctra.h.

109  :
110  x(aX), y(aY)
111  {
112  }
double y
Definition: specctra.h:105
double x
Definition: specctra.h:104

Member Function Documentation

◆ FixNegativeZero()

void DSN::POINT::FixNegativeZero ( )
inline

Change negative zero to positive zero in the IEEE floating point storage format.

Basically turns off the sign bit if the mantissa and exponent say the value is otherwise zero.

Definition at line 144 of file specctra.h.

145  {
146  if( x == -0.0 )
147  x = 0.0;
148 
149  if( y == -0.0 )
150  y = 0.0;
151  }
double y
Definition: specctra.h:105
double x
Definition: specctra.h:104

References x, and y.

Referenced by DSN::mapPt(), DSN::QARC::SetCenter(), DSN::RECTANGLE::SetCorners(), DSN::QARC::SetEnd(), DSN::QARC::SetStart(), DSN::PLACE::SetVertex(), and DSN::PIN::SetVertex().

◆ Format()

void DSN::POINT::Format ( OUTPUTFORMATTER out,
int  nestLevel 
) const
inline

Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.

Parameters
outThe formatter to write to.
nestLevelA multiple of the number of spaces to precede the output with.
Exceptions
IO_ERRORif a system error writing the output, such as a full disk.

Definition at line 160 of file specctra.h.

161  {
162  out->Print( nestLevel, " %.6g %.6g", x, y );
163  }
double y
Definition: specctra.h:105
double x
Definition: specctra.h:104
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Format and write text to the output stream.
Definition: richio.cpp:426

References OUTPUTFORMATTER::Print(), x, and y.

◆ operator!=()

bool DSN::POINT::operator!= ( const POINT other) const
inline

Definition at line 119 of file specctra.h.

120  {
121  return !( *this == other );
122  }

◆ operator+=()

POINT& DSN::POINT::operator+= ( const POINT other)
inline

Definition at line 124 of file specctra.h.

125  {
126  x += other.x;
127  y += other.y;
128  return *this;
129  }
double y
Definition: specctra.h:105
double x
Definition: specctra.h:104

References x, and y.

◆ operator=()

POINT& DSN::POINT::operator= ( const POINT other)
inline

Definition at line 131 of file specctra.h.

132  {
133  x = other.x;
134  y = other.y;
135  return *this;
136  }
double y
Definition: specctra.h:105
double x
Definition: specctra.h:104

References x, and y.

◆ operator==()

bool DSN::POINT::operator== ( const POINT other) const
inline

Definition at line 114 of file specctra.h.

115  {
116  return x==other.x && y==other.y;
117  }
double y
Definition: specctra.h:105
double x
Definition: specctra.h:104

References x, and y.

Member Data Documentation

◆ x

◆ y


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