00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #include <stdlib.h>
00044 #include <stdio.h>
00045
00046 #include <OSGConfig.h>
00047 #include <OSGImage.h>
00048
00049 #include "OSGFileGrabForeground.h"
00050
00051 OSG_USING_NAMESPACE
00052
00067
00068
00069 FileGrabForeground::FileGrabForeground(void) :
00070 Inherited()
00071 {
00072 }
00073
00074 FileGrabForeground::FileGrabForeground(const FileGrabForeground &source) :
00075 Inherited(source)
00076 {
00077 }
00078
00079 FileGrabForeground::~FileGrabForeground(void)
00080 {
00081 }
00082
00083
00084
00085 void FileGrabForeground::initMethod (void)
00086 {
00087 }
00088
00089 void FileGrabForeground::changed(BitVector whichField, UInt32 origin)
00090 {
00091 Inherited::changed(whichField, origin);
00092 }
00093
00094 void FileGrabForeground::dump( UInt32 ,
00095 const BitVector ) const
00096 {
00097 SLOG << "Dump FileGrabForeground NI" << std::endl;
00098 }
00099
00100
00104 void FileGrabForeground::draw(DrawActionBase *action, Viewport *port)
00105 {
00106 if(getActive() == false)
00107 return;
00108
00109 if(getName().empty())
00110 {
00111 FWARNING(("FileGrabForeground::draw: no name ?!?\n"));
00112 return;
00113 }
00114
00115
00116 if(getImage() == NullFC)
00117 {
00118 beginEditCP(this->getPtr(), FileGrabForeground::ImageFieldMask);
00119 {
00120 ImagePtr iPtr=Image::create();
00121 iPtr->set(Image::OSG_RGB_PF, 1);
00122 setImage(iPtr);
00123 }
00124 endEditCP (this->getPtr(), FileGrabForeground::ImageFieldMask);
00125 }
00126
00127 Inherited::draw(action,port);
00128
00129 Char8 *name = new Char8 [ getName().size() + 32 ];
00130
00131
00132 sprintf(name, getName().c_str(), getFrame());
00133
00134 ImagePtr i = getImage();
00135
00136 i->write(name);
00137
00138 delete [] name;
00139
00140 if(getIncrement() != false)
00141 {
00142 beginEditCP(this->getPtr(), FileGrabForeground::FrameFieldMask);
00143 {
00144 setFrame(getFrame() + 1);
00145 }
00146 endEditCP (this->getPtr(), FileGrabForeground::FrameFieldMask);
00147 }
00148 }
00149
00150
00151
00152
00153
00154 #ifdef __sgi
00155 #pragma set woff 1174
00156 #endif
00157
00158 #ifdef OSG_LINUX_ICC
00159 #pragma warning( disable : 177 )
00160 #endif
00161
00162 namespace
00163 {
00164 static char cvsid_cpp[] = "@(#)$Id: $";
00165 static char cvsid_hpp[] = OSGFILEGRABFOREGROUND_HEADER_CVSID;
00166 static char cvsid_inl[] = OSGFILEGRABFOREGROUND_INLINE_CVSID;
00167 }