LightPointNode
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGSIM_LIGHTPOINTNODE
#define OSGSIM_LIGHTPOINTNODE 1
#include <osgSim/Export>
#include <osgSim/LightPoint>
#include <osgSim/LightPointSystem>
#include <osg/Node>
#include <osg/NodeVisitor>
#include <osg/BoundingBox>
#include <osg/Quat>
#include <osg/Vec4>
#include <vector>
#include <set>
namespace osgSim {
class OSGSIM_EXPORT LightPointNode : public osg::Node
{
public :
typedef std::vector< LightPoint > LightPointList;
LightPointNode();
LightPointNode(const LightPointNode&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Node(osgSim,LightPointNode);
virtual void traverse(osg::NodeVisitor& nv);
unsigned int getNumLightPoints() const { return _lightPointList.size(); }
unsigned int addLightPoint(const LightPoint& lp);
void removeLightPoint(unsigned int pos);
LightPoint& getLightPoint(unsigned int pos) { return _lightPointList[pos]; }
const LightPoint& getLightPoint(unsigned int pos) const { return _lightPointList[pos]; }
void setLightPointList(const LightPointList& lpl) { _lightPointList=lpl; }
LightPointList& getLightPointList() { return _lightPointList; }
const LightPointList& getLightPointList() const { return _lightPointList; }
void setMinPixelSize(float minPixelSize) { _minPixelSize = minPixelSize; }
float getMinPixelSize() const { return _minPixelSize; }
void setMaxPixelSize(float maxPixelSize) { _maxPixelSize = maxPixelSize; }
float getMaxPixelSize() const { return _maxPixelSize; }
void setMaxVisibleDistance2(float maxVisibleDistance2) { _maxVisibleDistance2 = maxVisibleDistance2; }
float getMaxVisibleDistance2() const { return _maxVisibleDistance2; }
void setLightPointSystem( osgSim::LightPointSystem* lps) { _lightSystem = lps; }
osgSim::LightPointSystem* getLightPointSystem() { return _lightSystem.get(); }
const osgSim::LightPointSystem* getLightPointSystem() const { return _lightSystem.get(); }
void setPointSprite(bool enable=true) { _pointSprites = enable; }
bool getPointSprite() const { return _pointSprites; }
virtual osg::BoundingSphere computeBound() const;
protected:
~LightPointNode() {}
// used to cache the bounding box of the lightpoints as a tighter
// view frustum check.
mutable osg::BoundingBox _bbox;
LightPointList _lightPointList;
float _minPixelSize;
float _maxPixelSize;
float _maxVisibleDistance2;
osg::ref_ptr<osgSim::LightPointSystem> _lightSystem;
bool _pointSprites;
};
}
#endif
BoundingBox
LightPointSystem
LightPoint
NodeVisitor
Node
Quat
Vec4
osgSim::LightPointNode::addLightPoint
unsigned int addLightPoint(const LightPoint &lp)
osgSim::LightPointNode::removeLightPoint
void removeLightPoint(unsigned int pos)
osgSim::LightPointNode::getLightPoint
const LightPoint & getLightPoint(unsigned int pos) const
Definition LightPointNode:59
osgSim::LightPointNode::getLightPointList
const LightPointList & getLightPointList() const
Definition LightPointNode:66
osgSim::LightPointNode::getMinPixelSize
float getMinPixelSize() const
Definition LightPointNode:71
osgSim::LightPointNode::LightPointList
std::vector< LightPoint > LightPointList
Definition LightPointNode:37
osgSim::LightPointNode::setMinPixelSize
void setMinPixelSize(float minPixelSize)
Definition LightPointNode:69
osgSim::LightPointNode::_maxPixelSize
float _maxPixelSize
Definition LightPointNode:103
osgSim::LightPointNode::getMaxVisibleDistance2
float getMaxVisibleDistance2() const
Definition LightPointNode:79
osgSim::LightPointNode::_lightPointList
LightPointList _lightPointList
Definition LightPointNode:100
osgSim::LightPointNode::getPointSprite
bool getPointSprite() const
Definition LightPointNode:88
osgSim::LightPointNode::setMaxPixelSize
void setMaxPixelSize(float maxPixelSize)
Definition LightPointNode:73
osgSim::LightPointNode::_maxVisibleDistance2
float _maxVisibleDistance2
Definition LightPointNode:104
osgSim::LightPointNode::_minPixelSize
float _minPixelSize
Definition LightPointNode:102
osgSim::LightPointNode::computeBound
virtual osg::BoundingSphere computeBound() const
osgSim::LightPointNode::getLightPointSystem
const osgSim::LightPointSystem * getLightPointSystem() const
Definition LightPointNode:84
osgSim::LightPointNode::getMaxPixelSize
float getMaxPixelSize() const
Definition LightPointNode:75
osgSim::LightPointNode::getLightPointSystem
osgSim::LightPointSystem * getLightPointSystem()
Definition LightPointNode:83
osgSim::LightPointNode::LightPointNode
LightPointNode(const LightPointNode &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgSim::LightPointNode::getNumLightPoints
unsigned int getNumLightPoints() const
Definition LightPointNode:49
osgSim::LightPointNode::_bbox
osg::BoundingBox _bbox
Definition LightPointNode:98
osgSim::LightPointNode::_pointSprites
bool _pointSprites
Definition LightPointNode:108
osgSim::LightPointNode::getLightPoint
LightPoint & getLightPoint(unsigned int pos)
Definition LightPointNode:57
osgSim::LightPointNode::_lightSystem
osg::ref_ptr< osgSim::LightPointSystem > _lightSystem
Definition LightPointNode:106
osgSim::LightPointNode::getLightPointList
LightPointList & getLightPointList()
Definition LightPointNode:64
osgSim::LightPointNode::LightPointNode
LightPointNode()
osgSim::LightPointNode::~LightPointNode
~LightPointNode()
Definition LightPointNode:94
osgSim::LightPointNode::setMaxVisibleDistance2
void setMaxVisibleDistance2(float maxVisibleDistance2)
Definition LightPointNode:77
osgSim::LightPointNode::setLightPointList
void setLightPointList(const LightPointList &lpl)
Definition LightPointNode:62
osgSim::LightPointNode::META_Node
META_Node(osgSim, LightPointNode)
osgSim::LightPointNode::traverse
virtual void traverse(osg::NodeVisitor &nv)
osgSim::LightPointNode::setLightPointSystem
void setLightPointSystem(osgSim::LightPointSystem *lps)
Definition LightPointNode:81
osgSim::LightPointNode::setPointSprite
void setPointSprite(bool enable=true)
Definition LightPointNode:86
osgSim::LightPointSystem
Definition LightPointSystem:30
osgSim::LightPoint
Definition LightPoint:29
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::NodeVisitor
Definition NodeVisitor:82
osg::Node
Definition Node:72
osg::ref_ptr
Definition ref_ptr:32
osgSim
Definition BlinkSequence:27
osg::BoundingBox
BoundingBoxd BoundingBox
Definition BoundingBox:257
osg::BoundingSphere
BoundingSphered BoundingSphere
Definition BoundingSphere:314
Export
OSGSIM_EXPORT
#define OSGSIM_EXPORT
Definition osgSim/Export:38