Cumulia Illustrator Rendering Engine v1.1.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
variantmaker.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 "../variant/variant.h"
21#include "../variant/box.h"
22#include "../variant/color.h"
23#include "../variant/image.h"
24#include "../variant/integer.h"
25#include "../variant/matrix.h"
26#include "../variant/minmax.h"
27#include "../variant/plane.h"
28#include "../variant/quaternion.h"
29#include "../variant/ray.h"
30#include "../variant/real.h"
31#include "../variant/source.h"
32#include "../variant/tuple.h"
33#include "../variant/typedarray.h"
34#include "../variant/vector.h"
35
36#include <memory>
37
38namespace cil
39{
40 // box2i
41 std::shared_ptr<Box2i> _box2i();
42 std::shared_ptr<Box2i> _box2i(int xmin, int xmax, int ymin, int ymax);
43 std::shared_ptr<Box2i> _box2i(const Vector2i& min, const Vector2i& max);
44 std::shared_ptr<Box2i> _box2i(const Box2i& other);
45
46 // box2f
47 std::shared_ptr<Box2f> _box2f();
48 std::shared_ptr<Box2f> _box2f(float xmin, float xmax, float ymin, float ymax);
49 std::shared_ptr<Box2f> _box2f(const Vector2f& min, const Vector2f& max);
50 std::shared_ptr<Box2f> _box2f(const Box2f& other);
51
52 // box3i
53 std::shared_ptr<Box3i> _box3i();
54 std::shared_ptr<Box3i> _box3i(int xmin, int xmax, int ymin, int ymax, int zmin, int zmax);
55 std::shared_ptr<Box3i> _box3i(const Vector3i& min, const Vector3i& max);
56 std::shared_ptr<Box3i> _box3i(const Box3i& other);
57
58 // box3f
59 std::shared_ptr<Box3f> _box3f();
60 std::shared_ptr<Box3f> _box3f(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax);
61 std::shared_ptr<Box3f> _box3f(const Vector3f& min, const Vector3f& max);
62 std::shared_ptr<Box3f> _box3f(const Box3f& other);
63
64 // boundingbox
65 std::shared_ptr<BoundingBox> _bbox();
66 std::shared_ptr<BoundingBox> _bbox(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax);
67 std::shared_ptr<BoundingBox> _bbox(const Vector3f& min, const Vector3f& max);
68 std::shared_ptr<BoundingBox> _bbox(const BoundingBox& other);
69
70 // clr3
71 std::shared_ptr<Color3f> _clr3();
72 std::shared_ptr<Color3f> _clr3(float r, float g, float b);
73 std::shared_ptr<Color3f> _clr3(const Color3f& other);
74 std::shared_ptr<Color3f> _clr3(const Color3ub& other);
75 std::shared_ptr<Color3f> _clr3(const Color4f& other);
76 std::shared_ptr<Color3f> _clr3(const Color4ub& other);
77
78 // clr3ub
79 std::shared_ptr<Color3ub> _clr3ub();
80 std::shared_ptr<Color3ub> _clr3ub(unsigned char r, unsigned char g, unsigned char b);
81 std::shared_ptr<Color3ub> _clr3ub(const Color3f& other);
82 std::shared_ptr<Color3ub> _clr3ub(const Color3ub& other);
83 std::shared_ptr<Color3ub> _clr3ub(const Color4f& other);
84 std::shared_ptr<Color3ub> _clr3ub(const Color4ub& other);
85
86 // clr4
87 std::shared_ptr<Color4f> _clr4();
88 std::shared_ptr<Color4f> _clr4(float r, float g, float b, float a);
89 std::shared_ptr<Color4f> _clr4(const Color3f& other);
90 std::shared_ptr<Color4f> _clr4(const Color3ub& other);
91 std::shared_ptr<Color4f> _clr4(const Color4f& other);
92 std::shared_ptr<Color4f> _clr4(const Color4ub& other);
93
94 // clr4ub
95 std::shared_ptr<Color4ub> _clr4ub();
96 std::shared_ptr<Color4ub> _clr4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
97 std::shared_ptr<Color4ub> _clr4ub(const Color3f& other);
98 std::shared_ptr<Color4ub> _clr4ub(const Color3ub& other);
99 std::shared_ptr<Color4ub> _clr4ub(const Color4f& other);
100 std::shared_ptr<Color4ub> _clr4ub(const Color4ub& other);
101
102 // image2d
103 std::shared_ptr<Image2D> _image2d(int width, int height, unsigned char* data = nullptr);
104
105 // imageCube
106 std::shared_ptr<ImageCube> _imageCube(const std::vector<Image2D>& images);
107
108 // integer
109 std::shared_ptr<Integer> _integer();
110 std::shared_ptr<Integer> _integer(int v);
111 std::shared_ptr<Integer> _integer(const Integer& other);
112
113 // mat2
114 std::shared_ptr<Matrix2f> _mat2();
115 std::shared_ptr<Matrix2f> _mat2(float e00, float e01,
116 float e10, float e11);
117 std::shared_ptr<Matrix2f> _mat2(const Vector2f& c0,
118 const Vector2f& c1);
119 std::shared_ptr<Matrix2f> _mat2(const Matrix2f& other);
120 std::shared_ptr<Matrix2f> _mat2(const Matrix3f& other);
121 std::shared_ptr<Matrix2f> _mat2(const Matrix4f& other);
122
123 // mat3
124 std::shared_ptr<Matrix3f> _mat3();
125 std::shared_ptr<Matrix3f> _mat3(float e00, float e01, float e02,
126 float e10, float e11, float e12,
127 float e20, float e21, float e22);
128 std::shared_ptr<Matrix3f> _mat3(const Vector3f& c0,
129 const Vector3f& c1,
130 const Vector3f& c2);
131 std::shared_ptr<Matrix3f> _mat3(const Matrix2f& other);
132 std::shared_ptr<Matrix3f> _mat3(const Matrix3f& other);
133 std::shared_ptr<Matrix3f> _mat3(const Matrix4f& other);
134
135 // mat4
136 std::shared_ptr<Matrix4f> _mat4();
137 std::shared_ptr<Matrix4f> _mat4(float e00, float e01, float e02, float e03,
138 float e10, float e11, float e12, float e13,
139 float e20, float e21, float e22, float e23,
140 float e30, float e31, float e32, float e33);
141 std::shared_ptr<Matrix4f> _mat4(const Vector4f& c0,
142 const Vector4f& c1,
143 const Vector4f& c2,
144 const Vector4f& c3);
145 std::shared_ptr<Matrix4f> _mat4(const Matrix2f& other);
146 std::shared_ptr<Matrix4f> _mat4(const Matrix3f& other);
147 std::shared_ptr<Matrix4f> _mat4(const Matrix4f& other);
148
149 // minmax
150 std::shared_ptr<MinMax> _minmax();
151 std::shared_ptr<MinMax> _minmax(float min, float max);
152 std::shared_ptr<MinMax> _minmax(const MinMax& other);
153
154 // plane
155 std::shared_ptr<Plane> _plane();
156 std::shared_ptr<Plane> _plane(float x, float y, float z, float w);
157 std::shared_ptr<Plane> _plane(const Vector3f& origin, const Vector3f& normal);
158 std::shared_ptr<Plane> _plane(const Plane& other);
159
160 // quat
161 std::shared_ptr<Quaternion> _quat();
162 std::shared_ptr<Quaternion> _quat(float x, float y, float z, float w);
163 std::shared_ptr<Quaternion> _quat(const Vector3f& axis, float angle);
164 std::shared_ptr<Quaternion> _quat(const Quaternion& other);
165
166 // ray
167 std::shared_ptr<Ray> _ray();
168 std::shared_ptr<Ray> _ray(const Vector3f& origin, const Vector3f& normal);
169 std::shared_ptr<Ray> _ray(const Ray& other);
170
171 // real
172 std::shared_ptr<Real> _real();
173 std::shared_ptr<Real> _real(float v);
174 std::shared_ptr<Real> _real(const Real& other);
175
176 // source
177 std::shared_ptr<VertexSource> _vert(const std::string& text);
178 std::shared_ptr<FragmentSource> _frag(const std::string& text);
179 std::shared_ptr<GeometrySource> _geom(const std::string& text);
180
181 // i8array
182 std::shared_ptr<Int8Array> _i8array(int size = 0, char* data = nullptr, bool copy = true);
183 std::shared_ptr<Int8Array> _i8array(const std::initializer_list<char>& array);
184
185 // u8array
186 std::shared_ptr<Uint8Array> _u8array(int size = 0, unsigned char* data = nullptr, bool copy = true);
187 std::shared_ptr<Uint8Array> _u8array(const std::initializer_list<unsigned char>& array);
188
189 // i16array
190 std::shared_ptr<Int16Array> _i16array(int size = 0, short* data = nullptr, bool copy = true);
191 std::shared_ptr<Int16Array> _i16array(const std::initializer_list<short>& array);
192
193 // u16array
194 std::shared_ptr<Uint16Array> _u16array(int size = 0, unsigned short* data = nullptr, bool copy = true);
195 std::shared_ptr<Uint16Array> _u16array(const std::initializer_list<unsigned short>& array);
196
197 // i32array
198 std::shared_ptr<Int32Array> _i32array(int size = 0, int* data = nullptr, bool copy = true);
199 std::shared_ptr<Int32Array> _i32array(const std::initializer_list<int>& array);
200
201 // u32array
202 std::shared_ptr<Uint32Array> _u32array(int size = 0, unsigned int* data = nullptr, bool copy = true);
203 std::shared_ptr<Uint32Array> _u32array(const std::initializer_list<unsigned int>& array);
204
205 // f32array
206 std::shared_ptr<Float32Array> _f32array(int size = 0, float* data = nullptr, bool copy = true);
207 std::shared_ptr<Float32Array> _f32array(const std::initializer_list<float>& array);
208
209 // f64array
210 std::shared_ptr<Float64Array> _f64array(int size = 0, double* data = nullptr, bool copy = true);
211 std::shared_ptr<Float64Array> _f64array(const std::initializer_list<double>& array);
212
213 // ivec2
214 std::shared_ptr<Vector2i> _ivec2();
215 std::shared_ptr<Vector2i> _ivec2(int x, int y);
216 std::shared_ptr<Vector2i> _ivec2(const Vector2i& other);
217 std::shared_ptr<Vector2i> _ivec2(const Vector3i& other);
218 std::shared_ptr<Vector2i> _ivec2(const Vector4i& other);
219
220 // vec2
221 std::shared_ptr<Vector2f> _vec2();
222 std::shared_ptr<Vector2f> _vec2(float x, float y);
223 std::shared_ptr<Vector2f> _vec2(const Vector2f& other);
224 std::shared_ptr<Vector2f> _vec2(const Vector3f& other);
225 std::shared_ptr<Vector2f> _vec2(const Vector4f& other);
226
227 // ivec3
228 std::shared_ptr<Vector3i> _ivec3();
229 std::shared_ptr<Vector3i> _ivec3(int x, int y, int z);
230 std::shared_ptr<Vector3i> _ivec3(const Vector2i& other, int z = 0);
231 std::shared_ptr<Vector3i> _ivec3(const Vector3i& other);
232 std::shared_ptr<Vector3i> _ivec3(const Vector4i& other);
233
234 // vec3
235 std::shared_ptr<Vector3f> _vec3();
236 std::shared_ptr<Vector3f> _vec3(float x, float y, float z);
237 std::shared_ptr<Vector3f> _vec3(const Vector2f& other, float z = 0);
238 std::shared_ptr<Vector3f> _vec3(const Vector3f& other);
239 std::shared_ptr<Vector3f> _vec3(const Vector4f& other);
240
241 // ivec4
242 std::shared_ptr<Vector4i> _ivec4();
243 std::shared_ptr<Vector4i> _ivec4(int x, int y, int z, int w);
244 std::shared_ptr<Vector4i> _ivec4(const Vector2i& other, int z = 0, int w = 0);
245 std::shared_ptr<Vector4i> _ivec4(const Vector3i& other, int w = 0);
246 std::shared_ptr<Vector4i> _ivec4(const Vector4i& other);
247
248 // vec4
249 std::shared_ptr<Vector4f> _vec4();
250 std::shared_ptr<Vector4f> _vec4(float x, float y, float z, float w);
251 std::shared_ptr<Vector4f> _vec4(const Vector2f& other, float z = 0, float w = 0);
252 std::shared_ptr<Vector4f> _vec4(const Vector3f& other, float w = 0);
253 std::shared_ptr<Vector4f> _vec4(const Vector4f& other);
254}
The BoundingBox class inherits from Box3, specilizing the template parameters to float for element ty...
Definition box.h:224
The Box2f class inherits from Box2, specilizing the template parameters to float for element type and...
Definition box.h:128
The Box2i class inherits from Box2, specilizing the template parameters to int for element type and V...
Definition box.h:119
The Box3f class inherits from Box3, specilizing the template parameters to float for element type and...
Definition box.h:214
The Box3i class inherits from Box3, specilizing the template parameters to int for element type and V...
Definition box.h:204
The Color3f class inherits from Color3, specilizing the template parameters to float for element type...
Definition color.h:105
The Color3ub class inherits from Color3, specilizing the template parameters to unsigned char for ele...
Definition color.h:116
The Color4f class inherits from Color4, specilizing the template parameters to float for element type...
Definition color.h:146
The Color4ub class inherits from Color4, specilizing the template parameters to unsigned char for ele...
Definition color.h:157
The Integer class inherits from the Tuple class and stores a single integer.
Definition integer.h:26
The Matrix2f class is 2 X 2 matrix.
Definition matrix.h:169
The Matrix3f class is 3 X 3 matrix.
Definition matrix.h:194
The Matrix4f class is 4 X 4 matrix.
Definition matrix.h:226
The MinMax class inherits from Tuple, specilizing the template parameters to float for element type.
Definition minmax.h:31
The Plane class inherits from the Tuple class, specilizing the templated parameter to float for eleme...
Definition plane.h:30
The Quaternion class inherits from the Tuple class, specilizing the templated parameter to float for ...
Definition quaternion.h:28
The Ray class inherits from the Tuple class, specilizing the templated parameter to float for element...
Definition ray.h:31
The Real class inherits from the Tuple class and stores a single float.
Definition real.h:26
The class Vector2f inherits from the templated class of Vector2, and the template parameters are spec...
Definition vector.h:268
The class Vector2i inherits from the templated class of Vector2, and the template parameters are spec...
Definition vector.h:255
The class Vector3f inherits from the templated class of Vector3, and the template parameters are spec...
Definition vector.h:322
The class Vector3i inherits from the templated class of Vector3, and the template parameters are spec...
Definition vector.h:312
The class Vector4f inherits from the templated class of Vector4, and the template parameters are spec...
Definition vector.h:366
The class Vector4i inherits from the templated class of Vector4, and the template parameters are spec...
Definition vector.h:354
Definition decal.h:23
std::shared_ptr< MinMax > _minmax()
std::shared_ptr< Vector3f > _vec3()
std::shared_ptr< Integer > _integer()
std::shared_ptr< Uint32Array > _u32array(int size=0, unsigned int *data=nullptr, bool copy=true)
std::shared_ptr< Vector2i > _ivec2()
std::shared_ptr< Vector4i > _ivec4()
std::shared_ptr< Float64Array > _f64array(int size=0, double *data=nullptr, bool copy=true)
std::shared_ptr< Image2D > _image2d(int width, int height, unsigned char *data=nullptr)
std::shared_ptr< Uint16Array > _u16array(int size=0, unsigned short *data=nullptr, bool copy=true)
std::shared_ptr< Matrix3f > _mat3()
std::shared_ptr< Int16Array > _i16array(int size=0, short *data=nullptr, bool copy=true)
std::shared_ptr< Vector3i > _ivec3()
std::shared_ptr< Box2f > _box2f()
std::shared_ptr< Float32Array > _f32array(int size=0, float *data=nullptr, bool copy=true)
std::shared_ptr< Color4f > _clr4()
std::shared_ptr< Plane > _plane()
std::shared_ptr< ImageCube > _imageCube(const std::vector< Image2D > &images)
std::shared_ptr< Quaternion > _quat()
std::shared_ptr< Box3f > _box3f()
std::shared_ptr< BoundingBox > _bbox()
std::shared_ptr< Uint8Array > _u8array(int size=0, unsigned char *data=nullptr, bool copy=true)
std::shared_ptr< Color4ub > _clr4ub()
std::shared_ptr< Color3f > _clr3()
std::shared_ptr< Box2i > _box2i()
std::shared_ptr< Matrix4f > _mat4()
std::shared_ptr< GeometrySource > _geom(const std::string &text)
std::shared_ptr< Matrix2f > _mat2()
std::shared_ptr< Ray > _ray()
std::shared_ptr< Box3i > _box3i()
std::shared_ptr< Color3ub > _clr3ub()
std::shared_ptr< Int8Array > _i8array(int size=0, char *data=nullptr, bool copy=true)
std::shared_ptr< Vector4f > _vec4()
std::shared_ptr< VertexSource > _vert(const std::string &text)
std::shared_ptr< Int32Array > _i32array(int size=0, int *data=nullptr, bool copy=true)
std::shared_ptr< FragmentSource > _frag(const std::string &text)
std::shared_ptr< Real > _real()
std::shared_ptr< Vector2f > _vec2()