00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef TEDDY__IMPORTS__LW_LAYER__H
00026 #define TEDDY__IMPORTS__LW_LAYER__H
00027
00028
00029 #include "Teddy/TeddyConfig.h"
00030 #if defined( TEDDY_INCLUDE_LW_SCENE )
00031
00032
00033 #include "Teddy/Maths/Vector.h"
00034 #include "Teddy/Models/Model.h"
00035 #include "Teddy/Imports/lwdef.h"
00036 #include "Teddy/SysSupport/StdMap.h"
00037 #include "Teddy/SysSupport/Types.h"
00038 #include <cstring>
00039
00040
00041
00042 namespace Teddy {
00043 namespace Models { class Face; };
00044 namespace Models { class Vertex; };
00045 };
00046 using namespace Teddy::Models;
00047 using namespace Teddy::SysSupport;
00048
00049
00050 namespace Teddy {
00051 namespace Imports {
00052
00053
00054 class LWClip;
00055 class LWEnvelope;
00056 class LWFile;
00057 class LWModel;
00058 class LWSurface;
00059
00060
00061 typedef std::map<std::string, Model *> string_to_Model;
00062 typedef std::map<std::string, LWSurface *> string_to_LWSurface;
00063 typedef std::map<U4, Vertex *> U4_to_Vertex;
00064 typedef std::map<U4, Face *> U4_to_Face;
00065 typedef std::map<U4, LWEnvelope*> U4_to_LWEnvelope;
00066 typedef std::map<U4, LWClip *> U4_to_LWClip;
00067
00068
00073 class LWLayer : public Model {
00074 public:
00075 LWLayer( LWModel *model, const std::string &name, U2 flags, Vector pivot, int parent );
00076 virtual ~LWLayer();
00077
00078 LWClip *getClip ( VX clip_index );
00079 LWModel *getModel ();
00080 void processLayer();
00081
00082 protected:
00083 bool processChunk ();
00084
00085
00086 void pointList ();
00087 void polygonList ();
00088 void faceList ();
00089 void surfaceList ();
00090 void curveList ();
00091 void patchList ();
00092 void surface_sc ();
00093
00094
00095 void vertexMapping_ID4_U2_S0_d ();
00096 void polygonTags_ID4_d ();
00097 void envelope_U4_sc ();
00098 void clip_U4_sc ();
00099 void surf_S0_S0_sc ();
00100 void boundingBox_VEC12_VEC12 ();
00101 void descriptionLine_S0 ();
00102 void comments_S0 ();
00103 void thumbnail_U2_U2_d ();
00104
00105 protected:
00106 int parent_layer;
00107 Vector pivot;
00108 U2 flags;
00109 LWFile *f;
00110 LWModel *model;
00111
00112 std::string description_line;
00113 std::string commentary_text;
00114 string_to_Model models;
00115 string_to_LWSurface surfaces;
00116 U4_to_Vertex vertices;
00117 U4_to_Face faces;
00118 U4_to_LWEnvelope envelopes;
00119 U4_to_LWClip clips;
00120 U4 num_vertices;
00121 U4 num_faces;
00122 U4 num_surfaces;
00123 U4 num_envelopes;
00124 U4 num_clips;
00125 U4 current_surface;
00126 Vector bbox_min;
00127 Vector bbox_max;
00128 };
00129
00130
00131 };
00132 };
00133
00134
00135 #endif // TEDDY_INCLUDE_LW_SCENE
00136 #endif // TEDDY__IMPORTS__LW_LAYER__H
00137