VisualPrivate.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 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 <sdf/sdf.hh>
27 
28 #include "gazebo/msgs/msgs.hh"
29 #include "gazebo/common/Event.hh"
30 #include "gazebo/math/Box.hh"
31 #include "gazebo/math/Pose.hh"
33 #include "gazebo/math/Vector3.hh"
34 #include "gazebo/math/Vector2d.hh"
35 
39 
40 namespace Ogre
41 {
42  class MovableObject;
43  class SceneNode;
44  class StaticGeometry;
45  class RibbonTrail;
46  class AnimationState;
47  class SkeletonInstance;
48 }
49 
50 namespace gazebo
51 {
52  namespace rendering
53  {
54  class WireBox;
55 
58  {
60  public: VisualPrivate()
61  : sceneNode(NULL),
62  transparency(0),
63  castShadows(true),
64  isStatic(false),
66  visible(true),
68  skeleton(NULL),
69  animState(NULL),
70  useRTShader(true),
71  initialized(false),
73  id(0),
74  lighting(true),
76  type(Visual::VT_ENTITY),
77  layer(0)
78  {
79  }
80 
82  public: virtual ~VisualPrivate() = default;
83 
85  public: ScenePtr scene;
86 
88  public: Ogre::SceneNode *sceneNode;
89 
91  public: VisualPtr parent;
92 
94  public: sdf::ElementPtr sdf;
95 
97  public: std::string myMaterialName;
98 
100  public: std::string origMaterialName;
101 
103  public: float transparency;
104 
106  public: bool castShadows;
107 
110  public: bool isStatic;
111 
113  public: Ogre::StaticGeometry *staticGeom;
114 
116  public: bool visible;
117 
119  public: Ogre::RibbonTrail *ribbonTrail;
120 
122  public: Ogre::SkeletonInstance *skeleton;
123 
126 
128  public: std::list<DynamicLines*> lines;
129 
131  public: std::list< std::pair<DynamicLines*, unsigned int> > lineVertices;
132 
134  public: std::string name;
135 
137  public: std::vector<VisualPtr> children;
138 
140  public: Ogre::AnimationState *animState;
141 
144 
146  public: boost::function<void()> onAnimationComplete;
147 
149  public: bool useRTShader;
150 
152  public: bool initialized;
153 
156 
158  public: uint32_t id;
159 
161  public: static uint32_t visualIdCount;
162 
165 
167  public: bool lighting;
168 
170  public: std::vector<VisualPluginPtr> plugins;
171 
173  public: std::string meshName;
174 
176  public: std::string subMeshName;
177 
180 
183 
186 
189 
191  public: uint32_t visibilityFlags;
192 
195 
198  public: int32_t layer;
199  };
201  }
202 }
203 #endif
bool visible
True if rendered.
Definition: VisualPrivate.hh:116
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:147
Ogre::StaticGeometry * staticGeom
Pointer to the static geometry.
Definition: VisualPrivate.hh:113
ScenePtr scene
Pointer to the visual's scene.
Definition: VisualPrivate.hh:85
Private data for the Visual class.
Definition: VisualPrivate.hh:57
bool castShadows
True if visual casts shadows.
Definition: VisualPrivate.hh:106
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
Ogre::SkeletonInstance * skeleton
The visual's skeleton, used only for person simulation.
Definition: VisualPrivate.hh:122
bool lighting
True if lighting will be applied to this visual.
Definition: VisualPrivate.hh:167
std::vector< VisualPtr > children
Children visuals.
Definition: VisualPrivate.hh:137
std::string name
Name of the visual.
Definition: VisualPrivate.hh:134
math::Vector3 scale
Scale of visual.
Definition: VisualPrivate.hh:164
Ogre::AnimationState * animState
Used to animate the visual.
Definition: VisualPrivate.hh:140
std::vector< VisualPluginPtr > plugins
A list of visual plugins.
Definition: VisualPrivate.hh:170
Ogre::RibbonTrail * ribbonTrail
The ribbon train created by the visual.
Definition: VisualPrivate.hh:119
Visual::VisualType type
type
Definition: VisualPrivate.hh:194
common::Color specular
Specular color of the visual.
Definition: VisualPrivate.hh:185
float transparency
Transparency value.
Definition: VisualPrivate.hh:103
VisualType
Type of visual.
Definition: Visual.hh:62
uint32_t visibilityFlags
Visibility flags of the visual.
Definition: VisualPrivate.hh:191
static uint32_t visualIdCount
Counter used to create unique ids.
Definition: VisualPrivate.hh:161
A renderable object.
Definition: Visual.hh:58
event::ConnectionPtr preRenderConnection
Connection for the pre render event.
Definition: VisualPrivate.hh:125
VisualPtr parent
Parent visual.
Definition: VisualPrivate.hh:91
std::list< DynamicLines * > lines
List of all the lines created.
Definition: VisualPrivate.hh:128
std::string myMaterialName
The unique name for the visual's material.
Definition: VisualPrivate.hh:97
std::string origMaterialName
The original name for the visual's material.
Definition: VisualPrivate.hh:100
WireBox * boundingBox
A wire frame bounding box.
Definition: VisualPrivate.hh:155
bool useRTShader
True to use RT shader system.
Definition: VisualPrivate.hh:149
std::string meshName
The visual's mesh name.
Definition: VisualPrivate.hh:173
common::Color ambient
Ambient color of the visual.
Definition: VisualPrivate.hh:179
#define GZ_VISIBILITY_ALL
Render everything visibility mask.
Definition: RenderTypes.hh:26
sdf::ElementPtr sdf
The SDF element for the visual.
Definition: VisualPrivate.hh:94
boost::function< void()> onAnimationComplete
Callback for the animation complete event.
Definition: VisualPrivate.hh:146
#define NULL
Definition: CommonTypes.hh:30
Defines a color.
Definition: Color.hh:36
Ogre::SceneNode * sceneNode
Pointer to the visual's scene node in Ogre.
Definition: VisualPrivate.hh:88
VisualPrivate()
Constructor.
Definition: VisualPrivate.hh:60
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:79
std::string subMeshName
The visual's submesh name.
Definition: VisualPrivate.hh:176
boost::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:107
bool isStatic
True if the visual is static, which allows Ogre to improve performance.
Definition: VisualPrivate.hh:110
int32_t layer
Index of the layer to which this visual belongs.
Definition: VisualPrivate.hh:198
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:143
common::Color emissive
Emissive color of the visual.
Definition: VisualPrivate.hh:188
common::Color diffuse
Diffuse color of the visual.
Definition: VisualPrivate.hh:182
std::list< std::pair< DynamicLines *, unsigned int > > lineVertices
Lines and their vertices connected to this visual.
Definition: VisualPrivate.hh:131
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:39
bool initialized
True if initialized.
Definition: VisualPrivate.hh:152
uint32_t id
Unique id of this visual.
Definition: VisualPrivate.hh:158