Line |
Branch |
Exec |
Source |
1 |
|
|
// |
2 |
|
|
// leaf-node-light.h |
3 |
|
|
// gepetto-viewer |
4 |
|
|
// |
5 |
|
|
// Created by Joseph Mirabel in July 2015. |
6 |
|
|
// Copyright (c) 2015 LAAS-CNRS. All rights reserved. |
7 |
|
|
// |
8 |
|
|
|
9 |
|
|
#ifndef GEPETTO_VIEWER_LEAFNODELIGHT_HH |
10 |
|
|
#define GEPETTO_VIEWER_LEAFNODELIGHT_HH |
11 |
|
|
|
12 |
|
|
#include <gepetto/viewer/group-node.h> |
13 |
|
|
#include <gepetto/viewer/leaf-node-sphere.h> |
14 |
|
|
|
15 |
|
|
namespace gepetto { |
16 |
|
|
namespace viewer { |
17 |
|
|
DEF_CLASS_SMART_PTR(LeafNodeLight) |
18 |
|
|
|
19 |
|
|
/** Implementation of the Light GraphicalObject in OSG render */ |
20 |
|
|
class LeafNodeLight : public LeafNodeSphere { |
21 |
|
|
private: |
22 |
|
|
/** Associated weak pointer */ |
23 |
|
|
LeafNodeLightWeakPtr weak_ptr_; |
24 |
|
|
|
25 |
|
|
/** Associated Light Shape */ |
26 |
|
|
::osg::LightSourceRefPtr light_ptr_; |
27 |
|
|
|
28 |
|
|
void init(); |
29 |
|
|
|
30 |
|
|
/* Default constructor */ |
31 |
|
|
LeafNodeLight(const std::string& name, const float& radius); |
32 |
|
|
LeafNodeLight(const std::string& name, const float& radius, |
33 |
|
|
const osgVector4& color); |
34 |
|
|
|
35 |
|
|
/* Copy constructor */ |
36 |
|
|
LeafNodeLight(const std::string& name, const LeafNodeLight& other); |
37 |
|
|
|
38 |
|
|
/** Initialize weak_ptr */ |
39 |
|
|
void initWeakPtr(LeafNodeLightWeakPtr other_weak_ptr); |
40 |
|
|
|
41 |
|
|
static int uniqueLightNumber; |
42 |
|
|
|
43 |
|
|
protected: |
44 |
|
|
public: |
45 |
|
|
/** Static method which create a new box defined by the half_axis vector |
46 |
|
|
*/ |
47 |
|
|
static LeafNodeLightPtr_t create(const std::string& name, |
48 |
|
|
const float& radius); |
49 |
|
|
static LeafNodeLightPtr_t create(const std::string& name, const float& radius, |
50 |
|
|
const osgVector4& color); |
51 |
|
|
|
52 |
|
|
/** Static method for creating a clone of light other with the copy |
53 |
|
|
* constructor |
54 |
|
|
*/ |
55 |
|
|
static LeafNodeLightPtr_t createCopy(LeafNodeLightPtr_t other); |
56 |
|
|
|
57 |
|
|
/** Proceed to a clonage of the current object defined by the copy constructor |
58 |
|
|
*/ |
59 |
|
|
LeafNodeLightPtr_t clone(void) const; |
60 |
|
|
|
61 |
|
|
/** Copy |
62 |
|
|
\brief Proceed to a copy of the currend object as clone |
63 |
|
|
*/ |
64 |
|
|
LeafNodeLightPtr_t copy() const { return clone(); } |
65 |
|
|
|
66 |
|
|
/** Return a shared pointer of the current object |
67 |
|
|
*/ |
68 |
|
|
LeafNodeLightPtr_t self(void) const; |
69 |
|
|
|
70 |
|
|
/** Replace the old color pointer with the new one defined by |
71 |
|
|
* ColorConstSharedPtr color_ptr */ |
72 |
|
|
virtual void setColor(const osgVector4& color); |
73 |
|
|
|
74 |
|
|
void setRoot(GroupNodePtr_t root); |
75 |
|
|
|
76 |
|
✗ |
SCENE_VIEWER_ACCEPT_VISITOR; |
77 |
|
|
|
78 |
|
|
/** Destructor */ |
79 |
|
|
virtual ~LeafNodeLight(); |
80 |
|
|
}; |
81 |
|
|
} /* namespace viewer */ |
82 |
|
|
} /* namespace gepetto */ |
83 |
|
|
|
84 |
|
|
#endif /* GEPETTO_VIEWER_LEAFNODELIGHT_HH */ |
85 |
|
|
|