| http://www.sim.no/ http://www.coin3d.org/

SoEnvironmentElement.h
1 #ifndef COIN_SOENVIRONMENTELEMENT_H
2 #define COIN_SOENVIRONMENTELEMENT_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 #include <Inventor/elements/SoReplacedElement.h>
28 #include <Inventor/SbColor.h>
29
30 class COIN_DLL_API SoEnvironmentElement : public SoReplacedElement {
31 typedef SoReplacedElement inherited;
32
33 SO_ELEMENT_HEADER(SoEnvironmentElement);
34 public:
35 static void initClass(void);
36 protected:
37 virtual ~SoEnvironmentElement();
38
39 public:
40
41 enum FogType {
42 NONE,
43 HAZE,
44 FOG,
45 SMOKE
46 };
47
48 virtual void init(SoState * state);
49
50 static void set(SoState * const state, SoNode * const node,
51 const float ambientIntensity, const SbColor & ambientColor,
52 const SbVec3f & attenuation, const int32_t fogType,
53 const SbColor & fogColor, const float fogVisibility,
54 const float fogStart = 0.0f);
55 static void get(SoState * const state,
56 float & ambientIntensity, SbColor & ambientColor,
57 SbVec3f & attenuation, int32_t & fogType,
58 SbColor & fogColor, float & fogVisibility,
59 float & fogStart);
60
61 static float getAmbientIntensity(SoState * const state);
62 static float getFogVisibility(SoState * const state);
63 static const SbVec3f & getLightAttenuation(SoState * const state);
64 static const SbColor & getAmbientColor(SoState * const state);
65 static const SbColor & getFogColor(SoState * const state);
66 static int32_t getFogType(SoState * const state);
67
68 static void getDefault(float & ambientIntensity,
69 SbColor & ambientColor, SbVec3f & attenuation,
70 int32_t & fogType, SbColor & fogColor,
71 float & fogVisibility, float & fogNear);
72
73 virtual void print(FILE * file) const;
74
75 protected:
76
77 virtual void setElt(SoState * const state,
78 const float ambientIntensity,
79 const SbColor & ambientColor,
80 const SbVec3f & attenuation,
81 const int32_t fogType,
82 const SbColor & fogColor,
83 const float fogVisibility,
84 const float fogNear);
85
86 float ambientIntensity;
87 SbColor ambientColor;
88 SbVec3f attenuation;
89 int32_t fogType;
90 SbColor fogColor;
91 float fogVisibility;
92 float fogStart;
93 };
94
95 #endif // !COIN_SOENVIRONMENTELEMENT_H
SbColor
The SbColor class contains the red, green and blue components which make up a color value...
Definition: SbColor.h:30
SoEnvironmentElement::fogStart
float fogStart
Definition: SoEnvironmentElement.h:92
SoEnvironmentElement::FogType
FogType
Definition: SoEnvironmentElement.h:41
SoEnvironmentElement
The SoEnvironmentElement class is yet to be documented.FIXME: write doc.
Definition: SoEnvironmentElement.h:30
SoNode
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
SoEnvironmentElement::fogVisibility
float fogVisibility
Definition: SoEnvironmentElement.h:91
SoState
The SoState class manages the Coin scenegraph traversal state data.The SoState class is used by actio...
Definition: SoState.h:35
SoReplacedElement::init
virtual void init(SoState *state)
Definition: SoReplacedElement.cpp:79
SoEnvironmentElement::fogColor
SbColor fogColor
Definition: SoEnvironmentElement.h:90
SoEnvironmentElement::ambientColor
SbColor ambientColor
Definition: SoEnvironmentElement.h:87
SoEnvironmentElement::fogType
int32_t fogType
Definition: SoEnvironmentElement.h:89
SoReplacedElement
The SoReplacedElement class is an abstract element superclass.This is the superclass of all elements ...
Definition: SoReplacedElement.h:30
SoReplacedElement::print
virtual void print(FILE *file) const
Definition: SoReplacedElement.cpp:108
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec3f.h:40
SoEnvironmentElement::ambientIntensity
float ambientIntensity
Definition: SoEnvironmentElement.h:86
SoEnvironmentElement::attenuation
SbVec3f attenuation
Definition: SoEnvironmentElement.h:88

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.