VR-Forces 4.1.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
vrvCore
DtVisualizerAttributeFactory.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2011 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
9
10
#pragma once
11
#include <
vrvCore/vrvCore.h
>
12
#include <
vrvCore/DtVisualizerAttribute.h
>
13
#include <
vrvUtil/DtVirtualBaseClass.h
>
14
#include <
vrvUtil/DtUnicode.h
>
15
#include <boost/unordered_map.hpp>
16
17
namespace
makVrv
18
{
19
class
DtVisualizerAttribute;
20
class
DtDe;
21
25
class
DT_DLL_VRVCORE
DtVisualizerAttributeFactory
:
public
DtVirtualBaseClass
26
{
27
public
:
28
31
class
CreatorInterface
32
{
33
public
:
35
virtual
~
CreatorInterface
();
36
38
virtual
DtVisualizerAttribute
* create() = 0;
39
40
virtual
const
DtVisualizerAttribute::TypeInfo
& attributeTypeInfo()
const
41
= 0;
42
};
43
45
template
<
typename
Attribute>
46
class
Creator
:
public
CreatorInterface
47
{
48
public
:
49
virtual
DtVisualizerAttribute
* create()
50
{
51
return
new
Attribute();
52
}
53
54
virtual
const
DtVisualizerAttribute::TypeInfo
& attributeTypeInfo()
const
55
{
56
return
Attribute::theTypeInfo();
57
}
58
};
59
61
static
DtVisualizerAttributeFactory
& instance(
DtDe
&);
62
65
static
void
registerInstance(
DtDe
&,
DtVisualizerAttributeFactory
*);
66
68
virtual
~
DtVisualizerAttributeFactory
();
69
71
virtual
DtVisualizerAttribute
* create(
const
std::string& className);
72
73
76
virtual
DtVisualizerAttribute
* create(
const
std::string& className,
77
const
DtUnicode
& value);
78
81
virtual
void
registerClass(CreatorInterface* creator);
82
83
protected
:
84
DtVisualizerAttributeFactory
(
DtDe
&);
85
86
protected
:
87
typedef
boost::unordered_map<std::string, CreatorInterface*>
CreatorMap
;
88
CreatorMap
myCreators
;
89
Creator<DtVisualizerAttributeString>
myDefaultCreator
;
90
DtDe
&
myDe
;
91
};
92
}
93
Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)