basic/geometry/IGS/IGS_Group.cpp

Go to the documentation of this file.
00001 #include <assert.h>
00002 #include "IGS_Group.h"
00003 
00004 //=============================================================================
00005 // AddObject
00006 //
00007 // Description: adds an object to the group
00008 //=============================================================================
00009 void IGS_Group::AddObject( IGS_Object* object )
00010 {
00011         assert( object != NULL );
00012         this->objects.push_back( object );
00013 }
00014 
00015 IGS_Group::~IGS_Group()
00016 {
00017         int i;
00018         for( i = 0; i < this->objects.size(); i++ )
00019         {
00020                 IGS_Object*& object = objects[ i ];
00021                 delete object;
00022                 object = NULL;
00023         }
00024 }
00025 
00026 //=============================================================================
00027 // Render
00028 //
00029 // Description: renders an object to the OpenGL context using the controller 
00030 //=============================================================================
00031 void IGS_Group::Prepare( const IGS_Controller& controller )
00032 {
00033         int i;
00034         int size = this->objects.size();
00035         for( i = 0; i < size; i++ )
00036         {
00037                 IGS_Object* object = this->objects[ i ];
00038                 object->Prepare( controller );
00039         }
00040 }
00041 
00042 //=============================================================================
00043 // Render
00044 //
00045 // Description: renders an object to the OpenGL context using the controller 
00046 //=============================================================================
00047 void IGS_Group::Render( const IGS_Controller& controller ) const
00048 {
00049         int i;
00050         int size = this->objects.size();
00051         for( i = 0; i < size; i++ )
00052         {
00053                 IGS_Object* object = this->objects[ i ];
00054                 object->Render( controller );
00055         }
00056 }

Generated on Sat Apr 1 21:30:32 2006 for Motion Planning Kernel by  doxygen 1.4.6-NO