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
GradientDiameterGen.h
Go to the documentation of this file.
1
#pragma once
2
#include "DiameterGen.h"
3
4
class
GradientDiameterGen
:
public
DiameterGen
5
{
6
public
:
7
GradientDiameterGen
() :
_diameterStart
(1.0),
_diameterEnd
(1.0) {};
8
GradientDiameterGen
(
double
diameterStart,
double
diameterEnd)
9
:
_diameterStart
(diameterStart),
_diameterEnd
(diameterEnd) {};
10
11
META_DAObject
(
GradientDiameterGen
,
"Gradient Diameter"
)
12
13
14
virtual DoubleArrayPtr getDiameters(
unsigned
int
arraySize )
15
{
16
_dirty =
false
;
17
18
DoubleArrayPtr result =
new
osg::DoubleArray;
19
result->reserve(arraySize);
20
double
diameterStep = (
_diameterEnd
-
_diameterStart
) / arraySize;
21
22
for
(
unsigned
int
i = 0; i < arraySize; i++)
23
result->push_back(
_diameterStart
+ diameterStep * i);
24
25
return
result;
26
}
27
28
inline
double
getDiameterEnd
()
const
{
return
_diameterEnd
; }
29
inline
void
setDiameterEnd
(
double
val) { _dirty =
true
;
_diameterEnd
= val; }
30
31
inline
double
getDiameterStart
()
const
{
return
_diameterStart
; }
32
inline
void
setDiameterStart
(
double
val) { _dirty =
true
;
_diameterStart
= val; }
33
34
protected
:
35
double
_diameterStart
;
36
double
_diameterEnd
;
37
38
};
src
vreckoAP
DynamicArt
GradientDiameterGen.h
Generated on Tue Feb 19 2013 10:23:46 for vrecko by
1.8.3.1