- Timestamp:
- 02/12/07 19:00:37 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParserXerces.h
r2114 r2115 1 #ifndef _ X3D_PARSER_XERCES__H2 #define _ X3D_PARSER_XERCES__H1 #ifndef _OBJECTS_PARSER_XERCES__H 2 #define _OBJECTS_PARSER_XERCES__H 3 3 4 4 // --------------------------------------------------------------------------- … … 17 17 XERCES_CPP_NAMESPACE_END 18 18 19 class VspBspTree; 20 class BspTree; 21 class ViewCellsManager; 22 class ViewCellsTree; 23 class VspTree; 24 class OspTree; 25 class VspNode; 19 26 20 class BvhNode; 27 21 class BvHierarchy; 28 class HierarchyManager;29 22 30 23 … … 32 25 { 33 26 public: 34 // ----------------------------------------------------------------------- 35 // Constructors and Destructor 36 // ----------------------------------------------------------------------- 37 ObjectsParseHandlers(ObjectContainer &pvsObjects, 38 ObjectContainer &preprocessorObjects, 39 BoundingBoxConverter *bconverter); 40 ~ObjectsParseHandlers(); 41 42 43 // ----------------------------------------------------------------------- 44 // Getter methods 45 // ----------------------------------------------------------------------- 46 unsigned int GetElementCount() 47 { 48 return mElementCount; 49 } 50 51 unsigned int GetAttrCount() 52 { 53 return mAttrCount; 54 } 55 56 unsigned int GetCharacterCount() 57 { 58 return mCharacterCount; 59 } 60 61 unsigned int GetSpaceCount() 62 { 63 return mSpaceCount; 64 } 27 28 // ----------------------------------------------------------------------- 29 // Constructors and Destructor 30 // ----------------------------------------------------------------------- 31 32 ObjectsParseHandlers(ObjectContainer &pvsObjects, 33 const ObjectContainer &preprocessorObjects); 34 35 ~ObjectsParseHandlers(); 65 36 66 37 67 // ----------------------------------------------------------------------- 68 // Handlers for the SAX DocumentHandler interface 69 // ----------------------------------------------------------------------- 70 void endElement(const XMLCh* const name); 71 void startElement(const XMLCh* const name, AttributeList& attributes); 72 void characters(const XMLCh* const chars, const unsigned int length); 73 void ignorableWhitespace(const XMLCh* const chars, const unsigned int length); 74 void resetDocument(); 38 // ----------------------------------------------------------------------- 39 // Getter methods 40 // ----------------------------------------------------------------------- 75 41 76 ///////////////////////// 42 unsigned int GetElementCount() 43 { 44 return mElementCount; 45 } 77 46 78 int mUniqueObjectId; 79 vector<BvhLeaf *> mBvhLeaves; 80 ObjectContainer &mPreprocessorObjects; 47 unsigned int GetAttrCount() 48 { 49 return mAttrCount; 50 } 81 51 82 /// current state of the parser 83 int mCurrentState; 84 85 enum {, BVH}; 52 unsigned int GetCharacterCount() 53 { 54 return mCharacterCount; 55 } 86 56 87 int mViewSpaceHierarchyType; 88 int mObjectSpaceHierarchyType; 89 int nViewCells; 90 int nObjects; 91 92 93 //////////////////////////////// 57 unsigned int GetSpaceCount() 58 { 59 return mSpaceCount; 60 } 94 61 95 62 96 // Handlers for X3D 97 98 void StartObjectSpaceHierarchy(AttributeList& attributes); 63 // ----------------------------------------------------------------------- 64 // Handlers for the SAX DocumentHandler interface 65 // ----------------------------------------------------------------------- 99 66 100 void StartObjectSpaceHierarchyElement(const std::string &element, AttributeList& attributes); 67 void endElement(const XMLCh* const name); 68 void startElement(const XMLCh* const name, AttributeList& attributes); 69 void characters(const XMLCh* const chars, const unsigned int length); 70 void ignorableWhitespace(const XMLCh* const chars, const unsigned int length); 71 void resetDocument(); 101 72 102 void StartBvhLeaf(AttributeList& attributes); 103 void StartBvhInterior(AttributeList& attributes); 104 void StartBvhElement(string element, AttributeList& attributes); 73 void StartObjectSpaceHierarchyElement(const std::string &element, 74 AttributeList& attributes); 105 75 106 void EndObjectSpaceHierarchyInterior(); 76 ///////////////////////// 107 77 108 void EndBvhInterior(); 109 void EndOspInterior(); 78 int mUniqueObjectId; 110 79 111 void EndObjectSpaceHierarchy();80 vector<BvhLeaf *> mBvhLeaves; 112 81 113 void StartBvhLeafObjects(ObjectContainer &objects, const char *ptr); 82 const ObjectContainer &mPreprocessorObjects; 83 ObjectContainer &mPvsObjects; 114 84 115 // ----------------------------------------------------------------------- 116 // Handlers for the SAX ErrorHandler interface 117 // ----------------------------------------------------------------------- 85 /// current state of the parser 86 bool mIsObjectSpaceHierarchy; 118 87 119 void warning(const SAXParseException& exc); 120 void error(const SAXParseException& exc); 121 void fatalError(const SAXParseException& exc); 122 123 88 enum {BVH}; 89 90 //////////// 91 //-- Handlers for X3D 92 93 void StartBvhLeaf(AttributeList& attributes); 94 void StartBvhElement(string element, AttributeList& attributes); 95 96 void EndObjectSpaceHierarchy(); 97 98 void StartBvhLeafObjects(ObjectContainer &objects, const char *ptr); 99 100 // ----------------------------------------------------------------------- 101 // Handlers for the SAX ErrorHandler interface 102 // ----------------------------------------------------------------------- 103 104 void warning(const SAXParseException& exc); 105 void error(const SAXParseException& exc); 106 void fatalError(const SAXParseException& exc); 107 108 124 109 private: 125 126 127 128 129 130 131 132 133 134 135 136 137 138 110 // ----------------------------------------------------------------------- 111 // Private data members 112 // 113 // fAttrCount 114 // fCharacterCount 115 // fElementCount 116 // fSpaceCount 117 // These are just counters that are run upwards based on the input 118 // from the document handlers. 119 // ----------------------------------------------------------------------- 120 unsigned int mAttrCount; 121 unsigned int mCharacterCount; 122 unsigned int mElementCount; 123 unsigned int mSpaceCount; 139 124 }; 140 125 … … 146 131 { 147 132 public : 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 133 // ----------------------------------------------------------------------- 134 // Constructors and Destructor 135 // ----------------------------------------------------------------------- 136 StrX(const XMLCh* const toTranscode) 137 { 138 // Call the private transcoding method 139 mLocalForm = XMLString::transcode(toTranscode); 140 } 141 142 ~StrX() 143 { 144 XMLString::release(&mLocalForm); 145 } 146 147 // ----------------------------------------------------------------------- 148 // Getter methods 149 // ----------------------------------------------------------------------- 150 const char* LocalForm() const 151 { 152 return mLocalForm; 153 } 154 170 155 private : 171 172 173 174 175 176 177 156 // ----------------------------------------------------------------------- 157 // Private data members 158 // 159 // fLocalForm 160 // This is the local code page form of the string. 161 // ----------------------------------------------------------------------- 162 char* mLocalForm; 178 163 }; 179 164 … … 181 166 operator<<(XERCES_STD_QUALIFIER ostream& target, const StrX& toDump) 182 167 { 183 184 168 target << toDump.LocalForm(); 169 return target; 185 170 } 186 171 }
Note: See TracChangeset
for help on using the changeset viewer.