3ds Max C++ API Reference
IPoint3 Class Reference

#include <ipoint3.h>

+ Inheritance diagram for IPoint3:

Public Member Functions

 IPoint3 ()=default
 Initializes all vector components to zero. More...
 
 IPoint3 (const IPoint3 &)=default
 
 IPoint3 (IPoint3 &&)=default
 
IPoint3operator= (const IPoint3 &)=default
 
IPoint3operator= (IPoint3 &&)=default
 
 IPoint3 (int X, int Y, int Z)
 
 IPoint3 (const int ai[3])
 
intoperator[] (int i)
 
const intoperator[] (int i) const
 
 operator int * ()
 
IPoint3 operator- () const
 
IPoint3 operator+ () const
 
IPoint3operator-= (const IPoint3 &)
 
IPoint3operator+= (const IPoint3 &)
 
IPoint3operator*= (const IPoint3 &)
 Member-wise, in-place multiplication of this vector: (x*x, y*y, z*z) More...
 
IPoint3 operator- (const IPoint3 &) const
 
IPoint3 operator+ (const IPoint3 &) const
 
IPoint3 operator* (const IPoint3 &) const
 Member-wise multiplication of two vectors: (x*x, y*y, z*z) More...
 
int DotProd (const IPoint3 &) const
 
IPoint3 operator^ (const IPoint3 &) const
 
IPoint3 CrossProd (const IPoint3 &) const
 
int operator== (const IPoint3 &p) const
 
int operator!= (const IPoint3 &p) const
 

Public Attributes

int x = 0
 
int y = 0
 
int z = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

See also
Class Point3.

Description:
This class describes a 3D point using integer x, y and z coordinates. Methods are provided to add and subtract points, multiply and divide by scalars, and element by element multiply and divide two points. All methods are implemented by the system.
Data Members:
int x,y,z;

Constructor & Destructor Documentation

◆ IPoint3() [1/5]

IPoint3 ( )
default

Initializes all vector components to zero.

◆ IPoint3() [2/5]

IPoint3 ( const IPoint3 )
default

◆ IPoint3() [3/5]

IPoint3 ( IPoint3 &&  )
default

◆ IPoint3() [4/5]

IPoint3 ( int  X,
int  Y,
int  Z 
)
inline
Remarks
Constructor. x, y, and z are initialized to the values specified.
49  {
50  x = X;
51  y = Y;
52  z = Z;
53  }
int y
Definition: ipoint3.h:35
int z
Definition: ipoint3.h:36
int x
Definition: ipoint3.h:34

◆ IPoint3() [5/5]

IPoint3 ( const int  ai[3])
inline
Remarks
Constructor. x, y, and z are initialized to. ai[0], ai[1], and ai[2] respectively.
57  {
58  x = ai[0];
59  y = ai[1];
60  z = ai[2];
61  }

Member Function Documentation

◆ operator=() [1/2]

IPoint3& operator= ( const IPoint3 )
default

◆ operator=() [2/2]

IPoint3& operator= ( IPoint3 &&  )
default

◆ operator[]() [1/2]

int& operator[] ( int  i)
inline
Remarks
Allows access to x, y and z using the [ ] operator.
Returns
An index of 0 will return x, 1 will return y, 2 will return z.
67  {
68  DbgAssert((i >= 0) && (i <= 2));
69  return (&x)[i];
70  }
#define DbgAssert(expr)
Definition: assert1.h:82

◆ operator[]() [2/2]

const int& operator[] ( int  i) const
inline
Remarks
Allows access to x, y and z using the [ ] operator.
Returns
An index of 0 will return x, 1 will return y, 2 will return z.
74  {
75  DbgAssert((i >= 0) && (i <= 2));
76  return (&x)[i];
77  }

◆ operator int *()

operator int * ( )
inline
Remarks
Conversion function. Returns the address of the IPoint3.
82  {
83  return (&x);
84  }

◆ operator-() [1/2]

IPoint3 operator- ( ) const
inline
Remarks
Unary - operator. Negates x, y and z.
89  {
90  return (IPoint3(-x, -y, -z));
91  }
IPoint3()=default
Initializes all vector components to zero.

◆ operator+() [1/2]

IPoint3 operator+ ( ) const
inline
Remarks
Unary +. Returns the point unaltered.
94  {
95  return *this;
96  }

◆ operator-=()

IPoint3 & operator-= ( const IPoint3 a)
inline
Remarks
Subtracts a IPoint3 from this IPoint3.
155 {
156  x -= a.x;
157  y -= a.y;
158  z -= a.z;
159  return *this;
160 }

◆ operator+=()

IPoint3 & operator+= ( const IPoint3 a)
inline
Remarks
Adds a IPoint3 to this IPoint3.
163 {
164  x += a.x;
165  y += a.y;
166  z += a.z;
167  return *this;
168 }

◆ operator*=()

IPoint3 & operator*= ( const IPoint3 rhs)
inline

Member-wise, in-place multiplication of this vector: (x*x, y*y, z*z)

171 {
172  x *= rhs.x;
173  y *= rhs.y;
174  z *= rhs.z;
175  return *this;
176 }

◆ operator-() [2/2]

IPoint3 operator- ( const IPoint3 b) const
inline
Remarks
Subtracts a IPoint3 from a IPoint3.
179 {
180  return (IPoint3(x - b.x, y - b.y, z - b.z));
181 }

◆ operator+() [2/2]

IPoint3 operator+ ( const IPoint3 b) const
inline
Remarks
Adds a IPoint3 to a IPoint3.
184 {
185  return (IPoint3(x + b.x, y + b.y, z + b.z));
186 }

◆ operator*()

IPoint3 operator* ( const IPoint3 b) const
inline

Member-wise multiplication of two vectors: (x*x, y*y, z*z)

189 {
190  return IPoint3(x * b.x, y * b.y, z * b.z);
191 }

◆ DotProd()

int DotProd ( const IPoint3 b) const
inline
Remarks
Returns the dot product of two IPoint3s.
194 {
195  return (x * b.x + y * b.y + z * b.z);
196 }

◆ operator^()

IPoint3 operator^ ( const IPoint3 ) const
Remarks
The cross product of two IPoint3's (vectors).

◆ CrossProd()

IPoint3 CrossProd ( const IPoint3 ) const
Remarks
Returns the cross product of two IPoint3's (vectors).

◆ operator==()

int operator== ( const IPoint3 p) const
inline
Remarks
Test for equality between two IPoint3's.
Returns
Nonzero if the IPoint3's are equal; otherwise 0.

125  {
126  return (x == p.x && y == p.y && z == p.z);
127  }

◆ operator!=()

int operator!= ( const IPoint3 p) const
inline
129  {
130  return ((x != p.x) || (y != p.y) || (z != p.z));
131  }

Member Data Documentation

◆ x

int x = 0

◆ y

int y = 0

◆ z

int z = 0