1 module beziermeshmaker.datastructures.meshpoint;
2 
3 import beziermeshmaker.datastructures.quadcell;
4 import beziermeshmaker.datastructures.vec3;
5 
6 class MeshPoint {
7 	public static immutable int P_TYPE_ORIGINAL = 1; //P type vertices that were vertices in the original mesh
8 	public static immutable int P_TYPE_CENTROID = 2; //P type vertices that were centroids in the original mesh
9 	public static immutable int M_TYPE = 3;
10 
11 	//Experimentally determined defaults
12 	public static float ALPHA_BLEND_DEFAULT = 2;
13 	public static float BETA_BLEND_DEFAULT = 1;
14 
15 	QuadCell[] neighbors;
16 
17 	vec3 pt; //The actual location of the point
18 	int ptType;
19 
20 	float alphaBlend, betaBlend;
21 
22 	this (vec3 pt, int type) {
23 		this(pt, type, ALPHA_BLEND_DEFAULT, BETA_BLEND_DEFAULT);
24 	}
25 	this (vec3 pt, int type, float alphaBlend, float betaBlend) {
26 		this.pt = pt;
27 		this.ptType = type;
28 		this.alphaBlend = alphaBlend;
29 		this.betaBlend = betaBlend;
30 	}
31 
32 	public int getIndex(QuadCell cell) {
33 		for (int i = 0; i < neighbors.length; i++) {
34 			if (neighbors[i] == cell) {
35 				return i;
36 			}
37 		}
38 		return -1;
39 	}
40 }