aboutsummaryrefslogtreecommitdiff
path: root/tool_src/QvLib/QvState.h
blob: 433f8f23c2104551663a757d3e0b7713c002bfc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef  _QV_STATE_
#define  _QV_STATE_

#include <QvElement.h>

//[MSH_START]
#include "VrmlFile.h"
//[MSH_END]

class QvState {

  public:

    // Stack indices, based on type of elements in them:
    enum StackIndex {
	CameraIndex,
	Coordinate3Index,
	LightIndex,
	MaterialBindingIndex,
	MaterialIndex,
	NormalBindingIndex,
	NormalIndex,
	ShapeHintsIndex,
	Texture2Index,
	Texture2TransformationIndex,
	TextureCoordinate2Index,
	TransformationIndex,

	// This has to be last!!!
	NumStacks,
    };

    static const char *stackNames[NumStacks];	// Names of stacks

    int		depth;		// Current state depth
    QvElement	*stacks[NumStacks];	// Stacks of elements

//[MSH_START]
	BSPLIB_NAMESPACE::VrmlFile *vrmlfile_base;
	QvState( BSPLIB_NAMESPACE::VrmlFile *base );
//[MSH_END]

    QvState();
    ~QvState();

    // Adds an element instance to the indexed stack
    void	addElement(StackIndex stackIndex, QvElement *elt);

    // Returns top element on a stack
    QvElement *	getTopElement(StackIndex stackIndex)
	{ return stacks[stackIndex]; }

    // Pushes/pops the stacks
    void	push();
    void	pop();

    // Pops top element off one stack
    void	popElement(StackIndex stackIndex);

    // Prints contents for debugging, mostly
    void	print();
};

#endif /* _QV_STATE_ */