SmallChange  1.0.0
A collection of extensions to Coin3D
Loading...
Searching...
No Matches
SmColorGradientElement.h
1#ifndef SMALLCHANGE_COLORGRADIENTELEMENT_H
2#define SMALLCHANGE_COLORGRADIENTELEMENT_H
3
4/**************************************************************************\
5 *
6 * This file is part of the SmallChange extension library for Coin.
7 * Copyright (C) 1998-2003 by Systems in Motion. All rights reserved.
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 SmallChange with software that can not be combined with the
16 * GNU GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Systems in Motion about acquiring
18 * a Coin Professional Edition License.
19 *
20 * See <URL:http://www.coin3d.org> for more information.
21 *
22 * Systems in Motion, Teknobyen, Abels Gate 5, 7030 Trondheim, NORWAY.
23 * <URL:http://www.sim.no>.
24 *
25\**************************************************************************/
26
27#include <Inventor/elements/SoReplacedElement.h>
28#include <Inventor/elements/SoSubElement.h>
29#include <Inventor/SbLinear.h>
30
31// Avoid problem with Microsoft Visual C++ Win32 API headers (they
32// #define RELATIVE/ABSOLUTE in their header files (WINGDI.H)
33#ifdef RELATIVE
34#undef RELATIVE
35#endif // RELATIVE
36
37#ifdef ABSOLUTE
38#undef ABSOLUTE
39#endif // ABSOLUTE
40
41#include <SmallChange/basic.h>
42
43class SbColor;
44
45
46class SMALLCHANGE_DLL_API SmColorGradientElement : public SoReplacedElement {
48
49 SO_ELEMENT_HEADER(SmColorGradientElement);
50
51public:
52
53 enum Mapping {
54 RELATIVE,
55 ABSOLUTE
56 };
57
58 static void initClass(void);
59
60 virtual void init(SoState * state);
61 virtual void push(SoState * state);
62
63 static void set(SoState * state, SoNode * node,
64 const Mapping & mapping,
65 const int numparams,
66 const float * params,
67 const SbColor * colors);
68
69 static void get(SoState * state,
70 Mapping & mapping,
71 int & numparams,
72 const float *& params,
73 const SbColor *& colors);
74
75protected:
77
78private:
79 Mapping mapping;
80 int numparams;
81 const float * params;
82 const SbColor * colors;
83
84};
85
86#endif // !SMALLCHANGE_COLORGRADIENTELEMENT_H
Definition SmColorGradientElement.h:46