Ignition Rendering

API Reference

4.1.0
Ogre2DynamicRenderable.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 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 IGNITION_RENDERING_OGRE2_OGRE2DYNAMICRENDERABLE_HH_
18 #define IGNITION_RENDERING_OGRE2_OGRE2DYNAMICRENDERABLE_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include "ignition/rendering/ogre2/Export.hh"
28 
29 namespace ignition
30 {
31  namespace rendering
32  {
33  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
34  //
35  // forward declarations
36  class Ogre2DynamicRenderablePrivate;
37 
38  /* \class Ogre2DynamicRenderable Ogre2DynamicRenderable.hh \
39  * ignition/rendering/ogre2/Ogre2DynamicRenderable.hh
40  */
43  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2DynamicRenderable
44  {
47  public: explicit Ogre2DynamicRenderable(ScenePtr _scene);
48 
50  public: virtual ~Ogre2DynamicRenderable();
51 
54  public: void SetOperationType(MarkerType _opType);
55 
58  public: MarkerType OperationType() const;
59 
61  public: void Update();
62 
64  public: Ogre::MovableObject *OgreObject() const;
65 
69  public: void AddPoint(const ignition::math::Vector3d &_pt,
71 
77  public: void AddPoint(const double _x, const double _y, const double _z,
79 
83  public: void SetPoint(unsigned int _index,
84  const ignition::math::Vector3d &_value);
85 
89  public: void SetColor(unsigned int _index,
90  const ignition::math::Color &_color);
91 
98  public: ignition::math::Vector3d Point(unsigned int _index) const;
99 
102  public: unsigned int PointCount() const;
103 
105  public: void Clear();
106 
108  public: void Destroy();
109 
113  public: void SetMaterial(MaterialPtr _material, bool _unique = true);
114 
116  private: void CreateDynamicMesh();
117 
119  private: void UpdateBuffer();
120 
125  private: void GenerateNormals(Ogre::OperationType _opType,
126  const std::vector<math::Vector3d> &_vertices, float *_vbuffer);
127 
129  private: void DestroyBuffer();
130 
133  };
134  }
135  }
136 }
137 #endif
MarkerType
Enum for marker types.
Definition: Marker.hh:35
Definition: OgreObject.hh:30
static const Color White
STL class.
Dynamic renderable class that manages hardware buffers for a dynamic geometry.
Definition: Ogre2DynamicRenderable.hh:43