Cumulia Illustrator Rendering Engine v1.1.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
plane.h
1//##################################################################################################
2//
3// Copyright (c) 2024 Beijing Qiongqi Tech Co.,Ltd. All rights reserved.
4
5// This source code is confidential and proprietary to Beijing Qiongqi Tech Co.,Ltd(The Holder).
6// Any unauthorized use, copying, modification, or distribution of the code is strictly prohibited.
7// Any user shall obtain authorizaition from the Holder before modifying the source code. And the user shall not
8// sublicense, sell, distribute, or transfer the source code, whether in original or modified form, to any third party
9// without the prior written consent of the Holder.
10
11// This copyright notice and permission grant shall be included in all copies or substantial portions of the source code.
12
13// Author Cumulia Illustrator
14// Date 2024-10-31
15// Version V1.1.0
16//##################################################################################################
17
18#pragma once
19
20#include "tuple.h"
21
22namespace cil
23{
24 class Vector3f;
25 class Matrix4f;
26
29 class Plane : public Tuple<float>
30 {
31 public:
33 Plane(const Plane& other);
34 Plane(float a, float b, float c, float d);
38 const float& operator[](int index) const;
40 float& operator[](int index);
44 const float& operator[](char key) const;
48 float& operator[](char key);
50 void set(float a, float b, float c, float d);
52 void set(const Vector3f& origin, const Vector3f& normal);
58 void flip();
60 Vector3f project(const Vector3f& point) const;
62 void transform(const Matrix4f& other);
63 };
64
65 using plane = Plane;
66}
The Matrix4f class is 4 X 4 matrix.
Definition matrix.h:226
The Plane class inherits from the Tuple class, specilizing the templated parameter to float for eleme...
Definition plane.h:30
const float & operator[](int index) const
Provides read-only access to the element at a specific index(position) within the Plane object.
void flip()
Flips the Plane normal direction by negating all coefficients.
Vector3f normal() const
Gets the normal of the Plane.
float & operator[](char key)
Provides read-write access to a element within the Plane object using a character key.
Plane()
Constructs a Plane object, all coefficients initialized to 0.
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,...
Vector3f project(const Vector3f &point) const
Calculates and returns the projected point of the argument point on the current Plane object.
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 ...
Plane(float a, float b, float c, float d)
Constructs a Plane object and sets its coefficients with arguments (x, y, z, w).
float & operator[](int index)
Provides read-write access to the element at a specific index(position) within the Plane object.
void transform(const Matrix4f &other)
Transform the current Plane object using the other transformation matrix.
Vector3f origin() const
Gets the origin of the Plane.
Plane(const Plane &other)
const float & operator[](char key) const
Provides read-only 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.
The Tuple is a templated class inheriting from the most basic class Variant.
Definition tuple.h:27
The class Vector3f inherits from the templated class of Vector3, and the template parameters are spec...
Definition vector.h:322
Definition decal.h:23