![]() |
ICF 3.1.1.10
Technical documentation of ICF Libraries
|
Simple implementation of fixed-size vector. More...
#include <TFastVector.h>
Public Types | |
| enum | { MAX_ELEMENTS_COUNT = MaxSize } |
| typedef Element | ElementType |
Public Member Functions | |
| TFastVector () | |
| Create an uninitialized point. | |
| TFastVector (int componentsCount, const Element &value=Element()) | |
| Create vector and initialize number of components. | |
| TFastVector (const TFastVector< MaxSize, Element > &vector) | |
| Copy constructor. | |
| template<int Size> | |
| TFastVector (const imath::TVector< Size, Element > &vector) | |
| int | GetElementsCount () const |
| Get number of elements. | |
| bool | SetElementsCount (int count, const Element &value=Element()) |
| Set number of elements. | |
| bool | EnsureElementsCount (int count, const Element &value=Element()) |
| Ensure, that number of elements vector cannot be smaller that some value. | |
| const Element & | GetElement (int i) const |
| Get element at specified i. | |
| Element & | GetElementRef (int i) |
| Get reference to element at specified i. | |
| void | SetElement (int i, const Element &value) |
| Set element at specified i. | |
| void | Clear () |
| Set all coordinates to zero. | |
| void | SetElementsFrom (const TFastVector &vector, const Element &expansionValue=Element()) |
| Set elemenents from other vector without resizing. | |
| void | Translate (const TFastVector< MaxSize, Element > &vector) |
| Translate the point. | |
| TFastVector< MaxSize, Element > | GetTranslated (const TFastVector< MaxSize, Element > &vector) |
| Get translated point. | |
| void | GetTranslated (const TFastVector< MaxSize, Element > &vector, TFastVector< MaxSize, Element > &result) |
| /overloaded | |
| void | ScaledCumulate (const TFastVector< MaxSize, Element > &vector, Element scale) |
| Add second vector scaled by specified factor. | |
| bool | IsNull (Element tolerance=I_BIG_EPSILON) const |
| Check if this vector is null. | |
| Element | GetDotProduct (const TFastVector< MaxSize, Element > &vector) const |
| Return dot product of two vectors. | |
| Element | GetLength2 () const |
| Return euclidian length square. | |
| Element | GetLength () const |
| Return euclidian length. | |
| Element | GetDistance2 (const TFastVector< MaxSize, Element > &vector) const |
| Return distance square between two vectors. | |
| Element | GetDistance (const TFastVector< MaxSize, Element > &vector) const |
| Return distance between two vectors. | |
| Element | GetElementsSum () const |
| Get simple sum of all elements. | |
| bool | Normalize (Element length=1.0) |
| Normalize vector to specified length. | |
| bool | GetNormalized (TFastVector< MaxSize, Element > &result, Element length=1.0) const |
| Return normalized vector with the same direction and specified length. | |
| void | GetMinimal (const TFastVector< MaxSize, Element > &vector, TFastVector< MaxSize, Element > &result) const |
| Get vector with minimal elements values. | |
| void | GetMaximal (const TFastVector< MaxSize, Element > &vector, TFastVector< MaxSize, Element > &result) const |
| Get vector with maximal elements values. | |
| bool | Serialize (iser::IArchive &archive) |
| Serialize this vector to specified archive. | |
| bool | operator== (const TFastVector< MaxSize, Element > &vector) const |
| bool | operator!= (const TFastVector< MaxSize, Element > &vector) const |
| bool | operator< (const TFastVector< MaxSize, Element > &vector) const |
| bool | operator> (const TFastVector< MaxSize, Element > &vector) const |
| bool | operator<= (const TFastVector< MaxSize, Element > &vector) const |
| bool | operator>= (const TFastVector< MaxSize, Element > &vector) const |
| TFastVector< MaxSize, Element > | operator- () const |
| TFastVector< MaxSize, Element > | operator+ (const TFastVector< MaxSize, Element > &vector) const |
| TFastVector< MaxSize, Element > | operator- (const TFastVector< MaxSize, Element > &vector) const |
| TFastVector< MaxSize, Element > | operator* (Element scalar) const |
| TFastVector< MaxSize, Element > | operator/ (Element scalar) const |
| TFastVector< MaxSize, Element > & | operator= (const TFastVector< MaxSize, Element > &vector) |
| TFastVector< MaxSize, Element > & | operator+= (const TFastVector< MaxSize, Element > &vector) |
| TFastVector< MaxSize, Element > & | operator-= (const TFastVector< MaxSize, Element > &vector) |
| TFastVector< MaxSize, Element > & | operator*= (Element scalar) |
| TFastVector< MaxSize, Element > & | operator/= (Element scalar) |
| const Element & | operator[] (int i) const |
| Element & | operator[] (int i) |
Protected Attributes | |
| Element | m_elements [MaxSize] |
| int | m_elementsCount |
Simple implementation of fixed-size vector.
Definition at line 28 of file TFastVector.h.
| Element imath::TFastVector< MaxSize, Element >::ElementType |
Definition at line 31 of file TFastVector.h.
| anonymous enum |
| Enumerator | |
|---|---|
| MAX_ELEMENTS_COUNT | |
Definition at line 33 of file TFastVector.h.
|
inline |
Create an uninitialized point.
Definition at line 226 of file TFastVector.h.
|
inlineexplicit |
Create vector and initialize number of components.
Definition at line 233 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
|
inline |
Copy constructor.
Definition at line 243 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
|
inline |
Definition at line 53 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements.
|
inline |
Set all coordinates to zero.
Definition at line 328 of file TFastVector.h.
|
inline |
Ensure, that number of elements vector cannot be smaller that some value.
If number of elements was bigger or equal to specified value, it does nothing. In other case, number of elements will be set.
| count | number of elements. |
Definition at line 278 of file TFastVector.h.
|
inline |
Return distance between two vectors.
Definition at line 443 of file TFastVector.h.
|
inline |
Return distance square between two vectors.
Definition at line 436 of file TFastVector.h.
|
inline |
Return dot product of two vectors.
Definition at line 408 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
|
inline |
Get element at specified i.
Definition at line 298 of file TFastVector.h.
Referenced by imath::TFastVector< MaxSize, Element >::GetMaximal(), and imath::TFastVector< MaxSize, Element >::GetMinimal().
|
inline |
Get reference to element at specified i.
Definition at line 308 of file TFastVector.h.
|
inline |
Get number of elements.
Definition at line 253 of file TFastVector.h.
Referenced by imath::TFastVector< MaxSize, Element >::GetMaximal(), imath::TFastVector< MaxSize, Element >::GetMinimal(), icmm::CFastColor::operator*=(), icmm::CFastColor::operator/=(), icmm::CFastColor::operator<(), icmm::CFastColor::operator<=(), icmm::CFastColor::operator==(), icmm::CFastColor::operator>(), icmm::CFastColor::operator>=(), and imath::qHash().
| Element imath::TFastVector< MaxSize, Element >::GetElementsSum | ( | ) | const |
Get simple sum of all elements.
Definition at line 709 of file TFastVector.h.
|
inline |
Return euclidian length.
Definition at line 429 of file TFastVector.h.
|
inline |
Return euclidian length square.
Definition at line 422 of file TFastVector.h.
| void imath::TFastVector< MaxSize, Element >::GetMaximal | ( | const TFastVector< MaxSize, Element > & | vector, |
| TFastVector< MaxSize, Element > & | result ) const |
Get vector with maximal elements values.
Definition at line 764 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::GetElement(), imath::TFastVector< MaxSize, Element >::GetElementsCount(), imath::TFastVector< MaxSize, Element >::SetElement(), and imath::TFastVector< MaxSize, Element >::SetElementsCount().
| void imath::TFastVector< MaxSize, Element >::GetMinimal | ( | const TFastVector< MaxSize, Element > & | vector, |
| TFastVector< MaxSize, Element > & | result ) const |
Get vector with minimal elements values.
Definition at line 751 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::GetElement(), imath::TFastVector< MaxSize, Element >::GetElementsCount(), imath::TFastVector< MaxSize, Element >::SetElement(), and imath::TFastVector< MaxSize, Element >::SetElementsCount().
| bool imath::TFastVector< MaxSize, Element >::GetNormalized | ( | TFastVector< MaxSize, Element > & | result, |
| Element | length = 1.0 ) const |
Return normalized vector with the same direction and specified length.
| length | new vector length. |
Definition at line 742 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::Normalize().
|
inline |
Get translated point.
Definition at line 385 of file TFastVector.h.
| void imath::TFastVector< MaxSize, Element >::GetTranslated | ( | const TFastVector< MaxSize, Element > & | vector, |
| TFastVector< MaxSize, Element > & | result ) |
/overloaded
Definition at line 392 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::Translate().
|
inline |
Check if this vector is null.
Definition at line 401 of file TFastVector.h.
| bool imath::TFastVector< MaxSize, Element >::Normalize | ( | Element | length = 1.0 | ) |
Normalize vector to specified length.
| length | new vector length. |
Definition at line 722 of file TFastVector.h.
Referenced by imath::TFastVector< MaxSize, Element >::GetNormalized().
|
inline |
Definition at line 469 of file TFastVector.h.
|
inline |
Definition at line 665 of file TFastVector.h.
|
inline |
Definition at line 608 of file TFastVector.h.
|
inline |
Definition at line 643 of file TFastVector.h.
|
inline |
Definition at line 558 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
|
inline |
Definition at line 630 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements.
|
inline |
Definition at line 654 of file TFastVector.h.
|
inline |
Definition at line 583 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
|
inline |
Definition at line 676 of file TFastVector.h.
|
inline |
Definition at line 619 of file TFastVector.h.
| bool imath::TFastVector< MaxSize, Element >::operator< | ( | const TFastVector< MaxSize, Element > & | vector | ) | const |
Definition at line 476 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
| bool imath::TFastVector< MaxSize, Element >::operator<= | ( | const TFastVector< MaxSize, Element > & | vector | ) | const |
Definition at line 510 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
|
inline |
Definition at line 544 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
|
inline |
Definition at line 452 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
| bool imath::TFastVector< MaxSize, Element >::operator> | ( | const TFastVector< MaxSize, Element > & | vector | ) | const |
Definition at line 493 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
| bool imath::TFastVector< MaxSize, Element >::operator>= | ( | const TFastVector< MaxSize, Element > & | vector | ) | const |
Definition at line 527 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
| Element & imath::TFastVector< MaxSize, Element >::operator[] | ( | int | i | ) |
Definition at line 697 of file TFastVector.h.
| const Element & imath::TFastVector< MaxSize, Element >::operator[] | ( | int | i | ) | const |
Definition at line 687 of file TFastVector.h.
|
inline |
Add second vector scaled by specified factor.
It is equal of Translate(vector * scale) but can be faster implemented.
Definition at line 347 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
| bool imath::TFastVector< MaxSize, Element >::Serialize | ( | iser::IArchive & | archive | ) |
Serialize this vector to specified archive.
Definition at line 777 of file TFastVector.h.
References iser::CArchiveTag::Leaf, iser::CArchiveTag::Multiple, iser::IArchive::ProcessAnyList(), and iser::IArchive::ProcessLeaf().
|
inline |
Set element at specified i.
Definition at line 318 of file TFastVector.h.
Referenced by imath::TFastVector< MaxSize, Element >::GetMaximal(), and imath::TFastVector< MaxSize, Element >::GetMinimal().
|
inline |
Set number of elements.
| count | number of elements. |
Definition at line 260 of file TFastVector.h.
Referenced by imath::TFastVector< MaxSize, Element >::GetMaximal(), and imath::TFastVector< MaxSize, Element >::GetMinimal().
| void imath::TFastVector< MaxSize, Element >::SetElementsFrom | ( | const TFastVector< MaxSize, Element > & | vector, |
| const Element & | expansionValue = Element() ) |
Set elemenents from other vector without resizing.
| vector | source of element values will be copied. |
| expansionValue | if actual vector has more elements than vector, rest will be replaced with this value. |
Definition at line 370 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elementsCount.
|
inline |
Translate the point.
Definition at line 337 of file TFastVector.h.
References imath::TFastVector< MaxSize, Element >::m_elements, and imath::TFastVector< MaxSize, Element >::m_elementsCount.
Referenced by imath::TFastVector< MaxSize, Element >::GetTranslated().
|
protected |
Definition at line 218 of file TFastVector.h.
Referenced by icmm::CFastColor::CFastColor(), imath::TFastVector< MaxSize, Element >::GetDotProduct(), icmm::CFastColor::operator*(), icmm::CFastColor::operator*=(), icmm::CFastColor::operator+=(), imath::TFastVector< MaxSize, Element >::operator+=(), imath::TFastVector< MaxSize, Element >::operator-(), icmm::CFastColor::operator-=(), imath::TFastVector< MaxSize, Element >::operator-=(), icmm::CFastColor::operator/(), icmm::CFastColor::operator/=(), imath::TFastVector< MaxSize, Element >::operator<(), imath::TFastVector< MaxSize, Element >::operator<=(), icmm::CFastColor::operator=(), imath::TFastVector< MaxSize, Element >::operator=(), imath::TFastVector< MaxSize, Element >::operator==(), imath::TFastVector< MaxSize, Element >::operator>(), imath::TFastVector< MaxSize, Element >::operator>=(), imath::TFastVector< MaxSize, Element >::ScaledCumulate(), imath::TFastVector< MaxSize, Element >::TFastVector(), imath::TFastVector< MaxSize, Element >::TFastVector(), imath::TFastVector< MaxSize, Element >::TFastVector(), and imath::TFastVector< MaxSize, Element >::Translate().
|
protected |
Definition at line 219 of file TFastVector.h.
Referenced by icmm::CFastColor::CFastColor(), imath::TFastVector< MaxSize, Element >::GetDotProduct(), icmm::CFastColor::operator+=(), imath::TFastVector< MaxSize, Element >::operator+=(), icmm::CFastColor::operator-=(), imath::TFastVector< MaxSize, Element >::operator-=(), imath::TFastVector< MaxSize, Element >::operator<(), imath::TFastVector< MaxSize, Element >::operator<=(), icmm::CFastColor::operator=(), imath::TFastVector< MaxSize, Element >::operator=(), imath::TFastVector< MaxSize, Element >::operator==(), imath::TFastVector< MaxSize, Element >::operator>(), imath::TFastVector< MaxSize, Element >::operator>=(), imath::TFastVector< MaxSize, Element >::ScaledCumulate(), imath::TFastVector< MaxSize, Element >::SetElementsFrom(), imath::TFastVector< MaxSize, Element >::TFastVector(), imath::TFastVector< MaxSize, Element >::TFastVector(), and imath::TFastVector< MaxSize, Element >::Translate().
© Witold Gantzke and Kirill Lepskiy