30 #ifndef OGRE_TOOLS_OGRE_POINT_CLOUD_H 31 #define OGRE_TOOLS_OGRE_POINT_CLOUD_H 33 #include <OgreSimpleRenderable.h> 34 #include <OgreMovableObject.h> 35 #include <OgreString.h> 36 #include <OgreAxisAlignedBox.h> 37 #include <OgreVector3.h> 38 #include <OgreMaterial.h> 39 #include <OgreColourValue.h> 41 #include <OgreHardwareBufferManager.h> 42 #include <OgreSharedPtr.h> 48 #include <boost/shared_ptr.hpp> 75 Ogre::HardwareVertexBufferSharedPtr getBuffer();
77 Ogre::Real getBoundingRadius()
const override;
78 Ogre::Real getSquaredViewDepth(
const Ogre::Camera* cam)
const override;
79 void _notifyCurrentCamera(Ogre::Camera* camera)
override;
84 void getWorldTransforms(Ogre::Matrix4* xform)
const override;
85 const Ogre::LightList& getLights()
const override;
134 inline void setColor(
float r,
float g,
float b,
float a = 1.0)
136 color = Ogre::ColourValue(r, g, b, a);
149 void addPoints(
Point* points, uint32_t num_points);
155 void popPoints(uint32_t num_points);
168 void setDimensions(
float width,
float height,
float depth);
174 void setAutoSize(
bool auto_size);
177 void setCommonDirection(
const Ogre::Vector3& vec);
179 void setCommonUpVector(
const Ogre::Vector3& vec);
185 void setAlpha(
float alpha,
bool per_point_alpha =
false);
187 void setPickColor(
const Ogre::ColourValue& color);
188 void setColorByIndex(
bool set);
190 void setHighlightColor(
float r,
float g,
float b);
196 const Ogre::AxisAlignedBox& getBoundingBox()
const override;
197 float getBoundingRadius()
const override;
198 virtual void getWorldTransforms(Ogre::Matrix4* xform)
const;
203 void _updateRenderQueue(Ogre::RenderQueue* queue)
override;
204 void _notifyCurrentCamera(Ogre::Camera* camera)
override;
205 void _notifyAttached(Ogre::Node* parent,
bool isTagPoint =
false)
override;
206 #if (OGRE_VERSION_MAJOR >= 1 && OGRE_VERSION_MINOR >= 6) 207 void visitRenderables(Ogre::Renderable::Visitor* visitor,
bool debugRenderables)
override;
216 uint32_t getVerticesPerPoint();
217 PointCloudRenderablePtr createRenderable(
int num_points);
218 void regenerateAll();
219 void shrinkRenderables();
virtual void setName(const std::string &name)
Ogre::MaterialPtr current_material_
Ogre::MaterialPtr sphere_material_
std::vector< Point > V_Point
Ogre::MaterialPtr material_
uint32_t point_count_
The number of points currently in points_.
const Ogre::String & getMovableType() const override
Ogre::AxisAlignedBox bounding_box_
The bounding box of this point cloud.
Ogre::MaterialPtr flat_square_material_
boost::shared_ptr< PointCloudRenderable > PointCloudRenderablePtr
V_Point points_
The list of points we're displaying. Allocates to a high-water-mark.
Ogre::MaterialPtr square_material_
Ogre::Vector3 common_direction_
See Ogre::BillboardSet::setCommonDirection.
bool current_mode_supports_geometry_shader_
Ogre::MaterialPtr tile_material_
Representation of a point, with x/y/z position and r/g/b color.
Ogre::RenderOperation * getRenderOperation()
std::vector< PointCloudRenderablePtr > V_PointCloudRenderable
Ogre::MaterialPtr box_material_
unsigned short getNumWorldTransforms() const override
float bounding_radius_
The bounding radius of this point cloud.
Ogre::ColourValue pick_color_
virtual unsigned short getNumWorldTransforms() const
A visual representation of a set of points.
V_PointCloudRenderable renderables_
Ogre::MaterialPtr point_material_
Ogre::Vector3 common_up_vector_
See Ogre::BillboardSet::setCommonUpVector.
static Ogre::String sm_Type
The "renderable type" used by Ogre.
void setColor(float r, float g, float b, float a=1.0)