00001 /**************************************************************************\ 00002 * 00003 * This file is part of the Coin 3D visualization library. 00004 * Copyright (C) 1998-2002 by Systems in Motion. All rights reserved. 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public License 00008 * version 2.1 as published by the Free Software Foundation. See the 00009 * file LICENSE.LGPL at the root directory of the distribution for 00010 * more details. 00011 * 00012 * If you want to use Coin for applications not compatible with the 00013 * LGPL, please contact SIM to acquire a Professional Edition license. 00014 * 00015 * Systems in Motion, Prof Brochs gate 6, 7030 Trondheim, NORWAY 00016 * http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097 00017 * 00018 \**************************************************************************/ 00019 00020 #ifndef COIN_SOENGINE_H 00021 #define COIN_SOENGINE_H 00022 00023 #include <Inventor/fields/SoFieldContainer.h> 00024 00025 class SoEngineList; 00026 class SoEngineOutput; 00027 class SoEngineOutputList; 00028 class SoEngineOutputData; 00029 00030 class COIN_DLL_API SoEngine : public SoFieldContainer { 00031 typedef SoFieldContainer inherited; 00032 00033 public: 00034 static void initClass(void); 00035 static void initClasses(void); 00036 static SoType getClassTypeId(void); 00037 00038 void evaluateWrapper(void); 00039 00040 virtual int getOutputs(SoEngineOutputList & l) const; 00041 SoEngineOutput * getOutput(const SbName & outputname) const; 00042 SbBool getOutputName(const SoEngineOutput * output, SbName & outputname) const; 00043 virtual const SoEngineOutputData * getOutputData(void) const = 0; 00044 static SoEngine * getByName(const SbName & name); 00045 static int getByName(const SbName & name, SoEngineList & el); 00046 00047 SbBool isNotifying(void) const; 00048 virtual void notify(SoNotList * nl); 00049 00050 SoEngine * copy(void) const; 00051 virtual SoFieldContainer * copyThroughConnection(void) const; 00052 SbBool shouldCopy(void) const; 00053 00054 virtual void writeInstance(SoOutput * out); 00055 00056 00057 protected: 00058 SoEngine(void); 00059 virtual ~SoEngine(); 00060 virtual void evaluate(void) = 0; 00061 00062 virtual SbBool readInstance(SoInput * in, unsigned short flags); 00063 virtual void inputChanged(SoField * which); 00064 00065 static const SoFieldData ** getInputDataPtr(void); 00066 static const SoEngineOutputData ** getOutputDataPtr(void); 00067 00068 void writeOutputTypes(SoOutput * out); 00069 00070 private: 00071 virtual void destroy(void); // overloads SoBase::destroy() 00072 00073 static SoType classTypeId; 00074 unsigned int flags; 00075 }; 00076 00077 #if !defined(COIN_INTERNAL) 00078 #include <Inventor/engines/SoEngineOutput.h> 00079 #endif // COIN_INTERNAL 00080 00081 #endif // !COIN_SOENGINE_H