aboutsummaryrefslogtreecommitdiff
path: root/tool_src/QvLib/QvState.h
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-08-24 11:16:07 +0200
committerFelix Morgner <felix.morgner@gmail.com>2026-08-24 11:16:07 +0200
commitc068f22329d5cc722622a2183bbb22eef2093df7 (patch)
tree12d56c1aede67988a55e241364606bfbb4dba933 /tool_src/QvLib/QvState.h
downloadopenparsec-c068f22329d5cc722622a2183bbb22eef2093df7.tar.xz
openparsec-c068f22329d5cc722622a2183bbb22eef2093df7.zip
initial importHEADmain
Diffstat (limited to 'tool_src/QvLib/QvState.h')
-rw-r--r--tool_src/QvLib/QvState.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/tool_src/QvLib/QvState.h b/tool_src/QvLib/QvState.h
new file mode 100644
index 0000000..433f8f2
--- /dev/null
+++ b/tool_src/QvLib/QvState.h
@@ -0,0 +1,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_ */