]>
git.saurik.com Git - wxWidgets.git/blob - samples/opengl/penguin/dxfrenderer.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: DXF reader and renderer
4 // Author: Sandro Sigala
8 // Copyright: (c) Sandro Sigala
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _DXFRENDERER_H_
13 #define _DXFRENDERER_H_
17 DXFVector() { x
= y
= z
= 0.0f
; }
18 DXFVector(float _x
, float _y
, float _z
) { x
= _x
; y
= _y
; z
= _z
; }
24 enum Type
{ Line
, Face
} type
;
28 struct DXFLine
: public DXFEntity
30 DXFLine() { type
= Line
; }
35 struct DXFFace
: public DXFEntity
37 DXFFace() { type
= Face
; }
38 void CalculateNormal();
43 DXFVector n
; // normal
48 DXFLayer() { colour
= -1; }
53 WX_DECLARE_LIST(DXFEntity
, DXFEntityList
);
54 WX_DECLARE_LIST(DXFLayer
, DXFLayerList
);
63 bool Load(wxInputStream
& stream
);
64 bool IsOk() const { return m_loaded
; }
68 bool ParseHeader(wxInputStream
& stream
);
69 bool ParseTables(wxInputStream
& stream
);
70 bool ParseEntities(wxInputStream
& stream
);
71 int GetLayerColour(const wxString
& layer
) const;
72 void NormalizeEntities();
75 DXFLayerList m_layers
;
76 DXFEntityList m_entities
;
79 #endif // !_DXFRENDERER_H_