MeVisLab Resolution Independence API
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
29
31{
32public:
35
41
44 {
46 normClickCoords = SbVec2f(0, 0);
47 }
48
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
64class SOUTILS_EXPORT SoFocusElement : public SoReplacedElement
65{
66
67 SO_ELEMENT_HEADER(SoFocusElement);
68
69public:
71 void init(SoState* state) override;
72
75 static const SbFocusInfo& get(SoState* state);
76
79
81 static void set(SoState* state, SoNode* node, const SbFocusInfo& focusInfo);
82
83SoINTERNAL public :
85 static void initClass();
86
87protected:
90};
91
92#endif
FocusState
Administrates the current focus state.
@ FS_FOCUS
@ FS_NO_FOCUS
#define SOUTILS_EXPORT
System dependent includes. Disables some compiler/linker warnings.
Class transporting focus information for one sub graph.
SbFocusInfo()
Constructor.
SbVec2f normClickCoords
SbFocusInfo(FocusState state, SbVec2f normClickCoords)
Constructor.
int operator==(const SbFocusInfo &i) const
Operator to compare two instances.
FocusState state
Is the sub graph currently selected?
Open Inventor Element defining if the currently rendered Graph has the focus.
SbFocusInfo getDefault()
Returns a default SbFocusInfo.
void init(SoState *state) override
See inventor element documentation. Not to be called directly.
static void initClass()
Initializes the class.
static const SbFocusInfo & get(SoState *state)
static void set(SoState *state, SoNode *node, const SbFocusInfo &focusInfo)
Set element state. Usually called in action routines of self written inventor nodes.
SbFocusInfo _focusInfo
Stores the current focus state.