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

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