Index: Mesh.cc =================================================================== --- Mesh.cc (revision 2297) +++ Mesh.cc (working copy) @@ -172,6 +172,12 @@ throw InternalError(string("Illegal call to ") + MANTA_FUNC); } +void Mesh::remove(Object* obj) +{ + //I don't think this should be allowed. + throw InternalError(string("Illegal call to ") + MANTA_FUNC); +} + void Mesh::set( int i, Object *obj ) { //I don't think this should be allowed. Index: Group.cc =================================================================== --- Group.cc (revision 2297) +++ Group.cc (working copy) @@ -117,6 +117,13 @@ dirtybbox = true; } +void Group::remove(Object* obj) +{ + vector<Object*>::iterator iter = find(objs.begin(), objs.end(), obj); + if (iter != objs.end()) + objs.erase(iter); +} + void Group::set(size_t i, Object* obj) { ASSERT( i < objs.size() ); objs[i] = obj; Index: Mesh.h =================================================================== --- Mesh.h (revision 2297) +++ Mesh.h (working copy) @@ -72,6 +72,7 @@ //should not be allowed to use Group's add and set. virtual void add(Object* obj); + virtual void remove(Object* obj); virtual void set( int i, Object *obj ); inline MeshTriangle* get( size_t i ) { Index: Group.h =================================================================== --- Group.h (revision 2297) +++ Group.h (working copy) @@ -60,6 +60,7 @@ virtual bool isParallel() const { return true; } virtual void add(Object* obj); + virtual void remove(Object* obj); virtual void set( size_t i, Object* obj ); inline Object* get( size_t i ) {
Archive powered by MHonArc 2.6.16.