proj home

Files   Classes   Functions   Hierarchy  

graphicsImmediateDeferredSwitch Class Reference

Wraps the objects in switches added to either immediate or deferred containers. More...

#include <graphicsImmediateDeferredSwitch.h>

Inheritance diagram for graphicsImmediateDeferredSwitch:
Collaboration diagram for graphicsImmediateDeferredSwitch:

List of all members.

Public Member Functions

 ~graphicsImmediateDeferredSwitch ()
 Destructor for memory cleanup.
void toggle (uintc index)
 Toggle the graphics display with associated index.
boolc isdrawn (uintc index) const
 Is the switch turned on?
void pushdeferred (uint &index, gobj *p)
 Wraps graphics in a switch, assumes p made from new.
template<class T >
void pushdeferred (uint &index, T &data_, void(T::*fn_)())
 The function is called to write the graphics to the global graphics stream.
template<class T >
void pushdeferred (uint &index, T &data_, void(T::*fn_)(gobjContainer &))
 The function is called to write the graphics to the gobjContainer.
void pushimmediate (uint &index, gobj *p)
 Wraps the graphics in a switch and pushes to immediate graphics.

Public Attributes

vector< gobjSwitch<> * > gswitches
 Both immediate and deferred graphics which are created and indexed from the push functions.


Detailed Description

Wraps the objects in switches added to either immediate or deferred containers.

Indexes allow the object to be accessed again through the switch.

Assumed that graphics pushed is made from new operator.

Example
  g04 = new graphicsImmediateDeferredSwitch();
  g04->push(g04switch,*this,&graphicsImmediateDeferredTestTri::addshape01);

Definition at line 25 of file graphicsImmediateDeferredSwitch.h.


Constructor & Destructor Documentation

graphicsImmediateDeferredSwitch::~graphicsImmediateDeferredSwitch (  ) 

Destructor for memory cleanup.

Definition at line 24 of file graphicsImmediateDeferredSwitch.cpp.

References gswitches.

00025 {
00026   for (uint i=0; i<gswitches.size(); ++i)
00027   {
00028     delete gswitches[i]->x;
00029     gswitches[i]->x=0;
00030   }
00031 }


Member Function Documentation

boolc graphicsImmediateDeferredSwitch::isdrawn ( uintc  index  )  const

Is the switch turned on?

Definition at line 42 of file graphicsImmediateDeferredSwitch.cpp.

References gswitches.

00043 {
00044   assert(index<gswitches.size());
00045 
00046   return gswitches[index]->isdrawn;
00047 }

template<class T >
void graphicsImmediateDeferredSwitch::pushdeferred ( uint index,
T data_,
void(T::*)(gobjContainer &)  fn_ 
) [inline]

The function is called to write the graphics to the gobjContainer.

Definition at line 54 of file graphicsImmediateDeferredSwitch.h.

References gobjcallbackcontainercreatenew(), and pushdeferred().

Referenced by pushdeferred().

00055     { pushdeferred(index, gobjcallbackcontainercreatenew(data_,fn_)); }

template<class T >
void graphicsImmediateDeferredSwitch::pushdeferred ( uint index,
T data_,
void(T::*)()  fn_ 
) [inline]

The function is called to write the graphics to the global graphics stream.

Definition at line 48 of file graphicsImmediateDeferredSwitch.h.

References gobjcallbackcreatenew(), and pushdeferred().

Referenced by pushdeferred().

00049     { pushdeferred(index, gobjcallbackcreatenew(data_,fn_)); } 

void graphicsImmediateDeferredSwitch::pushdeferred ( uint index,
gobj p 
)

Wraps graphics in a switch, assumes p made from new.

Definition at line 12 of file graphicsImmediateDeferredSwitch.cpp.

Referenced by mazedisp03::construct(), tessD1disp01< TESS, PT, INDX >::displayDeferred(), graphicsImmediateDeferredTestTri::graphicscreate04(), graphicsImmediateDeferredTestTri::graphicscreate05(), and graphicsImmediateDeferredTestTri::graphicscreate06().

00016 {
00017   assert(p);
00018 
00019   index = gswitches.size();
00020   gswitches.push_back(new gobjSwitch<>(p,true,false));
00021   graphicsDeferred.push(gswitches[index]);
00022 }

void graphicsImmediateDeferredSwitch::pushimmediate ( uint index,
gobj p 
)

Wraps the graphics in a switch and pushes to immediate graphics.

Definition at line 34 of file graphicsImmediateDeferredSwitch.cpp.

References graphicsImmediateDeferred::graphicsImmediate, gswitches, and gobjContainer::push().

Referenced by mazedisp03::construct().

00035 {
00036   index = gswitches.size();
00037   gswitches.push_back(new gobjSwitch<>(p,true,false));
00038   graphicsImmediate.push(gswitches[index]);
00039 }

void graphicsImmediateDeferredSwitch::toggle ( uintc  index  ) 

Toggle the graphics display with associated index.

Definition at line 4 of file graphicsImmediateDeferredSwitch.cpp.

References gswitches.

00005 {
00006   assert(index<gswitches.size());
00007 
00008   gswitches[index]->toggle();
00009 }


Member Data Documentation

Both immediate and deferred graphics which are created and indexed from the push functions.

Definition at line 31 of file graphicsImmediateDeferredSwitch.h.

Referenced by isdrawn(), simplexD1tessapp01::keyboard(), pushimmediate(), toggle(), and ~graphicsImmediateDeferredSwitch().


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

Generated on Fri Mar 4 00:50:02 2011 for Chelton Evans Source by  doxygen 1.5.8