V-ART
xmlprinter.cpp
Go to the documentation of this file.
1 
5 #include "vart/xmlprinter.h"
6 #include "vart/scenenode.h"
7 #include "vart/dof.h"
8 
9 using namespace std;
10 
11 ostream* VART::XmlPrinter::outputPtr = &cout;
12 
14 {
15 }
16 
18 // virtual
19 {
20  cerr << "Unimplemented XmlPrint for " << nodePtr->GetID() << endl;
21 }
22 
24 // virtual
25 {
26  ostream& output = *outputPtr;
27  list<Dof*>::const_iterator dofIter = dofList.begin();
28  list<SceneNode*>::const_iterator iter = childList.begin();
29  string indentStr(indent,' ');
30 
31  output << indentStr << "<joint description=\"" << description << "\" type=\"";
32  switch (GetNumDofs())
33  {
34  case 1:
35  output << "uniaxial";
36  break;
37  case 2:
38  output << "biaxial";
39  break;
40  default:
41  output << "poliaxial";
42  }
43  output << "\">\n";
44  //~ while (dofIter != dofList.end())
45  //~ {
46  //~ (*dofIter)->XmlPrintOn(output, indent+2);
47  //~ ++dofIter;
48  //~ }
49  //~ while (iter != childList.end())
50  //~ {
51  //~ (*iter)->XmlPrintOn(output, indent+2);
52  //~ ++iter;
53  //~ }
54  output << indentStr << "</joint>\n";
55  output << flush;
56 }
Base class for objects that compose a scene graph.
Definition: scenenode.h:25
Header file for V-ART class "Dof".
Representation of joints.
Definition: joint.h:34
Header file for V-ART class "SceneNode".
virtual TypeID GetID() const
Returns type identification of the node.
Definition: scenenode.h:76
Header file for V-ART class "XmlPrinter".
static std::ostream * outputPtr
Definition: xmlprinter.h:29
virtual void OperateOn(SceneNode *nodePtr)
Definition: xmlprinter.cpp:17