Open Inventor Reference
MeVis/ThirdParty/Sources/Inventor/inventor/lib/database/include/Inventor/nodes/SoNode.h
Go to the documentation of this file.
00001 /*
00002  *
00003  *  Copyright (C) 2000 Silicon Graphics, Inc.  All Rights Reserved. 
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  *  Further, this software is distributed without any warranty that it is
00016  *  free of the rightful claim of any third person regarding infringement
00017  *  or the like.  Any license provided herein, whether implied or
00018  *  otherwise, applies only to this software file.  Patent licenses, if
00019  *  any, provided herein do not apply to combinations of this program with
00020  *  other software, or any other product whatsoever.
00021  * 
00022  *  You should have received a copy of the GNU Lesser General Public
00023  *  License along with this library; if not, write to the Free Software
00024  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025  *
00026  *  Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
00027  *  Mountain View, CA  94043, or:
00028  * 
00029  *  http://www.sgi.com 
00030  * 
00031  *  For further information regarding this notice, see: 
00032  * 
00033  *  http://oss.sgi.com/projects/GenInfo/NoticeExplan/
00034  *
00035  */
00036 
00037 
00038 /*
00039  * Copyright (C) 1990,91   Silicon Graphics, Inc.
00040  *
00041  _______________________________________________________________________
00042  ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
00043  |
00044  |   $Revision: 1.1.1.1 $
00045  |
00046  |   Description:
00047  |      This file defines the base SoNode class.
00048  |
00049  |   Author(s)          : Paul S. Strauss, Nick Thompson
00050  |
00051  ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
00052  _______________________________________________________________________
00053  */
00054 
00055 #ifndef  _SO_NODE_
00056 #define  _SO_NODE_
00057 
00058 #include <Inventor/system/SbSystem.h>
00059 #include <Inventor/fields/SoFieldContainer.h>
00060 #include <Inventor/SoLists.h>
00061 #include <Inventor/SbString.h>
00062 #include <Inventor/SoType.h>
00063 
00064 class SoAction;
00065 class SoCallbackAction;
00066 class SoChildList;
00067 class SoFieldData;
00068 class SoGLRenderAction;
00069 class SoGetBoundingBoxAction;
00070 class SoGetMatrixAction;
00071 class SoHandleEventAction;
00072 class SoInput;
00073 class SoOutput;
00074 class SoPickAction;
00075 class SoRayPickAction;
00076 class SoSearchAction;
00077 class SoWriteAction;
00078 
00079 
00080 
00083 
00101 
00102 
00103 class INVENTOR_API SoNode : public SoFieldContainer {
00104 
00105   public:
00106 
00108     void                setOverride(SbBool state);
00109 
00111     SbBool              isOverride() const              { return override; }
00112 
00114     static SoType       getClassTypeId()        { return classTypeId; }
00115 
00122     SoNode *            copy(SbBool copyConnections = FALSE) const;
00123 
00128     virtual SbBool      affectsState() const;
00129 
00135     static SoNode *     getByName(const SbName &name);
00140     static int          getByName(const SbName &name, SoNodeList &list);
00141 
00142   SoEXTENDER public:
00143 
00146     virtual void        doAction(SoAction *action);
00147 
00150     virtual void        GLRender(SoGLRenderAction *action);
00151     virtual void        callback(SoCallbackAction *action);
00152     virtual void        getBoundingBox(SoGetBoundingBoxAction *action);
00153     virtual void        getMatrix(SoGetMatrixAction *action);
00154     virtual void        handleEvent(SoHandleEventAction *action);
00155     virtual void        pick(SoPickAction *action);
00156     virtual void        rayPick(SoRayPickAction *action);
00157     virtual void        search(SoSearchAction *action);
00158     virtual void        write(SoWriteAction *action);
00159 
00163     virtual void        GLRenderBelowPath(SoGLRenderAction *action);
00164     virtual void        GLRenderInPath(SoGLRenderAction *action);
00165     virtual void        GLRenderOffPath(SoGLRenderAction *action);
00166 
00170     virtual void        grabEventsSetup();
00171     virtual void        grabEventsCleanup();
00172 
00173   SoINTERNAL public:
00174     enum Stage {
00175         FIRST_INSTANCE,         
00176         PROTO_INSTANCE,         
00177         OTHER_INSTANCE          
00178     };
00179 
00181     static void         initClass();
00182 
00184     static void         initClasses();
00185 
00187     virtual void        startNotify();
00188 
00190     virtual void        notify(SoNotList *list);
00191 
00193     uint32_t            getNodeId() const       { return uniqueId; }
00194 
00196     static uint32_t     getNextNodeId() { return nextUniqueId; }
00197 
00199     virtual SoChildList *getChildren() const;
00200 
00202     virtual void        writeInstance(SoOutput *out);
00203 
00206     static int          getActionMethodIndex(SoType t)
00207             { return t.getData(); }
00208 
00211     virtual SoNode *    addToCopyDict() const;
00212 
00215     virtual void        copyContents(const SoFieldContainer *fromFC,
00216                                      SbBool copyConnections);
00217 
00219     virtual SoFieldContainer *  copyThroughConnection() const;
00220 
00221   protected:
00224     static const SoFieldData **getFieldDataPtr() { return NULL; }
00225 
00227     SoNode();
00228     virtual ~SoNode();
00229 
00231     uint32_t    uniqueId;
00232 
00234     static uint32_t nextUniqueId;
00235 
00237     static int          nextActionMethodIndex;
00238 
00239   private:
00240     static SoType       classTypeId;    
00241 
00242     SbBool              override;       
00243 
00246     static void         callbackS(SoAction *, SoNode *);
00247     static void         GLRenderS(SoAction *, SoNode *);
00248     static void         getBoundingBoxS(SoAction *, SoNode *);
00249     static void         getMatrixS(SoAction *, SoNode *);
00250     static void         handleEventS(SoAction *, SoNode *);
00251     static void         pickS(SoAction *, SoNode *);
00252     static void         rayPickS(SoAction *, SoNode *);
00253     static void         searchS(SoAction *, SoNode *);
00254     static void         writeS(SoAction *, SoNode *);
00255 };
00256 
00257 #endif /* _SO_NODE_ */