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_SOSCENEMANAGER_H 00021 #define COIN_SOSCENEMANAGER_H 00022 00023 #include <Inventor/SbColor.h> 00024 #include <Inventor/SbVec2s.h> 00025 00026 class SbViewportRegion; 00027 class SoEvent; 00028 class SoGLRenderAction; 00029 class SoHandleEventAction; 00030 class SoNode; 00031 class SoNodeSensor; 00032 class SoOneShotSensor; 00033 class SoSensor; 00034 00035 class SoSceneManager; 00036 typedef void SoSceneManagerRenderCB(void * userdata, SoSceneManager * mgr); 00037 00038 00039 class COIN_DLL_API SoSceneManager { 00040 public: 00041 SoSceneManager(void); 00042 virtual ~SoSceneManager(); 00043 virtual void render(const SbBool clearwindow = TRUE, 00044 const SbBool clearzbuffer = TRUE); 00045 virtual SbBool processEvent(const SoEvent * const event); 00046 void reinitialize(void); 00047 void scheduleRedraw(void); 00048 virtual void setSceneGraph(SoNode * const sceneroot); 00049 virtual SoNode * getSceneGraph(void) const; 00050 void setWindowSize(const SbVec2s & newsize); 00051 const SbVec2s & getWindowSize(void) const; 00052 void setSize(const SbVec2s & newsize); 00053 const SbVec2s & getSize(void) const; 00054 void setOrigin(const SbVec2s & newOrigin); 00055 const SbVec2s & getOrigin(void) const; 00056 void setViewportRegion(const SbViewportRegion & newRegion); 00057 const SbViewportRegion & getViewportRegion(void) const; 00058 void setBackgroundColor(const SbColor & color); 00059 const SbColor & getBackgroundColor(void) const; 00060 void setBackgroundIndex(const int index); 00061 int getBackgroundIndex(void) const; 00062 void setRGBMode(const SbBool onOrOff); 00063 SbBool isRGBMode(void) const; 00064 virtual void activate(void); 00065 virtual void deactivate(void); 00066 void setRenderCallback(SoSceneManagerRenderCB * f, 00067 void * const userData = NULL); 00068 SbBool isAutoRedraw(void) const; 00069 void setRedrawPriority(const uint32_t priority); 00070 uint32_t getRedrawPriority(void) const; 00071 void setAntialiasing(const SbBool smoothing, const int numPasses); 00072 void getAntialiasing(SbBool & smoothing, int & numPasses) const; 00073 void setGLRenderAction(SoGLRenderAction * const action); 00074 SoGLRenderAction * getGLRenderAction(void) const; 00075 void setHandleEventAction(SoHandleEventAction * hea); 00076 SoHandleEventAction * getHandleEventAction(void) const; 00077 00078 static uint32_t getDefaultRedrawPriority(void); 00079 static void enableRealTimeUpdate(const SbBool flag); 00080 static SbBool isRealTimeUpdateEnabled(void); 00081 00082 protected: 00083 int isActive(void) const; 00084 void redraw(void); 00085 00086 private: 00087 class SoSceneManagerP * pimpl; 00088 friend class SoSceneManagerP; 00089 }; 00090 00091 #endif // !COIN_SOSCENEMANAGER_H