00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PointCloud_H
00020 #define PointCloud_H
00021
00022 #include <iostream>
00023 #include <osg/PositionAttitudeTransform>
00024 #include <osg/Geode>
00025 #include <osg/ShapeDrawable>
00026 #include <osg/Geometry>
00027 #include <osg/PointSprite>
00028 #include <osg/Point>
00029 #include <osg/StateAttribute>
00030 #include <osg/BlendFunc>
00031 #include <osg/Texture2D>
00032 #include <osgDB/ReadFile>
00033
00034 namespace uvsim
00035 {
00036
00037 class PointCloudCallback : public osg::NodeCallback
00038 {
00039 public:
00040 virtual void operator()(osg::Node *node, osg::NodeVisitor *nv);
00041 };
00042
00043 class PointCloud : public osg::Referenced
00044 {
00045 public:
00046 PointCloud();
00047 PointCloud(int pointSize, osg::Vec3Array * points, osg::Vec4Array * colors);
00048 virtual ~PointCloud();
00049 void updateSize();
00050 osg::ref_ptr<osg::PositionAttitudeTransform> root;
00051 protected:
00052 osg::ref_ptr<osg::Geode> geode;
00053 osg::ref_ptr<osg::Geometry> geom;
00054 osg::ref_ptr<osg::DrawArrays> drawArrays;
00055 osg::Vec3Array * points;
00056 osg::Vec4Array * colors;
00057 osg::StateSet* makeStateSet(float size);
00058 };
00059
00060 }
00061
00062 #endif
00063
00064