Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::Particles Class Reference
[Particles]

#include <OSGParticles.h>

Inheritance diagram for osg::Particles:

osg::ParticlesBase osg::MaterialDrawable osg::MaterialDrawableBase osg::Drawable osg::DrawableBase osg::NodeCore osg::AttachmentContainer osg::FieldContainer List of all members.

Modes

*enum osg::Particles::{
  Points = 0, Lines, ViewDirQuads, ViewerQuads,
  Arrows, ViewerArrows, Rectangles, LastMode
ModeE
enum osg::Particles::{ Any = 0, BackToFront, FrontToBackDrawOrderE

Public Types

typedef ParticlesPtr Ptr

Public Member Functions

Parents
*MFNodePtrgetParents (void)
const MFNodePtrgetParents (void) const
MFNodePtrgetMFParents (void)
Volume
*virtual void invalidateVolume (void)
Parents
*MFNodePtrgetParents (void)
const MFNodePtrgetParents (void) const
MFNodePtrgetMFParents (void)
Volume
*virtual void invalidateVolume (void)
Parents
*MFNodePtrgetParents (void)
const MFNodePtrgetParents (void) const
MFNodePtrgetMFParents (void)
Volume
*virtual void invalidateVolume (void)
Parents
*MFNodePtrgetParents (void)
const MFNodePtrgetParents (void) const
MFNodePtrgetMFParents (void)
Volume
*virtual void invalidateVolume (void)
Sync
*virtual void changed (BitVector whichField, UInt32 origin)
 react to field changes
Output
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
 output the instance for debug purposes
Draw
*Action::ResultE drawPrimitives (DrawActionBase *action)
Field Set
*void setPositions (const GeoPositionsPtr &value)
 Set the value of the Particles::_sfPositions field.
void setSecPositions (const GeoPositionsPtr &value)
 Set the value of the Particles::_sfSecPositions field.
void setColors (const GeoColorsPtr &value)
 Set the value of the Particles::_sfColors field.
void setNormals (const GeoNormalsPtr &value)
 Set the value of the Particles::_sfNormals field.
void setMaterial (const MaterialPtr &value)
 Set the value of the MaterialDrawable::_sfMaterial field.
FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get
*SFUInt32getSFMode (void)
 Get the Particles::_sfMode field.
SFGeoPositionsPtrgetSFPositions (void)
 Get the Particles::_sfPositions field.
MFVec3fgetMFSizes (void)
 Get the Particles::_mfSizes field.
SFGeoPositionsPtrgetSFSecPositions (void)
 Get the Particles::_sfSecPositions field.
SFGeoColorsPtrgetSFColors (void)
 Get the Particles::_sfColors field.
SFGeoNormalsPtrgetSFNormals (void)
 Get the Particles::_sfNormals field.
MFInt32getMFIndices (void)
 Get the Particles::_mfIndices field.
MFReal32getMFTextureZs (void)
 Get the Particles::_mfTextureZs field.
SFUInt32getSFDrawOrder (void)
 Get the Particles::_sfDrawOrder field.
SFBoolgetSFDynamic (void)
 Get the Particles::_sfDynamic field.
SFParticleBSPTreegetSFBsp (void)
 Get the Particles::_sfBsp field.
UInt32getMode (void)
 Get the value of the Particles::_sfMode field.
const UInt32getMode (void) const
 Get the value of the Particles::_sfMode field.
GeoPositionsPtrgetPositions (void)
 Get the value of the Particles::_sfPositions field.
const GeoPositionsPtrgetPositions (void) const
 Get the value of the Particles::_sfPositions field.
GeoPositionsPtrgetSecPositions (void)
 Get the value of the Particles::_sfSecPositions field.
const GeoPositionsPtrgetSecPositions (void) const
 Get the value of the Particles::_sfSecPositions field.
GeoColorsPtrgetColors (void)
 Get the value of the Particles::_sfColors field.
const GeoColorsPtrgetColors (void) const
 Get the value of the Particles::_sfColors field.
GeoNormalsPtrgetNormals (void)
 Get the value of the Particles::_sfNormals field.
const GeoNormalsPtrgetNormals (void) const
 Get the value of the Particles::_sfNormals field.
UInt32getDrawOrder (void)
 Get the value of the Particles::_sfDrawOrder field.
const UInt32getDrawOrder (void) const
 Get the value of the Particles::_sfDrawOrder field.
bool & getDynamic (void)
 Get the value of the Particles::_sfDynamic field.
const bool & getDynamic (void) const
 Get the value of the Particles::_sfDynamic field.
ParticleBSPTreegetBsp (void)
 Get the value of the Particles::_sfBsp field.
const ParticleBSPTreegetBsp (void) const
 Get the value of the Particles::_sfBsp field.
Vec3fgetSizes (const UInt32 index)
 Get the value of the index element the Particles::_mfSizes field.
MFVec3fgetSizes (void)
 Get the Particles::_mfSizes field.
const MFVec3fgetSizes (void) const
 Get the Particles::_mfSizes field.
Int32getIndices (const UInt32 index)
 Get the value of the index element the Particles::_mfIndices field.
MFInt32getIndices (void)
 Get the Particles::_mfIndices field.
const MFInt32getIndices (void) const
 Get the Particles::_mfIndices field.
Real32getTextureZs (const UInt32 index)
 Get the value of the index element the Particles::_mfTextureZs field.
MFReal32getTextureZs (void)
 Get the Particles::_mfTextureZs field.
const MFReal32getTextureZs (void) const
 Get the Particles::_mfTextureZs field.
Field Set
*void setMode (const UInt32 &value)
 Set the value of the Particles::_sfMode field.
void setDrawOrder (const UInt32 &value)
 Set the value of the Particles::_sfDrawOrder field.
void setDynamic (const bool &value)
 Set the value of the Particles::_sfDynamic field.
void setBsp (const ParticleBSPTree &value)
 Set the value of the Particles::_sfBsp field.
Binary Access
*virtual UInt32 getBinSize (const BitVector &whichField)
virtual void copyToBin (BinaryDataHandler &pMem, const BitVector &whichField)
virtual void copyFromBin (BinaryDataHandler &pMem, const BitVector &whichField)
Copy
*virtual FieldContainerPtr shallowCopy (void) const
action handler
Action::ResultE drawActionHandler (Action *action)
 initialize the static features of the class, e.g. action callbacks
Action::ResultE renderActionHandler (Action *action)
 initialize the static features of the class, e.g. action callbacks
Field Get
*SFMaterialPtrgetSFMaterial (void)
 Get the MaterialDrawable::_sfMaterial field.
MaterialPtrgetMaterial (void)
 Get the value of the MaterialDrawable::_sfMaterial field.
const MaterialPtrgetMaterial (void) const
 Get the value of the MaterialDrawable::_sfMaterial field.
Parents
*MFNodePtrgetParents (void)
const MFNodePtrgetParents (void) const
MFNodePtrgetMFParents (void)
Volume
*virtual void invalidateVolume (void)

Static Public Member Functions

Class Get
*static FieldContainerTypegetClassType (void)
 access the type of the class
static UInt32 getClassTypeId (void)
 access the numerical type of the class
Construction
*static ParticlesPtr create (void)
 create a new instance of the class
static ParticlesPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype

Static Public Attributes

static const osg::BitVector ModeFieldMask
static const osg::BitVector PositionsFieldMask
static const osg::BitVector SizesFieldMask
static const osg::BitVector SecPositionsFieldMask
static const osg::BitVector ColorsFieldMask
static const osg::BitVector NormalsFieldMask
static const osg::BitVector IndicesFieldMask
static const osg::BitVector TextureZsFieldMask
static const osg::BitVector DrawOrderFieldMask
static const osg::BitVector DynamicFieldMask
static const osg::BitVector PumpFieldMask
static const osg::BitVector BspFieldMask
static const osg::BitVector MTInfluenceMask
static const osg::BitVector MaterialFieldMask
static const BitVector ParentsFieldMask = (1 << NodeCore::ParentsFieldId )
static const BitVector AttachmentsFieldMask
static const BitVector NextFieldMask
CoredNodePtr helper
*static const bool isNodeCore = true
CoredNodePtr helper
*static const bool isNodeCore = true
CoredNodePtr helper
*static const bool isNodeCore = true
CoredNodePtr helper
*static const bool isNodeCore = true
static stat elem
*static StatElemDesc< StatIntElemstatNTriangles
static StatElemDesc< StatIntElemstatNLines
static StatElemDesc< StatIntElemstatNPoints
static StatElemDesc< StatIntElemstatNVertices
static StatElemDesc< StatIntElemstatNPrimitives
CoredNodePtr helper
*static const bool isNodeCore = true

Protected Member Functions

Sync
void executeSyncImpl (NodeCore *pOther, const BitVector &whichField)
MT Destruction
*virtual void onDestroy (void)
Set / Get Parents
*void addParent (const NodePtr &parent)
void subParent (const NodePtr &parent)
Pointer
*NodeCorePtr getPtr (void) const
Sync
void executeSyncImpl (NodeCore *pOther, const BitVector &whichField)
MT Destruction
*virtual void onDestroy (void)
Set / Get Parents
*void addParent (const NodePtr &parent)
void subParent (const NodePtr &parent)
Pointer
*NodeCorePtr getPtr (void) const
Transformation
*virtual void accumulateMatrix (Matrix &result)
Sync
void executeSyncImpl (NodeCore *pOther, const BitVector &whichField)
MT Destruction
*virtual void onDestroy (void)
Set / Get Parents
*void addParent (const NodePtr &parent)
void subParent (const NodePtr &parent)
Pointer
*NodeCorePtr getPtr (void) const
Transformation
*virtual void accumulateMatrix (Matrix &result)
Sync
void executeSyncImpl (NodeCore *pOther, const BitVector &whichField)
Set / Get Parents
*void addParent (const NodePtr &parent)
void subParent (const NodePtr &parent)
Pointer
*NodeCorePtr getPtr (void) const
Transformation
*virtual void accumulateMatrix (Matrix &result)
Constructors
Particles (void)
 Particles (const Particles &source)
Destructors
*virtual ~Particles (void)
NodeCore Specific
*void adjustVolume (Volume &volume)
Particles Specific
*Int32calcIndex (DrawActionBase *action, UInt32 &len, Int32 *index=NULL)
ParticlesDrawerfindDrawer (void)
Sync
*void executeSyncImpl (ParticlesBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync
*void executeSyncImpl (MaterialDrawableBase *pOther, const BitVector &whichField)
Sync
*void executeSyncImpl (DrawableBase *pOther, const BitVector &whichField)
Sync
void executeSyncImpl (NodeCore *pOther, const BitVector &whichField)
MT Destruction
*virtual void onDestroy (void)
Set / Get Parents
*void addParent (const NodePtr &parent)
void subParent (const NodePtr &parent)
Pointer
*NodeCorePtr getPtr (void) const
Transformation
*virtual void accumulateMatrix (Matrix &result)

Protected Attributes

Fields
*MFNodePtr _parents
Fields
*MFNodePtr _parents
Fields
*MFNodePtr _parents
Fields
*MFNodePtr _parents
Fields
*SFUInt32 _sfMode
SFGeoPositionsPtr _sfPositions
MFVec3f _mfSizes
SFGeoPositionsPtr _sfSecPositions
SFGeoColorsPtr _sfColors
SFGeoNormalsPtr _sfNormals
MFInt32 _mfIndices
MFReal32 _mfTextureZs
SFUInt32 _sfDrawOrder
SFBool _sfDynamic
SFParticleBSPTree _sfBsp
Fields
*SFMaterialPtr _sfMaterial
Fields
*MFNodePtr _parents

Private Types

typedef ParticlesBase Inherited

Private Member Functions

void operator= (const Particles &source)

Static Private Member Functions

static void initMethod (void)
 initialize the static features of the class, e.g. action callbacks

Friends

class FieldContainer
class ParticlesBase

Detailed Description

See Particles for details.

Definition at line 56 of file OSGParticles.h.


Member Typedef Documentation

typedef ParticlesBase osg::Particles::Inherited [private]
 

Reimplemented from osg::ParticlesBase.

Definition at line 60 of file OSGParticles.h.

typedef ParticlesPtr osg::ParticlesBase::Ptr [inherited]
 

Reimplemented from osg::MaterialDrawableBase.

Definition at line 101 of file OSGParticlesBase.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
Points 
Lines 
ViewDirQuads 
ViewerQuads 
Arrows 
ViewerArrows 
Rectangles 
LastMode 

Reimplemented from osg::ParticlesBase.

Definition at line 69 of file OSGParticles.h.

anonymous enum
 

Enumerator:
Any 
BackToFront 
FrontToBack 

Definition at line 73 of file OSGParticles.h.


Constructor & Destructor Documentation

Particles::Particles void   )  [protected]
 

Definition at line 100 of file OSGParticles.cpp.

00100                          :
00101     Inherited()
00102 {
00103 }

Particles::Particles const Particles source  )  [protected]
 

Definition at line 105 of file OSGParticles.cpp.

00105                                             :
00106     Inherited(source)
00107 {
00108 }

Particles::~Particles void   )  [protected, virtual]
 

Definition at line 110 of file OSGParticles.cpp.

References osg::ParticlesBase::_sfColors, osg::MaterialDrawableBase::_sfMaterial, osg::ParticlesBase::_sfNormals, osg::ParticlesBase::_sfPositions, osg::ParticlesBase::_sfSecPositions, osg::beginEditCP(), osg::endEditCP(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, and osg::subRefCP().

00111 {
00112     ParticlesPtr thisP(*this);
00113 
00114     if(_sfPositions.getValue() != NullFC)
00115     {
00116         beginEditCP(_sfPositions.getValue(), Attachment::ParentsFieldMask);
00117         {
00118             _sfPositions.getValue()->subParent(thisP);
00119         }
00120         endEditCP(_sfPositions.getValue(), Attachment::ParentsFieldMask);
00121 
00122         subRefCP(_sfPositions.getValue());
00123     }
00124 
00125     if(_sfSecPositions.getValue() != NullFC)
00126     {
00127         beginEditCP(_sfSecPositions.getValue(), Attachment::ParentsFieldMask);
00128         {
00129             _sfSecPositions.getValue()->subParent(thisP);
00130         }
00131         endEditCP(_sfSecPositions.getValue(), Attachment::ParentsFieldMask);
00132 
00133         subRefCP(_sfSecPositions.getValue());
00134     }
00135 
00136     if(_sfColors.getValue() != NullFC)
00137     {
00138         beginEditCP(_sfColors.getValue(), Attachment::ParentsFieldMask);
00139         {
00140             _sfColors.getValue()->subParent(thisP);
00141         }
00142         endEditCP(_sfColors.getValue(), Attachment::ParentsFieldMask);
00143 
00144         subRefCP(_sfColors.getValue());
00145     }
00146 
00147     if(_sfNormals.getValue() != NullFC)
00148     {
00149         beginEditCP(_sfNormals.getValue(), Attachment::ParentsFieldMask);
00150         {
00151             _sfNormals.getValue()->subParent(thisP);
00152         }
00153         endEditCP(_sfNormals.getValue(), Attachment::ParentsFieldMask);
00154 
00155         subRefCP(_sfNormals.getValue());
00156     }
00157 
00158     subRefCP(_sfMaterial.getValue());
00159 }


Member Function Documentation

void Particles::changed BitVector  whichField,
UInt32  origin
[virtual]
 

Reimplemented from osg::MaterialDrawable.

Definition at line 163 of file OSGParticles.cpp.

References osg::NodeCore::_parents, osg::ParticlesBase::_sfColors, osg::MaterialDrawableBase::_sfMaterial, osg::ParticlesBase::_sfNormals, osg::ParticlesBase::_sfPositions, osg::ParticlesBase::_sfSecPositions, osg::ChangedOrigin::Abstract, osg::ChangedOrigin::AbstrCheckValid, osg::ChangedOrigin::AbstrIncRefCount, osg::addRefCP(), osg::MaterialDrawable::changed(), osg::ParticlesBase::ColorsFieldMask, osg::ParticleBSPTree::destroy(), osg::ParticlesBase::getBsp(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::MaterialDrawableBase::MaterialFieldMask, osg::ParticlesBase::NormalsFieldMask, osg::NullFC, osg::ParticlesBase::PositionsFieldMask, osg::ParticlesBase::SecPositionsFieldMask, setColors(), setMaterial(), setNormals(), setPositions(), setSecPositions(), osg::SField< FieldTypeT, fieldNameSpace >::setValue(), and osg::MField< FieldTypeT, fieldNameSpace >::size().

00164 {
00165     if(whichField & PositionsFieldMask)
00166     {
00167         for(UInt32 i = 0; i < _parents.size(); i++)
00168         {
00169             _parents[i]->invalidateVolume();
00170         }
00171         getBsp().destroy();
00172 
00173         if(origin & ChangedOrigin::Abstract)
00174         {
00175             if(origin & ChangedOrigin::AbstrCheckValid)
00176             {
00177                 ParticlesPtr thisP(*this);
00178 
00179                 if(_sfPositions.getValue()                    != NullFC &&
00180                    _sfPositions.getValue()->findParent(thisP) ==     -1 )
00181                 {
00182                     GeoPositionsPtr pPos = _sfPositions.getValue();
00183 
00184                     _sfPositions.setValue(NullFC);
00185 
00186                     setPositions(pPos);
00187                 }
00188             }
00189             else if(origin & ChangedOrigin::AbstrIncRefCount)
00190             {
00191                 addRefCP(_sfPositions.getValue());
00192             }
00193             else
00194             {
00195                 GeoPositionsPtr pPos = _sfPositions.getValue();
00196 
00197                 _sfPositions.setValue(NullFC);
00198 
00199                 setPositions(pPos);
00200             }
00201         }
00202     }
00203 
00204     if(whichField & SecPositionsFieldMask)
00205     {
00206         if(origin & ChangedOrigin::Abstract)
00207         {
00208             if(origin & ChangedOrigin::AbstrCheckValid)
00209             {
00210                 ParticlesPtr thisP(*this);
00211 
00212                 if(_sfSecPositions.getValue()                    != NullFC &&
00213                    _sfSecPositions.getValue()->findParent(thisP) ==     -1 )
00214                 {
00215                     GeoPositionsPtr pPos = _sfSecPositions.getValue();
00216 
00217                     _sfSecPositions.setValue(NullFC);
00218 
00219                     setSecPositions(pPos);
00220                 }
00221             }
00222             else if(origin & ChangedOrigin::AbstrIncRefCount)
00223             {
00224                 addRefCP(_sfSecPositions.getValue());
00225             }
00226             else
00227             {
00228                 GeoPositionsPtr pPos = _sfSecPositions.getValue();
00229 
00230                 _sfSecPositions.setValue(NullFC);
00231 
00232                 setSecPositions(pPos);
00233             }
00234         }
00235     }
00236 
00237     if(whichField & ColorsFieldMask)
00238     {
00239         if(origin & ChangedOrigin::Abstract)
00240         {
00241             if(origin & ChangedOrigin::AbstrCheckValid)
00242             {
00243                 ParticlesPtr thisP(*this);
00244 
00245                 if(_sfColors.getValue()                    != NullFC &&
00246                    _sfColors.getValue()->findParent(thisP) ==     -1 )
00247                 {
00248                     GeoColorsPtr pCol = _sfColors.getValue();
00249 
00250                     _sfColors.setValue(NullFC);
00251 
00252                     setColors(pCol);
00253                 }
00254             }
00255             else if(origin & ChangedOrigin::AbstrIncRefCount)
00256             {
00257                 addRefCP(_sfColors.getValue());
00258             }
00259             else
00260             {
00261                 GeoColorsPtr pCol = _sfColors.getValue();
00262 
00263                 _sfColors.setValue(NullFC);
00264 
00265                 setColors(pCol);
00266             }
00267         }
00268     }
00269 
00270     if(whichField & NormalsFieldMask)
00271     {
00272         if(origin & ChangedOrigin::Abstract)
00273         {
00274             if(origin & ChangedOrigin::AbstrCheckValid)
00275             {
00276                 ParticlesPtr thisP(*this);
00277 
00278                 if(_sfNormals.getValue()                    != NullFC &&
00279                    _sfNormals.getValue()->findParent(thisP) ==     -1 )
00280                 {
00281                     GeoNormalsPtr pNorm = _sfNormals.getValue();
00282 
00283                     _sfNormals.setValue(NullFC);
00284 
00285                     setNormals(pNorm);
00286                 }
00287             }
00288             else if(origin & ChangedOrigin::AbstrIncRefCount)
00289             {
00290                 addRefCP(_sfNormals.getValue());
00291             }
00292             else
00293             {
00294                 GeoNormalsPtr pNorm = _sfNormals.getValue();
00295 
00296                 _sfNormals.setValue(NullFC);
00297 
00298                 setNormals(pNorm);
00299             }
00300         }
00301     }
00302 
00303     if(whichField & MaterialFieldMask)
00304     {
00305         if(origin & ChangedOrigin::Abstract)
00306         {
00307             if(origin & ChangedOrigin::AbstrIncRefCount)
00308             {
00309                 addRefCP(_sfMaterial.getValue());
00310             }
00311             else
00312             {
00313                 MaterialPtr pMat = _sfMaterial.getValue();
00314                 
00315                 _sfMaterial.setValue(NullFC);
00316                 
00317                 setMaterial(pMat);
00318             }
00319         }
00320     }
00321 
00322     Inherited::changed(whichField, origin);
00323 }

void Particles::dump UInt32  uiIndent = 0,
const BitVector  bvFlags = 0
const [virtual]
 

Reimplemented from osg::MaterialDrawable.

Definition at line 327 of file OSGParticles.cpp.

References SLOG.

00329 {
00330     SLOG << "Dump Particles NI" << std::endl;
00331 }

Action::ResultE Particles::drawPrimitives DrawActionBase action  )  [virtual]
 

Low-level Draw method that pumps OpenGL commands.

Reimplemented from osg::MaterialDrawable.

Definition at line 2482 of file OSGParticles.cpp.

References osg::ParticlesBase::_sfDrawOrder, Any, osg::ParticleBSPTree::build(), calcIndex(), osg::Action::Continue, osg::ParticleBSPTree::created(), osg::ParticlesDrawer::draw(), osg::ParticlesDrawer::drawIndexed(), findDrawer(), FWARNING, osg::Action::getActNode(), osg::ParticlesBase::getBsp(), osg::DrawActionBase::getCameraToWorld(), osg::ParticlesBase::getColors(), osg::ParticlesBase::getDynamic(), osg::ParticlesBase::getIndices(), osg::ParticlesBase::getMFIndices(), osg::ParticlesBase::getMFSizes(), osg::ParticlesBase::getNormals(), osg::ParticlesBase::getPositions(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::MField< FieldTypeT, fieldNameSpace >::getValues(), osg::TransformationMatrix< ValueTypeT >::invert(), osg::TransformationMatrix< ValueTypeT >::mult(), osg::NullFC, osg::MField< FieldTypeT, fieldNameSpace >::size(), osg::RenderAction::top_matrix(), and osg::ParticleBSPTree::traverse().

02483 {
02484     // some variables for faster access
02485     GeoPositionsPtr  pos  = getPositions();
02486     GeoColorsPtr     col  = getColors();
02487     GeoNormalsPtr    norm = getNormals();
02488     MFVec3f         *size = getMFSizes();
02489  
02490     if((size   ->size() > 1 && size   ->size() != pos->getSize())  ||
02491        (col  != NullFC && col->getSize()  != 1 &&
02492                           col->getSize()  != pos->getSize())       ||
02493        (norm != NullFC && norm->getSize() != 1 &&
02494                           norm->getSize() != pos->getSize())
02495       )
02496     {
02497         FWARNING(("Particles::draw: inconsistent attributes "
02498                     "(p:%d s:%d c:%d)!\n",
02499                     pos->getSize(), size->size(),
02500                     (col != NullFC)? (int)col->getSize() : -1));
02501         return Action::Continue;
02502     }
02503 
02504     ParticlesDrawer *drawer = findDrawer();
02505     
02506     if(drawer == NULL)
02507     {
025