arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

pbuffGlift.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 // 10/02/02     Aaron Lefohn    Scientific Computing and Imaging Institute      
00003 // School of Computing                  University of Utah
00004 //
00005 //  This library is free software; you can redistribute it and/or
00006 //  modify it under the terms of the GNU Lesser General Public
00007 //  License as published by the Free Software Foundation; either
00008 //  version 2.1 of the License, or (at your option) any later version.
00009 //
00010 //  This library is distributed in the hope that it will be useful,
00011 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 //  Lesser General Public License for more details.
00014 //
00015 //  You should have received a copy of the GNU Lesser General Public
00016 //  License along with this library; if not, write to the Free Software
00017 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 /////////////////////////////////////////////////////////////////////////////////
00019 
00020 #include <state/pbuffGlift.h>
00021 
00022 using namespace glift;
00023 
00024 PBuffGlift::PBuffGlift( PBuffer* pbuffer )
00025 : m_pbuff( pbuffer ),
00026 m_initCB( NULL ),
00027 m_deletePBuff(false)
00028 {}
00029 
00030 PBuffGlift::PBuffGlift( int xDim, int yDim, uint mode, PBuffRenCTX renderCTX )
00031 : m_pbuff( new PBuffer(xDim, yDim, mode, renderCTX) ),
00032 m_initCB( NULL ),
00033 m_deletePBuff(true)
00034 {}
00035 
00036 PBuffGlift::PBuffGlift( int xDim, int yDim, uint mode, VoidFuncPtr initCB, PBuffRenCTX renderCTX )
00037 : m_pbuff( new PBuffer(xDim, yDim, mode, renderCTX) ) ,
00038 m_initCB( new Command0(initCB) ),
00039 m_deletePBuff(true)
00040 {
00041    init();
00042 }
00043 
00044 PBuffGlift::PBuffGlift( int xDim, int yDim, uint mode, Command* initCB, PBuffRenCTX renderCTX )
00045 : m_pbuff( new PBuffer(xDim, yDim, mode, renderCTX) ) ,
00046 m_initCB( initCB ),
00047 m_deletePBuff(true)
00048 {
00049    init();
00050 }
00051 
00052 PBuffGlift::~PBuffGlift()
00053 {
00054    if( m_deletePBuff ) {
00055       delete m_pbuff;
00056    }
00057    delete m_initCB;
00058 }
00059 
00060 // Initialize RenCTX via 'm_initCB'
00061 void PBuffGlift::init()
00062 {
00063    if( m_initCB ) {
00064       m_pbuff->enable(true);
00065       m_initCB->execute();
00066       m_pbuff->disable();
00067    }
00068 }
00069 
00070 
00071 

Send questions, comments, and bug reports to:
jmk