1 | #ifndef GFX_SMF_INCLUDED // -*- C++ -*-
|
---|
2 | #define GFX_SMF_INCLUDED
|
---|
3 |
|
---|
4 | /************************************************************************
|
---|
5 |
|
---|
6 | SMF file parser.
|
---|
7 |
|
---|
8 | $Id: smf.h,v 1.8 1997/03/17 20:35:57 garland Exp $
|
---|
9 |
|
---|
10 | ************************************************************************/
|
---|
11 |
|
---|
12 | //#include <iostream.h>
|
---|
13 | #include <gfx/tools/Buffer.h>
|
---|
14 | #include <gfx/math/Vec3.h>
|
---|
15 | #include <gfx/math/Vec2.h>
|
---|
16 | #include <gfx/math/Mat4.h>
|
---|
17 |
|
---|
18 |
|
---|
19 | namespace simplif
|
---|
20 | {
|
---|
21 | #define SMF_MAXLINE 4096
|
---|
22 |
|
---|
23 | extern float SMF_version;
|
---|
24 | extern char *SMF_version_string;
|
---|
25 | extern char *SMF_source_revision;
|
---|
26 |
|
---|
27 | typedef buffer<char *> string_buffer;
|
---|
28 |
|
---|
29 |
|
---|
30 | class SMF_Model
|
---|
31 | {
|
---|
32 | public:
|
---|
33 |
|
---|
34 | ////////////////////////////////////////////////////////////////////////
|
---|
35 | //
|
---|
36 | // SMF input methods
|
---|
37 | //
|
---|
38 |
|
---|
39 | //
|
---|
40 | // These are the REQUIRED methods
|
---|
41 | virtual int in_Vertex(const Vec3&) = 0;
|
---|
42 | virtual int in_Normal(const Vec3&) = 0;
|
---|
43 | virtual int in_TexCoord(const Vec2&) = 0;
|
---|
44 | virtual int in_Face(int v1, int v2, int v3, int n1, int n2, int n3, int t1, int t2, int t3) = 0;
|
---|
45 |
|
---|
46 | //
|
---|
47 | // By default, arbitrary faces are flagged as errors
|
---|
48 | virtual int in_Face(const buffer<int> &);
|
---|
49 | //
|
---|
50 | // as are unknown commands
|
---|
51 | virtual int in_Unparsed(const char *, string_buffer&);
|
---|
52 |
|
---|
53 | virtual int note_Vertices(int);
|
---|
54 | virtual int note_Faces(int);
|
---|
55 | virtual int note_BBox(const Vec3& min, const Vec3& max);
|
---|
56 | virtual int note_BSphere(const Vec3&, real);
|
---|
57 | virtual int note_PXform(const Mat4&);
|
---|
58 | virtual int note_MXform(const Mat4&);
|
---|
59 | virtual int note_Unparsed(const char *,string_buffer&);
|
---|
60 | };
|
---|
61 |
|
---|
62 | class SMF_State;
|
---|
63 |
|
---|
64 | //
|
---|
65 | // Internal SMF variables
|
---|
66 | // (not accessible via 'set' commands)
|
---|
67 | //
|
---|
68 | struct SMF_ivars
|
---|
69 | {
|
---|
70 | int next_vertex;
|
---|
71 | int next_face;
|
---|
72 | };
|
---|
73 | }
|
---|
74 |
|
---|
75 |
|
---|
76 | // GFX_SMF_INCLUDED
|
---|
77 | #endif
|
---|