Added use of typedef to help clean up the readability a little and replaced a copy list with a reference.
This commit is contained in:
@@ -25,6 +25,8 @@ class dxfFile;
|
||||
class codeValue;
|
||||
class dxfEntity;
|
||||
|
||||
typedef std::vector<osg::ref_ptr<dxfEntity> > EntityList;
|
||||
|
||||
class dxfBlock : public osg::Referenced
|
||||
{
|
||||
public:
|
||||
@@ -32,10 +34,11 @@ public:
|
||||
virtual ~dxfBlock() {}
|
||||
inline const std::string& getName() const { return _name; }
|
||||
virtual void assign(dxfFile* dxf, codeValue& cv);
|
||||
std::vector<osg::ref_ptr<dxfEntity> > & getEntityList() { return _entityList; }
|
||||
EntityList& getEntityList() { return _entityList; }
|
||||
const osg::Vec3d& getPosition() const;
|
||||
|
||||
protected:
|
||||
std::vector<osg::ref_ptr<dxfEntity> > _entityList;
|
||||
EntityList _entityList;
|
||||
dxfEntity* _currentEntity;
|
||||
std::string _name;
|
||||
osg::Vec3d _position;
|
||||
|
||||
@@ -751,8 +751,8 @@ dxfInsert::drawScene(scene* sc)
|
||||
sc->pushMatrix(m);
|
||||
sc->pushMatrix(back);
|
||||
|
||||
std::vector<osg::ref_ptr<dxfEntity> > l = _block->getEntityList();
|
||||
for (std::vector<osg::ref_ptr<dxfEntity> >::iterator itr = l.begin(); itr != l.end(); ++itr) {
|
||||
EntityList& l = _block->getEntityList();
|
||||
for (EntityList::iterator itr = l.begin(); itr != l.end(); ++itr) {
|
||||
dxfBasicEntity* e = (*itr)->getEntity();
|
||||
if (e) {
|
||||
e->drawScene(sc);
|
||||
|
||||
@@ -78,7 +78,7 @@ void dxfEntities::assign(dxfFile* dxf, codeValue& cv)
|
||||
void
|
||||
dxfEntities::drawScene(scene* sc)
|
||||
{
|
||||
for (std::vector<osg::ref_ptr<dxfEntity> >::iterator itr = _entityList.begin();
|
||||
for (EntityList::iterator itr = _entityList.begin();
|
||||
itr != _entityList.end(); ++itr)
|
||||
(*itr)->drawScene(sc);
|
||||
}
|
||||
|
||||
@@ -85,8 +85,8 @@ public:
|
||||
virtual void drawScene(scene* sc);
|
||||
|
||||
protected:
|
||||
dxfEntity* _currentEntity;
|
||||
std::vector<osg::ref_ptr<dxfEntity> > _entityList;
|
||||
dxfEntity* _currentEntity;
|
||||
EntityList _entityList;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user