MeVisLab Toolbox Reference
SoPolygonLayerElement.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3/*
4 *
5 _______________________________________________________________________
6 ____________ W W W . A W A K E I D E A S . C O M ______________
7 |
8 |
9 | Description:
10 | ...
11 |
12 | Author(s) : Felix Ritter
13 |
14 ____________ W W W . A W A K E I D E A S . C O M ______________
15 _______________________________________________________________________
16 */
17
18#ifndef _SoPolygonLayerElement_H
19#define _SoPolygonLayerElement_H
20
21#include "SoShadowSystem.h"
23#include <functional>
24
26
28
30{
33
34 public:
36
37 float factor;
38 float units;
39
40 SbPolygonLayer(const SbString &_id="", float _factor=0.f, float _units=0.f) {
41 id= _id; factor= _factor; units= _units;
42 }
43
45 *this = layer;
46 }
47
48 SbPolygonLayer &operator =(const SbPolygonLayer &layer) {
49 id= layer.id; factor= layer.factor; units= layer.units;
50 return *this;
51 }
52
53};
54
56{
57 bool operator()(const SbPolygonLayer &x, const SbPolygonLayer &y) const { return strcmp(x.id.getString(), y.id.getString()) < 0; }
58};
59
60class SOSHADOW_CLASS_SPEC SoPolygonLayerElement : public SoAccumulatedElement
61{
62 typedef SoAccumulatedElement inherited;
63
64 SO_ELEMENT_HEADER(SoPolygonLayerElement);
65
66 public:
68 void init(SoState *state) override;
69
71 static void add(SoState *state, SoNode *node, const SbPolygonLayer &layer);
72
74 void push(SoState *state) override;
75
78
79 static const SbPolygonLayer &getWithId(SoState *state, const SbString &id);
80 static const SbPolygonLayer &getTop(SoState *state);
81 static const SbPolygonLayer &getBottom(SoState *state);
82
83 protected:
85 SbSet<SbPolygonLayer, ltSbPolygonLayerId>::const_iterator _top;
86 SbSet<SbPolygonLayer, ltSbPolygonLayerId>::const_iterator _bottom;
87
89
90 SoINTERNAL public:
91 static void initClass(void);
92
93};
94
96
97#endif // _SoPolygonLayerElement_H
#define __MEVIS_IV_END_NAMESPACE
Definition OIVConfig.h:40
#define __MEVIS_IV_BEGIN_NAMESPACE
Definition OIVConfig.h:39
#define SOSHADOW_CLASS_SPEC
Define a class export specifier needed to make the class exportable in dll's.
SbPolygonLayer(const SbPolygonLayer &layer)
SbPolygonLayer(const SbString &_id="", float _factor=0.f, float _units=0.f)
Definition SbSet.h:26
static const SbSet< SbPolygonLayer, ltSbPolygonLayerId > & get(SoState *state)
Returns the current list of polygon layers from the state.
static void initClass(void)
SbSet< SbPolygonLayer, ltSbPolygonLayerId >::const_iterator _bottom
static const SbPolygonLayer & getWithId(SoState *state, const SbString &id)
SbSet< SbPolygonLayer, ltSbPolygonLayerId > _layer
static void add(SoState *state, SoNode *node, const SbPolygonLayer &layer)
Add to the current polygon layer list.
static const SbPolygonLayer & getBottom(SoState *state)
static const SbPolygonLayer & getTop(SoState *state)
void init(SoState *state) override
Initializes element.
SbSet< SbPolygonLayer, ltSbPolygonLayerId >::const_iterator _top
void push(SoState *state) override
Overrides push() method to copy values from next instance in the stack.
virtual ~SoPolygonLayerElement()
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
bool operator()(const SbPolygonLayer &x, const SbPolygonLayer &y) const