Choreonoid  1.5
Light.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_LIGHT_H
7 #define CNOID_BODY_LIGHT_H
8 
9 #include "Device.h"
10 #include "exportdecl.h"
11 
12 namespace cnoid {
13 
14 class CNOID_EXPORT Light : public Device
15 {
16 protected:
17  Light();
18  Light(const Light& org, bool copyStateOnly = false);
19 
20 public:
21  void copyStateFrom(const Light& other);
22  virtual void forEachActualType(boost::function<bool(const std::type_info& type)> func);
23 
24  static int lightStateSize();
25  virtual const double* readState(const double* buf);
26  virtual double* writeState(double* out_buf) const;
27 
28  bool on() const { return on_; }
29  void on(bool on) { on_ = on; }
30 
31  const Vector3f& color() const { return color_; }
32  void setColor(const Vector3f& c) { color_ = c; }
33  void setColor(const Vector3& c) { color_ = c.cast<Vector3f::Scalar>(); }
34 
35  float intensity() const { return intensity_; }
36  void setIntensity(float intensity) { intensity_ = intensity; }
37 
38 private:
39  Vector3f color_;
40  float intensity_;
41  bool on_;
42 };
43 
45 
46 }
47 
48 #endif
void setColor(const Vector3 &c)
Definition: Light.h:33
void setIntensity(float intensity)
Definition: Light.h:36
ref_ptr< Light > LightPtr
Definition: Light.h:44
const Vector3f & color() const
Definition: Light.h:31
Definition: Referenced.h:128
float intensity() const
Definition: Light.h:35
bool on() const
Definition: Light.h:28
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
void setColor(const Vector3f &c)
Definition: Light.h:32
void on(bool on)
Definition: Light.h:29
Definition: Light.h:14
Eigen::Vector3d Vector3
Definition: EigenTypes.h:58
#define CNOID_EXPORT
Definition: Util/exportdecl.h:37
Definition: Device.h:52