Changeset 10245 in orxonox.OLD
- Timestamp:
- Jan 17, 2007, 1:08:54 AM (18 years ago)
- Location:
- branches/mount_points/src/lib/graphics/importer/oif
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mount_points/src/lib/graphics/importer/oif/object_information_file.cc
r10243 r10245 41 41 OIFData::OIFData(const std::string& fileName) 42 42 { 43 PRINTF(0)("OIFDATA NEW\n"); 43 PRINTF(0)("OIFDATA NEW %s\n", fileName.c_str()); 44 this->_root = NULL; 44 45 this->load(fileName); 46 } 47 48 49 OIFData::~OIFData() 50 { 51 if( this->_root) 52 delete this->_root; 45 53 } 46 54 … … 52 60 void OIFData::load(const std::string& fileName) 53 61 { 54 this->_root = NULL;55 56 62 if( fileName.empty()) 57 63 { … … 60 66 } 61 67 62 TiXmlDocument XMLDoc(fileName);68 TiXmlDocument* XMLDoc = new TiXmlDocument(fileName); 63 69 // load the campaign document 64 if( !XMLDoc .LoadFile(fileName))70 if( !XMLDoc->LoadFile(fileName)) 65 71 { 66 72 // report an error 67 PRINTF(3)("Could not load XML File %s: %s @ %d:%d\n", fileName.c_str(), XMLDoc .ErrorDesc(), XMLDoc.ErrorRow(), XMLDoc.ErrorCol());73 PRINTF(3)("Could not load XML File %s: %s @ %d:%d\n", fileName.c_str(), XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol()); 68 74 return; 69 75 } 70 76 71 77 // check basic validity 72 this->_root = XMLDoc .RootElement();78 this->_root = XMLDoc->RootElement(); 73 79 assert( this->_root != NULL); 74 80 75 PRINTF(0)("%s\n\n\n", this->_root->Value());76 81 if( strcmp( this->_root->Value(), "ObjectInformationFile")) 77 82 { … … 80 85 return; 81 86 } 87 88 // this->initMountPoint( this->_root); 82 89 } 83 90 … … 88 95 */ 89 96 ObjectInformationFile::ObjectInformationFile() 90 : data(new OIFData ())97 : data(new OIFData) 91 98 { 92 99 this->init(); … … 142 149 void ObjectInformationFile::load(const std::string& fileName) 143 150 { 151 PRINTF(0)("loading\n"); 144 152 this->data = OIFData::Pointer(new OIFData(fileName)); 145 153 } -
branches/mount_points/src/lib/graphics/importer/oif/object_information_file.h
r10243 r10245 22 22 OIFData(); 23 23 OIFData(const std::string& fileName); 24 virtual ~OIFData() {}24 virtual ~OIFData(); 25 25 26 26 void load(const std::string& fileName); 27 void initMountPoint(const TiXmlElement* root); 27 28 28 29 inline const TiXmlElement* root() { return this->_root; }
Note: See TracChangeset
for help on using the changeset viewer.