Core 1.0
Vec3I Class Reference

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

#include <ivector.h>

Public Member Functions

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

Static Public Attributes

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

Protected Attributes

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

Friends

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

Detailed Description

Point in three dimensions with integer coordinates.

This class completes the QPoint class from Qt.

Constructor & Destructor Documentation

◆ Vec3I() [1/2]

Vec3I::Vec3I ( int a)
inline

Create a vector with the same coordinates.

Parameters
aInteger.

◆ Vec3I() [2/2]

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

Create a vector with argument coordinates.

Parameters
a,b,cCoordinates.

Member Function Documentation

◆ Next()

Vec3I Vec3I::Next ( int k) const
inline

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

Parameters
kIndex.

Friends And Related Symbol Documentation

◆ operator+

Vec3I operator+ ( const Vec3I & u,
const Vec3I & v )
friend

Destructively scale a vector by another vector.

Adds up two vectors.

◆ operator<<

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

Overloaded output-stream operator.

Parameters
uVector.
sStream.