44 #include <gsl/gsl_matrix.h>
53 namespace AlignmentSubsystem
85 head->next = head->prev = p;
94 if (head == head->next)
98 p->next->prev = p->prev;
99 p->prev->next = p->next;
104 template <
class Type>
113 struct tVertexStructure;
114 struct tFaceStructure;
115 struct tEdgeStructure;
118 typedef struct tVertexStructure
tsVertex;
150 pMatrix = gsl_matrix_alloc(3, 3);
168 static const int SAFE = 1000000;
292 void MakeNewVertex(
double x,
double y,
double z,
int VertexId);
329 void PrintObj(
const char *FileName =
"chull.obj");
361 ScaleFactor = NewScaleFactor;
366 void SubVec(
int a[3],
int b[3],
int c[3]);
This class computes the convex hull of a set of 3d points.
void Checks()
Checks the consistency of the hull and prints the results to the standard error output.
void ReadVertices()
ReadVertices: Reads in the vertices, and links them into a circular list with MakeNullVertex....
static const bool REMOVED
void CleanUp(tVertex *pvnext)
CleanUp goes through each data structure list and clears all flags and NULLs out some pointers....
tFace MakeNullFace()
MakeNullFace creates a new face structure and initializes all of its flags to NULL and sets all the f...
void EdgeOrderOnFaces()
EdgeOrderOnFaces: puts e0 between v0 and v1, e1 between v1 and v2, e2 between v2 and v0 on each face....
void Reset()
Frees the vertices edges and faces lists and resets the debug and check flags.
static const bool VISIBLE
void PrintPoint(tVertex p)
Prints a single vertex to the standard output.
void Convexity()
Convexity checks that the volume between every face and every point is negative. This shows that each...
void Consistency()
Consistency runs through the edge list and checks that all adjacent faces have their endpoints in opp...
void SetScaleFactor(const int NewScaleFactor)
Set the floating point to integer scaling factor. If you want to tweak this a good value to start fro...
tFace MakeFace(tVertex v0, tVertex v1, tVertex v2, tFace f)
MakeFace creates a new face structure from three vertices (in ccw order). It returns a pointer to the...
bool AddOne(tVertex p)
AddOne is passed a vertex. It first determines all faces visible from that point. If none are visible...
void MakeNewVertex(double x, double y, double z, int VertexId)
Makes a vertex from the supplied information and adds it to the vertices list.
static void swap(Type &t, Type &x, Type &y)
struct tVertexStructure tsVertex
void CheckEndpts()
Checks that, for each face, for each i={0,1,2}, the [i]th vertex of that face is either the [0]th or ...
int GetScaleFactor() const
Set the floating point to integer scaling factor.
void PrintVertices(std::ofstream &Ofile)
Prints vertices to Ofile.
void CheckEuler(int V, int E, int F)
CheckEuler checks Euler's relation, as well as its implications when all faces are known to be triang...
static void remove(Type &head, Type p)
void CleanVertices(tVertex *pvnext)
CleanVertices runs through the vertex list and deletes the vertices that are marked as processed but ...
bool Collinear(tVertex a, tVertex b, tVertex c)
Collinear checks to see if the three points given are collinear, by checking to see if each element o...
void PrintOut(const char *FileName, tVertex v)
Prints vertices, edges and faces to the standard error output.
int Volumei(tFace f, tVertex p)
Volumei returns the volume of the tetrahedron determined by f and p.
bool DoubleTriangle()
DoubleTriangle builds the initial double triangle. It first finds 3 noncollinear points and makes two...
void MakeCcw(tFace f, tEdge e, tVertex p)
MakeCcw puts the vertices in the face structure in counterclock wise order. We want to store the vert...
void CleanEdges()
CleanEdges runs through the edge list and cleans up the structure. If there is a newface then it will...
static const bool PROCESSED
void ConstructHull()
ConstructHull adds the vertices to the hull one at a time. The hull vertices are those in the list ma...
int VolumeSign(tFace f, tVertex p)
VolumeSign returns the sign of the volume of the tetrahedron determined by f and p....
tVertex MakeNullVertex()
MakeNullVertex: Makes a vertex, nulls out fields.
void PrintEdges(std::ofstream &Ofile)
Prints the edges Ofile.
void PrintObj(const char *FileName="chull.obj")
Outputs the faces in Lightwave obj format for 3d viewing. The files chull.obj and chull....
void Print()
Print: Prints out the vertices and the faces. Uses the vnum indices corresponding to the order in whi...
void SubVec(int a[3], int b[3], int c[3])
SubVec: Computes a - b and puts it into c.
tFace MakeConeFace(tEdge e, tVertex p)
MakeConeFace makes a new face and two new edges between the edge and the point that are passed to it....
void PrintFaces(std::ofstream &Ofile)
Prints the faces to Ofile.
tEdge MakeNullEdge()
MakeNullEdge creates a new cell and initializes all pointers to NULL and sets all flags to off....
void CleanFaces()
CleanFaces runs through the face list and deletes any face marked visible.
static void add(Type &head, Type p)
Namespace to encapsulate INDI client, drivers, and mediator classes.
Holds the connection type.