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) 1998-2007 by Systems in Motion. All rights reserved.
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 Systems in Motion about acquiring
15  * a Coin Professional Edition License.
16  *
17  * See http://www.coin3d.org/ for more information.
18  *
19  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, 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 
29 class SoEngineList;
30 class SoEngineOutput;
31 class SoEngineOutputList;
32 class SoEngineOutputData;
33 
34 class COIN_DLL_API SoEngine : public SoFieldContainer {
36 
37 public:
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 
61 protected:
62  SoEngine(void);
63  virtual ~SoEngine();
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 
74 private:
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
SoBase::getNamedBase
static SoBase * getNamedBase(const SbName &name, SoType type)
Definition: SoBase.cpp:1072
SoEngine::copy
SoEngine * copy(void) const
Definition: SoEngine.cpp:437
SoBase::destroy
virtual void destroy(void)
Definition: SoBase.cpp:405
SbName
The SbName class stores strings by reference.
Definition: SbName.h:31
SoEngineList
The SoEngineList class is a container for SoEngine objects.
Definition: SoEngineList.h:31
SoEngine::getByName
static SoEngine * getByName(const SbName &name)
Definition: SoEngine.cpp:266
SoEngine::SoEngine
SoEngine(void)
Definition: SoEngine.cpp:90
SoNotList::getLastRec
SoNotRec * getLastRec(void) const
Definition: SoNotification.cpp:149
SoOutput
The SoOutput class is an abstraction of an output stream.
Definition: SoOutput.h:42
SoEngineOutput
The SoEngineOutput class is the output slots in SoEngine instances.
Definition: SoEngineOutput.h:36
SoEngine::inputChanged
virtual void inputChanged(SoField *which)
Definition: SoEngine.cpp:287
SoEngine::shouldCopy
SbBool shouldCopy(void) const
Definition: SoEngine.cpp:495
SoBase::getName
virtual SbName getName(void) const
Definition: SoBase.cpp:730
SoEngine::readInstance
virtual SbBool readInstance(SoInput *in, unsigned short flags)
Definition: SoEngine.cpp:391
SoNotRec::setType
void setType(const SoNotRec::Type type)
Definition: SoNotRec.cpp:62
SoEngine::getOutputData
virtual const SoEngineOutputData * getOutputData(void) const =0
SoFieldContainer::checkCopy
static SoFieldContainer * checkCopy(const SoFieldContainer *orig)
Definition: SoFieldContainer.cpp:797
SoNotRec
The SoNotRec class specifies records for notification lists.
Definition: SoNotRec.h:33
SoEngine::getOutputs
virtual int getOutputs(SoEngineOutputList &l) const
Definition: SoEngine.cpp:210
SoEngine::getOutputName
SbBool getOutputName(const SoEngineOutput *output, SbName &outputname) const
Definition: SoEngine.cpp:244
SoBase::writeHeader
SbBool writeHeader(SoOutput *out, SbBool isgroup, SbBool isengine) const
Definition: SoBase.cpp:1315
SoFieldContainer::isNotifyEnabled
SbBool isNotifyEnabled(void) const
Definition: SoFieldContainer.cpp:459
SoFieldContainer::getFields
virtual int getFields(SoFieldList &l) const
Definition: SoFieldContainer.cpp:318
SoField
The SoField class is the top-level abstract base class for fields.
Definition: SoField.h:38
SoBase::getNamedBases
static int getNamedBases(const SbName &name, SoBaseList &baselist, SoType type)
Definition: SoBase.cpp:1096
SoEngine::getInputDataPtr
static const SoFieldData ** getInputDataPtr(void)
Definition: SoEngine.cpp:374
SoEngine::writeOutputTypes
void writeOutputTypes(SoOutput *out)
Definition: SoEngine.cpp:414
SoType
The SoType class is the basis for the run-time type system in Coin.
Definition: SoType.h:50
SoFieldContainer::readInstance
virtual SbBool readInstance(SoInput *in, unsigned short flags)
Definition: SoFieldContainer.cpp:953
SbName::getString
const char * getString(void) const
Definition: SbName.cpp:278
SoDebugError::postInfo
static void postInfo(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:334
SoFieldContainer::writeInstance
virtual void writeInstance(SoOutput *out)
Definition: SoFieldContainer.cpp:640
SoNotList::append
void append(SoNotRec *const rec)
Definition: SoNotification.cpp:66
SoEngine::copyThroughConnection
virtual SoFieldContainer * copyThroughConnection(void) const
Definition: SoEngine.cpp:466
SoFieldContainer::initCopyDict
static void initCopyDict(void)
Definition: SoFieldContainer.cpp:744
SoEngine::evaluate
virtual void evaluate(void)=0
SoFieldContainer::findCopy
static SoFieldContainer * findCopy(const SoFieldContainer *orig, const SbBool copyconnections)
Definition: SoFieldContainer.cpp:831
SoFieldData
The SoFieldData class is a container for a prototype set of fields.
Definition: SoFieldData.h:39
SoFieldList
The SoFieldList class is a container for pointers to SoField objects.
Definition: SoFieldList.h:31
SoFieldContainer::copyDone
static void copyDone(void)
Definition: SoFieldContainer.cpp:929
SoFieldContainer
The SoFieldContainer class is a base class for all classes that contain fields.
Definition: SoFieldContainer.h:35
SoBase::ref
void ref(void) const
Definition: SoBase.cpp:574
SoFieldContainer::addCopy
static void addCopy(const SoFieldContainer *orig, const SoFieldContainer *copy)
Definition: SoFieldContainer.cpp:765
SoType::createInstance
void * createInstance(void) const
Definition: SoType.cpp:803
SoEngine::initClasses
static void initClasses(void)
Definition: SoEngine.cpp:162
SoEngine::isNotifying
SbBool isNotifying(void) const
Definition: SoEngine.cpp:523
SoFieldContainer::notify
virtual void notify(SoNotList *l)
Definition: SoFieldContainer.cpp:562
SoEngine::getOutput
SoEngineOutput * getOutput(const SbName &outputname) const
Definition: SoEngine.cpp:227
SoBase::getTypeId
virtual SoType getTypeId(void) const =0
SoType::createType
static const SoType createType(const SoType parent, const SbName name, const instantiationMethod method=(instantiationMethod) NULL, const uint16_t data=0)
Definition: SoType.cpp:256
SoEngine::writeInstance
virtual void writeInstance(SoOutput *out)
Definition: SoEngine.cpp:402
SoEngineOutputList
The SoEngineOutputList class is a container for SoEngineOutput objects.
Definition: SoEngineOutputList.h:31
SoBase::writeFooter
void writeFooter(SoOutput *out) const
Definition: SoBase.cpp:1428
SoNotList::getLastField
SoField * getLastField(void) const
Definition: SoNotification.cpp:167
SoInput
The SoInput class is an abstraction of file import functionality.
Definition: SoInput.h:55
SoEngine::evaluateWrapper
void evaluateWrapper(void)
Definition: SoEngine.cpp:343
SoType::getName
SbName getName(void) const
Definition: SoType.cpp:628
SoEngine::notify
virtual void notify(SoNotList *nl)
Definition: SoEngine.cpp:293
SoBase::unrefNoDelete
void unrefNoDelete(void) const
Definition: SoBase.cpp:665
SoEngine::~SoEngine
virtual ~SoEngine()
Definition: SoEngine.cpp:98
SoNotList
The SoNotList class is a list of SoNotRec notification records.
Definition: SoNotification.h:34
SoEngine::getOutputDataPtr
static const SoEngineOutputData ** getOutputDataPtr(void)
Definition: SoEngine.cpp:384
SoEngine
SoEngine is the base class for Coin engines.
Definition: SoEngine.h:34
SoNotRec::getType
SoNotRec::Type getType(void) const
Definition: SoNotRec.cpp:80
SoFieldContainer::copyThroughConnection
virtual SoFieldContainer * copyThroughConnection(void) const
Definition: SoFieldContainer.cpp:728

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Wed Jul 24 2019 for Coin by Doxygen. 1.8.17