Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef __TRIANGLEMESH__FOR_MT__
#define __TRIANGLEMESH__FOR_MT__
#include <vector>
#include "../src/params.h"
/**
* This is simple, minimalistically compatible (somewhat at the syntax level (*))
* class alternative to the main MotionTracking class ActiveMesh.
*
* (*) It uses standard container (std::vector) instead of those of MotionTracking (MArray).
* Data from both containers, however, can be accessed in a syntactically the same fashion,
* i.e., with pointers and []. Modifying lengths of the containers differ.
*
* (*) Also the Vector3F is different from the MotionTracking one, yet they are similar.
*
* It is meant for rapid trying/debugging of basic "mesh-processing" mesh-not-modifying algorithms.
*/
class ActiveMesh
{
public:
std::vector<Vector3FC> Pos; //list of mesh vertices
std::vector<long unsigned int> ID; //list of triangles organized in tripplets of indices into the Pos array of vertices;
//the array length should be 3x the number of triangles in the mesh
std::vector<Vector3F> norm; //list of vectors that are normal/orthogonal to the planes given by the individual triangles
///input is filename
///returns 0 on success, otherwise non-zero
int ImportSTL(const char* filename);
int ImportVTK(const char* filename);
void CenterMesh(const Vector3F& newCentre);
void ScaleMesh(const Vector3F& scale);
void displayMesh(void); //defined in graphics.cpp
};
#endif