LMinMax Class Reference

`#include <c4d_tools.h>`

## Detailed Description

A class to construct a bounding box around points.

## Public Member Functions

LMinMax ()

LMinMax (const Vector64 &v)

void Init (void)

void Init (const Vector64 &v)

void AddPoints (const Vector64 &a, const Vector64 &b)

void Set (const Vector64 &a, const Vector64 &b)

Bool IsPopulated (void) const

const Vector64GetMin (void) const

const Vector64GetMax (void) const

Vector64 GetMp (void) const

Vector64 min

Vector64 max

Bool used

## ◆ LMinMax() [1/2]

 LMinMax ( )

Default constructor.

## ◆ LMinMax() [2/2]

 LMinMax ( const Vector64 & v )
explicit

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

Parameters
 [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 Vector64 & v )

Initializes the minimum and maximum with vector v.

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

 void AddPoint ( const Vector64 & p )

Adds point p and recalculates the minimum and maximum.

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

 void AddPoints ( const Vector64 & a, const Vector64 & b )

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

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

## ◆ Set()

 void Set ( const Vector64 & a, const Vector64 & b )

Sets the minimum and maximum of the bounding box.

Parameters
 [in] a The minimum. [in] b The maximum.

## ◆ IsPopulated()

 Bool IsPopulated ( void ) const

Checks if any points were added.

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

## ◆ GetMin()

 const Vector64& GetMin ( void ) const

Gets the minimum of the bounding box.

Returns
The minimum position of the bounds.

## ◆ GetMax()

 const Vector64& GetMax ( void ) const

Gets the maximum of the bounding box.

Returns
The maximum position of the bounds.

## ◆ GetMp()

 Vector64 GetMp ( void ) const

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

Returns
The center of the bounds.

 Vector64 GetRad ( void ) const

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

Returns
The size of the bounds.

Gets both the center and size of the bounding box.

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

## ◆ min

 Vector64 min
private

## ◆ max

 Vector64 max
private

## ◆ used

 Bool used
private