OpendTect-6_4  6.4
vislight.h
Go to the documentation of this file.
1 #ifndef vislight_h
2 #define vislight_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Kristofer Tingdahl
9  Date: 4-11-2002
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "visbasemod.h"
17 #include "visdata.h"
18 #include "visnodestate.h"
19 #include "visosg.h"
20 
21 
22 namespace osg
23 {
24  class Light;
25  }
26 
27 namespace visBase
28 {
29 
36 {
37 public:
38  Light();
39  void setLightNum(int);
40  int getLightNum() const;
41 
42  void turnOn(bool n) { ison_ = n; updateLights(); }
43  bool isOn() const { return ison_; }
44 
45  void setAmbient(float);
47  float getAmbient() const;
48 
49  void setDiffuse(float);
51  float getDiffuse() const;
52 
53  void setDirection(float x,float y,float z);
55  float direction(int dim) const;
58  void fillPar( IOPar& ) const;
59  bool usePar( const IOPar& );
60 
61 
62 protected:
63  ~Light();
64  void updateLights();
65  void initLight();
66  bool ison_;
67  float ambient_;
68  float diffuse_;
69  osg::Light* light_;
70 
71  static const char* sKeyIsOn();
72  static const char* sKeyAmbient();
73  static const char* sKeyDiffuse();
74  static const char* sKeyLightNum();
75  static const char* sKeyDirection();
76 private:
77  void applyAttribute(
78  osg::StateSet*,osg::StateAttribute*);
79 };
80 
81 
82 } //visBase
83 
84 #endif
#define mExpClass(module)
Definition: commondefs.h:160
void turnOn(bool n)
Definition: vislight.h:42
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
float ambient_
Definition: vislight.h:67
Definition: visnodestate.h:27
float diffuse_
Definition: vislight.h:68
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
bool isOn() const
Definition: vislight.h:43
Class for all lights. More options are available in osg, but only what we currently need is implement...
Definition: vislight.h:35
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
Definition: visannot.h:43
Open Scene Graph.
Definition: visannot.h:29
TrcKeyZSampling::Dir direction(TrcKeyZSampling::Dir slctype, int dimnr)
Definition: trckeyzsampling.h:139
bool ison_
Definition: vislight.h:66
osg::Light * light_
Definition: vislight.h:69

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019