From 2ca4b30553ae3dd3298b2e3361daac8ac4b21d0e Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 15 May 2003 16:19:56 +0000 Subject: [PATCH] Rename matobj -> matmodel. --- simgear/scene/material/Makefile.am | 4 +- simgear/scene/material/mat.cxx | 2 +- simgear/scene/material/mat.hxx | 6 +-- .../material/{matobj.cxx => matmodel.cxx} | 42 +++++++++---------- .../material/{matobj.hxx => matmodel.hxx} | 33 +++++++-------- 5 files changed, 42 insertions(+), 45 deletions(-) rename simgear/scene/material/{matobj.cxx => matmodel.cxx} (87%) rename simgear/scene/material/{matobj.hxx => matmodel.hxx} (87%) diff --git a/simgear/scene/material/Makefile.am b/simgear/scene/material/Makefile.am index f781c001..fc0059c3 100644 --- a/simgear/scene/material/Makefile.am +++ b/simgear/scene/material/Makefile.am @@ -7,11 +7,11 @@ noinst_HEADERS = include_HEADERS = \ mat.hxx \ matlib.hxx \ - matobj.hxx + matmodel.hxx libsgmaterial_a_SOURCES = \ mat.cxx \ matlib.cxx \ - matobj.cxx + matmodel.cxx INCLUDES = -I$(top_srcdir) diff --git a/simgear/scene/material/mat.cxx b/simgear/scene/material/mat.cxx index d81947e7..0e505de5 100644 --- a/simgear/scene/material/mat.cxx +++ b/simgear/scene/material/mat.cxx @@ -153,7 +153,7 @@ SGMaterial::read_properties( const string &fg_root, const SGPropertyNode * props vector object_group_nodes = ((SGPropertyNode *)props)->getChildren("object-group"); for (unsigned int i = 0; i < object_group_nodes.size(); i++) - object_groups.push_back(new SGMatObjectGroup(object_group_nodes[i])); + object_groups.push_back(new SGMatModelGroup(object_group_nodes[i])); } diff --git a/simgear/scene/material/mat.hxx b/simgear/scene/material/mat.hxx index 12e54545..98697f0e 100644 --- a/simgear/scene/material/mat.hxx +++ b/simgear/scene/material/mat.hxx @@ -40,7 +40,7 @@ #include #include -#include "matobj.hxx" +#include "matmodel.hxx" SG_USING_STD(string); @@ -150,7 +150,7 @@ public: /** * Get a randomly-placed object for this material. */ - virtual SGMatObjectGroup * get_object_group (int index) const { + virtual SGMatModelGroup * get_object_group (int index) const { return object_groups[index]; } @@ -222,7 +222,7 @@ private: // true if texture loading deferred, and not yet loaded bool texture_loaded; - vector object_groups; + vector object_groups; // ref count so we can properly delete if we have multiple // pointers to this record diff --git a/simgear/scene/material/matobj.cxx b/simgear/scene/material/matmodel.cxx similarity index 87% rename from simgear/scene/material/matobj.cxx rename to simgear/scene/material/matmodel.cxx index 9f581d60..24f8c863 100644 --- a/simgear/scene/material/matobj.cxx +++ b/simgear/scene/material/matmodel.cxx @@ -1,4 +1,4 @@ -// matobj.cxx -- class to handle material properties +// matmodel.cxx -- class to handle models tied to a material property // // Written by Curtis Olson, started May 1998. // @@ -42,7 +42,7 @@ SG_USING_STD(map); #include #include -#include "matobj.hxx" +#include "matmodel.hxx" //////////////////////////////////////////////////////////////////////// @@ -68,10 +68,10 @@ local_file_exists( const string& path ) { //////////////////////////////////////////////////////////////////////// -// Implementation of SGMatObject. +// Implementation of SGMatModel. //////////////////////////////////////////////////////////////////////// -SGMatObject::SGMatObject (const SGPropertyNode * node, double range_m) +SGMatModel::SGMatModel (const SGPropertyNode * node, double range_m) : _models_loaded(false), _coverage_m2(node->getDoubleValue("coverage-m2", 1000000)), _range_m(range_m) @@ -106,7 +106,7 @@ SGMatObject::SGMatObject (const SGPropertyNode * node, double range_m) // load_models(); } -SGMatObject::~SGMatObject () +SGMatModel::~SGMatModel () { for (unsigned int i = 0; i < _models.size(); i++) { if (_models[i] != 0) { @@ -117,7 +117,7 @@ SGMatObject::~SGMatObject () } int -SGMatObject::get_model_count( SGModelLoader *loader, +SGMatModel::get_model_count( SGModelLoader *loader, const string &fg_root, SGPropertyNode *prop_root, double sim_time_sec ) @@ -127,7 +127,7 @@ SGMatObject::get_model_count( SGModelLoader *loader, } inline void -SGMatObject::load_models ( SGModelLoader *loader, +SGMatModel::load_models ( SGModelLoader *loader, const string &fg_root, SGPropertyNode *prop_root, double sim_time_sec ) @@ -163,7 +163,7 @@ SGMatObject::load_models ( SGModelLoader *loader, } ssgEntity * -SGMatObject::get_model( int index, +SGMatModel::get_model( int index, SGModelLoader *loader, const string &fg_root, SGPropertyNode *prop_root, @@ -174,7 +174,7 @@ SGMatObject::get_model( int index, } ssgEntity * -SGMatObject::get_random_model( SGModelLoader *loader, +SGMatModel::get_random_model( SGModelLoader *loader, const string &fg_root, SGPropertyNode *prop_root, double sim_time_sec ) @@ -188,13 +188,13 @@ SGMatObject::get_random_model( SGModelLoader *loader, } double -SGMatObject::get_coverage_m2 () const +SGMatModel::get_coverage_m2 () const { return _coverage_m2; } -SGMatObject::HeadingType -SGMatObject::get_heading_type () const +SGMatModel::HeadingType +SGMatModel::get_heading_type () const { return _heading_type; } @@ -202,10 +202,10 @@ SGMatObject::get_heading_type () const //////////////////////////////////////////////////////////////////////// -// Implementation of SGMatObjectGroup. +// Implementation of SGMatModelGroup. //////////////////////////////////////////////////////////////////////// -SGMatObjectGroup::SGMatObjectGroup (SGPropertyNode * node) +SGMatModelGroup::SGMatModelGroup (SGPropertyNode * node) : _range_m(node->getDoubleValue("range-m", 2000)) { // Load the object subnodes @@ -214,13 +214,13 @@ SGMatObjectGroup::SGMatObjectGroup (SGPropertyNode * node) for (unsigned int i = 0; i < object_nodes.size(); i++) { const SGPropertyNode * object_node = object_nodes[i]; if (object_node->hasChild("path")) - _objects.push_back(new SGMatObject(object_node, _range_m)); + _objects.push_back(new SGMatModel(object_node, _range_m)); else SG_LOG(SG_INPUT, SG_ALERT, "No path supplied for object"); } } -SGMatObjectGroup::~SGMatObjectGroup () +SGMatModelGroup::~SGMatModelGroup () { for (unsigned int i = 0; i < _objects.size(); i++) { delete _objects[i]; @@ -229,22 +229,22 @@ SGMatObjectGroup::~SGMatObjectGroup () } double -SGMatObjectGroup::get_range_m () const +SGMatModelGroup::get_range_m () const { return _range_m; } int -SGMatObjectGroup::get_object_count () const +SGMatModelGroup::get_object_count () const { return _objects.size(); } -SGMatObject * -SGMatObjectGroup::get_object (int index) const +SGMatModel * +SGMatModelGroup::get_object (int index) const { return _objects[index]; } -// end of matobj.cxx +// end of matmodel.cxx diff --git a/simgear/scene/material/matobj.hxx b/simgear/scene/material/matmodel.hxx similarity index 87% rename from simgear/scene/material/matobj.hxx rename to simgear/scene/material/matmodel.hxx index 8d92b5fd..33d769e8 100644 --- a/simgear/scene/material/matobj.hxx +++ b/simgear/scene/material/matmodel.hxx @@ -1,8 +1,6 @@ -// matobj.hxx -- a material in the scene graph. -// TODO: this class needs to be renamed. +// matmodel.hxx -- class to handle models tied to a material property // -// Written by Curtis Olson, started May 1998. -// Overhauled by David Megginson, December 2001 +// Written by David Megginson, December 2001 // // Copyright (C) 1998 - 2003 Curtis L. Olson - curt@flightgear.org // @@ -23,8 +21,8 @@ // $Id$ -#ifndef _SG_MAT_OBJ_HXX -#define _SG_MAT_OBJ_HXX +#ifndef _SG_MAT_MODEL_HXX +#define _SG_MAT_MODEL_HXX #ifndef __cplusplus # error This library requires C++ @@ -43,7 +41,7 @@ SG_USING_STD(string); -class SGMatObjectGroup; +class SGMatModelGroup; /** @@ -55,7 +53,7 @@ class SGMatObjectGroup; * different shapes of trees), but they are considered equivalent * and interchangeable. */ -class SGMatObject { +class SGMatModel { public: @@ -120,11 +118,11 @@ public: protected: - friend class SGMatObjectGroup; + friend class SGMatModelGroup; - SGMatObject (const SGPropertyNode * node, double range_m); + SGMatModel (const SGPropertyNode * node, double range_m); - virtual ~SGMatObject (); + virtual ~SGMatModel (); private: @@ -156,11 +154,11 @@ private: * Each SGMaterial instance keeps a (possibly-empty) list of * object groups for placing randomly on the scenery. */ -class SGMatObjectGroup { +class SGMatModelGroup { public: - virtual ~SGMatObjectGroup (); + virtual ~SGMatModelGroup (); /** @@ -185,21 +183,20 @@ public: * @param index The object's index, zero-based. * @return The object selected. */ - SGMatObject * get_object (int index) const; + SGMatModel * get_object (int index) const; protected: friend class SGMaterial; - SGMatObjectGroup (SGPropertyNode * node); + SGMatModelGroup (SGPropertyNode * node); private: double _range_m; - vector _objects; + vector _objects; }; - -#endif // _SG_MAT_OBJ_HXX +#endif // _SG_MAT_MODEL_HXX -- 2.39.5