VR-Engage  2.2
Loading...
Searching...
No Matches
vortexConfigurationElementDescriptor.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vortexConfigurationElementDescriptor.h
7//! \brief Defines DtVortexConfigurationElementDescriptor for individual Vortex physics configuration parameters
8//! \ingroup vreVrfVortexObjparam
9
10#pragma once
11
13#include <vrfutil/rwTemplatedList.h>
14
15#include <readerWriter/readerWriter.h>
16#include <readerWriter/rwBoolean.h>
17#include <readerWriter/rwReal.h>
18#include <readerWriter/rwInt.h>
19#include <readerWriter/rwVector.h>
20#include <readerWriter/rwString.h>
21
22namespace makVre
23{
24//! \brief Type identifier string for the DtVortexConfigurationElementDescriptor class
25const char DtVortexConfigurationElementDescriptorType[] = "DtVortexConfigurationElementDescriptor";
26
27//! \brief Descriptor for individual Vortex physics configuration parameters
28//!
29//! DtVortexConfigurationElementDescriptor represents a single parameter in the Vortex physics
30//! configuration. It supports multiple data types (boolean, vector, integer, real, string, and filename)
31//! and stores the parameter name along with its value. This class provides type-specific accessors
32//! and modifiers and supports serialization to and from XML.
34{
35protected:
36 //! \brief Protected default constructor
37 //!
38 //! Creates an empty configuration element descriptor
40
41public:
42 //! \brief Constructor with element name and registry
43 //! \param name Name of the configuration element
44 //! \param parentRegistry Optional parent registry for reader/writer operations
45 DtVortexConfigurationElementDescriptor(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
46
47 //! \brief Constructor with symbol element name and registry
48 //! \param name Symbol string name of the configuration element
49 //! \param parentRegistry Optional parent registry for reader/writer operations
50 DtVortexConfigurationElementDescriptor(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = 0);
51
52 //! \brief Copy constructor
53 //! \param orig Original configuration element descriptor to copy from
54 //! \param parentRegistry Optional parent registry for reader/writer operations
56 const DtVortexConfigurationElementDescriptor& orig, DtReaderWriterRegistry* parentRegistry = 0);
57
58 //! \brief Assignment operator
59 //! \param orig Original configuration element descriptor to copy from
60 //! \return Reference to this configuration element descriptor after assignment
62
63 //! \brief Virtual destructor
65
66 //! \brief Sets the parameter name
67 //! \param name The name to set for this parameter
68 virtual void setParameterName(const DtString& name);
69
70 //! \brief Gets the parameter name
71 //! \return The name of this parameter
72 virtual const DtString& getParameterName() const;
73
74 //! \brief Checks if a parameter name has been specified
75 //! \return True if the parameter name has been specified, false otherwise
76 virtual bool parameterNameSpecified() const;
77
78 //! \brief Gets the boolean value
79 //! \return The boolean value of this parameter
80 virtual bool getBooleanValue() const;
81
82 //! \brief Sets the boolean value
83 //! \param val The boolean value to set
84 //! \param isSpecified Flag indicating if the value is specified
85 virtual void setBooleanValue(bool val, bool isSpecified = true);
86
87 //! \brief Checks if a boolean value has been specified
88 //! \return True if a boolean value has been specified, false otherwise
89 virtual bool booleanValueSpecified() const;
90
91 //! \brief Gets the vector value
92 //! \return The vector value of this parameter
93 virtual DtVector getVectorValue() const;
94
95 //! \brief Sets the vector value
96 //! \param loc The vector value to set
97 //! \param isSpecified Flag indicating if the value is specified
98 virtual void setVectorValue(const DtVector& loc, bool isSpecified = true);
99
100 //! \brief Checks if a vector value has been specified
101 //! \return True if a vector value has been specified, false otherwise
102 virtual bool vectorValueSpecified() const;
103
104 //! \brief Gets the integer value
105 //! \return The integer value of this parameter
106 virtual int getIntValue() const;
107
108 //! \brief Sets the integer value
109 //! \param loc The integer value to set
110 //! \param isSpecified Flag indicating if the value is specified
111 virtual void setIntValue(const int loc, bool isSpecified = true);
112
113 //! \brief Checks if an integer value has been specified
114 //! \return True if an integer value has been specified, false otherwise
115 virtual bool intValueSpecified() const;
116
117 //! \brief Gets the real (double) value
118 //! \return The real value of this parameter
119 virtual double getRealValue() const;
120
121 //! \brief Sets the real (double) value
122 //! \param val The real value to set
123 //! \param isSpecified Flag indicating if the value is specified
124 virtual void setRealValue(double val, bool isSpecified = true);
125
126 //! \brief Checks if a real value has been specified
127 //! \return True if a real value has been specified, false otherwise
128 virtual bool realValueSpecified() const;
129
130 //! \brief Gets the string value
131 //! \return The string value of this parameter
132 virtual const DtString& getStringValue() const;
133
134 //! \brief Sets the string value
135 //! \param str The string value to set
136 //! \param isSpecified Flag indicating if the value is specified
137 virtual void setStringValue(const DtString& str, bool isSpecified = true);
138
139 //! \brief Checks if a string value has been specified
140 //! \return True if a string value has been specified, false otherwise
141 virtual bool stringValueSpecified() const;
142
143 //! \brief Gets the filename value
144 //! \return The filename value of this parameter
145 virtual const DtString& getFilenameValue() const;
146
147 //! \brief Sets the filename value
148 //! \param filename The filename value to set
149 //! \param isSpecified Flag indicating if the value is specified
150 virtual void setFilenameValue(const DtString& filename, bool isSpecified = true);
151
152 //! \brief Checks if a filename value has been specified
153 //! \return True if a filename value has been specified, false otherwise
154 virtual bool filenameValueSpecified() const;
155
156 //! \brief Gets the type identifier for reader/writer operations
157 //! \return Type identifier string
158 virtual const char* readerWriterType() const override;
159
160 //! \brief Gets the XML type identifier for serialization
161 //! \return XML type identifier string used when archiving to an XML stream
162 static const char* theXmlType();
163
164 //! \brief Gets the XML type identifier for this instance
165 //! \return XML type identifier string
166 virtual const char* xmlType() const override { return theXmlType(); }
167
168protected:
169 //! \brief The name of this parameter
170 DtRwString myParameterName;
171
172 //! \brief The boolean value of this parameter
173 DtRwBoolean myBoolValue;
174
175 //! \brief The vector value of this parameter
176 DtRwVector myVectorValue;
177
178 //! \brief The integer value of this parameter
179 DtRwInt myIntValue;
180
181 //! \brief The real (double) value of this parameter
182 DtRwReal myRealValue;
183
184 //! \brief The string value of this parameter
185 DtRwString myStringValue;
186
187 //! \brief The filename value of this parameter
188 DtRwString myFilenameValue;
189};
190
191//! \brief Type definition for a list of Vortex configuration element descriptors
192//!
193//! This list template specialization manages ownership of the descriptors
194//! and handles proper deletion when the list is destroyed
195using DtVortexConfigurationElementList = DtRwTemplatedListPtr<DtVortexConfigurationElementDescriptor, true>;
196} // namespace makVre
virtual bool vectorValueSpecified() const
Checks if a vector value has been specified.
DtVortexConfigurationElementDescriptor(const DtVortexConfigurationElementDescriptor &orig, DtReaderWriterRegistry *parentRegistry=0)
Copy constructor.
virtual const char * readerWriterType() const override
Gets the type identifier for reader/writer operations.
virtual const DtString & getStringValue() const
Gets the string value.
virtual void setIntValue(const int loc, bool isSpecified=true)
Sets the integer value.
virtual void setStringValue(const DtString &str, bool isSpecified=true)
Sets the string value.
virtual void setVectorValue(const DtVector &loc, bool isSpecified=true)
Sets the vector value.
virtual bool getBooleanValue() const
Gets the boolean value.
virtual bool intValueSpecified() const
Checks if an integer value has been specified.
virtual int getIntValue() const
Gets the integer value.
virtual void setBooleanValue(bool val, bool isSpecified=true)
Sets the boolean value.
DtRwString myParameterName
The name of this parameter.
Definition vortexConfigurationElementDescriptor.h:170
virtual bool stringValueSpecified() const
Checks if a string value has been specified.
DtRwBoolean myBoolValue
The boolean value of this parameter.
Definition vortexConfigurationElementDescriptor.h:173
DtRwString myStringValue
The string value of this parameter.
Definition vortexConfigurationElementDescriptor.h:185
virtual bool booleanValueSpecified() const
Checks if a boolean value has been specified.
DtVortexConfigurationElementDescriptor(const DtString &name, DtReaderWriterRegistry *parentRegistry=0)
Constructor with element name and registry.
virtual void setFilenameValue(const DtString &filename, bool isSpecified=true)
Sets the filename value.
DtVortexConfigurationElementDescriptor(const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=0)
Constructor with symbol element name and registry.
DtRwVector myVectorValue
The vector value of this parameter.
Definition vortexConfigurationElementDescriptor.h:176
virtual bool parameterNameSpecified() const
Checks if a parameter name has been specified.
virtual bool realValueSpecified() const
Checks if a real value has been specified.
virtual const DtString & getFilenameValue() const
Gets the filename value.
virtual void setRealValue(double val, bool isSpecified=true)
Sets the real (double) value.
DtRwString myFilenameValue
The filename value of this parameter.
Definition vortexConfigurationElementDescriptor.h:188
virtual ~DtVortexConfigurationElementDescriptor() override
Virtual destructor.
DtVortexConfigurationElementDescriptor & operator=(const DtVortexConfigurationElementDescriptor &orig)
Assignment operator.
virtual const char * xmlType() const override
Gets the XML type identifier for this instance.
Definition vortexConfigurationElementDescriptor.h:166
virtual const DtString & getParameterName() const
Gets the parameter name.
virtual DtVector getVectorValue() const
Gets the vector value.
virtual double getRealValue() const
Gets the real (double) value.
DtRwReal myRealValue
The real (double) value of this parameter.
Definition vortexConfigurationElementDescriptor.h:182
DtVortexConfigurationElementDescriptor()
Protected default constructor.
DtRwInt myIntValue
The integer value of this parameter.
Definition vortexConfigurationElementDescriptor.h:179
virtual bool filenameValueSpecified() const
Checks if a filename value has been specified.
static const char * theXmlType()
Gets the XML type identifier for serialization.
virtual void setParameterName(const DtString &name)
Sets the parameter name.
Defines export macros for the vreVrfVortexObjparam library.
#define VREVRFVORTEXOBJPARAM_DLL
Definition export.h:19
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
DtRwTemplatedListPtr< DtVortexConfigurationElementDescriptor, true > DtVortexConfigurationElementList
Type definition for a list of Vortex configuration element descriptors.
Definition vortexConfigurationElementDescriptor.h:195
const char DtVortexConfigurationElementDescriptorType[]
Type identifier string for the DtVortexConfigurationElementDescriptor class.
Definition vortexConfigurationElementDescriptor.h:25