ManipulatorVisualization.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package
19 * @author
20 * @date
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24#ifndef ManipulatorVisualization_H
25#define ManipulatorVisualization_H
26
27//Coin includes
28#include <Inventor/manips/SoTransformerManip.h>
29#include <Inventor/nodes/SoMaterial.h>
30#include <Inventor/nodes/SoSeparator.h>
31
32//VirtualRobot
33#include <VirtualRobot/Robot.h>
34#include <VirtualRobot/Visualization/CoinVisualization/CoinVisualization.h>
35
36//Boost includes
37#include <boost/smart_ptr/intrusive_ptr.hpp>
38
39
40//Let boost use referencing of Inventor to manage objects memory
41//and not its own shared pointer referencing
42using SoTransformerManipPtr = boost::intrusive_ptr<SoTransformerManip>;
43
44inline void
45intrusive_ptr_add_ref(SoTransformerManip* obj)
46{
47 obj->ref();
48}
49
50inline void
51intrusive_ptr_release(SoTransformerManip* obj)
52{
53 obj->unref();
54}
55
57
58class ManipulatorVisualization : SoSeparator
59{
60public:
63
64 void setVisualization(VirtualRobot::RobotPtr robot, VirtualRobot::RobotNodeSetPtr nodeSet);
66
67 void setColor(float r, float g, float b);
68
69 void addManipFinishCallback(SoDraggerCB* func, void* data);
70 void addManipMovedCallback(SoDraggerCB* func, void* data);
71
72 Eigen::Matrix4f getUserDesiredPose();
74
75 bool
77 {
78 return isVisualizing;
79 }
80
81private:
83 SoMaterial* material;
84 bool isVisualizing;
85 bool hasEndEffectorVisualizer;
86 Eigen::Matrix4f localTransformation;
87};
88
89#endif
uint8_t data[1]
void intrusive_ptr_release(SoTransformerManip *obj)
void intrusive_ptr_add_ref(SoTransformerManip *obj)
boost::intrusive_ptr< SoTransformerManip > SoTransformerManipPtr
boost::shared_ptr< VirtualRobot::CoinVisualization > CoinVisualizationPtr
void addManipFinishCallback(SoDraggerCB *func, void *data)
void addManipMovedCallback(SoDraggerCB *func, void *data)
Eigen::Matrix4f getUserDesiredPose()
std::string getUserDesiredPoseString()
void setVisualization(VirtualRobot::RobotPtr robot, VirtualRobot::RobotNodeSetPtr nodeSet)
void setColor(float r, float g, float b)
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19