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

SoEngine.h
1/**************************************************************************\
2 *
3 * This file is part of the Coin 3D visualization library.
4 * Copyright (C) by Kongsberg Oil & Gas Technologies.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * ("GPL") version 2 as published by the Free Software Foundation.
9 * See the file LICENSE.GPL at the root directory of this source
10 * distribution for additional information about the GNU GPL.
11 *
12 * For using Coin with software that can not be combined with the GNU
13 * GPL, and for taking advantage of the additional benefits of our
14 * support services, please contact Kongsberg Oil & Gas Technologies
15 * about acquiring a Coin Professional Edition License.
16 *
17 * See http://www.coin3d.org/ for more information.
18 *
19 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
20 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
21 *
22\**************************************************************************/
23
24#ifndef COIN_SOENGINE_H
25#define COIN_SOENGINE_H
26
27#include <Inventor/fields/SoFieldContainer.h>
28
29class SoEngineList;
30class SoEngineOutput;
33
34class COIN_DLL_API SoEngine : public SoFieldContainer {
36
37public:
38 static void initClass(void);
39 static void initClasses(void);
40 static SoType getClassTypeId(void);
41
42 void evaluateWrapper(void);
43
44 virtual int getOutputs(SoEngineOutputList & l) const;
45 SoEngineOutput * getOutput(const SbName & outputname) const;
46 SbBool getOutputName(const SoEngineOutput * output, SbName & outputname) const;
47 virtual const SoEngineOutputData * getOutputData(void) const = 0;
48 static SoEngine * getByName(const SbName & name);
49 static int getByName(const SbName & name, SoEngineList & el);
50
51 SbBool isNotifying(void) const;
52 virtual void notify(SoNotList * nl);
53
54 SoEngine * copy(void) const;
55 virtual SoFieldContainer * copyThroughConnection(void) const;
56 SbBool shouldCopy(void) const;
57
58 virtual void writeInstance(SoOutput * out);
59
60
61protected:
62 SoEngine(void);
63 virtual ~SoEngine(void);
64 virtual void evaluate(void) = 0;
65
66 virtual SbBool readInstance(SoInput * in, unsigned short flags);
67 virtual void inputChanged(SoField * which);
68
69 static const SoFieldData ** getInputDataPtr(void);
70 static const SoEngineOutputData ** getOutputDataPtr(void);
71
72 void writeOutputTypes(SoOutput * out);
73
74private:
75 virtual void destroy(void); // overrides SoBase::destroy()
76
77 static SoType classTypeId;
78
79 enum InternalEngineFlags {
80 FLAG_ISNOTIFYING = (1 << 0),
81 FLAG_ISDIRTY = (1 << 1)
82 };
83
84 unsigned int flags;
85
86 // needed for handling connections from SoEngineOutput
87 friend class SoEngineOutput;
88 void setDirty(void);
89};
90
91#if !defined(COIN_INTERNAL)
92#include <Inventor/engines/SoEngineOutput.h>
93#endif // COIN_INTERNAL
94
95#endif // !COIN_SOENGINE_H
The SbName class stores strings by reference.
Definition SbName.h:31
virtual void destroy(void)
Definition SoBase.cpp:286
The SoEngineList class is a container for SoEngine objects.
Definition SoEngineList.h:31
The SoEngineOutputData class is a container for a prototype set of outputs.
Definition SoOutputData.h:40
The SoEngineOutputList class is a container for SoEngineOutput objects.
Definition SoEngineOutputList.h:31
The SoEngineOutput class is the output slots in SoEngine instances.
Definition SoEngineOutput.h:36
SoEngine is the base class for Coin engines.
Definition SoEngine.h:34
virtual void evaluate(void)=0
virtual const SoEngineOutputData * getOutputData(void) const =0
The SoFieldContainer class is a base class for all classes that contain fields.
Definition SoFieldContainer.h:34
virtual void writeInstance(SoOutput *out)
Definition SoFieldContainer.cpp:715
virtual void notify(SoNotList *l)
Definition SoFieldContainer.cpp:636
virtual SoFieldContainer * copyThroughConnection(void) const
Definition SoFieldContainer.cpp:804
virtual SbBool readInstance(SoInput *in, unsigned short flags)
Definition SoFieldContainer.cpp:1038
The SoFieldData class is a container for a prototype set of fields.
Definition SoFieldData.h:39
The SoField class is the top-level abstract base class for fields.
Definition SoField.h:38
The SoInput class is an abstraction of file import functionality.
Definition SoInput.h:52
The SoNotList class is a list of SoNotRec notification records.
Definition SoNotification.h:34
The SoOutput class is an abstraction of an output stream.
Definition SoOutput.h:42
The SoType class is the basis for the run-time type system in Coin.
Definition SoType.h:50

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

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