📄 hotreadr.h
字号:
#ifndef _3DEJ_HOT_READER_H_
#define _3DEJ_HOT_READER_H_
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "..\..\3Dlib\defines.h"
#include "..\..\3Dlib\object.h"
#include "bsputil.h"
#include "ANSreadr.h"
#include "streamio.h"
#define MAX_COLOR_CACHE 16
struct ColorPatchRecord {
GLint vtxnum;
GLbyte polyname[256];
GLint colorindex;
};
struct ColorListRecord {
GLint colorindex;
GLuint color;
};
class CHOTReader : public CANSReader, public CBSPUtil {
protected:
GLuint CacheColor (GLuint color);
GLint SearchColor (GLuint color);
GLint SearchColorInTable (ColorListRecord *table, GLint colstart, GLint colend, GLuint color);
void removeBeadWithoutChild (GLbeadTree **bead);
void removeBSPBead (GLbeadTree **bead);
GLbeadTree *readBeadData ();
GLint readHeader ();
GLint readVerticesList ();
GLint readTextureList (GLint flag);
GLint countTotalString (char *string);
GLint readBeadList ();
GLint findString (char *string);
GLint ReadColorPatch (char *str);
GLint ReadDynamicVertex (char *str);
void createDOFTree (GLbeadTree *root);
void getDOFSibling (GLbeadTree *tree, GLbeadDOFTree **headdof, GLbeadDOFTree **dofptr);
void getDOFChild (GLbeadDOFTree *dofptr, GLbeadDOFTree *dofparent);
void setVertexDOFptr (GLbeadDOFTree *dofptr);
void setVertexDOF (GLbeadTree *tree, GLbeadDegreeOfFreedom *dofptr);
void setVertexDOF_BSP (GLbeadBSPTree *tree, GLbeadDegreeOfFreedom *dofptr);
void setDOFptrsubface (GLbeadTree *bead, GLbeadDegreeOfFreedom *dofptr);
void setDOFptr (GLbeadPolygon *poly, GLbeadDegreeOfFreedom *dofptr);
void dupVertexDOFptr (GLbeadDOFTree *dofptr);
void dupVertexDOF (GLbeadTree *tree, GLbeadDegreeOfFreedom *dofptr);
void dupVertexDOF_BSP (GLbeadBSPTree *tree, GLbeadDegreeOfFreedom *dofptr);
void dupDOFptrsubface (GLbeadTree *bead, GLbeadDegreeOfFreedom *dofptr);
void dupDOFptr (GLbeadPolygon *poly, GLbeadDegreeOfFreedom *dofptr);
void createSwitchList ();
void createObjectSlot ();
void traverseObjectSlotBead (GLbeadTree *bead);
GLfloat CalculateRadius (GLvertex *max, GLvertex *min);
inline GLint GetStringType (GLbyte *str);
ColorPatchRecord *colorpatch;
GLint totalcolorpatch;
DynamicVertexRecord *dynamicvertex;
GLint totaldynamicvertex;
CStreamIO in;
GLint animFlag, BSPproblem;
GLint VertexListPos, TextureListPos, BeadListPos;
GLfloat objectScale;
GLvertex BeadVertexMax, BeadVertexMin;
GLObjectData *objData;
ColorListRecord *ColorTable;
GLuint ColorTableSize;
GLuint ColorCache[MAX_COLOR_CACHE];
GLuint ColorIndexCache[MAX_COLOR_CACHE];
GLint ColorCacheIndex, ColorCacheWrap;
void Setup ();
void Cleanup ();
public:
CHOTReader(): CANSReader(), CBSPUtil() {
ColorCacheIndex = ColorCacheWrap = 0;
};
virtual ~CHOTReader() {};
GLObjectData *readHOT (char *filename, ColorListRecord *coltable, GLint totalcol, GLint texflag=0);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -