SMinMax Class Reference

#include <c4d_tools.h>

详细描述

A class to construct a bounding box around points.

公共成员函数

  SMinMax ()
  SMinMax (const Vector32 &v)
void  Init (void)
void  Init (const Vector32 &v)
void  AddPoint (const Vector32 &p)
void  AddPoints (const Vector32 &a, const Vector32 &b)
void  Set (const Vector32 &a, const Vector32 &b)
Bool   IsPopulated (void) const
const Vector32 GetMin (void) const
const Vector32 GetMax (void) const
Vector32   GetMp (void) const
Vector32   GetRad (void) const
void  GetMpRad ( Vector32 *mp, Vector32 *rad) const

Private Attributes

Vector32   min
Vector32   max
Bool   used

构造函数 & 析构函数文档编制

◆  SMinMax() [1/2]

SMinMax ( )

Default constructor.

◆  SMinMax() [2/2]

SMinMax ( const Vector32 v )
explicit

Constructs with vector v set for both the minimum and maximum.

参数
[in] v The vector for minimum and maximum.

成员函数文档编制

◆  Init() [1/2]

void Init ( void  )

Resets the minimum and maximum to the largest values possible.

◆  Init() [2/2]

void Init ( const Vector32 v )

Initializes the minimum and maximum with vector v .

参数
[in] v The value to initialize minimum and maximum.

◆  AddPoint()

void AddPoint ( const Vector32 p )

Adds point p and recalculates the minimum and maximum.

参数
[in] p The point to add into the bounds.

◆  AddPoints()

void AddPoints ( const Vector32 a ,
const Vector32 b  
)

Adds points a and b and recalculates the minimum and maximum.

参数
[in] a The minimum point to add into the bounds.
[in] b The maximum point to add into the bounds.

◆  Set()

void Set ( const Vector32 a ,
const Vector32 b  
)

Sets the minimum and maximum of the bounding box.

参数
[in] a The minimum.
[in] b The maximum.

◆  IsPopulated()

Bool IsPopulated ( void  ) const

Checks if any points were added.

返回
true if if any points were added to the bounds, otherwise false .

◆  GetMin()

const Vector32 & GetMin ( void  ) const

Gets the minimum of the bounding box.

返回
The minimum position of the bounds.

◆  GetMax()

const Vector32 & GetMax ( void  ) const

Gets the maximum of the bounding box.

返回
The maximum position of the bounds.

◆  GetMp()

Vector32 GetMp ( void  ) const

Gets the middle between the minimum and maximum (the center).

返回
The center of the bounds.

◆  GetRad()

Vector32 GetRad ( void  ) const

Gets half the distance between the minimum and the maximum (the size).

返回
The size of the bounds.

◆  GetMpRad()

void GetMpRad ( Vector32 mp ,
Vector32 rad  
) const

Gets both the center and size of the bounding box.

参数
[out] mp Assigned the center of the bounds.
[out] rad Assigned the size of the bounds.

Member Data Documentation

◆  min

Vector32 min
private

◆  max

Vector32 max
private

◆  used

Bool used
private