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#pragma once
25
26//Coin includes
27#include <Inventor/manips/SoTransformerManip.h>
28#include <Inventor/nodes/SoMaterial.h>
29#include <Inventor/nodes/SoSeparator.h>
30
31//VirtualRobot
32#include <VirtualRobot/Robot.h>
33#include <VirtualRobot/Visualization/CoinVisualization/CoinVisualization.h>
34
35//Boost includes
36#include <boost/smart_ptr/intrusive_ptr.hpp>
37
38
39//Let boost use referencing of Inventor to manage objects memory
40//and not its own shared pointer referencing
41using SoTransformerManipPtr = boost::intrusive_ptr<SoTransformerManip>;
42
43inline void
44intrusive_ptr_add_ref(SoTransformerManip* obj)
45{
46 obj->ref();
47}
48
49inline void
50intrusive_ptr_release(SoTransformerManip* obj)
51{
52 obj->unref();
53}
54
55class ManipulatorVisualization : SoSeparator
56{
57public:
60
61 void setVisualization(VirtualRobot::RobotPtr robot, VirtualRobot::RobotNodeSetPtr nodeSet);
63
64 void setColor(float r, float g, float b);
65
66 void addManipFinishCallback(SoDraggerCB* func, void* data);
67 void addManipMovedCallback(SoDraggerCB* func, void* data);
68
69 Eigen::Matrix4f getUserDesiredPose();
70 std::string getUserDesiredPoseString();
71 void setUserDesiredPose(Eigen::Matrix4f globalPose);
72
73 bool
75 {
76 return isVisualizing;
77 }
78
79private:
81 SoMaterial* material;
82 bool isVisualizing;
83 bool hasEndEffectorVisualizer;
84 Eigen::Matrix4f localTransformation;
85};
uint8_t data[1]
void intrusive_ptr_release(SoTransformerManip *obj)
void intrusive_ptr_add_ref(SoTransformerManip *obj)
boost::intrusive_ptr< SoTransformerManip > SoTransformerManipPtr
void addManipFinishCallback(SoDraggerCB *func, void *data)
void addManipMovedCallback(SoDraggerCB *func, void *data)
void setUserDesiredPose(Eigen::Matrix4f globalPose)
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