vrecko
virtual reality framework
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
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
4
#include "
pointshell_object_data_geometry.h
"
5
6
namespace
APSpacePartitioning {
7
8
class
PointShell_Object_Data_Geometry_Analyser
:
public
PointShell_Object_Data_Geometry
{
9
10
public
:
11
12
struct
VExt
:
public
PointShell_Object_Data_Geometry::V
{
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
19
struct
EExt
:
public
PointShell_Object_Data_Geometry::E
{
20
float
length
;
21
int
p1ID
;
22
int
p2ID
;
23
};
24
25
struct
PExt
:
public
PointShell_Object_Data_Geometry::P
{
26
float
size
;
27
int
e1ID
;
28
int
e2ID
;
29
int
e3ID
;
30
osg::Vec3f
norm
;
31
};
32
33
PointShell_Object_Data_Geometry_Analyser
();
34
~PointShell_Object_Data_Geometry_Analyser
(){};
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
59
VExt
vertices
[
FIELD_SIZE
];
60
EExt
edges
[3*
FIELD_SIZE
- 2];
61
PExt
polygons
[2*
FIELD_SIZE
-2];
62
int
iVerticesCount
;
63
int
iEdgesCount
;
64
int
iPolygonsCount
;
65
66
float
maxDistance
;
67
int
maxDistanceV1
;
68
int
maxDistanceV2
;
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
include
vreckoAP
SpacePartitioning
PointShell_Object_Data_Geometry_Analyser.h
Generated on Tue Feb 19 2013 10:23:45 for vrecko by
1.8.3.1