1 /*========================================================================= 2 3 Program: Visualization Toolkit 4 Module: vtk3DS.h 5 6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 7 All rights reserved. 8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 9 10 This software is distributed WITHOUT ANY WARRANTY; without even 11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 12 PURPOSE. See the above copyright notice for more information. 13 14 =========================================================================*/ 15 16 #include <ctype.h> 17 18 class vtkLight; 19 class vtkCamera; 20 class vtkProperty; 21 22 typedef float vtk3DSVector[3]; 23 24 /* A generic list type */ 25 #define VTK_LIST_INSERT(root, node) list_insert ((vtk3DSList **)&root, reinterpret_cast<vtk3DSList *>(node)) 26 #define VTK_LIST_FIND(root, name) list_find ((vtk3DSList **)&root, name) 27 #define VTK_LIST_DELETE(root, node) list_delete ((vtk3DSList **)&root, (vtk3DSList *)node) 28 #define VTK_LIST_KILL(root) list_kill ((vtk3DSList **)&root) 29 30 #define VTK_LIST_FIELDS \ 31 char name[80]; \ 32 void *next; 33 34 35 typedef unsigned char byte; 36 typedef unsigned short word; 37 typedef unsigned int dword; 38 39 typedef struct { 40 VTK_LIST_FIELDS 41 } vtk3DSList; 42 43 44 typedef struct { 45 int a, b, c; 46 } vtk3DSFace; 47 48 49 typedef struct { 50 float red, green, blue; 51 } vtk3DSColour; 52 53 54 /* Omni light command */ 55 typedef struct { 56 VTK_LIST_FIELDS 57 58 vtk3DSVector pos; /* Light position */ 59 vtk3DSColour col; /* Light colour */ 60 vtkLight *aLight; 61 } vtk3DSOmniLight; 62 63 64 /* Spotlight command */ 65 typedef struct { 66 VTK_LIST_FIELDS 67 68 vtk3DSVector pos; /* Spotlight position */ 69 vtk3DSVector target; /* Spotlight target location */ 70 vtk3DSColour col; /* Spotlight colour */ 71 float hotspot; /* Hotspot angle (degrees) */ 72 float falloff; /* Falloff angle (degrees) */ 73 int shadow_flag; /* Shadow flag (not used) */ 74 vtkLight *aLight; 75 } vtk3DSSpotLight; 76 77 78 /* Camera command */ 79 typedef struct { 80 VTK_LIST_FIELDS 81 82 vtk3DSVector pos; /* Camera location */ 83 vtk3DSVector target; /* Camera target */ 84 float bank; /* Banking angle (degrees) */ 85 float lens; /* Camera lens size (mm) */ 86 vtkCamera *aCamera; 87 } vtk3DSCamera; 88 89 90 /* Material list */ 91 typedef struct { 92 VTK_LIST_FIELDS 93 94 int external; /* Externally defined material? */ 95 } vtk3DSMaterial; 96 97 98 /* Object summary */ 99 typedef struct { 100 VTK_LIST_FIELDS 101 102 vtk3DSVector center; /* Min value of object extents */ 103 vtk3DSVector lengths; /* Max value of object extents */ 104 } vtk3DSSummary; 105 106 107 /* Material property */ 108 typedef struct { 109 VTK_LIST_FIELDS 110 111 vtk3DSColour ambient; 112 vtk3DSColour diffuse; 113 vtk3DSColour specular; 114 float shininess; 115 float transparency; 116 float reflection; 117 int self_illum; 118 char tex_map[40]; 119 float tex_strength; 120 char bump_map[40]; 121 float bump_strength; 122 vtkProperty *aProperty; 123 } vtk3DSMatProp; 124 125 126 127 class vtkActor; 128 class vtkPolyDataMapper; 129 class vtkPolyDataNormals; 130 class vtkStripper; 131 class vtkPoints; 132 class vtkCellArray; 133 class vtkPolyData; 134 135 /* A mesh object */ 136 typedef struct { 137 VTK_LIST_FIELDS 138 139 int vertices; /* Number of vertices */ 140 vtk3DSVector *vertex; /* List of object vertices */ 141 142 int faces; /* Number of faces */ 143 vtk3DSFace *face; /* List of object faces */ 144 vtk3DSMaterial **mtl; /* Materials for each face */ 145 146 int hidden; /* Hidden flag */ 147 int shadow; /* Shadow flag */ 148 vtkActor *anActor; 149 vtkPolyDataMapper *aMapper; 150 vtkPolyDataNormals *aNormals; 151 vtkStripper *aStripper; 152 vtkPoints *aPoints; 153 vtkCellArray *aCellArray; 154 vtkPolyData *aPolyData; 155 156 } vtk3DSMesh; 157 158 159 typedef struct { 160 dword start; 161 dword end; 162 dword length; 163 word tag; 164 } vtk3DSChunk; 165 166 167 typedef struct { 168 byte red; 169 byte green; 170 byte blue; 171 } vtk3DSColour_24; 172 173 174 175 // VTK-HeaderTest-Exclude: vtk3DS.h 176