Geom Software - C++ Programming and Geometry Libraries
WOF Documentation pages v1.16
GEOM_WOF::Point3 Class Reference

3D Point

#include <Point3.h>

Public Member Functions

 Point3 (const double x_, const double y_, const double z_)
 Constructor without color. More...
 
 Point3 (const double x_, const double y_, const double z_, unsigned char r_, unsigned char g_, unsigned char b_, unsigned char a_)
 Constructor with color. More...
 
 Point3 ()
 Default constructor. More...
 
 Point3 (const Point3 &p_)
 Copy constructor. More...
 
Point3operator= (const Point3 &other)
 operator= More...
 
 ~Point3 ()
 Destructor.
 
void setColor (unsigned char r_, unsigned char g_, unsigned char b_, unsigned char a_)
 Set color. More...
 
void getColor_255 (unsigned char &r_, unsigned char &g_, unsigned char &b_, unsigned char &a_) const
 Get color (unsigned char, range=0, ..., 255) More...
 
void getColor_255 (float &r_, float &g_, float &b_, float &a_) const
 Get color (float, range=0, ..., 255) More...
 
std::string getColorString ()
 Get color string (string, range=0.0, ..., 1.0) More...
 
void getColor_1 (float &r_, float &g_, float &b_, float &a_) const
 Get color (float, range=0.0, ..., 1.0) More...
 
bool hasColor () const
 Has color. More...
 
double x () const
 Get the x-coordinate. More...
 
double y () const
 Get the y-coordinate. More...
 
double z () const
 Get the z-coordinate. More...
 
void xyz (double &x_, double &y_, double &z_) const
 Get the x-, y- and z-coordinate. More...
 
void addOwnCoords (double &x, double &y, double &z) const
 Add the point's coordinates to x,y,z. More...
 
void copyColorFrom (const Point3 &other)
 Copy the color from another point. More...
 
void copyColorFrom (const Point3 &other0, const Point3 &other1)
 Copy the average color from two points. More...
 
void addWeightedOwnCoords (double weight, double &x, double &y, double &z) const
 Add the point's weighted coordinates to x,y,z. More...
 
bool operator< (const Point3 &p) const
 Less than operator. More...
 
bool operator> (const Point3 &p) const
 Greater than operator. More...
 
bool operator== (const Point3 &p) const
 Equality operator. More...
 
bool operator!= (const Point3 &p) const
 Inequality operator. More...
 
void set (const double x_, const double y_, const double z_)
 Set the coordiantes. More...
 
void set (const Point3 &pnt)
 Set the coordiantes. More...
 
Vector3 operator- (const Point3 &other) const
 operator- More...
 
Point3 operator+ (const Vector3 &vec) const
 operator+ More...
 
Point3 operator- (const Vector3 &vec) const
 operator- More...
 

Protected Attributes

double coordX
 
double coordY
 
double coordZ
 
unsigned char r
 
unsigned char g
 
unsigned char b
 
unsigned char a
 
bool bHasColor
 

Friends

std::ostream & operator<< (std::ostream &stream, const Point3 &pnt)
 
std::istream & operator>> (std::istream &stream, Point3 &pnt)
 

Constructor & Destructor Documentation

◆ Point3() [1/4]

GEOM_WOF::Point3::Point3 ( const double  x_,
const double  y_,
const double  z_ 
)
inline
Parameters
x_,y_,z_[in] coordinates

◆ Point3() [2/4]

GEOM_WOF::Point3::Point3 ( const double  x_,
const double  y_,
const double  z_,
unsigned char  r_,
unsigned char  g_,
unsigned char  b_,
unsigned char  a_ 
)
inline
Parameters
x_,y_,z_[in] coordinates
r_,g_,b_,a_[in] color

◆ Point3() [3/4]

GEOM_WOF::Point3::Point3 ( )
inline

Coordinates are initialized to 0.

◆ Point3() [4/4]

GEOM_WOF::Point3::Point3 ( const Point3 p_)
inline

Copies the coordinates of p_

Member Function Documentation

◆ addOwnCoords()

void GEOM_WOF::Point3::addOwnCoords ( double &  x,
double &  y,
double &  z 
) const
inline
Parameters
x,y,z[inout] are used to accumulate the point's coordinates

◆ addWeightedOwnCoords()

void GEOM_WOF::Point3::addWeightedOwnCoords ( double  weight,
double &  x,
double &  y,
double &  z 
) const
inline
Parameters
weightis a factor on x,y,z
x,y,z[inout] are used to accumulate the point's coordinates

◆ copyColorFrom() [1/2]

void GEOM_WOF::Point3::copyColorFrom ( const Point3 other)
inline
Parameters
other[in] is the point whose color is copied

◆ copyColorFrom() [2/2]

void GEOM_WOF::Point3::copyColorFrom ( const Point3 other0,
const Point3 other1 
)
inline
Parameters
other0,other1[in] are the points whose color is averaged

◆ getColor_1()

void GEOM_WOF::Point3::getColor_1 ( float &  r_,
float &  g_,
float &  b_,
float &  a_ 
) const
inline
Parameters
r_,g_,b_,a_are red, green, blue, alpha

◆ getColor_255() [1/2]

void GEOM_WOF::Point3::getColor_255 ( float &  r_,
float &  g_,
float &  b_,
float &  a_ 
) const
inline
Parameters
r_,g_,b_,a_are red, green, blue, alpha

◆ getColor_255() [2/2]

void GEOM_WOF::Point3::getColor_255 ( unsigned char &  r_,
unsigned char &  g_,
unsigned char &  b_,
unsigned char &  a_ 
) const
inline
Parameters
r_,g_,b_,a_are red, green, blue, alpha

◆ getColorString()

std::string GEOM_WOF::Point3::getColorString ( )
inline
Parameters
r_,g_,b_,a_are red, green, blue, alpha

◆ hasColor()

bool GEOM_WOF::Point3::hasColor ( ) const
inline

Returns whether a color has been assigned to the point

◆ operator!=()

bool GEOM_WOF::Point3::operator!= ( const Point3 p) const
inline
Parameters
p[in] The point whose coordinates are compared with the ones of the present point

◆ operator+()

Point3 GEOM_WOF::Point3::operator+ ( const Vector3 vec) const
inline
Returns
a point that corresponds to the present point moved by vec

◆ operator-() [1/2]

Vector3 GEOM_WOF::Point3::operator- ( const Point3 other) const
inline
Returns
the difference vector ( *this - other) i.e., a vector pointing from the point other to *this.

◆ operator-() [2/2]

Point3 GEOM_WOF::Point3::operator- ( const Vector3 vec) const
inline
Returns
a point that corresponds to the present point moved by vec

◆ operator<()

bool GEOM_WOF::Point3::operator< ( const Point3 p) const
inline
Parameters
p[in] is compared with *this
Returns
true if the coordinates of the present point are lexicographically smaller than the ones of p or false otherwise

◆ operator=()

Point3& GEOM_WOF::Point3::operator= ( const Point3 other)
inline

Assigns other

◆ operator==()

bool GEOM_WOF::Point3::operator== ( const Point3 p) const
inline
Parameters
p[in] The point whose coordinates are compared with the ones of the present point

◆ operator>()

bool GEOM_WOF::Point3::operator> ( const Point3 p) const
inline
Parameters
p[in] The point whose coordinates are compared with the ones of the present point
Returns
true if the coordinates of the present point are lexicographically greater than the ones of p or false otherwise

◆ set() [1/2]

void GEOM_WOF::Point3::set ( const double  x_,
const double  y_,
const double  z_ 
)
inline

Set the coordinates of the present point to x_,y_,z_.

Parameters
x_,y_,z_[in] are the coordinates to be assigned

◆ set() [2/2]

void GEOM_WOF::Point3::set ( const Point3 pnt)
inline

Set the coordinates of the present point to the ones of pnt

Parameters
pntcarries the coordinates to be assigned

◆ setColor()

void GEOM_WOF::Point3::setColor ( unsigned char  r_,
unsigned char  g_,
unsigned char  b_,
unsigned char  a_ 
)
inline
Parameters
r_,g_,b_,a_are red, green, blue, alpha in the range 0-255

◆ x()

double GEOM_WOF::Point3::x ( ) const
inline
Returns
the x-coordinate

◆ xyz()

void GEOM_WOF::Point3::xyz ( double &  x_,
double &  y_,
double &  z_ 
) const
inline
Parameters
x_,y_,z_[out] x,y,z-coordinates
Returns
all 3 coordinates at once

◆ y()

double GEOM_WOF::Point3::y ( ) const
inline
Returns
the y-coordinate

◆ z()

double GEOM_WOF::Point3::z ( ) const
inline
Returns
the z-coordinate

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