OpenVDB 11.0.0

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
Vec3< T > Class Template Reference

A simple vector class with three components, similar to openvdb::math::Vec3. More...

`#include <nanovdb/NanoVDB.h>`

## Public Types
using | ValueType = T

## Public Member Functions
| Vec3 ()=default
| Vec3 (T x)
| Vec3 (T x, T y, T z)
template<template< class > class Vec3T, class T2 >
| Vec3 (const Vec3T< T2 > &v)
template<typename T2 >
| Vec3 (const Vec3< T2 > &v)
| Vec3 (const Coord &ijk)
bool | operator== (const Vec3 &rhs) const
bool | operator!= (const Vec3 &rhs) const
template<template< class > class Vec3T, class T2 >
Vec3 & | operator= (const Vec3T< T2 > &rhs)
const T & | operator[] (int i) const
T & | operator[] (int i)
template<typename Vec3T >
T | dot (const Vec3T &v) const
template<typename Vec3T >
Vec3 | cross (const Vec3T &v) const
T | lengthSqr () const
T | length () const
Vec3 | operator- () const
Vec3 | operator* (const Vec3 &v) const
Vec3 | operator/ (const Vec3 &v) const
Vec3 | operator+ (const Vec3 &v) const
Vec3 | operator- (const Vec3 &v) const
Vec3 | operator+ (const Coord &ijk) const
Vec3 | operator- (const Coord &ijk) const
Vec3 | operator* (const T &s) const
Vec3 | operator/ (const T &s) const
Vec3 & | operator+= (const Vec3 &v)
Vec3 & | operator+= (const Coord &ijk)
Vec3 & | operator-= (const Vec3 &v)
Vec3 & | operator-= (const Coord &ijk)
Vec3 & | operator*= (const T &s)
Vec3 & | operator/= (const T &s)
Vec3 & | normalize ()
Vec3 & | minComponent (const Vec3 &other)
| Perform a component-wise minimum with the other Coord.
Vec3 & | maxComponent (const Vec3 &other)
| Perform a component-wise maximum with the other Coord.
ValueType | min () const
| Return the smallest vector component.
ValueType | max () const
| Return the largest vector component.
Coord | floor () const
| Round each component if this Vec<T> up to its integer value.
Coord | ceil () const
| Round each component if this Vec<T> down to its integer value.
Coord | round () const
| Round each component if this Vec<T> to its closest integer value.
T * | asPointer ()
| return a non-const raw constant pointer to array of three vector components
const T * | asPointer () const
| return a const raw constant pointer to array of three vector components

## Static Public Attributes
static const int | SIZE = 3
static const int | size = 3

## Detailed Description

template<typename T>
class nanovdb::Vec3< T >

A simple vector class with three components, similar to openvdb::math::Vec3.

## Member Typedef Documentation

## ◆ ValueType

template<typename T >

using ValueType = T

## Constructor & Destructor Documentation

## ◆ Vec3() [1/6]

template<typename T >

Vec3 | ( |  | ) |
| default

## ◆ Vec3() [2/6]

template<typename T >

Vec3 | ( | T | x | ) |
| inline explicit

## ◆ Vec3() [3/6]

template<typename T >

Vec3 | ( | T | x,
|  | T | y,
|  | T | z )
| inline

## ◆ Vec3() [4/6]

template<typename T >
template<template< class > class Vec3T, class T2 >

Vec3 | ( | const Vec3T< T2 > & | v | ) |
| inline

## ◆ Vec3() [5/6]

template<typename T >
template<typename T2 >

Vec3 | ( | const Vec3< T2 > & | v | ) |
| inline explicit

## ◆ Vec3() [6/6]

template<typename T >

Vec3 | ( | const Coord & | ijk | ) |
| inline explicit

## Member Function Documentation

## ◆ asPointer() [1/2]

template<typename T >

T * asPointer | ( |  | ) |
| inline

return a non-const raw constant pointer to array of three vector components

## ◆ asPointer() [2/2]

template<typename T >

const T * asPointer | ( |  | ) | const
| inline

return a const raw constant pointer to array of three vector components

## ◆ ceil()

template<typename T >

Coord ceil | ( |  | ) | const
| inline

Round each component if this Vec<T> down to its integer value.

Returns
  Return an integer Coord

## ◆ cross()

template<typename T >
template<typename Vec3T >

Vec3 cross | ( | const Vec3T & | v | ) | const
| inline

## ◆ dot()

template<typename T >
template<typename Vec3T >

T dot | ( | const Vec3T & | v | ) | const
| inline

## ◆ floor()

template<typename T >

Coord floor | ( |  | ) | const
| inline

Round each component if this Vec<T> up to its integer value.

Returns
  Return an integer Coord

## ◆ length()

template<typename T >

T length | ( |  | ) | const
| inline

## ◆ lengthSqr()

template<typename T >

T lengthSqr | ( |  | ) | const
| inline

## ◆ max()

template<typename T >

ValueType max | ( |  | ) | const
| inline

Return the largest vector component.

## ◆ maxComponent()

template<typename T >

Vec3 & maxComponent | ( | const Vec3< T > & | other | ) |
| inline

Perform a component-wise maximum with the other Coord.

## ◆ min()

template<typename T >

ValueType min | ( |  | ) | const
| inline

Return the smallest vector component.

## ◆ minComponent()

template<typename T >

Vec3 & minComponent | ( | const Vec3< T > & | other | ) |
| inline

Perform a component-wise minimum with the other Coord.

## ◆ normalize()

template<typename T >

Vec3 & normalize | ( |  | ) |
| inline

## ◆ operator!=()

template<typename T >

bool operator!= | ( | const Vec3< T > & | rhs | ) | const
| inline

## ◆ operator*() [1/2]

template<typename T >

Vec3 operator* | ( | const T & | s | ) | const
| inline

## ◆ operator*() [2/2]

template<typename T >

Vec3 operator* | ( | const Vec3< T > & | v | ) | const
| inline

## ◆ operator*=()

template<typename T >

Vec3 & operator*= | ( | const T & | s | ) |
| inline

## ◆ operator+() [1/2]

template<typename T >

Vec3 operator+ | ( | const Coord & | ijk | ) | const
| inline

## ◆ operator+() [2/2]

template<typename T >

Vec3 operator+ | ( | const Vec3< T > & | v | ) | const
| inline

## ◆ operator+=() [1/2]

template<typename T >

Vec3 & operator+= | ( | const Coord & | ijk | ) |
| inline

## ◆ operator+=() [2/2]

template<typename T >

Vec3 & operator+= | ( | const Vec3< T > & | v | ) |
| inline

## ◆ operator-() [1/3]

template<typename T >

Vec3 operator- | ( |  | ) | const
| inline

## ◆ operator-() [2/3]

template<typename T >

Vec3 operator- | ( | const Coord & | ijk | ) | const
| inline

## ◆ operator-() [3/3]

template<typename T >

Vec3 operator- | ( | const Vec3< T > & | v | ) | const
| inline

## ◆ operator-=() [1/2]

template<typename T >

Vec3 & operator-= | ( | const Coord & | ijk | ) |
| inline

## ◆ operator-=() [2/2]

template<typename T >

Vec3 & operator-= | ( | const Vec3< T > & | v | ) |
| inline

## ◆ operator/() [1/2]

template<typename T >

Vec3 operator/ | ( | const T & | s | ) | const
| inline

## ◆ operator/() [2/2]

template<typename T >

Vec3 operator/ | ( | const Vec3< T > & | v | ) | const
| inline

## ◆ operator/=()

template<typename T >

Vec3 & operator/= | ( | const T & | s | ) |
| inline

## ◆ operator=()

template<typename T >
template<template< class > class Vec3T, class T2 >

Vec3 & operator= | ( | const Vec3T< T2 > & | rhs | ) |
| inline

## ◆ operator==()

template<typename T >

bool operator== | ( | const Vec3< T > & | rhs | ) | const
| inline

## ◆ operator[]() [1/2]

template<typename T >

T & operator[] | ( | int | i | ) |
| inline

## ◆ operator[]() [2/2]

template<typename T >

const T & operator[] | ( | int | i | ) | const
| inline

## ◆ round()

template<typename T >

Coord round | ( |  | ) | const
| inline

Round each component if this Vec<T> to its closest integer value.

Returns
  Return an integer Coord

## Member Data Documentation

## ◆ SIZE

template<typename T >

const int SIZE = 3
| static

## ◆ size

template<typename T >

const int size = 3
| static