Changeset 10060 in orxonox.OLD for branches/mount_points/src/lib/graphics/importer/oif
- Timestamp:
- Dec 13, 2006, 11:19:25 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
r10059 r10060 20 20 #include "resource_oif.h" 21 21 22 #include "util/loading/factory.h" 23 #include "util/loading/load_param_xml.h" 24 25 26 /** 27 * constructor 28 * @param fileName name of the file 29 */ 30 OIFData::OIFData(const std::string& fileName) 31 { 32 this->load(fileName); 33 } 34 35 36 /** 37 * loading the data 38 * @param fileName file name where the data can be found 39 */ 40 void OIFData::load(const std::string& fileName) 41 { 42 // 43 if( fileName.empty()) 44 { 45 PRINTF(3)("No filename specified for object information loading"); 46 return; 47 } 48 49 TiXmlDocument XMLDoc(fileName); 50 // load the campaign document 51 if( !XMLDoc.LoadFile(fileName)) 52 { 53 // report an error 54 PRINTF(3)("Could not load XML File %s: %s @ %d:%d\n", fileName.c_str(), XMLDoc.ErrorDesc(), XMLDoc.ErrorRow(), XMLDoc.ErrorCol()); 55 return; 56 } 57 58 // check basic validity 59 TiXmlElement* root = XMLDoc.RootElement(); 60 assert( root != NULL); 61 62 if( strcmp( root->Value(), "ObjectInformationFile")) 63 { 64 // report an error 65 PRINTF(2)("Specified XML File is not an orxonox object information file (<ObjectInformationFile> element missing)\n"); 66 return; 67 } 68 69 // construct campaign 70 // return new Campaign( root); 71 } 72 22 73 23 74 … … 35 86 */ 36 87 ObjectInformationFile::ObjectInformationFile(const std::string& fileName) 37 : data(new OIFData( ))88 : data(new OIFData(fileName)) 38 89 { 39 90 // load the oif file -
branches/mount_points/src/lib/graphics/importer/oif/object_information_file.h
r10054 r10060 18 18 typedef CountPointer<OIFData> Pointer; 19 19 20 20 21 public: 21 OIFData( ) {}22 OIFData(const std::string& fileName); 22 23 virtual ~OIFData() {} 23 24 25 void load(const std::string& fileName); 24 26 25 27
Note: See TracChangeset
for help on using the changeset viewer.