libDXF 0.0.1
A library with DXF related functions written in C.
|
00001 00042 #ifndef LIBDXF_SRC_SPLINE_H 00043 #define LIBDXF_SRC_SPLINE_H 00044 00045 00046 #include "global.h" 00047 #include "binary_graphics_data.h" 00048 #include "point.h" 00049 #include "util.h" 00050 00051 00052 #ifdef __cplusplus 00053 extern "C" { 00054 #endif 00055 00056 00057 #define DXF_SPLINE_KNOT_TOLERANCE_DEFAULT 0.0000001 00058 #define DXF_SPLINE_CONTROL_POINT_TOLERANCE_DEFAULT 0.0000001 00059 #define DXF_SPLINE_FIT_TOLERANCE_DEFAULT 0.0000000001 00060 00061 00065 typedef struct 00066 dxf_spline_struct 00067 { 00068 /* Members common for all DXF drawable entities. */ 00069 int id_code; 00074 char *linetype; 00078 char *layer; 00082 double elevation; 00087 double thickness; 00091 double linetype_scale; 00094 int16_t visibility; 00101 int color; 00108 int paperspace; 00113 int graphics_data_size; 00118 int16_t shadow_mode; 00127 DxfBinaryGraphicsData *binary_graphics_data; 00132 char *dictionary_owner_soft; 00135 char *material; 00139 char *dictionary_owner_hard; 00142 int16_t lineweight; 00146 char *plot_style_name; 00149 long color_value; 00160 char *color_name; 00167 long transparency; 00174 /* Specific members for a DXF spline. */ 00175 DxfPoint *p0; 00178 DxfPoint *p1; 00181 DxfPoint *p2; 00185 DxfPoint *p3; 00189 DxfDouble *knot_value; 00192 DxfDouble *weight_value; 00196 double knot_tolerance; 00199 double control_point_tolerance; 00202 double fit_tolerance; 00205 int flag; 00215 int degree; 00218 int number_of_knots; 00221 int number_of_control_points; 00224 int number_of_fit_points; 00227 double extr_x0; 00231 double extr_y0; 00235 double extr_z0; 00239 struct DxfSpline *next; 00242 } DxfSpline; 00243 00244 00245 DxfSpline *dxf_spline_new (); 00246 DxfSpline *dxf_spline_init (DxfSpline *spline); 00247 DxfSpline *dxf_spline_read (DxfFile *fp, DxfSpline *spline); 00248 int dxf_spline_write (DxfFile *fp, DxfSpline *spline); 00249 int dxf_spline_free (DxfSpline *spline); 00250 void dxf_spline_free_chain (DxfSpline *splines); 00251 int dxf_spline_get_id_code (DxfSpline *spline); 00252 DxfSpline *dxf_spline_set_id_code (DxfSpline *spline, int id_code); 00253 char *dxf_spline_get_linetype (DxfSpline *spline); 00254 DxfSpline *dxf_spline_set_linetype (DxfSpline *spline, char *linetype); 00255 char *dxf_spline_get_layer (DxfSpline *spline); 00256 DxfSpline *dxf_spline_set_layer (DxfSpline *spline, char *layer); 00257 double dxf_spline_get_elevation (DxfSpline *spline); 00258 DxfSpline *dxf_spline_set_elevation (DxfSpline *spline, double elevation); 00259 double dxf_spline_get_thickness (DxfSpline *spline); 00260 DxfSpline *dxf_spline_set_thickness (DxfSpline *spline, double thickness); 00261 double dxf_spline_get_linetype_scale (DxfSpline *spline); 00262 DxfSpline *dxf_spline_set_linetype_scale (DxfSpline *spline, double linetype_scale); 00263 int16_t dxf_spline_get_visibility (DxfSpline *spline); 00264 DxfSpline *dxf_spline_set_visibility (DxfSpline *spline, int16_t visibility); 00265 int dxf_spline_get_color (DxfSpline *spline); 00266 DxfSpline *dxf_spline_set_color (DxfSpline *spline, int color); 00267 int dxf_spline_get_paperspace (DxfSpline *spline); 00268 DxfSpline *dxf_spline_set_paperspace (DxfSpline *spline, int paperspace); 00269 int dxf_spline_get_graphics_data_size (DxfSpline *spline); 00270 DxfSpline *dxf_spline_set_graphics_data_size (DxfSpline *spline, int graphics_data_size); 00271 int16_t dxf_spline_get_shadow_mode (DxfSpline *spline); 00272 DxfSpline *dxf_spline_set_shadow_mode (DxfSpline *spline, int16_t shadow_mode); 00273 DxfBinaryGraphicsData *dxf_spline_get_binary_graphics_data (DxfSpline *spline); 00274 DxfSpline *dxf_spline_set_binary_graphics_data (DxfSpline *spline, DxfBinaryGraphicsData *data); 00275 char *dxf_spline_get_dictionary_owner_soft (DxfSpline *spline); 00276 DxfSpline *dxf_spline_set_dictionary_owner_soft (DxfSpline *spline, char *dictionary_owner_soft); 00277 char *dxf_spline_get_material (DxfSpline *spline); 00278 DxfSpline *dxf_spline_set_material (DxfSpline *spline, char *material); 00279 char *dxf_spline_get_dictionary_owner_hard (DxfSpline *spline); 00280 DxfSpline *dxf_spline_set_dictionary_owner_hard (DxfSpline *spline, char *dictionary_owner_hard); 00281 int16_t dxf_spline_get_lineweight (DxfSpline *spline); 00282 DxfSpline *dxf_spline_set_lineweight (DxfSpline *spline, int16_t lineweight); 00283 char *dxf_spline_get_plot_style_name (DxfSpline *spline); 00284 DxfSpline *dxf_spline_set_plot_style_name (DxfSpline *spline, char *plot_style_name); 00285 long dxf_spline_get_color_value (DxfSpline *spline); 00286 DxfSpline *dxf_spline_set_color_value (DxfSpline *spline, long color_value); 00287 char *dxf_spline_get_color_name (DxfSpline *spline); 00288 DxfSpline *dxf_spline_set_color_name (DxfSpline *spline, char *color_name); 00289 long dxf_spline_get_transparency (DxfSpline *spline); 00290 DxfSpline *dxf_spline_set_transparency (DxfSpline *spline, long transparency); 00291 DxfPoint *dxf_spline_get_p0 (DxfSpline *spline); 00292 DxfSpline *dxf_spline_set_p0 (DxfSpline *spline, DxfPoint *p0); 00293 double dxf_spline_get_x0 (DxfSpline *spline); 00294 DxfSpline *dxf_spline_set_x0 (DxfSpline *spline, double x0); 00295 double dxf_spline_get_y0 (DxfSpline *spline); 00296 DxfSpline *dxf_spline_set_y0 (DxfSpline *spline, double y0); 00297 double dxf_spline_get_z0 (DxfSpline *spline); 00298 DxfSpline *dxf_spline_set_z0 (DxfSpline *spline, double z0); 00299 DxfPoint *dxf_spline_get_p1 (DxfSpline *spline); 00300 DxfSpline *dxf_spline_set_p1 (DxfSpline *spline, DxfPoint *p1); 00301 double dxf_spline_get_x1 (DxfSpline *spline); 00302 DxfSpline *dxf_spline_set_x1 (DxfSpline *spline, double x1); 00303 double dxf_spline_get_y1 (DxfSpline *spline); 00304 DxfSpline *dxf_spline_set_y1 (DxfSpline *spline, double y1); 00305 double dxf_spline_get_z1 (DxfSpline *spline); 00306 DxfSpline *dxf_spline_set_z1 (DxfSpline *spline, double z1); 00307 DxfPoint *dxf_spline_get_p2 (DxfSpline *spline); 00308 DxfSpline *dxf_spline_set_p2 (DxfSpline *spline, DxfPoint *p2); 00309 double dxf_spline_get_x2 (DxfSpline *spline); 00310 DxfSpline *dxf_spline_set_x2 (DxfSpline *spline, double x2); 00311 double dxf_spline_get_y2 (DxfSpline *spline); 00312 DxfSpline *dxf_spline_set_y2 (DxfSpline *spline, double y2); 00313 double dxf_spline_get_z2 (DxfSpline *spline); 00314 DxfSpline *dxf_spline_set_z2 (DxfSpline *spline, double z2); 00315 DxfPoint *dxf_spline_get_p3 (DxfSpline *spline); 00316 DxfSpline *dxf_spline_set_p3 (DxfSpline *spline, DxfPoint *p3); 00317 double dxf_spline_get_x3 (DxfSpline *spline); 00318 DxfSpline *dxf_spline_set_x3 (DxfSpline *spline, double x3); 00319 double dxf_spline_get_y3 (DxfSpline *spline); 00320 DxfSpline *dxf_spline_set_y3 (DxfSpline *spline, double y3); 00321 double dxf_spline_get_z3 (DxfSpline *spline); 00322 DxfSpline *dxf_spline_set_z3 (DxfSpline *spline, double z3); 00323 double dxf_spline_get_knot_tolerance (DxfSpline *spline); 00324 DxfSpline *dxf_spline_set_knot_tolerance (DxfSpline *spline, double knot_tolerance); 00325 double dxf_spline_get_control_point_tolerance (DxfSpline *spline); 00326 DxfSpline *dxf_spline_set_control_point_tolerance (DxfSpline *spline, double control_point_tolerance); 00327 double dxf_spline_get_fit_tolerance (DxfSpline *spline); 00328 DxfSpline *dxf_spline_set_fit_tolerance (DxfSpline *spline, double fit_tolerance); 00329 int dxf_spline_get_flag (DxfSpline *spline); 00330 00331 00332 #ifdef __cplusplus 00333 } 00334 #endif 00335 00336 00337 #endif /* LIBDXF_SRC_SPLINE_H */ 00338 00339 00340 /* EOF */ 00341