http://www.sim.no
http://www.coin3d.org
Main Page
Related Pages
Modules
Classes
Files
File List
include
Inventor
elements
SoElement.h
1
#ifndef COIN_SOELEMENT_H
2
#define COIN_SOELEMENT_H
3
4
/**************************************************************************\
5
*
6
* This file is part of the Coin 3D visualization library.
7
* Copyright (C) 1998-2007 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 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 Systems in Motion about acquiring
18
* a Coin Professional Edition License.
19
*
20
* See http://www.coin3d.org/ for more information.
21
*
22
* Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23
* http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24
*
25
\**************************************************************************/
26
27
#include <Inventor/SbBasic.h>
28
#include <Inventor/SoType.h>
29
#include <Inventor/misc/SoState.h>
30
#include <stdio.h>
31
32
class
SoNode
;
33
34
class
COIN_DLL_API
SoElement
{
35
public
:
36
static
void
initClass(
void
);
37
38
static
SoType
getClassTypeId(
void
);
39
static
int
getClassStackIndex(
void
);
40
const
SoType
getTypeId(
void
)
const
;
41
int
getStackIndex(
void
)
const
;
42
43
virtual
void
init(
SoState
* state);
44
45
virtual
void
push(
SoState
* state);
46
virtual
void
pop(
SoState
* state,
const
SoElement
* prevTopElement);
47
48
virtual
SbBool matches(
const
SoElement
* element)
const
= 0;
49
virtual
SoElement
* copyMatchInfo(
void
)
const
= 0;
50
51
static
void
initElements(
void
);
// only for base class (SoElement)
52
53
static
int
getNumStackIndices(
void
);
54
static
SoType
getIdFromStackIndex(
const
int
stackIndex);
55
56
void
setDepth(
const
int
depth);
57
58
int
getDepth(
void
)
const
;
59
60
virtual
void
print(FILE * file = stdout)
const
;
61
virtual
~
SoElement
();
62
63
protected
:
64
SoElement
(
void
);
65
static
int
classStackIndex
;
66
67
static
SoElement
* getElement(
SoState
*
const
state,
const
int
stackIndex);
68
static
const
SoElement
* getConstElement(
SoState
*
const
state,
const
int
stackIndex);
69
70
void
capture(
SoState
*
const
state)
const
;
71
72
virtual
void
captureThis(
SoState
* state)
const
;
73
74
void
setTypeId(
const
SoType
typeId);
75
void
setStackIndex(
const
int
index);
76
77
SoType
typeId
;
78
int
stackIndex
;
79
80
static
int
createStackIndex(
const
SoType
id
);
81
static
SoTypeList
*
stackToType
;
82
83
int
depth
;
84
85
SoElement
* getNextInStack(
void
)
const
;
86
SoElement
* getNextFree(
void
)
const
;
87
88
private
:
89
90
static
SoType
classTypeId;
91
92
friend
class
SoState
;
// FIXME: bad design. 19990629 mortene.
93
static
void
cleanup(
void
);
94
SoElement
* nextup;
95
SoElement
* nextdown;
96
};
97
98
// inlined methods
99
100
inline
SoElement
*
101
SoElement::getElement
(
SoState
*
const
state,
102
const
int
stackIndex)
103
{
104
return
state->
getElement
(stackIndex);
105
}
106
107
inline
void
108
SoElement::capture
(
SoState
*
const
state)
const
109
{
110
if
(state->
isCacheOpen
()) this->
captureThis
(state);
111
}
112
113
inline
const
SoElement
*
114
SoElement::getConstElement
(
SoState
*
const
state,
115
const
int
stackIndex)
116
{
117
const
SoElement
* element = state->
getConstElement
(stackIndex);
118
element->
capture
(state);
119
return
element;
120
}
121
122
#endif // !COIN_SOELEMENT_H
Copyright © 1998-2007 by
Systems in Motion AS
. All rights reserved.
Generated on Thu Jul 19 2012 for Coin by
Doxygen.
1.8.1.1