| 1 |
/* Copyright (C) 1992-1998 The Geometry Center |
| 2 |
* Copyright (C) 1998-2000 Stuart Levy, Tamara Munzner, Mark Phillips |
| 3 |
* |
| 4 |
* This file is part of Geomview. |
| 5 |
* |
| 6 |
* Geomview is free software; you can redistribute it and/or modify it |
| 7 |
* under the terms of the GNU Lesser General Public License as published |
| 8 |
* by the Free Software Foundation; either version 2, or (at your option) |
| 9 |
* any later version. |
| 10 |
* |
| 11 |
* Geomview is distributed in the hope that it will be useful, but |
| 12 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
* Lesser General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU Lesser General Public |
| 17 |
* License along with Geomview; see the file COPYING. If not, write |
| 18 |
* to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, |
| 19 |
* USA, or visit http://www.gnu.org. |
| 20 |
*/ |
| 21 |
#ifndef _QV_ELEMENT_ |
| 22 |
#define _QV_ELEMENT_ |
| 23 |
|
| 24 |
#include <QvBasic.h> |
| 25 |
|
| 26 |
class QvNode; |
| 27 |
|
| 28 |
////////////////////////////////////////////////////////////////////////////// |
| 29 |
// |
| 30 |
// The base class element; the data is a pointer to some QvNode. The |
| 31 |
// type of the node can be inferred from the use of the element |
| 32 |
// instance in a particular stack in the state. In some cases, the |
| 33 |
// "type" field is used to distinguish among various possible node |
| 34 |
// types within a single stack. |
| 35 |
// |
| 36 |
////////////////////////////////////////////////////////////////////////////// |
| 37 |
|
| 38 |
class QvElement { |
| 39 |
|
| 40 |
public: |
| 41 |
|
| 42 |
enum NodeType { |
| 43 |
// Fallback case |
| 44 |
Unknown, |
| 45 |
|
| 46 |
// Types of cameras in camera stack |
| 47 |
OrthographicCamera, |
| 48 |
PerspectiveCamera, |
| 49 |
|
| 50 |
// Types of lights in light stack |
| 51 |
DirectionalLight, |
| 52 |
PointLight, |
| 53 |
SpotLight, |
| 54 |
|
| 55 |
// Types of transformations in transformation stack |
| 56 |
NoOpTransform, // For QvTransformSeparator |
| 57 |
MatrixTransform, |
| 58 |
Rotation, |
| 59 |
Scale, |
| 60 |
Transform, |
| 61 |
Translation, |
| 62 |
|
| 63 |
// This has to be last!!! |
| 64 |
NumNodeTypes |
| 65 |
}; |
| 66 |
|
| 67 |
static const char *nodeTypeNames[NumNodeTypes]; // Names of node types |
| 68 |
|
| 69 |
int depth; // Depth of element in state |
| 70 |
QvElement *next; // Next element in stack |
| 71 |
QvNode *data; // Pointer to node containing data |
| 72 |
NodeType type; // Type of data node |
| 73 |
|
| 74 |
QvElement(); |
| 75 |
virtual ~QvElement(); |
| 76 |
|
| 77 |
// Prints contents for debugging, mostly |
| 78 |
virtual void print(); |
| 79 |
}; |
| 80 |
|
| 81 |
#endif /* _QV_ELEMENT_ */ |