00001 /* 00002 * QSceneTreeNode.h 00003 * $Id: QSceneTreeNode.h,v 1.11 2001/09/28 11:06:08 mjanich Exp $ 00004 * 00005 * Copyright (C) 2001 Richard Guenther 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 * 00021 */ 00022 00023 // Description : Definition of the QSceneTreeNode class 00024 // Purpose : 00025 // 00026 00027 #ifndef __QSCENETREENODE_H 00028 #define __QSCENETREENODE_H 00029 00030 #include <qevent.h> 00031 00032 #include "CMat4D.h" 00033 #include "CBoundingBox3D.h" 00034 #include "CTree.h" 00035 #include "GLDrawable.h" 00036 00037 00042 class QSceneTreeNode : public CTreeNode { 00043 public: 00045 QSceneTreeNode() 00046 : CTreeNode(), 00047 m_pTransformation(NULL), 00048 m_ViewingMode(normal) {}; 00050 ~QSceneTreeNode(); 00051 00053 const CMat4D *getTransformation() const { return m_pTransformation; }; 00055 void resetTransformation(); 00057 void applyTransformation(const CMat4D&); 00058 00061 virtual CBoundingBox3D getBoundingBox() const; 00062 00064 enum ViewingMode { hidden, disabled, normal, highlighted, boxed }; 00066 ViewingMode getViewingMode() const { return m_ViewingMode; }; 00068 virtual void setViewingMode(ViewingMode mode) { m_ViewingMode = mode; }; 00069 00071 virtual void requestUpdate() { 00072 ((QSceneTreeNode *)getParent())->requestUpdate(); 00073 }; 00074 00075 protected: 00076 CMat4D *m_pTransformation; 00077 ViewingMode m_ViewingMode; 00078 }; 00079 00080 00083 class QSceneTreeDrawable : public QSceneTreeNode, public GLDrawable { 00084 public: 00086 QSceneTreeDrawable() : QSceneTreeNode() {}; 00088 ~QSceneTreeDrawable(){}; 00089 00091 virtual bool event(const QEvent *pqEvent) { return false; }; 00092 }; 00093 00094 00095 00096 #endif