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

mline.c

Go to the documentation of this file.
00001 
00043 #include "mline.h"
00044 
00045 
00054 DxfMline *
00055 dxf_mline_new ()
00056 {
00057 #if DEBUG
00058         DXF_DEBUG_BEGIN
00059 #endif
00060         DxfMline *mline = NULL;
00061         size_t size;
00062 
00063         size = sizeof (DxfMline);
00064         /* avoid malloc of 0 bytes */
00065         if (size == 0) size = 1;
00066         if ((mline = malloc (size)) == NULL)
00067         {
00068                 fprintf (stderr,
00069                   (_("Error in %s () could not allocate memory for a DxfMline struct.\n")),
00070                   __FUNCTION__);
00071                 mline = NULL;
00072         }
00073         else
00074         {
00075                 memset (mline, 0, size);
00076         }
00077 #if DEBUG
00078         DXF_DEBUG_END
00079 #endif
00080         return (mline);
00081 }
00082 
00083 
00090 DxfMline *
00091 dxf_mline_init
00092 (
00093         DxfMline *mline
00095 )
00096 {
00097 #if DEBUG
00098         DXF_DEBUG_BEGIN
00099 #endif
00100         int i;
00101 
00102         /* Do some basic checks. */
00103         if (mline == NULL)
00104         {
00105                 fprintf (stderr,
00106                   (_("Warning in %s () a NULL pointer was passed.\n")),
00107                   __FUNCTION__);
00108                 mline = dxf_mline_new ();
00109         }
00110         if (mline == NULL)
00111         {
00112               fprintf (stderr,
00113                 (_("Error in %s () could not allocate memory for a DxfMline struct.\n")),
00114                 __FUNCTION__);
00115               return (NULL);
00116         }
00117         dxf_mline_set_id_code (mline, 0);
00118         dxf_mline_set_linetype (mline, strdup (DXF_DEFAULT_LINETYPE));
00119         dxf_mline_set_layer (mline, strdup (DXF_DEFAULT_LAYER));
00120         dxf_mline_set_elevation (mline, 0.0);
00121         dxf_mline_set_thickness (mline, 0.0);
00122         dxf_mline_set_linetype_scale (mline, DXF_DEFAULT_LINETYPE_SCALE);
00123         dxf_mline_set_visibility (mline, DXF_DEFAULT_VISIBILITY);
00124         dxf_mline_set_color (mline, DXF_COLOR_BYLAYER);
00125         dxf_mline_set_paperspace (mline, DXF_MODELSPACE);
00126         dxf_mline_set_graphics_data_size (mline, 0);
00127         dxf_mline_set_shadow_mode (mline, 0);
00128         dxf_mline_set_binary_graphics_data (mline, dxf_binary_graphics_data_new ());
00129         dxf_binary_graphics_data_init ((DxfBinaryGraphicsData *) dxf_mline_get_binary_graphics_data (mline));
00130         dxf_mline_set_dictionary_owner_soft (mline, strdup (""));
00131         dxf_mline_set_material (mline, strdup (""));
00132         dxf_mline_set_dictionary_owner_hard (mline, strdup (""));
00133         dxf_mline_set_lineweight (mline, 0);
00134         dxf_mline_set_plot_style_name (mline, strdup (""));
00135         dxf_mline_set_color_value (mline, 0);
00136         dxf_mline_set_color_name (mline, strdup (""));
00137         dxf_mline_set_transparency (mline, 0);
00138         dxf_mline_set_style_name (mline, strdup (""));
00139         dxf_mline_set_p0 (mline, dxf_point_new ());
00140         dxf_point_init ((DxfPoint *) dxf_mline_get_p0 (mline));
00141         dxf_mline_set_p1 (mline, dxf_point_new ());
00142         dxf_point_init ((DxfPoint *) dxf_mline_get_p1 (mline));
00143         dxf_mline_set_p2 (mline, dxf_point_new ());
00144         dxf_point_init ((DxfPoint *) dxf_mline_get_p2 (mline));
00145         dxf_mline_set_p3 (mline, dxf_point_new ());
00146         dxf_point_init ((DxfPoint *) dxf_mline_get_p3 (mline));
00147         for (i = 0; i < DXF_MAX_PARAM; i++)
00148         {
00149                 mline->element_parameters[i] = 0.0;
00150                 mline->area_fill_parameters[i] = 0.0;
00151         }
00152         dxf_mline_set_scale_factor (mline, 1.0);
00153         dxf_mline_set_justification (mline, 0);
00154         dxf_mline_set_flags (mline, 0);
00155         dxf_mline_set_number_of_vertices (mline, 0);
00156         dxf_mline_set_number_of_elements (mline, 0);
00157         dxf_mline_set_number_of_area_fill_parameters (mline, 0);
00158         dxf_mline_set_extr_x0 (mline, 0.0);
00159         dxf_mline_set_extr_y0 (mline, 0.0);
00160         dxf_mline_set_extr_z0 (mline, 1.0);
00161         dxf_mline_set_mlinestyle_dictionary (mline, strdup (""));
00162         dxf_mline_set_next (mline, NULL);
00163 #if DEBUG
00164         DXF_DEBUG_END
00165 #endif
00166         return (mline);
00167 }
00168 
00169 
00181 DxfMline *
00182 dxf_mline_read
00183 (
00184         DxfFile *fp,
00186         DxfMline *mline
00188 )
00189 {
00190 #if DEBUG
00191         DXF_DEBUG_BEGIN
00192 #endif
00193         char *temp_string = NULL;
00194         int i;
00195         int j;
00196         int k;
00197         int l;
00198         int m;
00199         DxfPoint *iter_p1;
00200         DxfPoint *iter_p2;
00201         DxfPoint *iter_p3;
00202 
00203         /* Do some basic checks. */
00204         if (fp == NULL)
00205         {
00206                 fprintf (stderr,
00207                   (_("Error in %s () a NULL file pointer was passed.\n")),
00208                   __FUNCTION__);
00209                 /* Clean up. */
00210                 free (temp_string);
00211                 return (NULL);
00212         }
00213         if (mline == NULL)
00214         {
00215                 fprintf (stderr,
00216                   (_("Warning in %s () a NULL pointer was passed.\n")),
00217                   __FUNCTION__);
00218                 mline = dxf_mline_new ();
00219                 mline = dxf_mline_init (mline);
00220         }
00221         l = 0;
00222         m = 0;
00223         i = 0; /* Number of found vertices in linked list p1. */
00224         iter_p1 = (DxfPoint *) mline->p1; /* Pointer to first vertex p1. */
00225         j = 0; /* Number of found direction vectors in linked list p2. */
00226         iter_p2 = (DxfPoint *) mline->p2; /* Pointer to first direction vector p2. */
00227         k = 0;
00228         iter_p3 = (DxfPoint *) mline->p3; /* Pointer to first direction vector p3. */
00229         (fp->line_number)++;
00230         fscanf (fp->fp, "%[^\n]", temp_string);
00231         while (strcmp (temp_string, "0") != 0)
00232         {
00233                 if (ferror (fp->fp))
00234                 {
00235                         fprintf (stderr,
00236                           (_("Error in %s () while reading from: %s in line: %d.\n")),
00237                           __FUNCTION__, fp->filename, fp->line_number);
00238                         fclose (fp->fp);
00239                         /* Clean up. */
00240                         free (temp_string);
00241                         return (NULL);
00242                 }
00243                 if (strcmp (temp_string, "2") == 0)
00244                 {
00245                         /* Now follows a string containing a string of
00246                          * up to 32 characters with the name of the
00247                          * style used for this mline. */
00248                         (fp->line_number)++;
00249                         fscanf (fp->fp, "%s\n", mline->style_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", &mline->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", mline->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", mline->layer);
00270                 }
00271                 else if (strcmp (temp_string, "10") == 0)
00272                 {
00273                         /* Now follows a string containing the
00274                          * X value of the start point. */
00275                         (fp->line_number)++;
00276                         fscanf (fp->fp, "%lf\n", &mline->p0->x0);
00277                 }
00278                 else if (strcmp (temp_string, "20") == 0)
00279                 {
00280                         /* Now follows a string containing the
00281                          * Y value of the start point. */
00282                         (fp->line_number)++;
00283                         fscanf (fp->fp, "%lf\n", &mline->p0->y0);
00284                 }
00285                 else if (strcmp (temp_string, "30") == 0)
00286                 {
00287                         /* Now follows a string containing the
00288                          * Z value of the start point. */
00289                         (fp->line_number)++;
00290                         fscanf (fp->fp, "%lf\n", &mline->p0->z0);
00291                 }
00292                 else if ((strcmp (temp_string, "11") == 0)
00293                   || (strcmp (temp_string, "21") == 0)
00294                   || (strcmp (temp_string, "31") == 0))
00295                 {
00296                         if (strcmp (temp_string, "11") == 0)
00297                         {
00298                                 /* Now follows a string containing the X-value
00299                                  * of the Vertex coordinates (one entry for each
00300                                  * vertex). */
00301                                 if (i > 0) /* Create a pointer for the next vertex. */
00302                                 {
00303                                         dxf_point_init ((DxfPoint *) iter_p1->next);
00304                                         iter_p1 = (DxfPoint *) iter_p1->next;
00305                                 }
00306                                 (fp->line_number)++;
00307                                 fscanf (fp->fp, "%lf\n", &iter_p1->x0);
00308                         }
00309                         else if (strcmp (temp_string, "21") == 0)
00310                         {
00311                                 /* Now follows a string containing the Y-value
00312                                  * of the Vertex coordinates (one entry for each
00313                                  * vertex). */
00314                                 (fp->line_number)++;
00315                                 fscanf (fp->fp, "%lf\n", &iter_p1->y0);
00316                         }
00317                         else if (strcmp (temp_string, "31") == 0)
00318                         {
00319                                 /* Now follows a string containing the Z-value
00320                                  * of the Vertex coordinates (one entry for each
00321                                  * vertex). */
00322                                 (fp->line_number)++;
00323                                 fscanf (fp->fp, "%lf\n", &iter_p1->z0);
00324                                 i++; /* Increase the number of found vertices. */
00325                         }
00326                 }
00327                 else if ((strcmp (temp_string, "12") == 0)
00328                   || (strcmp (temp_string, "22") == 0)
00329                   || (strcmp (temp_string, "32") == 0))
00330                 {
00331                         if (strcmp (temp_string, "12") == 0)
00332                         {
00333                                 /* Now follows a string containing the X-value
00334                                  * of the Direction vector (one entry for each
00335                                  * vector). */
00336                                 if (j > 0) /* Create a pointer for the next vector. */
00337                                 {
00338                                         dxf_point_init ((DxfPoint *) iter_p2->next);
00339                                         iter_p2 = (DxfPoint *) iter_p2->next;
00340                                 }
00341                                 (fp->line_number)++;
00342                                 fscanf (fp->fp, "%lf\n", &iter_p2->x0);
00343                         }
00344                         else if (strcmp (temp_string, "22") == 0)
00345                         {
00346                                 /* Now follows a string containing the Y-value
00347                                  * of the Direction vector (one entry for each
00348                                  * vector). */
00349                                 (fp->line_number)++;
00350                                 fscanf (fp->fp, "%lf\n", &iter_p2->y0);
00351                         }
00352                         else if (strcmp (temp_string, "32") == 0)
00353                         {
00354                                 /* Now follows a string containing the Z-value
00355                                  * of the Direction vector (one entry for each
00356                                  * vector). */
00357                                 (fp->line_number)++;
00358                                 fscanf (fp->fp, "%lf\n", &iter_p2->z0);
00359                                 j++; /* Increase the number of found vectors. */
00360                         }
00361                 }
00362                 else if ((strcmp (temp_string, "13") == 0)
00363                   || (strcmp (temp_string, "23") == 0)
00364                   || (strcmp (temp_string, "33") == 0))
00365                 {
00366                         if (strcmp (temp_string, "13") == 0)
00367                         {
00368                                 /* Now follows a string containing the X-value
00369                                  * of the Direction vector (one entry for each
00370                                  * vector). */
00371                                 if (k > 0) /* Create a pointer for the next vector. */
00372                                 {
00373                                         dxf_point_init ((DxfPoint *) iter_p3->next);
00374                                         iter_p3 = (DxfPoint *) iter_p3->next;
00375                                 }
00376                                 (fp->line_number)++;
00377                                 fscanf (fp->fp, "%lf\n", &iter_p3->x0);
00378                         }
00379                         else if (strcmp (temp_string, "23") == 0)
00380                         {
00381                                 /* Now follows a string containing the Y-value
00382                                  * of the Direction vector (one entry for each
00383                                  * vector). */
00384                                 (fp->line_number)++;
00385                                 fscanf (fp->fp, "%lf\n", &iter_p3->y0);
00386                         }
00387                         else if (strcmp (temp_string, "33") == 0)
00388                         {
00389                                 /* Now follows a string containing the Z-value
00390                                  * of the Direction vector (one entry for each
00391                                  * vector). */
00392                                 (fp->line_number)++;
00393                                 fscanf (fp->fp, "%lf\n", &iter_p3->z0);
00394                                 k++; /* Increase the number of found vectors. */
00395                         }
00396                 }
00397                 else if ((fp->acad_version_number <= AutoCAD_11)
00398                         && (strcmp (temp_string, "38") == 0))
00399                 {
00400                         /* Now follows a string containing the
00401                          * elevation. */
00402                         (fp->line_number)++;
00403                         fscanf (fp->fp, "%lf\n", &mline->elevation);
00404                 }
00405                 else if (strcmp (temp_string, "39") == 0)
00406                 {
00407                         /* Now follows a string containing the
00408                          * thickness. */
00409                         (fp->line_number)++;
00410                         fscanf (fp->fp, "%lf\n", &mline->thickness);
00411                 }
00412                 else if (strcmp (temp_string, "40") == 0)
00413                 {
00414                         /* Now follows a string containing the scale
00415                          * factor. */
00416                         (fp->line_number)++;
00417                         fscanf (fp->fp, "%lf\n", &mline->scale_factor);
00418                 }
00419                 else if (strcmp (temp_string, "41") == 0)
00420                 {
00421                         /* Now follows a string containing the element
00422                          * parameters (repeats based on previous code 74). */
00423                         (fp->line_number)++;
00424                         fscanf (fp->fp, "%lf\n", &mline->element_parameters[l]);
00425                         l++;
00426                 }
00427                 else if (strcmp (temp_string, "42") == 0)
00428                 {
00429                         /* Now follows a string containing the area fill
00430                          * parameters (repeats based on previous code 75). */
00431                         (fp->line_number)++;
00432                         fscanf (fp->fp, "%lf\n", &mline->area_fill_parameters[m]);
00433                         m++;
00434                 }
00435                 else if (strcmp (temp_string, "48") == 0)
00436                 {
00437                         /* Now follows a string containing the linetype
00438                          * scale. */
00439                         (fp->line_number)++;
00440                         fscanf (fp->fp, "%lf\n", &mline->linetype_scale);
00441                 }
00442                 else if (strcmp (temp_string, "60") == 0)
00443                 {
00444                         /* Now follows a string containing the
00445                          * visibility value. */
00446                         (fp->line_number)++;
00447                         fscanf (fp->fp, "%hd\n", &mline->visibility);
00448                 }
00449                 else if (strcmp (temp_string, "62") == 0)
00450                 {
00451                         /* Now follows a string containing the
00452                          * color value. */
00453                         (fp->line_number)++;
00454                         fscanf (fp->fp, "%d\n", &mline->color);
00455                 }
00456                 else if (strcmp (temp_string, "67") == 0)
00457                 {
00458                         /* Now follows a string containing the
00459                          * paperspace value. */
00460                         (fp->line_number)++;
00461                         fscanf (fp->fp, "%d\n", &mline->paperspace);
00462                 }
00463                 else if (strcmp (temp_string, "70") == 0)
00464                 {
00465                         /* Now follows a string containing the
00466                          * justification value. */
00467                         (fp->line_number)++;
00468                         fscanf (fp->fp, "%d\n", &mline->justification);
00469                 }
00470                 else if (strcmp (temp_string, "71") == 0)
00471                 {
00472                         /* Now follows a string containing the flags
00473                          * value. */
00474                         (fp->line_number)++;
00475                         fscanf (fp->fp, "%d\n", &mline->flags);
00476                 }
00477                 else if (strcmp (temp_string, "72") == 0)
00478                 {
00479                         /* Now follows a string containing the number of
00480                          * vertices value. */
00481                         (fp->line_number)++;
00482                         fscanf (fp->fp, "%d\n", &mline->number_of_vertices);
00483                 }
00484                 else if (strcmp (temp_string, "73") == 0)
00485                 {
00486                         /* Now follows a string containing the number of
00487                          * elements in MLINESTYLE definition. */
00488                         (fp->line_number)++;
00489                         fscanf (fp->fp, "%d\n", &mline->number_of_elements);
00490                 }
00491                 else if (strcmp (temp_string, "74") == 0)
00492                 {
00493                         /* Now follows a string containing the number of
00494                          * parameters for this element (repeats for each
00495                          * element in segment). */
00496                         (fp->line_number)++;
00497                         fscanf (fp->fp, "%d\n", &mline->number_of_parameters);
00498                 }
00499                 else if (strcmp (temp_string, "75") == 0)
00500                 {
00501                         /* Now follows a string containing the number of
00502                          * area fill parameters for this element
00503                          * (repeats for each element in segment). */
00504                         (fp->line_number)++;
00505                         fscanf (fp->fp, "%d\n", &mline->number_of_area_fill_parameters);
00506                 }
00507                 else if ((fp->acad_version_number >= AutoCAD_13)
00508                         && (strcmp (temp_string, "100") == 0))
00509                 {
00510                         /* Now follows a string containing the
00511                          * subclass marker value. */
00512                         (fp->line_number)++;
00513                         fscanf (fp->fp, "%s\n", temp_string);
00514                         if ((strcmp (temp_string, "AcDbEntity") != 0)
00515                         && ((strcmp (temp_string, "AcDbMline") != 0)))
00516                         {
00517                                 fprintf (stderr,
00518                                   (_("Warning in %s () found a bad subclass marker in: %s in line: %d.\n")),
00519                                   __FUNCTION__, fp->filename, fp->line_number);
00520                         }
00521                 }
00522                 else if (strcmp (temp_string, "210") == 0)
00523                 {
00524                         /* Now follows a string containing the
00525                          * X value of the extrusion direction. */
00526                         (fp->line_number)++;
00527                         fscanf (fp->fp, "%lf\n", &mline->extr_x0);
00528                 }
00529                 else if (strcmp (temp_string, "220") == 0)
00530                 {
00531                         /* Now follows a string containing the
00532                          * Y value of the extrusion direction. */
00533                         (fp->line_number)++;
00534                         fscanf (fp->fp, "%lf\n", &mline->extr_y0);
00535                 }
00536                 else if (strcmp (temp_string, "230") == 0)
00537                 {
00538                         /* Now follows a string containing the
00539                          * Z value of the extrusion direction. */
00540                         (fp->line_number)++;
00541                         fscanf (fp->fp, "%lf\n", &mline->extr_z0);
00542                 }
00543                 else if (strcmp (temp_string, "330") == 0)
00544                 {
00545                         /* Now follows a string containing Soft-pointer
00546                          * ID/handle to owner dictionary. */
00547                         (fp->line_number)++;
00548                         fscanf (fp->fp, "%s\n", mline->dictionary_owner_soft);
00549                 }
00550                 else if (strcmp (temp_string, "340") == 0)
00551                 {
00552                         /* Now follows a string containing a
00553                          * Pointer-handle/ID of MLINESTYLE dictionary. */
00554                         (fp->line_number)++;
00555                         fscanf (fp->fp, "%s\n", mline->mlinestyle_dictionary);
00556                 }
00557                 else if (strcmp (temp_string, "360") == 0)
00558                 {
00559                         /* Now follows a string containing Hard owner
00560                          * ID/handle to owner dictionary. */
00561                         (fp->line_number)++;
00562                         fscanf (fp->fp, "%s\n", mline->dictionary_owner_hard);
00563                 }
00564                 else if (strcmp (temp_string, "999") == 0)
00565                 {
00566                         /* Now follows a string containing a comment. */
00567                         (fp->line_number)++;
00568                         fscanf (fp->fp, "%s\n", temp_string);
00569                         fprintf (stdout, "DXF comment: %s\n", temp_string);
00570                 }
00571                 else
00572                 {
00573                         fprintf (stderr,
00574                           (_("Warning in %s () unknown string tag found while reading from: %s in line: %d.\n")),
00575                           __FUNCTION__, fp->filename, fp->line_number);
00576                 }
00577         }
00578         /* Handle omitted members and/or illegal values. */
00579         if (strcmp (dxf_mline_get_linetype (mline), "") == 0)
00580         {
00581                 dxf_mline_set_linetype (mline, strdup (DXF_DEFAULT_LINETYPE));
00582         }
00583         if (strcmp (dxf_mline_get_layer (mline), "") == 0)
00584         {
00585                 dxf_mline_set_layer (mline, strdup (DXF_DEFAULT_LAYER));
00586         }
00587         /* Clean up. */
00588         free (temp_string);
00589 #if DEBUG
00590         DXF_DEBUG_END
00591 #endif
00592         return (mline);
00593 }
00594 
00595 
00609 int
00610 dxf_mline_write
00611 (
00612         DxfFile *fp,
00614         DxfMline *mline
00616 )
00617 {
00618 #if DEBUG
00619         DXF_DEBUG_BEGIN
00620 #endif
00621         char *dxf_entity_name = strdup ("MLINE");
00622         int i;
00623         DxfPoint *iter;
00624 
00625         /* Do some basic checks. */
00626         if (fp == NULL)
00627         {
00628                 fprintf (stderr,
00629                   (_("Error in %s () a NULL file pointer was passed.\n")),
00630                   __FUNCTION__);
00631                 /* Clean up. */
00632                 free (dxf_entity_name);
00633                 return (EXIT_FAILURE);
00634         }
00635         if (mline == NULL)
00636         {
00637                 fprintf (stderr,
00638                   (_("Error in %s () a NULL pointer was passed.\n")),
00639                   __FUNCTION__);
00640                 /* Clean up. */
00641                 free (dxf_entity_name);
00642                 return (EXIT_FAILURE);
00643         }
00644         if ((fp->acad_version_number < AutoCAD_13)
00645           && (fp->follow_strict_version_rules))
00646         {
00647                 fprintf (stderr,
00648                   (_("Error in %s () illegal DXF version for this %s entity with id-code: %x.\n")),
00649                   __FUNCTION__, dxf_entity_name, mline->id_code);
00650                 return (EXIT_FAILURE);
00651         }
00652         else
00653         {
00654                 fprintf (stderr,
00655                   (_("Warning in %s () illegal DXF version for this %s entity with id-code: %x.\n")),
00656                   __FUNCTION__, dxf_entity_name, dxf_mline_get_id_code (mline));
00657         }
00658         if (strcmp (dxf_mline_get_linetype (mline), "") == 0)
00659         {
00660                 fprintf (stderr,
00661                   (_("Warning in %s () empty linetype string for the %s entity with id-code: %x\n")),
00662                   __FUNCTION__, dxf_entity_name, dxf_mline_get_id_code (mline));
00663                 fprintf (stderr,
00664                   (_("    %s entity is relocated to layer 0\n")),
00665                   dxf_entity_name);
00666                 dxf_mline_set_linetype (mline, strdup (DXF_DEFAULT_LINETYPE));
00667         }
00668         if (strcmp (dxf_mline_get_layer (mline), "") == 0)
00669         {
00670                 fprintf (stderr,
00671                   (_("Warning in %s () empty layer string for the %s entity with id-code: %x\n")),
00672                   __FUNCTION__, dxf_entity_name, dxf_mline_get_id_code (mline));
00673                 fprintf (stderr,
00674                   (_("    %s entity is relocated to layer 0\n")),
00675                   dxf_entity_name);
00676                 dxf_mline_set_layer (mline, strdup (DXF_DEFAULT_LAYER));
00677         }
00678         if (dxf_mline_get_number_of_parameters (mline) >= (DXF_MAX_PARAM - 1))
00679         {
00680                 fprintf (stderr,
00681                   (_("Error in %s () too many parameters.\n")),
00682                   __FUNCTION__);
00683                 /* Clean up. */
00684                 free (dxf_entity_name);
00685                 return (EXIT_FAILURE);
00686         }
00687         if (dxf_mline_get_number_of_area_fill_parameters (mline) >= (DXF_MAX_PARAM - 1))
00688         {
00689                 fprintf (stderr,
00690                   (_("Error in %s () too many area fill parameters.\n")),
00691                   __FUNCTION__);
00692                 /* Clean up. */
00693                 free (dxf_entity_name);
00694                 return (EXIT_FAILURE);
00695         }
00696         /* Start writing output. */
00697         fprintf (fp->fp, "  0\n%s\n", dxf_entity_name);
00698         if (dxf_mline_get_id_code (mline) != -1)
00699         {
00700                 fprintf (fp->fp, "  5\n%x\n", dxf_mline_get_id_code (mline));
00701         }
00712         if ((strcmp (mline->dictionary_owner_soft, "") != 0)
00713           && (fp->acad_version_number >= AutoCAD_14))
00714         {
00715                 fprintf (fp->fp, "102\n{ACAD_REACTORS\n");
00716                 fprintf (fp->fp, "330\n%s\n", dxf_mline_get_dictionary_owner_soft (mline));
00717                 fprintf (fp->fp, "102\n}\n");
00718         }
00719         if ((strcmp (dxf_mline_get_dictionary_owner_hard (mline), "") != 0)
00720           && (fp->acad_version_number >= AutoCAD_14))
00721         {
00722                 fprintf (fp->fp, "102\n{ACAD_XDICTIONARY\n");
00723                 fprintf (fp->fp, "360\n%s\n", dxf_mline_get_dictionary_owner_hard (mline));
00724                 fprintf (fp->fp, "102\n}\n");
00725         }
00726         if (fp->acad_version_number >= AutoCAD_13)
00727         {
00728                 fprintf (fp->fp, "100\nAcDbEntity\n");
00729         }
00730         if (dxf_mline_get_paperspace (mline) == DXF_PAPERSPACE)
00731         {
00732                 fprintf (fp->fp, " 67\n%d\n", DXF_PAPERSPACE);
00733         }
00734         fprintf (fp->fp, "  8\n%s\n", dxf_mline_get_layer (mline));
00735         if (strcmp (dxf_mline_get_linetype (mline), DXF_DEFAULT_LINETYPE) != 0)
00736         {
00737                 fprintf (fp->fp, "  6\n%s\n", dxf_mline_get_linetype (mline));
00738         }
00739         if ((fp->acad_version_number >= AutoCAD_2008)
00740           && (strcmp (dxf_mline_get_material (mline), "") != 0))
00741         {
00742                 fprintf (fp->fp, "347\n%s\n", dxf_mline_get_material (mline));
00743         }
00744         if ((fp->acad_version_number <= AutoCAD_11)
00745           && DXF_FLATLAND
00746           && (dxf_mline_get_elevation (mline) != 0.0))
00747         {
00748                 fprintf (fp->fp, " 38\n%f\n", dxf_mline_get_elevation (mline));
00749         }
00750         if (dxf_mline_get_color (mline) != DXF_COLOR_BYLAYER)
00751         {
00752                 fprintf (fp->fp, " 62\n%d\n", dxf_mline_get_color (mline));
00753         }
00754         if (fp->acad_version_number >= AutoCAD_2002)
00755         {
00756                 fprintf (fp->fp, "370\n%d\n", dxf_mline_get_lineweight (mline));
00757         }
00758         if (dxf_mline_get_linetype_scale (mline) != 1.0)
00759         {
00760                 fprintf (fp->fp, " 48\n%f\n", dxf_mline_get_linetype_scale (mline));
00761         }
00762         if (dxf_mline_get_visibility (mline) != 0)
00763         {
00764                 fprintf (fp->fp, " 60\n%d\n", dxf_mline_get_visibility (mline));
00765         }
00766         if (fp->acad_version_number >= AutoCAD_2000)
00767         {
00768 #ifdef BUILD_64
00769                 fprintf (fp->fp, "160\n%d\n", dxf_mline_get_graphics_data_size (mline));
00770 #else
00771                 fprintf (fp->fp, " 92\n%d\n", dxf_mline_get_graphics_data_size (mline));
00772 #endif
00773                 DxfBinaryGraphicsData *bgd_iter = (DxfBinaryGraphicsData *) dxf_mline_get_binary_graphics_data (mline);
00774                 while (dxf_binary_graphics_data_get_data_line (bgd_iter) != NULL)
00775                 {
00776                         fprintf (fp->fp, "310\n%s\n", dxf_binary_graphics_data_get_data_line (bgd_iter));
00777                         bgd_iter = (DxfBinaryGraphicsData *) dxf_binary_graphics_data_get_next (bgd_iter);
00778                 }
00779         }
00780         if (fp->acad_version_number >= AutoCAD_2004)
00781         {
00782                 fprintf (fp->fp, "420\n%ld\n", dxf_mline_get_color_value (mline));
00783                 fprintf (fp->fp, "430\n%s\n", dxf_mline_get_color_name (mline));
00784                 fprintf (fp->fp, "440\n%ld\n", dxf_mline_get_transparency (mline));
00785         }
00786         if (fp->acad_version_number >= AutoCAD_2009)
00787         {
00788                 fprintf (fp->fp, "390\n%s\n", dxf_mline_get_plot_style_name (mline));
00789                 fprintf (fp->fp, "284\n%d\n", dxf_mline_get_shadow_mode (mline));
00790         }
00791         if (fp->acad_version_number >= AutoCAD_13)
00792         {
00793                 fprintf (fp->fp, "100\nAcDbMline\n");
00794         }
00795         if (mline->thickness != 0.0)
00796         {
00797                 fprintf (fp->fp, " 39\n%f\n", dxf_mline_get_thickness (mline));
00798         }
00799         fprintf (fp->fp, "  2\n%s\n", dxf_mline_get_style_name (mline));
00800         fprintf (fp->fp, "340\n%s\n", dxf_mline_get_mlinestyle_dictionary (mline));
00801         fprintf (fp->fp, " 40\n%f\n", dxf_mline_get_scale_factor (mline));
00802         fprintf (fp->fp, " 70\n%d\n", dxf_mline_get_justification (mline));
00803         fprintf (fp->fp, " 71\n%d\n", dxf_mline_get_flags (mline));
00804         fprintf (fp->fp, " 72\n%d\n", dxf_mline_get_number_of_vertices (mline));
00805         fprintf (fp->fp, " 73\n%d\n", dxf_mline_get_number_of_elements (mline));
00806         fprintf (fp->fp, " 10\n%f\n", dxf_mline_get_x0 (mline));
00807         fprintf (fp->fp, " 20\n%f\n", dxf_mline_get_y0 (mline));
00808         fprintf (fp->fp, " 30\n%f\n", dxf_mline_get_z0 (mline));
00809         if ((fp->acad_version_number >= AutoCAD_12)
00810                 && (dxf_mline_get_extr_x0 (mline) != 0.0)
00811                 && (dxf_mline_get_extr_y0 (mline) != 0.0)
00812                 && (dxf_mline_get_extr_z0 (mline) != 1.0))
00813         {
00814                 fprintf (fp->fp, "210\n%f\n", dxf_mline_get_extr_x0 (mline));
00815                 fprintf (fp->fp, "220\n%f\n", dxf_mline_get_extr_y0 (mline));
00816                 fprintf (fp->fp, "230\n%f\n", dxf_mline_get_extr_z0 (mline));
00817         }
00818         iter = (DxfPoint *) mline->p1;
00819         i = 1;
00820         while (iter->next != NULL)
00821         {
00822                 fprintf (fp->fp, " 11\n%f\n", iter->x0);
00823                 fprintf (fp->fp, " 21\n%f\n", iter->y0);
00824                 fprintf (fp->fp, " 31\n%f\n", iter->z0);
00825                 iter = (DxfPoint *) iter->next;
00826                 i++;
00827         }
00828         if (i != mline->number_of_vertices)
00829         {
00830                 fprintf (stderr,
00831                   (_("Warning in %s () actual number of vertices differs from number_of_vertices value in struct.\n")),
00832                   __FUNCTION__);
00833         }
00834         iter = (DxfPoint *) mline->p2;
00835         i = 1;
00836         while (iter->next != NULL)
00837         {
00838                 fprintf (fp->fp, " 12\n%f\n", iter->x0);
00839                 fprintf (fp->fp, " 22\n%f\n", iter->y0);
00840                 fprintf (fp->fp, " 32\n%f\n", iter->z0);
00841                 iter = (DxfPoint *) iter->next;
00842                 i++;
00843         }
00844         if (i != mline->number_of_vertices)
00845         {
00846                 fprintf (stderr,
00847                   (_("Warning in %s () actual number of vertices differs from number_of_vertices value in struct.\n")),
00848                   __FUNCTION__);
00849         }
00850         iter = (DxfPoint *) mline->p3;
00851         i = 1;
00852         while (iter->next != NULL)
00853         {
00854                 fprintf (fp->fp, " 13\n%f\n", iter->x0);
00855                 fprintf (fp->fp, " 23\n%f\n", iter->y0);
00856                 fprintf (fp->fp, " 33\n%f\n", iter->z0);
00857                 iter = (DxfPoint *) iter->next;
00858                 i++;
00859         }
00860         if (i != mline->number_of_vertices)
00861         {
00862                 fprintf (stderr,
00863                   (_("Warning in %s () actual number of vertices differs from number_of_vertices value in struct.\n")),
00864                   __FUNCTION__);
00865         }
00866         fprintf (fp->fp, " 74\n%d\n", mline->number_of_parameters);
00867         for (i = 0; i < mline->number_of_parameters; i++)
00868         {
00869                 fprintf (fp->fp, " 41\n%f\n", mline->element_parameters[i]);
00870         }
00871         fprintf (fp->fp, " 75\n%d\n", mline->number_of_area_fill_parameters);
00872         for (i = 0; i < mline->number_of_area_fill_parameters; i++)
00873         {
00874                 fprintf (fp->fp, " 42\n%f\n", mline->area_fill_parameters[i]);
00875         }
00876         /* Clean up. */
00877         free (dxf_entity_name);
00878 #if DEBUG
00879         DXF_DEBUG_END
00880 #endif
00881         return (EXIT_SUCCESS);
00882 }
00883 
00884 
00892 int
00893 dxf_mline_free
00894 (
00895         DxfMline *mline
00898 )
00899 {
00900 #if DEBUG
00901         DXF_DEBUG_BEGIN
00902 #endif
00903         /* Do some basic checks. */
00904         if (mline == NULL)
00905         {
00906                 fprintf (stderr,
00907                   (_("Error in %s () a NULL pointer was passed.\n")),
00908                   __FUNCTION__);
00909                 return (EXIT_FAILURE);
00910         }
00911         if (mline->next != NULL)
00912         {
00913                 fprintf (stderr,
00914                   (_("Error in %s () pointer to next was not NULL.\n")),
00915                   __FUNCTION__);
00916                 return (EXIT_FAILURE);
00917         }
00918         free (mline->linetype);
00919         free (mline->layer);
00920         dxf_binary_graphics_data_free (mline->binary_graphics_data);
00921         free (mline->dictionary_owner_soft);
00922         free (mline->material);
00923         free (mline->dictionary_owner_hard);
00924         free (mline->plot_style_name);
00925         free (mline->color_name);
00926         free (mline->style_name);
00927         dxf_point_free (mline->p0);
00928         dxf_point_free_chain (mline->p1);
00929         dxf_point_free_chain (mline->p2);
00930         dxf_point_free_chain (mline->p3);
00931         free (mline->mlinestyle_dictionary);
00932         free (mline);
00933         mline = NULL;
00934 #if DEBUG
00935         DXF_DEBUG_END
00936 #endif
00937         return (EXIT_SUCCESS);
00938 }
00939 
00940 
00945 void
00946 dxf_mline_free_chain
00947 (
00948         DxfMline *mlines
00950 )
00951 {
00952 #ifdef DEBUG
00953         DXF_DEBUG_BEGIN
00954 #endif
00955         if (mlines == NULL)
00956         {
00957                 fprintf (stderr,
00958                   (_("Warning in %s () a NULL pointer was passed.\n")),
00959                   __FUNCTION__);
00960         }
00961         while (mlines != NULL)
00962         {
00963                 struct DxfMline *iter = mlines->next;
00964                 dxf_mline_free (mlines);
00965                 mlines = (DxfMline *) iter;
00966         }
00967 #if DEBUG
00968         DXF_DEBUG_END
00969 #endif
00970 }
00971 
00972 
00978 int
00979 dxf_mline_get_id_code
00980 (
00981         DxfMline *mline
00983 )
00984 {
00985 #if DEBUG
00986         DXF_DEBUG_BEGIN
00987 #endif
00988         /* Do some basic checks. */
00989         if (mline == NULL)
00990         {
00991                 fprintf (stderr,
00992                   (_("Error in %s () a NULL pointer was passed.\n")),
00993                   __FUNCTION__);
00994                 return (EXIT_FAILURE);
00995         }
00996         if (mline->id_code < 0)
00997         {
00998                 fprintf (stderr,
00999                   (_("Error in %s () a negative value was found.\n")),
01000                   __FUNCTION__);
01001                 return (EXIT_FAILURE);
01002         }
01003 #if DEBUG
01004         DXF_DEBUG_END
01005 #endif
01006         return (mline->id_code);
01007 }
01008 
01009 
01013 DxfMline *
01014 dxf_mline_set_id_code
01015 (
01016         DxfMline *mline,
01018         int id_code
01022 )
01023 {
01024 #if DEBUG
01025         DXF_DEBUG_BEGIN
01026 #endif
01027         /* Do some basic checks. */
01028         if (mline == NULL)
01029         {
01030                 fprintf (stderr,
01031                   (_("Error in %s () a NULL pointer was passed.\n")),
01032                   __FUNCTION__);
01033                 return (NULL);
01034         }
01035         if (id_code < 0)
01036         {
01037                 fprintf (stderr,
01038                   (_("Error in %s () a negative value was passed.\n")),
01039                   __FUNCTION__);
01040                 return (NULL);
01041         }
01042         mline->id_code = id_code;
01043 #if DEBUG
01044         DXF_DEBUG_END
01045 #endif
01046         return (mline);
01047 }
01048 
01049 
01055 char *
01056 dxf_mline_get_linetype
01057 (
01058         DxfMline *mline
01060 )
01061 {
01062 #if DEBUG
01063         DXF_DEBUG_BEGIN
01064 #endif
01065         /* Do some basic checks. */
01066         if (mline == NULL)
01067         {
01068                 fprintf (stderr,
01069                   (_("Error in %s () a NULL pointer was passed.\n")),
01070                   __FUNCTION__);
01071                 return (NULL);
01072         }
01073         if (mline->linetype ==  NULL)
01074         {
01075                 fprintf (stderr,
01076                   (_("Error in %s () a NULL pointer was found.\n")),
01077                   __FUNCTION__);
01078                 return (NULL);
01079         }
01080 #if DEBUG
01081         DXF_DEBUG_END
01082 #endif
01083         return (strdup (mline->linetype));
01084 }
01085 
01086 
01090 DxfMline *
01091 dxf_mline_set_linetype
01092 (
01093         DxfMline *mline,
01095         char *linetype
01097 )
01098 {
01099 #if DEBUG
01100         DXF_DEBUG_BEGIN
01101 #endif
01102         /* Do some basic checks. */
01103         if (mline == NULL)
01104         {
01105                 fprintf (stderr,
01106                   (_("Error in %s () a NULL pointer was passed.\n")),
01107                   __FUNCTION__);
01108                 return (NULL);
01109         }
01110         if (linetype == NULL)
01111         {
01112                 fprintf (stderr,
01113                   (_("Error in %s () a NULL pointer was passed.\n")),
01114                   __FUNCTION__);
01115                 return (NULL);
01116         }
01117         mline->linetype = strdup (linetype);
01118 #if DEBUG
01119         DXF_DEBUG_END
01120 #endif
01121         return (mline);
01122 }
01123 
01124 
01130 char *
01131 dxf_mline_get_layer
01132 (
01133         DxfMline *mline
01135 )
01136 {
01137 #if DEBUG
01138         DXF_DEBUG_BEGIN
01139 #endif
01140         /* Do some basic checks. */
01141         if (mline == NULL)
01142         {
01143                 fprintf (stderr,
01144                   (_("Error in %s () a NULL pointer was passed.\n")),
01145                   __FUNCTION__);
01146                 return (NULL);
01147         }
01148         if (mline->layer ==  NULL)
01149         {
01150                 fprintf (stderr,
01151                   (_("Error in %s () a NULL pointer was found.\n")),
01152                   __FUNCTION__);
01153                 return (NULL);
01154         }
01155 #if DEBUG
01156         DXF_DEBUG_END
01157 #endif
01158         return (strdup (mline->layer));
01159 }
01160 
01161 
01165 DxfMline *
01166 dxf_mline_set_layer
01167 (
01168         DxfMline *mline,
01170         char *layer
01172 )
01173 {
01174 #if DEBUG
01175         DXF_DEBUG_BEGIN
01176 #endif
01177         /* Do some basic checks. */
01178         if (mline == NULL)
01179         {
01180                 fprintf (stderr,
01181                   (_("Error in %s () a NULL pointer was passed.\n")),
01182                   __FUNCTION__);
01183                 return (NULL);
01184         }
01185         if (layer == NULL)
01186         {
01187                 fprintf (stderr,
01188                   (_("Error in %s () a NULL pointer was passed.\n")),
01189                   __FUNCTION__);
01190                 return (NULL);
01191         }
01192         mline->layer = strdup (layer);
01193 #if DEBUG
01194         DXF_DEBUG_END
01195 #endif
01196         return (mline);
01197 }
01198 
01199 
01205 double
01206 dxf_mline_get_elevation
01207 (
01208         DxfMline *mline
01210 )
01211 {
01212 #if DEBUG
01213         DXF_DEBUG_BEGIN
01214 #endif
01215         /* Do some basic checks. */
01216         if (mline == NULL)
01217         {
01218                 fprintf (stderr,
01219                   (_("Error in %s () a NULL pointer was passed.\n")),
01220                   __FUNCTION__);
01221                 return (EXIT_FAILURE);
01222         }
01223 #if DEBUG
01224         DXF_DEBUG_END
01225 #endif
01226         return (mline->elevation);
01227 }
01228 
01229 
01233 DxfMline *
01234 dxf_mline_set_elevation
01235 (
01236         DxfMline *mline,
01238         double elevation
01240 )
01241 {
01242 #if DEBUG
01243         DXF_DEBUG_BEGIN
01244 #endif
01245         /* Do some basic checks. */
01246         if (mline == NULL)
01247         {
01248                 fprintf (stderr,
01249                   (_("Error in %s () a NULL pointer was passed.\n")),
01250                   __FUNCTION__);
01251                 return (NULL);
01252         }
01253         mline->elevation = elevation;
01254 #if DEBUG
01255         DXF_DEBUG_END
01256 #endif
01257         return (mline);
01258 }
01259 
01260 
01266 double
01267 dxf_mline_get_thickness
01268 (
01269         DxfMline *mline
01271 )
01272 {
01273 #if DEBUG
01274         DXF_DEBUG_BEGIN
01275 #endif
01276         /* Do some basic checks. */
01277         if (mline == NULL)
01278         {
01279                 fprintf (stderr,
01280                   (_("Error in %s () a NULL pointer was passed.\n")),
01281                   __FUNCTION__);
01282                 return (EXIT_FAILURE);
01283         }
01284         if (mline->thickness < 0.0)
01285         {
01286                 fprintf (stderr,
01287                   (_("Error in %s () a negative value was found.\n")),
01288                   __FUNCTION__);
01289                 return (EXIT_FAILURE);
01290         }
01291 #if DEBUG
01292         DXF_DEBUG_END
01293 #endif
01294         return (mline->thickness);
01295 }
01296 
01297 
01301 DxfMline *
01302 dxf_mline_set_thickness
01303 (
01304         DxfMline *mline,
01306         double thickness
01308 )
01309 {
01310 #if DEBUG
01311         DXF_DEBUG_BEGIN
01312 #endif
01313         /* Do some basic checks. */
01314         if (mline == NULL)
01315         {
01316                 fprintf (stderr,
01317                   (_("Error in %s () a NULL pointer was passed.\n")),
01318                   __FUNCTION__);
01319                 return (NULL);
01320         }
01321         if (thickness < 0.0)
01322         {
01323                 fprintf (stderr,
01324                   (_("Error in %s () a negative value was passed.\n")),
01325                   __FUNCTION__);
01326                 return (NULL);
01327         }
01328         mline->thickness = thickness;
01329 #if DEBUG
01330         DXF_DEBUG_END
01331 #endif
01332         return (mline);
01333 }
01334 
01335 
01341 double
01342 dxf_mline_get_linetype_scale
01343 (
01344         DxfMline *mline
01346 )
01347 {
01348 #if DEBUG
01349         DXF_DEBUG_BEGIN
01350 #endif
01351         /* Do some basic checks. */
01352         if (mline == NULL)
01353         {
01354                 fprintf (stderr,
01355                   (_("Error in %s () a NULL pointer was passed.\n")),
01356                   __FUNCTION__);
01357                 return (EXIT_FAILURE);
01358         }
01359         if (mline->linetype_scale < 0.0)
01360         {
01361                 fprintf (stderr,
01362                   (_("Error in %s () a negative value was found.\n")),
01363                   __FUNCTION__);
01364                 return (EXIT_FAILURE);
01365         }
01366 #if DEBUG
01367         DXF_DEBUG_END
01368 #endif
01369         return (mline->linetype_scale);
01370 }
01371 
01372 
01376 DxfMline *
01377 dxf_mline_set_linetype_scale
01378 (
01379         DxfMline *mline,
01381         double linetype_scale
01383 )
01384 {
01385 #if DEBUG
01386         DXF_DEBUG_BEGIN
01387 #endif
01388         /* Do some basic checks. */
01389         if (mline == NULL)
01390         {
01391                 fprintf (stderr,
01392                   (_("Error in %s () a NULL pointer was passed.\n")),
01393                   __FUNCTION__);
01394                 return (NULL);
01395         }
01396         if (linetype_scale < 0.0)
01397         {
01398                 fprintf (stderr,
01399                   (_("Error in %s () a negative value was passed.\n")),
01400                   __FUNCTION__);
01401                 return (NULL);
01402         }
01403         mline->linetype_scale = linetype_scale;
01404 #if DEBUG
01405         DXF_DEBUG_END
01406 #endif
01407         return (mline);
01408 }
01409 
01410 
01416 int16_t
01417 dxf_mline_get_visibility
01418 (
01419         DxfMline *mline
01421 )
01422 {
01423 #if DEBUG
01424         DXF_DEBUG_BEGIN
01425 #endif
01426         /* Do some basic checks. */
01427         if (mline == NULL)
01428         {
01429                 fprintf (stderr,
01430                   (_("Error in %s () a NULL pointer was passed.\n")),
01431                   __FUNCTION__);
01432                 return (EXIT_FAILURE);
01433         }
01434         if (mline->visibility < 0)
01435         {
01436                 fprintf (stderr,
01437                   (_("Error in %s () a negative value was found.\n")),
01438                   __FUNCTION__);
01439                 return (EXIT_FAILURE);
01440         }
01441         if (mline->visibility > 1)
01442         {
01443                 fprintf (stderr,
01444                   (_("Error in %s () an out of range value was found.\n")),
01445                   __FUNCTION__);
01446                 return (EXIT_FAILURE);
01447         }
01448 #if DEBUG
01449         DXF_DEBUG_END
01450 #endif
01451         return (mline->visibility);
01452 }
01453 
01454 
01458 DxfMline *
01459 dxf_mline_set_visibility
01460 (
01461         DxfMline *mline,
01463         int16_t visibility
01465 )
01466 {
01467 #if DEBUG
01468         DXF_DEBUG_BEGIN
01469 #endif
01470         /* Do some basic checks. */
01471         if (mline == NULL)
01472         {
01473                 fprintf (stderr,
01474                   (_("Error in %s () a NULL pointer was passed.\n")),
01475                   __FUNCTION__);
01476                 return (NULL);
01477         }
01478         if (visibility < 0)
01479         {
01480                 fprintf (stderr,
01481                   (_("Error in %s () a negative value was passed.\n")),
01482                   __FUNCTION__);
01483                 return (NULL);
01484         }
01485         if (visibility > 1)
01486         {
01487                 fprintf (stderr,
01488                   (_("Error in %s () an out of range value was passed.\n")),
01489                   __FUNCTION__);
01490                 return (NULL);
01491         }
01492         mline->visibility = visibility;
01493 #if DEBUG
01494         DXF_DEBUG_END
01495 #endif
01496         return (mline);
01497 }
01498 
01499 
01505 int
01506 dxf_mline_get_color
01507 (
01508         DxfMline *mline
01510 )
01511 {
01512 #if DEBUG
01513         DXF_DEBUG_BEGIN
01514 #endif
01515         /* Do some basic checks. */
01516         if (mline == NULL)
01517         {
01518                 fprintf (stderr,
01519                   (_("Error in %s () a NULL pointer was passed.\n")),
01520                   __FUNCTION__);
01521                 return (EXIT_FAILURE);
01522         }
01523         if (mline->color < 0)
01524         {
01525                 fprintf (stderr,
01526                   (_("Warning in %s () a negative value was found.\n")),
01527                   __FUNCTION__);
01528         }
01529 #if DEBUG
01530         DXF_DEBUG_END
01531 #endif
01532         return (mline->color);
01533 }
01534 
01535 
01539 DxfMline *
01540 dxf_mline_set_color
01541 (
01542         DxfMline *mline,
01544         int color
01546 )
01547 {
01548 #if DEBUG
01549         DXF_DEBUG_BEGIN
01550 #endif
01551         /* Do some basic checks. */
01552         if (mline == NULL)
01553         {
01554                 fprintf (stderr,
01555                   (_("Error in %s () a NULL pointer was passed.\n")),
01556                   __FUNCTION__);
01557                 return (NULL);
01558         }
01559         if (color < 0)
01560         {
01561                 fprintf (stderr,
01562                   (_("Warning in %s () a negative value was passed.\n")),
01563                   __FUNCTION__);
01564         }
01565         mline->color = color;
01566 #if DEBUG
01567         DXF_DEBUG_END
01568 #endif
01569         return (mline);
01570 }
01571 
01572 
01578 int
01579 dxf_mline_get_paperspace
01580 (
01581         DxfMline *mline
01583 )
01584 {
01585 #if DEBUG
01586         DXF_DEBUG_BEGIN
01587 #endif
01588         /* Do some basic checks. */
01589         if (mline == NULL)
01590         {
01591                 fprintf (stderr,
01592                   (_("Error in %s () a NULL pointer was passed.\n")),
01593                   __FUNCTION__);
01594                 return (EXIT_FAILURE);
01595         }
01596         if (mline->paperspace < 0)
01597         {
01598                 fprintf (stderr,
01599                   (_("Warning in %s () a negative value was found.\n")),
01600                   __FUNCTION__);
01601         }
01602         if (mline->paperspace > 1)
01603         {
01604                 fprintf (stderr,
01605                   (_("Warning in %s () an out of range value was found.\n")),
01606                   __FUNCTION__);
01607         }
01608 #if DEBUG
01609         DXF_DEBUG_END
01610 #endif
01611         return (mline->paperspace);
01612 }
01613 
01614 
01618 DxfMline *
01619 dxf_mline_set_paperspace
01620 (
01621         DxfMline *mline,
01623         int paperspace
01625 )
01626 {
01627 #if DEBUG
01628         DXF_DEBUG_BEGIN
01629 #endif
01630         /* Do some basic checks. */
01631         if (mline == NULL)
01632         {
01633                 fprintf (stderr,
01634                   (_("Error in %s () a NULL pointer was passed.\n")),
01635                   __FUNCTION__);
01636                 return (NULL);
01637         }
01638         if (paperspace < 0)
01639         {
01640                 fprintf (stderr,
01641                   (_("Error in %s () a negative value was passed.\n")),
01642                   __FUNCTION__);
01643                 return (NULL);
01644         }
01645         if (paperspace > 1)
01646         {
01647                 fprintf (stderr,
01648                   (_("Error in %s () an out of range value was passed.\n")),
01649                   __FUNCTION__);
01650                 return (NULL);
01651         }
01652         mline->paperspace = paperspace;
01653 #if DEBUG
01654         DXF_DEBUG_END
01655 #endif
01656         return (mline);
01657 }
01658 
01659 
01666 int
01667 dxf_mline_get_graphics_data_size
01668 (
01669         DxfMline *mline
01671 )
01672 {
01673 #if DEBUG
01674         DXF_DEBUG_BEGIN
01675 #endif
01676         /* Do some basic checks. */
01677         if (mline == NULL)
01678         {
01679                 fprintf (stderr,
01680                   (_("Error in %s () a NULL pointer was passed.\n")),
01681                   __FUNCTION__);
01682                 return (EXIT_FAILURE);
01683         }
01684         if (mline->graphics_data_size < 0)
01685         {
01686                 fprintf (stderr,
01687                   (_("Warning in %s () a negative value was found.\n")),
01688                   __FUNCTION__);
01689         }
01690         if (mline->graphics_data_size == 0)
01691         {
01692                 fprintf (stderr,
01693                   (_("Warning in %s () a zero value was found.\n")),
01694                   __FUNCTION__);
01695         }
01696 #if DEBUG
01697         DXF_DEBUG_END
01698 #endif
01699         return (mline->graphics_data_size);
01700 }
01701 
01702 
01709 DxfMline *
01710 dxf_mline_set_graphics_data_size
01711 (
01712         DxfMline *mline,
01714         int graphics_data_size
01717 )
01718 {
01719 #if DEBUG
01720         DXF_DEBUG_BEGIN
01721 #endif
01722         /* Do some basic checks. */
01723         if (mline == NULL)
01724         {
01725                 fprintf (stderr,
01726                   (_("Error in %s () a NULL pointer was passed.\n")),
01727                   __FUNCTION__);
01728                 return (NULL);
01729         }
01730         if (graphics_data_size < 0)
01731         {
01732                 fprintf (stderr,
01733                   (_("Error in %s () a negative value was passed.\n")),
01734                   __FUNCTION__);
01735                 return (NULL);
01736         }
01737         if (graphics_data_size == 0)
01738         {
01739                 fprintf (stderr,
01740                   (_("Warning in %s () a zero value was passed.\n")),
01741                   __FUNCTION__);
01742         }
01743         mline->graphics_data_size = graphics_data_size;
01744 #if DEBUG
01745         DXF_DEBUG_END
01746 #endif
01747         return (mline);
01748 }
01749 
01750 
01757 int16_t
01758 dxf_mline_get_shadow_mode
01759 (
01760         DxfMline *mline
01762 )
01763 {
01764 #if DEBUG
01765         DXF_DEBUG_BEGIN
01766 #endif
01767         /* Do some basic checks. */
01768         if (mline == NULL)
01769         {
01770                 fprintf (stderr,
01771                   (_("Error in %s () a NULL pointer was passed.\n")),
01772                   __FUNCTION__);
01773                 return (EXIT_FAILURE);
01774         }
01775         if (mline->shadow_mode < 0)
01776         {
01777                 fprintf (stderr,
01778                   (_("Error in %s () a negative value was found.\n")),
01779                   __FUNCTION__);
01780                 return (EXIT_FAILURE);
01781         }
01782         if (mline->shadow_mode > 3)
01783         {
01784                 fprintf (stderr,
01785                   (_("Error in %s () an out of range value was found.\n")),
01786                   __FUNCTION__);
01787                 return (EXIT_FAILURE);
01788         }
01789 #if DEBUG
01790         DXF_DEBUG_END
01791 #endif
01792         return (mline->shadow_mode);
01793 }
01794 
01795 
01802 DxfMline *
01803 dxf_mline_set_shadow_mode
01804 (
01805         DxfMline *mline,
01807         int16_t shadow_mode
01809 )
01810 {
01811 #if DEBUG
01812         DXF_DEBUG_BEGIN
01813 #endif
01814         /* Do some basic checks. */
01815         if (mline == NULL)
01816         {
01817                 fprintf (stderr,
01818                   (_("Error in %s () a NULL pointer was passed.\n")),
01819                   __FUNCTION__);
01820                 return (NULL);
01821         }
01822         if (shadow_mode < 0)
01823         {
01824                 fprintf (stderr,
01825                   (_("Error in %s () a negative value was passed.\n")),
01826                   __FUNCTION__);
01827                 return (NULL);
01828         }
01829         if (shadow_mode > 3)
01830         {
01831                 fprintf (stderr,
01832                   (_("Error in %s () an out of range value was passed.\n")),
01833                   __FUNCTION__);
01834                 return (NULL);
01835         }
01836         mline->shadow_mode = shadow_mode;
01837 #if DEBUG
01838         DXF_DEBUG_END
01839 #endif
01840         return (mline);
01841 }
01842 
01843 
01852 DxfBinaryGraphicsData *
01853 dxf_mline_get_binary_graphics_data
01854 (
01855         DxfMline *mline
01857 )
01858 {
01859 #if DEBUG
01860         DXF_DEBUG_BEGIN
01861 #endif
01862         /* Do some basic checks. */
01863         if (mline == NULL)
01864         {
01865                 fprintf (stderr,
01866                   (_("Error in %s () a NULL pointer was passed.\n")),
01867                   __FUNCTION__);
01868                 return (NULL);
01869         }
01870         if (mline->binary_graphics_data ==  NULL)
01871         {
01872                 fprintf (stderr,
01873                   (_("Error in %s () a NULL pointer was found.\n")),
01874                   __FUNCTION__);
01875                 return (NULL);
01876         }
01877 #if DEBUG
01878         DXF_DEBUG_END
01879 #endif
01880         return ((DxfBinaryGraphicsData *) mline->binary_graphics_data);
01881 }
01882 
01883 
01888 DxfMline *
01889 dxf_mline_set_binary_graphics_data
01890 (
01891         DxfMline *mline,
01893         DxfBinaryGraphicsData *data
01896 )
01897 {
01898 #if DEBUG
01899         DXF_DEBUG_BEGIN
01900 #endif
01901         /* Do some basic checks. */
01902         if (mline == NULL)
01903         {
01904                 fprintf (stderr,
01905                   (_("Error in %s () a NULL pointer was passed.\n")),
01906                   __FUNCTION__);
01907                 return (NULL);
01908         }
01909         if (data == NULL)
01910         {
01911                 fprintf (stderr,
01912                   (_("Error in %s () a NULL pointer was passed.\n")),
01913                   __FUNCTION__);
01914                 return (NULL);
01915         }
01916         mline->binary_graphics_data = (DxfBinaryGraphicsData *) data;
01917 #if DEBUG
01918         DXF_DEBUG_END
01919 #endif
01920         return (mline);
01921 }
01922 
01923 
01932 char *
01933 dxf_mline_get_dictionary_owner_soft
01934 (
01935         DxfMline *mline
01937 )
01938 {
01939 #if DEBUG
01940         DXF_DEBUG_BEGIN
01941 #endif
01942         /* Do some basic checks. */
01943         if (mline == NULL)
01944         {
01945                 fprintf (stderr,
01946                   (_("Error in %s () a NULL pointer was passed.\n")),
01947                   __FUNCTION__);
01948                 return (NULL);
01949         }
01950         if (mline->dictionary_owner_soft ==  NULL)
01951         {
01952                 fprintf (stderr,
01953                   (_("Error in %s () a NULL pointer was found.\n")),
01954                   __FUNCTION__);
01955                 return (NULL);
01956         }
01957 #if DEBUG
01958         DXF_DEBUG_END
01959 #endif
01960         return (strdup (mline->dictionary_owner_soft));
01961 }
01962 
01963 
01968 DxfMline *
01969 dxf_mline_set_dictionary_owner_soft
01970 (
01971         DxfMline *mline,
01973         char *dictionary_owner_soft
01976 )
01977 {
01978 #if DEBUG
01979         DXF_DEBUG_BEGIN
01980 #endif
01981         /* Do some basic checks. */
01982         if (mline == NULL)
01983         {
01984                 fprintf (stderr,
01985                   (_("Error in %s () a NULL pointer was passed.\n")),
01986                   __FUNCTION__);
01987                 return (NULL);
01988         }
01989         if (dictionary_owner_soft == NULL)
01990         {
01991                 fprintf (stderr,
01992                   (_("Error in %s () a NULL pointer was passed.\n")),
01993                   __FUNCTION__);
01994                 return (NULL);
01995         }
01996         mline->dictionary_owner_soft = strdup (dictionary_owner_soft);
01997 #if DEBUG
01998         DXF_DEBUG_END
01999 #endif
02000         return (mline);
02001 }
02002 
02003 
02012 char *
02013 dxf_mline_get_material
02014 (
02015         DxfMline *mline
02017 )
02018 {
02019 #if DEBUG
02020         DXF_DEBUG_BEGIN
02021 #endif
02022         /* Do some basic checks. */
02023         if (mline == NULL)
02024         {
02025                 fprintf (stderr,
02026                   (_("Error in %s () a NULL pointer was passed.\n")),
02027                   __FUNCTION__);
02028                 return (NULL);
02029         }
02030         if (mline->material ==  NULL)
02031         {
02032                 fprintf (stderr,
02033                   (_("Error in %s () a NULL pointer was found.\n")),
02034                   __FUNCTION__);
02035                 return (NULL);
02036         }
02037 #if DEBUG
02038         DXF_DEBUG_END
02039 #endif
02040         return (strdup (mline->material));
02041 }
02042 
02043 
02050 DxfMline *
02051 dxf_mline_set_material
02052 (
02053         DxfMline *mline,
02055         char *material
02058 )
02059 {
02060 #if DEBUG
02061         DXF_DEBUG_BEGIN
02062 #endif
02063         /* Do some basic checks. */
02064         if (mline == NULL)
02065         {
02066                 fprintf (stderr,
02067                   (_("Error in %s () a NULL pointer was passed.\n")),
02068                   __FUNCTION__);
02069                 return (NULL);
02070         }
02071         if (material == NULL)
02072         {
02073                 fprintf (stderr,
02074                   (_("Error in %s () a NULL pointer was passed.\n")),
02075                   __FUNCTION__);
02076                 return (NULL);
02077         }
02078         mline->material = strdup (material);
02079 #if DEBUG
02080         DXF_DEBUG_END
02081 #endif
02082         return (mline);
02083 }
02084 
02085 
02094 char *
02095 dxf_mline_get_dictionary_owner_hard
02096 (
02097         DxfMline *mline
02099 )
02100 {
02101 #if DEBUG
02102         DXF_DEBUG_BEGIN
02103 #endif
02104         /* Do some basic checks. */
02105         if (mline == NULL)
02106         {
02107                 fprintf (stderr,
02108                   (_("Error in %s () a NULL pointer was passed.\n")),
02109                   __FUNCTION__);
02110                 return (NULL);
02111         }
02112         if (mline->dictionary_owner_hard ==  NULL)
02113         {
02114                 fprintf (stderr,
02115                   (_("Error in %s () a NULL pointer was found.\n")),
02116                   __FUNCTION__);
02117                 return (NULL);
02118         }
02119 #if DEBUG
02120         DXF_DEBUG_END
02121 #endif
02122         return (strdup (mline->dictionary_owner_hard));
02123 }
02124 
02125 
02130 DxfMline *
02131 dxf_mline_set_dictionary_owner_hard
02132 (
02133         DxfMline *mline,
02135         char *dictionary_owner_hard
02138 )
02139 {
02140 #if DEBUG
02141         DXF_DEBUG_BEGIN
02142 #endif
02143         /* Do some basic checks. */
02144         if (mline == NULL)
02145         {
02146                 fprintf (stderr,
02147                   (_("Error in %s () a NULL pointer was passed.\n")),
02148                   __FUNCTION__);
02149                 return (NULL);
02150         }
02151         if (dictionary_owner_hard == NULL)
02152         {
02153                 fprintf (stderr,
02154                   (_("Error in %s () a NULL pointer was passed.\n")),
02155                   __FUNCTION__);
02156                 return (NULL);
02157         }
02158         mline->dictionary_owner_hard = strdup (dictionary_owner_hard);
02159 #if DEBUG
02160         DXF_DEBUG_END
02161 #endif
02162         return (mline);
02163 }
02164 
02165 
02172 int16_t
02173 dxf_mline_get_lineweight
02174 (
02175         DxfMline *mline
02177 )
02178 {
02179 #if DEBUG
02180         DXF_DEBUG_BEGIN
02181 #endif
02182         /* Do some basic checks. */
02183         if (mline == NULL)
02184         {
02185                 fprintf (stderr,
02186                   (_("Error in %s () a NULL pointer was passed.\n")),
02187                   __FUNCTION__);
02188                 return (EXIT_FAILURE);
02189         }
02190 #if DEBUG
02191         DXF_DEBUG_END
02192 #endif
02193         return (mline->lineweight);
02194 }
02195 
02196 
02203 DxfMline *
02204 dxf_mline_set_lineweight
02205 (
02206         DxfMline *mline,
02208         int16_t lineweight
02210 )
02211 {
02212 #if DEBUG
02213         DXF_DEBUG_BEGIN
02214 #endif
02215         /* Do some basic checks. */
02216         if (mline == NULL)
02217         {
02218                 fprintf (stderr,
02219                   (_("Error in %s () a NULL pointer was passed.\n")),
02220                   __FUNCTION__);
02221                 return (NULL);
02222         }
02223         mline->lineweight = lineweight;
02224 #if DEBUG
02225         DXF_DEBUG_END
02226 #endif
02227         return (mline);
02228 }
02229 
02230 
02237 char *
02238 dxf_mline_get_plot_style_name
02239 (
02240         DxfMline *mline
02242 )
02243 {
02244 #if DEBUG
02245         DXF_DEBUG_BEGIN
02246 #endif
02247         /* Do some basic checks. */
02248         if (mline == NULL)
02249         {
02250                 fprintf (stderr,
02251                   (_("Error in %s () a NULL pointer was passed.\n")),
02252                   __FUNCTION__);
02253                 return (NULL);
02254         }
02255         if (mline->plot_style_name ==  NULL)
02256         {
02257                 fprintf (stderr,
02258                   (_("Error in %s () a NULL pointer was found.\n")),
02259                   __FUNCTION__);
02260                 return (NULL);
02261         }
02262 #if DEBUG
02263         DXF_DEBUG_END
02264 #endif
02265         return (strdup (mline->plot_style_name));
02266 }
02267 
02268 
02275 DxfMline *
02276 dxf_mline_set_plot_style_name
02277 (
02278         DxfMline *mline,
02280         char *plot_style_name
02283 )
02284 {
02285 #if DEBUG
02286         DXF_DEBUG_BEGIN
02287 #endif
02288         /* Do some basic checks. */
02289         if (mline == NULL)
02290         {
02291                 fprintf (stderr,
02292                   (_("Error in %s () a NULL pointer was passed.\n")),
02293                   __FUNCTION__);
02294                 return (NULL);
02295         }
02296         if (plot_style_name == NULL)
02297         {
02298                 fprintf (stderr,
02299                   (_("Error in %s () a NULL pointer was passed.\n")),
02300                   __FUNCTION__);
02301                 return (NULL);
02302         }
02303         mline->plot_style_name = strdup (plot_style_name);
02304 #if DEBUG
02305         DXF_DEBUG_END
02306 #endif
02307         return (mline);
02308 }
02309 
02310 
02317 long
02318 dxf_mline_get_color_value
02319 (
02320         DxfMline *mline
02322 )
02323 {
02324 #if DEBUG
02325         DXF_DEBUG_BEGIN
02326 #endif
02327         /* Do some basic checks. */
02328         if (mline == NULL)
02329         {
02330                 fprintf (stderr,
02331                   (_("Error in %s () a NULL pointer was passed.\n")),
02332                   __FUNCTION__);
02333                 return (EXIT_FAILURE);
02334         }
02335 #if DEBUG
02336         DXF_DEBUG_END
02337 #endif
02338         return (mline->color_value);
02339 }
02340 
02341 
02348 DxfMline *
02349 dxf_mline_set_color_value
02350 (
02351         DxfMline *mline,
02353         long color_value
02355 )
02356 {
02357 #if DEBUG
02358         DXF_DEBUG_BEGIN
02359 #endif
02360         /* Do some basic checks. */
02361         if (mline == NULL)
02362         {
02363                 fprintf (stderr,
02364                   (_("Error in %s () a NULL pointer was passed.\n")),
02365                   __FUNCTION__);
02366                 return (NULL);
02367         }
02368         mline->color_value = color_value;
02369 #if DEBUG
02370         DXF_DEBUG_END
02371 #endif
02372         return (mline);
02373 }
02374 
02375 
02382 char *
02383 dxf_mline_get_color_name
02384 (
02385         DxfMline *mline
02387 )
02388 {
02389 #if DEBUG
02390         DXF_DEBUG_BEGIN
02391 #endif
02392         /* Do some basic checks. */
02393         if (mline == NULL)
02394         {
02395                 fprintf (stderr,
02396                   (_("Error in %s () a NULL pointer was passed.\n")),
02397                   __FUNCTION__);
02398                 return (NULL);
02399         }
02400         if (mline->color_name ==  NULL)
02401         {
02402                 fprintf (stderr,
02403                   (_("Error in %s () a NULL pointer was found.\n")),
02404                   __FUNCTION__);
02405                 return (NULL);
02406         }
02407 #if DEBUG
02408         DXF_DEBUG_END
02409 #endif
02410         return (strdup (mline->color_name));
02411 }
02412 
02413 
02420 DxfMline *
02421 dxf_mline_set_color_name
02422 (
02423         DxfMline *mline,
02425         char *color_name
02428 )
02429 {
02430 #if DEBUG
02431         DXF_DEBUG_BEGIN
02432 #endif
02433         /* Do some basic checks. */
02434         if (mline == NULL)
02435         {
02436                 fprintf (stderr,
02437                   (_("Error in %s () a NULL pointer was passed.\n")),
02438                   __FUNCTION__);
02439                 return (NULL);
02440         }
02441         if (color_name == NULL)
02442         {
02443                 fprintf (stderr,
02444                   (_("Error in %s () a NULL pointer was passed.\n")),
02445                   __FUNCTION__);
02446                 return (NULL);
02447         }
02448         mline->color_name = strdup (color_name);
02449 #if DEBUG
02450         DXF_DEBUG_END
02451 #endif
02452         return (mline);
02453 }
02454 
02455 
02462 long
02463 dxf_mline_get_transparency
02464 (
02465         DxfMline *mline
02467 )
02468 {
02469 #if DEBUG
02470         DXF_DEBUG_BEGIN
02471 #endif
02472         /* Do some basic checks. */
02473         if (mline == NULL)
02474         {
02475                 fprintf (stderr,
02476                   (_("Error in %s () a NULL pointer was passed.\n")),
02477                   __FUNCTION__);
02478                 return (EXIT_FAILURE);
02479         }
02480 #if DEBUG
02481         DXF_DEBUG_END
02482 #endif
02483         return (mline->transparency);
02484 }
02485 
02486 
02493 DxfMline *
02494 dxf_mline_set_transparency
02495 (
02496         DxfMline *mline,
02498         long transparency
02500 )
02501 {
02502 #if DEBUG
02503         DXF_DEBUG_BEGIN
02504 #endif
02505         /* Do some basic checks. */
02506         if (mline == NULL)
02507         {
02508                 fprintf (stderr,
02509                   (_("Error in %s () a NULL pointer was passed.\n")),
02510                   __FUNCTION__);
02511                 return (NULL);
02512         }
02513         mline->transparency = transparency;
02514 #if DEBUG
02515         DXF_DEBUG_END
02516 #endif
02517         return (mline);
02518 }
02519 
02520 
02527 char *
02528 dxf_mline_get_style_name
02529 (
02530         DxfMline *mline
02532 )
02533 {
02534 #if DEBUG
02535         DXF_DEBUG_BEGIN
02536 #endif
02537         /* Do some basic checks. */
02538         if (mline == NULL)
02539         {
02540                 fprintf (stderr,
02541                   (_("Error in %s () a NULL pointer was passed.\n")),
02542                   __FUNCTION__);
02543                 return (NULL);
02544         }
02545         if (mline->style_name ==  NULL)
02546         {
02547                 fprintf (stderr,
02548                   (_("Error in %s () a NULL pointer was found.\n")),
02549                   __FUNCTION__);
02550                 return (NULL);
02551         }
02552 #if DEBUG
02553         DXF_DEBUG_END
02554 #endif
02555         return (strdup (mline->style_name));
02556 }
02557 
02558 
02565 DxfMline *
02566 dxf_mline_set_style_name
02567 (
02568         DxfMline *mline,
02570         char *style_name
02573 )
02574 {
02575 #if DEBUG
02576         DXF_DEBUG_BEGIN
02577 #endif
02578         /* Do some basic checks. */
02579         if (mline == NULL)
02580         {
02581                 fprintf (stderr,
02582                   (_("Error in %s () a NULL pointer was passed.\n")),
02583                   __FUNCTION__);
02584                 return (NULL);
02585         }
02586         if (style_name == NULL)
02587         {
02588                 fprintf (stderr,
02589                   (_("Error in %s () a NULL pointer was passed.\n")),
02590                   __FUNCTION__);
02591                 return (NULL);
02592         }
02593         mline->style_name = strdup (style_name);
02594 #if DEBUG
02595         DXF_DEBUG_END
02596 #endif
02597         return (mline);
02598 }
02599 
02600 
02606 DxfPoint *
02607 dxf_mline_get_p0
02608 (
02609         DxfMline *mline
02611 )
02612 {
02613 #ifdef DEBUG
02614         DXF_DEBUG_BEGIN
02615 #endif
02616         /* Do some basic checks. */
02617         if (mline == NULL)
02618         {
02619                 fprintf (stderr,
02620                   (_("Error in %s () a NULL pointer was passed.\n")),
02621                   __FUNCTION__);
02622                 return (NULL);
02623         }
02624         if (mline->p0 == NULL)
02625         {
02626                 fprintf (stderr,
02627                   (_("Error in %s () a NULL pointer was found.\n")),
02628                   __FUNCTION__);
02629                 return (NULL);
02630         }
02631 #if DEBUG
02632         DXF_DEBUG_END
02633 #endif
02634         return (mline->p0);
02635 }
02636 
02637 
02643 DxfMline *
02644 dxf_mline_set_p0
02645 (
02646         DxfMline *mline,
02648         DxfPoint *p0
02650 )
02651 {
02652 #ifdef DEBUG
02653         DXF_DEBUG_BEGIN
02654 #endif
02655         /* Do some basic checks. */
02656         if (mline == NULL)
02657         {
02658                 fprintf (stderr,
02659                   (_("Error in %s () a NULL pointer was passed.\n")),
02660                   __FUNCTION__);
02661                 return (NULL);
02662         }
02663         if (p0 == NULL)
02664         {
02665                 fprintf (stderr,
02666                   (_("Error in %s () a NULL pointer was passed.\n")),
02667                   __FUNCTION__);
02668                 return (NULL);
02669         }
02670         mline->p0 = p0;
02671 #if DEBUG
02672         DXF_DEBUG_END
02673 #endif
02674         return (mline);
02675 }
02676 
02677 
02684 double
02685 dxf_mline_get_x0
02686 (
02687         DxfMline *mline
02689 )
02690 {
02691 #ifdef DEBUG
02692         DXF_DEBUG_BEGIN
02693 #endif
02694 
02695         /* Do some basic checks. */
02696         if (mline == NULL)
02697         {
02698                 fprintf (stderr,
02699                   (_("Error in %s () a NULL pointer was passed.\n")),
02700                   __FUNCTION__);
02701                 return (EXIT_FAILURE);
02702         }
02703         if (mline->p0 == NULL)
02704         {
02705                 fprintf (stderr,
02706                   (_("Error in %s () a NULL pointer was found.\n")),
02707                   __FUNCTION__);
02708                 return (EXIT_FAILURE);
02709         }
02710 #if DEBUG
02711         DXF_DEBUG_END
02712 #endif
02713         return (mline->p0->x0);
02714 }
02715 
02716 
02724 DxfMline *
02725 dxf_mline_set_x0
02726 (
02727         DxfMline *mline,
02729         double x0
02732 )
02733 {
02734 #ifdef DEBUG
02735         DXF_DEBUG_BEGIN
02736 #endif
02737         /* Do some basic checks. */
02738         if (mline == NULL)
02739         {
02740                 fprintf (stderr,
02741                   (_("Error in %s () a NULL pointer was passed.\n")),
02742                   __FUNCTION__);
02743                 return (NULL);
02744         }
02745         if (mline->p0 == NULL)
02746         {
02747                 fprintf (stderr,
02748                   (_("Error in %s () a NULL pointer was found.\n")),
02749                   __FUNCTION__);
02750                 return (NULL);
02751         }
02752         mline->p0->x0 = x0;
02753 #if DEBUG
02754         DXF_DEBUG_END
02755 #endif
02756         return (mline);
02757 }
02758 
02759 
02766 double
02767 dxf_mline_get_y0
02768 (
02769         DxfMline *mline
02771 )
02772 {
02773 #ifdef DEBUG
02774         DXF_DEBUG_BEGIN
02775 #endif
02776 
02777         /* Do some basic checks. */
02778         if (mline == NULL)
02779         {
02780                 fprintf (stderr,
02781                   (_("Error in %s () a NULL pointer was passed.\n")),
02782                   __FUNCTION__);
02783                 return (EXIT_FAILURE);
02784         }
02785         if (mline->p0 == NULL)
02786         {
02787                 fprintf (stderr,
02788                   (_("Error in %s () a NULL pointer was found.\n")),
02789                   __FUNCTION__);
02790                 return (EXIT_FAILURE);
02791         }
02792 #if DEBUG
02793         DXF_DEBUG_END
02794 #endif
02795         return (mline->p0->y0);
02796 }
02797 
02798 
02806 DxfMline *
02807 dxf_mline_set_y0
02808 (
02809         DxfMline *mline,
02811         double y0
02814 )
02815 {
02816 #ifdef DEBUG
02817         DXF_DEBUG_BEGIN
02818 #endif
02819         /* Do some basic checks. */
02820         if (mline == NULL)
02821         {
02822                 fprintf (stderr,
02823                   (_("Error in %s () a NULL pointer was passed.\n")),
02824                   __FUNCTION__);
02825                 return (NULL);
02826         }
02827         if (mline->p0 == NULL)
02828         {
02829                 fprintf (stderr,
02830                   (_("Error in %s () a NULL pointer was found.\n")),
02831                   __FUNCTION__);
02832                 return (NULL);
02833         }
02834         mline->p0->y0 = y0;
02835 #if DEBUG
02836         DXF_DEBUG_END
02837 #endif
02838         return (mline);
02839 }
02840 
02841 
02848 double
02849 dxf_mline_get_z0
02850 (
02851         DxfMline *mline
02853 )
02854 {
02855 #ifdef DEBUG
02856         DXF_DEBUG_BEGIN
02857 #endif
02858 
02859         /* Do some basic checks. */
02860         if (mline == NULL)
02861         {
02862                 fprintf (stderr,
02863                   (_("Error in %s () a NULL pointer was passed.\n")),
02864                   __FUNCTION__);
02865                 return (EXIT_FAILURE);
02866         }
02867         if (mline->p0 == NULL)
02868         {
02869                 fprintf (stderr,
02870                   (_("Error in %s () a NULL pointer was found.\n")),
02871                   __FUNCTION__);
02872                 return (EXIT_FAILURE);
02873         }
02874 #if DEBUG
02875         DXF_DEBUG_END
02876 #endif
02877         return (mline->p0->z0);
02878 }
02879 
02880 
02888 DxfMline *
02889 dxf_mline_set_z0
02890 (
02891         DxfMline *mline,
02893         double z0
02896 )
02897 {
02898 #ifdef DEBUG
02899         DXF_DEBUG_BEGIN
02900 #endif
02901         /* Do some basic checks. */
02902         if (mline == NULL)
02903         {
02904                 fprintf (stderr,
02905                   (_("Error in %s () a NULL pointer was passed.\n")),
02906                   __FUNCTION__);
02907                 return (NULL);
02908         }
02909         if (mline->p0 == NULL)
02910         {
02911                 fprintf (stderr,
02912                   (_("Error in %s () a NULL pointer was found.\n")),
02913                   __FUNCTION__);
02914                 return (NULL);
02915         }
02916         mline->p0->z0 = z0;
02917 #if DEBUG
02918         DXF_DEBUG_END
02919 #endif
02920         return (mline);
02921 }
02922 
02923 
02930 DxfPoint *
02931 dxf_mline_get_p1
02932 (
02933         DxfMline *mline
02935 )
02936 {
02937 #ifdef DEBUG
02938         DXF_DEBUG_BEGIN
02939 #endif
02940         /* Do some basic checks. */
02941         if (mline == NULL)
02942         {
02943                 fprintf (stderr,
02944                   (_("Error in %s () a NULL pointer was passed.\n")),
02945                   __FUNCTION__);
02946                 return (NULL);
02947         }
02948         if (mline->p1 == NULL)
02949         {
02950                 fprintf (stderr,
02951                   (_("Error in %s () a NULL pointer was found.\n")),
02952                   __FUNCTION__);
02953                 return (NULL);
02954         }
02955 #if DEBUG
02956         DXF_DEBUG_END
02957 #endif
02958         return (mline->p1);
02959 }
02960 
02961 
02968 DxfMline *
02969 dxf_mline_set_p1
02970 (
02971         DxfMline *mline,
02973         DxfPoint *p1
02975 )
02976 {
02977 #ifdef DEBUG
02978         DXF_DEBUG_BEGIN
02979 #endif
02980         /* Do some basic checks. */
02981         if (mline == NULL)
02982         {
02983                 fprintf (stderr,
02984                   (_("Error in %s () a NULL pointer was passed.\n")),
02985                   __FUNCTION__);
02986                 return (NULL);
02987         }
02988         if (p1 == NULL)
02989         {
02990                 fprintf (stderr,
02991                   (_("Error in %s () a NULL pointer was passed.\n")),
02992                   __FUNCTION__);
02993                 return (NULL);
02994         }
02995         mline->p1 = p1;
02996 #if DEBUG
02997         DXF_DEBUG_END
02998 #endif
02999         return (mline);
03000 }
03001 
03002 
03010 double
03011 dxf_mline_get_x1
03012 (
03013         DxfMline *mline
03015 )
03016 {
03017 #ifdef DEBUG
03018         DXF_DEBUG_BEGIN
03019 #endif
03020 
03021         /* Do some basic checks. */
03022         if (mline == NULL)
03023         {
03024                 fprintf (stderr,
03025                   (_("Error in %s () a NULL pointer was passed.\n")),
03026                   __FUNCTION__);
03027                 return (EXIT_FAILURE);
03028         }
03029         if (mline->p1 == NULL)
03030         {
03031                 fprintf (stderr,
03032                   (_("Error in %s () a NULL pointer was found.\n")),
03033                   __FUNCTION__);
03034                 return (EXIT_FAILURE);
03035         }
03036 #if DEBUG
03037         DXF_DEBUG_END
03038 #endif
03039         return (mline->p1->x0);
03040 }
03041 
03042 
03050 DxfMline *
03051 dxf_mline_set_x1
03052 (
03053         DxfMline *mline,
03055         double x1
03058 )
03059 {
03060 #ifdef DEBUG
03061         DXF_DEBUG_BEGIN
03062 #endif
03063         /* Do some basic checks. */
03064         if (mline == NULL)
03065         {
03066                 fprintf (stderr,
03067                   (_("Error in %s () a NULL pointer was passed.\n")),
03068                   __FUNCTION__);
03069                 return (NULL);
03070         }
03071         if (mline->p1 == NULL)
03072         {
03073                 fprintf (stderr,
03074                   (_("Error in %s () a NULL pointer was found.\n")),
03075                   __FUNCTION__);
03076                 return (NULL);
03077         }
03078         mline->p1->x0 = x1;
03079 #if DEBUG
03080         DXF_DEBUG_END
03081 #endif
03082         return (mline);
03083 }
03084 
03085 
03093 double
03094 dxf_mline_get_y1
03095 (
03096         DxfMline *mline
03098 )
03099 {
03100 #ifdef DEBUG
03101         DXF_DEBUG_BEGIN
03102 #endif
03103 
03104         /* Do some basic checks. */
03105         if (mline == NULL)
03106         {
03107                 fprintf (stderr,
03108                   (_("Error in %s () a NULL pointer was passed.\n")),
03109                   __FUNCTION__);
03110                 return (EXIT_FAILURE);
03111         }
03112         if (mline->p1 == NULL)
03113         {
03114                 fprintf (stderr,
03115                   (_("Error in %s () a NULL pointer was found.\n")),
03116                   __FUNCTION__);
03117                 return (EXIT_FAILURE);
03118         }
03119 #if DEBUG
03120         DXF_DEBUG_END
03121 #endif
03122         return (mline->p1->y0);
03123 }
03124 
03125 
03133 DxfMline *
03134 dxf_mline_set_y1
03135 (
03136         DxfMline *mline,
03138         double y1
03141 )
03142 {
03143 #ifdef DEBUG
03144         DXF_DEBUG_BEGIN
03145 #endif
03146         /* Do some basic checks. */
03147         if (mline == NULL)
03148         {
03149                 fprintf (stderr,
03150                   (_("Error in %s () a NULL pointer was passed.\n")),
03151                   __FUNCTION__);
03152                 return (NULL);
03153         }
03154         if (mline->p1 == NULL)
03155         {
03156                 fprintf (stderr,
03157                   (_("Error in %s () a NULL pointer was found.\n")),
03158                   __FUNCTION__);
03159                 return (NULL);
03160         }
03161         mline->p1->y0 = y1;
03162 #if DEBUG
03163         DXF_DEBUG_END
03164 #endif
03165         return (mline);
03166 }
03167 
03168 
03176 double
03177 dxf_mline_get_z1
03178 (
03179         DxfMline *mline
03181 )
03182 {
03183 #ifdef DEBUG
03184         DXF_DEBUG_BEGIN
03185 #endif
03186 
03187         /* Do some basic checks. */
03188         if (mline == NULL)
03189         {
03190                 fprintf (stderr,
03191                   (_("Error in %s () a NULL pointer was passed.\n")),
03192                   __FUNCTION__);
03193                 return (EXIT_FAILURE);
03194         }
03195         if (mline->p1 == NULL)
03196         {
03197                 fprintf (stderr,
03198                   (_("Error in %s () a NULL pointer was found.\n")),
03199                   __FUNCTION__);
03200                 return (EXIT_FAILURE);
03201         }
03202 #if DEBUG
03203         DXF_DEBUG_END
03204 #endif
03205         return (mline->p1->z0);
03206 }
03207 
03208 
03216 DxfMline *
03217 dxf_mline_set_z1
03218 (
03219         DxfMline *mline,
03221         double z1
03224 )
03225 {
03226 #ifdef DEBUG
03227         DXF_DEBUG_BEGIN
03228 #endif
03229         /* Do some basic checks. */
03230         if (mline == NULL)
03231         {
03232                 fprintf (stderr,
03233                   (_("Error in %s () a NULL pointer was passed.\n")),
03234                   __FUNCTION__);
03235                 return (NULL);
03236         }
03237         if (mline->p1 == NULL)
03238         {
03239                 fprintf (stderr,
03240                   (_("Error in %s () a NULL pointer was found.\n")),
03241                   __FUNCTION__);
03242                 return (NULL);
03243         }
03244         mline->p1->z0 = z1;
03245 #if DEBUG
03246         DXF_DEBUG_END
03247 #endif
03248         return (mline);
03249 }
03250 
03251 
03258 DxfPoint *
03259 dxf_mline_get_p2
03260 (
03261         DxfMline *mline
03263 )
03264 {
03265 #ifdef DEBUG
03266         DXF_DEBUG_BEGIN
03267 #endif
03268         /* Do some basic checks. */
03269         if (mline == NULL)
03270         {
03271                 fprintf (stderr,
03272                   (_("Error in %s () a NULL pointer was passed.\n")),
03273                   __FUNCTION__);
03274                 return (NULL);
03275         }
03276         if (mline->p2 == NULL)
03277         {
03278                 fprintf (stderr,
03279                   (_("Error in %s () a NULL pointer was found.\n")),
03280                   __FUNCTION__);
03281                 return (NULL);
03282         }
03283 #if DEBUG
03284         DXF_DEBUG_END
03285 #endif
03286         return (mline->p2);
03287 }
03288 
03289 
03296 DxfMline *
03297 dxf_mline_set_p2
03298 (
03299         DxfMline *mline,
03301         DxfPoint *p2
03303 )
03304 {
03305 #ifdef DEBUG
03306         DXF_DEBUG_BEGIN
03307 #endif
03308         /* Do some basic checks. */
03309         if (mline == NULL)
03310         {
03311                 fprintf (stderr,
03312                   (_("Error in %s () a NULL pointer was passed.\n")),
03313                   __FUNCTION__);
03314                 return (NULL);
03315         }
03316         if (p2 == NULL)
03317         {
03318                 fprintf (stderr,
03319                   (_("Error in %s () a NULL pointer was passed.\n")),
03320                   __FUNCTION__);
03321                 return (NULL);
03322         }
03323         mline->p2 = p2;
03324 #if DEBUG
03325         DXF_DEBUG_END
03326 #endif
03327         return (mline);
03328 }
03329 
03330 
03338 double
03339 dxf_mline_get_x2
03340 (
03341         DxfMline *mline
03343 )
03344 {
03345 #ifdef DEBUG
03346         DXF_DEBUG_BEGIN
03347 #endif
03348 
03349         /* Do some basic checks. */
03350         if (mline == NULL)
03351         {
03352                 fprintf (stderr,
03353                   (_("Error in %s () a NULL pointer was passed.\n")),
03354                   __FUNCTION__);
03355                 return (EXIT_FAILURE);
03356         }
03357         if (mline->p2 == NULL)
03358         {
03359                 fprintf (stderr,
03360                   (_("Error in %s () a NULL pointer was found.\n")),
03361                   __FUNCTION__);
03362                 return (EXIT_FAILURE);
03363         }
03364 #if DEBUG
03365         DXF_DEBUG_END
03366 #endif
03367         return (mline->p2->x0);
03368 }
03369 
03370 
03378 DxfMline *
03379 dxf_mline_set_x2
03380 (
03381         DxfMline *mline,
03383         double x2
03387 )
03388 {
03389 #ifdef DEBUG
03390         DXF_DEBUG_BEGIN
03391 #endif
03392         /* Do some basic checks. */
03393         if (mline == NULL)
03394         {
03395                 fprintf (stderr,
03396                   (_("Error in %s () a NULL pointer was passed.\n")),
03397                   __FUNCTION__);
03398                 return (NULL);
03399         }
03400         if (mline->p2 == NULL)
03401         {
03402                 fprintf (stderr,
03403                   (_("Error in %s () a NULL pointer was found.\n")),
03404                   __FUNCTION__);
03405                 return (NULL);
03406         }
03407         mline->p2->x0 = x2;
03408 #if DEBUG
03409         DXF_DEBUG_END
03410 #endif
03411         return (mline);
03412 }
03413 
03414 
03422 double
03423 dxf_mline_get_y2
03424 (
03425         DxfMline *mline
03427 )
03428 {
03429 #ifdef DEBUG
03430         DXF_DEBUG_BEGIN
03431 #endif
03432 
03433         /* Do some basic checks. */
03434         if (mline == NULL)
03435         {
03436                 fprintf (stderr,
03437                   (_("Error in %s () a NULL pointer was passed.\n")),
03438                   __FUNCTION__);
03439                 return (EXIT_FAILURE);
03440         }
03441         if (mline->p2 == NULL)
03442         {
03443                 fprintf (stderr,
03444                   (_("Error in %s () a NULL pointer was found.\n")),
03445                   __FUNCTION__);
03446                 return (EXIT_FAILURE);
03447         }
03448 #if DEBUG
03449         DXF_DEBUG_END
03450 #endif
03451         return (mline->p2->y0);
03452 }
03453 
03454 
03462 DxfMline *
03463 dxf_mline_set_y2
03464 (
03465         DxfMline *mline,
03467         double y2
03471 )
03472 {
03473 #ifdef DEBUG
03474         DXF_DEBUG_BEGIN
03475 #endif
03476         /* Do some basic checks. */
03477         if (mline == NULL)
03478         {
03479                 fprintf (stderr,
03480                   (_("Error in %s () a NULL pointer was passed.\n")),
03481                   __FUNCTION__);
03482                 return (NULL);
03483         }
03484         if (mline->p2 == NULL)
03485         {
03486                 fprintf (stderr,
03487                   (_("Error in %s () a NULL pointer was found.\n")),
03488                   __FUNCTION__);
03489                 return (NULL);
03490         }
03491         mline->p2->y0 = y2;
03492 #if DEBUG
03493         DXF_DEBUG_END
03494 #endif
03495         return (mline);
03496 }
03497 
03498 
03506 double
03507 dxf_mline_get_z2
03508 (
03509         DxfMline *mline
03511 )
03512 {
03513 #ifdef DEBUG
03514         DXF_DEBUG_BEGIN
03515 #endif
03516 
03517         /* Do some basic checks. */
03518         if (mline == NULL)
03519         {
03520                 fprintf (stderr,
03521                   (_("Error in %s () a NULL pointer was passed.\n")),
03522                   __FUNCTION__);
03523                 return (EXIT_FAILURE);
03524         }
03525         if (mline->p2 == NULL)
03526         {
03527                 fprintf (stderr,
03528                   (_("Error in %s () a NULL pointer was found.\n")),
03529                   __FUNCTION__);
03530                 return (EXIT_FAILURE);
03531         }
03532 #if DEBUG
03533         DXF_DEBUG_END
03534 #endif
03535         return (mline->p2->z0);
03536 }
03537 
03538 
03546 DxfMline *
03547 dxf_mline_set_z2
03548 (
03549         DxfMline *mline,
03551         double z2
03555 )
03556 {
03557 #ifdef DEBUG
03558         DXF_DEBUG_BEGIN
03559 #endif
03560         /* Do some basic checks. */
03561         if (mline == NULL)
03562         {
03563                 fprintf (stderr,
03564                   (_("Error in %s () a NULL pointer was passed.\n")),
03565                   __FUNCTION__);
03566                 return (NULL);
03567         }
03568         if (mline->p2 == NULL)
03569         {
03570                 fprintf (stderr,
03571                   (_("Error in %s () a NULL pointer was found.\n")),
03572                   __FUNCTION__);
03573                 return (NULL);
03574         }
03575         mline->p2->z0 = z2;
03576 #if DEBUG
03577         DXF_DEBUG_END
03578 #endif
03579         return (mline);
03580 }
03581 
03582 
03589 DxfPoint *
03590 dxf_mline_get_p3
03591 (
03592         DxfMline *mline
03594 )
03595 {
03596 #ifdef DEBUG
03597         DXF_DEBUG_BEGIN
03598 #endif
03599         /* Do some basic checks. */
03600         if (mline == NULL)
03601         {
03602                 fprintf (stderr,
03603                   (_("Error in %s () a NULL pointer was passed.\n")),
03604                   __FUNCTION__);
03605                 return (NULL);
03606         }
03607         if (mline->p3 == NULL)
03608         {
03609                 fprintf (stderr,
03610                   (_("Error in %s () a NULL pointer was found.\n")),
03611                   __FUNCTION__);
03612                 return (NULL);
03613         }
03614 #if DEBUG
03615         DXF_DEBUG_END
03616 #endif
03617         return (mline->p3);
03618 }
03619 
03620 
03627 DxfMline *
03628 dxf_mline_set_p3
03629 (
03630         DxfMline *mline,
03632         DxfPoint *p3
03634 )
03635 {
03636 #ifdef DEBUG
03637         DXF_DEBUG_BEGIN
03638 #endif
03639         /* Do some basic checks. */
03640         if (mline == NULL)
03641         {
03642                 fprintf (stderr,
03643                   (_("Error in %s () a NULL pointer was passed.\n")),
03644                   __FUNCTION__);
03645                 return (NULL);
03646         }
03647         if (p3 == NULL)
03648         {
03649                 fprintf (stderr,
03650                   (_("Error in %s () a NULL pointer was passed.\n")),
03651                   __FUNCTION__);
03652                 return (NULL);
03653         }
03654         mline->p3 = p3;
03655 #if DEBUG
03656         DXF_DEBUG_END
03657 #endif
03658         return (mline);
03659 }
03660 
03661 
03670 double
03671 dxf_mline_get_x3
03672 (
03673         DxfMline *mline
03675 )
03676 {
03677 #ifdef DEBUG
03678         DXF_DEBUG_BEGIN
03679 #endif
03680 
03681         /* Do some basic checks. */
03682         if (mline == NULL)
03683         {
03684                 fprintf (stderr,
03685                   (_("Error in %s () a NULL pointer was passed.\n")),
03686                   __FUNCTION__);
03687                 return (EXIT_FAILURE);
03688         }
03689         if (mline->p3 == NULL)
03690         {
03691                 fprintf (stderr,
03692                   (_("Error in %s () a NULL pointer was found.\n")),
03693                   __FUNCTION__);
03694                 return (EXIT_FAILURE);
03695         }
03696 #if DEBUG
03697         DXF_DEBUG_END
03698 #endif
03699         return (mline->p3->x0);
03700 }
03701 
03702 
03711 DxfMline *
03712 dxf_mline_set_x3
03713 (
03714         DxfMline *mline,
03716         double x3
03720 )
03721 {
03722 #ifdef DEBUG
03723         DXF_DEBUG_BEGIN
03724 #endif
03725         /* Do some basic checks. */
03726         if (mline == NULL)
03727         {
03728                 fprintf (stderr,
03729                   (_("Error in %s () a NULL pointer was passed.\n")),
03730                   __FUNCTION__);
03731                 return (NULL);
03732         }
03733         if (mline->p3 == NULL)
03734         {
03735                 fprintf (stderr,
03736                   (_("Error in %s () a NULL pointer was found.\n")),
03737                   __FUNCTION__);
03738                 return (NULL);
03739         }
03740         mline->p3->x0 = x3;
03741 #if DEBUG
03742         DXF_DEBUG_END
03743 #endif
03744         return (mline);
03745 }
03746 
03747 
03756 double
03757 dxf_mline_get_y3
03758 (
03759         DxfMline *mline
03761 )
03762 {
03763 #ifdef DEBUG
03764         DXF_DEBUG_BEGIN
03765 #endif
03766 
03767         /* Do some basic checks. */
03768         if (mline == NULL)
03769         {
03770                 fprintf (stderr,
03771                   (_("Error in %s () a NULL pointer was passed.\n")),
03772                   __FUNCTION__);
03773                 return (EXIT_FAILURE);
03774         }
03775         if (mline->p3 == NULL)
03776         {
03777                 fprintf (stderr,
03778                   (_("Error in %s () a NULL pointer was found.\n")),
03779                   __FUNCTION__);
03780                 return (EXIT_FAILURE);
03781         }
03782 #if DEBUG
03783         DXF_DEBUG_END
03784 #endif
03785         return (mline->p3->y0);
03786 }
03787 
03788 
03797 DxfMline *
03798 dxf_mline_set_y3
03799 (
03800         DxfMline *mline,
03802         double y3
03806 )
03807 {
03808 #ifdef DEBUG
03809         DXF_DEBUG_BEGIN
03810 #endif
03811         /* Do some basic checks. */
03812         if (mline == NULL)
03813         {
03814                 fprintf (stderr,
03815                   (_("Error in %s () a NULL pointer was passed.\n")),
03816                   __FUNCTION__);
03817                 return (NULL);
03818         }
03819         if (mline->p3 == NULL)
03820         {
03821                 fprintf (stderr,
03822                   (_("Error in %s () a NULL pointer was found.\n")),
03823                   __FUNCTION__);
03824                 return (NULL);
03825         }
03826         mline->p3->y0 = y3;
03827 #if DEBUG
03828         DXF_DEBUG_END
03829 #endif
03830         return (mline);
03831 }
03832 
03833 
03842 double
03843 dxf_mline_get_z3
03844 (
03845         DxfMline *mline
03847 )
03848 {
03849 #ifdef DEBUG
03850         DXF_DEBUG_BEGIN
03851 #endif
03852 
03853         /* Do some basic checks. */
03854         if (mline == NULL)
03855         {
03856                 fprintf (stderr,
03857                   (_("Error in %s () a NULL pointer was passed.\n")),
03858                   __FUNCTION__);
03859                 return (EXIT_FAILURE);
03860         }
03861         if (mline->p3 == NULL)
03862         {
03863                 fprintf (stderr,
03864                   (_("Error in %s () a NULL pointer was found.\n")),
03865                   __FUNCTION__);
03866                 return (EXIT_FAILURE);
03867         }
03868 #if DEBUG
03869         DXF_DEBUG_END
03870 #endif
03871         return (mline->p3->z0);
03872 }
03873 
03874 
03883 DxfMline *
03884 dxf_mline_set_z3
03885 (
03886         DxfMline *mline,
03888         double z3
03892 )
03893 {
03894 #ifdef DEBUG
03895         DXF_DEBUG_BEGIN
03896 #endif
03897         /* Do some basic checks. */
03898         if (mline == NULL)
03899         {
03900                 fprintf (stderr,
03901                   (_("Error in %s () a NULL pointer was passed.\n")),
03902                   __FUNCTION__);
03903                 return (NULL);
03904         }
03905         if (mline->p3 == NULL)
03906         {
03907                 fprintf (stderr,
03908                   (_("Error in %s () a NULL pointer was found.\n")),
03909                   __FUNCTION__);
03910                 return (NULL);
03911         }
03912         mline->p3->z0 = z3;
03913 #if DEBUG
03914         DXF_DEBUG_END
03915 #endif
03916         return (mline);
03917 }
03918 
03919 
03925 double
03926 dxf_mline_get_scale_factor
03927 (
03928         DxfMline *mline
03930 )
03931 {
03932 #ifdef DEBUG
03933         DXF_DEBUG_BEGIN
03934 #endif
03935 
03936         /* Do some basic checks. */
03937         if (mline == NULL)
03938         {
03939                 fprintf (stderr,
03940                   (_("Error in %s () a NULL pointer was passed.\n")),
03941                   __FUNCTION__);
03942                 return (EXIT_FAILURE);
03943         }
03944         if (mline->element_parameters == NULL)
03945         {
03946                 fprintf (stderr,
03947                   (_("Error in %s () a NULL pointer was found.\n")),
03948                   __FUNCTION__);
03949                 return (EXIT_FAILURE);
03950         }
03951 #if DEBUG
03952         DXF_DEBUG_END
03953 #endif
03954         return (mline->scale_factor);
03955 }
03956 
03957 
03964 DxfMline *
03965 dxf_mline_set_scale_factor
03966 (
03967         DxfMline *mline,
03969         double scale_factor
03971 )
03972 {
03973 #ifdef DEBUG
03974         DXF_DEBUG_BEGIN
03975 #endif
03976         /* Do some basic checks. */
03977         if (mline == NULL)
03978         {
03979                 fprintf (stderr,
03980                   (_("Error in %s () a NULL pointer was passed.\n")),
03981                   __FUNCTION__);
03982                 return (NULL);
03983         }
03984         mline->scale_factor = scale_factor;
03985 #if DEBUG
03986         DXF_DEBUG_END
03987 #endif
03988         return (mline);
03989 }
03990 
03991 
03997 double
03998 dxf_mline_get_element_parameters
03999 (
04000         DxfMline *mline
04002 )
04003 {
04004 #ifdef DEBUG
04005         DXF_DEBUG_BEGIN
04006 #endif
04007 
04008         /* Do some basic checks. */
04009         if (mline == NULL)
04010         {
04011                 fprintf (stderr,
04012                   (_("Error in %s () a NULL pointer was passed.\n")),
04013                   __FUNCTION__);
04014                 return (EXIT_FAILURE);
04015         }
04016         if (mline->element_parameters == NULL)
04017         {
04018                 fprintf (stderr,
04019                   (_("Error in %s () a NULL pointer was found.\n")),
04020                   __FUNCTION__);
04021                 return (EXIT_FAILURE);
04022         }
04023 #if DEBUG
04024         DXF_DEBUG_END
04025 #endif
04026         return (*(mline->element_parameters));
04027 }
04028 
04029 
04037 DxfMline *
04038 dxf_mline_set_element_parameters
04039 (
04040         DxfMline *mline,
04042         double *element_parameters
04045 )
04046 {
04047 #ifdef DEBUG
04048         DXF_DEBUG_BEGIN
04049 #endif
04050         /* Do some basic checks. */
04051         if (mline == NULL)
04052         {
04053                 fprintf (stderr,
04054                   (_("Error in %s () a NULL pointer was passed.\n")),
04055                   __FUNCTION__);
04056                 return (NULL);
04057         }
04058         if (element_parameters == NULL)
04059         {
04060                 fprintf (stderr,
04061                   (_("Error in %s () a NULL pointer was passed.\n")),
04062                   __FUNCTION__);
04063                 return (NULL);
04064         }
04065         *(mline->element_parameters) = *element_parameters;
04066 #if DEBUG
04067         DXF_DEBUG_END
04068 #endif
04069         return (mline);
04070 }
04071 
04072 
04078 double
04079 dxf_mline_get_area_fill_parameters
04080 (
04081         DxfMline *mline
04083 )
04084 {
04085 #ifdef DEBUG
04086         DXF_DEBUG_BEGIN
04087 #endif
04088 
04089         /* Do some basic checks. */
04090         if (mline == NULL)
04091         {
04092                 fprintf (stderr,
04093                   (_("Error in %s () a NULL pointer was passed.\n")),
04094                   __FUNCTION__);
04095                 return (EXIT_FAILURE);
04096         }
04097 #if DEBUG
04098         DXF_DEBUG_END
04099 #endif
04100         return (*(mline->area_fill_parameters));
04101 }
04102 
04103 
04111 DxfMline *
04112 dxf_mline_set_area_fill_parameters
04113 (
04114         DxfMline *mline,
04116         double *area_fill_parameters
04119 )
04120 {
04121 #ifdef DEBUG
04122         DXF_DEBUG_BEGIN
04123 #endif
04124         /* Do some basic checks. */
04125         if (mline == NULL)
04126         {
04127                 fprintf (stderr,
04128                   (_("Error in %s () a NULL pointer was passed.\n")),
04129                   __FUNCTION__);
04130                 return (NULL);
04131         }
04132         if (area_fill_parameters == NULL)
04133         {
04134                 fprintf (stderr,
04135                   (_("Error in %s () a NULL pointer was passed.\n")),
04136                   __FUNCTION__);
04137                 return (NULL);
04138         }
04139         *(mline->area_fill_parameters) = *area_fill_parameters;
04140 #if DEBUG
04141         DXF_DEBUG_END
04142 #endif
04143         return (mline);
04144 }
04145 
04146 
04152 int
04153 dxf_mline_get_justification
04154 (
04155         DxfMline *mline
04157 )
04158 {
04159 #if DEBUG
04160         DXF_DEBUG_BEGIN
04161 #endif
04162         /* Do some basic checks. */
04163         if (mline == NULL)
04164         {
04165                 fprintf (stderr,
04166                   (_("Error in %s () a NULL pointer was passed.\n")),
04167                   __FUNCTION__);
04168                 return (EXIT_FAILURE);
04169         }
04170         if (mline->justification < 0)
04171         {
04172                 fprintf (stderr,
04173                   (_("Error in %s () a negative value was found.\n")),
04174                   __FUNCTION__);
04175                 return (EXIT_FAILURE);
04176         }
04177         if (mline->justification > 2)
04178         {
04179                 fprintf (stderr,
04180                   (_("Error in %s () an out of range value was found.\n")),
04181                   __FUNCTION__);
04182                 return (EXIT_FAILURE);
04183         }
04184 #if DEBUG
04185         DXF_DEBUG_END
04186 #endif
04187         return (mline->justification);
04188 }
04189 
04190 
04194 DxfMline *
04195 dxf_mline_set_justification
04196 (
04197         DxfMline *mline,
04199         int justification
04201 )
04202 {
04203 #if DEBUG
04204         DXF_DEBUG_BEGIN
04205 #endif
04206         /* Do some basic checks. */
04207         if (mline == NULL)
04208         {
04209                 fprintf (stderr,
04210                   (_("Error in %s () a NULL pointer was passed.\n")),
04211                   __FUNCTION__);
04212                 return (NULL);
04213         }
04214         if (justification < 0)
04215         {
04216                 fprintf (stderr,
04217                   (_("Error in %s () a negative value was passed.\n")),
04218                   __FUNCTION__);
04219                 return (NULL);
04220         }
04221         if (justification > 2)
04222         {
04223                 fprintf (stderr,
04224                   (_("Error in %s () an out of range value was passed.\n")),
04225                   __FUNCTION__);
04226                 return (NULL);
04227         }
04228         mline->justification = justification;
04229 #if DEBUG
04230         DXF_DEBUG_END
04231 #endif
04232         return (mline);
04233 }
04234 
04235 
04241 int
04242 dxf_mline_get_flags
04243 (
04244         DxfMline *mline
04246 )
04247 {
04248 #if DEBUG
04249         DXF_DEBUG_BEGIN
04250 #endif
04251         /* Do some basic checks. */
04252         if (mline == NULL)
04253         {
04254                 fprintf (stderr,
04255                   (_("Error in %s () a NULL pointer was passed.\n")),
04256                   __FUNCTION__);
04257                 return (EXIT_FAILURE);
04258         }
04259         if (mline->flags < 0)
04260         {
04261                 fprintf (stderr,
04262                   (_("Error in %s () a negative value was found.\n")),
04263                   __FUNCTION__);
04264                 return (EXIT_FAILURE);
04265         }
04266         if (mline->flags > 0x00001111)
04267         {
04268                 fprintf (stderr,
04269                   (_("Error in %s () an out of range value was found.\n")),
04270                   __FUNCTION__);
04271                 return (EXIT_FAILURE);
04272         }
04273 #if DEBUG
04274         DXF_DEBUG_END
04275 #endif
04276         return (mline->flags);
04277 }
04278 
04279 
04283 DxfMline *
04284 dxf_mline_set_flags
04285 (
04286         DxfMline *mline,
04288         int flags
04290 )
04291 {
04292 #if DEBUG
04293         DXF_DEBUG_BEGIN
04294 #endif
04295         /* Do some basic checks. */
04296         if (mline == NULL)
04297         {
04298                 fprintf (stderr,
04299                   (_("Error in %s () a NULL pointer was passed.\n")),
04300                   __FUNCTION__);
04301                 return (NULL);
04302         }
04303         if (flags < 0)
04304         {
04305                 fprintf (stderr,
04306                   (_("Error in %s () a negative value was passed.\n")),
04307                   __FUNCTION__);
04308                 return (NULL);
04309         }
04310         if (flags > 0x00001111)
04311         {
04312                 fprintf (stderr,
04313                   (_("Error in %s () an out of range value was passed.\n")),
04314                   __FUNCTION__);
04315                 return (NULL);
04316         }
04317         mline->flags = flags;
04318 #if DEBUG
04319         DXF_DEBUG_END
04320 #endif
04321         return (mline);
04322 }
04323 
04324 
04330 int
04331 dxf_mline_get_number_of_vertices
04332 (
04333         DxfMline *mline
04335 )
04336 {
04337 #if DEBUG
04338         DXF_DEBUG_BEGIN
04339 #endif
04340         /* Do some basic checks. */
04341         if (mline == NULL)
04342         {
04343                 fprintf (stderr,
04344                   (_("Error in %s () a NULL pointer was passed.\n")),
04345                   __FUNCTION__);
04346                 return (EXIT_FAILURE);
04347         }
04348         if (mline->number_of_vertices < 0)
04349         {
04350                 fprintf (stderr,
04351                   (_("Error in %s () a negative value was found.\n")),
04352                   __FUNCTION__);
04353                 return (EXIT_FAILURE);
04354         }
04355 #if DEBUG
04356         DXF_DEBUG_END
04357 #endif
04358         return (mline->number_of_vertices);
04359 }
04360 
04361 
04365 DxfMline *
04366 dxf_mline_set_number_of_vertices
04367 (
04368         DxfMline *mline,
04370         int number_of_vertices
04372 )
04373 {
04374 #if DEBUG
04375         DXF_DEBUG_BEGIN
04376 #endif
04377         /* Do some basic checks. */
04378         if (mline == NULL)
04379         {
04380                 fprintf (stderr,
04381                   (_("Error in %s () a NULL pointer was passed.\n")),
04382                   __FUNCTION__);
04383                 return (NULL);
04384         }
04385         if (number_of_vertices < 0)
04386         {
04387                 fprintf (stderr,
04388                   (_("Error in %s () a negative value was passed.\n")),
04389                   __FUNCTION__);
04390                 return (NULL);
04391         }
04392         mline->number_of_vertices = number_of_vertices;
04393 #if DEBUG
04394         DXF_DEBUG_END
04395 #endif
04396         return (mline);
04397 }
04398 
04399 
04405 int
04406 dxf_mline_get_number_of_elements
04407 (
04408         DxfMline *mline
04410 )
04411 {
04412 #if DEBUG
04413         DXF_DEBUG_BEGIN
04414 #endif
04415         /* Do some basic checks. */
04416         if (mline == NULL)
04417         {
04418                 fprintf (stderr,
04419                   (_("Error in %s () a NULL pointer was passed.\n")),
04420                   __FUNCTION__);
04421                 return (EXIT_FAILURE);
04422         }
04423         if (mline->number_of_elements < 0)
04424         {
04425                 fprintf (stderr,
04426                   (_("Error in %s () a negative value was found.\n")),
04427                   __FUNCTION__);
04428                 return (EXIT_FAILURE);
04429         }
04430 #if DEBUG
04431         DXF_DEBUG_END
04432 #endif
04433         return (mline->number_of_elements);
04434 }
04435 
04436 
04440 DxfMline *
04441 dxf_mline_set_number_of_elements
04442 (
04443         DxfMline *mline,
04445         int number_of_elements
04447 )
04448 {
04449 #if DEBUG
04450         DXF_DEBUG_BEGIN
04451 #endif
04452         /* Do some basic checks. */
04453         if (mline == NULL)
04454         {
04455                 fprintf (stderr,
04456                   (_("Error in %s () a NULL pointer was passed.\n")),
04457                   __FUNCTION__);
04458                 return (NULL);
04459         }
04460         if (number_of_elements < 0)
04461         {
04462                 fprintf (stderr,
04463                   (_("Error in %s () a negative value was passed.\n")),
04464                   __FUNCTION__);
04465                 return (NULL);
04466         }
04467         mline->number_of_elements = number_of_elements;
04468 #if DEBUG
04469         DXF_DEBUG_END
04470 #endif
04471         return (mline);
04472 }
04473 
04474 
04480 int
04481 dxf_mline_get_number_of_parameters
04482 (
04483         DxfMline *mline
04485 )
04486 {
04487 #if DEBUG
04488         DXF_DEBUG_BEGIN
04489 #endif
04490         /* Do some basic checks. */
04491         if (mline == NULL)
04492         {
04493                 fprintf (stderr,
04494                   (_("Error in %s () a NULL pointer was passed.\n")),
04495                   __FUNCTION__);
04496                 return (EXIT_FAILURE);
04497         }
04498         if (mline->number_of_parameters < 0)
04499         {
04500                 fprintf (stderr,
04501                   (_("Error in %s () a negative value was found.\n")),
04502                   __FUNCTION__);
04503                 return (EXIT_FAILURE);
04504         }
04505 #if DEBUG
04506         DXF_DEBUG_END
04507 #endif
04508         return (mline->number_of_parameters);
04509 }
04510 
04511 
04515 DxfMline *
04516 dxf_mline_set_number_of_parameters
04517 (
04518         DxfMline *mline,
04520         int number_of_parameters
04522 )
04523 {
04524 #if DEBUG
04525         DXF_DEBUG_BEGIN
04526 #endif
04527         /* Do some basic checks. */
04528         if (mline == NULL)
04529         {
04530                 fprintf (stderr,
04531                   (_("Error in %s () a NULL pointer was passed.\n")),
04532                   __FUNCTION__);
04533                 return (NULL);
04534         }
04535         if (number_of_parameters < 0)
04536         {
04537                 fprintf (stderr,
04538                   (_("Error in %s () a negative value was passed.\n")),
04539                   __FUNCTION__);
04540                 return (NULL);
04541         }
04542         mline->number_of_parameters = number_of_parameters;
04543 #if DEBUG
04544         DXF_DEBUG_END
04545 #endif
04546         return (mline);
04547 }
04548 
04549 
04556 int
04557 dxf_mline_get_number_of_area_fill_parameters
04558 (
04559         DxfMline *mline
04561 )
04562 {
04563 #if DEBUG
04564         DXF_DEBUG_BEGIN
04565 #endif
04566         /* Do some basic checks. */
04567         if (mline == NULL)
04568         {
04569                 fprintf (stderr,
04570                   (_("Error in %s () a NULL pointer was passed.\n")),
04571                   __FUNCTION__);
04572                 return (EXIT_FAILURE);
04573         }
04574         if (mline->number_of_area_fill_parameters < 0)
04575         {
04576                 fprintf (stderr,
04577                   (_("Error in %s () a negative value was found.\n")),
04578                   __FUNCTION__);
04579                 return (EXIT_FAILURE);
04580         }
04581 #if DEBUG
04582         DXF_DEBUG_END
04583 #endif
04584         return (mline->number_of_area_fill_parameters);
04585 }
04586 
04587 
04592 DxfMline *
04593 dxf_mline_set_number_of_area_fill_parameters
04594 (
04595         DxfMline *mline,
04597         int number_of_area_fill_parameters
04600 )
04601 {
04602 #if DEBUG
04603         DXF_DEBUG_BEGIN
04604 #endif
04605         /* Do some basic checks. */
04606         if (mline == NULL)
04607         {
04608                 fprintf (stderr,
04609                   (_("Error in %s () a NULL pointer was passed.\n")),
04610                   __FUNCTION__);
04611                 return (NULL);
04612         }
04613         if (number_of_area_fill_parameters < 0)
04614         {
04615                 fprintf (stderr,
04616                   (_("Error in %s () a negative value was passed.\n")),
04617                   __FUNCTION__);
04618                 return (NULL);
04619         }
04620         mline->number_of_area_fill_parameters = number_of_area_fill_parameters;
04621 #if DEBUG
04622         DXF_DEBUG_END
04623 #endif
04624         return (mline);
04625 }
04626 
04627 
04636 DxfPoint *
04637 dxf_mline_get_extrusion_vector_as_point
04638 (
04639         DxfMline *mline
04641 )
04642 {
04643 #ifdef DEBUG
04644         DXF_DEBUG_BEGIN
04645 #endif
04646         DxfPoint *point = NULL;
04647 
04648         /* Do some basic checks. */
04649         if (mline == NULL)
04650         {
04651                 fprintf (stderr,
04652                   (_("Error in %s () a NULL pointer was passed.\n")),
04653                   __FUNCTION__);
04654                 return (NULL);
04655         }
04656         point = dxf_point_init (point);
04657         if (point == NULL)
04658         {
04659               fprintf (stderr,
04660                   (_("Error in %s () could not allocate memory.\n")),
04661                 __FUNCTION__);
04662               return (NULL);
04663         }
04664         point->x0 = mline->extr_x0;
04665         point->y0 = mline->extr_y0;
04666         point->z0 = mline->extr_z0;
04667 #if DEBUG
04668         DXF_DEBUG_END
04669 #endif
04670         return (point);
04671 }
04672 
04673 
04680 double
04681 dxf_mline_get_extr_x0
04682 (
04683         DxfMline *mline
04685 )
04686 {
04687 #ifdef DEBUG
04688         DXF_DEBUG_BEGIN
04689 #endif
04690 
04691         /* Do some basic checks. */
04692         if (mline == NULL)
04693         {
04694                 fprintf (stderr,
04695                   (_("Error in %s () a NULL pointer was passed.\n")),
04696                   __FUNCTION__);
04697                 return (EXIT_FAILURE);
04698         }
04699 #if DEBUG
04700         DXF_DEBUG_END
04701 #endif
04702         return (mline->extr_x0);
04703 }
04704 
04705 
04713 DxfMline *
04714 dxf_mline_set_extr_x0
04715 (
04716         DxfMline *mline,
04718         double extr_x0
04721 )
04722 {
04723 #ifdef DEBUG
04724         DXF_DEBUG_BEGIN
04725 #endif
04726         /* Do some basic checks. */
04727         if (mline == NULL)
04728         {
04729                 fprintf (stderr,
04730                   (_("Error in %s () a NULL pointer was passed.\n")),
04731                   __FUNCTION__);
04732                 return (NULL);
04733         }
04734         mline->extr_x0 = extr_x0;
04735 #if DEBUG
04736         DXF_DEBUG_END
04737 #endif
04738         return (mline);
04739 }
04740 
04741 
04748 double
04749 dxf_mline_get_extr_y0
04750 (
04751         DxfMline *mline
04753 )
04754 {
04755 #ifdef DEBUG
04756         DXF_DEBUG_BEGIN
04757 #endif
04758 
04759         /* Do some basic checks. */
04760         if (mline == NULL)
04761         {
04762                 fprintf (stderr,
04763                   (_("Error in %s () a NULL pointer was passed.\n")),
04764                   __FUNCTION__);
04765                 return (EXIT_FAILURE);
04766         }
04767 #if DEBUG
04768         DXF_DEBUG_END
04769 #endif
04770         return (mline->extr_y0);
04771 }
04772 
04773 
04781 DxfMline *
04782 dxf_mline_set_extr_y0
04783 (
04784         DxfMline *mline,
04786         double extr_y0
04789 )
04790 {
04791 #ifdef DEBUG
04792         DXF_DEBUG_BEGIN
04793 #endif
04794         /* Do some basic checks. */
04795         if (mline == NULL)
04796         {
04797                 fprintf (stderr,
04798                   (_("Error in %s () a NULL pointer was passed.\n")),
04799                   __FUNCTION__);
04800                 return (NULL);
04801         }
04802         mline->extr_y0 = extr_y0;
04803 #if DEBUG
04804         DXF_DEBUG_END
04805 #endif
04806         return (mline);
04807 }
04808 
04809 
04816 double
04817 dxf_mline_get_extr_z0
04818 (
04819         DxfMline *mline
04821 )
04822 {
04823 #ifdef DEBUG
04824         DXF_DEBUG_BEGIN
04825 #endif
04826 
04827         /* Do some basic checks. */
04828         if (mline == NULL)
04829         {
04830                 fprintf (stderr,
04831                   (_("Error in %s () a NULL pointer was passed.\n")),
04832                   __FUNCTION__);
04833                 return (EXIT_FAILURE);
04834         }
04835 #if DEBUG
04836         DXF_DEBUG_END
04837 #endif
04838         return (mline->extr_z0);
04839 }
04840 
04841 
04849 DxfMline *
04850 dxf_mline_set_extr_z0
04851 (
04852         DxfMline *mline,
04854         double extr_z0
04857 )
04858 {
04859 #ifdef DEBUG
04860         DXF_DEBUG_BEGIN
04861 #endif
04862         /* Do some basic checks. */
04863         if (mline == NULL)
04864         {
04865                 fprintf (stderr,
04866                   (_("Error in %s () a NULL pointer was passed.\n")),
04867                   __FUNCTION__);
04868                 return (NULL);
04869         }
04870         mline->extr_z0 = extr_z0;
04871 #if DEBUG
04872         DXF_DEBUG_END
04873 #endif
04874         return (mline);
04875 }
04876 
04877 
04882 DxfMline *
04883 dxf_mline_set_extrusion_vector_from_point
04884 (
04885         DxfMline *mline,
04887         DxfPoint *point
04889 )
04890 {
04891 #if DEBUG
04892         DXF_DEBUG_BEGIN
04893 #endif
04894         /* Do some basic checks. */
04895         if (mline == NULL)
04896         {
04897                 fprintf (stderr,
04898                   (_("Error in %s () a NULL pointer was passed.\n")),
04899                   __FUNCTION__);
04900                 return (NULL);
04901         }
04902         if (point == NULL)
04903         {
04904                 fprintf (stderr,
04905                   (_("Error in %s () a NULL pointer was passed.\n")),
04906                   __FUNCTION__);
04907                 return (NULL);
04908         }
04909         mline->extr_x0 = (double) point->x0;
04910         mline->extr_y0 = (double) point->y0;
04911         mline->extr_z0 = (double) point->z0;
04912 #if DEBUG
04913         DXF_DEBUG_END
04914 #endif
04915         return (mline);
04916 }
04917 
04918 
04922 DxfMline *
04923 dxf_mline_set_extrusion_vector
04924 (
04925         DxfMline *mline,
04927         double extr_x0,
04929         double extr_y0,
04931         double extr_z0
04933 )
04934 {
04935 #if DEBUG
04936         DXF_DEBUG_BEGIN
04937 #endif
04938         /* Do some basic checks. */
04939         if (mline == NULL)
04940         {
04941                 fprintf (stderr,
04942                   (_("Error in %s () a NULL pointer was passed.\n")),
04943                   __FUNCTION__);
04944                 return (NULL);
04945         }
04946         mline->extr_x0 = extr_x0;
04947         mline->extr_y0 = extr_y0;
04948         mline->extr_z0 = extr_z0;
04949 #if DEBUG
04950         DXF_DEBUG_END
04951 #endif
04952         return (mline);
04953 }
04954 
04955 
04962 char *
04963 dxf_mline_get_mlinestyle_dictionary
04964 (
04965         DxfMline *mline
04967 )
04968 {
04969 #if DEBUG
04970         DXF_DEBUG_BEGIN
04971 #endif
04972         /* Do some basic checks. */
04973         if (mline == NULL)
04974         {
04975                 fprintf (stderr,
04976                   (_("Error in %s () a NULL pointer was passed.\n")),
04977                   __FUNCTION__);
04978                 return (NULL);
04979         }
04980         if (mline->mlinestyle_dictionary ==  NULL)
04981         {
04982                 fprintf (stderr,
04983                   (_("Error in %s () a NULL pointer was found.\n")),
04984                   __FUNCTION__);
04985                 return (NULL);
04986         }
04987 #if DEBUG
04988         DXF_DEBUG_END
04989 #endif
04990         return (strdup (mline->mlinestyle_dictionary));
04991 }
04992 
04993 
05000 DxfMline *
05001 dxf_mline_set_mlinestyle_dictionary
05002 (
05003         DxfMline *mline,
05005         char *mlinestyle_dictionary
05008 )
05009 {
05010 #if DEBUG
05011         DXF_DEBUG_BEGIN
05012 #endif
05013         /* Do some basic checks. */
05014         if (mline == NULL)
05015         {
05016                 fprintf (stderr,
05017                   (_("Error in %s () a NULL pointer was passed.\n")),
05018                   __FUNCTION__);
05019                 return (NULL);
05020         }
05021         if (mlinestyle_dictionary == NULL)
05022         {
05023                 fprintf (stderr,
05024                   (_("Error in %s () a NULL pointer was passed.\n")),
05025                   __FUNCTION__);
05026                 return (NULL);
05027         }
05028         mline->mlinestyle_dictionary = strdup (mlinestyle_dictionary);
05029 #if DEBUG
05030         DXF_DEBUG_END
05031 #endif
05032         return (mline);
05033 }
05034 
05035 
05044 DxfMline *
05045 dxf_mline_get_next
05046 (
05047         DxfMline *mline
05049 )
05050 {
05051 #if DEBUG
05052         DXF_DEBUG_BEGIN
05053 #endif
05054         /* Do some basic checks. */
05055         if (mline == NULL)
05056         {
05057                 fprintf (stderr,
05058                   (_("Error in %s () a NULL pointer was passed.\n")),
05059                   __FUNCTION__);
05060                 return (NULL);
05061         }
05062         if (mline->next == NULL)
05063         {
05064                 fprintf (stderr,
05065                   (_("Error in %s () a NULL pointer was found.\n")),
05066                   __FUNCTION__);
05067                 return (NULL);
05068         }
05069 #if DEBUG
05070         DXF_DEBUG_END
05071 #endif
05072         return ((DxfMline *) mline->next);
05073 }
05074 
05075 
05080 DxfMline *
05081 dxf_mline_set_next
05082 (
05083         DxfMline *mline,
05085         DxfMline *next
05087 )
05088 {
05089 #if DEBUG
05090         DXF_DEBUG_BEGIN
05091 #endif
05092         /* Do some basic checks. */
05093         if (mline == NULL)
05094         {
05095                 fprintf (stderr,
05096                   (_("Error in %s () a NULL pointer was passed.\n")),
05097                   __FUNCTION__);
05098                 return (NULL);
05099         }
05100         if (next == NULL)
05101         {
05102                 fprintf (stderr,
05103                   (_("Error in %s () a NULL pointer was passed.\n")),
05104                   __FUNCTION__);
05105                 return (NULL);
05106         }
05107         mline->next = (struct DxfMline *) next;
05108 #if DEBUG
05109         DXF_DEBUG_END
05110 #endif
05111         return (mline);
05112 }
05113 
05114 
05123 DxfMline *
05124 dxf_mline_get_last
05125 (
05126         DxfMline *mline
05128 )
05129 {
05130 #if DEBUG
05131         DXF_DEBUG_BEGIN
05132 #endif
05133         /* Do some basic checks. */
05134         if (mline == NULL)
05135         {
05136                 fprintf (stderr,
05137                   (_("Error in %s () a NULL pointer was passed.\n")),
05138                   __FUNCTION__);
05139                 return (NULL);
05140         }
05141         if (mline->next == NULL)
05142         {
05143                 fprintf (stderr,
05144                   (_("Warning in %s () a NULL pointer was found.\n")),
05145                   __FUNCTION__);
05146                 return ((DxfMline *) mline);
05147         }
05148         DxfMline *iter = (DxfMline *) mline->next;
05149         while (iter->next != NULL)
05150         {
05151                 iter = (DxfMline *) iter->next;
05152         }
05153 #if DEBUG
05154         DXF_DEBUG_END
05155 #endif
05156         return ((DxfMline *) iter);
05157 }
05158 
05159 
05160 /* EOF */