MeVisLab Resolution Independence API
Toggle main menu visibility
Loading...
Searching...
No Matches
SoFocusElement.h
Go to the documentation of this file.
1
/*************************************************************************************
2
**
3
** Copyright 2007, MeVis Medical Solutions AG
4
**
5
** The user may use this file in accordance with the license agreement provided with
6
** the Software or, alternatively, in accordance with the terms contained in a
7
** written agreement between the user and MeVis Medical Solutions AG.
8
**
9
** For further information use the contact form at https://www.mevislab.de/contact
10
**
11
**************************************************************************************/
12
13
#ifndef SO_FOCUS_ELEMENT_H
14
#define SO_FOCUS_ELEMENT_H
15
16
18
19
#include "
SoUtilsSystem.h
"
20
21
#include <Inventor/elements/SoReplacedElement.h>
22
#include <Inventor/events/SoEvent.h>
23
25
enum
FocusState
{
26
FS_FOCUS
,
27
FS_NO_FOCUS
,
28
};
29
30
class
SbFocusInfo
31
{
32
public
:
34
FocusState
state
;
35
40
SbVec2f
normClickCoords
;
41
43
SbFocusInfo
()
44
{
45
state
=
FS_NO_FOCUS
;
46
normClickCoords
= SbVec2f(0, 0);
47
}
48
50
SbFocusInfo
(
FocusState
state
, SbVec2f
normClickCoords
)
51
{
52
this->state =
state
;
53
this->normClickCoords =
normClickCoords
;
54
}
55
57
int
operator==
(
const
SbFocusInfo
& i)
const
58
{
59
return
((
state
== i.
state
) && (
normClickCoords
== i.
normClickCoords
));
60
}
61
};
62
64
class
SOUTILS_EXPORT
SoFocusElement
:
public
SoReplacedElement
65
{
66
67
SO_ELEMENT_HEADER(
SoFocusElement
);
68
69
public
:
71
void
init
(SoState* state)
override
;
72
75
static
const
SbFocusInfo
&
get
(SoState* state);
76
78
SbFocusInfo
getDefault
();
79
81
static
void
set
(SoState* state, SoNode* node,
const
SbFocusInfo
& focusInfo);
82
83
SoINTERNAL public :
85
static
void
initClass
();
86
87
protected
:
89
SbFocusInfo
_focusInfo
;
90
};
91
92
#endif
FocusState
FocusState
Administrates the current focus state.
Definition
SoFocusElement.h:25
FS_FOCUS
@ FS_FOCUS
Definition
SoFocusElement.h:26
FS_NO_FOCUS
@ FS_NO_FOCUS
Definition
SoFocusElement.h:27
SoUtilsSystem.h
SOUTILS_EXPORT
#define SOUTILS_EXPORT
System dependent includes. Disables some compiler/linker warnings.
Definition
SoUtilsSystem.h:30
SbFocusInfo
Class transporting focus information for one sub graph.
Definition
SoFocusElement.h:31
SbFocusInfo::SbFocusInfo
SbFocusInfo()
Constructor.
Definition
SoFocusElement.h:43
SbFocusInfo::normClickCoords
SbVec2f normClickCoords
Definition
SoFocusElement.h:40
SbFocusInfo::SbFocusInfo
SbFocusInfo(FocusState state, SbVec2f normClickCoords)
Constructor.
Definition
SoFocusElement.h:50
SbFocusInfo::operator==
int operator==(const SbFocusInfo &i) const
Operator to compare two instances.
Definition
SoFocusElement.h:57
SbFocusInfo::state
FocusState state
Is the sub graph currently selected?
Definition
SoFocusElement.h:34
SoFocusElement
Open Inventor Element defining if the currently rendered Graph has the focus.
Definition
SoFocusElement.h:65
SoFocusElement::getDefault
SbFocusInfo getDefault()
Returns a default SbFocusInfo.
SoFocusElement::init
void init(SoState *state) override
See inventor element documentation. Not to be called directly.
SoFocusElement::initClass
static void initClass()
Initializes the class.
SoFocusElement::get
static const SbFocusInfo & get(SoState *state)
SoFocusElement::set
static void set(SoState *state, SoNode *node, const SbFocusInfo &focusInfo)
Set element state. Usually called in action routines of self written inventor nodes.
SoFocusElement::_focusInfo
SbFocusInfo _focusInfo
Stores the current focus state.
Definition
SoFocusElement.h:89
MeVisLab
Standard
Sources
Inventor
SoUtils
SoFocusElement.h
Generated by
1.18.0