gepetto-viewer 6.0.0
An user-friendly Graphical Interface
Loading...
Searching...
No Matches
node-rod.h
Go to the documentation of this file.
1//
2// node-rod.cpp
3// gepetto-viewer
4//
5// Created by Pierre Fernbach in may 2015.
6// Copyright (c) 2015 LAAS-CNRS. All rights reserved.
7//
8
9#ifndef ROD_HH
10#define ROD_HH
11
15
16#include <vector>
17
18namespace gepetto {
19namespace viewer {
20
22
23class NodeRod : public Node {
24 private:
25 std::vector<LeafNodeCapsulePtr_t> list_of_capsule_;
26 NodeRodWeakPtr weak_ptr_;
27 void initWeakPtr(NodeRodWeakPtr other_weak_ptr);
28 osgVector4 color_;
29 float radius_;
30 float totalLength_;
31 size_t maxCapsule_; // max number of capsule for this rod
32 protected:
34 NodeRod(const std::string& name, osgVector4 color, float radius,
35 float totalLength, size_t maxCapsule);
36
38 NodeRod(const NodeRod& other);
39
40 public:
41 typedef osg::Vec3f::value_type value_type;
43 static NodeRodPtr_t create(const std::string& name, osgVector4 color,
44 float radius, float totalLength, short maxCapsule);
45
47 virtual std::string getCapsuleName(size_t i);
48
49 virtual LeafNodeCapsulePtr_t getCapsule(size_t i) const;
50
53 static NodeRodPtr_t createCopy(NodeRodPtr_t other);
54
56 NodeRodPtr_t self(void) const;
57
58 virtual float radius() const { return radius_; }
59
60 virtual float totalLength() const { return totalLength_; }
61
62 void setColor(const osgVector4& color) { color_ = color; }
63
64 virtual osgVector4 color() const { return color_; }
65
66 virtual size_t maxCapsule() const { return maxCapsule_; }
67
68 virtual void applyConfiguration(std::vector<std::vector<value_type> > params);
69};
70} /* namespace viewer */
71} /* namespace gepetto */
72
73#endif // ROD_HH
Definition node-rod.h:23
static NodeRodPtr_t create(const std::string &name, osgVector4 color, float radius, float totalLength, short maxCapsule)
NodeRod(const NodeRod &other)
virtual float totalLength() const
Definition node-rod.h:60
virtual LeafNodeCapsulePtr_t getCapsule(size_t i) const
virtual size_t maxCapsule() const
Definition node-rod.h:66
NodeRod(const std::string &name, osgVector4 color, float radius, float totalLength, size_t maxCapsule)
static NodeRodPtr_t createCopy(NodeRodPtr_t other)
virtual float radius() const
Definition node-rod.h:58
void setColor(const osgVector4 &color)
Definition node-rod.h:62
NodeRodPtr_t self(void) const
virtual void applyConfiguration(std::vector< std::vector< value_type > > params)
virtual osgVector4 color() const
Definition node-rod.h:64
osg::Vec3f::value_type value_type
Definition node-rod.h:41
virtual std::string getCapsuleName(size_t i)
Abstract base class of 3D objects in a scene.
Definition node.h:25
::osg::Vec4f osgVector4
Definition config-osg.h:100
#define DEF_CLASS_SMART_PTR(className)
Definition macros.h:51
Definition action-search-bar.hh:27