vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PointShell_Object_Data_Geometry_Analyser.h
Go to the documentation of this file.
1 #ifndef POINTSHELL_OBJECT_DATA_GEOMETRY_ANALYSER_H
2 #define POINTSHELL_OBJECT_DATA_GEOMETRY_ANALYSER_H
3 
5 
6 namespace APSpacePartitioning {
7 
9 
10 public :
11 
13  osg::Vec3f comNorm; //normal used for computaions
14  int id; // ID of this vertex // used only for outPut
15  list<int> polygons;
16  list<int> edges;
17 };
18 
20  float length;
21  int p1ID;
22  int p2ID;
23 };
24 
26  float size;
27  int e1ID;
28  int e2ID;
29  int e3ID;
30  osg::Vec3f norm;
31 };
32 
35 
36  void setVerticesCount(int count);
37  void setPolygonsCount(int count);
38  void setEdgesCount(int count);
39 
40  void writeVertex(int seqnum,osg::Vec3f pos, osg::Vec3f norm); // writes a new vertex into a mesh
41  void writeVertex(int seqnum,osg::Vec3f pos); // writes a new vertex into a mesh
42  void writeEdge(int seqnum,int vertexPos1, int vertexPos2); // writes an edge into a mesh
43  void writeEdge(int seqnum,int vertexPos1, int vertexPos2, int polygonPos1, int polygonPos2); // writes an edge in to a mesh
44  void writePolygon(int seqnum, int v1, int v2, int v3); // writes a new polygon in a mesh
45 
46  void finishStructureBuild();
47 
48  vector<PointShell_Object_Data_Geometry::V> getVertices(); // returns all vertices of geometry
49  vector<PointShell_Object_Data_Geometry::E> getEdges(); // returns all edges of geometry
50  vector<PointShell_Object_Data_Geometry::P> getPolygons(); // returns all polygons of geometry
51 
52  PointShell_Object_Data_Geometry::V getVertex(int seqnum); // returns a vertex at position seqnum
53 
54  float getMaxDistance(); // returns maximum distance in object. Computed by vertices.
55  osg::Vec3f getMaxDistanceVector(); // returns maximum distance vector. Computed by vertices.
56 
57 protected:
58  #define FIELD_SIZE 200000
65 
66  float maxDistance;
69 
70  void calculateEdgesLength(); // calculates length of ALL edges
71  void calculateEdgeLength(int edge); // calculate length of required edge
72 
73  void calculateNormalOfPolygons(); // calcluates normals of ALL polygons
74  void calculateNormalOfPolygon(int seqnum); // calculate normal of required polygon
75 
76  void calculateVerticesNormals(); // calculate normals of vertices
77  void calculateVertexNormal(int seqnum); // calculate normals of vertex
78 
79  void cleanVertexEdges(); // cleans vertex edges from duplicities
80 
81  void handleEdges(int polygon); // for a polygon the new edges are created or the polygons edges ID's are set
82  vector<int> getEdges(int polygon);
83 };
84 }
85 #endif