leaf-node-box.h
Go to the documentation of this file.
1 //
2 // leaf-node-box.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_LEAFNODEBOX_HH
10 #define GEPETTO_VIEWER_LEAFNODEBOX_HH
11 
13 
14 namespace gepetto {
15 namespace viewer {
16  DEF_CLASS_SMART_PTR(LeafNodeBox)
17 
18 
19  class LeafNodeBox : public NodeDrawable
20  {
21  private:
23  LeafNodeBoxWeakPtr weak_ptr_;
24 
26  ::osg::BoxRefPtr box_ptr_;
27 
28  void init ();
29 
30  /* Default constructor */
31  LeafNodeBox (const std::string &name, const osgVector3 &half_axis);
32  LeafNodeBox (const std::string &name, const osgVector3 &half_axis, const osgVector4 &color);
33 
34  /* Copy constructor */
35  LeafNodeBox (const LeafNodeBox& other);
36 
38  void initWeakPtr (LeafNodeBoxWeakPtr other_weak_ptr);
39 
40  protected:
41  public:
44  static LeafNodeBoxPtr_t create (const std::string &name, const osgVector3& half_axis);
45  static LeafNodeBoxPtr_t create (const std::string &name, const osgVector3& half_axis, const osgVector4 &color);
46 
49  static LeafNodeBoxPtr_t createCopy (LeafNodeBoxPtr_t other);
50 
53  virtual LeafNodeBoxPtr_t clone (void) const;
54 
58  virtual NodePtr_t copy() const { return clone(); }
59 
62  LeafNodeBoxPtr_t self (void) const;
63 
67  void setHalfAxis (const osgVector3& half_axis);
68 
70  {
71  return box_ptr_->getHalfLengths();
72  }
73 
75 
77  virtual ~LeafNodeBox();
78 
79  };
80 } /* namespace viewer */
81 } /* namespace gepetto */
82 
83 #endif /* GEPETTO_VIEWER_LEAFNODEBOX_HH */
Definition: node-drawable.h:19
::osg::Vec3f osgVector3
Definition: config-osg.h:109
::osg::Vec4f osgVector4
Definition: config-osg.h:110
Definition: leaf-node-box.h:19
viewer::NodePtr_t NodePtr_t
Definition: fwd.hh:47
Definition: action-search-bar.hh:27
virtual NodePtr_t copy() const
Proceed to a copy of the currend object as clone.
Definition: leaf-node-box.h:58
#define DEF_CLASS_SMART_PTR(className)
Definition: macros.h:50
SCENE_VIEWER_ACCEPT_VISITOR
Definition: leaf-node-box.h:74
osgVector3 getHalfAxis() const
Definition: leaf-node-box.h:69