Cumulia Illustrator Rendering Engine v1.0.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
cil::Vector3< T, S > Class Template Reference

The class Vector3 is a templated class inheriting from the Vector class. A vector3 object holds 3 elements. More...

#include <vector.h>

Inheritance diagram for cil::Vector3< T, S >:
cil::Vector< T, S > cil::Tuple< T > cil::Variant

Public Member Functions

 Vector3 ()
 Contructs a Vector3 object with 3 elements, all initialized to 0.
 
void set (T x, T y, T z)
 Sets the values of the three elements of current Vector3 object.
 
operator^ (const S &other) const
 Calculates the cross product of this vector3 and another vector3, returning a new Vector3.
 
- Public Member Functions inherited from cil::Vector< T, S >
 Vector (int size)
 Constructs a Vector object with a specified number of elements.
 
const T & operator[] (int index) const
 Provides read-only access to the element at a specific index(position) within the Vector object.
 
T & operator[] (int index)
 Provides read-write access to the element at a specific index(position) within the Vector object.
 
const T & operator[] (char key) const
 Provides read-only access to a element within the Vector object using a character key.
 
T & operator[] (char key)
 Provides read-write access to a element within the Vector object using a character key.
 
Vectoroperator+= (const Vector &other)
 Performs element-wise addition between the current Vector and another vector.
 
Vector< T, S > & operator-= (const Vector &other)
 Performs element-wise subtraction between the current Vector and another vector.
 
Vector< T, S > & operator*= (float factor)
 Performs scalar multiplication between the current Vector and a floating-point factor.
 
Vector< T, S > & operator/= (float factor)
 Performs scalar division between the current Vector and a floating-point factor.
 
operator+ (const S &other) const
 Returns a Vector object that is formed by element-wise addition between the current Vector and another vector.
 
operator- (const S &other) const
 Returns a Vector object that is formed by element-wise subtraction between the current Vector and another vector.
 
operator- () const
 Returns a Vector object that is formed by changing the sign of each element of the current vector.
 
operator* (const S &other) const
 Returns a Vector object that is formed by element-wise multiplication between the current Vector and another vector.
 
operator* (float factor) const
 Returns a Vector object that is formed by multiplying each element of the current vector by the factor.
 
operator/ (float factor) const
 Returns a Vector object that is formed by dividing each element of the current vector by the factor.
 
squaredLength () const
 Returns the squared length of the current Vector.
 
float length () const
 Returns the length of the current Vector.
 
bool setLength (float len)
 Changes the length of the current Vector and returns a boolean value indicating success.
 
bool normalize ()
 Normalize the current Vector and returns a boolean value indicating success.
 
- Public Member Functions inherited from cil::Tuple< T >
 Tuple (int size)
 Constructs a Tuple object with a specified number of elements, and initialize all elements to 0.
 
virtual ~Tuple ()
 
int size () const
 Gets the number of elements of the Tuple.
 
T * data ()
 Gets the data array of the Tuple.
 
const T * data () const
 Gets the data array of the Tuple, and the data could not be modified upon which this function is called.
 
void setData (const T *data)
 Sets the data array of the Variant.
 
Tuple< T > & operator= (const Tuple &other)
 Copys the data of another Tuple to the one on which the operator is invoked.
 
bool operator== (const Tuple &other) const
 Compares the Tuple with another one, and returns true if they are equal, otherwise returns false.
 
bool operator!= (const Tuple &other) const
 Compares the Tuple with another one, and returns false if they are equal, otherwise returns true.
 
- Public Member Functions inherited from cil::Variant
 Variant ()
 
virtual ~Variant ()
 
const std::string & type () const
 

Additional Inherited Members

- Protected Attributes inherited from cil::Tuple< T >
T * m_data
 The data array of the Tuple.
 
int m_size
 The number of elements that the data array of the Tuple holds.
 
- Protected Attributes inherited from cil::Variant
std::string m_type
 

Detailed Description

template<typename T, typename S>
class cil::Vector3< T, S >

The class Vector3 is a templated class inheriting from the Vector class. A vector3 object holds 3 elements.

Constructor & Destructor Documentation

◆ Vector3()

template<typename T , typename S >
cil::Vector3< T, S >::Vector3 ( )
inline

Contructs a Vector3 object with 3 elements, all initialized to 0.

Member Function Documentation

◆ operator^()

template<typename T , typename S >
S cil::Vector3< T, S >::operator^ ( const S & other) const
inline

Calculates the cross product of this vector3 and another vector3, returning a new Vector3.

◆ set()

template<typename T , typename S >
void cil::Vector3< T, S >::set ( T x,
T y,
T z )
inline

Sets the values of the three elements of current Vector3 object.