gepetto-viewer 6.0.0
An user-friendly Graphical Interface
Loading...
Searching...
No Matches
group-node.h
Go to the documentation of this file.
1//
2// group-node.h
3// gepetto-viewer
4//
5// Created by Justin Carpentier, Mathieu Geisert in November 2014.
6// Copyright (c) 2014 LAAS-CNRS. All rights reserved.
7//
8
9#ifndef GEPETTO_VIEWER_GROUPNODE_HH
10#define GEPETTO_VIEWER_GROUPNODE_HH
11
12#include <gepetto/viewer/node.h>
13
14namespace gepetto {
15namespace viewer {
16
17DEF_CLASS_SMART_PTR(GroupNode)
18
19class GroupNode : public Node {
20 private:
24 typedef std::vector<NodePtr_t> Nodes_t;
25 Nodes_t list_of_objects_;
26
28 GroupNodeWeakPtr weak_ptr_;
29
30 protected:
34 GroupNode(const std::string& name);
35
37 GroupNode(const GroupNode& other);
38
40 void initWeakPtr(GroupNodeWeakPtr other_weak_ptr);
41
42 public:
45 static GroupNodePtr_t create(const std::string& name);
46
49 static GroupNodePtr_t createCopy(GroupNodePtr_t other);
50
53 GroupNodePtr_t clone(void) const;
54
57 GroupNodePtr_t self(void) const;
58
61 virtual bool addChild(NodePtr_t child_ptr);
62
65 virtual bool removeChild(NodePtr_t child_ptr);
66
69 virtual bool hasChild(NodePtr_t child_ptr) const;
70
73 virtual void removeAllChildren();
74
75 virtual size_t getNumOfChildren() const { return list_of_objects_.size(); }
76
77 virtual NodePtr_t getChild(size_t i) const {
78 Nodes_t::const_iterator it = list_of_objects_.begin();
79 if (list_of_objects_.size() > i) {
80 std::advance(it, (long)i);
81 }
82 return *it;
83 }
84
89 virtual void setLightingMode(const LightingMode& lighting_state);
90
95 virtual void setWireFrameMode(const WireFrameMode& wireframe_state);
96
100 virtual void setAlpha(const float& alpha);
101
103 void setColor(const osgVector4& color);
104
105 void traverse(NodeVisitor& visitor);
106
107 virtual osg::ref_ptr<osg::Node> getOsgNode() const;
108
110
111 /* Destructor */
112 virtual ~GroupNode();
113
114}; /* class GraphicalGroupOSG */
115
116} /* namespace viewer */
117} /* namespace gepetto */
118
119#endif /* GEPETTO_VIEWER_GROUPNODE_HH */
Definition group-node.h:19
virtual void setAlpha(const float &alpha)
void traverse(NodeVisitor &visitor)
virtual void setLightingMode(const LightingMode &lighting_state)
Virtual method for setting the lighting mode of the object : influence by light or not.
GroupNode(const GroupNode &other)
void initWeakPtr(GroupNodeWeakPtr other_weak_ptr)
GroupNode(const std::string &name)
Default constructor.
SCENE_VIEWER_ACCEPT_VISITOR
Definition group-node.h:109
static GroupNodePtr_t createCopy(GroupNodePtr_t other)
virtual osg::ref_ptr< osg::Node > getOsgNode() const
virtual bool removeChild(NodePtr_t child_ptr)
GroupNodePtr_t self(void) const
GroupNodePtr_t clone(void) const
virtual void setWireFrameMode(const WireFrameMode &wireframe_state)
Virtual method for setting the wireframe mode of the object : visible or not.
void setColor(const osgVector4 &color)
virtual void removeAllChildren()
virtual size_t getNumOfChildren() const
Definition group-node.h:75
virtual bool hasChild(NodePtr_t child_ptr) const
virtual bool addChild(NodePtr_t child_ptr)
static GroupNodePtr_t create(const std::string &name)
virtual NodePtr_t getChild(size_t i) const
Definition group-node.h:77
Definition node-visitor.h:35
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
LightingMode
Definition config-osg.h:109
WireFrameMode
Definition config-osg.h:111
Definition action-search-bar.hh:27