| Line |
Branch |
Exec |
Source |
| 1 |
|
|
// |
| 2 |
|
|
// Copyright (c) CNRS |
| 3 |
|
|
// Author: Joseph Mirabel |
| 4 |
|
|
// |
| 5 |
|
|
|
| 6 |
|
|
#ifndef HPP_GUI_ROADMAP_HH |
| 7 |
|
|
#define HPP_GUI_ROADMAP_HH |
| 8 |
|
|
|
| 9 |
|
|
#include <gepetto/gui/color-map.hh> |
| 10 |
|
|
#include <gepetto/gui/windows-manager.hh> |
| 11 |
|
|
#include <hpp/common-idl.hh> |
| 12 |
|
|
#include <hppwidgetsplugin/hppwidgetsplugin.hh> |
| 13 |
|
|
|
| 14 |
|
|
namespace hpp { |
| 15 |
|
|
namespace gui { |
| 16 |
|
|
class Roadmap { |
| 17 |
|
|
public: |
| 18 |
|
|
typedef unsigned int NodeID; |
| 19 |
|
|
typedef unsigned int EdgeID; |
| 20 |
|
|
typedef gepetto::viewer::Configuration Frame; |
| 21 |
|
|
typedef osgVector3 Position; |
| 22 |
|
|
typedef gepetto::viewer::WindowsManager::Color_t Color; |
| 23 |
|
|
|
| 24 |
|
|
float radius, axisSize; |
| 25 |
|
|
|
| 26 |
|
|
Roadmap(HppWidgetsPlugin* plugin_); |
| 27 |
|
|
|
| 28 |
|
✗ |
virtual ~Roadmap() {} |
| 29 |
|
|
|
| 30 |
|
|
virtual void initRoadmapFromJoint(const std::string& jointName); |
| 31 |
|
|
|
| 32 |
|
|
virtual void initRoadmapFromBody(const std::string& bodyName); |
| 33 |
|
|
|
| 34 |
|
|
/// You can call this function several times. It will continue displaying the |
| 35 |
|
|
/// roadmap where it stopped. |
| 36 |
|
|
void displayRoadmap(); |
| 37 |
|
|
|
| 38 |
|
|
/// This function is called before anything else. |
| 39 |
|
|
/// You should save the current configuration in this function |
| 40 |
|
|
virtual void beforeDisplay(); |
| 41 |
|
|
|
| 42 |
|
|
/// This function is called after each display. |
| 43 |
|
|
/// You should restore the configuration you saved in the function |
| 44 |
|
|
virtual void afterDisplay(); |
| 45 |
|
|
|
| 46 |
|
|
virtual std::size_t numberNodes(); |
| 47 |
|
|
|
| 48 |
|
|
virtual std::size_t numberEdges(); |
| 49 |
|
|
|
| 50 |
|
|
virtual std::string roadmapName(); |
| 51 |
|
|
|
| 52 |
|
|
virtual std::string nodeName(NodeID nodeId); |
| 53 |
|
|
|
| 54 |
|
|
virtual std::string edgeName(EdgeID edgeId); |
| 55 |
|
|
|
| 56 |
|
|
virtual void nodePosition(NodeID nodeId, Frame& frame); |
| 57 |
|
|
|
| 58 |
|
|
virtual void edgePositions(EdgeID edgeId, Position& start, Position& end); |
| 59 |
|
|
|
| 60 |
|
|
virtual void nodeColor(NodeID nodeId, Color& color); |
| 61 |
|
|
|
| 62 |
|
|
virtual void edgeColor(EdgeID edgeId, Color& color); |
| 63 |
|
|
|
| 64 |
|
|
protected: |
| 65 |
|
|
NodeID currentNodeId_, currentEdgeId_; |
| 66 |
|
|
gepetto::gui::ColorMap nodeColorMap_, edgeColorMap_; |
| 67 |
|
|
|
| 68 |
|
|
private: |
| 69 |
|
|
void initRoadmap(); |
| 70 |
|
|
inline void getPosition(const hpp::floatSeq& q, Frame& t) const; |
| 71 |
|
|
|
| 72 |
|
|
HppWidgetsPlugin* plugin_; |
| 73 |
|
|
std::string name_; |
| 74 |
|
|
bool link_; |
| 75 |
|
|
}; |
| 76 |
|
|
} // namespace gui |
| 77 |
|
|
} // namespace hpp |
| 78 |
|
|
|
| 79 |
|
|
#endif // HPP_GUI_ROADMAP_HH |
| 80 |
|
|
|