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::Vector2f Class Referencefinal

The class Vector2f inherits from the templated class of Vector2, and the template parameters are specified. Each element in the Vector2f object will be a float. More...

#include <vector.h>

Inheritance diagram for cil::Vector2f:
cil::Vector2< float, Vector2f > cil::Vector< float, Vector2f > cil::Tuple< float > cil::Variant

Public Member Functions

 Vector2f ()
 Contructs a Vector2f object, all elements initialized to 0.
 
 Vector2f (float x, float y)
 Contructs a Vector2f object and sets the floats x and y to the elements.
 
 Vector2f (const Vector2f &other)
 Contructs a Vector2f object by copying the elements of another existing vector2f object.
 
 Vector2f (const Vector3f &other)
 Contructs a Vector2f object by copying the firt two elements of another existing vector3f object.
 
 Vector2f (const Vector4f &other)
 Contructs a Vector2f object by copying the firt two elements of another existing vector4f object.
 
- Public Member Functions inherited from cil::Vector2< float, Vector2f >
 Vector2 ()
 Contructs a Vector2 object with 2 elements, all initialized to 0.
 
void set (float x, float y)
 Sets the values of the two elements of current Vector2 object.
 
- Public Member Functions inherited from cil::Vector< float, Vector2f >
 Vector (int size)
 Constructs a Vector object with a specified number of elements.
 
const float & operator[] (int index) const
 Provides read-only access to the element at a specific index(position) within the Vector object.
 
float & operator[] (int index)
 Provides read-write access to the element at a specific index(position) within the Vector object.
 
const float & operator[] (char key) const
 Provides read-only access to a element within the Vector object using a character key.
 
float & 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< float, Vector2f > & operator-= (const Vector &other)
 Performs element-wise subtraction between the current Vector and another vector.
 
Vector< float, Vector2f > & operator*= (float factor)
 Performs scalar multiplication between the current Vector and a floating-point factor.
 
Vector< float, Vector2f > & operator/= (float factor)
 Performs scalar division between the current Vector and a floating-point factor.
 
Vector2f operator+ (const Vector2f &other) const
 Returns a Vector object that is formed by element-wise addition between the current Vector and another vector.
 
Vector2f operator- (const Vector2f &other) const
 Returns a Vector object that is formed by element-wise subtraction between the current Vector and another vector.
 
Vector2f operator- () const
 Returns a Vector object that is formed by changing the sign of each element of the current vector.
 
float operator* (const Vector2f &other) const
 Returns a Vector object that is formed by element-wise multiplication between the current Vector and another vector.
 
Vector2f operator* (float factor) const
 Returns a Vector object that is formed by multiplying each element of the current vector by the factor.
 
Vector2f operator/ (float factor) const
 Returns a Vector object that is formed by dividing each element of the current vector by the factor.
 
float 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< float >
 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.
 
float * data ()
 Gets the data array of the Tuple.
 
const float * 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 float *data)
 Sets the data array of the Variant.
 
Tuple< float > & 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< float >
float * 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

The class Vector2f inherits from the templated class of Vector2, and the template parameters are specified. Each element in the Vector2f object will be a float.

Constructor & Destructor Documentation

◆ Vector2f() [1/5]

cil::Vector2f::Vector2f ( )

Contructs a Vector2f object, all elements initialized to 0.

◆ Vector2f() [2/5]

cil::Vector2f::Vector2f ( float x,
float y )

Contructs a Vector2f object and sets the floats x and y to the elements.

◆ Vector2f() [3/5]

cil::Vector2f::Vector2f ( const Vector2f & other)

Contructs a Vector2f object by copying the elements of another existing vector2f object.

◆ Vector2f() [4/5]

cil::Vector2f::Vector2f ( const Vector3f & other)

Contructs a Vector2f object by copying the firt two elements of another existing vector3f object.

◆ Vector2f() [5/5]

cil::Vector2f::Vector2f ( const Vector4f & other)

Contructs a Vector2f object by copying the firt two elements of another existing vector4f object.