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

solid.c

Go to the documentation of this file.
00001 
00051 #include "solid.h"
00052 
00053 
00061 DxfSolid *
00062 dxf_solid_new ()
00063 {
00064 #if DEBUG
00065         DXF_DEBUG_BEGIN
00066 #endif
00067         DxfSolid *solid = NULL;
00068         size_t size;
00069 
00070         size = sizeof (DxfSolid);
00071         /* avoid malloc of 0 bytes */
00072         if (size == 0) size = 1;
00073         if ((solid = malloc (size)) == NULL)
00074         {
00075                 fprintf (stderr,
00076                   (_("Error in %s () could not allocate memory for a DxfSolid struct.\n")),
00077                   __FUNCTION__);
00078                 solid = NULL;
00079         }
00080         else
00081         {
00082                 memset (solid, 0, size);
00083         }
00084 #if DEBUG
00085         DXF_DEBUG_END
00086 #endif
00087         return (solid);
00088 }
00089 
00090 
00097 DxfSolid *
00098 dxf_solid_init
00099 (
00100         DxfSolid *solid
00102 )
00103 {
00104 #if DEBUG
00105         DXF_DEBUG_BEGIN
00106 #endif
00107         /* Do some basic checks. */
00108         if (solid == NULL)
00109         {
00110                 fprintf (stderr,
00111                   (_("Warning in %s () a NULL pointer was passed.\n")),
00112                   __FUNCTION__);
00113                 solid = dxf_solid_new ();
00114         }
00115         if (solid == NULL)
00116         {
00117                 fprintf (stderr,
00118                   (_("Error in %s () could not allocate memory for a DxfSolid struct.\n")),
00119                   __FUNCTION__);
00120                 return (NULL);
00121         }
00122         solid->id_code = 0;
00123         solid->linetype = strdup (DXF_DEFAULT_LINETYPE);
00124         solid->layer = strdup (DXF_DEFAULT_LAYER);
00125         solid->elevation = 0.0;
00126         solid->thickness = 0.0;
00127         solid->linetype_scale = DXF_DEFAULT_LINETYPE_SCALE;
00128         solid->visibility = DXF_DEFAULT_VISIBILITY;
00129         solid->color = DXF_COLOR_BYLAYER;
00130         solid->paperspace = DXF_MODELSPACE;
00131         solid->graphics_data_size = 0;
00132         solid->shadow_mode = 0;
00133         solid->binary_graphics_data = dxf_binary_graphics_data_new ();
00134         solid->binary_graphics_data = dxf_binary_graphics_data_init (solid->binary_graphics_data);
00135         solid->dictionary_owner_soft = strdup ("");
00136         solid->material = strdup ("");
00137         solid->dictionary_owner_hard = strdup ("");
00138         solid->lineweight = 0;
00139         solid->plot_style_name = strdup ("");
00140         solid->color_value = 0;
00141         solid->color_name = strdup ("");
00142         solid->transparency = 0;
00143         solid->p0 = (DxfPoint *) dxf_point_new ();
00144         solid->p0 = (DxfPoint *) dxf_point_init ((DxfPoint *) solid->p0);
00145         solid->p0->x0 = 0.0;
00146         solid->p0->y0 = 0.0;
00147         solid->p0->z0 = 0.0;
00148         solid->p1 = (DxfPoint *) dxf_point_new ();
00149         solid->p1 = (DxfPoint *) dxf_point_init ((DxfPoint *) solid->p1);
00150         solid->p1->x0 = 0.0;
00151         solid->p1->y0 = 0.0;
00152         solid->p1->z0 = 0.0;
00153         solid->p2 = (DxfPoint *) dxf_point_new ();
00154         solid->p2 = (DxfPoint *) dxf_point_init ((DxfPoint *) solid->p2);
00155         solid->p2->x0 = 0.0;
00156         solid->p2->y0 = 0.0;
00157         solid->p2->z0 = 0.0;
00158         solid->p3 = (DxfPoint *) dxf_point_new ();
00159         solid->p3 = (DxfPoint *) dxf_point_init ((DxfPoint *) solid->p3);
00160         solid->p3->x0 = 0.0;
00161         solid->p3->y0 = 0.0;
00162         solid->p3->z0 = 0.0;
00163         solid->extr_x0 = 0.0;
00164         solid->extr_y0 = 0.0;
00165         solid->extr_z0 = 0.0;
00166         solid->next = NULL;
00167 #if DEBUG
00168         DXF_DEBUG_END
00169 #endif
00170         return (solid);
00171 }
00172 
00173 
00185 DxfSolid *
00186 dxf_solid_read
00187 (
00188         DxfFile *fp,
00190         DxfSolid *solid
00192 )
00193 {
00194 #if DEBUG
00195         DXF_DEBUG_BEGIN
00196 #endif
00197         char *temp_string = NULL;
00198 
00199         /* Do some basic checks. */
00200         if (fp == NULL)
00201         {
00202                 fprintf (stderr,
00203                   (_("Error in %s () a NULL file pointer was passed.\n")),
00204                   __FUNCTION__);
00205                 /* Clean up. */
00206                 free (temp_string);
00207                 return (NULL);
00208         }
00209         if (solid == NULL)
00210         {
00211                 fprintf (stderr,
00212                   (_("Warning in %s () a NULL pointer was passed.\n")),
00213                   __FUNCTION__);
00214                 solid = dxf_solid_new ();
00215                 solid = dxf_solid_init (solid);
00216         }
00217         if (solid->p0 == NULL)
00218         {
00219                 fprintf (stderr,
00220                   (_("Warning in %s () a NULL pointer was found.\n")),
00221                   __FUNCTION__);
00222                 solid->p0 = dxf_point_new ();
00223                 solid->p0 = dxf_point_init (solid->p0);
00224         }
00225         if (solid->p1 == NULL)
00226         {
00227                 fprintf (stderr,
00228                   (_("Warning in %s () a NULL pointer was found.\n")),
00229                   __FUNCTION__);
00230                 solid->p1 = dxf_point_new ();
00231                 solid->p1 = dxf_point_init (solid->p1);
00232         }
00233         if (solid->p2 == NULL)
00234         {
00235                 fprintf (stderr,
00236                   (_("Warning in %s () a NULL pointer was found.\n")),
00237                   __FUNCTION__);
00238                 solid->p2 = dxf_point_new ();
00239                 solid->p2 = dxf_point_init (solid->p2);
00240         }
00241         if (solid->p3== NULL)
00242         {
00243                 fprintf (stderr,
00244                   (_("Warning in %s () a NULL pointer was found.\n")),
00245                   __FUNCTION__);
00246                 solid->p3 = dxf_point_new ();
00247                 solid->p3 = dxf_point_init (solid->p3);
00248         }
00249         /* Start reading and parsing. */
00250         (fp->line_number)++;
00251         fscanf (fp->fp, "%[^\n]", temp_string);
00252         while (strcmp (temp_string, "0") != 0)
00253         {
00254                 if (ferror (fp->fp))
00255                 {
00256                         fprintf (stderr,
00257                           (_("Error in %s () while reading from: %s in line: %d.\n")),
00258                           __FUNCTION__, fp->filename, fp->line_number);
00259                         fclose (fp->fp);
00260                         /* Clean up. */
00261                         free (temp_string);
00262                         return (NULL);
00263                 }
00264                 if (strcmp (temp_string, "5") == 0)
00265                 {
00266                         /* Now follows a string containing a sequential
00267                          * id number. */
00268                         (fp->line_number)++;
00269                         fscanf (fp->fp, "%x\n", &solid->id_code);
00270                 }
00271                 else if (strcmp (temp_string, "6") == 0)
00272                 {
00273                         /* Now follows a string containing a linetype
00274                          * name. */
00275                         (fp->line_number)++;
00276                         fscanf (fp->fp, "%s\n", solid->linetype);
00277                 }
00278                 else if (strcmp (temp_string, "8") == 0)
00279                 {
00280                         /* Now follows a string containing a layer name. */
00281                         (fp->line_number)++;
00282                         fscanf (fp->fp, "%s\n", solid->layer);
00283                 }
00284                 else if (strcmp (temp_string, "10") == 0)
00285                 {
00286                         /* Now follows a string containing the
00287                          * X-coordinate of the point. */
00288                         (fp->line_number)++;
00289                         fscanf (fp->fp, "%lf\n", &solid->p0->x0);
00290                 }
00291                 else if (strcmp (temp_string, "20") == 0)
00292                 {
00293                         /* Now follows a string containing the
00294                          * Y-coordinate of the point. */
00295                         (fp->line_number)++;
00296                         fscanf (fp->fp, "%lf\n", &solid->p0->y0);
00297                 }
00298                 else if (strcmp (temp_string, "30") == 0)
00299                 {
00300                         /* Now follows a string containing the
00301                          * Z-coordinate of the point. */
00302                         (fp->line_number)++;
00303                         fscanf (fp->fp, "%lf\n", &solid->p0->z0);
00304                 }
00305                 else if (strcmp (temp_string, "11") == 0)
00306                 {
00307                         /* Now follows a string containing the
00308                          * X-coordinate of the point. */
00309                         (fp->line_number)++;
00310                         fscanf (fp->fp, "%lf\n", &solid->p1->x0);
00311                 }
00312                 else if (strcmp (temp_string, "21") == 0)
00313                 {
00314                         /* Now follows a string containing the
00315                          * Y-coordinate of the point. */
00316                         (fp->line_number)++;
00317                         fscanf (fp->fp, "%lf\n", &solid->p1->y0);
00318                 }
00319                 else if (strcmp (temp_string, "31") == 0)
00320                 {
00321                         /* Now follows a string containing the
00322                          * Z-coordinate of the point. */
00323                         (fp->line_number)++;
00324                         fscanf (fp->fp, "%lf\n", &solid->p1->z0);
00325                 }
00326                 else if (strcmp (temp_string, "12") == 0)
00327                 {
00328                         /* Now follows a string containing the
00329                          * X-coordinate of the point. */
00330                         (fp->line_number)++;
00331                         fscanf (fp->fp, "%lf\n", &solid->p2->x0);
00332                 }
00333                 else if (strcmp (temp_string, "22") == 0)
00334                 {
00335                         /* Now follows a string containing the
00336                          * Y-coordinate of the point. */
00337                         (fp->line_number)++;
00338                         fscanf (fp->fp, "%lf\n", &solid->p2->y0);
00339                 }
00340                 else if (strcmp (temp_string, "32") == 0)
00341                 {
00342                         /* Now follows a string containing the
00343                          * Z-coordinate of the point. */
00344                         (fp->line_number)++;
00345                         fscanf (fp->fp, "%lf\n", &solid->p2->z0);
00346                 }
00347                 else if (strcmp (temp_string, "13") == 0)
00348                 {
00349                         /* Now follows a string containing the
00350                          * X-coordinate of the point. */
00351                         (fp->line_number)++;
00352                         fscanf (fp->fp, "%lf\n", &solid->p3->x0);
00353                 }
00354                 else if (strcmp (temp_string, "23") == 0)
00355                 {
00356                         /* Now follows a string containing the
00357                          * Y-coordinate of the point. */
00358                         (fp->line_number)++;
00359                         fscanf (fp->fp, "%lf\n", &solid->p3->y0);
00360                 }
00361                 else if (strcmp (temp_string, "33") == 0)
00362                 {
00363                         /* Now follows a string containing the
00364                          * Z-coordinate of the point. */
00365                         (fp->line_number)++;
00366                         fscanf (fp->fp, "%lf\n", &solid->p3->z0);
00367                 }
00368                 else if (strcmp (temp_string, "38") == 0)
00369                 {
00370                         /* Now follows a string containing the
00371                          * elevation. */
00372                         (fp->line_number)++;
00373                         fscanf (fp->fp, "%lf\n", &solid->elevation);
00374                 }
00375                 else if (strcmp (temp_string, "39") == 0)
00376                 {
00377                         /* Now follows a string containing the
00378                          * thickness. */
00379                         (fp->line_number)++;
00380                         fscanf (fp->fp, "%lf\n", &solid->thickness);
00381                 }
00382                 else if (strcmp (temp_string, "48") == 0)
00383                 {
00384                         /* Now follows a string containing the linetype
00385                          * scale. */
00386                         (fp->line_number)++;
00387                         fscanf (fp->fp, "%lf\n", &solid->linetype_scale);
00388                 }
00389                 else if (strcmp (temp_string, "60") == 0)
00390                 {
00391                         /* Now follows a string containing the
00392                          * visibility value. */
00393                         (fp->line_number)++;
00394                         fscanf (fp->fp, "%hd\n", &solid->visibility);
00395                 }
00396                 else if (strcmp (temp_string, "62") == 0)
00397                 {
00398                         /* Now follows a string containing the
00399                          * color value. */
00400                         (fp->line_number)++;
00401                         fscanf (fp->fp, "%d\n", &solid->color);
00402                 }
00403                 else if (strcmp (temp_string, "67") == 0)
00404                 {
00405                         /* Now follows a string containing the
00406                          * paperspace value. */
00407                         (fp->line_number)++;
00408                         fscanf (fp->fp, "%d\n", &solid->paperspace);
00409                 }
00410                 else if (strcmp (temp_string, "92") == 0)
00411                 {
00412                         /* Now follows a string containing the
00413                          * graphics data size value. */
00414                         (fp->line_number)++;
00415                         fscanf (fp->fp, "%d\n", &solid->graphics_data_size);
00416                 }
00417                 else if ((fp->acad_version_number >= AutoCAD_12)
00418                         && (strcmp (temp_string, "100") == 0))
00419                 {
00420                         /* Subclass markers are post AutoCAD R12
00421                          * variable so additional testing for the
00422                          * version should probably be added here.
00423                          * Now follows a string containing the
00424                          * subclass marker value. */
00425                         (fp->line_number)++;
00426                         fscanf (fp->fp, "%s\n", temp_string);
00427                 }
00428                 else if (strcmp (temp_string, "160") == 0)
00429                 {
00430                         /* Now follows a string containing the
00431                          * graphics data size value. */
00432                         (fp->line_number)++;
00433                         fscanf (fp->fp, "%d\n", &solid->graphics_data_size);
00434                 }
00435                 else if (strcmp (temp_string, "210") == 0)
00436                 {
00437                         /* Now follows a string containing the
00438                          * X-value of the extrusion vector. */
00439                         (fp->line_number)++;
00440                         fscanf (fp->fp, "%lf\n", &solid->extr_x0);
00441                 }
00442                 else if (strcmp (temp_string, "220") == 0)
00443                 {
00444                         /* Now follows a string containing the
00445                          * Y-value of the extrusion vector. */
00446                         (fp->line_number)++;
00447                         fscanf (fp->fp, "%lf\n", &solid->extr_y0);
00448                 }
00449                 else if (strcmp (temp_string, "230") == 0)
00450                 {
00451                         /* Now follows a string containing the
00452                          * Z-value of the extrusion vector. */
00453                         (fp->line_number)++;
00454                         fscanf (fp->fp, "%lf\n", &solid->extr_z0);
00455                 }
00456                 else if (strcmp (temp_string, "284") == 0)
00457                 {
00458                         /* Now follows a string containing the shadow
00459                          * mode value. */
00460                         (fp->line_number)++;
00461                         fscanf (fp->fp, "%hd\n", &solid->shadow_mode);
00462                 }
00463                 else if (strcmp (temp_string, "310") == 0)
00464                 {
00465                         /* Now follows a string containing binary
00466                          * graphics data. */
00467                         (fp->line_number)++;
00468                         fscanf (fp->fp, "%s\n", solid->binary_graphics_data->data_line);
00469                         dxf_binary_graphics_data_init ((DxfBinaryGraphicsData *) solid->binary_graphics_data->next);
00470                         solid->binary_graphics_data = (DxfBinaryGraphicsData *) solid->binary_graphics_data->next;
00471                 }
00472                 else if (strcmp (temp_string, "330") == 0)
00473                 {
00474                         /* Now follows a string containing Soft-pointer
00475                          * ID/handle to owner dictionary. */
00476                         (fp->line_number)++;
00477                         fscanf (fp->fp, "%s\n", solid->dictionary_owner_soft);
00478                 }
00479                 else if (strcmp (temp_string, "347") == 0)
00480                 {
00481                         /* Now follows a string containing a
00482                          * hard-pointer ID/handle to material object. */
00483                         (fp->line_number)++;
00484                         fscanf (fp->fp, "%s\n", solid->material);
00485                 }
00486                 else if (strcmp (temp_string, "360") == 0)
00487                 {
00488                         /* Now follows a string containing Hard owner
00489                          * ID/handle to owner dictionary. */
00490                         (fp->line_number)++;
00491                         fscanf (fp->fp, "%s\n", solid->dictionary_owner_hard);
00492                 }
00493                 else if (strcmp (temp_string, "370") == 0)
00494                 {
00495                         /* Now follows a string containing the lineweight
00496                          * value. */
00497                         (fp->line_number)++;
00498                         fscanf (fp->fp, "%hd\n", &solid->lineweight);
00499                 }
00500                 else if (strcmp (temp_string, "390") == 0)
00501                 {
00502                         /* Now follows a string containing a plot style
00503                          * name value. */
00504                         (fp->line_number)++;
00505                         fscanf (fp->fp, "%s\n", solid->plot_style_name);
00506                 }
00507                 else if (strcmp (temp_string, "420") == 0)
00508                 {
00509                         /* Now follows a string containing a color value. */
00510                         (fp->line_number)++;
00511                         fscanf (fp->fp, "%ld\n", &solid->color_value);
00512                 }
00513                 else if (strcmp (temp_string, "430") == 0)
00514                 {
00515                         /* Now follows a string containing a color
00516                          * name value. */
00517                         (fp->line_number)++;
00518                         fscanf (fp->fp, "%s\n", solid->color_name);
00519                 }
00520                 else if (strcmp (temp_string, "440") == 0)
00521                 {
00522                         /* Now follows a string containing a transparency
00523                          * value. */
00524                         (fp->line_number)++;
00525                         fscanf (fp->fp, "%ld\n", &solid->transparency);
00526                 }
00527                 else if (strcmp (temp_string, "999") == 0)
00528                 {
00529                         /* Now follows a string containing a comment. */
00530                         (fp->line_number)++;
00531                         fscanf (fp->fp, "%s\n", temp_string);
00532                         fprintf (stdout, "DXF comment: %s\n", temp_string);
00533                 }
00534                 else
00535                 {
00536                         fprintf (stderr,
00537                           (_("Warning in %s () unknown string tag found while reading from: %s in line: %d.\n")),
00538                           __FUNCTION__, fp->filename, fp->line_number);
00539                 }
00540         }
00541         /* Handle omitted members and/or illegal values. */
00542         if (strcmp (solid->linetype, "") == 0)
00543         {
00544                 solid->linetype = strdup (DXF_DEFAULT_LINETYPE);
00545         }
00546         if (strcmp (solid->layer, "") == 0)
00547         {
00548                 solid->layer = strdup (DXF_DEFAULT_LAYER);
00549         }
00550         /* Clean up. */
00551         free (temp_string);
00552 #if DEBUG
00553         DXF_DEBUG_END
00554 #endif
00555         return (solid);
00556 }
00557 
00558 
00565 int
00566 dxf_solid_write
00567 (
00568         DxfFile *fp,
00570         DxfSolid *solid
00572 )
00573 {
00574 #if DEBUG
00575         DXF_DEBUG_BEGIN
00576 #endif
00577         char *dxf_entity_name = strdup ("SOLID");
00578 
00579         /* Do some basic checks. */
00580         if (fp == NULL)
00581         {
00582                 fprintf (stderr,
00583                   (_("Error in %s () a NULL file pointer was passed.\n")),
00584                   __FUNCTION__);
00585                 /* Clean up. */
00586                 free (dxf_entity_name);
00587                 return (EXIT_FAILURE);
00588         }
00589         if (solid == NULL)
00590         {
00591                 fprintf (stderr,
00592                   (_("Error in %s () a NULL pointer was passed.\n")),
00593                   __FUNCTION__);
00594                 /* Clean up. */
00595                 free (dxf_entity_name);
00596                 return (EXIT_FAILURE);
00597         }
00598         if (strcmp (solid->linetype, "") == 0)
00599         {
00600                 fprintf (stderr,
00601                   (_("Warning in %s () empty linetype string for the %s entity with id-code: %x\n")),
00602                   __FUNCTION__, dxf_entity_name, solid->id_code);
00603                 fprintf (stderr,
00604                   (_("\t%s entity is reset to default linetype")),
00605                   dxf_entity_name);
00606                 solid->linetype = strdup (DXF_DEFAULT_LINETYPE);
00607         }
00608         if (strcmp (solid->layer, "") == 0)
00609         {
00610                 fprintf (stderr,
00611                   (_("Warning in %s () empty layer string for the %s entity with id-code: %x\n")),
00612                   __FUNCTION__, dxf_entity_name, solid->id_code);
00613                 fprintf (stderr,
00614                   (_("\t%s entity is relocated to layer 0")),
00615                   dxf_entity_name);
00616                 solid->layer = strdup (DXF_DEFAULT_LAYER);
00617         }
00618         if (solid->p0 == NULL)
00619         {
00620                 fprintf (stderr,
00621                   (_("Error in %s () a NULL pointer was found.\n")),
00622                   __FUNCTION__);
00623                 /* Clean up. */
00624                 free (dxf_entity_name);
00625                 return (EXIT_FAILURE);
00626         }
00627         if (solid->p1 == NULL)
00628         {
00629                 fprintf (stderr,
00630                   (_("Error in %s () a NULL pointer was found.\n")),
00631                   __FUNCTION__);
00632                 /* Clean up. */
00633                 free (dxf_entity_name);
00634                 return (EXIT_FAILURE);
00635         }
00636         if (solid->p2 == NULL)
00637         {
00638                 fprintf (stderr,
00639                   (_("Error in %s () a NULL pointer was found.\n")),
00640                   __FUNCTION__);
00641                 /* Clean up. */
00642                 free (dxf_entity_name);
00643                 return (EXIT_FAILURE);
00644         }
00645         if (solid->p3 == NULL)
00646         {
00647                 fprintf (stderr,
00648                   (_("Error in %s () a NULL pointer was found.\n")),
00649                   __FUNCTION__);
00650                 /* Clean up. */
00651                 free (dxf_entity_name);
00652                 return (EXIT_FAILURE);
00653         }
00654         /* Start writing output. */
00655         fprintf (fp->fp, "  0\n%s\n", dxf_entity_name);
00656         if (solid->id_code != -1)
00657         {
00658                 fprintf (fp->fp, "  5\n%x\n", solid->id_code);
00659         }
00670         if ((strcmp (solid->dictionary_owner_soft, "") != 0)
00671           && (fp->acad_version_number >= AutoCAD_14))
00672         {
00673                 fprintf (fp->fp, "102\n{ACAD_REACTORS\n");
00674                 fprintf (fp->fp, "330\n%s\n", solid->dictionary_owner_soft);
00675                 fprintf (fp->fp, "102\n}\n");
00676         }
00677         if ((strcmp (solid->dictionary_owner_hard, "") != 0)
00678           && (fp->acad_version_number >= AutoCAD_14))
00679         {
00680                 fprintf (fp->fp, "102\n{ACAD_XDICTIONARY\n");
00681                 fprintf (fp->fp, "360\n%s\n", solid->dictionary_owner_hard);
00682                 fprintf (fp->fp, "102\n}\n");
00683         }
00684         if (fp->acad_version_number >= AutoCAD_13)
00685         {
00686                 fprintf (fp->fp, "100\nAcDbEntity\n");
00687         }
00688         if (solid->paperspace == DXF_PAPERSPACE)
00689         {
00690                 fprintf (fp->fp, " 67\n%d\n", DXF_PAPERSPACE);
00691         }
00692         fprintf (fp->fp, "  8\n%s\n", solid->layer);
00693         if (strcmp (solid->linetype, DXF_DEFAULT_LINETYPE) != 0)
00694         {
00695                 fprintf (fp->fp, "  6\n%s\n", solid->linetype);
00696         }
00697         if ((fp->acad_version_number >= AutoCAD_2008)
00698           && (strcmp (solid->material, "") != 0))
00699         {
00700                 fprintf (fp->fp, "347\n%s\n", solid->material);
00701         }
00702         if (solid->color != DXF_COLOR_BYLAYER)
00703         {
00704                 fprintf (fp->fp, " 62\n%d\n", solid->color);
00705         }
00706         if (fp->acad_version_number >= AutoCAD_2002)
00707         {
00708                 fprintf (fp->fp, "370\n%d\n", solid->lineweight);
00709         }
00710         if ((fp->acad_version_number <= AutoCAD_11)
00711           && DXF_FLATLAND
00712           && (solid->elevation != 0.0))
00713         {
00714                 fprintf (fp->fp, " 38\n%f\n", solid->elevation);
00715         }
00716         if (solid->linetype_scale != 1.0)
00717         {
00718                 fprintf (fp->fp, " 48\n%f\n", solid->linetype_scale);
00719         }
00720         if (solid->visibility != 0)
00721         {
00722                 fprintf (fp->fp, " 60\n%d\n", solid->visibility);
00723         }
00724         if ((fp->acad_version_number >= AutoCAD_2000)
00725           && (solid->graphics_data_size > 0))
00726         {
00727 #ifdef BUILD_64
00728                 fprintf (fp->fp, "160\n%d\n", solid->graphics_data_size);
00729 #else
00730                 fprintf (fp->fp, " 92\n%d\n", solid->graphics_data_size);
00731 #endif
00732                 if (solid->binary_graphics_data != NULL)
00733                 {
00734                         DxfBinaryGraphicsData *iter;
00735                         iter = solid->binary_graphics_data;
00736                         while (iter != NULL)
00737                         {
00738                                 fprintf (fp->fp, "310\n%s\n", dxf_binary_graphics_data_get_data_line (iter));
00739                                 iter = (DxfBinaryGraphicsData *) dxf_binary_graphics_data_get_next (iter);
00740                         }
00741                 }
00742         }
00743         if (fp->acad_version_number >= AutoCAD_2004)
00744         {
00745                 fprintf (fp->fp, "420\n%ld\n", solid->color_value);
00746                 fprintf (fp->fp, "430\n%s\n", solid->color_name);
00747                 fprintf (fp->fp, "440\n%ld\n", solid->transparency);
00748         }
00749         if (fp->acad_version_number >= AutoCAD_2009)
00750         {
00751                 fprintf (fp->fp, "390\n%s\n", solid->plot_style_name);
00752                 fprintf (fp->fp, "284\n%d\n", solid->shadow_mode);
00753         }
00754         if (fp->acad_version_number >= AutoCAD_13)
00755         {
00756                 fprintf (fp->fp, "100\nAcDbTrace\n");
00757         }
00758         fprintf (fp->fp, " 10\n%f\n", solid->p0->x0);
00759         fprintf (fp->fp, " 20\n%f\n", solid->p0->y0);
00760         fprintf (fp->fp, " 30\n%f\n", solid->p0->z0);
00761         fprintf (fp->fp, " 11\n%f\n", solid->p1->x0);
00762         fprintf (fp->fp, " 21\n%f\n", solid->p1->y0);
00763         fprintf (fp->fp, " 31\n%f\n", solid->p1->z0);
00764         fprintf (fp->fp, " 12\n%f\n", solid->p2->x0);
00765         fprintf (fp->fp, " 22\n%f\n", solid->p2->y0);
00766         fprintf (fp->fp, " 32\n%f\n", solid->p2->z0);
00767         fprintf (fp->fp, " 13\n%f\n", solid->p3->x0);
00768         fprintf (fp->fp, " 23\n%f\n", solid->p3->y0);
00769         fprintf (fp->fp, " 33\n%f\n", solid->p3->z0);
00770         if (solid->thickness != 0.0)
00771         {
00772                 fprintf (fp->fp, " 39\n%f\n", solid->thickness);
00773         }
00774         if ((fp->acad_version_number >= AutoCAD_12)
00775                 && (solid->extr_x0 != 0.0)
00776                 && (solid->extr_y0 != 0.0)
00777                 && (solid->extr_z0 != 1.0))
00778         {
00779                 fprintf (fp->fp, "210\n%f\n", solid->extr_x0);
00780                 fprintf (fp->fp, "220\n%f\n", solid->extr_y0);
00781                 fprintf (fp->fp, "230\n%f\n", solid->extr_z0);
00782         }
00783         /* Clean up. */
00784         free (dxf_entity_name);
00785 #if DEBUG
00786         DXF_DEBUG_END
00787 #endif
00788         return (EXIT_SUCCESS);
00789 }
00790 
00791 
00799 int
00800 dxf_solid_free
00801 (
00802         DxfSolid *solid
00805 )
00806 {
00807 #if DEBUG
00808         DXF_DEBUG_BEGIN
00809 #endif
00810         /* Do some basic checks. */
00811         if (solid == NULL)
00812         {
00813                 fprintf (stderr,
00814                   (_("Error in %s () a NULL pointer was passed.\n")),
00815                   __FUNCTION__);
00816                 return (EXIT_FAILURE);
00817         }
00818         if (solid->next != NULL)
00819         {
00820                 fprintf (stderr,
00821                   (_("Error in %s () pointer to next was not NULL.\n")),
00822                   __FUNCTION__);
00823                 return (EXIT_FAILURE);
00824         }
00825         free (solid->linetype);
00826         free (solid->layer);
00827         free (solid->dictionary_owner_soft);
00828         free (solid->dictionary_owner_hard);
00829         free (solid);
00830         solid = NULL;
00831 #if DEBUG
00832         DXF_DEBUG_END
00833 #endif
00834         return (EXIT_SUCCESS);
00835 }
00836 
00837 
00842 void
00843 dxf_solid_free_chain
00844 (
00845         DxfSolid *solids
00847 )
00848 {
00849 #ifdef DEBUG
00850         DXF_DEBUG_BEGIN
00851 #endif
00852         if (solids == NULL)
00853         {
00854                 fprintf (stderr,
00855                   (_("Warning in %s () a NULL pointer was passed.\n")),
00856                   __FUNCTION__);
00857         }
00858         while (solids != NULL)
00859         {
00860                 struct DxfSolid *iter = solids->next;
00861                 dxf_solid_free (solids);
00862                 solids = (DxfSolid *) iter;
00863         }
00864 #if DEBUG
00865         DXF_DEBUG_END
00866 #endif
00867 }
00868 
00869 
00875 int
00876 dxf_solid_get_id_code
00877 (
00878         DxfSolid *solid
00880 )
00881 {
00882 #if DEBUG
00883         DXF_DEBUG_BEGIN
00884 #endif
00885         /* Do some basic checks. */
00886         if (solid == NULL)
00887         {
00888                 fprintf (stderr,
00889                   (_("Error in %s () a NULL pointer was passed.\n")),
00890                   __FUNCTION__);
00891                 return (EXIT_FAILURE);
00892         }
00893         if (solid->id_code < 0)
00894         {
00895                 fprintf (stderr,
00896                   (_("Warning in %s () a negative value was found.\n")),
00897                   __FUNCTION__);
00898         }
00899 #if DEBUG
00900         DXF_DEBUG_END
00901 #endif
00902         return (solid->id_code);
00903 }
00904 
00905 
00909 DxfSolid *
00910 dxf_solid_set_id_code
00911 (
00912         DxfSolid *solid,
00914         int id_code
00918 )
00919 {
00920 #if DEBUG
00921         DXF_DEBUG_BEGIN
00922 #endif
00923         /* Do some basic checks. */
00924         if (solid == NULL)
00925         {
00926                 fprintf (stderr,
00927                   (_("Error in %s () a NULL pointer was passed.\n")),
00928                   __FUNCTION__);
00929                 return (NULL);
00930         }
00931         if (id_code < 0)
00932         {
00933                 fprintf (stderr,
00934                   (_("Warning in %s () a negative value was passed.\n")),
00935                   __FUNCTION__);
00936         }
00937         solid->id_code = id_code;
00938 #if DEBUG
00939         DXF_DEBUG_END
00940 #endif
00941         return (solid);
00942 }
00943 
00944 
00950 char *
00951 dxf_solid_get_linetype
00952 (
00953         DxfSolid *solid
00955 )
00956 {
00957 #if DEBUG
00958         DXF_DEBUG_BEGIN
00959 #endif
00960         /* Do some basic checks. */
00961         if (solid == NULL)
00962         {
00963                 fprintf (stderr,
00964                   (_("Error in %s () a NULL pointer was passed.\n")),
00965                   __FUNCTION__);
00966                 return (NULL);
00967         }
00968         if (solid->linetype ==  NULL)
00969         {
00970                 fprintf (stderr,
00971                   (_("Error in %s () a NULL pointer was found.\n")),
00972                   __FUNCTION__);
00973                 return (NULL);
00974         }
00975 #if DEBUG
00976         DXF_DEBUG_END
00977 #endif
00978         return (strdup (solid->linetype));
00979 }
00980 
00981 
00985 DxfSolid *
00986 dxf_solid_set_linetype
00987 (
00988         DxfSolid *solid,
00990         char *linetype
00993 )
00994 {
00995 #if DEBUG
00996         DXF_DEBUG_BEGIN
00997 #endif
00998         /* Do some basic checks. */
00999         if (solid == NULL)
01000         {
01001                 fprintf (stderr,
01002                   (_("Error in %s () a NULL pointer was passed.\n")),
01003                   __FUNCTION__);
01004                 return (NULL);
01005         }
01006         if (linetype == NULL)
01007         {
01008                 fprintf (stderr,
01009                   (_("Error in %s () a NULL pointer was passed.\n")),
01010                   __FUNCTION__);
01011                 return (NULL);
01012         }
01013         solid->linetype = strdup (linetype);
01014 #if DEBUG
01015         DXF_DEBUG_END
01016 #endif
01017         return (solid);
01018 }
01019 
01020 
01026 char *
01027 dxf_solid_get_layer
01028 (
01029         DxfSolid *solid
01031 )
01032 {
01033 #if DEBUG
01034         DXF_DEBUG_BEGIN
01035 #endif
01036         /* Do some basic checks. */
01037         if (solid == NULL)
01038         {
01039                 fprintf (stderr,
01040                   (_("Error in %s () a NULL pointer was passed.\n")),
01041                   __FUNCTION__);
01042                 return (NULL);
01043         }
01044         if (solid->layer ==  NULL)
01045         {
01046                 fprintf (stderr,
01047                   (_("Error in %s () a NULL pointer was found.\n")),
01048                   __FUNCTION__);
01049                 return (NULL);
01050         }
01051 #if DEBUG
01052         DXF_DEBUG_END
01053 #endif
01054         return (strdup (solid->layer));
01055 }
01056 
01057 
01061 DxfSolid *
01062 dxf_solid_set_layer
01063 (
01064         DxfSolid *solid,
01066         char *layer
01069 )
01070 {
01071 #if DEBUG
01072         DXF_DEBUG_BEGIN
01073 #endif
01074         /* Do some basic checks. */
01075         if (solid == NULL)
01076         {
01077                 fprintf (stderr,
01078                   (_("Error in %s () a NULL pointer was passed.\n")),
01079                   __FUNCTION__);
01080                 return (NULL);
01081         }
01082         if (layer == NULL)
01083         {
01084                 fprintf (stderr,
01085                   (_("Error in %s () a NULL pointer was passed.\n")),
01086                   __FUNCTION__);
01087                 return (NULL);
01088         }
01089         solid->layer = strdup (layer);
01090 #if DEBUG
01091         DXF_DEBUG_END
01092 #endif
01093         return (solid);
01094 }
01095 
01096 
01102 double
01103 dxf_solid_get_elevation
01104 (
01105         DxfSolid *solid
01107 )
01108 {
01109 #if DEBUG
01110         DXF_DEBUG_BEGIN
01111 #endif
01112         /* Do some basic checks. */
01113         if (solid == NULL)
01114         {
01115                 fprintf (stderr,
01116                   (_("Error in %s () a NULL pointer was passed.\n")),
01117                   __FUNCTION__);
01118                 return (EXIT_FAILURE);
01119         }
01120 #if DEBUG
01121         DXF_DEBUG_END
01122 #endif
01123         return (solid->elevation);
01124 }
01125 
01126 
01130 DxfSolid *
01131 dxf_solid_set_elevation
01132 (
01133         DxfSolid *solid,
01135         double elevation
01137 )
01138 {
01139 #if DEBUG
01140         DXF_DEBUG_BEGIN
01141 #endif
01142         /* Do some basic checks. */
01143         if (solid == NULL)
01144         {
01145                 fprintf (stderr,
01146                   (_("Error in %s () a NULL pointer was passed.\n")),
01147                   __FUNCTION__);
01148                 return (NULL);
01149         }
01150         solid->elevation = elevation;
01151 #if DEBUG
01152         DXF_DEBUG_END
01153 #endif
01154         return (solid);
01155 }
01156 
01157 
01163 double
01164 dxf_solid_get_thickness
01165 (
01166         DxfSolid *solid
01168 )
01169 {
01170 #if DEBUG
01171         DXF_DEBUG_BEGIN
01172 #endif
01173         /* Do some basic checks. */
01174         if (solid == NULL)
01175         {
01176                 fprintf (stderr,
01177                   (_("Error in %s () a NULL pointer was passed.\n")),
01178                   __FUNCTION__);
01179                 return (EXIT_FAILURE);
01180         }
01181         if (solid->thickness < 0.0)
01182         {
01183                 fprintf (stderr,
01184                   (_("Warning in %s () a negative value was found.\n")),
01185                   __FUNCTION__);
01186         }
01187 #if DEBUG
01188         DXF_DEBUG_END
01189 #endif
01190         return (solid->thickness);
01191 }
01192 
01193 
01197 DxfSolid *
01198 dxf_solid_set_thickness
01199 (
01200         DxfSolid *solid,
01202         double thickness
01204 )
01205 {
01206 #if DEBUG
01207         DXF_DEBUG_BEGIN
01208 #endif
01209         /* Do some basic checks. */
01210         if (solid == NULL)
01211         {
01212                 fprintf (stderr,
01213                   (_("Error in %s () a NULL pointer was passed.\n")),
01214                   __FUNCTION__);
01215                 return (NULL);
01216         }
01217         if (thickness < 0.0)
01218         {
01219                 fprintf (stderr,
01220                   (_("Warning in %s () a negative value was passed.\n")),
01221                   __FUNCTION__);
01222         }
01223         solid->thickness = thickness;
01224 #if DEBUG
01225         DXF_DEBUG_END
01226 #endif
01227         return (solid);
01228 }
01229 
01230 
01236 double
01237 dxf_solid_get_linetype_scale
01238 (
01239         DxfSolid *solid
01241 )
01242 {
01243 #if DEBUG
01244         DXF_DEBUG_BEGIN
01245 #endif
01246         /* Do some basic checks. */
01247         if (solid == NULL)
01248         {
01249                 fprintf (stderr,
01250                   (_("Error in %s () a NULL pointer was passed.\n")),
01251                   __FUNCTION__);
01252                 return (EXIT_FAILURE);
01253         }
01254         if (solid->linetype_scale < 0.0)
01255         {
01256                 fprintf (stderr,
01257                   (_("Warning in %s () a negative value was found.\n")),
01258                   __FUNCTION__);
01259         }
01260 #if DEBUG
01261         DXF_DEBUG_END
01262 #endif
01263         return (solid->linetype_scale);
01264 }
01265 
01266 
01270 DxfSolid *
01271 dxf_solid_set_linetype_scale
01272 (
01273         DxfSolid *solid,
01275         double linetype_scale
01277 )
01278 {
01279 #if DEBUG
01280         DXF_DEBUG_BEGIN
01281 #endif
01282         /* Do some basic checks. */
01283         if (solid == NULL)
01284         {
01285                 fprintf (stderr,
01286                   (_("Error in %s () a NULL pointer was passed.\n")),
01287                   __FUNCTION__);
01288                 return (NULL);
01289         }
01290         if (linetype_scale < 0.0)
01291         {
01292                 fprintf (stderr,
01293                   (_("Warning in %s () a negative value was passed.\n")),
01294                   __FUNCTION__);
01295         }
01296         solid->linetype_scale = linetype_scale;
01297 #if DEBUG
01298         DXF_DEBUG_END
01299 #endif
01300         return (solid);
01301 }
01302 
01303 
01309 int16_t
01310 dxf_solid_get_visibility
01311 (
01312         DxfSolid *solid
01314 )
01315 {
01316 #if DEBUG
01317         DXF_DEBUG_BEGIN
01318 #endif
01319         /* Do some basic checks. */
01320         if (solid == NULL)
01321         {
01322                 fprintf (stderr,
01323                   (_("Error in %s () a NULL pointer was passed.\n")),
01324                   __FUNCTION__);
01325                 return (EXIT_FAILURE);
01326         }
01327         if (solid->visibility < 0)
01328         {
01329                 fprintf (stderr,
01330                   (_("Warning in %s () a negative value was found.\n")),
01331                   __FUNCTION__);
01332         }
01333         if (solid->visibility > 1)
01334         {
01335                 fprintf (stderr,
01336                   (_("Warning in %s () an out of range value was found.\n")),
01337                   __FUNCTION__);
01338         }
01339 #if DEBUG
01340         DXF_DEBUG_END
01341 #endif
01342         return (solid->visibility);
01343 }
01344 
01345 
01349 DxfSolid *
01350 dxf_solid_set_visibility
01351 (
01352         DxfSolid *solid,
01354         int16_t visibility
01356 )
01357 {
01358 #if DEBUG
01359         DXF_DEBUG_BEGIN
01360 #endif
01361         /* Do some basic checks. */
01362         if (solid == NULL)
01363         {
01364                 fprintf (stderr,
01365                   (_("Error in %s () a NULL pointer was passed.\n")),
01366                   __FUNCTION__);
01367                 return (NULL);
01368         }
01369         if (visibility < 0)
01370         {
01371                 fprintf (stderr,
01372                   (_("Warning in %s () a negative value was passed.\n")),
01373                   __FUNCTION__);
01374         }
01375         if (visibility > 1)
01376         {
01377                 fprintf (stderr,
01378                   (_("Warning in %s () an out of range value was passed.\n")),
01379                   __FUNCTION__);
01380         }
01381         solid->visibility = visibility;
01382 #if DEBUG
01383         DXF_DEBUG_END
01384 #endif
01385         return (solid);
01386 }
01387 
01388 
01394 int
01395 dxf_solid_get_color
01396 (
01397         DxfSolid *solid
01399 )
01400 {
01401 #if DEBUG
01402         DXF_DEBUG_BEGIN
01403 #endif
01404         /* Do some basic checks. */
01405         if (solid == NULL)
01406         {
01407                 fprintf (stderr,
01408                   (_("Error in %s () a NULL pointer was passed.\n")),
01409                   __FUNCTION__);
01410                 return (EXIT_FAILURE);
01411         }
01412         if (solid->color < 0)
01413         {
01414                 fprintf (stderr,
01415                   (_("Warning in %s () a negative value was found.\n")),
01416                   __FUNCTION__);
01417         }
01418 #if DEBUG
01419         DXF_DEBUG_END
01420 #endif
01421         return (solid->color);
01422 }
01423 
01424 
01428 DxfSolid *
01429 dxf_solid_set_color
01430 (
01431         DxfSolid *solid,
01433         int color
01435 )
01436 {
01437 #if DEBUG
01438         DXF_DEBUG_BEGIN
01439 #endif
01440         /* Do some basic checks. */
01441         if (solid == NULL)
01442         {
01443                 fprintf (stderr,
01444                   (_("Error in %s () a NULL pointer was passed.\n")),
01445                   __FUNCTION__);
01446                 return (NULL);
01447         }
01448         if (color < 0)
01449         {
01450                 fprintf (stderr,
01451                   (_("Warning in %s () a negative value was passed.\n")),
01452                   __FUNCTION__);
01453         }
01454         solid->color = color;
01455 #if DEBUG
01456         DXF_DEBUG_END
01457 #endif
01458         return (solid);
01459 }
01460 
01461 
01467 int
01468 dxf_solid_get_paperspace
01469 (
01470         DxfSolid *solid
01472 )
01473 {
01474 #if DEBUG
01475         DXF_DEBUG_BEGIN
01476 #endif
01477         /* Do some basic checks. */
01478         if (solid == NULL)
01479         {
01480                 fprintf (stderr,
01481                   (_("Error in %s () a NULL pointer was passed.\n")),
01482                   __FUNCTION__);
01483                 return (EXIT_FAILURE);
01484         }
01485         if (solid->paperspace < 0)
01486         {
01487                 fprintf (stderr,
01488                   (_("Warning in %s () a negative value was found.\n")),
01489                   __FUNCTION__);
01490         }
01491         if (solid->paperspace > 1)
01492         {
01493                 fprintf (stderr,
01494                   (_("Warning in %s () an out of range value was found.\n")),
01495                   __FUNCTION__);
01496         }
01497 #if DEBUG
01498         DXF_DEBUG_END
01499 #endif
01500         return (solid->paperspace);
01501 }
01502 
01503 
01507 DxfSolid *
01508 dxf_solid_set_paperspace
01509 (
01510         DxfSolid *solid,
01512         int paperspace
01515 )
01516 {
01517 #if DEBUG
01518         DXF_DEBUG_BEGIN
01519 #endif
01520         /* Do some basic checks. */
01521         if (solid == NULL)
01522         {
01523                 fprintf (stderr,
01524                   (_("Error in %s () a NULL pointer was passed.\n")),
01525                   __FUNCTION__);
01526                 return (NULL);
01527         }
01528         if (paperspace < 0)
01529         {
01530                 fprintf (stderr,
01531                   (_("Warning in %s () a negative value was passed.\n")),
01532                   __FUNCTION__);
01533         }
01534         if (paperspace > 1)
01535         {
01536                 fprintf (stderr,
01537                   (_("Warning in %s () an out of range value was passed.\n")),
01538                   __FUNCTION__);
01539         }
01540         solid->paperspace = paperspace;
01541 #if DEBUG
01542         DXF_DEBUG_END
01543 #endif
01544         return (solid);
01545 }
01546 
01547 
01554 int
01555 dxf_solid_get_graphics_data_size
01556 (
01557         DxfSolid *solid
01559 )
01560 {
01561 #if DEBUG
01562         DXF_DEBUG_BEGIN
01563 #endif
01564         /* Do some basic checks. */
01565         if (solid == NULL)
01566         {
01567                 fprintf (stderr,
01568                   (_("Error in %s () a NULL pointer was passed.\n")),
01569                   __FUNCTION__);
01570                 return (EXIT_FAILURE);
01571         }
01572         if (solid->graphics_data_size < 0)
01573         {
01574                 fprintf (stderr,
01575                   (_("Warning in %s () a negative value was found.\n")),
01576                   __FUNCTION__);
01577         }
01578         if (solid->graphics_data_size == 0)
01579         {
01580                 fprintf (stderr,
01581                   (_("Warning in %s () a zero value was found.\n")),
01582                   __FUNCTION__);
01583         }
01584 #if DEBUG
01585         DXF_DEBUG_END
01586 #endif
01587         return (solid->graphics_data_size);
01588 }
01589 
01590 
01597 DxfSolid *
01598 dxf_solid_set_graphics_data_size
01599 (
01600         DxfSolid *solid,
01602         int graphics_data_size
01605 )
01606 {
01607 #if DEBUG
01608         DXF_DEBUG_BEGIN
01609 #endif
01610         /* Do some basic checks. */
01611         if (solid == NULL)
01612         {
01613                 fprintf (stderr,
01614                   (_("Error in %s () a NULL pointer was passed.\n")),
01615                   __FUNCTION__);
01616                 return (NULL);
01617         }
01618         if (graphics_data_size < 0)
01619         {
01620                 fprintf (stderr,
01621                   (_("Warning in %s () a negative value was passed.\n")),
01622                   __FUNCTION__);
01623         }
01624         if (graphics_data_size == 0)
01625         {
01626                 fprintf (stderr,
01627                   (_("Warning in %s () a zero value was passed.\n")),
01628                   __FUNCTION__);
01629         }
01630         solid->graphics_data_size = graphics_data_size;
01631 #if DEBUG
01632         DXF_DEBUG_END
01633 #endif
01634         return (solid);
01635 }
01636 
01637 
01644 int16_t
01645 dxf_solid_get_shadow_mode
01646 (
01647         DxfSolid *solid
01649 )
01650 {
01651 #if DEBUG
01652         DXF_DEBUG_BEGIN
01653 #endif
01654         /* Do some basic checks. */
01655         if (solid == NULL)
01656         {
01657                 fprintf (stderr,
01658                   (_("Error in %s () a NULL pointer was passed.\n")),
01659                   __FUNCTION__);
01660                 return (EXIT_FAILURE);
01661         }
01662         if (solid->shadow_mode < 0)
01663         {
01664                 fprintf (stderr,
01665                   (_("Warning in %s () a negative value was found.\n")),
01666                   __FUNCTION__);
01667         }
01668         if (solid->shadow_mode > 3)
01669         {
01670                 fprintf (stderr,
01671                   (_("Warning in %s () an out of range value was found.\n")),
01672                   __FUNCTION__);
01673         }
01674 #if DEBUG
01675         DXF_DEBUG_END
01676 #endif
01677         return (solid->shadow_mode);
01678 }
01679 
01680 
01687 DxfSolid *
01688 dxf_solid_set_shadow_mode
01689 (
01690         DxfSolid *solid,
01692         int16_t shadow_mode
01694 )
01695 {
01696 #if DEBUG
01697         DXF_DEBUG_BEGIN
01698 #endif
01699         /* Do some basic checks. */
01700         if (solid == NULL)
01701         {
01702                 fprintf (stderr,
01703                   (_("Error in %s () a NULL pointer was passed.\n")),
01704                   __FUNCTION__);
01705                 return (NULL);
01706         }
01707         if (shadow_mode < 0)
01708         {
01709                 fprintf (stderr,
01710                   (_("Warning in %s () a negative value was passed.\n")),
01711                   __FUNCTION__);
01712         }
01713         if (shadow_mode > 3)
01714         {
01715                 fprintf (stderr,
01716                   (_("Warning in %s () an out of range value was passed.\n")),
01717                   __FUNCTION__);
01718         }
01719         solid->shadow_mode = shadow_mode;
01720 #if DEBUG
01721         DXF_DEBUG_END
01722 #endif
01723         return (solid);
01724 }
01725 
01726 
01735 DxfBinaryGraphicsData *
01736 dxf_solid_get_binary_graphics_data
01737 (
01738         DxfSolid *solid
01740 )
01741 {
01742 #if DEBUG
01743         DXF_DEBUG_BEGIN
01744 #endif
01745         /* Do some basic checks. */
01746         if (solid == NULL)
01747         {
01748                 fprintf (stderr,
01749                   (_("Error in %s () a NULL pointer was passed.\n")),
01750                   __FUNCTION__);
01751                 return (NULL);
01752         }
01753         if (solid->binary_graphics_data ==  NULL)
01754         {
01755                 fprintf (stderr,
01756                   (_("Error in %s () a NULL pointer was found.\n")),
01757                   __FUNCTION__);
01758                 return (NULL);
01759         }
01760 #if DEBUG
01761         DXF_DEBUG_END
01762 #endif
01763         return ((DxfBinaryGraphicsData *) solid->binary_graphics_data);
01764 }
01765 
01766 
01771 DxfSolid *
01772 dxf_solid_set_binary_graphics_data
01773 (
01774         DxfSolid *solid,
01776         DxfBinaryGraphicsData *data
01779 )
01780 {
01781 #if DEBUG
01782         DXF_DEBUG_BEGIN
01783 #endif
01784         /* Do some basic checks. */
01785         if (solid == NULL)
01786         {
01787                 fprintf (stderr,
01788                   (_("Error in %s () a NULL pointer was passed.\n")),
01789                   __FUNCTION__);
01790                 return (NULL);
01791         }
01792         if (data == NULL)
01793         {
01794                 fprintf (stderr,
01795                   (_("Error in %s () a NULL pointer was passed.\n")),
01796                   __FUNCTION__);
01797                 return (NULL);
01798         }
01799         solid->binary_graphics_data = (DxfBinaryGraphicsData *) data;
01800 #if DEBUG
01801         DXF_DEBUG_END
01802 #endif
01803         return (solid);
01804 }
01805 
01806 
01815 char *
01816 dxf_solid_get_dictionary_owner_soft
01817 (
01818         DxfSolid *solid
01820 )
01821 {
01822 #if DEBUG
01823         DXF_DEBUG_BEGIN
01824 #endif
01825         /* Do some basic checks. */
01826         if (solid == NULL)
01827         {
01828                 fprintf (stderr,
01829                   (_("Error in %s () a NULL pointer was passed.\n")),
01830                   __FUNCTION__);
01831                 return (NULL);
01832         }
01833         if (solid->dictionary_owner_soft ==  NULL)
01834         {
01835                 fprintf (stderr,
01836                   (_("Error in %s () a NULL pointer was found.\n")),
01837                   __FUNCTION__);
01838                 return (NULL);
01839         }
01840 #if DEBUG
01841         DXF_DEBUG_END
01842 #endif
01843         return (strdup (solid->dictionary_owner_soft));
01844 }
01845 
01846 
01851 DxfSolid *
01852 dxf_solid_set_dictionary_owner_soft
01853 (
01854         DxfSolid *solid,
01856         char *dictionary_owner_soft
01859 )
01860 {
01861 #if DEBUG
01862         DXF_DEBUG_BEGIN
01863 #endif
01864         /* Do some basic checks. */
01865         if (solid == NULL)
01866         {
01867                 fprintf (stderr,
01868                   (_("Error in %s () a NULL pointer was passed.\n")),
01869                   __FUNCTION__);
01870                 return (NULL);
01871         }
01872         if (dictionary_owner_soft == NULL)
01873         {
01874                 fprintf (stderr,
01875                   (_("Error in %s () a NULL pointer was passed.\n")),
01876                   __FUNCTION__);
01877                 return (NULL);
01878         }
01879         solid->dictionary_owner_soft = strdup (dictionary_owner_soft);
01880 #if DEBUG
01881         DXF_DEBUG_END
01882 #endif
01883         return (solid);
01884 }
01885 
01886 
01895 char *
01896 dxf_solid_get_material
01897 (
01898         DxfSolid *solid
01900 )
01901 {
01902 #if DEBUG
01903         DXF_DEBUG_BEGIN
01904 #endif
01905         /* Do some basic checks. */
01906         if (solid == NULL)
01907         {
01908                 fprintf (stderr,
01909                   (_("Error in %s () a NULL pointer was passed.\n")),
01910                   __FUNCTION__);
01911                 return (NULL);
01912         }
01913         if (solid->material ==  NULL)
01914         {
01915                 fprintf (stderr,
01916                   (_("Error in %s () a NULL pointer was found.\n")),
01917                   __FUNCTION__);
01918                 return (NULL);
01919         }
01920 #if DEBUG
01921         DXF_DEBUG_END
01922 #endif
01923         return (strdup (solid->material));
01924 }
01925 
01926 
01933 DxfSolid *
01934 dxf_solid_set_material
01935 (
01936         DxfSolid *solid,
01938         char *material
01941 )
01942 {
01943 #if DEBUG
01944         DXF_DEBUG_BEGIN
01945 #endif
01946         /* Do some basic checks. */
01947         if (solid == NULL)
01948         {
01949                 fprintf (stderr,
01950                   (_("Error in %s () a NULL pointer was passed.\n")),
01951                   __FUNCTION__);
01952                 return (NULL);
01953         }
01954         if (material == NULL)
01955         {
01956                 fprintf (stderr,
01957                   (_("Error in %s () a NULL pointer was passed.\n")),
01958                   __FUNCTION__);
01959                 return (NULL);
01960         }
01961         solid->material = strdup (material);
01962 #if DEBUG
01963         DXF_DEBUG_END
01964 #endif
01965         return (solid);
01966 }
01967 
01968 
01977 char *
01978 dxf_solid_get_dictionary_owner_hard
01979 (
01980         DxfSolid *solid
01982 )
01983 {
01984 #if DEBUG
01985         DXF_DEBUG_BEGIN
01986 #endif
01987         /* Do some basic checks. */
01988         if (solid == NULL)
01989         {
01990                 fprintf (stderr,
01991                   (_("Error in %s () a NULL pointer was passed.\n")),
01992                   __FUNCTION__);
01993                 return (NULL);
01994         }
01995         if (solid->dictionary_owner_hard ==  NULL)
01996         {
01997                 fprintf (stderr,
01998                   (_("Error in %s () a NULL pointer was found.\n")),
01999                   __FUNCTION__);
02000                 return (NULL);
02001         }
02002 #if DEBUG
02003         DXF_DEBUG_END
02004 #endif
02005         return (strdup (solid->dictionary_owner_hard));
02006 }
02007 
02008 
02013 DxfSolid *
02014 dxf_solid_set_dictionary_owner_hard
02015 (
02016         DxfSolid *solid,
02018         char *dictionary_owner_hard
02021 )
02022 {
02023 #if DEBUG
02024         DXF_DEBUG_BEGIN
02025 #endif
02026         /* Do some basic checks. */
02027         if (solid == NULL)
02028         {
02029                 fprintf (stderr,
02030                   (_("Error in %s () a NULL pointer was passed.\n")),
02031                   __FUNCTION__);
02032                 return (NULL);
02033         }
02034         if (dictionary_owner_hard == NULL)
02035         {
02036                 fprintf (stderr,
02037                   (_("Error in %s () a NULL pointer was passed.\n")),
02038                   __FUNCTION__);
02039                 return (NULL);
02040         }
02041         solid->dictionary_owner_hard = strdup (dictionary_owner_hard);
02042 #if DEBUG
02043         DXF_DEBUG_END
02044 #endif
02045         return (solid);
02046 }
02047 
02048 
02055 int16_t
02056 dxf_solid_get_lineweight
02057 (
02058         DxfSolid *solid
02060 )
02061 {
02062 #if DEBUG
02063         DXF_DEBUG_BEGIN
02064 #endif
02065         /* Do some basic checks. */
02066         if (solid == NULL)
02067         {
02068                 fprintf (stderr,
02069                   (_("Error in %s () a NULL pointer was passed.\n")),
02070                   __FUNCTION__);
02071                 return (EXIT_FAILURE);
02072         }
02073 #if DEBUG
02074         DXF_DEBUG_END
02075 #endif
02076         return (solid->lineweight);
02077 }
02078 
02079 
02086 DxfSolid *
02087 dxf_solid_set_lineweight
02088 (
02089         DxfSolid *solid,
02091         int16_t lineweight
02093 )
02094 {
02095 #if DEBUG
02096         DXF_DEBUG_BEGIN
02097 #endif
02098         /* Do some basic checks. */
02099         if (solid == NULL)
02100         {
02101                 fprintf (stderr,
02102                   (_("Error in %s () a NULL pointer was passed.\n")),
02103                   __FUNCTION__);
02104                 return (NULL);
02105         }
02106         solid->lineweight = lineweight;
02107 #if DEBUG
02108         DXF_DEBUG_END
02109 #endif
02110         return (solid);
02111 }
02112 
02113 
02120 char *
02121 dxf_solid_get_plot_style_name
02122 (
02123         DxfSolid *solid
02125 )
02126 {
02127 #if DEBUG
02128         DXF_DEBUG_BEGIN
02129 #endif
02130         /* Do some basic checks. */
02131         if (solid == NULL)
02132         {
02133                 fprintf (stderr,
02134                   (_("Error in %s () a NULL pointer was passed.\n")),
02135                   __FUNCTION__);
02136                 return (NULL);
02137         }
02138         if (solid->plot_style_name ==  NULL)
02139         {
02140                 fprintf (stderr,
02141                   (_("Error in %s () a NULL pointer was found.\n")),
02142                   __FUNCTION__);
02143                 return (NULL);
02144         }
02145 #if DEBUG
02146         DXF_DEBUG_END
02147 #endif
02148         return (strdup (solid->plot_style_name));
02149 }
02150 
02151 
02158 DxfSolid *
02159 dxf_solid_set_plot_style_name
02160 (
02161         DxfSolid *solid,
02163         char *plot_style_name
02166 )
02167 {
02168 #if DEBUG
02169         DXF_DEBUG_BEGIN
02170 #endif
02171         /* Do some basic checks. */
02172         if (solid == NULL)
02173         {
02174                 fprintf (stderr,
02175                   (_("Error in %s () a NULL pointer was passed.\n")),
02176                   __FUNCTION__);
02177                 return (NULL);
02178         }
02179         if (plot_style_name == NULL)
02180         {
02181                 fprintf (stderr,
02182                   (_("Error in %s () a NULL pointer was passed.\n")),
02183                   __FUNCTION__);
02184                 return (NULL);
02185         }
02186         solid->plot_style_name = strdup (plot_style_name);
02187 #if DEBUG
02188         DXF_DEBUG_END
02189 #endif
02190         return (solid);
02191 }
02192 
02193 
02200 long
02201 dxf_solid_get_color_value
02202 (
02203         DxfSolid *solid
02205 )
02206 {
02207 #if DEBUG
02208         DXF_DEBUG_BEGIN
02209 #endif
02210         /* Do some basic checks. */
02211         if (solid == NULL)
02212         {
02213                 fprintf (stderr,
02214                   (_("Error in %s () a NULL pointer was passed.\n")),
02215                   __FUNCTION__);
02216                 return (EXIT_FAILURE);
02217         }
02218 #if DEBUG
02219         DXF_DEBUG_END
02220 #endif
02221         return (solid->color_value);
02222 }
02223 
02224 
02231 DxfSolid *
02232 dxf_solid_set_color_value
02233 (
02234         DxfSolid *solid,
02236         long color_value
02238 )
02239 {
02240 #if DEBUG
02241         DXF_DEBUG_BEGIN
02242 #endif
02243         /* Do some basic checks. */
02244         if (solid == NULL)
02245         {
02246                 fprintf (stderr,
02247                   (_("Error in %s () a NULL pointer was passed.\n")),
02248                   __FUNCTION__);
02249                 return (NULL);
02250         }
02251         solid->color_value = color_value;
02252 #if DEBUG
02253         DXF_DEBUG_END
02254 #endif
02255         return (solid);
02256 }
02257 
02258 
02265 char *
02266 dxf_solid_get_color_name
02267 (
02268         DxfSolid *solid
02270 )
02271 {
02272 #if DEBUG
02273         DXF_DEBUG_BEGIN
02274 #endif
02275         /* Do some basic checks. */
02276         if (solid == NULL)
02277         {
02278                 fprintf (stderr,
02279                   (_("Error in %s () a NULL pointer was passed.\n")),
02280                   __FUNCTION__);
02281                 return (NULL);
02282         }
02283         if (solid->color_name ==  NULL)
02284         {
02285                 fprintf (stderr,
02286                   (_("Error in %s () a NULL pointer was found.\n")),
02287                   __FUNCTION__);
02288                 return (NULL);
02289         }
02290 #if DEBUG
02291         DXF_DEBUG_END
02292 #endif
02293         return (strdup (solid->color_name));
02294 }
02295 
02296 
02303 DxfSolid *
02304 dxf_solid_set_color_name
02305 (
02306         DxfSolid *solid,
02308         char *color_name
02311 )
02312 {
02313 #if DEBUG
02314         DXF_DEBUG_BEGIN
02315 #endif
02316         /* Do some basic checks. */
02317         if (solid == NULL)
02318         {
02319                 fprintf (stderr,
02320                   (_("Error in %s () a NULL pointer was passed.\n")),
02321                   __FUNCTION__);
02322                 return (NULL);
02323         }
02324         if (color_name == NULL)
02325         {
02326                 fprintf (stderr,
02327                   (_("Error in %s () a NULL pointer was passed.\n")),
02328                   __FUNCTION__);
02329                 return (NULL);
02330         }
02331         solid->color_name = strdup (color_name);
02332 #if DEBUG
02333         DXF_DEBUG_END
02334 #endif
02335         return (solid);
02336 }
02337 
02338 
02345 long
02346 dxf_solid_get_transparency
02347 (
02348         DxfSolid *solid
02350 )
02351 {
02352 #if DEBUG
02353         DXF_DEBUG_BEGIN
02354 #endif
02355         /* Do some basic checks. */
02356         if (solid == NULL)
02357         {
02358                 fprintf (stderr,
02359                   (_("Error in %s () a NULL pointer was passed.\n")),
02360                   __FUNCTION__);
02361                 return (EXIT_FAILURE);
02362         }
02363 #if DEBUG
02364         DXF_DEBUG_END
02365 #endif
02366         return (solid->transparency);
02367 }
02368 
02369 
02376 DxfSolid *
02377 dxf_solid_set_transparency
02378 (
02379         DxfSolid *solid,
02381         long transparency
02383 )
02384 {
02385 #if DEBUG
02386         DXF_DEBUG_BEGIN
02387 #endif
02388         /* Do some basic checks. */
02389         if (solid == NULL)
02390         {
02391                 fprintf (stderr,
02392                   (_("Error in %s () a NULL pointer was passed.\n")),
02393                   __FUNCTION__);
02394                 return (NULL);
02395         }
02396         solid->transparency = transparency;
02397 #if DEBUG
02398         DXF_DEBUG_END
02399 #endif
02400         return (solid);
02401 }
02402 
02403 
02409 DxfPoint *
02410 dxf_solid_get_p0
02411 (
02412         DxfSolid *solid
02414 )
02415 {
02416 #ifdef DEBUG
02417         DXF_DEBUG_BEGIN
02418 #endif
02419         /* Do some basic checks. */
02420         if (solid == NULL)
02421         {
02422                 fprintf (stderr,
02423                   (_("Error in %s () a NULL pointer was passed.\n")),
02424                   __FUNCTION__);
02425                 return (NULL);
02426         }
02427         if (solid->p0 == NULL)
02428         {
02429                 fprintf (stderr,
02430                   (_("Error in %s () a NULL pointer was found.\n")),
02431                   __FUNCTION__);
02432                 return (NULL);
02433         }
02434 #if DEBUG
02435         DXF_DEBUG_END
02436 #endif
02437         return (solid->p0);
02438 }
02439 
02440 
02446 DxfSolid *
02447 dxf_solid_set_p0
02448 (
02449         DxfSolid *solid,
02451         DxfPoint *p0
02453 )
02454 {
02455 #ifdef DEBUG
02456         DXF_DEBUG_BEGIN
02457 #endif
02458         /* Do some basic checks. */
02459         if (solid == NULL)
02460         {
02461                 fprintf (stderr,
02462                   (_("Error in %s () a NULL pointer was passed.\n")),
02463                   __FUNCTION__);
02464                 return (NULL);
02465         }
02466         if (p0 == NULL)
02467         {
02468                 fprintf (stderr,
02469                   (_("Error in %s () a NULL pointer was passed.\n")),
02470                   __FUNCTION__);
02471                 return (NULL);
02472         }
02473         solid->p0 = p0;
02474 #if DEBUG
02475         DXF_DEBUG_END
02476 #endif
02477         return (solid);
02478 }
02479 
02480 
02487 double
02488 dxf_solid_get_x0
02489 (
02490         DxfSolid *solid
02492 )
02493 {
02494 #ifdef DEBUG
02495         DXF_DEBUG_BEGIN
02496 #endif
02497 
02498         /* Do some basic checks. */
02499         if (solid == NULL)
02500         {
02501                 fprintf (stderr,
02502                   (_("Error in %s () a NULL pointer was passed.\n")),
02503                   __FUNCTION__);
02504                 return (EXIT_FAILURE);
02505         }
02506         if (solid->p0 == NULL)
02507         {
02508                 fprintf (stderr,
02509                   (_("Error in %s () a NULL pointer was found.\n")),
02510                   __FUNCTION__);
02511                 return (EXIT_FAILURE);
02512         }
02513 #if DEBUG
02514         DXF_DEBUG_END
02515 #endif
02516         return (solid->p0->x0);
02517 }
02518 
02519 
02527 DxfSolid *
02528 dxf_solid_set_x0
02529 (
02530         DxfSolid *solid,
02532         double x0
02535 )
02536 {
02537 #ifdef DEBUG
02538         DXF_DEBUG_BEGIN
02539 #endif
02540         /* Do some basic checks. */
02541         if (solid == NULL)
02542         {
02543                 fprintf (stderr,
02544                   (_("Error in %s () a NULL pointer was passed.\n")),
02545                   __FUNCTION__);
02546                 return (NULL);
02547         }
02548         if (solid->p0 == NULL)
02549         {
02550                 fprintf (stderr,
02551                   (_("Error in %s () a NULL pointer was found.\n")),
02552                   __FUNCTION__);
02553                 return (NULL);
02554         }
02555         solid->p0->x0 = x0;
02556 #if DEBUG
02557         DXF_DEBUG_END
02558 #endif
02559         return (solid);
02560 }
02561 
02562 
02569 double
02570 dxf_solid_get_y0
02571 (
02572         DxfSolid *solid
02574 )
02575 {
02576 #ifdef DEBUG
02577         DXF_DEBUG_BEGIN
02578 #endif
02579 
02580         /* Do some basic checks. */
02581         if (solid == NULL)
02582         {
02583                 fprintf (stderr,
02584                   (_("Error in %s () a NULL pointer was passed.\n")),
02585                   __FUNCTION__);
02586                 return (EXIT_FAILURE);
02587         }
02588         if (solid->p0 == NULL)
02589         {
02590                 fprintf (stderr,
02591                   (_("Error in %s () a NULL pointer was found.\n")),
02592                   __FUNCTION__);
02593                 return (EXIT_FAILURE);
02594         }
02595 #if DEBUG
02596         DXF_DEBUG_END
02597 #endif
02598         return (solid->p0->y0);
02599 }
02600 
02601 
02609 DxfSolid *
02610 dxf_solid_set_y0
02611 (
02612         DxfSolid *solid,
02614         double y0
02617 )
02618 {
02619 #ifdef DEBUG
02620         DXF_DEBUG_BEGIN
02621 #endif
02622         /* Do some basic checks. */
02623         if (solid == NULL)
02624         {
02625                 fprintf (stderr,
02626                   (_("Error in %s () a NULL pointer was passed.\n")),
02627                   __FUNCTION__);
02628                 return (NULL);
02629         }
02630         if (solid->p0 == NULL)
02631         {
02632                 fprintf (stderr,
02633                   (_("Error in %s () a NULL pointer was found.\n")),
02634                   __FUNCTION__);
02635                 return (NULL);
02636         }
02637         solid->p0->y0 = y0;
02638 #if DEBUG
02639         DXF_DEBUG_END
02640 #endif
02641         return (solid);
02642 }
02643 
02644 
02651 double
02652 dxf_solid_get_z0
02653 (
02654         DxfSolid *solid
02656 )
02657 {
02658 #ifdef DEBUG
02659         DXF_DEBUG_BEGIN
02660 #endif
02661 
02662         /* Do some basic checks. */
02663         if (solid == NULL)
02664         {
02665                 fprintf (stderr,
02666                   (_("Error in %s () a NULL pointer was passed.\n")),
02667                   __FUNCTION__);
02668                 return (EXIT_FAILURE);
02669         }
02670         if (solid->p0 == NULL)
02671         {
02672                 fprintf (stderr,
02673                   (_("Error in %s () a NULL pointer was found.\n")),
02674                   __FUNCTION__);
02675                 return (EXIT_FAILURE);
02676         }
02677 #if DEBUG
02678         DXF_DEBUG_END
02679 #endif
02680         return (solid->p0->z0);
02681 }
02682 
02683 
02691 DxfSolid *
02692 dxf_solid_set_z0
02693 (
02694         DxfSolid *solid,
02696         double z0
02699 )
02700 {
02701 #ifdef DEBUG
02702         DXF_DEBUG_BEGIN
02703 #endif
02704         /* Do some basic checks. */
02705         if (solid == NULL)
02706         {
02707                 fprintf (stderr,
02708                   (_("Error in %s () a NULL pointer was passed.\n")),
02709                   __FUNCTION__);
02710                 return (NULL);
02711         }
02712         if (solid->p0 == NULL)
02713         {
02714                 fprintf (stderr,
02715                   (_("Error in %s () a NULL pointer was found.\n")),
02716                   __FUNCTION__);
02717                 return (NULL);
02718         }
02719         solid->p0->z0 = z0;
02720 #if DEBUG
02721         DXF_DEBUG_END
02722 #endif
02723         return (solid);
02724 }
02725 
02726 
02732 DxfPoint *
02733 dxf_solid_get_p1
02734 (
02735         DxfSolid *solid
02737 )
02738 {
02739 #ifdef DEBUG
02740         DXF_DEBUG_BEGIN
02741 #endif
02742         /* Do some basic checks. */
02743         if (solid == NULL)
02744         {
02745                 fprintf (stderr,
02746                   (_("Error in %s () a NULL pointer was passed.\n")),
02747                   __FUNCTION__);
02748                 return (NULL);
02749         }
02750         if (solid->p1 == NULL)
02751         {
02752                 fprintf (stderr,
02753                   (_("Error in %s () a NULL pointer was found.\n")),
02754                   __FUNCTION__);
02755                 return (NULL);
02756         }
02757 #if DEBUG
02758         DXF_DEBUG_END
02759 #endif
02760         return (solid->p1);
02761 }
02762 
02763 
02769 DxfSolid *
02770 dxf_solid_set_p1
02771 (
02772         DxfSolid *solid,
02774         DxfPoint *p1
02776 )
02777 {
02778 #ifdef DEBUG
02779         DXF_DEBUG_BEGIN
02780 #endif
02781         /* Do some basic checks. */
02782         if (solid == NULL)
02783         {
02784                 fprintf (stderr,
02785                   (_("Error in %s () a NULL pointer was passed.\n")),
02786                   __FUNCTION__);
02787                 return (NULL);
02788         }
02789         if (p1 == NULL)
02790         {
02791                 fprintf (stderr,
02792                   (_("Error in %s () a NULL pointer was passed.\n")),
02793                   __FUNCTION__);
02794                 return (NULL);
02795         }
02796         solid->p1 = p1;
02797 #if DEBUG
02798         DXF_DEBUG_END
02799 #endif
02800         return (solid);
02801 }
02802 
02803 
02810 double
02811 dxf_solid_get_x1
02812 (
02813         DxfSolid *solid
02815 )
02816 {
02817 #ifdef DEBUG
02818         DXF_DEBUG_BEGIN
02819 #endif
02820 
02821         /* Do some basic checks. */
02822         if (solid == NULL)
02823         {
02824                 fprintf (stderr,
02825                   (_("Error in %s () a NULL pointer was passed.\n")),
02826                   __FUNCTION__);
02827                 return (EXIT_FAILURE);
02828         }
02829         if (solid->p1 == NULL)
02830         {
02831                 fprintf (stderr,
02832                   (_("Error in %s () a NULL pointer was found.\n")),
02833                   __FUNCTION__);
02834                 return (EXIT_FAILURE);
02835         }
02836 #if DEBUG
02837         DXF_DEBUG_END
02838 #endif
02839         return (solid->p1->x0);
02840 }
02841 
02842 
02850 DxfSolid *
02851 dxf_solid_set_x1
02852 (
02853         DxfSolid *solid,
02855         double x1
02858 )
02859 {
02860 #ifdef DEBUG
02861         DXF_DEBUG_BEGIN
02862 #endif
02863         /* Do some basic checks. */
02864         if (solid == NULL)
02865         {
02866                 fprintf (stderr,
02867                   (_("Error in %s () a NULL pointer was passed.\n")),
02868                   __FUNCTION__);
02869                 return (NULL);
02870         }
02871         if (solid->p1 == NULL)
02872         {
02873                 fprintf (stderr,
02874                   (_("Error in %s () a NULL pointer was found.\n")),
02875                   __FUNCTION__);
02876                 return (NULL);
02877         }
02878         solid->p1->x0 = x1;
02879 #if DEBUG
02880         DXF_DEBUG_END
02881 #endif
02882         return (solid);
02883 }
02884 
02885 
02892 double
02893 dxf_solid_get_y1
02894 (
02895         DxfSolid *solid
02897 )
02898 {
02899 #ifdef DEBUG
02900         DXF_DEBUG_BEGIN
02901 #endif
02902 
02903         /* Do some basic checks. */
02904         if (solid == NULL)
02905         {
02906                 fprintf (stderr,
02907                   (_("Error in %s () a NULL pointer was passed.\n")),
02908                   __FUNCTION__);
02909                 return (EXIT_FAILURE);
02910         }
02911         if (solid->p1 == NULL)
02912         {
02913                 fprintf (stderr,
02914                   (_("Error in %s () a NULL pointer was found.\n")),
02915                   __FUNCTION__);
02916                 return (EXIT_FAILURE);
02917         }
02918 #if DEBUG
02919         DXF_DEBUG_END
02920 #endif
02921         return (solid->p1->y0);
02922 }
02923 
02924 
02932 DxfSolid *
02933 dxf_solid_set_y1
02934 (
02935         DxfSolid *solid,
02937         double y1
02940 )
02941 {
02942 #ifdef DEBUG
02943         DXF_DEBUG_BEGIN
02944 #endif
02945         /* Do some basic checks. */
02946         if (solid == NULL)
02947         {
02948                 fprintf (stderr,
02949                   (_("Error in %s () a NULL pointer was passed.\n")),
02950                   __FUNCTION__);
02951                 return (NULL);
02952         }
02953         if (solid->p1 == NULL)
02954         {
02955                 fprintf (stderr,
02956                   (_("Error in %s () a NULL pointer was found.\n")),
02957                   __FUNCTION__);
02958                 return (NULL);
02959         }
02960         solid->p1->y0 = y1;
02961 #if DEBUG
02962         DXF_DEBUG_END
02963 #endif
02964         return (solid);
02965 }
02966 
02967 
02974 double
02975 dxf_solid_get_z1
02976 (
02977         DxfSolid *solid
02979 )
02980 {
02981 #ifdef DEBUG
02982         DXF_DEBUG_BEGIN
02983 #endif
02984 
02985         /* Do some basic checks. */
02986         if (solid == NULL)
02987         {
02988                 fprintf (stderr,
02989                   (_("Error in %s () a NULL pointer was passed.\n")),
02990                   __FUNCTION__);
02991                 return (EXIT_FAILURE);
02992         }
02993         if (solid->p1 == NULL)
02994         {
02995                 fprintf (stderr,
02996                   (_("Error in %s () a NULL pointer was found.\n")),
02997                   __FUNCTION__);
02998                 return (EXIT_FAILURE);
02999         }
03000 #if DEBUG
03001         DXF_DEBUG_END
03002 #endif
03003         return (solid->p1->z0);
03004 }
03005 
03006 
03014 DxfSolid *
03015 dxf_solid_set_z1
03016 (
03017         DxfSolid *solid,
03019         double z1
03022 )
03023 {
03024 #ifdef DEBUG
03025         DXF_DEBUG_BEGIN
03026 #endif
03027         /* Do some basic checks. */
03028         if (solid == NULL)
03029         {
03030                 fprintf (stderr,
03031                   (_("Error in %s () a NULL pointer was passed.\n")),
03032                   __FUNCTION__);
03033                 return (NULL);
03034         }
03035         if (solid->p1 == NULL)
03036         {
03037                 fprintf (stderr,
03038                   (_("Error in %s () a NULL pointer was found.\n")),
03039                   __FUNCTION__);
03040                 return (NULL);
03041         }
03042         solid->p1->z0 = z1;
03043 #if DEBUG
03044         DXF_DEBUG_END
03045 #endif
03046         return (solid);
03047 }
03048 
03049 
03055 DxfPoint *
03056 dxf_solid_get_p2
03057 (
03058         DxfSolid *solid
03060 )
03061 {
03062 #ifdef DEBUG
03063         DXF_DEBUG_BEGIN
03064 #endif
03065         /* Do some basic checks. */
03066         if (solid == NULL)
03067         {
03068                 fprintf (stderr,
03069                   (_("Error in %s () a NULL pointer was passed.\n")),
03070                   __FUNCTION__);
03071                 return (NULL);
03072         }
03073         if (solid->p2 == NULL)
03074         {
03075                 fprintf (stderr,
03076                   (_("Error in %s () a NULL pointer was found.\n")),
03077                   __FUNCTION__);
03078                 return (NULL);
03079         }
03080 #if DEBUG
03081         DXF_DEBUG_END
03082 #endif
03083         return (solid->p2);
03084 }
03085 
03086 
03092 DxfSolid *
03093 dxf_solid_set_p2
03094 (
03095         DxfSolid *solid,
03097         DxfPoint *p2
03099 )
03100 {
03101 #ifdef DEBUG
03102         DXF_DEBUG_BEGIN
03103 #endif
03104         /* Do some basic checks. */
03105         if (solid == NULL)
03106         {
03107                 fprintf (stderr,
03108                   (_("Error in %s () a NULL pointer was passed.\n")),
03109                   __FUNCTION__);
03110                 return (NULL);
03111         }
03112         if (p2 == NULL)
03113         {
03114                 fprintf (stderr,
03115                   (_("Error in %s () a NULL pointer was passed.\n")),
03116                   __FUNCTION__);
03117                 return (NULL);
03118         }
03119         solid->p2 = p2;
03120 #if DEBUG
03121         DXF_DEBUG_END
03122 #endif
03123         return (solid);
03124 }
03125 
03126 
03133 double
03134 dxf_solid_get_x2
03135 (
03136         DxfSolid *solid
03138 )
03139 {
03140 #ifdef DEBUG
03141         DXF_DEBUG_BEGIN
03142 #endif
03143 
03144         /* Do some basic checks. */
03145         if (solid == NULL)
03146         {
03147                 fprintf (stderr,
03148                   (_("Error in %s () a NULL pointer was passed.\n")),
03149                   __FUNCTION__);
03150                 return (EXIT_FAILURE);
03151         }
03152         if (solid->p2 == NULL)
03153         {
03154                 fprintf (stderr,
03155                   (_("Error in %s () a NULL pointer was found.\n")),
03156                   __FUNCTION__);
03157                 return (EXIT_FAILURE);
03158         }
03159 #if DEBUG
03160         DXF_DEBUG_END
03161 #endif
03162         return (solid->p2->x0);
03163 }
03164 
03165 
03173 DxfSolid *
03174 dxf_solid_set_x2
03175 (
03176         DxfSolid *solid,
03178         double x2
03181 )
03182 {
03183 #ifdef DEBUG
03184         DXF_DEBUG_BEGIN
03185 #endif
03186         /* Do some basic checks. */
03187         if (solid == NULL)
03188         {
03189                 fprintf (stderr,
03190                   (_("Error in %s () a NULL pointer was passed.\n")),
03191                   __FUNCTION__);
03192                 return (NULL);
03193         }
03194         if (solid->p2 == NULL)
03195         {
03196                 fprintf (stderr,
03197                   (_("Error in %s () a NULL pointer was found.\n")),
03198                   __FUNCTION__);
03199                 return (NULL);
03200         }
03201         solid->p2->x0 = x2;
03202 #if DEBUG
03203         DXF_DEBUG_END
03204 #endif
03205         return (solid);
03206 }
03207 
03208 
03215 double
03216 dxf_solid_get_y2
03217 (
03218         DxfSolid *solid
03220 )
03221 {
03222 #ifdef DEBUG
03223         DXF_DEBUG_BEGIN
03224 #endif
03225 
03226         /* Do some basic checks. */
03227         if (solid == NULL)
03228         {
03229                 fprintf (stderr,
03230                   (_("Error in %s () a NULL pointer was passed.\n")),
03231                   __FUNCTION__);
03232                 return (EXIT_FAILURE);
03233         }
03234         if (solid->p2 == NULL)
03235         {
03236                 fprintf (stderr,
03237                   (_("Error in %s () a NULL pointer was found.\n")),
03238                   __FUNCTION__);
03239                 return (EXIT_FAILURE);
03240         }
03241 #if DEBUG
03242         DXF_DEBUG_END
03243 #endif
03244         return (solid->p2->y0);
03245 }
03246 
03247 
03255 DxfSolid *
03256 dxf_solid_set_y2
03257 (
03258         DxfSolid *solid,
03260         double y2
03263 )
03264 {
03265 #ifdef DEBUG
03266         DXF_DEBUG_BEGIN
03267 #endif
03268         /* Do some basic checks. */
03269         if (solid == NULL)
03270         {
03271                 fprintf (stderr,
03272                   (_("Error in %s () a NULL pointer was passed.\n")),
03273                   __FUNCTION__);
03274                 return (NULL);
03275         }
03276         if (solid->p2 == NULL)
03277         {
03278                 fprintf (stderr,
03279                   (_("Error in %s () a NULL pointer was found.\n")),
03280                   __FUNCTION__);
03281                 return (NULL);
03282         }
03283         solid->p2->y0 = y2;
03284 #if DEBUG
03285         DXF_DEBUG_END
03286 #endif
03287         return (solid);
03288 }
03289 
03290 
03297 double
03298 dxf_solid_get_z2
03299 (
03300         DxfSolid *solid
03302 )
03303 {
03304 #ifdef DEBUG
03305         DXF_DEBUG_BEGIN
03306 #endif
03307 
03308         /* Do some basic checks. */
03309         if (solid == NULL)
03310         {
03311                 fprintf (stderr,
03312                   (_("Error in %s () a NULL pointer was passed.\n")),
03313                   __FUNCTION__);
03314                 return (EXIT_FAILURE);
03315         }
03316         if (solid->p2 == NULL)
03317         {
03318                 fprintf (stderr,
03319                   (_("Error in %s () a NULL pointer was found.\n")),
03320                   __FUNCTION__);
03321                 return (EXIT_FAILURE);
03322         }
03323 #if DEBUG
03324         DXF_DEBUG_END
03325 #endif
03326         return (solid->p2->z0);
03327 }
03328 
03329 
03337 DxfSolid *
03338 dxf_solid_set_z2
03339 (
03340         DxfSolid *solid,
03342         double z2
03345 )
03346 {
03347 #ifdef DEBUG
03348         DXF_DEBUG_BEGIN
03349 #endif
03350         /* Do some basic checks. */
03351         if (solid == NULL)
03352         {
03353                 fprintf (stderr,
03354                   (_("Error in %s () a NULL pointer was passed.\n")),
03355                   __FUNCTION__);
03356                 return (NULL);
03357         }
03358         if (solid->p2 == NULL)
03359         {
03360                 fprintf (stderr,
03361                   (_("Error in %s () a NULL pointer was found.\n")),
03362                   __FUNCTION__);
03363                 return (NULL);
03364         }
03365         solid->p2->z0 = z2;
03366 #if DEBUG
03367         DXF_DEBUG_END
03368 #endif
03369         return (solid);
03370 }
03371 
03372 
03378 DxfPoint *
03379 dxf_solid_get_p3
03380 (
03381         DxfSolid *solid
03383 )
03384 {
03385 #ifdef DEBUG
03386         DXF_DEBUG_BEGIN
03387 #endif
03388         /* Do some basic checks. */
03389         if (solid == NULL)
03390         {
03391                 fprintf (stderr,
03392                   (_("Error in %s () a NULL pointer was passed.\n")),
03393                   __FUNCTION__);
03394                 return (NULL);
03395         }
03396         if (solid->p3 == NULL)
03397         {
03398                 fprintf (stderr,
03399                   (_("Error in %s () a NULL pointer was found.\n")),
03400                   __FUNCTION__);
03401                 return (NULL);
03402         }
03403 #if DEBUG
03404         DXF_DEBUG_END
03405 #endif
03406         return (solid->p3);
03407 }
03408 
03409 
03415 DxfSolid *
03416 dxf_solid_set_p3
03417 (
03418         DxfSolid *solid,
03420         DxfPoint *p3
03422 )
03423 {
03424 #ifdef DEBUG
03425         DXF_DEBUG_BEGIN
03426 #endif
03427         /* Do some basic checks. */
03428         if (solid == NULL)
03429         {
03430                 fprintf (stderr,
03431                   (_("Error in %s () a NULL pointer was passed.\n")),
03432                   __FUNCTION__);
03433                 return (NULL);
03434         }
03435         if (p3 == NULL)
03436         {
03437                 fprintf (stderr,
03438                   (_("Error in %s () a NULL pointer was passed.\n")),
03439                   __FUNCTION__);
03440                 return (NULL);
03441         }
03442         solid->p3 = p3;
03443 #if DEBUG
03444         DXF_DEBUG_END
03445 #endif
03446         return (solid);
03447 }
03448 
03449 
03456 double
03457 dxf_solid_get_x3
03458 (
03459         DxfSolid *solid
03461 )
03462 {
03463 #ifdef DEBUG
03464         DXF_DEBUG_BEGIN
03465 #endif
03466 
03467         /* Do some basic checks. */
03468         if (solid == NULL)
03469         {
03470                 fprintf (stderr,
03471                   (_("Error in %s () a NULL pointer was passed.\n")),
03472                   __FUNCTION__);
03473                 return (EXIT_FAILURE);
03474         }
03475         if (solid->p3 == NULL)
03476         {
03477                 fprintf (stderr,
03478                   (_("Error in %s () a NULL pointer was found.\n")),
03479                   __FUNCTION__);
03480                 return (EXIT_FAILURE);
03481         }
03482 #if DEBUG
03483         DXF_DEBUG_END
03484 #endif
03485         return (solid->p3->x0);
03486 }
03487 
03488 
03496 DxfSolid *
03497 dxf_solid_set_x3
03498 (
03499         DxfSolid *solid,
03501         double x3
03504 )
03505 {
03506 #ifdef DEBUG
03507         DXF_DEBUG_BEGIN
03508 #endif
03509         /* Do some basic checks. */
03510         if (solid == NULL)
03511         {
03512                 fprintf (stderr,
03513                   (_("Error in %s () a NULL pointer was passed.\n")),
03514                   __FUNCTION__);
03515                 return (NULL);
03516         }
03517         if (solid->p3 == NULL)
03518         {
03519                 fprintf (stderr,
03520                   (_("Error in %s () a NULL pointer was found.\n")),
03521                   __FUNCTION__);
03522                 return (NULL);
03523         }
03524         solid->p3->x0 = x3;
03525 #if DEBUG
03526         DXF_DEBUG_END
03527 #endif
03528         return (solid);
03529 }
03530 
03531 
03538 double
03539 dxf_solid_get_y3
03540 (
03541         DxfSolid *solid
03543 )
03544 {
03545 #ifdef DEBUG
03546         DXF_DEBUG_BEGIN
03547 #endif
03548 
03549         /* Do some basic checks. */
03550         if (solid == NULL)
03551         {
03552                 fprintf (stderr,
03553                   (_("Error in %s () a NULL pointer was passed.\n")),
03554                   __FUNCTION__);
03555                 return (EXIT_FAILURE);
03556         }
03557         if (solid->p3 == NULL)
03558         {
03559                 fprintf (stderr,
03560                   (_("Error in %s () a NULL pointer was found.\n")),
03561                   __FUNCTION__);
03562                 return (EXIT_FAILURE);
03563         }
03564 #if DEBUG
03565         DXF_DEBUG_END
03566 #endif
03567         return (solid->p3->y0);
03568 }
03569 
03570 
03578 DxfSolid *
03579 dxf_solid_set_y3
03580 (
03581         DxfSolid *solid,
03583         double y3
03586 )
03587 {
03588 #ifdef DEBUG
03589         DXF_DEBUG_BEGIN
03590 #endif
03591         /* Do some basic checks. */
03592         if (solid == NULL)
03593         {
03594                 fprintf (stderr,
03595                   (_("Error in %s () a NULL pointer was passed.\n")),
03596                   __FUNCTION__);
03597                 return (NULL);
03598         }
03599         if (solid->p3 == NULL)
03600         {
03601                 fprintf (stderr,
03602                   (_("Error in %s () a NULL pointer was found.\n")),
03603                   __FUNCTION__);
03604                 return (NULL);
03605         }
03606         solid->p3->y0 = y3;
03607 #if DEBUG
03608         DXF_DEBUG_END
03609 #endif
03610         return (solid);
03611 }
03612 
03613 
03620 double
03621 dxf_solid_get_z3
03622 (
03623         DxfSolid *solid
03625 )
03626 {
03627 #ifdef DEBUG
03628         DXF_DEBUG_BEGIN
03629 #endif
03630 
03631         /* Do some basic checks. */
03632         if (solid == NULL)
03633         {
03634                 fprintf (stderr,
03635                   (_("Error in %s () a NULL pointer was passed.\n")),
03636                   __FUNCTION__);
03637                 return (EXIT_FAILURE);
03638         }
03639         if (solid->p3 == NULL)
03640         {
03641                 fprintf (stderr,
03642                   (_("Error in %s () a NULL pointer was found.\n")),
03643                   __FUNCTION__);
03644                 return (EXIT_FAILURE);
03645         }
03646 #if DEBUG
03647         DXF_DEBUG_END
03648 #endif
03649         return (solid->p3->z0);
03650 }
03651 
03652 
03660 DxfSolid *
03661 dxf_solid_set_z3
03662 (
03663         DxfSolid *solid,
03665         double z3
03668 )
03669 {
03670 #ifdef DEBUG
03671         DXF_DEBUG_BEGIN
03672 #endif
03673         /* Do some basic checks. */
03674         if (solid == NULL)
03675         {
03676                 fprintf (stderr,
03677                   (_("Error in %s () a NULL pointer was passed.\n")),
03678                   __FUNCTION__);
03679                 return (NULL);
03680         }
03681         if (solid->p3 == NULL)
03682         {
03683                 fprintf (stderr,
03684                   (_("Error in %s () a NULL pointer was found.\n")),
03685                   __FUNCTION__);
03686                 return (NULL);
03687         }
03688         solid->p3->z0 = z3;
03689 #if DEBUG
03690         DXF_DEBUG_END
03691 #endif
03692         return (solid);
03693 }
03694 
03695 
03704 DxfPoint *
03705 dxf_solid_get_extrusion_vector_as_point
03706 (
03707         DxfSolid *solid
03709 )
03710 {
03711 #ifdef DEBUG
03712         DXF_DEBUG_BEGIN
03713 #endif
03714         DxfPoint *point = NULL;
03715 
03716         /* Do some basic checks. */
03717         if (solid == NULL)
03718         {
03719                 fprintf (stderr,
03720                   (_("Error in %s () a NULL pointer was passed.\n")),
03721                   __FUNCTION__);
03722                 return (NULL);
03723         }
03724         point = dxf_point_init (point);
03725         if (point == NULL)
03726         {
03727               fprintf (stderr,
03728                   (_("Error in %s () could not allocate memory.\n")),
03729                 __FUNCTION__);
03730               return (NULL);
03731         }
03732         point->x0 = solid->extr_x0;
03733         point->y0 = solid->extr_y0;
03734         point->z0 = solid->extr_z0;
03735 #if DEBUG
03736         DXF_DEBUG_END
03737 #endif
03738         return (point);
03739 }
03740 
03741 
03746 DxfSolid *
03747 dxf_solid_set_extrusion_vector_from_point
03748 (
03749         DxfSolid *solid,
03751         DxfPoint *point
03753 )
03754 {
03755 #if DEBUG
03756         DXF_DEBUG_BEGIN
03757 #endif
03758         /* Do some basic checks. */
03759         if (solid == NULL)
03760         {
03761                 fprintf (stderr,
03762                   (_("Error in %s () a NULL pointer was passed.\n")),
03763                   __FUNCTION__);
03764                 return (NULL);
03765         }
03766         if (point == NULL)
03767         {
03768                 fprintf (stderr,
03769                   (_("Error in %s () a NULL pointer was passed.\n")),
03770                   __FUNCTION__);
03771                 return (NULL);
03772         }
03773         solid->extr_x0 = (double) point->x0;
03774         solid->extr_y0 = (double) point->y0;
03775         solid->extr_z0 = (double) point->z0;
03776 #if DEBUG
03777         DXF_DEBUG_END
03778 #endif
03779         return (solid);
03780 }
03781 
03782 
03786 DxfSolid *
03787 dxf_solid_set_extrusion_vector
03788 (
03789         DxfSolid *solid,
03791         double extr_x0,
03793         double extr_y0,
03795         double extr_z0
03797 )
03798 {
03799 #if DEBUG
03800         DXF_DEBUG_BEGIN
03801 #endif
03802         /* Do some basic checks. */
03803         if (solid == NULL)
03804         {
03805                 fprintf (stderr,
03806                   (_("Error in %s () a NULL pointer was passed.\n")),
03807                   __FUNCTION__);
03808                 return (NULL);
03809         }
03810         solid->extr_x0 = extr_x0;
03811         solid->extr_y0 = extr_y0;
03812         solid->extr_z0 = extr_z0;
03813 #if DEBUG
03814         DXF_DEBUG_END
03815 #endif
03816         return (solid);
03817 }
03818 
03819 
03826 double
03827 dxf_solid_get_extr_x0
03828 (
03829         DxfSolid *solid
03831 )
03832 {
03833 #ifdef DEBUG
03834         DXF_DEBUG_BEGIN
03835 #endif
03836 
03837         /* Do some basic checks. */
03838         if (solid == NULL)
03839         {
03840                 fprintf (stderr,
03841                   (_("Error in %s () a NULL pointer was passed.\n")),
03842                   __FUNCTION__);
03843                 return (EXIT_FAILURE);
03844         }
03845 #if DEBUG
03846         DXF_DEBUG_END
03847 #endif
03848         return (solid->extr_x0);
03849 }
03850 
03851 
03859 DxfSolid *
03860 dxf_solid_set_extr_x0
03861 (
03862         DxfSolid *solid,
03864         double extr_x0
03867 )
03868 {
03869 #ifdef DEBUG
03870         DXF_DEBUG_BEGIN
03871 #endif
03872         /* Do some basic checks. */
03873         if (solid == NULL)
03874         {
03875                 fprintf (stderr,
03876                   (_("Error in %s () a NULL pointer was passed.\n")),
03877                   __FUNCTION__);
03878                 return (NULL);
03879         }
03880         solid->extr_x0 = extr_x0;
03881 #if DEBUG
03882         DXF_DEBUG_END
03883 #endif
03884         return (solid);
03885 }
03886 
03887 
03894 double
03895 dxf_solid_get_extr_y0
03896 (
03897         DxfSolid *solid
03899 )
03900 {
03901 #ifdef DEBUG
03902         DXF_DEBUG_BEGIN
03903 #endif
03904 
03905         /* Do some basic checks. */
03906         if (solid == NULL)
03907         {
03908                 fprintf (stderr,
03909                   (_("Error in %s () a NULL pointer was passed.\n")),
03910                   __FUNCTION__);
03911                 return (EXIT_FAILURE);
03912         }
03913 #if DEBUG
03914         DXF_DEBUG_END
03915 #endif
03916         return (solid->extr_y0);
03917 }
03918 
03919 
03927 DxfSolid *
03928 dxf_solid_set_extr_y0
03929 (
03930         DxfSolid *solid,
03932         double extr_y0
03935 )
03936 {
03937 #ifdef DEBUG
03938         DXF_DEBUG_BEGIN
03939 #endif
03940         /* Do some basic checks. */
03941         if (solid == NULL)
03942         {
03943                 fprintf (stderr,
03944                   (_("Error in %s () a NULL pointer was passed.\n")),
03945                   __FUNCTION__);
03946                 return (NULL);
03947         }
03948         solid->extr_y0 = extr_y0;
03949 #if DEBUG
03950         DXF_DEBUG_END
03951 #endif
03952         return (solid);
03953 }
03954 
03955 
03962 double
03963 dxf_solid_get_extr_z0
03964 (
03965         DxfSolid *solid
03967 )
03968 {
03969 #ifdef DEBUG
03970         DXF_DEBUG_BEGIN
03971 #endif
03972 
03973         /* Do some basic checks. */
03974         if (solid == NULL)
03975         {
03976                 fprintf (stderr,
03977                   (_("Error in %s () a NULL pointer was passed.\n")),
03978                   __FUNCTION__);
03979                 return (EXIT_FAILURE);
03980         }
03981 #if DEBUG
03982         DXF_DEBUG_END
03983 #endif
03984         return (solid->extr_z0);
03985 }
03986 
03987 
03995 DxfSolid *
03996 dxf_solid_set_extr_z0
03997 (
03998         DxfSolid *solid,
04000         double extr_z0
04003 )
04004 {
04005 #ifdef DEBUG
04006         DXF_DEBUG_BEGIN
04007 #endif
04008         /* Do some basic checks. */
04009         if (solid == NULL)
04010         {
04011                 fprintf (stderr,
04012                   (_("Error in %s () a NULL pointer was passed.\n")),
04013                   __FUNCTION__);
04014                 return (NULL);
04015         }
04016         solid->extr_z0 = extr_z0;
04017 #if DEBUG
04018         DXF_DEBUG_END
04019 #endif
04020         return (solid);
04021 }
04022 
04023 
04032 DxfSolid *
04033 dxf_solid_get_next
04034 (
04035         DxfSolid *solid
04037 )
04038 {
04039 #if DEBUG
04040         DXF_DEBUG_BEGIN
04041 #endif
04042         /* Do some basic checks. */
04043         if (solid == NULL)
04044         {
04045                 fprintf (stderr,
04046                   (_("Error in %s () a NULL pointer was passed.\n")),
04047                   __FUNCTION__);
04048                 return (NULL);
04049         }
04050         if (solid->next == NULL)
04051         {
04052                 fprintf (stderr,
04053                   (_("Error in %s () a NULL pointer was found.\n")),
04054                   __FUNCTION__);
04055                 return (NULL);
04056         }
04057 #if DEBUG
04058         DXF_DEBUG_END
04059 #endif
04060         return ((DxfSolid *) solid->next);
04061 }
04062 
04063 
04068 DxfSolid *
04069 dxf_solid_set_next
04070 (
04071         DxfSolid *solid,
04073         DxfSolid *next
04075 )
04076 {
04077 #if DEBUG
04078         DXF_DEBUG_BEGIN
04079 #endif
04080         /* Do some basic checks. */
04081         if (solid == NULL)
04082         {
04083                 fprintf (stderr,
04084                   (_("Error in %s () a NULL pointer was passed.\n")),
04085                   __FUNCTION__);
04086                 return (NULL);
04087         }
04088         if (next == NULL)
04089         {
04090                 fprintf (stderr,
04091                   (_("Error in %s () a NULL pointer was passed.\n")),
04092                   __FUNCTION__);
04093                 return (NULL);
04094         }
04095         solid->next = (struct DxfSolid *) next;
04096 #if DEBUG
04097         DXF_DEBUG_END
04098 #endif
04099         return (solid);
04100 }
04101 
04102 
04111 DxfSolid *
04112 dxf_solid_get_last
04113 (
04114         DxfSolid *solid
04116 )
04117 {
04118 #if DEBUG
04119         DXF_DEBUG_BEGIN
04120 #endif
04121         /* Do some basic checks. */
04122         if (solid == NULL)
04123         {
04124                 fprintf (stderr,
04125                   (_("Error in %s () a NULL pointer was passed.\n")),
04126                   __FUNCTION__);
04127                 return (NULL);
04128         }
04129         if (solid->next == NULL)
04130         {
04131                 fprintf (stderr,
04132                   (_("Warning in %s () a NULL pointer was found.\n")),
04133                   __FUNCTION__);
04134                 return ((DxfSolid *) solid);
04135         }
04136         DxfSolid *iter = (DxfSolid *) solid->next;
04137         while (iter->next != NULL)
04138         {
04139                 iter = (DxfSolid *) iter->next;
04140         }
04141 #if DEBUG
04142         DXF_DEBUG_END
04143 #endif
04144         return ((DxfSolid *) iter);
04145 }
04146 
04147 
04148 /* EOF */