aboutsummaryrefslogtreecommitdiff
path: root/tool_src/QvLib
diff options
context:
space:
mode:
Diffstat (limited to 'tool_src/QvLib')
-rw-r--r--tool_src/QvLib/Makefile90
-rw-r--r--tool_src/QvLib/QvBasic.h46
-rw-r--r--tool_src/QvLib/QvChildList.cpp10
-rw-r--r--tool_src/QvLib/QvChildList.h13
-rw-r--r--tool_src/QvLib/QvCone.cpp27
-rw-r--r--tool_src/QvLib/QvCone.h26
-rw-r--r--tool_src/QvLib/QvCoordinate3.cpp17
-rw-r--r--tool_src/QvLib/QvCoordinate3.h16
-rw-r--r--tool_src/QvLib/QvCube.cpp21
-rw-r--r--tool_src/QvLib/QvCube.h18
-rw-r--r--tool_src/QvLib/QvCylinder.cpp28
-rw-r--r--tool_src/QvLib/QvCylinder.h27
-rw-r--r--tool_src/QvLib/QvDB.h18
-rw-r--r--tool_src/QvLib/QvDb.cpp29
-rw-r--r--tool_src/QvLib/QvDebugError.cpp16
-rw-r--r--tool_src/QvLib/QvDebugError.h9
-rw-r--r--tool_src/QvLib/QvDict.cpp98
-rw-r--r--tool_src/QvLib/QvDict.h33
-rw-r--r--tool_src/QvLib/QvDirectionalLight.cpp25
-rw-r--r--tool_src/QvLib/QvDirectionalLight.h22
-rw-r--r--tool_src/QvLib/QvElement.cpp38
-rw-r--r--tool_src/QvLib/QvElement.h62
-rw-r--r--tool_src/QvLib/QvField.cpp175
-rw-r--r--tool_src/QvLib/QvField.h72
-rw-r--r--tool_src/QvLib/QvFieldData.cpp266
-rw-r--r--tool_src/QvLib/QvFieldData.h46
-rw-r--r--tool_src/QvLib/QvFields.h23
-rw-r--r--tool_src/QvLib/QvGroup.cpp81
-rw-r--r--tool_src/QvLib/QvGroup.h19
-rw-r--r--tool_src/QvLib/QvIndexedFaceSet.cpp23
-rw-r--r--tool_src/QvLib/QvIndexedFaceSet.h21
-rw-r--r--tool_src/QvLib/QvIndexedLineSet.cpp23
-rw-r--r--tool_src/QvLib/QvIndexedLineSet.h21
-rw-r--r--tool_src/QvLib/QvInfo.cpp17
-rw-r--r--tool_src/QvLib/QvInfo.h16
-rw-r--r--tool_src/QvLib/QvInput.cpp568
-rw-r--r--tool_src/QvLib/QvInput.h65
-rw-r--r--tool_src/QvLib/QvLevelOfDetail.cpp17
-rw-r--r--tool_src/QvLib/QvLevelOfDetail.h16
-rwxr-xr-xtool_src/QvLib/QvLib.vcproj1765
-rwxr-xr-xtool_src/QvLib/QvLib.vcxproj597
-rw-r--r--tool_src/QvLib/QvLists.cpp5
-rw-r--r--tool_src/QvLib/QvLists.h17
-rw-r--r--tool_src/QvLib/QvMFColor.cpp13
-rw-r--r--tool_src/QvLib/QvMFColor.h12
-rw-r--r--tool_src/QvLib/QvMFFloat.cpp9
-rw-r--r--tool_src/QvLib/QvMFFloat.h12
-rw-r--r--tool_src/QvLib/QvMFLong.cpp9
-rw-r--r--tool_src/QvLib/QvMFLong.h12
-rw-r--r--tool_src/QvLib/QvMFVec2f.cpp12
-rw-r--r--tool_src/QvLib/QvMFVec2f.h12
-rw-r--r--tool_src/QvLib/QvMFVec3f.cpp13
-rw-r--r--tool_src/QvLib/QvMFVec3f.h12
-rw-r--r--tool_src/QvLib/QvMaterial.cpp27
-rw-r--r--tool_src/QvLib/QvMaterial.h22
-rw-r--r--tool_src/QvLib/QvMaterialBinding.cpp31
-rw-r--r--tool_src/QvLib/QvMaterialBinding.h28
-rw-r--r--tool_src/QvLib/QvMatrixTransform.cpp20
-rw-r--r--tool_src/QvLib/QvMatrixTransform.h16
-rw-r--r--tool_src/QvLib/QvName.cpp126
-rw-r--r--tool_src/QvLib/QvNode.cpp381
-rw-r--r--tool_src/QvLib/QvNode.h57
-rw-r--r--tool_src/QvLib/QvNodes.h39
-rw-r--r--tool_src/QvLib/QvNormal.cpp19
-rw-r--r--tool_src/QvLib/QvNormal.h16
-rw-r--r--tool_src/QvLib/QvNormalBinding.cpp29
-rw-r--r--tool_src/QvLib/QvNormalBinding.h28
-rw-r--r--tool_src/QvLib/QvOrthographicCamera.cpp28
-rw-r--r--tool_src/QvLib/QvOrthographicCamera.h22
-rw-r--r--tool_src/QvLib/QvPList.cpp64
-rw-r--r--tool_src/QvLib/QvPList.h29
-rw-r--r--tool_src/QvLib/QvPerspectiveCamera.cpp30
-rw-r--r--tool_src/QvLib/QvPerspectiveCamera.h23
-rw-r--r--tool_src/QvLib/QvPointLight.cpp25
-rw-r--r--tool_src/QvLib/QvPointLight.h22
-rw-r--r--tool_src/QvLib/QvPointSet.cpp19
-rw-r--r--tool_src/QvLib/QvPointSet.h19
-rw-r--r--tool_src/QvLib/QvReadError.cpp19
-rw-r--r--tool_src/QvLib/QvReadError.h11
-rw-r--r--tool_src/QvLib/QvRotation.cpp20
-rw-r--r--tool_src/QvLib/QvRotation.h16
-rw-r--r--tool_src/QvLib/QvSFBitMask.cpp84
-rw-r--r--tool_src/QvLib/QvSFBitMask.h12
-rw-r--r--tool_src/QvLib/QvSFBool.cpp37
-rw-r--r--tool_src/QvLib/QvSFBool.h12
-rw-r--r--tool_src/QvLib/QvSFColor.cpp11
-rw-r--r--tool_src/QvLib/QvSFColor.h12
-rw-r--r--tool_src/QvLib/QvSFEnum.cpp58
-rw-r--r--tool_src/QvLib/QvSFEnum.h38
-rw-r--r--tool_src/QvLib/QvSFFloat.cpp9
-rw-r--r--tool_src/QvLib/QvSFFloat.h12
-rw-r--r--tool_src/QvLib/QvSFImage.cpp39
-rw-r--r--tool_src/QvLib/QvSFImage.h14
-rw-r--r--tool_src/QvLib/QvSFLong.cpp9
-rw-r--r--tool_src/QvLib/QvSFLong.h12
-rw-r--r--tool_src/QvLib/QvSFMatrix.cpp16
-rw-r--r--tool_src/QvLib/QvSFMatrix.h12
-rw-r--r--tool_src/QvLib/QvSFRotation.cpp12
-rw-r--r--tool_src/QvLib/QvSFRotation.h13
-rw-r--r--tool_src/QvLib/QvSFString.cpp9
-rw-r--r--tool_src/QvLib/QvSFString.h12
-rw-r--r--tool_src/QvLib/QvSFVec2f.cpp10
-rw-r--r--tool_src/QvLib/QvSFVec2f.h12
-rw-r--r--tool_src/QvLib/QvSFVec3f.cpp11
-rw-r--r--tool_src/QvLib/QvSFVec3f.h12
-rw-r--r--tool_src/QvLib/QvScale.cpp17
-rw-r--r--tool_src/QvLib/QvScale.h16
-rw-r--r--tool_src/QvLib/QvSeparator.cpp23
-rw-r--r--tool_src/QvLib/QvSeparator.h24
-rw-r--r--tool_src/QvLib/QvShapeHints.cpp37
-rw-r--r--tool_src/QvLib/QvShapeHints.h36
-rw-r--r--tool_src/QvLib/QvSphere.cpp17
-rw-r--r--tool_src/QvLib/QvSphere.h17
-rw-r--r--tool_src/QvLib/QvSpotLight.h29
-rw-r--r--tool_src/QvLib/QvSpotlight.cpp35
-rw-r--r--tool_src/QvLib/QvState.cpp128
-rw-r--r--tool_src/QvLib/QvState.h64
-rw-r--r--tool_src/QvLib/QvString.cpp106
-rw-r--r--tool_src/QvLib/QvString.h101
-rw-r--r--tool_src/QvLib/QvSubField.h72
-rw-r--r--tool_src/QvLib/QvSubNode.h41
-rw-r--r--tool_src/QvLib/QvSwitch.cpp17
-rw-r--r--tool_src/QvLib/QvSwitch.h19
-rw-r--r--tool_src/QvLib/QvTexture2.cpp55
-rw-r--r--tool_src/QvLib/QvTexture2.h29
-rw-r--r--tool_src/QvLib/QvTexture2Transform.cpp23
-rw-r--r--tool_src/QvLib/QvTexture2Transform.h20
-rw-r--r--tool_src/QvLib/QvTextureCoordinate2.cpp17
-rw-r--r--tool_src/QvLib/QvTextureCoordinate2.h16
-rw-r--r--tool_src/QvLib/QvTransform.cpp31
-rw-r--r--tool_src/QvLib/QvTransform.h21
-rw-r--r--tool_src/QvLib/QvTransformSeparator.cpp13
-rw-r--r--tool_src/QvLib/QvTransformSeparator.h13
-rw-r--r--tool_src/QvLib/QvTranslation.cpp17
-rw-r--r--tool_src/QvLib/QvTranslation.h16
-rw-r--r--tool_src/QvLib/QvTraverse.cpp317
-rw-r--r--tool_src/QvLib/QvTraverse.p15927
-rw-r--r--tool_src/QvLib/QvUnknownNode.cpp26
-rw-r--r--tool_src/QvLib/QvUnknownNode.h18
-rw-r--r--tool_src/QvLib/QvWWWAnchor.cpp24
-rw-r--r--tool_src/QvLib/QvWWWAnchor.h24
-rw-r--r--tool_src/QvLib/QvWWWInline.cpp24
-rw-r--r--tool_src/QvLib/QvWWWInline.h20
-rw-r--r--tool_src/QvLib/QvWWWInline.p9602
144 files changed, 33374 insertions, 0 deletions
diff --git a/tool_src/QvLib/Makefile b/tool_src/QvLib/Makefile
new file mode 100644
index 0000000..b1c0e0a
--- /dev/null
+++ b/tool_src/QvLib/Makefile
@@ -0,0 +1,90 @@
+# QvLib makefile
+
+CFILES = QvChildList.cpp\
+QvCone.cpp\
+QvCoordinate3.cpp\
+QvCube.cpp\
+QvCylinder.cpp\
+QvDb.cpp\
+QvDebugError.cpp\
+QvDict.cpp\
+QvDirectionalLight.cpp\
+QvElement.cpp\
+QvField.cpp\
+QvFieldData.cpp\
+QvGroup.cpp\
+QvIndexedFaceSet.cpp\
+QvIndexedLineSet.cpp\
+QvInfo.cpp\
+QvInput.cpp\
+QvLevelOfDetail.cpp\
+QvLists.cpp\
+QvMFColor.cpp\
+QvMFFloat.cpp\
+QvMFLong.cpp\
+QvMFVec2f.cpp\
+QvMFVec3f.cpp\
+QvMaterial.cpp\
+QvMaterialBinding.cpp\
+QvMatrixTransform.cpp\
+QvName.cpp\
+QvNode.cpp\
+QvNormal.cpp\
+QvNormalBinding.cpp\
+QvOrthographicCamera.cpp\
+QvPList.cpp\
+QvPerspectiveCamera.cpp\
+QvPointLight.cpp\
+QvPointSet.cpp\
+QvReadError.cpp\
+QvRotation.cpp\
+QvSFBitMask.cpp\
+QvSFBool.cpp\
+QvSFColor.cpp\
+QvSFEnum.cpp\
+QvSFFloat.cpp\
+QvSFImage.cpp\
+QvSFLong.cpp\
+QvSFMatrix.cpp\
+QvSFRotation.cpp\
+QvSFString.cpp\
+QvSFVec2f.cpp\
+QvSFVec3f.cpp\
+QvScale.cpp\
+QvSeparator.cpp\
+QvShapeHints.cpp\
+QvSphere.cpp\
+QvSpotlight.cpp\
+QvState.cpp\
+QvString.cpp\
+QvSwitch.cpp\
+QvTexture2.cpp\
+QvTexture2Transform.cpp\
+QvTextureCoordinate2.cpp\
+QvTransform.cpp\
+QvTransformSeparator.cpp\
+QvTranslation.cpp\
+QvTraverse.cpp\
+QvUnknownNode.cpp\
+QvWWWAnchor.cpp\
+QvWWWInline.cpp
+
+
+CFLAGS = -g -O2 -I. -I../BspLib -fno-for-scope\
+ -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp
+
+all: libqv.a
+
+libqv.a: $(CFILES:.cpp=.o)
+ ar rc libqv.a $(CFILES:.cpp=.o)
+ ranlib libqv.a
+
+.cpp.o:
+ gcc $(CFLAGS) -o $@ -c $<
+
+clean:
+ rm -f *.o *.a *~
+
+
+
+
diff --git a/tool_src/QvLib/QvBasic.h b/tool_src/QvLib/QvBasic.h
new file mode 100644
index 0000000..f54c906
--- /dev/null
+++ b/tool_src/QvLib/QvBasic.h
@@ -0,0 +1,46 @@
+#ifndef _QV_BASIC_
+#define _QV_BASIC_
+
+#ifdef WIN32
+typedef unsigned long u_long;
+#define M_PI 3.1415926536
+#define M_PI_4 (M_PI/4.0)
+#endif
+
+#include <sys/types.h>
+#ifndef WIN32
+//#include <libc.h>
+#include <stdlib.h>
+
+#else
+#include <stdlib.h>
+#endif /* WIN32 */
+#include <stdio.h>
+
+#ifndef FALSE
+# define FALSE 0
+# define TRUE 1
+#endif
+
+typedef int QvBool;
+
+// This uses the preprocessor to quote a string
+#if defined(__STDC__) || defined(__ANSI_CPP__) /* ANSI C */
+# define QV__QUOTE(str) #str
+#else /* Non-ANSI C */
+#ifdef WIN32
+# define QV__QUOTE(str) #str
+#else
+# define QV__QUOTE(str) "str"
+#endif
+#endif
+
+// This uses the preprocessor to concatenate two strings
+#if defined(__STDC__) || defined(__ANSI_CPP__) /* ANSI C */
+# define QV__CONCAT(str1, str2) str1##str2
+#else /* Non-ANSI C */
+# define QV__CONCAT(str1, str2) str1/**/str2
+#endif
+
+#endif /* _QV_BASIC_ */
+
diff --git a/tool_src/QvLib/QvChildList.cpp b/tool_src/QvLib/QvChildList.cpp
new file mode 100644
index 0000000..5fba922
--- /dev/null
+++ b/tool_src/QvLib/QvChildList.cpp
@@ -0,0 +1,10 @@
+#include <QvChildList.h>
+
+QvChildList::QvChildList() : QvNodeList()
+{
+}
+
+QvChildList::~QvChildList()
+{
+ truncate(0);
+}
diff --git a/tool_src/QvLib/QvChildList.h b/tool_src/QvLib/QvChildList.h
new file mode 100644
index 0000000..f200c28
--- /dev/null
+++ b/tool_src/QvLib/QvChildList.h
@@ -0,0 +1,13 @@
+#ifndef _QV_CHILD_LIST_
+#define _QV_CHILD_LIST_
+
+#include <QvLists.h>
+
+class QvChildList : public QvNodeList {
+
+ public:
+ QvChildList();
+ ~QvChildList();
+};
+
+#endif /* _QV_CHILD_LIST_ */
diff --git a/tool_src/QvLib/QvCone.cpp b/tool_src/QvLib/QvCone.cpp
new file mode 100644
index 0000000..b8724f3
--- /dev/null
+++ b/tool_src/QvLib/QvCone.cpp
@@ -0,0 +1,27 @@
+#include <QvCone.h>
+
+QV_NODE_SOURCE(QvCone);
+
+QvCone::QvCone()
+{
+ QV_NODE_CONSTRUCTOR(QvCone);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(parts);
+ QV_NODE_ADD_FIELD(bottomRadius);
+ QV_NODE_ADD_FIELD(height);
+
+ parts.value = ALL;
+ bottomRadius.value = 1.0;
+ height.value = 2.0;
+
+ QV_NODE_DEFINE_ENUM_VALUE(Part, SIDES);
+ QV_NODE_DEFINE_ENUM_VALUE(Part, BOTTOM);
+ QV_NODE_DEFINE_ENUM_VALUE(Part, ALL);
+
+ QV_NODE_SET_SF_ENUM_TYPE(parts, Part);
+}
+
+QvCone::~QvCone()
+{
+}
diff --git a/tool_src/QvLib/QvCone.h b/tool_src/QvLib/QvCone.h
new file mode 100644
index 0000000..74a3291
--- /dev/null
+++ b/tool_src/QvLib/QvCone.h
@@ -0,0 +1,26 @@
+#ifndef _QV_CONE_
+#define _QV_CONE_
+
+#include <QvSFBitMask.h>
+#include <QvSFFloat.h>
+#include <QvSubNode.h>
+
+class QvCone : public QvNode {
+
+ QV_NODE_HEADER(QvCone);
+
+ public:
+
+ enum Part { // Cone parts:
+ SIDES = 0x01, // The conical part
+ BOTTOM = 0x02, // The bottom circular face
+ ALL = 0x03 // All parts
+ };
+
+ // Fields
+ QvSFBitMask parts; // Visible parts of cone
+ QvSFFloat bottomRadius; // Radius of bottom circular face
+ QvSFFloat height; // Size in y dimension
+};
+
+#endif /* _QV_CONE_ */
diff --git a/tool_src/QvLib/QvCoordinate3.cpp b/tool_src/QvLib/QvCoordinate3.cpp
new file mode 100644
index 0000000..9822b97
--- /dev/null
+++ b/tool_src/QvLib/QvCoordinate3.cpp
@@ -0,0 +1,17 @@
+#include <QvCoordinate3.h>
+
+QV_NODE_SOURCE(QvCoordinate3);
+
+QvCoordinate3::QvCoordinate3()
+{
+ QV_NODE_CONSTRUCTOR(QvCoordinate3);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(point);
+
+ point.values[0] = point.values[1] = point.values[2] = 0.0;
+}
+
+QvCoordinate3::~QvCoordinate3()
+{
+}
diff --git a/tool_src/QvLib/QvCoordinate3.h b/tool_src/QvLib/QvCoordinate3.h
new file mode 100644
index 0000000..035e692
--- /dev/null
+++ b/tool_src/QvLib/QvCoordinate3.h
@@ -0,0 +1,16 @@
+#ifndef _QV_COORDINATE3_
+#define _QV_COORDINATE3_
+
+#include <QvMFVec3f.h>
+#include <QvSubNode.h>
+
+class QvCoordinate3 : public QvNode {
+
+ QV_NODE_HEADER(QvCoordinate3);
+
+ public:
+ // Fields
+ QvMFVec3f point; // Coordinate point(s)
+};
+
+#endif /* _QV_COORDINATE3_ */
diff --git a/tool_src/QvLib/QvCube.cpp b/tool_src/QvLib/QvCube.cpp
new file mode 100644
index 0000000..eec1cd0
--- /dev/null
+++ b/tool_src/QvLib/QvCube.cpp
@@ -0,0 +1,21 @@
+#include <QvCube.h>
+
+QV_NODE_SOURCE(QvCube);
+
+QvCube::QvCube()
+{
+ QV_NODE_CONSTRUCTOR(QvCube);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(width);
+ QV_NODE_ADD_FIELD(height);
+ QV_NODE_ADD_FIELD(depth);
+
+ width.value = 2.0;
+ height.value = 2.0;
+ depth.value = 2.0;
+}
+
+QvCube::~QvCube()
+{
+}
diff --git a/tool_src/QvLib/QvCube.h b/tool_src/QvLib/QvCube.h
new file mode 100644
index 0000000..fe02d92
--- /dev/null
+++ b/tool_src/QvLib/QvCube.h
@@ -0,0 +1,18 @@
+#ifndef _QV_CUBE_
+#define _QV_CUBE_
+
+#include <QvSFFloat.h>
+#include <QvSubNode.h>
+
+class QvCube : public QvNode {
+
+ QV_NODE_HEADER(QvCube);
+
+ public:
+ // Fields
+ QvSFFloat width; // Size in x dimension
+ QvSFFloat height; // Size in y dimension
+ QvSFFloat depth; // Size in z dimension
+};
+
+#endif /* _QV_CUBE_ */
diff --git a/tool_src/QvLib/QvCylinder.cpp b/tool_src/QvLib/QvCylinder.cpp
new file mode 100644
index 0000000..a2b871a
--- /dev/null
+++ b/tool_src/QvLib/QvCylinder.cpp
@@ -0,0 +1,28 @@
+#include <QvCylinder.h>
+
+QV_NODE_SOURCE(QvCylinder);
+
+QvCylinder::QvCylinder()
+{
+ QV_NODE_CONSTRUCTOR(QvCylinder);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(parts);
+ QV_NODE_ADD_FIELD(radius);
+ QV_NODE_ADD_FIELD(height);
+
+ parts.value = ALL;
+ radius.value = 1.0;
+ height.value = 2.0;
+
+ QV_NODE_DEFINE_ENUM_VALUE(Part, SIDES);
+ QV_NODE_DEFINE_ENUM_VALUE(Part, TOP);
+ QV_NODE_DEFINE_ENUM_VALUE(Part, BOTTOM);
+ QV_NODE_DEFINE_ENUM_VALUE(Part, ALL);
+
+ QV_NODE_SET_SF_ENUM_TYPE(parts, Part);
+}
+
+QvCylinder::~QvCylinder()
+{
+}
diff --git a/tool_src/QvLib/QvCylinder.h b/tool_src/QvLib/QvCylinder.h
new file mode 100644
index 0000000..9a762df
--- /dev/null
+++ b/tool_src/QvLib/QvCylinder.h
@@ -0,0 +1,27 @@
+#ifndef _QV_CYLINDER_
+#define _QV_CYLINDER_
+
+#include <QvSFBitMask.h>
+#include <QvSFFloat.h>
+#include <QvSubNode.h>
+
+class QvCylinder : public QvNode {
+
+ QV_NODE_HEADER(QvCylinder);
+
+ public:
+
+ enum Part { // Cylinder parts
+ SIDES = 0x01, // The tubular part
+ TOP = 0x02, // The top circular face
+ BOTTOM = 0x04, // The bottom circular face
+ ALL = 0x07, // All parts
+ };
+
+ // Fields
+ QvSFBitMask parts; // Visible parts of cylinder
+ QvSFFloat radius; // Radius in x and z dimensions
+ QvSFFloat height; // Size in y dimension
+};
+
+#endif /* _QV_CYLINDER_ */
diff --git a/tool_src/QvLib/QvDB.h b/tool_src/QvLib/QvDB.h
new file mode 100644
index 0000000..aee530c
--- /dev/null
+++ b/tool_src/QvLib/QvDB.h
@@ -0,0 +1,18 @@
+#ifndef _QV_DB_
+#define _QV_DB_
+
+#include <QvBasic.h>
+
+class QvInput;
+class QvNode;
+class QvField;
+
+class QvDB {
+ public:
+ static const char *versionString;
+
+ static void init();
+ static QvBool read(QvInput *in, QvNode *&rootNode);
+};
+
+#endif /* _QV_DB_ */
diff --git a/tool_src/QvLib/QvDb.cpp b/tool_src/QvLib/QvDb.cpp
new file mode 100644
index 0000000..6d4ddf7
--- /dev/null
+++ b/tool_src/QvLib/QvDb.cpp
@@ -0,0 +1,29 @@
+#include <QvDB.h>
+#include <QvInput.h>
+#include <QvReadError.h>
+#include <QvNode.h>
+
+const char *QvDB::versionString = "Reference VRML Parser 1.0";
+
+void
+QvDB::init()
+{
+ QvNode::init();
+}
+
+QvBool
+QvDB::read(QvInput *in, QvNode *&node)
+{
+ QvBool ret;
+
+ ret = QvNode::read(in, node);
+
+ if (ret && node == NULL && ! in->eof()) {
+ char c;
+ in->get(c);
+ QvReadError::post(in, "Extra characters ('%c') found in input", c);
+ ret = FALSE;
+ }
+
+ return ret;
+}
diff --git a/tool_src/QvLib/QvDebugError.cpp b/tool_src/QvLib/QvDebugError.cpp
new file mode 100644
index 0000000..c8cbd03
--- /dev/null
+++ b/tool_src/QvLib/QvDebugError.cpp
@@ -0,0 +1,16 @@
+#include <stdarg.h>
+#include <QvString.h>
+#include <QvDebugError.h>
+
+void
+QvDebugError::post(const char *methodName, const char *formatString ...)
+{
+ char buf[10000];
+ va_list ap;
+
+ va_start(ap, formatString);
+ vsprintf(buf, formatString, ap);
+ va_end(ap);
+
+ fprintf(stderr, "VRML error in %s(): %s\n", methodName, buf);
+}
diff --git a/tool_src/QvLib/QvDebugError.h b/tool_src/QvLib/QvDebugError.h
new file mode 100644
index 0000000..4fff114
--- /dev/null
+++ b/tool_src/QvLib/QvDebugError.h
@@ -0,0 +1,9 @@
+#ifndef _QV_DEBUG_ERROR
+#define _QV_DEBUG_ERROR
+
+class QvDebugError {
+ public:
+ static void post(const char *methodName, const char *formatString ...);
+};
+
+#endif /* _QV_DEBUG_ERROR */
diff --git a/tool_src/QvLib/QvDict.cpp b/tool_src/QvLib/QvDict.cpp
new file mode 100644
index 0000000..52b3be6
--- /dev/null
+++ b/tool_src/QvLib/QvDict.cpp
@@ -0,0 +1,98 @@
+#include <QvDict.h>
+
+struct QvDictListThing {
+ QvPList *keyList;
+ QvPList *valueList;
+};
+
+QvDict::QvDict( int entries )
+{
+ tableSize=entries;
+ buckets=new QvDictEntry *[tableSize];
+ for (int i = 0; i < tableSize; i++)
+ buckets[i] = NULL;
+}
+
+QvDict::~QvDict()
+{
+ clear();
+ delete [] buckets;
+}
+
+void
+QvDict::clear()
+{
+ int i;
+ QvDictEntry *entry, *nextEntry;
+
+ for (i = 0; i < tableSize; i++) {
+
+ for (entry = buckets[i]; entry != NULL; entry = nextEntry) {
+ nextEntry = entry->next;
+ delete entry;
+ }
+ buckets[i] = NULL;
+ }
+}
+
+QvBool
+QvDict::enter(u_long key, void *value)
+{
+ QvDictEntry *&entry = findEntry(key);
+
+ if (entry == NULL) {
+ entry = new QvDictEntry(key, value);
+ entry->next = NULL;
+ return TRUE;
+ }
+ else {
+ entry->value = value;
+ return FALSE;
+ }
+}
+
+QvBool
+QvDict::find(u_long key, void *&value) const
+{
+ QvDictEntry *&entry = findEntry(key);
+
+ if (entry == NULL) {
+ value = NULL;
+ return FALSE;
+ }
+ else {
+ value = entry->value;
+ return TRUE;
+ }
+}
+
+QvDictEntry *&
+QvDict::findEntry(u_long key) const
+{
+ QvDictEntry **entry;
+
+ entry = &buckets[key % tableSize];
+
+ while (*entry != NULL) {
+ if ((*entry)->key == key)
+ break;
+ entry = &(*entry)->next;
+ }
+ return *entry;
+}
+
+QvBool
+QvDict::remove(u_long key)
+{
+ QvDictEntry *&entry = findEntry(key);
+ QvDictEntry *tmp;
+
+ if (entry == NULL)
+ return FALSE;
+ else {
+ tmp = entry;
+ entry = entry->next;
+ delete tmp;
+ return TRUE;
+ }
+}
diff --git a/tool_src/QvLib/QvDict.h b/tool_src/QvLib/QvDict.h
new file mode 100644
index 0000000..3a3aebe
--- /dev/null
+++ b/tool_src/QvLib/QvDict.h
@@ -0,0 +1,33 @@
+#ifndef _QV_DICT_
+#define _QV_DICT_
+
+#include <QvBasic.h>
+#include <QvString.h>
+#include <QvPList.h>
+
+class QvDictEntry {
+ private:
+ u_long key;
+ void * value;
+ QvDictEntry * next;
+ QvDictEntry(u_long k, void *v) { key = k; value = v; };
+
+friend class QvDict;
+};
+
+class QvDict {
+ public:
+ QvDict( int entries = 251 );
+ ~QvDict();
+ void clear();
+ QvBool enter(u_long key, void *value);
+ QvBool find(u_long key, void *&value) const;
+ QvBool remove(u_long key);
+
+ private:
+ int tableSize;
+ QvDictEntry * *buckets;
+ QvDictEntry *& findEntry(u_long key) const;
+};
+
+#endif /* _QV_DICT_ */
diff --git a/tool_src/QvLib/QvDirectionalLight.cpp b/tool_src/QvLib/QvDirectionalLight.cpp
new file mode 100644
index 0000000..b1e53d3
--- /dev/null
+++ b/tool_src/QvLib/QvDirectionalLight.cpp
@@ -0,0 +1,25 @@
+#include <QvDirectionalLight.h>
+
+QV_NODE_SOURCE(QvDirectionalLight);
+
+QvDirectionalLight::QvDirectionalLight()
+{
+ QV_NODE_CONSTRUCTOR(QvDirectionalLight);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(on);
+ QV_NODE_ADD_FIELD(intensity);
+ QV_NODE_ADD_FIELD(color);
+ QV_NODE_ADD_FIELD(direction);
+
+ on.value = TRUE;
+ intensity.value = 1.0;
+ color.value[0] = color.value[1] = color.value[2] = 1.0;
+ direction.value[0] = 0.0;
+ direction.value[1] = 0.0;
+ direction.value[2] = -1.0;
+}
+
+QvDirectionalLight::~QvDirectionalLight()
+{
+}
diff --git a/tool_src/QvLib/QvDirectionalLight.h b/tool_src/QvLib/QvDirectionalLight.h
new file mode 100644
index 0000000..cd5e22d
--- /dev/null
+++ b/tool_src/QvLib/QvDirectionalLight.h
@@ -0,0 +1,22 @@
+#ifndef _QV_DIRECTIONAL_LIGHT_
+#define _QV_DIRECTIONAL_LIGHT_
+
+#include <QvSFBool.h>
+#include <QvSFColor.h>
+#include <QvSFFloat.h>
+#include <QvSFVec3f.h>
+#include <QvSubNode.h>
+
+class QvDirectionalLight : public QvNode {
+
+ QV_NODE_HEADER(QvDirectionalLight);
+
+ public:
+ // Fields
+ QvSFBool on; // Whether light is on
+ QvSFFloat intensity; // Source intensity (0 to 1)
+ QvSFColor color; // RGB source color
+ QvSFVec3f direction; // Illumination direction vector
+};
+
+#endif /* _QV_DIRECTIONAL_LIGHT_ */
diff --git a/tool_src/QvLib/QvElement.cpp b/tool_src/QvLib/QvElement.cpp
new file mode 100644
index 0000000..28ddb88
--- /dev/null
+++ b/tool_src/QvLib/QvElement.cpp
@@ -0,0 +1,38 @@
+#include <QvElement.h>
+
+const char *QvElement::nodeTypeNames[NumNodeTypes] = {
+ "Unknown",
+ "OrthographicCamera",
+ "PerspectiveCamera",
+ "DirectionalLight",
+ "PointLight",
+ "SpotLight",
+ "NoOpTransform",
+ "MatrixTransform",
+ "Rotation",
+ "Scale",
+ "Transform",
+ "Translation",
+};
+
+QvElement::QvElement()
+{
+ // These will be set to something real when the element is
+ // added to the state
+ depth = -1;
+ next = NULL;
+
+ // Presumably, the caller will set these
+ data = NULL;
+ type = Unknown;
+}
+
+QvElement::~QvElement()
+{
+}
+
+void
+QvElement::print()
+{
+ printf("\t\tElement of type %s\n", nodeTypeNames[type]);
+}
diff --git a/tool_src/QvLib/QvElement.h b/tool_src/QvLib/QvElement.h
new file mode 100644
index 0000000..58c5ce1
--- /dev/null
+++ b/tool_src/QvLib/QvElement.h
@@ -0,0 +1,62 @@
+#ifndef _QV_ELEMENT_
+#define _QV_ELEMENT_
+
+#include <QvBasic.h>
+
+class QvNode;
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// The base class element; the data is a pointer to some QvNode. The
+// type of the node can be inferred from the use of the element
+// instance in a particular stack in the state. In some cases, the
+// "type" field is used to distinguish among various possible node
+// types within a single stack.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+class QvElement {
+
+ public:
+
+ enum NodeType {
+ // Fallback case
+ Unknown,
+
+ // Types of cameras in camera stack
+ OrthographicCamera,
+ PerspectiveCamera,
+
+ // Types of lights in light stack
+ DirectionalLight,
+ PointLight,
+ SpotLight,
+
+ // Types of transformations in transformation stack
+ NoOpTransform, // For QvTransformSeparator
+ MatrixTransform,
+ Rotation,
+ Scale,
+ Transform,
+ Translation,
+
+ // This has to be last!!!
+ NumNodeTypes,
+ };
+
+ static const char *nodeTypeNames[NumNodeTypes]; // Names of node types
+
+ int depth; // Depth of element in state
+ QvElement *next; // Next element in stack
+ QvNode *data; // Pointer to node containing data
+ NodeType type; // Type of data node
+
+ QvElement();
+ virtual ~QvElement();
+
+ QvElement operator= (QvElement * x){ return *x;}
+ // Prints contents for debugging, mostly
+ virtual void print();
+};
+
+#endif /* _QV_ELEMENT_ */
diff --git a/tool_src/QvLib/QvField.cpp b/tool_src/QvLib/QvField.cpp
new file mode 100644
index 0000000..e682dda
--- /dev/null
+++ b/tool_src/QvLib/QvField.cpp
@@ -0,0 +1,175 @@
+#include <QvInput.h>
+#include <QvReadError.h>
+#include <QvFields.h>
+
+// Special characters in files
+#define OPEN_BRACE_CHAR '['
+#define CLOSE_BRACE_CHAR ']'
+#define VALUE_SEPARATOR_CHAR ','
+#define IGNORE_CHAR '~'
+
+QvField::~QvField()
+{
+}
+
+void
+QvField::setContainer(QvNode *cont)
+{
+ container = cont;
+ setDefault(TRUE);
+}
+
+QvBool
+QvField::read(QvInput *in, const QvName &name)
+{
+ char c;
+
+ setDefault(FALSE);
+
+ if (in->read(c) && c == IGNORE_CHAR) {
+ setDefault(TRUE);
+ setIgnored(TRUE);
+ }
+
+ else {
+ setIgnored(FALSE);
+
+ in->putBack(c);
+
+ if (! readValue(in)) {
+ QvReadError::post(in, "Couldn't read value for field \"%s\"",
+ name.getString());
+ return FALSE;
+ }
+
+ if (in->read(c)) {
+ if (c == IGNORE_CHAR)
+ setIgnored(TRUE);
+ else
+ in->putBack(c);
+ }
+ }
+
+ return TRUE;
+}
+
+QvField *
+QvField::createInstanceFromName(const QvName &className)
+{
+#define TRY_CLASS(name, class) \
+ else if (className == name) \
+ inst = new class
+
+ QvField *inst = NULL;
+
+ if (0) ; // So "else" works in first TRY_CLASS
+
+ TRY_CLASS("MFColor", QvMFColor);
+ TRY_CLASS("MFFloat", QvMFFloat);
+ TRY_CLASS("MFLong", QvMFLong);
+ TRY_CLASS("MFVec2f", QvMFVec2f);
+ TRY_CLASS("MFVec3f", QvMFVec3f);
+ TRY_CLASS("SFBitMask", QvSFBitMask);
+ TRY_CLASS("SFBool", QvSFBool);
+ TRY_CLASS("SFColor", QvSFColor);
+ TRY_CLASS("SFEnum", QvSFEnum);
+ TRY_CLASS("SFFloat", QvSFFloat);
+ TRY_CLASS("SFImage", QvSFImage);
+ TRY_CLASS("SFLong", QvSFLong);
+ TRY_CLASS("SFMatrix", QvSFMatrix);
+ TRY_CLASS("SFRotation", QvSFRotation);
+ TRY_CLASS("SFString", QvSFString);
+ TRY_CLASS("SFVec2f", QvSFVec2f);
+ TRY_CLASS("SFVec3f", QvSFVec3f);
+
+ return inst;
+
+#undef TRY_CLASS
+}
+
+QvSField::QvSField()
+{
+}
+
+
+QvSField::~QvSField()
+{
+}
+
+QvMField::QvMField()
+{
+ maxNum = num = 0;
+}
+
+QvMField::~QvMField()
+{
+}
+
+void
+QvMField::makeRoom(int newNum)
+{
+ if (newNum != num)
+ allocValues(newNum);
+}
+
+QvBool
+QvMField::readValue(QvInput *in)
+{
+ char c;
+ int curIndex = 0;
+
+ if (in->read(c) && c == OPEN_BRACE_CHAR) {
+
+ if (in->read(c) && c == CLOSE_BRACE_CHAR)
+ ;
+ else {
+ in->putBack(c);
+
+ while (TRUE) {
+
+ if (curIndex >= num)
+ makeRoom(curIndex + 1);
+
+ if (! read1Value(in, curIndex++) || ! in->read(c)) {
+ QvReadError::post(in, "Couldn't read value %d of field",
+ curIndex);
+ return FALSE;
+ }
+
+ if (c == VALUE_SEPARATOR_CHAR) {
+ if (in->read(c)) {
+ if (c == CLOSE_BRACE_CHAR)
+ break;
+ else
+ in->putBack(c);
+ }
+ }
+
+ else if (c == CLOSE_BRACE_CHAR)
+ break;
+
+ else {
+ QvReadError::post(in,
+ "Expected '%c' or '%c' but got "
+ "'%c' while reading value %d",
+ VALUE_SEPARATOR_CHAR,
+ CLOSE_BRACE_CHAR, c,
+ curIndex);
+ return FALSE;
+ }
+ }
+ }
+
+ if (curIndex < num)
+ makeRoom(curIndex);
+ }
+
+ else {
+ in->putBack(c);
+ makeRoom(1);
+ if (! read1Value(in, 0))
+ return FALSE;
+ }
+
+ return TRUE;
+}
diff --git a/tool_src/QvLib/QvField.h b/tool_src/QvLib/QvField.h
new file mode 100644
index 0000000..ff32ade
--- /dev/null
+++ b/tool_src/QvLib/QvField.h
@@ -0,0 +1,72 @@
+#ifndef _QV_FIELD_
+#define _QV_FIELD_
+
+#include <QvString.h>
+
+class QvInput;
+class QvNode;
+
+class QvField {
+ public:
+ virtual ~QvField();
+
+ void setIgnored(QvBool ig) { flags.ignored = ig; }
+ QvBool isIgnored() const { return flags.ignored; }
+
+ QvBool isDefault() const { return flags.hasDefault; }
+
+ QvNode * getContainer() const { return container; }
+
+ void setDefault(QvBool def) { flags.hasDefault = def; }
+ void setContainer(QvNode *cont);
+ QvBool read(QvInput *in, const QvName &name);
+
+ QvField() { flags.hasDefault = TRUE; flags.ignored = FALSE; }
+
+ public:
+
+ private:
+ struct {
+ unsigned int hasDefault : 1; // Field is set to default value
+ unsigned int ignored : 1; // Field value is to be ignored
+ } flags;
+
+ QvNode *container;
+
+ static QvField * createInstanceFromName(const QvName &className);
+ virtual QvBool readValue(QvInput *in) = 0;
+
+friend class QvFieldData;
+};
+
+class QvSField : public QvField {
+ public:
+ virtual ~QvSField();
+
+ protected:
+ QvSField();
+
+ private:
+ virtual QvBool readValue(QvInput *in) = 0;
+};
+
+class QvMField : public QvField {
+
+ public:
+ int num; // Number of values
+ int maxNum; // Number of values allocated
+
+ // Destructor
+ virtual ~QvMField();
+
+ protected:
+ QvMField();
+ virtual void makeRoom(int newNum);
+
+ private:
+ virtual void allocValues(int num) = 0;
+ virtual QvBool readValue(QvInput *in);
+ virtual QvBool read1Value(QvInput *in, int index) = 0;
+};
+
+#endif /* _QV_FIELD_ */
diff --git a/tool_src/QvLib/QvFieldData.cpp b/tool_src/QvLib/QvFieldData.cpp
new file mode 100644
index 0000000..afe55da
--- /dev/null
+++ b/tool_src/QvLib/QvFieldData.cpp
@@ -0,0 +1,266 @@
+#include <QvInput.h>
+#include <QvReadError.h>
+#include <QvField.h>
+#include <QvFieldData.h>
+#include <QvUnknownNode.h>
+
+#define OPEN_BRACE_CHAR '['
+#define CLOSE_BRACE_CHAR ']'
+#define VALUE_SEPARATOR_CHAR ','
+
+struct QvFieldEntry {
+ QvName name;
+ long offset;
+};
+
+struct QvEnumEntry {
+ QvName typeName;
+ int num;
+ int arraySize;
+ int *vals;
+ QvName *names;
+ QvEnumEntry(const QvName &name);
+ ~QvEnumEntry();
+
+ static int growSize;
+};
+
+int QvEnumEntry::growSize = 6;
+
+QvEnumEntry::QvEnumEntry(const QvName &name)
+{
+ typeName = name;
+ num = 0;
+ arraySize = growSize;
+ vals = new int[arraySize];
+ names = new QvName[arraySize];
+}
+
+QvEnumEntry::~QvEnumEntry()
+{
+ delete [] vals;
+ delete [] names;
+}
+
+QvFieldData::~QvFieldData()
+{
+ struct QvFieldEntry *tmpField;
+ struct QvEnumEntry *tmpEnum;
+
+ for (int i=0; i<fields.getLength(); i++) {
+ tmpField = (struct QvFieldEntry *)fields[i];
+ delete tmpField;
+ }
+
+ for (int j=0; j<enums.getLength(); j++) {
+ tmpEnum = (struct QvEnumEntry *)enums[j];
+ delete tmpEnum;
+ }
+}
+
+void
+QvFieldData::addField(QvNode *defobj, const char *fieldName,
+ const QvField *field)
+{
+ struct QvFieldEntry *newField = new struct QvFieldEntry;
+ newField->name = fieldName;
+ newField->offset = (const char *) field - (const char *) defobj;
+
+ fields.append((void *) newField);
+}
+
+const QvName &
+QvFieldData::getFieldName(int index) const
+{
+ return ((QvFieldEntry *) fields[index])->name;
+}
+
+QvField *
+QvFieldData::getField(const QvNode *object, int index) const
+{
+ return (QvField *) ((char *) object +
+ ((QvFieldEntry *) fields[index])->offset);
+}
+
+#include <ctype.h>
+static QvName
+stripWhite(const char *name)
+{
+ int firstchar = -1;
+ int lastchar = -1;
+ int lastwhite = -1;
+ int i =0;
+ for ( i=0; name[i]; i++) {
+ if (isspace(name[i]))
+ lastwhite = i;
+ else {
+ if (firstchar == -1) firstchar = i;
+ lastchar = i;
+ }
+ }
+
+ if (lastchar > lastwhite)
+ return QvName(&name[firstchar]);
+
+ char buf[500];
+ int b;
+ for (b=0, i=firstchar; i<=lastchar; i++, b++)
+ buf[b] = name[i];
+ buf[b] = 0;
+ return QvName(buf);
+}
+
+void
+QvFieldData::addEnumValue(const char *typeNameArg,
+ const char *valNameArg, int val)
+{
+ struct QvEnumEntry *e = NULL;
+ QvName typeName = stripWhite(typeNameArg);
+ QvName valName = stripWhite(valNameArg);
+
+ for (int i=0; i<enums.getLength(); i++) {
+ e = (struct QvEnumEntry *) enums[i];
+ if (e->typeName == typeName)
+ break;
+ else
+ e = NULL;
+ }
+ if (e == NULL) {
+ e = new QvEnumEntry(typeName);
+ enums.append((void*) e);
+ }
+ if (e->num == e->arraySize) {
+ e->arraySize += QvEnumEntry::growSize;
+ int *ovals = e->vals;
+ QvName *onames = e->names;
+ e->vals = new int[e->arraySize];
+ e->names = new QvName[e->arraySize];
+ for (int i=0; i<e->num; i++) {
+ e->vals[i] = ovals[i];
+ e->names[i] = onames[i];
+ }
+ delete [] ovals;
+ delete [] onames;
+ }
+ e->vals[e->num] = val;
+ e->names[e->num] = valName;
+ e->num++;
+}
+
+void
+QvFieldData::getEnumData(const char *typeNameArg, int &num,
+ const int *&vals, const QvName *&names)
+{
+ QvName typeName = stripWhite(typeNameArg);
+
+ for (int i=0; i<enums.getLength(); i++) {
+ struct QvEnumEntry *e = (struct QvEnumEntry *) enums[i];
+ if (e->typeName == typeName) {
+ num = e->num;
+ vals = e->vals;
+ names = e->names;
+ return;
+ }
+ }
+ num = 0;
+ vals = NULL;
+ names = NULL;
+}
+
+QvBool
+QvFieldData::readFieldTypes(QvInput *in, QvNode *object)
+{
+ QvBool gotChar;
+ QvName fieldType, fieldName;
+ char c;
+
+ if (! ((gotChar = in->read(c)) || c != OPEN_BRACE_CHAR))
+ return FALSE;
+
+ if (in->read(c) && c == CLOSE_BRACE_CHAR)
+ return TRUE;
+
+ in->putBack(c);
+
+ QvBool alreadyHasFields = (object->isBuiltIn || getNumFields() != 0);
+
+ while (TRUE) {
+
+ if (! in->read(fieldType, TRUE) || ! in->read(fieldName, TRUE))
+ return FALSE;
+
+ if (! alreadyHasFields) {
+ QvField *fld = QvField::createInstanceFromName(fieldType);
+ fld->setContainer(object);
+ addField(object, fieldName.getString(), fld);
+ }
+
+ if (! in->read(c))
+ return FALSE;
+ if (c == VALUE_SEPARATOR_CHAR) {
+
+ if (in->read(c)) {
+ if (c == CLOSE_BRACE_CHAR)
+ return TRUE;
+ else
+ in->putBack(c);
+ }
+ }
+ else if (c == CLOSE_BRACE_CHAR)
+ return TRUE;
+ else
+ return FALSE;
+ }
+}
+
+QvBool
+QvFieldData::read(QvInput *in, QvNode *object,
+ QvBool errorOnUnknownField) const
+{
+ QvName fieldName;
+
+ if (fields.getLength() == 0) return TRUE;
+
+ while (TRUE) {
+
+ if (! in->read(fieldName, TRUE) || ! fieldName)
+ return TRUE;
+
+ QvBool foundName;
+ if (! read(in, object, fieldName, foundName))
+ return FALSE;
+
+ if (!foundName) {
+ if (errorOnUnknownField) {
+ QvReadError::post(in, "Unknown field \"%s\"",
+ fieldName.getString());
+ return FALSE;
+ }
+ else {
+ in->putBack(fieldName.getString());
+ return TRUE;
+ }
+ }
+ }
+}
+
+QvBool
+QvFieldData::read(QvInput *in, QvNode *object,
+ const QvName &fieldName, QvBool &foundName) const
+{
+ int i = 0;
+ for ( i = 0; i < fields.getLength(); i++) {
+ QvName fni = getFieldName(i);
+
+ if (fieldName == fni) {
+ if (! getField(object, i)->read(in, fieldName))
+ return FALSE;
+ break;
+ }
+ }
+ if (i == fields.getLength())
+ foundName = FALSE;
+ else foundName = TRUE;
+
+ return TRUE;
+}
diff --git a/tool_src/QvLib/QvFieldData.h b/tool_src/QvLib/QvFieldData.h
new file mode 100644
index 0000000..3fb74d8
--- /dev/null
+++ b/tool_src/QvLib/QvFieldData.h
@@ -0,0 +1,46 @@
+#ifndef _QV_FIELD_DATA_
+#define _QV_FIELD_DATA_
+
+#include <QvBasic.h>
+#include <QvPList.h>
+#include <QvString.h>
+
+class QvField;
+class QvInput;
+class QvNode;
+
+class QvFieldData {
+ public:
+ QvFieldData() {}
+ ~QvFieldData();
+
+ void addField(QvNode *defObject, const char *fieldName,
+ const QvField *field);
+
+ int getNumFields() const { return fields.getLength(); }
+
+ const QvName & getFieldName(int index) const;
+
+ QvField * getField(const QvNode *object,
+ int index) const;
+
+ void addEnumValue(const char *typeName,
+ const char *valName, int val);
+ void getEnumData(const char *typeName, int &num,
+ const int *&vals, const QvName *&names);
+
+ QvBool read(QvInput *in, QvNode *object,
+ QvBool errorOnUnknownField = TRUE) const;
+
+ QvBool read(QvInput *in, QvNode *object,
+ const QvName &fieldName,
+ QvBool &foundName) const;
+
+ QvBool readFieldTypes(QvInput *in, QvNode *object);
+
+ private:
+ QvPList fields;
+ QvPList enums;
+};
+
+#endif /* _QV_FIELD_DATA_ */
diff --git a/tool_src/QvLib/QvFields.h b/tool_src/QvLib/QvFields.h
new file mode 100644
index 0000000..f731b0d
--- /dev/null
+++ b/tool_src/QvLib/QvFields.h
@@ -0,0 +1,23 @@
+#ifndef _QV_FIELDS_
+#define _QV_FIELDS_
+
+#include <QvMFColor.h>
+#include <QvMFFloat.h>
+#include <QvMFLong.h>
+#include <QvMFVec2f.h>
+#include <QvMFVec3f.h>
+
+#include <QvSFBitMask.h>
+#include <QvSFBool.h>
+#include <QvSFColor.h>
+#include <QvSFEnum.h>
+#include <QvSFFloat.h>
+#include <QvSFImage.h>
+#include <QvSFLong.h>
+#include <QvSFMatrix.h>
+#include <QvSFRotation.h>
+#include <QvSFString.h>
+#include <QvSFVec2f.h>
+#include <QvSFVec3f.h>
+
+#endif /* _QV_FIELDS_ */
diff --git a/tool_src/QvLib/QvGroup.cpp b/tool_src/QvLib/QvGroup.cpp
new file mode 100644
index 0000000..96795c5
--- /dev/null
+++ b/tool_src/QvLib/QvGroup.cpp
@@ -0,0 +1,81 @@
+#include <QvInput.h>
+#include <QvReadError.h>
+#include <QvFieldData.h>
+#include <QvChildList.h>
+#include <QvGroup.h>
+
+QV_NODE_SOURCE(QvGroup);
+
+QvGroup::QvGroup()
+{
+ children = new QvChildList();
+ QV_NODE_CONSTRUCTOR(QvGroup);
+ isBuiltIn = TRUE;
+}
+
+QvGroup::~QvGroup()
+{
+ delete children;
+}
+
+QvNode *
+QvGroup::getChild(int index) const
+{
+ return(*children)[index];
+}
+
+int
+QvGroup::getNumChildren() const
+{
+ return children->getLength();
+}
+
+QvChildList *
+QvGroup::getChildren() const
+{
+ return children;
+}
+
+QvBool
+QvGroup::readInstance(QvInput *in)
+{
+ QvName typeString;
+ QvFieldData *fieldData = getFieldData();
+
+ if (! isBuiltIn) {
+ if (in->read(typeString, TRUE)) {
+ if (typeString == "fields") {
+ if (! fieldData->readFieldTypes(in, this)) {
+ QvReadError::post(in, "Bad field specifications for node");
+ return FALSE;
+ }
+ }
+ else
+ in->putBack(typeString.getString());
+ }
+ }
+
+ return (fieldData->read(in, this, FALSE) && readChildren(in));
+}
+
+QvBool
+QvGroup::readChildren(QvInput *in)
+{
+ QvNode *child;
+ QvBool ret = TRUE;
+
+ while (TRUE) {
+ if (read(in, child)) {
+ if (child != NULL)
+ children->append(child);
+ else
+ break;
+ }
+ else {
+ ret = FALSE;
+ break;
+ }
+ }
+
+ return ret;
+}
diff --git a/tool_src/QvLib/QvGroup.h b/tool_src/QvLib/QvGroup.h
new file mode 100644
index 0000000..0cb092a
--- /dev/null
+++ b/tool_src/QvLib/QvGroup.h
@@ -0,0 +1,19 @@
+#ifndef _QV_GROUP_
+#define _QV_GROUP_
+
+class QvChildList;
+#include <QvSubNode.h>
+
+class QvGroup : public QvNode {
+
+ QV_NODE_HEADER(QvGroup);
+
+ public:
+ QvNode * getChild(int index) const;
+ int getNumChildren() const;
+ virtual QvChildList *getChildren() const;
+ virtual QvBool readInstance(QvInput *in);
+ virtual QvBool readChildren(QvInput *in);
+};
+
+#endif /* _QV_GROUP_ */
diff --git a/tool_src/QvLib/QvIndexedFaceSet.cpp b/tool_src/QvLib/QvIndexedFaceSet.cpp
new file mode 100644
index 0000000..c5cbe26
--- /dev/null
+++ b/tool_src/QvLib/QvIndexedFaceSet.cpp
@@ -0,0 +1,23 @@
+#include <QvIndexedFaceSet.h>
+
+QV_NODE_SOURCE(QvIndexedFaceSet);
+
+QvIndexedFaceSet::QvIndexedFaceSet()
+{
+ QV_NODE_CONSTRUCTOR(QvIndexedFaceSet);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(coordIndex);
+ QV_NODE_ADD_FIELD(materialIndex);
+ QV_NODE_ADD_FIELD(normalIndex);
+ QV_NODE_ADD_FIELD(textureCoordIndex);
+
+ coordIndex.values[0] = 0;
+ materialIndex.values[0] = QV_END_FACE_INDEX;
+ normalIndex.values[0] = QV_END_FACE_INDEX;
+ textureCoordIndex.values[0] = QV_END_FACE_INDEX;
+}
+
+QvIndexedFaceSet::~QvIndexedFaceSet()
+{
+}
diff --git a/tool_src/QvLib/QvIndexedFaceSet.h b/tool_src/QvLib/QvIndexedFaceSet.h
new file mode 100644
index 0000000..ffe4a5b
--- /dev/null
+++ b/tool_src/QvLib/QvIndexedFaceSet.h
@@ -0,0 +1,21 @@
+#ifndef _QV_INDEXED_FACE_SET_
+#define _QV_INDEXED_FACE_SET_
+
+#include <QvMFLong.h>
+#include <QvSubNode.h>
+
+#define QV_END_FACE_INDEX (-1)
+
+class QvIndexedFaceSet : public QvNode {
+
+ QV_NODE_HEADER(QvIndexedFaceSet);
+
+ public:
+ // Fields:
+ QvMFLong coordIndex; // Coordinate indices
+ QvMFLong materialIndex; // Material indices
+ QvMFLong normalIndex; // Surface normal indices
+ QvMFLong textureCoordIndex; // Texture Coordinate indices
+};
+
+#endif /* _QV_INDEXED_FACE_SET_ */
diff --git a/tool_src/QvLib/QvIndexedLineSet.cpp b/tool_src/QvLib/QvIndexedLineSet.cpp
new file mode 100644
index 0000000..79c10a6
--- /dev/null
+++ b/tool_src/QvLib/QvIndexedLineSet.cpp
@@ -0,0 +1,23 @@
+#include <QvIndexedLineSet.h>
+
+QV_NODE_SOURCE(QvIndexedLineSet);
+
+QvIndexedLineSet::QvIndexedLineSet()
+{
+ QV_NODE_CONSTRUCTOR(QvIndexedLineSet);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(coordIndex);
+ QV_NODE_ADD_FIELD(materialIndex);
+ QV_NODE_ADD_FIELD(normalIndex);
+ QV_NODE_ADD_FIELD(textureCoordIndex);
+
+ coordIndex.values[0] = 0;
+ materialIndex.values[0] = QV_END_LINE_INDEX;
+ normalIndex.values[0] = QV_END_LINE_INDEX;
+ textureCoordIndex.values[0] = QV_END_LINE_INDEX;
+}
+
+QvIndexedLineSet::~QvIndexedLineSet()
+{
+}
diff --git a/tool_src/QvLib/QvIndexedLineSet.h b/tool_src/QvLib/QvIndexedLineSet.h
new file mode 100644
index 0000000..cfcecd7
--- /dev/null
+++ b/tool_src/QvLib/QvIndexedLineSet.h
@@ -0,0 +1,21 @@
+#ifndef _QV_INDEXED_LINE_SET_
+#define _QV_INDEXED_LINE_SET_
+
+#include <QvMFLong.h>
+#include <QvSubNode.h>
+
+#define QV_END_LINE_INDEX (-1)
+
+class QvIndexedLineSet : public QvNode {
+
+ QV_NODE_HEADER(QvIndexedLineSet);
+
+ public:
+ // Fields:
+ QvMFLong coordIndex; // Coordinate indices
+ QvMFLong materialIndex; // Material indices
+ QvMFLong normalIndex; // Surline normal indices
+ QvMFLong textureCoordIndex; // Texture Coordinate indices
+};
+
+#endif /* _QV_INDEXED_LINE_SET_ */
diff --git a/tool_src/QvLib/QvInfo.cpp b/tool_src/QvLib/QvInfo.cpp
new file mode 100644
index 0000000..4ab54fc
--- /dev/null
+++ b/tool_src/QvLib/QvInfo.cpp
@@ -0,0 +1,17 @@
+#include <QvInfo.h>
+
+QV_NODE_SOURCE(QvInfo);
+
+QvInfo::QvInfo()
+{
+ QV_NODE_CONSTRUCTOR(QvInfo);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(string);
+
+ string.value = "<Undefined info>";
+}
+
+QvInfo::~QvInfo()
+{
+}
diff --git a/tool_src/QvLib/QvInfo.h b/tool_src/QvLib/QvInfo.h
new file mode 100644
index 0000000..4173253
--- /dev/null
+++ b/tool_src/QvLib/QvInfo.h
@@ -0,0 +1,16 @@
+#ifndef _QV_INFO_
+#define _QV_INFO_
+
+#include <QvSFString.h>
+#include <QvSubNode.h>
+
+class QvInfo : public QvNode {
+
+ QV_NODE_HEADER(QvInfo);
+
+ public:
+ // Fields
+ QvSFString string; // Info string
+};
+
+#endif /* _QV_INFO_ */
diff --git a/tool_src/QvLib/QvInput.cpp b/tool_src/QvLib/QvInput.cpp
new file mode 100644
index 0000000..2f77669
--- /dev/null
+++ b/tool_src/QvLib/QvInput.cpp
@@ -0,0 +1,568 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <QvInput.h>
+#include <QvDebugError.h>
+#include <QvReadError.h>
+#include <QvNode.h>
+
+#define CURVERSION 1.0 // Current version of file format
+#define COMMENT_CHAR '#'
+
+static const int numValidASCIIHeaders = 1;
+struct headerStorage
+{
+ const char *string;
+ float version;
+};
+
+static const headerStorage ASCIIHeader[1] = {
+ { "#VRML V1.0 ascii", /* 20 chars */ 1.0 },
+};
+
+float
+QvInput::isASCIIHeader(const char *string)
+{
+ for (int i = 0; i < numValidASCIIHeaders; i++) {
+ if (strcmp(ASCIIHeader[i].string, string) == 0)
+ return ASCIIHeader[i].version;
+ }
+ return FALSE;
+}
+
+QvInput::QvInput()
+{
+ setFilePointer(stdin);
+}
+
+QvInput::~QvInput()
+{
+}
+
+void
+QvInput::setFilePointer(FILE *newFP)
+{
+ fp = newFP;
+ lineNum = 1;
+ version = CURVERSION;
+ readHeader = FALSE;
+ headerOk = TRUE;
+ backBufIndex = -1;
+}
+
+float
+QvInput::getVersion()
+{
+ if (! readHeader)
+ (void) checkHeader();
+
+ return version;
+}
+
+QvBool
+QvInput::get(char &c)
+{
+ QvBool ret;
+
+ if (backBufIndex >= 0) {
+ c = backBuf.getString()[backBufIndex++];
+
+ if (c != '\0')
+ return TRUE;
+
+ backBuf.makeEmpty();
+ backBufIndex = -1;
+ }
+
+ if (! readHeader && ! checkHeader())
+ return FALSE;
+
+ if (eof()) {
+ c = (char)EOF;
+ ret = FALSE;
+ }
+
+ else {
+ int i = getc(fp);
+
+ if (i == EOF) {
+ c = (char)EOF;
+ ret = FALSE;
+ }
+ else {
+ c = (char) i;
+ ret = TRUE;
+ }
+ }
+
+ return ret;
+}
+
+QvBool
+QvInput::read(char &c)
+{
+ return (skipWhiteSpace() && get(c));
+}
+
+QvBool
+QvInput::read(QvString &s)
+{
+ if (! skipWhiteSpace())
+ return FALSE;
+
+ QvBool quoted;
+ char c;
+ char bufStore[256];
+ char *buf;
+ int bytesLeft;
+
+ s.makeEmpty();
+
+ if (! get(c))
+ return FALSE;
+
+ quoted = (c == '\"');
+ if (! quoted)
+ putBack(c);
+
+ do {
+ buf = bufStore;
+ bytesLeft = sizeof(bufStore) - 1;
+
+ while (bytesLeft > 0) {
+
+ if (! get(*buf))
+ break;
+
+ if (quoted) {
+ if (*buf == '\"')
+ break;
+
+ if (*buf == '\\') {
+ if ((get(c)) && c == '\"')
+ *buf = '\"';
+ else
+ putBack(c);
+ }
+
+ if (*buf == '\n')
+ lineNum++;
+ }
+
+ else if (isspace(*buf)) {
+ putBack(*buf);
+ break;
+ }
+
+ buf++;
+ bytesLeft--;
+ }
+ *buf = '\0';
+
+ s += bufStore;
+
+ } while (bytesLeft == 0);
+
+ return TRUE;
+}
+
+QvBool
+QvInput::read(QvName &n, QvBool validIdent)
+{
+ QvBool gotChar;
+
+ if (! skipWhiteSpace())
+ return FALSE;
+
+ if (! validIdent) {
+ QvString s;
+
+ if (! read(s))
+ return FALSE;
+
+ n = s;
+ }
+
+ else {
+ char buf[256];
+ char *b = buf;
+ char c;
+
+ if ((gotChar = get(c)) && QvName::isIdentStartChar(c)) {
+ *b++ = c;
+
+ while ((gotChar = get(c)) && QvName::isIdentChar(c)) {
+ if (b - buf < 255)
+ *b++ = c;
+ }
+ }
+ *b = '\0';
+
+ if (gotChar)
+ putBack(c);
+
+ n = buf;
+ }
+
+ return TRUE;
+}
+
+#define READ_NUM(reader, readType, num, type) \
+ QvBool ok; \
+ if (! skipWhiteSpace()) \
+ ok = FALSE; \
+ else { \
+ readType _tmp; \
+ ok = reader(_tmp); \
+ if (ok) \
+ num = (type) _tmp; \
+ } \
+ return ok
+
+#define READ_INTEGER(num, type) \
+ READ_NUM(readInteger, long, num, type)
+
+#define READ_UNSIGNED_INTEGER(num, type) \
+ READ_NUM(readUnsignedInteger, unsigned long, num, type)
+
+#define READ_REAL(num, type) \
+ READ_NUM(readReal, double, num, type)
+
+QvBool
+QvInput::read(int &i)
+{
+ READ_INTEGER(i, int);
+}
+
+QvBool
+QvInput::read(unsigned int &i)
+{
+ READ_UNSIGNED_INTEGER(i, unsigned int);
+}
+
+QvBool
+QvInput::read(short &s)
+{
+ READ_INTEGER(s, short);
+}
+
+QvBool
+QvInput::read(unsigned short &s)
+{
+ READ_UNSIGNED_INTEGER(s, unsigned short);
+}
+
+QvBool
+QvInput::read(long &l)
+{
+ READ_INTEGER(l, long);
+}
+
+QvBool
+QvInput::read(unsigned long &l)
+{
+ READ_UNSIGNED_INTEGER(l, unsigned long);
+}
+
+QvBool
+QvInput::read(float &f)
+{
+ READ_REAL(f, float);
+}
+
+QvBool
+QvInput::read(double &d)
+{
+ READ_REAL(d, double);
+}
+
+QvBool
+QvInput::eof() const
+{
+ return feof(fp);
+}
+
+void
+QvInput::getLocationString(QvString &string) const
+{
+ char buf[128];
+ sprintf(buf, "\tOccurred at line %3d", lineNum);
+ string = buf;
+}
+
+void
+QvInput::putBack(char c)
+{
+ if (c == (char) EOF)
+ return;
+
+ if (backBufIndex >= 0)
+ --backBufIndex;
+ else
+ ungetc(c, fp);
+}
+
+void
+QvInput::putBack(const char *string)
+{
+ backBuf = string;
+ backBufIndex = 0;
+}
+
+QvBool
+QvInput::checkHeader()
+{
+ char c;
+
+ readHeader = TRUE;
+
+ if (get(c)) {
+ if (c == COMMENT_CHAR) {
+ char buf[256];
+ int i = 0;
+
+ buf[i++] = c;
+ while (get(c) && c != '\n')
+ buf[i++] = c;
+ buf[i] = '\0';
+ if (c == '\n')
+ lineNum++;
+
+ if ((version = isASCIIHeader(buf)))
+ return TRUE;
+ }
+
+ else
+ putBack(c);
+ }
+
+ QvReadError::post(this, "File does not have a valid header string");
+ headerOk = FALSE;
+ return FALSE;
+}
+
+QvBool
+QvInput::skipWhiteSpace()
+{
+ char c;
+ QvBool gotChar;
+
+ if (! readHeader && ! checkHeader())
+ return FALSE;
+
+ while (TRUE) {
+
+ while ((gotChar = get(c)) && isspace(c))
+ if (c == '\n')
+ lineNum++;
+
+ if (! gotChar)
+ break;
+
+ if (c == COMMENT_CHAR) {
+ while (get(c) && c != '\n')
+ ;
+
+ if (eof())
+ QvReadError::post(this, "EOF reached before end of comment");
+ else
+ lineNum++;
+ }
+ else {
+ putBack(c);
+ break; }
+ }
+
+ return TRUE;
+}
+
+QvBool
+QvInput::readInteger(long &l)
+{
+ char str[32];
+ char *s = str;
+
+ if (readChar(s, '-') || readChar(s, '+'))
+ s++;
+
+ if (! readUnsignedIntegerString(s))
+ return FALSE;
+
+ l = strtol(str, NULL, 0);
+
+ return TRUE;
+}
+
+QvBool
+QvInput::readUnsignedInteger(unsigned long &l)
+{
+ char str[32];
+ if (! readUnsignedIntegerString(str))
+ return FALSE;
+
+ l = strtoul(str, NULL, 0);
+
+ return TRUE;
+}
+
+QvBool
+QvInput::readUnsignedIntegerString(char *str)
+{
+ int minSize = 1;
+ char *s = str;
+
+ if (readChar(s, '0')) {
+
+ if (readChar(s + 1, 'x')) {
+ s += 2 + readHexDigits(s + 2);
+ minSize = 3;
+ }
+
+ else
+ s += 1 + readDigits(s + 1);
+ }
+
+ else
+ s += readDigits(s);
+
+ if (s - str < minSize)
+ return FALSE;
+
+ *s = '\0';
+
+ return TRUE;
+}
+
+QvBool
+QvInput::readReal(double &d)
+{
+ char str[32];
+ int n;
+ char *s = str;
+ QvBool gotNum = FALSE;
+
+ n = readChar(s, '-');
+ if (n == 0)
+ n = readChar(s, '+');
+ s += n;
+
+ if ((n = readDigits(s)) > 0) {
+ gotNum = TRUE;
+ s += n;
+ }
+
+ if (readChar(s, '.') > 0) {
+ s++;
+
+ if ((n = readDigits(s)) > 0) {
+ gotNum = TRUE;
+ s += n;
+ }
+ }
+
+ if (! gotNum)
+ return FALSE;
+
+ n = readChar(s, 'e');
+ if (n == 0)
+ n = readChar(s, 'E');
+
+ if (n > 0) {
+ s += n;
+
+ n = readChar(s, '-');
+ if (n == 0)
+ n = readChar(s, '+');
+ s += n;
+
+ if ((n = readDigits(s)) > 0)
+ s += n;
+
+ else
+ return FALSE; }
+
+ *s = '\0';
+
+ d = atof(str);
+
+ return TRUE;
+}
+
+int
+QvInput::readDigits(char *string)
+{
+ char c, *s = string;
+
+ while (get(c)) {
+
+ if (isdigit(c))
+ *s++ = c;
+
+ else {
+ putBack(c);
+ break;
+ }
+ }
+
+ return s - string;
+}
+
+int
+QvInput::readHexDigits(char *string)
+{
+ char c, *s = string;
+
+ while (get(c)) {
+
+ if (isxdigit(c))
+ *s++ = c;
+
+ else {
+ putBack(c);
+ break;
+ }
+ }
+
+ return s - string;
+}
+
+int
+QvInput::readChar(char *string, char charToRead)
+{
+ char c;
+ int ret;
+
+ if (! get(c))
+ ret = 0;
+
+ else if (c == charToRead) {
+ *string = c;
+ ret = 1;
+ }
+
+ else {
+ putBack(c);
+ ret = 0;
+ }
+
+ return ret;
+}
+
+void
+QvInput::addReference(const QvName &name, QvNode *node)
+{
+ refDict.enter((u_long) name.getString(), (void *) node);
+
+ node->setName(name);
+}
+
+QvNode *
+QvInput::findReference(const QvName &name) const
+{
+ void *node;
+
+ if (refDict.find((u_long) name.getString(), node))
+ return (QvNode *) node;
+
+ return NULL;
+}
diff --git a/tool_src/QvLib/QvInput.h b/tool_src/QvLib/QvInput.h
new file mode 100644
index 0000000..f458aed
--- /dev/null
+++ b/tool_src/QvLib/QvInput.h
@@ -0,0 +1,65 @@
+#ifndef _QV_INPUT_
+#define _QV_INPUT_
+
+#include <QvDict.h>
+#include <QvString.h>
+
+class QvNode;
+class QvDB;
+
+class QvInput {
+ public:
+
+ QvInput();
+ ~QvInput();
+
+ static float isASCIIHeader(const char *string);
+ void setFilePointer(FILE *newFP);
+ FILE * getCurFile() const { return fp; }
+ float getVersion();
+ QvBool get(char &c);
+ QvBool read(char &c);
+ QvBool read(QvString &s);
+ QvBool read(QvName &n, QvBool validIdent = FALSE);
+ QvBool read(int &i);
+ QvBool read(unsigned int &i);
+ QvBool read(short &s);
+ QvBool read(unsigned short &s);
+ QvBool read(long &l);
+ QvBool read(unsigned long &l);
+ QvBool read(float &f);
+ QvBool read(double &d);
+ QvBool eof() const;
+ void getLocationString(QvString &string) const;
+ void putBack(char c);
+ void putBack(const char *string);
+ void addReference(const QvName &name, QvNode *node);
+ QvNode * findReference(const QvName &name) const;
+
+ private:
+ FILE *fp; // File pointer
+ int lineNum; // Number of line currently reading
+ float version; // Version number of file
+ QvBool readHeader; // TRUE if header was checked for A/B
+ QvBool headerOk; // TRUE if header was read ok
+ QvDict refDict; // Node reference dictionary
+ QvString backBuf;
+ int backBufIndex;
+
+ QvBool checkHeader();
+
+ QvBool skipWhiteSpace();
+
+ QvBool readInteger(long &l);
+ QvBool readUnsignedInteger(unsigned long &l);
+ QvBool readReal(double &d);
+ QvBool readUnsignedIntegerString(char *str);
+ int readDigits(char *string);
+ int readHexDigits(char *string);
+ int readChar(char *string, char charToRead);
+
+friend class QvNode;
+friend class QvDB;
+};
+
+#endif /* _QV_INPUT_ */
diff --git a/tool_src/QvLib/QvLevelOfDetail.cpp b/tool_src/QvLib/QvLevelOfDetail.cpp
new file mode 100644
index 0000000..28c1b48
--- /dev/null
+++ b/tool_src/QvLib/QvLevelOfDetail.cpp
@@ -0,0 +1,17 @@
+#include <QvLevelOfDetail.h>
+
+QV_NODE_SOURCE(QvLevelOfDetail);
+
+QvLevelOfDetail::QvLevelOfDetail()
+{
+ QV_NODE_CONSTRUCTOR(QvLevelOfDetail);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(screenArea);
+
+ screenArea.values[0] = 0;
+}
+
+QvLevelOfDetail::~QvLevelOfDetail()
+{
+}
diff --git a/tool_src/QvLib/QvLevelOfDetail.h b/tool_src/QvLib/QvLevelOfDetail.h
new file mode 100644
index 0000000..8557cbb
--- /dev/null
+++ b/tool_src/QvLib/QvLevelOfDetail.h
@@ -0,0 +1,16 @@
+#ifndef _QV_LEVEL_OF_DETAIL_
+#define _QV_LEVEL_OF_DETAIL_
+
+#include <QvMFFloat.h>
+#include <QvGroup.h>
+
+class QvLevelOfDetail : public QvGroup {
+
+ QV_NODE_HEADER(QvLevelOfDetail);
+
+ public:
+ // Fields
+ QvMFFloat screenArea; // Areas to use for comparison
+};
+
+#endif /* _QV_LEVEL_OF_DETAIL_ */
diff --git a/tool_src/QvLib/QvLib.vcproj b/tool_src/QvLib/QvLib.vcproj
new file mode 100755
index 0000000..acd9d61
--- /dev/null
+++ b/tool_src/QvLib/QvLib.vcproj
@@ -0,0 +1,1765 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="QvLib"
+ SccProjectName="&quot;$/ParsecTools/QvLib&quot;"
+ SccLocalPath=".">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\BspLib;..\QvLib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderFile=".\Debug/QvLib.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ DebugInformationFormat="4"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile=".\Debug\QvLib.lib"
+ SuppressStartupBanner="TRUE"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="3079"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\BspLib;..\QvLib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+ StringPooling="TRUE"
+ RuntimeLibrary="4"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderFile=".\Release/QvLib.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile=".\Release\QvLib.lib"
+ SuppressStartupBanner="TRUE"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="3079"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="Qvbasic.h">
+ </File>
+ <File
+ RelativePath="QvChildList.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvchildlist.h">
+ </File>
+ <File
+ RelativePath="QvCone.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvcone.h">
+ </File>
+ <File
+ RelativePath="QvCoordinate3.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvcoordinate3.h">
+ </File>
+ <File
+ RelativePath="QvCube.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvcube.h">
+ </File>
+ <File
+ RelativePath="QvCylinder.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvcylinder.h">
+ </File>
+ <File
+ RelativePath="QvDb.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvdb.h">
+ </File>
+ <File
+ RelativePath="QvDebugError.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvdebugerror.h">
+ </File>
+ <File
+ RelativePath="QvDict.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvdict.h">
+ </File>
+ <File
+ RelativePath="QvDirectionalLight.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvdirectionallight.h">
+ </File>
+ <File
+ RelativePath="QvElement.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvelement.h">
+ </File>
+ <File
+ RelativePath="QvField.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvfield.h">
+ </File>
+ <File
+ RelativePath="QvFieldData.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvfielddata.h">
+ </File>
+ <File
+ RelativePath="Qvfields.h">
+ </File>
+ <File
+ RelativePath="QvGroup.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvgroup.h">
+ </File>
+ <File
+ RelativePath="QvIndexedFaceSet.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvindexedfaceset.h">
+ </File>
+ <File
+ RelativePath="QvIndexedLineSet.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvindexedlineset.h">
+ </File>
+ <File
+ RelativePath="QvInfo.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvinfo.h">
+ </File>
+ <File
+ RelativePath="QvInput.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvinput.h">
+ </File>
+ <File
+ RelativePath="QvLevelOfDetail.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvlevelofdetail.h">
+ </File>
+ <File
+ RelativePath="QvLists.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvlists.h">
+ </File>
+ <File
+ RelativePath="QvMaterial.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvmaterial.h">
+ </File>
+ <File
+ RelativePath="QvMaterialBinding.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvmaterialbinding.h">
+ </File>
+ <File
+ RelativePath="QvMatrixTransform.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvmatrixtransform.h">
+ </File>
+ <File
+ RelativePath="QvMFColor.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvmfcolor.h">
+ </File>
+ <File
+ RelativePath="QvMFFloat.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvmffloat.h">
+ </File>
+ <File
+ RelativePath="QvMFLong.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvmflong.h">
+ </File>
+ <File
+ RelativePath="QvMFVec2f.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvmfvec2f.h">
+ </File>
+ <File
+ RelativePath="QvMFVec3f.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvmfvec3f.h">
+ </File>
+ <File
+ RelativePath="QvName.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="QvNode.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvnode.h">
+ </File>
+ <File
+ RelativePath="Qvnodes.h">
+ </File>
+ <File
+ RelativePath="QvNormal.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvnormal.h">
+ </File>
+ <File
+ RelativePath="QvNormalBinding.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvnormalbinding.h">
+ </File>
+ <File
+ RelativePath="QvOrthographicCamera.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvorthographiccamera.h">
+ </File>
+ <File
+ RelativePath="QvPerspectiveCamera.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvperspectivecamera.h">
+ </File>
+ <File
+ RelativePath="QvPList.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvplist.h">
+ </File>
+ <File
+ RelativePath="QvPointLight.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvpointlight.h">
+ </File>
+ <File
+ RelativePath="QvPointSet.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvpointset.h">
+ </File>
+ <File
+ RelativePath="QvReadError.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvreaderror.h">
+ </File>
+ <File
+ RelativePath="QvRotation.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvrotation.h">
+ </File>
+ <File
+ RelativePath="QvScale.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvscale.h">
+ </File>
+ <File
+ RelativePath="QvSeparator.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvseparator.h">
+ </File>
+ <File
+ RelativePath="QvSFBitMask.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvsfbitmask.h">
+ </File>
+ <File
+ RelativePath="QvSFBool.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvsfbool.h">
+ </File>
+ <File
+ RelativePath="QvSFColor.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvsfcolor.h">
+ </File>
+ <File
+ RelativePath="QvSFEnum.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvsfenum.h">
+ </File>
+ <File
+ RelativePath="QvSFFloat.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvsffloat.h">
+ </File>
+ <File
+ RelativePath="QvSFImage.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvsfimage.h">
+ </File>
+ <File
+ RelativePath="QvSFLong.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvsflong.h">
+ </File>
+ <File
+ RelativePath="QvSFMatrix.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvsfmatrix.h">
+ </File>
+ <File
+ RelativePath="QvSFRotation.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvsfrotation.h">
+ </File>
+ <File
+ RelativePath="QvSFString.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvsfstring.h">
+ </File>
+ <File
+ RelativePath="QvSFVec2f.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvsfvec2f.h">
+ </File>
+ <File
+ RelativePath="QvSFVec3f.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvsfvec3f.h">
+ </File>
+ <File
+ RelativePath="QvShapeHints.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvshapehints.h">
+ </File>
+ <File
+ RelativePath="QvSphere.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvsphere.h">
+ </File>
+ <File
+ RelativePath="QvSpotlight.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvspotlight.h">
+ </File>
+ <File
+ RelativePath="QvState.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvstate.h">
+ </File>
+ <File
+ RelativePath="QvString.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvstring.h">
+ </File>
+ <File
+ RelativePath="Qvsubfield.h">
+ </File>
+ <File
+ RelativePath="Qvsubnode.h">
+ </File>
+ <File
+ RelativePath="QvSwitch.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvswitch.h">
+ </File>
+ <File
+ RelativePath="QvTexture2.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvtexture2.h">
+ </File>
+ <File
+ RelativePath="QvTexture2Transform.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvtexture2transform.h">
+ </File>
+ <File
+ RelativePath="QvTextureCoordinate2.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvtexturecoordinate2.h">
+ </File>
+ <File
+ RelativePath="QvTransform.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvtransform.h">
+ </File>
+ <File
+ RelativePath="QvTransformSeparator.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvtransformseparator.h">
+ </File>
+ <File
+ RelativePath="QvTranslation.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvtranslation.h">
+ </File>
+ <File
+ RelativePath="QvTraverse.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="QvUnknownNode.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvunknownnode.h">
+ </File>
+ <File
+ RelativePath="QvWWWAnchor.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvwwwanchor.h">
+ </File>
+ <File
+ RelativePath="QvWWWInline.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="Qvwwwinline.h">
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/tool_src/QvLib/QvLib.vcxproj b/tool_src/QvLib/QvLib.vcxproj
new file mode 100755
index 0000000..9951ca7
--- /dev/null
+++ b/tool_src/QvLib/QvLib.vcxproj
@@ -0,0 +1,597 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <SccProjectName>"$/ParsecTools/QvLib"</SccProjectName>
+ <SccLocalPath>.</SccLocalPath>
+ <ProjectGuid>{A7E24141-287A-4D83-9C15-8A7EDC9A02A2}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v110</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v110</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>11.0.50727.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>.\Debug\</OutDir>
+ <IntDir>.\Debug\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>.\Release\</OutDir>
+ <IntDir>.\Release\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\BspLib;..\QvLib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader />
+ <PrecompiledHeaderOutputFile>.\Debug/QvLib.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
+ <ObjectFileName>.\Debug/</ObjectFileName>
+ <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <Lib>
+ <OutputFile>.\Debug\QvLib.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0c07</Culture>
+ </ResourceCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\BspLib;..\QvLib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader />
+ <PrecompiledHeaderOutputFile>.\Release/QvLib.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>.\Release/</AssemblerListingLocation>
+ <ObjectFileName>.\Release/</ObjectFileName>
+ <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <Lib>
+ <OutputFile>.\Release\QvLib.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0c07</Culture>
+ </ResourceCompile>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="Qvbasic.h" />
+ <ClInclude Include="Qvchildlist.h" />
+ <ClInclude Include="Qvcone.h" />
+ <ClInclude Include="Qvcoordinate3.h" />
+ <ClInclude Include="Qvcube.h" />
+ <ClInclude Include="Qvcylinder.h" />
+ <ClInclude Include="Qvdb.h" />
+ <ClInclude Include="Qvdebugerror.h" />
+ <ClInclude Include="Qvdict.h" />
+ <ClInclude Include="Qvdirectionallight.h" />
+ <ClInclude Include="Qvelement.h" />
+ <ClInclude Include="Qvfield.h" />
+ <ClInclude Include="Qvfielddata.h" />
+ <ClInclude Include="Qvfields.h" />
+ <ClInclude Include="Qvgroup.h" />
+ <ClInclude Include="Qvindexedfaceset.h" />
+ <ClInclude Include="Qvindexedlineset.h" />
+ <ClInclude Include="Qvinfo.h" />
+ <ClInclude Include="Qvinput.h" />
+ <ClInclude Include="Qvlevelofdetail.h" />
+ <ClInclude Include="Qvlists.h" />
+ <ClInclude Include="Qvmaterial.h" />
+ <ClInclude Include="Qvmaterialbinding.h" />
+ <ClInclude Include="Qvmatrixtransform.h" />
+ <ClInclude Include="Qvmfcolor.h" />
+ <ClInclude Include="Qvmffloat.h" />
+ <ClInclude Include="Qvmflong.h" />
+ <ClInclude Include="Qvmfvec2f.h" />
+ <ClInclude Include="Qvmfvec3f.h" />
+ <ClInclude Include="Qvnode.h" />
+ <ClInclude Include="Qvnodes.h" />
+ <ClInclude Include="Qvnormal.h" />
+ <ClInclude Include="Qvnormalbinding.h" />
+ <ClInclude Include="Qvorthographiccamera.h" />
+ <ClInclude Include="Qvperspectivecamera.h" />
+ <ClInclude Include="Qvplist.h" />
+ <ClInclude Include="Qvpointlight.h" />
+ <ClInclude Include="Qvpointset.h" />
+ <ClInclude Include="Qvreaderror.h" />
+ <ClInclude Include="Qvrotation.h" />
+ <ClInclude Include="Qvscale.h" />
+ <ClInclude Include="Qvseparator.h" />
+ <ClInclude Include="Qvsfbitmask.h" />
+ <ClInclude Include="Qvsfbool.h" />
+ <ClInclude Include="Qvsfcolor.h" />
+ <ClInclude Include="Qvsfenum.h" />
+ <ClInclude Include="Qvsffloat.h" />
+ <ClInclude Include="Qvsfimage.h" />
+ <ClInclude Include="Qvsflong.h" />
+ <ClInclude Include="Qvsfmatrix.h" />
+ <ClInclude Include="Qvsfrotation.h" />
+ <ClInclude Include="Qvsfstring.h" />
+ <ClInclude Include="Qvsfvec2f.h" />
+ <ClInclude Include="Qvsfvec3f.h" />
+ <ClInclude Include="Qvshapehints.h" />
+ <ClInclude Include="Qvsphere.h" />
+ <ClInclude Include="Qvspotlight.h" />
+ <ClInclude Include="Qvstate.h" />
+ <ClInclude Include="Qvstring.h" />
+ <ClInclude Include="Qvsubfield.h" />
+ <ClInclude Include="Qvsubnode.h" />
+ <ClInclude Include="Qvswitch.h" />
+ <ClInclude Include="Qvtexture2.h" />
+ <ClInclude Include="Qvtexture2transform.h" />
+ <ClInclude Include="Qvtexturecoordinate2.h" />
+ <ClInclude Include="Qvtransform.h" />
+ <ClInclude Include="Qvtransformseparator.h" />
+ <ClInclude Include="Qvtranslation.h" />
+ <ClInclude Include="Qvunknownnode.h" />
+ <ClInclude Include="Qvwwwanchor.h" />
+ <ClInclude Include="Qvwwwinline.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="QvChildList.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvCone.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvCoordinate3.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvCube.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvCylinder.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvDb.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvDebugError.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvDict.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvDirectionalLight.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvElement.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvField.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvFieldData.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvGroup.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvIndexedFaceSet.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvIndexedLineSet.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvInfo.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvInput.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvLevelOfDetail.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvLists.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvMaterial.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvMaterialBinding.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvMatrixTransform.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvMFColor.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvMFFloat.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvMFLong.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvMFVec2f.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvMFVec3f.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvName.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvNode.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvNormal.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvNormalBinding.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvOrthographicCamera.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvPerspectiveCamera.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvPList.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvPointLight.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvPointSet.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvReadError.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvRotation.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvScale.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSeparator.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSFBitMask.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSFBool.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSFColor.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSFEnum.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSFFloat.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSFImage.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSFLong.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSFMatrix.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSFRotation.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSFString.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSFVec2f.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSFVec3f.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvShapeHints.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSphere.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSpotlight.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvState.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvString.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvSwitch.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvTexture2.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvTexture2Transform.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvTextureCoordinate2.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvTransform.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvTransformSeparator.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvTranslation.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvTraverse.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvUnknownNode.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvWWWAnchor.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="QvWWWInline.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\BspLib\BspLib.vcxproj">
+ <Project>{aa6fab40-a936-486c-9db0-1addffcd4d00}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/tool_src/QvLib/QvLists.cpp b/tool_src/QvLib/QvLists.cpp
new file mode 100644
index 0000000..2c844a4
--- /dev/null
+++ b/tool_src/QvLib/QvLists.cpp
@@ -0,0 +1,5 @@
+#include <QvLists.h>
+
+QvNodeList::QvNodeList() : QvPList()
+{
+}
diff --git a/tool_src/QvLib/QvLists.h b/tool_src/QvLib/QvLists.h
new file mode 100644
index 0000000..7b9ec15
--- /dev/null
+++ b/tool_src/QvLib/QvLists.h
@@ -0,0 +1,17 @@
+#ifndef _QV_LISTS_
+#define _QV_LISTS_
+
+#include <QvPList.h>
+
+class QvField;
+class QvNode;
+
+class QvNodeList : public QvPList {
+ public:
+ QvNodeList();
+ ~QvNodeList() { truncate(0); }
+ QvNode * operator [](int i) const
+ { return ( (QvNode *) ( (*(const QvPList *) this) [i] ) ); }
+};
+
+#endif /* _QV_LISTS_ */
diff --git a/tool_src/QvLib/QvMFColor.cpp b/tool_src/QvLib/QvMFColor.cpp
new file mode 100644
index 0000000..10fbaeb
--- /dev/null
+++ b/tool_src/QvLib/QvMFColor.cpp
@@ -0,0 +1,13 @@
+#include <QvMFColor.h>
+
+QV_MFIELD_SOURCE(QvMFColor, float, 3);
+
+QvBool
+QvMFColor::read1Value(QvInput *in, int index)
+{
+ float *valuePtr = values + index * 3;
+
+ return (in->read(valuePtr[0]) &&
+ in->read(valuePtr[1]) &&
+ in->read(valuePtr[2]));
+}
diff --git a/tool_src/QvLib/QvMFColor.h b/tool_src/QvLib/QvMFColor.h
new file mode 100644
index 0000000..3950c2f
--- /dev/null
+++ b/tool_src/QvLib/QvMFColor.h
@@ -0,0 +1,12 @@
+#ifndef _QV_MF_COLOR_
+#define _QV_MF_COLOR_
+
+#include <QvSubField.h>
+
+class QvMFColor : public QvMField {
+ public:
+ float *values; // 3 per color
+ QV_MFIELD_HEADER(QvMFColor);
+};
+
+#endif /* _QV_MF_COLOR_ */
diff --git a/tool_src/QvLib/QvMFFloat.cpp b/tool_src/QvLib/QvMFFloat.cpp
new file mode 100644
index 0000000..240df46
--- /dev/null
+++ b/tool_src/QvLib/QvMFFloat.cpp
@@ -0,0 +1,9 @@
+#include <QvMFFloat.h>
+
+QV_MFIELD_SOURCE(QvMFFloat, float, 1);
+
+QvBool
+QvMFFloat::read1Value(QvInput *in, int index)
+{
+ return in->read(values[index]);
+}
diff --git a/tool_src/QvLib/QvMFFloat.h b/tool_src/QvLib/QvMFFloat.h
new file mode 100644
index 0000000..cf88135
--- /dev/null
+++ b/tool_src/QvLib/QvMFFloat.h
@@ -0,0 +1,12 @@
+#ifndef _QV_MF_FLOAT_
+#define _QV_MF_FLOAT_
+
+#include <QvSubField.h>
+
+class QvMFFloat : public QvMField {
+ public:
+ float *values;
+ QV_MFIELD_HEADER(QvMFFloat);
+};
+
+#endif /* _QV_MF_FLOAT_ */
diff --git a/tool_src/QvLib/QvMFLong.cpp b/tool_src/QvLib/QvMFLong.cpp
new file mode 100644
index 0000000..e0e069c
--- /dev/null
+++ b/tool_src/QvLib/QvMFLong.cpp
@@ -0,0 +1,9 @@
+#include <QvMFLong.h>
+
+QV_MFIELD_SOURCE(QvMFLong, long, 1);
+
+QvBool
+QvMFLong::read1Value(QvInput *in, int index)
+{
+ return in->read(values[index]);
+}
diff --git a/tool_src/QvLib/QvMFLong.h b/tool_src/QvLib/QvMFLong.h
new file mode 100644
index 0000000..4e092d6
--- /dev/null
+++ b/tool_src/QvLib/QvMFLong.h
@@ -0,0 +1,12 @@
+#ifndef _QV_MF_LONG_
+#define _QV_MF_LONG_
+
+#include <QvSubField.h>
+
+class QvMFLong : public QvMField {
+ public:
+ long *values;
+ QV_MFIELD_HEADER(QvMFLong);
+};
+
+#endif /* _QV_MF_LONG_ */
diff --git a/tool_src/QvLib/QvMFVec2f.cpp b/tool_src/QvLib/QvMFVec2f.cpp
new file mode 100644
index 0000000..2a265f5
--- /dev/null
+++ b/tool_src/QvLib/QvMFVec2f.cpp
@@ -0,0 +1,12 @@
+#include <QvMFVec2f.h>
+
+QV_MFIELD_SOURCE(QvMFVec2f, float, 2);
+
+QvBool
+QvMFVec2f::read1Value(QvInput *in, int index)
+{
+ float *valuePtr = values + index * 2;
+
+ return (in->read(valuePtr[0]) &&
+ in->read(valuePtr[1]));
+}
diff --git a/tool_src/QvLib/QvMFVec2f.h b/tool_src/QvLib/QvMFVec2f.h
new file mode 100644
index 0000000..56b8958
--- /dev/null
+++ b/tool_src/QvLib/QvMFVec2f.h
@@ -0,0 +1,12 @@
+#ifndef _QV_MF_VEC2F_
+#define _QV_MF_VEC2F_
+
+#include <QvSubField.h>
+
+class QvMFVec2f : public QvMField {
+ public:
+ float *values;
+ QV_MFIELD_HEADER(QvMFVec2f);
+};
+
+#endif /* _QV_MF_VEC2F_ */
diff --git a/tool_src/QvLib/QvMFVec3f.cpp b/tool_src/QvLib/QvMFVec3f.cpp
new file mode 100644
index 0000000..1022579
--- /dev/null
+++ b/tool_src/QvLib/QvMFVec3f.cpp
@@ -0,0 +1,13 @@
+#include <QvMFVec3f.h>
+
+QV_MFIELD_SOURCE(QvMFVec3f, float, 3);
+
+QvBool
+QvMFVec3f::read1Value(QvInput *in, int index)
+{
+ float *valuePtr = values + index * 3;
+
+ return (in->read(valuePtr[0]) &&
+ in->read(valuePtr[1]) &&
+ in->read(valuePtr[2]));
+}
diff --git a/tool_src/QvLib/QvMFVec3f.h b/tool_src/QvLib/QvMFVec3f.h
new file mode 100644
index 0000000..e3efd93
--- /dev/null
+++ b/tool_src/QvLib/QvMFVec3f.h
@@ -0,0 +1,12 @@
+#ifndef _QV_MF_VEC3F_
+#define _QV_MF_VEC3F_
+
+#include <QvSubField.h>
+
+class QvMFVec3f : public QvMField {
+ public:
+ float *values;
+ QV_MFIELD_HEADER(QvMFVec3f);
+};
+
+#endif /* _QV_MF_VEC3F_ */
diff --git a/tool_src/QvLib/QvMaterial.cpp b/tool_src/QvLib/QvMaterial.cpp
new file mode 100644
index 0000000..9b5bc43
--- /dev/null
+++ b/tool_src/QvLib/QvMaterial.cpp
@@ -0,0 +1,27 @@
+#include <QvMaterial.h>
+
+QV_NODE_SOURCE(QvMaterial);
+
+QvMaterial::QvMaterial()
+{
+ QV_NODE_CONSTRUCTOR(QvMaterial);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(ambientColor);
+ QV_NODE_ADD_FIELD(diffuseColor);
+ QV_NODE_ADD_FIELD(specularColor);
+ QV_NODE_ADD_FIELD(emissiveColor);
+ QV_NODE_ADD_FIELD(shininess);
+ QV_NODE_ADD_FIELD(transparency);
+
+ ambientColor.values[0]=ambientColor.values[1]=ambientColor.values[2] = 0.2;
+ diffuseColor.values[0]=diffuseColor.values[1]=diffuseColor.values[2] = 0.2;
+ specularColor.values[0]=specularColor.values[1]=specularColor.values[2]=0.;
+ emissiveColor.values[0]=emissiveColor.values[1]=emissiveColor.values[2]=0.;
+ shininess.values[0] = 0.2;
+ transparency.values[0] = 0.0;
+}
+
+QvMaterial::~QvMaterial()
+{
+}
diff --git a/tool_src/QvLib/QvMaterial.h b/tool_src/QvLib/QvMaterial.h
new file mode 100644
index 0000000..3a15905
--- /dev/null
+++ b/tool_src/QvLib/QvMaterial.h
@@ -0,0 +1,22 @@
+#ifndef _QV_MATERIAL_
+#define _QV_MATERIAL_
+
+#include <QvMFColor.h>
+#include <QvMFFloat.h>
+#include <QvSubNode.h>
+
+class QvMaterial : public QvNode {
+
+ QV_NODE_HEADER(QvMaterial);
+
+ public:
+ // Fields
+ QvMFColor ambientColor; // Ambient color
+ QvMFColor diffuseColor; // Diffuse color
+ QvMFColor specularColor; // Specular color
+ QvMFColor emissiveColor; // Emissive color
+ QvMFFloat shininess; // Shininess
+ QvMFFloat transparency; // Transparency
+};
+
+#endif /* _QV_MATERIAL_ */
diff --git a/tool_src/QvLib/QvMaterialBinding.cpp b/tool_src/QvLib/QvMaterialBinding.cpp
new file mode 100644
index 0000000..f4289d4
--- /dev/null
+++ b/tool_src/QvLib/QvMaterialBinding.cpp
@@ -0,0 +1,31 @@
+#include <QvMaterialBinding.h>
+
+QV_NODE_SOURCE(QvMaterialBinding);
+
+
+QvMaterialBinding::QvMaterialBinding()
+{
+ QV_NODE_CONSTRUCTOR(QvMaterialBinding);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(value);
+
+ value.value = DEFAULT;
+
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, DEFAULT);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, NONE);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, OVERALL);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, PER_PART);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, PER_PART_INDEXED);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, PER_FACE);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, PER_FACE_INDEXED);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, PER_VERTEX);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, PER_VERTEX_INDEXED);
+
+ QV_NODE_SET_SF_ENUM_TYPE(value, Binding);
+}
+
+
+QvMaterialBinding::~QvMaterialBinding()
+{
+}
diff --git a/tool_src/QvLib/QvMaterialBinding.h b/tool_src/QvLib/QvMaterialBinding.h
new file mode 100644
index 0000000..138148e
--- /dev/null
+++ b/tool_src/QvLib/QvMaterialBinding.h
@@ -0,0 +1,28 @@
+#ifndef _QV_MATERIAL_BINDING_
+#define _QV_MATERIAL_BINDING_
+
+#include <QvSFEnum.h>
+#include <QvSubNode.h>
+
+class QvMaterialBinding : public QvNode {
+
+ QV_NODE_HEADER(QvMaterialBinding);
+
+ public:
+ enum Binding {
+ DEFAULT,
+ NONE,
+ OVERALL,
+ PER_PART,
+ PER_PART_INDEXED,
+ PER_FACE,
+ PER_FACE_INDEXED,
+ PER_VERTEX,
+ PER_VERTEX_INDEXED,
+ };
+
+ // Fields:
+ QvSFEnum value;
+};
+
+#endif /* _QV_MATERIAL_BINDING_ */
diff --git a/tool_src/QvLib/QvMatrixTransform.cpp b/tool_src/QvLib/QvMatrixTransform.cpp
new file mode 100644
index 0000000..dc3d7ae
--- /dev/null
+++ b/tool_src/QvLib/QvMatrixTransform.cpp
@@ -0,0 +1,20 @@
+#include <QvMatrixTransform.h>
+
+QV_NODE_SOURCE(QvMatrixTransform);
+
+
+QvMatrixTransform::QvMatrixTransform()
+{
+ QV_NODE_CONSTRUCTOR(QvMatrixTransform);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(matrix);
+
+ for (int i = 0; i < 4; i++)
+ for (int j = 0; j < 4; j++)
+ matrix.value[i][j] = (i == j ? 1.0 : 0.0);
+}
+
+QvMatrixTransform::~QvMatrixTransform()
+{
+}
diff --git a/tool_src/QvLib/QvMatrixTransform.h b/tool_src/QvLib/QvMatrixTransform.h
new file mode 100644
index 0000000..a608cbf
--- /dev/null
+++ b/tool_src/QvLib/QvMatrixTransform.h
@@ -0,0 +1,16 @@
+#ifndef _QV_MATRIX_TRANSFORM_
+#define _QV_MATRIX_TRANSFORM_
+
+#include <QvSFMatrix.h>
+#include <QvSubNode.h>
+
+class QvMatrixTransform : public QvNode {
+
+ QV_NODE_HEADER(QvMatrixTransform);
+
+ public:
+ // Fields
+ QvSFMatrix matrix; // Transformation matrix
+};
+
+#endif /* _QV_MATRIX_TRANSFORM_ */
diff --git a/tool_src/QvLib/QvName.cpp b/tool_src/QvLib/QvName.cpp
new file mode 100644
index 0000000..626c6b8
--- /dev/null
+++ b/tool_src/QvLib/QvName.cpp
@@ -0,0 +1,126 @@
+#include <QvString.h>
+#include <ctype.h>
+
+#define CHUNK_SIZE 4000
+
+struct QvNameChunk {
+ char mem[CHUNK_SIZE];
+ char *curByte;
+ int bytesLeft;
+ struct QvNameChunk *next;
+};
+
+int QvNameEntry::nameTableSize;
+QvNameEntry ** QvNameEntry::nameTable;
+struct QvNameChunk *QvNameEntry::chunk;
+
+void
+QvNameEntry::initClass()
+{
+ int i;
+
+
+ nameTableSize = 1999;
+ nameTable = new QvNameEntry *[nameTableSize];
+
+ for (i = 0; i < nameTableSize; i++)
+ nameTable[i] = NULL;
+
+ chunk = NULL;
+}
+
+const QvNameEntry *
+QvNameEntry::insert(const char *s)
+{
+ u_long h = QvString::hash(s);
+ u_long i;
+ QvNameEntry *entry;
+ QvNameEntry *head;
+
+ if (nameTableSize == 0)
+ initClass();
+
+ i = h % nameTableSize;
+ entry = head = nameTable[i];
+
+ while (entry != NULL) {
+ if (entry->hashValue == h && entry->isEqual(s))
+ break;
+ entry = entry->next;
+ }
+
+ if (entry == NULL) {
+
+ int len = strlen(s) + 1;
+
+ if (len >= CHUNK_SIZE)
+ s = strdup(s);
+
+ else {
+
+ if (chunk == NULL || chunk->bytesLeft < len) {
+ struct QvNameChunk *newChunk = new QvNameChunk;
+
+ newChunk->curByte = newChunk->mem;
+ newChunk->bytesLeft = CHUNK_SIZE;
+ newChunk->next = chunk;
+
+ chunk = newChunk;
+ }
+
+ strcpy(chunk->curByte, s);
+ s = chunk->curByte;
+
+ chunk->curByte += len;
+ chunk->bytesLeft -= len;
+ }
+
+ entry = new QvNameEntry(s, h, head);
+ nameTable[i] = entry;
+ }
+
+ return entry;
+}
+
+QvName::QvName()
+{
+ entry = QvNameEntry::insert("");
+}
+
+QvBool
+QvName::isIdentStartChar(char c)
+{
+ if (isdigit(c)) return FALSE;
+
+ return isIdentChar(c);
+}
+
+QvBool
+QvName::isIdentChar(char c)
+{
+ if (isalnum(c) || c == '_') return TRUE;
+
+ return FALSE;
+}
+
+QvBool
+QvName::isNodeNameStartChar(char c)
+{
+ if (isdigit(c)) return FALSE;
+
+ return isIdentChar(c);
+}
+
+static const char
+badCharacters[] = "+\'\"\\{}";
+
+QvBool
+QvName::isNodeNameChar(char c)
+{
+ if (isalnum(c)) return TRUE;
+
+ if ((strchr(badCharacters, c) != NULL) ||
+ isspace(c) || iscntrl(c)) return FALSE;
+
+ return TRUE;
+}
diff --git a/tool_src/QvLib/QvNode.cpp b/tool_src/QvLib/QvNode.cpp
new file mode 100644
index 0000000..40fad6b
--- /dev/null
+++ b/tool_src/QvLib/QvNode.cpp
@@ -0,0 +1,381 @@
+#include <ctype.h>
+#include <QvDB.h>
+#include <QvInput.h>
+#include <QvDebugError.h>
+#include <QvReadError.h>
+#include <QvField.h>
+#include <QvFieldData.h>
+#include <QvNodes.h>
+#include <QvUnknownNode.h>
+
+// The global name dictionary
+QvDict *QvNode::nameDict = NULL;
+
+// Syntax for writing instances to files
+#define OPEN_BRACE '{'
+#define CLOSE_BRACE '}'
+#define DEFINITION_KEYWORD "DEF"
+#define REFERENCE_KEYWORD "USE"
+#define NULL_KEYWORD "NULL"
+
+void
+QvNode::init()
+{
+ if (nameDict == NULL)
+ nameDict = new QvDict;
+}
+
+QvNode::QvNode()
+{
+ objName = new QvName("");
+}
+
+QvNode::~QvNode()
+{
+ if (! !(*objName))
+ removeName(this, objName->getString());
+ delete objName;
+}
+
+const QvName &
+QvNode::getName() const
+{
+ return *objName;
+}
+
+void
+QvNode::setName(const QvName &newName)
+{
+ if (! !(*objName)) {
+ removeName(this, objName->getString());
+ }
+ delete objName;
+
+ const char *str = newName.getString();
+ QvBool isBad = 0;
+
+ if (newName.getLength() > 0 &&
+ !QvName::isNodeNameStartChar(str[0])) isBad = TRUE;
+
+ int i;
+ for (i = 1; i < newName.getLength() && !isBad; i++) {
+ isBad = !QvName::isNodeNameChar(str[i]);
+ }
+
+ if (isBad) {
+ QvString goodString;
+
+ if (!QvName::isNodeNameStartChar(str[0])) {
+ goodString += "_";
+ }
+ for (i = 0; i < newName.getLength(); i++) {
+ char temp[2];
+ temp[0] = str[i]; temp[1] = '\0';
+ if (!QvName::isNodeNameChar(str[i]))
+ goodString += "_";
+ else
+ goodString += temp;
+ }
+#ifdef DEBUG
+ QvDebugError::post("QvNode::setName", "Bad characters in"
+ " name '%s'. Replacing with name '%s'",
+ str, goodString.getString());
+#endif
+ objName = new QvName(goodString);
+ }
+ else {
+ objName = new QvName(newName);
+ }
+ if (! !(*objName)) {
+ addName(this, objName->getString());
+ }
+}
+
+void
+QvNode::addName(QvNode *b, const char *name)
+{
+ QvPList *list;
+ void *t;
+ if (!nameDict->find((u_long)name, t)) {
+ list = new QvPList;
+ nameDict->enter((u_long)name, list);
+ }
+ else {
+ list = (QvPList *)t;
+ }
+
+ list->append(b);
+}
+
+void
+QvNode::removeName(QvNode *b, const char *name)
+{
+ QvPList *list;
+ QvBool found;
+ void *t;
+ int i;
+
+ found = nameDict->find((u_long) name, t);
+
+ if (found) {
+ list = (QvPList *) t;
+ i = list->find(b);
+
+ if (i < 0)
+ found = FALSE;
+
+ else
+ list->remove(i);
+ }
+
+ if (! found)
+ QvDebugError::post("QvNode::removeName",
+ "Name \"%s\" (node %x) is not in dictionary",
+ name, b);
+}
+
+QvBool
+QvNode::read(QvInput *in, QvNode *&node)
+{
+ QvBool ret;
+ QvName name;
+
+ if (! in->read(name, TRUE)) {
+ node = NULL;
+ ret = in->headerOk;
+ }
+
+ else if (! name || name == NULL_KEYWORD) {
+ node = NULL;
+ ret = TRUE;
+ }
+
+ else if (name == REFERENCE_KEYWORD) {
+ node = readReference(in);
+ ret = (node != NULL);
+ }
+
+ else
+ ret = readNode(in, name, node);
+
+ return ret;
+}
+
+QvBool
+QvNode::readInstance(QvInput *in)
+{
+ QvName typeString;
+ QvFieldData *fieldData = getFieldData();
+
+ if (in->read(typeString, TRUE)) {
+ if (typeString == "fields") {
+ if (! fieldData->readFieldTypes(in, this)) {
+ QvReadError::post(in, "Bad field specifications for node");
+ return FALSE;
+ }
+ }
+ else
+ in->putBack(typeString.getString());
+ }
+
+ if (! fieldData->read(in, this))
+ return FALSE;
+
+ return TRUE;
+}
+
+QvNode *
+QvNode::readReference(QvInput *in)
+{
+ QvName refName;
+ QvNode *node;
+
+ if (! in->read(refName, FALSE)) {
+ QvReadError::post(in, "Premature end of file after "
+ REFERENCE_KEYWORD);
+ node = NULL;
+ }
+
+ else if ((node = in->findReference(refName)) == NULL)
+ QvReadError::post(in, "Unknown reference \"%s\"",
+ refName.getString());
+
+ return node;
+}
+
+QvBool
+QvNode::readNode(QvInput *in, QvName &className, QvNode *&node)
+{
+ QvBool gotChar;
+ QvName refName;
+ char c;
+ QvBool ret = TRUE, flush = FALSE;
+
+ node = NULL;
+
+ if (className == DEFINITION_KEYWORD) {
+ if (! in->read(refName, FALSE) || ! in->read(className, TRUE)) {
+ QvReadError::post(in, "Premature end of file after "
+ DEFINITION_KEYWORD);
+ ret = FALSE;
+ }
+
+ if (! refName) {
+ QvReadError::post(in, "No name given after ", DEFINITION_KEYWORD);
+ ret = FALSE;
+ }
+
+ if (! className) {
+ QvReadError::post(in, "Invalid definition of %s",
+ refName.getString());
+ ret = FALSE;
+ }
+ }
+
+ if (ret) {
+
+ if (! (gotChar = in->read(c)) || c != OPEN_BRACE) {
+ if (gotChar)
+ QvReadError::post(in, "Expected '%c'; got '%c'",
+ OPEN_BRACE, c);
+ else
+ QvReadError::post(in, "Expected '%c'; got EOF", OPEN_BRACE);
+ ret = FALSE;
+ }
+
+ else {
+ ret = readNodeInstance(in, className, refName, node);
+
+ if (! ret)
+ flush = TRUE;
+
+ else if (! (gotChar = in->read(c)) || c != CLOSE_BRACE) {
+ if (gotChar)
+ QvReadError::post(in, "Expected '%c'; got '%c'",
+ CLOSE_BRACE, c);
+ else
+ QvReadError::post(in, "Expected '%c'; got EOF",
+ CLOSE_BRACE);
+ ret = FALSE;
+ }
+ }
+ }
+
+ if (! ret && flush)
+ flushInput(in);
+
+ return ret;
+}
+
+QvBool
+QvNode::readNodeInstance(QvInput *in, const QvName &className,
+ const QvName &refName, QvNode *&node)
+{
+ node = createInstance(in, className);
+ if (node == NULL)
+ return FALSE;
+
+ if (! (! refName))
+ in->addReference(refName, node);
+
+ return node->readInstance(in);
+}
+
+QvNode *
+QvNode::createInstance(QvInput *in, const QvName &className)
+{
+ QvNode *instance;
+ QvString unknownString;
+
+ instance = createInstanceFromName(className);
+
+ if (instance == NULL) {
+
+ if (! in->read(unknownString) || unknownString != "fields") {
+ QvReadError::post(in, "Unknown class \"%s\"",
+ className.getString());
+ return NULL;
+ }
+
+ else if (unknownString == "fields") {
+ QvUnknownNode *tmpNode = new QvUnknownNode;
+ tmpNode->setClassName(className.getString());
+ instance = tmpNode;
+ in->putBack(unknownString.getString());
+ }
+ }
+
+ return instance;
+}
+
+QvNode *
+QvNode::createInstanceFromName(const QvName &className)
+{
+#define TRY_CLASS(name, class) \
+ else if (className == name) \
+ inst = new class
+
+ QvNode *inst = NULL;
+
+ if (0) ; // So "else" works in first TRY_CLASS
+ TRY_CLASS("Cone", QvCone);
+ TRY_CLASS("Coordinate3", QvCoordinate3);
+ TRY_CLASS("Cube", QvCube);
+ TRY_CLASS("Cylinder", QvCylinder);
+ TRY_CLASS("DirectionalLight", QvDirectionalLight);
+ TRY_CLASS("Group", QvGroup);
+ TRY_CLASS("IndexedFaceSet", QvIndexedFaceSet);
+ TRY_CLASS("IndexedLineSet", QvIndexedLineSet);
+ TRY_CLASS("Info", QvInfo);
+ TRY_CLASS("LevelOfDetail", QvLevelOfDetail);
+ TRY_CLASS("Material", QvMaterial);
+ TRY_CLASS("MaterialBinding", QvMaterialBinding);
+ TRY_CLASS("MatrixTransform", QvMatrixTransform);
+ TRY_CLASS("Normal", QvNormal);
+ TRY_CLASS("NormalBinding", QvNormalBinding);
+ TRY_CLASS("OrthographicCamera", QvOrthographicCamera);
+ TRY_CLASS("PerspectiveCamera", QvPerspectiveCamera);
+ TRY_CLASS("PointLight", QvPointLight);
+ TRY_CLASS("PointSet", QvPointSet);
+ TRY_CLASS("Rotation", QvRotation);
+ TRY_CLASS("Scale", QvScale);
+ TRY_CLASS("Separator", QvSeparator);
+ TRY_CLASS("ShapeHints", QvShapeHints);
+ TRY_CLASS("Sphere", QvSphere);
+ TRY_CLASS("SpotLight", QvSpotLight);
+ TRY_CLASS("Switch", QvSwitch);
+ TRY_CLASS("Texture2", QvTexture2);
+ TRY_CLASS("Texture2Transform", QvTexture2Transform);
+ TRY_CLASS("TextureCoordinate2", QvTextureCoordinate2);
+ TRY_CLASS("Transform", QvTransform);
+ TRY_CLASS("TransformSeparator", QvTransformSeparator);
+ TRY_CLASS("Translation", QvTranslation);
+ TRY_CLASS("WWWAnchor", QvWWWAnchor);
+ TRY_CLASS("WWWInline", QvWWWInline);
+
+ return inst;
+
+#undef TRY_CLASS
+}
+
+void
+QvNode::flushInput(QvInput *in)
+{
+ int nestLevel = 1;
+ char c;
+
+ while (nestLevel > 0 && in->get(c)) {
+
+ if (c == CLOSE_BRACE)
+ nestLevel--;
+
+ else if (c == OPEN_BRACE)
+ nestLevel++;
+ }
+}
+
+#undef OPEN_BRACE
+#undef CLOSE_BRACE
+#undef DEFINITION_KEYWORD
+#undef REFERENCE_KEYWORD
+#undef NULL_KEYWORD
diff --git a/tool_src/QvLib/QvNode.h b/tool_src/QvLib/QvNode.h
new file mode 100644
index 0000000..a24d6ea
--- /dev/null
+++ b/tool_src/QvLib/QvNode.h
@@ -0,0 +1,57 @@
+#ifndef _QV_NODE_
+#define _QV_NODE_
+
+#include <QvString.h>
+
+class QvChildList;
+class QvDict;
+class QvFieldData;
+class QvInput;
+class QvNodeList;
+class QvState;
+
+class QvNode {
+
+ public:
+ enum Stage {
+ FIRST_INSTANCE, // First real instance being constructed
+ PROTO_INSTANCE, // Prototype instance being constructed
+ OTHER_INSTANCE, // Subsequent instance being constructed
+ };
+
+ QvFieldData *fieldData;
+ QvChildList *children;
+ QvBool isBuiltIn;
+
+ QvName *objName;
+ QvNode();
+ virtual ~QvNode();
+
+ const QvName & getName() const;
+ void setName(const QvName &name);
+
+ static void init();
+ static QvBool read(QvInput *in, QvNode *&node);
+
+ virtual QvFieldData *getFieldData() = 0;
+
+ virtual void traverse(QvState *state) = 0;
+
+ protected:
+ virtual QvBool readInstance(QvInput *in);
+
+ private:
+ static QvDict *nameDict;
+
+ static void addName(QvNode *, const char *);
+ static void removeName(QvNode *, const char *);
+ static QvNode * readReference(QvInput *in);
+ static QvBool readNode(QvInput *in, QvName &className,QvNode *&node);
+ static QvBool readNodeInstance(QvInput *in, const QvName &className,
+ const QvName &refName, QvNode *&node);
+ static QvNode * createInstance(QvInput *in, const QvName &className);
+ static QvNode * createInstanceFromName(const QvName &className);
+ static void flushInput(QvInput *in);
+};
+
+#endif /* _QV_NODE_ */
diff --git a/tool_src/QvLib/QvNodes.h b/tool_src/QvLib/QvNodes.h
new file mode 100644
index 0000000..75d85d2
--- /dev/null
+++ b/tool_src/QvLib/QvNodes.h
@@ -0,0 +1,39 @@
+#ifndef _QV_NODES_
+#define _QV_NODES_
+
+#include <QvCone.h>
+#include <QvCoordinate3.h>
+#include <QvCube.h>
+#include <QvCylinder.h>
+#include <QvDirectionalLight.h>
+#include <QvGroup.h>
+#include <QvIndexedFaceSet.h>
+#include <QvIndexedLineSet.h>
+#include <QvInfo.h>
+#include <QvLevelOfDetail.h>
+#include <QvMaterial.h>
+#include <QvMaterialBinding.h>
+#include <QvMatrixTransform.h>
+#include <QvNormal.h>
+#include <QvNormalBinding.h>
+#include <QvOrthographicCamera.h>
+#include <QvPerspectiveCamera.h>
+#include <QvPointLight.h>
+#include <QvPointSet.h>
+#include <QvRotation.h>
+#include <QvScale.h>
+#include <QvSeparator.h>
+#include <QvShapeHints.h>
+#include <QvSphere.h>
+#include <QvSpotLight.h>
+#include <QvSwitch.h>
+#include <QvTexture2.h>
+#include <QvTexture2Transform.h>
+#include <QvTextureCoordinate2.h>
+#include <QvTransform.h>
+#include <QvTransformSeparator.h>
+#include <QvTranslation.h>
+#include <QvWWWAnchor.h>
+#include <QvWWWInline.h>
+
+#endif /* _QV_NODES_ */
diff --git a/tool_src/QvLib/QvNormal.cpp b/tool_src/QvLib/QvNormal.cpp
new file mode 100644
index 0000000..2d91800
--- /dev/null
+++ b/tool_src/QvLib/QvNormal.cpp
@@ -0,0 +1,19 @@
+#include <QvNormal.h>
+
+QV_NODE_SOURCE(QvNormal);
+
+QvNormal::QvNormal()
+{
+ QV_NODE_CONSTRUCTOR(QvNormal);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(vector);
+
+ vector.values[0] = 0.0;
+ vector.values[1] = 0.0;
+ vector.values[2] = 1.0;
+}
+
+QvNormal::~QvNormal()
+{
+}
diff --git a/tool_src/QvLib/QvNormal.h b/tool_src/QvLib/QvNormal.h
new file mode 100644
index 0000000..75a1020
--- /dev/null
+++ b/tool_src/QvLib/QvNormal.h
@@ -0,0 +1,16 @@
+#ifndef _QV_NORMAL_
+#define _QV_NORMAL_
+
+#include <QvMFVec3f.h>
+#include <QvSubNode.h>
+
+class QvNormal : public QvNode {
+
+ QV_NODE_HEADER(QvNormal);
+
+ public:
+ // Fields
+ QvMFVec3f vector; // Normal vector(s)
+};
+
+#endif /* _QV_NORMAL_ */
diff --git a/tool_src/QvLib/QvNormalBinding.cpp b/tool_src/QvLib/QvNormalBinding.cpp
new file mode 100644
index 0000000..db53681
--- /dev/null
+++ b/tool_src/QvLib/QvNormalBinding.cpp
@@ -0,0 +1,29 @@
+#include <QvNormalBinding.h>
+
+QV_NODE_SOURCE(QvNormalBinding);
+
+QvNormalBinding::QvNormalBinding()
+{
+ QV_NODE_CONSTRUCTOR(QvNormalBinding);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(value);
+
+ value.value = DEFAULT;
+
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, DEFAULT);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, NONE);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, OVERALL);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, PER_PART);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, PER_PART_INDEXED);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, PER_FACE);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, PER_FACE_INDEXED);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, PER_VERTEX);
+ QV_NODE_DEFINE_ENUM_VALUE(Binding, PER_VERTEX_INDEXED);
+
+ QV_NODE_SET_SF_ENUM_TYPE(value, Binding);
+}
+
+QvNormalBinding::~QvNormalBinding()
+{
+}
diff --git a/tool_src/QvLib/QvNormalBinding.h b/tool_src/QvLib/QvNormalBinding.h
new file mode 100644
index 0000000..e690fdd
--- /dev/null
+++ b/tool_src/QvLib/QvNormalBinding.h
@@ -0,0 +1,28 @@
+#ifndef _QV_NORMAL_BINDING_
+#define _QV_NORMAL_BINDING_
+
+#include <QvSFEnum.h>
+#include <QvSubNode.h>
+
+class QvNormalBinding : public QvNode {
+
+ QV_NODE_HEADER(QvNormalBinding);
+
+ public:
+ enum Binding {
+ DEFAULT,
+ NONE,
+ OVERALL,
+ PER_PART,
+ PER_PART_INDEXED,
+ PER_FACE,
+ PER_FACE_INDEXED,
+ PER_VERTEX,
+ PER_VERTEX_INDEXED,
+ };
+
+ // Fields
+ QvSFEnum value; // Normal binding value
+};
+
+#endif /* _QV_NORMAL_BINDING_ */
diff --git a/tool_src/QvLib/QvOrthographicCamera.cpp b/tool_src/QvLib/QvOrthographicCamera.cpp
new file mode 100644
index 0000000..3a04d1c
--- /dev/null
+++ b/tool_src/QvLib/QvOrthographicCamera.cpp
@@ -0,0 +1,28 @@
+#include <QvOrthographicCamera.h>
+
+QV_NODE_SOURCE(QvOrthographicCamera);
+
+QvOrthographicCamera::QvOrthographicCamera()
+{
+ QV_NODE_CONSTRUCTOR(QvOrthographicCamera);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(position);
+ QV_NODE_ADD_FIELD(orientation);
+ QV_NODE_ADD_FIELD(focalDistance);
+ QV_NODE_ADD_FIELD(height);
+
+ position.value[0] = 0.0;
+ position.value[1] = 0.0;
+ position.value[2] = 1.0;
+ orientation.axis[0] = 0.0;
+ orientation.axis[1] = 0.0;
+ orientation.axis[2] = 1.0;
+ orientation.angle = 0.0;
+ focalDistance.value = 5.0;
+ height.value = 2.0;
+}
+
+QvOrthographicCamera::~QvOrthographicCamera()
+{
+}
diff --git a/tool_src/QvLib/QvOrthographicCamera.h b/tool_src/QvLib/QvOrthographicCamera.h
new file mode 100644
index 0000000..1d44fda
--- /dev/null
+++ b/tool_src/QvLib/QvOrthographicCamera.h
@@ -0,0 +1,22 @@
+#ifndef _QV_ORTHOGRAPHIC_CAMERA_
+#define _QV_ORTHOGRAPHIC_CAMERA_
+
+#include <QvSFFloat.h>
+#include <QvSFRotation.h>
+#include <QvSFVec3f.h>
+#include <QvSubNode.h>
+
+class QvOrthographicCamera : public QvNode {
+
+ QV_NODE_HEADER(QvOrthographicCamera);
+
+ public:
+ QvSFVec3f position; // Location of viewpoint
+ QvSFRotation orientation; // Orientation (rotation with
+ // respect to (0,0,-1) vector)
+ QvSFFloat focalDistance; // Distance from viewpoint to
+ // point of focus.
+ QvSFFloat height; // Height of view volume
+};
+
+#endif /* _QV_ORTHOGRAPHIC_CAMERA_ */
diff --git a/tool_src/QvLib/QvPList.cpp b/tool_src/QvLib/QvPList.cpp
new file mode 100644
index 0000000..6872428
--- /dev/null
+++ b/tool_src/QvLib/QvPList.cpp
@@ -0,0 +1,64 @@
+#include <QvPList.h>
+
+#define DEFAULT_INITIAL_SIZE 4
+
+QvPList::QvPList()
+{
+ ptrs = NULL;
+ nPtrs = ptrsSize = 0;
+
+ setSize(0);
+}
+
+QvPList::~QvPList()
+{
+ if (ptrs != NULL)
+ delete [] ptrs;
+}
+
+int
+QvPList::find(const void *ptr) const
+{
+ int i;
+
+ for (i = 0; i < nPtrs; i++)
+ if (ptrs[i] == ptr)
+ return(i);
+
+ return -1;
+}
+
+void
+QvPList::remove(int which)
+{
+ int i;
+
+ for (i = which; i < nPtrs - 1; i++)
+ ptrs[i] = ptrs[i + 1];
+
+ setSize(nPtrs - 1);
+}
+
+void
+QvPList::expand(int size)
+{
+ void **newPtrs;
+ int i;
+
+ if (ptrsSize == 0)
+ ptrsSize = DEFAULT_INITIAL_SIZE;
+
+ while (size > ptrsSize) {
+ ptrsSize *= 2;
+ }
+
+ newPtrs = (void **) new uintptr_t[ptrsSize];
+
+ if (ptrs != NULL) {
+ for (i = 0; i < nPtrs; i++)
+ newPtrs[i] = ptrs[i];
+ delete [] ptrs;
+ }
+
+ ptrs = newPtrs;
+}
diff --git a/tool_src/QvLib/QvPList.h b/tool_src/QvLib/QvPList.h
new file mode 100644
index 0000000..50f3eff
--- /dev/null
+++ b/tool_src/QvLib/QvPList.h
@@ -0,0 +1,29 @@
+#ifndef _QV_PLIST_
+#define _QV_PLIST_
+
+#include <QvBasic.h>
+
+class QvPList {
+ public:
+ QvPList();
+ ~QvPList();
+ void append(void * ptr)
+ { if (nPtrs + 1 > ptrsSize) expand(nPtrs + 1);
+ ptrs[nPtrs++] = ptr; }
+ int find(const void *ptr) const;
+ void remove(int which);
+ int getLength() const { return (int) nPtrs; }
+ void truncate(int start)
+ { nPtrs = start; }
+ void *& operator [](int i) const { return ptrs[i]; }
+
+ private:
+ void ** ptrs;
+ int nPtrs;
+ int ptrsSize;
+ void setSize(int size)
+ { if (size > ptrsSize) expand(size); nPtrs = size; }
+ void expand(int size);
+};
+
+#endif /* _QV_PLIST_ */
diff --git a/tool_src/QvLib/QvPerspectiveCamera.cpp b/tool_src/QvLib/QvPerspectiveCamera.cpp
new file mode 100644
index 0000000..5083108
--- /dev/null
+++ b/tool_src/QvLib/QvPerspectiveCamera.cpp
@@ -0,0 +1,30 @@
+#include "math.h"
+
+#include <QvPerspectiveCamera.h>
+
+QV_NODE_SOURCE(QvPerspectiveCamera);
+
+QvPerspectiveCamera::QvPerspectiveCamera()
+{
+ QV_NODE_CONSTRUCTOR(QvPerspectiveCamera);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(position);
+ QV_NODE_ADD_FIELD(orientation);
+ QV_NODE_ADD_FIELD(focalDistance);
+ QV_NODE_ADD_FIELD(heightAngle);
+
+ position.value[0] = 0.0;
+ position.value[1] = 0.0;
+ position.value[2] = 1.0;
+ orientation.axis[0] = 0.0;
+ orientation.axis[1] = 0.0;
+ orientation.axis[2] = 1.0;
+ orientation.angle = 0.0;
+ focalDistance.value = 5.0;
+ heightAngle.value = M_PI_4; // 45 degrees
+}
+
+QvPerspectiveCamera::~QvPerspectiveCamera()
+{
+}
diff --git a/tool_src/QvLib/QvPerspectiveCamera.h b/tool_src/QvLib/QvPerspectiveCamera.h
new file mode 100644
index 0000000..9ac8543
--- /dev/null
+++ b/tool_src/QvLib/QvPerspectiveCamera.h
@@ -0,0 +1,23 @@
+#ifndef _QV_PERSPECTIVE_CAMERA_
+#define _QV_PERSPECTIVE_CAMERA_
+
+#include <QvSFFloat.h>
+#include <QvSFRotation.h>
+#include <QvSFVec3f.h>
+#include <QvSubNode.h>
+
+class QvPerspectiveCamera : public QvNode {
+
+ QV_NODE_HEADER(QvPerspectiveCamera);
+
+ public:
+ QvSFVec3f position; // Location of viewpoint
+ QvSFRotation orientation; // Orientation (rotation with
+ // respect to (0,0,-1) vector)
+ QvSFFloat focalDistance; // Distance from viewpoint to
+ // point of focus.
+ QvSFFloat heightAngle; // Angle (in radians) of field
+ // of view, in height direction
+};
+
+#endif /* _QV_PERSPECTIVE_CAMERA_ */
diff --git a/tool_src/QvLib/QvPointLight.cpp b/tool_src/QvLib/QvPointLight.cpp
new file mode 100644
index 0000000..18652e1
--- /dev/null
+++ b/tool_src/QvLib/QvPointLight.cpp
@@ -0,0 +1,25 @@
+#include <QvPointLight.h>
+
+QV_NODE_SOURCE(QvPointLight);
+
+QvPointLight::QvPointLight()
+{
+ QV_NODE_CONSTRUCTOR(QvPointLight);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(on);
+ QV_NODE_ADD_FIELD(intensity);
+ QV_NODE_ADD_FIELD(color);
+ QV_NODE_ADD_FIELD(location);
+
+ on.value = TRUE;
+ intensity.value = 1.0;
+ color.value[0] = color.value[1] = color.value[2] = 1.0;
+ location.value[0] = 0.0;
+ location.value[1] = 0.0;
+ location.value[2] = 1.0;
+}
+
+QvPointLight::~QvPointLight()
+{
+}
diff --git a/tool_src/QvLib/QvPointLight.h b/tool_src/QvLib/QvPointLight.h
new file mode 100644
index 0000000..09008bf
--- /dev/null
+++ b/tool_src/QvLib/QvPointLight.h
@@ -0,0 +1,22 @@
+#ifndef _QV_POINT_LIGHT_
+#define _QV_POINT_LIGHT_
+
+#include <QvSFBool.h>
+#include <QvSFColor.h>
+#include <QvSFFloat.h>
+#include <QvSFVec3f.h>
+#include <QvSubNode.h>
+
+class QvPointLight : public QvNode {
+
+ QV_NODE_HEADER(QvPointLight);
+
+ public:
+ // Fields
+ QvSFBool on; // Whether light is on
+ QvSFFloat intensity; // Source intensity (0 to 1)
+ QvSFColor color; // RGB source color
+ QvSFVec3f location; // Source location
+};
+
+#endif /* _QV_POINT_LIGHT_ */
diff --git a/tool_src/QvLib/QvPointSet.cpp b/tool_src/QvLib/QvPointSet.cpp
new file mode 100644
index 0000000..ed8dfdf
--- /dev/null
+++ b/tool_src/QvLib/QvPointSet.cpp
@@ -0,0 +1,19 @@
+#include <QvPointSet.h>
+
+QV_NODE_SOURCE(QvPointSet);
+
+QvPointSet::QvPointSet()
+{
+ QV_NODE_CONSTRUCTOR(QvPointSet);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(startIndex);
+ QV_NODE_ADD_FIELD(numPoints);
+
+ startIndex.value = 0;
+ numPoints.value = QV_POINT_SET_USE_REST_OF_POINTS;
+}
+
+QvPointSet::~QvPointSet()
+{
+}
diff --git a/tool_src/QvLib/QvPointSet.h b/tool_src/QvLib/QvPointSet.h
new file mode 100644
index 0000000..aebc871
--- /dev/null
+++ b/tool_src/QvLib/QvPointSet.h
@@ -0,0 +1,19 @@
+#ifndef _QV_POINT_SET_
+#define _QV_POINT_SET_
+
+#include <QvSFLong.h>
+#include <QvSubNode.h>
+
+#define QV_POINT_SET_USE_REST_OF_POINTS (-1)
+
+class QvPointSet : public QvNode {
+
+ QV_NODE_HEADER(QvPointSet);
+
+ public:
+ // Fields
+ QvSFLong startIndex; // Index of 1st coordinate of shape
+ QvSFLong numPoints; // Number of points to draw
+};
+
+#endif /* _QV_POINT_SET_ */
diff --git a/tool_src/QvLib/QvReadError.cpp b/tool_src/QvLib/QvReadError.cpp
new file mode 100644
index 0000000..313525f
--- /dev/null
+++ b/tool_src/QvLib/QvReadError.cpp
@@ -0,0 +1,19 @@
+#include <stdarg.h>
+#include <QvString.h>
+#include <QvInput.h>
+#include <QvReadError.h>
+
+void
+QvReadError::post(const QvInput *in, const char *formatString ...)
+{
+ char buf[10000];
+ va_list ap;
+
+ va_start(ap, formatString);
+ vsprintf(buf, formatString, ap);
+ va_end(ap);
+
+ QvString locstr;
+ in->getLocationString(locstr);
+ fprintf(stderr, "VRML read error: %s\n%s\n", buf, locstr.getString());
+}
diff --git a/tool_src/QvLib/QvReadError.h b/tool_src/QvLib/QvReadError.h
new file mode 100644
index 0000000..61c4468
--- /dev/null
+++ b/tool_src/QvLib/QvReadError.h
@@ -0,0 +1,11 @@
+#ifndef _QV_READ_ERROR
+#define _QV_READ_ERROR
+
+class QvInput;
+
+class QvReadError {
+ public:
+ static void post(const QvInput *in, const char *formatString ...);
+};
+
+#endif /* _QV_READ_ERROR */
diff --git a/tool_src/QvLib/QvRotation.cpp b/tool_src/QvLib/QvRotation.cpp
new file mode 100644
index 0000000..345ee19
--- /dev/null
+++ b/tool_src/QvLib/QvRotation.cpp
@@ -0,0 +1,20 @@
+#include <QvRotation.h>
+
+QV_NODE_SOURCE(QvRotation);
+
+QvRotation::QvRotation()
+{
+ QV_NODE_CONSTRUCTOR(QvRotation);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(rotation);
+
+ rotation.axis[0] = 0.0;
+ rotation.axis[1] = 0.0;
+ rotation.axis[2] = 1.0;
+ rotation.angle = 0.0;
+}
+
+QvRotation::~QvRotation()
+{
+}
diff --git a/tool_src/QvLib/QvRotation.h b/tool_src/QvLib/QvRotation.h
new file mode 100644
index 0000000..9029420
--- /dev/null
+++ b/tool_src/QvLib/QvRotation.h
@@ -0,0 +1,16 @@
+#ifndef _QV_ROTATION_
+#define _QV_ROTATION_
+
+#include <QvSFRotation.h>
+#include <QvSubNode.h>
+
+class QvRotation : public QvNode {
+
+ QV_NODE_HEADER(QvRotation);
+
+ public:
+ // Fields
+ QvSFRotation rotation; // Rotation
+};
+
+#endif /* _QV_ROTATION_ */
diff --git a/tool_src/QvLib/QvSFBitMask.cpp b/tool_src/QvLib/QvSFBitMask.cpp
new file mode 100644
index 0000000..d4c89df
--- /dev/null
+++ b/tool_src/QvLib/QvSFBitMask.cpp
@@ -0,0 +1,84 @@
+#include <QvDebugError.h>
+#include <QvReadError.h>
+#include <QvSFBitMask.h>
+
+// Special characters when reading or writing value in ASCII
+#define OPEN_PAREN '('
+#define CLOSE_PAREN ')'
+#define BITWISE_OR '|'
+
+QV_SFIELD_SOURCE(QvSFBitMask);
+
+QvBool
+QvSFBitMask::readValue(QvInput *in)
+{
+ char c;
+ QvName n;
+ int v;
+
+#ifdef DEBUG
+ if (enumValues == NULL) {
+ QvDebugError::post("QvSFBitMask::readValue",
+ "Enum values were never initialized");
+ QvReadError::post(in, "Couldn't read QvSFBitMask values");
+ return FALSE;
+ }
+#endif /* DEBUG */
+
+ value = 0;
+
+ // Read first character
+ if (! in->read(c))
+ return FALSE;
+
+ // Check for parenthesized list of bitwise-or'ed flags
+ if (c == OPEN_PAREN) {
+
+ // Read names separated by BITWISE_OR
+ while (TRUE) {
+ if (in->read(n, TRUE) && ! (! n) ) {
+
+ if (findEnumValue(n, v))
+ value |= v;
+
+ else {
+ QvReadError::post(in, "Unknown QvSFBitMask bit "
+ "mask value \"%s\"", n.getString());
+ return FALSE;
+ }
+ }
+
+ if (! in->read(c)) {
+ QvReadError::post(in, "EOF reached before '%c' "
+ "in QvSFBitMask value", CLOSE_PAREN);
+ return FALSE;
+ }
+
+ if (c == CLOSE_PAREN)
+ break;
+
+ else if (c != BITWISE_OR) {
+ QvReadError::post(in, "Expected '%c' or '%c', got '%c' ",
+ "in QvSFBitMask value",
+ BITWISE_OR, CLOSE_PAREN, c);
+ return FALSE;
+ }
+ }
+ }
+
+ else {
+ in->putBack(c);
+
+ // Read mnemonic value as a character string identifier
+ if (! in->read(n, TRUE))
+ return FALSE;
+
+ if (! findEnumValue(n, value)) {
+ QvReadError::post(in, "Unknown QvSFBitMask bit "
+ "mask value \"%s\"", n.getString());
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
diff --git a/tool_src/QvLib/QvSFBitMask.h b/tool_src/QvLib/QvSFBitMask.h
new file mode 100644
index 0000000..274b8d0
--- /dev/null
+++ b/tool_src/QvLib/QvSFBitMask.h
@@ -0,0 +1,12 @@
+#ifndef _QV_SF_BIT_MASK_
+#define _QV_SF_BIT_MASK_
+
+#include <QvSFEnum.h>
+
+class QvSFBitMask : public QvSFEnum {
+ public:
+ // Inherits value
+ QV_SFIELD_HEADER(QvSFBitMask);
+};
+
+#endif /* _QV_SF_BIT_MASK_ */
diff --git a/tool_src/QvLib/QvSFBool.cpp b/tool_src/QvLib/QvSFBool.cpp
new file mode 100644
index 0000000..a1ecd9c
--- /dev/null
+++ b/tool_src/QvLib/QvSFBool.cpp
@@ -0,0 +1,37 @@
+#include <QvReadError.h>
+#include <QvSFBool.h>
+
+QV_SFIELD_SOURCE(QvSFBool);
+
+QvBool
+QvSFBool::readValue(QvInput *in)
+{
+ // accept 0 or 1
+ if (in->read(value)) {
+ if (value != 0 && value != 1) {
+ QvReadError::post(in, "Illegal value for QvSFBool: %d "
+ "(must be 0 or 1)", value);
+ return FALSE;
+ }
+ return TRUE;
+ }
+
+ // read TRUE/FALSE keyword
+ QvName n;
+ if (! in->read(n, TRUE))
+ return FALSE;
+
+ if (n == "TRUE") {
+ value = TRUE;
+ return TRUE;
+ }
+
+ if (n == "FALSE") {
+ value = FALSE;
+ return TRUE;
+ }
+
+ QvReadError::post(in, "Unknown value (\"%s\") for QvSFBool ",
+ "(must be TRUE or FALSE)", n.getString());
+ return FALSE;
+}
diff --git a/tool_src/QvLib/QvSFBool.h b/tool_src/QvLib/QvSFBool.h
new file mode 100644
index 0000000..929618e
--- /dev/null
+++ b/tool_src/QvLib/QvSFBool.h
@@ -0,0 +1,12 @@
+#ifndef _QV_SF_BOOL_
+#define _QV_SF_BOOL_
+
+#include <QvSubField.h>
+
+class QvSFBool : public QvSField {
+ public:
+ QvBool value;
+ QV_SFIELD_HEADER(QvSFBool);
+};
+
+#endif /* _QV_SF_BOOL_ */
diff --git a/tool_src/QvLib/QvSFColor.cpp b/tool_src/QvLib/QvSFColor.cpp
new file mode 100644
index 0000000..add6f6e
--- /dev/null
+++ b/tool_src/QvLib/QvSFColor.cpp
@@ -0,0 +1,11 @@
+#include <QvSFColor.h>
+
+QV_SFIELD_SOURCE(QvSFColor);
+
+QvBool
+QvSFColor::readValue(QvInput *in)
+{
+ return (in->read(value[0]) &&
+ in->read(value[1]) &&
+ in->read(value[2]));
+}
diff --git a/tool_src/QvLib/QvSFColor.h b/tool_src/QvLib/QvSFColor.h
new file mode 100644
index 0000000..d724b36
--- /dev/null
+++ b/tool_src/QvLib/QvSFColor.h
@@ -0,0 +1,12 @@
+#ifndef _QV_SF_COLOR_
+#define _QV_SF_COLOR_
+
+#include <QvSubField.h>
+
+class QvSFColor : public QvSField {
+ public:
+ float value[3];
+ QV_SFIELD_HEADER(QvSFColor);
+};
+
+#endif /* _QV_SF_COLOR_ */
diff --git a/tool_src/QvLib/QvSFEnum.cpp b/tool_src/QvLib/QvSFEnum.cpp
new file mode 100644
index 0000000..2c41da9
--- /dev/null
+++ b/tool_src/QvLib/QvSFEnum.cpp
@@ -0,0 +1,58 @@
+#include <QvDebugError.h>
+#include <QvReadError.h>
+#include <QvSFEnum.h>
+
+// Can't use macro, since we define a constructor.
+
+QvSFEnum::QvSFEnum()
+{
+ enumValues = NULL;
+ enumNames = NULL;
+}
+
+QvSFEnum::~QvSFEnum()
+{
+}
+
+QvBool
+QvSFEnum::findEnumValue(const QvName &name, int &val) const
+{
+ int i;
+
+ // Look through names table for one that matches
+ for (i = 0; i < numEnums; i++) {
+ if (name == enumNames[i]) {
+ val = enumValues[i];
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+QvBool
+QvSFEnum::readValue(QvInput *in)
+{
+ QvName n;
+
+#ifdef DEBUG
+ if (enumValues == NULL) {
+ QvDebugError::post("QvSFEnum::readValue",
+ "Enum values were never initialized");
+ QvReadError::post(in, "Couldn't read QvSFEnum value");
+ return FALSE;
+ }
+#endif /* DEBUG */
+
+ // Read mnemonic value as a character string identifier
+ if (! in->read(n, TRUE))
+ return FALSE;
+
+ if (findEnumValue(n, value))
+ return TRUE;
+
+ // Not found? Too bad
+ QvReadError::post(in, "Unknown QvSFEnum enumeration value \"%s\"",
+ n.getString());
+ return FALSE;
+}
diff --git a/tool_src/QvLib/QvSFEnum.h b/tool_src/QvLib/QvSFEnum.h
new file mode 100644
index 0000000..14a6c4b
--- /dev/null
+++ b/tool_src/QvLib/QvSFEnum.h
@@ -0,0 +1,38 @@
+#ifndef _QV_SF_ENUM_
+#define _QV_SF_ENUM_
+
+#include <QvString.h>
+#include <QvSubField.h>
+
+class QvSFEnum : public QvSField {
+ public:
+ int value;
+ QV_SFIELD_HEADER(QvSFEnum);
+
+ // Sets up value/name correspondances
+ void setEnums(int num, const int vals[], const QvName names[])
+ { numEnums = num; enumValues = vals; enumNames = names; }
+
+ int numEnums; // Number of enumeration values
+ const int *enumValues; // Enumeration values
+ const QvName *enumNames; // Mnemonic names of values
+
+ // Looks up enum name, returns value. Returns FALSE if not found.
+ QvBool findEnumValue(const QvName &name, int &val) const;
+};
+
+#define QV_NODE_SET_SF_ENUM_TYPE(fieldName, enumType) \
+ do { \
+ int _so_sf_enum_num; \
+ const int *_so_sf_enum_vals; \
+ const QvName *_so_sf_enum_names; \
+ fieldData->getEnumData(QV__QUOTE(enumType), \
+ _so_sf_enum_num, \
+ _so_sf_enum_vals, \
+ _so_sf_enum_names); \
+ fieldName.setEnums(_so_sf_enum_num, \
+ _so_sf_enum_vals, \
+ _so_sf_enum_names); \
+ } while (0)
+
+#endif /* _QV_SF_ENUM_ */
diff --git a/tool_src/QvLib/QvSFFloat.cpp b/tool_src/QvLib/QvSFFloat.cpp
new file mode 100644
index 0000000..c3e693d
--- /dev/null
+++ b/tool_src/QvLib/QvSFFloat.cpp
@@ -0,0 +1,9 @@
+#include <QvSFFloat.h>
+
+QV_SFIELD_SOURCE(QvSFFloat);
+
+QvBool
+QvSFFloat::readValue(QvInput *in)
+{
+ return in->read(value);
+}
diff --git a/tool_src/QvLib/QvSFFloat.h b/tool_src/QvLib/QvSFFloat.h
new file mode 100644
index 0000000..f8fde12
--- /dev/null
+++ b/tool_src/QvLib/QvSFFloat.h
@@ -0,0 +1,12 @@
+#ifndef _QV_SF_FLOAT_
+#define _QV_SF_FLOAT_
+
+#include <QvSubField.h>
+
+class QvSFFloat : public QvSField {
+ public:
+ float value;
+ QV_SFIELD_HEADER(QvSFFloat);
+};
+
+#endif /* _QV_SF_FLOAT_ */
diff --git a/tool_src/QvLib/QvSFImage.cpp b/tool_src/QvLib/QvSFImage.cpp
new file mode 100644
index 0000000..d733bf2
--- /dev/null
+++ b/tool_src/QvLib/QvSFImage.cpp
@@ -0,0 +1,39 @@
+#include <QvSFImage.h>
+
+// Can't use macro, since we define a constructor.
+
+QvSFImage::QvSFImage()
+{
+ size[0] = size[1] = 0;
+ numComponents = 0;
+ bytes = NULL;
+}
+
+QvSFImage::~QvSFImage()
+{
+ if (bytes != NULL)
+ delete [] bytes;
+}
+QvBool
+QvSFImage::readValue(QvInput *in)
+{
+ if (! in->read(size[0]) ||
+ ! in->read(size[1]) ||
+ ! in->read(numComponents))
+ return FALSE;
+
+ if (bytes != NULL)
+ delete [] bytes;
+ bytes = new unsigned char[size[0] * size[1] * numComponents];
+
+ int byte = 0;
+ for (int i = 0; i < size[0] * size[1]; i++) {
+ unsigned long l;
+ if (! in->read(l))
+ return FALSE;
+ for (int j = 0; j < numComponents; j++)
+ bytes[byte++] =
+ (unsigned char) ((l >> (8*(numComponents-j-1))) & 0xFF);
+ }
+ return TRUE;
+}
diff --git a/tool_src/QvLib/QvSFImage.h b/tool_src/QvLib/QvSFImage.h
new file mode 100644
index 0000000..80a1fe1
--- /dev/null
+++ b/tool_src/QvLib/QvSFImage.h
@@ -0,0 +1,14 @@
+#ifndef _QV_SF_IMAGE_
+#define _QV_SF_IMAGE_
+
+#include <QvSubField.h>
+
+class QvSFImage : public QvSField {
+ public:
+ short size[2]; // Width and height of image
+ int numComponents; // Number of components per pixel
+ unsigned char * bytes; // Array of pixels
+ QV_SFIELD_HEADER(QvSFImage);
+};
+
+#endif /* _QV_SF_IMAGE_ */
diff --git a/tool_src/QvLib/QvSFLong.cpp b/tool_src/QvLib/QvSFLong.cpp
new file mode 100644
index 0000000..929583f
--- /dev/null
+++ b/tool_src/QvLib/QvSFLong.cpp
@@ -0,0 +1,9 @@
+#include <QvSFLong.h>
+
+QV_SFIELD_SOURCE(QvSFLong);
+
+QvBool
+QvSFLong::readValue(QvInput *in)
+{
+ return in->read(value);
+}
diff --git a/tool_src/QvLib/QvSFLong.h b/tool_src/QvLib/QvSFLong.h
new file mode 100644
index 0000000..96c7406
--- /dev/null
+++ b/tool_src/QvLib/QvSFLong.h
@@ -0,0 +1,12 @@
+#ifndef _QV_SF_LONG_
+#define _QV_SF_LONG_
+
+#include <QvSubField.h>
+
+class QvSFLong : public QvSField {
+ public:
+ long value;
+ QV_SFIELD_HEADER(QvSFLong);
+};
+
+#endif /* _QV_SF_LONG_ */
diff --git a/tool_src/QvLib/QvSFMatrix.cpp b/tool_src/QvLib/QvSFMatrix.cpp
new file mode 100644
index 0000000..b6a4f87
--- /dev/null
+++ b/tool_src/QvLib/QvSFMatrix.cpp
@@ -0,0 +1,16 @@
+#include <QvSFMatrix.h>
+
+QV_SFIELD_SOURCE(QvSFMatrix);
+
+QvBool
+QvSFMatrix::readValue(QvInput *in)
+{
+ return (in->read(value[0][0]) && in->read(value[0][1]) &&
+ in->read(value[0][2]) && in->read(value[0][3]) &&
+ in->read(value[1][0]) && in->read(value[1][1]) &&
+ in->read(value[1][2]) && in->read(value[1][3]) &&
+ in->read(value[2][0]) && in->read(value[2][1]) &&
+ in->read(value[2][2]) && in->read(value[2][3]) &&
+ in->read(value[3][0]) && in->read(value[3][1]) &&
+ in->read(value[3][2]) && in->read(value[3][3]));
+}
diff --git a/tool_src/QvLib/QvSFMatrix.h b/tool_src/QvLib/QvSFMatrix.h
new file mode 100644
index 0000000..e00b7ae
--- /dev/null
+++ b/tool_src/QvLib/QvSFMatrix.h
@@ -0,0 +1,12 @@
+#ifndef _QV_SF_MATRIX_
+#define _QV_SF_MATRIX_
+
+#include <QvSubField.h>
+
+class QvSFMatrix : public QvSField {
+ public:
+ float value[4][4];
+ QV_SFIELD_HEADER(QvSFMatrix);
+};
+
+#endif /* _QV_SF_MATRIX_ */
diff --git a/tool_src/QvLib/QvSFRotation.cpp b/tool_src/QvLib/QvSFRotation.cpp
new file mode 100644
index 0000000..a76beb6
--- /dev/null
+++ b/tool_src/QvLib/QvSFRotation.cpp
@@ -0,0 +1,12 @@
+#include <QvSFRotation.h>
+
+QV_SFIELD_SOURCE(QvSFRotation);
+
+QvBool
+QvSFRotation::readValue(QvInput *in)
+{
+ return (in->read(axis[0]) &&
+ in->read(axis[1]) &&
+ in->read(axis[2]) &&
+ in->read(angle));
+}
diff --git a/tool_src/QvLib/QvSFRotation.h b/tool_src/QvLib/QvSFRotation.h
new file mode 100644
index 0000000..5402f94
--- /dev/null
+++ b/tool_src/QvLib/QvSFRotation.h
@@ -0,0 +1,13 @@
+#ifndef _QV_SF_ROTATION_
+#define _QV_SF_ROTATION_
+
+#include <QvSubField.h>
+
+class QvSFRotation : public QvSField {
+ public:
+ float axis[3];
+ float angle;
+ QV_SFIELD_HEADER(QvSFRotation);
+};
+
+#endif /* _QV_SF_ROTATION_ */
diff --git a/tool_src/QvLib/QvSFString.cpp b/tool_src/QvLib/QvSFString.cpp
new file mode 100644
index 0000000..9ddad5c
--- /dev/null
+++ b/tool_src/QvLib/QvSFString.cpp
@@ -0,0 +1,9 @@
+#include <QvSFString.h>
+
+QV_SFIELD_SOURCE(QvSFString);
+
+QvBool
+QvSFString::readValue(QvInput *in)
+{
+ return in->read(value);
+}
diff --git a/tool_src/QvLib/QvSFString.h b/tool_src/QvLib/QvSFString.h
new file mode 100644
index 0000000..70c9048
--- /dev/null
+++ b/tool_src/QvLib/QvSFString.h
@@ -0,0 +1,12 @@
+#ifndef _QV_SF_STRING_
+#define _QV_SF_STRING_
+
+#include <QvSubField.h>
+
+class QvSFString : public QvSField {
+ public:
+ QvString value;
+ QV_SFIELD_HEADER(QvSFString);
+};
+
+#endif /* _QV_SF_STRING_ */
diff --git a/tool_src/QvLib/QvSFVec2f.cpp b/tool_src/QvLib/QvSFVec2f.cpp
new file mode 100644
index 0000000..de1eace
--- /dev/null
+++ b/tool_src/QvLib/QvSFVec2f.cpp
@@ -0,0 +1,10 @@
+#include <QvSFVec2f.h>
+
+QV_SFIELD_SOURCE(QvSFVec2f);
+
+QvBool
+QvSFVec2f::readValue(QvInput *in)
+{
+ return (in->read(value[0]) &&
+ in->read(value[1]));
+}
diff --git a/tool_src/QvLib/QvSFVec2f.h b/tool_src/QvLib/QvSFVec2f.h
new file mode 100644
index 0000000..2863a26
--- /dev/null
+++ b/tool_src/QvLib/QvSFVec2f.h
@@ -0,0 +1,12 @@
+#ifndef _QV_SF_VEC2F_
+#define _QV_SF_VEC2F_
+
+#include <QvSubField.h>
+
+class QvSFVec2f : public QvSField {
+ public:
+ float value[2];
+ QV_SFIELD_HEADER(QvSFVec2f);
+};
+
+#endif /* _QV_SF_VEC2F_ */
diff --git a/tool_src/QvLib/QvSFVec3f.cpp b/tool_src/QvLib/QvSFVec3f.cpp
new file mode 100644
index 0000000..01148e6
--- /dev/null
+++ b/tool_src/QvLib/QvSFVec3f.cpp
@@ -0,0 +1,11 @@
+#include <QvSFVec3f.h>
+
+QV_SFIELD_SOURCE(QvSFVec3f);
+
+QvBool
+QvSFVec3f::readValue(QvInput *in)
+{
+ return (in->read(value[0]) &&
+ in->read(value[1]) &&
+ in->read(value[2]));
+}
diff --git a/tool_src/QvLib/QvSFVec3f.h b/tool_src/QvLib/QvSFVec3f.h
new file mode 100644
index 0000000..c8b2c0f
--- /dev/null
+++ b/tool_src/QvLib/QvSFVec3f.h
@@ -0,0 +1,12 @@
+#ifndef _QV_SF_VEC3F_
+#define _QV_SF_VEC3F_
+
+#include <QvSubField.h>
+
+class QvSFVec3f : public QvSField {
+ public:
+ float value[3];
+ QV_SFIELD_HEADER(QvSFVec3f);
+};
+
+#endif /* _QV_SF_VEC3F_ */
diff --git a/tool_src/QvLib/QvScale.cpp b/tool_src/QvLib/QvScale.cpp
new file mode 100644
index 0000000..e09a08e
--- /dev/null
+++ b/tool_src/QvLib/QvScale.cpp
@@ -0,0 +1,17 @@
+#include <QvScale.h>
+
+QV_NODE_SOURCE(QvScale);
+
+QvScale::QvScale()
+{
+ QV_NODE_CONSTRUCTOR(QvScale);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(scaleFactor);
+
+ scaleFactor.value[0] = scaleFactor.value[1] = scaleFactor.value[2] =1.0;
+}
+
+QvScale::~QvScale()
+{
+}
diff --git a/tool_src/QvLib/QvScale.h b/tool_src/QvLib/QvScale.h
new file mode 100644
index 0000000..06384d7
--- /dev/null
+++ b/tool_src/QvLib/QvScale.h
@@ -0,0 +1,16 @@
+#ifndef _QV_SCALE_
+#define _QV_SCALE_
+
+#include <QvSFVec3f.h>
+#include <QvSubNode.h>
+
+class QvScale : public QvNode {
+
+ QV_NODE_HEADER(QvScale);
+
+ public:
+ // Fields
+ QvSFVec3f scaleFactor; // Scale factors in x, y, and z
+};
+
+#endif /* _QV_SCALE_ */
diff --git a/tool_src/QvLib/QvSeparator.cpp b/tool_src/QvLib/QvSeparator.cpp
new file mode 100644
index 0000000..5c9751e
--- /dev/null
+++ b/tool_src/QvLib/QvSeparator.cpp
@@ -0,0 +1,23 @@
+#include <QvSeparator.h>
+
+QV_NODE_SOURCE(QvSeparator);
+
+QvSeparator::QvSeparator()
+{
+ QV_NODE_CONSTRUCTOR(QvSeparator);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(renderCulling);
+
+ renderCulling.value = AUTO;
+
+ QV_NODE_DEFINE_ENUM_VALUE(CullEnabled, ON);
+ QV_NODE_DEFINE_ENUM_VALUE(CullEnabled, OFF);
+ QV_NODE_DEFINE_ENUM_VALUE(CullEnabled, AUTO);
+
+ QV_NODE_SET_SF_ENUM_TYPE(renderCulling, CullEnabled);
+}
+
+QvSeparator::~QvSeparator()
+{
+}
diff --git a/tool_src/QvLib/QvSeparator.h b/tool_src/QvLib/QvSeparator.h
new file mode 100644
index 0000000..a6a8688
--- /dev/null
+++ b/tool_src/QvLib/QvSeparator.h
@@ -0,0 +1,24 @@
+#ifndef _QV_SEPARATOR_
+#define _QV_SEPARATOR_
+
+#include <QvSFEnum.h>
+#include <QvGroup.h>
+
+#include <QvSFBitMask.h>
+
+class QvSeparator : public QvGroup {
+
+ QV_NODE_HEADER(QvSeparator);
+
+ public:
+ enum CullEnabled { // Possible values for culling
+ OFF, // Never cull
+ ON, // Always cull
+ AUTO, // Decide based on some heuristic
+ };
+
+ // Fields
+ QvSFEnum renderCulling;
+};
+
+#endif /* _QV_SEPARATOR_ */
diff --git a/tool_src/QvLib/QvShapeHints.cpp b/tool_src/QvLib/QvShapeHints.cpp
new file mode 100644
index 0000000..7c868c2
--- /dev/null
+++ b/tool_src/QvLib/QvShapeHints.cpp
@@ -0,0 +1,37 @@
+#include <QvShapeHints.h>
+
+QV_NODE_SOURCE(QvShapeHints);
+
+QvShapeHints::QvShapeHints()
+{
+ QV_NODE_CONSTRUCTOR(QvShapeHints);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(vertexOrdering);
+ QV_NODE_ADD_FIELD(shapeType);
+ QV_NODE_ADD_FIELD(faceType);
+ QV_NODE_ADD_FIELD(creaseAngle);
+
+ vertexOrdering.value = UNKNOWN_ORDERING;
+ shapeType.value = UNKNOWN_SHAPE_TYPE;
+ faceType.value = CONVEX;
+ creaseAngle.value = 0.5;
+
+ QV_NODE_DEFINE_ENUM_VALUE(VertexOrdering, UNKNOWN_ORDERING);
+ QV_NODE_DEFINE_ENUM_VALUE(VertexOrdering, CLOCKWISE);
+ QV_NODE_DEFINE_ENUM_VALUE(VertexOrdering, COUNTERCLOCKWISE);
+
+ QV_NODE_DEFINE_ENUM_VALUE(ShapeType, UNKNOWN_SHAPE_TYPE);
+ QV_NODE_DEFINE_ENUM_VALUE(ShapeType, SOLID);
+
+ QV_NODE_DEFINE_ENUM_VALUE(FaceType, UNKNOWN_FACE_TYPE);
+ QV_NODE_DEFINE_ENUM_VALUE(FaceType, CONVEX);
+
+ QV_NODE_SET_SF_ENUM_TYPE(vertexOrdering, VertexOrdering);
+ QV_NODE_SET_SF_ENUM_TYPE(shapeType, ShapeType);
+ QV_NODE_SET_SF_ENUM_TYPE(faceType, FaceType);
+}
+
+QvShapeHints::~QvShapeHints()
+{
+}
diff --git a/tool_src/QvLib/QvShapeHints.h b/tool_src/QvLib/QvShapeHints.h
new file mode 100644
index 0000000..e816239
--- /dev/null
+++ b/tool_src/QvLib/QvShapeHints.h
@@ -0,0 +1,36 @@
+#ifndef _QV_SHAPE_HINTS_
+#define _QV_SHAPE_HINTS_
+
+#include <QvSFEnum.h>
+#include <QvSFFloat.h>
+#include <QvSubNode.h>
+
+class QvShapeHints : public QvNode {
+
+ QV_NODE_HEADER(QvShapeHints);
+
+ public:
+ enum VertexOrdering {
+ UNKNOWN_ORDERING,
+ CLOCKWISE,
+ COUNTERCLOCKWISE,
+ };
+
+ enum ShapeType {
+ UNKNOWN_SHAPE_TYPE,
+ SOLID,
+ };
+
+ enum FaceType {
+ UNKNOWN_FACE_TYPE,
+ CONVEX,
+ };
+
+ // Fields
+ QvSFEnum vertexOrdering; // Ordering of face vertices
+ QvSFEnum shapeType; // Info about shape geometry
+ QvSFEnum faceType; // Info about face geometry
+ QvSFFloat creaseAngle; // Smallest angle for sharp edge
+};
+
+#endif /* _QV_SHAPE_HINTS_ */
diff --git a/tool_src/QvLib/QvSphere.cpp b/tool_src/QvLib/QvSphere.cpp
new file mode 100644
index 0000000..c15d830
--- /dev/null
+++ b/tool_src/QvLib/QvSphere.cpp
@@ -0,0 +1,17 @@
+#include <QvSphere.h>
+
+QV_NODE_SOURCE(QvSphere);
+
+QvSphere::QvSphere()
+{
+ QV_NODE_CONSTRUCTOR(QvSphere);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(radius);
+
+ radius.value = 1.0;
+}
+
+QvSphere::~QvSphere()
+{
+}
diff --git a/tool_src/QvLib/QvSphere.h b/tool_src/QvLib/QvSphere.h
new file mode 100644
index 0000000..f867c54
--- /dev/null
+++ b/tool_src/QvLib/QvSphere.h
@@ -0,0 +1,17 @@
+#ifndef _QV_SPHERE_
+#define _QV_SPHERE_
+
+#include <QvSFFloat.h>
+#include <QvSubNode.h>
+
+class QvSphere : public QvNode {
+
+ QV_NODE_HEADER(QvSphere);
+
+ public:
+ // Fields
+ QvSFFloat radius; // Radius of sphere
+};
+
+#endif /* _QV_SPHERE_ */
+
diff --git a/tool_src/QvLib/QvSpotLight.h b/tool_src/QvLib/QvSpotLight.h
new file mode 100644
index 0000000..81f739a
--- /dev/null
+++ b/tool_src/QvLib/QvSpotLight.h
@@ -0,0 +1,29 @@
+#ifndef _QV_SPOT_LIGHT_
+#define _QV_SPOT_LIGHT_
+
+#include <QvSFBool.h>
+#include <QvSFColor.h>
+#include <QvSFFloat.h>
+#include <QvSFVec3f.h>
+#include <QvSubNode.h>
+
+class QvSpotLight : public QvNode {
+
+ QV_NODE_HEADER(QvSpotLight);
+
+ public:
+ // Fields:
+ QvSFBool on; // Whether light is on
+ QvSFFloat intensity; // Source intensity (0 to 1)
+ QvSFColor color; // RGB source color
+ QvSFVec3f location; // Source location
+ QvSFVec3f direction; // Primary direction of illumination
+ QvSFFloat dropOffRate; // Rate of intensity drop-off from primary
+ // direction: 0 = constant intensity,
+ // 1 = sharp drop-off
+ QvSFFloat cutOffAngle; // Angle (in radians) outside of which
+ // intensity is zero, measured from
+ // edge of cone to other edge
+};
+
+#endif /* _QV_SPOT_LIGHT_ */
diff --git a/tool_src/QvLib/QvSpotlight.cpp b/tool_src/QvLib/QvSpotlight.cpp
new file mode 100644
index 0000000..5273711
--- /dev/null
+++ b/tool_src/QvLib/QvSpotlight.cpp
@@ -0,0 +1,35 @@
+#include "math.h"
+
+#include <QvSpotLight.h>
+
+QV_NODE_SOURCE(QvSpotLight);
+
+QvSpotLight::QvSpotLight()
+{
+ QV_NODE_CONSTRUCTOR(QvSpotLight);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(on);
+ QV_NODE_ADD_FIELD(intensity);
+ QV_NODE_ADD_FIELD(color);
+ QV_NODE_ADD_FIELD(location);
+ QV_NODE_ADD_FIELD(direction);
+ QV_NODE_ADD_FIELD(dropOffRate);
+ QV_NODE_ADD_FIELD(cutOffAngle);
+
+ on.value = TRUE;
+ intensity.value = 1.0;
+ color.value[0] = color.value[1] = color.value[2] = 1.0;
+ location.value[0] = 0.0;
+ location.value[1] = 0.0;
+ location.value[2] = 1.0;
+ direction.value[0] = 0.0;
+ direction.value[1] = 0.0;
+ direction.value[2] = -1.0;
+ dropOffRate.value = 0.0;
+ cutOffAngle.value = M_PI / 4.0;
+}
+
+QvSpotLight::~QvSpotLight()
+{
+}
diff --git a/tool_src/QvLib/QvState.cpp b/tool_src/QvLib/QvState.cpp
new file mode 100644
index 0000000..6a629b8
--- /dev/null
+++ b/tool_src/QvLib/QvState.cpp
@@ -0,0 +1,128 @@
+
+//[MSH_START]
+// 02/01/98: moved FetchCoordinate3State(), FetchMaterialState(), and
+// FetchMaterialBindingState() into class BRep.
+// 01/01/98: added new material retrieval code (msh)
+// 05/05/97: added new constructor (msh)
+// 04/03/97: added display of coordinate3 stack (msh)
+//[MSH_END]
+
+#include <QvState.h>
+
+
+const char *QvState::stackNames[NumStacks] = {
+ "Camera",
+ "Coordinate3",
+ "Light",
+ "MaterialBinding",
+ "Material",
+ "NormalBinding",
+ "Normal",
+ "ShapeHints",
+ "Texture2",
+ "Texture2Transformation",
+ "TextureCoordinate2",
+ "Transformation",
+};
+
+//[MSH_START]
+QvState::QvState( BSPLIB_NAMESPACE::VrmlFile *base )
+{
+ vrmlfile_base = base;
+ //stacks = new QvElement[NumStacks];
+
+ //stacks = (QvElement **) new QvElement[NumStacks];
+ //stacks = new QvElement * [NumStacks];
+
+ for (int i = 0; i < NumStacks; i++){
+ stacks[i] = NULL;
+ }
+ depth = 0;
+}
+//[MSH_END]
+
+QvState::QvState()
+{
+//[MSH_START]
+ vrmlfile_base = NULL;
+//[MSH_END]
+
+ //stacks = new QvElement[NumStacks];
+ //stacks = (QvElement **) new QvElement[NumStacks];
+ //stacks = new QvElement * [NumStacks];
+
+ int i = 0;
+ for (i = 0; i < NumStacks; i++){
+ stacks[i] = NULL;
+ }
+ depth = 0;
+}
+
+QvState::~QvState()
+{
+ while (depth > 0)
+ pop();
+
+ //delete [] stacks;
+}
+
+void
+QvState::addElement(StackIndex stackIndex, QvElement *elt)
+{
+ elt->depth = depth;
+ elt->next = stacks[stackIndex];
+ stacks[stackIndex] = elt;
+}
+
+void
+QvState::push()
+{
+ depth++;
+}
+
+void
+QvState::pop()
+{
+ depth--;
+
+ for (int i = 0; i < NumStacks; i++)
+ while (stacks[i] != NULL && stacks[i]->depth > depth)
+ popElement((StackIndex) i);
+}
+
+void
+QvState::popElement(StackIndex stackIndex)
+{
+ QvElement *elt = stacks[stackIndex];
+ stacks[stackIndex] = elt->next;
+ delete elt;
+}
+
+void
+QvState::print()
+{
+ printf("Traversal state:\n");
+
+ for (int i = 0; i < NumStacks; i++) {
+ printf("\tStack [%2d] (%s):\n", i, stackNames[i]);
+
+ if (stacks[i] == NULL){
+ printf("\t\tNULL\n");
+ } else {
+ for (QvElement *elt = stacks[i]; elt != NULL; elt = elt->next) {
+ elt->print();
+//[MSH_START]
+/*
+ if ( i == Coordinate3Index ) {
+ QvCoordinate3 *c3 = (QvCoordinate3 *) elt->data;
+ for ( int j = 0; j < c3->point.num; j++ )
+ printf( "point[%d]=%f %f %f\n", j, c3->point.values[ j*3 ], c3->point.values[ j*3 + 1 ], c3->point.values[ j*3 + 2 ] );
+
+ }
+*/
+//[MSH_END]
+ }
+ }
+
+ }
+}
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_ */
diff --git a/tool_src/QvLib/QvString.cpp b/tool_src/QvLib/QvString.cpp
new file mode 100644
index 0000000..a5562a3
--- /dev/null
+++ b/tool_src/QvLib/QvString.cpp
@@ -0,0 +1,106 @@
+#include <QvString.h>
+
+QvString::~QvString()
+{
+ if (string != staticStorage)
+ delete [] string;
+}
+
+void
+QvString::expand(int bySize)
+{
+ int newSize = strlen(string) + bySize + 1;
+
+ if (newSize >= QV_STRING_STATIC_STORAGE_SIZE &&
+ (string == staticStorage || newSize > storageSize)) {
+
+ char *newString = new char[newSize];
+
+ strcpy(newString, string);
+
+ if (string != staticStorage)
+ delete [] string;
+
+ string = newString;
+ storageSize = newSize;
+ }
+}
+
+u_long
+QvString::hash(const char *s)
+{
+ u_long total, shift;
+
+ total = shift = 0;
+ while (*s) {
+ total = total ^ ((*s) << shift);
+ shift+=5;
+ if (shift>24) shift -= 24;
+ s++;
+ }
+
+ return( total );
+}
+
+void
+QvString::makeEmpty(QvBool freeOld)
+{
+ if (string != staticStorage) {
+ if (freeOld)
+ delete [] string;
+ string = staticStorage;
+ }
+ string[0] = '\0';
+}
+
+QvString &
+QvString::operator =(const char *str)
+{
+ int size = strlen(str) + 1;
+
+ if (str >= string &&
+ str < string + (string != staticStorage ? storageSize :
+ QV_STRING_STATIC_STORAGE_SIZE)) {
+
+ QvString tmp = str;
+ *this = tmp;
+ return *this;
+ }
+
+ if (size < QV_STRING_STATIC_STORAGE_SIZE) {
+ if (string != staticStorage)
+ makeEmpty();
+ }
+
+ else if (string == staticStorage)
+ string = new char[size];
+
+ else if (size > storageSize) {
+ delete [] string;
+ string = new char[size];
+ }
+
+ strcpy(string, str);
+ storageSize = size;
+ return *this;
+}
+
+QvString &
+QvString::operator +=(const char *str)
+{
+ expand(strlen(str));
+ strcat(string, str);
+ return *this;
+}
+
+int
+operator ==(const QvString &str, const char *s)
+{
+ return (str.string[0] == s[0] && ! strcmp(str.string, s));
+}
+
+int
+operator !=(const QvString &str, const char *s)
+{
+ return (str.string[0] != s[0] || strcmp(str.string, s));
+}
diff --git a/tool_src/QvLib/QvString.h b/tool_src/QvLib/QvString.h
new file mode 100644
index 0000000..ae49676
--- /dev/null
+++ b/tool_src/QvLib/QvString.h
@@ -0,0 +1,101 @@
+#ifndef _QV_STRING_
+#define _QV_STRING_
+
+#include <QvBasic.h>
+#include <string.h>
+
+class QvString {
+ public:
+ QvString() { string = staticStorage;
+ string[0] = '\0'; }
+ QvString(const char *str) { string = staticStorage;
+ *this = str; }
+ QvString(const QvString &str) { string = staticStorage;
+ *this = str.string; }
+ ~QvString();
+ u_long hash() { return QvString::hash(string); }
+ int getLength() const { return strlen(string); }
+ void makeEmpty(QvBool freeOld = TRUE);
+ const char * getString() const { return string; }
+ QvString & operator =(const char *str);
+ QvString & operator =(const QvString &str)
+ { return (*this = str.string); }
+ QvString & operator +=(const char *str);
+ int operator !() const { return (string[0] == '\0'); }
+ friend int operator ==(const QvString &str, const char *s);
+
+ friend int operator ==(const char *s, const QvString &str)
+ { return (str == s); }
+
+ friend int operator ==(const QvString &str1, const QvString &str2)
+ { return (str1 == str2.string); }
+ friend int operator !=(const QvString &str, const char *s);
+
+ friend int operator !=(const char *s, const QvString &str)
+ { return (str != s); }
+ friend int operator !=(const QvString &str1,
+ const QvString &str2)
+ { return (str1 != str2.string); }
+ static u_long hash(const char *s);
+ private:
+ char *string;
+ int storageSize;
+#define QV_STRING_STATIC_STORAGE_SIZE 32
+ char staticStorage[QV_STRING_STATIC_STORAGE_SIZE];
+ void expand(int bySize);
+};
+
+class QvNameEntry {
+ public:
+ QvBool isEmpty() const { return (string[0] == '\0'); }
+ QvBool isEqual(const char *s) const
+ { return (string[0] == s[0] && ! strcmp(string, s)); }
+ private:
+ static int nameTableSize;
+ static QvNameEntry **nameTable;
+ static struct QvNameChunk *chunk;
+ const char *string;
+ u_long hashValue;
+ QvNameEntry *next;
+ static void initClass();
+ QvNameEntry(const char *s, u_long h, QvNameEntry *n)
+ { string = s; hashValue = h; next = n; }
+ static const QvNameEntry * insert(const char *s);
+
+friend class QvName;
+};
+
+class QvName {
+ public:
+ QvName();
+ QvName(const char *s) { entry = QvNameEntry::insert(s); }
+ QvName(const QvString &s) { entry = QvNameEntry::insert(s.getString()); }
+
+ QvName(const QvName &n) { entry = n.entry; }
+ ~QvName() {}
+ const char *getString() const { return entry->string; }
+ int getLength() const { return strlen(entry->string); }
+ static QvBool isIdentStartChar(char c);
+ static QvBool isIdentChar(char c);
+ static QvBool isNodeNameStartChar(char c);
+ static QvBool isNodeNameChar(char c);
+ int operator !() const { return entry->isEmpty(); }
+ friend int operator ==(const QvName &n, const char *s)
+ { return n.entry->isEqual(s); }
+ friend int operator ==(const char *s, const QvName &n)
+ { return n.entry->isEqual(s); }
+
+ friend int operator ==(const QvName &n1, const QvName &n2)
+ { return n1.entry == n2.entry; }
+ friend int operator !=(const QvName &n, const char *s)
+ { return ! n.entry->isEqual(s); }
+ friend int operator !=(const char *s, const QvName &n)
+ { return ! n.entry->isEqual(s); }
+
+ friend int operator !=(const QvName &n1, const QvName &n2)
+ { return n1.entry != n2.entry; }
+ private:
+ const QvNameEntry *entry;
+};
+
+#endif /* _QV_STRING_ */
diff --git a/tool_src/QvLib/QvSubField.h b/tool_src/QvLib/QvSubField.h
new file mode 100644
index 0000000..a9fdea5
--- /dev/null
+++ b/tool_src/QvLib/QvSubField.h
@@ -0,0 +1,72 @@
+#ifndef _QV_SUB_FIELD_
+#define _QV_SUB_FIELD_
+
+#include <QvField.h>
+#include <QvInput.h>
+
+/////////////////////////////////////////////////////////////////////////////
+
+#define QV_SFIELD_HEADER(className) \
+ public: \
+ className(); \
+ virtual ~className(); \
+ virtual QvBool readValue(QvInput *in)
+
+/////////////////////////////////////////////////////////////////////////////
+
+#define QV_MFIELD_HEADER(className) \
+ public: \
+ className(); \
+ virtual ~className(); \
+ virtual QvBool read1Value(QvInput *in, int index); \
+ void allocValues(int newNum)
+
+/////////////////////////////////////////////////////////////////////////////
+
+#define QV_SFIELD_SOURCE(className) \
+ \
+className::className() \
+{ \
+} \
+className::~className() \
+{ \
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+#define QV_MFIELD_SOURCE(className, valueType, numValues) \
+ \
+className::className() \
+{ \
+ values = NULL; \
+ /* Make room for 1 value to start */ \
+ allocValues(1); \
+} \
+ \
+className::~className() \
+{ \
+ if (values != NULL) \
+ free((char *) values); \
+} \
+ \
+void \
+className::allocValues(int newNum) \
+{ \
+ if (values == NULL) { \
+ if (newNum > 0) \
+ values = (valueType *) \
+ malloc(numValues * sizeof(valueType) * newNum); \
+ } \
+ else { \
+ if (newNum > 0) \
+ values = (valueType *) \
+ realloc(values, numValues * sizeof(valueType) * newNum); \
+ else { \
+ free((char *) values); \
+ values = NULL; \
+ } \
+ } \
+ num = maxNum = newNum; \
+}
+
+#endif /* _QV_SUB_FIELD_ */
diff --git a/tool_src/QvLib/QvSubNode.h b/tool_src/QvLib/QvSubNode.h
new file mode 100644
index 0000000..c79c025
--- /dev/null
+++ b/tool_src/QvLib/QvSubNode.h
@@ -0,0 +1,41 @@
+#ifndef _QV_SUB_NODE_
+#define _QV_SUB_NODE_
+
+#include <QvFieldData.h>
+#include <QvNode.h>
+
+#define QV_NODE_HEADER(className) \
+ public: \
+ className(); \
+ virtual ~className(); \
+ virtual void traverse(QvState *state); \
+ private: \
+ static QvBool firstInstance; \
+ static QvFieldData *fieldData; \
+ virtual QvFieldData *getFieldData() { return fieldData; }
+
+#define QV_NODE_SOURCE(className) \
+ QvFieldData *className::fieldData; \
+ QvBool className::firstInstance = TRUE;
+
+#define QV_NODE_CONSTRUCTOR(className) \
+ if (fieldData == NULL) \
+ fieldData = new QvFieldData; \
+ else \
+ firstInstance = FALSE; \
+ isBuiltIn = FALSE; \
+
+#define QV_NODE_IS_FIRST_INSTANCE() (firstInstance == TRUE)
+
+#define QV_NODE_ADD_FIELD(fieldName) \
+ if (firstInstance) \
+ fieldData->addField(this, QV__QUOTE(fieldName), &this->fieldName); \
+ this->fieldName.setContainer(this);
+
+#define QV_NODE_DEFINE_ENUM_VALUE(enumType,enumValue) \
+ if (firstInstance) \
+ fieldData->addEnumValue(QV__QUOTE(enumType), \
+ QV__QUOTE(enumValue), enumValue)
+
+#endif /* _QV_SUB_NODE_ */
+
diff --git a/tool_src/QvLib/QvSwitch.cpp b/tool_src/QvLib/QvSwitch.cpp
new file mode 100644
index 0000000..ddbc8e4
--- /dev/null
+++ b/tool_src/QvLib/QvSwitch.cpp
@@ -0,0 +1,17 @@
+#include <QvSwitch.h>
+
+QV_NODE_SOURCE(QvSwitch);
+
+QvSwitch::QvSwitch()
+{
+ QV_NODE_CONSTRUCTOR(QvSwitch);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(whichChild);
+
+ whichChild.value = QV_SWITCH_NONE;
+}
+
+QvSwitch::~QvSwitch()
+{
+}
diff --git a/tool_src/QvLib/QvSwitch.h b/tool_src/QvLib/QvSwitch.h
new file mode 100644
index 0000000..47998cc
--- /dev/null
+++ b/tool_src/QvLib/QvSwitch.h
@@ -0,0 +1,19 @@
+#ifndef _QV_SWITCH_
+#define _QV_SWITCH_
+
+#include <QvSFLong.h>
+#include <QvGroup.h>
+
+#define QV_SWITCH_NONE (-1) /* Don't traverse any children */
+#define QV_SWITCH_ALL (-3) /* Traverse all children */
+
+class QvSwitch : public QvGroup {
+
+ QV_NODE_HEADER(QvSwitch);
+
+ public:
+ // Fields
+ QvSFLong whichChild; // Child to traverse
+};
+
+#endif /* _QV_SWITCH_ */
diff --git a/tool_src/QvLib/QvTexture2.cpp b/tool_src/QvLib/QvTexture2.cpp
new file mode 100644
index 0000000..ca06351
--- /dev/null
+++ b/tool_src/QvLib/QvTexture2.cpp
@@ -0,0 +1,55 @@
+#include <QvTexture2.h>
+
+QV_NODE_SOURCE(QvTexture2);
+
+QvTexture2::QvTexture2()
+{
+ QV_NODE_CONSTRUCTOR(QvTexture2);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(filename);
+ QV_NODE_ADD_FIELD(image);
+ QV_NODE_ADD_FIELD(wrapS);
+ QV_NODE_ADD_FIELD(wrapT);
+
+ filename.value = "";
+ image.size[0] = image.size[1] = 0.0;
+ image.numComponents = 0;
+ image.bytes = NULL;
+ wrapS.value = REPEAT;
+ wrapT.value = REPEAT;
+
+ QV_NODE_DEFINE_ENUM_VALUE(Wrap, REPEAT);
+ QV_NODE_DEFINE_ENUM_VALUE(Wrap, CLAMP);
+
+ QV_NODE_SET_SF_ENUM_TYPE(wrapS, Wrap);
+ QV_NODE_SET_SF_ENUM_TYPE(wrapT, Wrap);
+}
+
+QvTexture2::~QvTexture2()
+{
+}
+
+QvBool
+QvTexture2::readInstance(QvInput *in)
+{
+ QvBool readOK = QvNode::readInstance(in);
+
+ if (readOK && ! filename.isDefault()) {
+ if (! readImage())
+ readOK = FALSE;
+ image.setDefault(TRUE);
+ }
+
+ return readOK;
+}
+
+QvBool
+QvTexture2::readImage()
+{
+ // ???
+ // ??? Read image from filename and store results in image field.
+ // ???
+
+ return TRUE;
+}
diff --git a/tool_src/QvLib/QvTexture2.h b/tool_src/QvLib/QvTexture2.h
new file mode 100644
index 0000000..2933078
--- /dev/null
+++ b/tool_src/QvLib/QvTexture2.h
@@ -0,0 +1,29 @@
+#ifndef _QV_TEXTURE_2_
+#define _QV_TEXTURE_2_
+
+#include <QvSFEnum.h>
+#include <QvSFImage.h>
+#include <QvSFString.h>
+#include <QvSubNode.h>
+
+class QvTexture2 : public QvNode {
+
+ QV_NODE_HEADER(QvTexture2);
+
+ public:
+ enum Wrap { // Texture wrap type
+ REPEAT,
+ CLAMP,
+ };
+
+ // Fields.
+ QvSFString filename; // file to read texture from
+ QvSFImage image; // The texture
+ QvSFEnum wrapS;
+ QvSFEnum wrapT;
+
+ virtual QvBool readInstance(QvInput *in);
+ QvBool readImage();
+};
+
+#endif /* _QV_TEXTURE_2_ */
diff --git a/tool_src/QvLib/QvTexture2Transform.cpp b/tool_src/QvLib/QvTexture2Transform.cpp
new file mode 100644
index 0000000..22b2e6f
--- /dev/null
+++ b/tool_src/QvLib/QvTexture2Transform.cpp
@@ -0,0 +1,23 @@
+#include <QvTexture2Transform.h>
+
+QV_NODE_SOURCE(QvTexture2Transform);
+
+QvTexture2Transform::QvTexture2Transform()
+{
+ QV_NODE_CONSTRUCTOR(QvTexture2Transform);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(translation);
+ QV_NODE_ADD_FIELD(rotation);
+ QV_NODE_ADD_FIELD(scaleFactor);
+ QV_NODE_ADD_FIELD(center);
+
+ translation.value[0] = translation.value[1] = 0.0;
+ rotation.value = 0.0;
+ scaleFactor.value[0] = scaleFactor.value[1] = 1.0;
+ center.value[0] = center.value[1] = 0.0;
+}
+
+QvTexture2Transform::~QvTexture2Transform()
+{
+}
diff --git a/tool_src/QvLib/QvTexture2Transform.h b/tool_src/QvLib/QvTexture2Transform.h
new file mode 100644
index 0000000..e2b5066
--- /dev/null
+++ b/tool_src/QvLib/QvTexture2Transform.h
@@ -0,0 +1,20 @@
+#ifndef _QV_TEXTURE_2_TRANSFORM_
+#define _QV_TEXTURE_2_TRANSFORM_
+
+#include <QvSFFloat.h>
+#include <QvSFVec2f.h>
+#include <QvSubNode.h>
+
+class QvTexture2Transform : public QvNode {
+
+ QV_NODE_HEADER(QvTexture2Transform);
+
+ public:
+ // Fields
+ QvSFVec2f translation; // Translation vector
+ QvSFFloat rotation; // Rotation
+ QvSFVec2f scaleFactor; // Scale factors
+ QvSFVec2f center; // Center point for scale and rotate
+};
+
+#endif /* _QV_TEXTURE_2_TRANSFORM_ */
diff --git a/tool_src/QvLib/QvTextureCoordinate2.cpp b/tool_src/QvLib/QvTextureCoordinate2.cpp
new file mode 100644
index 0000000..f2783b1
--- /dev/null
+++ b/tool_src/QvLib/QvTextureCoordinate2.cpp
@@ -0,0 +1,17 @@
+#include <QvTextureCoordinate2.h>
+
+QV_NODE_SOURCE(QvTextureCoordinate2);
+
+QvTextureCoordinate2::QvTextureCoordinate2()
+{
+ QV_NODE_CONSTRUCTOR(QvTextureCoordinate2);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(point);
+
+ point.values[0] = point.values[1] = 0.0;
+}
+
+QvTextureCoordinate2::~QvTextureCoordinate2()
+{
+}
diff --git a/tool_src/QvLib/QvTextureCoordinate2.h b/tool_src/QvLib/QvTextureCoordinate2.h
new file mode 100644
index 0000000..9534e94
--- /dev/null
+++ b/tool_src/QvLib/QvTextureCoordinate2.h
@@ -0,0 +1,16 @@
+#ifndef _QV_TEXTURE_COORDINATE_2_
+#define _QV_TEXTURE_COORDINATE_2_
+
+#include <QvMFVec2f.h>
+#include <QvSubNode.h>
+
+class QvTextureCoordinate2 : public QvNode {
+
+ QV_NODE_HEADER(QvTextureCoordinate2);
+
+ public:
+ // Fields
+ QvMFVec2f point; // TextureCoordinate point(s)
+};
+
+#endif /* _QV_TEXTURE_COORDINATE_2_ */
diff --git a/tool_src/QvLib/QvTransform.cpp b/tool_src/QvLib/QvTransform.cpp
new file mode 100644
index 0000000..5e265f1
--- /dev/null
+++ b/tool_src/QvLib/QvTransform.cpp
@@ -0,0 +1,31 @@
+#include <QvTransform.h>
+
+QV_NODE_SOURCE(QvTransform);
+
+QvTransform::QvTransform()
+{
+ QV_NODE_CONSTRUCTOR(QvTransform);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(translation);
+ QV_NODE_ADD_FIELD(rotation);
+ QV_NODE_ADD_FIELD(scaleFactor);
+ QV_NODE_ADD_FIELD(scaleOrientation);
+ QV_NODE_ADD_FIELD(center);
+
+ translation.value[0] = translation.value[1] = translation.value[2] = 0.0;
+ rotation.axis[0] = 0.0;
+ rotation.axis[1] = 0.0;
+ rotation.axis[2] = 1.0;
+ rotation.angle = 0.0;
+ scaleFactor.value[0] = scaleFactor.value[1] = scaleFactor.value[2] = 1.0;
+ scaleOrientation.axis[0] = 0.0;
+ scaleOrientation.axis[1] = 0.0;
+ scaleOrientation.axis[2] = 1.0;
+ scaleOrientation.angle = 0.0;
+ center.value[0] = center.value[1] = center.value[2] = 0.0;
+}
+
+QvTransform::~QvTransform()
+{
+}
diff --git a/tool_src/QvLib/QvTransform.h b/tool_src/QvLib/QvTransform.h
new file mode 100644
index 0000000..be64031
--- /dev/null
+++ b/tool_src/QvLib/QvTransform.h
@@ -0,0 +1,21 @@
+#ifndef _QV_TRANSFORM_
+#define _QV_TRANSFORM_
+
+#include <QvSFRotation.h>
+#include <QvSFVec3f.h>
+#include <QvSubNode.h>
+
+class QvTransform : public QvNode {
+
+ QV_NODE_HEADER(QvTransform);
+
+ public:
+ // Fields
+ QvSFVec3f translation; // Translation vector
+ QvSFRotation rotation; // Rotation
+ QvSFVec3f scaleFactor; // Scale factors
+ QvSFRotation scaleOrientation;// Defines rotational space for scale
+ QvSFVec3f center; // Center point for scale and rotate
+};
+
+#endif /* _QV_TRANSFORM_ */
diff --git a/tool_src/QvLib/QvTransformSeparator.cpp b/tool_src/QvLib/QvTransformSeparator.cpp
new file mode 100644
index 0000000..416754f
--- /dev/null
+++ b/tool_src/QvLib/QvTransformSeparator.cpp
@@ -0,0 +1,13 @@
+#include <QvTransformSeparator.h>
+
+QV_NODE_SOURCE(QvTransformSeparator);
+
+QvTransformSeparator::QvTransformSeparator()
+{
+ QV_NODE_CONSTRUCTOR(QvTransformSeparator);
+ isBuiltIn = TRUE;
+}
+
+QvTransformSeparator::~QvTransformSeparator()
+{
+}
diff --git a/tool_src/QvLib/QvTransformSeparator.h b/tool_src/QvLib/QvTransformSeparator.h
new file mode 100644
index 0000000..90cc435
--- /dev/null
+++ b/tool_src/QvLib/QvTransformSeparator.h
@@ -0,0 +1,13 @@
+#ifndef _QV_TRANSFORM_SEPARATOR_
+#define _QV_TRANSFORM_SEPARATOR_
+
+#include <QvGroup.h>
+
+class QvTransformSeparator : public QvGroup {
+
+ QV_NODE_HEADER(QvTransformSeparator);
+
+ // No fields
+};
+
+#endif /* _QV_TRANSFORM_SEPARATOR_ */
diff --git a/tool_src/QvLib/QvTranslation.cpp b/tool_src/QvLib/QvTranslation.cpp
new file mode 100644
index 0000000..1b79720
--- /dev/null
+++ b/tool_src/QvLib/QvTranslation.cpp
@@ -0,0 +1,17 @@
+#include <QvTranslation.h>
+
+QV_NODE_SOURCE(QvTranslation);
+
+QvTranslation::QvTranslation()
+{
+ QV_NODE_CONSTRUCTOR(QvTranslation);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(translation);
+
+ translation.value[0] = translation.value[1] = translation.value[2] = 0.0;
+}
+
+QvTranslation::~QvTranslation()
+{
+}
diff --git a/tool_src/QvLib/QvTranslation.h b/tool_src/QvLib/QvTranslation.h
new file mode 100644
index 0000000..0921b5d
--- /dev/null
+++ b/tool_src/QvLib/QvTranslation.h
@@ -0,0 +1,16 @@
+#ifndef _QV_TRANSLATION_
+#define _QV_TRANSLATION_
+
+#include <QvSFVec3f.h>
+#include <QvSubNode.h>
+
+class QvTranslation : public QvNode {
+
+ QV_NODE_HEADER(QvTranslation);
+
+ public:
+ // Fields
+ QvSFVec3f translation; // Translation vector
+};
+
+#endif /* _QV_TRANSLATION_ */
diff --git a/tool_src/QvLib/QvTraverse.cpp b/tool_src/QvLib/QvTraverse.cpp
new file mode 100644
index 0000000..07da40c
--- /dev/null
+++ b/tool_src/QvLib/QvTraverse.cpp
@@ -0,0 +1,317 @@
+#include <QvElement.h>
+#include <QvNodes.h>
+#include <QvState.h>
+//#ifdef WIN32
+#include <QvUnknownNode.h>
+//#endif
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// Traversal code for all nodes. The default method (in QvNode) does
+// nothing. Because traverse() is defined in the header for ALL node
+// classes, each one has an implementation here.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+// For debugging
+static int indent = 0;
+static void
+announce(const char *className)
+{
+ for (int i = 0; i < indent; i++)
+ printf("\t");
+ printf("Traversing a %s\n", className);
+}
+#define ANNOUNCE(className) announce(QV__QUOTE(className))
+
+#define DEFAULT_TRAVERSE(className) \
+void \
+className::traverse(QvState *) \
+{ \
+ ANNOUNCE(className); \
+}
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// Groups.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+void
+QvGroup::traverse(QvState *state)
+{
+ ANNOUNCE(QvGroup);
+ indent++;
+ for (int i = 0; i < getNumChildren(); i++)
+ getChild(i)->traverse(state);
+ indent--;
+}
+
+void
+QvLevelOfDetail::traverse(QvState *state)
+{
+ ANNOUNCE(QvLevelOfDetail);
+ indent++;
+
+ // ??? In a real implementation, this would choose a child based
+ // ??? on the projected screen areas.
+ if (getNumChildren() > 0)
+ getChild(0)->traverse(state);
+
+ indent--;
+}
+
+void
+QvSeparator::traverse(QvState *state)
+{
+ ANNOUNCE(QvSeparator);
+ state->push();
+ indent++;
+ for (int i = 0; i < getNumChildren(); i++)
+ getChild(i)->traverse(state);
+ indent--;
+ state->pop();
+}
+
+void
+QvSwitch::traverse(QvState *state)
+{
+ ANNOUNCE(QvSwitch);
+ indent++;
+
+ int which = whichChild.value;
+
+ if (which == QV_SWITCH_NONE)
+ ;
+
+ else if (which == QV_SWITCH_ALL)
+ for (int i = 0; i < getNumChildren(); i++)
+ getChild(i)->traverse(state);
+
+ else
+ if (which < getNumChildren())
+ getChild(which)->traverse(state);
+
+ indent--;
+}
+
+void
+QvTransformSeparator::traverse(QvState *state)
+{
+ ANNOUNCE(QvTransformSeparator);
+
+ // We need to "push" just the transformation stack. We'll
+ // accomplish this by just pushing a no-op transformation onto
+ // that stack. When we "pop", we'll restore that stack to its
+ // previous state.
+
+ QvElement *markerElt = new QvElement;
+ markerElt->data = this;
+ markerElt->type = QvElement::NoOpTransform;
+ state->addElement(QvState::TransformationIndex, markerElt);
+
+ indent++;
+ for (int i = 0; i < getNumChildren(); i++)
+ getChild(i)->traverse(state);
+ indent--;
+
+ // Now do the "pop"
+ while (state->getTopElement(QvState::TransformationIndex) != markerElt)
+ state->popElement(QvState::TransformationIndex);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// Properties.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#define DO_PROPERTY(className, stackIndex) \
+void \
+className::traverse(QvState *state) \
+{ \
+ ANNOUNCE(className); \
+ QvElement *elt = new QvElement; \
+ elt->data = this; \
+ state->addElement(QvState::stackIndex, elt); \
+}
+
+#define DO_TYPED_PROPERTY(className, stackIndex, eltType) \
+void \
+className::traverse(QvState *state) \
+{ \
+ ANNOUNCE(className); \
+ QvElement *elt = new QvElement; \
+ elt->data = this; \
+ elt->type = QvElement::eltType; \
+ state->addElement(QvState::stackIndex, elt); \
+}
+
+
+void QvCoordinate3::traverse(QvState *state)
+{
+ ANNOUNCE(QvCoordinate3);
+ QvElement *elt = new QvElement;
+ elt->data = this;
+ state->addElement(QvState::Coordinate3Index, elt);
+
+//[MSH_START]
+/*
+ for ( int i = 0; i < point.num; i++ )
+ printf( "point[%d]=%f %f %f\n", i, point.values[ i*3 ], point.values[ i*3 + 1 ], point.values[ i*3 + 2 ] );
+*/
+//[MSH_END]
+
+ printf( "---------------------------------------\n" );
+}
+//DO_PROPERTY(QvCoordinate3, Coordinate3Index)
+//--------------------------------------------
+
+DO_PROPERTY(QvMaterial, MaterialIndex)
+DO_PROPERTY(QvMaterialBinding, MaterialBindingIndex)
+DO_PROPERTY(QvNormal, NormalIndex)
+DO_PROPERTY(QvNormalBinding, NormalBindingIndex)
+DO_PROPERTY(QvShapeHints, ShapeHintsIndex)
+DO_PROPERTY(QvTextureCoordinate2, TextureCoordinate2Index)
+DO_PROPERTY(QvTexture2, Texture2Index)
+DO_PROPERTY(QvTexture2Transform, Texture2TransformationIndex)
+
+DO_TYPED_PROPERTY(QvDirectionalLight, LightIndex, DirectionalLight)
+DO_TYPED_PROPERTY(QvPointLight, LightIndex, PointLight)
+DO_TYPED_PROPERTY(QvSpotLight, LightIndex, SpotLight)
+
+DO_TYPED_PROPERTY(QvOrthographicCamera, CameraIndex, OrthographicCamera)
+DO_TYPED_PROPERTY(QvPerspectiveCamera, CameraIndex, PerspectiveCamera)
+
+DO_TYPED_PROPERTY(QvTransform, TransformationIndex, Transform)
+DO_TYPED_PROPERTY(QvRotation, TransformationIndex, Rotation)
+DO_TYPED_PROPERTY(QvMatrixTransform, TransformationIndex, MatrixTransform)
+DO_TYPED_PROPERTY(QvTranslation, TransformationIndex, Translation)
+DO_TYPED_PROPERTY(QvScale, TransformationIndex, Scale)
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// Shapes.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+static void
+printProperties(QvState *state)
+{
+ printf("--------------------------------------------------------------\n");
+ state->print();
+ printf("--------------------------------------------------------------\n");
+}
+
+#define DO_SHAPE(className) \
+void \
+className::traverse(QvState *state) \
+{ \
+ ANNOUNCE(className); \
+ printProperties(state); \
+}
+
+//[MSH_START]
+/*
+void QvCone::traverse(QvState *state)
+{
+ ANNOUNCE(QvCone);
+ printf( "\tbottomRadius=%f\n", bottomRadius.value );
+ printf( "\theight=%f\n", height.value );
+ printf( "\tparts=%d\n", parts.value );
+ printf( "---------------------------------------\n" );
+ printProperties(state);
+}
+*/
+//[MSH_END]
+
+
+
+//[MSH_START]
+
+//DO_SHAPE(QvSphere)
+//DO_SHAPE(QvCone)
+//DO_SHAPE(QvCube)
+//DO_SHAPE(QvCylinder)
+
+#include "BspObjectList.h"
+#include "BRep.h"
+
+void QvSphere::traverse(QvState *state)
+{
+ ANNOUNCE(QvSphere);
+ BSPLIB_NAMESPACE::BRep brep( state );
+ brep.BuildFromSpherePrimitive( *this );
+}
+
+void QvCone::traverse(QvState *state)
+{
+ ANNOUNCE(QvCone);
+ BSPLIB_NAMESPACE::BRep brep( state );
+ brep.BuildFromConePrimitive( *this );
+}
+
+void QvCube::traverse(QvState *state)
+{
+ ANNOUNCE(QvCube);
+ BSPLIB_NAMESPACE::BRep brep( state );
+ brep.BuildFromCubePrimitive( *this );
+}
+
+
+void QvCylinder::traverse(QvState *state)
+{
+ ANNOUNCE(QvCylinder);
+ BSPLIB_NAMESPACE::BRep brep( state );
+ brep.BuildFromCylinderPrimitive( *this );
+}
+
+void QvIndexedFaceSet::traverse(QvState *state)
+{
+ ANNOUNCE(QvIndexedFaceSet);
+/*
+ for ( int i = 0; i < coordIndex.num; i++ )
+ printf( "coordIndex[%d]=%d\n", i, coordIndex.values[ i ] );
+ printf( "---------------------------------------\n" );
+*/
+ // build b-rep out of this indexed face set and current state
+ BSPLIB_NAMESPACE::BRep brep( state );
+ brep.BuildFromIndexedFaceSet( *this );
+}
+//[MSH_END]
+
+//DO_SHAPE(QvIndexedFaceSet)
+//--------------------------------------------
+
+DO_SHAPE(QvIndexedLineSet)
+DO_SHAPE(QvPointSet)
+
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// WWW-specific nodes.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+// ???
+DEFAULT_TRAVERSE(QvWWWAnchor)
+DEFAULT_TRAVERSE(QvWWWInline)
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// Default traversal methods. These nodes have no effects during traversal.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+DEFAULT_TRAVERSE(QvInfo)
+DEFAULT_TRAVERSE(QvUnknownNode)
+
+//////////////////////////////////////////////////////////////////////////////
+
+#undef ANNOUNCE
+#undef DEFAULT_TRAVERSE
+#undef DO_PROPERTY
+#undef DO_SHAPE
+#undef DO_TYPED_PROPERTY
diff --git a/tool_src/QvLib/QvTraverse.p b/tool_src/QvLib/QvTraverse.p
new file mode 100644
index 0000000..15aa9ae
--- /dev/null
+++ b/tool_src/QvLib/QvTraverse.p
@@ -0,0 +1,15927 @@
+# 1 "QvTraverse.cpp"
+# 1 "QvElement.h" 1
+
+
+
+# 1 "QvBasic.h" 1
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/types.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/cdefs.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 121 "/usr/include/sys/cdefs.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 67 "/usr/include/sys/types.h" 2 3 4
+
+
+
+# 1 "/usr/include/machine/types.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/ppc/types.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef signed char int8_t;
+typedef unsigned char u_int8_t;
+typedef short int16_t;
+typedef unsigned short u_int16_t;
+typedef int int32_t;
+typedef unsigned int u_int32_t;
+typedef long long int64_t;
+typedef unsigned long long u_int64_t;
+
+typedef int32_t register_t;
+
+
+typedef int *intptr_t;
+typedef unsigned long *uintptr_t;
+
+
+
+# 30 "/usr/include/machine/types.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 70 "/usr/include/sys/types.h" 2 3 4
+
+
+# 1 "/usr/include/machine/ansi.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/ppc/ansi.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 34 "/usr/include/machine/ansi.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 72 "/usr/include/sys/types.h" 2 3 4
+
+# 1 "/usr/include/machine/endian.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/ppc/endian.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+unsigned long htonl (unsigned long) ;
+unsigned short htons (unsigned short) ;
+unsigned long ntohl (unsigned long) ;
+unsigned short ntohs (unsigned short) ;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 116 "/usr/include/ppc/endian.h" 3 4
+
+
+
+# 30 "/usr/include/machine/endian.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 73 "/usr/include/sys/types.h" 2 3 4
+
+
+
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+typedef unsigned short ushort;
+typedef unsigned int uint;
+
+
+typedef u_int64_t u_quad_t;
+typedef int64_t quad_t;
+typedef quad_t * qaddr_t;
+
+typedef char * caddr_t;
+typedef int32_t daddr_t;
+typedef int32_t dev_t;
+typedef u_int32_t fixpt_t;
+typedef u_int32_t gid_t;
+typedef u_int32_t ino_t;
+typedef long key_t;
+typedef u_int16_t mode_t;
+typedef u_int16_t nlink_t;
+typedef quad_t off_t;
+typedef int32_t pid_t;
+typedef quad_t rlim_t;
+typedef int32_t segsz_t;
+typedef int32_t swblk_t;
+typedef u_int32_t uid_t;
+
+
+
+
+
+
+
+
+
+
+
+typedef unsigned long clock_t;
+
+
+
+
+typedef long unsigned int size_t;
+
+
+
+
+typedef int ssize_t;
+
+
+
+
+typedef long time_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int32_t fd_mask;
+
+
+
+
+
+
+typedef struct fd_set {
+ fd_mask fds_bits[((( 256 ) + (( (sizeof(fd_mask) * 8 ) ) - 1)) / ( (sizeof(fd_mask) * 8 ) )) ];
+} fd_set;
+
+
+
+
+
+
+
+# 174 "/usr/include/sys/types.h" 3 4
+
+
+
+
+
+struct _pthread_handler_rec
+{
+ void (*routine)(void *);
+ void *arg;
+ struct _pthread_handler_rec *next;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct _opaque_pthread_t { long sig; struct _pthread_handler_rec *cleanup_stack; char opaque[596 ];} *pthread_t;
+
+typedef struct _opaque_pthread_attr_t { long sig; char opaque[36 ]; } pthread_attr_t;
+
+typedef struct _opaque_pthread_mutexattr_t { long sig; char opaque[8 ]; } pthread_mutexattr_t;
+
+typedef struct _opaque_pthread_mutex_t { long sig; char opaque[40 ]; } pthread_mutex_t;
+
+typedef struct _opaque_pthread_condattr_t { long sig; char opaque[4 ]; } pthread_condattr_t;
+
+typedef struct _opaque_pthread_cond_t { long sig; char opaque[24 ]; } pthread_cond_t;
+
+typedef struct { long sig; char opaque[4 ]; } pthread_once_t;
+
+
+
+typedef unsigned long pthread_key_t;
+
+
+# 10 "QvBasic.h" 2
+
+
+# 1 "/usr/include/libc.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/stdio.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef off_t fpos_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct __sbuf {
+ unsigned char *_base;
+ int _size;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct __sFILE {
+ unsigned char *_p;
+ int _r;
+ int _w;
+ short _flags;
+ short _file;
+ struct __sbuf _bf;
+ int _lbfsize;
+
+
+ void *_cookie;
+ int (*_close) (void *) ;
+ int (*_read) (void *, char *, int) ;
+ fpos_t (*_seek) (void *, fpos_t, int) ;
+ int (*_write) (void *, const char *, int) ;
+
+
+ struct __sbuf _ub;
+ unsigned char *_up;
+ int _ur;
+
+
+ unsigned char _ubuf[3];
+ unsigned char _nbuf[1];
+
+
+ struct __sbuf _lb;
+
+
+ int _blksize;
+ fpos_t _offset;
+} FILE;
+
+extern "C" {
+extern FILE __sF[];
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+void clearerr (FILE *) ;
+int fclose (FILE *) ;
+int feof (FILE *) ;
+int ferror (FILE *) ;
+int fflush (FILE *) ;
+int fgetc (FILE *) ;
+int fgetpos (FILE *, fpos_t *) ;
+char *fgets (char *, size_t, FILE *) ;
+FILE *fopen (const char *, const char *) ;
+int fprintf (FILE *, const char *, ...) ;
+int fputc (int, FILE *) ;
+int fputs (const char *, FILE *) ;
+size_t fread (void *, size_t, size_t, FILE *) ;
+FILE *freopen (const char *, const char *, FILE *) ;
+int fscanf (FILE *, const char *, ...) ;
+int fseek (FILE *, long, int) ;
+int fsetpos (FILE *, const fpos_t *) ;
+long ftell (FILE *) ;
+size_t fwrite (const void *, size_t, size_t, FILE *) ;
+int getc (FILE *) ;
+int getchar (void) ;
+char *gets (char *) ;
+
+extern int sys_nerr;
+extern const char * const sys_errlist[];
+
+void perror (const char *) ;
+int printf (const char *, ...) ;
+int putc (int, FILE *) ;
+int putchar (int) ;
+int puts (const char *) ;
+int remove (const char *) ;
+int rename (const char *, const char *) ;
+void rewind (FILE *) ;
+int scanf (const char *, ...) ;
+void setbuf (FILE *, char *) ;
+int setvbuf (FILE *, char *, int, size_t) ;
+int sprintf (char *, const char *, ...) ;
+int sscanf (const char *, const char *, ...) ;
+FILE *tmpfile (void) ;
+char *tmpnam (char *) ;
+int ungetc (int, FILE *) ;
+int vfprintf (FILE *, const char *, char * ) ;
+int vprintf (const char *, char * ) ;
+int vsprintf (char *, const char *, char * ) ;
+}
+
+
+
+
+
+
+
+
+extern "C" {
+char *ctermid (char *) ;
+FILE *fdopen (int, const char *) ;
+int fileno (FILE *) ;
+}
+
+
+
+
+
+
+extern "C" {
+char *fgetln (FILE *, size_t *) ;
+int fpurge (FILE *) ;
+int fseeko (FILE *, fpos_t, int) ;
+fpos_t ftello (FILE *) ;
+int getw (FILE *) ;
+int pclose (FILE *) ;
+FILE *popen (const char *, const char *) ;
+int putw (int, FILE *) ;
+void setbuffer (FILE *, char *, int) ;
+int setlinebuf (FILE *) ;
+char *tempnam (const char *, const char *) ;
+int snprintf (char *, size_t, const char *, ...) ;
+int vsnprintf (char *, size_t, const char *, char * ) ;
+int vscanf (const char *, char * ) ;
+int vsscanf (const char *, const char *, char * ) ;
+FILE *zopen (const char *, const char *, int) ;
+}
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+FILE *funopen (const void *,
+ int (*)(void *, char *, int),
+ int (*)(void *, const char *, int),
+ fpos_t (*)(void *, fpos_t, int),
+ int (*)(void *)) ;
+}
+
+
+
+
+
+
+
+extern "C" {
+int __srget (FILE *) ;
+int __svfscanf (FILE *, const char *, char * ) ;
+int __swbuf (int, FILE *) ;
+}
+
+
+
+
+
+
+
+static inline int __sputc(int _c, FILE *_p) {
+ if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
+ return (*_p->_p++ = _c);
+ else
+ return (__swbuf(_c, _p));
+}
+# 379 "/usr/include/stdio.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 29 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/standards.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 30 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/unistd.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/unistd.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 72 "/usr/include/unistd.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+ void
+ _exit (int) ;
+int access (const char *, int) ;
+unsigned int alarm (unsigned int) ;
+int chdir (const char *) ;
+int chown (const char *, uid_t, gid_t) ;
+int close (int) ;
+size_t confstr (int, char *, size_t) ;
+int dup (int) ;
+int dup2 (int, int) ;
+int execl (const char *, const char *, ...) ;
+int execle (const char *, const char *, ...) ;
+int execlp (const char *, const char *, ...) ;
+int execv (const char *, char * const *) ;
+int execve (const char *, char * const *, char * const *) ;
+int execvp (const char *, char * const *) ;
+pid_t fork (void) ;
+long fpathconf (int, int) ;
+char *getcwd (char *, size_t) ;
+gid_t getegid (void) ;
+uid_t geteuid (void) ;
+gid_t getgid (void) ;
+int getgroups (int, gid_t []) ;
+char *getlogin (void) ;
+pid_t getpgrp (void) ;
+pid_t getpid (void) ;
+pid_t getppid (void) ;
+uid_t getuid (void) ;
+int isatty (int) ;
+int link (const char *, const char *) ;
+off_t lseek (int, off_t, int) ;
+long pathconf (const char *, int) ;
+int pause (void) ;
+int pipe (int *) ;
+ssize_t read (int, void *, size_t) ;
+int rmdir (const char *) ;
+int setgid (gid_t) ;
+int setpgid (pid_t, pid_t) ;
+pid_t setsid (void) ;
+int setuid (uid_t) ;
+unsigned int sleep (unsigned int) ;
+long sysconf (int) ;
+pid_t tcgetpgrp (int) ;
+int tcsetpgrp (int, pid_t) ;
+char *ttyname (int) ;
+int unlink (const char *) ;
+ssize_t write (int, const void *, size_t) ;
+
+extern char *optarg;
+extern int optind, opterr, optopt, optreset;
+int getopt (int, char * const [], const char *) ;
+
+
+
+struct timeval;
+
+int acct (const char *) ;
+int async_daemon (void) ;
+char *brk (const char *) ;
+int chroot (const char *) ;
+char *crypt (const char *, const char *) ;
+int des_cipher (const char *, char *, long, int) ;
+int des_setkey (const char *key) ;
+int encrypt (char *, int) ;
+void endusershell (void) ;
+int exect (const char *, char * const *, char * const *) ;
+int fchdir (int) ;
+int fchown (int, int, int) ;
+int fsync (int) ;
+int ftruncate (int, off_t) ;
+int getdtablesize (void) ;
+int getgrouplist (const char *, int, int *, int *) ;
+long gethostid (void) ;
+int gethostname (char *, int) ;
+mode_t getmode (const void *, mode_t) ;
+ int
+ getpagesize (void) ;
+char *getpass (const char *) ;
+char *getusershell (void) ;
+char *getwd (char *) ;
+int initgroups (const char *, int) ;
+int iruserok (unsigned long, int, const char *, const char *) ;
+int mknod (const char *, mode_t, dev_t) ;
+int mkstemp (char *) ;
+char *mktemp (char *) ;
+int nfssvc (int, void *) ;
+int nice (int) ;
+
+
+
+
+# 1 "/usr/include/signal.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/signal.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/machine/signal.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/ppc/signal.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int sig_atomic_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef enum {
+ REGS_SAVED_NONE,
+ REGS_SAVED_CALLER,
+
+
+ REGS_SAVED_ALL
+} regs_saved_t;
+
+
+
+
+
+
+
+
+
+struct sigcontext {
+ int sc_onstack;
+ int sc_mask;
+ int sc_ir;
+ int sc_psw;
+ int sc_sp;
+ void *sc_regs;
+};
+
+
+
+# 27 "/usr/include/machine/signal.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 70 "/usr/include/sys/signal.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef unsigned int sigset_t;
+
+
+
+
+struct sigaction {
+
+ void (*sa_handler)(int);
+
+
+
+ sigset_t sa_mask;
+ int sa_flags;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef void (*sig_t) (int) ;
+
+
+
+
+struct sigaltstack {
+ char *ss_sp;
+ int ss_size;
+ int ss_flags;
+};
+
+
+
+
+
+
+
+struct sigvec {
+ void (*sv_handler)();
+ int sv_mask;
+ int sv_flags;
+};
+
+
+
+
+
+
+
+
+struct sigstack {
+ char *ss_sp;
+ int ss_onstack;
+};
+
+
+
+
+
+
+
+# 213 "/usr/include/sys/signal.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+void (*signal (int, void (*) (int) ) ) (int) ;
+}
+
+# 62 "/usr/include/signal.h" 2 3 4
+
+
+
+extern const char * const sys_signame[32 ];
+extern const char * const sys_siglist[32 ];
+
+
+extern "C" {
+int raise (int) ;
+
+int kill (pid_t, int) ;
+int sigaction (int, const struct sigaction *, struct sigaction *) ;
+int sigaddset (sigset_t *, int) ;
+int sigdelset (sigset_t *, int) ;
+int sigemptyset (sigset_t *) ;
+int sigfillset (sigset_t *) ;
+int sigismember (const sigset_t *, int) ;
+int sigpending (sigset_t *) ;
+int sigprocmask (int, const sigset_t *, sigset_t *) ;
+int sigsuspend (const sigset_t *) ;
+
+int killpg (pid_t, int) ;
+int sigblock (int) ;
+int siginterrupt (int, int) ;
+int sigpause (int) ;
+int sigreturn (struct sigcontext *) ;
+int sigsetmask (int) ;
+int sigvec (int, struct sigvec *, struct sigvec *) ;
+void psignal (unsigned int, const char *) ;
+
+
+}
+
+
+
+
+
+
+
+
+
+# 176 "/usr/include/unistd.h" 2 3 4
+
+
+int profil (char *, int, int, int) ;
+int rcmd (char **, int, const char *,
+ const char *, const char *, int *) ;
+char *re_comp (const char *) ;
+int re_exec (const char *) ;
+int readlink (const char *, char *, int) ;
+int reboot (int) ;
+int revoke (const char *) ;
+int rresvport (int *) ;
+int ruserok (const char *, int, const char *, const char *) ;
+char *sbrk (int) ;
+int select (int, fd_set *, fd_set *, fd_set *, struct timeval *) ;
+int setegid (gid_t) ;
+int seteuid (uid_t) ;
+int setgroups (int, const gid_t *) ;
+void sethostid (long) ;
+int sethostname (const char *, int) ;
+int setkey (const char *) ;
+int setlogin (const char *) ;
+void *setmode (const char *) ;
+int setpgrp (pid_t pid, pid_t pgrp) ;
+int setregid (gid_t, gid_t) ;
+int setreuid (uid_t, uid_t) ;
+int setrgid (gid_t) ;
+int setruid (uid_t) ;
+void setusershell (void) ;
+int swapon (const char *) ;
+int symlink (const char *, const char *) ;
+void sync (void) ;
+int syscall (int, ...) ;
+int truncate (const char *, off_t) ;
+int ttyslot (void) ;
+unsigned int ualarm (unsigned int, unsigned int) ;
+int unwhiteout (const char *) ;
+void usleep (unsigned int) ;
+void *valloc (size_t) ;
+pid_t vfork (void) ;
+
+extern char *suboptarg;
+int getsubopt (char **, char * const *, char **) ;
+
+
+int getattrlist (const char*,void*,void*,size_t,unsigned long) ;
+int setattrlist (const char*,void*,void*,size_t,unsigned long) ;
+int exchangedata (const char*,const char*,unsigned long) ;
+int checkuseraccess (const char*,uid_t,gid_t*,int,int,unsigned long) ;
+int getdirentriesattr (int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long) ;
+int searchfs (const char*,void*,void*,unsigned long,unsigned long,void*) ;
+
+int fsctl (const char *,unsigned long,void*,unsigned long) ;
+
+
+
+}
+
+
+# 31 "/usr/include/libc.h" 2 3 4
+
+
+
+
+
+
+# 1 "/usr/include/string.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+void *memchr (const void *, int, size_t) ;
+int memcmp (const void *, const void *, size_t) ;
+void *memcpy (void *, const void *, size_t) ;
+void *memmove (void *, const void *, size_t) ;
+void *memset (void *, int, size_t) ;
+char *strcat (char *, const char *) ;
+char *strchr (const char *, int) ;
+int strcmp (const char *, const char *) ;
+int strcoll (const char *, const char *) ;
+char *strcpy (char *, const char *) ;
+size_t strcspn (const char *, const char *) ;
+char *strerror (int) ;
+size_t strlen (const char *) ;
+char *strncat (char *, const char *, size_t) ;
+int strncmp (const char *, const char *, size_t) ;
+char *strncpy (char *, const char *, size_t) ;
+char *strpbrk (const char *, const char *) ;
+char *strrchr (const char *, int) ;
+size_t strspn (const char *, const char *) ;
+char *strstr (const char *, const char *) ;
+char *strtok (char *, const char *) ;
+size_t strxfrm (char *, const char *, size_t) ;
+
+
+
+int bcmp (const void *, const void *, size_t) ;
+void bcopy (const void *, void *, size_t) ;
+void bzero (void *, size_t) ;
+int ffs (int) ;
+char *index (const char *, int) ;
+void *memccpy (void *, const void *, int, size_t) ;
+char *rindex (const char *, int) ;
+int strcasecmp (const char *, const char *) ;
+char *strdup (const char *) ;
+void strmode (int, char *) ;
+int strncasecmp (const char *, const char *, size_t) ;
+char *strsep (char **, const char *) ;
+void swab (const void *, void *, size_t) ;
+
+}
+
+
+# 37 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/stdlib.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef __wchar_t rune_t;
+
+typedef __wchar_t wchar_t;
+
+
+typedef struct {
+ int quot;
+ int rem;
+} div_t;
+
+typedef struct {
+ long quot;
+ long rem;
+} ldiv_t;
+
+
+
+
+
+
+
+
+
+
+extern int __mb_cur_max;
+
+
+
+
+extern "C" {
+ void
+ abort (void) ;
+ int
+ abs (int) ;
+int atexit (void (*)(void)) ;
+double atof (const char *) ;
+int atoi (const char *) ;
+long atol (const char *) ;
+void *bsearch (const void *, const void *, size_t,
+ size_t, int (*)(const void *, const void *)) ;
+void *calloc (size_t, size_t) ;
+ div_t
+ div (int, int) ;
+ void
+ exit (int) ;
+void free (void *) ;
+char *getenv (const char *) ;
+ long
+ labs (long) ;
+ ldiv_t
+ ldiv (long, long) ;
+void *malloc (size_t) ;
+void qsort (void *, size_t, size_t,
+ int (*)(const void *, const void *)) ;
+int rand (void) ;
+void *realloc (void *, size_t) ;
+void srand (unsigned) ;
+double strtod (const char *, char **) ;
+long strtol (const char *, char **, int) ;
+unsigned long
+ strtoul (const char *, char **, int) ;
+int system (const char *) ;
+
+
+int mblen (const char *, size_t) ;
+size_t mbstowcs (wchar_t *, const char *, size_t) ;
+int wctomb (char *, wchar_t) ;
+int mbtowc (wchar_t *, const char *, size_t) ;
+size_t wcstombs (char *, const wchar_t *, size_t) ;
+
+
+int putenv (const char *) ;
+int setenv (const char *, const char *, int) ;
+
+
+
+void *alloca (size_t) ;
+
+char *getbsize (int *, long *) ;
+char *cgetcap (char *, char *, int) ;
+int cgetclose (void) ;
+int cgetent (char **, char **, char *) ;
+int cgetfirst (char **, char **) ;
+int cgetmatch (char *, char *) ;
+int cgetnext (char **, char **) ;
+int cgetnum (char *, char *, long *) ;
+int cgetset (char *) ;
+int cgetstr (char *, char *, char **) ;
+int cgetustr (char *, char *, char **) ;
+
+int daemon (int, int) ;
+char *devname (int, int) ;
+int getloadavg (double [], int) ;
+
+char *group_from_gid (unsigned long, int) ;
+int heapsort (void *, size_t, size_t,
+ int (*)(const void *, const void *)) ;
+char *initstate (unsigned long, char *, long) ;
+int mergesort (void *, size_t, size_t,
+ int (*)(const void *, const void *)) ;
+int radixsort (const unsigned char **, int, const unsigned char *,
+ unsigned) ;
+int sradixsort (const unsigned char **, int, const unsigned char *,
+ unsigned) ;
+long random (void) ;
+char *realpath (const char *, char resolved_path[]) ;
+char *setstate (char *) ;
+void srandom (unsigned long) ;
+char *user_from_uid (unsigned long, int) ;
+
+long long
+ strtoq (const char *, char **, int) ;
+unsigned long long
+ strtouq (const char *, char **, int) ;
+
+void unsetenv (const char *) ;
+
+}
+
+
+# 38 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/time.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct tm {
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_mon;
+ int tm_year;
+ int tm_wday;
+ int tm_yday;
+ int tm_isdst;
+ long tm_gmtoff;
+ char *tm_zone;
+};
+
+# 1 "/usr/include/gcc/darwin/2.95.2/g++/../machine/limits.h" 1 3
+
+
+# 1 "/usr/include/ppc/limits.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 3 "/usr/include/gcc/darwin/2.95.2/g++/../machine/limits.h" 2 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 100 "/usr/include/time.h" 2 3 4
+
+
+
+
+
+
+extern "C" {
+char *asctime (const struct tm *) ;
+clock_t clock (void) ;
+char *ctime (const time_t *) ;
+double difftime (time_t, time_t) ;
+struct tm *gmtime (const time_t *) ;
+struct tm *localtime (const time_t *) ;
+time_t mktime (struct tm *) ;
+size_t strftime (char *, size_t, const char *, const struct tm *) ;
+time_t time (time_t *) ;
+
+
+void tzset (void) ;
+
+
+
+char *timezone (int, int) ;
+void tzsetwall (void) ;
+
+}
+
+
+# 39 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/gcc/darwin/2.95.2/g++/../stdarg.h" 1 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/gcc/darwin/2.95.2/g++/../va-ppc.h" 1 3
+
+
+
+
+
+
+
+
+typedef char *__gnuc_va_list;
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 43 "/usr/include/gcc/darwin/2.95.2/g++/../va-ppc.h" 3
+
+
+
+void va_end (__gnuc_va_list);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 352 "/usr/include/gcc/darwin/2.95.2/g++/../va-ppc.h" 3
+
+# 42 "/usr/include/gcc/darwin/2.95.2/g++/../stdarg.h" 2 3
+
+# 131 "/usr/include/gcc/darwin/2.95.2/g++/../stdarg.h" 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 175 "/usr/include/gcc/darwin/2.95.2/g++/../stdarg.h" 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef __gnuc_va_list va_list;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 40 "/usr/include/libc.h" 2 3 4
+
+
+
+# 1 "/usr/include/sys/mount.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/ucred.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/param.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/syslimits.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 88 "/usr/include/sys/param.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/machine/param.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/ppc/param.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 30 "/usr/include/machine/param.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 102 "/usr/include/sys/param.h" 2 3 4
+
+# 1 "/usr/include/gcc/darwin/2.95.2/g++/../machine/limits.h" 1 3
+# 10 "/usr/include/gcc/darwin/2.95.2/g++/../machine/limits.h" 3
+
+# 108 "/usr/include/gcc/darwin/2.95.2/g++/../machine/limits.h" 3
+
+# 103 "/usr/include/sys/param.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 61 "/usr/include/sys/ucred.h" 2 3 4
+
+
+
+
+
+struct ucred {
+ u_long cr_ref;
+ uid_t cr_uid;
+ short cr_ngroups;
+ gid_t cr_groups[16 ];
+};
+
+
+
+
+# 88 "/usr/include/sys/ucred.h" 3 4
+
+
+
+# 62 "/usr/include/sys/mount.h" 2 3 4
+
+
+# 1 "/usr/include/sys/queue.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 184 "/usr/include/sys/queue.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 260 "/usr/include/sys/queue.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 378 "/usr/include/sys/queue.h" 3 4
+
+
+
+
+
+
+
+
+
+# 395 "/usr/include/sys/queue.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 453 "/usr/include/sys/queue.h" 3 4
+
+
+# 463 "/usr/include/sys/queue.h" 3 4
+
+
+# 473 "/usr/include/sys/queue.h" 3 4
+
+
+# 483 "/usr/include/sys/queue.h" 3 4
+
+
+
+
+
+
+
+
+# 502 "/usr/include/sys/queue.h" 3 4
+
+# 548 "/usr/include/sys/queue.h" 3 4
+
+
+
+# 64 "/usr/include/sys/mount.h" 2 3 4
+
+# 1 "/usr/include/sys/lock.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 74 "/usr/include/sys/lock.h" 3 4
+
+
+
+
+
+# 1 "/usr/include/mach/boolean.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/mach/machine/boolean.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/mach/ppc/boolean.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int boolean_t;
+
+
+# 27 "/usr/include/mach/machine/boolean.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 127 "/usr/include/mach/boolean.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 79 "/usr/include/sys/lock.h" 2 3 4
+
+
+
+struct slock{
+ volatile unsigned int lock_data[10];
+};
+
+
+
+
+
+typedef struct slock simple_lock_data_t;
+typedef struct slock *simple_lock_t;
+
+
+
+
+
+
+
+
+
+
+
+struct lock__bsd__ {
+ simple_lock_data_t
+ lk_interlock;
+ u_int lk_flags;
+ int lk_sharecount;
+ int lk_waitcount;
+ short lk_exclusivecount;
+ short lk_prio;
+ char *lk_wmesg;
+ int lk_timo;
+ pid_t lk_lockholder;
+ void *lk_lockthread;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct proc;
+
+void lockinit (struct lock__bsd__ *, int prio, char *wmesg, int timo,
+ int flags) ;
+int lockmgr (struct lock__bsd__ *, u_int flags,
+ simple_lock_t, struct proc *p) ;
+int lockstatus (struct lock__bsd__ *) ;
+
+
+# 65 "/usr/include/sys/mount.h" 2 3 4
+
+# 1 "/usr/include/net/radix.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct radix_node {
+ struct radix_mask *rn_mklist;
+ struct radix_node *rn_p;
+ short rn_b;
+ char rn_bmask;
+ u_char rn_flags;
+
+
+
+ union {
+ struct {
+ caddr_t rn_Key;
+ caddr_t rn_Mask;
+ struct radix_node *rn_Dupedkey;
+ } rn_leaf;
+ struct {
+ int rn_Off;
+ struct radix_node *rn_L;
+ struct radix_node *rn_R;
+ } rn_node;
+ } rn_u;
+
+
+
+
+
+};
+
+
+
+
+
+
+
+
+
+
+
+
+struct radix_mask {
+ short rm_b;
+ char rm_unused;
+ u_char rm_flags;
+ struct radix_mask *rm_mklist;
+ union {
+ caddr_t rmu_mask;
+ struct radix_node *rmu_leaf;
+ } rm_rmu;
+ int rm_refs;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int walktree_f_t (struct radix_node *, void *) ;
+
+struct radix_node_head {
+ struct radix_node *rnh_treetop;
+ int rnh_addrsize;
+ int rnh_pktsize;
+ struct radix_node *(*rnh_addaddr)
+ (void *v, void *mask,
+ struct radix_node_head *head, struct radix_node nodes[]) ;
+ struct radix_node *(*rnh_addpkt)
+ (void *v, void *mask,
+ struct radix_node_head *head, struct radix_node nodes[]) ;
+ struct radix_node *(*rnh_deladdr)
+ (void *v, void *mask, struct radix_node_head *head) ;
+ struct radix_node *(*rnh_delpkt)
+ (void *v, void *mask, struct radix_node_head *head) ;
+ struct radix_node *(*rnh_matchaddr)
+ (void *v, struct radix_node_head *head) ;
+ struct radix_node *(*rnh_lookup)
+ (void *v, void *mask, struct radix_node_head *head) ;
+ struct radix_node *(*rnh_matchpkt)
+ (void *v, struct radix_node_head *head) ;
+ int (*rnh_walktree)
+ (struct radix_node_head *head, walktree_f_t *f, void *w) ;
+ int (*rnh_walktree_from)
+ (struct radix_node_head *head, void *a, void *m,
+ walktree_f_t *f, void *w) ;
+ void (*rnh_close)
+ (struct radix_node *rn, struct radix_node_head *head) ;
+ struct radix_node rnh_nodes[3];
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+void rn_init (void) ;
+int rn_inithead (void **, int) ;
+int rn_refines (void *, void *) ;
+struct radix_node
+ *rn_addmask (void *, int, int) ,
+ *rn_addroute (void *, void *, struct radix_node_head *,
+ struct radix_node [2]) ,
+ *rn_delete (void *, void *, struct radix_node_head *) ,
+ *rn_lookup (void *v_arg, void *m_arg,
+ struct radix_node_head *head) ,
+ *rn_match (void *, struct radix_node_head *) ;
+
+
+
+# 66 "/usr/include/sys/mount.h" 2 3 4
+
+# 1 "/usr/include/sys/socket.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct linger {
+ int l_onoff;
+ int l_linger;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct sockaddr {
+ u_char sa_len;
+ u_char sa_family;
+ char sa_data[14];
+};
+
+
+
+
+
+
+struct sockproto {
+ u_short sp_family;
+ u_short sp_protocol;
+};
+
+
+
+
+
+
+
+
+
+
+
+struct sockaddr_storage {
+ u_char ss_len;
+ u_char ss_family;
+ char _ss_pad1[((sizeof(int64_t)) - sizeof(u_char) * 2) ];
+ int64_t _ss_align;
+ char _ss_pad2[(128 - sizeof(u_char) * 2 - ((sizeof(int64_t)) - sizeof(u_char) * 2) - (sizeof(int64_t)) ) ];
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 295 "/usr/include/sys/socket.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct msghdr {
+ caddr_t msg_name;
+ u_int msg_namelen;
+ struct iovec *msg_iov;
+ u_int msg_iovlen;
+ caddr_t msg_control;
+ u_int msg_controllen;
+ int msg_flags;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct cmsghdr {
+ u_int cmsg_len;
+ int cmsg_level;
+ int cmsg_type;
+
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct osockaddr {
+ u_short sa_family;
+ char sa_data[14];
+};
+
+
+
+
+struct omsghdr {
+ caddr_t msg_name;
+ int msg_namelen;
+ struct iovec *msg_iov;
+ int msg_iovlen;
+ caddr_t msg_accrights;
+ int msg_accrightslen;
+};
+
+
+
+
+
+
+
+
+# 427 "/usr/include/sys/socket.h" 3 4
+
+
+
+
+
+
+extern "C" {
+int accept (int, struct sockaddr *, int *) ;
+int bind (int, const struct sockaddr *, int) ;
+int connect (int, const struct sockaddr *, int) ;
+int getpeername (int, struct sockaddr *, int *) ;
+int getsockname (int, struct sockaddr *, int *) ;
+int getsockopt (int, int, int, void *, int *) ;
+int listen (int, int) ;
+ssize_t recv (int, void *, size_t, int) ;
+ssize_t recvfrom (int, void *, size_t, int, struct sockaddr *, int *) ;
+ssize_t recvmsg (int, struct msghdr *, int) ;
+ssize_t send (int, const void *, size_t, int) ;
+ssize_t sendto (int, const void *,
+ size_t, int, const struct sockaddr *, int) ;
+ssize_t sendmsg (int, const struct msghdr *, int) ;
+
+
+
+int setsockopt (int, int, int, const void *, int) ;
+int shutdown (int, int) ;
+int socket (int, int, int) ;
+int socketpair (int, int, int, int *) ;
+}
+
+
+
+# 67 "/usr/include/sys/mount.h" 2 3 4
+
+
+typedef struct fsid { int32_t val[2]; } fsid_t;
+
+
+
+
+
+
+
+struct fid {
+ u_short fid_len;
+ u_short fid_reserved;
+ char fid_data[16 ];
+};
+
+
+
+
+
+
+
+
+struct statfs {
+ short f_otype;
+ short f_oflags;
+ long f_bsize;
+ long f_iosize;
+ long f_blocks;
+ long f_bfree;
+ long f_bavail;
+ long f_files;
+ long f_ffree;
+ fsid_t f_fsid;
+ uid_t f_owner;
+ short f_reserved1;
+ short f_type;
+ long f_flags;
+ long f_reserved2[2];
+ char f_fstypename[15 ];
+ char f_mntonname[90 ];
+ char f_mntfromname[90 ];
+
+
+
+
+ char f_reserved3;
+ long f_reserved4[4];
+
+};
+
+
+
+
+
+
+struct vnodelst { struct vnode *lh_first; } ;
+
+struct mount {
+ struct { struct mount *cqe_next; struct mount *cqe_prev; } mnt_list;
+ struct vfsops *mnt_op;
+ struct vfsconf *mnt_vfc;
+ struct vnode *mnt_vnodecovered;
+ struct vnodelst mnt_vnodelist;
+ struct lock__bsd__ mnt_lock;
+ int mnt_flag;
+ int mnt_kern_flag;
+ int mnt_maxsymlinklen;
+ struct statfs mnt_stat;
+ qaddr_t mnt_data;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct fhandle {
+ fsid_t fh_fsid;
+ struct fid fh_fid;
+};
+typedef struct fhandle fhandle_t;
+
+
+
+
+struct export_args {
+ int ex_flags;
+ uid_t ex_root;
+ struct ucred ex_anon;
+ struct sockaddr *ex_addr;
+ int ex_addrlen;
+ struct sockaddr *ex_mask;
+ int ex_masklen;
+};
+
+
+
+
+
+
+struct vfsconf {
+ struct vfsops *vfc_vfsops;
+ char vfc_name[15 ];
+ int vfc_typenum;
+ int vfc_refcount;
+ int vfc_flags;
+ int (*vfc_mountroot)(void);
+ struct vfsconf *vfc_next;
+};
+
+# 361 "/usr/include/sys/mount.h" 3 4
+
+
+
+
+extern "C" {
+int fstatfs (int, struct statfs *) ;
+int getfh (const char *, fhandle_t *) ;
+int getfsstat (struct statfs *, long, int) ;
+int getmntinfo (struct statfs **, int) ;
+int mount (const char *, const char *, int, void *) ;
+int statfs (const char *, struct statfs *) ;
+int unmount (const char *, int) ;
+}
+
+
+
+# 43 "/usr/include/libc.h" 2 3 4
+
+
+# 1 "/usr/include/sys/wait.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+union wait {
+ int w_status;
+
+
+
+ struct {
+
+
+
+
+
+
+
+ unsigned int w_Filler:16,
+ w_Retcode:8,
+ w_Coredump:1,
+ w_Termsig:7;
+
+ } w_T;
+
+
+
+
+
+ struct {
+
+
+
+
+
+
+ unsigned int w_Filler:16,
+ w_Stopsig:8,
+ w_Stopval:8;
+
+ } w_S;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+struct rusage;
+
+pid_t wait (int *) ;
+pid_t waitpid (pid_t, int *, int) ;
+
+pid_t wait3 (int *, int, struct rusage *) ;
+pid_t wait4 (pid_t, int *, int, struct rusage *) ;
+
+}
+
+
+# 45 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/sys/time.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct timeval {
+ int32_t tv_sec;
+ int32_t tv_usec;
+};
+
+
+
+
+struct timespec {
+ time_t tv_sec;
+ int32_t tv_nsec;
+};
+
+
+
+
+
+
+
+
+
+
+struct timezone {
+ int tz_minuteswest;
+ int tz_dsttime;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 121 "/usr/include/sys/time.h" 3 4
+
+# 130 "/usr/include/sys/time.h" 3 4
+
+
+
+
+
+
+
+
+
+struct itimerval {
+ struct timeval it_interval;
+ struct timeval it_value;
+};
+
+
+
+
+struct clockinfo {
+ int hz;
+ int tick;
+ int tickadj;
+ int stathz;
+ int profhz;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+int adjtime (const struct timeval *, struct timeval *) ;
+int getitimer (int, struct itimerval *) ;
+int gettimeofday (struct timeval *, struct timezone *) ;
+int setitimer (int, const struct itimerval *, struct itimerval *) ;
+int settimeofday (const struct timeval *, const struct timezone *) ;
+int utimes (const char *, const struct timeval *) ;
+}
+
+
+
+
+
+# 46 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/sys/times.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct tms {
+ clock_t tms_utime;
+ clock_t tms_stime;
+ clock_t tms_cutime;
+ clock_t tms_cstime;
+};
+
+
+
+
+extern "C" {
+clock_t times (struct tms *) ;
+}
+
+
+# 47 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/sys/resource.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct rusage {
+ struct timeval ru_utime;
+ struct timeval ru_stime;
+ long ru_maxrss;
+
+ long ru_ixrss;
+ long ru_idrss;
+ long ru_isrss;
+ long ru_minflt;
+ long ru_majflt;
+ long ru_nswap;
+ long ru_inblock;
+ long ru_oublock;
+ long ru_msgsnd;
+ long ru_msgrcv;
+ long ru_nsignals;
+ long ru_nvcsw;
+ long ru_nivcsw;
+
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct orlimit {
+ int32_t rlim_cur;
+ int32_t rlim_max;
+};
+
+struct rlimit {
+ rlim_t rlim_cur;
+ rlim_t rlim_max;
+};
+
+
+struct loadavg {
+ fixpt_t ldavg[3];
+ long fscale;
+};
+
+
+
+
+
+
+
+extern "C" {
+int getpriority (int, int) ;
+int getrlimit (int, struct rlimit *) ;
+int getrusage (int, struct rusage *) ;
+int setpriority (int, int, int) ;
+int setrlimit (int, const struct rlimit *) ;
+}
+
+
+
+# 48 "/usr/include/libc.h" 2 3 4
+
+
+
+
+# 1 "/usr/include/sys/stat.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct ostat {
+ u_int16_t st_dev;
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+ u_int16_t st_uid;
+ u_int16_t st_gid;
+ u_int16_t st_rdev;
+ int32_t st_size;
+ struct timespec st_atimespec;
+ struct timespec st_mtimespec;
+ struct timespec st_ctimespec;
+ int32_t st_blksize;
+ int32_t st_blocks;
+ u_int32_t st_flags;
+ u_int32_t st_gen;
+};
+
+
+struct stat {
+ dev_t st_dev;
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+ uid_t st_uid;
+ gid_t st_gid;
+ dev_t st_rdev;
+
+ struct timespec st_atimespec;
+ struct timespec st_mtimespec;
+ struct timespec st_ctimespec;
+
+
+
+
+
+
+
+
+ off_t st_size;
+ int64_t st_blocks;
+ u_int32_t st_blksize;
+ u_int32_t st_flags;
+ u_int32_t st_gen;
+ int32_t st_lspare;
+ int64_t st_qspare[2];
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+int chmod (const char *, mode_t) ;
+int fstat (int, struct stat *) ;
+int mkdir (const char *, mode_t) ;
+int mkfifo (const char *, mode_t) ;
+int stat (const char *, struct stat *) ;
+mode_t umask (mode_t) ;
+
+int chflags (const char *, u_long) ;
+int fchflags (int, u_long) ;
+int fchmod (int, mode_t) ;
+int lstat (const char *, struct stat *) ;
+
+}
+
+
+# 52 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/sys/file.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/fcntl.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 131 "/usr/include/sys/fcntl.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct flock {
+ off_t l_start;
+ off_t l_len;
+ pid_t l_pid;
+ short l_type;
+ short l_whence;
+};
+
+
+
+
+
+
+struct radvisory {
+ off_t ra_offset;
+ int ra_count;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct fstore {
+ u_int32_t fst_flags;
+ int fst_posmode;
+ off_t fst_offset;
+ off_t fst_length;
+ off_t fst_bytesalloc;
+} fstore_t;
+
+
+
+typedef struct fbootstraptransfer {
+ off_t fbt_offset;
+ size_t fbt_length;
+ void *fbt_buffer;
+} fbootstraptransfer_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct log2phys {
+ u_int32_t l2p_flags;
+ off_t l2p_contigbytes;
+ off_t l2p_devoffset;
+};
+
+
+
+
+
+
+
+
+
+extern "C" {
+int open (const char *, int, ...) ;
+int creat (const char *, mode_t) ;
+int fcntl (int, int, ...) ;
+
+int flock (int, int) ;
+
+}
+
+
+
+# 61 "/usr/include/sys/file.h" 2 3 4
+
+
+
+# 112 "/usr/include/sys/file.h" 3 4
+
+
+
+# 53 "/usr/include/libc.h" 2 3 4
+
+
+# 1 "/usr/include/sys/ioctl.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/ttycom.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/ioccom.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 66 "/usr/include/sys/ttycom.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+struct winsize {
+ unsigned short ws_row;
+ unsigned short ws_col;
+ unsigned short ws_xpixel;
+ unsigned short ws_ypixel;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 66 "/usr/include/sys/ioctl.h" 2 3 4
+
+
+
+
+
+
+
+struct ttysize {
+ unsigned short ts_lines;
+ unsigned short ts_cols;
+ unsigned short ts_xxx;
+ unsigned short ts_yyy;
+};
+
+
+
+
+
+# 1 "/usr/include/sys/filio.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 84 "/usr/include/sys/ioctl.h" 2 3 4
+
+# 1 "/usr/include/sys/sockio.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 85 "/usr/include/sys/ioctl.h" 2 3 4
+
+
+
+
+
+
+extern "C" {
+int ioctl (int, unsigned long, ...) ;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 55 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/netinet/in.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct in_addr {
+ u_int32_t s_addr;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct sockaddr_in {
+ u_char sin_len;
+ u_char sin_family;
+ u_short sin_port;
+ struct in_addr sin_addr;
+ char sin_zero[8];
+};
+
+
+
+
+
+
+
+
+
+
+struct ip_opts {
+ struct in_addr ip_dst;
+ char ip_opts[40];
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct ip_mreq {
+ struct in_addr imr_multiaddr;
+ struct in_addr imr_interface;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 456 "/usr/include/netinet/in.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 499 "/usr/include/netinet/in.h" 3 4
+
+
+
+# 1 "/usr/include/netinet6/in6.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct in6_addr {
+ union {
+ u_int8_t __u6_addr8[16];
+ u_int16_t __u6_addr16[8];
+ u_int32_t __u6_addr32[4];
+ } __u6_addr;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct sockaddr_in6 {
+ u_int8_t sin6_len;
+ u_int8_t sin6_family;
+ u_int16_t sin6_port;
+ u_int32_t sin6_flowinfo;
+ struct in6_addr sin6_addr;
+ u_int32_t sin6_scope_id;
+};
+
+
+
+
+# 166 "/usr/include/netinet6/in6.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 199 "/usr/include/netinet6/in6.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 335 "/usr/include/netinet6/in6.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct route_in6 {
+ struct rtentry *ro_rt;
+ struct sockaddr_in6 ro_dst;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct ipv6_mreq {
+ struct in6_addr ipv6mr_multiaddr;
+ u_int ipv6mr_interface;
+};
+
+
+
+
+struct in6_pktinfo {
+ struct in6_addr ipi6_addr;
+ u_int ipi6_ifindex;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 530 "/usr/include/netinet6/in6.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 611 "/usr/include/netinet6/in6.h" 3 4
+
+# 640 "/usr/include/netinet6/in6.h" 3 4
+
+
+
+# 666 "/usr/include/netinet6/in6.h" 3 4
+
+
+extern "C" {
+struct cmsghdr;
+
+extern int inet6_option_space (int) ;
+extern int inet6_option_init (void *, struct cmsghdr **, int) ;
+extern int inet6_option_append (struct cmsghdr *, const u_int8_t *,
+ int, int) ;
+extern u_int8_t *inet6_option_alloc (struct cmsghdr *, int, int, int) ;
+extern int inet6_option_next (const struct cmsghdr *, u_int8_t **) ;
+extern int inet6_option_find (const struct cmsghdr *, u_int8_t **, int) ;
+
+extern size_t inet6_rthdr_space (int, int) ;
+extern struct cmsghdr *inet6_rthdr_init (void *, int) ;
+extern int inet6_rthdr_add (struct cmsghdr *, const struct in6_addr *,
+ unsigned int) ;
+extern int inet6_rthdr_lasthop (struct cmsghdr *, unsigned int) ;
+
+
+
+extern int inet6_rthdr_segments (const struct cmsghdr *) ;
+extern struct in6_addr *inet6_rthdr_getaddr (struct cmsghdr *, int) ;
+extern int inet6_rthdr_getflags (const struct cmsghdr *, int) ;
+
+extern int inet6_opt_init (void *, size_t) ;
+extern int inet6_opt_append (void *, size_t, int, u_int8_t,
+ size_t, u_int8_t, void **) ;
+extern int inet6_opt_finish (void *, size_t, int) ;
+extern int inet6_opt_set_val (void *, size_t, void *, int) ;
+
+extern int inet6_opt_next (void *, size_t, int, u_int8_t *,
+ size_t *, void **) ;
+extern int inet6_opt_find (void *, size_t, int, u_int8_t,
+ size_t *, void **) ;
+extern int inet6_opt_get_val (void *, size_t, void *, int) ;
+extern size_t inet6_rth_space (int, int) ;
+extern void *inet6_rth_init (void *, int, int, int) ;
+extern int inet6_rth_add (void *, const struct in6_addr *) ;
+extern int inet6_rth_reverse (const void *, void *) ;
+extern int inet6_rth_segments (const void *) ;
+extern struct in6_addr *inet6_rth_getaddr (const void *, int) ;
+}
+
+
+# 502 "/usr/include/netinet/in.h" 2 3 4
+
+
+
+# 514 "/usr/include/netinet/in.h" 3 4
+
+
+
+# 56 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/arpa/inet.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+unsigned long inet_addr (const char *) ;
+int inet_aton (const char *, struct in_addr *) ;
+unsigned long inet_lnaof (struct in_addr) ;
+struct in_addr inet_makeaddr (u_long , u_long) ;
+unsigned long inet_netof (struct in_addr) ;
+unsigned long inet_network (const char *) ;
+char *inet_ntoa (struct in_addr) ;
+}
+
+
+# 57 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/mach/machine/vm_types.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/mach/ppc/vm_types.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef unsigned int natural_t;
+
+
+
+
+
+
+
+
+typedef int integer_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef natural_t vm_offset_t;
+
+
+
+
+
+
+typedef natural_t vm_size_t;
+typedef unsigned long long vm_double_size_t;
+
+
+
+
+typedef unsigned int space_t;
+
+
+
+
+
+
+
+
+
+
+# 27 "/usr/include/mach/machine/vm_types.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 58 "/usr/include/libc.h" 2 3 4
+
+
+# 1 "/usr/include/mach/kern_return.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/mach/machine/kern_return.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/mach/ppc/kern_return.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int kern_return_t;
+
+
+# 27 "/usr/include/mach/machine/kern_return.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 64 "/usr/include/mach/kern_return.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 60 "/usr/include/libc.h" 2 3 4
+
+
+struct qelem {
+ struct qelem *q_forw;
+ struct qelem *q_back;
+ char *q_data;
+};
+
+extern kern_return_t map_fd(int fd, vm_offset_t offset,
+ vm_offset_t *addr, boolean_t find_space, vm_size_t numbytes);
+
+
+
+# 12 "QvBasic.h" 2
+
+
+
+
+
+
+
+
+
+
+
+typedef int QvBool;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 4 "QvElement.h" 2
+
+
+class QvNode;
+
+
+
+
+
+
+
+
+
+
+
+class QvElement {
+
+ public:
+
+ enum NodeType {
+
+ Unknown,
+
+
+ OrthographicCamera,
+ PerspectiveCamera,
+
+
+ DirectionalLight,
+ PointLight,
+ SpotLight,
+
+
+ NoOpTransform,
+ MatrixTransform,
+ Rotation,
+ Scale,
+ Transform,
+ Translation,
+
+
+ NumNodeTypes,
+ };
+
+ static const char *nodeTypeNames[NumNodeTypes];
+
+ int depth;
+ QvElement *next;
+ QvNode *data;
+ NodeType type;
+
+ QvElement();
+ virtual ~QvElement();
+
+
+ virtual void print();
+};
+
+
+# 1 "QvTraverse.cpp" 2
+
+# 1 "QvNodes.h" 1
+
+
+
+# 1 "QvCone.h" 1
+
+
+
+# 1 "QvSFBitMask.h" 1
+
+
+
+# 1 "QvSFEnum.h" 1
+
+
+
+# 1 "QvString.h" 1
+
+
+
+
+
+
+class QvString {
+ public:
+ QvString() { string = staticStorage;
+ string[0] = '\0'; }
+ QvString(const char *str) { string = staticStorage;
+ *this = str; }
+ QvString(const QvString &str) { string = staticStorage;
+ *this = str.string; }
+ ~QvString();
+ u_long hash() { return QvString::hash(string); }
+ int getLength() const { return strlen(string); }
+ void makeEmpty(QvBool freeOld = 1 );
+ const char * getString() const { return string; }
+ QvString & operator =(const char *str);
+ QvString & operator =(const QvString &str)
+ { return (*this = str.string); }
+ QvString & operator +=(const char *str);
+ int operator !() const { return (string[0] == '\0'); }
+ friend int operator ==(const QvString &str, const char *s);
+
+ friend int operator ==(const char *s, const QvString &str)
+ { return (str == s); }
+
+ friend int operator ==(const QvString &str1, const QvString &str2)
+ { return (str1 == str2.string); }
+ friend int operator !=(const QvString &str, const char *s);
+
+ friend int operator !=(const char *s, const QvString &str)
+ { return (str != s); }
+ friend int operator !=(const QvString &str1,
+ const QvString &str2)
+ { return (str1 != str2.string); }
+ static u_long hash(const char *s);
+ private:
+ char *string;
+ int storageSize;
+
+ char staticStorage[32 ];
+ void expand(int bySize);
+};
+
+class QvNameEntry {
+ public:
+ QvBool isEmpty() const { return (string[0] == '\0'); }
+ QvBool isEqual(const char *s) const
+ { return (string[0] == s[0] && ! strcmp(string, s)); }
+ private:
+ static int nameTableSize;
+ static QvNameEntry **nameTable;
+ static struct QvNameChunk *chunk;
+ const char *string;
+ u_long hashValue;
+ QvNameEntry *next;
+ static void initClass();
+ QvNameEntry(const char *s, u_long h, QvNameEntry *n)
+ { string = s; hashValue = h; next = n; }
+ static const QvNameEntry * insert(const char *s);
+
+friend class QvName;
+};
+
+class QvName {
+ public:
+ QvName();
+ QvName(const char *s) { entry = QvNameEntry::insert(s); }
+ QvName(const QvString &s) { entry = QvNameEntry::insert(s.getString()); }
+
+ QvName(const QvName &n) { entry = n.entry; }
+ ~QvName() {}
+ const char *getString() const { return entry->string; }
+ int getLength() const { return strlen(entry->string); }
+ static QvBool isIdentStartChar(char c);
+ static QvBool isIdentChar(char c);
+ static QvBool isNodeNameStartChar(char c);
+ static QvBool isNodeNameChar(char c);
+ int operator !() const { return entry->isEmpty(); }
+ friend int operator ==(const QvName &n, const char *s)
+ { return n.entry->isEqual(s); }
+ friend int operator ==(const char *s, const QvName &n)
+ { return n.entry->isEqual(s); }
+
+ friend int operator ==(const QvName &n1, const QvName &n2)
+ { return n1.entry == n2.entry; }
+ friend int operator !=(const QvName &n, const char *s)
+ { return ! n.entry->isEqual(s); }
+ friend int operator !=(const char *s, const QvName &n)
+ { return ! n.entry->isEqual(s); }
+
+ friend int operator !=(const QvName &n1, const QvName &n2)
+ { return n1.entry != n2.entry; }
+ private:
+ const QvNameEntry *entry;
+};
+
+
+# 4 "QvSFEnum.h" 2
+
+# 1 "QvSubField.h" 1
+
+
+
+# 1 "QvField.h" 1
+
+
+
+
+
+class QvInput;
+class QvNode;
+
+class QvField {
+ public:
+ virtual ~QvField();
+
+ void setIgnored(QvBool ig) { flags.ignored = ig; }
+ QvBool isIgnored() const { return flags.ignored; }
+
+ QvBool isDefault() const { return flags.hasDefault; }
+
+ QvNode * getContainer() const { return container; }
+
+ void setDefault(QvBool def) { flags.hasDefault = def; }
+ void setContainer(QvNode *cont);
+ QvBool read(QvInput *in, const QvName &name);
+
+ QvField() { flags.hasDefault = 1 ; flags.ignored = 0 ; }
+
+ public:
+
+ private:
+ struct {
+ unsigned int hasDefault : 1;
+ unsigned int ignored : 1;
+ } flags;
+
+ QvNode *container;
+
+ static QvField * createInstanceFromName(const QvName &className);
+ virtual QvBool readValue(QvInput *in) = 0;
+
+friend class QvFieldData;
+};
+
+class QvSField : public QvField {
+ public:
+ virtual ~QvSField();
+
+ protected:
+ QvSField();
+
+ private:
+ virtual QvBool readValue(QvInput *in) = 0;
+};
+
+class QvMField : public QvField {
+
+ public:
+ int num;
+ int maxNum;
+
+
+ virtual ~QvMField();
+
+ protected:
+ QvMField();
+ virtual void makeRoom(int newNum);
+
+ private:
+ virtual void allocValues(int num) = 0;
+ virtual QvBool readValue(QvInput *in);
+ virtual QvBool read1Value(QvInput *in, int index) = 0;
+};
+
+
+# 4 "QvSubField.h" 2
+
+# 1 "QvInput.h" 1
+
+
+
+# 1 "QvDict.h" 1
+
+
+
+
+
+# 1 "QvPList.h" 1
+
+
+
+
+
+class QvPList {
+ public:
+ QvPList();
+ ~QvPList();
+ void append(void * ptr)
+ { if (nPtrs + 1 > ptrsSize) expand(nPtrs + 1);
+ ptrs[nPtrs++] = ptr; }
+ int find(const void *ptr) const;
+ void remove(int which);
+ int getLength() const { return (int) nPtrs; }
+ void truncate(int start)
+ { nPtrs = start; }
+ void *& operator [](int i) const { return ptrs[i]; }
+
+ private:
+ void ** ptrs;
+ int nPtrs;
+ int ptrsSize;
+ void setSize(int size)
+ { if (size > ptrsSize) expand(size); nPtrs = size; }
+ void expand(int size);
+};
+
+
+# 6 "QvDict.h" 2
+
+
+class QvDictEntry {
+ private:
+ u_long key;
+ void * value;
+ QvDictEntry * next;
+ QvDictEntry(u_long k, void *v) { key = k; value = v; };
+
+friend class QvDict;
+};
+
+class QvDict {
+ public:
+ QvDict( int entries = 251 );
+ ~QvDict();
+ void clear();
+ QvBool enter(u_long key, void *value);
+ QvBool find(u_long key, void *&value) const;
+ QvBool remove(u_long key);
+
+ private:
+ int tableSize;
+ QvDictEntry * *buckets;
+ QvDictEntry *& findEntry(u_long key) const;
+};
+
+
+# 4 "QvInput.h" 2
+
+
+
+class QvNode;
+class QvDB;
+
+class QvInput {
+ public:
+
+ QvInput();
+ ~QvInput();
+
+ static float isASCIIHeader(const char *string);
+ void setFilePointer(FILE *newFP);
+ FILE * getCurFile() const { return fp; }
+ float getVersion();
+ QvBool get(char &c);
+ QvBool read(char &c);
+ QvBool read(QvString &s);
+ QvBool read(QvName &n, QvBool validIdent = 0 );
+ QvBool read(int &i);
+ QvBool read(unsigned int &i);
+ QvBool read(short &s);
+ QvBool read(unsigned short &s);
+ QvBool read(long &l);
+ QvBool read(unsigned long &l);
+ QvBool read(float &f);
+ QvBool read(double &d);
+ QvBool eof() const;
+ void getLocationString(QvString &string) const;
+ void putBack(char c);
+ void putBack(const char *string);
+ void addReference(const QvName &name, QvNode *node);
+ QvNode * findReference(const QvName &name) const;
+
+ private:
+ FILE *fp;
+ int lineNum;
+ float version;
+ QvBool readHeader;
+ QvBool headerOk;
+ QvDict refDict;
+ QvString backBuf;
+ int backBufIndex;
+
+ QvBool checkHeader();
+
+ QvBool skipWhiteSpace();
+
+ QvBool readInteger(long &l);
+ QvBool readUnsignedInteger(unsigned long &l);
+ QvBool readReal(double &d);
+ QvBool readUnsignedIntegerString(char *str);
+ int readDigits(char *string);
+ int readHexDigits(char *string);
+ int readChar(char *string, char charToRead);
+
+friend class QvNode;
+friend class QvDB;
+};
+
+
+# 5 "QvSubField.h" 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 71 "QvSubField.h"
+
+
+# 5 "QvSFEnum.h" 2
+
+
+class QvSFEnum : public QvSField {
+ public:
+ int value;
+ public: QvSFEnum (); virtual ~ QvSFEnum (); virtual QvBool readValue(QvInput *in) ;
+
+
+ void setEnums(int num, const int vals[], const QvName names[])
+ { numEnums = num; enumValues = vals; enumNames = names; }
+
+ int numEnums;
+ const int *enumValues;
+ const QvName *enumNames;
+
+
+ QvBool findEnumValue(const QvName &name, int &val) const;
+};
+
+
+# 37 "QvSFEnum.h"
+
+
+# 4 "QvSFBitMask.h" 2
+
+
+class QvSFBitMask : public QvSFEnum {
+ public:
+
+ public: QvSFBitMask (); virtual ~ QvSFBitMask (); virtual QvBool readValue(QvInput *in) ;
+};
+
+
+# 4 "QvCone.h" 2
+
+# 1 "QvSFFloat.h" 1
+
+
+
+
+
+class QvSFFloat : public QvSField {
+ public:
+ float value;
+ public: QvSFFloat (); virtual ~ QvSFFloat (); virtual QvBool readValue(QvInput *in) ;
+};
+
+
+# 5 "QvCone.h" 2
+
+# 1 "QvSubNode.h" 1
+
+
+
+# 1 "QvFieldData.h" 1
+
+
+
+
+
+
+
+class QvField;
+class QvInput;
+class QvNode;
+
+class QvFieldData {
+ public:
+ QvFieldData() {}
+ ~QvFieldData();
+
+ void addField(QvNode *defObject, const char *fieldName,
+ const QvField *field);
+
+ int getNumFields() const { return fields.getLength(); }
+
+ const QvName & getFieldName(int index) const;
+
+ QvField * getField(const QvNode *object,
+ int index) const;
+
+ void addEnumValue(const char *typeName,
+ const char *valName, int val);
+ void getEnumData(const char *typeName, int &num,
+ const int *&vals, const QvName *&names);
+
+ QvBool read(QvInput *in, QvNode *object,
+ QvBool errorOnUnknownField = 1 ) const;
+
+ QvBool read(QvInput *in, QvNode *object,
+ const QvName &fieldName,
+ QvBool &foundName) const;
+
+ QvBool readFieldTypes(QvInput *in, QvNode *object);
+
+ private:
+ QvPList fields;
+ QvPList enums;
+};
+
+
+# 4 "QvSubNode.h" 2
+
+# 1 "QvNode.h" 1
+
+
+
+
+
+class QvChildList;
+class QvDict;
+class QvFieldData;
+class QvInput;
+class QvNodeList;
+class QvState;
+
+class QvNode {
+
+ public:
+ enum Stage {
+ FIRST_INSTANCE,
+ PROTO_INSTANCE,
+ OTHER_INSTANCE,
+ };
+
+ QvFieldData *fieldData;
+ QvChildList *children;
+ QvBool isBuiltIn;
+
+ QvName *objName;
+ QvNode();
+ virtual ~QvNode();
+
+ const QvName & getName() const;
+ void setName(const QvName &name);
+
+ static void init();
+ static QvBool read(QvInput *in, QvNode *&node);
+
+ virtual QvFieldData *getFieldData() = 0;
+
+ virtual void traverse(QvState *state) = 0;
+
+ protected:
+ virtual QvBool readInstance(QvInput *in);
+
+ private:
+ static QvDict *nameDict;
+
+ static void addName(QvNode *, const char *);
+ static void removeName(QvNode *, const char *);
+ static QvNode * readReference(QvInput *in);
+ static QvBool readNode(QvInput *in, QvName &className,QvNode *&node);
+ static QvBool readNodeInstance(QvInput *in, const QvName &className,
+ const QvName &refName, QvNode *&node);
+ static QvNode * createInstance(QvInput *in, const QvName &className);
+ static QvNode * createInstanceFromName(const QvName &className);
+ static void flushInput(QvInput *in);
+};
+
+
+# 5 "QvSubNode.h" 2
+
+
+
+# 16 "QvSubNode.h"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 6 "QvCone.h" 2
+
+
+class QvCone : public QvNode {
+
+ public: QvCone :: QvCone (); virtual ~ QvCone (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ enum Part {
+ SIDES = 0x01,
+ BOTTOM = 0x02,
+ ALL = 0x03
+ };
+
+
+ QvSFBitMask parts;
+ QvSFFloat bottomRadius;
+ QvSFFloat height;
+};
+
+
+# 4 "QvNodes.h" 2
+
+# 1 "QvCoordinate3.h" 1
+
+
+
+# 1 "QvMFVec3f.h" 1
+
+
+
+
+
+class QvMFVec3f : public QvMField {
+ public:
+ float *values;
+ public: QvMFVec3f (); virtual ~ QvMFVec3f (); virtual QvBool read1Value(QvInput *in, int index); void allocValues(int newNum) ;
+};
+
+
+# 4 "QvCoordinate3.h" 2
+
+
+
+class QvCoordinate3 : public QvNode {
+
+ public: QvCoordinate3 :: QvCoordinate3 (); virtual ~ QvCoordinate3 (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvMFVec3f point;
+};
+
+
+# 5 "QvNodes.h" 2
+
+# 1 "QvCube.h" 1
+
+
+
+
+
+
+class QvCube : public QvNode {
+
+ public: QvCube :: QvCube (); virtual ~ QvCube (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFFloat width;
+ QvSFFloat height;
+ QvSFFloat depth;
+};
+
+
+# 6 "QvNodes.h" 2
+
+# 1 "QvCylinder.h" 1
+
+
+
+
+
+
+
+class QvCylinder : public QvNode {
+
+ public: QvCylinder :: QvCylinder (); virtual ~ QvCylinder (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ enum Part {
+ SIDES = 0x01,
+ TOP = 0x02,
+ BOTTOM = 0x04,
+ ALL = 0x07,
+ };
+
+
+ QvSFBitMask parts;
+ QvSFFloat radius;
+ QvSFFloat height;
+};
+
+
+# 7 "QvNodes.h" 2
+
+# 1 "QvDirectionalLight.h" 1
+
+
+
+# 1 "QvSFBool.h" 1
+
+
+
+
+
+class QvSFBool : public QvSField {
+ public:
+ QvBool value;
+ public: QvSFBool (); virtual ~ QvSFBool (); virtual QvBool readValue(QvInput *in) ;
+};
+
+
+# 4 "QvDirectionalLight.h" 2
+
+# 1 "QvSFColor.h" 1
+
+
+
+
+
+class QvSFColor : public QvSField {
+ public:
+ float value[3];
+ public: QvSFColor (); virtual ~ QvSFColor (); virtual QvBool readValue(QvInput *in) ;
+};
+
+
+# 5 "QvDirectionalLight.h" 2
+
+
+# 1 "QvSFVec3f.h" 1
+
+
+
+
+
+class QvSFVec3f : public QvSField {
+ public:
+ float value[3];
+ public: QvSFVec3f (); virtual ~ QvSFVec3f (); virtual QvBool readValue(QvInput *in) ;
+};
+
+
+# 7 "QvDirectionalLight.h" 2
+
+
+
+class QvDirectionalLight : public QvNode {
+
+ public: QvDirectionalLight :: QvDirectionalLight (); virtual ~ QvDirectionalLight (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFBool on;
+ QvSFFloat intensity;
+ QvSFColor color;
+ QvSFVec3f direction;
+};
+
+
+# 8 "QvNodes.h" 2
+
+# 1 "QvGroup.h" 1
+
+
+
+class QvChildList;
+
+
+class QvGroup : public QvNode {
+
+ public: QvGroup :: QvGroup (); virtual ~ QvGroup (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+ QvNode * getChild(int index) const;
+ int getNumChildren() const;
+ virtual QvChildList *getChildren() const;
+ virtual QvBool readInstance(QvInput *in);
+ virtual QvBool readChildren(QvInput *in);
+};
+
+
+# 9 "QvNodes.h" 2
+
+# 1 "QvIndexedFaceSet.h" 1
+
+
+
+# 1 "QvMFLong.h" 1
+
+
+
+
+
+class QvMFLong : public QvMField {
+ public:
+ long *values;
+ public: QvMFLong (); virtual ~ QvMFLong (); virtual QvBool read1Value(QvInput *in, int index); void allocValues(int newNum) ;
+};
+
+
+# 4 "QvIndexedFaceSet.h" 2
+
+
+
+
+
+class QvIndexedFaceSet : public QvNode {
+
+ public: QvIndexedFaceSet :: QvIndexedFaceSet (); virtual ~ QvIndexedFaceSet (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvMFLong coordIndex;
+ QvMFLong materialIndex;
+ QvMFLong normalIndex;
+ QvMFLong textureCoordIndex;
+};
+
+
+# 10 "QvNodes.h" 2
+
+# 1 "QvIndexedLineSet.h" 1
+
+
+
+
+
+
+
+
+class QvIndexedLineSet : public QvNode {
+
+ public: QvIndexedLineSet :: QvIndexedLineSet (); virtual ~ QvIndexedLineSet (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvMFLong coordIndex;
+ QvMFLong materialIndex;
+ QvMFLong normalIndex;
+ QvMFLong textureCoordIndex;
+};
+
+
+# 11 "QvNodes.h" 2
+
+# 1 "QvInfo.h" 1
+
+
+
+# 1 "QvSFString.h" 1
+
+
+
+
+
+class QvSFString : public QvSField {
+ public:
+ QvString value;
+ public: QvSFString (); virtual ~ QvSFString (); virtual QvBool readValue(QvInput *in) ;
+};
+
+
+# 4 "QvInfo.h" 2
+
+
+
+class QvInfo : public QvNode {
+
+ public: QvInfo :: QvInfo (); virtual ~ QvInfo (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFString string;
+};
+
+
+# 12 "QvNodes.h" 2
+
+# 1 "QvLevelOfDetail.h" 1
+
+
+
+# 1 "QvMFFloat.h" 1
+
+
+
+
+
+class QvMFFloat : public QvMField {
+ public:
+ float *values;
+ public: QvMFFloat (); virtual ~ QvMFFloat (); virtual QvBool read1Value(QvInput *in, int index); void allocValues(int newNum) ;
+};
+
+
+# 4 "QvLevelOfDetail.h" 2
+
+
+
+class QvLevelOfDetail : public QvGroup {
+
+ public: QvLevelOfDetail :: QvLevelOfDetail (); virtual ~ QvLevelOfDetail (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvMFFloat screenArea;
+};
+
+
+# 13 "QvNodes.h" 2
+
+# 1 "QvMaterial.h" 1
+
+
+
+# 1 "QvMFColor.h" 1
+
+
+
+
+
+class QvMFColor : public QvMField {
+ public:
+ float *values;
+ public: QvMFColor (); virtual ~ QvMFColor (); virtual QvBool read1Value(QvInput *in, int index); void allocValues(int newNum) ;
+};
+
+
+# 4 "QvMaterial.h" 2
+
+
+
+
+class QvMaterial : public QvNode {
+
+ public: QvMaterial :: QvMaterial (); virtual ~ QvMaterial (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvMFColor ambientColor;
+ QvMFColor diffuseColor;
+ QvMFColor specularColor;
+ QvMFColor emissiveColor;
+ QvMFFloat shininess;
+ QvMFFloat transparency;
+};
+
+
+# 14 "QvNodes.h" 2
+
+# 1 "QvMaterialBinding.h" 1
+
+
+
+
+
+
+class QvMaterialBinding : public QvNode {
+
+ public: QvMaterialBinding :: QvMaterialBinding (); virtual ~ QvMaterialBinding (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+ enum Binding {
+ DEFAULT,
+ NONE,
+ OVERALL,
+ PER_PART,
+ PER_PART_INDEXED,
+ PER_FACE,
+ PER_FACE_INDEXED,
+ PER_VERTEX,
+ PER_VERTEX_INDEXED,
+ };
+
+
+ QvSFEnum value;
+};
+
+
+# 15 "QvNodes.h" 2
+
+# 1 "QvMatrixTransform.h" 1
+
+
+
+# 1 "QvSFMatrix.h" 1
+
+
+
+
+
+class QvSFMatrix : public QvSField {
+ public:
+ float value[4][4];
+ public: QvSFMatrix (); virtual ~ QvSFMatrix (); virtual QvBool readValue(QvInput *in) ;
+};
+
+
+# 4 "QvMatrixTransform.h" 2
+
+
+
+class QvMatrixTransform : public QvNode {
+
+ public: QvMatrixTransform :: QvMatrixTransform (); virtual ~ QvMatrixTransform (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFMatrix matrix;
+};
+
+
+# 16 "QvNodes.h" 2
+
+# 1 "QvNormal.h" 1
+
+
+
+
+
+
+class QvNormal : public QvNode {
+
+ public: QvNormal :: QvNormal (); virtual ~ QvNormal (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvMFVec3f vector;
+};
+
+
+# 17 "QvNodes.h" 2
+
+# 1 "QvNormalBinding.h" 1
+
+
+
+
+
+
+class QvNormalBinding : public QvNode {
+
+ public: QvNormalBinding :: QvNormalBinding (); virtual ~ QvNormalBinding (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+ enum Binding {
+ DEFAULT,
+ NONE,
+ OVERALL,
+ PER_PART,
+ PER_PART_INDEXED,
+ PER_FACE,
+ PER_FACE_INDEXED,
+ PER_VERTEX,
+ PER_VERTEX_INDEXED,
+ };
+
+
+ QvSFEnum value;
+};
+
+
+# 18 "QvNodes.h" 2
+
+# 1 "QvOrthographicCamera.h" 1
+
+
+
+
+# 1 "QvSFRotation.h" 1
+
+
+
+
+
+class QvSFRotation : public QvSField {
+ public:
+ float axis[3];
+ float angle;
+ public: QvSFRotation (); virtual ~ QvSFRotation (); virtual QvBool readValue(QvInput *in) ;
+};
+
+
+# 5 "QvOrthographicCamera.h" 2
+
+
+
+
+class QvOrthographicCamera : public QvNode {
+
+ public: QvOrthographicCamera :: QvOrthographicCamera (); virtual ~ QvOrthographicCamera (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+ QvSFVec3f position;
+ QvSFRotation orientation;
+
+ QvSFFloat focalDistance;
+
+ QvSFFloat height;
+};
+
+
+# 19 "QvNodes.h" 2
+
+# 1 "QvPerspectiveCamera.h" 1
+
+
+
+
+
+
+
+
+class QvPerspectiveCamera : public QvNode {
+
+ public: QvPerspectiveCamera :: QvPerspectiveCamera (); virtual ~ QvPerspectiveCamera (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+ QvSFVec3f position;
+ QvSFRotation orientation;
+
+ QvSFFloat focalDistance;
+
+ QvSFFloat heightAngle;
+
+};
+
+
+# 20 "QvNodes.h" 2
+
+# 1 "QvPointLight.h" 1
+
+
+
+
+
+
+
+
+
+class QvPointLight : public QvNode {
+
+ public: QvPointLight :: QvPointLight (); virtual ~ QvPointLight (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFBool on;
+ QvSFFloat intensity;
+ QvSFColor color;
+ QvSFVec3f location;
+};
+
+
+# 21 "QvNodes.h" 2
+
+# 1 "QvPointSet.h" 1
+
+
+
+# 1 "QvSFLong.h" 1
+
+
+
+
+
+class QvSFLong : public QvSField {
+ public:
+ long value;
+ public: QvSFLong (); virtual ~ QvSFLong (); virtual QvBool readValue(QvInput *in) ;
+};
+
+
+# 4 "QvPointSet.h" 2
+
+
+
+
+
+class QvPointSet : public QvNode {
+
+ public: QvPointSet :: QvPointSet (); virtual ~ QvPointSet (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFLong startIndex;
+ QvSFLong numPoints;
+};
+
+
+# 22 "QvNodes.h" 2
+
+# 1 "QvRotation.h" 1
+
+
+
+
+
+
+class QvRotation : public QvNode {
+
+ public: QvRotation :: QvRotation (); virtual ~ QvRotation (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFRotation rotation;
+};
+
+
+# 23 "QvNodes.h" 2
+
+# 1 "QvScale.h" 1
+
+
+
+
+
+
+class QvScale : public QvNode {
+
+ public: QvScale :: QvScale (); virtual ~ QvScale (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFVec3f scaleFactor;
+};
+
+
+# 24 "QvNodes.h" 2
+
+# 1 "QvSeparator.h" 1
+
+
+
+
+
+
+
+
+class QvSeparator : public QvGroup {
+
+ public: QvSeparator :: QvSeparator (); virtual ~ QvSeparator (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+ enum CullEnabled {
+ OFF,
+ ON,
+ AUTO,
+ };
+
+
+ QvSFEnum renderCulling;
+};
+
+
+# 25 "QvNodes.h" 2
+
+# 1 "QvShapeHints.h" 1
+
+
+
+
+
+
+
+class QvShapeHints : public QvNode {
+
+ public: QvShapeHints :: QvShapeHints (); virtual ~ QvShapeHints (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+ enum VertexOrdering {
+ UNKNOWN_ORDERING,
+ CLOCKWISE,
+ COUNTERCLOCKWISE,
+ };
+
+ enum ShapeType {
+ UNKNOWN_SHAPE_TYPE,
+ SOLID,
+ };
+
+ enum FaceType {
+ UNKNOWN_FACE_TYPE,
+ CONVEX,
+ };
+
+
+ QvSFEnum vertexOrdering;
+ QvSFEnum shapeType;
+ QvSFEnum faceType;
+ QvSFFloat creaseAngle;
+};
+
+
+# 26 "QvNodes.h" 2
+
+# 1 "QvSphere.h" 1
+
+
+
+
+
+
+class QvSphere : public QvNode {
+
+ public: QvSphere :: QvSphere (); virtual ~ QvSphere (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFFloat radius;
+};
+
+
+
+# 27 "QvNodes.h" 2
+
+# 1 "QvSpotLight.h" 1
+
+
+
+
+
+
+
+
+
+class QvSpotLight : public QvNode {
+
+ public: QvSpotLight :: QvSpotLight (); virtual ~ QvSpotLight (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFBool on;
+ QvSFFloat intensity;
+ QvSFColor color;
+ QvSFVec3f location;
+ QvSFVec3f direction;
+ QvSFFloat dropOffRate;
+
+
+ QvSFFloat cutOffAngle;
+
+
+};
+
+
+# 28 "QvNodes.h" 2
+
+# 1 "QvSwitch.h" 1
+
+
+
+
+
+
+
+
+
+class QvSwitch : public QvGroup {
+
+ public: QvSwitch :: QvSwitch (); virtual ~ QvSwitch (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFLong whichChild;
+};
+
+
+# 29 "QvNodes.h" 2
+
+# 1 "QvTexture2.h" 1
+
+
+
+
+# 1 "QvSFImage.h" 1
+
+
+
+
+
+class QvSFImage : public QvSField {
+ public:
+ short size[2];
+ int numComponents;
+ unsigned char * bytes;
+ public: QvSFImage (); virtual ~ QvSFImage (); virtual QvBool readValue(QvInput *in) ;
+};
+
+
+# 5 "QvTexture2.h" 2
+
+
+
+
+class QvTexture2 : public QvNode {
+
+ public: QvTexture2 :: QvTexture2 (); virtual ~ QvTexture2 (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+ enum Wrap {
+ REPEAT,
+ CLAMP,
+ };
+
+
+ QvSFString filename;
+ QvSFImage image;
+ QvSFEnum wrapS;
+ QvSFEnum wrapT;
+
+ virtual QvBool readInstance(QvInput *in);
+ QvBool readImage();
+};
+
+
+# 30 "QvNodes.h" 2
+
+# 1 "QvTexture2Transform.h" 1
+
+
+
+
+# 1 "QvSFVec2f.h" 1
+
+
+
+
+
+class QvSFVec2f : public QvSField {
+ public:
+ float value[2];
+ public: QvSFVec2f (); virtual ~ QvSFVec2f (); virtual QvBool readValue(QvInput *in) ;
+};
+
+
+# 5 "QvTexture2Transform.h" 2
+
+
+
+class QvTexture2Transform : public QvNode {
+
+ public: QvTexture2Transform :: QvTexture2Transform (); virtual ~ QvTexture2Transform (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFVec2f translation;
+ QvSFFloat rotation;
+ QvSFVec2f scaleFactor;
+ QvSFVec2f center;
+};
+
+
+# 31 "QvNodes.h" 2
+
+# 1 "QvTextureCoordinate2.h" 1
+
+
+
+# 1 "QvMFVec2f.h" 1
+
+
+
+
+
+class QvMFVec2f : public QvMField {
+ public:
+ float *values;
+ public: QvMFVec2f (); virtual ~ QvMFVec2f (); virtual QvBool read1Value(QvInput *in, int index); void allocValues(int newNum) ;
+};
+
+
+# 4 "QvTextureCoordinate2.h" 2
+
+
+
+class QvTextureCoordinate2 : public QvNode {
+
+ public: QvTextureCoordinate2 :: QvTextureCoordinate2 (); virtual ~ QvTextureCoordinate2 (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvMFVec2f point;
+};
+
+
+# 32 "QvNodes.h" 2
+
+# 1 "QvTransform.h" 1
+
+
+
+
+
+
+
+class QvTransform : public QvNode {
+
+ public: QvTransform :: QvTransform (); virtual ~ QvTransform (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFVec3f translation;
+ QvSFRotation rotation;
+ QvSFVec3f scaleFactor;
+ QvSFRotation scaleOrientation;
+ QvSFVec3f center;
+};
+
+
+# 33 "QvNodes.h" 2
+
+# 1 "QvTransformSeparator.h" 1
+
+
+
+
+
+class QvTransformSeparator : public QvGroup {
+
+ public: QvTransformSeparator :: QvTransformSeparator (); virtual ~ QvTransformSeparator (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+
+};
+
+
+# 34 "QvNodes.h" 2
+
+# 1 "QvTranslation.h" 1
+
+
+
+
+
+
+class QvTranslation : public QvNode {
+
+ public: QvTranslation :: QvTranslation (); virtual ~ QvTranslation (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFVec3f translation;
+};
+
+
+# 35 "QvNodes.h" 2
+
+# 1 "QvWWWAnchor.h" 1
+
+
+
+
+
+
+
+class QvWWWAnchor : public QvGroup {
+
+ public: QvWWWAnchor :: QvWWWAnchor (); virtual ~ QvWWWAnchor (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ enum Map {
+ NONE,
+ POINT,
+ };
+
+
+ QvSFString name;
+ QvSFEnum map;
+};
+
+
+# 36 "QvNodes.h" 2
+
+# 1 "QvWWWInline.h" 1
+
+
+
+
+
+
+
+class QvWWWInline : public QvGroup {
+
+ public: QvWWWInline :: QvWWWInline (); virtual ~ QvWWWInline (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFString name;
+ QvSFVec3f bboxSize;
+ QvSFVec3f bboxCenter;
+};
+
+
+# 37 "QvNodes.h" 2
+
+
+
+# 2 "QvTraverse.cpp" 2
+
+# 1 "QvState.h" 1
+
+
+
+
+
+
+# 1 "../BspLib/VrmlFile.h" 1
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/BspLibDefs.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/ctype.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/runetype.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct {
+ rune_t min;
+ rune_t max;
+ rune_t map;
+ unsigned long *types;
+} _RuneEntry;
+
+typedef struct {
+ int nranges;
+ _RuneEntry *ranges;
+} _RuneRange;
+
+typedef struct {
+ char magic[8];
+ char encoding[32];
+
+ rune_t (*sgetrune)
+ (const char *, unsigned int, char const **) ;
+ int (*sputrune)
+ (rune_t, char *, unsigned int, char **) ;
+ rune_t invalid_rune;
+
+ unsigned long runetype[(1 <<8 ) ];
+ rune_t maplower[(1 <<8 ) ];
+ rune_t mapupper[(1 <<8 ) ];
+
+
+
+
+
+
+ _RuneRange runetype_ext;
+ _RuneRange maplower_ext;
+ _RuneRange mapupper_ext;
+
+ void *variable;
+ int variable_len;
+} _RuneLocale;
+
+
+
+extern _RuneLocale _DefaultRuneLocale;
+extern _RuneLocale *_CurrentRuneLocale;
+
+
+# 68 "/usr/include/ctype.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+unsigned long ___runetype (__wchar_t ) ;
+__wchar_t ___tolower (__wchar_t ) ;
+__wchar_t ___toupper (__wchar_t ) ;
+}
+
+
+
+
+
+
+
+
+
+
+
+static inline int
+__istype(__wchar_t c, unsigned long f)
+{
+ return((((c & (~((1 <<8 ) - 1)) ) ? ___runetype(c) :
+ _CurrentRuneLocale->runetype[c]) & f) ? 1 : 0);
+}
+
+static inline int
+__isctype(__wchar_t c, unsigned long f)
+{
+ return((((c & (~((1 <<8 ) - 1)) ) ? 0 :
+ _DefaultRuneLocale.runetype[c]) & f) ? 1 : 0);
+}
+
+
+
+static inline __wchar_t
+toupper(__wchar_t c)
+{
+ return((c & (~((1 <<8 ) - 1)) ) ?
+ ___toupper(c) : _CurrentRuneLocale->mapupper[c]);
+}
+
+static inline __wchar_t
+tolower(__wchar_t c)
+{
+ return((c & (~((1 <<8 ) - 1)) ) ?
+ ___tolower(c) : _CurrentRuneLocale->maplower[c]);
+}
+
+
+# 166 "/usr/include/ctype.h" 3 4
+
+
+
+# 13 "../BspLib/BspLibDefs.h" 2
+
+# 1 "/usr/include/errno.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/errno.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+extern int * __error (void) ;
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 22 "/usr/include/errno.h" 2 3 4
+
+
+# 14 "../BspLib/BspLibDefs.h" 2
+
+# 1 "/usr/include/limits.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/gcc/darwin/2.95.2/g++/../machine/limits.h" 1 3
+# 10 "/usr/include/gcc/darwin/2.95.2/g++/../machine/limits.h" 3
+
+# 108 "/usr/include/gcc/darwin/2.95.2/g++/../machine/limits.h" 3
+
+# 62 "/usr/include/limits.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 15 "../BspLib/BspLibDefs.h" 2
+
+# 1 "/usr/include/math.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern int signgam;
+
+
+enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
+
+
+
+
+
+
+
+
+
+
+
+extern enum fdversion _fdlib_version ;
+
+
+
+
+
+
+# 91 "/usr/include/math.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+extern double acos (double) ;
+extern double asin (double) ;
+extern double atan (double) ;
+extern double atan2 (double, double) ;
+extern double cos (double) ;
+extern double sin (double) ;
+extern double tan (double) ;
+
+extern double cosh (double) ;
+extern double sinh (double) ;
+extern double tanh (double) ;
+
+extern double exp (double) ;
+extern double frexp (double, int *) ;
+extern double ldexp (double, int) ;
+extern double log (double) ;
+extern double log10 (double) ;
+extern double modf (double, double *) ;
+
+extern double pow (double, double) ;
+extern double sqrt (double) ;
+
+extern double ceil (double) ;
+extern double fabs (double) ;
+extern double floor (double) ;
+extern double fmod (double, double) ;
+
+
+extern double erf (double) ;
+extern double erfc (double) ;
+extern double gamma (double) ;
+extern double hypot (double, double) ;
+extern int isinf (double) ;
+extern int isnan (double) ;
+extern int finite (double) ;
+extern double j0 (double) ;
+extern double j1 (double) ;
+extern double jn (int, double) ;
+extern double lgamma (double) ;
+extern double y0 (double) ;
+extern double y1 (double) ;
+extern double yn (int, double) ;
+
+
+extern double acosh (double) ;
+extern double asinh (double) ;
+extern double atanh (double) ;
+extern double cbrt (double) ;
+extern double logb (double) ;
+extern double nextafter (double, double) ;
+extern double remainder (double, double) ;
+extern double scalb (double, int) ;
+
+
+
+
+
+
+
+
+extern double significand (double) ;
+
+
+
+
+extern double copysign (double, double) ;
+extern int ilogb (double) ;
+extern double rint (double) ;
+extern double scalbn (double, int) ;
+
+
+
+
+extern double cabs();
+extern double drem (double, double) ;
+extern double expm1 (double) ;
+extern double log1p (double) ;
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
+# 16 "../BspLib/BspLibDefs.h" 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef unsigned char byte;
+typedef unsigned short word;
+typedef unsigned long dword;
+
+
+typedef long fixed_t;
+typedef float float_t;
+typedef double hprec_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+struct ColorRGB {
+ byte R;
+ byte G;
+ byte B;
+};
+
+
+struct ColorRGBA {
+ byte R;
+ byte G;
+ byte B;
+ byte A;
+};
+
+
+struct ColorRGBf {
+ float R;
+ float G;
+ float B;
+};
+
+
+struct ColorRGBAf {
+ float R;
+ float G;
+ float B;
+ float A;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+class EpsAreas {
+
+public:
+ static double eps_scalarproduct;
+ static double eps_vanishcomponent;
+ static double eps_vanishdenominator;
+ static double eps_planethickness;
+ static double eps_pointonline;
+ static double eps_pointonlineseg;
+ static double eps_vertexmergearea;
+};
+
+
+}
+
+
+
+
+# 12 "../BspLib/VrmlFile.h" 2
+
+# 1 "../BspLib/BoundingBox.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/BspObject.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/SystemIO.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+
+class SystemIO {
+
+public:
+
+
+ enum {
+ SYSTEM_IO_OK = 0x0000,
+ SYSTEM_IO_ERROR = 0x0001,
+ END_OF_FILE = 0x0002,
+ FILE_NOT_FOUND = 0x0003,
+ FILE_READ_ERROR = 0x0004,
+ FILE_WRITE_ERROR = 0x0005,
+ FILE_CLOSED = 0x0006,
+ FILE_ALREADY_OPEN = 0x0007,
+ };
+
+
+ enum {
+ CRITERR_ALLOW_RET = 0x0001,
+ };
+
+
+ enum {
+ CHECK_ERRORS = 0x0001,
+ };
+
+public:
+ static void InfoMessage( char *message );
+ static void ErrorMessage( char *message );
+ static void HandleCriticalError( int flags = 0 );
+ static void SetProgramName( const char *name );
+ static void SetInfoMessageCallback( void (*callb)(char*) );
+ static void SetErrorMessageCallback( void (*callb)(char*) );
+ static void SetCriticalErrorCallback( int (*callb)(int) );
+
+
+
+
+
+public:
+ static const char version_str[];
+
+private:
+ static const char *program_name;
+ static void (*infomessage_callback)(char*);
+ static void (*errormessage_callback)(char*);
+ static int (*criticalerror_callback)(int);
+
+
+
+
+
+
+protected:
+
+
+
+class FilePtr {
+
+public:
+ FilePtr( const char *fname, const char *mode ) { fp = fopen( fname, mode ); }
+ ~FilePtr() { if ( fp ) fclose( fp ); }
+
+ operator FILE*() { return fp; }
+
+protected:
+ FILE *fp;
+
+};
+
+
+
+class FileAccess : public FilePtr {
+
+public:
+ FileAccess( const char *fname, const char *mode, int flags = CHECK_ERRORS );
+ ~FileAccess();
+
+ int ReOpen( const char *fname, const char *mode, int flags = CHECK_ERRORS );
+ int Close();
+
+ int Read( void *buffer, size_t size, size_t count, int flags = 0 );
+ int Write( void *buffer, size_t size, size_t count, int flags = 0 );
+
+ char *ReadLine( char *line, int maxlen, int flags = 0 );
+ char *WriteLine( char *line, int flags = 0 );
+
+ int Status() { return status; }
+
+ char *getFileName() { return filename; }
+
+private:
+ void IOError( int errorcode );
+
+private:
+ char *filename;
+ int status;
+
+};
+
+
+
+class StrScratch {
+
+public:
+ StrScratch() { line = new char[ 1024 ]; }
+ ~StrScratch() { delete line; }
+
+ operator char*() { return line; }
+
+private:
+ char *line;
+
+};
+
+
+};
+
+
+
+
+class String {
+
+public:
+ String() { data = 0 ; }
+ String( const char *src );
+ ~String() { delete data; }
+
+ String( const String& copyobj );
+ String& operator =( const String& copyobj );
+
+ operator char*() { return data; }
+
+ int IsNULL() const { return ( data == 0 ); }
+ int IsEmpty() const { return data ? ( *data == '\0' ) : 1 ; }
+
+ int getLength() const { return data ? strlen( data ) : 0; }
+
+private:
+ char *data;
+};
+
+
+}
+
+
+
+
+# 13 "../BspLib/BspObject.h" 2
+
+# 1 "../BspLib/Chunk.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+template<class T> class Chunk;
+
+
+
+
+template<class T>
+class ChunkRep : public virtual SystemIO {
+
+ friend class Chunk<T>;
+
+
+ enum {
+ E_INVALIDINDX
+ };
+
+ void Error( int err ) const;
+
+private:
+ ChunkRep( int chunksize = 0 );
+ ~ChunkRep();
+
+ int AddElement( const T& element );
+ T& FetchElement( int index );
+
+ int getNumElements() const;
+
+private:
+ int ref_count;
+ int numelements;
+ int maxnumelements;
+ T* elements;
+ ChunkRep* next;
+
+ static const int CHUNK_SIZE;
+};
+
+
+
+
+template<class T>
+ChunkRep<T>::ChunkRep( int chunksize ) : ref_count( 0 )
+{
+ int challocsize = chunksize > 0 ? chunksize : CHUNK_SIZE;
+ elements = new T[ challocsize ];
+ maxnumelements = challocsize;
+ numelements = 0;
+ next = 0 ;
+}
+
+
+
+
+template<class T>
+ChunkRep<T>::~ChunkRep()
+{
+ delete[] elements;
+ delete next;
+}
+
+
+
+
+template<class T>
+void ChunkRep<T>::Error( int err ) const
+{
+ {
+ StrScratch message;
+ sprintf( message, "***ERROR*** in object of a class of template Chunk" );
+
+ switch ( err ) {
+
+ case E_INVALIDINDX:
+ sprintf( message + strlen( message ), ": [Invalid index]" );
+ break;
+ }
+
+ ErrorMessage( message );
+ }
+
+ HandleCriticalError();
+}
+
+
+
+
+template<class T>
+T& ChunkRep<T>::FetchElement( int index )
+{
+
+# 133 "../BspLib/Chunk.h"
+
+
+ if ( index >= numelements )
+ Error( E_INVALIDINDX );
+
+
+ return elements[ index ];
+
+
+
+}
+
+
+
+
+template<class T>
+int ChunkRep<T>::AddElement( const T& element )
+{
+
+# 185 "../BspLib/Chunk.h"
+
+
+
+ if ( numelements == maxnumelements ) {
+
+
+ maxnumelements *= 2;
+
+
+
+ T *temp = new T[ maxnumelements ];
+
+
+
+
+ for ( int i = 0; i < numelements; i++ )
+ temp[ i ] = elements[ i ];
+
+ delete[] elements;
+ elements = temp;
+ }
+
+ elements[ numelements ] = element;
+ return numelements++;
+
+
+
+}
+
+
+
+
+template<class T>
+int ChunkRep<T>::getNumElements() const
+{
+ int num = 0;
+ for ( const ChunkRep *vlist = this; vlist; vlist = vlist->next )
+ num += vlist->numelements;
+ return num;
+}
+
+
+
+
+template<class T>
+class Chunk {
+
+public:
+ Chunk( int chunksize = 0 ) { rep = new ChunkRep<T>( chunksize ); rep->ref_count = 1; }
+ ~Chunk() { if ( --rep->ref_count == 0 ) delete rep; }
+
+ Chunk( const Chunk& copyobj );
+ Chunk& operator =( const Chunk& copyobj );
+
+ T& operator []( int index ) { return rep->FetchElement( index ); }
+ T& FetchElement( int index ) { return rep->FetchElement( index ); }
+ int AddElement( const T& element ) { return rep->AddElement( element ); }
+
+ int getNumElements() const { return rep->getNumElements(); }
+
+private:
+ ChunkRep<T>* rep;
+};
+
+
+
+
+template<class T>
+Chunk<T>::Chunk( const Chunk<T>& copyobj )
+{
+ rep = copyobj.rep;
+ rep->ref_count++;
+}
+
+
+
+
+template<class T>
+Chunk<T>& Chunk<T>::operator =( const Chunk<T>& copyobj )
+{
+ if ( &copyobj != this ) {
+ if ( --rep->ref_count == 0 ) {
+ delete rep;
+ }
+ rep = copyobj.rep;
+ rep->ref_count++;
+ }
+ return *this;
+}
+
+
+}
+
+
+
+
+# 14 "../BspLib/BspObject.h" 2
+
+# 1 "../BspLib/Face.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/Material.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+
+class Material {
+
+public:
+ Material() { }
+ ~Material() { }
+
+ ColorRGBA getAmbientColor() { return ambientcolor; }
+ ColorRGBA getDiffuseColor() { return diffusecolor; }
+ ColorRGBA getSpecularColor() { return specularcolor; }
+ ColorRGBA getEmissiveColor() { return emissivecolor; }
+
+ void setAmbientColor( ColorRGBA col ) { ambientcolor = col; ambientcolor.A = 255; }
+ void setDiffuseColor( ColorRGBA col ) { diffusecolor = col; diffusecolor.A = 255; }
+ void setSpecularColor( ColorRGBA col ) { specularcolor = col; specularcolor.A = 255; }
+ void setEmissiveColor( ColorRGBA col ) { emissivecolor = col; emissivecolor.A = 255; }
+
+ float getShininess() { return shininess; }
+ float getTransparency() { return transparency; }
+
+ void setShininess( float s ) { shininess = s; }
+ void setTransparency( float t ) { transparency = t; }
+
+private:
+ ColorRGBA ambientcolor;
+ ColorRGBA diffusecolor;
+ ColorRGBA specularcolor;
+ ColorRGBA emissivecolor;
+ float shininess;
+ float transparency;
+};
+
+
+}
+
+
+
+
+# 14 "../BspLib/Face.h" 2
+
+# 1 "../BspLib/Plane.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/Vertex.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+
+class Vertex3 {
+
+ friend class Vector3;
+ friend class LineSeg3;
+
+ friend int operator ==( const Vertex3 v1, const Vertex3 v2 );
+ friend int operator !=( const Vertex3 v1, const Vertex3 v2 );
+
+ friend Vector3 operator -( const Vertex3 v1, const Vertex3 v2 );
+
+ friend Vertex3 operator +( const Vertex3 v1, const Vector3 v2 );
+ friend Vertex3 operator +( const Vector3 v1, const Vertex3 v2 );
+ friend Vertex3 operator -( const Vertex3 v1, const Vector3 v2 );
+
+public:
+ Vertex3( hprec_t x = 0, hprec_t y = 0, hprec_t z = 0, hprec_t w = 1.0 );
+ ~Vertex3() { }
+
+ Vertex3& operator +=( const Vector3 v );
+ Vertex3& operator -=( const Vector3 v );
+
+ int IsInVicinity( const Vertex3& vertex ) const;
+ void ChangeAxes( const char *xchangecmd, const Vertex3& ads );
+
+ hprec_t getX() const { return X; }
+ hprec_t getY() const { return Y; }
+ hprec_t getZ() const { return Z; }
+ hprec_t getW() const { return W; }
+
+ void setX( hprec_t x ) { X = x; }
+ void setY( hprec_t y ) { Y = y; }
+ void setZ( hprec_t z ) { Z = z; }
+ void setW( hprec_t w ) { W = w; }
+
+private:
+ void ChangeAxis( const char xchar, const hprec_t src );
+
+protected:
+ hprec_t X;
+ hprec_t Y;
+ hprec_t Z;
+ hprec_t W;
+};
+
+
+
+
+class Vector3 : public Vertex3 {
+
+ friend class LineSeg3;
+
+ friend Vector3 operator -( const Vertex3 v1, const Vertex3 v2 );
+
+ friend Vertex3 operator +( const Vertex3 v1, const Vector3 v2 );
+ friend Vertex3 operator +( const Vector3 v1, const Vertex3 v2 );
+ friend Vertex3 operator -( const Vertex3 v1, const Vector3 v2 );
+
+ friend Vector3 operator +( const Vector3 v1, const Vector3 v2 );
+ friend Vector3 operator -( const Vector3 v1, const Vector3 v2 );
+
+ friend Vector3 operator *( const Vector3 v1, double t );
+ friend Vector3 operator *( double t, const Vector3 v1 );
+
+public:
+ Vector3( hprec_t x = 0, hprec_t y = 0, hprec_t z = 0, hprec_t w = 1.0 )
+ : Vertex3( x, y, z, w ) { }
+
+ Vector3( const Vertex3& v1, const Vertex3& v2 )
+ : Vertex3( v2.X - v1.X, v2.Y - v1.Y, v2.Z - v1.Z ) { }
+
+ Vector3( const Vector3& v1, const Vector3& v2 );
+
+ Vector3( const Vertex3& vtx ) { *(Vertex3*)this = vtx; }
+ ~Vector3() { }
+
+ Vector3& operator +=( const Vector3 v );
+ Vector3& operator -=( const Vector3 v );
+
+ Vector3& operator *=( double t );
+
+ int Normalize();
+ int Homogenize();
+ int IsNullVector() const;
+ hprec_t VecLength() const;
+ hprec_t DotProduct( const Vector3& vect ) const;
+ void CrossProduct( const Vector3& vect1, const Vector3& vect2 );
+ void CreateDirVec( const Vertex3& vertex1, const Vertex3& vertex2 );
+};
+
+
+
+
+class Vertex2 {
+
+ friend class Vector2;
+ friend class LineSeg2;
+
+ friend int operator ==( const Vertex2 v1, const Vertex2 v2 );
+ friend int operator !=( const Vertex2 v1, const Vertex2 v2 );
+
+ friend Vector2 operator -( const Vertex2 v1, const Vertex2 v2 );
+
+ friend Vertex2 operator +( const Vertex2 v1, const Vector2 v2 );
+ friend Vertex2 operator +( const Vector2 v1, const Vertex2 v2 );
+ friend Vertex2 operator -( const Vertex2 v1, const Vector2 v2 );
+
+public:
+ Vertex2( hprec_t x = 0, hprec_t y = 0, hprec_t w = 1.0 ) { X = x; Y = y; W = w; }
+
+ Vertex2( const Vector2& vect );
+ ~Vertex2() { }
+
+ Vertex2& operator +=( const Vector2 v );
+ Vertex2& operator -=( const Vector2 v );
+
+ int IsInVicinity( const Vertex2& vertex ) const;
+ void InitFromVertex3( const Vertex3& vertex );
+
+ hprec_t getX() const { return X; }
+ hprec_t getY() const { return Y; }
+ hprec_t getW() const { return W; }
+
+ void setX( hprec_t x ) { X = x; }
+ void setY( hprec_t y ) { Y = y; }
+ void setW( hprec_t w ) { W = w; }
+
+protected:
+ hprec_t X;
+ hprec_t Y;
+ hprec_t W;
+};
+
+
+
+
+class Vector2 : public Vertex2 {
+
+ friend class LineSeg2;
+
+ friend Vector2 operator -( const Vertex2 v1, const Vertex2 v2 );
+
+ friend Vertex2 operator +( const Vertex2 v1, const Vector2 v2 );
+ friend Vertex2 operator +( const Vector2 v1, const Vertex2 v2 );
+ friend Vertex2 operator -( const Vertex2 v1, const Vector2 v2 );
+
+ friend Vector2 operator +( const Vector2 v1, const Vector2 v2 );
+ friend Vector2 operator -( const Vector2 v1, const Vector2 v2 );
+
+ friend Vector2 operator *( const Vector2 v1, double t );
+ friend Vector2 operator *( double t, const Vector2 v1 );
+
+public:
+ Vector2( hprec_t x = 0, hprec_t y = 0, hprec_t w = 1.0 )
+ : Vertex2( x, y, w ) { }
+
+ Vector2( const Vertex2& v1, const Vertex2& v2 )
+ : Vertex2( v2.X - v1.X, v2.Y - v1.Y ) { }
+
+ Vector2( const Vertex2& vtx ) { *(Vertex2*)this = vtx; }
+ ~Vector2() { }
+
+ Vector2& operator +=( const Vector2 v );
+ Vector2& operator -=( const Vector2 v );
+
+ Vector2& operator *=( double t );
+
+ int Normalize();
+ int Homogenize();
+ int IsNullVector() const;
+ hprec_t VecLength() const;
+ hprec_t DotProduct( const Vector2& vect ) const;
+ void CreateDirVec( const Vertex2& vertex, const Vertex2& dirvec );
+};
+
+
+}
+
+
+
+# 1 "../BspLib/Vector.h" 1
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/Vector3.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/Vertex3.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+inline Vertex3::Vertex3( hprec_t x, hprec_t y, hprec_t z, hprec_t w )
+{
+ X = x;
+ Y = y;
+ Z = z;
+ W = w;
+}
+
+
+inline int operator ==( const Vertex3 v1, const Vertex3 v2 )
+{
+ return ( ( v1.X == v2.X ) && ( v1.Y == v2.Y ) && ( v1.Z == v2.Z ) && ( v1.W == v2.W ) );
+}
+
+
+inline int operator !=( const Vertex3 v1, const Vertex3 v2 )
+{
+ return ( ( v1.X != v2.X ) || ( v1.Y != v2.Y ) || ( v1.Z != v2.Z ) || ( v1.W != v2.W ) );
+}
+
+
+inline Vertex3& Vertex3::operator +=( const Vector3 v )
+{
+ X += v.X;
+ Y += v.Y;
+ Z += v.Z;
+
+ return *this;
+}
+
+
+inline Vertex3& Vertex3::operator -=( const Vector3 v )
+{
+ X -= v.X;
+ Y -= v.Y;
+ Z -= v.Z;
+
+ return *this;
+}
+
+
+inline int Vertex3::IsInVicinity( const Vertex3& vertex ) const
+{
+ return ( ( fabs( X - vertex.X ) < EpsAreas::eps_vertexmergearea ) &&
+ ( fabs( Y - vertex.Y ) < EpsAreas::eps_vertexmergearea ) &&
+ ( fabs( Z - vertex.Z ) < EpsAreas::eps_vertexmergearea ) );
+}
+
+
+}
+
+
+
+
+# 13 "../BspLib/Vector3.h" 2
+
+
+
+namespace BspLib {
+
+
+
+inline Vector3 operator *( const Vector3 v1, double t )
+{
+ return Vector3( v1.X * t, v1.Y * t, v1.Z * t, 1.0 );
+}
+
+
+inline Vector3 operator *( double t, const Vector3 v1 )
+{
+ return Vector3( v1.X * t, v1.Y * t, v1.Z * t, 1.0 );
+}
+
+
+inline Vector3::Vector3( const Vector3& v1, const Vector3& v2 )
+{
+ CrossProduct( v1, v2 );
+}
+
+
+inline Vector3& Vector3::operator +=( const Vector3 v )
+{
+ X += v.X;
+ Y += v.Y;
+ Z += v.Z;
+ return *this;
+}
+
+
+inline Vector3& Vector3::operator -=( const Vector3 v )
+{
+ X -= v.X;
+ Y -= v.Y;
+ Z -= v.Z;
+ return *this;
+}
+
+
+inline Vector3& Vector3::operator *=( double t )
+{
+ X *= t;
+ Y *= t;
+ Z *= t;
+ return *this;
+}
+
+
+inline int Vector3::Normalize()
+{
+ if ( IsNullVector() )
+ return 0 ;
+
+ double oonorm = 1 / VecLength();
+ X = X * oonorm;
+ Y = Y * oonorm;
+ Z = Z * oonorm;
+ W = 1.0;
+ return 1 ;
+}
+
+
+inline int Vector3::Homogenize()
+{
+ if ( fabs( W ) < EpsAreas::eps_vanishdenominator )
+ return 0 ;
+
+ double oow = 1 / W;
+ X = X * oow;
+ Y = Y * oow;
+ Z = Z * oow;
+ W = 1.0;
+ return 1 ;
+}
+
+
+inline int Vector3::IsNullVector() const
+{
+
+ return ( ( fabs( X ) < EpsAreas::eps_vanishcomponent ) && ( fabs( Y ) < EpsAreas::eps_vanishcomponent ) && ( fabs( Z ) < EpsAreas::eps_vanishcomponent ) );
+}
+
+
+inline hprec_t Vector3::VecLength() const
+{
+ return sqrt( X * X + Y * Y + Z * Z );
+}
+
+
+inline hprec_t Vector3::DotProduct( const Vector3& vect ) const
+{
+ return ( vect.X * X ) + ( vect.Y * Y ) + ( vect.Z * Z );
+}
+
+
+inline void Vector3::CrossProduct( const Vector3& vect1, const Vector3& vect2 )
+{
+ X = ( vect1.Y * vect2.Z ) - ( vect1.Z * vect2.Y );
+ Y = ( vect1.Z * vect2.X ) - ( vect1.X * vect2.Z );
+ Z = ( vect1.X * vect2.Y ) - ( vect1.Y * vect2.X );
+ W = 1.0;
+}
+
+
+inline void Vector3::CreateDirVec( const Vertex3& vertex1, const Vertex3& vertex2 )
+{
+ X = vertex2.X - vertex1.X;
+ Y = vertex2.Y - vertex1.Y;
+ Z = vertex2.Z - vertex1.Z;
+ W = 1.0;
+}
+
+
+}
+
+
+
+
+# 12 "../BspLib/Vector.h" 2
+
+# 1 "../BspLib/Vector2.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/Vertex2.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+inline Vertex2::Vertex2( const Vector2& vect )
+{
+ X = vect.X;
+ Y = vect.Y;
+ W = vect.W;
+}
+
+
+inline int operator ==( const Vertex2 v1, const Vertex2 v2 )
+{
+ return ( ( v1.X == v2.X ) && ( v1.Y == v2.Y ) && ( v1.W == v2.W ) );
+}
+
+
+inline int operator !=( const Vertex2 v1, const Vertex2 v2 )
+{
+ return ( ( v1.X != v2.X ) || ( v1.Y != v2.Y ) || ( v1.W != v2.W ) );
+}
+
+
+inline Vertex2& Vertex2::operator +=( const Vector2 v )
+{
+ X += v.X;
+ Y += v.Y;
+
+ return *this;
+}
+
+
+inline Vertex2& Vertex2::operator -=( const Vector2 v )
+{
+ X -= v.X;
+ Y -= v.Y;
+
+ return *this;
+}
+
+
+inline int Vertex2::IsInVicinity( const Vertex2& vertex ) const
+{
+ return ( ( fabs( X - vertex.X ) < EpsAreas::eps_vertexmergearea ) &&
+ ( fabs( Y - vertex.Y ) < EpsAreas::eps_vertexmergearea ) );
+}
+
+
+inline void Vertex2::InitFromVertex3( const Vertex3& vertex )
+{
+ X = vertex.getX();
+ Y = vertex.getY();
+ W = vertex.getZ();
+}
+
+
+}
+
+
+
+
+# 13 "../BspLib/Vector2.h" 2
+
+
+
+namespace BspLib {
+
+
+
+inline Vector2 operator *( const Vector2 v1, double t )
+{
+ return Vector2( v1.X * t, v1.Y * t, 1.0 );
+}
+
+
+inline Vector2 operator *( double t, const Vector2 v1 )
+{
+ return Vector2( v1.X * t, v1.Y * t, 1.0 );
+}
+
+
+inline Vector2& Vector2::operator +=( const Vector2 v )
+{
+ X += v.X;
+ Y += v.Y;
+ return *this;
+}
+
+
+inline Vector2& Vector2::operator -=( const Vector2 v )
+{
+ X -= v.X;
+ Y -= v.Y;
+ return *this;
+}
+
+
+inline Vector2& Vector2::operator *=( double t )
+{
+ X *= t;
+ Y *= t;
+ return *this;
+}
+
+
+inline int Vector2::Normalize()
+{
+ if ( IsNullVector() )
+ return 0 ;
+
+ double oonorm = 1 / VecLength();
+ X = X * oonorm;
+ Y = Y * oonorm;
+ W = 1.0;
+ return 1 ;
+}
+
+
+inline int Vector2::Homogenize()
+{
+ if ( fabs( W ) < EpsAreas::eps_vanishdenominator )
+ return 0 ;
+
+ double oow = 1 / W;
+ X = X * oow;
+ Y = Y * oow;
+ W = 1.0;
+ return 1 ;
+}
+
+
+inline int Vector2::IsNullVector() const
+{
+
+ return ( ( fabs( X ) < EpsAreas::eps_vanishcomponent ) && ( fabs( Y ) < EpsAreas::eps_vanishcomponent ) );
+}
+
+
+inline hprec_t Vector2::VecLength() const
+{
+ return sqrt( X * X + Y * Y );
+}
+
+
+inline hprec_t Vector2::DotProduct( const Vector2& vect ) const
+{
+ return ( vect.X * X ) + ( vect.Y * Y );
+}
+
+
+inline void Vector2::CreateDirVec( const Vertex2& vertex1, const Vertex2& vertex2 )
+{
+ X = vertex2.X - vertex1.X;
+ Y = vertex2.Y - vertex1.Y;
+ W = 1.0;
+}
+
+
+}
+
+
+
+
+# 13 "../BspLib/Vector.h" 2
+
+
+
+namespace BspLib {
+
+
+
+inline Vertex3 operator +( const Vertex3 v1, const Vector3 v2 )
+{
+ return Vertex3( v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z, 1.0 );
+}
+
+
+inline Vertex3 operator +( const Vector3 v1, const Vertex3 v2 )
+{
+ return Vertex3( v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z, 1.0 );
+}
+
+
+inline Vector3 operator -( const Vertex3 v1, const Vertex3 v2 )
+{
+ return Vector3( v1.X - v2.X, v1.Y - v2.Y, v1.Z - v2.Z, 1.0 );
+}
+
+
+inline Vertex3 operator -( const Vertex3 v1, const Vector3 v2 )
+{
+ return Vertex3( v1.X - v2.X, v1.Y - v2.Y, v1.Z - v2.Z, 1.0 );
+}
+
+
+inline Vector3 operator +( const Vector3 v1, const Vector3 v2 )
+{
+ return Vector3( v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z, 1.0 );
+}
+
+
+inline Vector3 operator -( const Vector3 v1, const Vector3 v2 )
+{
+ return Vector3( v1.X - v2.X, v1.Y - v2.Y, v1.Z - v2.Z, 1.0 );
+}
+
+
+
+
+
+
+inline Vertex2 operator +( const Vertex2 v1, const Vector2 v2 )
+{
+ return Vertex2( v1.X + v2.X, v1.Y + v2.Y, 1.0 );
+}
+
+
+inline Vertex2 operator +( const Vector2 v1, const Vertex2 v2 )
+{
+ return Vertex2( v1.X + v2.X, v1.Y + v2.Y, 1.0 );
+}
+
+
+inline Vector2 operator -( const Vertex2 v1, const Vertex2 v2 )
+{
+ return Vector2( v1.X - v2.X, v1.Y - v2.Y, 1.0 );
+}
+
+
+inline Vertex2 operator -( const Vertex2 v1, const Vector2 v2 )
+{
+ return Vertex2( v1.X - v2.X, v1.Y - v2.Y, 1.0 );
+}
+
+
+inline Vector2 operator +( const Vector2 v1, const Vector2 v2 )
+{
+ return Vector2( v1.X + v2.X, v1.Y + v2.Y, 1.0 );
+}
+
+
+inline Vector2 operator -( const Vector2 v1, const Vector2 v2 )
+{
+ return Vector2( v1.X - v2.X, v1.Y - v2.Y, 1.0 );
+}
+
+
+}
+
+
+
+
+# 199 "../BspLib/Vertex.h" 2
+
+# 1 "../BspLib/LineSeg2.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+
+class LineSeg2 {
+
+public:
+ LineSeg2( const Vertex2& basevtx, const Vector2& dirvec );
+ ~LineSeg2() { }
+
+ int PointOnLineSeg( const Vertex2& vertex ) const;
+
+private:
+ Vertex2 m_basevtx;
+ Vector2 m_dirvec;
+};
+
+
+inline LineSeg2::LineSeg2( const Vertex2& basevtx, const Vector2& dirvec )
+{
+ m_basevtx = basevtx;
+ m_dirvec = dirvec;
+}
+
+
+}
+
+
+
+
+# 200 "../BspLib/Vertex.h" 2
+
+# 1 "../BspLib/LineSeg3.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+
+class LineSeg3 {
+
+public:
+ LineSeg3( const Vertex3& basevtx, const Vector3& dirvec );
+ ~LineSeg3() { }
+
+ int PointOnLineSeg( const Vertex3& vertex ) const;
+
+private:
+ Vertex3 m_basevtx;
+ Vector3 m_dirvec;
+};
+
+
+inline LineSeg3::LineSeg3( const Vertex3& basevtx, const Vector3& dirvec )
+{
+ m_basevtx = basevtx;
+ m_dirvec = dirvec;
+}
+
+
+}
+
+
+
+
+# 201 "../BspLib/Vertex.h" 2
+
+# 1 "../BspLib/VertexChunk.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+
+class VertexChunkRep : public virtual SystemIO {
+
+ friend class VertexChunk;
+
+private:
+ VertexChunkRep( int chunksize = 0 );
+ ~VertexChunkRep();
+
+ Vertex3& FetchVertex( int index );
+ int AddVertex( Vertex3 vertex );
+ int FindVertex( const Vertex3& vertex );
+ int FindCloseVertex( const Vertex3& vertex, int skip = -1 );
+ int CheckVertices( int verbose );
+
+ int getNumElements() const;
+
+private:
+ void ChangeAxis( char xchar, hprec_t src );
+ int VerticesEqual( Vertex3 v1, Vertex3 v2 );
+
+private:
+ int ref_count;
+
+ int numvertices;
+ int maxnumvertices;
+ Vertex3* vertices;
+ VertexChunkRep* next;
+
+ int nummultvertices;
+ static int eliminatedoublets;
+ static const int CHUNK_SIZE;
+};
+
+
+inline VertexChunkRep::VertexChunkRep( int chunksize ) : ref_count( 0 )
+{
+ int challocsize = chunksize > 0 ? chunksize : CHUNK_SIZE;
+ vertices = new Vertex3[ challocsize ];
+ maxnumvertices = challocsize;
+ numvertices = 0;
+ next = 0 ;
+}
+
+
+inline VertexChunkRep::~VertexChunkRep()
+{
+ delete next;
+ delete[] vertices;
+}
+
+
+inline int VertexChunkRep::VerticesEqual( Vertex3 v1, Vertex3 v2 )
+{
+
+ return ( v1 == v2 );
+}
+
+
+
+
+class VertexChunk {
+
+public:
+ VertexChunk( int chunksize = 0 ) { rep = new VertexChunkRep( chunksize ); rep->ref_count = 1; }
+ ~VertexChunk() { if ( --rep->ref_count == 0 ) delete rep; }
+
+ VertexChunk( const VertexChunk& copyobj );
+ VertexChunk& operator =( const VertexChunk& copyobj );
+
+ Vertex3& operator []( int index ) { return rep->FetchVertex( index ); }
+ Vertex3& FetchVertex( int index ) { return rep->FetchVertex( index ); }
+
+ int AddVertex( const Vertex3 vertex ) { return rep->AddVertex( vertex ); }
+ int FindVertex( const Vertex3& vertex ) { return rep->FindVertex( vertex ); }
+ int FindCloseVertex( Vertex3 vertex, int skip = -1 ) { return rep->FindCloseVertex( vertex, skip ); }
+ int CheckVertices( int verbose ) { return rep->CheckVertices( verbose ); }
+
+ int getNumElements() const { return rep->getNumElements(); }
+
+private:
+ VertexChunkRep* rep;
+};
+
+
+inline VertexChunk::VertexChunk( const VertexChunk& copyobj )
+{
+ rep = copyobj.rep;
+ rep->ref_count++;
+}
+
+
+inline VertexChunk& VertexChunk::operator =( const VertexChunk& copyobj )
+{
+ if ( &copyobj != this ) {
+ if ( --rep->ref_count == 0 ) {
+ delete rep;
+ }
+ rep = copyobj.rep;
+ rep->ref_count++;
+ }
+ return *this;
+}
+
+
+}
+
+
+
+
+# 202 "../BspLib/Vertex.h" 2
+
+
+
+
+
+# 13 "../BspLib/Plane.h" 2
+
+
+
+namespace BspLib {
+
+
+
+
+class Plane {
+
+ enum {
+ NORMAL_VALID = 0x0001,
+ OFFSET_VALID = 0x0002,
+ PLANE_VALID = NORMAL_VALID | OFFSET_VALID,
+ };
+
+public:
+ Plane() : m_valid( 0 ) { }
+ Plane( const Vector3& pnormal );
+ Plane( const Vector3& pnormal, double poffset );
+ Plane( const Vertex3& v1, const Vertex3& v2, const Vertex3& v3 );
+ ~Plane() { }
+
+ int InitPlane( const Vertex3& v1, const Vertex3& v2, const Vertex3& v3 );
+ int CalcPlaneOffset( const Vertex3& vtx );
+
+ Vector3 getPlaneNormal() const { return m_normal; }
+ void setPlaneNormal( const Vector3& pnormal ) { m_normal = pnormal; }
+
+ double getPlaneOffset() const { return m_offset; }
+ void setPlaneOffset( double poffset ) { m_offset = poffset; }
+
+ int NormalValid() const { return ( ( m_valid & NORMAL_VALID ) == NORMAL_VALID ); }
+ int PlaneValid() const { return ( ( m_valid & PLANE_VALID ) == PLANE_VALID ); }
+
+ void ApplyScaleFactor( double sfac );
+ void EliminateDirectionality();
+
+ int PointContained( const Vertex3& point ) const;
+ int PointInPositiveHalfspace( const Vertex3& point ) const;
+ int PointInNegativeHalfspace( const Vertex3& point ) const;
+
+private:
+ Vector3 m_normal;
+ double m_offset;
+ int m_valid;
+};
+
+
+inline Plane::Plane( const Vector3& pnormal )
+{
+ m_normal = pnormal;
+ m_offset = 0.0;
+ m_valid = NORMAL_VALID;
+}
+
+
+inline Plane::Plane( const Vector3& pnormal, double poffset )
+{
+ m_normal = pnormal;
+ m_offset = poffset;
+ m_valid = PLANE_VALID;
+}
+
+
+inline Plane::Plane( const Vertex3& v1, const Vertex3& v2, const Vertex3& v3 )
+{
+
+
+ m_normal.CrossProduct( v3 - v1, v2 - v1 );
+
+
+ m_valid = m_normal.Normalize() ? PLANE_VALID : 0;
+
+
+ m_offset = m_normal.DotProduct( v1 );
+}
+
+
+inline int Plane::InitPlane( const Vertex3& v1, const Vertex3& v2, const Vertex3& v3 )
+{
+ *this = Plane( v1, v2, v3 );
+ return m_valid;
+}
+
+
+inline int Plane::CalcPlaneOffset( const Vertex3& vtx )
+{
+
+ m_offset = m_normal.DotProduct( vtx );
+ return ( m_valid |= OFFSET_VALID );
+}
+
+
+inline void Plane::ApplyScaleFactor( double sfac )
+{
+
+
+ m_offset *= sfac;
+}
+
+
+inline void Plane::EliminateDirectionality()
+{
+ if ( m_offset < 0.0 ) {
+ m_normal *= -1.0;
+ m_offset = -m_offset;
+ }
+}
+
+
+inline int Plane::PointContained( const Vertex3& point ) const
+{
+ return ( fabs( m_normal.DotProduct( point ) - m_offset ) < EpsAreas::eps_planethickness );
+}
+
+
+inline int Plane::PointInPositiveHalfspace( const Vertex3& point ) const
+{
+ return ( m_normal.DotProduct( point ) - m_offset >= EpsAreas::eps_planethickness );
+}
+
+
+inline int Plane::PointInNegativeHalfspace( const Vertex3& point ) const
+{
+ return ( m_normal.DotProduct( point ) - m_offset <= - EpsAreas::eps_planethickness );
+}
+
+
+}
+
+
+
+
+# 15 "../BspLib/Face.h" 2
+
+
+# 1 "../BspLib/Texture.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+
+
+
+
+class Texture : public virtual SystemIO {
+
+public:
+ Texture( int w = -1, int h = -1, char *tname = 0 , char *fname = 0 );
+ ~Texture() { }
+
+ int getWidth() const { return m_width; }
+ int getHeight() const { return m_height; }
+ const char* getName() const { return m_name; }
+ const char* getFile() const { return m_file; }
+
+ void setWidth( int w ) { m_width = w; }
+ void setHeight( int h ) { m_height = h; }
+ void setName( const char *tname );
+ void setFile( const char *fname );
+
+ void WriteInfo( FILE *fp );
+
+private:
+ int m_width;
+ int m_height;
+ char m_name[ 31 + 1 ];
+ char m_file[ 1024 + 1 ];
+};
+
+
+typedef Chunk<Texture> TextureChunk;
+
+
+}
+
+
+
+
+# 17 "../BspLib/Face.h" 2
+
+# 1 "../BspLib/TriMapping.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+
+class TriMapping : public virtual SystemIO {
+
+ void Error() const;
+
+public:
+ TriMapping() { }
+ ~TriMapping() { }
+
+ Vertex2& getMapXY( int indx ) { if ( indx > 2 ) Error(); return map_xy[ indx ]; }
+ Vertex2& getMapUV( int indx ) { if ( indx > 2 ) Error(); return map_uv[ indx ]; }
+
+private:
+ Vertex2 map_xy[ 3 ];
+ Vertex2 map_uv[ 3 ];
+};
+
+
+}
+
+
+
+
+# 18 "../BspLib/Face.h" 2
+
+
+
+
+namespace BspLib {
+
+
+
+
+class Face : public virtual SystemIO {
+
+ void Error() const;
+
+public:
+
+
+ enum ShadingType {
+ no_shad = 0x1000,
+ flat_shad = 0x1001,
+ gouraud_shad = 0x1002,
+ afftex_shad = 0x2003,
+ ipol1tex_shad = 0x2004,
+ ipol2tex_shad = 0x2005,
+ persptex_shad = 0x2006,
+ material_shad = 0x1007,
+ texmat_shad = 0x3008,
+ num_shading_types = 9,
+ base_mask = 0x00ff,
+ color_mask = 0x1000,
+ texmap_mask = 0x2000,
+ };
+
+
+ enum ColorModel {
+ no_col,
+ indexed_col,
+ rgb_col,
+ material_col,
+ num_color_models
+ };
+
+public:
+ Face();
+ ~Face() { delete faceplane; delete facematerial; delete facemapping; delete texturename; }
+
+ Face( const Face& copyobj );
+ Face& operator =( const Face& copyobj );
+
+ int getId() const { return faceid; }
+ void setId( int id ) { faceid = id; }
+
+ Material getMaterial() const { if ( facematerial == 0 ) Error(); return *facematerial; }
+ Plane getPlane() const { if ( faceplane == 0 ) Error(); return *faceplane; }
+
+ Vector3 getPlaneNormal() const;
+ void setPlaneNormal( const Vector3& normal );
+
+ int getShadingType() const { return shadingtype; }
+ void setShadingType( int type );
+
+ int getColorType() const { return colortype; }
+ void getColorIndex( dword& col ) const { col = facecolor_indx; }
+ void getColorRGBA( ColorRGBA& col ) const { col = facecolor_rgba; }
+ void getColorChannels( float& r, float& g, float& b ) const;
+ const char *getTextureName() { return texturename; }
+
+ void setFaceColor( dword col );
+ void setFaceColor( ColorRGBA col );
+ void setTextureName( const char *tname );
+
+ int NormalValid() const { return faceplane ? faceplane->NormalValid() : 0 ; }
+ int PlaneValid() const { return faceplane ? faceplane->PlaneValid() : 0 ; }
+ int MaterialAttached() const { return ( facematerial != 0 ); }
+ int MappingAttached() const { return ( facemapping != 0 ); }
+ int FaceTexMapped() const { return ( ( shadingtype & texmap_mask ) != 0 ); }
+
+ void CalcPlane( const Vertex3& vertex1, const Vertex3& vertex2, const Vertex3& vertex3 );
+ void AttachNormal( const Vector3& normal );
+ void AttachPlane( Plane *plane );
+ void AttachMaterial( Material *mat );
+
+ int ConvertColorIndexToRGB( char *palette, int changemode );
+
+ Vertex2& MapXY( int indx );
+ Vertex2& MapUV( int indx );
+
+ void WriteFaceInfo( FILE *fp ) const;
+ void WriteNormalInfo( FILE *fp ) const;
+ void WriteMappingInfo( FILE *fp ) const;
+
+public:
+ static int GetTypeIndex( const char *type );
+ static int GetColorModelIndex( const char *type );
+
+public:
+ static const char* material_strings[];
+
+private:
+ static const char* prop_strings[];
+ static const int prop_ids[];
+ static const char* color_strings[];
+ static const int color_ids[];
+
+private:
+ int faceid;
+ Plane* faceplane;
+
+ int shadingtype;
+ int colortype;
+
+ dword facecolor_indx;
+ ColorRGBA facecolor_rgba;
+ Material* facematerial;
+ TriMapping* facemapping;
+ char* texturename;
+};
+
+
+typedef Chunk<Face> FaceChunk;
+
+
+inline Face::Face()
+{
+ faceid = -1;
+ shadingtype = -1;
+ colortype = -1;
+ faceplane = 0 ;
+ facematerial = 0 ;
+ facemapping = 0 ;
+ texturename = 0 ;
+}
+
+
+inline Vector3 Face::getPlaneNormal() const
+{
+
+ if ( ( faceplane == 0 ) || !faceplane->NormalValid() )
+ Error();
+ ;
+ return faceplane->getPlaneNormal();
+}
+
+
+inline void Face::setPlaneNormal( const Vector3& normal )
+{
+
+ if ( ( faceplane == 0 ) || !faceplane->NormalValid() )
+ Error();
+ ;
+ faceplane->setPlaneNormal( normal );
+}
+
+
+inline void Face::setShadingType( int type )
+{
+
+ if ( ( type & base_mask ) >= num_shading_types )
+ Error();
+ ;
+ shadingtype = type;
+}
+
+
+inline void Face::setFaceColor( dword col )
+{
+ facecolor_indx = col;
+ colortype = indexed_col;
+}
+
+
+inline void Face::setFaceColor( ColorRGBA col )
+{
+ facecolor_rgba = col;
+ colortype = rgb_col;
+}
+
+
+inline void Face::getColorChannels( float& r, float& g, float& b ) const
+{
+ r = facecolor_rgba.R / 255.0f;
+ g = facecolor_rgba.G / 255.0f;
+ b = facecolor_rgba.B / 255.0f;
+}
+
+
+inline Vertex2& Face::MapXY( int indx )
+{
+ if ( facemapping == 0 )
+ facemapping = new TriMapping;
+ return facemapping->getMapXY( indx );
+}
+
+
+inline Vertex2& Face::MapUV( int indx )
+{
+ if ( facemapping == 0 )
+ facemapping = new TriMapping;
+ return facemapping->getMapUV( indx );
+}
+
+
+}
+
+
+
+
+# 15 "../BspLib/BspObject.h" 2
+
+# 1 "../BspLib/Mapping.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+
+
+
+
+class Mapping : public virtual SystemIO {
+
+ void Error( int vertindx );
+
+public:
+ Mapping() { numvertexindxs = 0; }
+ ~Mapping() { }
+
+ void InsertFaceVertex( int vindx ) { facevertexindxs[ numvertexindxs++ ] = vindx; }
+ void SetCorrespondence( int vindx, Vertex2 vertex );
+ Vertex2 FetchMapPoint( int vertindx );
+
+ int getNumVertices() { return numvertexindxs; }
+ void setNumVertices( int num ) { numvertexindxs = num; }
+ void setMappingCoordinates( int k, const Vertex2& vertex);
+
+ void WriteMappingInfo( FILE *fp ) const;
+
+private:
+ int numvertexindxs;
+ int facevertexindxs[ 32 ];
+ Vertex2 mappingcoordinates[ 32 ];
+};
+
+
+typedef Chunk<Mapping> MappingChunk;
+
+
+inline void Mapping::setMappingCoordinates( int k, const Vertex2& vertex)
+{
+ if ( k < 32 )
+ mappingcoordinates[ k ] = vertex;
+ else
+ Error( k );
+}
+
+
+inline void Mapping::SetCorrespondence( int vindx, Vertex2 vertex )
+{
+ if ( numvertexindxs < 32 ) {
+ facevertexindxs[ numvertexindxs ] = vindx;
+ mappingcoordinates[ numvertexindxs ] = vertex;
+ numvertexindxs++;
+ } else {
+ Error( numvertexindxs );
+ }
+}
+
+
+inline Vertex2 Mapping::FetchMapPoint( int vertindx )
+{
+ for ( int i = 0; i < numvertexindxs; i++ )
+ if ( facevertexindxs[ i ] == vertindx )
+ return mappingcoordinates[ i ];
+ Error( vertindx );
+ return Vertex2( 0, 0 );
+}
+
+
+}
+
+
+
+
+# 16 "../BspLib/BspObject.h" 2
+
+# 1 "../BspLib/PolygonList.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/Polygon.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+class BoundingBox;
+
+
+
+
+class VIndx {
+
+public:
+ VIndx( int indx = -1, VIndx *next = 0 ) { vertindx = indx; nextvertindx = next; }
+ ~VIndx() { delete nextvertindx; }
+
+ int getIndx() const { return vertindx; }
+ void setIndx( int indx ) { vertindx = indx; }
+
+ VIndx* getNext() const { return nextvertindx; }
+ void setNext( VIndx *next ) { nextvertindx = next; }
+
+private:
+ int vertindx;
+ VIndx* nextvertindx;
+};
+
+
+class BSPNode;
+class BspObject;
+
+
+
+
+class Polygon : public virtual SystemIO {
+
+ friend class PolygonListRep;
+
+ void Error() const;
+
+
+ enum {
+ POLY_IN_FRONT_SUBSPACE,
+ POLY_IN_BACK_SUBSPACE,
+ POLY_STRADDLES_SPLITTER,
+ POLY_IN_SAME_PLANE,
+ };
+
+
+ enum {
+ FRONT_SUBSPACE = 1,
+ BACK_SUBSPACE = -1
+ };
+
+public:
+
+
+ enum {
+ SPLITTERCRIT_FIRST_POLY = 0x0000,
+ SPLITTERCRIT_SAMPLE_FIRST_N = 0x0101,
+ SPLITTERCRIT_SAMPLE_ALL = 0x0002,
+ SPLITTERCRIT_RANDOM_SAMPLE = 0x0103,
+ SPLITTERCRITMASK_SAMPLESIZ = 0x0100,
+ };
+
+
+ enum {
+ MESSAGE_SPLITTING_POLYGON = 0x0001,
+ MESSAGE_STARTVERTEX_IN_SPLITTER_PLANE = 0x0002,
+ MESSAGE_VERTEX_IN_SPLITTER_PLANE = 0x0004,
+ MESSAGE_NEW_SPLITVERTEX = 0x0008,
+ MESSAGE_REUSING_SPLITVERTEX = 0x0010,
+ MESSAGE_TRACEVERTEX_INSERTED = 0x0020,
+ MESSAGE_SPLITTING_QUADRILATERAL = 0x0040,
+ MESSAGE_INVOCATION = 0x0080,
+ MESSAGE_CHECKING_POLYGON_PLANES = 0x0100,
+ MESSAGEMASK_DISPLAY_ALL = 0xffff
+ };
+
+public:
+ Polygon( BspObject *bobj, int pno = 0, int fno = 0, Polygon *next = 0 , int num = 1 );
+ ~Polygon() { delete vertindxs; delete nextpolygon; }
+
+ Polygon* NewPolygon();
+ Polygon* InsertPolygon( Polygon *poly );
+ Polygon* DeleteHead();
+ Polygon* FindPolygon( int id );
+ int SumVertexNumsEntireList();
+
+ void PrependNewVIndx( int indx );
+ void AppendNewVIndx( int indx = -1 );
+ void AppendVIndx( VIndx *vindx );
+ VIndx* UnlinkLastVIndx();
+
+ void CalcPlaneNormals();
+ void CheckEdges();
+ Polygon* CheckPlanesAndMappings();
+
+
+ void CalcBoundingBox( BoundingBox* &boundingbox );
+
+
+ int CheckIntersection( Polygon *testpoly );
+
+ int NormalDirectionSimilar( Polygon *testpoly );
+
+ void SplitPolygon( Polygon *poly, Polygon* &frontsubspace, Polygon* &backsubspace );
+
+ BSPNode* PartitionSpace();
+
+
+ void CorrectBase( BspObject *newbaseobj, int vertexindxbase, int faceidbase, int polygonidbase );
+ void CorrectBaseByTable( BspObject *newbaseobj, int *vtxindxmap, int faceidbase, int polygonidbase );
+
+ int getId() const { return polygonno; }
+ void setId( int pno ) { polygonno = pno; }
+
+ int getFaceId() const { return faceno; }
+ void setFaceId( int fno ) { faceno = fno; }
+
+ int getNumPolygons() const { return numpolygons; }
+ void setNumPolygons( int len ) { numpolygons = len; }
+
+ Polygon* getNext() const { return nextpolygon; }
+ void setNext( Polygon *next ) { nextpolygon = next; }
+
+ int getNumVertices() const { return numvertindxs; }
+
+ VIndx* getVList() const { return vertindxs; }
+ BspObject* getBaseObject() const { return baseobject; }
+
+ VertexChunk& getVertexList();
+ FaceChunk& getFaceList();
+
+ int HasArea() const;
+
+ int getFirstVertexIndx() const;
+ int getSecondVertexIndx() const;
+ int getThirdVertexIndx() const;
+
+ Vertex3 getFirstVertex() const;
+ Vertex3 getSecondVertex() const;
+ Vertex3 getThirdVertex() const;
+
+ Plane getPlane() const { return ((Polygon *const)this)->getFaceList()[ faceno ].getPlane(); }
+ Vector3 getPlaneNormal() const { return ((Polygon *const)this)->getFaceList()[ faceno ].getPlaneNormal(); }
+
+ void FillVertexIndexArray( dword *arr ) const;
+ void WriteVertexList( FILE *fp, int cr ) const;
+ void WritePolyList( FILE *fp ) const;
+
+ int CalcSplitterTestProbability();
+
+public:
+ static int getSplitterSelection() { return splitter_crit; }
+ static void setSplitterSelection( int criterion ) { splitter_crit = criterion; }
+
+ static int getSampleSize() { return sample_size; }
+ static void setSampleSize( int siz ) { sample_size = siz; }
+
+ static int getTriangulationFlag() { return triangulate_all; }
+ static void setTriangulationFlag( int flag ) { triangulate_all = flag; }
+
+ static int getNormalizeVectorsFlag() { return normalize_vectors; }
+ static void setNormalizeVectorsFlag( int flag ) { normalize_vectors = flag; }
+
+ static int getDisplayMessagesFlag() { return display_messages; }
+ static void setDisplayMessagesFlag( int flag ) { display_messages = flag; }
+
+ static void ResetCallCount() { partition_callcount = 0; }
+
+private:
+ static int splitter_crit;
+ static int sample_size;
+ static int triangulate_all;
+ static int normalize_vectors;
+ static int display_messages;
+ static int partition_callcount;
+ static int test_probability;
+ static char str_scratchpad[];
+
+private:
+ int polygonno;
+ int faceno;
+ int numpolygons;
+ int numvertindxs;
+ VIndx* vertindxs;
+ VIndx* vindxinsertpos;
+ BspObject* baseobject;
+ Polygon* nextpolygon;
+};
+
+
+inline int Polygon::HasArea() const
+{
+
+
+ return ( vertindxs && vertindxs->getNext() && vertindxs->getNext()->getNext() );
+}
+
+
+inline int Polygon::getFirstVertexIndx() const
+{
+
+ if ( vertindxs == 0 )
+ Error();
+ ;
+ return vertindxs->getIndx();
+}
+inline Vertex3 Polygon::getFirstVertex() const
+{
+
+ if ( vertindxs == 0 )
+ Error();
+ ;
+ return ((Polygon *const)this)->getVertexList()[ vertindxs->getIndx() ];
+}
+
+
+inline int Polygon::getSecondVertexIndx() const
+{
+
+ if ( ( vertindxs == 0 ) || ( vertindxs->getNext() == 0 ) )
+ Error();
+ ;
+ return vertindxs->getNext()->getIndx();
+}
+inline Vertex3 Polygon::getSecondVertex() const
+{
+
+ if ( ( vertindxs == 0 ) || ( vertindxs->getNext() == 0 ) )
+ Error();
+ ;
+ return ((Polygon *const)this)->getVertexList()[ vertindxs->getNext()->getIndx() ];
+}
+
+
+inline int Polygon::getThirdVertexIndx() const
+{
+
+ if ( ( vertindxs == 0 ) ||
+ ( vertindxs->getNext() == 0 ) ||
+ ( vertindxs->getNext()->getNext() == 0 ) )
+ Error();
+ ;
+ return vertindxs->getNext()->getNext()->getIndx();
+}
+inline Vertex3 Polygon::getThirdVertex() const
+{
+
+ if ( ( vertindxs == 0 ) ||
+ ( vertindxs->getNext() == 0 ) ||
+ ( vertindxs->getNext()->getNext() == 0 ) )
+ Error();
+ ;
+ return ((Polygon *const)this)->getVertexList()[ vertindxs->getNext()->getNext()->getIndx() ];
+}
+
+
+}
+
+
+
+
+# 13 "../BspLib/PolygonList.h" 2
+
+
+
+
+namespace BspLib {
+
+
+class BSPNode;
+class BspObject;
+
+
+
+
+class PolygonListRep : public virtual SystemIO {
+
+ friend class PolygonList;
+
+
+ enum {
+ E_NEWVINDX,
+ E_APPENDVINDX,
+ E_GETNUMVERTXS
+ };
+
+
+ void Error( int err ) const;
+
+private:
+ PolygonListRep( BspObject *bobj );
+ ~PolygonListRep() { delete list; }
+
+ void MergeLists( PolygonListRep *mergelist );
+
+ Polygon* InitList( Polygon *listhead );
+
+
+ void InvalidateList() { list = 0 ; numpolygons = 0; }
+
+ Polygon* FetchHead() { return list; }
+ Polygon* UnlinkHead();
+ Polygon* DeleteHead();
+ Polygon* FindPolygon( int id ) { return list ? list->FindPolygon( id ) : 0 ; }
+
+ Polygon* NewPolygon();
+ Polygon* InsertPolygon( Polygon *poly );
+
+ void PrependNewVIndx( int indx = -1 ) { if ( list == 0 ) Error( E_NEWVINDX ); list->PrependNewVIndx( indx ); }
+ void AppendNewVIndx( int indx = -1 ) { if ( list == 0 ) Error( E_NEWVINDX ); list->AppendNewVIndx( indx ); }
+ void AppendVIndx( VIndx *vindx ) { if ( list == 0 ) Error( E_APPENDVINDX ); list->AppendVIndx( vindx ); }
+ Polygon* CalcPlaneNormals();
+ Polygon* CheckPolygonPlanes();
+ BSPNode* PartitionSpace();
+
+ void WritePolyList( FILE *fp, int no ) const;
+
+ int getNumElements() const { return numpolygons; }
+ int getNumVertices() const { if( list == 0 ) Error( E_GETNUMVERTXS ); return list->getNumVertices(); }
+
+private:
+ int ref_count;
+ int numpolygons;
+ BspObject* baseobject;
+ Polygon* list;
+};
+
+
+inline PolygonListRep::PolygonListRep( BspObject *bobj ) : ref_count( 0 )
+{
+ baseobject = bobj;
+ list = 0 ;
+ numpolygons = 0;
+}
+
+
+
+
+class PolygonList {
+
+public:
+ PolygonList( BspObject *bobj ) { rep = new PolygonListRep( bobj ); rep->ref_count = 1; }
+ ~PolygonList() { if ( --rep->ref_count == 0 ) delete rep; }
+
+ PolygonList( const PolygonList& copyobj );
+ PolygonList& operator =( const PolygonList& copyobj );
+
+ void MergeLists( PolygonList *mergelist ) { if ( mergelist ) rep->MergeLists( mergelist->rep ); }
+
+ Polygon* InitList( Polygon *listhead ) { return rep->InitList( listhead ); }
+ void InvalidateList() { rep->InvalidateList(); }
+
+ Polygon* FetchHead() { return rep->FetchHead(); }
+ Polygon* UnlinkHead() { return rep->UnlinkHead(); }
+ Polygon* DeleteHead() { return rep->DeleteHead(); }
+ Polygon* FindPolygon( int id ) { return rep->FindPolygon( id ); }
+
+ Polygon* NewPolygon() { return rep->NewPolygon(); }
+ Polygon* InsertPolygon( Polygon *poly ) { return rep->InsertPolygon( poly ); }
+
+ void PrependNewVIndx( int indx = -1 ) { rep->PrependNewVIndx( indx ); }
+ void AppendNewVIndx( int indx = -1 ) { rep->AppendNewVIndx( indx ); }
+ void AppendVIndx( VIndx *vindx ) { rep->AppendVIndx( vindx ); }
+ Polygon* CalcPlaneNormals() { return rep->CalcPlaneNormals(); }
+ Polygon* CheckPolygonPlanes() { return rep->CheckPolygonPlanes(); }
+ BSPNode* PartitionSpace() { return rep->PartitionSpace(); }
+
+ void WritePolyList( FILE *fp, int no ) const { rep->WritePolyList( fp, no ); }
+
+ int getNumElements() const { return rep->getNumElements(); }
+ int getNumVertices() const { return rep->getNumVertices(); }
+
+private:
+ PolygonListRep* rep;
+};
+
+
+inline PolygonList::PolygonList( const PolygonList& copyobj )
+{
+ rep = copyobj.rep;
+ rep->ref_count++;
+}
+
+
+inline PolygonList& PolygonList::operator =( const PolygonList& copyobj )
+{
+ if ( &copyobj != this ) {
+
+ if ( --rep->ref_count == 0 ) {
+ delete rep;
+ }
+ rep = copyobj.rep;
+ rep->ref_count++;
+ }
+ return *this;
+}
+
+
+}
+
+
+
+
+# 17 "../BspLib/BspObject.h" 2
+
+# 1 "../BspLib/BSPTree.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/BspNode.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+class BoundingBox;
+class BspObject;
+
+
+
+
+class BSPNode {
+
+public:
+
+
+ enum {
+ OUTPUT_OLD_STYLE,
+ OUTPUT_KEY_VALUE_STYLE
+ };
+
+public:
+ BSPNode( BSPNode *front = 0 , BSPNode *back = 0 ,
+ Polygon *poly = 0 , Polygon *backpoly = 0 ,
+ Plane *sep = 0 , BoundingBox *box = 0 , int num = -1 );
+ ~BSPNode();
+
+public:
+ void NumberBSPNodes( int& curno );
+ void SumVertexNums( int& vtxnum );
+ void CorrectPolygonBases( BspObject *newbaseobj, int vertexindxbase, int faceidbase, int polygonidbase );
+ void CorrectPolygonBasesByTable( BspObject *newbaseobj, int *vtxindxmap, int faceidbase, int polygonidbase );
+ void WriteBSPTree( FILE *fp );
+ void CheckEdges();
+ void FetchFacePolygons( int facno, PolygonList& facepolylist );
+ Polygon* FetchBSPPolygon( int polyno );
+ void CalcBoundingBoxes();
+ void CalcSeparatorPlanes();
+
+ int getNodeNumber() const { return nodenumber; }
+ Polygon* getPolygon() { return polygon; }
+ Polygon* getBackPolygon() { return backpolygon; }
+ BSPNode* getFrontSubtree() const { return frontsubtree; }
+ BSPNode* getBackSubtree() const { return backsubtree; }
+
+ Plane* getSeparatorPlane() { return separatorplane; }
+ void setSeparatorPlane( Plane *sep ) { separatorplane = sep; }
+
+ BoundingBox*getBoundingBox() { return boundingbox; }
+ void setBoundingBox( BoundingBox *box ) { boundingbox = box; }
+
+private:
+ void GrowBoundingBox( BSPNode *othernode );
+
+public:
+ static int getOutputFormat() { return outputformat; }
+ static void setOutputFormat( int format ) { outputformat = format; }
+
+private:
+ static int outputformat;
+
+private:
+ int nodenumber;
+ Polygon* polygon;
+ Polygon* backpolygon;
+ Plane* separatorplane;
+ BoundingBox*boundingbox;
+ BSPNode* frontsubtree;
+ BSPNode* backsubtree;
+};
+
+
+
+
+class BSPNodeFlat {
+
+public:
+ BSPNodeFlat( int front = 0, int back = 0,
+ Polygon *poly = 0 , int clist = 0, int blist = 0,
+ Plane *sep = 0 , BoundingBox *box = 0 , int num = -1 );
+ ~BSPNodeFlat() { }
+
+public:
+ void InitNode( int front, int back, Polygon *poly, int clist, int blist,
+ Plane *sep = 0 , BoundingBox *box = 0 , int num = -1 );
+
+ void ApplyScaleFactor( double sfac );
+
+ int getNodeNumber() const { return nodenumber; }
+ Polygon* getPolygon() { return polygon; }
+ int getContainedList() const { return containedlistindx; }
+ int getBackList() const { return backlistindx; }
+ int getFrontSubTree() const { return frontsubtreeindx; }
+ int getBackSubTree() const { return backsubtreeindx; }
+
+ Plane* getSeparatorPlane() { return separatorplane; }
+ void setSeparatorPlane( Plane *sep ) { separatorplane = sep; }
+
+ BoundingBox*getBoundingBox() { return boundingbox; }
+ void setBoundingBox( BoundingBox *box ) { boundingbox = box; }
+
+private:
+ int nodenumber;
+ Polygon* polygon;
+ Plane* separatorplane;
+ BoundingBox*boundingbox;
+ int containedlistindx;
+ int backlistindx;
+ int frontsubtreeindx;
+ int backsubtreeindx;
+};
+
+
+}
+
+
+
+
+# 13 "../BspLib/BSPTree.h" 2
+
+
+
+namespace BspLib {
+
+
+
+
+class BSPTreeRep {
+
+ friend class BSPTree;
+
+private:
+ BSPTreeRep() : ref_count( 0 ) { root = 0 ; }
+ ~BSPTreeRep() { delete root; }
+
+ BSPNode* InitTree( BSPNode *rootnode );
+ BSPNode* getRoot() { return root; }
+
+ void InvalidateTree();
+
+ int TreeEmpty() const { return ( root == 0 ); }
+
+private:
+ int ref_count;
+ BSPNode* root;
+};
+
+
+inline BSPNode *BSPTreeRep::InitTree( BSPNode *rootnode )
+{
+ delete root;
+ return ( root = rootnode );
+}
+
+
+inline void BSPTreeRep::InvalidateTree()
+{
+ root = 0 ;
+}
+
+
+
+
+class BSPTree {
+
+public:
+ BSPTree() { rep = new BSPTreeRep; rep->ref_count = 1; }
+ ~BSPTree() { if ( --rep->ref_count == 0 ) delete rep; }
+
+ BSPTree( const BSPTree& copyobj );
+ BSPTree& operator =( const BSPTree& copyobj );
+
+
+ BSPNode* operator->() { return rep->getRoot(); }
+
+ BSPNode* InitTree( BSPNode *rootnode ) { return rep->InitTree( rootnode ); }
+ BSPNode* getRoot() { return rep->getRoot(); }
+
+ void InvalidateTree() { rep->InvalidateTree(); }
+
+ int TreeEmpty() const { return rep->TreeEmpty(); }
+
+private:
+ BSPTreeRep* rep;
+};
+
+
+inline BSPTree::BSPTree( const BSPTree& copyobj )
+{
+ rep = copyobj.rep;
+ rep->ref_count++;
+}
+
+
+inline BSPTree& BSPTree::operator =( const BSPTree& copyobj )
+{
+ if ( &copyobj != this ) {
+ if ( --rep->ref_count == 0 ) {
+ delete rep;
+ }
+ rep = copyobj.rep;
+ rep->ref_count++;
+ }
+ return *this;
+}
+
+
+
+
+class BSPTreeFlatRep {
+
+ friend class BSPTreeFlat;
+
+private:
+ BSPTreeFlatRep() : ref_count( 0 ) { root = 0 ; numnodes = 0; nodestorage = 0; }
+ ~BSPTreeFlatRep() { delete[] root; }
+
+ BSPNodeFlat* AppendNode( int front, int back, Polygon *poly, int clist, int blist );
+ BSPNodeFlat* FetchNodePerId( int id );
+ BSPNode* BuildBSPTree( int nodenum );
+ BSPNodeFlat* getRoot() { return root; }
+
+ int TreeEmpty() const { return ( root == 0 ); }
+ int getNumNodes() const { return numnodes; }
+
+ void ApplyScaleFactor( double sfac );
+ void DestroyTree() { delete[] root; root = 0 ; numnodes = 0; nodestorage = 0; }
+
+private:
+ int ref_count;
+ int numnodes;
+ int nodestorage;
+ BSPNodeFlat* root;
+};
+
+
+
+
+class BSPTreeFlat {
+
+public:
+ BSPTreeFlat() { rep = new BSPTreeFlatRep; rep->ref_count = 1; }
+ ~BSPTreeFlat() { if ( --rep->ref_count == 0 ) delete rep; }
+
+ BSPTreeFlat( const BSPTreeFlat& copyobj );
+ BSPTreeFlat& operator =( const BSPTreeFlat& copyobj );
+
+ BSPNodeFlat* AppendNode( int front, int back, Polygon *poly, int clist, int blist )
+ { return rep->AppendNode( front, back, poly, clist, blist ); }
+ BSPNodeFlat* FetchNodePerId( int id ) { return rep->FetchNodePerId( id ); }
+ BSPNode* BuildBSPTree( int nodenum ) { return rep->BuildBSPTree( nodenum ); }
+ BSPNodeFlat* getRoot() { return rep->getRoot(); }
+
+ int TreeEmpty() const { return rep->TreeEmpty(); }
+ int getNumNodes() const { return rep->getNumNodes(); }
+
+ void ApplyScaleFactor( double sfac ) { rep->ApplyScaleFactor( sfac ); }
+ void DestroyTree() { rep->DestroyTree(); }
+
+private:
+ BSPTreeFlatRep* rep;
+};
+
+
+inline BSPTreeFlat::BSPTreeFlat( const BSPTreeFlat& copyobj )
+{
+ rep = copyobj.rep;
+ rep->ref_count++;
+}
+
+
+inline BSPTreeFlat& BSPTreeFlat::operator =( const BSPTreeFlat& copyobj )
+{
+ if ( &copyobj != this ) {
+ if ( --rep->ref_count == 0 ) {
+ delete rep;
+ }
+ rep = copyobj.rep;
+ rep->ref_count++;
+ }
+ return *this;
+}
+
+
+}
+
+
+
+
+# 18 "../BspLib/BspObject.h" 2
+
+
+# 1 "../BspLib/Transform3.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+
+class Transform3 {
+
+ friend Transform3 operator *( const Transform3& trafo1, const Transform3& trafo2 );
+
+public:
+ Transform3();
+ Transform3( const float trafo[4][4] );
+ Transform3( const double trafo[4][4] );
+ ~Transform3() { }
+
+
+ Vector3 TransformVector3( const Vector3& vec ) const;
+
+
+ Transform3& Concat( const Transform3& cattrafo );
+ Transform3& ConcatR( const Transform3& cattrafo );
+
+
+ Transform3& LoadIdentity();
+ Transform3& LoadRotation( double angle, double x, double y, double z );
+ Transform3& LoadScale( double x, double y, double z );
+ Transform3& LoadTranslation( double x, double y, double z );
+
+
+ Transform3& Rotate( double angle, double x, double y, double z );
+ Transform3& Scale( double x, double y, double z );
+ Transform3& Translate( double x, double y, double z );
+
+
+ Transform3& RotateR( double angle, double x, double y, double z );
+ Transform3& ScaleR( double x, double y, double z );
+ Transform3& TranslateR( double x, double y, double z );
+
+
+ Vector3 FetchTranslation() const;
+ Vector3 ExtractTranslation();
+
+private:
+
+ double m_matrix[4][4];
+};
+
+
+inline Transform3& Transform3::LoadIdentity()
+{
+ memset( m_matrix, 0, sizeof( m_matrix ) );
+
+ m_matrix[ 0 ][ 0 ] = 1.0;
+ m_matrix[ 1 ][ 1 ] = 1.0;
+ m_matrix[ 2 ][ 2 ] = 1.0;
+ m_matrix[ 3 ][ 3 ] = 1.0;
+
+ return *this;
+}
+
+
+inline Transform3::Transform3()
+{
+
+}
+
+
+inline Transform3::Transform3( const double trafo[4][4] )
+{
+
+
+
+ memcpy( m_matrix, trafo, sizeof( m_matrix ) );
+}
+
+
+inline Transform3::Transform3( const float trafo[4][4] )
+{
+
+
+
+ for ( int i = 0; i < 16; i++ )
+ ((double *)m_matrix)[ i ] = (double) ((float *)trafo)[ i ];
+}
+
+
+}
+
+
+
+
+# 20 "../BspLib/BspObject.h" 2
+
+
+
+
+namespace BspLib {
+
+
+class BoundingBox;
+
+
+
+
+class BspObjectInfo {
+
+ friend class BspObject;
+
+private:
+ BspObjectInfo();
+ ~BspObjectInfo() { }
+
+public:
+ int getNumVertices() const { return numvertices; }
+ int getNumPolygons() const { return numpolygons; }
+ int getNumFaces() const { return numfaces; }
+
+ int getInputVertices() const { return numvertices_in; }
+ int getInputPolygons() const { return numpolygons_in; }
+ int getInputFaces() const { return numfaces_in; }
+
+ int getBspPolygons() const { return numbsppolygons; }
+ int getPreBspPolygons() const { return numpolygons_before_bsp; }
+
+ int getNumTextures() const { return numtextures; }
+ int getNumMappings() const { return numcorrespondences; }
+ int getNumNormals() const { return numnormals; }
+ int getNumTexturedFaces() const { return numtexmappedfaces; }
+
+ int getNumTraceVertices() const { return numtracevertices; }
+ int getNumMultiVertices() const { return nummultvertices; }
+ int getNumSplitQuads() const { return numsplitquadrilaterals; }
+
+protected:
+ int numvertices;
+ int numpolygons;
+ int numfaces;
+ int numtextures;
+ int numcorrespondences;
+
+ int numnormals;
+ int numtexmappedfaces;
+
+ int numvertices_in;
+ int numpolygons_in;
+ int numfaces_in;
+
+ int numbsppolygons;
+ int numpolygons_before_bsp;
+
+ int numtracevertices;
+ int nummultvertices;
+ int numsplitquadrilaterals;
+};
+
+
+
+
+class BspObject : public BspObjectInfo, public virtual SystemIO {
+
+ friend class BoundingBox;
+ friend class BspObjectListRep;
+ friend class Face;
+ friend class ObjectBSPNode;
+ friend class Polygon;
+
+ friend class VrmlFile;
+
+public:
+ BspObject();
+ ~BspObject() { delete objectname; delete next; }
+
+ BspObject( const BspObject& copyobj );
+ BspObject& operator =( const BspObject& copyobj );
+
+
+
+ void MergeObjects( BspObject *mergeobj );
+
+ void CollapseObjectList();
+
+ BoundingBox* BuildBoundingBoxList();
+
+ BSPNode* BuildBSPTree();
+ BSPNode* BuildBSPTreeFromFlat();
+
+ int BspTreeAvailable();
+ int BSPTreeAvailable();
+ int BSPTreeFlatAvailable();
+
+
+ void CalcBoundingBoxes();
+ void CalcSeparatorPlanes();
+ void CheckEdges();
+ void CheckPolygonPlanes();
+ void CheckVertices( int verbose );
+ void CalcPlaneNormals();
+ void CheckParsedData();
+ void UpdateAttributeNumbers();
+
+ int ConvertColorIndexesToRGB( char *palette, int changemode );
+
+
+ void CalcBoundingBox( Vertex3& minvertex, Vertex3& maxvertex );
+
+
+ void DisplayStatistics();
+
+
+
+
+ virtual int WriteVertexList( FileAccess& fp ) { return 0 ; }
+ virtual int WritePolygonList( FileAccess& fp ) { return 0 ; }
+ virtual int WriteFaceList( FileAccess& fp ) { return 0 ; }
+ virtual int WriteFaceProperties( FileAccess& fp ) { return 0 ; }
+ virtual int WriteTextureList( FileAccess& fp ) { return 0 ; }
+ virtual int WriteMappingList( FileAccess& fp ) { return 0 ; }
+ virtual int WriteNormals( FileAccess& fp ) { return 0 ; }
+ virtual int WriteBSPTree( FileAccess& fp ) { return 0 ; }
+
+
+ VertexChunk& getVertexList() { return vertexlist; }
+ PolygonList& getPolygonList() { return polygonlist; }
+ FaceChunk& getFaceList() { return facelist; }
+ TextureChunk& getTextureList() { return texturelist; }
+ MappingChunk& getMappingList() { return mappinglist; }
+ BSPTree& getBSPTree() { return bsptree; }
+ BSPTreeFlat& getBSPTreeFlat() { return bsptreeflat; }
+
+
+ char* getObjectName() const { return objectname; }
+ void setObjectName( char *name );
+
+
+ Vertex3 getCenterInWorldSpace() const { return objecttrafo.FetchTranslation(); }
+ Transform3 getObjectTransformation() const { return objecttrafo; }
+ void setObjectTransformation( const Transform3& ot ) { objecttrafo = ot; }
+
+
+ void ApplyScale( double scalefac );
+
+
+ void ApplyCenter();
+
+
+ void ApplyTransformation();
+
+
+ BspObject* getNext() const { return next; }
+
+private:
+ void InconsistencyError( const char *err );
+
+public:
+ static int getEliminateDoubletsOnMergeFlag() { return check_vertex_doublets_on_merge; }
+ static void setEliminateDoubletsOnMergeFlag( int flag ) { check_vertex_doublets_on_merge = flag; }
+
+private:
+ static int check_vertex_doublets_on_merge;
+
+protected:
+
+ VertexChunk vertexlist;
+ PolygonList polygonlist;
+ FaceChunk facelist;
+ TextureChunk texturelist;
+ MappingChunk mappinglist;
+ BSPTree bsptree;
+ BSPTreeFlat bsptreeflat;
+ Transform3 objecttrafo;
+
+
+ char* objectname;
+
+
+ BspObject* next;
+};
+
+
+inline BspObject::BspObject( const BspObject& copyobj ) :
+ BspObjectInfo( copyobj ),
+ vertexlist( copyobj.vertexlist ),
+ polygonlist( copyobj.polygonlist ),
+ facelist( copyobj.facelist ),
+ texturelist( copyobj.texturelist ),
+ mappinglist( copyobj.mappinglist ),
+ bsptree( copyobj.bsptree ),
+ bsptreeflat( copyobj.bsptreeflat ),
+ objecttrafo( copyobj.objecttrafo )
+{
+
+ objectname = 0 ;
+ setObjectName( copyobj.objectname );
+
+
+ next = 0 ;
+}
+
+
+inline BspObject& BspObject::operator =( const BspObject& copyobj )
+{
+ if ( &copyobj != this ) {
+
+
+ *(BspObjectInfo *)this = copyobj;
+
+
+ vertexlist = copyobj.vertexlist;
+ polygonlist = copyobj.polygonlist;
+ facelist = copyobj.facelist;
+ texturelist = copyobj.texturelist;
+ mappinglist = copyobj.mappinglist;
+ bsptree = copyobj.bsptree;
+ bsptreeflat = copyobj.bsptreeflat;
+ objecttrafo = copyobj.objecttrafo;
+
+
+ setObjectName( copyobj.objectname );
+
+
+ next = 0 ;
+ }
+ return *this;
+}
+
+
+}
+
+
+
+
+# 13 "../BspLib/BoundingBox.h" 2
+
+
+
+
+namespace BspLib {
+
+
+
+
+class BoundingBox {
+
+ friend class ObjectBSPNode;
+
+public:
+ BoundingBox() { containedobject = 0 ; nextbox = 0 ; }
+ BoundingBox( BspObject *cobj, BoundingBox *next = 0 );
+ BoundingBox( const Vertex3& minvert, const Vertex3& maxvert, BoundingBox *next = 0 );
+ ~BoundingBox() { delete nextbox; }
+
+ void ApplyScaleFactor( double sfac );
+ void GrowBoundingBox( BoundingBox *otherbox );
+ void BoundingBoxListUnion( BoundingBox& unionbox );
+ ObjectBSPNode* PartitionSpace();
+
+ Vertex3 getMinVertex() const { return minvertex; }
+ Vertex3 getMaxVertex() const { return maxvertex; }
+ BspObject* getContainedObject() const { return containedobject; }
+ BoundingBox* getNext() const { return nextbox; }
+
+private:
+ Vertex3 minvertex;
+ Vertex3 maxvertex;
+ BspObject* containedobject;
+ BoundingBox* nextbox;
+};
+
+
+inline BoundingBox::BoundingBox( BspObject *cobj, BoundingBox *next )
+{
+ if ( ( containedobject = cobj ) != 0 ) {
+ cobj->CalcBoundingBox( minvertex, maxvertex );
+ }
+ nextbox = next;
+}
+
+
+inline BoundingBox::BoundingBox( const Vertex3& minvert, const Vertex3& maxvert, BoundingBox *next )
+{
+ minvertex = minvert;
+ maxvertex = maxvert;
+ containedobject = 0 ;
+ nextbox = next;
+}
+
+
+}
+
+
+
+
+# 13 "../BspLib/VrmlFile.h" 2
+
+# 1 "../BspLib/InputData3D.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/BspObjectList.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/ObjectBSPTree.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/ObjectBSPNode.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+
+class ObjectBSPNode {
+
+public:
+ ObjectBSPNode( ObjectBSPNode *front = 0 , ObjectBSPNode *back = 0 , Plane *sep = 0 , BoundingBox *bbox = 0 , int id = -1 );
+ ~ObjectBSPNode() { delete separatorplane; delete boundingbox; delete frontsubtree; delete backsubtree; }
+
+ void NumberBSPNodes( int& curno );
+ void WriteBSPTree( FILE *fp ) const;
+
+ BspObject* CreateObjectList();
+ BspObject* CreateMergedBSPTree();
+
+ void DeleteNodeBspObjects();
+
+ int getNodeNumber() const { return nodenumber; }
+ Plane* getSeparatorPlane() const { return separatorplane; }
+ BoundingBox* getBoundingBox() const { return boundingbox; }
+ ObjectBSPNode* getFrontSubtree() const { return frontsubtree; }
+ ObjectBSPNode* getBackSubtree() const { return backsubtree; }
+
+private:
+ void MergeTreeNodeObjects( BspObject *newobject );
+ BSPNode* CreateUnifiedBSPTree();
+
+private:
+ int nodenumber;
+ Plane* separatorplane;
+ BoundingBox* boundingbox;
+ ObjectBSPNode* frontsubtree;
+ ObjectBSPNode* backsubtree;
+};
+
+
+inline ObjectBSPNode::ObjectBSPNode( ObjectBSPNode *front, ObjectBSPNode *back, Plane *sep, BoundingBox *bbox, int id )
+{
+ frontsubtree = front;
+ backsubtree = back;
+ separatorplane = sep;
+ boundingbox = bbox;
+ nodenumber = id;
+}
+
+
+}
+
+
+
+
+# 13 "../BspLib/ObjectBSPTree.h" 2
+
+
+
+namespace BspLib {
+
+
+
+
+class ObjectBSPTreeRep {
+
+ friend class ObjectBSPTree;
+
+private:
+ ObjectBSPTreeRep() : ref_count( 0 ) { root = 0 ; }
+ ~ObjectBSPTreeRep() { delete root; }
+
+ void KillTree() { delete root; root = 0 ; }
+ ObjectBSPNode* InitTree( ObjectBSPNode *rootnode );
+ ObjectBSPNode* getRoot() { return root; }
+
+ int TreeEmpty() const { return ( root == 0 ); }
+
+private:
+ int ref_count;
+ ObjectBSPNode* root;
+};
+
+
+inline ObjectBSPNode *ObjectBSPTreeRep::InitTree( ObjectBSPNode *rootnode )
+{
+ delete root;
+ return ( root = rootnode );
+}
+
+
+
+
+class ObjectBSPTree {
+
+public:
+ ObjectBSPTree() { rep = new ObjectBSPTreeRep; rep->ref_count = 1; }
+ ~ObjectBSPTree() { if ( --rep->ref_count == 0 ) delete rep; }
+
+ ObjectBSPTree( const ObjectBSPTree& copyobj );
+ ObjectBSPTree& operator =( const ObjectBSPTree& copyobj );
+
+
+ ObjectBSPNode* operator->() { return rep->getRoot(); }
+
+ void KillTree() { rep->KillTree(); }
+ ObjectBSPNode* InitTree( ObjectBSPNode *rootnode ) { return rep->InitTree( rootnode ); }
+ ObjectBSPNode* getRoot() { return rep->getRoot(); }
+
+ int TreeEmpty() const { return rep->TreeEmpty(); }
+
+private:
+ ObjectBSPTreeRep* rep;
+};
+
+
+inline ObjectBSPTree::ObjectBSPTree( const ObjectBSPTree& copyobj )
+{
+ rep = copyobj.rep;
+ rep->ref_count++;
+}
+
+
+inline ObjectBSPTree& ObjectBSPTree::operator =( const ObjectBSPTree& copyobj )
+{
+ if ( &copyobj != this ) {
+ if ( --rep->ref_count == 0 ) {
+ delete rep;
+ }
+ rep = copyobj.rep;
+ rep->ref_count++;
+ }
+ return *this;
+}
+
+
+}
+
+
+
+
+# 14 "../BspLib/BspObjectList.h" 2
+
+
+
+namespace BspLib {
+
+
+
+
+class BspObjectListRep {
+
+ friend class BspObjectList;
+
+public:
+ BspObjectListRep() : ref_count( 0 ) { list = 0 ; }
+ ~BspObjectListRep() { delete list; }
+
+ BspObject* CreateNewObject();
+ BspObject* InsertObject( BspObject *obj );
+
+ BoundingBox* BuildBoundingBoxList();
+
+ int CountListObjects();
+
+ int PrepareObjectBSPTree( ObjectBSPTree& objbsptree );
+ int MergeObjectBSPTree( ObjectBSPTree& objbsptree );
+
+ int CollapseObjectList();
+
+ int ProcessObjects( int flags );
+
+ int BspTreeAvailable() { return list ? list->BspTreeAvailable() : 0 ; }
+ int BSPTreeAvailable() { return list ? list->BSPTreeAvailable() : 0 ; }
+ int BSPTreeFlatAvailable() { return list ? list->BSPTreeFlatAvailable() : 0 ; }
+
+ BspObject* getListHead() const { return list; }
+
+private:
+ int ref_count;
+ BspObject* list;
+};
+
+
+
+
+class BspObjectList {
+
+public:
+
+
+ enum {
+ CHECK_PLANES = 0x0001,
+ BUILD_BSP = 0x0002,
+ CHECK_VERTICES = 0x0004,
+ CHECK_EDGES = 0x0008,
+ BUILD_BSP_WITH_CHECKS = 0x000F,
+ DISPLAY_STATS = 0x0010,
+ BUILD_FROM_FLAT = 0x0020,
+ MERGE_VERTICES = 0x0040,
+ CULL_NULL_EDGES = 0x0080,
+ ELIMINATE_T_VERTICES = 0x0100,
+ MERGE_FACES = 0x0200,
+ CALC_PLANE_NORMALS = 0x0400,
+ CALC_BOUNDING_BOXES = 0x0800,
+ CALC_SEPARATOR_PLANES = 0x1000,
+ APPLY_TRANSFORMATIONS = 0x2000,
+ };
+
+public:
+ BspObjectList() { rep = new BspObjectListRep(); rep->ref_count = 1; }
+ ~BspObjectList() { if ( --rep->ref_count == 0 ) delete rep; }
+
+ BspObjectList( const BspObjectList& copyobj );
+ BspObjectList& operator =( const BspObjectList& copyobj );
+
+ BspObject* CreateNewObject() { return rep->CreateNewObject(); }
+ BspObject* InsertObject( BspObject *obj ) { return rep->InsertObject( obj ); }
+
+
+
+ BoundingBox* BuildBoundingBoxList() { return rep->BuildBoundingBoxList(); }
+
+ int CountListObjects() { return rep->CountListObjects(); }
+
+ int PrepareObjectBSPTree( ObjectBSPTree& objbsptree ) { return rep->PrepareObjectBSPTree( objbsptree ); }
+ int MergeObjectBSPTree( ObjectBSPTree& objbsptree ) { return rep->MergeObjectBSPTree( objbsptree ); }
+
+ int CollapseObjectList() { return rep->CollapseObjectList(); }
+
+
+ int ProcessObjects( int flags ) { return rep->ProcessObjects( flags ); }
+
+
+ int BspTreeAvailable() { return rep->BspTreeAvailable(); }
+
+ int BSPTreeAvailable() { return rep->BSPTreeAvailable(); }
+
+ int BSPTreeFlatAvailable() { return rep->BSPTreeFlatAvailable(); }
+
+
+
+
+
+
+
+
+ BspObject* getListHead() { return rep->getListHead(); }
+
+private:
+ BspObjectListRep *rep;
+};
+
+
+inline BspObjectList::BspObjectList( const BspObjectList& copyobj )
+{
+ rep = copyobj.rep;
+ rep->ref_count++;
+}
+
+
+inline BspObjectList& BspObjectList::operator =( const BspObjectList& copyobj )
+{
+ if ( &copyobj != this ) {
+
+ if ( --rep->ref_count == 0 ) {
+ delete rep;
+ }
+ rep = copyobj.rep;
+ rep->ref_count++;
+ }
+ return *this;
+}
+
+
+}
+
+
+
+
+# 13 "../BspLib/InputData3D.h" 2
+
+# 1 "../BspLib/IOData3D.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+
+class IOData3D : public virtual SystemIO {
+
+public:
+
+
+ enum {
+ DONT_CREATE_OBJECT = 0x0000,
+ UNKNOWN_FORMAT = 0x0001,
+ AOD_FORMAT_1_1 = 0x0002,
+ VRML_FORMAT_1_0 = 0x0003,
+ BSP_FORMAT_1_1 = 0x0004,
+ _3DX_FORMAT_1_0 = 0x0005,
+
+ };
+
+protected:
+
+
+ enum {
+ NO_CHECKS = 0x0000,
+ CHECK_FILENAME = 0x0001,
+ ALL_CHECKS = 0x0001
+ };
+
+public:
+ IOData3D( BspObjectList objectlist, const String& filename, int checkflags = ALL_CHECKS );
+ ~IOData3D() { }
+
+ BspObjectList getObjectList() const { return m_objectlist; }
+ String getFileName() const { return m_filename; }
+ void setFileName( const String& filename ) { m_filename = filename; }
+
+protected:
+ BspObjectList m_objectlist;
+ String m_filename;
+
+protected:
+
+ static const char AOD_SIGNATURE_1_1[];
+ static const char VRML_SIGNATURE_1_0[];
+ static const char BSP_SIGNATURE_1_1[];
+ static const char _3DX_SIGNATURE_1_0[];
+
+
+
+ static const int TEXTLINE_MAX;
+ static char line[];
+};
+
+
+}
+
+
+
+
+# 14 "../BspLib/InputData3D.h" 2
+
+
+
+namespace BspLib {
+
+
+
+
+class InputData3D : public IOData3D {
+
+public:
+
+ enum {
+ CONVERT_COLINDXS_TO_RGB = 0x0001,
+ FILTER_SCALE_FACTORS = 0x0002,
+ FILTER_AXES_DIR_SWITCH = 0x0004,
+ FILTER_AXES_EXCHANGE = 0x0008,
+ DO_AXES_EXCHANGE = FILTER_AXES_DIR_SWITCH | FILTER_AXES_EXCHANGE,
+ FORCE_MAXIMUM_EXTENT = 0x0010,
+ ALLOW_N_GONS = 0x0020,
+ };
+
+public:
+ InputData3D( BspObjectList objectlist, const char *filename, int format = UNKNOWN_FORMAT );
+ virtual ~InputData3D();
+
+ virtual int ParseObjectData();
+
+ int getObjectFormat() const { return m_objectformat; }
+ InputData3D* getRealObject() const { return m_data; }
+
+ int InputDataValid() const { return m_inputok; }
+
+
+ static int EnableRGBConversion( int enable );
+ static int EnableScaleFactors( int enable );
+ static int EnableAxesChange( int enable );
+ static int EnableMaximumExtent( int enable, double extent );
+ static int EnableAllowNGons( int enable );
+
+
+ static int getRGBConversionFlag() { return ( ( PostProcessingFlags & CONVERT_COLINDXS_TO_RGB ) == CONVERT_COLINDXS_TO_RGB ); }
+ static int getScaleFactorsFlag() { return ( ( PostProcessingFlags & FILTER_SCALE_FACTORS ) == FILTER_SCALE_FACTORS ); }
+ static int getAxesChangeFlag() { return ( ( PostProcessingFlags & DO_AXES_EXCHANGE ) == DO_AXES_EXCHANGE ); }
+ static int getEnforceExtentsFlag() { return ( ( PostProcessingFlags & FORCE_MAXIMUM_EXTENT ) == FORCE_MAXIMUM_EXTENT ); }
+ static double getMaxExtents() { return MaximumExtentToForce; }
+ static int getAllowNGonFlag() { return ( ( PostProcessingFlags & ALLOW_N_GONS ) == ALLOW_N_GONS ); }
+
+private:
+ int ReadFileSignature();
+
+protected:
+ static dword PostProcessingFlags;
+ static double MaximumExtentToForce;
+ static const char parser_err_str[];
+
+protected:
+ int m_objectformat;
+ int m_inputok;
+
+private:
+ InputData3D* m_data;
+};
+
+
+}
+
+
+
+
+# 14 "../BspLib/VrmlFile.h" 2
+
+
+
+namespace BspLib {
+
+
+class BspObjectList;
+
+
+
+class VrmlFile : public InputData3D {
+
+ friend class BRep;
+
+public:
+ VrmlFile( BspObjectList objectlist, const char *filename );
+ ~VrmlFile();
+
+ int ParseObjectData();
+ int WriteOutputFile();
+
+private:
+ void ApplySceneTransformations();
+ void EnforceSceneExtents( BoundingBox& unionbox );
+
+private:
+ BoundingBox* m_bboxlist;
+};
+
+
+}
+
+
+
+
+# 7 "QvState.h" 2
+
+
+
+class QvState {
+
+ public:
+
+
+ enum StackIndex {
+ CameraIndex,
+ Coordinate3Index,
+ LightIndex,
+ MaterialBindingIndex,
+ MaterialIndex,
+ NormalBindingIndex,
+ NormalIndex,
+ ShapeHintsIndex,
+ Texture2Index,
+ Texture2TransformationIndex,
+ TextureCoordinate2Index,
+ TransformationIndex,
+
+
+ NumStacks,
+ };
+
+ static const char *stackNames[NumStacks];
+
+ int depth;
+ QvElement **stacks;
+
+
+ BspLib ::VrmlFile *vrmlfile_base;
+ QvState( BspLib ::VrmlFile *base );
+
+
+ QvState();
+ ~QvState();
+
+
+ void addElement(StackIndex stackIndex, QvElement *elt);
+
+
+ QvElement * getTopElement(StackIndex stackIndex)
+ { return stacks[stackIndex]; }
+
+
+ void push();
+ void pop();
+
+
+ void popElement(StackIndex stackIndex);
+
+
+ void print();
+};
+
+
+# 3 "QvTraverse.cpp" 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+static int indent = 0;
+static void
+announce(const char *className)
+{
+ for (int i = 0; i < indent; i++)
+ printf("\t");
+ printf("Traversing a %s\n", className);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+void
+QvGroup::traverse(QvState *state)
+{
+ announce("QvGroup" ) ;
+ indent++;
+ for (int i = 0; i < getNumChildren(); i++)
+ getChild(i)->traverse(state);
+ indent--;
+}
+
+void
+QvLevelOfDetail::traverse(QvState *state)
+{
+ announce("QvLevelOfDetail" ) ;
+ indent++;
+
+
+
+ if (getNumChildren() > 0)
+ getChild(0)->traverse(state);
+
+ indent--;
+}
+
+void
+QvSeparator::traverse(QvState *state)
+{
+ announce("QvSeparator" ) ;
+ state->push();
+ indent++;
+ for (int i = 0; i < getNumChildren(); i++)
+ getChild(i)->traverse(state);
+ indent--;
+ state->pop();
+}
+
+void
+QvSwitch::traverse(QvState *state)
+{
+ announce("QvSwitch" ) ;
+ indent++;
+
+ int which = whichChild.value;
+
+ if (which == (-1) )
+ ;
+
+ else if (which == (-3) )
+ for (int i = 0; i < getNumChildren(); i++)
+ getChild(i)->traverse(state);
+
+ else
+ if (which < getNumChildren())
+ getChild(which)->traverse(state);
+
+ indent--;
+}
+
+void
+QvTransformSeparator::traverse(QvState *state)
+{
+ announce("QvTransformSeparator" ) ;
+
+
+
+
+
+
+ QvElement *markerElt = new QvElement;
+ markerElt->data = this;
+ markerElt->type = QvElement::NoOpTransform;
+ state->addElement(QvState::TransformationIndex, markerElt);
+
+ indent++;
+ for (int i = 0; i < getNumChildren(); i++)
+ getChild(i)->traverse(state);
+ indent--;
+
+
+ while (state->getTopElement(QvState::TransformationIndex) != markerElt)
+ state->popElement(QvState::TransformationIndex);
+}
+
+
+
+
+
+
+
+
+# 139 "QvTraverse.cpp"
+
+
+# 150 "QvTraverse.cpp"
+
+
+void QvCoordinate3::traverse(QvState *state)
+{
+ announce("QvCoordinate3" ) ;
+ QvElement *elt = new QvElement;
+ elt->data = this;
+ state->addElement(QvState::Coordinate3Index, elt);
+
+
+
+
+
+
+
+
+ printf( "---------------------------------------\n" );
+}
+
+
+
+void QvMaterial ::traverse(QvState *state) { announce("QvMaterial" ) ; QvElement *elt = new QvElement; elt->data = this; state->addElement(QvState:: MaterialIndex , elt); }
+void QvMaterialBinding ::traverse(QvState *state) { announce("QvMaterialBinding" ) ; QvElement *elt = new QvElement; elt->data = this; state->addElement(QvState:: MaterialBindingIndex , elt); }
+void QvNormal ::traverse(QvState *state) { announce("QvNormal" ) ; QvElement *elt = new QvElement; elt->data = this; state->addElement(QvState:: NormalIndex , elt); }
+void QvNormalBinding ::traverse(QvState *state) { announce("QvNormalBinding" ) ; QvElement *elt = new QvElement; elt->data = this; state->addElement(QvState:: NormalBindingIndex , elt); }
+void QvShapeHints ::traverse(QvState *state) { announce("QvShapeHints" ) ; QvElement *elt = new QvElement; elt->data = this; state->addElement(QvState:: ShapeHintsIndex , elt); }
+void QvTextureCoordinate2 ::traverse(QvState *state) { announce("QvTextureCoordinate2" ) ; QvElement *elt = new QvElement; elt->data = this; state->addElement(QvState:: TextureCoordinate2Index , elt); }
+void QvTexture2 ::traverse(QvState *state) { announce("QvTexture2" ) ; QvElement *elt = new QvElement; elt->data = this; state->addElement(QvState:: Texture2Index , elt); }
+void QvTexture2Transform ::traverse(QvState *state) { announce("QvTexture2Transform" ) ; QvElement *elt = new QvElement; elt->data = this; state->addElement(QvState:: Texture2TransformationIndex , elt); }
+
+void QvDirectionalLight ::traverse(QvState *state) { announce("QvDirectionalLight" ) ; QvElement *elt = new QvElement; elt->data = this; elt->type = QvElement:: DirectionalLight ; state->addElement(QvState:: LightIndex , elt); }
+void QvPointLight ::traverse(QvState *state) { announce("QvPointLight" ) ; QvElement *elt = new QvElement; elt->data = this; elt->type = QvElement:: PointLight ; state->addElement(QvState:: LightIndex , elt); }
+void QvSpotLight ::traverse(QvState *state) { announce("QvSpotLight" ) ; QvElement *elt = new QvElement; elt->data = this; elt->type = QvElement:: SpotLight ; state->addElement(QvState:: LightIndex , elt); }
+
+void QvOrthographicCamera ::traverse(QvState *state) { announce("QvOrthographicCamera" ) ; QvElement *elt = new QvElement; elt->data = this; elt->type = QvElement:: OrthographicCamera ; state->addElement(QvState:: CameraIndex , elt); }
+void QvPerspectiveCamera ::traverse(QvState *state) { announce("QvPerspectiveCamera" ) ; QvElement *elt = new QvElement; elt->data = this; elt->type = QvElement:: PerspectiveCamera ; state->addElement(QvState:: CameraIndex , elt); }
+
+void QvTransform ::traverse(QvState *state) { announce("QvTransform" ) ; QvElement *elt = new QvElement; elt->data = this; elt->type = QvElement:: Transform ; state->addElement(QvState:: TransformationIndex , elt); }
+void QvRotation ::traverse(QvState *state) { announce("QvRotation" ) ; QvElement *elt = new QvElement; elt->data = this; elt->type = QvElement:: Rotation ; state->addElement(QvState:: TransformationIndex , elt); }
+void QvMatrixTransform ::traverse(QvState *state) { announce("QvMatrixTransform" ) ; QvElement *elt = new QvElement; elt->data = this; elt->type = QvElement:: MatrixTransform ; state->addElement(QvState:: TransformationIndex , elt); }
+void QvTranslation ::traverse(QvState *state) { announce("QvTranslation" ) ; QvElement *elt = new QvElement; elt->data = this; elt->type = QvElement:: Translation ; state->addElement(QvState:: TransformationIndex , elt); }
+void QvScale ::traverse(QvState *state) { announce("QvScale" ) ; QvElement *elt = new QvElement; elt->data = this; elt->type = QvElement:: Scale ; state->addElement(QvState:: TransformationIndex , elt); }
+
+
+
+
+
+
+
+static void
+printProperties(QvState *state)
+{
+ printf("--------------------------------------------------------------\n");
+ state->print();
+ printf("--------------------------------------------------------------\n");
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/BRep.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "../BspLib/Transform2.h" 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+
+class Transform2 {
+
+ friend Transform2 operator *( const Transform2& trafo1, const Transform2& trafo2 );
+
+public:
+ Transform2();
+ Transform2( const float trafo[3][3] );
+ Transform2( const double trafo[3][3] );
+ ~Transform2() { }
+
+
+ Vector2 TransformVector2( const Vector2& vec ) const;
+
+ double Determinant();
+ int Inverse( Transform2& inverse );
+
+
+ Transform2& Concat( const Transform2& cattrafo );
+ Transform2& ConcatR( const Transform2& cattrafo );
+
+
+ Transform2& LoadIdentity();
+ Transform2& LoadRotation( double angle );
+ Transform2& LoadScale( double x, double y );
+ Transform2& LoadTranslation( double x, double y );
+
+
+ Transform2& Rotate( double angle );
+ Transform2& Scale( double x, double y );
+ Transform2& Translate( double x, double y );
+
+
+ Transform2& RotateR( double angle );
+ Transform2& ScaleR( double x, double y );
+ Transform2& TranslateR( double x, double y );
+
+
+ Vector2 FetchTranslation() const;
+ Vector2 ExtractTranslation();
+
+
+ double * LinMatrixAccess() { return (double *) m_matrix; }
+
+private:
+
+ double m_matrix[3][3];
+};
+
+
+inline Transform2& Transform2::LoadIdentity()
+{
+ memset( m_matrix, 0, sizeof( m_matrix ) );
+
+ m_matrix[ 0 ][ 0 ] = 1.0;
+ m_matrix[ 1 ][ 1 ] = 1.0;
+ m_matrix[ 2 ][ 2 ] = 1.0;
+
+ return *this;
+}
+
+
+inline Transform2::Transform2()
+{
+
+}
+
+
+inline Transform2::Transform2( const double trafo[3][3] )
+{
+
+
+
+ memcpy( m_matrix, trafo, sizeof( m_matrix ) );
+}
+
+
+inline Transform2::Transform2( const float trafo[3][3] )
+{
+
+
+
+ for ( int i = 0; i < 9; i++ )
+ ((double *)m_matrix)[ i ] = (double) ((float *)trafo)[ i ];
+}
+
+
+}
+
+
+
+
+# 16 "../BspLib/BRep.h" 2
+
+
+
+
+
+
+
+
+
+
+
+
+namespace BspLib {
+
+
+
+
+class BRep : public virtual SystemIO {
+
+public:
+ BRep( QvState *state );
+ ~BRep() { }
+
+ void BuildFromSpherePrimitive( const QvSphere& spherenode );
+ void BuildFromConePrimitive( const QvCone& spherenode );
+ void BuildFromCubePrimitive( const QvCube& spherenode );
+ void BuildFromCylinderPrimitive( const QvCylinder& spherenode );
+ void BuildFromIndexedFaceSet( const QvIndexedFaceSet& faceset );
+
+public:
+ static int getTriangulation() { return do_triangulation; }
+ static void setTriangulation( int tri ) { do_triangulation = tri; }
+
+ static int getTessellation() { return tessellation_slices; }
+ static void setTessellation( int tes ) { tessellation_slices = tes; }
+
+ static int getMaterialFlag() { return use_material_spec; }
+ static void setMaterialFlag( int mfl ) { use_material_spec = mfl; }
+
+ static int getMirrorTextureVFlag() { return mirror_v_axis; }
+ static void setMirrorTextureVFlag( int mtv ) { mirror_v_axis = mtv; }
+
+private:
+ float* FetchCoordinate3State( int &num );
+ float* FetchTextureCoordinate2State( int &num );
+ float* FetchNormalState( int &num );
+ void FetchTransformationState( Transform3& trafo );
+ void FetchTextureTransformationState( Transform2& trafo );
+ int FetchMaterialState( Material& mat, int indx );
+ void FetchMaterialBindingState( int& binding );
+ void FetchNormalBindingState( int& binding );
+ void FetchShapeHintsState();
+ Texture* CheckTexture2State();
+ void CreateIndexedFace( Texture *texture, int curindex, int numtexindexs, long *texindexs, int v1, int v2, int v3 );
+ void PostProcessObject();
+
+private:
+ static int shapehint_vertexOrdering;
+ static int shapehint_shapeType;
+ static int shapehint_faceType;
+ static float shapehint_creaseAngle;
+
+ static int use_material_spec;
+ static int mirror_v_axis;
+ static int do_triangulation;
+ static int tessellation_slices;
+
+private:
+ QvState* m_state;
+ BspObject* m_baseobject;
+};
+
+
+}
+
+
+
+
+# 239 "QvTraverse.cpp" 2
+
+
+void QvSphere::traverse(QvState *state)
+{
+ announce("QvSphere" ) ;
+ BspLib ::BRep brep( state );
+ brep.BuildFromSpherePrimitive( *this );
+}
+
+void QvCone::traverse(QvState *state)
+{
+ announce("QvCone" ) ;
+ BspLib ::BRep brep( state );
+ brep.BuildFromConePrimitive( *this );
+}
+
+void QvCube::traverse(QvState *state)
+{
+ announce("QvCube" ) ;
+ BspLib ::BRep brep( state );
+ brep.BuildFromCubePrimitive( *this );
+}
+
+
+void QvCylinder::traverse(QvState *state)
+{
+ announce("QvCylinder" ) ;
+ BspLib ::BRep brep( state );
+ brep.BuildFromCylinderPrimitive( *this );
+}
+
+void QvIndexedFaceSet::traverse(QvState *state)
+{
+ announce("QvIndexedFaceSet" ) ;
+
+
+
+
+
+
+ BspLib ::BRep brep( state );
+ brep.BuildFromIndexedFaceSet( *this );
+}
+
+
+
+
+
+void QvIndexedLineSet ::traverse(QvState *state) { announce("QvIndexedLineSet" ) ; printProperties(state); }
+void QvPointSet ::traverse(QvState *state) { announce("QvPointSet" ) ; printProperties(state); }
+
+
+
+
+
+
+
+
+
+
+void QvWWWAnchor ::traverse(QvState *) { announce("QvWWWAnchor" ) ; }
+void QvWWWInline ::traverse(QvState *) { announce("QvWWWInline" ) ; }
+
+
+
+
+
+
+
+void QvInfo ::traverse(QvState *) { announce("QvInfo" ) ; }
+void QvUnknownNode ::traverse(QvState *) { announce("QvUnknownNode" ) ; }
+
+
+
+
+
+
+
+
diff --git a/tool_src/QvLib/QvUnknownNode.cpp b/tool_src/QvLib/QvUnknownNode.cpp
new file mode 100644
index 0000000..7444669
--- /dev/null
+++ b/tool_src/QvLib/QvUnknownNode.cpp
@@ -0,0 +1,26 @@
+#include <QvUnknownNode.h>
+
+QV_NODE_SOURCE(QvUnknownNode);
+
+QvUnknownNode::QvUnknownNode()
+{
+ QV_NODE_CONSTRUCTOR(QvUnknownNode);
+
+ className = NULL;
+
+ // Set global field data to this instance's
+ instanceFieldData = new QvFieldData;
+ fieldData = instanceFieldData;
+}
+
+void
+QvUnknownNode::setClassName(const char *name)
+{
+ className = strdup(name);
+}
+
+QvUnknownNode::~QvUnknownNode()
+{
+ if (className != NULL)
+ free((void *) className);
+}
diff --git a/tool_src/QvLib/QvUnknownNode.h b/tool_src/QvLib/QvUnknownNode.h
new file mode 100644
index 0000000..68dde4f
--- /dev/null
+++ b/tool_src/QvLib/QvUnknownNode.h
@@ -0,0 +1,18 @@
+#ifndef _QV_UNKNOWN_NODE_
+#define _QV_UNKNOWN_NODE_
+
+#include <QvGroup.h>
+
+class QvUnknownNode : public QvGroup {
+
+ QV_NODE_HEADER(QvUnknownNode);
+
+ public:
+ const char *className;
+ QvFieldData *instanceFieldData;
+
+ void setClassName(const char *name);
+};
+
+#endif /* _QV_UNKNOWN_NODE_ */
+
diff --git a/tool_src/QvLib/QvWWWAnchor.cpp b/tool_src/QvLib/QvWWWAnchor.cpp
new file mode 100644
index 0000000..232fe6a
--- /dev/null
+++ b/tool_src/QvLib/QvWWWAnchor.cpp
@@ -0,0 +1,24 @@
+#include <QvWWWAnchor.h>
+
+QV_NODE_SOURCE(QvWWWAnchor);
+
+QvWWWAnchor::QvWWWAnchor()
+{
+ QV_NODE_CONSTRUCTOR(QvWWWAnchor);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(name);
+ QV_NODE_ADD_FIELD(map);
+
+ name.value = "";
+ map.value = NONE;
+
+ QV_NODE_DEFINE_ENUM_VALUE(Map, NONE);
+ QV_NODE_DEFINE_ENUM_VALUE(Map, POINT);
+
+ QV_NODE_SET_SF_ENUM_TYPE(map, Map);
+}
+
+QvWWWAnchor::~QvWWWAnchor()
+{
+}
diff --git a/tool_src/QvLib/QvWWWAnchor.h b/tool_src/QvLib/QvWWWAnchor.h
new file mode 100644
index 0000000..988a40e
--- /dev/null
+++ b/tool_src/QvLib/QvWWWAnchor.h
@@ -0,0 +1,24 @@
+#ifndef _QV_WWW_ANCHOR_
+#define _QV_WWW_ANCHOR_
+
+#include <QvSFEnum.h>
+#include <QvSFString.h>
+#include <QvGroup.h>
+
+class QvWWWAnchor : public QvGroup {
+
+ QV_NODE_HEADER(QvWWWAnchor);
+
+ public:
+
+ enum Map { // Map types:
+ NONE, // Leave URL name alone
+ POINT, // Add object coords to URL name
+ };
+
+ // Fields
+ QvSFString name; // URL name
+ QvSFEnum map; // How to map pick to URL name
+};
+
+#endif /* _QV_WWW_ANCHOR_ */
diff --git a/tool_src/QvLib/QvWWWInline.cpp b/tool_src/QvLib/QvWWWInline.cpp
new file mode 100644
index 0000000..13db2aa
--- /dev/null
+++ b/tool_src/QvLib/QvWWWInline.cpp
@@ -0,0 +1,24 @@
+#ifdef WIN32
+#include <QvSFString.h>
+#endif
+#include <QvWWWInline.h>
+
+QV_NODE_SOURCE(QvWWWInline);
+
+QvWWWInline::QvWWWInline()
+{
+ QV_NODE_CONSTRUCTOR(QvWWWInline);
+ isBuiltIn = TRUE;
+
+ QV_NODE_ADD_FIELD(name);
+ QV_NODE_ADD_FIELD(bboxSize);
+ QV_NODE_ADD_FIELD(bboxCenter);
+
+ name.value = "";
+ bboxSize.value[0] = bboxSize.value[0] = bboxSize.value[0] = 0.0;
+ bboxCenter.value[0] = bboxCenter.value[0] = bboxCenter.value[0] = 0.0;
+}
+
+QvWWWInline::~QvWWWInline()
+{
+}
diff --git a/tool_src/QvLib/QvWWWInline.h b/tool_src/QvLib/QvWWWInline.h
new file mode 100644
index 0000000..3dd1441
--- /dev/null
+++ b/tool_src/QvLib/QvWWWInline.h
@@ -0,0 +1,20 @@
+#ifndef _QV_WWW_INLINE_
+#define _QV_WWW_INLINE_
+
+#include <QvSFEnum.h>
+#include <QvSFVec3f.h>
+#include <QvSFString.h>
+#include <QvGroup.h>
+
+class QvWWWInline : public QvGroup {
+
+ QV_NODE_HEADER(QvWWWInline);
+
+ public:
+ // Fields
+ QvSFString name; // URL name
+ QvSFVec3f bboxSize; // Size of 3D bounding box
+ QvSFVec3f bboxCenter; // Center of 3D bounding box
+};
+
+#endif /* _QV_WWW_INLINE_ */
diff --git a/tool_src/QvLib/QvWWWInline.p b/tool_src/QvLib/QvWWWInline.p
new file mode 100644
index 0000000..917b9ab
--- /dev/null
+++ b/tool_src/QvLib/QvWWWInline.p
@@ -0,0 +1,9602 @@
+# 1 "QvWWWInline.cpp"
+
+
+
+# 1 "QvWWWInline.h" 1
+
+
+
+# 1 "QvSFEnum.h" 1
+
+
+
+# 1 "QvString.h" 1
+
+
+
+# 1 "QvBasic.h" 1
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/types.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/cdefs.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 121 "/usr/include/sys/cdefs.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 67 "/usr/include/sys/types.h" 2 3 4
+
+
+
+# 1 "/usr/include/machine/types.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/ppc/types.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef signed char int8_t;
+typedef unsigned char u_int8_t;
+typedef short int16_t;
+typedef unsigned short u_int16_t;
+typedef int int32_t;
+typedef unsigned int u_int32_t;
+typedef long long int64_t;
+typedef unsigned long long u_int64_t;
+
+typedef int32_t register_t;
+
+
+typedef int *intptr_t;
+typedef unsigned long *uintptr_t;
+
+
+
+# 30 "/usr/include/machine/types.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 70 "/usr/include/sys/types.h" 2 3 4
+
+
+# 1 "/usr/include/machine/ansi.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/ppc/ansi.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 34 "/usr/include/machine/ansi.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 72 "/usr/include/sys/types.h" 2 3 4
+
+# 1 "/usr/include/machine/endian.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/ppc/endian.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+unsigned long htonl (unsigned long) ;
+unsigned short htons (unsigned short) ;
+unsigned long ntohl (unsigned long) ;
+unsigned short ntohs (unsigned short) ;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 116 "/usr/include/ppc/endian.h" 3 4
+
+
+
+# 30 "/usr/include/machine/endian.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 73 "/usr/include/sys/types.h" 2 3 4
+
+
+
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+typedef unsigned short ushort;
+typedef unsigned int uint;
+
+
+typedef u_int64_t u_quad_t;
+typedef int64_t quad_t;
+typedef quad_t * qaddr_t;
+
+typedef char * caddr_t;
+typedef int32_t daddr_t;
+typedef int32_t dev_t;
+typedef u_int32_t fixpt_t;
+typedef u_int32_t gid_t;
+typedef u_int32_t ino_t;
+typedef long key_t;
+typedef u_int16_t mode_t;
+typedef u_int16_t nlink_t;
+typedef quad_t off_t;
+typedef int32_t pid_t;
+typedef quad_t rlim_t;
+typedef int32_t segsz_t;
+typedef int32_t swblk_t;
+typedef u_int32_t uid_t;
+
+
+
+
+
+
+
+
+
+
+
+typedef unsigned long clock_t;
+
+
+
+
+typedef long unsigned int size_t;
+
+
+
+
+typedef int ssize_t;
+
+
+
+
+typedef long time_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int32_t fd_mask;
+
+
+
+
+
+
+typedef struct fd_set {
+ fd_mask fds_bits[((( 256 ) + (( (sizeof(fd_mask) * 8 ) ) - 1)) / ( (sizeof(fd_mask) * 8 ) )) ];
+} fd_set;
+
+
+
+
+
+
+
+# 174 "/usr/include/sys/types.h" 3 4
+
+
+
+
+
+struct _pthread_handler_rec
+{
+ void (*routine)(void *);
+ void *arg;
+ struct _pthread_handler_rec *next;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct _opaque_pthread_t { long sig; struct _pthread_handler_rec *cleanup_stack; char opaque[596 ];} *pthread_t;
+
+typedef struct _opaque_pthread_attr_t { long sig; char opaque[36 ]; } pthread_attr_t;
+
+typedef struct _opaque_pthread_mutexattr_t { long sig; char opaque[8 ]; } pthread_mutexattr_t;
+
+typedef struct _opaque_pthread_mutex_t { long sig; char opaque[40 ]; } pthread_mutex_t;
+
+typedef struct _opaque_pthread_condattr_t { long sig; char opaque[4 ]; } pthread_condattr_t;
+
+typedef struct _opaque_pthread_cond_t { long sig; char opaque[24 ]; } pthread_cond_t;
+
+typedef struct { long sig; char opaque[4 ]; } pthread_once_t;
+
+
+
+typedef unsigned long pthread_key_t;
+
+
+# 10 "QvBasic.h" 2
+
+
+# 1 "/usr/include/libc.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/stdio.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef off_t fpos_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct __sbuf {
+ unsigned char *_base;
+ int _size;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct __sFILE {
+ unsigned char *_p;
+ int _r;
+ int _w;
+ short _flags;
+ short _file;
+ struct __sbuf _bf;
+ int _lbfsize;
+
+
+ void *_cookie;
+ int (*_close) (void *) ;
+ int (*_read) (void *, char *, int) ;
+ fpos_t (*_seek) (void *, fpos_t, int) ;
+ int (*_write) (void *, const char *, int) ;
+
+
+ struct __sbuf _ub;
+ unsigned char *_up;
+ int _ur;
+
+
+ unsigned char _ubuf[3];
+ unsigned char _nbuf[1];
+
+
+ struct __sbuf _lb;
+
+
+ int _blksize;
+ fpos_t _offset;
+} FILE;
+
+extern "C" {
+extern FILE __sF[];
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+void clearerr (FILE *) ;
+int fclose (FILE *) ;
+int feof (FILE *) ;
+int ferror (FILE *) ;
+int fflush (FILE *) ;
+int fgetc (FILE *) ;
+int fgetpos (FILE *, fpos_t *) ;
+char *fgets (char *, size_t, FILE *) ;
+FILE *fopen (const char *, const char *) ;
+int fprintf (FILE *, const char *, ...) ;
+int fputc (int, FILE *) ;
+int fputs (const char *, FILE *) ;
+size_t fread (void *, size_t, size_t, FILE *) ;
+FILE *freopen (const char *, const char *, FILE *) ;
+int fscanf (FILE *, const char *, ...) ;
+int fseek (FILE *, long, int) ;
+int fsetpos (FILE *, const fpos_t *) ;
+long ftell (FILE *) ;
+size_t fwrite (const void *, size_t, size_t, FILE *) ;
+int getc (FILE *) ;
+int getchar (void) ;
+char *gets (char *) ;
+
+extern int sys_nerr;
+extern const char * const sys_errlist[];
+
+void perror (const char *) ;
+int printf (const char *, ...) ;
+int putc (int, FILE *) ;
+int putchar (int) ;
+int puts (const char *) ;
+int remove (const char *) ;
+int rename (const char *, const char *) ;
+void rewind (FILE *) ;
+int scanf (const char *, ...) ;
+void setbuf (FILE *, char *) ;
+int setvbuf (FILE *, char *, int, size_t) ;
+int sprintf (char *, const char *, ...) ;
+int sscanf (const char *, const char *, ...) ;
+FILE *tmpfile (void) ;
+char *tmpnam (char *) ;
+int ungetc (int, FILE *) ;
+int vfprintf (FILE *, const char *, char * ) ;
+int vprintf (const char *, char * ) ;
+int vsprintf (char *, const char *, char * ) ;
+}
+
+
+
+
+
+
+
+
+extern "C" {
+char *ctermid (char *) ;
+FILE *fdopen (int, const char *) ;
+int fileno (FILE *) ;
+}
+
+
+
+
+
+
+extern "C" {
+char *fgetln (FILE *, size_t *) ;
+int fpurge (FILE *) ;
+int fseeko (FILE *, fpos_t, int) ;
+fpos_t ftello (FILE *) ;
+int getw (FILE *) ;
+int pclose (FILE *) ;
+FILE *popen (const char *, const char *) ;
+int putw (int, FILE *) ;
+void setbuffer (FILE *, char *, int) ;
+int setlinebuf (FILE *) ;
+char *tempnam (const char *, const char *) ;
+int snprintf (char *, size_t, const char *, ...) ;
+int vsnprintf (char *, size_t, const char *, char * ) ;
+int vscanf (const char *, char * ) ;
+int vsscanf (const char *, const char *, char * ) ;
+FILE *zopen (const char *, const char *, int) ;
+}
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+FILE *funopen (const void *,
+ int (*)(void *, char *, int),
+ int (*)(void *, const char *, int),
+ fpos_t (*)(void *, fpos_t, int),
+ int (*)(void *)) ;
+}
+
+
+
+
+
+
+
+extern "C" {
+int __srget (FILE *) ;
+int __svfscanf (FILE *, const char *, char * ) ;
+int __swbuf (int, FILE *) ;
+}
+
+
+
+
+
+
+
+static inline int __sputc(int _c, FILE *_p) {
+ if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
+ return (*_p->_p++ = _c);
+ else
+ return (__swbuf(_c, _p));
+}
+# 379 "/usr/include/stdio.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 29 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/standards.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 30 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/unistd.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/unistd.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 72 "/usr/include/unistd.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+ void
+ _exit (int) ;
+int access (const char *, int) ;
+unsigned int alarm (unsigned int) ;
+int chdir (const char *) ;
+int chown (const char *, uid_t, gid_t) ;
+int close (int) ;
+size_t confstr (int, char *, size_t) ;
+int dup (int) ;
+int dup2 (int, int) ;
+int execl (const char *, const char *, ...) ;
+int execle (const char *, const char *, ...) ;
+int execlp (const char *, const char *, ...) ;
+int execv (const char *, char * const *) ;
+int execve (const char *, char * const *, char * const *) ;
+int execvp (const char *, char * const *) ;
+pid_t fork (void) ;
+long fpathconf (int, int) ;
+char *getcwd (char *, size_t) ;
+gid_t getegid (void) ;
+uid_t geteuid (void) ;
+gid_t getgid (void) ;
+int getgroups (int, gid_t []) ;
+char *getlogin (void) ;
+pid_t getpgrp (void) ;
+pid_t getpid (void) ;
+pid_t getppid (void) ;
+uid_t getuid (void) ;
+int isatty (int) ;
+int link (const char *, const char *) ;
+off_t lseek (int, off_t, int) ;
+long pathconf (const char *, int) ;
+int pause (void) ;
+int pipe (int *) ;
+ssize_t read (int, void *, size_t) ;
+int rmdir (const char *) ;
+int setgid (gid_t) ;
+int setpgid (pid_t, pid_t) ;
+pid_t setsid (void) ;
+int setuid (uid_t) ;
+unsigned int sleep (unsigned int) ;
+long sysconf (int) ;
+pid_t tcgetpgrp (int) ;
+int tcsetpgrp (int, pid_t) ;
+char *ttyname (int) ;
+int unlink (const char *) ;
+ssize_t write (int, const void *, size_t) ;
+
+extern char *optarg;
+extern int optind, opterr, optopt, optreset;
+int getopt (int, char * const [], const char *) ;
+
+
+
+struct timeval;
+
+int acct (const char *) ;
+int async_daemon (void) ;
+char *brk (const char *) ;
+int chroot (const char *) ;
+char *crypt (const char *, const char *) ;
+int des_cipher (const char *, char *, long, int) ;
+int des_setkey (const char *key) ;
+int encrypt (char *, int) ;
+void endusershell (void) ;
+int exect (const char *, char * const *, char * const *) ;
+int fchdir (int) ;
+int fchown (int, int, int) ;
+int fsync (int) ;
+int ftruncate (int, off_t) ;
+int getdtablesize (void) ;
+int getgrouplist (const char *, int, int *, int *) ;
+long gethostid (void) ;
+int gethostname (char *, int) ;
+mode_t getmode (const void *, mode_t) ;
+ int
+ getpagesize (void) ;
+char *getpass (const char *) ;
+char *getusershell (void) ;
+char *getwd (char *) ;
+int initgroups (const char *, int) ;
+int iruserok (unsigned long, int, const char *, const char *) ;
+int mknod (const char *, mode_t, dev_t) ;
+int mkstemp (char *) ;
+char *mktemp (char *) ;
+int nfssvc (int, void *) ;
+int nice (int) ;
+
+
+
+
+# 1 "/usr/include/signal.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/signal.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/machine/signal.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/ppc/signal.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int sig_atomic_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef enum {
+ REGS_SAVED_NONE,
+ REGS_SAVED_CALLER,
+
+
+ REGS_SAVED_ALL
+} regs_saved_t;
+
+
+
+
+
+
+
+
+
+struct sigcontext {
+ int sc_onstack;
+ int sc_mask;
+ int sc_ir;
+ int sc_psw;
+ int sc_sp;
+ void *sc_regs;
+};
+
+
+
+# 27 "/usr/include/machine/signal.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 70 "/usr/include/sys/signal.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef unsigned int sigset_t;
+
+
+
+
+struct sigaction {
+
+ void (*sa_handler)(int);
+
+
+
+ sigset_t sa_mask;
+ int sa_flags;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef void (*sig_t) (int) ;
+
+
+
+
+struct sigaltstack {
+ char *ss_sp;
+ int ss_size;
+ int ss_flags;
+};
+
+
+
+
+
+
+
+struct sigvec {
+ void (*sv_handler)();
+ int sv_mask;
+ int sv_flags;
+};
+
+
+
+
+
+
+
+
+struct sigstack {
+ char *ss_sp;
+ int ss_onstack;
+};
+
+
+
+
+
+
+
+# 213 "/usr/include/sys/signal.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+void (*signal (int, void (*) (int) ) ) (int) ;
+}
+
+# 62 "/usr/include/signal.h" 2 3 4
+
+
+
+extern const char * const sys_signame[32 ];
+extern const char * const sys_siglist[32 ];
+
+
+extern "C" {
+int raise (int) ;
+
+int kill (pid_t, int) ;
+int sigaction (int, const struct sigaction *, struct sigaction *) ;
+int sigaddset (sigset_t *, int) ;
+int sigdelset (sigset_t *, int) ;
+int sigemptyset (sigset_t *) ;
+int sigfillset (sigset_t *) ;
+int sigismember (const sigset_t *, int) ;
+int sigpending (sigset_t *) ;
+int sigprocmask (int, const sigset_t *, sigset_t *) ;
+int sigsuspend (const sigset_t *) ;
+
+int killpg (pid_t, int) ;
+int sigblock (int) ;
+int siginterrupt (int, int) ;
+int sigpause (int) ;
+int sigreturn (struct sigcontext *) ;
+int sigsetmask (int) ;
+int sigvec (int, struct sigvec *, struct sigvec *) ;
+void psignal (unsigned int, const char *) ;
+
+
+}
+
+
+
+
+
+
+
+
+
+# 176 "/usr/include/unistd.h" 2 3 4
+
+
+int profil (char *, int, int, int) ;
+int rcmd (char **, int, const char *,
+ const char *, const char *, int *) ;
+char *re_comp (const char *) ;
+int re_exec (const char *) ;
+int readlink (const char *, char *, int) ;
+int reboot (int) ;
+int revoke (const char *) ;
+int rresvport (int *) ;
+int ruserok (const char *, int, const char *, const char *) ;
+char *sbrk (int) ;
+int select (int, fd_set *, fd_set *, fd_set *, struct timeval *) ;
+int setegid (gid_t) ;
+int seteuid (uid_t) ;
+int setgroups (int, const gid_t *) ;
+void sethostid (long) ;
+int sethostname (const char *, int) ;
+int setkey (const char *) ;
+int setlogin (const char *) ;
+void *setmode (const char *) ;
+int setpgrp (pid_t pid, pid_t pgrp) ;
+int setregid (gid_t, gid_t) ;
+int setreuid (uid_t, uid_t) ;
+int setrgid (gid_t) ;
+int setruid (uid_t) ;
+void setusershell (void) ;
+int swapon (const char *) ;
+int symlink (const char *, const char *) ;
+void sync (void) ;
+int syscall (int, ...) ;
+int truncate (const char *, off_t) ;
+int ttyslot (void) ;
+unsigned int ualarm (unsigned int, unsigned int) ;
+int unwhiteout (const char *) ;
+void usleep (unsigned int) ;
+void *valloc (size_t) ;
+pid_t vfork (void) ;
+
+extern char *suboptarg;
+int getsubopt (char **, char * const *, char **) ;
+
+
+int getattrlist (const char*,void*,void*,size_t,unsigned long) ;
+int setattrlist (const char*,void*,void*,size_t,unsigned long) ;
+int exchangedata (const char*,const char*,unsigned long) ;
+int checkuseraccess (const char*,uid_t,gid_t*,int,int,unsigned long) ;
+int getdirentriesattr (int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long) ;
+int searchfs (const char*,void*,void*,unsigned long,unsigned long,void*) ;
+
+int fsctl (const char *,unsigned long,void*,unsigned long) ;
+
+
+
+}
+
+
+# 31 "/usr/include/libc.h" 2 3 4
+
+
+
+
+
+
+# 1 "/usr/include/string.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+void *memchr (const void *, int, size_t) ;
+int memcmp (const void *, const void *, size_t) ;
+void *memcpy (void *, const void *, size_t) ;
+void *memmove (void *, const void *, size_t) ;
+void *memset (void *, int, size_t) ;
+char *strcat (char *, const char *) ;
+char *strchr (const char *, int) ;
+int strcmp (const char *, const char *) ;
+int strcoll (const char *, const char *) ;
+char *strcpy (char *, const char *) ;
+size_t strcspn (const char *, const char *) ;
+char *strerror (int) ;
+size_t strlen (const char *) ;
+char *strncat (char *, const char *, size_t) ;
+int strncmp (const char *, const char *, size_t) ;
+char *strncpy (char *, const char *, size_t) ;
+char *strpbrk (const char *, const char *) ;
+char *strrchr (const char *, int) ;
+size_t strspn (const char *, const char *) ;
+char *strstr (const char *, const char *) ;
+char *strtok (char *, const char *) ;
+size_t strxfrm (char *, const char *, size_t) ;
+
+
+
+int bcmp (const void *, const void *, size_t) ;
+void bcopy (const void *, void *, size_t) ;
+void bzero (void *, size_t) ;
+int ffs (int) ;
+char *index (const char *, int) ;
+void *memccpy (void *, const void *, int, size_t) ;
+char *rindex (const char *, int) ;
+int strcasecmp (const char *, const char *) ;
+char *strdup (const char *) ;
+void strmode (int, char *) ;
+int strncasecmp (const char *, const char *, size_t) ;
+char *strsep (char **, const char *) ;
+void swab (const void *, void *, size_t) ;
+
+}
+
+
+# 37 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/stdlib.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef __wchar_t rune_t;
+
+typedef __wchar_t wchar_t;
+
+
+typedef struct {
+ int quot;
+ int rem;
+} div_t;
+
+typedef struct {
+ long quot;
+ long rem;
+} ldiv_t;
+
+
+
+
+
+
+
+
+
+
+extern int __mb_cur_max;
+
+
+
+
+extern "C" {
+ void
+ abort (void) ;
+ int
+ abs (int) ;
+int atexit (void (*)(void)) ;
+double atof (const char *) ;
+int atoi (const char *) ;
+long atol (const char *) ;
+void *bsearch (const void *, const void *, size_t,
+ size_t, int (*)(const void *, const void *)) ;
+void *calloc (size_t, size_t) ;
+ div_t
+ div (int, int) ;
+ void
+ exit (int) ;
+void free (void *) ;
+char *getenv (const char *) ;
+ long
+ labs (long) ;
+ ldiv_t
+ ldiv (long, long) ;
+void *malloc (size_t) ;
+void qsort (void *, size_t, size_t,
+ int (*)(const void *, const void *)) ;
+int rand (void) ;
+void *realloc (void *, size_t) ;
+void srand (unsigned) ;
+double strtod (const char *, char **) ;
+long strtol (const char *, char **, int) ;
+unsigned long
+ strtoul (const char *, char **, int) ;
+int system (const char *) ;
+
+
+int mblen (const char *, size_t) ;
+size_t mbstowcs (wchar_t *, const char *, size_t) ;
+int wctomb (char *, wchar_t) ;
+int mbtowc (wchar_t *, const char *, size_t) ;
+size_t wcstombs (char *, const wchar_t *, size_t) ;
+
+
+int putenv (const char *) ;
+int setenv (const char *, const char *, int) ;
+
+
+
+void *alloca (size_t) ;
+
+char *getbsize (int *, long *) ;
+char *cgetcap (char *, char *, int) ;
+int cgetclose (void) ;
+int cgetent (char **, char **, char *) ;
+int cgetfirst (char **, char **) ;
+int cgetmatch (char *, char *) ;
+int cgetnext (char **, char **) ;
+int cgetnum (char *, char *, long *) ;
+int cgetset (char *) ;
+int cgetstr (char *, char *, char **) ;
+int cgetustr (char *, char *, char **) ;
+
+int daemon (int, int) ;
+char *devname (int, int) ;
+int getloadavg (double [], int) ;
+
+char *group_from_gid (unsigned long, int) ;
+int heapsort (void *, size_t, size_t,
+ int (*)(const void *, const void *)) ;
+char *initstate (unsigned long, char *, long) ;
+int mergesort (void *, size_t, size_t,
+ int (*)(const void *, const void *)) ;
+int radixsort (const unsigned char **, int, const unsigned char *,
+ unsigned) ;
+int sradixsort (const unsigned char **, int, const unsigned char *,
+ unsigned) ;
+long random (void) ;
+char *realpath (const char *, char resolved_path[]) ;
+char *setstate (char *) ;
+void srandom (unsigned long) ;
+char *user_from_uid (unsigned long, int) ;
+
+long long
+ strtoq (const char *, char **, int) ;
+unsigned long long
+ strtouq (const char *, char **, int) ;
+
+void unsetenv (const char *) ;
+
+}
+
+
+# 38 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/time.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct tm {
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_mon;
+ int tm_year;
+ int tm_wday;
+ int tm_yday;
+ int tm_isdst;
+ long tm_gmtoff;
+ char *tm_zone;
+};
+
+# 1 "/usr/include/gcc/darwin/2.95.2/g++/../machine/limits.h" 1 3
+
+
+# 1 "/usr/include/ppc/limits.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 3 "/usr/include/gcc/darwin/2.95.2/g++/../machine/limits.h" 2 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 100 "/usr/include/time.h" 2 3 4
+
+
+
+
+
+
+extern "C" {
+char *asctime (const struct tm *) ;
+clock_t clock (void) ;
+char *ctime (const time_t *) ;
+double difftime (time_t, time_t) ;
+struct tm *gmtime (const time_t *) ;
+struct tm *localtime (const time_t *) ;
+time_t mktime (struct tm *) ;
+size_t strftime (char *, size_t, const char *, const struct tm *) ;
+time_t time (time_t *) ;
+
+
+void tzset (void) ;
+
+
+
+char *timezone (int, int) ;
+void tzsetwall (void) ;
+
+}
+
+
+# 39 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/gcc/darwin/2.95.2/g++/../stdarg.h" 1 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/gcc/darwin/2.95.2/g++/../va-ppc.h" 1 3
+
+
+
+
+
+
+
+
+typedef char *__gnuc_va_list;
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 43 "/usr/include/gcc/darwin/2.95.2/g++/../va-ppc.h" 3
+
+
+
+void va_end (__gnuc_va_list);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 352 "/usr/include/gcc/darwin/2.95.2/g++/../va-ppc.h" 3
+
+# 42 "/usr/include/gcc/darwin/2.95.2/g++/../stdarg.h" 2 3
+
+# 131 "/usr/include/gcc/darwin/2.95.2/g++/../stdarg.h" 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 175 "/usr/include/gcc/darwin/2.95.2/g++/../stdarg.h" 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef __gnuc_va_list va_list;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 40 "/usr/include/libc.h" 2 3 4
+
+
+
+# 1 "/usr/include/sys/mount.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/ucred.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/param.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/syslimits.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 88 "/usr/include/sys/param.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/machine/param.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/ppc/param.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 30 "/usr/include/machine/param.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 102 "/usr/include/sys/param.h" 2 3 4
+
+# 1 "/usr/include/gcc/darwin/2.95.2/g++/../machine/limits.h" 1 3
+# 10 "/usr/include/gcc/darwin/2.95.2/g++/../machine/limits.h" 3
+
+# 108 "/usr/include/gcc/darwin/2.95.2/g++/../machine/limits.h" 3
+
+# 103 "/usr/include/sys/param.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 61 "/usr/include/sys/ucred.h" 2 3 4
+
+
+
+
+
+struct ucred {
+ u_long cr_ref;
+ uid_t cr_uid;
+ short cr_ngroups;
+ gid_t cr_groups[16 ];
+};
+
+
+
+
+# 88 "/usr/include/sys/ucred.h" 3 4
+
+
+
+# 62 "/usr/include/sys/mount.h" 2 3 4
+
+
+# 1 "/usr/include/sys/queue.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 184 "/usr/include/sys/queue.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 260 "/usr/include/sys/queue.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 378 "/usr/include/sys/queue.h" 3 4
+
+
+
+
+
+
+
+
+
+# 395 "/usr/include/sys/queue.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 453 "/usr/include/sys/queue.h" 3 4
+
+
+# 463 "/usr/include/sys/queue.h" 3 4
+
+
+# 473 "/usr/include/sys/queue.h" 3 4
+
+
+# 483 "/usr/include/sys/queue.h" 3 4
+
+
+
+
+
+
+
+
+# 502 "/usr/include/sys/queue.h" 3 4
+
+# 548 "/usr/include/sys/queue.h" 3 4
+
+
+
+# 64 "/usr/include/sys/mount.h" 2 3 4
+
+# 1 "/usr/include/sys/lock.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 74 "/usr/include/sys/lock.h" 3 4
+
+
+
+
+
+# 1 "/usr/include/mach/boolean.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/mach/machine/boolean.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/mach/ppc/boolean.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int boolean_t;
+
+
+# 27 "/usr/include/mach/machine/boolean.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 127 "/usr/include/mach/boolean.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 79 "/usr/include/sys/lock.h" 2 3 4
+
+
+
+struct slock{
+ volatile unsigned int lock_data[10];
+};
+
+
+
+
+
+typedef struct slock simple_lock_data_t;
+typedef struct slock *simple_lock_t;
+
+
+
+
+
+
+
+
+
+
+
+struct lock__bsd__ {
+ simple_lock_data_t
+ lk_interlock;
+ u_int lk_flags;
+ int lk_sharecount;
+ int lk_waitcount;
+ short lk_exclusivecount;
+ short lk_prio;
+ char *lk_wmesg;
+ int lk_timo;
+ pid_t lk_lockholder;
+ void *lk_lockthread;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct proc;
+
+void lockinit (struct lock__bsd__ *, int prio, char *wmesg, int timo,
+ int flags) ;
+int lockmgr (struct lock__bsd__ *, u_int flags,
+ simple_lock_t, struct proc *p) ;
+int lockstatus (struct lock__bsd__ *) ;
+
+
+# 65 "/usr/include/sys/mount.h" 2 3 4
+
+# 1 "/usr/include/net/radix.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct radix_node {
+ struct radix_mask *rn_mklist;
+ struct radix_node *rn_p;
+ short rn_b;
+ char rn_bmask;
+ u_char rn_flags;
+
+
+
+ union {
+ struct {
+ caddr_t rn_Key;
+ caddr_t rn_Mask;
+ struct radix_node *rn_Dupedkey;
+ } rn_leaf;
+ struct {
+ int rn_Off;
+ struct radix_node *rn_L;
+ struct radix_node *rn_R;
+ } rn_node;
+ } rn_u;
+
+
+
+
+
+};
+
+
+
+
+
+
+
+
+
+
+
+
+struct radix_mask {
+ short rm_b;
+ char rm_unused;
+ u_char rm_flags;
+ struct radix_mask *rm_mklist;
+ union {
+ caddr_t rmu_mask;
+ struct radix_node *rmu_leaf;
+ } rm_rmu;
+ int rm_refs;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int walktree_f_t (struct radix_node *, void *) ;
+
+struct radix_node_head {
+ struct radix_node *rnh_treetop;
+ int rnh_addrsize;
+ int rnh_pktsize;
+ struct radix_node *(*rnh_addaddr)
+ (void *v, void *mask,
+ struct radix_node_head *head, struct radix_node nodes[]) ;
+ struct radix_node *(*rnh_addpkt)
+ (void *v, void *mask,
+ struct radix_node_head *head, struct radix_node nodes[]) ;
+ struct radix_node *(*rnh_deladdr)
+ (void *v, void *mask, struct radix_node_head *head) ;
+ struct radix_node *(*rnh_delpkt)
+ (void *v, void *mask, struct radix_node_head *head) ;
+ struct radix_node *(*rnh_matchaddr)
+ (void *v, struct radix_node_head *head) ;
+ struct radix_node *(*rnh_lookup)
+ (void *v, void *mask, struct radix_node_head *head) ;
+ struct radix_node *(*rnh_matchpkt)
+ (void *v, struct radix_node_head *head) ;
+ int (*rnh_walktree)
+ (struct radix_node_head *head, walktree_f_t *f, void *w) ;
+ int (*rnh_walktree_from)
+ (struct radix_node_head *head, void *a, void *m,
+ walktree_f_t *f, void *w) ;
+ void (*rnh_close)
+ (struct radix_node *rn, struct radix_node_head *head) ;
+ struct radix_node rnh_nodes[3];
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+void rn_init (void) ;
+int rn_inithead (void **, int) ;
+int rn_refines (void *, void *) ;
+struct radix_node
+ *rn_addmask (void *, int, int) ,
+ *rn_addroute (void *, void *, struct radix_node_head *,
+ struct radix_node [2]) ,
+ *rn_delete (void *, void *, struct radix_node_head *) ,
+ *rn_lookup (void *v_arg, void *m_arg,
+ struct radix_node_head *head) ,
+ *rn_match (void *, struct radix_node_head *) ;
+
+
+
+# 66 "/usr/include/sys/mount.h" 2 3 4
+
+# 1 "/usr/include/sys/socket.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct linger {
+ int l_onoff;
+ int l_linger;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct sockaddr {
+ u_char sa_len;
+ u_char sa_family;
+ char sa_data[14];
+};
+
+
+
+
+
+
+struct sockproto {
+ u_short sp_family;
+ u_short sp_protocol;
+};
+
+
+
+
+
+
+
+
+
+
+
+struct sockaddr_storage {
+ u_char ss_len;
+ u_char ss_family;
+ char _ss_pad1[((sizeof(int64_t)) - sizeof(u_char) * 2) ];
+ int64_t _ss_align;
+ char _ss_pad2[(128 - sizeof(u_char) * 2 - ((sizeof(int64_t)) - sizeof(u_char) * 2) - (sizeof(int64_t)) ) ];
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 295 "/usr/include/sys/socket.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct msghdr {
+ caddr_t msg_name;
+ u_int msg_namelen;
+ struct iovec *msg_iov;
+ u_int msg_iovlen;
+ caddr_t msg_control;
+ u_int msg_controllen;
+ int msg_flags;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct cmsghdr {
+ u_int cmsg_len;
+ int cmsg_level;
+ int cmsg_type;
+
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct osockaddr {
+ u_short sa_family;
+ char sa_data[14];
+};
+
+
+
+
+struct omsghdr {
+ caddr_t msg_name;
+ int msg_namelen;
+ struct iovec *msg_iov;
+ int msg_iovlen;
+ caddr_t msg_accrights;
+ int msg_accrightslen;
+};
+
+
+
+
+
+
+
+
+# 427 "/usr/include/sys/socket.h" 3 4
+
+
+
+
+
+
+extern "C" {
+int accept (int, struct sockaddr *, int *) ;
+int bind (int, const struct sockaddr *, int) ;
+int connect (int, const struct sockaddr *, int) ;
+int getpeername (int, struct sockaddr *, int *) ;
+int getsockname (int, struct sockaddr *, int *) ;
+int getsockopt (int, int, int, void *, int *) ;
+int listen (int, int) ;
+ssize_t recv (int, void *, size_t, int) ;
+ssize_t recvfrom (int, void *, size_t, int, struct sockaddr *, int *) ;
+ssize_t recvmsg (int, struct msghdr *, int) ;
+ssize_t send (int, const void *, size_t, int) ;
+ssize_t sendto (int, const void *,
+ size_t, int, const struct sockaddr *, int) ;
+ssize_t sendmsg (int, const struct msghdr *, int) ;
+
+
+
+int setsockopt (int, int, int, const void *, int) ;
+int shutdown (int, int) ;
+int socket (int, int, int) ;
+int socketpair (int, int, int, int *) ;
+}
+
+
+
+# 67 "/usr/include/sys/mount.h" 2 3 4
+
+
+typedef struct fsid { int32_t val[2]; } fsid_t;
+
+
+
+
+
+
+
+struct fid {
+ u_short fid_len;
+ u_short fid_reserved;
+ char fid_data[16 ];
+};
+
+
+
+
+
+
+
+
+struct statfs {
+ short f_otype;
+ short f_oflags;
+ long f_bsize;
+ long f_iosize;
+ long f_blocks;
+ long f_bfree;
+ long f_bavail;
+ long f_files;
+ long f_ffree;
+ fsid_t f_fsid;
+ uid_t f_owner;
+ short f_reserved1;
+ short f_type;
+ long f_flags;
+ long f_reserved2[2];
+ char f_fstypename[15 ];
+ char f_mntonname[90 ];
+ char f_mntfromname[90 ];
+
+
+
+
+ char f_reserved3;
+ long f_reserved4[4];
+
+};
+
+
+
+
+
+
+struct vnodelst { struct vnode *lh_first; } ;
+
+struct mount {
+ struct { struct mount *cqe_next; struct mount *cqe_prev; } mnt_list;
+ struct vfsops *mnt_op;
+ struct vfsconf *mnt_vfc;
+ struct vnode *mnt_vnodecovered;
+ struct vnodelst mnt_vnodelist;
+ struct lock__bsd__ mnt_lock;
+ int mnt_flag;
+ int mnt_kern_flag;
+ int mnt_maxsymlinklen;
+ struct statfs mnt_stat;
+ qaddr_t mnt_data;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct fhandle {
+ fsid_t fh_fsid;
+ struct fid fh_fid;
+};
+typedef struct fhandle fhandle_t;
+
+
+
+
+struct export_args {
+ int ex_flags;
+ uid_t ex_root;
+ struct ucred ex_anon;
+ struct sockaddr *ex_addr;
+ int ex_addrlen;
+ struct sockaddr *ex_mask;
+ int ex_masklen;
+};
+
+
+
+
+
+
+struct vfsconf {
+ struct vfsops *vfc_vfsops;
+ char vfc_name[15 ];
+ int vfc_typenum;
+ int vfc_refcount;
+ int vfc_flags;
+ int (*vfc_mountroot)(void);
+ struct vfsconf *vfc_next;
+};
+
+# 361 "/usr/include/sys/mount.h" 3 4
+
+
+
+
+extern "C" {
+int fstatfs (int, struct statfs *) ;
+int getfh (const char *, fhandle_t *) ;
+int getfsstat (struct statfs *, long, int) ;
+int getmntinfo (struct statfs **, int) ;
+int mount (const char *, const char *, int, void *) ;
+int statfs (const char *, struct statfs *) ;
+int unmount (const char *, int) ;
+}
+
+
+
+# 43 "/usr/include/libc.h" 2 3 4
+
+
+# 1 "/usr/include/sys/wait.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+union wait {
+ int w_status;
+
+
+
+ struct {
+
+
+
+
+
+
+
+ unsigned int w_Filler:16,
+ w_Retcode:8,
+ w_Coredump:1,
+ w_Termsig:7;
+
+ } w_T;
+
+
+
+
+
+ struct {
+
+
+
+
+
+
+ unsigned int w_Filler:16,
+ w_Stopsig:8,
+ w_Stopval:8;
+
+ } w_S;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+struct rusage;
+
+pid_t wait (int *) ;
+pid_t waitpid (pid_t, int *, int) ;
+
+pid_t wait3 (int *, int, struct rusage *) ;
+pid_t wait4 (pid_t, int *, int, struct rusage *) ;
+
+}
+
+
+# 45 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/sys/time.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct timeval {
+ int32_t tv_sec;
+ int32_t tv_usec;
+};
+
+
+
+
+struct timespec {
+ time_t tv_sec;
+ int32_t tv_nsec;
+};
+
+
+
+
+
+
+
+
+
+
+struct timezone {
+ int tz_minuteswest;
+ int tz_dsttime;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 121 "/usr/include/sys/time.h" 3 4
+
+# 130 "/usr/include/sys/time.h" 3 4
+
+
+
+
+
+
+
+
+
+struct itimerval {
+ struct timeval it_interval;
+ struct timeval it_value;
+};
+
+
+
+
+struct clockinfo {
+ int hz;
+ int tick;
+ int tickadj;
+ int stathz;
+ int profhz;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+int adjtime (const struct timeval *, struct timeval *) ;
+int getitimer (int, struct itimerval *) ;
+int gettimeofday (struct timeval *, struct timezone *) ;
+int setitimer (int, const struct itimerval *, struct itimerval *) ;
+int settimeofday (const struct timeval *, const struct timezone *) ;
+int utimes (const char *, const struct timeval *) ;
+}
+
+
+
+
+
+# 46 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/sys/times.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct tms {
+ clock_t tms_utime;
+ clock_t tms_stime;
+ clock_t tms_cutime;
+ clock_t tms_cstime;
+};
+
+
+
+
+extern "C" {
+clock_t times (struct tms *) ;
+}
+
+
+# 47 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/sys/resource.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct rusage {
+ struct timeval ru_utime;
+ struct timeval ru_stime;
+ long ru_maxrss;
+
+ long ru_ixrss;
+ long ru_idrss;
+ long ru_isrss;
+ long ru_minflt;
+ long ru_majflt;
+ long ru_nswap;
+ long ru_inblock;
+ long ru_oublock;
+ long ru_msgsnd;
+ long ru_msgrcv;
+ long ru_nsignals;
+ long ru_nvcsw;
+ long ru_nivcsw;
+
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct orlimit {
+ int32_t rlim_cur;
+ int32_t rlim_max;
+};
+
+struct rlimit {
+ rlim_t rlim_cur;
+ rlim_t rlim_max;
+};
+
+
+struct loadavg {
+ fixpt_t ldavg[3];
+ long fscale;
+};
+
+
+
+
+
+
+
+extern "C" {
+int getpriority (int, int) ;
+int getrlimit (int, struct rlimit *) ;
+int getrusage (int, struct rusage *) ;
+int setpriority (int, int, int) ;
+int setrlimit (int, const struct rlimit *) ;
+}
+
+
+
+# 48 "/usr/include/libc.h" 2 3 4
+
+
+
+
+# 1 "/usr/include/sys/stat.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct ostat {
+ u_int16_t st_dev;
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+ u_int16_t st_uid;
+ u_int16_t st_gid;
+ u_int16_t st_rdev;
+ int32_t st_size;
+ struct timespec st_atimespec;
+ struct timespec st_mtimespec;
+ struct timespec st_ctimespec;
+ int32_t st_blksize;
+ int32_t st_blocks;
+ u_int32_t st_flags;
+ u_int32_t st_gen;
+};
+
+
+struct stat {
+ dev_t st_dev;
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+ uid_t st_uid;
+ gid_t st_gid;
+ dev_t st_rdev;
+
+ struct timespec st_atimespec;
+ struct timespec st_mtimespec;
+ struct timespec st_ctimespec;
+
+
+
+
+
+
+
+
+ off_t st_size;
+ int64_t st_blocks;
+ u_int32_t st_blksize;
+ u_int32_t st_flags;
+ u_int32_t st_gen;
+ int32_t st_lspare;
+ int64_t st_qspare[2];
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+int chmod (const char *, mode_t) ;
+int fstat (int, struct stat *) ;
+int mkdir (const char *, mode_t) ;
+int mkfifo (const char *, mode_t) ;
+int stat (const char *, struct stat *) ;
+mode_t umask (mode_t) ;
+
+int chflags (const char *, u_long) ;
+int fchflags (int, u_long) ;
+int fchmod (int, mode_t) ;
+int lstat (const char *, struct stat *) ;
+
+}
+
+
+# 52 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/sys/file.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/fcntl.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 131 "/usr/include/sys/fcntl.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct flock {
+ off_t l_start;
+ off_t l_len;
+ pid_t l_pid;
+ short l_type;
+ short l_whence;
+};
+
+
+
+
+
+
+struct radvisory {
+ off_t ra_offset;
+ int ra_count;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct fstore {
+ u_int32_t fst_flags;
+ int fst_posmode;
+ off_t fst_offset;
+ off_t fst_length;
+ off_t fst_bytesalloc;
+} fstore_t;
+
+
+
+typedef struct fbootstraptransfer {
+ off_t fbt_offset;
+ size_t fbt_length;
+ void *fbt_buffer;
+} fbootstraptransfer_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct log2phys {
+ u_int32_t l2p_flags;
+ off_t l2p_contigbytes;
+ off_t l2p_devoffset;
+};
+
+
+
+
+
+
+
+
+
+extern "C" {
+int open (const char *, int, ...) ;
+int creat (const char *, mode_t) ;
+int fcntl (int, int, ...) ;
+
+int flock (int, int) ;
+
+}
+
+
+
+# 61 "/usr/include/sys/file.h" 2 3 4
+
+
+
+# 112 "/usr/include/sys/file.h" 3 4
+
+
+
+# 53 "/usr/include/libc.h" 2 3 4
+
+
+# 1 "/usr/include/sys/ioctl.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/ttycom.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/sys/ioccom.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 66 "/usr/include/sys/ttycom.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+struct winsize {
+ unsigned short ws_row;
+ unsigned short ws_col;
+ unsigned short ws_xpixel;
+ unsigned short ws_ypixel;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 66 "/usr/include/sys/ioctl.h" 2 3 4
+
+
+
+
+
+
+
+struct ttysize {
+ unsigned short ts_lines;
+ unsigned short ts_cols;
+ unsigned short ts_xxx;
+ unsigned short ts_yyy;
+};
+
+
+
+
+
+# 1 "/usr/include/sys/filio.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 84 "/usr/include/sys/ioctl.h" 2 3 4
+
+# 1 "/usr/include/sys/sockio.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 85 "/usr/include/sys/ioctl.h" 2 3 4
+
+
+
+
+
+
+extern "C" {
+int ioctl (int, unsigned long, ...) ;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 55 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/netinet/in.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct in_addr {
+ u_int32_t s_addr;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct sockaddr_in {
+ u_char sin_len;
+ u_char sin_family;
+ u_short sin_port;
+ struct in_addr sin_addr;
+ char sin_zero[8];
+};
+
+
+
+
+
+
+
+
+
+
+struct ip_opts {
+ struct in_addr ip_dst;
+ char ip_opts[40];
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct ip_mreq {
+ struct in_addr imr_multiaddr;
+ struct in_addr imr_interface;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 456 "/usr/include/netinet/in.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 499 "/usr/include/netinet/in.h" 3 4
+
+
+
+# 1 "/usr/include/netinet6/in6.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct in6_addr {
+ union {
+ u_int8_t __u6_addr8[16];
+ u_int16_t __u6_addr16[8];
+ u_int32_t __u6_addr32[4];
+ } __u6_addr;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct sockaddr_in6 {
+ u_int8_t sin6_len;
+ u_int8_t sin6_family;
+ u_int16_t sin6_port;
+ u_int32_t sin6_flowinfo;
+ struct in6_addr sin6_addr;
+ u_int32_t sin6_scope_id;
+};
+
+
+
+
+# 166 "/usr/include/netinet6/in6.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 199 "/usr/include/netinet6/in6.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 335 "/usr/include/netinet6/in6.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct route_in6 {
+ struct rtentry *ro_rt;
+ struct sockaddr_in6 ro_dst;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct ipv6_mreq {
+ struct in6_addr ipv6mr_multiaddr;
+ u_int ipv6mr_interface;
+};
+
+
+
+
+struct in6_pktinfo {
+ struct in6_addr ipi6_addr;
+ u_int ipi6_ifindex;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 530 "/usr/include/netinet6/in6.h" 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 611 "/usr/include/netinet6/in6.h" 3 4
+
+# 640 "/usr/include/netinet6/in6.h" 3 4
+
+
+
+# 666 "/usr/include/netinet6/in6.h" 3 4
+
+
+extern "C" {
+struct cmsghdr;
+
+extern int inet6_option_space (int) ;
+extern int inet6_option_init (void *, struct cmsghdr **, int) ;
+extern int inet6_option_append (struct cmsghdr *, const u_int8_t *,
+ int, int) ;
+extern u_int8_t *inet6_option_alloc (struct cmsghdr *, int, int, int) ;
+extern int inet6_option_next (const struct cmsghdr *, u_int8_t **) ;
+extern int inet6_option_find (const struct cmsghdr *, u_int8_t **, int) ;
+
+extern size_t inet6_rthdr_space (int, int) ;
+extern struct cmsghdr *inet6_rthdr_init (void *, int) ;
+extern int inet6_rthdr_add (struct cmsghdr *, const struct in6_addr *,
+ unsigned int) ;
+extern int inet6_rthdr_lasthop (struct cmsghdr *, unsigned int) ;
+
+
+
+extern int inet6_rthdr_segments (const struct cmsghdr *) ;
+extern struct in6_addr *inet6_rthdr_getaddr (struct cmsghdr *, int) ;
+extern int inet6_rthdr_getflags (const struct cmsghdr *, int) ;
+
+extern int inet6_opt_init (void *, size_t) ;
+extern int inet6_opt_append (void *, size_t, int, u_int8_t,
+ size_t, u_int8_t, void **) ;
+extern int inet6_opt_finish (void *, size_t, int) ;
+extern int inet6_opt_set_val (void *, size_t, void *, int) ;
+
+extern int inet6_opt_next (void *, size_t, int, u_int8_t *,
+ size_t *, void **) ;
+extern int inet6_opt_find (void *, size_t, int, u_int8_t,
+ size_t *, void **) ;
+extern int inet6_opt_get_val (void *, size_t, void *, int) ;
+extern size_t inet6_rth_space (int, int) ;
+extern void *inet6_rth_init (void *, int, int, int) ;
+extern int inet6_rth_add (void *, const struct in6_addr *) ;
+extern int inet6_rth_reverse (const void *, void *) ;
+extern int inet6_rth_segments (const void *) ;
+extern struct in6_addr *inet6_rth_getaddr (const void *, int) ;
+}
+
+
+# 502 "/usr/include/netinet/in.h" 2 3 4
+
+
+
+# 514 "/usr/include/netinet/in.h" 3 4
+
+
+
+# 56 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/arpa/inet.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+unsigned long inet_addr (const char *) ;
+int inet_aton (const char *, struct in_addr *) ;
+unsigned long inet_lnaof (struct in_addr) ;
+struct in_addr inet_makeaddr (u_long , u_long) ;
+unsigned long inet_netof (struct in_addr) ;
+unsigned long inet_network (const char *) ;
+char *inet_ntoa (struct in_addr) ;
+}
+
+
+# 57 "/usr/include/libc.h" 2 3 4
+
+# 1 "/usr/include/mach/machine/vm_types.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/mach/ppc/vm_types.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef unsigned int natural_t;
+
+
+
+
+
+
+
+
+typedef int integer_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef natural_t vm_offset_t;
+
+
+
+
+
+
+typedef natural_t vm_size_t;
+typedef unsigned long long vm_double_size_t;
+
+
+
+
+typedef unsigned int space_t;
+
+
+
+
+
+
+
+
+
+
+# 27 "/usr/include/mach/machine/vm_types.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 58 "/usr/include/libc.h" 2 3 4
+
+
+# 1 "/usr/include/mach/kern_return.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/mach/machine/kern_return.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 1 "/usr/include/mach/ppc/kern_return.h" 1 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int kern_return_t;
+
+
+# 27 "/usr/include/mach/machine/kern_return.h" 2 3 4
+
+
+
+
+
+
+
+
+
+# 64 "/usr/include/mach/kern_return.h" 2 3 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 60 "/usr/include/libc.h" 2 3 4
+
+
+struct qelem {
+ struct qelem *q_forw;
+ struct qelem *q_back;
+ char *q_data;
+};
+
+extern kern_return_t map_fd(int fd, vm_offset_t offset,
+ vm_offset_t *addr, boolean_t find_space, vm_size_t numbytes);
+
+
+
+# 12 "QvBasic.h" 2
+
+
+
+
+
+
+
+
+
+
+
+typedef int QvBool;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 4 "QvString.h" 2
+
+
+
+class QvString {
+ public:
+ QvString() { string = staticStorage;
+ string[0] = '\0'; }
+ QvString(const char *str) { string = staticStorage;
+ *this = str; }
+ QvString(const QvString &str) { string = staticStorage;
+ *this = str.string; }
+ ~QvString();
+ u_long hash() { return QvString::hash(string); }
+ int getLength() const { return strlen(string); }
+ void makeEmpty(QvBool freeOld = 1 );
+ const char * getString() const { return string; }
+ QvString & operator =(const char *str);
+ QvString & operator =(const QvString &str)
+ { return (*this = str.string); }
+ QvString & operator +=(const char *str);
+ int operator !() const { return (string[0] == '\0'); }
+ friend int operator ==(const QvString &str, const char *s);
+
+ friend int operator ==(const char *s, const QvString &str)
+ { return (str == s); }
+
+ friend int operator ==(const QvString &str1, const QvString &str2)
+ { return (str1 == str2.string); }
+ friend int operator !=(const QvString &str, const char *s);
+
+ friend int operator !=(const char *s, const QvString &str)
+ { return (str != s); }
+ friend int operator !=(const QvString &str1,
+ const QvString &str2)
+ { return (str1 != str2.string); }
+ static u_long hash(const char *s);
+ private:
+ char *string;
+ int storageSize;
+
+ char staticStorage[32 ];
+ void expand(int bySize);
+};
+
+class QvNameEntry {
+ public:
+ QvBool isEmpty() const { return (string[0] == '\0'); }
+ QvBool isEqual(const char *s) const
+ { return (string[0] == s[0] && ! strcmp(string, s)); }
+ private:
+ static int nameTableSize;
+ static QvNameEntry **nameTable;
+ static struct QvNameChunk *chunk;
+ const char *string;
+ u_long hashValue;
+ QvNameEntry *next;
+ static void initClass();
+ QvNameEntry(const char *s, u_long h, QvNameEntry *n)
+ { string = s; hashValue = h; next = n; }
+ static const QvNameEntry * insert(const char *s);
+
+friend class QvName;
+};
+
+class QvName {
+ public:
+ QvName();
+ QvName(const char *s) { entry = QvNameEntry::insert(s); }
+ QvName(const QvString &s) { entry = QvNameEntry::insert(s.getString()); }
+
+ QvName(const QvName &n) { entry = n.entry; }
+ ~QvName() {}
+ const char *getString() const { return entry->string; }
+ int getLength() const { return strlen(entry->string); }
+ static QvBool isIdentStartChar(char c);
+ static QvBool isIdentChar(char c);
+ static QvBool isNodeNameStartChar(char c);
+ static QvBool isNodeNameChar(char c);
+ int operator !() const { return entry->isEmpty(); }
+ friend int operator ==(const QvName &n, const char *s)
+ { return n.entry->isEqual(s); }
+ friend int operator ==(const char *s, const QvName &n)
+ { return n.entry->isEqual(s); }
+
+ friend int operator ==(const QvName &n1, const QvName &n2)
+ { return n1.entry == n2.entry; }
+ friend int operator !=(const QvName &n, const char *s)
+ { return ! n.entry->isEqual(s); }
+ friend int operator !=(const char *s, const QvName &n)
+ { return ! n.entry->isEqual(s); }
+
+ friend int operator !=(const QvName &n1, const QvName &n2)
+ { return n1.entry != n2.entry; }
+ private:
+ const QvNameEntry *entry;
+};
+
+
+# 4 "QvSFEnum.h" 2
+
+# 1 "QvSubField.h" 1
+
+
+
+# 1 "QvField.h" 1
+
+
+
+
+
+class QvInput;
+class QvNode;
+
+class QvField {
+ public:
+ virtual ~QvField();
+
+ void setIgnored(QvBool ig) { flags.ignored = ig; }
+ QvBool isIgnored() const { return flags.ignored; }
+
+ QvBool isDefault() const { return flags.hasDefault; }
+
+ QvNode * getContainer() const { return container; }
+
+ void setDefault(QvBool def) { flags.hasDefault = def; }
+ void setContainer(QvNode *cont);
+ QvBool read(QvInput *in, const QvName &name);
+
+ QvField() { flags.hasDefault = 1 ; flags.ignored = 0 ; }
+
+ public:
+
+ private:
+ struct {
+ unsigned int hasDefault : 1;
+ unsigned int ignored : 1;
+ } flags;
+
+ QvNode *container;
+
+ static QvField * createInstanceFromName(const QvName &className);
+ virtual QvBool readValue(QvInput *in) = 0;
+
+friend class QvFieldData;
+};
+
+class QvSField : public QvField {
+ public:
+ virtual ~QvSField();
+
+ protected:
+ QvSField();
+
+ private:
+ virtual QvBool readValue(QvInput *in) = 0;
+};
+
+class QvMField : public QvField {
+
+ public:
+ int num;
+ int maxNum;
+
+
+ virtual ~QvMField();
+
+ protected:
+ QvMField();
+ virtual void makeRoom(int newNum);
+
+ private:
+ virtual void allocValues(int num) = 0;
+ virtual QvBool readValue(QvInput *in);
+ virtual QvBool read1Value(QvInput *in, int index) = 0;
+};
+
+
+# 4 "QvSubField.h" 2
+
+# 1 "QvInput.h" 1
+
+
+
+# 1 "QvDict.h" 1
+
+
+
+
+
+# 1 "QvPList.h" 1
+
+
+
+
+
+class QvPList {
+ public:
+ QvPList();
+ ~QvPList();
+ void append(void * ptr)
+ { if (nPtrs + 1 > ptrsSize) expand(nPtrs + 1);
+ ptrs[nPtrs++] = ptr; }
+ int find(const void *ptr) const;
+ void remove(int which);
+ int getLength() const { return (int) nPtrs; }
+ void truncate(int start)
+ { nPtrs = start; }
+ void *& operator [](int i) const { return ptrs[i]; }
+
+ private:
+ void ** ptrs;
+ int nPtrs;
+ int ptrsSize;
+ void setSize(int size)
+ { if (size > ptrsSize) expand(size); nPtrs = size; }
+ void expand(int size);
+};
+
+
+# 6 "QvDict.h" 2
+
+
+class QvDictEntry {
+ private:
+ u_long key;
+ void * value;
+ QvDictEntry * next;
+ QvDictEntry(u_long k, void *v) { key = k; value = v; };
+
+friend class QvDict;
+};
+
+class QvDict {
+ public:
+ QvDict( int entries = 251 );
+ ~QvDict();
+ void clear();
+ QvBool enter(u_long key, void *value);
+ QvBool find(u_long key, void *&value) const;
+ QvBool remove(u_long key);
+
+ private:
+ int tableSize;
+ QvDictEntry * *buckets;
+ QvDictEntry *& findEntry(u_long key) const;
+};
+
+
+# 4 "QvInput.h" 2
+
+
+
+class QvNode;
+class QvDB;
+
+class QvInput {
+ public:
+
+ QvInput();
+ ~QvInput();
+
+ static float isASCIIHeader(const char *string);
+ void setFilePointer(FILE *newFP);
+ FILE * getCurFile() const { return fp; }
+ float getVersion();
+ QvBool get(char &c);
+ QvBool read(char &c);
+ QvBool read(QvString &s);
+ QvBool read(QvName &n, QvBool validIdent = 0 );
+ QvBool read(int &i);
+ QvBool read(unsigned int &i);
+ QvBool read(short &s);
+ QvBool read(unsigned short &s);
+ QvBool read(long &l);
+ QvBool read(unsigned long &l);
+ QvBool read(float &f);
+ QvBool read(double &d);
+ QvBool eof() const;
+ void getLocationString(QvString &string) const;
+ void putBack(char c);
+ void putBack(const char *string);
+ void addReference(const QvName &name, QvNode *node);
+ QvNode * findReference(const QvName &name) const;
+
+ private:
+ FILE *fp;
+ int lineNum;
+ float version;
+ QvBool readHeader;
+ QvBool headerOk;
+ QvDict refDict;
+ QvString backBuf;
+ int backBufIndex;
+
+ QvBool checkHeader();
+
+ QvBool skipWhiteSpace();
+
+ QvBool readInteger(long &l);
+ QvBool readUnsignedInteger(unsigned long &l);
+ QvBool readReal(double &d);
+ QvBool readUnsignedIntegerString(char *str);
+ int readDigits(char *string);
+ int readHexDigits(char *string);
+ int readChar(char *string, char charToRead);
+
+friend class QvNode;
+friend class QvDB;
+};
+
+
+# 5 "QvSubField.h" 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 71 "QvSubField.h"
+
+
+# 5 "QvSFEnum.h" 2
+
+
+class QvSFEnum : public QvSField {
+ public:
+ int value;
+ public: QvSFEnum (); virtual ~ QvSFEnum (); virtual QvBool readValue(QvInput *in) ;
+
+
+ void setEnums(int num, const int vals[], const QvName names[])
+ { numEnums = num; enumValues = vals; enumNames = names; }
+
+ int numEnums;
+ const int *enumValues;
+ const QvName *enumNames;
+
+
+ QvBool findEnumValue(const QvName &name, int &val) const;
+};
+
+
+# 37 "QvSFEnum.h"
+
+
+# 4 "QvWWWInline.h" 2
+
+# 1 "QvSFVec3f.h" 1
+
+
+
+
+
+class QvSFVec3f : public QvSField {
+ public:
+ float value[3];
+ public: QvSFVec3f (); virtual ~ QvSFVec3f (); virtual QvBool readValue(QvInput *in) ;
+};
+
+
+# 5 "QvWWWInline.h" 2
+
+# 1 "QvGroup.h" 1
+
+
+
+class QvChildList;
+# 1 "QvSubNode.h" 1
+
+
+
+# 1 "QvFieldData.h" 1
+
+
+
+
+
+
+
+class QvField;
+class QvInput;
+class QvNode;
+
+class QvFieldData {
+ public:
+ QvFieldData() {}
+ ~QvFieldData();
+
+ void addField(QvNode *defObject, const char *fieldName,
+ const QvField *field);
+
+ int getNumFields() const { return fields.getLength(); }
+
+ const QvName & getFieldName(int index) const;
+
+ QvField * getField(const QvNode *object,
+ int index) const;
+
+ void addEnumValue(const char *typeName,
+ const char *valName, int val);
+ void getEnumData(const char *typeName, int &num,
+ const int *&vals, const QvName *&names);
+
+ QvBool read(QvInput *in, QvNode *object,
+ QvBool errorOnUnknownField = 1 ) const;
+
+ QvBool read(QvInput *in, QvNode *object,
+ const QvName &fieldName,
+ QvBool &foundName) const;
+
+ QvBool readFieldTypes(QvInput *in, QvNode *object);
+
+ private:
+ QvPList fields;
+ QvPList enums;
+};
+
+
+# 4 "QvSubNode.h" 2
+
+# 1 "QvNode.h" 1
+
+
+
+
+
+class QvChildList;
+class QvDict;
+class QvFieldData;
+class QvInput;
+class QvNodeList;
+class QvState;
+
+class QvNode {
+
+ public:
+ enum Stage {
+ FIRST_INSTANCE,
+ PROTO_INSTANCE,
+ OTHER_INSTANCE,
+ };
+
+ QvFieldData *fieldData;
+ QvChildList *children;
+ QvBool isBuiltIn;
+
+ QvName *objName;
+ QvNode();
+ virtual ~QvNode();
+
+ const QvName & getName() const;
+ void setName(const QvName &name);
+
+ static void init();
+ static QvBool read(QvInput *in, QvNode *&node);
+
+ virtual QvFieldData *getFieldData() = 0;
+
+ virtual void traverse(QvState *state) = 0;
+
+ protected:
+ virtual QvBool readInstance(QvInput *in);
+
+ private:
+ static QvDict *nameDict;
+
+ static void addName(QvNode *, const char *);
+ static void removeName(QvNode *, const char *);
+ static QvNode * readReference(QvInput *in);
+ static QvBool readNode(QvInput *in, QvName &className,QvNode *&node);
+ static QvBool readNodeInstance(QvInput *in, const QvName &className,
+ const QvName &refName, QvNode *&node);
+ static QvNode * createInstance(QvInput *in, const QvName &className);
+ static QvNode * createInstanceFromName(const QvName &className);
+ static void flushInput(QvInput *in);
+};
+
+
+# 5 "QvSubNode.h" 2
+
+
+
+# 16 "QvSubNode.h"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 5 "QvGroup.h" 2
+
+
+class QvGroup : public QvNode {
+
+ public: QvGroup :: QvGroup (); virtual ~ QvGroup (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+ QvNode * getChild(int index) const;
+ int getNumChildren() const;
+ virtual QvChildList *getChildren() const;
+ virtual QvBool readInstance(QvInput *in);
+ virtual QvBool readChildren(QvInput *in);
+};
+
+
+# 6 "QvWWWInline.h" 2
+
+
+class QvWWWInline : public QvGroup {
+
+ public: QvWWWInline :: QvWWWInline (); virtual ~ QvWWWInline (); virtual void traverse(QvState *state); private: static QvBool firstInstance; static QvFieldData *fieldData; virtual QvFieldData *getFieldData() { return fieldData; } ;
+
+ public:
+
+ QvSFString name;
+ QvSFVec3f bboxSize;
+ QvSFVec3f bboxCenter;
+};
+
+
+# 4 "QvWWWInline.cpp" 2
+
+
+QvFieldData * QvWWWInline ::fieldData; QvBool QvWWWInline ::firstInstance = 1 ; ;
+
+QvWWWInline::QvWWWInline()
+{
+ if (fieldData == 0 ) fieldData = new QvFieldData; else firstInstance = 0 ; isBuiltIn = 0 ; ;
+ isBuiltIn = 1 ;
+
+ if (firstInstance) fieldData->addField(this, "name" , &this-> name ); this-> name .setContainer(this); ;
+ if (firstInstance) fieldData->addField(this, "bboxSize" , &this-> bboxSize ); this-> bboxSize .setContainer(this); ;
+ if (firstInstance) fieldData->addField(this, "bboxCenter" , &this-> bboxCenter ); this-> bboxCenter .setContainer(this); ;
+
+ name.value = "";
+ bboxSize.value[0] = bboxSize.value[0] = bboxSize.value[0] = 0.0;
+ bboxCenter.value[0] = bboxCenter.value[0] = bboxCenter.value[0] = 0.0;
+}
+
+QvWWWInline::~QvWWWInline()
+{
+}