commit 1752f8c6fbd3a87385d3bc5401edf9a127bdc815
parent 25a5253945085b69d96924ede79944e59ea885a4
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Mon, 27 Jun 2016 12:22:13 +0200
Back to public types for quadrics
As it was before 970d9ab36f4e8c40d480d9f8625de379f7fba12a
Diffstat:
2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -48,7 +48,6 @@ set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
set(SSOL_FILES_SRC
ssol_device.c
- ssol_quadric.c
ssol_shape.c)
set(SSOL_FILES_INC_API
@@ -56,7 +55,6 @@ set(SSOL_FILES_INC_API
set(SSOL_FILES_INC
ssol_device_c.h
- ssol_quadric_c.h
ssol_shape_c.h)
set(SSOL_FILES_DOC COPYING README.md)
diff --git a/src/ssol.h b/src/ssol.h
@@ -66,6 +66,13 @@ enum ssol_parametrization_type {
SSOL_PARAMETRIZATION_PRIMITIVE_ID /* Map from 3D to 1D with primitive id */
};
+enum ssol_quadric_type {
+ SSOL_QUADRIC_PLANE,
+ SSOL_QUADRIC_PARABOL,
+ SSOL_QUADRIC_PARABOLIC_CYLINDER,
+ SSOL_GENERAL_QUADRIC
+};
+
enum ssol_carving_type {
SSOL_CARVING_CIRCLE,
SSOL_CARVING_POLYGON
@@ -103,6 +110,33 @@ struct ssol_image_layout {
static const struct ssol_vertex_data SSOL_VERTEX_DATA_NULL =
SSOL_VERTEX_DATA_NULL__;
+/* The following quadric definitions are in local coordinate system. */
+struct ssol_quadric_plane {
+ char unused; /* Define z = 0 */
+};
+struct ssol_quadric_parabol {
+ double focal; /* Define x^2 + y^2 - 4 focal z = 0 */
+};
+
+struct ssol_quadric_parabolic_cylinder {
+ double focal; /* Define y^2 - 4 focal z = 0 */
+};
+
+struct ssol_general_quadric {
+ double a, b, c, d, e, f, g, h, i, j;
+ /* Define ax² + 2bxy + 2cxz + 2dx + ey² + 2fyz + 2gy + hz² + 2iz + j = 0 */
+};
+
+struct ssol_quadric {
+ enum ssol_quadric_type type;
+ union {
+ struct ssol_quadric_plane plane;
+ struct ssol_quadric_parabol parabol;
+ struct ssol_quadric_parabolic_cylinder parabolic_cylinder;
+ struct ssol_quadric_parabolic_cylinder general_quadric;
+ } data;
+};
+
struct ssol_carving_circle {
double radius;
};