+#ifdef HAVE_CONFIG_H
+# include <simgear_config.h>
+#endif
+
#include <simgear/compiler.h>
+#ifndef _WIN32
#include <unistd.h>
-#include STL_IOSTREAM
-
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
-SG_USING_STD(cout);
-SG_USING_STD(endl);
#endif
+#include <iostream>
+#include <cstdlib>
+#include <cstdio>
+
#include "sg_binobj.hxx"
+#include <simgear/debug/logstream.hxx>
+
+using std::cout;
+using std::endl;
int main( int argc, char **argv ) {
if ( argc != 2 ) {
cout << "Usage: " << argv[0] << " binary_obj_file" << endl;
}
+
+
+ sglog().setLogLevels( SG_ALL, SG_ALERT );
SGBinObject obj;
bool result = obj.read_bin( argv[1] );
obj.get_gbs_radius());
cout << endl;
- point_list nodes = obj.get_wgs84_nodes();
+ std::vector<SGVec3d> nodes = obj.get_wgs84_nodes();
cout << "# vertex list" << endl;
for ( i = 0; i < (int)nodes.size(); ++i ) {
printf("v %.5f %.5f %.5f\n", nodes[i].x(), nodes[i].y(), nodes[i].z() );
}
cout << endl;
- point_list normals = obj.get_normals();
+ std::vector<SGVec3f> normals = obj.get_normals();
cout << "# vertex normal list" << endl;
for ( i = 0; i < (int)normals.size(); ++i ) {
printf("vn %.5f %.5f %.5f\n",
}
cout << endl;
- point_list texcoords = obj.get_texcoords();
+ std::vector<SGVec2f> texcoords = obj.get_texcoords();
cout << "# texture coordinate list" << endl;
for ( i = 0; i < (int)texcoords.size(); ++i ) {
printf("vt %.5f %.5f\n",
cout << "# geometry groups" << endl;
cout << endl;
- string material;
+ std::string material;
int_list vertex_index;
int_list normal_index;
int_list tex_index;