Modernise the mat lib header, remove 'using std'
This commit is contained in:
@@ -77,7 +77,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath,
|
|||||||
if (!strcmp(node->getName(), "material")) {
|
if (!strcmp(node->getName(), "material")) {
|
||||||
SGSharedPtr<SGMaterial> m = new SGMaterial(options.get(), node, prop_root);
|
SGSharedPtr<SGMaterial> m = new SGMaterial(options.get(), node, prop_root);
|
||||||
|
|
||||||
vector<SGPropertyNode_ptr>names = node->getChildren("name");
|
std::vector<SGPropertyNode_ptr>names = node->getChildren("name");
|
||||||
for ( unsigned int j = 0; j < names.size(); j++ ) {
|
for ( unsigned int j = 0; j < names.size(); j++ ) {
|
||||||
string name = names[j]->getStringValue();
|
string name = names[j]->getStringValue();
|
||||||
// cerr << "Material " << name << endl;
|
// cerr << "Material " << name << endl;
|
||||||
|
|||||||
@@ -25,10 +25,6 @@
|
|||||||
#define _MATLIB_HXX
|
#define _MATLIB_HXX
|
||||||
|
|
||||||
|
|
||||||
#ifndef __cplusplus
|
|
||||||
# error This library requires C++
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
|
|
||||||
#include <simgear/structure/SGSharedPtr.hxx>
|
#include <simgear/structure/SGSharedPtr.hxx>
|
||||||
@@ -37,20 +33,11 @@
|
|||||||
#include <map> // STL associative "array"
|
#include <map> // STL associative "array"
|
||||||
#include <vector> // STL "array"
|
#include <vector> // STL "array"
|
||||||
|
|
||||||
#include <osg/Geode>
|
|
||||||
|
|
||||||
class SGMaterial;
|
class SGMaterial;
|
||||||
class SGPropertyNode;
|
class SGPropertyNode;
|
||||||
|
|
||||||
using std::string;
|
namespace simgear { class Effect; }
|
||||||
using std::map;
|
namespace osg { class Geode; }
|
||||||
using std::vector;
|
|
||||||
using std::less;
|
|
||||||
|
|
||||||
namespace simgear
|
|
||||||
{
|
|
||||||
class Effect;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Material management class
|
// Material management class
|
||||||
class SGMaterialLib {
|
class SGMaterialLib {
|
||||||
@@ -60,7 +47,7 @@ private:
|
|||||||
// associative array of materials
|
// associative array of materials
|
||||||
typedef std::vector< SGSharedPtr<SGMaterial> > material_list;
|
typedef std::vector< SGSharedPtr<SGMaterial> > material_list;
|
||||||
typedef material_list::iterator material_list_iterator;
|
typedef material_list::iterator material_list_iterator;
|
||||||
typedef map < string, material_list> material_map;
|
typedef std::map < std::string, material_list> material_map;
|
||||||
typedef material_map::iterator material_map_iterator;
|
typedef material_map::iterator material_map_iterator;
|
||||||
typedef material_map::const_iterator const_material_map_iterator;
|
typedef material_map::const_iterator const_material_map_iterator;
|
||||||
|
|
||||||
@@ -72,10 +59,10 @@ public:
|
|||||||
SGMaterialLib ( void );
|
SGMaterialLib ( void );
|
||||||
|
|
||||||
// Load a library of material properties
|
// Load a library of material properties
|
||||||
bool load( const string &fg_root, const string& mpath,
|
bool load( const std::string &fg_root, const std::string& mpath,
|
||||||
SGPropertyNode *prop_root );
|
SGPropertyNode *prop_root );
|
||||||
// find a material record by material name
|
// find a material record by material name
|
||||||
SGMaterial *find( const string& material );
|
SGMaterial *find( const std::string& material );
|
||||||
|
|
||||||
material_map_iterator begin() { return matlib.begin(); }
|
material_map_iterator begin() { return matlib.begin(); }
|
||||||
const_material_map_iterator begin() const { return matlib.begin(); }
|
const_material_map_iterator begin() const { return matlib.begin(); }
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
#define SIGN "OBJECT_SIGN: "
|
#define SIGN "OBJECT_SIGN: "
|
||||||
|
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
using std::string;
|
||||||
using namespace simgear;
|
using namespace simgear;
|
||||||
|
|
||||||
// for temporary storage of sign elements
|
// for temporary storage of sign elements
|
||||||
|
|||||||
Reference in New Issue
Block a user