Cumulia Illustrator Rendering Engine v1.1.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
clipping.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 <cilcore.h>
21
22#include <vector>
23
24namespace cil
25{
27 {
28 public:
29 enum class Scope
30 {
31 Inner = 0,
32 Outer = 1,
33 };
34
35 protected:
37
38 std::shared_ptr<Culling> m_culling_front;
39 std::shared_ptr<Culling> m_culling_back;
40 std::shared_ptr<ColorMask> m_colorMask_back;
41 std::shared_ptr<Depth> m_depth_front;
42 std::shared_ptr<Depth> m_depth_back;
43 std::shared_ptr<Stencil> m_stencil_front;
44 std::shared_ptr<Stencil> m_stencil_back;
45 std::shared_ptr<PolygonOffset> m_polygonOffset_front;
46 std::shared_ptr<PolygonOffset> m_polygonOffset_back;
47 std::shared_ptr<VertexSource> m_vertex_front;
48 std::shared_ptr<FragmentSource> m_fragment_front;
49 std::shared_ptr<VertexSource> m_vertex_back;
50 std::shared_ptr<FragmentSource> m_fragment_back;
51 std::shared_ptr<Stencil> m_stencil_cap;
52 std::shared_ptr<Culling> m_culling_cap;
53 std::shared_ptr<Depth> m_depth_cap;
54 std::shared_ptr<VertexSource> m_vertex_cap;
55 std::shared_ptr<FragmentSource> m_fragment_cap;
56 std::shared_ptr<Geometry> m_geometry_cap;
57
58 virtual void addParameters(const std::shared_ptr<std::map<std::string, std::shared_ptr<Variant>>>& parameters);
59
60 public:
62
65
66 virtual std::shared_ptr<Node> getClippedNode(const std::shared_ptr<Node>& node);
67 virtual std::shared_ptr<Node> getCapNode(const std::shared_ptr<BoundingBox>& boundingBox);
68 };
69
70 class PlaneClipping : public Clipping
71 {
72 private:
73 std::shared_ptr<Plane> m_parameters_clipping;
74
75 protected:
76 virtual void addParameters(const std::shared_ptr<std::map<std::string, std::shared_ptr<Variant>>>& parameters);
77
78 public:
80
81 void set(float a, float b, float c, float d);
82 void set(const std::shared_ptr<Vector3f>& origin, const std::shared_ptr<Vector3f>& normal);
85 };
86
88 {
89 private:
90 std::shared_ptr<Plane> m_parameters_clipping1;
91 std::shared_ptr<Plane> m_parameters_clipping2;
92
93 protected:
94 virtual void addParameters(const std::shared_ptr<std::map<std::string, std::shared_ptr<Variant>>>& parameters);
95
96 public:
98
99 void setPlane1(float a, float b, float c, float d);
100 void setPlane1(const std::shared_ptr<Vector3f>& origin, const std::shared_ptr<Vector3f>& normal);
103
104 void setPlane2(float a, float b, float c, float d);
105 void setPlane2(const std::shared_ptr<Vector3f>& origin, const std::shared_ptr<Vector3f>& normal);
108
109 virtual std::shared_ptr<Node> getCapNode(const std::shared_ptr<BoundingBox>& boundingBox);
110 };
111
113 {
114 private:
115 std::shared_ptr<Vector4f> m_parameters_clipping;
116
117 protected:
118 virtual void addParameters(const std::shared_ptr<std::map<std::string, std::shared_ptr<Variant>>>& parameters);
119
120 public:
122
123 void set(float a, float b, float c, float d);
124 void set(const std::shared_ptr<Vector3f>& position, float radius);
126 float getRadius();
127 };
128
129 std::shared_ptr<PlaneClipping> _planeClipping();
130 std::shared_ptr<PlaneClipping> _planeClipping(float a, float b, float c, float d);
131 std::shared_ptr<PlaneClipping> _planeClipping(const std::shared_ptr<Vector3f>& origin, const std::shared_ptr<Vector3f>& normal);
132
133 std::shared_ptr<TwoPlaneClipping> _2planeClipping();
134 std::shared_ptr<TwoPlaneClipping> _2planeClipping(const std::shared_ptr<Vector3f>& origin1,
135 const std::shared_ptr<Vector3f>& normal1,
136 const std::shared_ptr<Vector3f>& origin2,
137 const std::shared_ptr<Vector3f>& normal2);
138
139 std::shared_ptr<SphereClipping> _sphereClipping();
140 std::shared_ptr<SphereClipping> _sphereClipping(float a, float b, float c, float d);
141 std::shared_ptr<SphereClipping> _sphereClipping(const std::shared_ptr<Vector3f>& position, float radius);
142}
Definition clipping.h:27
std::shared_ptr< Geometry > m_geometry_cap
Definition clipping.h:56
std::shared_ptr< FragmentSource > m_fragment_back
Definition clipping.h:50
virtual std::shared_ptr< Node > getClippedNode(const std::shared_ptr< Node > &node)
std::shared_ptr< VertexSource > m_vertex_cap
Definition clipping.h:54
std::shared_ptr< VertexSource > m_vertex_front
Definition clipping.h:47
std::shared_ptr< Culling > m_culling_cap
Definition clipping.h:52
Scope
Definition clipping.h:30
std::shared_ptr< PolygonOffset > m_polygonOffset_back
Definition clipping.h:46
std::shared_ptr< FragmentSource > m_fragment_front
Definition clipping.h:48
std::shared_ptr< FragmentSource > m_fragment_cap
Definition clipping.h:55
virtual void addParameters(const std::shared_ptr< std::map< std::string, std::shared_ptr< Variant > > > &parameters)
std::shared_ptr< Stencil > m_stencil_back
Definition clipping.h:44
std::shared_ptr< Culling > m_culling_back
Definition clipping.h:39
std::shared_ptr< VertexSource > m_vertex_back
Definition clipping.h:49
std::shared_ptr< Culling > m_culling_front
Definition clipping.h:38
std::shared_ptr< Depth > m_depth_cap
Definition clipping.h:53
virtual std::shared_ptr< Node > getCapNode(const std::shared_ptr< BoundingBox > &boundingBox)
Scope m_scope
Definition clipping.h:36
void setScope(Scope scope)
std::shared_ptr< Depth > m_depth_front
Definition clipping.h:41
std::shared_ptr< ColorMask > m_colorMask_back
Definition clipping.h:40
std::shared_ptr< Depth > m_depth_back
Definition clipping.h:42
std::shared_ptr< Stencil > m_stencil_cap
Definition clipping.h:51
std::shared_ptr< PolygonOffset > m_polygonOffset_front
Definition clipping.h:45
std::shared_ptr< Stencil > m_stencil_front
Definition clipping.h:43
Definition clipping.h:71
Vector3f getOrigin()
void set(const std::shared_ptr< Vector3f > &origin, const std::shared_ptr< Vector3f > &normal)
void set(float a, float b, float c, float d)
Vector3f getNormal()
virtual void addParameters(const std::shared_ptr< std::map< std::string, std::shared_ptr< Variant > > > &parameters)
Definition clipping.h:113
void set(float a, float b, float c, float d)
virtual void addParameters(const std::shared_ptr< std::map< std::string, std::shared_ptr< Variant > > > &parameters)
Vector3f getPosition()
void set(const std::shared_ptr< Vector3f > &position, float radius)
Definition clipping.h:88
Vector3f getPlane2Normal()
Vector3f getPlane2Origin()
void setPlane2(const std::shared_ptr< Vector3f > &origin, const std::shared_ptr< Vector3f > &normal)
virtual std::shared_ptr< Node > getCapNode(const std::shared_ptr< BoundingBox > &boundingBox)
Vector3f getPlane1Normal()
virtual void addParameters(const std::shared_ptr< std::map< std::string, std::shared_ptr< Variant > > > &parameters)
void setPlane1(float a, float b, float c, float d)
void setPlane2(float a, float b, float c, float d)
Vector3f getPlane1Origin()
void setPlane1(const std::shared_ptr< Vector3f > &origin, const std::shared_ptr< Vector3f > &normal)
The class Vector3f inherits from the templated class of Vector3, and the template parameters are spec...
Definition vector.h:322
Definition decal.h:23
std::shared_ptr< SphereClipping > _sphereClipping()
std::shared_ptr< PlaneClipping > _planeClipping()
std::shared_ptr< TwoPlaneClipping > _2planeClipping()