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
SweepSurfaceGeode.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <osg\Geode>
4
5
#include "Spline.h"
6
#include "types.h"
7
#include "RotationFrameGenerator.h"
8
#include "ColorGen.h"
9
#include "DiameterGen.h"
10
11
class
SweepSurfaceGeode
:
public
osg::Geode
12
{
13
public
:
14
SweepSurfaceGeode
();
15
SweepSurfaceGeode
(
const
SweepSurfaceGeode
&,
const
osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
16
17
META_Node
(APDYNAMICART,
SweepSurfaceGeode
);
18
20
virtual
void
traverse
(osg::NodeVisitor& nv);
21
23
inline
SplinePtr
getLeadingSpline
()
const
{
return
_leadSpline
; }
24
inline
SplinePtr
getLeadingSpline
() {
return
_leadSpline
; }
25
inline
void
setLeadingSpline
(SplinePtr val);
26
27
inline
ColorGenPtr
getColorGenerator
()
const
{
return
_colorGen
; }
28
inline
ColorGenPtr
getColorGenerator
() {
return
_colorGen
; }
29
inline
void
setColorGenerator
(ColorGenPtr val);
30
31
inline
DiameterGenPtr
getDiameterGenerator
()
const
{
return
_diameterGen
; }
32
inline
DiameterGenPtr
getDiameterGenerator
() {
return
_diameterGen
; }
33
inline
void
setDiameterGenerator
(DiameterGenPtr val);
34
35
inline
SplinePtr
getCrossSectionSpline
()
const
{
return
_crossSectionSpline
; }
36
inline
SplinePtr
getCrossSectionSpline
() {
return
_crossSectionSpline
; }
37
inline
void
setCrossSectionSpline
(SplinePtr val);
38
39
inline
RotationFrameGeneratorPtr
getRFGenerator
()
const
{
return
_rfGenerator
; }
40
inline
RotationFrameGeneratorPtr
getRFGenerator
() {
return
_rfGenerator
; }
41
inline
void
setRFGenerator
(RotationFrameGeneratorPtr val);
42
43
inline
const
Vec3ArrayPtr
getCrossSectionArray
()
const
{
return
_crossSectionArray
; }
44
inline
const
Vec3ArrayPtr
getLeadSplineArray
()
const
{
return
_leadSplineArray
; }
45
46
protected
:
47
SplinePtr
_leadSpline
;
48
SplinePtr
_crossSectionSpline
;
49
ColorGenPtr
_colorGen
;
50
DiameterGenPtr
_diameterGen
;
51
osg::ref_ptr<osg::Geometry>
_geometry
;
52
RotationFrameGeneratorPtr
_rfGenerator
;
53
Vec3ArrayPtr
_leadSplineArray
;
54
Vec3ArrayPtr
_crossSectionArray
;
55
56
57
std::vector<osg::Quat>
_rotationAngles
;
//NOTE: This is just temporary!!! It will be solved better
58
RotationFrameArray
_rfArray
;
59
DoubleArrayPtr
_diameters
;
60
void
updateGeometry
();
61
void
createDrawableObject
();
62
void
updateVertexArray
();
63
void
updateNormalArray
();
64
void
updatePrimitiveSet
();
65
void
showDebugNormals
();
66
Vec3ArrayPtr
compute2DNormals
();
67
inline
osg::Vec3
compute2DNormal
(
const
osg::Vec3& p1,
const
osg::Vec3& p2);
68
void
updateColorArray
();
69
};
70
72
void
SweepSurfaceGeode::setCrossSectionSpline
( SplinePtr val )
73
{
74
if
(val.valid()) {
75
_crossSectionSpline
= val;
76
_crossSectionSpline
->dirty();
77
}
78
}
79
80
void
SweepSurfaceGeode::setLeadingSpline
( SplinePtr val )
81
{
82
if
(val.valid()) {
83
_leadSpline
= val;
84
_leadSpline
->dirty();
85
}
86
}
87
88
void
SweepSurfaceGeode::setRFGenerator
( RotationFrameGeneratorPtr val )
89
{
90
if
(val.valid()) {
91
_rfGenerator
= val;
92
_rfGenerator
->dirty();
93
}
94
}
95
96
void
SweepSurfaceGeode::setColorGenerator
( ColorGenPtr val )
97
{
98
if
(val.valid()) {
99
_colorGen
= val;
100
_colorGen
->dirty();
101
}
102
}
103
104
void
SweepSurfaceGeode::setDiameterGenerator
( DiameterGenPtr val )
105
{
106
if
(val.valid()) {
107
_diameterGen
= val;
108
_diameterGen
->dirty();
109
}
110
}
111
112
typedef
osg::ref_ptr<SweepSurfaceGeode>
SweepSurfaceGeodePtr
;
113
src
vreckoAP
DynamicArt
SweepSurfaceGeode.h
Generated on Tue Feb 19 2013 10:23:46 for vrecko by
1.8.3.1