VR-Forces 4.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
gdb
specification.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2003 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
/*******************************************************************************
6
** $RCSfile: specification.h,v $ $Revision: 1.14 $ $State: Exp $
7
*******************************************************************************/
8
#ifndef specification_H_
9
#define specification_H_
10
11
//
12
// \file specification.h
13
// \brief Contains the declaration of the DtSpecification class.
14
//
15
16
#include "
gdb/gdbDefines.h
"
17
#include <stdio.h>
18
#include <vlutil/vlString.h>
19
#include "
geometry/gdbColor.h
"
20
#include <vlutil/vlList.h>
21
#include "
gdb/specAttrib.h
"
22
23
24
// The DtSpecification class represents the meta-data associated with a vector network
25
// feature. It is a collection of attributes, each a key-value pair, and provides
26
// an interface for setting and getting the associated attributes.
27
class
DT_DLL_gdb
DtSpecification
28
{
29
30
public
:
31
32
typedef
DtList
DtSpecAttributeContainer
;
33
typedef
DtString
DtAttributeKey
;
34
35
36
// default constructor
37
DtSpecification
();
38
39
// destructor
40
virtual
~
DtSpecification
();
41
42
// copy constructor
43
DtSpecification
(
const
DtSpecification
& orig);
44
45
// assignment operator
46
DtSpecification
& operator=(
const
DtSpecification
& orig);
47
48
// @name Comparison operators
50
virtual
bool
operator==
(
const
DtSpecification
& other)
const
;
51
virtual
bool
operator!=
(
const
DtSpecification
& other)
const
;
52
53
// If the specified specification contains all of the attributes of this
54
// specification, then this specification is a superset of the specified
55
// specification.
56
virtual
bool
isASupersetOf(
const
DtSpecification
& other)
const
;
58
59
// accessor / mutator functions
60
virtual
const
DtColor
& color()
const
;
61
virtual
void
setColor(
const
DtColor
& c);
62
63
// returns a string that describes the surface characteristic.
64
virtual
DtString
specificationString()
const
;
65
66
// debugging aid
67
virtual
void
dump()
const
;
68
69
// get/set length
70
virtual
double
length()
const
;
71
virtual
void
setLength(
double
val);
72
73
// get/set width
74
virtual
double
width()
const
;
75
virtual
void
setWidth(
double
val);
76
77
// get/set rotation of the object about the Z-axis in degrees (0 if not specified)
78
virtual
int
rotationAboutZ()
const
;
79
virtual
void
setRotationAboutZ(
int
angleInDegrees);
80
81
// get/set visible flag
82
virtual
bool
visible()
const
;
83
virtual
void
setVisible(
bool
val);
84
85
// get a radius for drawing nodes
86
virtual
double
drawingRadius()
const
;
87
88
// add (as copy) and lookup an attribute
89
virtual
void
addAttribute(
const
DtSpecificationAttribute
& att);
90
91
virtual
void
removeAttribute(
const
DtSpecificationAttribute
& att);
92
virtual
void
removeAttribute(
const
DtAttributeKey
& label);
93
94
virtual
DtSpecificationAttribute
* attribute(
const
DtString
& label);
95
virtual
const
DtSpecificationAttribute
* attribute(
const
DtString
& label)
const
;
96
97
// add and lookup an integer attribute
98
virtual
void
addIntegerAttribute(
const
DtString
& label,
int
value);
99
virtual
bool
lookupIntegerAttribute(
const
DtString
& label,
int
& value)
const
;
100
101
// add and lookup a real attribute
102
virtual
void
addRealAttribute(
const
DtString
& label,
double
value);
103
virtual
bool
lookupRealAttribute(
const
DtString
& label,
double
& value)
const
;
104
105
// add and lookup a string attribute
106
virtual
void
addStringAttribute(
const
DtString
& label,
const
DtString
& value);
107
virtual
bool
lookupStringAttribute(
const
DtString
& label,
DtString
& value)
const
;
108
109
// check for existence and return attribute pointer
110
virtual
const
DtSpecificationAttribute
* attributeOfType(
const
DtString
& label,
111
unsigned
int
type)
const
;
112
113
// input/output functions
114
virtual
bool
readFrom(FILE* fp);
115
virtual
bool
writeTo(FILE* fp);
116
117
// return a null specification
118
static
const
DtSpecification
& nullSpecification();
119
120
// Returns the list of all attributes
121
virtual
const
DtSpecAttributeContainer
& attributes()
const
;
122
123
protected
:
124
125
// specification attribute factory method
126
virtual
DtSpecificationAttribute
* newAttribute(
unsigned
int
type);
127
128
protected
:
129
130
DtColor
myColor
;
131
bool
myVisible
;
132
DtSpecAttributeContainer
myAttributes
;
133
134
static
const
DtString
theLengthString
;
135
static
const
DtString
theWidthString
;
136
static
const
DtString
theOrientationString
;
137
138
static
const
DtSpecification
theNullSpecification
;
139
};
140
141
#endif
Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (
www.mak.com
)