Commit 3f4817b0 authored by Ken Martin's avatar Ken Martin
Browse files

uses new collections

parent 13effd64
......@@ -36,7 +36,11 @@ public:
vlRenderWindow();
char *GetClassName() {return "vlRenderWindow";};
void PrintSelf(ostream& os, vlIndent indent);
void AddRenderers(vlRenderer *);
void RemoveRenderers(vlRenderer *);
vlRendererCollection *GetRenderers() {return &(this->Renderers);};
virtual void Render();
virtual void Frame() = 0;
virtual void Start() = 0;
......
......@@ -50,6 +50,10 @@ public:
void AddLights(vlLight *);
void AddActors(vlActor *);
void RemoveLights(vlLight *);
void RemoveActors(vlActor *);
vlLightCollection *GetLights() {return &(this->Lights);};
vlActorCollection *GetActors() {return &(this->Actors);};
void SetActiveCamera(vlCamera *);
vlCamera *GetActiveCamera();
......
......@@ -44,7 +44,13 @@ void vlRenderWindow::AddRenderers(vlRenderer *ren)
{
// we are its parent
ren->SetRenderWindow(this);
this->Renderers.AddMember(ren);
this->Renderers.AddItem(ren);
}
void vlRenderWindow::RemoveRenderers(vlRenderer *ren)
{
// we are its parent
this->Renderers.RemoveItem(ren);
}
void vlRenderWindow::SetSize(int a[2])
......
......@@ -63,12 +63,22 @@ vlCamera *vlRenderer::GetActiveCamera()
void vlRenderer::AddLights(vlLight *light)
{
this->Lights.AddMember(light);
this->Lights.AddItem(light);
}
void vlRenderer::AddActors(vlActor *actor)
{
this->Actors.AddMember(actor);
this->Actors.AddItem(actor);
}
void vlRenderer::RemoveLights(vlLight *light)
{
this->Lights.RemoveItem(light);
}
void vlRenderer::RemoveActors(vlActor *actor)
{
this->Actors.RemoveItem(actor);
}
void vlRenderer::DoLights()
......@@ -123,9 +133,9 @@ void vlRenderer::ResetCamera()
all_bounds[1] = all_bounds[3] = all_bounds[5] = -LARGE_FLOAT;
// loop through actors
for (num = 1; num <= this->Actors.GetNumberOfMembers(); num++)
for (num = 1; num <= this->Actors.GetNumberOfItems(); num++)
{
anActor = this->Actors.GetMember(num);
anActor = this->Actors.GetItem(num);
// if it's invisible, we can skip the rest
if ( anActor->GetVisibility() )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment