VisualPrivate.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 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 
18 #ifndef _VISUAL_PRIVATE_HH_
19 #define _VISUAL_PRIVATE_HH_
20 
21 #include <string>
22 #include <utility>
23 #include <list>
24 #include <vector>
25 
26 #include <boost/function.hpp>
27 #include <sdf/sdf.hh>
28 
29 #include "gazebo/msgs/msgs.hh"
30 #include "gazebo/common/Event.hh"
31 #include "gazebo/math/Box.hh"
32 #include "gazebo/math/Pose.hh"
34 #include "gazebo/math/Vector3.hh"
35 #include "gazebo/math/Vector2d.hh"
36 
40 
41 namespace Ogre
42 {
43  class MovableObject;
44  class SceneNode;
45  class StaticGeometry;
46  class RibbonTrail;
47  class AnimationState;
48  class SkeletonInstance;
49 }
50 
51 namespace gazebo
52 {
53  namespace rendering
54  {
55  class WireBox;
56 
59  {
61  public: VisualPrivate()
62  : sceneNode(NULL),
63  transparency(0),
64  castShadows(true),
65  isStatic(false),
67  visible(true),
69  skeleton(NULL),
70  animState(NULL),
71  useRTShader(true),
72  initialized(false),
74  id(0),
75  lighting(true),
77  type(Visual::VT_ENTITY),
78  layer(0),
79  geomSize(ignition::math::Vector3d::One),
80  inheritTransparency(true),
81  wireframe(false)
82  {
83  }
84 
86  public: virtual ~VisualPrivate() = default;
87 
89  public: ScenePtr scene;
90 
92  public: Ogre::SceneNode *sceneNode;
93 
95  public: VisualPtr parent;
96 
98  public: sdf::ElementPtr sdf;
99 
101  public: std::string myMaterialName;
102 
104  public: std::string origMaterialName;
105 
107  public: float transparency;
108 
110  public: bool castShadows;
111 
114  public: bool isStatic;
115 
117  public: Ogre::StaticGeometry *staticGeom;
118 
120  public: bool visible;
121 
123  public: Ogre::RibbonTrail *ribbonTrail;
124 
126  public: Ogre::SkeletonInstance *skeleton;
127 
130 
132  public: std::list<DynamicLines*> lines;
133 
135  public: std::list< std::pair<DynamicLines*, unsigned int> > lineVertices;
136 
138  public: std::string name;
139 
141  public: std::vector<VisualPtr> children;
142 
144  public: Ogre::AnimationState *animState;
145 
148 
150  public: boost::function<void()> onAnimationComplete;
151 
153  public: bool useRTShader;
154 
156  public: bool initialized;
157 
160 
162  public: uint32_t id;
163 
165  public: static uint32_t visualIdCount;
166 
168  public: ignition::math::Vector3d scale;
169 
171  public: bool lighting;
172 
174  public: std::vector<VisualPluginPtr> plugins;
175 
177  public: std::string meshName;
178 
180  public: std::string subMeshName;
181 
184 
187 
190 
193 
195  public: uint32_t visibilityFlags;
196 
199 
202  public: int32_t layer;
203 
205  public: ignition::math::Vector3d geomSize;
206 
208  public: bool inheritTransparency;
209 
211  public: bool wireframe;
212  };
214  }
215 }
216 #endif
bool inheritTransparency
True to inherit transparency from parent.
Definition: VisualPrivate.hh:208
bool visible
True if rendered.
Definition: VisualPrivate.hh:120
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:153
Ogre::StaticGeometry * staticGeom
Pointer to the static geometry.
Definition: VisualPrivate.hh:117
ScenePtr scene
Pointer to the visual's scene.
Definition: VisualPrivate.hh:89
Private data for the Visual class.
Definition: VisualPrivate.hh:58
bool castShadows
True if visual casts shadows.
Definition: VisualPrivate.hh:110
bool wireframe
True if wireframe mode is enabled.
Definition: VisualPrivate.hh:211
Ogre::SkeletonInstance * skeleton
The visual's skeleton, used only for person simulation.
Definition: VisualPrivate.hh:126
bool lighting
True if lighting will be applied to this visual.
Definition: VisualPrivate.hh:171
std::vector< VisualPtr > children
Children visuals.
Definition: VisualPrivate.hh:141
ignition::math::Vector3d scale
Scale of visual.
Definition: VisualPrivate.hh:168
std::string name
Name of the visual.
Definition: VisualPrivate.hh:138
Ogre::AnimationState * animState
Used to animate the visual.
Definition: VisualPrivate.hh:144
std::vector< VisualPluginPtr > plugins
A list of visual plugins.
Definition: VisualPrivate.hh:174
Ogre::RibbonTrail * ribbonTrail
The ribbon train created by the visual.
Definition: VisualPrivate.hh:123
Visual::VisualType type
type
Definition: VisualPrivate.hh:198
common::Color specular
Specular color of the visual.
Definition: VisualPrivate.hh:189
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:112
float transparency
Transparency value.
Definition: VisualPrivate.hh:107
VisualType
Type of visual.
Definition: Visual.hh:63
uint32_t visibilityFlags
Visibility flags of the visual.
Definition: VisualPrivate.hh:195
static uint32_t visualIdCount
Counter used to create unique ids.
Definition: VisualPrivate.hh:165
A renderable object.
Definition: Visual.hh:59
event::ConnectionPtr preRenderConnection
Connection for the pre render event.
Definition: VisualPrivate.hh:129
VisualPtr parent
Parent visual.
Definition: VisualPrivate.hh:95
std::list< DynamicLines * > lines
List of all the lines created.
Definition: VisualPrivate.hh:132
std::string myMaterialName
The unique name for the visual's material.
Definition: VisualPrivate.hh:101
std::string origMaterialName
The original name for the visual's material.
Definition: VisualPrivate.hh:104
WireBox * boundingBox
A wire frame bounding box.
Definition: VisualPrivate.hh:159
bool useRTShader
True to use RT shader system.
Definition: VisualPrivate.hh:153
std::string meshName
The visual's mesh name.
Definition: VisualPrivate.hh:177
ignition::math::Vector3d geomSize
Size of attached geometry.
Definition: VisualPrivate.hh:205
common::Color ambient
Ambient color of the visual.
Definition: VisualPrivate.hh:183
#define GZ_VISIBILITY_ALL
Render everything visibility mask.
Definition: RenderTypes.hh:26
sdf::ElementPtr sdf
The SDF element for the visual.
Definition: VisualPrivate.hh:98
boost::function< void()> onAnimationComplete
Callback for the animation complete event.
Definition: VisualPrivate.hh:150
#define NULL
Definition: CommonTypes.hh:31
Defines a color.
Definition: Color.hh:36
Ogre::SceneNode * sceneNode
Pointer to the visual's scene node in Ogre.
Definition: VisualPrivate.hh:92
VisualPrivate()
Constructor.
Definition: VisualPrivate.hh:61
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:80
std::string subMeshName
The visual's submesh name.
Definition: VisualPrivate.hh:180
bool isStatic
True if the visual is static, which allows Ogre to improve performance.
Definition: VisualPrivate.hh:114
int32_t layer
Index of the layer to which this visual belongs.
Definition: VisualPrivate.hh:202
Draws a wireframe box.
Definition: WireBox.hh:36
virtual ~VisualPrivate()=default
Default destructor.
common::Time prevAnimTime
Time of the previous animation step.
Definition: VisualPrivate.hh:147
common::Color emissive
Emissive color of the visual.
Definition: VisualPrivate.hh:192
common::Color diffuse
Diffuse color of the visual.
Definition: VisualPrivate.hh:186
std::list< std::pair< DynamicLines *, unsigned int > > lineVertices
Lines and their vertices connected to this visual.
Definition: VisualPrivate.hh:135
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:44
bool initialized
True if initialized.
Definition: VisualPrivate.hh:156
uint32_t id
Unique id of this visual.
Definition: VisualPrivate.hh:162