openscenegraph
LightPointNode
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGSIM_LIGHTPOINTNODE
15#define OSGSIM_LIGHTPOINTNODE 1
16
17#include <osgSim/Export>
18#include <osgSim/LightPoint>
20
21#include <osg/Node>
22#include <osg/NodeVisitor>
23#include <osg/BoundingBox>
24#include <osg/Quat>
25#include <osg/Vec4>
26
27#include <vector>
28#include <set>
29
30namespace osgSim {
31
32
34{
35 public :
36
37 typedef std::vector< LightPoint > LightPointList;
38
40
43
45
46 virtual void traverse(osg::NodeVisitor& nv);
47
48
49 unsigned int getNumLightPoints() const { return _lightPointList.size(); }
50
51
52 unsigned int addLightPoint(const LightPoint& lp);
53
54 void removeLightPoint(unsigned int pos);
55
56
57 LightPoint& getLightPoint(unsigned int pos) { return _lightPointList[pos]; }
58
59 const LightPoint& getLightPoint(unsigned int pos) const { return _lightPointList[pos]; }
60
61
62 void setLightPointList(const LightPointList& lpl) { _lightPointList=lpl; }
63
64 LightPointList& getLightPointList() { return _lightPointList; }
65
66 const LightPointList& getLightPointList() const { return _lightPointList; }
67
68
69 void setMinPixelSize(float minPixelSize) { _minPixelSize = minPixelSize; }
70
71 float getMinPixelSize() const { return _minPixelSize; }
72
73 void setMaxPixelSize(float maxPixelSize) { _maxPixelSize = maxPixelSize; }
74
75 float getMaxPixelSize() const { return _maxPixelSize; }
76
77 void setMaxVisibleDistance2(float maxVisibleDistance2) { _maxVisibleDistance2 = maxVisibleDistance2; }
78
79 float getMaxVisibleDistance2() const { return _maxVisibleDistance2; }
80
81 void setLightPointSystem( osgSim::LightPointSystem* lps) { _lightSystem = lps; }
82
83 osgSim::LightPointSystem* getLightPointSystem() { return _lightSystem.get(); }
84 const osgSim::LightPointSystem* getLightPointSystem() const { return _lightSystem.get(); }
85
86 void setPointSprite(bool enable=true) { _pointSprites = enable; }
87
88 bool getPointSprite() const { return _pointSprites; }
89
91
92 protected:
93
95
96 // used to cache the bounding box of the lightpoints as a tighter
97 // view frustum check.
99
101
105
107
109
110};
111
112}
113
114#endif
Definition LightPointNode:34
unsigned int addLightPoint(const LightPoint &lp)
void removeLightPoint(unsigned int pos)
const LightPoint & getLightPoint(unsigned int pos) const
Definition LightPointNode:59
const LightPointList & getLightPointList() const
Definition LightPointNode:66
float getMinPixelSize() const
Definition LightPointNode:71
std::vector< LightPoint > LightPointList
Definition LightPointNode:37
void setMinPixelSize(float minPixelSize)
Definition LightPointNode:69
float _maxPixelSize
Definition LightPointNode:103
float getMaxVisibleDistance2() const
Definition LightPointNode:79
LightPointList _lightPointList
Definition LightPointNode:100
bool getPointSprite() const
Definition LightPointNode:88
void setMaxPixelSize(float maxPixelSize)
Definition LightPointNode:73
float _maxVisibleDistance2
Definition LightPointNode:104
float _minPixelSize
Definition LightPointNode:102
virtual osg::BoundingSphere computeBound() const
const osgSim::LightPointSystem * getLightPointSystem() const
Definition LightPointNode:84
float getMaxPixelSize() const
Definition LightPointNode:75
osgSim::LightPointSystem * getLightPointSystem()
Definition LightPointNode:83
LightPointNode(const LightPointNode &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
unsigned int getNumLightPoints() const
Definition LightPointNode:49
osg::BoundingBox _bbox
Definition LightPointNode:98
bool _pointSprites
Definition LightPointNode:108
LightPoint & getLightPoint(unsigned int pos)
Definition LightPointNode:57
osg::ref_ptr< osgSim::LightPointSystem > _lightSystem
Definition LightPointNode:106
LightPointList & getLightPointList()
Definition LightPointNode:64
~LightPointNode()
Definition LightPointNode:94
void setMaxVisibleDistance2(float maxVisibleDistance2)
Definition LightPointNode:77
void setLightPointList(const LightPointList &lpl)
Definition LightPointNode:62
META_Node(osgSim, LightPointNode)
virtual void traverse(osg::NodeVisitor &nv)
void setLightPointSystem(osgSim::LightPointSystem *lps)
Definition LightPointNode:81
void setPointSprite(bool enable=true)
Definition LightPointNode:86
Definition LightPointSystem:30
Definition LightPoint:29
Definition BoundingBox:34
Definition BoundingSphere:35
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Definition NodeVisitor:82
Definition Node:72
Definition ref_ptr:32
Definition BlinkSequence:27
#define OSGSIM_EXPORT
Definition osgSim/Export:38