libDXF 0.0.1
A library with DXF related functions written in C.
|
00001 00042 #ifndef LIBDXF_SRC_SHAPE_H 00043 #define LIBDXF_SRC_SHAPE_H 00044 00045 00046 #include "global.h" 00047 #include "point.h" 00048 #include "binary_graphics_data.h" 00049 00050 00051 #ifdef __cplusplus 00052 extern "C" { 00053 #endif 00054 00055 00059 typedef struct 00060 dxf_shape_struct 00061 { 00062 /* Members common for all DXF drawable entities. */ 00063 int id_code; 00068 char *linetype; 00072 char *layer; 00076 double elevation; 00082 double thickness; 00086 double linetype_scale; 00090 int16_t visibility; 00098 int color; 00105 int paperspace; 00111 int graphics_data_size; 00120 int16_t shadow_mode; 00130 DxfBinaryGraphicsData *binary_graphics_data; 00136 char *dictionary_owner_soft; 00140 char *material; 00145 char *dictionary_owner_hard; 00149 int16_t lineweight; 00154 char *plot_style_name; 00158 long color_value; 00170 char *color_name; 00178 long transparency; 00186 /* Specific members for a DXF shape. */ 00187 char *shape_name; 00190 DxfPoint *p0; 00193 double x0; 00196 double y0; 00199 double z0; 00202 double size; 00205 double rel_x_scale; 00208 double rot_angle; 00211 double obl_angle; 00214 double extr_x0; 00218 double extr_y0; 00222 double extr_z0; 00226 struct DxfShape *next; 00229 } DxfShape; 00230 00231 00232 DxfShape *dxf_shape_new (); 00233 DxfShape *dxf_shape_init (DxfShape *shape); 00234 DxfShape *dxf_shape_read (DxfFile *fp, DxfShape *shape); 00235 int dxf_shape_write (DxfFile *fp, DxfShape *shape); 00236 int dxf_shape_free (DxfShape *shape); 00237 void dxf_shape_free_chain (DxfShape *shapes); 00238 int dxf_shape_get_id_code (DxfShape *shape); 00239 DxfShape *dxf_shape_set_id_code (DxfShape *shape, int id_code); 00240 char *dxf_shape_get_linetype (DxfShape *shape); 00241 DxfShape *dxf_shape_set_linetype (DxfShape *shape, char *linetype); 00242 char *dxf_shape_get_layer (DxfShape *shape); 00243 DxfShape *dxf_shape_set_layer (DxfShape *shape, char *layer); 00244 double dxf_shape_get_elevation (DxfShape *shape); 00245 DxfShape *dxf_shape_set_elevation (DxfShape *shape, double elevation); 00246 double dxf_shape_get_thickness (DxfShape *shape); 00247 DxfShape *dxf_shape_set_thickness (DxfShape *shape, double thickness); 00248 double dxf_shape_get_linetype_scale (DxfShape *shape); 00249 DxfShape *dxf_shape_set_linetype_scale (DxfShape *shape, double linetype_scale); 00250 int16_t dxf_shape_get_visibility (DxfShape *shape); 00251 DxfShape *dxf_shape_set_visibility (DxfShape *shape, int16_t visibility); 00252 int dxf_shape_get_color (DxfShape *shape); 00253 DxfShape *dxf_shape_set_color (DxfShape *shape, int color); 00254 int dxf_shape_get_paperspace (DxfShape *shape); 00255 DxfShape *dxf_shape_set_paperspace (DxfShape *shape, int paperspace); 00256 int dxf_shape_get_graphics_data_size (DxfShape *shape); 00257 DxfShape *dxf_shape_set_graphics_data_size (DxfShape *shape, int graphics_data_size); 00258 int16_t dxf_shape_get_shadow_mode (DxfShape *shape); 00259 DxfShape *dxf_shape_set_shadow_mode (DxfShape *shape, int16_t shadow_mode); 00260 DxfBinaryGraphicsData *dxf_shape_get_binary_graphics_data (DxfShape *shape); 00261 DxfShape *dxf_shape_set_binary_graphics_data (DxfShape *shape, DxfBinaryGraphicsData *data); 00262 char *dxf_shape_get_dictionary_owner_soft (DxfShape *shape); 00263 DxfShape *dxf_shape_set_dictionary_owner_soft (DxfShape *shape, char *dictionary_owner_soft); 00264 char *dxf_shape_get_material (DxfShape *shape); 00265 DxfShape *dxf_shape_set_material (DxfShape *shape, char *material); 00266 char *dxf_shape_get_dictionary_owner_hard (DxfShape *shape); 00267 DxfShape *dxf_shape_set_dictionary_owner_hard (DxfShape *shape, char *dictionary_owner_hard); 00268 int16_t dxf_shape_get_lineweight (DxfShape *shape); 00269 DxfShape *dxf_shape_set_lineweight (DxfShape *shape, int16_t lineweight); 00270 char *dxf_shape_get_plot_style_name (DxfShape *shape); 00271 DxfShape *dxf_shape_set_plot_style_name (DxfShape *shape, char *plot_style_name); 00272 long dxf_shape_get_color_value (DxfShape *shape); 00273 DxfShape *dxf_shape_set_color_value (DxfShape *shape, long color_value); 00274 char *dxf_shape_get_color_name (DxfShape *shape); 00275 DxfShape *dxf_shape_set_color_name (DxfShape *shape, char *color_name); 00276 long dxf_shape_get_transparency (DxfShape *shape); 00277 DxfShape *dxf_shape_set_transparency (DxfShape *shape, long transparency); 00278 DxfPoint *dxf_shape_get_p0 (DxfShape *shape); 00279 DxfShape *dxf_shape_set_p0 (DxfShape *shape, DxfPoint *p0); 00280 double dxf_shape_get_x0 (DxfShape *shape); 00281 DxfShape *dxf_shape_set_x0 (DxfShape *shape, double x0); 00282 double dxf_shape_get_y0 (DxfShape *shape); 00283 DxfShape *dxf_shape_set_y0 (DxfShape *shape, double y0); 00284 double dxf_shape_get_z0 (DxfShape *shape); 00285 DxfShape *dxf_shape_set_z0 (DxfShape *shape, double z0); 00286 double dxf_shape_get_size (DxfShape *shape); 00287 DxfShape *dxf_shape_set_size (DxfShape *shape, double size); 00288 double dxf_shape_get_rel_x_scale (DxfShape *shape); 00289 DxfShape *dxf_shape_set_rel_x_scale (DxfShape *shape, double rel_x_scale); 00290 double dxf_shape_get_rot_angle (DxfShape *shape); 00291 DxfShape *dxf_shape_set_rot_angle (DxfShape *shape, double rot_angle); 00292 double dxf_shape_get_obl_angle (DxfShape *shape); 00293 DxfShape *dxf_shape_set_obl_angle (DxfShape *shape, double obl_angle); 00294 double dxf_shape_get_extr_x0 (DxfShape *shape); 00295 DxfShape *dxf_shape_set_extr_x0 (DxfShape *shape, double extr_x0); 00296 double dxf_shape_get_extr_y0 (DxfShape *shape); 00297 DxfShape *dxf_shape_set_extr_y0 (DxfShape *shape, double extr_y0); 00298 double dxf_shape_get_extr_z0 (DxfShape *shape); 00299 DxfShape *dxf_shape_set_extr_z0 (DxfShape *shape, double extr_z0); 00300 DxfShape *dxf_shape_get_next (DxfShape *shape); 00301 DxfShape *dxf_shape_set_next (DxfShape *shape, DxfShape *next); 00302 DxfShape *dxf_shape_get_last (DxfShape *shape); 00303 00304 00305 #ifdef __cplusplus 00306 } 00307 #endif 00308 00309 00310 #endif /* LIBDXF_SRC_SHAPE_H */ 00311 00312 00313 /* EOF */