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::Plane Class Reference

The Plane class inherits from the Tuple class, specilizing the templated parameter to float for element type. More...

#include <plane.h>

Inheritance diagram for cil::Plane:
cil::Tuple< float > cil::Variant

Public Member Functions

 Plane ()
 Constructs a Plane object, all coefficients initialized to 0.
 
 Plane (const Plane &other)
 
 Plane (float a, float b, float c, float d)
 Constructs a Plane object and sets its coefficients with arguments (x, y, z, w).
 
 Plane (const Vector3f &origin, const Vector3f &normal)
 Constructs a Plane objet using the point-normal equation A(x-x0) + B(y-y0) +C(z-z0) = 0, so the a = A, b = B, c = C, d = - (Ax0 + By0 + Cz0).
 
const float & operator[] (int index) const
 Provides read-only access to the element at a specific index(position) within the Plane object.
 
float & operator[] (int index)
 Provides read-write access to the element at a specific index(position) within the Plane object.
 
const float & operator[] (char key) const
 Provides read-only access to a element within the Plane object using a character key.
 
float & operator[] (char key)
 Provides read-write access to a element within the Plane object using a character key.
 
void set (float a, float b, float c, float d)
 Sets the coefficients of the Plane.
 
void set (const Vector3f &origin, const Vector3f &normal)
 Sets the coefficients of the Plane using the point-normal equation A(x-x0) + B(y-y0) +C(z-z0) = 0 of the Plane object.
 
Vector3f getNormal ()
 Gets the normal of the Plane.
 
Vector3f getOrigin ()
 Gets the origin of the Plane.
 
void flip ()
 Flips the Plane normal direction by negating all coefficients.
 
Vector3f project (const Vector3f &point) const
 Calculates and returns the projected point of the argument point on the current Plane object.
 
void transform (const Matrix4f &other)
 Transform the current Plane object using the other transformation matrix.
 
- 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 Plane class inherits from the Tuple class, specilizing the templated parameter to float for element type.

The Plane object is represented in 3D space using the equation(ax + by + cz + d = 0), and stores the coefficients (a, b, c, d).

Constructor & Destructor Documentation

◆ Plane() [1/4]

cil::Plane::Plane ( )

Constructs a Plane object, all coefficients initialized to 0.

◆ Plane() [2/4]

cil::Plane::Plane ( const Plane & other)

◆ Plane() [3/4]

cil::Plane::Plane ( float a,
float b,
float c,
float d )

Constructs a Plane object and sets its coefficients with arguments (x, y, z, w).

◆ Plane() [4/4]

cil::Plane::Plane ( const Vector3f & origin,
const Vector3f & normal )

Constructs a Plane objet using the point-normal equation A(x-x0) + B(y-y0) +C(z-z0) = 0, so the a = A, b = B, c = C, d = - (Ax0 + By0 + Cz0).

Member Function Documentation

◆ flip()

void cil::Plane::flip ( )

Flips the Plane normal direction by negating all coefficients.

◆ getNormal()

Vector3f cil::Plane::getNormal ( )

Gets the normal of the Plane.

◆ getOrigin()

Vector3f cil::Plane::getOrigin ( )

Gets the origin of the Plane.

◆ operator[]() [1/4]

float & cil::Plane::operator[] ( char key)

Provides read-write access to a element within the Plane object using a character key.

It allows accessing elements of the Color using character keys 'a', 'b', 'c', 'd'. If the key-check fails, returns the first element.

◆ operator[]() [2/4]

const float & cil::Plane::operator[] ( char key) const

Provides read-only access to a element within the Plane object using a character key.

It allows accessing elements of the Color using character keys 'a', 'b', 'c', 'd'. If the key-check fails, returns the first element.

◆ operator[]() [3/4]

float & cil::Plane::operator[] ( int index)

Provides read-write access to the element at a specific index(position) within the Plane object.

◆ operator[]() [4/4]

const float & cil::Plane::operator[] ( int index) const

Provides read-only access to the element at a specific index(position) within the Plane object.

◆ project()

Vector3f cil::Plane::project ( const Vector3f & point) const

Calculates and returns the projected point of the argument point on the current Plane object.

◆ set() [1/2]

void cil::Plane::set ( const Vector3f & origin,
const Vector3f & normal )

Sets the coefficients of the Plane using the point-normal equation A(x-x0) + B(y-y0) +C(z-z0) = 0 of the Plane object.

◆ set() [2/2]

void cil::Plane::set ( float a,
float b,
float c,
float d )

Sets the coefficients of the Plane.

◆ transform()

void cil::Plane::transform ( const Matrix4f & other)

Transform the current Plane object using the other transformation matrix.