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_SOSTATE_H 00021 #define COIN_SOSTATE_H 00022 00023 #include <Inventor/SbBasic.h> 00024 #include <stdio.h> 00025 00026 class SoAction; 00027 class SoTypeList; 00028 class SoElement; 00029 00030 class COIN_DLL_API SoState { 00031 public: 00032 SoState(SoAction * action, 00033 const SoTypeList & enabledelements); 00034 ~SoState(void); 00035 00036 SoAction * getAction(void) const; 00037 00038 SoElement * getElement(const int stackindex); 00039 const SoElement * getConstElement(const int stackindex) const; 00040 00041 void push(void); 00042 void pop(void); 00043 00044 void print(FILE * const file = stdout) const; 00045 00046 SbBool isElementEnabled(const int stackindex) const; 00047 00048 int getDepth(void) const; 00049 00050 void setCacheOpen(const SbBool flag); 00051 SbBool isCacheOpen(void) const; 00052 00053 void lazyEvaluate(void) const; 00054 00055 SoElement * getElementNoPush(const int stackindex) const; 00056 00057 private: 00058 SoElement ** stack; 00059 class SoStateP * pimpl; 00060 }; 00061 00062 // used very often, and is therefore inlined 00063 inline const SoElement * 00064 SoState::getConstElement(const int stackindex) const 00065 { 00066 return this->stack[stackindex]; 00067 } 00068 00069 #endif // !COIN_SOSTATE_H