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

dimension.c

Go to the documentation of this file.
00001 
00043 #include "dimension.h"
00044 
00045 
00054 DxfDimension *
00055 dxf_dimension_new ()
00056 {
00057 #if DEBUG
00058         DXF_DEBUG_BEGIN
00059 #endif
00060         DxfDimension *dimension = NULL;
00061         size_t size;
00062 
00063         size = sizeof (DxfDimension);
00064         /* avoid malloc of 0 bytes */
00065         if (size == 0) size = 1;
00066         if ((dimension = malloc (size)) == NULL)
00067         {
00068                 fprintf (stderr,
00069                   (_("Error in %s () could not allocate memory for a DxfDimension struct.\n")),
00070                   __FUNCTION__);
00071                 dimension = NULL;
00072         }
00073         else
00074         {
00075                 memset (dimension, 0, size);
00076         }
00077 #if DEBUG
00078         DXF_DEBUG_END
00079 #endif
00080         return (dimension);
00081 }
00082 
00083 
00091 DxfDimension *
00092 dxf_dimension_init
00093 (
00094         DxfDimension *dimension
00097 )
00098 {
00099 #if DEBUG
00100         DXF_DEBUG_BEGIN
00101 #endif
00102         /* Do some basic checks. */
00103         if (dimension == NULL)
00104         {
00105                 fprintf (stderr,
00106                   (_("Warning in %s () a NULL pointer was passed.\n")),
00107                   __FUNCTION__);
00108                 dimension = dxf_dimension_new ();
00109         }
00110         if (dimension == NULL)
00111         {
00112               fprintf (stderr,
00113                 (_("Error in %s () could not allocate memory for a DxfDimension struct.\n")),
00114                 __FUNCTION__);
00115               return (NULL);
00116         }
00117         dxf_dimension_set_id_code (dimension, 0);
00118         dxf_dimension_set_linetype (dimension, strdup (DXF_DEFAULT_LINETYPE));
00119         dxf_dimension_set_layer (dimension, strdup (DXF_DEFAULT_LAYER));
00120         dxf_dimension_set_elevation (dimension, 0.0);
00121         dxf_dimension_set_thickness (dimension, 0.0);
00122         dxf_dimension_set_linetype_scale (dimension, DXF_DEFAULT_LINETYPE_SCALE);
00123         dxf_dimension_set_visibility (dimension, DXF_DEFAULT_VISIBILITY);
00124         dxf_dimension_set_color (dimension, DXF_COLOR_BYLAYER);
00125         dxf_dimension_set_paperspace (dimension, DXF_PAPERSPACE);
00126         dxf_dimension_set_dictionary_owner_soft (dimension, strdup (""));
00127         dxf_dimension_set_dictionary_owner_hard (dimension, strdup (""));
00128         dxf_dimension_set_dim_text (dimension, strdup (""));
00129         dxf_dimension_set_dimblock_name (dimension, strdup (""));
00130         dxf_dimension_set_dimstyle_name (dimension, strdup (""));
00131         dxf_dimension_set_x0 (dimension, 0.0);
00132         dxf_dimension_set_y0 (dimension, 0.0);
00133         dxf_dimension_set_z0 (dimension, 0.0);
00134         dxf_dimension_set_x1 (dimension, 0.0);
00135         dxf_dimension_set_y1 (dimension, 0.0);
00136         dxf_dimension_set_z1 (dimension, 0.0);
00137         dxf_dimension_set_x2 (dimension, 0.0);
00138         dxf_dimension_set_y2 (dimension, 0.0);
00139         dxf_dimension_set_z2 (dimension, 0.0);
00140         dxf_dimension_set_x3 (dimension, 0.0);
00141         dxf_dimension_set_y3 (dimension, 0.0);
00142         dxf_dimension_set_z3 (dimension, 0.0);
00143         dxf_dimension_set_x4 (dimension, 0.0);
00144         dxf_dimension_set_y4 (dimension, 0.0);
00145         dxf_dimension_set_z4 (dimension, 0.0);
00146         dxf_dimension_set_x5 (dimension, 0.0);
00147         dxf_dimension_set_y5 (dimension, 0.0);
00148         dxf_dimension_set_z5 (dimension, 0.0);
00149         dxf_dimension_set_x6 (dimension, 0.0);
00150         dxf_dimension_set_y6 (dimension, 0.0);
00151         dxf_dimension_set_z6 (dimension, 0.0);
00152         dxf_dimension_set_leader_length (dimension, 0.0);
00153         dxf_dimension_set_text_line_spacing_factor (dimension, 0.0);
00154         dxf_dimension_set_actual_measurement (dimension, 0.0);
00155         dxf_dimension_set_angle (dimension, 0.0);
00156         dxf_dimension_set_hor_dir (dimension, 0.0);
00157         dxf_dimension_set_obl_angle (dimension, 0.0);
00158         dxf_dimension_set_text_angle (dimension, 0.0);
00159         dxf_dimension_set_flag (dimension, 0);
00160         dxf_dimension_set_attachment_point (dimension, 0);
00161         dxf_dimension_set_text_line_spacing (dimension, 0);
00162         dxf_dimension_set_extr_x0 (dimension, 0.0);
00163         dxf_dimension_set_extr_y0 (dimension, 0.0);
00164         dxf_dimension_set_extr_z0 (dimension, 0.0);
00165         dxf_dimension_set_next (dimension, NULL);
00166 #if DEBUG
00167         DXF_DEBUG_END
00168 #endif
00169         return (dimension);
00170 }
00171 
00172 
00184 DxfDimension *
00185 dxf_dimension_read
00186 (
00187         DxfFile *fp,
00189         DxfDimension *dimension
00191 )
00192 {
00193 #if DEBUG
00194         DXF_DEBUG_BEGIN
00195 #endif
00196         char *temp_string = NULL;
00197 
00198         /* Do some basic checks. */
00199         if (fp == NULL)
00200         {
00201                 fprintf (stderr,
00202                   (_("Error in %s () a NULL file pointer was passed.\n")),
00203                   __FUNCTION__);
00204                 /* Clean up. */
00205                 free (temp_string);
00206                 return (NULL);
00207         }
00208         if (dimension == NULL)
00209         {
00210                 fprintf (stderr,
00211                   (_("Warning in %s () a NULL pointer was passed.\n")),
00212                   __FUNCTION__);
00213                 dimension = dxf_dimension_new ();
00214                 dimension = dxf_dimension_init (dimension);
00215         }
00216         (fp->line_number)++;
00217         fscanf (fp->fp, "%[^\n]", temp_string);
00218         while (strcmp (temp_string, "0") != 0)
00219         {
00220                 if (ferror (fp->fp))
00221                 {
00222                         fprintf (stderr,
00223                           (_("Error in %s () while reading from: %s in line: %d.\n")),
00224                           __FUNCTION__, fp->filename, fp->line_number);
00225                         fclose (fp->fp);
00226                         /* Clean up. */
00227                         free (temp_string);
00228                         return (NULL);
00229                 }
00230                 if (strcmp (temp_string, "1") == 0)
00231                 {
00232                         /* Now follows a string containing a dimension
00233                          * text string. */
00234                         (fp->line_number)++;
00235                         fscanf (fp->fp, "%s\n", dimension->dim_text);
00236                 }
00237                 if (strcmp (temp_string, "2") == 0)
00238                 {
00239                         /* Now follows a string containing a dimension
00240                          * block name string. */
00241                         (fp->line_number)++;
00242                         fscanf (fp->fp, "%s\n", dimension->dimblock_name);
00243                 }
00244                 if (strcmp (temp_string, "3") == 0)
00245                 {
00246                         /* Now follows a string containing a dimension
00247                          * style name string. */
00248                         (fp->line_number)++;
00249                         fscanf (fp->fp, "%s\n", dimension->dimstyle_name);
00250                 }
00251                 if (strcmp (temp_string, "5") == 0)
00252                 {
00253                         /* Now follows a string containing a sequential
00254                          * id number. */
00255                         (fp->line_number)++;
00256                         fscanf (fp->fp, "%x\n", &dimension->id_code);
00257                 }
00258                 else if (strcmp (temp_string, "6") == 0)
00259                 {
00260                         /* Now follows a string containing a linetype
00261                          * name. */
00262                         (fp->line_number)++;
00263                         fscanf (fp->fp, "%s\n", dimension->linetype);
00264                 }
00265                 else if (strcmp (temp_string, "8") == 0)
00266                 {
00267                         /* Now follows a string containing a layer name. */
00268                         (fp->line_number)++;
00269                         fscanf (fp->fp, "%s\n", dimension->layer);
00270                 }
00271                 else if (strcmp (temp_string, "10") == 0)
00272                 {
00273                         /* Now follows a string containing the
00274                          * X-value of the definition point for all
00275                          * dimension types. */
00276                         (fp->line_number)++;
00277                         fscanf (fp->fp, "%lf\n", &dimension->p0->x0);
00278                 }
00279                 else if (strcmp (temp_string, "20") == 0)
00280                 {
00281                         /* Now follows a string containing the
00282                          * Y-value of the definition point for all
00283                          * dimension types. */
00284                         (fp->line_number)++;
00285                         fscanf (fp->fp, "%lf\n", &dimension->p0->y0);
00286                 }
00287                 else if (strcmp (temp_string, "30") == 0)
00288                 {
00289                         /* Now follows a string containing the
00290                          * Z-value of the definition point for all
00291                          * dimension types. */
00292                         (fp->line_number)++;
00293                         fscanf (fp->fp, "%lf\n", &dimension->p0->z0);
00294                 }
00295                 else if (strcmp (temp_string, "11") == 0)
00296                 {
00297                         /* Now follows a string containing the
00298                          * X-value of the middle point of dimension text. */
00299                         (fp->line_number)++;
00300                         fscanf (fp->fp, "%lf\n", &dimension->p1->x0);
00301                 }
00302                 else if (strcmp (temp_string, "21") == 0)
00303                 {
00304                         /* Now follows a string containing the
00305                          * Y-value of the middle point of dimension text. */
00306                         (fp->line_number)++;
00307                         fscanf (fp->fp, "%lf\n", &dimension->p1->y0);
00308                 }
00309                 else if (strcmp (temp_string, "31") == 0)
00310                 {
00311                         /* Now follows a string containing the
00312                          * Z-value of the middle point of dimension text. */
00313                         (fp->line_number)++;
00314                         fscanf (fp->fp, "%lf\n", &dimension->p1->z0);
00315                 }
00316                 else if (strcmp (temp_string, "12") == 0)
00317                 {
00318                         /* Now follows a string containing the
00319                          * X-value of the dimension block translation
00320                          * vector. */
00321                         (fp->line_number)++;
00322                         fscanf (fp->fp, "%lf\n", &dimension->p2->x0);
00323                 }
00324                 else if (strcmp (temp_string, "22") == 0)
00325                 {
00326                         /* Now follows a string containing the
00327                          * Y-value of the dimension block translation
00328                          * vector. */
00329                         (fp->line_number)++;
00330                         fscanf (fp->fp, "%lf\n", &dimension->p2->y0);
00331                 }
00332                 else if (strcmp (temp_string, "32") == 0)
00333                 {
00334                         /* Now follows a string containing the
00335                          * Z-value of the dimension block translation
00336                          * vector. */
00337                         (fp->line_number)++;
00338                         fscanf (fp->fp, "%lf\n", &dimension->p2->z0);
00339                 }
00340                 else if (strcmp (temp_string, "13") == 0)
00341                 {
00342                         /* Now follows a string containing the
00343                          * X-value of the definition point for linear and
00344                          * angular dimensions. */
00345                         (fp->line_number)++;
00346                         fscanf (fp->fp, "%lf\n", &dimension->p3->x0);
00347                 }
00348                 else if (strcmp (temp_string, "23") == 0)
00349                 {
00350                         /* Now follows a string containing the
00351                          * Y-value of the definition point for linear and
00352                          * angular dimensions. */
00353                         (fp->line_number)++;
00354                         fscanf (fp->fp, "%lf\n", &dimension->p3->y0);
00355                 }
00356                 else if (strcmp (temp_string, "33") == 0)
00357                 {
00358                         /* Now follows a string containing the
00359                          * Z-value of the definition point for linear and
00360                          * angular dimensions. */
00361                         (fp->line_number)++;
00362                         fscanf (fp->fp, "%lf\n", &dimension->p3->z0);
00363                 }
00364                 else if (strcmp (temp_string, "14") == 0)
00365                 {
00366                         /* Now follows a string containing the
00367                          * X-value of the definition point for linear and
00368                          * angular dimensions. */
00369                         (fp->line_number)++;
00370                         fscanf (fp->fp, "%lf\n", &dimension->p4->x0);
00371                 }
00372                 else if (strcmp (temp_string, "24") == 0)
00373                 {
00374                         /* Now follows a string containing the
00375                          * Y-value of the definition point for linear and
00376                          * angular dimensions. */
00377                         (fp->line_number)++;
00378                         fscanf (fp->fp, "%lf\n", &dimension->p4->y0);
00379                 }
00380                 else if (strcmp (temp_string, "34") == 0)
00381                 {
00382                         /* Now follows a string containing the
00383                          * Z-value of the definition point for linear and
00384                          * angular dimensions. */
00385                         (fp->line_number)++;
00386                         fscanf (fp->fp, "%lf\n", &dimension->p4->z0);
00387                 }
00388                 else if (strcmp (temp_string, "15") == 0)
00389                 {
00390                         /* Now follows a string containing the
00391                          * X-value of the definition point for diameter,
00392                          * radius, and angular dimensions. */
00393                         (fp->line_number)++;
00394                         fscanf (fp->fp, "%lf\n", &dimension->p5->x0);
00395                 }
00396                 else if (strcmp (temp_string, "25") == 0)
00397                 {
00398                         /* Now follows a string containing the
00399                          * Y-value of the definition point for diameter,
00400                          * radius, and angular dimensions. */
00401                         (fp->line_number)++;
00402                         fscanf (fp->fp, "%lf\n", &dimension->p5->y0);
00403                 }
00404                 else if (strcmp (temp_string, "35") == 0)
00405                 {
00406                         /* Now follows a string containing the
00407                          * Z-value of the definition point for diameter,
00408                          * radius, and angular dimensions. */
00409                         (fp->line_number)++;
00410                         fscanf (fp->fp, "%lf\n", &dimension->p5->z0);
00411                 }
00412                 else if (strcmp (temp_string, "16") == 0)
00413                 {
00414                         /* Now follows a string containing the
00415                          * X-value of the point defining dimension arc for
00416                          * angular dimensions. */
00417                         (fp->line_number)++;
00418                         fscanf (fp->fp, "%lf\n", &dimension->p6->x0);
00419                 }
00420                 else if (strcmp (temp_string, "26") == 0)
00421                 {
00422                         /* Now follows a string containing the
00423                          * Y-value of the point defining dimension arc for
00424                          * angular dimensions. */
00425                         (fp->line_number)++;
00426                         fscanf (fp->fp, "%lf\n", &dimension->p6->y0);
00427                 }
00428                 else if (strcmp (temp_string, "36") == 0)
00429                 {
00430                         /* Now follows a string containing the
00431                          * Z-value of the point defining dimension arc for
00432                          * angular dimensions. */
00433                         (fp->line_number)++;
00434                         fscanf (fp->fp, "%lf\n", &dimension->p6->z0);
00435                 }
00436                 else if (strcmp (temp_string, "38") == 0)
00437                 {
00438                         /* Now follows a string containing the
00439                          * elevation. */
00440                         (fp->line_number)++;
00441                         fscanf (fp->fp, "%lf\n", &dimension->elevation);
00442                 }
00443                 else if (strcmp (temp_string, "39") == 0)
00444                 {
00445                         /* Now follows a string containing the
00446                          * thickness. */
00447                         (fp->line_number)++;
00448                         fscanf (fp->fp, "%lf\n", &dimension->thickness);
00449                 }
00450                 else if (strcmp (temp_string, "40") == 0)
00451                 {
00452                         /* Now follows a string containing the leader
00453                          * length. */
00454                         (fp->line_number)++;
00455                         fscanf (fp->fp, "%lf\n", &dimension->leader_length);
00456                 }
00457                 else if (strcmp (temp_string, "41") == 0)
00458                 {
00459                         /* Now follows a string containing the text line
00460                          * spacing factor. */
00461                         (fp->line_number)++;
00462                         fscanf (fp->fp, "%lf\n", &dimension->text_line_spacing_factor);
00463                 }
00464                 else if (strcmp (temp_string, "42") == 0)
00465                 {
00466                         /* Now follows a string containing the actual
00467                          * measurement. */
00468                         (fp->line_number)++;
00469                         fscanf (fp->fp, "%lf\n", &dimension->actual_measurement);
00470                 }
00471                 else if (strcmp (temp_string, "48") == 0)
00472                 {
00473                         /* Now follows a string containing the linetype
00474                          * scale. */
00475                         (fp->line_number)++;
00476                         fscanf (fp->fp, "%lf\n", &dimension->linetype_scale);
00477                 }
00478                 else if (strcmp (temp_string, "50") == 0)
00479                 {
00480                         /* Now follows a string containing the angle of
00481                          * rotated, horizontal, or vertical linear
00482                          * dimensions. */
00483                         (fp->line_number)++;
00484                         fscanf (fp->fp, "%lf\n", &dimension->angle);
00485                 }
00486                 else if (strcmp (temp_string, "51") == 0)
00487                 {
00488                         /* Now follows a string containing the horizontal
00489                          * direction. */
00490                         (fp->line_number)++;
00491                         fscanf (fp->fp, "%lf\n", &dimension->hor_dir);
00492                 }
00493                 else if (strcmp (temp_string, "52") == 0)
00494                 {
00495                         /* Now follows a string containing the oblique
00496                          * angle. */
00497                         (fp->line_number)++;
00498                         fscanf (fp->fp, "%lf\n", &dimension->obl_angle);
00499                 }
00500                 else if (strcmp (temp_string, "53") == 0)
00501                 {
00502                         /* Now follows a string containing the text
00503                          * angle. */
00504                         (fp->line_number)++;
00505                         fscanf (fp->fp, "%lf\n", &dimension->text_angle);
00506                 }
00507                 else if (strcmp (temp_string, "60") == 0)
00508                 {
00509                         /* Now follows a string containing the
00510                          * visibility value. */
00511                         (fp->line_number)++;
00512                         fscanf (fp->fp, "%hd\n", &dimension->visibility);
00513                 }
00514                 else if (strcmp (temp_string, "62") == 0)
00515                 {
00516                         /* Now follows a string containing the
00517                          * color value. */
00518                         (fp->line_number)++;
00519                         fscanf (fp->fp, "%d\n", &dimension->color);
00520                 }
00521                 else if (strcmp (temp_string, "67") == 0)
00522                 {
00523                         /* Now follows a string containing the
00524                          * paperspace value. */
00525                         (fp->line_number)++;
00526                         fscanf (fp->fp, "%d\n", &dimension->paperspace);
00527                 }
00528                 else if (strcmp (temp_string, "70") == 0)
00529                 {
00530                         /* Now follows a string containing a flag
00531                          * value. */
00532                         (fp->line_number)++;
00533                         fscanf (fp->fp, "%d\n", &dimension->flag);
00534                 }
00535                 else if (strcmp (temp_string, "71") == 0)
00536                 {
00537                         /* Now follows a string containing the attachment
00538                          * point value. */
00539                         (fp->line_number)++;
00540                         fscanf (fp->fp, "%d\n", &dimension->attachment_point);
00541                 }
00542                 else if (strcmp (temp_string, "72") == 0)
00543                 {
00544                         /* Now follows a string containing the text line
00545                          * spacing value. */
00546                         (fp->line_number)++;
00547                         fscanf (fp->fp, "%d\n", &dimension->text_line_spacing);
00548                 }
00549                 else if ((fp->acad_version_number >= AutoCAD_13)
00550                         && (strcmp (temp_string, "100") == 0))
00551                 {
00552                         /* Now follows a string containing the
00553                          * subclass marker value. */
00554                         (fp->line_number)++;
00555                         fscanf (fp->fp, "%s\n", temp_string);
00556                         if ((strcmp (temp_string, "AcDbEntity") != 0)
00557                           && (strcmp (temp_string, "AcDbDimension") != 0)
00558                           && (strcmp (temp_string, "AcDbAlignedDimension") != 0)
00559                           && (strcmp (temp_string, "AcDbRotatedDimension") != 0)
00560                           && (strcmp (temp_string, "AcDb3PointAngularDimension") != 0)
00561                           && (strcmp (temp_string, "AcDbDiametricDimension") != 0)
00562                           && (strcmp (temp_string, "AcDbRadialDimension") != 0)
00563                           && (strcmp (temp_string, "AcDbOrdinateDimension") != 0))
00564                         {
00565                                 fprintf (stderr,
00566                                   (_("Warning in %s () found a bad subclass marker in: %s in line: %d.\n")),
00567                                   __FUNCTION__, fp->filename, fp->line_number);
00568                         }
00569                 }
00570                 else if (strcmp (temp_string, "210") == 0)
00571                 {
00572                         /* Now follows a string containing the
00573                          * X-value of the extrusion vector. */
00574                         (fp->line_number)++;
00575                         fscanf (fp->fp, "%lf\n", &dimension->extr_x0);
00576                 }
00577                 else if (strcmp (temp_string, "220") == 0)
00578                 {
00579                         /* Now follows a string containing the
00580                          * Y-value of the extrusion vector. */
00581                         (fp->line_number)++;
00582                         fscanf (fp->fp, "%lf\n", &dimension->extr_y0);
00583                 }
00584                 else if (strcmp (temp_string, "230") == 0)
00585                 {
00586                         /* Now follows a string containing the
00587                          * Z-value of the extrusion vector. */
00588                         (fp->line_number)++;
00589                         fscanf (fp->fp, "%lf\n", &dimension->extr_z0);
00590                 }
00591                 else if (strcmp (temp_string, "330") == 0)
00592                 {
00593                         /* Now follows a string containing Soft-pointer
00594                          * ID/handle to owner dictionary. */
00595                         (fp->line_number)++;
00596                         fscanf (fp->fp, "%s\n", dimension->dictionary_owner_soft);
00597                 }
00598                 else if (strcmp (temp_string, "360") == 0)
00599                 {
00600                         /* Now follows a string containing Hard owner
00601                          * ID/handle to owner dictionary. */
00602                         (fp->line_number)++;
00603                         fscanf (fp->fp, "%s\n", dimension->dictionary_owner_hard);
00604                 }
00605                 else if (strcmp (temp_string, "999") == 0)
00606                 {
00607                         /* Now follows a string containing a comment. */
00608                         (fp->line_number)++;
00609                         fscanf (fp->fp, "%s\n", temp_string);
00610                         fprintf (stdout, "DXF comment: %s\n", temp_string);
00611                 }
00612                 else
00613                 {
00614                         fprintf (stderr,
00615                           (_("Warning in %s () unknown string tag found while reading from: %s in line: %d.\n")),
00616                           __FUNCTION__, fp->filename, fp->line_number);
00617                 }
00618         }
00619         /* Handle omitted members and/or illegal values. */
00620         if (strcmp (dxf_dimension_get_linetype (dimension), "") == 0)
00621         {
00622                 dxf_dimension_set_linetype (dimension, strdup (DXF_DEFAULT_LINETYPE));
00623         }
00624         if (strcmp (dxf_dimension_get_layer (dimension), "") == 0)
00625         {
00626                 dxf_dimension_set_layer (dimension, strdup (DXF_DEFAULT_LAYER));
00627         }
00628         /* Clean up. */
00629         free (temp_string);
00630 #if DEBUG
00631         DXF_DEBUG_END
00632 #endif
00633         return (dimension);
00634 }
00635 
00636 
00643 int
00644 dxf_dimension_write
00645 (
00646         DxfFile *fp,
00648         DxfDimension *dimension
00651 )
00652 {
00653 #if DEBUG
00654         DXF_DEBUG_BEGIN
00655 #endif
00656         char *dxf_entity_name = strdup ("DIMENSION");
00657 
00658         /* Do some basic checks. */
00659         if (fp == NULL)
00660         {
00661                 fprintf (stderr,
00662                   (_("Error in %s () a NULL file pointer was passed.\n")),
00663                   __FUNCTION__);
00664                 /* Clean up. */
00665                 free (dxf_entity_name);
00666                 return (EXIT_FAILURE);
00667         }
00668         if (dimension == NULL)
00669         {
00670                 fprintf (stderr,
00671                   (_("Error in %s () a NULL pointer was passed.\n")),
00672                   __FUNCTION__);
00673                 /* Clean up. */
00674                 free (dxf_entity_name);
00675                 return (EXIT_FAILURE);
00676         }
00677         if ((dxf_dimension_get_flag (dimension) > 6)
00678           || (dxf_dimension_get_flag (dimension) < 0))
00679         {
00680                 fprintf (stderr,
00681                   (_("Error in %s () an out of range flag value was detected.\n")),
00682                   __FUNCTION__);
00683                 /* Clean up. */
00684                 free (dxf_entity_name);
00685                 return (EXIT_FAILURE);
00686         }
00687         if (strcmp (dxf_dimension_get_layer (dimension), "") == 0)
00688         {
00689                 fprintf (stderr,
00690                   (_("Warning in %s () empty layer string for the %s entity with id-code: %x\n")),
00691                   __FUNCTION__, dxf_entity_name, dxf_dimension_get_id_code (dimension));
00692                 fprintf (stderr,
00693                   (_("\t%s entity is relocated to layer 0")),
00694                   dxf_entity_name);
00695                 dxf_dimension_set_layer (dimension, strdup (DXF_DEFAULT_LAYER));
00696         }
00697         /* Start writing output. */
00698         fprintf (fp->fp, "  0\n%s\n", dxf_entity_name);
00699         if (dxf_dimension_get_id_code (dimension) != -1)
00700         {
00701                 fprintf (fp->fp, "  5\n%x\n", dxf_dimension_get_id_code (dimension));
00702         }
00713         if ((strcmp (dxf_dimension_get_dictionary_owner_soft (dimension), "") != 0)
00714           && (fp->acad_version_number >= AutoCAD_14))
00715         {
00716                 fprintf (fp->fp, "102\n{ACAD_REACTORS\n");
00717                 fprintf (fp->fp, "330\n%s\n", dxf_dimension_get_dictionary_owner_soft (dimension));
00718                 fprintf (fp->fp, "102\n}\n");
00719         }
00720         if ((strcmp (dxf_dimension_get_dictionary_owner_hard (dimension), "") != 0)
00721           && (fp->acad_version_number >= AutoCAD_14))
00722         {
00723                 fprintf (fp->fp, "102\n{ACAD_XDICTIONARY\n");
00724                 fprintf (fp->fp, "360\n%s\n", dxf_dimension_get_dictionary_owner_hard (dimension));
00725                 fprintf (fp->fp, "102\n}\n");
00726         }
00727         if (fp->acad_version_number >= AutoCAD_13)
00728         {
00729                 fprintf (fp->fp, "100\nAcDbEntity\n");
00730         }
00731         if (dxf_dimension_get_paperspace (dimension) == DXF_PAPERSPACE)
00732         {
00733                 fprintf (fp->fp, " 67\n%d\n", DXF_PAPERSPACE);
00734         }
00735         fprintf (fp->fp, "  8\n%s\n", dxf_dimension_get_layer (dimension));
00736         if (strcmp (dxf_dimension_get_linetype (dimension), DXF_DEFAULT_LINETYPE) != 0)
00737         {
00738                 fprintf (fp->fp, "  6\n%s\n", dxf_dimension_get_linetype (dimension));
00739         }
00740         if (dxf_dimension_get_color (dimension) != DXF_COLOR_BYLAYER)
00741         {
00742                 fprintf (fp->fp, " 62\n%d\n", dxf_dimension_get_color (dimension));
00743         }
00744         if (dxf_dimension_get_linetype_scale (dimension) != 1.0)
00745         {
00746                 fprintf (fp->fp, " 48\n%f\n", dxf_dimension_get_linetype_scale (dimension));
00747         }
00748         if (dxf_dimension_get_visibility (dimension) != 0)
00749         {
00750                 fprintf (fp->fp, " 60\n%d\n", dxf_dimension_get_visibility (dimension));
00751         }
00752         if (fp->acad_version_number >= AutoCAD_13)
00753         {
00754                 fprintf (fp->fp, "100\nAcDbDimension\n");
00755         }
00756         fprintf (fp->fp, "  2\n%s\n", dxf_dimension_get_dimblock_name (dimension));
00757         fprintf (fp->fp, " 10\n%f\n", dxf_dimension_get_x0 (dimension));
00758         fprintf (fp->fp, " 20\n%f\n", dxf_dimension_get_y0 (dimension));
00759         fprintf (fp->fp, " 30\n%f\n", dxf_dimension_get_z0 (dimension));
00760         fprintf (fp->fp, " 11\n%f\n", dxf_dimension_get_x1 (dimension));
00761         fprintf (fp->fp, " 21\n%f\n", dxf_dimension_get_y1 (dimension));
00762         fprintf (fp->fp, " 31\n%f\n", dxf_dimension_get_z1 (dimension));
00763         fprintf (fp->fp, " 70\n%d\n", dxf_dimension_get_flag (dimension));
00764         if (fp->acad_version_number >= AutoCAD_2000)
00765         {
00766                 fprintf (fp->fp, " 71\n%d\n", dxf_dimension_get_attachment_point (dimension));
00767                 fprintf (fp->fp, " 72\n%d\n", dxf_dimension_get_text_line_spacing (dimension));
00768                 fprintf (fp->fp, " 41\n%f\n", dxf_dimension_get_text_line_spacing_factor (dimension));
00769                 fprintf (fp->fp, " 42\n%f\n", dxf_dimension_get_actual_measurement (dimension));
00770         }
00771         fprintf (fp->fp, "  1\n%s\n", dxf_dimension_get_dim_text (dimension));
00772         fprintf (fp->fp, " 53\n%f\n", dxf_dimension_get_text_angle (dimension));
00773         fprintf (fp->fp, " 51\n%f\n", dxf_dimension_get_hor_dir (dimension));
00774         fprintf (fp->fp, "210\n%fn", dxf_dimension_get_extr_x0 (dimension));
00775         fprintf (fp->fp, "220\n%fn", dxf_dimension_get_extr_y0 (dimension));
00776         fprintf (fp->fp, "230\n%fn", dxf_dimension_get_extr_z0 (dimension));
00777         fprintf (fp->fp, "  3\n%s\n", dxf_dimension_get_dimstyle_name (dimension));
00778         /* Rotated, horizontal, or vertical dimension. */
00779         if (dxf_dimension_get_flag (dimension) == 0)
00780         {
00781                 if (fp->acad_version_number >= AutoCAD_13)
00782                 {
00783                         fprintf (fp->fp, "100\nAcDbAlignedDimension\n");
00784                 }
00785                 fprintf (fp->fp, " 12\n%f\n", dxf_dimension_get_x2 (dimension));
00786                 fprintf (fp->fp, " 22\n%f\n", dxf_dimension_get_y2 (dimension));
00787                 fprintf (fp->fp, " 32\n%f\n", dxf_dimension_get_z2 (dimension));
00788                 fprintf (fp->fp, " 13\n%f\n", dxf_dimension_get_x3 (dimension));
00789                 fprintf (fp->fp, " 23\n%f\n", dxf_dimension_get_y3 (dimension));
00790                 fprintf (fp->fp, " 33\n%f\n", dxf_dimension_get_z3 (dimension));
00791                 fprintf (fp->fp, " 14\n%f\n", dxf_dimension_get_x4 (dimension));
00792                 fprintf (fp->fp, " 24\n%f\n", dxf_dimension_get_y4 (dimension));
00793                 fprintf (fp->fp, " 34\n%f\n", dxf_dimension_get_z4 (dimension));
00794                 fprintf (fp->fp, " 50\n%f\n", dxf_dimension_get_angle (dimension));
00795                 fprintf (fp->fp, " 52\n%f\n", dxf_dimension_get_obl_angle (dimension));
00796                 if (fp->acad_version_number >= AutoCAD_13)
00797                 {
00798                         fprintf (fp->fp, "100\nAcDbRotatedDimension\n");
00799                 }
00800         }
00801         /* Aligned dimension. */
00802         else if (dxf_dimension_get_flag (dimension) == 1)
00803         {
00804                 if (fp->acad_version_number >= AutoCAD_13)
00805                 {
00806                         fprintf (fp->fp, "100\nAcDbAlignedDimension\n");
00807                 }
00808                 fprintf (fp->fp, " 12\n%f\n", dxf_dimension_get_x2 (dimension));
00809                 fprintf (fp->fp, " 22\n%f\n", dxf_dimension_get_y2 (dimension));
00810                 fprintf (fp->fp, " 32\n%f\n", dxf_dimension_get_z2 (dimension));
00811                 fprintf (fp->fp, " 13\n%f\n", dxf_dimension_get_x3 (dimension));
00812                 fprintf (fp->fp, " 23\n%f\n", dxf_dimension_get_y3 (dimension));
00813                 fprintf (fp->fp, " 33\n%f\n", dxf_dimension_get_z3 (dimension));
00814                 fprintf (fp->fp, " 14\n%f\n", dxf_dimension_get_x4 (dimension));
00815                 fprintf (fp->fp, " 24\n%f\n", dxf_dimension_get_y4 (dimension));
00816                 fprintf (fp->fp, " 34\n%f\n", dxf_dimension_get_z4 (dimension));
00817                 fprintf (fp->fp, " 50\n%f\n", dxf_dimension_get_angle (dimension));
00818         }
00819         /* Angular dimension. */
00820         else if (dxf_dimension_get_flag (dimension) == 2)
00821         {
00822                 if (fp->acad_version_number >= AutoCAD_13)
00823                 {
00824                         fprintf (fp->fp, "100\nAcDb3PointAngularDimension\n");
00825                 }
00826                 fprintf (fp->fp, " 13\n%f\n", dxf_dimension_get_x3 (dimension));
00827                 fprintf (fp->fp, " 23\n%f\n", dxf_dimension_get_y3 (dimension));
00828                 fprintf (fp->fp, " 33\n%f\n", dxf_dimension_get_z3 (dimension));
00829                 fprintf (fp->fp, " 14\n%f\n", dxf_dimension_get_x4 (dimension));
00830                 fprintf (fp->fp, " 24\n%f\n", dxf_dimension_get_y4 (dimension));
00831                 fprintf (fp->fp, " 34\n%f\n", dxf_dimension_get_z4 (dimension));
00832                 fprintf (fp->fp, " 15\n%f\n", dxf_dimension_get_x5 (dimension));
00833                 fprintf (fp->fp, " 25\n%f\n", dxf_dimension_get_y5 (dimension));
00834                 fprintf (fp->fp, " 35\n%f\n", dxf_dimension_get_z5 (dimension));
00835                 fprintf (fp->fp, " 16\n%f\n", dxf_dimension_get_x6 (dimension));
00836                 fprintf (fp->fp, " 26\n%f\n", dxf_dimension_get_y6 (dimension));
00837                 fprintf (fp->fp, " 36\n%f\n", dxf_dimension_get_z6 (dimension));
00838         }
00839         /* Diameter dimension. */
00840         else if (dxf_dimension_get_flag (dimension) == 3)
00841         {
00842                 if (fp->acad_version_number >= AutoCAD_13)
00843                 {
00844                         fprintf (fp->fp, "100\nAcDbDiametricDimension\n");
00845                 }
00846                 fprintf (fp->fp, " 15\n%f\n", dxf_dimension_get_x5 (dimension));
00847                 fprintf (fp->fp, " 25\n%f\n", dxf_dimension_get_y5 (dimension));
00848                 fprintf (fp->fp, " 35\n%f\n", dxf_dimension_get_z5 (dimension));
00849                 fprintf (fp->fp, " 40\n%f\n", dxf_dimension_get_leader_length (dimension));
00850         }
00851         /* Radius dimension. */
00852         else if (dxf_dimension_get_flag (dimension) == 4)
00853         {
00854                 if (fp->acad_version_number >= AutoCAD_13)
00855                 {
00856                         fprintf (fp->fp, "100\nAcDbRadialDimension\n");
00857                 }
00858                 fprintf (fp->fp, " 15\n%f\n", dxf_dimension_get_x5 (dimension));
00859                 fprintf (fp->fp, " 25\n%f\n", dxf_dimension_get_y5 (dimension));
00860                 fprintf (fp->fp, " 35\n%f\n", dxf_dimension_get_z5 (dimension));
00861                 fprintf (fp->fp, " 40\n%f\n", dxf_dimension_get_leader_length (dimension));
00862         }
00863         /* Angular 3-point dimension. */
00864         else if (dxf_dimension_get_flag (dimension) == 5)
00865         {
00866                 if (fp->acad_version_number >= AutoCAD_13)
00867                 {
00868                         fprintf (fp->fp, "100\nAcDb3PointAngularDimension\n");
00869                 }
00870                 fprintf (fp->fp, " 13\n%f\n", dxf_dimension_get_x3 (dimension));
00871                 fprintf (fp->fp, " 23\n%f\n", dxf_dimension_get_y3 (dimension));
00872                 fprintf (fp->fp, " 33\n%f\n", dxf_dimension_get_z3 (dimension));
00873                 fprintf (fp->fp, " 14\n%f\n", dxf_dimension_get_x4 (dimension));
00874                 fprintf (fp->fp, " 24\n%f\n", dxf_dimension_get_y4 (dimension));
00875                 fprintf (fp->fp, " 34\n%f\n", dxf_dimension_get_z4 (dimension));
00876                 fprintf (fp->fp, " 15\n%f\n", dxf_dimension_get_x5 (dimension));
00877                 fprintf (fp->fp, " 25\n%f\n", dxf_dimension_get_y5 (dimension));
00878                 fprintf (fp->fp, " 35\n%f\n", dxf_dimension_get_z5 (dimension));
00879                 fprintf (fp->fp, " 16\n%f\n", dxf_dimension_get_x6 (dimension));
00880                 fprintf (fp->fp, " 26\n%f\n", dxf_dimension_get_y6 (dimension));
00881                 fprintf (fp->fp, " 36\n%f\n", dxf_dimension_get_z6 (dimension));
00882         }
00883         /* Ordinate dimension. */
00884         else if (dxf_dimension_get_flag (dimension) == 6)
00885         {
00886                 if (fp->acad_version_number >= AutoCAD_13)
00887                 {
00888                         fprintf (fp->fp, "100\nAcDbOrdinateDimension\n");
00889                 }
00890                 fprintf (fp->fp, " 13\n%f\n", dxf_dimension_get_x3 (dimension));
00891                 fprintf (fp->fp, " 23\n%f\n", dxf_dimension_get_y3 (dimension));
00892                 fprintf (fp->fp, " 33\n%f\n", dxf_dimension_get_z3 (dimension));
00893                 fprintf (fp->fp, " 14\n%f\n", dxf_dimension_get_x4 (dimension));
00894                 fprintf (fp->fp, " 24\n%f\n", dxf_dimension_get_y4 (dimension));
00895                 fprintf (fp->fp, " 34\n%f\n", dxf_dimension_get_z4 (dimension));
00896         }
00897         if (dxf_dimension_get_thickness (dimension) != 0.0)
00898         {
00899                 fprintf (fp->fp, " 39\n%f\n", dxf_dimension_get_thickness (dimension));
00900         }
00901         /* Clean up. */
00902         free (dxf_entity_name);
00903 #if DEBUG
00904         DXF_DEBUG_END
00905 #endif
00906         return (EXIT_SUCCESS);
00907 }
00908 
00909 
00917 int
00918 dxf_dimension_free
00919 (
00920         DxfDimension *dimension
00923 )
00924 {
00925 #if DEBUG
00926         DXF_DEBUG_BEGIN
00927 #endif
00928         /* Do some basic checks. */
00929         if (dimension == NULL)
00930         {
00931                 fprintf (stderr,
00932                   (_("Error in %s () a NULL pointer was passed.\n")),
00933                   __FUNCTION__);
00934                 return (EXIT_FAILURE);
00935         }
00936         if (dimension->next != NULL)
00937         {
00938                 fprintf (stderr,
00939                   (_("Error in %s () pointer to next was not NULL.\n")),
00940                   __FUNCTION__);
00941                 return (EXIT_FAILURE);
00942         }
00943         free (dimension->linetype);
00944         free (dimension->layer);
00945         free (dimension->dim_text);
00946         free (dimension->dimblock_name);
00947         free (dimension->dimstyle_name);
00948         free (dimension->dictionary_owner_soft);
00949         free (dimension->dictionary_owner_hard);
00950         free (dimension);
00951         dimension = NULL;
00952 #if DEBUG
00953         DXF_DEBUG_END
00954 #endif
00955         return (EXIT_SUCCESS);
00956 }
00957 
00958 
00963 void
00964 dxf_dimension_free_chain
00965 (
00966         DxfDimension *dimensions
00968 )
00969 {
00970 #ifdef DEBUG
00971         DXF_DEBUG_BEGIN
00972 #endif
00973         if (dimensions == NULL)
00974         {
00975                 fprintf (stderr,
00976                   (_("Error in %s () a NULL pointer was passed.\n")),
00977                   __FUNCTION__);
00978                 return;
00979         }
00980         while (dimensions != NULL)
00981         {
00982                 DxfDimension *iter = (DxfDimension *) dxf_dimension_get_next (dimensions);
00983                 dxf_dimension_free (dimensions);
00984                 dimensions = (DxfDimension *) iter;
00985         }
00986 #if DEBUG
00987         DXF_DEBUG_END
00988 #endif
00989 }
00990 
00991 
00997 int
00998 dxf_dimension_get_id_code
00999 (
01000         DxfDimension *dimension
01002 )
01003 {
01004 #if DEBUG
01005         DXF_DEBUG_BEGIN
01006 #endif
01007         /* Do some basic checks. */
01008         if (dimension == NULL)
01009         {
01010                 fprintf (stderr,
01011                   (_("Error in %s () a NULL pointer was passed.\n")),
01012                   __FUNCTION__);
01013                 return (DXF_ERROR);
01014         }
01015         if (dimension->id_code < 0)
01016         {
01017                 fprintf (stderr,
01018                   (_("Error in %s () a negative value was found in the id-code member.\n")),
01019                   __FUNCTION__);
01020                 return (DXF_ERROR);
01021         }
01022 #if DEBUG
01023         DXF_DEBUG_END
01024 #endif
01025         return (dimension->id_code);
01026 }
01027 
01028 
01035 DxfDimension *
01036 dxf_dimension_set_id_code
01037 (
01038         DxfDimension *dimension,
01040         int id_code
01044 )
01045 {
01046 #if DEBUG
01047         DXF_DEBUG_BEGIN
01048 #endif
01049         /* Do some basic checks. */
01050         if (dimension == NULL)
01051         {
01052                 fprintf (stderr,
01053                   (_("Error in %s () a NULL pointer was passed.\n")),
01054                   __FUNCTION__);
01055                 return (NULL);
01056         }
01057         if (id_code < 0)
01058         {
01059                 fprintf (stderr,
01060                   (_("Error in %s () a negative id-code value was passed.\n")),
01061                   __FUNCTION__);
01062                 return (NULL);
01063         }
01064         dimension->id_code = id_code;
01065 #if DEBUG
01066         DXF_DEBUG_END
01067 #endif
01068         return (dimension);
01069 }
01070 
01071 
01077 char *
01078 dxf_dimension_get_linetype
01079 (
01080         DxfDimension *dimension
01082 )
01083 {
01084 #if DEBUG
01085         DXF_DEBUG_BEGIN
01086 #endif
01087         /* Do some basic checks. */
01088         if (dimension == NULL)
01089         {
01090                 fprintf (stderr,
01091                   (_("Error in %s () a NULL pointer was passed.\n")),
01092                   __FUNCTION__);
01093                 return (NULL);
01094         }
01095         if (dimension->linetype ==  NULL)
01096         {
01097                 fprintf (stderr,
01098                   (_("Error in %s () a NULL pointer was found in the linetype member.\n")),
01099                   __FUNCTION__);
01100                 return (NULL);
01101         }
01102 #if DEBUG
01103         DXF_DEBUG_END
01104 #endif
01105         return (strdup (dimension->linetype));
01106 }
01107 
01108 
01115 DxfDimension *
01116 dxf_dimension_set_linetype
01117 (
01118         DxfDimension *dimension,
01120         char *linetype
01122 )
01123 {
01124 #if DEBUG
01125         DXF_DEBUG_BEGIN
01126 #endif
01127         /* Do some basic checks. */
01128         if (dimension == NULL)
01129         {
01130                 fprintf (stderr,
01131                   (_("Error in %s () a NULL pointer was passed.\n")),
01132                   __FUNCTION__);
01133                 return (NULL);
01134         }
01135         if (linetype == NULL)
01136         {
01137                 fprintf (stderr,
01138                   (_("Error in %s () a NULL pointer was passed.\n")),
01139                   __FUNCTION__);
01140                 return (NULL);
01141         }
01142         dimension->linetype = strdup (linetype);
01143 #if DEBUG
01144         DXF_DEBUG_END
01145 #endif
01146         return (dimension);
01147 }
01148 
01149 
01155 char *
01156 dxf_dimension_get_layer
01157 (
01158         DxfDimension *dimension
01160 )
01161 {
01162 #if DEBUG
01163         DXF_DEBUG_BEGIN
01164 #endif
01165         /* Do some basic checks. */
01166         if (dimension == NULL)
01167         {
01168                 fprintf (stderr,
01169                   (_("Error in %s () a NULL pointer was passed.\n")),
01170                   __FUNCTION__);
01171                 return (NULL);
01172         }
01173         if (dimension->layer ==  NULL)
01174         {
01175                 fprintf (stderr,
01176                   (_("Error in %s () a NULL pointer was found in the layer member.\n")),
01177                   __FUNCTION__);
01178                 return (NULL);
01179         }
01180 #if DEBUG
01181         DXF_DEBUG_END
01182 #endif
01183         return (strdup (dimension->layer));
01184 }
01185 
01186 
01193 DxfDimension *
01194 dxf_dimension_set_layer
01195 (
01196         DxfDimension *dimension,
01198         char *layer
01200 )
01201 {
01202 #if DEBUG
01203         DXF_DEBUG_BEGIN
01204 #endif
01205         /* Do some basic checks. */
01206         if (dimension == NULL)
01207         {
01208                 fprintf (stderr,
01209                   (_("Error in %s () a NULL pointer was passed.\n")),
01210                   __FUNCTION__);
01211                 return (NULL);
01212         }
01213         if (layer == NULL)
01214         {
01215                 fprintf (stderr,
01216                   (_("Error in %s () a NULL pointer was passed.\n")),
01217                   __FUNCTION__);
01218                 return (NULL);
01219         }
01220         dimension->layer = strdup (layer);
01221 #if DEBUG
01222         DXF_DEBUG_END
01223 #endif
01224         return (dimension);
01225 }
01226 
01227 
01233 double
01234 dxf_dimension_get_elevation
01235 (
01236         DxfDimension *dimension
01238 )
01239 {
01240 #if DEBUG
01241         DXF_DEBUG_BEGIN
01242 #endif
01243         /* Do some basic checks. */
01244         if (dimension == NULL)
01245         {
01246                 fprintf (stderr,
01247                   (_("Error in %s () a NULL pointer was passed.\n")),
01248                   __FUNCTION__);
01249                 return (EXIT_FAILURE);
01250         }
01251 #if DEBUG
01252         DXF_DEBUG_END
01253 #endif
01254         return (dimension->elevation);
01255 }
01256 
01257 
01264 DxfDimension *
01265 dxf_dimension_set_elevation
01266 (
01267         DxfDimension *dimension,
01269         double elevation
01271 )
01272 {
01273 #if DEBUG
01274         DXF_DEBUG_BEGIN
01275 #endif
01276         /* Do some basic checks. */
01277         if (dimension == NULL)
01278         {
01279                 fprintf (stderr,
01280                   (_("Error in %s () a NULL pointer was passed.\n")),
01281                   __FUNCTION__);
01282                 return (NULL);
01283         }
01284         dimension->elevation = elevation;
01285 #if DEBUG
01286         DXF_DEBUG_END
01287 #endif
01288         return (dimension);
01289 }
01290 
01291 
01297 double
01298 dxf_dimension_get_thickness
01299 (
01300         DxfDimension *dimension
01302 )
01303 {
01304 #if DEBUG
01305         DXF_DEBUG_BEGIN
01306 #endif
01307         /* Do some basic checks. */
01308         if (dimension == NULL)
01309         {
01310                 fprintf (stderr,
01311                   (_("Error in %s () a NULL pointer was passed.\n")),
01312                   __FUNCTION__);
01313                 return (EXIT_FAILURE);
01314         }
01315         if (dimension->thickness < 0.0)
01316         {
01317                 fprintf (stderr,
01318                   (_("Error in %s () a negative value was found in the thickness member.\n")),
01319                   __FUNCTION__);
01320                 return (EXIT_FAILURE);
01321         }
01322 #if DEBUG
01323         DXF_DEBUG_END
01324 #endif
01325         return (dimension->thickness);
01326 }
01327 
01328 
01335 DxfDimension *
01336 dxf_dimension_set_thickness
01337 (
01338         DxfDimension *dimension,
01340         double thickness
01342 )
01343 {
01344 #if DEBUG
01345         DXF_DEBUG_BEGIN
01346 #endif
01347         /* Do some basic checks. */
01348         if (dimension == NULL)
01349         {
01350                 fprintf (stderr,
01351                   (_("Error in %s () a NULL pointer was passed.\n")),
01352                   __FUNCTION__);
01353                 return (NULL);
01354         }
01355         if (thickness < 0.0)
01356         {
01357                 fprintf (stderr,
01358                   (_("Error in %s () a negative thickness value was passed.\n")),
01359                   __FUNCTION__);
01360                 return (NULL);
01361         }
01362         dimension->thickness = thickness;
01363 #if DEBUG
01364         DXF_DEBUG_END
01365 #endif
01366         return (dimension);
01367 }
01368 
01369 
01375 double
01376 dxf_dimension_get_linetype_scale
01377 (
01378         DxfDimension *dimension
01380 )
01381 {
01382 #if DEBUG
01383         DXF_DEBUG_BEGIN
01384 #endif
01385         /* Do some basic checks. */
01386         if (dimension == NULL)
01387         {
01388                 fprintf (stderr,
01389                   (_("Error in %s () a NULL pointer was passed.\n")),
01390                   __FUNCTION__);
01391                 return (EXIT_FAILURE);
01392         }
01393         if (dimension->linetype_scale < 0.0)
01394         {
01395                 fprintf (stderr,
01396                   (_("Error in %s () a negative value was found in the linetype scale member.\n")),
01397                   __FUNCTION__);
01398                 return (EXIT_FAILURE);
01399         }
01400 #if DEBUG
01401         DXF_DEBUG_END
01402 #endif
01403         return (dimension->linetype_scale);
01404 }
01405 
01406 
01413 DxfDimension *
01414 dxf_dimension_set_linetype_scale
01415 (
01416         DxfDimension *dimension,
01418         double linetype_scale
01420 )
01421 {
01422 #if DEBUG
01423         DXF_DEBUG_BEGIN
01424 #endif
01425         /* Do some basic checks. */
01426         if (dimension == NULL)
01427         {
01428                 fprintf (stderr,
01429                   (_("Error in %s () a NULL pointer was passed.\n")),
01430                   __FUNCTION__);
01431                 return (NULL);
01432         }
01433         if (linetype_scale < 0.0)
01434         {
01435                 fprintf (stderr,
01436                   (_("Error in %s () a negative linetype scale value was passed.\n")),
01437                   __FUNCTION__);
01438                 return (NULL);
01439         }
01440         dimension->linetype_scale = linetype_scale;
01441 #if DEBUG
01442         DXF_DEBUG_END
01443 #endif
01444         return (dimension);
01445 }
01446 
01447 
01453 int16_t
01454 dxf_dimension_get_visibility
01455 (
01456         DxfDimension *dimension
01458 )
01459 {
01460 #if DEBUG
01461         DXF_DEBUG_BEGIN
01462 #endif
01463         /* Do some basic checks. */
01464         if (dimension == NULL)
01465         {
01466                 fprintf (stderr,
01467                   (_("Error in %s () a NULL pointer was passed.\n")),
01468                   __FUNCTION__);
01469                 return (EXIT_FAILURE);
01470         }
01471         if (dimension->visibility < 0)
01472         {
01473                 fprintf (stderr,
01474                   (_("Error in %s () a negative value was found in the visibility member.\n")),
01475                   __FUNCTION__);
01476                 return (EXIT_FAILURE);
01477         }
01478         if (dimension->visibility > 1)
01479         {
01480                 fprintf (stderr,
01481                   (_("Error in %s () an out of range value was found in the visibility member.\n")),
01482                   __FUNCTION__);
01483                 return (EXIT_FAILURE);
01484         }
01485 #if DEBUG
01486         DXF_DEBUG_END
01487 #endif
01488         return (dimension->visibility);
01489 }
01490 
01491 
01498 DxfDimension *
01499 dxf_dimension_set_visibility
01500 (
01501         DxfDimension *dimension,
01503         int16_t visibility
01505 )
01506 {
01507 #if DEBUG
01508         DXF_DEBUG_BEGIN
01509 #endif
01510         /* Do some basic checks. */
01511         if (dimension == NULL)
01512         {
01513                 fprintf (stderr,
01514                   (_("Error in %s () a NULL pointer was passed.\n")),
01515                   __FUNCTION__);
01516                 return (NULL);
01517         }
01518         if (visibility < 0)
01519         {
01520                 fprintf (stderr,
01521                   (_("Error in %s () a negative visibility value was passed.\n")),
01522                   __FUNCTION__);
01523                 return (NULL);
01524         }
01525         if (visibility > 1)
01526         {
01527                 fprintf (stderr,
01528                   (_("Error in %s () an out of range visibility value was passed.\n")),
01529                   __FUNCTION__);
01530                 return (NULL);
01531         }
01532         dimension->visibility = visibility;
01533 #if DEBUG
01534         DXF_DEBUG_END
01535 #endif
01536         return (dimension);
01537 }
01538 
01539 
01545 int
01546 dxf_dimension_get_color
01547 (
01548         DxfDimension *dimension
01550 )
01551 {
01552 #if DEBUG
01553         DXF_DEBUG_BEGIN
01554 #endif
01555         /* Do some basic checks. */
01556         if (dimension == NULL)
01557         {
01558                 fprintf (stderr,
01559                   (_("Error in %s () a NULL pointer was passed.\n")),
01560                   __FUNCTION__);
01561                 return (EXIT_FAILURE);
01562         }
01563         if (dimension->color < 0)
01564         {
01565                 fprintf (stderr,
01566                   (_("Warning in %s () a negative value was found in the color member.\n")),
01567                   __FUNCTION__);
01568         }
01569 #if DEBUG
01570         DXF_DEBUG_END
01571 #endif
01572         return (dimension->color);
01573 }
01574 
01575 
01582 DxfDimension *
01583 dxf_dimension_set_color
01584 (
01585         DxfDimension *dimension,
01587         int color
01589 )
01590 {
01591 #if DEBUG
01592         DXF_DEBUG_BEGIN
01593 #endif
01594         /* Do some basic checks. */
01595         if (dimension == NULL)
01596         {
01597                 fprintf (stderr,
01598                   (_("Error in %s () a NULL pointer was passed.\n")),
01599                   __FUNCTION__);
01600                 return (NULL);
01601         }
01602         if (color < 0)
01603         {
01604                 fprintf (stderr,
01605                   (_("Warning in %s () a negative color value was passed.\n")),
01606                   __FUNCTION__);
01607                 fprintf (stderr,
01608                   (_("\teffectively turning this entity it's visibility off.\n")));
01609         }
01610         dimension->color = color;
01611 #if DEBUG
01612         DXF_DEBUG_END
01613 #endif
01614         return (dimension);
01615 }
01616 
01617 
01624 int
01625 dxf_dimension_get_paperspace
01626 (
01627         DxfDimension *dimension
01629 )
01630 {
01631 #if DEBUG
01632         DXF_DEBUG_BEGIN
01633 #endif
01634         /* Do some basic checks. */
01635         if (dimension == NULL)
01636         {
01637                 fprintf (stderr,
01638                   (_("Error in %s () a NULL pointer was passed.\n")),
01639                   __FUNCTION__);
01640                 return (EXIT_FAILURE);
01641         }
01642         if (dimension->paperspace < 0)
01643         {
01644                 fprintf (stderr,
01645                   (_("Warning in %s () a negative value was found in the paperspace member.\n")),
01646                   __FUNCTION__);
01647         }
01648         if (dimension->paperspace > 1)
01649         {
01650                 fprintf (stderr,
01651                   (_("Warning in %s () an out of range value was found in the paperspace member.\n")),
01652                   __FUNCTION__);
01653         }
01654 #if DEBUG
01655         DXF_DEBUG_END
01656 #endif
01657         return (dimension->paperspace);
01658 }
01659 
01660 
01667 DxfDimension *
01668 dxf_dimension_set_paperspace
01669 (
01670         DxfDimension *dimension,
01672         int paperspace
01674 )
01675 {
01676 #if DEBUG
01677         DXF_DEBUG_BEGIN
01678 #endif
01679         /* Do some basic checks. */
01680         if (dimension == NULL)
01681         {
01682                 fprintf (stderr,
01683                   (_("Error in %s () a NULL pointer was passed.\n")),
01684                   __FUNCTION__);
01685                 return (NULL);
01686         }
01687         if (paperspace < 0)
01688         {
01689                 fprintf (stderr,
01690                   (_("Error in %s () a negative paperspace value was passed.\n")),
01691                   __FUNCTION__);
01692                 return (NULL);
01693         }
01694         if (paperspace > 1)
01695         {
01696                 fprintf (stderr,
01697                   (_("Error in %s () an out of range paperspace value was passed.\n")),
01698                   __FUNCTION__);
01699                 return (NULL);
01700         }
01701         dimension->paperspace = paperspace;
01702 #if DEBUG
01703         DXF_DEBUG_END
01704 #endif
01705         return (dimension);
01706 }
01707 
01708 
01716 int
01717 dxf_dimension_get_graphics_data_size
01718 (
01719         DxfDimension *dimension
01721 )
01722 {
01723 #if DEBUG
01724         DXF_DEBUG_BEGIN
01725 #endif
01726         /* Do some basic checks. */
01727         if (dimension == NULL)
01728         {
01729                 fprintf (stderr,
01730                   (_("Error in %s () a NULL pointer was passed.\n")),
01731                   __FUNCTION__);
01732                 return (EXIT_FAILURE);
01733         }
01734         if (dimension->graphics_data_size < 0)
01735         {
01736                 fprintf (stderr,
01737                   (_("Warning in %s () a negative value was found in the graphics_data_size member.\n")),
01738                   __FUNCTION__);
01739         }
01740         if (dimension->graphics_data_size == 0)
01741         {
01742                 fprintf (stderr,
01743                   (_("Warning in %s () a zero value was found in the graphics_data_size member.\n")),
01744                   __FUNCTION__);
01745         }
01746 #if DEBUG
01747         DXF_DEBUG_END
01748 #endif
01749         return (dimension->graphics_data_size);
01750 }
01751 
01752 
01759 DxfDimension *
01760 dxf_dimension_set_graphics_data_size
01761 (
01762         DxfDimension *dimension,
01764         int graphics_data_size
01767 )
01768 {
01769 #if DEBUG
01770         DXF_DEBUG_BEGIN
01771 #endif
01772         /* Do some basic checks. */
01773         if (dimension == NULL)
01774         {
01775                 fprintf (stderr,
01776                   (_("Error in %s () a NULL pointer was passed.\n")),
01777                   __FUNCTION__);
01778                 return (NULL);
01779         }
01780         if (graphics_data_size < 0)
01781         {
01782                 fprintf (stderr,
01783                   (_("Error in %s () a negative graphics_data_size value was passed.\n")),
01784                   __FUNCTION__);
01785                 return (NULL);
01786         }
01787         if (graphics_data_size == 0)
01788         {
01789                 fprintf (stderr,
01790                   (_("Warning in %s () a zero graphics_data_size value was passed.\n")),
01791                   __FUNCTION__);
01792         }
01793         dimension->graphics_data_size = graphics_data_size;
01794 #if DEBUG
01795         DXF_DEBUG_END
01796 #endif
01797         return (dimension);
01798 }
01799 
01800 
01807 int16_t
01808 dxf_dimension_get_shadow_mode
01809 (
01810         DxfDimension *dimension
01812 )
01813 {
01814 #if DEBUG
01815         DXF_DEBUG_BEGIN
01816 #endif
01817         /* Do some basic checks. */
01818         if (dimension == NULL)
01819         {
01820                 fprintf (stderr,
01821                   (_("Error in %s () a NULL pointer was passed.\n")),
01822                   __FUNCTION__);
01823                 return (EXIT_FAILURE);
01824         }
01825         if (dimension->shadow_mode < 0)
01826         {
01827                 fprintf (stderr,
01828                   (_("Error in %s () a negative value was found in the shadow_mode member.\n")),
01829                   __FUNCTION__);
01830                 return (EXIT_FAILURE);
01831         }
01832         if (dimension->shadow_mode > 3)
01833         {
01834                 fprintf (stderr,
01835                   (_("Error in %s () an out of range value was found in the shadow_mode member.\n")),
01836                   __FUNCTION__);
01837                 return (EXIT_FAILURE);
01838         }
01839 #if DEBUG
01840         DXF_DEBUG_END
01841 #endif
01842         return (dimension->shadow_mode);
01843 }
01844 
01845 
01852 DxfDimension *
01853 dxf_dimension_set_shadow_mode
01854 (
01855         DxfDimension *dimension,
01857         int16_t shadow_mode
01859 )
01860 {
01861 #if DEBUG
01862         DXF_DEBUG_BEGIN
01863 #endif
01864         /* Do some basic checks. */
01865         if (dimension == NULL)
01866         {
01867                 fprintf (stderr,
01868                   (_("Error in %s () a NULL pointer was passed.\n")),
01869                   __FUNCTION__);
01870                 return (NULL);
01871         }
01872         if (shadow_mode < 0)
01873         {
01874                 fprintf (stderr,
01875                   (_("Error in %s () a negative shadow_mode value was passed.\n")),
01876                   __FUNCTION__);
01877                 return (NULL);
01878         }
01879         if (shadow_mode > 3)
01880         {
01881                 fprintf (stderr,
01882                   (_("Error in %s () an out of range shadow_mode value was passed.\n")),
01883                   __FUNCTION__);
01884                 return (NULL);
01885         }
01886         dimension->shadow_mode = shadow_mode;
01887 #if DEBUG
01888         DXF_DEBUG_END
01889 #endif
01890         return (dimension);
01891 }
01892 
01893 
01903 DxfBinaryGraphicsData *
01904 dxf_dimension_get_binary_graphics_data
01905 (
01906         DxfDimension *dimension
01908 )
01909 {
01910 #if DEBUG
01911         DXF_DEBUG_BEGIN
01912 #endif
01913         /* Do some basic checks. */
01914         if (dimension == NULL)
01915         {
01916                 fprintf (stderr,
01917                   (_("Error in %s () a NULL pointer was passed.\n")),
01918                   __FUNCTION__);
01919                 return (NULL);
01920         }
01921         if (dimension->binary_graphics_data ==  NULL)
01922         {
01923                 fprintf (stderr,
01924                   (_("Error in %s () a NULL pointer was found in the binary_graphics_data member.\n")),
01925                   __FUNCTION__);
01926                 return (NULL);
01927         }
01928 #if DEBUG
01929         DXF_DEBUG_END
01930 #endif
01931         return ((DxfBinaryGraphicsData *) dimension->binary_graphics_data);
01932 }
01933 
01934 
01942 DxfDimension *
01943 dxf_dimension_set_binary_graphics_data
01944 (
01945         DxfDimension *dimension,
01947         DxfBinaryGraphicsData *data
01950 )
01951 {
01952 #if DEBUG
01953         DXF_DEBUG_BEGIN
01954 #endif
01955         /* Do some basic checks. */
01956         if (dimension == NULL)
01957         {
01958                 fprintf (stderr,
01959                   (_("Error in %s () a NULL pointer was passed.\n")),
01960                   __FUNCTION__);
01961                 return (NULL);
01962         }
01963         if (data == NULL)
01964         {
01965                 fprintf (stderr,
01966                   (_("Error in %s () a NULL pointer was passed.\n")),
01967                   __FUNCTION__);
01968                 return (NULL);
01969         }
01970         dimension->binary_graphics_data = (DxfBinaryGraphicsData *) data;
01971 #if DEBUG
01972         DXF_DEBUG_END
01973 #endif
01974         return (dimension);
01975 }
01976 
01977 
01987 char *
01988 dxf_dimension_get_dictionary_owner_soft
01989 (
01990         DxfDimension *dimension
01992 )
01993 {
01994 #if DEBUG
01995         DXF_DEBUG_BEGIN
01996 #endif
01997         /* Do some basic checks. */
01998         if (dimension == NULL)
01999         {
02000                 fprintf (stderr,
02001                   (_("Error in %s () a NULL pointer was passed.\n")),
02002                   __FUNCTION__);
02003                 return (NULL);
02004         }
02005         if (dimension->dictionary_owner_soft ==  NULL)
02006         {
02007                 fprintf (stderr,
02008                   (_("Error in %s () a NULL pointer was found in the dictionary_owner_soft member.\n")),
02009                   __FUNCTION__);
02010                 return (NULL);
02011         }
02012 #if DEBUG
02013         DXF_DEBUG_END
02014 #endif
02015         return (strdup (dimension->dictionary_owner_soft));
02016 }
02017 
02018 
02026 DxfDimension *
02027 dxf_dimension_set_dictionary_owner_soft
02028 (
02029         DxfDimension *dimension,
02031         char *dictionary_owner_soft
02034 )
02035 {
02036 #if DEBUG
02037         DXF_DEBUG_BEGIN
02038 #endif
02039         /* Do some basic checks. */
02040         if (dimension == NULL)
02041         {
02042                 fprintf (stderr,
02043                   (_("Error in %s () a NULL pointer was passed.\n")),
02044                   __FUNCTION__);
02045                 return (NULL);
02046         }
02047         if (dictionary_owner_soft == NULL)
02048         {
02049                 fprintf (stderr,
02050                   (_("Error in %s () a NULL pointer was passed.\n")),
02051                   __FUNCTION__);
02052                 return (NULL);
02053         }
02054         dimension->dictionary_owner_soft = strdup (dictionary_owner_soft);
02055 #if DEBUG
02056         DXF_DEBUG_END
02057 #endif
02058         return (dimension);
02059 }
02060 
02061 
02070 char *
02071 dxf_dimension_get_material
02072 (
02073         DxfDimension *dimension
02075 )
02076 {
02077 #if DEBUG
02078         DXF_DEBUG_BEGIN
02079 #endif
02080         /* Do some basic checks. */
02081         if (dimension == NULL)
02082         {
02083                 fprintf (stderr,
02084                   (_("Error in %s () a NULL pointer was passed.\n")),
02085                   __FUNCTION__);
02086                 return (NULL);
02087         }
02088         if (dimension->material ==  NULL)
02089         {
02090                 fprintf (stderr,
02091                   (_("Error in %s () a NULL pointer was found in the material member.\n")),
02092                   __FUNCTION__);
02093                 return (NULL);
02094         }
02095 #if DEBUG
02096         DXF_DEBUG_END
02097 #endif
02098         return (strdup (dimension->material));
02099 }
02100 
02101 
02109 DxfDimension *
02110 dxf_dimension_set_material
02111 (
02112         DxfDimension *dimension,
02114         char *material
02117 )
02118 {
02119 #if DEBUG
02120         DXF_DEBUG_BEGIN
02121 #endif
02122         /* Do some basic checks. */
02123         if (dimension == NULL)
02124         {
02125                 fprintf (stderr,
02126                   (_("Error in %s () a NULL pointer was passed.\n")),
02127                   __FUNCTION__);
02128                 return (NULL);
02129         }
02130         if (material == NULL)
02131         {
02132                 fprintf (stderr,
02133                   (_("Error in %s () a NULL pointer was passed.\n")),
02134                   __FUNCTION__);
02135                 return (NULL);
02136         }
02137         dimension->material = strdup (material);
02138 #if DEBUG
02139         DXF_DEBUG_END
02140 #endif
02141         return (dimension);
02142 }
02143 
02144 
02154 char *
02155 dxf_dimension_get_dictionary_owner_hard
02156 (
02157         DxfDimension *dimension
02159 )
02160 {
02161 #if DEBUG
02162         DXF_DEBUG_BEGIN
02163 #endif
02164         /* Do some basic checks. */
02165         if (dimension == NULL)
02166         {
02167                 fprintf (stderr,
02168                   (_("Error in %s () a NULL pointer was passed.\n")),
02169                   __FUNCTION__);
02170                 return (NULL);
02171         }
02172         if (dimension->dictionary_owner_hard ==  NULL)
02173         {
02174                 fprintf (stderr,
02175                   (_("Error in %s () a NULL pointer was found in the dictionary_owner_hard member.\n")),
02176                   __FUNCTION__);
02177                 return (NULL);
02178         }
02179 #if DEBUG
02180         DXF_DEBUG_END
02181 #endif
02182         return (strdup (dimension->dictionary_owner_hard));
02183 }
02184 
02185 
02193 DxfDimension *
02194 dxf_dimension_set_dictionary_owner_hard
02195 (
02196         DxfDimension *dimension,
02198         char *dictionary_owner_hard
02201 )
02202 {
02203 #if DEBUG
02204         DXF_DEBUG_BEGIN
02205 #endif
02206         /* Do some basic checks. */
02207         if (dimension == NULL)
02208         {
02209                 fprintf (stderr,
02210                   (_("Error in %s () a NULL pointer was passed.\n")),
02211                   __FUNCTION__);
02212                 return (NULL);
02213         }
02214         if (dictionary_owner_hard == NULL)
02215         {
02216                 fprintf (stderr,
02217                   (_("Error in %s () a NULL pointer was passed.\n")),
02218                   __FUNCTION__);
02219                 return (NULL);
02220         }
02221         dimension->dictionary_owner_hard = strdup (dictionary_owner_hard);
02222 #if DEBUG
02223         DXF_DEBUG_END
02224 #endif
02225         return (dimension);
02226 }
02227 
02228 
02235 int16_t
02236 dxf_dimension_get_lineweight
02237 (
02238         DxfDimension *dimension
02240 )
02241 {
02242 #if DEBUG
02243         DXF_DEBUG_BEGIN
02244 #endif
02245         /* Do some basic checks. */
02246         if (dimension == NULL)
02247         {
02248                 fprintf (stderr,
02249                   (_("Error in %s () a NULL pointer was passed.\n")),
02250                   __FUNCTION__);
02251                 return (EXIT_FAILURE);
02252         }
02253 #if DEBUG
02254         DXF_DEBUG_END
02255 #endif
02256         return (dimension->lineweight);
02257 }
02258 
02259 
02266 DxfDimension *
02267 dxf_dimension_set_lineweight
02268 (
02269         DxfDimension *dimension,
02271         int16_t lineweight
02273 )
02274 {
02275 #if DEBUG
02276         DXF_DEBUG_BEGIN
02277 #endif
02278         /* Do some basic checks. */
02279         if (dimension == NULL)
02280         {
02281                 fprintf (stderr,
02282                   (_("Error in %s () a NULL pointer was passed.\n")),
02283                   __FUNCTION__);
02284                 return (NULL);
02285         }
02286         dimension->lineweight = lineweight;
02287 #if DEBUG
02288         DXF_DEBUG_END
02289 #endif
02290         return (dimension);
02291 }
02292 
02293 
02300 char *
02301 dxf_dimension_get_plot_style_name
02302 (
02303         DxfDimension *dimension
02305 )
02306 {
02307 #if DEBUG
02308         DXF_DEBUG_BEGIN
02309 #endif
02310         /* Do some basic checks. */
02311         if (dimension == NULL)
02312         {
02313                 fprintf (stderr,
02314                   (_("Error in %s () a NULL pointer was passed.\n")),
02315                   __FUNCTION__);
02316                 return (NULL);
02317         }
02318         if (dimension->plot_style_name ==  NULL)
02319         {
02320                 fprintf (stderr,
02321                   (_("Error in %s () a NULL pointer was found in the plot_style_name member.\n")),
02322                   __FUNCTION__);
02323                 return (NULL);
02324         }
02325 #if DEBUG
02326         DXF_DEBUG_END
02327 #endif
02328         return (strdup (dimension->plot_style_name));
02329 }
02330 
02331 
02338 DxfDimension *
02339 dxf_dimension_set_plot_style_name
02340 (
02341         DxfDimension *dimension,
02343         char *plot_style_name
02346 )
02347 {
02348 #if DEBUG
02349         DXF_DEBUG_BEGIN
02350 #endif
02351         /* Do some basic checks. */
02352         if (dimension == NULL)
02353         {
02354                 fprintf (stderr,
02355                   (_("Error in %s () a NULL pointer was passed.\n")),
02356                   __FUNCTION__);
02357                 return (NULL);
02358         }
02359         if (plot_style_name == NULL)
02360         {
02361                 fprintf (stderr,
02362                   (_("Error in %s () a NULL pointer was passed.\n")),
02363                   __FUNCTION__);
02364                 return (NULL);
02365         }
02366         dimension->plot_style_name = strdup (plot_style_name);
02367 #if DEBUG
02368         DXF_DEBUG_END
02369 #endif
02370         return (dimension);
02371 }
02372 
02373 
02380 long
02381 dxf_dimension_get_color_value
02382 (
02383         DxfDimension *dimension
02385 )
02386 {
02387 #if DEBUG
02388         DXF_DEBUG_BEGIN
02389 #endif
02390         /* Do some basic checks. */
02391         if (dimension == NULL)
02392         {
02393                 fprintf (stderr,
02394                   (_("Error in %s () a NULL pointer was passed.\n")),
02395                   __FUNCTION__);
02396                 return (EXIT_FAILURE);
02397         }
02398 #if DEBUG
02399         DXF_DEBUG_END
02400 #endif
02401         return (dimension->color_value);
02402 }
02403 
02404 
02411 DxfDimension *
02412 dxf_dimension_set_color_value
02413 (
02414         DxfDimension *dimension,
02416         long color_value
02418 )
02419 {
02420 #if DEBUG
02421         DXF_DEBUG_BEGIN
02422 #endif
02423         /* Do some basic checks. */
02424         if (dimension == NULL)
02425         {
02426                 fprintf (stderr,
02427                   (_("Error in %s () a NULL pointer was passed.\n")),
02428                   __FUNCTION__);
02429                 return (NULL);
02430         }
02431         dimension->color_value = color_value;
02432 #if DEBUG
02433         DXF_DEBUG_END
02434 #endif
02435         return (dimension);
02436 }
02437 
02438 
02445 char *
02446 dxf_dimension_get_color_name
02447 (
02448         DxfDimension *dimension
02450 )
02451 {
02452 #if DEBUG
02453         DXF_DEBUG_BEGIN
02454 #endif
02455         /* Do some basic checks. */
02456         if (dimension == NULL)
02457         {
02458                 fprintf (stderr,
02459                   (_("Error in %s () a NULL pointer was passed.\n")),
02460                   __FUNCTION__);
02461                 return (NULL);
02462         }
02463         if (dimension->color_name ==  NULL)
02464         {
02465                 fprintf (stderr,
02466                   (_("Error in %s () a NULL pointer was found in the color_name member.\n")),
02467                   __FUNCTION__);
02468                 return (NULL);
02469         }
02470 #if DEBUG
02471         DXF_DEBUG_END
02472 #endif
02473         return (strdup (dimension->color_name));
02474 }
02475 
02476 
02483 DxfDimension *
02484 dxf_dimension_set_color_name
02485 (
02486         DxfDimension *dimension,
02488         char *color_name
02491 )
02492 {
02493 #if DEBUG
02494         DXF_DEBUG_BEGIN
02495 #endif
02496         /* Do some basic checks. */
02497         if (dimension == NULL)
02498         {
02499                 fprintf (stderr,
02500                   (_("Error in %s () a NULL pointer was passed.\n")),
02501                   __FUNCTION__);
02502                 return (NULL);
02503         }
02504         if (color_name == NULL)
02505         {
02506                 fprintf (stderr,
02507                   (_("Error in %s () a NULL pointer was passed.\n")),
02508                   __FUNCTION__);
02509                 return (NULL);
02510         }
02511         dimension->color_name = strdup (color_name);
02512 #if DEBUG
02513         DXF_DEBUG_END
02514 #endif
02515         return (dimension);
02516 }
02517 
02518 
02525 long
02526 dxf_dimension_get_transparency
02527 (
02528         DxfDimension *dimension
02530 )
02531 {
02532 #if DEBUG
02533         DXF_DEBUG_BEGIN
02534 #endif
02535         /* Do some basic checks. */
02536         if (dimension == NULL)
02537         {
02538                 fprintf (stderr,
02539                   (_("Error in %s () a NULL pointer was passed.\n")),
02540                   __FUNCTION__);
02541                 return (EXIT_FAILURE);
02542         }
02543 #if DEBUG
02544         DXF_DEBUG_END
02545 #endif
02546         return (dimension->transparency);
02547 }
02548 
02549 
02556 DxfDimension *
02557 dxf_dimension_set_transparency
02558 (
02559         DxfDimension *dimension,
02561         long transparency
02563 )
02564 {
02565 #if DEBUG
02566         DXF_DEBUG_BEGIN
02567 #endif
02568         /* Do some basic checks. */
02569         if (dimension == NULL)
02570         {
02571                 fprintf (stderr,
02572                   (_("Error in %s () a NULL pointer was passed.\n")),
02573                   __FUNCTION__);
02574                 return (NULL);
02575         }
02576         dimension->transparency = transparency;
02577 #if DEBUG
02578         DXF_DEBUG_END
02579 #endif
02580         return (dimension);
02581 }
02582 
02583 
02590 char *
02591 dxf_dimension_get_dim_text
02592 (
02593         DxfDimension *dimension
02595 )
02596 {
02597 #if DEBUG
02598         DXF_DEBUG_BEGIN
02599 #endif
02600         /* Do some basic checks. */
02601         if (dimension == NULL)
02602         {
02603                 fprintf (stderr,
02604                   (_("Error in %s () a NULL pointer was passed.\n")),
02605                   __FUNCTION__);
02606                 return (NULL);
02607         }
02608         if (dimension->dim_text ==  NULL)
02609         {
02610                 fprintf (stderr,
02611                   (_("Error in %s () a NULL pointer was found in the dim_text member.\n")),
02612                   __FUNCTION__);
02613                 return (NULL);
02614         }
02615 #if DEBUG
02616         DXF_DEBUG_END
02617 #endif
02618         return (strdup (dimension->dim_text));
02619 }
02620 
02621 
02628 DxfDimension *
02629 dxf_dimension_set_dim_text
02630 (
02631         DxfDimension *dimension,
02633         char *dim_text
02635 )
02636 {
02637 #if DEBUG
02638         DXF_DEBUG_BEGIN
02639 #endif
02640         /* Do some basic checks. */
02641         if (dimension == NULL)
02642         {
02643                 fprintf (stderr,
02644                   (_("Error in %s () a NULL pointer was passed.\n")),
02645                   __FUNCTION__);
02646                 return (NULL);
02647         }
02648         if (dim_text == NULL)
02649         {
02650                 fprintf (stderr,
02651                   (_("Error in %s () a NULL pointer was passed.\n")),
02652                   __FUNCTION__);
02653                 return (NULL);
02654         }
02655         dimension->dim_text = strdup (dim_text);
02656 #if DEBUG
02657         DXF_DEBUG_END
02658 #endif
02659         return (dimension);
02660 }
02661 
02662 
02669 char *
02670 dxf_dimension_get_dimblock_name
02671 (
02672         DxfDimension *dimension
02674 )
02675 {
02676 #if DEBUG
02677         DXF_DEBUG_BEGIN
02678 #endif
02679         /* Do some basic checks. */
02680         if (dimension == NULL)
02681         {
02682                 fprintf (stderr,
02683                   (_("Error in %s () a NULL pointer was passed.\n")),
02684                   __FUNCTION__);
02685                 return (NULL);
02686         }
02687         if (dimension->dimblock_name ==  NULL)
02688         {
02689                 fprintf (stderr,
02690                   (_("Error in %s () a NULL pointer was found in the dimblock_name member.\n")),
02691                   __FUNCTION__);
02692                 return (NULL);
02693         }
02694 #if DEBUG
02695         DXF_DEBUG_END
02696 #endif
02697         return (strdup (dimension->dimblock_name));
02698 }
02699 
02700 
02707 DxfDimension *
02708 dxf_dimension_set_dimblock_name
02709 (
02710         DxfDimension *dimension,
02712         char *dimblock_name
02714 )
02715 {
02716 #if DEBUG
02717         DXF_DEBUG_BEGIN
02718 #endif
02719         /* Do some basic checks. */
02720         if (dimension == NULL)
02721         {
02722                 fprintf (stderr,
02723                   (_("Error in %s () a NULL pointer was passed.\n")),
02724                   __FUNCTION__);
02725                 return (NULL);
02726         }
02727         if (dimblock_name == NULL)
02728         {
02729                 fprintf (stderr,
02730                   (_("Error in %s () a NULL pointer was passed.\n")),
02731                   __FUNCTION__);
02732                 return (NULL);
02733         }
02734         dimension->dimblock_name = strdup (dimblock_name);
02735 #if DEBUG
02736         DXF_DEBUG_END
02737 #endif
02738         return (dimension);
02739 }
02740 
02741 
02748 char *
02749 dxf_dimension_get_dimstyle_name
02750 (
02751         DxfDimension *dimension
02753 )
02754 {
02755 #if DEBUG
02756         DXF_DEBUG_BEGIN
02757 #endif
02758         /* Do some basic checks. */
02759         if (dimension == NULL)
02760         {
02761                 fprintf (stderr,
02762                   (_("Error in %s () a NULL pointer was passed.\n")),
02763                   __FUNCTION__);
02764                 return (NULL);
02765         }
02766         if (dimension->dimstyle_name ==  NULL)
02767         {
02768                 fprintf (stderr,
02769                   (_("Error in %s () a NULL pointer was found in the dimstyle_name member.\n")),
02770                   __FUNCTION__);
02771                 return (NULL);
02772         }
02773 #if DEBUG
02774         DXF_DEBUG_END
02775 #endif
02776         return (strdup (dimension->dimstyle_name));
02777 }
02778 
02779 
02786 DxfDimension *
02787 dxf_dimension_set_dimstyle_name
02788 (
02789         DxfDimension *dimension,
02791         char *dimstyle_name
02793 )
02794 {
02795 #if DEBUG
02796         DXF_DEBUG_BEGIN
02797 #endif
02798         /* Do some basic checks. */
02799         if (dimension == NULL)
02800         {
02801                 fprintf (stderr,
02802                   (_("Error in %s () a NULL pointer was passed.\n")),
02803                   __FUNCTION__);
02804                 return (NULL);
02805         }
02806         if (dimstyle_name == NULL)
02807         {
02808                 fprintf (stderr,
02809                   (_("Error in %s () a NULL pointer was passed.\n")),
02810                   __FUNCTION__);
02811                 return (NULL);
02812         }
02813         dimension->dimblock_name = strdup (dimstyle_name);
02814 #if DEBUG
02815         DXF_DEBUG_END
02816 #endif
02817         return (dimension);
02818 }
02819 
02820 
02828 DxfPoint *
02829 dxf_dimension_get_p0
02830 (
02831         DxfDimension *dimension
02833 )
02834 {
02835 #ifdef DEBUG
02836         DXF_DEBUG_BEGIN
02837 #endif
02838         /* Do some basic checks. */
02839         if (dimension == NULL)
02840         {
02841                 fprintf (stderr,
02842                   (_("Error in %s () a NULL pointer was passed.\n")),
02843                   __FUNCTION__);
02844                 return (NULL);
02845         }
02846         if (dimension->p0 == NULL)
02847         {
02848                 fprintf (stderr,
02849                   (_("Error in %s () a NULL pointer was passed.\n")),
02850                   __FUNCTION__);
02851                 return (NULL);
02852         }
02853 #if DEBUG
02854         DXF_DEBUG_END
02855 #endif
02856         return (dimension->p0);
02857 }
02858 
02859 
02867 DxfDimension *
02868 dxf_dimension_set_p0
02869 (
02870         DxfDimension *dimension,
02872         DxfPoint *p0
02874 )
02875 {
02876 #ifdef DEBUG
02877         DXF_DEBUG_BEGIN
02878 #endif
02879         /* Do some basic checks. */
02880         if (dimension == NULL)
02881         {
02882                 fprintf (stderr,
02883                   (_("Error in %s () a NULL pointer was passed.\n")),
02884                   __FUNCTION__);
02885                 return (NULL);
02886         }
02887         if (p0 == NULL)
02888         {
02889                 fprintf (stderr,
02890                   (_("Error in %s () a NULL pointer was passed.\n")),
02891                   __FUNCTION__);
02892                 return (NULL);
02893         }
02894         dimension->p0 = (DxfPoint *) p0;
02895 #if DEBUG
02896         DXF_DEBUG_END
02897 #endif
02898         return (dimension);
02899 }
02900 
02901 
02909 double
02910 dxf_dimension_get_x0
02911 (
02912         DxfDimension *dimension
02914 )
02915 {
02916 #ifdef DEBUG
02917         DXF_DEBUG_BEGIN
02918 #endif
02919         /* Do some basic checks. */
02920         if (dimension == NULL)
02921         {
02922                 fprintf (stderr,
02923                   (_("Error in %s () a NULL pointer was passed.\n")),
02924                   __FUNCTION__);
02925                 return (EXIT_FAILURE);
02926         }
02927         if (dimension->p0 == NULL)
02928         {
02929               fprintf (stderr,
02930                   (_("Error in %s () a NULL pointer was found.\n")),
02931                 __FUNCTION__);
02932               return (EXIT_FAILURE);
02933         }
02934 #if DEBUG
02935         DXF_DEBUG_END
02936 #endif
02937         return (dimension->p0->x0);
02938 }
02939 
02940 
02948 DxfDimension *
02949 dxf_dimension_set_x0
02950 (
02951         DxfDimension *dimension,
02953         double x0
02955 )
02956 {
02957 #ifdef DEBUG
02958         DXF_DEBUG_BEGIN
02959 #endif
02960         /* Do some basic checks. */
02961         if (dimension == NULL)
02962         {
02963                 fprintf (stderr,
02964                   (_("Error in %s () a NULL pointer was passed.\n")),
02965                   __FUNCTION__);
02966                 return (NULL);
02967         }
02968         if (dimension->p0 == NULL)
02969         {
02970                 fprintf (stderr,
02971                   (_("Error in %s () a NULL pointer was found.\n")),
02972                   __FUNCTION__);
02973                 return (NULL);
02974         }
02975         dimension->p0->x0 = x0;
02976 #if DEBUG
02977         DXF_DEBUG_END
02978 #endif
02979         return (dimension);
02980 }
02981 
02982 
02990 double
02991 dxf_dimension_get_y0
02992 (
02993         DxfDimension *dimension
02995 )
02996 {
02997 #ifdef DEBUG
02998         DXF_DEBUG_BEGIN
02999 #endif
03000         /* Do some basic checks. */
03001         if (dimension == NULL)
03002         {
03003                 fprintf (stderr,
03004                   (_("Error in %s () a NULL pointer was passed.\n")),
03005                   __FUNCTION__);
03006                 return (EXIT_FAILURE);
03007         }
03008         if (dimension->p0 == NULL)
03009         {
03010               fprintf (stderr,
03011                   (_("Error in %s () a NULL pointer was found.\n")),
03012                 __FUNCTION__);
03013               return (EXIT_FAILURE);
03014         }
03015 #if DEBUG
03016         DXF_DEBUG_END
03017 #endif
03018         return (dimension->p0->y0);
03019 }
03020 
03021 
03029 DxfDimension *
03030 dxf_dimension_set_y0
03031 (
03032         DxfDimension *dimension,
03034         double y0
03036 )
03037 {
03038 #ifdef DEBUG
03039         DXF_DEBUG_BEGIN
03040 #endif
03041         /* Do some basic checks. */
03042         if (dimension == NULL)
03043         {
03044                 fprintf (stderr,
03045                   (_("Error in %s () a NULL pointer was passed.\n")),
03046                   __FUNCTION__);
03047                 return (NULL);
03048         }
03049         if (dimension->p0 == NULL)
03050         {
03051                 fprintf (stderr,
03052                   (_("Error in %s () a NULL pointer was found.\n")),
03053                   __FUNCTION__);
03054                 return (NULL);
03055         }
03056         dimension->p0->y0 = y0;
03057 #if DEBUG
03058         DXF_DEBUG_END
03059 #endif
03060         return (dimension);
03061 }
03062 
03063 
03071 double
03072 dxf_dimension_get_z0
03073 (
03074         DxfDimension *dimension
03076 )
03077 {
03078 #ifdef DEBUG
03079         DXF_DEBUG_BEGIN
03080 #endif
03081         /* Do some basic checks. */
03082         if (dimension == NULL)
03083         {
03084                 fprintf (stderr,
03085                   (_("Error in %s () a NULL pointer was passed.\n")),
03086                   __FUNCTION__);
03087                 return (EXIT_FAILURE);
03088         }
03089         if (dimension->p0 == NULL)
03090         {
03091               fprintf (stderr,
03092                   (_("Error in %s () a NULL pointer was found.\n")),
03093                 __FUNCTION__);
03094               return (EXIT_FAILURE);
03095         }
03096 #if DEBUG
03097         DXF_DEBUG_END
03098 #endif
03099         return (dimension->p0->z0);
03100 }
03101 
03102 
03110 DxfDimension *
03111 dxf_dimension_set_z0
03112 (
03113         DxfDimension *dimension,
03115         double z0
03117 )
03118 {
03119 #ifdef DEBUG
03120         DXF_DEBUG_BEGIN
03121 #endif
03122         /* Do some basic checks. */
03123         if (dimension == NULL)
03124         {
03125                 fprintf (stderr,
03126                   (_("Error in %s () a NULL pointer was passed.\n")),
03127                   __FUNCTION__);
03128                 return (NULL);
03129         }
03130         if (dimension->p0 == NULL)
03131         {
03132                 fprintf (stderr,
03133                   (_("Error in %s () a NULL pointer was found.\n")),
03134                   __FUNCTION__);
03135                 return (NULL);
03136         }
03137         dimension->p0->z0 = z0;
03138 #if DEBUG
03139         DXF_DEBUG_END
03140 #endif
03141         return (dimension);
03142 }
03143 
03144 
03152 DxfPoint *
03153 dxf_dimension_get_p1
03154 (
03155         DxfDimension *dimension
03157 )
03158 {
03159 #ifdef DEBUG
03160         DXF_DEBUG_BEGIN
03161 #endif
03162         /* Do some basic checks. */
03163         if (dimension == NULL)
03164         {
03165                 fprintf (stderr,
03166                   (_("Error in %s () a NULL pointer was passed.\n")),
03167                   __FUNCTION__);
03168                 return (NULL);
03169         }
03170         if (dimension->p1 == NULL)
03171         {
03172                 fprintf (stderr,
03173                   (_("Error in %s () a NULL pointer was passed.\n")),
03174                   __FUNCTION__);
03175                 return (NULL);
03176         }
03177 #if DEBUG
03178         DXF_DEBUG_END
03179 #endif
03180         return (dimension->p1);
03181 }
03182 
03183 
03191 DxfDimension *
03192 dxf_dimension_set_p1
03193 (
03194         DxfDimension *dimension,
03196         DxfPoint *p1
03198 )
03199 {
03200 #ifdef DEBUG
03201         DXF_DEBUG_BEGIN
03202 #endif
03203         /* Do some basic checks. */
03204         if (dimension == NULL)
03205         {
03206                 fprintf (stderr,
03207                   (_("Error in %s () a NULL pointer was passed.\n")),
03208                   __FUNCTION__);
03209                 return (NULL);
03210         }
03211         if (p1 == NULL)
03212         {
03213                 fprintf (stderr,
03214                   (_("Error in %s () a NULL pointer was passed.\n")),
03215                   __FUNCTION__);
03216                 return (NULL);
03217         }
03218         dimension->p1 = (DxfPoint *) p1;
03219 #if DEBUG
03220         DXF_DEBUG_END
03221 #endif
03222         return (dimension);
03223 }
03224 
03225 
03233 double
03234 dxf_dimension_get_x1
03235 (
03236         DxfDimension *dimension
03238 )
03239 {
03240 #ifdef DEBUG
03241         DXF_DEBUG_BEGIN
03242 #endif
03243         /* Do some basic checks. */
03244         if (dimension == NULL)
03245         {
03246                 fprintf (stderr,
03247                   (_("Error in %s () a NULL pointer was passed.\n")),
03248                   __FUNCTION__);
03249                 return (EXIT_FAILURE);
03250         }
03251         if (dimension->p1 == NULL)
03252         {
03253               fprintf (stderr,
03254                   (_("Error in %s () a NULL pointer was found.\n")),
03255                 __FUNCTION__);
03256               return (EXIT_FAILURE);
03257         }
03258 #if DEBUG
03259         DXF_DEBUG_END
03260 #endif
03261         return (dimension->p1->x0);
03262 }
03263 
03264 
03272 DxfDimension *
03273 dxf_dimension_set_x1
03274 (
03275         DxfDimension *dimension,
03277         double x1
03279 )
03280 {
03281 #ifdef DEBUG
03282         DXF_DEBUG_BEGIN
03283 #endif
03284         /* Do some basic checks. */
03285         if (dimension == NULL)
03286         {
03287                 fprintf (stderr,
03288                   (_("Error in %s () a NULL pointer was passed.\n")),
03289                   __FUNCTION__);
03290                 return (NULL);
03291         }
03292         if (dimension->p1 == NULL)
03293         {
03294                 fprintf (stderr,
03295                   (_("Error in %s () a NULL pointer was found.\n")),
03296                   __FUNCTION__);
03297                 return (NULL);
03298         }
03299         dimension->p1->x0 = x1;
03300 #if DEBUG
03301         DXF_DEBUG_END
03302 #endif
03303         return (dimension);
03304 }
03305 
03306 
03314 double
03315 dxf_dimension_get_y1
03316 (
03317         DxfDimension *dimension
03319 )
03320 {
03321 #ifdef DEBUG
03322         DXF_DEBUG_BEGIN
03323 #endif
03324         /* Do some basic checks. */
03325         if (dimension == NULL)
03326         {
03327                 fprintf (stderr,
03328                   (_("Error in %s () a NULL pointer was passed.\n")),
03329                   __FUNCTION__);
03330                 return (EXIT_FAILURE);
03331         }
03332         if (dimension->p1 == NULL)
03333         {
03334               fprintf (stderr,
03335                   (_("Error in %s () a NULL pointer was found.\n")),
03336                 __FUNCTION__);
03337               return (EXIT_FAILURE);
03338         }
03339 #if DEBUG
03340         DXF_DEBUG_END
03341 #endif
03342         return (dimension->p1->y0);
03343 }
03344 
03345 
03353 DxfDimension *
03354 dxf_dimension_set_y1
03355 (
03356         DxfDimension *dimension,
03358         double y1
03360 )
03361 {
03362 #ifdef DEBUG
03363         DXF_DEBUG_BEGIN
03364 #endif
03365         /* Do some basic checks. */
03366         if (dimension == NULL)
03367         {
03368                 fprintf (stderr,
03369                   (_("Error in %s () a NULL pointer was passed.\n")),
03370                   __FUNCTION__);
03371                 return (NULL);
03372         }
03373         if (dimension->p1 == NULL)
03374         {
03375                 fprintf (stderr,
03376                   (_("Error in %s () a NULL pointer was found.\n")),
03377                   __FUNCTION__);
03378                 return (NULL);
03379         }
03380         dimension->p1->y0 = y1;
03381 #if DEBUG
03382         DXF_DEBUG_END
03383 #endif
03384         return (dimension);
03385 }
03386 
03387 
03396 double
03397 dxf_dimension_get_z1
03398 (
03399         DxfDimension *dimension
03401 )
03402 {
03403 #ifdef DEBUG
03404         DXF_DEBUG_BEGIN
03405 #endif
03406         /* Do some basic checks. */
03407         if (dimension == NULL)
03408         {
03409                 fprintf (stderr,
03410                   (_("Error in %s () a NULL pointer was passed.\n")),
03411                   __FUNCTION__);
03412                 return (EXIT_FAILURE);
03413         }
03414         if (dimension->p1 == NULL)
03415         {
03416               fprintf (stderr,
03417                   (_("Error in %s () a NULL pointer was found.\n")),
03418                 __FUNCTION__);
03419               return (EXIT_FAILURE);
03420         }
03421 #if DEBUG
03422         DXF_DEBUG_END
03423 #endif
03424         return (dimension->p1->z0);
03425 }
03426 
03427 
03435 DxfDimension *
03436 dxf_dimension_set_z1
03437 (
03438         DxfDimension *dimension,
03440         double z1
03442 )
03443 {
03444 #ifdef DEBUG
03445         DXF_DEBUG_BEGIN
03446 #endif
03447         /* Do some basic checks. */
03448         if (dimension == NULL)
03449         {
03450                 fprintf (stderr,
03451                   (_("Error in %s () a NULL pointer was passed.\n")),
03452                   __FUNCTION__);
03453                 return (NULL);
03454         }
03455         if (dimension->p1 == NULL)
03456         {
03457                 fprintf (stderr,
03458                   (_("Error in %s () a NULL pointer was found.\n")),
03459                   __FUNCTION__);
03460                 return (NULL);
03461         }
03462         dimension->p1->z0 = z1;
03463 #if DEBUG
03464         DXF_DEBUG_END
03465 #endif
03466         return (dimension);
03467 }
03468 
03469 
03477 DxfPoint *
03478 dxf_dimension_get_p2
03479 (
03480         DxfDimension *dimension
03482 )
03483 {
03484 #ifdef DEBUG
03485         DXF_DEBUG_BEGIN
03486 #endif
03487         /* Do some basic checks. */
03488         if (dimension == NULL)
03489         {
03490                 fprintf (stderr,
03491                   (_("Error in %s () a NULL pointer was passed.\n")),
03492                   __FUNCTION__);
03493                 return (NULL);
03494         }
03495         if (dimension->p2 == NULL)
03496         {
03497                 fprintf (stderr,
03498                   (_("Error in %s () a NULL pointer was passed.\n")),
03499                   __FUNCTION__);
03500                 return (NULL);
03501         }
03502 #if DEBUG
03503         DXF_DEBUG_END
03504 #endif
03505         return (dimension->p2);
03506 }
03507 
03508 
03516 DxfDimension *
03517 dxf_dimension_set_p2
03518 (
03519         DxfDimension *dimension,
03521         DxfPoint *p2
03523 )
03524 {
03525 #ifdef DEBUG
03526         DXF_DEBUG_BEGIN
03527 #endif
03528         /* Do some basic checks. */
03529         if (dimension == NULL)
03530         {
03531                 fprintf (stderr,
03532                   (_("Error in %s () a NULL pointer was passed.\n")),
03533                   __FUNCTION__);
03534                 return (NULL);
03535         }
03536         if (p2 == NULL)
03537         {
03538                 fprintf (stderr,
03539                   (_("Error in %s () a NULL pointer was passed.\n")),
03540                   __FUNCTION__);
03541                 return (NULL);
03542         }
03543         dimension->p2 = (DxfPoint *) p2;
03544 #if DEBUG
03545         DXF_DEBUG_END
03546 #endif
03547         return (dimension);
03548 }
03549 
03550 
03558 double
03559 dxf_dimension_get_x2
03560 (
03561         DxfDimension *dimension
03563 )
03564 {
03565 #ifdef DEBUG
03566         DXF_DEBUG_BEGIN
03567 #endif
03568         /* Do some basic checks. */
03569         if (dimension == NULL)
03570         {
03571                 fprintf (stderr,
03572                   (_("Error in %s () a NULL pointer was passed.\n")),
03573                   __FUNCTION__);
03574                 return (EXIT_FAILURE);
03575         }
03576         if (dimension->p2 == NULL)
03577         {
03578               fprintf (stderr,
03579                   (_("Error in %s () a NULL pointer was found.\n")),
03580                 __FUNCTION__);
03581               return (EXIT_FAILURE);
03582         }
03583 #if DEBUG
03584         DXF_DEBUG_END
03585 #endif
03586         return (dimension->p2->x0);
03587 }
03588 
03589 
03597 DxfDimension *
03598 dxf_dimension_set_x2
03599 (
03600         DxfDimension *dimension,
03602         double x2
03604 )
03605 {
03606 #ifdef DEBUG
03607         DXF_DEBUG_BEGIN
03608 #endif
03609         /* Do some basic checks. */
03610         if (dimension == NULL)
03611         {
03612                 fprintf (stderr,
03613                   (_("Error in %s () a NULL pointer was passed.\n")),
03614                   __FUNCTION__);
03615                 return (NULL);
03616         }
03617         if (dimension->p2 == NULL)
03618         {
03619                 fprintf (stderr,
03620                   (_("Error in %s () a NULL pointer was found.\n")),
03621                   __FUNCTION__);
03622                 return (NULL);
03623         }
03624         dimension->p2->x0 = x2;
03625 #if DEBUG
03626         DXF_DEBUG_END
03627 #endif
03628         return (dimension);
03629 }
03630 
03631 
03639 double
03640 dxf_dimension_get_y2
03641 (
03642         DxfDimension *dimension
03644 )
03645 {
03646 #ifdef DEBUG
03647         DXF_DEBUG_BEGIN
03648 #endif
03649         /* Do some basic checks. */
03650         if (dimension == NULL)
03651         {
03652                 fprintf (stderr,
03653                   (_("Error in %s () a NULL pointer was passed.\n")),
03654                   __FUNCTION__);
03655                 return (EXIT_FAILURE);
03656         }
03657         if (dimension->p2 == NULL)
03658         {
03659               fprintf (stderr,
03660                   (_("Error in %s () a NULL pointer was found.\n")),
03661                 __FUNCTION__);
03662               return (EXIT_FAILURE);
03663         }
03664 #if DEBUG
03665         DXF_DEBUG_END
03666 #endif
03667         return (dimension->p2->y0);
03668 }
03669 
03670 
03678 DxfDimension *
03679 dxf_dimension_set_y2
03680 (
03681         DxfDimension *dimension,
03683         double y2
03686 )
03687 {
03688 #ifdef DEBUG
03689         DXF_DEBUG_BEGIN
03690 #endif
03691         /* Do some basic checks. */
03692         if (dimension == NULL)
03693         {
03694                 fprintf (stderr,
03695                   (_("Error in %s () a NULL pointer was passed.\n")),
03696                   __FUNCTION__);
03697                 return (NULL);
03698         }
03699         if (dimension->p2 == NULL)
03700         {
03701                 fprintf (stderr,
03702                   (_("Error in %s () a NULL pointer was found.\n")),
03703                   __FUNCTION__);
03704                 return (NULL);
03705         }
03706         dimension->p2->y0 = y2;
03707 #if DEBUG
03708         DXF_DEBUG_END
03709 #endif
03710         return (dimension);
03711 }
03712 
03713 
03721 double
03722 dxf_dimension_get_z2
03723 (
03724         DxfDimension *dimension
03726 )
03727 {
03728 #ifdef DEBUG
03729         DXF_DEBUG_BEGIN
03730 #endif
03731         /* Do some basic checks. */
03732         if (dimension == NULL)
03733         {
03734                 fprintf (stderr,
03735                   (_("Error in %s () a NULL pointer was passed.\n")),
03736                   __FUNCTION__);
03737                 return (EXIT_FAILURE);
03738         }
03739         if (dimension->p2 == NULL)
03740         {
03741               fprintf (stderr,
03742                   (_("Error in %s () a NULL pointer was found.\n")),
03743                 __FUNCTION__);
03744               return (EXIT_FAILURE);
03745         }
03746 #if DEBUG
03747         DXF_DEBUG_END
03748 #endif
03749         return (dimension->p2->z0);
03750 }
03751 
03752 
03760 DxfDimension *
03761 dxf_dimension_set_z2
03762 (
03763         DxfDimension *dimension,
03765         double z2
03767 )
03768 {
03769 #ifdef DEBUG
03770         DXF_DEBUG_BEGIN
03771 #endif
03772         /* Do some basic checks. */
03773         if (dimension == NULL)
03774         {
03775                 fprintf (stderr,
03776                   (_("Error in %s () a NULL pointer was passed.\n")),
03777                   __FUNCTION__);
03778                 return (NULL);
03779         }
03780         if (dimension->p2 == NULL)
03781         {
03782                 fprintf (stderr,
03783                   (_("Error in %s () a NULL pointer was found.\n")),
03784                   __FUNCTION__);
03785                 return (NULL);
03786         }
03787         dimension->p2->z0 = z2;
03788 #if DEBUG
03789         DXF_DEBUG_END
03790 #endif
03791         return (dimension);
03792 }
03793 
03794 
03802 DxfPoint *
03803 dxf_dimension_get_p3
03804 (
03805         DxfDimension *dimension
03807 )
03808 {
03809 #ifdef DEBUG
03810         DXF_DEBUG_BEGIN
03811 #endif
03812         /* Do some basic checks. */
03813         if (dimension == NULL)
03814         {
03815                 fprintf (stderr,
03816                   (_("Error in %s () a NULL pointer was passed.\n")),
03817                   __FUNCTION__);
03818                 return (NULL);
03819         }
03820         if (dimension->p3 == NULL)
03821         {
03822                 fprintf (stderr,
03823                   (_("Error in %s () a NULL pointer was passed.\n")),
03824                   __FUNCTION__);
03825                 return (NULL);
03826         }
03827 #if DEBUG
03828         DXF_DEBUG_END
03829 #endif
03830         return (dimension->p3);
03831 }
03832 
03833 
03841 DxfDimension *
03842 dxf_dimension_set_p3
03843 (
03844         DxfDimension *dimension,
03846         DxfPoint *p3
03848 )
03849 {
03850 #ifdef DEBUG
03851         DXF_DEBUG_BEGIN
03852 #endif
03853         /* Do some basic checks. */
03854         if (dimension == NULL)
03855         {
03856                 fprintf (stderr,
03857                   (_("Error in %s () a NULL pointer was passed.\n")),
03858                   __FUNCTION__);
03859                 return (NULL);
03860         }
03861         if (p3 == NULL)
03862         {
03863                 fprintf (stderr,
03864                   (_("Error in %s () a NULL pointer was passed.\n")),
03865                   __FUNCTION__);
03866                 return (NULL);
03867         }
03868         dimension->p3 = (DxfPoint *) p3;
03869 #if DEBUG
03870         DXF_DEBUG_END
03871 #endif
03872         return (dimension);
03873 }
03874 
03875 
03883 double
03884 dxf_dimension_get_x3
03885 (
03886         DxfDimension *dimension
03888 )
03889 {
03890 #ifdef DEBUG
03891         DXF_DEBUG_BEGIN
03892 #endif
03893         /* Do some basic checks. */
03894         if (dimension == NULL)
03895         {
03896                 fprintf (stderr,
03897                   (_("Error in %s () a NULL pointer was passed.\n")),
03898                   __FUNCTION__);
03899                 return (EXIT_FAILURE);
03900         }
03901         if (dimension->p3 == NULL)
03902         {
03903               fprintf (stderr,
03904                   (_("Error in %s () a NULL pointer was found.\n")),
03905                 __FUNCTION__);
03906               return (EXIT_FAILURE);
03907         }
03908 #if DEBUG
03909         DXF_DEBUG_END
03910 #endif
03911         return (dimension->p3->x0);
03912 }
03913 
03914 
03922 DxfDimension *
03923 dxf_dimension_set_x3
03924 (
03925         DxfDimension *dimension,
03927         double x3
03930 )
03931 {
03932 #ifdef DEBUG
03933         DXF_DEBUG_BEGIN
03934 #endif
03935         /* Do some basic checks. */
03936         if (dimension == NULL)
03937         {
03938                 fprintf (stderr,
03939                   (_("Error in %s () a NULL pointer was passed.\n")),
03940                   __FUNCTION__);
03941                 return (NULL);
03942         }
03943         if (dimension->p3 == NULL)
03944         {
03945                 fprintf (stderr,
03946                   (_("Error in %s () a NULL pointer was found.\n")),
03947                   __FUNCTION__);
03948                 return (NULL);
03949         }
03950         dimension->p3->x0 = x3;
03951 #if DEBUG
03952         DXF_DEBUG_END
03953 #endif
03954         return (dimension);
03955 }
03956 
03957 
03965 double
03966 dxf_dimension_get_y3
03967 (
03968         DxfDimension *dimension
03970 )
03971 {
03972 #ifdef DEBUG
03973         DXF_DEBUG_BEGIN
03974 #endif
03975         /* Do some basic checks. */
03976         if (dimension == NULL)
03977         {
03978                 fprintf (stderr,
03979                   (_("Error in %s () a NULL pointer was passed.\n")),
03980                   __FUNCTION__);
03981                 return (EXIT_FAILURE);
03982         }
03983         if (dimension->p3 == NULL)
03984         {
03985               fprintf (stderr,
03986                   (_("Error in %s () a NULL pointer was found.\n")),
03987                 __FUNCTION__);
03988               return (EXIT_FAILURE);
03989         }
03990 #if DEBUG
03991         DXF_DEBUG_END
03992 #endif
03993         return (dimension->p3->y0);
03994 }
03995 
03996 
04004 DxfDimension *
04005 dxf_dimension_set_y3
04006 (
04007         DxfDimension *dimension,
04009         double y3
04012 )
04013 {
04014 #ifdef DEBUG
04015         DXF_DEBUG_BEGIN
04016 #endif
04017         /* Do some basic checks. */
04018         if (dimension == NULL)
04019         {
04020                 fprintf (stderr,
04021                   (_("Error in %s () a NULL pointer was passed.\n")),
04022                   __FUNCTION__);
04023                 return (NULL);
04024         }
04025         if (dimension->p3 == NULL)
04026         {
04027                 fprintf (stderr,
04028                   (_("Error in %s () a NULL pointer was found.\n")),
04029                   __FUNCTION__);
04030                 return (NULL);
04031         }
04032         dimension->p3->y0 = y3;
04033 #if DEBUG
04034         DXF_DEBUG_END
04035 #endif
04036         return (dimension);
04037 }
04038 
04039 
04047 double
04048 dxf_dimension_get_z3
04049 (
04050         DxfDimension *dimension
04052 )
04053 {
04054 #ifdef DEBUG
04055         DXF_DEBUG_BEGIN
04056 #endif
04057         /* Do some basic checks. */
04058         if (dimension == NULL)
04059         {
04060                 fprintf (stderr,
04061                   (_("Error in %s () a NULL pointer was passed.\n")),
04062                   __FUNCTION__);
04063                 return (EXIT_FAILURE);
04064         }
04065         if (dimension->p3 == NULL)
04066         {
04067               fprintf (stderr,
04068                   (_("Error in %s () a NULL pointer was found.\n")),
04069                 __FUNCTION__);
04070               return (EXIT_FAILURE);
04071         }
04072 #if DEBUG
04073         DXF_DEBUG_END
04074 #endif
04075         return (dimension->p3->z0);
04076 }
04077 
04078 
04086 DxfDimension *
04087 dxf_dimension_set_z3
04088 (
04089         DxfDimension *dimension,
04091         double z3
04094 )
04095 {
04096 #ifdef DEBUG
04097         DXF_DEBUG_BEGIN
04098 #endif
04099         /* Do some basic checks. */
04100         if (dimension == NULL)
04101         {
04102                 fprintf (stderr,
04103                   (_("Error in %s () a NULL pointer was passed.\n")),
04104                   __FUNCTION__);
04105                 return (NULL);
04106         }
04107         if (dimension->p3 == NULL)
04108         {
04109                 fprintf (stderr,
04110                   (_("Error in %s () a NULL pointer was found.\n")),
04111                   __FUNCTION__);
04112                 return (NULL);
04113         }
04114         dimension->p3->z0 = z3;
04115 #if DEBUG
04116         DXF_DEBUG_END
04117 #endif
04118         return (dimension);
04119 }
04120 
04121 
04129 DxfPoint *
04130 dxf_dimension_get_p4
04131 (
04132         DxfDimension *dimension
04134 )
04135 {
04136 #ifdef DEBUG
04137         DXF_DEBUG_BEGIN
04138 #endif
04139         /* Do some basic checks. */
04140         if (dimension == NULL)
04141         {
04142                 fprintf (stderr,
04143                   (_("Error in %s () a NULL pointer was passed.\n")),
04144                   __FUNCTION__);
04145                 return (NULL);
04146         }
04147         if (dimension->p4 == NULL)
04148         {
04149                 fprintf (stderr,
04150                   (_("Error in %s () a NULL pointer was found.\n")),
04151                   __FUNCTION__);
04152                 return (NULL);
04153         }
04154 #if DEBUG
04155         DXF_DEBUG_END
04156 #endif
04157         return (dimension->p4);
04158 }
04159 
04160 
04168 DxfDimension *
04169 dxf_dimension_set_p4
04170 (
04171         DxfDimension *dimension,
04173         DxfPoint *p4
04175 )
04176 {
04177 #ifdef DEBUG
04178         DXF_DEBUG_BEGIN
04179 #endif
04180         /* Do some basic checks. */
04181         if (dimension == NULL)
04182         {
04183                 fprintf (stderr,
04184                   (_("Error in %s () a NULL pointer was passed.\n")),
04185                   __FUNCTION__);
04186                 return (NULL);
04187         }
04188         if (p4 == NULL)
04189         {
04190                 fprintf (stderr,
04191                   (_("Error in %s () a NULL pointer was passed.\n")),
04192                   __FUNCTION__);
04193                 return (NULL);
04194         }
04195         dimension->p4 = (DxfPoint *) p4;
04196 #if DEBUG
04197         DXF_DEBUG_END
04198 #endif
04199         return (dimension);
04200 }
04201 
04202 
04210 double
04211 dxf_dimension_get_x4
04212 (
04213         DxfDimension *dimension
04215 )
04216 {
04217 #ifdef DEBUG
04218         DXF_DEBUG_BEGIN
04219 #endif
04220         /* Do some basic checks. */
04221         if (dimension == NULL)
04222         {
04223                 fprintf (stderr,
04224                   (_("Error in %s () a NULL pointer was passed.\n")),
04225                   __FUNCTION__);
04226                 return (EXIT_FAILURE);
04227         }
04228         if (dimension->p4 == NULL)
04229         {
04230               fprintf (stderr,
04231                   (_("Error in %s () a NULL pointer was found.\n")),
04232                 __FUNCTION__);
04233               return (EXIT_FAILURE);
04234         }
04235 #if DEBUG
04236         DXF_DEBUG_END
04237 #endif
04238         return (dimension->p4->x0);
04239 }
04240 
04241 
04249 DxfDimension *
04250 dxf_dimension_set_x4
04251 (
04252         DxfDimension *dimension,
04254         double x4
04256 )
04257 {
04258 #ifdef DEBUG
04259         DXF_DEBUG_BEGIN
04260 #endif
04261         /* Do some basic checks. */
04262         if (dimension == NULL)
04263         {
04264                 fprintf (stderr,
04265                   (_("Error in %s () a NULL pointer was passed.\n")),
04266                   __FUNCTION__);
04267                 return (NULL);
04268         }
04269         if (dimension->p4 == NULL)
04270         {
04271                 fprintf (stderr,
04272                   (_("Error in %s () a NULL pointer was found.\n")),
04273                   __FUNCTION__);
04274                 return (NULL);
04275         }
04276         dimension->p4->x0 = x4;
04277 #if DEBUG
04278         DXF_DEBUG_END
04279 #endif
04280         return (dimension);
04281 }
04282 
04283 
04291 double
04292 dxf_dimension_get_y4
04293 (
04294         DxfDimension *dimension
04296 )
04297 {
04298 #ifdef DEBUG
04299         DXF_DEBUG_BEGIN
04300 #endif
04301         /* Do some basic checks. */
04302         if (dimension == NULL)
04303         {
04304                 fprintf (stderr,
04305                   (_("Error in %s () a NULL pointer was passed.\n")),
04306                   __FUNCTION__);
04307                 return (EXIT_FAILURE);
04308         }
04309         if (dimension->p4 == NULL)
04310         {
04311               fprintf (stderr,
04312                   (_("Error in %s () a NULL pointer was found.\n")),
04313                 __FUNCTION__);
04314               return (EXIT_FAILURE);
04315         }
04316 #if DEBUG
04317         DXF_DEBUG_END
04318 #endif
04319         return (dimension->p4->y0);
04320 }
04321 
04322 
04330 DxfDimension *
04331 dxf_dimension_set_y4
04332 (
04333         DxfDimension *dimension,
04335         double y4
04337 )
04338 {
04339 #ifdef DEBUG
04340         DXF_DEBUG_BEGIN
04341 #endif
04342         /* Do some basic checks. */
04343         if (dimension == NULL)
04344         {
04345                 fprintf (stderr,
04346                   (_("Error in %s () a NULL pointer was passed.\n")),
04347                   __FUNCTION__);
04348                 return (NULL);
04349         }
04350         if (dimension->p4 == NULL)
04351         {
04352                 fprintf (stderr,
04353                   (_("Error in %s () a NULL pointer was found.\n")),
04354                   __FUNCTION__);
04355                 return (NULL);
04356         }
04357         dimension->p4->y0 = y4;
04358 #if DEBUG
04359         DXF_DEBUG_END
04360 #endif
04361         return (dimension);
04362 }
04363 
04364 
04372 double
04373 dxf_dimension_get_z4
04374 (
04375         DxfDimension *dimension
04377 )
04378 {
04379 #ifdef DEBUG
04380         DXF_DEBUG_BEGIN
04381 #endif
04382         /* Do some basic checks. */
04383         if (dimension == NULL)
04384         {
04385                 fprintf (stderr,
04386                   (_("Error in %s () a NULL pointer was passed.\n")),
04387                   __FUNCTION__);
04388                 return (EXIT_FAILURE);
04389         }
04390         if (dimension->p4 == NULL)
04391         {
04392               fprintf (stderr,
04393                   (_("Error in %s () a NULL pointer was found.\n")),
04394                 __FUNCTION__);
04395               return (EXIT_FAILURE);
04396         }
04397 #if DEBUG
04398         DXF_DEBUG_END
04399 #endif
04400         return (dimension->p4->z0);
04401 }
04402 
04403 
04411 DxfDimension *
04412 dxf_dimension_set_z4
04413 (
04414         DxfDimension *dimension,
04416         double z4
04418 )
04419 {
04420 #ifdef DEBUG
04421         DXF_DEBUG_BEGIN
04422 #endif
04423         /* Do some basic checks. */
04424         if (dimension == NULL)
04425         {
04426                 fprintf (stderr,
04427                   (_("Error in %s () a NULL pointer was passed.\n")),
04428                   __FUNCTION__);
04429                 return (NULL);
04430         }
04431         if (dimension->p4 == NULL)
04432         {
04433                 fprintf (stderr,
04434                   (_("Error in %s () a NULL pointer was found.\n")),
04435                   __FUNCTION__);
04436                 return (NULL);
04437         }
04438         dimension->p4->z0 = z4;
04439 #if DEBUG
04440         DXF_DEBUG_END
04441 #endif
04442         return (dimension);
04443 }
04444 
04445 
04453 DxfPoint *
04454 dxf_dimension_get_p5
04455 (
04456         DxfDimension *dimension
04458 )
04459 {
04460 #ifdef DEBUG
04461         DXF_DEBUG_BEGIN
04462 #endif
04463         /* Do some basic checks. */
04464         if (dimension == NULL)
04465         {
04466                 fprintf (stderr,
04467                   (_("Error in %s () a NULL pointer was passed.\n")),
04468                   __FUNCTION__);
04469                 return (NULL);
04470         }
04471         if (dimension->p5 == NULL)
04472         {
04473                 fprintf (stderr,
04474                   (_("Error in %s () a NULL pointer was found.\n")),
04475                   __FUNCTION__);
04476                 return (NULL);
04477         }
04478 #if DEBUG
04479         DXF_DEBUG_END
04480 #endif
04481         return (dimension->p5);
04482 }
04483 
04484 
04492 DxfDimension *
04493 dxf_dimension_set_p5
04494 (
04495         DxfDimension *dimension,
04497         DxfPoint *p5
04499 )
04500 {
04501 #ifdef DEBUG
04502         DXF_DEBUG_BEGIN
04503 #endif
04504         /* Do some basic checks. */
04505         if (dimension == NULL)
04506         {
04507                 fprintf (stderr,
04508                   (_("Error in %s () a NULL pointer was passed.\n")),
04509                   __FUNCTION__);
04510                 return (NULL);
04511         }
04512         if (p5 == NULL)
04513         {
04514                 fprintf (stderr,
04515                   (_("Error in %s () a NULL pointer was passed.\n")),
04516                   __FUNCTION__);
04517                 return (NULL);
04518         }
04519         dimension->p5 = (DxfPoint *) p5;
04520 #if DEBUG
04521         DXF_DEBUG_END
04522 #endif
04523         return (dimension);
04524 }
04525 
04526 
04534 double
04535 dxf_dimension_get_x5
04536 (
04537         DxfDimension *dimension
04539 )
04540 {
04541 #ifdef DEBUG
04542         DXF_DEBUG_BEGIN
04543 #endif
04544         /* Do some basic checks. */
04545         if (dimension == NULL)
04546         {
04547                 fprintf (stderr,
04548                   (_("Error in %s () a NULL pointer was passed.\n")),
04549                   __FUNCTION__);
04550                 return (EXIT_FAILURE);
04551         }
04552         if (dimension->p5 == NULL)
04553         {
04554               fprintf (stderr,
04555                   (_("Error in %s () a NULL pointer was found.\n")),
04556                 __FUNCTION__);
04557               return (EXIT_FAILURE);
04558         }
04559 #if DEBUG
04560         DXF_DEBUG_END
04561 #endif
04562         return (dimension->p5->x0);
04563 }
04564 
04565 
04573 DxfDimension *
04574 dxf_dimension_set_x5
04575 (
04576         DxfDimension *dimension,
04578         double x5
04580 )
04581 {
04582 #ifdef DEBUG
04583         DXF_DEBUG_BEGIN
04584 #endif
04585         /* Do some basic checks. */
04586         if (dimension == NULL)
04587         {
04588                 fprintf (stderr,
04589                   (_("Error in %s () a NULL pointer was passed.\n")),
04590                   __FUNCTION__);
04591                 return (NULL);
04592         }
04593         if (dimension->p5 == NULL)
04594         {
04595                 fprintf (stderr,
04596                   (_("Error in %s () a NULL pointer was found.\n")),
04597                   __FUNCTION__);
04598                 return (NULL);
04599         }
04600         dimension->p5->x0 = x5;
04601 #if DEBUG
04602         DXF_DEBUG_END
04603 #endif
04604         return (dimension);
04605 }
04606 
04607 
04615 double
04616 dxf_dimension_get_y5
04617 (
04618         DxfDimension *dimension
04620 )
04621 {
04622 #ifdef DEBUG
04623         DXF_DEBUG_BEGIN
04624 #endif
04625         /* Do some basic checks. */
04626         if (dimension == NULL)
04627         {
04628                 fprintf (stderr,
04629                   (_("Error in %s () a NULL pointer was passed.\n")),
04630                   __FUNCTION__);
04631                 return (EXIT_FAILURE);
04632         }
04633         if (dimension->p5 == NULL)
04634         {
04635               fprintf (stderr,
04636                   (_("Error in %s () a NULL pointer was found.\n")),
04637                 __FUNCTION__);
04638               return (EXIT_FAILURE);
04639         }
04640 #if DEBUG
04641         DXF_DEBUG_END
04642 #endif
04643         return (dimension->p5->y0);
04644 }
04645 
04646 
04654 DxfDimension *
04655 dxf_dimension_set_y5
04656 (
04657         DxfDimension *dimension,
04659         double y5
04661 )
04662 {
04663 #ifdef DEBUG
04664         DXF_DEBUG_BEGIN
04665 #endif
04666         /* Do some basic checks. */
04667         if (dimension == NULL)
04668         {
04669                 fprintf (stderr,
04670                   (_("Error in %s () a NULL pointer was passed.\n")),
04671                   __FUNCTION__);
04672                 return (NULL);
04673         }
04674         if (dimension->p5 == NULL)
04675         {
04676                 fprintf (stderr,
04677                   (_("Error in %s () a NULL pointer was found.\n")),
04678                   __FUNCTION__);
04679                 return (NULL);
04680         }
04681         dimension->p5->y0 = y5;
04682 #if DEBUG
04683         DXF_DEBUG_END
04684 #endif
04685         return (dimension);
04686 }
04687 
04688 
04696 double
04697 dxf_dimension_get_z5
04698 (
04699         DxfDimension *dimension
04701 )
04702 {
04703 #ifdef DEBUG
04704         DXF_DEBUG_BEGIN
04705 #endif
04706         /* Do some basic checks. */
04707         if (dimension == NULL)
04708         {
04709                 fprintf (stderr,
04710                   (_("Error in %s () a NULL pointer was passed.\n")),
04711                   __FUNCTION__);
04712                 return (EXIT_FAILURE);
04713         }
04714         if (dimension->p5 == NULL)
04715         {
04716               fprintf (stderr,
04717                   (_("Error in %s () a NULL pointer was found.\n")),
04718                 __FUNCTION__);
04719               return (EXIT_FAILURE);
04720         }
04721 #if DEBUG
04722         DXF_DEBUG_END
04723 #endif
04724         return (dimension->p5->z0);
04725 }
04726 
04727 
04735 DxfDimension *
04736 dxf_dimension_set_z5
04737 (
04738         DxfDimension *dimension,
04740         double z5
04742 )
04743 {
04744 #ifdef DEBUG
04745         DXF_DEBUG_BEGIN
04746 #endif
04747         /* Do some basic checks. */
04748         if (dimension == NULL)
04749         {
04750                 fprintf (stderr,
04751                   (_("Error in %s () a NULL pointer was passed.\n")),
04752                   __FUNCTION__);
04753                 return (NULL);
04754         }
04755         if (dimension->p5 == NULL)
04756         {
04757                 fprintf (stderr,
04758                   (_("Error in %s () a NULL pointer was found.\n")),
04759                   __FUNCTION__);
04760                 return (NULL);
04761         }
04762         dimension->p5->z0 = z5;
04763 #if DEBUG
04764         DXF_DEBUG_END
04765 #endif
04766         return (dimension);
04767 }
04768 
04769 
04777 DxfPoint *
04778 dxf_dimension_get_p6
04779 (
04780         DxfDimension *dimension
04782 )
04783 {
04784 #ifdef DEBUG
04785         DXF_DEBUG_BEGIN
04786 #endif
04787         /* Do some basic checks. */
04788         if (dimension == NULL)
04789         {
04790                 fprintf (stderr,
04791                   (_("Error in %s () a NULL pointer was passed.\n")),
04792                   __FUNCTION__);
04793                 return (NULL);
04794         }
04795         if (dimension->p6 == NULL)
04796         {
04797                 fprintf (stderr,
04798                   (_("Error in %s () a NULL pointer was found.\n")),
04799                   __FUNCTION__);
04800                 return (NULL);
04801         }
04802 #if DEBUG
04803         DXF_DEBUG_END
04804 #endif
04805         return (dimension->p6);
04806 }
04807 
04808 
04816 DxfDimension *
04817 dxf_dimension_set_p6
04818 (
04819         DxfDimension *dimension,
04821         DxfPoint *p6
04823 )
04824 {
04825 #ifdef DEBUG
04826         DXF_DEBUG_BEGIN
04827 #endif
04828         /* Do some basic checks. */
04829         if (dimension == NULL)
04830         {
04831                 fprintf (stderr,
04832                   (_("Error in %s () a NULL pointer was passed.\n")),
04833                   __FUNCTION__);
04834                 return (NULL);
04835         }
04836         if (p6 == NULL)
04837         {
04838                 fprintf (stderr,
04839                   (_("Error in %s () a NULL pointer was passed.\n")),
04840                   __FUNCTION__);
04841                 return (NULL);
04842         }
04843         dimension->p6 = (DxfPoint *) p6;
04844 #if DEBUG
04845         DXF_DEBUG_END
04846 #endif
04847         return (dimension);
04848 }
04849 
04850 
04858 double
04859 dxf_dimension_get_x6
04860 (
04861         DxfDimension *dimension
04863 )
04864 {
04865 #ifdef DEBUG
04866         DXF_DEBUG_BEGIN
04867 #endif
04868         /* Do some basic checks. */
04869         if (dimension == NULL)
04870         {
04871                 fprintf (stderr,
04872                   (_("Error in %s () a NULL pointer was passed.\n")),
04873                   __FUNCTION__);
04874                 return (EXIT_FAILURE);
04875         }
04876         if (dimension->p6 == NULL)
04877         {
04878               fprintf (stderr,
04879                   (_("Error in %s () a NULL pointer was found.\n")),
04880                 __FUNCTION__);
04881               return (EXIT_FAILURE);
04882         }
04883 #if DEBUG
04884         DXF_DEBUG_END
04885 #endif
04886         return (dimension->p6->x0);
04887 }
04888 
04889 
04897 DxfDimension *
04898 dxf_dimension_set_x6
04899 (
04900         DxfDimension *dimension,
04902         double x6
04904 )
04905 {
04906 #ifdef DEBUG
04907         DXF_DEBUG_BEGIN
04908 #endif
04909         /* Do some basic checks. */
04910         if (dimension == NULL)
04911         {
04912                 fprintf (stderr,
04913                   (_("Error in %s () a NULL pointer was passed.\n")),
04914                   __FUNCTION__);
04915                 return (NULL);
04916         }
04917         if (dimension->p6 == NULL)
04918         {
04919                 fprintf (stderr,
04920                   (_("Error in %s () a NULL pointer was found.\n")),
04921                   __FUNCTION__);
04922                 return (NULL);
04923         }
04924         dimension->p6->x0 = x6;
04925 #if DEBUG
04926         DXF_DEBUG_END
04927 #endif
04928         return (dimension);
04929 }
04930 
04931 
04939 double
04940 dxf_dimension_get_y6
04941 (
04942         DxfDimension *dimension
04944 )
04945 {
04946 #ifdef DEBUG
04947         DXF_DEBUG_BEGIN
04948 #endif
04949         /* Do some basic checks. */
04950         if (dimension == NULL)
04951         {
04952                 fprintf (stderr,
04953                   (_("Error in %s () a NULL pointer was passed.\n")),
04954                   __FUNCTION__);
04955                 return (EXIT_FAILURE);
04956         }
04957         if (dimension->p6 == NULL)
04958         {
04959               fprintf (stderr,
04960                   (_("Error in %s () a NULL pointer was found.\n")),
04961                 __FUNCTION__);
04962               return (EXIT_FAILURE);
04963         }
04964 #if DEBUG
04965         DXF_DEBUG_END
04966 #endif
04967         return (dimension->p6->y0);
04968 }
04969 
04970 
04978 DxfDimension *
04979 dxf_dimension_set_y6
04980 (
04981         DxfDimension *dimension,
04983         double y6
04985 )
04986 {
04987 #ifdef DEBUG
04988         DXF_DEBUG_BEGIN
04989 #endif
04990         /* Do some basic checks. */
04991         if (dimension == NULL)
04992         {
04993                 fprintf (stderr,
04994                   (_("Error in %s () a NULL pointer was passed.\n")),
04995                   __FUNCTION__);
04996                 return (NULL);
04997         }
04998         if (dimension->p6 == NULL)
04999         {
05000                 fprintf (stderr,
05001                   (_("Error in %s () a NULL pointer was found.\n")),
05002                   __FUNCTION__);
05003                 return (NULL);
05004         }
05005         dimension->p6->y0 = y6;
05006 #if DEBUG
05007         DXF_DEBUG_END
05008 #endif
05009         return (dimension);
05010 }
05011 
05012 
05020 double
05021 dxf_dimension_get_z6
05022 (
05023         DxfDimension *dimension
05025 )
05026 {
05027 #ifdef DEBUG
05028         DXF_DEBUG_BEGIN
05029 #endif
05030         /* Do some basic checks. */
05031         if (dimension == NULL)
05032         {
05033                 fprintf (stderr,
05034                   (_("Error in %s () a NULL pointer was passed.\n")),
05035                   __FUNCTION__);
05036                 return (EXIT_FAILURE);
05037         }
05038         if (dimension->p6 == NULL)
05039         {
05040               fprintf (stderr,
05041                   (_("Error in %s () a NULL pointer was found.\n")),
05042                 __FUNCTION__);
05043               return (EXIT_FAILURE);
05044         }
05045 #if DEBUG
05046         DXF_DEBUG_END
05047 #endif
05048         return (dimension->p6->z0);
05049 }
05050 
05051 
05059 DxfDimension *
05060 dxf_dimension_set_z6
05061 (
05062         DxfDimension *dimension,
05064         double z6
05066 )
05067 {
05068 #ifdef DEBUG
05069         DXF_DEBUG_BEGIN
05070 #endif
05071         /* Do some basic checks. */
05072         if (dimension == NULL)
05073         {
05074                 fprintf (stderr,
05075                   (_("Error in %s () a NULL pointer was passed.\n")),
05076                   __FUNCTION__);
05077                 return (NULL);
05078         }
05079         if (dimension->p6 == NULL)
05080         {
05081                 fprintf (stderr,
05082                   (_("Error in %s () a NULL pointer was found.\n")),
05083                   __FUNCTION__);
05084                 return (NULL);
05085         }
05086         dimension->p6->z0 = z6;
05087 #if DEBUG
05088         DXF_DEBUG_END
05089 #endif
05090         return (dimension);
05091 }
05092 
05093 
05099 double
05100 dxf_dimension_get_leader_length
05101 (
05102         DxfDimension *dimension
05104 )
05105 {
05106 #if DEBUG
05107         DXF_DEBUG_BEGIN
05108 #endif
05109         /* Do some basic checks. */
05110         if (dimension == NULL)
05111         {
05112                 fprintf (stderr,
05113                   (_("Error in %s () a NULL pointer was passed.\n")),
05114                   __FUNCTION__);
05115                 return (EXIT_FAILURE);
05116         }
05117 #if DEBUG
05118         DXF_DEBUG_END
05119 #endif
05120         return (dimension->leader_length);
05121 }
05122 
05123 
05130 DxfDimension *
05131 dxf_dimension_set_leader_length
05132 (
05133         DxfDimension *dimension,
05135         double leader_length
05137 )
05138 {
05139 #if DEBUG
05140         DXF_DEBUG_BEGIN
05141 #endif
05142         /* Do some basic checks. */
05143         if (dimension == NULL)
05144         {
05145                 fprintf (stderr,
05146                   (_("Error in %s () a NULL pointer was passed.\n")),
05147                   __FUNCTION__);
05148                 return (NULL);
05149         }
05150         dimension->leader_length = leader_length;
05151 #if DEBUG
05152         DXF_DEBUG_END
05153 #endif
05154         return (dimension);
05155 }
05156 
05157 
05165 double
05166 dxf_dimension_get_text_line_spacing_factor
05167 (
05168         DxfDimension *dimension
05170 )
05171 {
05172 #if DEBUG
05173         DXF_DEBUG_BEGIN
05174 #endif
05175         /* Do some basic checks. */
05176         if (dimension == NULL)
05177         {
05178                 fprintf (stderr,
05179                   (_("Error in %s () a NULL pointer was passed.\n")),
05180                   __FUNCTION__);
05181                 return (EXIT_FAILURE);
05182         }
05183 #if DEBUG
05184         DXF_DEBUG_END
05185 #endif
05186         return (dimension->text_line_spacing_factor);
05187 }
05188 
05189 
05197 DxfDimension *
05198 dxf_dimension_set_text_line_spacing_factor
05199 (
05200         DxfDimension *dimension,
05202         double text_line_spacing_factor
05204 )
05205 {
05206 #if DEBUG
05207         DXF_DEBUG_BEGIN
05208 #endif
05209         /* Do some basic checks. */
05210         if (dimension == NULL)
05211         {
05212                 fprintf (stderr,
05213                   (_("Error in %s () a NULL pointer was passed.\n")),
05214                   __FUNCTION__);
05215                 return (NULL);
05216         }
05217         dimension->text_line_spacing_factor = text_line_spacing_factor;
05218 #if DEBUG
05219         DXF_DEBUG_END
05220 #endif
05221         return (dimension);
05222 }
05223 
05224 
05231 double
05232 dxf_dimension_get_actual_measurement
05233 (
05234         DxfDimension *dimension
05236 )
05237 {
05238 #if DEBUG
05239         DXF_DEBUG_BEGIN
05240 #endif
05241         /* Do some basic checks. */
05242         if (dimension == NULL)
05243         {
05244                 fprintf (stderr,
05245                   (_("Error in %s () a NULL pointer was passed.\n")),
05246                   __FUNCTION__);
05247                 return (EXIT_FAILURE);
05248         }
05249 #if DEBUG
05250         DXF_DEBUG_END
05251 #endif
05252         return (dimension->actual_measurement);
05253 }
05254 
05255 
05262 DxfDimension *
05263 dxf_dimension_set_actual_measurement
05264 (
05265         DxfDimension *dimension,
05267         double actual_measurement
05269 )
05270 {
05271 #if DEBUG
05272         DXF_DEBUG_BEGIN
05273 #endif
05274         /* Do some basic checks. */
05275         if (dimension == NULL)
05276         {
05277                 fprintf (stderr,
05278                   (_("Error in %s () a NULL pointer was passed.\n")),
05279                   __FUNCTION__);
05280                 return (NULL);
05281         }
05282         dimension->actual_measurement = actual_measurement;
05283 #if DEBUG
05284         DXF_DEBUG_END
05285 #endif
05286         return (dimension);
05287 }
05288 
05289 
05296 double
05297 dxf_dimension_get_angle
05298 (
05299         DxfDimension *dimension
05301 )
05302 {
05303 #if DEBUG
05304         DXF_DEBUG_BEGIN
05305 #endif
05306         /* Do some basic checks. */
05307         if (dimension == NULL)
05308         {
05309                 fprintf (stderr,
05310                   (_("Error in %s () a NULL pointer was passed.\n")),
05311                   __FUNCTION__);
05312                 return (EXIT_FAILURE);
05313         }
05314 #if DEBUG
05315         DXF_DEBUG_END
05316 #endif
05317         return (dimension->angle);
05318 }
05319 
05320 
05328 DxfDimension *
05329 dxf_dimension_set_angle
05330 (
05331         DxfDimension *dimension,
05333         double angle
05335 )
05336 {
05337 #if DEBUG
05338         DXF_DEBUG_BEGIN
05339 #endif
05340         /* Do some basic checks. */
05341         if (dimension == NULL)
05342         {
05343                 fprintf (stderr,
05344                   (_("Error in %s () a NULL pointer was passed.\n")),
05345                   __FUNCTION__);
05346                 return (NULL);
05347         }
05348         dimension->angle = angle;
05349 #if DEBUG
05350         DXF_DEBUG_END
05351 #endif
05352         return (dimension);
05353 }
05354 
05355 
05363 double
05364 dxf_dimension_get_hor_dir
05365 (
05366         DxfDimension *dimension
05368 )
05369 {
05370 #if DEBUG
05371         DXF_DEBUG_BEGIN
05372 #endif
05373         /* Do some basic checks. */
05374         if (dimension == NULL)
05375         {
05376                 fprintf (stderr,
05377                   (_("Error in %s () a NULL pointer was passed.\n")),
05378                   __FUNCTION__);
05379                 return (EXIT_FAILURE);
05380         }
05381 #if DEBUG
05382         DXF_DEBUG_END
05383 #endif
05384         return (dimension->hor_dir);
05385 }
05386 
05387 
05395 DxfDimension *
05396 dxf_dimension_set_hor_dir
05397 (
05398         DxfDimension *dimension,
05400         double hor_dir
05402 )
05403 {
05404 #if DEBUG
05405         DXF_DEBUG_BEGIN
05406 #endif
05407         /* Do some basic checks. */
05408         if (dimension == NULL)
05409         {
05410                 fprintf (stderr,
05411                   (_("Error in %s () a NULL pointer was passed.\n")),
05412                   __FUNCTION__);
05413                 return (NULL);
05414         }
05415         dimension->hor_dir = hor_dir;
05416 #if DEBUG
05417         DXF_DEBUG_END
05418 #endif
05419         return (dimension);
05420 }
05421 
05422 
05430 double
05431 dxf_dimension_get_obl_angle
05432 (
05433         DxfDimension *dimension
05435 )
05436 {
05437 #if DEBUG
05438         DXF_DEBUG_BEGIN
05439 #endif
05440         /* Do some basic checks. */
05441         if (dimension == NULL)
05442         {
05443                 fprintf (stderr,
05444                   (_("Error in %s () a NULL pointer was passed.\n")),
05445                   __FUNCTION__);
05446                 return (EXIT_FAILURE);
05447         }
05448 #if DEBUG
05449         DXF_DEBUG_END
05450 #endif
05451         return (dimension->obl_angle);
05452 }
05453 
05454 
05462 DxfDimension *
05463 dxf_dimension_set_obl_angle
05464 (
05465         DxfDimension *dimension,
05467         double obl_angle
05469 )
05470 {
05471 #if DEBUG
05472         DXF_DEBUG_BEGIN
05473 #endif
05474         /* Do some basic checks. */
05475         if (dimension == NULL)
05476         {
05477                 fprintf (stderr,
05478                   (_("Error in %s () a NULL pointer was passed.\n")),
05479                   __FUNCTION__);
05480                 return (NULL);
05481         }
05482         dimension->obl_angle = obl_angle;
05483 #if DEBUG
05484         DXF_DEBUG_END
05485 #endif
05486         return (dimension);
05487 }
05488 
05489 
05495 double
05496 dxf_dimension_get_text_angle
05497 (
05498         DxfDimension *dimension
05500 )
05501 {
05502 #if DEBUG
05503         DXF_DEBUG_BEGIN
05504 #endif
05505         /* Do some basic checks. */
05506         if (dimension == NULL)
05507         {
05508                 fprintf (stderr,
05509                   (_("Error in %s () a NULL pointer was passed.\n")),
05510                   __FUNCTION__);
05511                 return (EXIT_FAILURE);
05512         }
05513 #if DEBUG
05514         DXF_DEBUG_END
05515 #endif
05516         return (dimension->text_angle);
05517 }
05518 
05519 
05526 DxfDimension *
05527 dxf_dimension_set_text_angle
05528 (
05529         DxfDimension *dimension,
05531         double text_angle
05533 )
05534 {
05535 #if DEBUG
05536         DXF_DEBUG_BEGIN
05537 #endif
05538         /* Do some basic checks. */
05539         if (dimension == NULL)
05540         {
05541                 fprintf (stderr,
05542                   (_("Error in %s () a NULL pointer was passed.\n")),
05543                   __FUNCTION__);
05544                 return (NULL);
05545         }
05546         dimension->text_angle = text_angle;
05547 #if DEBUG
05548         DXF_DEBUG_END
05549 #endif
05550         return (dimension);
05551 }
05552 
05553 
05560 int
05561 dxf_dimension_get_flag
05562 (
05563         DxfDimension *dimension
05565 )
05566 {
05567 #if DEBUG
05568         DXF_DEBUG_BEGIN
05569 #endif
05570         if (dimension == NULL)
05571         {
05572               fprintf (stderr,
05573                   (_("Error in %s () a NULL pointer was passed.\n")),
05574                   __FUNCTION__);
05575               return (DXF_ERROR);
05576         }
05577         if (dimension->flag < 0)
05578         {
05579                 fprintf (stderr,
05580                   (_("Error in %s () a negative value was found in the flag member.\n")),
05581                   __FUNCTION__);
05582                 return (DXF_ERROR);
05583         }
05584 #if DEBUG
05585         DXF_DEBUG_END
05586 #endif
05587         return (dimension->flag);
05588 }
05589 
05590 
05597 DxfDimension *
05598 dxf_dimension_set_flag
05599 (
05600         DxfDimension *dimension,
05602         int flag
05604 )
05605 {
05606 #if DEBUG
05607         DXF_DEBUG_BEGIN
05608 #endif
05609         /* Do some basic checks. */
05610         if (dimension == NULL)
05611         {
05612                 fprintf (stderr,
05613                   (_("Error in %s () a NULL pointer was passed.\n")),
05614                   __FUNCTION__);
05615                 return (NULL);
05616         }
05617         if (flag < 0)
05618         {
05619                 fprintf (stderr,
05620                   (_("Error in %s () a negative value was found in the passed flag.\n")),
05621                   __FUNCTION__);
05622                 return (NULL);
05623         }
05624         dimension->flag = flag;
05625 #if DEBUG
05626         DXF_DEBUG_END
05627 #endif
05628         return (dimension);
05629 }
05630 
05631 
05637 int
05638 dxf_dimension_get_attachment_point
05639 (
05640         DxfDimension *dimension
05642 )
05643 {
05644 #if DEBUG
05645         DXF_DEBUG_BEGIN
05646 #endif
05647         if (dimension == NULL)
05648         {
05649               fprintf (stderr,
05650                   (_("Error in %s () a NULL pointer was passed.\n")),
05651                   __FUNCTION__);
05652               return (DXF_ERROR);
05653         }
05654         if (dimension->attachment_point < 0)
05655         {
05656                 fprintf (stderr,
05657                   (_("Error in %s () a negative value was found in the attachment_point member.\n")),
05658                   __FUNCTION__);
05659               return (DXF_ERROR);
05660         }
05661         if (dimension->attachment_point > 9)
05662         {
05663                 fprintf (stderr,
05664                   (_("Error in %s () an out of range value was found in the attachment_point member.\n")),
05665                   __FUNCTION__);
05666               return (DXF_ERROR);
05667         }
05668 #if DEBUG
05669         DXF_DEBUG_END
05670 #endif
05671         return (dimension->attachment_point);
05672 }
05673 
05674 
05681 DxfDimension *
05682 dxf_dimension_set_attachment_point
05683 (
05684         DxfDimension *dimension,
05686         int attachment_point
05688 )
05689 {
05690 #if DEBUG
05691         DXF_DEBUG_BEGIN
05692 #endif
05693         /* Do some basic checks. */
05694         if (dimension == NULL)
05695         {
05696                 fprintf (stderr,
05697                   (_("Error in %s () a NULL pointer was passed.\n")),
05698                   __FUNCTION__);
05699                 return (NULL);
05700         }
05701         if (attachment_point < 0)
05702         {
05703                 fprintf (stderr,
05704                   (_("Error in %s () a negative value was passed in the attachment_point.\n")),
05705                   __FUNCTION__);
05706                 return (NULL);
05707         }
05708         if (attachment_point > 9)
05709         {
05710                 fprintf (stderr,
05711                   (_("Error in %s () an out of range value was passed in the attachment_point.\n")),
05712                   __FUNCTION__);
05713                 return (NULL);
05714         }
05715         dimension->attachment_point = attachment_point;
05716 #if DEBUG
05717         DXF_DEBUG_END
05718 #endif
05719         return (dimension);
05720 }
05721 
05722 
05728 int
05729 dxf_dimension_get_text_line_spacing
05730 (
05731         DxfDimension *dimension
05733 )
05734 {
05735 #if DEBUG
05736         DXF_DEBUG_BEGIN
05737 #endif
05738         if (dimension == NULL)
05739         {
05740               fprintf (stderr,
05741                   (_("Error in %s () a NULL pointer was passed.\n")),
05742                   __FUNCTION__);
05743               return (DXF_ERROR);
05744         }
05745         if (dimension->text_line_spacing < 0)
05746         {
05747                 fprintf (stderr,
05748                   (_("Error in %s () a negative value was found in the text_line_spacing member.\n")),
05749                   __FUNCTION__);
05750               return (DXF_ERROR);
05751         }
05752         if (dimension->text_line_spacing > 2)
05753         {
05754                 fprintf (stderr,
05755                   (_("Error in %s () an out of range value was found in the text_line_spacing member.\n")),
05756                   __FUNCTION__);
05757               return (DXF_ERROR);
05758         }
05759 #if DEBUG
05760         DXF_DEBUG_END
05761 #endif
05762         return (dimension->text_line_spacing);
05763 }
05764 
05765 
05772 DxfDimension *
05773 dxf_dimension_set_text_line_spacing
05774 (
05775         DxfDimension *dimension,
05777         int text_line_spacing
05779 )
05780 {
05781 #if DEBUG
05782         DXF_DEBUG_BEGIN
05783 #endif
05784         /* Do some basic checks. */
05785         if (dimension == NULL)
05786         {
05787                 fprintf (stderr,
05788                   (_("Error in %s () a NULL pointer was passed.\n")),
05789                   __FUNCTION__);
05790                 return (NULL);
05791         }
05792         if (text_line_spacing < 0)
05793         {
05794                 fprintf (stderr,
05795                   (_("Error in %s () a negative value was passed in the text_line_spacing.\n")),
05796                   __FUNCTION__);
05797                 return (NULL);
05798         }
05799         if (text_line_spacing > 2)
05800         {
05801                 fprintf (stderr,
05802                   (_("Error in %s () an out of range value was passed in the text_line_spacing.\n")),
05803                   __FUNCTION__);
05804                 return (NULL);
05805         }
05806         dimension->text_line_spacing = text_line_spacing;
05807 #if DEBUG
05808         DXF_DEBUG_END
05809 #endif
05810         return (dimension);
05811 }
05812 
05813 
05821 double
05822 dxf_dimension_get_extr_x0
05823 (
05824         DxfDimension *dimension
05826 )
05827 {
05828 #ifdef DEBUG
05829         DXF_DEBUG_BEGIN
05830 #endif
05831         /* Do some basic checks. */
05832         if (dimension == NULL)
05833         {
05834                 fprintf (stderr,
05835                   (_("Error in %s () a NULL pointer was passed.\n")),
05836                   __FUNCTION__);
05837                 return (EXIT_FAILURE);
05838         }
05839 #if DEBUG
05840         DXF_DEBUG_END
05841 #endif
05842         return (dimension->extr_x0);
05843 }
05844 
05845 
05853 DxfDimension *
05854 dxf_dimension_set_extr_x0
05855 (
05856         DxfDimension *dimension,
05858         double extr_x0
05860 )
05861 {
05862 #ifdef DEBUG
05863         DXF_DEBUG_BEGIN
05864 #endif
05865         /* Do some basic checks. */
05866         if (dimension == NULL)
05867         {
05868                 fprintf (stderr,
05869                   (_("Error in %s () a NULL pointer was passed.\n")),
05870                   __FUNCTION__);
05871                 return (NULL);
05872         }
05873         dimension->extr_x0 = extr_x0;
05874 #if DEBUG
05875         DXF_DEBUG_END
05876 #endif
05877         return (dimension);
05878 }
05879 
05880 
05888 double
05889 dxf_dimension_get_extr_y0
05890 (
05891         DxfDimension *dimension
05893 )
05894 {
05895 #ifdef DEBUG
05896         DXF_DEBUG_BEGIN
05897 #endif
05898         /* Do some basic checks. */
05899         if (dimension == NULL)
05900         {
05901                 fprintf (stderr,
05902                   (_("Error in %s () a NULL pointer was passed.\n")),
05903                   __FUNCTION__);
05904                 return (EXIT_FAILURE);
05905         }
05906 #if DEBUG
05907         DXF_DEBUG_END
05908 #endif
05909         return (dimension->extr_y0);
05910 }
05911 
05912 
05920 DxfDimension *
05921 dxf_dimension_set_extr_y0
05922 (
05923         DxfDimension *dimension,
05925         double extr_y0
05927 )
05928 {
05929 #ifdef DEBUG
05930         DXF_DEBUG_BEGIN
05931 #endif
05932         /* Do some basic checks. */
05933         if (dimension == NULL)
05934         {
05935                 fprintf (stderr,
05936                   (_("Error in %s () a NULL pointer was passed.\n")),
05937                   __FUNCTION__);
05938                 return (NULL);
05939         }
05940         dimension->extr_y0 = extr_y0;
05941 #if DEBUG
05942         DXF_DEBUG_END
05943 #endif
05944         return (dimension);
05945 }
05946 
05947 
05955 double
05956 dxf_dimension_get_extr_z0
05957 (
05958         DxfDimension *dimension
05960 )
05961 {
05962 #ifdef DEBUG
05963         DXF_DEBUG_BEGIN
05964 #endif
05965         /* Do some basic checks. */
05966         if (dimension == NULL)
05967         {
05968                 fprintf (stderr,
05969                   (_("Error in %s () a NULL pointer was passed.\n")),
05970                   __FUNCTION__);
05971                 return (EXIT_FAILURE);
05972         }
05973 #if DEBUG
05974         DXF_DEBUG_END
05975 #endif
05976         return (dimension->extr_z0);
05977 }
05978 
05979 
05987 DxfDimension *
05988 dxf_dimension_set_extr_z0
05989 (
05990         DxfDimension *dimension,
05992         double extr_z0
05994 )
05995 {
05996 #ifdef DEBUG
05997         DXF_DEBUG_BEGIN
05998 #endif
05999         /* Do some basic checks. */
06000         if (dimension == NULL)
06001         {
06002                 fprintf (stderr,
06003                   (_("Error in %s () a NULL pointer was passed.\n")),
06004                   __FUNCTION__);
06005                 return (NULL);
06006         }
06007         dimension->extr_z0 = extr_z0;
06008 #if DEBUG
06009         DXF_DEBUG_END
06010 #endif
06011         return (dimension);
06012 }
06013 
06014 
06024 DxfPoint *
06025 dxf_dimension_get_extrusion_vector_as_point
06026 (
06027         DxfDimension *dimension
06029 )
06030 {
06031 #ifdef DEBUG
06032         DXF_DEBUG_BEGIN
06033 #endif
06034         DxfPoint *point = NULL;
06035 
06036         /* Do some basic checks. */
06037         if (dimension == NULL)
06038         {
06039                 fprintf (stderr,
06040                   (_("Error in %s () a NULL pointer was passed.\n")),
06041                   __FUNCTION__);
06042                 return (NULL);
06043         }
06044         point = dxf_point_init (point);
06045         if (point == NULL)
06046         {
06047               fprintf (stderr,
06048                   (_("Error in %s () could not allocate memory for a DxfPoint struct.\n")),
06049                 __FUNCTION__);
06050               return (NULL);
06051         }
06052         point->x0 = dimension->extr_x0;
06053         point->y0 = dimension->extr_y0;
06054         point->z0 = dimension->extr_z0;
06055 #if DEBUG
06056         DXF_DEBUG_END
06057 #endif
06058         return (point);
06059 }
06060 
06061 
06068 DxfDimension *
06069 dxf_dimension_set_extrusion_vector
06070 (
06071         DxfDimension *dimension,
06073         double extr_x0,
06075         double extr_y0,
06077         double extr_z0
06079 )
06080 {
06081 #if DEBUG
06082         DXF_DEBUG_BEGIN
06083 #endif
06084         /* Do some basic checks. */
06085         if (dimension == NULL)
06086         {
06087                 fprintf (stderr,
06088                   (_("Error in %s () a NULL pointer was passed.\n")),
06089                   __FUNCTION__);
06090                 return (NULL);
06091         }
06092         dimension->extr_x0 = extr_x0;
06093         dimension->extr_y0 = extr_y0;
06094         dimension->extr_z0 = extr_z0;
06095 #if DEBUG
06096         DXF_DEBUG_END
06097 #endif
06098         return (dimension);
06099 }
06100 
06101 
06111 DxfDimension *
06112 dxf_dimension_get_next
06113 (
06114         DxfDimension *dimension
06116 )
06117 {
06118 #if DEBUG
06119         DXF_DEBUG_BEGIN
06120 #endif
06121         /* Do some basic checks. */
06122         if (dimension == NULL)
06123         {
06124                 fprintf (stderr,
06125                   (_("Error in %s () a NULL pointer was passed.\n")),
06126                   __FUNCTION__);
06127                 return (NULL);
06128         }
06129         if (dimension->next == NULL)
06130         {
06131                 fprintf (stderr,
06132                   (_("Error in %s () a NULL pointer was found in the next member.\n")),
06133                   __FUNCTION__);
06134                 return (NULL);
06135         }
06136 #if DEBUG
06137         DXF_DEBUG_END
06138 #endif
06139         return ((DxfDimension *) dimension->next);
06140 }
06141 
06142 
06150 DxfDimension *
06151 dxf_dimension_set_next
06152 (
06153         DxfDimension *dimension,
06155         DxfDimension *next
06157 )
06158 {
06159 #if DEBUG
06160         DXF_DEBUG_BEGIN
06161 #endif
06162         /* Do some basic checks. */
06163         if (dimension == NULL)
06164         {
06165                 fprintf (stderr,
06166                   (_("Error in %s () a NULL pointer was passed.\n")),
06167                   __FUNCTION__);
06168                 return (NULL);
06169         }
06170         if (next == NULL)
06171         {
06172                 fprintf (stderr,
06173                   (_("Error in %s () a NULL pointer was passed.\n")),
06174                   __FUNCTION__);
06175                 return (NULL);
06176         }
06177         dimension->next = (struct DxfDimension *) next;
06178 #if DEBUG
06179         DXF_DEBUG_END
06180 #endif
06181         return (dimension);
06182 }
06183 
06184 
06194 DxfDimension *
06195 dxf_dimension_get_last
06196 (
06197         DxfDimension *dimension
06199 )
06200 {
06201 #if DEBUG
06202         DXF_DEBUG_BEGIN
06203 #endif
06204         /* Do some basic checks. */
06205         if (dimension == NULL)
06206         {
06207                 fprintf (stderr,
06208                   (_("Error in %s () a NULL pointer was passed.\n")),
06209                   __FUNCTION__);
06210                 return (NULL);
06211         }
06212         if (dimension->next == NULL)
06213         {
06214                 fprintf (stderr,
06215                   (_("Warning in %s () a NULL pointer was found in the next member.\n")),
06216                   __FUNCTION__);
06217                 return ((DxfDimension *) dimension);
06218         }
06219         DxfDimension *iter = (DxfDimension *) dimension->next;
06220         while (iter->next != NULL)
06221         {
06222                 iter = (DxfDimension *) iter->next;
06223         }
06224 #if DEBUG
06225         DXF_DEBUG_END
06226 #endif
06227         return ((DxfDimension *) iter);
06228 }
06229 
06230 
06231 /* EOF */