]>
git.saurik.com Git - wxWidgets.git/blob - samples/opengl/penguin/dxfrenderer.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: DXF reader and renderer
4 // Author: Sandro Sigala
7 // Copyright: (c) Sandro Sigala
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _DXFRENDERER_H_
12 #define _DXFRENDERER_H_
16 DXFVector() { x
= y
= z
= 0.0f
; }
17 DXFVector(float _x
, float _y
, float _z
) { x
= _x
; y
= _y
; z
= _z
; }
23 enum Type
{ Line
, Face
} type
;
27 struct DXFLine
: public DXFEntity
29 DXFLine() { type
= Line
; }
34 struct DXFFace
: public DXFEntity
36 DXFFace() { type
= Face
; }
37 void CalculateNormal();
42 DXFVector n
; // normal
47 DXFLayer() { colour
= -1; }
52 WX_DECLARE_LIST(DXFEntity
, DXFEntityList
);
53 WX_DECLARE_LIST(DXFLayer
, DXFLayerList
);
62 bool Load(wxInputStream
& stream
);
63 bool IsOk() const { return m_loaded
; }
67 bool ParseHeader(wxInputStream
& stream
);
68 bool ParseTables(wxInputStream
& stream
);
69 bool ParseEntities(wxInputStream
& stream
);
70 int GetLayerColour(const wxString
& layer
) const;
71 void NormalizeEntities();
74 DXFLayerList m_layers
;
75 DXFEntityList m_entities
;
78 #endif // !_DXFRENDERER_H_