3ds Max C++ API Reference
ipoint2.h File Reference
#include "GeomExport.h"
#include "maxheap.h"
#include "strbasic.h"
#include "assert1.h"
#include <iosfwd>
#include <math.h>

Classes

class  IPoint2
 

Functions

int Length (const IPoint2 &)
 
IPoint2 Normalize (const IPoint2 &)
 
IPoint2 operator* (int, const IPoint2 &)
 
IPoint2 operator* (const IPoint2 &, int)
 
IPoint2 operator/ (const IPoint2 &, int)
 
M_STD_OSTREAMoperator<< (M_STD_OSTREAM &, const IPoint2 &)
 
int MaxComponent (const IPoint2 &p)
 
int MinComponent (const IPoint2 &p)
 

Function Documentation

◆ Length()

int Length ( const IPoint2 v)
inline
Remarks
Returns the length of the IPoint2, ie:

sqrt(v.x*v.x+v.y*v.y);
167 {
168  double dvx = (double)v.x;
169  double dvy = (double)v.y;
170  return (int)sqrt(dvx * dvx + dvy * dvy);
171 }
int y
Definition: ipoint2.h:38
int x
Definition: ipoint2.h:37

◆ Normalize()

IPoint2 Normalize ( const IPoint2 )
Remarks
Returns a unit vector. This is an IPoint2 with each component divided by the point Length().

◆ operator*() [1/2]

IPoint2 operator* ( int  f,
const IPoint2 a 
)
inline
Remarks
Returns an IPoint2 multiplied by a scalar.
229 {
230  return (IPoint2(a.x * f, a.y * f));
231 }
Definition: ipoint2.h:33

◆ operator*() [2/2]

IPoint2 operator* ( const IPoint2 a,
int  f 
)
inline
Remarks
Returns an IPoint2 multiplied by a scalar.
234 {
235  return (IPoint2(a.x * f, a.y * f));
236 }

◆ operator/()

IPoint2 operator/ ( const IPoint2 a,
int  f 
)
inline
Remarks
Returns an IPoint2 whose x and y members are divided by a scalar.
239 {
240  return (IPoint2(a.x / f, a.y / f));
241 }

◆ operator<<()

M_STD_OSTREAM& operator<< ( M_STD_OSTREAM ,
const IPoint2  
)

◆ MaxComponent()

int MaxComponent ( const IPoint2 p)
inline
Remarks
Returns the component with the minimum abs value. 0=x, 1=y.
157 {
158  return (p.x > p.y ? 0 : 1);
159 }

◆ MinComponent()

int MinComponent ( const IPoint2 p)
inline
Remarks
Returns the component with the minimum abs value. 0=x, 1=y.
162 {
163  return (p.x < p.y ? 0 : 1);
164 }