00001 00002 // SceneToFileGlobalVariables.h // 00004 00005 #ifndef SCENETOFILEGLOBALVARIABLES_H 00006 #define SCENETOFILEGLOBALVARIABLES_H 00007 00008 #include "GlobalVariables.h" 00009 #include "NameDict.h" 00010 00011 #include <list> 00012 00013 namespace X3DTK { 00014 namespace X3D { 00015 00017 00018 class SceneToFileGlobalVariables : public GlobalVariables 00019 { 00020 public: 00022 SceneToFileGlobalVariables(); 00024 virtual ~SceneToFileGlobalVariables(); 00025 00027 void pushHasUSE(bool value); 00028 00030 void newLine(); 00032 void pushCurrentLine(); 00034 void writeCurrentLine(const SFString &string); 00036 void writeOpeningLine(const SFString &string); 00037 00039 void addTab(); 00041 void removeTab(); 00042 00044 inline MFString getOutput() const {return _output;}; 00046 bool hasChild(); 00048 void popLine(); 00050 inline bool getHasUSE() const {return _hasUSEStack.front();}; 00052 void popHasUSE(); 00054 inline SFString getTab() const {return _tab;}; 00056 SFString getDEF(const SFNode &N); 00058 SFString getUSE(const SFNode &N) const; 00059 00060 private: 00061 int _lineNumber; 00062 MFString _output; 00063 SFString _tab; 00064 std::list<int> _lineStack; 00065 std::list<bool> _hasUSEStack; 00066 std::list<SFString> _DEFList; 00067 }; 00068 00069 } 00070 } 00071 00072 #endif