All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ContactVisual.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2012 Nate Koenig
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 /* Desc: Camera Visualization Class
18  * Author: Nate Koenig
19  */
20 
21 #ifndef _CONTACTVISUAL_HH_
22 #define _CONTACTVISUAL_HH_
23 
24 #include <string>
25 #include <vector>
26 
28 #include "gazebo/msgs/msgs.hh"
30 
31 namespace Ogre
32 {
33  class Entity;
34  class SceneNode;
35 }
36 
37 namespace gazebo
38 {
39  namespace rendering
40  {
43 
44  class DynamicLines;
45 
51  class ContactVisual : public Visual
52  {
58  public: ContactVisual(const std::string &_name, VisualPtr _vis,
59  const std::string &_topicName);
60 
62  public: virtual ~ContactVisual();
63 
65  private: void Update();
66 
69  private: void OnContact(ConstContactsPtr &_msg);
70 
73  private: void SetupInstancedMaterialToEntity(Ogre::Entity *_ent);
74 
76  private: transport::NodePtr node;
77 
79  private: transport::SubscriberPtr contactsSub;
80 
82  private: boost::shared_ptr<msgs::Contacts const> contactsMsg;
83 
85  private: std::vector<event::ConnectionPtr> connections;
86 
88  private: class ContactPoint
89  {
91  public: Ogre::SceneNode *sceneNode;
93  public: DynamicLines *normal, *depth;
94  };
95 
97  private: std::vector<ContactVisual::ContactPoint*> points;
98  };
100  }
101 }
102 #endif