KiCad PCB EDA Suite
DSN::POINT Struct Reference

Struct POINT is a holder for 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 ()
 Function FixNegativeZero will change negative zero to positive zero in the IEEE floating point storage format. More...
 
void Format (OUTPUTFORMATTER *out, int nestLevel) const
 Function Format writes this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format. More...
 

Public Attributes

double x
 
double y
 

Detailed Description

Struct POINT is a holder for 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 93 of file specctra.h.

Constructor & Destructor Documentation

◆ POINT() [1/2]

DSN::POINT::POINT ( )
inline

Definition at line 98 of file specctra.h.

98 { x=0.0; y=0.0; }
double y
Definition: specctra.h:96
double x
Definition: specctra.h:95

References x, and y.

◆ POINT() [2/2]

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

Definition at line 100 of file specctra.h.

100  :
101  x(aX), y(aY)
102  {
103  }
double y
Definition: specctra.h:96
double x
Definition: specctra.h:95

Member Function Documentation

◆ FixNegativeZero()

void DSN::POINT::FixNegativeZero ( )
inline

Function FixNegativeZero will 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 135 of file specctra.h.

136  {
137  if( x == -0.0 )
138  x = 0.0;
139  if( y == -0.0 )
140  y = 0.0;
141  }
double y
Definition: specctra.h:96
double x
Definition: specctra.h:95

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

Function Format writes 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 preceed the output with.
Exceptions
IO_ERRORif a system error writing the output, such as a full disk.

Definition at line 151 of file specctra.h.

152  {
153  out->Print( nestLevel, " %.6g %.6g", x, y );
154  }
double y
Definition: specctra.h:96
double x
Definition: specctra.h:95
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Format and write text to the output stream.
Definition: richio.cpp:408

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

◆ operator!=()

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

Definition at line 110 of file specctra.h.

111  {
112  return !( *this == other );
113  }

◆ operator+=()

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

Definition at line 115 of file specctra.h.

116  {
117  x += other.x;
118  y += other.y;
119  return *this;
120  }
double y
Definition: specctra.h:96
double x
Definition: specctra.h:95

References x, and y.

◆ operator=()

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

Definition at line 122 of file specctra.h.

123  {
124  x = other.x;
125  y = other.y;
126  return *this;
127  }
double y
Definition: specctra.h:96
double x
Definition: specctra.h:95

References x, and y.

◆ operator==()

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

Definition at line 105 of file specctra.h.

106  {
107  return x==other.x && y==other.y;
108  }
double y
Definition: specctra.h:96
double x
Definition: specctra.h:95

References x, and y.

Member Data Documentation

◆ x

◆ y


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