libDXF 0.0.1
A library with DXF related functions written in C.

spline.c

Go to the documentation of this file.
00001 
00233 #include "spline.h"
00234 
00235 
00244 DxfSpline *
00245 dxf_spline_new ()
00246 {
00247 #if DEBUG
00248         DXF_DEBUG_BEGIN
00249 #endif
00250         DxfSpline *spline = NULL;
00251         size_t size;
00252 
00253         size = sizeof (DxfSpline);
00254         /* avoid malloc of 0 bytes */
00255         if (size == 0) size = 1;
00256         if ((spline = malloc (size)) == NULL)
00257         {
00258                 fprintf (stderr,
00259                   (_("Error in %s () could not allocate memory for a DxfSpline struct.\n")),
00260                   __FUNCTION__);
00261                 spline = NULL;
00262         }
00263         else
00264         {
00265                 memset (spline, 0, size);
00266         }
00267 #if DEBUG
00268         DXF_DEBUG_END
00269 #endif
00270         return (spline);
00271 }
00272 
00273 
00281 DxfSpline *
00282 dxf_spline_init
00283 (
00284         DxfSpline *spline
00286 )
00287 {
00288 #if DEBUG
00289         DXF_DEBUG_BEGIN
00290 #endif
00291         /* Do some basic checks. */
00292         if (spline == NULL)
00293         {
00294                 fprintf (stderr,
00295                   (_("Warning in %s () a NULL pointer was passed.\n")),
00296                   __FUNCTION__);
00297                 spline = dxf_spline_new ();
00298         }
00299         if (spline == NULL)
00300         {
00301                 fprintf (stderr,
00302                   (_("Error in %s () could not allocate memory for a DxfSpline struct.\n")),
00303                   __FUNCTION__);
00304                 return (NULL);
00305         }
00306         spline->id_code = 0;
00307         spline->linetype = strdup (DXF_DEFAULT_LINETYPE);
00308         spline->layer = strdup (DXF_DEFAULT_LAYER);
00309         spline->elevation = 0.0;
00310         spline->thickness = 0.0;
00311         spline->linetype_scale = 1.0;
00312         spline->visibility = 0;
00313         spline->color = DXF_COLOR_BYLAYER;
00314         spline->paperspace = DXF_MODELSPACE;
00315         spline->graphics_data_size = 0;
00316         spline->shadow_mode = 0;
00317         dxf_binary_graphics_data_init ((DxfBinaryGraphicsData *) spline->binary_graphics_data);
00318         spline->dictionary_owner_soft = strdup ("");
00319         spline->material = strdup ("");
00320         spline->dictionary_owner_hard = strdup ("");
00321         spline->lineweight = 0;
00322         spline->plot_style_name = strdup ("");
00323         spline->color_value = 0;
00324         spline->color_name = strdup ("");
00325         spline->transparency = 0;
00326         spline->p0 = dxf_point_new ();
00327         spline->p0 = dxf_point_init (spline->p0);
00328         spline->p1 = dxf_point_new ();
00329         spline->p1 = dxf_point_init (spline->p1);
00330         spline->p2 = dxf_point_new ();
00331         spline->p2 = dxf_point_init (spline->p2);
00332         spline->p3 = dxf_point_new ();
00333         spline->p3 = dxf_point_init (spline->p3);
00334         dxf_double_new (spline->knot_value);
00335         spline->knot_value = dxf_double_init (spline->knot_value);
00336         spline->knot_value->value = 0.0;
00337         dxf_double_new (spline->weight_value);
00338         spline->weight_value = dxf_double_init (spline->weight_value);
00339         spline->weight_value->value = 0.0;
00340         spline->extr_x0 = 0.0;
00341         spline->extr_y0 = 0.0;
00342         spline->extr_z0 = 0.0;
00343         spline->knot_tolerance = DXF_SPLINE_KNOT_TOLERANCE_DEFAULT;
00344         spline->control_point_tolerance = DXF_SPLINE_CONTROL_POINT_TOLERANCE_DEFAULT;
00345         spline->fit_tolerance = DXF_SPLINE_FIT_TOLERANCE_DEFAULT;
00346         spline->flag = 0;
00347         spline->degree = 0;
00348         spline->number_of_knots = 0;
00349         spline->number_of_control_points = 0;
00350         spline->number_of_fit_points = 0;
00351         spline->next = NULL;
00352 #if DEBUG
00353         DXF_DEBUG_END
00354 #endif
00355         return (spline);
00356 }
00357 
00358 
00370 DxfSpline *
00371 dxf_spline_read
00372 (
00373         DxfFile *fp,
00375         DxfSpline *spline
00377 )
00378 {
00379 #if DEBUG
00380         DXF_DEBUG_BEGIN
00381 #endif
00382         char *temp_string = NULL;
00383         DxfBinaryGraphicsData *binary_graphics_data = NULL;
00384         DxfPoint *p0 = NULL;
00385         DxfPoint *p1 = NULL;
00386         DxfPoint *p2 = NULL;
00387         DxfPoint *p3 = NULL;
00388         DxfDouble *kv = NULL; /* knot_value iter. */
00389         DxfDouble *wv = NULL; /* weight value iter. */
00390 
00391         /* Do some basic checks. */
00392         if (fp == NULL)
00393         {
00394                 fprintf (stderr,
00395                   (_("Error in %s () a NULL file pointer was passed.\n")),
00396                   __FUNCTION__);
00397                 /* Clean up. */
00398                 free (temp_string);
00399                 return (NULL);
00400         }
00401         if (spline == NULL)
00402         {
00403                 fprintf (stderr,
00404                   (_("Warning in %s () a NULL pointer was passed.\n")),
00405                   __FUNCTION__);
00406                 spline = dxf_spline_new ();
00407                 spline = dxf_spline_init (spline);
00408         }
00409         binary_graphics_data = (DxfBinaryGraphicsData *) spline->binary_graphics_data;
00410         p0 = (DxfPoint *) spline->p0;
00411         p1 = (DxfPoint *) spline->p1;
00412         p2 = (DxfPoint *) spline->p2;
00413         p3 = (DxfPoint *) spline->p3;
00414         kv = (DxfDouble *) spline->knot_value;
00415         wv = (DxfDouble *) spline->weight_value;
00416         (fp->line_number)++;
00417         fscanf (fp->fp, "%[^\n]", temp_string);
00418         while (strcmp (temp_string, "0") != 0)
00419         {
00420                 if (ferror (fp->fp))
00421                 {
00422                         fprintf (stderr,
00423                           (_("Error in %s () while reading from: %s in line: %d.\n")),
00424                           __FUNCTION__, fp->filename, fp->line_number);
00425                         fclose (fp->fp);
00426                         /* Clean up. */
00427                         free (temp_string);
00428                         return (NULL);
00429                 }
00430                 if (strcmp (temp_string, "5") == 0)
00431                 {
00432                         /* Now follows a string containing a sequential
00433                          * id number. */
00434                         (fp->line_number)++;
00435                         fscanf (fp->fp, "%x\n", &spline->id_code);
00436                 }
00437                 else if (strcmp (temp_string, "6") == 0)
00438                 {
00439                         /* Now follows a string containing a linetype
00440                          * name. */
00441                         (fp->line_number)++;
00442                         fscanf (fp->fp, "%s\n", spline->linetype);
00443                 }
00444                 else if (strcmp (temp_string, "8") == 0)
00445                 {
00446                         /* Now follows a string containing a layer name. */
00447                         (fp->line_number)++;
00448                         fscanf (fp->fp, "%s\n", spline->layer);
00449                 }
00450                 else if (strcmp (temp_string, "10") == 0)
00451                 {
00452                         /* Now follows a string containing the
00453                          * X-value of the control point coordinate
00454                          * (multiple entries). */
00455                         (fp->line_number)++;
00456                         fscanf (fp->fp, "%lf\n", &p0->x0);
00457                 }
00458                 else if (strcmp (temp_string, "20") == 0)
00459                 {
00460                         /* Now follows a string containing the
00461                          * Y-coordinate of control point coordinate
00462                          * (multiple entries). */
00463                         (fp->line_number)++;
00464                         fscanf (fp->fp, "%lf\n", &p0->y0);
00465                 }
00466                 else if (strcmp (temp_string, "30") == 0)
00467                 {
00468                         /* Now follows a string containing the
00469                          * Z-coordinate of the control point coordinate
00470                          * (multiple entries). */
00471                         (fp->line_number)++;
00472                         fscanf (fp->fp, "%lf\n", &p0->z0);
00473                         dxf_point_init ((DxfPoint *) p0->next);
00474                         p0 = (DxfPoint *) p0->next;
00475                 }
00476                 else if (strcmp (temp_string, "11") == 0)
00477                 {
00478                         /* Now follows a string containing the
00479                          * X-coordinate of the fit point coordinate
00480                          * (multiple entries). */
00481                         (fp->line_number)++;
00482                         fscanf (fp->fp, "%lf\n", &p1->x0);
00483                 }
00484                 else if (strcmp (temp_string, "21") == 0)
00485                 {
00486                         /* Now follows a string containing the
00487                          * Y-coordinate of the fit point coordinate
00488                          * (multiple entries). */
00489                         (fp->line_number)++;
00490                         fscanf (fp->fp, "%lf\n", &p1->y0);
00491                 }
00492                 else if (strcmp (temp_string, "31") == 0)
00493                 {
00494                         /* Now follows a string containing the
00495                          * Z-coordinate of the fit point coordinate
00496                          * (multiple entries). */
00497                         (fp->line_number)++;
00498                         fscanf (fp->fp, "%lf\n", &p1->z0);
00499                         dxf_point_init ((DxfPoint *) p1->next);
00500                         p1 = (DxfPoint *) p1->next;
00501                 }
00502                 else if (strcmp (temp_string, "12") == 0)
00503                 {
00504                         /* Now follows a string containing the
00505                          * X-coordinate of the start tangent,
00506                          * may be omitted (in WCS). */
00507                         (fp->line_number)++;
00508                         fscanf (fp->fp, "%lf\n", &p2->x0);
00509                 }
00510                 else if (strcmp (temp_string, "22") == 0)
00511                 {
00512                         /* Now follows a string containing the
00513                          * Y-coordinate of the start tangent,
00514                          * may be omitted (in WCS). */
00515                         (fp->line_number)++;
00516                         fscanf (fp->fp, "%lf\n", &p2->y0);
00517                 }
00518                 else if (strcmp (temp_string, "32") == 0)
00519                 {
00520                         /* Now follows a string containing the
00521                          * Z-coordinate of the start tangent,
00522                          * may be omitted (in WCS). */
00523                         (fp->line_number)++;
00524                         fscanf (fp->fp, "%lf\n", &p2->z0);
00525                 }
00526                 else if (strcmp (temp_string, "13") == 0)
00527                 {
00528                         /* Now follows a string containing the
00529                          * X-coordinate of the end tangent,
00530                          * may be omitted (in WCS). */
00531                         (fp->line_number)++;
00532                         fscanf (fp->fp, "%lf\n", &p3->x0);
00533                 }
00534                 else if (strcmp (temp_string, "23") == 0)
00535                 {
00536                         /* Now follows a string containing the
00537                          * Y-coordinate of the end tangent,
00538                          * may be omitted (in WCS). */
00539                         (fp->line_number)++;
00540                         fscanf (fp->fp, "%lf\n", &p3->y0);
00541                 }
00542                 else if (strcmp (temp_string, "33") == 0)
00543                 {
00544                         /* Now follows a string containing the
00545                          * Z-coordinate of the end tangent,
00546                          * may be omitted (in WCS). */
00547                         (fp->line_number)++;
00548                         fscanf (fp->fp, "%lf\n", &p3->z0);
00549                 }
00550                 else if ((fp->acad_version_number <= AutoCAD_11)
00551                         && (strcmp (temp_string, "38") == 0)
00552                         && (spline->elevation != 0.0))
00553                 {
00554                         /* Now follows a string containing the
00555                          * elevation. */
00556                         (fp->line_number)++;
00557                         fscanf (fp->fp, "%lf\n", &spline->elevation);
00558                 }
00559                 else if (strcmp (temp_string, "39") == 0)
00560                 {
00561                         /* Now follows a thickness value. */
00562                         (fp->line_number)++;
00563                         fscanf (fp->fp, "%lf\n", &spline->thickness);
00564                 }
00565                 else if (strcmp (temp_string, "40") == 0)
00566                 {
00567                         /* Now follows a knot value (one entry per knot, multiple entries). */
00568                         (fp->line_number)++;
00569                         fscanf (fp->fp, "%lf\n", &kv->value);
00570                         dxf_double_init ((DxfDouble *) kv->next);
00571                         kv = (DxfDouble *) kv->next;
00572                 }
00573                 else if (strcmp (temp_string, "41") == 0)
00574                 {
00575                         /* Now follows a weight value (one entry per knot, multiple entries). */
00576                         (fp->line_number)++;
00577                         fscanf (fp->fp, "%lf\n", &wv->value);
00578                         dxf_double_init ((DxfDouble *) wv->next);
00579                         wv = (DxfDouble *) wv->next;
00580                 }
00581                 else if (strcmp (temp_string, "42") == 0)
00582                 {
00583                         /* Now follows a knot tolerance value. */
00584                         (fp->line_number)++;
00585                         fscanf (fp->fp, "%lf\n", &spline->knot_tolerance);
00586                 }
00587                 else if (strcmp (temp_string, "43") == 0)
00588                 {
00589                         /* Now follows a control point tolerance value. */
00590                         (fp->line_number)++;
00591                         fscanf (fp->fp, "%lf\n", &spline->control_point_tolerance);
00592                 }
00593                 else if (strcmp (temp_string, "44") == 0)
00594                 {
00595                         /* Now follows a fit point tolerance value. */
00596                         (fp->line_number)++;
00597                         fscanf (fp->fp, "%lf\n", &spline->fit_tolerance);
00598                 }
00599                 else if (strcmp (temp_string, "48") == 0)
00600                 {
00601                         /* Now follows a linetype scale value. */
00602                         (fp->line_number)++;
00603                         fscanf (fp->fp, "%lf\n", &spline->linetype_scale);
00604                 }
00605                 else if (strcmp (temp_string, "60") == 0)
00606                 {
00607                         /* Now follows a string containing the
00608                          * visibility value. */
00609                         (fp->line_number)++;
00610                         fscanf (fp->fp, "%hd\n", &spline->visibility);
00611                 }
00612                 else if (strcmp (temp_string, "62") == 0)
00613                 {
00614                         /* Now follows a string containing the
00615                          * color value. */
00616                         (fp->line_number)++;
00617                         fscanf (fp->fp, "%d\n", &spline->color);
00618                 }
00619                 else if (strcmp (temp_string, "67") == 0)
00620                 {
00621                         /* Now follows a string containing the
00622                          * paperspace value. */
00623                         (fp->line_number)++;
00624                         fscanf (fp->fp, "%d\n", &spline->paperspace);
00625                 }
00626                 else if (strcmp (temp_string, "70") == 0)
00627                 {
00628                         /* Now follows a flag value (bit coded). */
00629                         (fp->line_number)++;
00630                         fscanf (fp->fp, "%d\n", &spline->flag);
00631                 }
00632                 else if (strcmp (temp_string, "71") == 0)
00633                 {
00634                         /* Now follows a degree of spline curve value. */
00635                         (fp->line_number)++;
00636                         fscanf (fp->fp, "%d\n", &spline->degree);
00637                 }
00638                 else if (strcmp (temp_string, "72") == 0)
00639                 {
00640                         /* Now follows a number of knots value. */
00641                         (fp->line_number)++;
00642                         fscanf (fp->fp, "%d\n", &spline->number_of_knots);
00643                 }
00644                 else if (strcmp (temp_string, "73") == 0)
00645                 {
00646                         /* Now follows a number of control points value. */
00647                         (fp->line_number)++;
00648                         fscanf (fp->fp, "%d\n", &spline->number_of_control_points);
00649                 }
00650                 else if (strcmp (temp_string, "74") == 0)
00651                 {
00652                         /* Now follows a number of fit points value. */
00653                         (fp->line_number)++;
00654                         fscanf (fp->fp, "%d\n", &spline->number_of_fit_points);
00655                 }
00656                 else if (strcmp (temp_string, "92") == 0)
00657                 {
00658                         /* Now follows a string containing the
00659                          * paperspace value. */
00660                         (fp->line_number)++;
00661                         fscanf (fp->fp, "%d\n", &spline->graphics_data_size);
00662                 }
00663                 else if (strcmp (temp_string, "284") == 0)
00664                 {
00665                         /* Now follows a string containing the shadow
00666                          * mode value. */
00667                         (fp->line_number)++;
00668                         fscanf (fp->fp, "%hd\n", &spline->shadow_mode);
00669                 }
00670                 else if (strcmp (temp_string, "310") == 0)
00671                 {
00672                         /* Now follows a string containing binary
00673                          * graphics data. */
00674                         (fp->line_number)++;
00675                         fscanf (fp->fp, "%s\n", binary_graphics_data->data_line);
00676                         dxf_binary_graphics_data_init ((DxfBinaryGraphicsData *) binary_graphics_data->next);
00677                         binary_graphics_data = (DxfBinaryGraphicsData *) binary_graphics_data->next;
00678                 }
00679                 else if (strcmp (temp_string, "330") == 0)
00680                 {
00681                         /* Now follows a string containing a
00682                          * soft-pointer ID/handle to owner dictionary. */
00683                         (fp->line_number)++;
00684                         fscanf (fp->fp, "%s\n", spline->dictionary_owner_soft);
00685                 }
00686                 else if (strcmp (temp_string, "347") == 0)
00687                 {
00688                         /* Now follows a string containing a
00689                          * hard-pointer ID/handle to material object. */
00690                         (fp->line_number)++;
00691                         fscanf (fp->fp, "%s\n", spline->material);
00692                 }
00693                 else if (strcmp (temp_string, "360") == 0)
00694                 {
00695                         /* Now follows a string containing a
00696                          * hard-pointer ID/handle to owner dictionary. */
00697                         (fp->line_number)++;
00698                         fscanf (fp->fp, "%s\n", spline->dictionary_owner_hard);
00699                 }
00700                 else if (strcmp (temp_string, "370") == 0)
00701                 {
00702                         /* Now follows a string containing the lineweight
00703                          * value. */
00704                         (fp->line_number)++;
00705                         fscanf (fp->fp, "%hd\n", &spline->lineweight);
00706                 }
00707                 else if (strcmp (temp_string, "390") == 0)
00708                 {
00709                         /* Now follows a string containing a plot style
00710                          * name value. */
00711                         (fp->line_number)++;
00712                         fscanf (fp->fp, "%s\n", spline->plot_style_name);
00713                 }
00714                 else if (strcmp (temp_string, "420") == 0)
00715                 {
00716                         /* Now follows a string containing a color value. */
00717                         (fp->line_number)++;
00718                         fscanf (fp->fp, "%ld\n", &spline->color_value);
00719                 }
00720                 else if (strcmp (temp_string, "430") == 0)
00721                 {
00722                         /* Now follows a string containing a color
00723                          * name value. */
00724                         (fp->line_number)++;
00725                         fscanf (fp->fp, "%s\n", spline->color_name);
00726                 }
00727                 else if (strcmp (temp_string, "440") == 0)
00728                 {
00729                         /* Now follows a string containing a transparency
00730                          * value. */
00731                         (fp->line_number)++;
00732                         fscanf (fp->fp, "%ld\n", &spline->transparency);
00733                 }
00734                 else if (strcmp (temp_string, "999") == 0)
00735                 {
00736                         /* Now follows a string containing a comment. */
00737                         (fp->line_number)++;
00738                         fscanf (fp->fp, "%s\n", temp_string);
00739                         fprintf (stdout, "DXF comment: %s\n", temp_string);
00740                 }
00741                 else
00742                 {
00743                         fprintf (stderr,
00744                           (_("Warning in %s () unknown string tag found while reading from: %s in line: %d.\n")),
00745                           __FUNCTION__, fp->filename, fp->line_number);
00746                 }
00747         }
00748         /* Handle omitted members and/or illegal values. */
00749         if (strcmp (spline->linetype, "") == 0)
00750         {
00751                 spline->linetype = strdup (DXF_DEFAULT_LINETYPE);
00752         }
00753         if (strcmp (spline->layer, "") == 0)
00754         {
00755                 spline->layer = strdup (DXF_DEFAULT_LAYER);
00756         }
00757         /* Clean up. */
00758         free (temp_string);
00759 #if DEBUG
00760         DXF_DEBUG_END
00761 #endif
00762         return (spline);
00763 }
00764 
00765 
00772 int
00773 dxf_spline_write
00774 (
00775         DxfFile *fp,
00777         DxfSpline *spline
00779 )
00780 {
00781 #if DEBUG
00782         DXF_DEBUG_BEGIN
00783 #endif
00784         char *dxf_entity_name = strdup ("SPLINE");
00785         int i;
00786         DxfBinaryGraphicsData *binary_graphics_data = NULL;
00787         DxfPoint *p0 = NULL;
00788         DxfPoint *p1 = NULL;
00789         DxfPoint *p2 = NULL;
00790         DxfPoint *p3 = NULL;
00791 
00792         /* Do some basic checks. */
00793         if (fp == NULL)
00794         {
00795                 fprintf (stderr,
00796                   (_("Error in %s () a NULL file pointer was passed.\n")),
00797                   __FUNCTION__);
00798                 /* Clean up. */
00799                 free (dxf_entity_name);
00800                 return (EXIT_FAILURE);
00801         }
00802         if (spline == NULL)
00803         {
00804                 fprintf (stderr,
00805                   (_("Error in %s () a NULL pointer was passed.\n")),
00806                   __FUNCTION__);
00807                 /* Clean up. */
00808                 free (dxf_entity_name);
00809                 return (EXIT_FAILURE);
00810         }
00811         if (fp->acad_version_number < AutoCAD_13)
00812         {
00813                 fprintf (stderr,
00814                   (_("Warning in %s () illegal DXF version for this entity.\n")),
00815                   __FUNCTION__);
00816         }
00817         if (strcmp (spline->linetype, "") == 0)
00818         {
00819                 fprintf (stderr,
00820                   (_("Warning in %s () empty linetype string for the %s entity with id-code: %x\n")),
00821                   __FUNCTION__, dxf_entity_name, spline->id_code);
00822                 fprintf (stderr,
00823                   (_("\t%s entity is reset to default linetype")),
00824                   dxf_entity_name);
00825                 spline->linetype = strdup (DXF_DEFAULT_LINETYPE);
00826         }
00827         if (strcmp (spline->layer, "") == 0)
00828         {
00829                 fprintf (stderr,
00830                   (_("Warning in %s () empty layer string for the %s entity with id-code: %x.\n")),
00831                   __FUNCTION__, dxf_entity_name, spline->id_code);
00832                 fprintf (stderr,
00833                   (_("\t%s entity is relocated to default layer.\n")),
00834                   dxf_entity_name);
00835                 spline->layer = DXF_DEFAULT_LAYER;
00836         }
00837         /* Start writing output. */
00838         binary_graphics_data = (DxfBinaryGraphicsData *) spline->binary_graphics_data;
00839         p0 = (DxfPoint *) spline->p0;
00840         p1 = (DxfPoint *) spline->p1;
00841         p2 = (DxfPoint *) spline->p2;
00842         p3 = (DxfPoint *) spline->p3;
00843         fprintf (fp->fp, "  0\n%s\n", dxf_entity_name);
00844         if (spline->id_code != -1)
00845         {
00846                 fprintf (fp->fp, "  5\n%x\n", spline->id_code);
00847         }
00858         if ((strcmp (spline->dictionary_owner_soft, "") != 0)
00859           && (fp->acad_version_number >= AutoCAD_14))
00860         {
00861                 fprintf (fp->fp, "102\n{ACAD_REACTORS\n");
00862                 fprintf (fp->fp, "330\n%s\n", spline->dictionary_owner_soft);
00863                 fprintf (fp->fp, "102\n}\n");
00864         }
00865         if ((strcmp (spline->dictionary_owner_hard, "") != 0)
00866           && (fp->acad_version_number >= AutoCAD_14))
00867         {
00868                 fprintf (fp->fp, "102\n{ACAD_XDICTIONARY\n");
00869                 fprintf (fp->fp, "360\n%s\n", spline->dictionary_owner_hard);
00870                 fprintf (fp->fp, "102\n}\n");
00871         }
00872         if (fp->acad_version_number >= AutoCAD_13)
00873         {
00874                 fprintf (fp->fp, "100\nAcDbEntity\n");
00875         }
00876         if (spline->paperspace != DXF_MODELSPACE)
00877         {
00878                 fprintf (fp->fp, " 67\n%d\n", DXF_PAPERSPACE);
00879         }
00880         fprintf (fp->fp, "  8\n%s\n", spline->layer);
00881         if (strcmp (spline->linetype, DXF_DEFAULT_LINETYPE) != 0)
00882         {
00883                 fprintf (fp->fp, "  6\n%s\n", spline->linetype);
00884         }
00885         if ((fp->acad_version_number <= AutoCAD_11)
00886           && DXF_FLATLAND
00887           && (spline->elevation != 0.0))
00888         {
00889                 fprintf (fp->fp, " 38\n%f\n", spline->elevation);
00890         }
00891         if ((fp->acad_version_number >= AutoCAD_2007)
00892           && (strcmp (spline->material, "") != 0))
00893         {
00894                 fprintf (fp->fp, "347\n%s\n", spline->material);
00895         }
00896         if (spline->color != DXF_COLOR_BYLAYER)
00897         {
00898                 fprintf (fp->fp, " 62\n%d\n", spline->color);
00899         }
00900         if (spline->thickness != 0.0)
00901         {
00902                 fprintf (fp->fp, " 39\n%f\n", spline->thickness);
00903         }
00904         fprintf (fp->fp, "370\n%d\n", spline->lineweight);
00905         fprintf (fp->fp, " 48\n%f\n", spline->linetype_scale);
00906         if (spline->visibility != 0)
00907         {
00908                 fprintf (fp->fp, " 60\n%d\n", spline->visibility);
00909         }
00910         fprintf (fp->fp, " 92\n%d\n", spline->graphics_data_size);
00914         while (binary_graphics_data != NULL)
00915         {
00916                 fprintf (fp->fp, "310\n%s\n", binary_graphics_data->data_line);
00917                 binary_graphics_data = (DxfBinaryGraphicsData *) dxf_binary_graphics_data_get_next (binary_graphics_data);
00918         }
00919         fprintf (fp->fp, "420\n%ld\n", spline->color_value);
00920         fprintf (fp->fp, "430\n%s\n", spline->color_name);
00921         fprintf (fp->fp, "440\n%ld\n", spline->transparency);
00922         fprintf (fp->fp, "390\n%s\n", spline->plot_style_name);
00923         fprintf (fp->fp, "284\n%d\n", spline->shadow_mode);
00924         fprintf (fp->fp, "100\nAcDbSpline\n");
00925         if ((fp->acad_version_number >= AutoCAD_12)
00926                 && (spline->extr_x0 != 0.0)
00927                 && (spline->extr_y0 != 0.0)
00928                 && (spline->extr_z0 != 1.0))
00929         {
00930                 fprintf (fp->fp, "210\n%f\n", spline->extr_x0);
00931                 fprintf (fp->fp, "220\n%f\n", spline->extr_y0);
00932                 fprintf (fp->fp, "230\n%f\n", spline->extr_z0);
00933         }
00934         fprintf (fp->fp, " 70\n%d\n", spline->flag);
00935         fprintf (fp->fp, " 71\n%d\n", spline->degree);
00936         fprintf (fp->fp, " 72\n%d\n", spline->number_of_knots);
00937         fprintf (fp->fp, " 73\n%d\n", spline->number_of_control_points);
00938         fprintf (fp->fp, " 74\n%d\n", spline->number_of_fit_points);
00939         fprintf (fp->fp, " 42\n%f\n", spline->knot_tolerance);
00940         fprintf (fp->fp, " 43\n%f\n", spline->control_point_tolerance);
00941         fprintf (fp->fp, " 12\n%f\n", p2->x0);
00942         fprintf (fp->fp, " 22\n%f\n", p2->y0);
00943         fprintf (fp->fp, " 32\n%f\n", p2->z0);
00944         fprintf (fp->fp, " 13\n%f\n", p3->x0);
00945         fprintf (fp->fp, " 23\n%f\n", p3->y0);
00946         fprintf (fp->fp, " 33\n%f\n", p3->z0);
00947         for (i = 0; i < spline->number_of_knots; i++)
00948         {
00949                 fprintf (fp->fp, " 40\n%f\n", spline->knot_value->value);
00951         }
00952         if (spline->number_of_fit_points != 0)
00953         {
00954         for (i = 0; i < spline->number_of_fit_points; i++)
00955                 {
00956                         fprintf (fp->fp, " 41\n%f\n", spline->weight_value->value);
00958                 }
00959         }
00960         while (spline->p0 != NULL)
00961         {
00962                 fprintf (fp->fp, " 10\n%f\n", p0->x0);
00963                 fprintf (fp->fp, " 20\n%f\n", p0->y0);
00964                 fprintf (fp->fp, " 30\n%f\n", p0->z0);
00965                 p0 = (DxfPoint *) dxf_point_get_next (p0);
00966         }
00967         while (spline->p1 != NULL)
00968         {
00969                 fprintf (fp->fp, " 11\n%f\n", p1->x0);
00970                 fprintf (fp->fp, " 21\n%f\n", p1->y0);
00971                 fprintf (fp->fp, " 31\n%f\n", p1->z0);
00972                 p1 = (DxfPoint *) dxf_point_get_next (p1);
00973         }
00974         /* Clean up. */
00975         free (dxf_entity_name);
00976 #if DEBUG
00977         DXF_DEBUG_END
00978 #endif
00979         return (EXIT_SUCCESS);
00980 }
00981 
00982 
00990 int
00991 dxf_spline_free
00992 (
00993         DxfSpline *spline
00996 )
00997 {
00998 #if DEBUG
00999         DXF_DEBUG_BEGIN
01000 #endif
01001         /* Do some basic checks. */
01002         if (spline == NULL)
01003         {
01004                 fprintf (stderr,
01005                   (_("Error in %s () a NULL pointer was passed.\n")),
01006                   __FUNCTION__);
01007                 return (EXIT_FAILURE);
01008         }
01009         if (spline->next != NULL)
01010         {
01011                 fprintf (stderr,
01012                   (_("Error in %s () pointer to next was not NULL.\n")),
01013                   __FUNCTION__);
01014                 return (EXIT_FAILURE);
01015         }
01016         free (spline->linetype);
01017         free (spline->layer);
01018         dxf_binary_graphics_data_free_chain ((DxfBinaryGraphicsData *) spline->binary_graphics_data);
01019         free (spline->dictionary_owner_soft);
01020         free (spline->material);
01021         free (spline->dictionary_owner_hard);
01022         free (spline->plot_style_name);
01023         free (spline->color_name);
01024         dxf_point_free_chain (spline->p0);
01025         dxf_point_free_chain (spline->p1);
01026         dxf_point_free (spline->p2);
01027         dxf_point_free (spline->p3);
01028         dxf_double_free_chain (spline->knot_value);
01029         dxf_double_free_chain (spline->weight_value);
01030         free (spline);
01031         spline = NULL;
01032 #if DEBUG
01033         DXF_DEBUG_END
01034 #endif
01035         return (EXIT_SUCCESS);
01036 }
01037 
01038 
01043 void
01044 dxf_spline_free_chain
01045 (
01046         DxfSpline *splines
01048 )
01049 {
01050 #ifdef DEBUG
01051         DXF_DEBUG_BEGIN
01052 #endif
01053         if (splines == NULL)
01054         {
01055                 fprintf (stderr,
01056                   (_("Warning in %s () a NULL pointer was passed.\n")),
01057                   __FUNCTION__);
01058         }
01059         while (splines != NULL)
01060         {
01061                 struct DxfSpline *iter = splines->next;
01062                 dxf_spline_free (splines);
01063                 splines = (DxfSpline *) iter;
01064         }
01065 #if DEBUG
01066         DXF_DEBUG_END
01067 #endif
01068 }
01069 
01070 
01077 int
01078 dxf_spline_get_id_code
01079 (
01080         DxfSpline *spline
01082 )
01083 {
01084 #if DEBUG
01085         DXF_DEBUG_BEGIN
01086 #endif
01087         /* Do some basic checks. */
01088         if (spline == NULL)
01089         {
01090                 fprintf (stderr,
01091                   (_("Error in %s () a NULL pointer was passed.\n")),
01092                   __FUNCTION__);
01093                 return (EXIT_FAILURE);
01094         }
01095         if (spline->id_code < 0)
01096         {
01097                 fprintf (stderr,
01098                   (_("Error in %s () a negative value was found in the id_code member.\n")),
01099                   __FUNCTION__);
01100                 return (EXIT_FAILURE);
01101         }
01102 #if DEBUG
01103         DXF_DEBUG_END
01104 #endif
01105         return (spline->id_code);
01106 }
01107 
01108 
01114 DxfSpline *
01115 dxf_spline_set_id_code
01116 (
01117         DxfSpline *spline,
01119         int id_code
01123 )
01124 {
01125 #if DEBUG
01126         DXF_DEBUG_BEGIN
01127 #endif
01128         /* Do some basic checks. */
01129         if (spline == NULL)
01130         {
01131                 fprintf (stderr,
01132                   (_("Error in %s () a NULL pointer was passed.\n")),
01133                   __FUNCTION__);
01134                 return (NULL);
01135         }
01136         if (id_code < 0)
01137         {
01138                 fprintf (stderr,
01139                   (_("Error in %s () a negative id-code value was passed.\n")),
01140                   __FUNCTION__);
01141                 return (NULL);
01142         }
01143         spline->id_code = id_code;
01144 #if DEBUG
01145         DXF_DEBUG_END
01146 #endif
01147         return (spline);
01148 }
01149 
01150 
01156 char *
01157 dxf_spline_get_linetype
01158 (
01159         DxfSpline *spline
01161 )
01162 {
01163 #if DEBUG
01164         DXF_DEBUG_BEGIN
01165 #endif
01166         /* Do some basic checks. */
01167         if (spline == NULL)
01168         {
01169                 fprintf (stderr,
01170                   (_("Error in %s () a NULL pointer was passed.\n")),
01171                   __FUNCTION__);
01172                 return (NULL);
01173         }
01174         if (spline->linetype ==  NULL)
01175         {
01176                 fprintf (stderr,
01177                   (_("Error in %s () a NULL pointer was found in the linetype member.\n")),
01178                   __FUNCTION__);
01179                 return (NULL);
01180         }
01181 #if DEBUG
01182         DXF_DEBUG_END
01183 #endif
01184         return (strdup (spline->linetype));
01185 }
01186 
01187 
01194 DxfSpline *
01195 dxf_spline_set_linetype
01196 (
01197         DxfSpline *spline,
01199         char *linetype
01201 )
01202 {
01203 #if DEBUG
01204         DXF_DEBUG_BEGIN
01205 #endif
01206         /* Do some basic checks. */
01207         if (spline == NULL)
01208         {
01209                 fprintf (stderr,
01210                   (_("Error in %s () a NULL pointer was passed.\n")),
01211                   __FUNCTION__);
01212                 return (NULL);
01213         }
01214         if (linetype == NULL)
01215         {
01216                 fprintf (stderr,
01217                   (_("Error in %s () a NULL pointer was passed.\n")),
01218                   __FUNCTION__);
01219                 return (NULL);
01220         }
01221         spline->linetype = strdup (linetype);
01222 #if DEBUG
01223         DXF_DEBUG_END
01224 #endif
01225         return (spline);
01226 }
01227 
01228 
01234 char *
01235 dxf_spline_get_layer
01236 (
01237         DxfSpline *spline
01239 )
01240 {
01241 #if DEBUG
01242         DXF_DEBUG_BEGIN
01243 #endif
01244         /* Do some basic checks. */
01245         if (spline == NULL)
01246         {
01247                 fprintf (stderr,
01248                   (_("Error in %s () a NULL pointer was passed.\n")),
01249                   __FUNCTION__);
01250                 return (NULL);
01251         }
01252         if (spline->layer ==  NULL)
01253         {
01254                 fprintf (stderr,
01255                   (_("Error in %s () a NULL pointer was found in the layer member.\n")),
01256                   __FUNCTION__);
01257                 return (NULL);
01258         }
01259 #if DEBUG
01260         DXF_DEBUG_END
01261 #endif
01262         return (strdup (spline->layer));
01263 }
01264 
01265 
01272 DxfSpline *
01273 dxf_spline_set_layer
01274 (
01275         DxfSpline *spline,
01277         char *layer
01279 )
01280 {
01281 #if DEBUG
01282         DXF_DEBUG_BEGIN
01283 #endif
01284         /* Do some basic checks. */
01285         if (spline == NULL)
01286         {
01287                 fprintf (stderr,
01288                   (_("Error in %s () a NULL pointer was passed.\n")),
01289                   __FUNCTION__);
01290                 return (NULL);
01291         }
01292         if (layer == NULL)
01293         {
01294                 fprintf (stderr,
01295                   (_("Error in %s () a NULL pointer was passed.\n")),
01296                   __FUNCTION__);
01297                 return (NULL);
01298         }
01299         spline->layer = strdup (layer);
01300 #if DEBUG
01301         DXF_DEBUG_END
01302 #endif
01303         return (spline);
01304 }
01305 
01306 
01313 double
01314 dxf_spline_get_elevation
01315 (
01316         DxfSpline *spline
01318 )
01319 {
01320 #if DEBUG
01321         DXF_DEBUG_BEGIN
01322 #endif
01323         /* Do some basic checks. */
01324         if (spline == NULL)
01325         {
01326                 fprintf (stderr,
01327                   (_("Error in %s () a NULL pointer was passed.\n")),
01328                   __FUNCTION__);
01329                 return (EXIT_FAILURE);
01330         }
01331 #if DEBUG
01332         DXF_DEBUG_END
01333 #endif
01334         return (spline->elevation);
01335 }
01336 
01337 
01344 DxfSpline *
01345 dxf_spline_set_elevation
01346 (
01347         DxfSpline *spline,
01349         double elevation
01351 )
01352 {
01353 #if DEBUG
01354         DXF_DEBUG_BEGIN
01355 #endif
01356         /* Do some basic checks. */
01357         if (spline == NULL)
01358         {
01359                 fprintf (stderr,
01360                   (_("Error in %s () a NULL pointer was passed.\n")),
01361                   __FUNCTION__);
01362                 return (NULL);
01363         }
01364         spline->elevation = elevation;
01365 #if DEBUG
01366         DXF_DEBUG_END
01367 #endif
01368         return (spline);
01369 }
01370 
01371 
01378 double
01379 dxf_spline_get_thickness
01380 (
01381         DxfSpline *spline
01383 )
01384 {
01385 #if DEBUG
01386         DXF_DEBUG_BEGIN
01387 #endif
01388         /* Do some basic checks. */
01389         if (spline == NULL)
01390         {
01391                 fprintf (stderr,
01392                   (_("Error in %s () a NULL pointer was passed.\n")),
01393                   __FUNCTION__);
01394                 return (EXIT_FAILURE);
01395         }
01396         if (spline->thickness < 0.0)
01397         {
01398                 fprintf (stderr,
01399                   (_("Warning in %s () a negative value was found in the thickness member.\n")),
01400                   __FUNCTION__);
01401         }
01402 #if DEBUG
01403         DXF_DEBUG_END
01404 #endif
01405         return (spline->thickness);
01406 }
01407 
01408 
01415 DxfSpline *
01416 dxf_spline_set_thickness
01417 (
01418         DxfSpline *spline,
01420         double thickness
01422 )
01423 {
01424 #if DEBUG
01425         DXF_DEBUG_BEGIN
01426 #endif
01427         /* Do some basic checks. */
01428         if (spline == NULL)
01429         {
01430                 fprintf (stderr,
01431                   (_("Error in %s () a NULL pointer was passed.\n")),
01432                   __FUNCTION__);
01433                 return (NULL);
01434         }
01435         if (thickness < 0.0)
01436         {
01437                 fprintf (stderr,
01438                   (_("Warning in %s () a negative thickness value was passed.\n")),
01439                   __FUNCTION__);
01440         }
01441         spline->thickness = thickness;
01442 #if DEBUG
01443         DXF_DEBUG_END
01444 #endif
01445         return (spline);
01446 }
01447 
01448 
01455 double
01456 dxf_spline_get_linetype_scale
01457 (
01458         DxfSpline *spline
01460 )
01461 {
01462 #if DEBUG
01463         DXF_DEBUG_BEGIN
01464 #endif
01465         /* Do some basic checks. */
01466         if (spline == NULL)
01467         {
01468                 fprintf (stderr,
01469                   (_("Error in %s () a NULL pointer was passed.\n")),
01470                   __FUNCTION__);
01471                 return (EXIT_FAILURE);
01472         }
01473         if (spline->linetype_scale < 0.0)
01474         {
01475                 fprintf (stderr,
01476                   (_("Error in %s () a negative value was found in the linetype scale member.\n")),
01477                   __FUNCTION__);
01478                 return (EXIT_FAILURE);
01479         }
01480 #if DEBUG
01481         DXF_DEBUG_END
01482 #endif
01483         return (spline->linetype_scale);
01484 }
01485 
01486 
01493 DxfSpline *
01494 dxf_spline_set_linetype_scale
01495 (
01496         DxfSpline *spline,
01498         double linetype_scale
01500 )
01501 {
01502 #if DEBUG
01503         DXF_DEBUG_BEGIN
01504 #endif
01505         /* Do some basic checks. */
01506         if (spline == NULL)
01507         {
01508                 fprintf (stderr,
01509                   (_("Error in %s () a NULL pointer was passed.\n")),
01510                   __FUNCTION__);
01511                 return (NULL);
01512         }
01513         if (linetype_scale < 0.0)
01514         {
01515                 fprintf (stderr,
01516                   (_("Error in %s () a negative linetype scale value was passed.\n")),
01517                   __FUNCTION__);
01518                 return (NULL);
01519         }
01520         spline->linetype_scale = linetype_scale;
01521 #if DEBUG
01522         DXF_DEBUG_END
01523 #endif
01524         return (spline);
01525 }
01526 
01527 
01534 int16_t
01535 dxf_spline_get_visibility
01536 (
01537         DxfSpline *spline
01539 )
01540 {
01541 #if DEBUG
01542         DXF_DEBUG_BEGIN
01543 #endif
01544         /* Do some basic checks. */
01545         if (spline == NULL)
01546         {
01547                 fprintf (stderr,
01548                   (_("Error in %s () a NULL pointer was passed.\n")),
01549                   __FUNCTION__);
01550                 return (EXIT_FAILURE);
01551         }
01552         if (spline->visibility < 0)
01553         {
01554                 fprintf (stderr,
01555                   (_("Error in %s () a negative value was found in the visibility member.\n")),
01556                   __FUNCTION__);
01557                 return (EXIT_FAILURE);
01558         }
01559         if (spline->visibility > 1)
01560         {
01561                 fprintf (stderr,
01562                   (_("Error in %s () an out of range value was found in the visibility member.\n")),
01563                   __FUNCTION__);
01564                 return (EXIT_FAILURE);
01565         }
01566 #if DEBUG
01567         DXF_DEBUG_END
01568 #endif
01569         return (spline->visibility);
01570 }
01571 
01572 
01579 DxfSpline *
01580 dxf_spline_set_visibility
01581 (
01582         DxfSpline *spline,
01584         int16_t visibility
01586 )
01587 {
01588 #if DEBUG
01589         DXF_DEBUG_BEGIN
01590 #endif
01591         /* Do some basic checks. */
01592         if (spline == NULL)
01593         {
01594                 fprintf (stderr,
01595                   (_("Error in %s () a NULL pointer was passed.\n")),
01596                   __FUNCTION__);
01597                 return (NULL);
01598         }
01599         if (visibility < 0)
01600         {
01601                 fprintf (stderr,
01602                   (_("Error in %s () a negative visibility value was passed.\n")),
01603                   __FUNCTION__);
01604                 return (NULL);
01605         }
01606         if (visibility > 1)
01607         {
01608                 fprintf (stderr,
01609                   (_("Error in %s () an out of range visibility value was passed.\n")),
01610                   __FUNCTION__);
01611                 return (NULL);
01612         }
01613         spline->visibility = visibility;
01614 #if DEBUG
01615         DXF_DEBUG_END
01616 #endif
01617         return (spline);
01618 }
01619 
01620 
01627 int
01628 dxf_spline_get_color
01629 (
01630         DxfSpline *spline
01632 )
01633 {
01634 #if DEBUG
01635         DXF_DEBUG_BEGIN
01636 #endif
01637         /* Do some basic checks. */
01638         if (spline == NULL)
01639         {
01640                 fprintf (stderr,
01641                   (_("Error in %s () a NULL pointer was passed.\n")),
01642                   __FUNCTION__);
01643                 return (EXIT_FAILURE);
01644         }
01645         if (spline->color < 0)
01646         {
01647                 fprintf (stderr,
01648                   (_("Warning in %s () a negative value was found in the color member.\n")),
01649                   __FUNCTION__);
01650         }
01651 #if DEBUG
01652         DXF_DEBUG_END
01653 #endif
01654         return (spline->color);
01655 }
01656 
01657 
01664 DxfSpline *
01665 dxf_spline_set_color
01666 (
01667         DxfSpline *spline,
01669         int color
01671 )
01672 {
01673 #if DEBUG
01674         DXF_DEBUG_BEGIN
01675 #endif
01676         /* Do some basic checks. */
01677         if (spline == NULL)
01678         {
01679                 fprintf (stderr,
01680                   (_("Error in %s () a NULL pointer was passed.\n")),
01681                   __FUNCTION__);
01682                 return (NULL);
01683         }
01684         if (color < 0)
01685         {
01686                 fprintf (stderr,
01687                   (_("Warning in %s () a negative color value was passed.\n")),
01688                   __FUNCTION__);
01689                 fprintf (stderr,
01690                   (_("\teffectively turning this entity it's visibility off.\n")));
01691         }
01692         spline->color = color;
01693 #if DEBUG
01694         DXF_DEBUG_END
01695 #endif
01696         return (spline);
01697 }
01698 
01699 
01706 int
01707 dxf_spline_get_paperspace
01708 (
01709         DxfSpline *spline
01711 )
01712 {
01713 #if DEBUG
01714         DXF_DEBUG_BEGIN
01715 #endif
01716         /* Do some basic checks. */
01717         if (spline == NULL)
01718         {
01719                 fprintf (stderr,
01720                   (_("Error in %s () a NULL pointer was passed.\n")),
01721                   __FUNCTION__);
01722                 return (EXIT_FAILURE);
01723         }
01724         if (spline->paperspace < 0)
01725         {
01726                 fprintf (stderr,
01727                   (_("Warning in %s () a negative value was found in the paperspace member.\n")),
01728                   __FUNCTION__);
01729         }
01730         if (spline->paperspace > 1)
01731         {
01732                 fprintf (stderr,
01733                   (_("Warning in %s () an out of range value was found in the paperspace member.\n")),
01734                   __FUNCTION__);
01735         }
01736 #if DEBUG
01737         DXF_DEBUG_END
01738 #endif
01739         return (spline->paperspace);
01740 }
01741 
01742 
01749 DxfSpline *
01750 dxf_spline_set_paperspace
01751 (
01752         DxfSpline *spline,
01754         int paperspace
01757 )
01758 {
01759 #if DEBUG
01760         DXF_DEBUG_BEGIN
01761 #endif
01762         /* Do some basic checks. */
01763         if (spline == NULL)
01764         {
01765                 fprintf (stderr,
01766                   (_("Error in %s () a NULL pointer was passed.\n")),
01767                   __FUNCTION__);
01768                 return (NULL);
01769         }
01770         if (paperspace < 0)
01771         {
01772                 fprintf (stderr,
01773                   (_("Error in %s () a negative paperspace value was passed.\n")),
01774                   __FUNCTION__);
01775                 return (NULL);
01776         }
01777         if (paperspace > 1)
01778         {
01779                 fprintf (stderr,
01780                   (_("Error in %s () an out of range paperspace value was passed.\n")),
01781                   __FUNCTION__);
01782                 return (NULL);
01783         }
01784         spline->paperspace = paperspace;
01785 #if DEBUG
01786         DXF_DEBUG_END
01787 #endif
01788         return (spline);
01789 }
01790 
01791 
01798 int
01799 dxf_spline_get_graphics_data_size
01800 (
01801         DxfSpline *spline
01803 )
01804 {
01805 #if DEBUG
01806         DXF_DEBUG_BEGIN
01807 #endif
01808         /* Do some basic checks. */
01809         if (spline == NULL)
01810         {
01811                 fprintf (stderr,
01812                   (_("Error in %s () a NULL pointer was passed.\n")),
01813                   __FUNCTION__);
01814                 return (EXIT_FAILURE);
01815         }
01816         if (spline->graphics_data_size < 0)
01817         {
01818                 fprintf (stderr,
01819                   (_("Warning in %s () a negative value was found in the graphics_data_size member.\n")),
01820                   __FUNCTION__);
01821         }
01822         if (spline->graphics_data_size == 0)
01823         {
01824                 fprintf (stderr,
01825                   (_("Warning in %s () a zero value was found in the graphics_data_size member.\n")),
01826                   __FUNCTION__);
01827         }
01828 #if DEBUG
01829         DXF_DEBUG_END
01830 #endif
01831         return (spline->graphics_data_size);
01832 }
01833 
01834 
01841 DxfSpline *
01842 dxf_spline_set_graphics_data_size
01843 (
01844         DxfSpline *spline,
01846         int graphics_data_size
01849 )
01850 {
01851 #if DEBUG
01852         DXF_DEBUG_BEGIN
01853 #endif
01854         /* Do some basic checks. */
01855         if (spline == NULL)
01856         {
01857                 fprintf (stderr,
01858                   (_("Error in %s () a NULL pointer was passed.\n")),
01859                   __FUNCTION__);
01860                 return (NULL);
01861         }
01862         if (graphics_data_size < 0)
01863         {
01864                 fprintf (stderr,
01865                   (_("Error in %s () a negative graphics_data_size value was passed.\n")),
01866                   __FUNCTION__);
01867                 return (NULL);
01868         }
01869         if (graphics_data_size == 0)
01870         {
01871                 fprintf (stderr,
01872                   (_("Error in %s () a zero graphics_data_size value was passed.\n")),
01873                   __FUNCTION__);
01874                 return (NULL);
01875         }
01876         spline->graphics_data_size = graphics_data_size;
01877 #if DEBUG
01878         DXF_DEBUG_END
01879 #endif
01880         return (spline);
01881 }
01882 
01883 
01890 int16_t
01891 dxf_spline_get_shadow_mode
01892 (
01893         DxfSpline *spline
01895 )
01896 {
01897 #if DEBUG
01898         DXF_DEBUG_BEGIN
01899 #endif
01900         /* Do some basic checks. */
01901         if (spline == NULL)
01902         {
01903                 fprintf (stderr,
01904                   (_("Error in %s () a NULL pointer was passed.\n")),
01905                   __FUNCTION__);
01906                 return (EXIT_FAILURE);
01907         }
01908         if (spline->shadow_mode < 0)
01909         {
01910                 fprintf (stderr,
01911                   (_("Error in %s () a negative value was found in the shadow_mode member.\n")),
01912                   __FUNCTION__);
01913                 return (EXIT_FAILURE);
01914         }
01915         if (spline->shadow_mode > 3)
01916         {
01917                 fprintf (stderr,
01918                   (_("Error in %s () an out of range value was found in the shadow_mode member.\n")),
01919                   __FUNCTION__);
01920                 return (EXIT_FAILURE);
01921         }
01922 #if DEBUG
01923         DXF_DEBUG_END
01924 #endif
01925         return (spline->shadow_mode);
01926 }
01927 
01928 
01935 DxfSpline *
01936 dxf_spline_set_shadow_mode
01937 (
01938         DxfSpline *spline,
01940         int16_t shadow_mode
01942 )
01943 {
01944 #if DEBUG
01945         DXF_DEBUG_BEGIN
01946 #endif
01947         /* Do some basic checks. */
01948         if (spline == NULL)
01949         {
01950                 fprintf (stderr,
01951                   (_("Error in %s () a NULL pointer was passed.\n")),
01952                   __FUNCTION__);
01953                 return (NULL);
01954         }
01955         if (shadow_mode < 0)
01956         {
01957                 fprintf (stderr,
01958                   (_("Error in %s () a negative shadow_mode value was passed.\n")),
01959                   __FUNCTION__);
01960                 return (NULL);
01961         }
01962         if (shadow_mode > 3)
01963         {
01964                 fprintf (stderr,
01965                   (_("Error in %s () an out of range shadow_mode value was passed.\n")),
01966                   __FUNCTION__);
01967                 return (NULL);
01968         }
01969         spline->shadow_mode = shadow_mode;
01970 #if DEBUG
01971         DXF_DEBUG_END
01972 #endif
01973         return (spline);
01974 }
01975 
01976 
01986 DxfBinaryGraphicsData *
01987 dxf_spline_get_binary_graphics_data
01988 (
01989         DxfSpline *spline
01991 )
01992 {
01993 #if DEBUG
01994         DXF_DEBUG_BEGIN
01995 #endif
01996         /* Do some basic checks. */
01997         if (spline == NULL)
01998         {
01999                 fprintf (stderr,
02000                   (_("Error in %s () a NULL pointer was passed.\n")),
02001                   __FUNCTION__);
02002                 return (NULL);
02003         }
02004         if (spline->binary_graphics_data ==  NULL)
02005         {
02006                 fprintf (stderr,
02007                   (_("Error in %s () a NULL pointer was found in the binary_graphics_data member.\n")),
02008                   __FUNCTION__);
02009                 return (NULL);
02010         }
02011 #if DEBUG
02012         DXF_DEBUG_END
02013 #endif
02014         return ((DxfBinaryGraphicsData *) spline->binary_graphics_data);
02015 }
02016 
02017 
02025 DxfSpline *
02026 dxf_spline_set_binary_graphics_data
02027 (
02028         DxfSpline *spline,
02030         DxfBinaryGraphicsData *data
02033 )
02034 {
02035 #if DEBUG
02036         DXF_DEBUG_BEGIN
02037 #endif
02038         /* Do some basic checks. */
02039         if (spline == NULL)
02040         {
02041                 fprintf (stderr,
02042                   (_("Error in %s () a NULL pointer was passed.\n")),
02043                   __FUNCTION__);
02044                 return (NULL);
02045         }
02046         if (data == NULL)
02047         {
02048                 fprintf (stderr,
02049                   (_("Error in %s () a NULL pointer was passed.\n")),
02050                   __FUNCTION__);
02051                 return (NULL);
02052         }
02053         spline->binary_graphics_data = (DxfBinaryGraphicsData *) data;
02054 #if DEBUG
02055         DXF_DEBUG_END
02056 #endif
02057         return (spline);
02058 }
02059 
02060 
02070 char *
02071 dxf_spline_get_dictionary_owner_soft
02072 (
02073         DxfSpline *spline
02075 )
02076 {
02077 #if DEBUG
02078         DXF_DEBUG_BEGIN
02079 #endif
02080         /* Do some basic checks. */
02081         if (spline == NULL)
02082         {
02083                 fprintf (stderr,
02084                   (_("Error in %s () a NULL pointer was passed.\n")),
02085                   __FUNCTION__);
02086                 return (NULL);
02087         }
02088         if (spline->dictionary_owner_soft ==  NULL)
02089         {
02090                 fprintf (stderr,
02091                   (_("Error in %s () a NULL pointer was found in the dictionary_owner_soft member.\n")),
02092                   __FUNCTION__);
02093                 return (NULL);
02094         }
02095 #if DEBUG
02096         DXF_DEBUG_END
02097 #endif
02098         return (strdup (spline->dictionary_owner_soft));
02099 }
02100 
02101 
02109 DxfSpline *
02110 dxf_spline_set_dictionary_owner_soft
02111 (
02112         DxfSpline *spline,
02114         char *dictionary_owner_soft
02117 )
02118 {
02119 #if DEBUG
02120         DXF_DEBUG_BEGIN
02121 #endif
02122         /* Do some basic checks. */
02123         if (spline == NULL)
02124         {
02125                 fprintf (stderr,
02126                   (_("Error in %s () a NULL pointer was passed.\n")),
02127                   __FUNCTION__);
02128                 return (NULL);
02129         }
02130         if (dictionary_owner_soft == NULL)
02131         {
02132                 fprintf (stderr,
02133                   (_("Error in %s () a NULL pointer was passed.\n")),
02134                   __FUNCTION__);
02135                 return (NULL);
02136         }
02137         spline->dictionary_owner_soft = strdup (dictionary_owner_soft);
02138 #if DEBUG
02139         DXF_DEBUG_END
02140 #endif
02141         return (spline);
02142 }
02143 
02144 
02153 char *
02154 dxf_spline_get_material
02155 (
02156         DxfSpline *spline
02158 )
02159 {
02160 #if DEBUG
02161         DXF_DEBUG_BEGIN
02162 #endif
02163         /* Do some basic checks. */
02164         if (spline == NULL)
02165         {
02166                 fprintf (stderr,
02167                   (_("Error in %s () a NULL pointer was passed.\n")),
02168                   __FUNCTION__);
02169                 return (NULL);
02170         }
02171         if (spline->material ==  NULL)
02172         {
02173                 fprintf (stderr,
02174                   (_("Error in %s () a NULL pointer was found in the material member.\n")),
02175                   __FUNCTION__);
02176                 return (NULL);
02177         }
02178 #if DEBUG
02179         DXF_DEBUG_END
02180 #endif
02181         return (strdup (spline->material));
02182 }
02183 
02184 
02191 DxfSpline *
02192 dxf_spline_set_material
02193 (
02194         DxfSpline *spline,
02196         char *material
02199 )
02200 {
02201 #if DEBUG
02202         DXF_DEBUG_BEGIN
02203 #endif
02204         /* Do some basic checks. */
02205         if (spline == NULL)
02206         {
02207                 fprintf (stderr,
02208                   (_("Error in %s () a NULL pointer was passed.\n")),
02209                   __FUNCTION__);
02210                 return (NULL);
02211         }
02212         if (material == NULL)
02213         {
02214                 fprintf (stderr,
02215                   (_("Error in %s () a NULL pointer was passed.\n")),
02216                   __FUNCTION__);
02217                 return (NULL);
02218         }
02219         spline->material = strdup (material);
02220 #if DEBUG
02221         DXF_DEBUG_END
02222 #endif
02223         return (spline);
02224 }
02225 
02226 
02236 char *
02237 dxf_spline_get_dictionary_owner_hard
02238 (
02239         DxfSpline *spline
02241 )
02242 {
02243 #if DEBUG
02244         DXF_DEBUG_BEGIN
02245 #endif
02246         /* Do some basic checks. */
02247         if (spline == NULL)
02248         {
02249                 fprintf (stderr,
02250                   (_("Error in %s () a NULL pointer was passed.\n")),
02251                   __FUNCTION__);
02252                 return (NULL);
02253         }
02254         if (spline->dictionary_owner_hard ==  NULL)
02255         {
02256                 fprintf (stderr,
02257                   (_("Error in %s () a NULL pointer was found in the dictionary_owner_hard member.\n")),
02258                   __FUNCTION__);
02259                 return (NULL);
02260         }
02261 #if DEBUG
02262         DXF_DEBUG_END
02263 #endif
02264         return (strdup (spline->dictionary_owner_hard));
02265 }
02266 
02267 
02275 DxfSpline *
02276 dxf_spline_set_dictionary_owner_hard
02277 (
02278         DxfSpline *spline,
02280         char *dictionary_owner_hard
02283 )
02284 {
02285 #if DEBUG
02286         DXF_DEBUG_BEGIN
02287 #endif
02288         /* Do some basic checks. */
02289         if (spline == NULL)
02290         {
02291                 fprintf (stderr,
02292                   (_("Error in %s () a NULL pointer was passed.\n")),
02293                   __FUNCTION__);
02294                 return (NULL);
02295         }
02296         if (dictionary_owner_hard == NULL)
02297         {
02298                 fprintf (stderr,
02299                   (_("Error in %s () a NULL pointer was passed.\n")),
02300                   __FUNCTION__);
02301                 return (NULL);
02302         }
02303         spline->dictionary_owner_hard = strdup (dictionary_owner_hard);
02304 #if DEBUG
02305         DXF_DEBUG_END
02306 #endif
02307         return (spline);
02308 }
02309 
02310 
02317 int16_t
02318 dxf_spline_get_lineweight
02319 (
02320         DxfSpline *spline
02322 )
02323 {
02324 #if DEBUG
02325         DXF_DEBUG_BEGIN
02326 #endif
02327         /* Do some basic checks. */
02328         if (spline == NULL)
02329         {
02330                 fprintf (stderr,
02331                   (_("Error in %s () a NULL pointer was passed.\n")),
02332                   __FUNCTION__);
02333                 return (EXIT_FAILURE);
02334         }
02335 #if DEBUG
02336         DXF_DEBUG_END
02337 #endif
02338         return (spline->lineweight);
02339 }
02340 
02341 
02348 DxfSpline *
02349 dxf_spline_set_lineweight
02350 (
02351         DxfSpline *spline,
02353         int16_t lineweight
02355 )
02356 {
02357 #if DEBUG
02358         DXF_DEBUG_BEGIN
02359 #endif
02360         /* Do some basic checks. */
02361         if (spline == NULL)
02362         {
02363                 fprintf (stderr,
02364                   (_("Error in %s () a NULL pointer was passed.\n")),
02365                   __FUNCTION__);
02366                 return (NULL);
02367         }
02368         spline->lineweight = lineweight;
02369 #if DEBUG
02370         DXF_DEBUG_END
02371 #endif
02372         return (spline);
02373 }
02374 
02375 
02382 char *
02383 dxf_spline_get_plot_style_name
02384 (
02385         DxfSpline *spline
02387 )
02388 {
02389 #if DEBUG
02390         DXF_DEBUG_BEGIN
02391 #endif
02392         /* Do some basic checks. */
02393         if (spline == NULL)
02394         {
02395                 fprintf (stderr,
02396                   (_("Error in %s () a NULL pointer was passed.\n")),
02397                   __FUNCTION__);
02398                 return (NULL);
02399         }
02400         if (spline->plot_style_name ==  NULL)
02401         {
02402                 fprintf (stderr,
02403                   (_("Error in %s () a NULL pointer was found in the plot_style_name member.\n")),
02404                   __FUNCTION__);
02405                 return (NULL);
02406         }
02407 #if DEBUG
02408         DXF_DEBUG_END
02409 #endif
02410         return (strdup (spline->plot_style_name));
02411 }
02412 
02413 
02420 DxfSpline *
02421 dxf_spline_set_plot_style_name
02422 (
02423         DxfSpline *spline,
02425         char *plot_style_name
02428 )
02429 {
02430 #if DEBUG
02431         DXF_DEBUG_BEGIN
02432 #endif
02433         /* Do some basic checks. */
02434         if (spline == NULL)
02435         {
02436                 fprintf (stderr,
02437                   (_("Error in %s () a NULL pointer was passed.\n")),
02438                   __FUNCTION__);
02439                 return (NULL);
02440         }
02441         if (plot_style_name == NULL)
02442         {
02443                 fprintf (stderr,
02444                   (_("Error in %s () a NULL pointer was passed.\n")),
02445                   __FUNCTION__);
02446                 return (NULL);
02447         }
02448         spline->plot_style_name = strdup (plot_style_name);
02449 #if DEBUG
02450         DXF_DEBUG_END
02451 #endif
02452         return (spline);
02453 }
02454 
02455 
02462 long
02463 dxf_spline_get_color_value
02464 (
02465         DxfSpline *spline
02467 )
02468 {
02469 #if DEBUG
02470         DXF_DEBUG_BEGIN
02471 #endif
02472         /* Do some basic checks. */
02473         if (spline == NULL)
02474         {
02475                 fprintf (stderr,
02476                   (_("Error in %s () a NULL pointer was passed.\n")),
02477                   __FUNCTION__);
02478                 return (EXIT_FAILURE);
02479         }
02480 #if DEBUG
02481         DXF_DEBUG_END
02482 #endif
02483         return (spline->color_value);
02484 }
02485 
02486 
02493 DxfSpline *
02494 dxf_spline_set_color_value
02495 (
02496         DxfSpline *spline,
02498         long color_value
02500 )
02501 {
02502 #if DEBUG
02503         DXF_DEBUG_BEGIN
02504 #endif
02505         /* Do some basic checks. */
02506         if (spline == NULL)
02507         {
02508                 fprintf (stderr,
02509                   (_("Error in %s () a NULL pointer was passed.\n")),
02510                   __FUNCTION__);
02511                 return (NULL);
02512         }
02513         spline->color_value = color_value;
02514 #if DEBUG
02515         DXF_DEBUG_END
02516 #endif
02517         return (spline);
02518 }
02519 
02520 
02527 char *
02528 dxf_spline_get_color_name
02529 (
02530         DxfSpline *spline
02532 )
02533 {
02534 #if DEBUG
02535         DXF_DEBUG_BEGIN
02536 #endif
02537         /* Do some basic checks. */
02538         if (spline == NULL)
02539         {
02540                 fprintf (stderr,
02541                   (_("Error in %s () a NULL pointer was passed.\n")),
02542                   __FUNCTION__);
02543                 return (NULL);
02544         }
02545         if (spline->color_name ==  NULL)
02546         {
02547                 fprintf (stderr,
02548                   (_("Error in %s () a NULL pointer was found in the color_name member.\n")),
02549                   __FUNCTION__);
02550                 return (NULL);
02551         }
02552 #if DEBUG
02553         DXF_DEBUG_END
02554 #endif
02555         return (strdup (spline->color_name));
02556 }
02557 
02558 
02565 DxfSpline *
02566 dxf_spline_set_color_name
02567 (
02568         DxfSpline *spline,
02570         char *color_name
02573 )
02574 {
02575 #if DEBUG
02576         DXF_DEBUG_BEGIN
02577 #endif
02578         /* Do some basic checks. */
02579         if (spline == NULL)
02580         {
02581                 fprintf (stderr,
02582                   (_("Error in %s () a NULL pointer was passed.\n")),
02583                   __FUNCTION__);
02584                 return (NULL);
02585         }
02586         if (color_name == NULL)
02587         {
02588                 fprintf (stderr,
02589                   (_("Error in %s () a NULL pointer was passed.\n")),
02590                   __FUNCTION__);
02591                 return (NULL);
02592         }
02593         spline->color_name = strdup (color_name);
02594 #if DEBUG
02595         DXF_DEBUG_END
02596 #endif
02597         return (spline);
02598 }
02599 
02600 
02607 long
02608 dxf_spline_get_transparency
02609 (
02610         DxfSpline *spline
02612 )
02613 {
02614 #if DEBUG
02615         DXF_DEBUG_BEGIN
02616 #endif
02617         /* Do some basic checks. */
02618         if (spline == NULL)
02619         {
02620                 fprintf (stderr,
02621                   (_("Error in %s () a NULL pointer was passed.\n")),
02622                   __FUNCTION__);
02623                 return (EXIT_FAILURE);
02624         }
02625 #if DEBUG
02626         DXF_DEBUG_END
02627 #endif
02628         return (spline->transparency);
02629 }
02630 
02631 
02638 DxfSpline *
02639 dxf_spline_set_transparency
02640 (
02641         DxfSpline *spline,
02643         long transparency
02645 )
02646 {
02647 #if DEBUG
02648         DXF_DEBUG_BEGIN
02649 #endif
02650         /* Do some basic checks. */
02651         if (spline == NULL)
02652         {
02653                 fprintf (stderr,
02654                   (_("Error in %s () a NULL pointer was passed.\n")),
02655                   __FUNCTION__);
02656                 return (NULL);
02657         }
02658         spline->transparency = transparency;
02659 #if DEBUG
02660         DXF_DEBUG_END
02661 #endif
02662         return (spline);
02663 }
02664 
02665 
02674 DxfPoint *
02675 dxf_spline_get_p0
02676 (
02677         DxfSpline *spline
02679 )
02680 {
02681 #if DEBUG
02682         DXF_DEBUG_BEGIN
02683 #endif
02684         /* Do some basic checks. */
02685         if (spline == NULL)
02686         {
02687                 fprintf (stderr,
02688                   (_("Error in %s () a NULL pointer was passed.\n")),
02689                   __FUNCTION__);
02690                 return (NULL);
02691         }
02692         if (spline->p0 ==  NULL)
02693         {
02694                 fprintf (stderr,
02695                   (_("Error in %s () a NULL pointer was found in the p0 member.\n")),
02696                   __FUNCTION__);
02697                 return (NULL);
02698         }
02699 #if DEBUG
02700         DXF_DEBUG_END
02701 #endif
02702         return ((DxfPoint *) spline->p0);
02703 }
02704 
02705 
02714 DxfSpline *
02715 dxf_spline_set_p0
02716 (
02717         DxfSpline *spline,
02719         DxfPoint *p0
02722 )
02723 {
02724 #if DEBUG
02725         DXF_DEBUG_BEGIN
02726 #endif
02727         /* Do some basic checks. */
02728         if (spline == NULL)
02729         {
02730                 fprintf (stderr,
02731                   (_("Error in %s () a NULL pointer was passed.\n")),
02732                   __FUNCTION__);
02733                 return (NULL);
02734         }
02735         if (p0 == NULL)
02736         {
02737                 fprintf (stderr,
02738                   (_("Error in %s () a NULL pointer was passed.\n")),
02739                   __FUNCTION__);
02740                 return (NULL);
02741         }
02742         spline->p0 = (DxfPoint *) p0;
02743 #if DEBUG
02744         DXF_DEBUG_END
02745 #endif
02746         return (spline);
02747 }
02748 
02749 
02756 double
02757 dxf_spline_get_x0
02758 (
02759         DxfSpline *spline
02761 )
02762 {
02763 #ifdef DEBUG
02764         DXF_DEBUG_BEGIN
02765 #endif
02766 
02767         /* Do some basic checks. */
02768         if (spline == NULL)
02769         {
02770                 fprintf (stderr,
02771                   (_("Error in %s () a NULL pointer was passed.\n")),
02772                   __FUNCTION__);
02773                 return (EXIT_FAILURE);
02774         }
02775         if (spline->p0 == NULL)
02776         {
02777                 fprintf (stderr,
02778                   (_("Error in %s () a NULL pointer was found.\n")),
02779                   __FUNCTION__);
02780                 return (EXIT_FAILURE);
02781         }
02782 #if DEBUG
02783         DXF_DEBUG_END
02784 #endif
02785         return (spline->p0->x0);
02786 }
02787 
02788 
02796 DxfSpline *
02797 dxf_spline_set_x0
02798 (
02799         DxfSpline *spline,
02801         double x0
02804 )
02805 {
02806 #ifdef DEBUG
02807         DXF_DEBUG_BEGIN
02808 #endif
02809         /* Do some basic checks. */
02810         if (spline == NULL)
02811         {
02812                 fprintf (stderr,
02813                   (_("Error in %s () a NULL pointer was passed.\n")),
02814                   __FUNCTION__);
02815                 return (NULL);
02816         }
02817         if (spline->p0 == NULL)
02818         {
02819                 fprintf (stderr,
02820                   (_("Error in %s () a NULL pointer was found.\n")),
02821                   __FUNCTION__);
02822                 return (NULL);
02823         }
02824         spline->p0->x0 = x0;
02825 #if DEBUG
02826         DXF_DEBUG_END
02827 #endif
02828         return (spline);
02829 }
02830 
02831 
02838 double
02839 dxf_spline_get_y0
02840 (
02841         DxfSpline *spline
02843 )
02844 {
02845 #ifdef DEBUG
02846         DXF_DEBUG_BEGIN
02847 #endif
02848 
02849         /* Do some basic checks. */
02850         if (spline == NULL)
02851         {
02852                 fprintf (stderr,
02853                   (_("Error in %s () a NULL pointer was passed.\n")),
02854                   __FUNCTION__);
02855                 return (EXIT_FAILURE);
02856         }
02857         if (spline->p0 == NULL)
02858         {
02859                 fprintf (stderr,
02860                   (_("Error in %s () a NULL pointer was found.\n")),
02861                   __FUNCTION__);
02862                 return (EXIT_FAILURE);
02863         }
02864 #if DEBUG
02865         DXF_DEBUG_END
02866 #endif
02867         return (spline->p0->y0);
02868 }
02869 
02870 
02878 DxfSpline *
02879 dxf_spline_set_y0
02880 (
02881         DxfSpline *spline,
02883         double y0
02886 )
02887 {
02888 #ifdef DEBUG
02889         DXF_DEBUG_BEGIN
02890 #endif
02891         /* Do some basic checks. */
02892         if (spline == NULL)
02893         {
02894                 fprintf (stderr,
02895                   (_("Error in %s () a NULL pointer was passed.\n")),
02896                   __FUNCTION__);
02897                 return (NULL);
02898         }
02899         if (spline->p0 == NULL)
02900         {
02901                 fprintf (stderr,
02902                   (_("Error in %s () a NULL pointer was found.\n")),
02903                   __FUNCTION__);
02904                 return (NULL);
02905         }
02906         spline->p0->y0 = y0;
02907 #if DEBUG
02908         DXF_DEBUG_END
02909 #endif
02910         return (spline);
02911 }
02912 
02913 
02920 double
02921 dxf_spline_get_z0
02922 (
02923         DxfSpline *spline
02925 )
02926 {
02927 #ifdef DEBUG
02928         DXF_DEBUG_BEGIN
02929 #endif
02930 
02931         /* Do some basic checks. */
02932         if (spline == NULL)
02933         {
02934                 fprintf (stderr,
02935                   (_("Error in %s () a NULL pointer was passed.\n")),
02936                   __FUNCTION__);
02937                 return (EXIT_FAILURE);
02938         }
02939         if (spline->p0 == NULL)
02940         {
02941                 fprintf (stderr,
02942                   (_("Error in %s () a NULL pointer was found.\n")),
02943                   __FUNCTION__);
02944                 return (EXIT_FAILURE);
02945         }
02946 #if DEBUG
02947         DXF_DEBUG_END
02948 #endif
02949         return (spline->p0->z0);
02950 }
02951 
02952 
02960 DxfSpline *
02961 dxf_spline_set_z0
02962 (
02963         DxfSpline *spline,
02965         double z0
02968 )
02969 {
02970 #ifdef DEBUG
02971         DXF_DEBUG_BEGIN
02972 #endif
02973         /* Do some basic checks. */
02974         if (spline == NULL)
02975         {
02976                 fprintf (stderr,
02977                   (_("Error in %s () a NULL pointer was passed.\n")),
02978                   __FUNCTION__);
02979                 return (NULL);
02980         }
02981         if (spline->p0 == NULL)
02982         {
02983                 fprintf (stderr,
02984                   (_("Error in %s () a NULL pointer was found.\n")),
02985                   __FUNCTION__);
02986                 return (NULL);
02987         }
02988         spline->p0->z0 = z0;
02989 #if DEBUG
02990         DXF_DEBUG_END
02991 #endif
02992         return (spline);
02993 }
02994 
02995 
03004 DxfPoint *
03005 dxf_spline_get_p1
03006 (
03007         DxfSpline *spline
03009 )
03010 {
03011 #if DEBUG
03012         DXF_DEBUG_BEGIN
03013 #endif
03014         /* Do some basic checks. */
03015         if (spline == NULL)
03016         {
03017                 fprintf (stderr,
03018                   (_("Error in %s () a NULL pointer was passed.\n")),
03019                   __FUNCTION__);
03020                 return (NULL);
03021         }
03022         if (spline->p1 ==  NULL)
03023         {
03024                 fprintf (stderr,
03025                   (_("Error in %s () a NULL pointer was found in the p1 member.\n")),
03026                   __FUNCTION__);
03027                 return (NULL);
03028         }
03029 #if DEBUG
03030         DXF_DEBUG_END
03031 #endif
03032         return ((DxfPoint *) spline->p1);
03033 }
03034 
03035 
03044 DxfSpline *
03045 dxf_spline_set_p1
03046 (
03047         DxfSpline *spline,
03049         DxfPoint *p1
03052 )
03053 {
03054 #if DEBUG
03055         DXF_DEBUG_BEGIN
03056 #endif
03057         /* Do some basic checks. */
03058         if (spline == NULL)
03059         {
03060                 fprintf (stderr,
03061                   (_("Error in %s () a NULL pointer was passed.\n")),
03062                   __FUNCTION__);
03063                 return (NULL);
03064         }
03065         if (p1 == NULL)
03066         {
03067                 fprintf (stderr,
03068                   (_("Error in %s () a NULL pointer was passed.\n")),
03069                   __FUNCTION__);
03070                 return (NULL);
03071         }
03072         spline->p1 = (DxfPoint *) p1;
03073 #if DEBUG
03074         DXF_DEBUG_END
03075 #endif
03076         return (spline);
03077 }
03078 
03079 
03086 double
03087 dxf_spline_get_x1
03088 (
03089         DxfSpline *spline
03091 )
03092 {
03093 #ifdef DEBUG
03094         DXF_DEBUG_BEGIN
03095 #endif
03096 
03097         /* Do some basic checks. */
03098         if (spline == NULL)
03099         {
03100                 fprintf (stderr,
03101                   (_("Error in %s () a NULL pointer was passed.\n")),
03102                   __FUNCTION__);
03103                 return (EXIT_FAILURE);
03104         }
03105         if (spline->p1 == NULL)
03106         {
03107                 fprintf (stderr,
03108                   (_("Error in %s () a NULL pointer was found.\n")),
03109                   __FUNCTION__);
03110                 return (EXIT_FAILURE);
03111         }
03112 #if DEBUG
03113         DXF_DEBUG_END
03114 #endif
03115         return (spline->p1->x0);
03116 }
03117 
03118 
03126 DxfSpline *
03127 dxf_spline_set_x1
03128 (
03129         DxfSpline *spline,
03131         double x1
03134 )
03135 {
03136 #ifdef DEBUG
03137         DXF_DEBUG_BEGIN
03138 #endif
03139         /* Do some basic checks. */
03140         if (spline == NULL)
03141         {
03142                 fprintf (stderr,
03143                   (_("Error in %s () a NULL pointer was passed.\n")),
03144                   __FUNCTION__);
03145                 return (NULL);
03146         }
03147         if (spline->p1 == NULL)
03148         {
03149                 fprintf (stderr,
03150                   (_("Error in %s () a NULL pointer was found.\n")),
03151                   __FUNCTION__);
03152                 return (NULL);
03153         }
03154         spline->p1->x0 = x1;
03155 #if DEBUG
03156         DXF_DEBUG_END
03157 #endif
03158         return (spline);
03159 }
03160 
03161 
03168 double
03169 dxf_spline_get_y1
03170 (
03171         DxfSpline *spline
03173 )
03174 {
03175 #ifdef DEBUG
03176         DXF_DEBUG_BEGIN
03177 #endif
03178 
03179         /* Do some basic checks. */
03180         if (spline == NULL)
03181         {
03182                 fprintf (stderr,
03183                   (_("Error in %s () a NULL pointer was passed.\n")),
03184                   __FUNCTION__);
03185                 return (EXIT_FAILURE);
03186         }
03187         if (spline->p1 == NULL)
03188         {
03189                 fprintf (stderr,
03190                   (_("Error in %s () a NULL pointer was found.\n")),
03191                   __FUNCTION__);
03192                 return (EXIT_FAILURE);
03193         }
03194 #if DEBUG
03195         DXF_DEBUG_END
03196 #endif
03197         return (spline->p1->y0);
03198 }
03199 
03200 
03208 DxfSpline *
03209 dxf_spline_set_y1
03210 (
03211         DxfSpline *spline,
03213         double y1
03216 )
03217 {
03218 #ifdef DEBUG
03219         DXF_DEBUG_BEGIN
03220 #endif
03221         /* Do some basic checks. */
03222         if (spline == NULL)
03223         {
03224                 fprintf (stderr,
03225                   (_("Error in %s () a NULL pointer was passed.\n")),
03226                   __FUNCTION__);
03227                 return (NULL);
03228         }
03229         if (spline->p1 == NULL)
03230         {
03231                 fprintf (stderr,
03232                   (_("Error in %s () a NULL pointer was found.\n")),
03233                   __FUNCTION__);
03234                 return (NULL);
03235         }
03236         spline->p1->y0 = y1;
03237 #if DEBUG
03238         DXF_DEBUG_END
03239 #endif
03240         return (spline);
03241 }
03242 
03243 
03250 double
03251 dxf_spline_get_z1
03252 (
03253         DxfSpline *spline
03255 )
03256 {
03257 #ifdef DEBUG
03258         DXF_DEBUG_BEGIN
03259 #endif
03260 
03261         /* Do some basic checks. */
03262         if (spline == NULL)
03263         {
03264                 fprintf (stderr,
03265                   (_("Error in %s () a NULL pointer was passed.\n")),
03266                   __FUNCTION__);
03267                 return (EXIT_FAILURE);
03268         }
03269         if (spline->p1 == NULL)
03270         {
03271                 fprintf (stderr,
03272                   (_("Error in %s () a NULL pointer was found.\n")),
03273                   __FUNCTION__);
03274                 return (EXIT_FAILURE);
03275         }
03276 #if DEBUG
03277         DXF_DEBUG_END
03278 #endif
03279         return (spline->p1->z0);
03280 }
03281 
03282 
03290 DxfSpline *
03291 dxf_spline_set_z1
03292 (
03293         DxfSpline *spline,
03295         double z1
03298 )
03299 {
03300 #ifdef DEBUG
03301         DXF_DEBUG_BEGIN
03302 #endif
03303         /* Do some basic checks. */
03304         if (spline == NULL)
03305         {
03306                 fprintf (stderr,
03307                   (_("Error in %s () a NULL pointer was passed.\n")),
03308                   __FUNCTION__);
03309                 return (NULL);
03310         }
03311         if (spline->p1 == NULL)
03312         {
03313                 fprintf (stderr,
03314                   (_("Error in %s () a NULL pointer was found.\n")),
03315                   __FUNCTION__);
03316                 return (NULL);
03317         }
03318         spline->p1->z0 = z1;
03319 #if DEBUG
03320         DXF_DEBUG_END
03321 #endif
03322         return (spline);
03323 }
03324 
03325 
03332 DxfPoint *
03333 dxf_spline_get_p2
03334 (
03335         DxfSpline *spline
03337 )
03338 {
03339 #if DEBUG
03340         DXF_DEBUG_BEGIN
03341 #endif
03342         /* Do some basic checks. */
03343         if (spline == NULL)
03344         {
03345                 fprintf (stderr,
03346                   (_("Error in %s () a NULL pointer was passed.\n")),
03347                   __FUNCTION__);
03348                 return (NULL);
03349         }
03350         if (spline->p2 ==  NULL)
03351         {
03352                 fprintf (stderr,
03353                   (_("Error in %s () a NULL pointer was found in the p1 member.\n")),
03354                   __FUNCTION__);
03355                 return (NULL);
03356         }
03357 #if DEBUG
03358         DXF_DEBUG_END
03359 #endif
03360         return ((DxfPoint *) spline->p2);
03361 }
03362 
03363 
03370 DxfSpline *
03371 dxf_spline_set_p2
03372 (
03373         DxfSpline *spline,
03375         DxfPoint *p2
03377 )
03378 {
03379 #if DEBUG
03380         DXF_DEBUG_BEGIN
03381 #endif
03382         /* Do some basic checks. */
03383         if (spline == NULL)
03384         {
03385                 fprintf (stderr,
03386                   (_("Error in %s () a NULL pointer was passed.\n")),
03387                   __FUNCTION__);
03388                 return (NULL);
03389         }
03390         if (p2 == NULL)
03391         {
03392                 fprintf (stderr,
03393                   (_("Error in %s () a NULL pointer was passed.\n")),
03394                   __FUNCTION__);
03395                 return (NULL);
03396         }
03397         spline->p2 = (DxfPoint *) p2;
03398 #if DEBUG
03399         DXF_DEBUG_END
03400 #endif
03401         return (spline);
03402 }
03403 
03404 
03411 double
03412 dxf_spline_get_x2
03413 (
03414         DxfSpline *spline
03416 )
03417 {
03418 #ifdef DEBUG
03419         DXF_DEBUG_BEGIN
03420 #endif
03421 
03422         /* Do some basic checks. */
03423         if (spline == NULL)
03424         {
03425                 fprintf (stderr,
03426                   (_("Error in %s () a NULL pointer was passed.\n")),
03427                   __FUNCTION__);
03428                 return (EXIT_FAILURE);
03429         }
03430         if (spline->p2 == NULL)
03431         {
03432                 fprintf (stderr,
03433                   (_("Error in %s () a NULL pointer was found.\n")),
03434                   __FUNCTION__);
03435                 return (EXIT_FAILURE);
03436         }
03437 #if DEBUG
03438         DXF_DEBUG_END
03439 #endif
03440         return (spline->p2->x0);
03441 }
03442 
03443 
03451 DxfSpline *
03452 dxf_spline_set_x2
03453 (
03454         DxfSpline *spline,
03456         double x2
03459 )
03460 {
03461 #ifdef DEBUG
03462         DXF_DEBUG_BEGIN
03463 #endif
03464         /* Do some basic checks. */
03465         if (spline == NULL)
03466         {
03467                 fprintf (stderr,
03468                   (_("Error in %s () a NULL pointer was passed.\n")),
03469                   __FUNCTION__);
03470                 return (NULL);
03471         }
03472         if (spline->p2 == NULL)
03473         {
03474                 fprintf (stderr,
03475                   (_("Error in %s () a NULL pointer was found.\n")),
03476                   __FUNCTION__);
03477                 return (NULL);
03478         }
03479         spline->p2->x0 = x2;
03480 #if DEBUG
03481         DXF_DEBUG_END
03482 #endif
03483         return (spline);
03484 }
03485 
03486 
03493 double
03494 dxf_spline_get_y2
03495 (
03496         DxfSpline *spline
03498 )
03499 {
03500 #ifdef DEBUG
03501         DXF_DEBUG_BEGIN
03502 #endif
03503 
03504         /* Do some basic checks. */
03505         if (spline == NULL)
03506         {
03507                 fprintf (stderr,
03508                   (_("Error in %s () a NULL pointer was passed.\n")),
03509                   __FUNCTION__);
03510                 return (EXIT_FAILURE);
03511         }
03512         if (spline->p2 == NULL)
03513         {
03514                 fprintf (stderr,
03515                   (_("Error in %s () a NULL pointer was found.\n")),
03516                   __FUNCTION__);
03517                 return (EXIT_FAILURE);
03518         }
03519 #if DEBUG
03520         DXF_DEBUG_END
03521 #endif
03522         return (spline->p2->y0);
03523 }
03524 
03525 
03533 DxfSpline *
03534 dxf_spline_set_y2
03535 (
03536         DxfSpline *spline,
03538         double y2
03541 )
03542 {
03543 #ifdef DEBUG
03544         DXF_DEBUG_BEGIN
03545 #endif
03546         /* Do some basic checks. */
03547         if (spline == NULL)
03548         {
03549                 fprintf (stderr,
03550                   (_("Error in %s () a NULL pointer was passed.\n")),
03551                   __FUNCTION__);
03552                 return (NULL);
03553         }
03554         if (spline->p2 == NULL)
03555         {
03556                 fprintf (stderr,
03557                   (_("Error in %s () a NULL pointer was found.\n")),
03558                   __FUNCTION__);
03559                 return (NULL);
03560         }
03561         spline->p2->y0 = y2;
03562 #if DEBUG
03563         DXF_DEBUG_END
03564 #endif
03565         return (spline);
03566 }
03567 
03568 
03575 double
03576 dxf_spline_get_z2
03577 (
03578         DxfSpline *spline
03580 )
03581 {
03582 #ifdef DEBUG
03583         DXF_DEBUG_BEGIN
03584 #endif
03585 
03586         /* Do some basic checks. */
03587         if (spline == NULL)
03588         {
03589                 fprintf (stderr,
03590                   (_("Error in %s () a NULL pointer was passed.\n")),
03591                   __FUNCTION__);
03592                 return (EXIT_FAILURE);
03593         }
03594         if (spline->p2 == NULL)
03595         {
03596                 fprintf (stderr,
03597                   (_("Error in %s () a NULL pointer was found.\n")),
03598                   __FUNCTION__);
03599                 return (EXIT_FAILURE);
03600         }
03601 #if DEBUG
03602         DXF_DEBUG_END
03603 #endif
03604         return (spline->p2->z0);
03605 }
03606 
03607 
03615 DxfSpline *
03616 dxf_spline_set_z2
03617 (
03618         DxfSpline *spline,
03620         double z2
03623 )
03624 {
03625 #ifdef DEBUG
03626         DXF_DEBUG_BEGIN
03627 #endif
03628         /* Do some basic checks. */
03629         if (spline == NULL)
03630         {
03631                 fprintf (stderr,
03632                   (_("Error in %s () a NULL pointer was passed.\n")),
03633                   __FUNCTION__);
03634                 return (NULL);
03635         }
03636         if (spline->p2 == NULL)
03637         {
03638                 fprintf (stderr,
03639                   (_("Error in %s () a NULL pointer was found.\n")),
03640                   __FUNCTION__);
03641                 return (NULL);
03642         }
03643         spline->p2->z0 = z2;
03644 #if DEBUG
03645         DXF_DEBUG_END
03646 #endif
03647         return (spline);
03648 }
03649 
03650 
03657 DxfPoint *
03658 dxf_spline_get_p3
03659 (
03660         DxfSpline *spline
03662 )
03663 {
03664 #if DEBUG
03665         DXF_DEBUG_BEGIN
03666 #endif
03667         /* Do some basic checks. */
03668         if (spline == NULL)
03669         {
03670                 fprintf (stderr,
03671                   (_("Error in %s () a NULL pointer was passed.\n")),
03672                   __FUNCTION__);
03673                 return (NULL);
03674         }
03675         if (spline->p3 ==  NULL)
03676         {
03677                 fprintf (stderr,
03678                   (_("Error in %s () a NULL pointer was found in the p1 member.\n")),
03679                   __FUNCTION__);
03680                 return (NULL);
03681         }
03682 #if DEBUG
03683         DXF_DEBUG_END
03684 #endif
03685         return ((DxfPoint *) spline->p3);
03686 }
03687 
03688 
03695 DxfSpline *
03696 dxf_spline_set_p3
03697 (
03698         DxfSpline *spline,
03700         DxfPoint *p3
03702 )
03703 {
03704 #if DEBUG
03705         DXF_DEBUG_BEGIN
03706 #endif
03707         /* Do some basic checks. */
03708         if (spline == NULL)
03709         {
03710                 fprintf (stderr,
03711                   (_("Error in %s () a NULL pointer was passed.\n")),
03712                   __FUNCTION__);
03713                 return (NULL);
03714         }
03715         if (p3 == NULL)
03716         {
03717                 fprintf (stderr,
03718                   (_("Error in %s () a NULL pointer was passed.\n")),
03719                   __FUNCTION__);
03720                 return (NULL);
03721         }
03722         spline->p3 = (DxfPoint *) p3;
03723 #if DEBUG
03724         DXF_DEBUG_END
03725 #endif
03726         return (spline);
03727 }
03728 
03729 
03736 double
03737 dxf_spline_get_x3
03738 (
03739         DxfSpline *spline
03741 )
03742 {
03743 #ifdef DEBUG
03744         DXF_DEBUG_BEGIN
03745 #endif
03746 
03747         /* Do some basic checks. */
03748         if (spline == NULL)
03749         {
03750                 fprintf (stderr,
03751                   (_("Error in %s () a NULL pointer was passed.\n")),
03752                   __FUNCTION__);
03753                 return (EXIT_FAILURE);
03754         }
03755         if (spline->p3 == NULL)
03756         {
03757                 fprintf (stderr,
03758                   (_("Error in %s () a NULL pointer was found.\n")),
03759                   __FUNCTION__);
03760                 return (EXIT_FAILURE);
03761         }
03762 #if DEBUG
03763         DXF_DEBUG_END
03764 #endif
03765         return (spline->p3->x0);
03766 }
03767 
03768 
03776 DxfSpline *
03777 dxf_spline_set_x3
03778 (
03779         DxfSpline *spline,
03781         double x3
03784 )
03785 {
03786 #ifdef DEBUG
03787         DXF_DEBUG_BEGIN
03788 #endif
03789         /* Do some basic checks. */
03790         if (spline == NULL)
03791         {
03792                 fprintf (stderr,
03793                   (_("Error in %s () a NULL pointer was passed.\n")),
03794                   __FUNCTION__);
03795                 return (NULL);
03796         }
03797         if (spline->p3 == NULL)
03798         {
03799                 fprintf (stderr,
03800                   (_("Error in %s () a NULL pointer was found.\n")),
03801                   __FUNCTION__);
03802                 return (NULL);
03803         }
03804         spline->p3->x0 = x3;
03805 #if DEBUG
03806         DXF_DEBUG_END
03807 #endif
03808         return (spline);
03809 }
03810 
03811 
03818 double
03819 dxf_spline_get_y3
03820 (
03821         DxfSpline *spline
03823 )
03824 {
03825 #ifdef DEBUG
03826         DXF_DEBUG_BEGIN
03827 #endif
03828 
03829         /* Do some basic checks. */
03830         if (spline == NULL)
03831         {
03832                 fprintf (stderr,
03833                   (_("Error in %s () a NULL pointer was passed.\n")),
03834                   __FUNCTION__);
03835                 return (EXIT_FAILURE);
03836         }
03837         if (spline->p3 == NULL)
03838         {
03839                 fprintf (stderr,
03840                   (_("Error in %s () a NULL pointer was found.\n")),
03841                   __FUNCTION__);
03842                 return (EXIT_FAILURE);
03843         }
03844 #if DEBUG
03845         DXF_DEBUG_END
03846 #endif
03847         return (spline->p3->y0);
03848 }
03849 
03850 
03858 DxfSpline *
03859 dxf_spline_set_y3
03860 (
03861         DxfSpline *spline,
03863         double y3
03866 )
03867 {
03868 #ifdef DEBUG
03869         DXF_DEBUG_BEGIN
03870 #endif
03871         /* Do some basic checks. */
03872         if (spline == NULL)
03873         {
03874                 fprintf (stderr,
03875                   (_("Error in %s () a NULL pointer was passed.\n")),
03876                   __FUNCTION__);
03877                 return (NULL);
03878         }
03879         if (spline->p3 == NULL)
03880         {
03881                 fprintf (stderr,
03882                   (_("Error in %s () a NULL pointer was found.\n")),
03883                   __FUNCTION__);
03884                 return (NULL);
03885         }
03886         spline->p3->y0 = y3;
03887 #if DEBUG
03888         DXF_DEBUG_END
03889 #endif
03890         return (spline);
03891 }
03892 
03893 
03900 double
03901 dxf_spline_get_z3
03902 (
03903         DxfSpline *spline
03905 )
03906 {
03907 #ifdef DEBUG
03908         DXF_DEBUG_BEGIN
03909 #endif
03910 
03911         /* Do some basic checks. */
03912         if (spline == NULL)
03913         {
03914                 fprintf (stderr,
03915                   (_("Error in %s () a NULL pointer was passed.\n")),
03916                   __FUNCTION__);
03917                 return (EXIT_FAILURE);
03918         }
03919         if (spline->p3 == NULL)
03920         {
03921                 fprintf (stderr,
03922                   (_("Error in %s () a NULL pointer was found.\n")),
03923                   __FUNCTION__);
03924                 return (EXIT_FAILURE);
03925         }
03926 #if DEBUG
03927         DXF_DEBUG_END
03928 #endif
03929         return (spline->p3->z0);
03930 }
03931 
03932 
03940 DxfSpline *
03941 dxf_spline_set_z3
03942 (
03943         DxfSpline *spline,
03945         double z3
03948 )
03949 {
03950 #ifdef DEBUG
03951         DXF_DEBUG_BEGIN
03952 #endif
03953         /* Do some basic checks. */
03954         if (spline == NULL)
03955         {
03956                 fprintf (stderr,
03957                   (_("Error in %s () a NULL pointer was passed.\n")),
03958                   __FUNCTION__);
03959                 return (NULL);
03960         }
03961         if (spline->p3 == NULL)
03962         {
03963                 fprintf (stderr,
03964                   (_("Error in %s () a NULL pointer was found.\n")),
03965                   __FUNCTION__);
03966                 return (NULL);
03967         }
03968         spline->p3->z0 = z3;
03969 #if DEBUG
03970         DXF_DEBUG_END
03971 #endif
03972         return (spline);
03973 }
03974 
03975 
03981 double
03982 dxf_spline_get_knot_tolerance
03983 (
03984         DxfSpline *spline
03986 )
03987 {
03988 #ifdef DEBUG
03989         DXF_DEBUG_BEGIN
03990 #endif
03991 
03992         /* Do some basic checks. */
03993         if (spline == NULL)
03994         {
03995                 fprintf (stderr,
03996                   (_("Error in %s () a NULL pointer was passed.\n")),
03997                   __FUNCTION__);
03998                 return (EXIT_FAILURE);
03999         }
04000 #if DEBUG
04001         DXF_DEBUG_END
04002 #endif
04003         return (spline->knot_tolerance);
04004 }
04005 
04006 
04013 DxfSpline *
04014 dxf_spline_set_knot_tolerance
04015 (
04016         DxfSpline *spline,
04018         double knot_tolerance
04021 )
04022 {
04023 #ifdef DEBUG
04024         DXF_DEBUG_BEGIN
04025 #endif
04026         /* Do some basic checks. */
04027         if (spline == NULL)
04028         {
04029                 fprintf (stderr,
04030                   (_("Error in %s () a NULL pointer was passed.\n")),
04031                   __FUNCTION__);
04032                 return (NULL);
04033         }
04034         spline->knot_tolerance = knot_tolerance;
04035 #if DEBUG
04036         DXF_DEBUG_END
04037 #endif
04038         return (spline);
04039 }
04040 
04041 
04047 double
04048 dxf_spline_get_control_point_tolerance
04049 (
04050         DxfSpline *spline
04052 )
04053 {
04054 #ifdef DEBUG
04055         DXF_DEBUG_BEGIN
04056 #endif
04057 
04058         /* Do some basic checks. */
04059         if (spline == NULL)
04060         {
04061                 fprintf (stderr,
04062                   (_("Error in %s () a NULL pointer was passed.\n")),
04063                   __FUNCTION__);
04064                 return (EXIT_FAILURE);
04065         }
04066 #if DEBUG
04067         DXF_DEBUG_END
04068 #endif
04069         return (spline->control_point_tolerance);
04070 }
04071 
04072 
04079 DxfSpline *
04080 dxf_spline_set_control_point_tolerance
04081 (
04082         DxfSpline *spline,
04084         double control_point_tolerance
04087 )
04088 {
04089 #ifdef DEBUG
04090         DXF_DEBUG_BEGIN
04091 #endif
04092         /* Do some basic checks. */
04093         if (spline == NULL)
04094         {
04095                 fprintf (stderr,
04096                   (_("Error in %s () a NULL pointer was passed.\n")),
04097                   __FUNCTION__);
04098                 return (NULL);
04099         }
04100         spline->control_point_tolerance = control_point_tolerance;
04101 #if DEBUG
04102         DXF_DEBUG_END
04103 #endif
04104         return (spline);
04105 }
04106 
04107 
04113 double
04114 dxf_spline_get_fit_tolerance
04115 (
04116         DxfSpline *spline
04118 )
04119 {
04120 #ifdef DEBUG
04121         DXF_DEBUG_BEGIN
04122 #endif
04123 
04124         /* Do some basic checks. */
04125         if (spline == NULL)
04126         {
04127                 fprintf (stderr,
04128                   (_("Error in %s () a NULL pointer was passed.\n")),
04129                   __FUNCTION__);
04130                 return (EXIT_FAILURE);
04131         }
04132 #if DEBUG
04133         DXF_DEBUG_END
04134 #endif
04135         return (spline->fit_tolerance);
04136 }
04137 
04138 
04145 DxfSpline *
04146 dxf_spline_set_fit_tolerance
04147 (
04148         DxfSpline *spline,
04150         double fit_tolerance
04153 )
04154 {
04155 #ifdef DEBUG
04156         DXF_DEBUG_BEGIN
04157 #endif
04158         /* Do some basic checks. */
04159         if (spline == NULL)
04160         {
04161                 fprintf (stderr,
04162                   (_("Error in %s () a NULL pointer was passed.\n")),
04163                   __FUNCTION__);
04164                 return (NULL);
04165         }
04166         spline->fit_tolerance = fit_tolerance;
04167 #if DEBUG
04168         DXF_DEBUG_END
04169 #endif
04170         return (spline);
04171 }
04172 
04173 
04180 int
04181 dxf_spline_get_flag
04182 (
04183         DxfSpline *spline
04185 )
04186 {
04187 #if DEBUG
04188         DXF_DEBUG_BEGIN
04189 #endif
04190         /* Do some basic checks. */
04191         if (spline == NULL)
04192         {
04193                 fprintf (stderr,
04194                   (_("Error in %s () a NULL pointer was passed.\n")),
04195                   __FUNCTION__);
04196                 return (EXIT_FAILURE);
04197         }
04198         if (spline->flag < 0)
04199         {
04200                 fprintf (stderr,
04201                   (_("Warning in %s () a negative value was found.\n")),
04202                   __FUNCTION__);
04203         }
04204         if (spline->flag > 31)
04205         {
04206                 fprintf (stderr,
04207                   (_("Warning in %s () an out of range value was found.\n")),
04208                   __FUNCTION__);
04209         }
04210 #if DEBUG
04211         DXF_DEBUG_END
04212 #endif
04213         return (spline->flag);
04214 }
04215 
04216 
04217 /* EOF */