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

SoProtoInstance.h
1 #ifndef COIN_SOPROTOINSTANCE_H
2 #define COIN_SOPROTOINSTANCE_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) by Kongsberg Oil & Gas Technologies.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Kongsberg Oil & Gas Technologies
18  * about acquiring a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 // NB: This is work-in-progress, and the API might change from day to
28 // day. Do not use this class unless you are prepared for this.
29 // pederb, 2002-05-28
30 
31 #include <Inventor/nodes/SoNode.h>
32 #include <Inventor/nodes/SoSubNode.h>
33 
34 class SoProto;
35 class SoSensor;
36 
37 class COIN_DLL_API SoProtoInstance : public SoNode {
38  typedef SoNode inherited;
39 
40  // The following definitions are used instead of SO_NODE_HEADER() to
41  // let SoProtoInstance have dynamic handling of SoFieldData objects.
42 
43  PRIVATE_NODE_TYPESYSTEM_HEADER();
44 protected:
45  virtual const SoFieldData * getFieldData(void) const;
46 private:
47  SoFieldData * classfielddata;
48 
49 public:
50  static void initClass(void);
51 
52  SoProtoInstance(SoProto * proto,
53  const SoFieldData * deffielddata);
54 
55  static SoProtoInstance * findProtoInstance(const SoNode * rootnode);
56  void setRootNode(SoNode * root);
57  SoNode * getRootNode(void);
58 
59  SoProto * getProtoDefinition(void) const;
60  SbName getProtoName(void) const;
61 
62  virtual void write(SoWriteAction * action);
63 
64 protected:
65  virtual ~SoProtoInstance();
66  virtual SbBool readInstance(SoInput * in, unsigned short flags);
67  virtual const char * getFileFormatName(void) const;
68 
69 private:
70 
71  static void sensorCB(void * data, SoSensor * sensor);
72  static void cleanupClass(void);
73  void copyFieldData(const SoFieldData * src);
74 
75  class SoProtoInstanceP * pimpl;
76 };
77 
78 #endif // !COIN_SOPROTOINSTANCE_H

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

Generated on Mon Mar 17 2014 18:54:30 for Coin by Doxygen 1.8.1.2.