Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
CSolid3D.hpp
Go to the documentation of this file.
1#ifndef LIBS_SHAPES_CSOLID3D_HPP_
2#define LIBS_SHAPES_CSOLID3D_HPP_
3
4#include "math/structs.hpp"
6
7#include <cstdint>
8#include <memory>
9#include <vector>
10
12{
13public:
14 static bool canCreateSurface2DFilled(
15 const std::vector<std::shared_ptr<std::vector<iv::math::geometry::Point3d>>> &contours,
16 std::vector<iv::math::geometry::Point3d> &pointsOut, std::vector<iv::math::geometry::Point3d> &normalsOut,
17 std::vector<uint64_t> &indexTrianglesOut, std::vector<std::vector<uint64_t>> &indexTriangleStripOut,
18 std::vector<std::vector<uint64_t>> &indexTriangleFanOut);
19
20 explicit CSolid3D(const CSolid3D *solid3D);
21 explicit CSolid3D(const std::vector<std::vector<iv::math::geometry::Point3d>> &solid3DClosed);
22 CSolid3D(const std::vector<iv::math::geometry::Point3d> &points,
23 const std::vector<iv::math::geometry::Point3d> &normals, const std::vector<uint64_t> &indexTriangles,
24 const std::vector<std::vector<uint64_t>> &indexTriangleStrip,
25 const std::vector<std::vector<uint64_t>> &indexTriangleFan);
26 virtual ~CSolid3D();
27
28 bool operator==(const CSolid3D &b) const;
29
30 void draw(IGraphics *graphics);
31
32private:
33 enum class EBandType
34 {
38 };
39
41 {
49
50 SPrvBandMesh(CSolid3D::EBandType typeBand, uint64_t numVertexBand, uint32_t **indexVertex);
51 explicit SPrvBandMesh(const SPrvBandMesh *bandMesh);
53
54 SPrvBandMesh(SPrvBandMesh &&b) noexcept = default;
55
56 bool operator==(const SPrvBandMesh &b) const
57 {
58 return (m_bandType == b.m_bandType) && (m_indexVertex == b.m_indexVertex);
59 }
60
62
64 std::unique_ptr<uint32_t[]> m_indexVertex;
65 };
66
67 static void prvAppendBand(const CSolid3D::EBandType &typeBand, const std::vector<uint64_t> &indexTriangles,
68 std::vector<SPrvBandMesh> *bands);
69 static void prvAppendBands(const CSolid3D::EBandType &typeBand,
70 const std::vector<std::vector<uint64_t>> &indexTriangles,
71 std::vector<SPrvBandMesh> *bands);
72
73 uint64_t m_numPoints;
74 float *m_points;
75 float *m_normals;
77
78 std::vector<SPrvBandMesh> m_bands;
79};
80
81#endif /* LIBS_SHAPES_CSOLID3D_HPP_ */
Definition CSolid3D.hpp:12
void draw(IGraphics *graphics)
Definition CSolid3D.cpp:388
float * m_textureOpt
Definition CSolid3D.hpp:76
float * m_normals
Definition CSolid3D.hpp:75
uint64_t m_numPoints
Definition CSolid3D.hpp:73
static bool canCreateSurface2DFilled(const std::vector< std::shared_ptr< std::vector< iv::math::geometry::Point3d > > > &contours, std::vector< iv::math::geometry::Point3d > &pointsOut, std::vector< iv::math::geometry::Point3d > &normalsOut, std::vector< uint64_t > &indexTrianglesOut, std::vector< std::vector< uint64_t > > &indexTriangleStripOut, std::vector< std::vector< uint64_t > > &indexTriangleFanOut)
Definition CSolid3D.cpp:264
std::vector< SPrvBandMesh > m_bands
Definition CSolid3D.hpp:78
EBandType
Definition CSolid3D.hpp:34
bool operator==(const CSolid3D &b) const
Definition CSolid3D.cpp:382
float * m_points
Definition CSolid3D.hpp:74
static void prvAppendBand(const CSolid3D::EBandType &typeBand, const std::vector< uint64_t > &indexTriangles, std::vector< SPrvBandMesh > *bands)
Definition CSolid3D.cpp:236
CSolid3D(const CSolid3D *solid3D)
Definition CSolid3D.cpp:342
virtual ~CSolid3D()
Definition CSolid3D.cpp:368
static void prvAppendBands(const CSolid3D::EBandType &typeBand, const std::vector< std::vector< uint64_t > > &indexTriangles, std::vector< SPrvBandMesh > *bands)
Definition CSolid3D.cpp:251
Definition IGraphics.hpp:20
Definition CSolid3D.hpp:41
uint64_t m_numVertexBand
Definition CSolid3D.hpp:63
~SPrvBandMesh()
Definition CSolid3D.cpp:231
bool operator==(const SPrvBandMesh &b) const
Definition CSolid3D.hpp:56
SPrvBandMesh(SPrvBandMesh &&b) noexcept=default
std::unique_ptr< uint32_t[]> m_indexVertex
Definition CSolid3D.hpp:64
SPrvBandMesh()
Definition CSolid3D.hpp:42
CSolid3D::EBandType m_bandType
Definition CSolid3D.hpp:61