VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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/color.h"
20 #include <vlutil/vlList.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.
28 {
29 
30 public:
31 
32  typedef DtList DtSpecAttributeContainer;
34 
35 
36  // default constructor
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 
131  bool myVisible;
133 
134  static const DtString theLengthString;
135  static const DtString theWidthString;
137 
139 };
140 
141 #endif
static const DtString theLengthString
Definition: specification.h:134
bool myVisible
Definition: specification.h:131
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
DtSpecAttributeContainer myAttributes
Definition: specification.h:132
#define DT_DLL_gdb
Definition: gdbDefines.h:25
Definition: color.h:25
static const DtSpecification theNullSpecification
Definition: specification.h:138
static const DtString theWidthString
Definition: specification.h:135
DtList DtSpecAttributeContainer
Definition: specification.h:32
DtColor myColor
Definition: specification.h:130
DtString DtAttributeKey
Definition: specification.h:33
Definition: specification.h:27
static const DtString theOrientationString
Definition: specification.h:136
DT_DLL_VRVCORE double length(const makVrv::DtCoordinateSystem &, const std::vector< DtVector > &vertices)
Returns the total distance of a segmented line defined by the provided vector of vertices. Coordinates are in local database coordinates. The coordinate system is used to convert between the local database coordinates and geocentric. All distance is in 2D – the Z value is ignored.
DT_DLL_terrainCS bool operator!=(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
Definition: specificationAttribute.h:23

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)