Click here to Skip to main content
15,892,927 members
Articles / Multimedia / OpenGL

A small VRML viewer using OpenGL and MFC

Rate me:
Please Sign up or sign in to vote.
4.96/5 (57 votes)
30 Nov 19992 min read 428.9K   16.8K   159  
//********************************************
// ParserVrml.h
// class CParserVrml
//********************************************
// pierre.alliez@cnet.francetelecom.fr
// Created : 02/04/98
// Modified : 02/04/98
//********************************************

#ifndef _PARSER_VRML_
#define _PARSER_VRML_


#define MAX_LINE_VRML 10000
#define MAX_WORD_VRML 1000

class CParserVrml
{
private :

	int m_SizeFile;
	char *m_pBuffer;
	int m_IndexBuffer;
	CString m_FileName;
	char m_pBufferLine[MAX_LINE_VRML];
	char m_pBufferWord[MAX_WORD_VRML];

public :

	// Construtor / destructor
	CParserVrml();
	~CParserVrml();

	// Running
	void Free(void);
	int Run(char *filename,CSceneGraph3d *pSceneGraph);

	// Word processing
	int ReadFile(char *filename);
	int ReadLine();
	int ReadWord();
	int OffsetToString(char *string);
	int OffsetToStringBefore(char *string,char *before);
	int OffsetToStringBeginLine(char *string);


	int CheckVersion();
	void CountDef(void);
	int CountMesh(void);
	int CheckMesh();
	int ReadMesh(CSceneGraph3d *pSceneGraph);
	int StoreMesh(CArray3d<CVertex3d> *pArrayVertex,CArray3d<CFace3d> *pArrayFace,int HasTexture,float *pTextureCoordinate,int *pTextureCoordinateIndex);
	int SizeMesh(int *pNbVertex,int *pNbFace,int HasTexture,int *pNbTextureCoordinate = NULL);
};

#endif // _PARSER_VRML_

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
France France
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions