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 throw ( IO_ERROR )
 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 94 of file specctra.h.

Constructor & Destructor Documentation

DSN::POINT::POINT ( )
inline

Definition at line 99 of file specctra.h.

99 { x=0.0; y=0.0; }
double y
Definition: specctra.h:97
double x
Definition: specctra.h:96
DSN::POINT::POINT ( double  aX,
double  aY 
)
inline

Definition at line 101 of file specctra.h.

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

Member Function Documentation

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 136 of file specctra.h.

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

137  {
138  if( x == -0.0 )
139  x = 0.0;
140  if( y == -0.0 )
141  y = 0.0;
142  }
double y
Definition: specctra.h:97
double x
Definition: specctra.h:96
void DSN::POINT::Format ( OUTPUTFORMATTER out,
int  nestLevel 
) const
throw (IO_ERROR
)
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 152 of file specctra.h.

153  {
154  out->Print( nestLevel, " %.6g %.6g", x, y );
155  }
double y
Definition: specctra.h:97
double x
Definition: specctra.h:96
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Function Print formats and writes text to the output stream.
Definition: richio.cpp:408
bool DSN::POINT::operator!= ( const POINT other) const
inline

Definition at line 111 of file specctra.h.

112  {
113  return !( *this == other );
114  }
POINT& DSN::POINT::operator+= ( const POINT other)
inline

Definition at line 116 of file specctra.h.

References x, and y.

117  {
118  x += other.x;
119  y += other.y;
120  return *this;
121  }
double y
Definition: specctra.h:97
double x
Definition: specctra.h:96
POINT& DSN::POINT::operator= ( const POINT other)
inline

Definition at line 123 of file specctra.h.

References x, and y.

124  {
125  x = other.x;
126  y = other.y;
127  return *this;
128  }
double y
Definition: specctra.h:97
double x
Definition: specctra.h:96
bool DSN::POINT::operator== ( const POINT other) const
inline

Definition at line 106 of file specctra.h.

References x, and y.

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

Member Data Documentation


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