Core 1.0
Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
QPoint3 Class Reference

Point in three dimensions with integer coordinates. More...

#include <ivector.h>

Public Member Functions

 QPoint3 ()
 Empty.
 
 QPoint3 (int)
 Create a vector with the same coordinates. More...
 
 QPoint3 (int, int, int)
 Create a vector with argument coordinates. More...
 
int & operator[] (int)
 Gets the i-th coordinate of vector.
 
int operator[] (int) const
 Returns the i-th coordinate of vector.
 
QPoint3 operator+ () const
 Overloaded.
 
QPoint3 operator- () const
 Overloaded.
 
QPoint3operator+= (const QPoint3 &)
 Destructive addition.
 
QPoint3operator-= (const QPoint3 &)
 Destructive subtraction.
 
QPoint3operator*= (int)
 Destructive scalar multiply.
 
QPoint3 Next (int) const
 Return the k-th point in the 1-neighborhood of the point. More...
 
QString ToString () const
 Create a QString form a integer vector. More...
 

Static Public Attributes

static const QPoint3 next [26]
 % Array of 26 QPoint3 representing the offsets of the 1-neighborhood points of a QPoint3.
 

Protected Attributes

int c [3] = { 0,0,0 }
 Integer coordinates.
 

Friends

QPoint3 operator+ (const QPoint3 &, const QPoint3 &)
 Destructively scale a vector by another vector. More...
 
QPoint3 operator- (const QPoint3 &, const QPoint3 &)
 Difference between two vectors.
 
bool operator== (const QPoint3 &, const QPoint3 &)
 Strong equality test.
 
bool operator!= (const QPoint3 &, const QPoint3 &)
 Strong difference test.
 
std::ostream & operator<< (std::ostream &, const QPoint3 &)
 Overloaded output-stream operator. More...
 

Detailed Description

Point in three dimensions with integer coordinates.

This class completes the QPoint class from Qt.

Constructor & Destructor Documentation

◆ QPoint3() [1/2]

QPoint3::QPoint3 ( int  a)
inline

Create a vector with the same coordinates.

Parameters
aInteger.

◆ QPoint3() [2/2]

QPoint3::QPoint3 ( int  a,
int  b,
int  c 
)
inline

Create a vector with argument coordinates.

Parameters
a,b,cCoordinates.

Member Function Documentation

◆ Next()

QPoint3 QPoint3::Next ( int  k) const
inline

Return the k-th point in the 1-neighborhood of the point.

Parameters
kIndex.

◆ ToString()

QString QPoint3::ToString ( ) const

Create a QString form a integer vector.

Parameters
nNumber of digits.

Friends And Related Function Documentation

◆ operator+

QPoint3 operator+ ( const QPoint3 u,
const QPoint3 v 
)
friend

Destructively scale a vector by another vector.

Adds up two vectors.

◆ operator<<

std::ostream & operator<< ( std::ostream &  s,
const QPoint3 u 
)
friend

Overloaded output-stream operator.

Parameters
uVector.
sStream.