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
34class SoProto;
35class SoSensor;
36
37class 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();
44protected:
45 virtual const SoFieldData * getFieldData(void) const;
46private:
47 SoFieldData * classfielddata;
48
49public:
50 static void initClass(void);
51
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
64protected:
65 virtual ~SoProtoInstance();
66 virtual SbBool readInstance(SoInput * in, unsigned short flags);
67 virtual const char * getFileFormatName(void) const;
68
69private:
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
The SbName class stores strings by reference.
Definition SbName.h:31
virtual const char * getFileFormatName(void) const
Definition SoBase.cpp:1326
virtual const SoFieldData * getFieldData(void) const
Definition SoFieldContainer.cpp:738
The SoFieldData class is a container for a prototype set of fields.
Definition SoFieldData.h:39
The SoInput class is an abstraction of file import functionality.
Definition SoInput.h:52
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:47
virtual SbBool readInstance(SoInput *in, unsigned short flags)
Definition SoNode.cpp:1466
virtual void write(SoWriteAction *action)
Definition SoNode.cpp:1217
The SoProtoInstance class handles PROTO instances.
Definition SoProtoInstance.h:37
The SoProto class handles PROTO definitions.
Definition SoProto.h:41
The SoSensor class is the abstract base class for all sensors.
Definition SoSensor.h:34
The SoWriteAction class writes a scene graph to file.
Definition SoWriteAction.h:33

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

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.