Ignition Rendering

API Reference

5.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"
27 
28 #ifdef _MSC_VER
29  #pragma warning(push, 0)
30 #endif
31 #include <OgreHlmsPso.h>
32 #ifdef _MSC_VER
33  #pragma warning(pop)
34 #endif
35 
36 namespace Ogre
37 {
38  class MovableObject;
39 }
40 
41 namespace ignition
42 {
43  namespace rendering
44  {
45  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
46  //
47  // forward declarations
48  class Ogre2DynamicRenderablePrivate;
49 
50  /* \class Ogre2DynamicRenderable Ogre2DynamicRenderable.hh \
51  * ignition/rendering/ogre2/Ogre2DynamicRenderable.hh
52  */
55  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2DynamicRenderable
56  {
59  public: explicit Ogre2DynamicRenderable(ScenePtr _scene);
60 
62  public: virtual ~Ogre2DynamicRenderable();
63 
66  public: void SetOperationType(MarkerType _opType);
67 
70  public: MarkerType OperationType() const;
71 
73  public: void Update();
74 
76  public: Ogre::MovableObject *OgreObject() const;
77 
81  public: void AddPoint(const ignition::math::Vector3d &_pt,
83 
89  public: void AddPoint(const double _x, const double _y, const double _z,
91 
95  public: void SetPoint(unsigned int _index,
96  const ignition::math::Vector3d &_value);
97 
101  public: void SetColor(unsigned int _index,
102  const ignition::math::Color &_color);
103 
110  public: ignition::math::Vector3d Point(unsigned int _index) const;
111 
114  public: unsigned int PointCount() const;
115 
117  public: void Clear();
118 
120  public: void Destroy();
121 
125  public: void SetMaterial(MaterialPtr _material, bool _unique = true);
126 
128  private: void CreateDynamicMesh();
129 
131  private: void UpdateBuffer();
132 
137  private: void GenerateNormals(Ogre::OperationType _opType,
138  const std::vector<math::Vector3d> &_vertices, float *_vbuffer);
139 
141  private: void DestroyBuffer();
142 
145  };
146  }
147  }
148 }
149 #endif
MarkerType
Enum for marker types.
Definition: Marker.hh:35
Definition: OgreObject.hh:32
static const Color White
STL class.
Definition: OgreCamera.hh:27
Dynamic renderable class that manages hardware buffers for a dynamic geometry.
Definition: Ogre2DynamicRenderable.hh:55