proj home

Files   Classes   Functions   Hierarchy  

gobjContainerSwitch Class Reference

A graphics container where each is a switch. More...

#include <gobjbase.h>

Inheritance diagram for gobjContainerSwitch:
Collaboration diagram for gobjContainerSwitch:

List of all members.

Public Member Functions

 gobjContainerSwitch (boolc cleanup_)
 On death the switches are deleted but what is inside them is deleted on the clients cleanup policy.
void draw ()
 Draw the scene.
void nuke ()
 Delete the switches which contain the memory policy of what they are pointing to.
 ~gobjContainerSwitch ()
 Clean up memory, at the least the switches.
gobjSwitchpush (gobj *g)
 g is wrapped in a gobjSwitch and pushed to gcontainer.

Public Attributes

gobjContainer gcontainer
 The graphics being displayed.
vector< gobjSwitch<> * > gswitch
 Turn on and off individual graphics.


Detailed Description

A graphics container where each is a switch.

Useful for a scene where there are multiple objects that may or may not be visible. By default all objects are visible.

Use in a similar way to gobjContainer.

Definition at line 283 of file gobjbase.h.


Constructor & Destructor Documentation

gobjContainerSwitch::gobjContainerSwitch ( boolc  cleanup_  ) 

On death the switches are deleted but what is inside them is deleted on the clients cleanup policy.

Definition at line 155 of file gobjbase.cpp.

00156   : gcontainer(cleanup_)
00157 {
00158 }

gobjContainerSwitch::~gobjContainerSwitch (  ) 

Clean up memory, at the least the switches.

Definition at line 187 of file gobjbase.cpp.

References nuke().

00188 {
00189   nuke();
00190 }


Member Function Documentation

void gobjContainerSwitch::draw (  )  [inline, virtual]

Draw the scene.

Implements gobj.

Definition at line 297 of file gobjbase.h.

References gobjContainer::draw(), gcontainer, and GOBJDEBUGCODE.

Referenced by d3tessdraw::draw(), and d3tessdraw::meshupdate().

void gobjContainerSwitch::nuke (  ) 

Delete the switches which contain the memory policy of what they are pointing to.

Definition at line 178 of file gobjbase.cpp.

References gcontainer, gswitch, and gobjContainer::vg.

Referenced by ~gobjContainerSwitch().

00179 {
00180   uint sz=gswitch.size();
00181   for (uint i=0; i<sz; ++i)
00182     delete gswitch[i];
00183   gswitch.clear();
00184   gcontainer.vg.clear();
00185 }

gobjSwitch * gobjContainerSwitch::push ( gobj g  ) 

g is wrapped in a gobjSwitch and pushed to gcontainer.

Definition at line 160 of file gobjbase.cpp.

References gobjContainer::cleanup, gcontainer, gswitch, and gobjContainer::vg.

Referenced by d3tessdraw::d3tessdraw().

00161 { 
00162   assert(g!=0); 
00163   gobjSwitch<> * gs = new gobjSwitch<>(g,true,gcontainer.cleanup);
00164   assert(gs!=0);
00165   gswitch.push_back(gs);
00166   gcontainer.vg.push_back(gs); 
00167 
00168   assert(gcontainer.vg.size()==gswitch.size());
00169 
00170   return gs;
00171 }


Member Data Documentation

The graphics being displayed.

Definition at line 288 of file gobjbase.h.

Referenced by draw(), nuke(), and push().

Turn on and off individual graphics.

Definition at line 290 of file gobjbase.h.

Referenced by displaymenu(), main(), nuke(), and push().


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:49:58 2011 for Chelton Evans Source by  doxygen 1.5.8