1 #ifndef BASICCOMPONENTS_H 2 #define BASICCOMPONENTS_H 13 float first,second,third=0;
36 if(is3d)
return make_pair(first*100,make_pair(second*100,third*100)) > make_pair(other.
first*100,make_pair(other.
second*100,other.
third*100));
37 else return make_pair(first*100,second*100) > make_pair(other.
first*100,other.
second*100);
50 if(is3d && rhs.
is3d) {
68 else return os << v.
first+50 <<
", " << v.
second+50 <<endl;
84 return (vertices.first==b.
vertices.first && vertices.second==b.
vertices.second ) ||
98 Vertice u=vertices.
first, v=vertices.second, u_proj, v_proj;
101 double ux=u.
first, uy=u.
second, uz=u.
third, vx=v.first, vy=v.second, vz=v.third;
122 u_proj.first= (std::sqrt(3) * ux - std::sqrt(3) * uz)/ std::sqrt(6);
123 u_proj.second= (ux + 2*uy + uz)/ std::sqrt(6);
124 v_proj.first= (std::sqrt(3) * vx - std::sqrt(3) * vz)/ std::sqrt(6);
125 v_proj.second= (vx + 2*vy + vz)/ std::sqrt(6);
149 d= -(a*u.first + b*u.second + c*u.third);
153 float x= sqrt(a*a +b*b +c*c);
161 if(distance(u)<
EPS && distance(v)<
EPS)
return true;
bool is3d
Definition: basicComponents.h:14
ostream & operator<<(std::ostream &os, const Vertice &v)
Function to print shifted co-ordiantes of vertices for debugging.
Definition: basicComponents.h:65
Edge projected(int plane)
Definition: basicComponents.h:97
Vertice deepCopy()
Definition: basicComponents.h:23
char label
Definition: basicComponents.h:15
Definition: basicComponents.h:71
bool operator<(Vertice other) const
Less than operator defined for faster comparisons between different vertices.
Definition: basicComponents.h:33
Vertice operator-(const Vertice &rhs)
Difference operator defined for faster comparisons between different vertices.
Definition: basicComponents.h:46
bool operator<(Edge other) const
Less than operator defined for faster comparisons between Edges.
Definition: basicComponents.h:77
float second
Definition: basicComponents.h:13
float first
Definition: basicComponents.h:13
Definition: basicComponents.h:9
bool onPlane(Edge e)
Function used to check whether an Edge lies on the plane or not.
Definition: basicComponents.h:159
float d
Definition: basicComponents.h:141
#define EPS
Definition: basicComponents.h:7
float distance(Vertice u)
Definition: basicComponents.h:152
float third
Definition: basicComponents.h:13
pair< Vertice, Vertice > vertices
Definition: basicComponents.h:74
Plane(Vertice u, Vertice v, Vertice w)
Constructor to define plane using 3 vertices.
Definition: basicComponents.h:144
Structured Defined to represent Planes.
Definition: basicComponents.h:140