Coin Logo http://www.sim.no/
http://www.coin3d.org/

SoProtoInstance.h
00001 #ifndef COIN_SOPROTOINSTANCE_H
00002 #define COIN_SOPROTOINSTANCE_H
00003 
00004 /**************************************************************************\
00005  *
00006  *  This file is part of the Coin 3D visualization library.
00007  *  Copyright (C) by Kongsberg Oil & Gas Technologies.
00008  *
00009  *  This library is free software; you can redistribute it and/or
00010  *  modify it under the terms of the GNU General Public License
00011  *  ("GPL") version 2 as published by the Free Software Foundation.
00012  *  See the file LICENSE.GPL at the root directory of this source
00013  *  distribution for additional information about the GNU GPL.
00014  *
00015  *  For using Coin with software that can not be combined with the GNU
00016  *  GPL, and for taking advantage of the additional benefits of our
00017  *  support services, please contact Kongsberg Oil & Gas Technologies
00018  *  about acquiring a Coin Professional Edition License.
00019  *
00020  *  See http://www.coin3d.org/ for more information.
00021  *
00022  *  Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
00023  *  http://www.sim.no/  sales@sim.no  coin-support@coin3d.org
00024  *
00025 \**************************************************************************/
00026 
00027 // NB: This is work-in-progress, and the API might change from day to
00028 // day. Do not use this class unless you are prepared for this.
00029 // pederb, 2002-05-28
00030 
00031 #include <Inventor/nodes/SoNode.h>
00032 #include <Inventor/nodes/SoSubNode.h>
00033 
00034 class SoProto;
00035 class SoSensor;
00036 
00037 class COIN_DLL_API SoProtoInstance : public SoNode {
00038   typedef SoNode inherited;
00039 
00040   // The following definitions are used instead of SO_NODE_HEADER() to
00041   // let SoProtoInstance have dynamic handling of SoFieldData objects.
00042 
00043   PRIVATE_NODE_TYPESYSTEM_HEADER();
00044 protected:
00045   virtual const SoFieldData * getFieldData(void) const;
00046 private:
00047   SoFieldData * classfielddata;
00048 
00049 public:
00050   static void initClass(void);
00051 
00052   SoProtoInstance(SoProto * proto,
00053                   const SoFieldData * deffielddata);
00054 
00055   static SoProtoInstance * findProtoInstance(const SoNode * rootnode); 
00056   void setRootNode(SoNode * root);
00057   SoNode * getRootNode(void);
00058 
00059   SoProto * getProtoDefinition(void) const;
00060   SbName getProtoName(void) const;
00061   
00062   virtual void write(SoWriteAction * action);
00063 
00064 protected:
00065   virtual ~SoProtoInstance();
00066   virtual SbBool readInstance(SoInput * in, unsigned short flags);
00067   virtual const char * getFileFormatName(void) const;
00068 
00069 private:
00070 
00071   static void sensorCB(void * data, SoSensor * sensor);
00072   static void cleanupClass(void);
00073   void copyFieldData(const SoFieldData * src);
00074 
00075   class SoProtoInstanceP * pimpl;
00076 };
00077 
00078 #endif // !COIN_SOPROTOINSTANCE_H

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Fri Dec 11 2015 03:24:55 for Coin by Doxygen 1.7.6.1.