00001 /* 00002 * Copyright (c) 1998 by Tech Soft 3D, LLC. 00003 * The information contained herein is confidential and proprietary to 00004 * Tech Soft 3D, LLC., and considered a trade secret as defined under 00005 * civil and criminal statutes. Tech Soft 3D shall pursue its civil 00006 * and criminal remedies in the event of unauthorized use or misappropriation 00007 * of its trade secrets. Use of this information by anyone other than 00008 * authorized employees of Tech Soft 3D, LLC. is granted only under a 00009 * written non-disclosure agreement, expressly prescribing the scope and 00010 * manner of such use. 00011 * 00012 * $Id: hl_8h-source.html,v 1.29 2008-03-10 07:09:28 stage Exp $ 00013 */ 00014 00015 #define FPEPS (1.0e-5) /* for now: should be option */ 00016 #define FPZERO(x) ((x < FPEPS) && (x > -FPEPS)) 00017 00018 00019 00020 00021 struct HT_HL_Triangle { 00022 HT_HL_Triangle *next; 00023 HT_Net_Rendition const *net_rendition; 00024 00025 HT_Geometry const *geometry_in_progress; /* for callbacks */ 00026 HT_Subsegment const *instance_in_progress; 00027 00028 HT_DC_Point *samples; 00029 HT_DC_Point *points; 00030 00031 int count; 00032 00033 }; 00034 00035 00036 00037 struct HT_HL_Skip { 00038 HT_HL_Skip *next; 00039 HT_HL_Skip *prev; 00040 00041 float start; 00042 float end; 00043 }; 00044 00045 struct HT_HL_Line { 00046 HT_HL_Line *next; 00047 00048 HT_DC_Point p1; 00049 HT_DC_Point p2; 00050 00051 HT_RGBAS32 *colors; 00052 00053 float dx, dy, dz; 00054 float xmin, xmax, ymin, ymax; 00055 00056 float start; 00057 float end; 00058 00059 float epsilon; 00060 00061 HT_HL_Skip *first_skip; 00062 HT_HL_Skip *last_skip; 00063 }; 00064 00065 struct HT_HL_Polyline { 00066 HT_HL_Polyline *next; 00067 HT_Net_Rendition const *net_rendition; 00068 HT_Geometry const *geometry_in_progress; /* for callbacks */ 00069 HT_Subsegment const *instance_in_progress; 00070 00071 HT_HL_Line *lines; 00072 }; 00073 00074 00075 00076 struct HT_HL_Marker { 00077 HT_HL_Marker *next; 00078 HT_Net_Rendition const *net_rendition; 00079 HT_Geometry const *geometry_in_progress; /* for callbacks */ 00080 HT_Subsegment const *instance_in_progress; 00081 00082 HT_DC_Point p0; 00083 float rotation; 00084 float size_fixup; 00085 00086 bool visible; 00087 }; 00088 00089 00090 struct HT_HL_String { 00091 HT_HL_String *next; 00092 HT_Net_Rendition const *net_rendition; 00093 HT_Geometry const *geometry_in_progress; /* for callbacks */ 00094 HT_Subsegment const *instance_in_progress; 00095 00096 HT_DC_Point p0; 00097 HT_Hidden_Text_Info *hidden_text_info; 00098 HT_Text_Karacter_Info *kinfo; 00099 00100 bool visible; 00101 }; 00102 00103 00104 struct HT_HL_Image { 00105 HT_HL_Image * next; 00106 HT_Net_Rendition const * net_rendition; 00107 HT_Geometry const * geometry_in_progress; /* for callbacks */ 00108 HT_Subsegment const * instance_in_progress; 00109 00110 HT_DC_Point p0; 00111 HT_DC_Point p1; 00112 HT_Image_Info * hidden_image_info; 00113 00114 bool visible; /* ? */ 00115 }; 00116 00117 00118 struct HT_HL_Triangle_Bounding { 00119 HT_HL_Triangle *triangle; 00120 int offset; 00121 float xmin, xmax, ymin, ymax; 00122 }; 00123 00124 struct HT_HL_QuadTree_Node { 00125 00126 HT_HL_QuadTree_Node *children; 00127 HT_HL_QuadTree_Node *sibling; 00128 00129 HT_HL_Triangle_Bounding *boundings; 00130 HT_HL_Triangle *triangles; 00131 HT_HL_Triangle_Bounding *current; 00132 00133 HT_HL_QuadTree_Node *next; 00134 00135 unsigned long count; 00136 unsigned long level; 00137 unsigned long index; 00138 00139 float xmin, xmax, ymin, ymax; 00140 00141 }; 00142 00143 00144 00145 00146 struct HT_HL_Data { 00147 HT_HL_QuadTree_Node *root; 00148 HT_HL_QuadTree_Node *nodes; 00149 00150 HT_HL_Triangle *triangles; 00151 00152 HT_HL_Polyline *polylines; 00153 HT_HL_Image *images; 00154 HT_HL_Marker *markers; 00155 HT_HL_String *strings; 00156 00157 HT_HL_Polyline *silhouettes; 00158 00159 float tolerance_squared; 00160 float face_tolerance; 00161 int longest_polyline; 00162 int image_count; 00163 00164 HT_Display_Context * dc; 00165 00166 HT_Int_Rectangle extent; 00167 bool processed; 00168 bool hidden_lines; 00169 bool silhouette; 00170 bool multiple_depth_ranges; 00171 }; 00172 00173 00174