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
ComputeThread.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <OpenThreads/Thread>
4
#include "
ComputeStrategy.h
"
5
#include "
Utils.h
"
6
#include <random>
7
8
namespace
APDYNAMICART
9
{
10
11
struct
InitSettings
12
{
13
IComputeStrategyPtr
strategy
;
14
Parameters
params
;
15
float
size
;
16
int
settleIterations
;
17
int
iterationCount
;
18
int
interpolationSteps
;
19
bool
randomRun
;
20
};
21
22
class
ComputeThread
:
public
OpenThreads::Thread,
public
osg::Referenced
23
{
24
25
public
:
27
ComputeThread
();
28
virtual
void
run
();
29
30
bool
isTooSmall
(
int
i,
int
iter );
31
32
virtual
int
cancel
();
33
35
void
init
(
const
InitSettings
& settings);
36
bool
getData
(osg::Vec3Array* points, osg::Vec4Array* colors,
Limits
& limits,
Parameters
& params);
37
void
addPoint
( osg::Vec3 point );
38
void
setColor
( osg::Vec4 color,
int
index );
39
void
interpolatePoints
();
40
41
protected
:
42
bool
_dirty
;
43
bool
_done
;
44
45
OpenThreads::Mutex
_mutex
;
46
Vec3ArrayPtr
_points
;
47
Vec4ArrayPtr
_colors
;
48
Limits
_lim
;
49
InitSettings
_conf
;
50
static
std::tr1::mt19937
eng
;
51
osg::Vec3
_initPoint
;
52
private
:
53
bool
isDiverging( osg::Vec3 &point );
54
void
createRandomParameters();
55
void
computeColors();
56
void
computePoints();
57
};
58
59
typedef
osg::ref_ptr<ComputeThread>
ComputeThreadPtr
;
60
61
}
include
vreckoAP
DynamicArt
ComputeThread.h
Generated on Tue Feb 19 2013 10:23:42 for vrecko by
1.8.3.1