Gazebo Rendering

API Reference

3.7.2
gz/rendering/ogre2/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 GZ_RENDERING_OGRE2_OGRE2DYNAMICRENDERABLE_HH_
18 #define GZ_RENDERING_OGRE2_OGRE2DYNAMICRENDERABLE_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include "gz/rendering/ogre2/Export.hh"
27 #include "gz/rendering/Marker.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 gz::math::Vector3d &_pt,
70  const gz::math::Color &_color = gz::math::Color::White);
71 
77  public: void AddPoint(const double _x, const double _y, const double _z,
78  const gz::math::Color &_color = gz::math::Color::White);
79 
83  public: void SetPoint(unsigned int _index,
84  const gz::math::Vector3d &_value);
85 
89  public: void SetColor(unsigned int _index,
90  const gz::math::Color &_color);
91 
98  public: gz::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
STL class.
STL class.
Dynamic renderable class that manages hardware buffers for a dynamic geometry.
Definition: gz/rendering/ogre2/Ogre2DynamicRenderable.hh:43
Definition: gz/rendering/ogre/OgreObject.hh:32
MarkerType
Enum for marker types.
Definition: gz/rendering/Marker.hh:35