 |
JSBSim Flight Dynamics Model
1.1.11 (13 Feb 2022)
An Open Source Flight Dynamics and Control Software Library in C++
|
41 #include "simgear/structure/SGSharedPtr.hxx"
42 #include "math/FGColumnVector3.h"
137 typedef SGSharedPtr<Element> Element_ptr;
148 Element(
const std::string& nm);
155 bool HasAttribute(
const std::string& key) {
return attributes.find(key) != attributes.end();}
179 const std::string&
GetName(
void)
const {
return name;}
180 void ChangeName(
const std::string& _name) { name = _name; }
321 const std::string& supplied_units,
322 const std::string& target_units);
335 double DisperseValue(
Element *e,
double val,
const std::string& supplied_units=
"",
336 const std::string& target_units=
"");
350 void AddAttribute(
const std::string& name,
const std::string& value);
359 void Print(
unsigned int level=0);
389 std::map <std::string, std::string> attributes;
390 std::vector <std::string> data_lines;
391 std::vector <Element_ptr> children;
393 unsigned int element_index;
394 std::string file_name;
396 typedef std::map <std::string, std::map <std::string, double> > tMapConvert;
397 static tMapConvert convert;
398 static bool converterIsInitialized;
Element * GetParent(void)
Returns a pointer to the parent of an element.
void AddChildElement(Element *el)
Adds a child element to the list of children stored for this element.
const std::string & GetFileName(void) const
Returns the name of the file in which the element has been read.
This class implements a 3 element column vector.
bool HasAttribute(const std::string &key)
Determines if an element has the supplied attribute.
std::string GetAttributeValue(const std::string &key)
Retrieves an attribute.
void SetParent(Element *p)
This function sets the value of the parent class attribute to the supplied Element pointer.
void SetLineNumber(int line)
Set the line number at which the element has been read.
Element * FindElement(const std::string &el="")
Searches for a specified element.
double FindElementValueAsNumber(const std::string &el="")
Searches for the named element and returns the data belonging to it as a number.
double FindElementValueAsNumberConvertFromTo(const std::string &el, const std::string &supplied_units, const std::string &target_units)
Searches for the named element and converts and returns the data belonging to it.
bool FindElementValueAsBoolean(const std::string &el="")
Searches for the named element and returns the data belonging to it as a bool.
double FindElementValueAsNumberConvertTo(const std::string &el, const std::string &target_units)
Searches for the named element and converts and returns the data belonging to it.
unsigned int GetNumDataLines(void)
Returns the number of lines of data stored.
~Element(void)
Destructor.
int GetLineNumber(void) const
Returns the line number at which the element has been defined.
double GetDataAsNumber(void)
Converts the element data to a number.
void SetFileName(const std::string &name)
Set the name of the file in which the element has been read.
std::string FindElementValue(const std::string &el="")
Searches for the named element and returns the string data belonging to it.
void MergeAttributes(Element *el)
Merges the attributes of the current element with another element.
bool SetAttributeValue(const std::string &key, const std::string &value)
Modifies an attribute.
std::string GetDataLine(unsigned int i=0)
Gets a line of data belonging to an element.
double GetAttributeValueAsNumber(const std::string &key)
Retrieves an attribute value as a double precision real number.
const std::string & GetName(void) const
Retrieves the element name.
unsigned int GetNumElements(void)
Returns the number of child elements for this element.
Element(const std::string &nm)
Constructor.
void Print(unsigned int level=0)
Prints the element.
std::string ReadFrom(void) const
Return a string that contains a description of the location where the current XML element was read fr...
Element * FindNextElement(const std::string &el="")
Searches for the next element as specified.
Element * GetNextElement(void)
Returns a pointer to the next element in the list.
Element * GetElement(unsigned int el=0)
Returns a pointer to the element requested by index.
void AddData(std::string d)
Stores data belonging to this element.
void AddAttribute(const std::string &name, const std::string &value)
Stores an attribute belonging to this element.
FGColumnVector3 FindElementTripletConvertTo(const std::string &target_units)
Composes a 3-element column vector for the supplied location or orientation.