DynamicRenderable.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2012 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16*/
17#ifndef _DYNAMICRENDERABLE_HH_
18#define _DYNAMICRENDERABLE_HH_
19
20#include <string>
23#include "gazebo/util/system.hh"
24
25namespace gazebo
26{
27 namespace rendering
28 {
31
35 class GZ_RENDERING_VISIBLE DynamicRenderable : public Ogre::SimpleRenderable
36 {
39
41 public: virtual ~DynamicRenderable();
42
50 public: void Init(RenderOpType _opType, bool _useIndices = false);
51
54 public: void SetOperationType(RenderOpType _opType);
55
59
62 public: virtual Ogre::Real getBoundingRadius() const;
63
68 public: virtual Ogre::Real getSquaredViewDepth(
69 const Ogre::Camera *_cam) const;
70
73 public: std::string GetMovableType() const;
74
78 protected: virtual void CreateVertexDeclaration() = 0;
79
93 protected: void PrepareHardwareBuffers(size_t _vertexCount,
94 size_t _indexCount);
95
102 protected: virtual void FillHardwareBuffers() = 0;
103
105 protected: size_t vertexBufferCapacity;
106
108 protected: size_t indexBufferCapacity;
109 };
111 }
112}
113#endif
rendering
Definition RenderEngine.hh:31
Abstract base class providing mechanisms for dynamically growing hardware buffers.
Definition DynamicRenderable.hh:36
virtual Ogre::Real getSquaredViewDepth(const Ogre::Camera *_cam) const
Implementation of Ogre::SimpleRenderable.
virtual ~DynamicRenderable()
Virtual destructor.
size_t indexBufferCapacity
Maximum capacity of the currently allocated index buffer.
Definition DynamicRenderable.hh:108
std::string GetMovableType() const
Get type of movable.
void SetOperationType(RenderOpType _opType)
Set the render operation type.
virtual void CreateVertexDeclaration()=0
Creates the vertex declaration.
RenderOpType GetOperationType() const
Get the render operation type.
virtual void FillHardwareBuffers()=0
Fills the hardware vertex and index buffers with data.
void Init(RenderOpType _opType, bool _useIndices=false)
Initializes the dynamic renderable.
virtual Ogre::Real getBoundingRadius() const
Implementation of Ogre::SimpleRenderable.
size_t vertexBufferCapacity
Maximum capacity of the currently allocated vertex buffer.
Definition DynamicRenderable.hh:105
void PrepareHardwareBuffers(size_t _vertexCount, size_t _indexCount)
Prepares the hardware buffers for the requested vertex and index counts.
RenderOpType
Type of render operation for a drawable.
Definition RenderTypes.hh:217
Forward declarations for the common classes.
Definition Animation.hh:27