-
Notifications
You must be signed in to change notification settings - Fork 2
/
Tet.h
75 lines (58 loc) · 1.84 KB
/
Tet.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//
// Tet.h
// Reader
//
// Created by Rob Fonti on 1/10/18.
// Copyright © 2018 Rob Fonti. All rights reserved.
//
#ifndef Tet_h
#define Tet_h
#include <vector>
#include <iostream>
#include <memory>
#include "Point.h"
#include "Utility.h"
#include "Estimator.h"
#include "Particle.h"
#include "Constants.h"
#include "EstimatorCollection.h"
//Tet Class includes 4 points which define a given tetrahedra
//Tets have ID's associated with them.
typedef std::shared_ptr<point> point_ptr;
typedef std::shared_ptr<EstimatorCollection> EstCol_ptr;
typedef std::shared_ptr<Particle> Part_ptr;
using std::vector;
class Tet
{
private:
int TetID;
double d0; //sign of the D0 deternminant (false = negative, true = positive)
std::string tetName;
vector< double > vert1;
vector< double > vert2;
vector< double > vert3;
vector< double > vert4;
vector< double > A1, A2, A3, A4;; //3x3 determinants precomp
// Estimators
vector< EstCol_ptr > estimators;
public:
Tet( std::string label, point p );
std::string name() { return tetName; };
void setVertices( std::shared_ptr<point> p1, std::shared_ptr<point> p2,
std::shared_ptr<point> p3, std::shared_ptr<point> p4 );
void addVertice( std::shared_ptr< point > inVertice );
void addEstimator( EstCol_ptr newEstimator );
void setID( int tetID );
int getID();
vector< double > getVert1();
vector< double > getVert2();
vector< double > getVert3();
vector< double > getVert4();
vector< double > getCentroid();
std::vector< EstCol_ptr > getEstimators() { return estimators; };
bool amIHere( const std::vector< double >& testPoint );
// Estimator interface
void scoreTally(Part_ptr p , double xs);
void endTallyHist();
};
#endif /* Tet_h */