Tesselator.hpp
Go to the documentation of this file.
1 
28 //
29 // Created by Christian Swan on 09.10.17.
30 //
31 
32 #ifndef LVR2_ALGORITHM_TESSELATOR_H
33 #define LVR2_ALGORITHM_TESSELATOR_H
34 
38 
39 #if _MSC_VER
40 #include <Windows.h>
41 #endif
42 
43 #ifndef __APPLE__
44 #include <GL/glu.h>
45 #include <GL/glut.h>
46 #define CALLBACK
47 #else
48 #include <OpenGL/glu.h>
49 #include <GLUT/glut.h>
50 #endif
51 
52 namespace lvr2
53 {
54 
60 template<typename BaseVecT>
61 class Tesselator {
62 
63 public:
64 
68  static void apply(
70  ClusterBiMap<FaceHandle>& clusters,
72  float lineFusionThreshold
73  );
74 
75 private:
76 
80  static GLUtesselator* m_tesselator;
81 
85  static GLenum m_type;
86 
90  static std::vector<BaseVecT> m_vertices;
91 
95  static std::vector<BaseVecT> m_faces;
96 
100  static void CALLBACK beginCallback(GLenum type);
101 
105  static void CALLBACK vertexCallback(void* data);
106 
111  static void CALLBACK combineDataCallback(GLdouble coords[3],
112  void *vertex_data[4],
113  GLfloat weight[4],
114  void **outData,
115  void *userData);
116 
120  static void CALLBACK endCallback(void);
124  static void CALLBACK errorCallback(GLenum errno);
125 
130  static void init();
131 
137  static void addTesselatedFaces(
138  BaseMesh<BaseVecT>& mesh,
139  ClusterBiMap<FaceHandle>& clusters,
141  ClusterHandle clusterH
142  );
143 };
144 
145 } // namespace lvr2
146 
147 #include "lvr2/algorithm/Tesselator.tcc"
148 
149 #endif //LVR2_ALGORITHM_TESSELATOR_H
static void CALLBACK beginCallback(GLenum type)
static void CALLBACK combineDataCallback(GLdouble coords[3], void *vertex_data[4], GLfloat weight[4], void **outData, void *userData)
static GLenum m_type
Definition: Tesselator.hpp:85
HalfEdgeMesh< Vec > mesh
#define CALLBACK
Definition: Tesselator.hpp:46
static void apply(BaseMesh< BaseVecT > &mesh, ClusterBiMap< FaceHandle > &clusters, DenseFaceMap< Normal< typename BaseVecT::CoordType >> &faceNormals, float lineFusionThreshold)
static void addTesselatedFaces(BaseMesh< BaseVecT > &mesh, ClusterBiMap< FaceHandle > &clusters, DenseFaceMap< Normal< typename BaseVecT::CoordType >> &faceNormal, ClusterHandle clusterH)
Interface for triangle-meshes with adjacency information.
Definition: BaseMesh.hpp:140
A map of clusters, which also saves a back-reference from handle to cluster.
static std::vector< BaseVecT > m_faces
Definition: Tesselator.hpp:95
Handle to access Cluster of the ClusterBiMap.
Definition: Handles.hpp:152
static void init()
static std::vector< BaseVecT > m_vertices
Definition: Tesselator.hpp:90
static void CALLBACK endCallback(void)
static void CALLBACK vertexCallback(void *data)
static void CALLBACK errorCallback(GLenum errno)
static GLUtesselator * m_tesselator
Definition: Tesselator.hpp:80
A map with constant lookup overhead using small-ish integer-keys.
Definition: VectorMap.hpp:60


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:09