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

ScXMLStateMachine.h
00001 #ifndef COIN_SCXMLSTATEMACHINE_H
00002 #define COIN_SCXMLSTATEMACHINE_H
00003 
00004 /**************************************************************************\
00005  *
00006  *  This file is part of the Coin 3D visualization library.
00007  *  Copyright (C) by Kongsberg Oil & Gas Technologies.
00008  *
00009  *  This library is free software; you can redistribute it and/or
00010  *  modify it under the terms of the GNU General Public License
00011  *  ("GPL") version 2 as published by the Free Software Foundation.
00012  *  See the file LICENSE.GPL at the root directory of this source
00013  *  distribution for additional information about the GNU GPL.
00014  *
00015  *  For using Coin with software that can not be combined with the GNU
00016  *  GPL, and for taking advantage of the additional benefits of our
00017  *  support services, please contact Kongsberg Oil & Gas Technologies
00018  *  about acquiring a Coin Professional Edition License.
00019  *
00020  *  See http://www.coin3d.org/ for more information.
00021  *
00022  *  Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
00023  *  http://www.sim.no/  sales@sim.no  coin-support@coin3d.org
00024  *
00025 \**************************************************************************/
00026 
00027 #include <Inventor/scxml/ScXMLObject.h>
00028 
00029 #include <Inventor/SbName.h>
00030 #include <Inventor/tools/SbPimplPtr.h>
00031 
00032 class ScXMLEvent;
00033 class ScXMLDocument;
00034 class ScXMLStateMachine;
00035 
00036 typedef void ScXMLStateMachineDeleteCB(void * userdata,
00037                                        ScXMLStateMachine * statemachine);
00038 typedef void ScXMLStateChangeCB(void * userdata,
00039                                 ScXMLStateMachine * statemachine,
00040                                 const char * stateidentifier,
00041                                 SbBool enterstate,
00042                                 SbBool success);
00043 
00044 class COIN_DLL_API ScXMLStateMachine : public ScXMLObject {
00045   typedef ScXMLObject inherited;
00046   SCXML_OBJECT_HEADER(ScXMLStateMachine)
00047 
00048 public:
00049   static void initClass(void);
00050 
00051   ScXMLStateMachine(void);
00052   virtual ~ScXMLStateMachine(void);
00053 
00054   virtual void setName(const SbName & name);
00055   const SbName & getName(void) const;
00056 
00057   virtual void setDescription(ScXMLDocument * document);
00058   const ScXMLDocument * getDescription(void) const;
00059 
00060   virtual void initialize(void);
00061 
00062   virtual void queueEvent(const ScXMLEvent * event, SbBool dealloc = FALSE);
00063   virtual void queueEvent(const SbName & eventid);
00064   virtual SbBool processEventQueue(void);
00065 
00066   virtual SbBool isActive(void) const;
00067   virtual SbBool isFinished(void) const;
00068 
00069   virtual const ScXMLEvent * getCurrentEvent(void) const;
00070 
00071   virtual int getNumActiveStates(void) const;
00072   virtual const ScXMLObject * getActiveState(int idx) const;
00073 
00074   virtual const ScXMLObject * getState(const char * identifier) const;
00075 
00076   virtual void addDeleteCallback(ScXMLStateMachineDeleteCB * callback,
00077                                  void * userdata);
00078   virtual void removeDeleteCallback(ScXMLStateMachineDeleteCB * callback,
00079                                     void * userdata);
00080 
00081   virtual void addStateChangeCallback(ScXMLStateChangeCB * callback,
00082                                       void * userdata);
00083   virtual void removeStateChangeCallback(ScXMLStateChangeCB * callback,
00084                                          void * userdata);
00085 protected:
00086   virtual SbBool processOneEvent(const ScXMLEvent * event);
00087 
00088   virtual void setCurrentEvent(const ScXMLEvent * event);
00089 
00090 private:
00091   ScXMLStateMachine(const ScXMLStateMachine & rhs); // N/A
00092   ScXMLStateMachine & operator = (const ScXMLStateMachine & rhs); // N/A
00093 
00094   class PImpl;
00095   SbPimplPtr<PImpl> pimpl;
00096 
00097 }; // ScXMLStateMachine
00098 
00099 #endif // !COIN_SCXMLSTATEMACHINE_H

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

Generated on Thu Apr 28 2011 03:43:03 for Coin by Doxygen 1.7.4.