MeVisLab Resolution Independence API
Toggle main menu visibility
Loading...
Searching...
No Matches
SoSFMLBase.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_SFMLBASE_H
14
#define SO_SFMLBASE_H
15
18
19
#include "
InventorWrapperDllInit.h
"
20
#include "
SoInventorWrapperTrace.h
"
21
22
#include <ThirdPartyWarningsDisable.h>
23
#include <Inventor/fields/SoSubField.h>
24
#include <Inventor/SbLinear.h>
25
#include <vector>
26
#include <ThirdPartyWarningsRestore.h>
27
28
#include <mlDataTypes.h>
29
#include <mlTypeDefs.h>
30
#include <mlBase.h>
31
32
//=============================================================
35
44
//=============================================================
45
class
INVENTORWRAPPER_API
SoSFMLBase
:
public
SoSField
46
{
47
48
// Use standard field stuff
49
SO_SFIELD_CONSTRUCTOR_HEADER(
SoSFMLBase
);
50
SO_SFIELD_REQUIRED_HEADER(
SoSFMLBase
);
51
52
public
:
54
static
void
initClass
();
55
57
virtual
void
setValue
(ML_NAMESPACE::Base* mlBasePtr);
58
virtual
ML_NAMESPACE::Base*
getValue
()
const
;
59
SbBool
readValue
(SoInput* in)
override
;
60
void
writeValue
(SoOutput* out)
const override
;
61
63
template
<
class
Type> Type
getTypedValue
()
64
{
65
return
mlbase_cast<Type>(
getValue
());
66
}
67
69
75
void
addAllowedType
(
const
ML_NAMESPACE::RuntimeType* allowedType);
76
78
template
<
typename
T>
void
addAllowedType
()
79
{
80
addAllowedType
(T::getClassTypeId());
81
}
82
84
std::vector<const ML_NAMESPACE::RuntimeType*>
getAllowedTypes
()
const
85
{
86
return
_allowedTypes
;
87
}
88
91
bool
hasUnallowedType
()
const
92
{
93
return
_unallowedType
;
94
}
95
96
protected
:
98
ML_NAMESPACE::Base*
_value
;
99
101
std::vector<const ML_NAMESPACE::RuntimeType*>
_allowedTypes
;
102
104
bool
_unallowedType
;
105
bool
_isRefCountedBase
;
106
};
107
108
#endif
InventorWrapperDllInit.h
INVENTORWRAPPER_API
#define INVENTORWRAPPER_API
Library initialization and export macros for platform independecy of project.
Definition
InventorWrapperDllInit.h:21
SoInventorWrapperTrace.h
SoSFMLBase
Definition
SoSFMLBase.h:46
SoSFMLBase::getAllowedTypes
std::vector< const ml::RuntimeType * > getAllowedTypes() const
Returns a list of allowed Base types for this field.
Definition
SoSFMLBase.h:84
SoSFMLBase::addAllowedType
void addAllowedType()
Same as above, with template parameter where the Base type can be specified directly.
Definition
SoSFMLBase.h:78
SoSFMLBase::writeValue
void writeValue(SoOutput *out) const override
SoSFMLBase::getTypedValue
Type getTypedValue()
Returns a Base pointer of given Type, returns NULL if the base object is not derived from Type.
Definition
SoSFMLBase.h:63
SoSFMLBase::_isRefCountedBase
bool _isRefCountedBase
Definition
SoSFMLBase.h:105
SoSFMLBase::getValue
virtual ml::Base * getValue() const
SoSFMLBase::hasUnallowedType
bool hasUnallowedType() const
Definition
SoSFMLBase.h:91
SoSFMLBase::_value
ml::Base * _value
Pointer to the stored base object.
Definition
SoSFMLBase.h:98
SoSFMLBase::addAllowedType
void addAllowedType(const ml::RuntimeType *allowedType)
SoSFMLBase::readValue
SbBool readValue(SoInput *in) override
SoSFMLBase::_unallowedType
bool _unallowedType
Remember if an unallowed type was assigned to this field.
Definition
SoSFMLBase.h:104
SoSFMLBase::initClass
static void initClass()
Initializes field class, setting up runtime type info.
SoSFMLBase::_allowedTypes
std::vector< const ml::RuntimeType * > _allowedTypes
List of allowed Base types. If empty, any type is allowed.
Definition
SoSFMLBase.h:101
SoSFMLBase::setValue
virtual void setValue(ml::Base *mlBasePtr)
Field access implementation.
MeVis
Foundation
Sources
MLInventorBinding
SoSFMLBase.h
Generated by
1.18.0