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

spline.c File Reference

Functions for a DXF spline entity (SPLINE). More...

#include "spline.h"
Include dependency graph for spline.c:

Go to the source code of this file.

Functions

DxfSplinedxf_spline_new ()
 Allocate memory for a DXF SPLINE.
DxfSplinedxf_spline_init (DxfSpline *spline)
 Allocate memory and initialize data fields in a DXF SPLINE entity.
DxfSplinedxf_spline_read (DxfFile *fp, DxfSpline *spline)
 Read data from a DXF file into a DXF SPLINE entity.
int dxf_spline_write (DxfFile *fp, DxfSpline *spline)
 Write DXF output for a DXF SPLINE entity.
int dxf_spline_free (DxfSpline *spline)
 Free the allocated memory for a DXF SPLINE and all it's data fields.
void dxf_spline_free_chain (DxfSpline *splines)
 Free the allocated memory for a chain of DXF SPLINE entities and all their data fields.
int dxf_spline_get_id_code (DxfSpline *spline)
 Get the id_code from a DXF SPLINE.
DxfSplinedxf_spline_set_id_code (DxfSpline *spline, int id_code)
 Set the ID code for a DXF SPLINE entity.
char * dxf_spline_get_linetype (DxfSpline *spline)
 Get the linetype from a DXF SPLINE entity.
DxfSplinedxf_spline_set_linetype (DxfSpline *spline, char *linetype)
 Set the linetype for a DXF SPLINE entity.
char * dxf_spline_get_layer (DxfSpline *spline)
 Get the layer from a DXF SPLINE entity.
DxfSplinedxf_spline_set_layer (DxfSpline *spline, char *layer)
 Set the layer for a DXF SPLINE entity.
double dxf_spline_get_elevation (DxfSpline *spline)
 Get the elevation from a DXF SPLINE entity.
DxfSplinedxf_spline_set_elevation (DxfSpline *spline, double elevation)
 Set the elevation for a DXF SPLINE entity.
double dxf_spline_get_thickness (DxfSpline *spline)
 Get the thickness from a DXF SPLINE entity.
DxfSplinedxf_spline_set_thickness (DxfSpline *spline, double thickness)
 Set the thickness for a DXF SPLINE entity.
double dxf_spline_get_linetype_scale (DxfSpline *spline)
 Get the linetype_scale from a DXF SPLINE entity.
DxfSplinedxf_spline_set_linetype_scale (DxfSpline *spline, double linetype_scale)
 Set the linetype_scale for a DXF SPLINE entity.
int16_t dxf_spline_get_visibility (DxfSpline *spline)
 Get the visibility from a DXF SPLINE entity.
DxfSplinedxf_spline_set_visibility (DxfSpline *spline, int16_t visibility)
 Set the visibility for a DXF SPLINE entity.
int dxf_spline_get_color (DxfSpline *spline)
 Get the color from a DXF SPLINE entity.
DxfSplinedxf_spline_set_color (DxfSpline *spline, int color)
 Set the color for a DXF SPLINE entity.
int dxf_spline_get_paperspace (DxfSpline *spline)
 Get the paperspace flag value from a DXF SPLINE entity.
DxfSplinedxf_spline_set_paperspace (DxfSpline *spline, int paperspace)
 Set the paperspace flag for a DXF SPLINE entity.
int dxf_spline_get_graphics_data_size (DxfSpline *spline)
 Get the graphics_data_size value from a DXF SPLINE entity.
DxfSplinedxf_spline_set_graphics_data_size (DxfSpline *spline, int graphics_data_size)
 Set the graphics_data_size value for a DXF SPLINE entity.
int16_t dxf_spline_get_shadow_mode (DxfSpline *spline)
 Get the shadow_mode from a DXF SPLINE entity.
DxfSplinedxf_spline_set_shadow_mode (DxfSpline *spline, int16_t shadow_mode)
 Set the shadow_mode for a DXF SPLINE entity.
DxfBinaryGraphicsDatadxf_spline_get_binary_graphics_data (DxfSpline *spline)
 Get the pointer to the binary_graphics_data from a DXF SPLINE entity.
DxfSplinedxf_spline_set_binary_graphics_data (DxfSpline *spline, DxfBinaryGraphicsData *data)
 Set the pointer to the binary_graphics_data for a DXF SPLINE entity.
char * dxf_spline_get_dictionary_owner_soft (DxfSpline *spline)
 Get the pointer to the dictionary_owner_soft from a DXF SPLINE entity.
DxfSplinedxf_spline_set_dictionary_owner_soft (DxfSpline *spline, char *dictionary_owner_soft)
 Set the pointer to the dictionary_owner_soft for a DXF SPLINE entity.
char * dxf_spline_get_material (DxfSpline *spline)
 Get the pointer to the material from a DXF SPLINE entity.
DxfSplinedxf_spline_set_material (DxfSpline *spline, char *material)
 Set the pointer to the material for a DXF SPLINE entity.
char * dxf_spline_get_dictionary_owner_hard (DxfSpline *spline)
 Get the pointer to the dictionary_owner_hard from a DXF SPLINE entity.
DxfSplinedxf_spline_set_dictionary_owner_hard (DxfSpline *spline, char *dictionary_owner_hard)
 Set the pointer to the dictionary_owner_hard for a DXF SPLINE entity.
int16_t dxf_spline_get_lineweight (DxfSpline *spline)
 Get the lineweight from a DXF SPLINE entity.
DxfSplinedxf_spline_set_lineweight (DxfSpline *spline, int16_t lineweight)
 Set the lineweight for a DXF SPLINE entity.
char * dxf_spline_get_plot_style_name (DxfSpline *spline)
 Get the plot_style_name from a DXF SPLINE entity.
DxfSplinedxf_spline_set_plot_style_name (DxfSpline *spline, char *plot_style_name)
 Set the plot_style_name for a DXF SPLINE entity.
long dxf_spline_get_color_value (DxfSpline *spline)
 Get the color_value from a DXF SPLINE entity.
DxfSplinedxf_spline_set_color_value (DxfSpline *spline, long color_value)
 Set the color_value for a DXF SPLINE entity.
char * dxf_spline_get_color_name (DxfSpline *spline)
 Get the color_name from a DXF SPLINE entity.
DxfSplinedxf_spline_set_color_name (DxfSpline *spline, char *color_name)
 Set the color_name for a DXF SPLINE entity.
long dxf_spline_get_transparency (DxfSpline *spline)
 Get the transparency from a DXF SPLINE entity.
DxfSplinedxf_spline_set_transparency (DxfSpline *spline, long transparency)
 Set the transparency for a DXF SPLINE entity.
DxfPointdxf_spline_get_p0 (DxfSpline *spline)
 Get the first control point p0 from a DXF SPLINE entity.
DxfSplinedxf_spline_set_p0 (DxfSpline *spline, DxfPoint *p0)
 Set the first control point p0 for a DXF SPLINE entity.
double dxf_spline_get_x0 (DxfSpline *spline)
 Get the X-value x0 of the first control point p0 of a DXF SPLINE entity.
DxfSplinedxf_spline_set_x0 (DxfSpline *spline, double x0)
 Set the X-value x0 of the first control point p0 of a DXF SPLINE entity.
double dxf_spline_get_y0 (DxfSpline *spline)
 Get the Y-value y0 of the first control point p0 of a DXF SPLINE entity.
DxfSplinedxf_spline_set_y0 (DxfSpline *spline, double y0)
 Set the Y-value y0 of the first control point p0 of a DXF SPLINE entity.
double dxf_spline_get_z0 (DxfSpline *spline)
 Get the Z-value z0 of the first control point p0 of a DXF SPLINE entity.
DxfSplinedxf_spline_set_z0 (DxfSpline *spline, double z0)
 Set the Z-value z0 of the first control point p0 of a DXF SPLINE entity.
DxfPointdxf_spline_get_p1 (DxfSpline *spline)
 Get the first fit point p1 from a DXF SPLINE entity.
DxfSplinedxf_spline_set_p1 (DxfSpline *spline, DxfPoint *p1)
 Set the first fit point p1 for a DXF SPLINE entity.
double dxf_spline_get_x1 (DxfSpline *spline)
 Get the X-value x1 of the (first) fit point p1 of a DXF SPLINE entity.
DxfSplinedxf_spline_set_x1 (DxfSpline *spline, double x1)
 Set the X-value x1 of the (first) fit point p1 of a DXF SPLINE entity.
double dxf_spline_get_y1 (DxfSpline *spline)
 Get the Y-value y1 of the (first) fit point p1 of a DXF SPLINE entity.
DxfSplinedxf_spline_set_y1 (DxfSpline *spline, double y1)
 Set the Y-value y1 of the (first) fit point p1 of a DXF SPLINE entity.
double dxf_spline_get_z1 (DxfSpline *spline)
 Get the Z-value zy1 of the (first) fit point p1 of a DXF SPLINE entity.
DxfSplinedxf_spline_set_z1 (DxfSpline *spline, double z1)
 Set the Z-value z1 of the (first) fit point p1 of a DXF SPLINE entity.
DxfPointdxf_spline_get_p2 (DxfSpline *spline)
 Get the start tangent point p2 from a DXF SPLINE entity.
DxfSplinedxf_spline_set_p2 (DxfSpline *spline, DxfPoint *p2)
 Set the start tangent point p2 for a DXF SPLINE entity.
double dxf_spline_get_x2 (DxfSpline *spline)
 Get the X-value x2 of the start tangent point p2 of a DXF SPLINE entity.
DxfSplinedxf_spline_set_x2 (DxfSpline *spline, double x2)
 Set the X-value x2 of the start tangent point p2 of a DXF SPLINE entity.
double dxf_spline_get_y2 (DxfSpline *spline)
 Get the Y-value y2 of the start tangent point p2 of a DXF SPLINE entity.
DxfSplinedxf_spline_set_y2 (DxfSpline *spline, double y2)
 Set the Y-value y2 of the start tangent point p2 of a DXF SPLINE entity.
double dxf_spline_get_z2 (DxfSpline *spline)
 Get the Z-value z2 of the start tangent point p2 of a DXF SPLINE entity.
DxfSplinedxf_spline_set_z2 (DxfSpline *spline, double z2)
 Set the Z-value z2 of the start tangent point p2 of a DXF SPLINE entity.
DxfPointdxf_spline_get_p3 (DxfSpline *spline)
 Get the end tangent point p3 from a DXF SPLINE entity.
DxfSplinedxf_spline_set_p3 (DxfSpline *spline, DxfPoint *p3)
 Set the end tangent point p3 for a DXF SPLINE entity.
double dxf_spline_get_x3 (DxfSpline *spline)
 Get the X-value x3 of the end tangent point p3 of a DXF SPLINE entity.
DxfSplinedxf_spline_set_x3 (DxfSpline *spline, double x3)
 Set the X-value x3 of the end tangent point p3 of a DXF SPLINE entity.
double dxf_spline_get_y3 (DxfSpline *spline)
 Get the Y-value y3 of the end tangent point p3 of a DXF SPLINE entity.
DxfSplinedxf_spline_set_y3 (DxfSpline *spline, double y3)
 Set the Y-value y3 of the end tangent point p3 of a DXF SPLINE entity.
double dxf_spline_get_z3 (DxfSpline *spline)
 Get the Z-value z3 of the end tangent point p3 of a DXF SPLINE entity.
DxfSplinedxf_spline_set_z3 (DxfSpline *spline, double z3)
 Set the Z-value z3 of the end tangent point p3 of a DXF SPLINE entity.
double dxf_spline_get_knot_tolerance (DxfSpline *spline)
 Get the knot_tolerance of a DXF SPLINE entity.
DxfSplinedxf_spline_set_knot_tolerance (DxfSpline *spline, double knot_tolerance)
 Set the knot_tolerance of a DXF SPLINE entity.
double dxf_spline_get_control_point_tolerance (DxfSpline *spline)
 Get the control_point_tolerance of a DXF SPLINE entity.
DxfSplinedxf_spline_set_control_point_tolerance (DxfSpline *spline, double control_point_tolerance)
 Set the control_point_tolerance of a DXF SPLINE entity.
double dxf_spline_get_fit_tolerance (DxfSpline *spline)
 Get the fit_tolerance of a DXF SPLINE entity.
DxfSplinedxf_spline_set_fit_tolerance (DxfSpline *spline, double fit_tolerance)
 Set the fit_tolerance of a DXF SPLINE entity.
int dxf_spline_get_flag (DxfSpline *spline)
 Get the flag from a DXF SPLINE.

Detailed Description

Functions for a DXF spline entity (SPLINE).

Author:
Copyright (C) 2013, 2014, 2015, 2016, 2017 by Bert Timmerman <bert.timmerman@xs4all.nl>.

A spline is a smooth curve that passes through or near a given set of points.
You can control how closely the curve fits the points.
The SPLINE creates a particular type of spline known as a nonuniform rational B-spline (NURBS) curve.
A NURBS curve produces a smooth curve between control points.
You create splines by specifying points.
You can close the spline so that the start and endpoints are coincident and tangent.
Tolerance describes how closely the spline fits the set of fit points you specify.
The lower the tolerance, the more closely the spline fits the points.
At zero tolerance, the spline passes through the points.

Order.
The order of a NURBS curve defines the number of nearby control points that influence any given point on the curve.
The curve is represented mathematically by a polynomial of degree one less than the order of the curve.
Hence, second-order curves (which are represented by linear polynomials) are called linear curves, third-order curves are called quadratic curves, and fourth-order curves are called cubic curves.
The number of control points must be greater than or equal to the order of the curve.

In practice, cubic curves are the ones most commonly used.
Fifth- and sixth-order curves are sometimes useful, especially for obtaining continuous higher order derivatives, but curves of higher orders are practically never used because they lead to internal numerical problems and tend to require disproportionately large calculation times.

Control points.
The control points determine the shape of the curve.
Typically, each point of the curve is computed by taking a weighted sum of a number of control points.
The weight of each point varies according to the governing parameter.
For a curve of degree d, the weight of any control point is only nonzero in d+1 intervals of the parameter space.
Within those intervals, the weight changes according to a polynomial function (basis functions) of degree d.
At the boundaries of the intervals, the basis functions go smoothly to zero, the smoothness being determined by the degree of the polynomial.

As an example, the basis function of degree one is a triangle function.
It rises from zero to one, then falls to zero again.
While it rises, the basis function of the previous control point falls.
In that way, the curve interpolates between the two points, and the resulting curve is a polygon, which is continuous, but not differentiable at the interval boundaries, or knots.
Higher degree polynomials have correspondingly more continuous derivatives.
Note that within the interval the polynomial nature of the basis functions and the linearity of the construction make the curve perfectly smooth, so it is only at the knots that discontinuity can arise.

The fact that a single control point only influences those intervals where it is active is a highly desirable property, known as local support.
In modeling, it allows the changing of one part of a surface while keeping other parts equal.

Adding more control points allows better approximation to a given curve, although only a certain class of curves can be represented exactly with a finite number of control points.
NURBS curves also feature a scalar weight for each control point.
This allows for more control over the shape of the curve without unduly raising the number of control points.
In particular, it adds conic sections like circles and ellipses to the set of curves that can be represented exactly.
The term rational in NURBS refers to these weights.

The control points can have any dimensionality.
One-dimensional points just define a scalar function of the parameter.
These are typically used in image processing programs to tune the brightness and color curves.
Three-dimensional control points are used abundantly in 3D modeling, where they are used in the everyday meaning of the word 'point', a location in 3D space.
Multi-dimensional points might be used to control sets of time-driven values, e.g. the different positional and rotational settings of a robot arm.
NURBS surfaces are just an application of this.
Each control 'point' is actually a full vector of control points, defining a curve.
These curves share their degree and the number of control points, and span one dimension of the parameter space.
By interpolating these control vectors over the other dimension of the parameter space, a continuous set of curves is obtained, defining the surface.

The knot vector.
The knot vector is a sequence of parameter values that determines where and how the control points affect the NURBS curve.
The number of knots is always equal to the number of control points plus curve degree plus one (i.e. number of control points plus curve order).
The knot vector divides the parametric space in the intervals mentioned before, usually referred to as knot spans.
Each time the parameter value enters a new knot span, a new control point becomes active, while an old control point is discarded.
It follows that the values in the knot vector should be in nondecreasing order, so (0, 0, 1, 2, 3, 3) is valid while (0, 0, 2, 1, 3, 3) is not.

Consecutive knots can have the same value.
This then defines a knot span of zero length, which implies that two control points are activated at the same time (and of course two control points become deactivated).
This has impact on continuity of the resulting curve or its higher derivatives; for instance, it allows the creation of corners in an otherwise smooth NURBS curve.
A number of coinciding knots is sometimes referred to as a knot with a certain multiplicity.
Knots with multiplicity two or three are known as double or triple knots.
The multiplicity of a knot is limited to the degree of the curve; since a higher multiplicity would split the curve into disjoint parts and it would leave control points unused.
For first-degree NURBS, each knot is paired with a control point.

The knot vector usually starts with a knot that has multiplicity equal to the order.
This makes sense, since this activates the control points that have influence on the first knot span.
Similarly, the knot vector usually ends with a knot of that multiplicity.
Curves with such knot vectors start and end in a control point.

The individual knot values are not meaningful by themselves; only the ratios of the difference between the knot values matter.
Hence, the knot vectors (0, 0, 1, 2, 3, 3) and (0, 0, 2, 4, 6, 6) produce the same curve.
The positions of the knot values influences the mapping of parameter space to curve space.
Rendering a NURBS curve is usually done by stepping with a fixed stride through the parameter range.
By changing the knot span lengths, more sample points can be used in regions where the curvature is high.
Another use is in situations where the parameter value has some physical significance, for instance if the parameter is time and the curve describes the motion of a robot arm.
The knot span lengths then translate into velocity and acceleration, which are essential to get right to prevent damage to the robot arm or its environment.
This flexibility in the mapping is what the phrase non uniform in NURBS refers to.

Necessary only for internal calculations, knots are usually not helpful to the users of modeling software.
Therefore, many modeling applications do not make the knots editable or even visible.
It's usually possible to establish reasonable knot vectors by looking at the variation in the control points.
More recent versions of NURBS software (e.g., Autodesk Maya and Rhinoceros 3D) allow for interactive editing of knot positions, but this is significantly less intuitive than the editing of control points.

Fit Tolerance.
Changes the tolerance for fitting of the current spline curve.
The spline curve is redefined so that it fits through the existing points according to the new tolerance.
You can repeatedly change the fit tolerance, but doing so changes the fit tolerance for all the control points regardless of the control point that is selected.
If you set the tolerance to 0, the spline curve passes through the fit points.
Entering a tolerance greater than 0 allows the spline curve to pass through the fit points within the specified tolerance.

dxf_spline_tolerance.png

Tangents.
Defines the tangency for the first and last points of the spline curve.
The Start Tangent specifies the tangency of the spline curve at the first point.

dxf_spline_first_tangent_point.png

The End Tangent specifies the tangency of the spline curve at the last point.

dxf_spline_last_tangent_point.png
Version:
According to DXF R10 (backward compatibility).
According to DXF R11 (backward compatibility).
According to DXF R12 (backward compatibility).
According to DXF R13.
According to DXF R14.

Copyright Notices.


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to:
Free Software Foundation, Inc.,
59 Temple Place,
Suite 330,
Boston,
MA 02111 USA.

Drawing eXchange Format (DXF) is a defacto industry standard for the exchange of drawing files between various Computer Aided Drafting programs.
DXF is an industry standard designed by Autodesk(TM).
For more details see http://www.autodesk.com .


Definition in file spline.c.


Function Documentation

DxfSpline* dxf_spline_new ( )

Allocate memory for a DXF SPLINE.

Fill the memory contents with zeros.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.

Definition at line 245 of file spline.c.

References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

Referenced by dxf_spline_init(), and dxf_spline_read().

DxfSpline* dxf_spline_init ( DxfSpline spline)

Allocate memory and initialize data fields in a DXF SPLINE entity.

Returns:
NULL when no memory was allocated, a pointer to the allocated memory when succesful.
Parameters:
splinea pointer to the DXF SPLINE entity.

Definition at line 283 of file spline.c.

References _, dxf_spline_struct::binary_graphics_data, dxf_spline_struct::color, dxf_spline_struct::color_name, dxf_spline_struct::color_value, dxf_spline_struct::control_point_tolerance, dxf_spline_struct::degree, dxf_spline_struct::dictionary_owner_hard, dxf_spline_struct::dictionary_owner_soft, dxf_binary_graphics_data_init(), DXF_COLOR_BYLAYER, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, dxf_double_init(), dxf_double_new(), DXF_MODELSPACE, dxf_point_init(), dxf_point_new(), DXF_SPLINE_CONTROL_POINT_TOLERANCE_DEFAULT, DXF_SPLINE_FIT_TOLERANCE_DEFAULT, DXF_SPLINE_KNOT_TOLERANCE_DEFAULT, dxf_spline_new(), dxf_spline_struct::elevation, dxf_spline_struct::extr_x0, dxf_spline_struct::extr_y0, dxf_spline_struct::extr_z0, dxf_spline_struct::fit_tolerance, dxf_spline_struct::flag, dxf_spline_struct::graphics_data_size, dxf_spline_struct::id_code, dxf_spline_struct::knot_tolerance, dxf_spline_struct::knot_value, dxf_spline_struct::layer, dxf_spline_struct::linetype, dxf_spline_struct::linetype_scale, dxf_spline_struct::lineweight, dxf_spline_struct::material, dxf_spline_struct::next, dxf_spline_struct::number_of_control_points, dxf_spline_struct::number_of_fit_points, dxf_spline_struct::number_of_knots, dxf_spline_struct::p0, dxf_spline_struct::p1, dxf_spline_struct::p2, dxf_spline_struct::p3, dxf_spline_struct::paperspace, dxf_spline_struct::plot_style_name, dxf_spline_struct::shadow_mode, dxf_spline_struct::thickness, dxf_spline_struct::transparency, dxf_double_struct::value, dxf_spline_struct::visibility, and dxf_spline_struct::weight_value.

Referenced by dxf_helix_init(), and dxf_spline_read().

Here is the call graph for this function:

DxfSpline* dxf_spline_read ( DxfFile fp,
DxfSpline spline 
)

Read data from a DXF file into a DXF SPLINE entity.

The last line read from file contained the string "SPLINE".
Now follows some data for the SPLINE, to be terminated with a " 0" string announcing the following entity, or the end of the ENTITY section marker ENDSEC.
While parsing the DXF file store data in spline.

Returns:
a pointer to spline, or NULL when an error occurred.
Parameters:
fpDXF file pointer to an input file (or device).
splinea pointer to the DXF SPLINE entity.

Definition at line 372 of file spline.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_11, dxf_spline_struct::binary_graphics_data, dxf_spline_struct::color, dxf_spline_struct::color_name, dxf_spline_struct::color_value, dxf_spline_struct::control_point_tolerance, dxf_binary_graphics_data_struct::data_line, dxf_spline_struct::degree, dxf_spline_struct::dictionary_owner_hard, dxf_spline_struct::dictionary_owner_soft, dxf_binary_graphics_data_init(), DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, dxf_double_init(), dxf_point_init(), dxf_spline_init(), dxf_spline_new(), dxf_spline_struct::elevation, dxf_file_struct::filename, dxf_spline_struct::fit_tolerance, dxf_spline_struct::flag, dxf_file_struct::fp, dxf_spline_struct::graphics_data_size, dxf_spline_struct::id_code, dxf_spline_struct::knot_tolerance, dxf_spline_struct::knot_value, dxf_spline_struct::layer, dxf_file_struct::line_number, dxf_spline_struct::linetype, dxf_spline_struct::linetype_scale, dxf_spline_struct::lineweight, dxf_spline_struct::material, dxf_binary_graphics_data_struct::next, dxf_double_struct::next, dxf_point_struct::next, dxf_spline_struct::number_of_control_points, dxf_spline_struct::number_of_fit_points, dxf_spline_struct::number_of_knots, dxf_spline_struct::p0, dxf_spline_struct::p1, dxf_spline_struct::p2, dxf_spline_struct::p3, dxf_spline_struct::paperspace, dxf_spline_struct::plot_style_name, dxf_spline_struct::shadow_mode, dxf_spline_struct::thickness, dxf_spline_struct::transparency, dxf_double_struct::value, dxf_spline_struct::visibility, dxf_spline_struct::weight_value, dxf_point_struct::x0, dxf_point_struct::y0, and dxf_point_struct::z0.

Referenced by dxf_helix_read().

Here is the call graph for this function:

int dxf_spline_write ( DxfFile fp,
DxfSpline spline 
)

Write DXF output for a DXF SPLINE entity.

Returns:
EXIT_SUCCESS when done, or EXIT_FAILURE when an error occurred.

Todo:
for version R14.
Implementing the start of application-defined group "{application_name", with Group code 102.
For example: "{ACAD_REACTORS" indicates the start of the AutoCAD persistent reactors group.

application-defined codes: Group codes and values within the 102 groups are application defined (optional).

End of group, "}" (optional), with Group code 102.
Todo:
On 64 bit machines use group code 160.
Todo:
implement as a single linked list of double.
Todo:
implement as a single linked list of double.

Parameters:
fpDXF file pointer to an output file (or device).
splinea pointer to the DXF SPLINE entity.

Definition at line 774 of file spline.c.

References _, dxf_file_struct::acad_version_number, AutoCAD_11, AutoCAD_12, AutoCAD_13, AutoCAD_14, AutoCAD_2007, dxf_spline_struct::binary_graphics_data, dxf_spline_struct::color, dxf_spline_struct::color_name, dxf_spline_struct::color_value, dxf_spline_struct::control_point_tolerance, dxf_binary_graphics_data_struct::data_line, dxf_spline_struct::degree, dxf_spline_struct::dictionary_owner_hard, dxf_spline_struct::dictionary_owner_soft, dxf_binary_graphics_data_get_next(), DXF_COLOR_BYLAYER, DXF_DEBUG_BEGIN, DXF_DEBUG_END, DXF_DEFAULT_LAYER, DXF_DEFAULT_LINETYPE, DXF_FLATLAND, DXF_MODELSPACE, DXF_PAPERSPACE, dxf_point_get_next(), dxf_spline_struct::elevation, dxf_spline_struct::extr_x0, dxf_spline_struct::extr_y0, dxf_spline_struct::extr_z0, dxf_spline_struct::flag, dxf_file_struct::fp, dxf_spline_struct::graphics_data_size, dxf_spline_struct::id_code, dxf_spline_struct::knot_tolerance, dxf_spline_struct::knot_value, dxf_spline_struct::layer, dxf_spline_struct::linetype, dxf_spline_struct::linetype_scale, dxf_spline_struct::lineweight, dxf_spline_struct::material, dxf_spline_struct::number_of_control_points, dxf_spline_struct::number_of_fit_points, dxf_spline_struct::number_of_knots, dxf_spline_struct::p0, dxf_spline_struct::p1, dxf_spline_struct::p2, dxf_spline_struct::p3, dxf_spline_struct::paperspace, dxf_spline_struct::plot_style_name, dxf_spline_struct::shadow_mode, dxf_spline_struct::thickness, dxf_spline_struct::transparency, dxf_double_struct::value, dxf_spline_struct::visibility, dxf_spline_struct::weight_value, dxf_point_struct::x0, dxf_point_struct::y0, and dxf_point_struct::z0.

Here is the call graph for this function:

int dxf_spline_free ( DxfSpline spline)
void dxf_spline_free_chain ( DxfSpline splines)

Free the allocated memory for a chain of DXF SPLINE entities and all their data fields.

Parameters:
splinesa pointer to the chain of DXF SPLINE entities.

Definition at line 1045 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_free(), and dxf_spline_struct::next.

Here is the call graph for this function:

int dxf_spline_get_id_code ( DxfSpline spline)

Get the id_code from a DXF SPLINE.

Returns:
id_code when successful, or EXIT_FAILURE when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE.

Definition at line 1079 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::id_code.

DxfSpline* dxf_spline_set_id_code ( DxfSpline spline,
int  id_code 
)

Set the ID code for a DXF SPLINE entity.

Returns:
spline when successful or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
id_codeIdentification number for the entity.
This is to be an unique (sequential) number in the DXF file.

Definition at line 1116 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::id_code.

char* dxf_spline_get_linetype ( DxfSpline spline)

Get the linetype from a DXF SPLINE entity.

Returns:
linetype when sucessful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 1158 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::linetype.

DxfSpline* dxf_spline_set_linetype ( DxfSpline spline,
char *  linetype 
)

Set the linetype for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
linetypea string containing the linetype for the entity.

Definition at line 1196 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::linetype.

char* dxf_spline_get_layer ( DxfSpline spline)

Get the layer from a DXF SPLINE entity.

Returns:
layer when sucessful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 1236 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::layer.

DxfSpline* dxf_spline_set_layer ( DxfSpline spline,
char *  layer 
)

Set the layer for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
layera string containing the layer for the entity.

Definition at line 1274 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::layer.

double dxf_spline_get_elevation ( DxfSpline spline)

Get the elevation from a DXF SPLINE entity.

Returns:
elevation when successful, or EXIT_FAILURE when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 1315 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::elevation.

DxfSpline* dxf_spline_set_elevation ( DxfSpline spline,
double  elevation 
)

Set the elevation for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
elevationthe elevation to be set for the entity.

Definition at line 1346 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::elevation.

double dxf_spline_get_thickness ( DxfSpline spline)

Get the thickness from a DXF SPLINE entity.

Returns:
thickness when successful, or EXIT_FAILURE when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 1380 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::thickness.

DxfSpline* dxf_spline_set_thickness ( DxfSpline spline,
double  thickness 
)

Set the thickness for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
thicknessthe thickness to be set for the entity.

Definition at line 1417 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::thickness.

double dxf_spline_get_linetype_scale ( DxfSpline spline)

Get the linetype_scale from a DXF SPLINE entity.

Returns:
linetype_scale when successful, or EXIT_FAILURE when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 1457 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::linetype_scale.

DxfSpline* dxf_spline_set_linetype_scale ( DxfSpline spline,
double  linetype_scale 
)

Set the linetype_scale for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
linetype_scalethe linetype_scale to be set for the entity.

Definition at line 1495 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::linetype_scale.

int16_t dxf_spline_get_visibility ( DxfSpline spline)

Get the visibility from a DXF SPLINE entity.

Returns:
visibility when successful, or EXIT_FAILURE when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 1536 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::visibility.

DxfSpline* dxf_spline_set_visibility ( DxfSpline spline,
int16_t  visibility 
)

Set the visibility for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
visibilitythe visibility to be set for the entity.

Definition at line 1581 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::visibility.

int dxf_spline_get_color ( DxfSpline spline)

Get the color from a DXF SPLINE entity.

Returns:
color when successful, or EXIT_FAILURE when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 1629 of file spline.c.

References _, dxf_spline_struct::color, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfSpline* dxf_spline_set_color ( DxfSpline spline,
int  color 
)

Set the color for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
colorthe color to be set for the entity.

Definition at line 1666 of file spline.c.

References _, dxf_spline_struct::color, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

int dxf_spline_get_paperspace ( DxfSpline spline)

Get the paperspace flag value from a DXF SPLINE entity.

Returns:
paperspace flag value when successful, or EXIT_FAILURE when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 1708 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::paperspace.

DxfSpline* dxf_spline_set_paperspace ( DxfSpline spline,
int  paperspace 
)

Set the paperspace flag for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
paperspacethe paperspace flag value to be set for the entity.

Definition at line 1751 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::paperspace.

int dxf_spline_get_graphics_data_size ( DxfSpline spline)

Get the graphics_data_size value from a DXF SPLINE entity.

Returns:
graphics_data_size flag value when successful, or EXIT_FAILURE when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 1800 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::graphics_data_size.

DxfSpline* dxf_spline_set_graphics_data_size ( DxfSpline spline,
int  graphics_data_size 
)

Set the graphics_data_size value for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
graphics_data_sizethe graphics_data_size value to be set for the entity.

Definition at line 1843 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::graphics_data_size.

int16_t dxf_spline_get_shadow_mode ( DxfSpline spline)

Get the shadow_mode from a DXF SPLINE entity.

Returns:
shadow_mode when successful, or EXIT_FAILURE when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 1892 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::shadow_mode.

DxfSpline* dxf_spline_set_shadow_mode ( DxfSpline spline,
int16_t  shadow_mode 
)

Set the shadow_mode for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
shadow_modethe shadow mode to be set for the entity.

Definition at line 1937 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::shadow_mode.

DxfBinaryGraphicsData* dxf_spline_get_binary_graphics_data ( DxfSpline spline)

Get the pointer to the binary_graphics_data from a DXF SPLINE entity.

Returns:
a pointer to the binary_graphics_data when successful, or NULL when an error occurred.
Warning:
No checks are performed on the returned pointer.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 1988 of file spline.c.

References _, dxf_spline_struct::binary_graphics_data, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfSpline* dxf_spline_set_binary_graphics_data ( DxfSpline spline,
DxfBinaryGraphicsData data 
)

Set the pointer to the binary_graphics_data for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
dataa string containing the pointer to the binary_graphics_data for the entity.

Definition at line 2027 of file spline.c.

References _, dxf_spline_struct::binary_graphics_data, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

char* dxf_spline_get_dictionary_owner_soft ( DxfSpline spline)

Get the pointer to the dictionary_owner_soft from a DXF SPLINE entity.

Returns:
a pointer to dictionary_owner_soft when successful, or NULL when an error occurred.
Warning:
No checks are performed on the returned pointer.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 2072 of file spline.c.

References _, dxf_spline_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfSpline* dxf_spline_set_dictionary_owner_soft ( DxfSpline spline,
char *  dictionary_owner_soft 
)

Set the pointer to the dictionary_owner_soft for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
dictionary_owner_softa string containing the pointer to the dictionary_owner_soft for the entity.

Definition at line 2111 of file spline.c.

References _, dxf_spline_struct::dictionary_owner_soft, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

char* dxf_spline_get_material ( DxfSpline spline)

Get the pointer to the material from a DXF SPLINE entity.

Returns:
a pointer to material when successful, or NULL when an error occurred.
Warning:
No checks are performed on the returned pointer.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 2155 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::material.

DxfSpline* dxf_spline_set_material ( DxfSpline spline,
char *  material 
)

Set the pointer to the material for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
materiala string containing the pointer to the material for the entity.

Definition at line 2193 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::material.

char* dxf_spline_get_dictionary_owner_hard ( DxfSpline spline)

Get the pointer to the dictionary_owner_hard from a DXF SPLINE entity.

Returns:
a pointer to dictionary_owner_hard when successful, or NULL when an error occurred.
Warning:
No checks are performed on the returned pointer.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 2238 of file spline.c.

References _, dxf_spline_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfSpline* dxf_spline_set_dictionary_owner_hard ( DxfSpline spline,
char *  dictionary_owner_hard 
)

Set the pointer to the dictionary_owner_hard for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
dictionary_owner_harda string containing the pointer to the dictionary_owner_hard for the entity.

Definition at line 2277 of file spline.c.

References _, dxf_spline_struct::dictionary_owner_hard, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

int16_t dxf_spline_get_lineweight ( DxfSpline spline)

Get the lineweight from a DXF SPLINE entity.

Returns:
lineweight when successful, or EXIT_FAILURE when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 2319 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::lineweight.

DxfSpline* dxf_spline_set_lineweight ( DxfSpline spline,
int16_t  lineweight 
)

Set the lineweight for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
lineweightthe lineweight to be set for the entity.

Definition at line 2350 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::lineweight.

char* dxf_spline_get_plot_style_name ( DxfSpline spline)

Get the plot_style_name from a DXF SPLINE entity.

Returns:
plot_style_name when sucessful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 2384 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::plot_style_name.

DxfSpline* dxf_spline_set_plot_style_name ( DxfSpline spline,
char *  plot_style_name 
)

Set the plot_style_name for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
plot_style_namea string containing the plot_style_name for the entity.

Definition at line 2422 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::plot_style_name.

long dxf_spline_get_color_value ( DxfSpline spline)

Get the color_value from a DXF SPLINE entity.

Returns:
color_value when successful, or EXIT_FAILURE when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 2464 of file spline.c.

References _, dxf_spline_struct::color_value, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfSpline* dxf_spline_set_color_value ( DxfSpline spline,
long  color_value 
)

Set the color_value for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
color_valuethe color_value to be set for the entity.

Definition at line 2495 of file spline.c.

References _, dxf_spline_struct::color_value, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

char* dxf_spline_get_color_name ( DxfSpline spline)

Get the color_name from a DXF SPLINE entity.

Returns:
color_name when sucessful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 2529 of file spline.c.

References _, dxf_spline_struct::color_name, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfSpline* dxf_spline_set_color_name ( DxfSpline spline,
char *  color_name 
)

Set the color_name for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
color_namea string containing the color_name for the entity.

Definition at line 2567 of file spline.c.

References _, dxf_spline_struct::color_name, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

long dxf_spline_get_transparency ( DxfSpline spline)

Get the transparency from a DXF SPLINE entity.

Returns:
transparency when successful, or EXIT_FAILURE when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 2609 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::transparency.

DxfSpline* dxf_spline_set_transparency ( DxfSpline spline,
long  transparency 
)

Set the transparency for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
transparencythe transparency to be set for the entity.

Definition at line 2640 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::transparency.

DxfPoint* dxf_spline_get_p0 ( DxfSpline spline)

Get the first control point p0 from a DXF SPLINE entity.

p0 is the first control point in a single linked list.

Returns:
control point p0 when sucessful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 2676 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::p0.

DxfSpline* dxf_spline_set_p0 ( DxfSpline spline,
DxfPoint p0 
)

Set the first control point p0 for a DXF SPLINE entity.

p0 is the first control point in a single linked list.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
p0a control point p0 (multiple entries) for the entity.

Definition at line 2716 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::p0.

double dxf_spline_get_x0 ( DxfSpline spline)

Get the X-value x0 of the first control point p0 of a DXF SPLINE entity.

Returns:
the X-value x0 of the first control point p0.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 2758 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p0, and dxf_point_struct::x0.

DxfSpline* dxf_spline_set_x0 ( DxfSpline spline,
double  x0 
)

Set the X-value x0 of the first control point p0 of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
x0the X-value x0 of the first control point p0 to be set for a DXF SPLINE entity.

Definition at line 2798 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p0, and dxf_point_struct::x0.

double dxf_spline_get_y0 ( DxfSpline spline)

Get the Y-value y0 of the first control point p0 of a DXF SPLINE entity.

Returns:
the Y-value y0 of the first control point p0.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 2840 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p0, and dxf_point_struct::y0.

DxfSpline* dxf_spline_set_y0 ( DxfSpline spline,
double  y0 
)

Set the Y-value y0 of the first control point p0 of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
y0the Y-value y0 of the first control point p0 to be set for a DXF SPLINE entity.

Definition at line 2880 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p0, and dxf_point_struct::y0.

double dxf_spline_get_z0 ( DxfSpline spline)

Get the Z-value z0 of the first control point p0 of a DXF SPLINE entity.

Returns:
the Z-value z0 of the first control point p0.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 2922 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p0, and dxf_point_struct::z0.

DxfSpline* dxf_spline_set_z0 ( DxfSpline spline,
double  z0 
)

Set the Z-value z0 of the first control point p0 of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
z0the Z-value z0 of the first control point p0 to be set for a DXF SPLINE entity.

Definition at line 2962 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p0, and dxf_point_struct::z0.

DxfPoint* dxf_spline_get_p1 ( DxfSpline spline)

Get the first fit point p1 from a DXF SPLINE entity.

p1 is the first fit point in a single linked list.

Returns:
fit point p1 when sucessful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 3006 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::p1.

DxfSpline* dxf_spline_set_p1 ( DxfSpline spline,
DxfPoint p1 
)

Set the first fit point p1 for a DXF SPLINE entity.

p1 is the first fit point in a single linked list.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
p1a fit point p0 (multiple entries) for the entity.

Definition at line 3046 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::p1.

double dxf_spline_get_x1 ( DxfSpline spline)

Get the X-value x1 of the (first) fit point p1 of a DXF SPLINE entity.

Returns:
the X-value x1 of the (first) fit point p1.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 3088 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p1, and dxf_point_struct::x0.

DxfSpline* dxf_spline_set_x1 ( DxfSpline spline,
double  x1 
)

Set the X-value x1 of the (first) fit point p1 of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
x1the X-value x1 of the (first) fit point p1 to be set for a DXF SPLINE entity.

Definition at line 3128 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p1, and dxf_point_struct::x0.

double dxf_spline_get_y1 ( DxfSpline spline)

Get the Y-value y1 of the (first) fit point p1 of a DXF SPLINE entity.

Returns:
the Y-value y1 of the (first) fit point p1.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 3170 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p1, and dxf_point_struct::y0.

DxfSpline* dxf_spline_set_y1 ( DxfSpline spline,
double  y1 
)

Set the Y-value y1 of the (first) fit point p1 of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
y1the Y-value y1 of the (first) fit point p1 to be set for a DXF SPLINE entity.

Definition at line 3210 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p1, and dxf_point_struct::y0.

double dxf_spline_get_z1 ( DxfSpline spline)

Get the Z-value zy1 of the (first) fit point p1 of a DXF SPLINE entity.

Returns:
the Z-value z1 of the (first) fit point p1.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 3252 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p1, and dxf_point_struct::z0.

DxfSpline* dxf_spline_set_z1 ( DxfSpline spline,
double  z1 
)

Set the Z-value z1 of the (first) fit point p1 of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
z1the Z-value z1 of the (first) fit point p1 to be set for a DXF SPLINE entity.

Definition at line 3292 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p1, and dxf_point_struct::z0.

DxfPoint* dxf_spline_get_p2 ( DxfSpline spline)

Get the start tangent point p2 from a DXF SPLINE entity.

Returns:
start tangent point p2 when sucessful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 3334 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::p2.

DxfSpline* dxf_spline_set_p2 ( DxfSpline spline,
DxfPoint p2 
)

Set the start tangent point p2 for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
p2a start tangent point p2 for the entity.

Definition at line 3372 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::p2.

double dxf_spline_get_x2 ( DxfSpline spline)

Get the X-value x2 of the start tangent point p2 of a DXF SPLINE entity.

Returns:
the X-value x2 of the start tangent point p2.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 3413 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p2, and dxf_point_struct::x0.

DxfSpline* dxf_spline_set_x2 ( DxfSpline spline,
double  x2 
)

Set the X-value x2 of the start tangent point p2 of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
x2the X-value x2 of the start tangent point p2 to be set for a DXF SPLINE entity.

Definition at line 3453 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p2, and dxf_point_struct::x0.

double dxf_spline_get_y2 ( DxfSpline spline)

Get the Y-value y2 of the start tangent point p2 of a DXF SPLINE entity.

Returns:
the Y-value y2 of the start tangent point p2.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 3495 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p2, and dxf_point_struct::y0.

DxfSpline* dxf_spline_set_y2 ( DxfSpline spline,
double  y2 
)

Set the Y-value y2 of the start tangent point p2 of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
y2the Y-value y2 of the start tangent point p2 to be set for a DXF SPLINE entity.

Definition at line 3535 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p2, and dxf_point_struct::y0.

double dxf_spline_get_z2 ( DxfSpline spline)

Get the Z-value z2 of the start tangent point p2 of a DXF SPLINE entity.

Returns:
the Z-value z2 of the start tangent point p2.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 3577 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p2, and dxf_point_struct::z0.

DxfSpline* dxf_spline_set_z2 ( DxfSpline spline,
double  z2 
)

Set the Z-value z2 of the start tangent point p2 of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
z2the Z-value z2 of the start tangent point p2 to be set for a DXF SPLINE entity.

Definition at line 3617 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p2, and dxf_point_struct::z0.

DxfPoint* dxf_spline_get_p3 ( DxfSpline spline)

Get the end tangent point p3 from a DXF SPLINE entity.

Returns:
end tangent point p3 when sucessful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 3659 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::p3.

DxfSpline* dxf_spline_set_p3 ( DxfSpline spline,
DxfPoint p3 
)

Set the end tangent point p3 for a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
p3a end tangent point p3 for the entity.

Definition at line 3697 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::p3.

double dxf_spline_get_x3 ( DxfSpline spline)

Get the X-value x3 of the end tangent point p3 of a DXF SPLINE entity.

Returns:
the X-value x3 of the end tangent point p3.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 3738 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p3, and dxf_point_struct::x0.

DxfSpline* dxf_spline_set_x3 ( DxfSpline spline,
double  x3 
)

Set the X-value x3 of the end tangent point p3 of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
x3the X-value x3 of the end tangent point p3 to be set for a DXF SPLINE entity.

Definition at line 3778 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p3, and dxf_point_struct::x0.

double dxf_spline_get_y3 ( DxfSpline spline)

Get the Y-value y3 of the end tangent point p3 of a DXF SPLINE entity.

Returns:
the Y-value y3 of the end tangent point p3.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 3820 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p3, and dxf_point_struct::y0.

DxfSpline* dxf_spline_set_y3 ( DxfSpline spline,
double  y3 
)

Set the Y-value y3 of the end tangent point p3 of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
y3the Y-value y3 of the end tangent point p3 to be set for a DXF SPLINE entity.

Definition at line 3860 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p3, and dxf_point_struct::y0.

double dxf_spline_get_z3 ( DxfSpline spline)

Get the Z-value z3 of the end tangent point p3 of a DXF SPLINE entity.

Returns:
the Z-value z3 of the end tangent point p3.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 3902 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p3, and dxf_point_struct::z0.

DxfSpline* dxf_spline_set_z3 ( DxfSpline spline,
double  z3 
)

Set the Z-value z3 of the end tangent point p3 of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
z3the Z-value yz of the end tangent point p3 to be set for a DXF SPLINE entity.

Definition at line 3942 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_spline_struct::p3, and dxf_point_struct::z0.

double dxf_spline_get_knot_tolerance ( DxfSpline spline)

Get the knot_tolerance of a DXF SPLINE entity.

Returns:
the knot_tolerance.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 3983 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::knot_tolerance.

DxfSpline* dxf_spline_set_knot_tolerance ( DxfSpline spline,
double  knot_tolerance 
)

Set the knot_tolerance of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
knot_tolerancethe knot_tolerance to be set for a DXF SPLINE entity.

Definition at line 4015 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::knot_tolerance.

double dxf_spline_get_control_point_tolerance ( DxfSpline spline)

Get the control_point_tolerance of a DXF SPLINE entity.

Returns:
the control_point_tolerance.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 4049 of file spline.c.

References _, dxf_spline_struct::control_point_tolerance, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

DxfSpline* dxf_spline_set_control_point_tolerance ( DxfSpline spline,
double  control_point_tolerance 
)

Set the control_point_tolerance of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
control_point_tolerancethe control_point_tolerance to be set for a DXF SPLINE entity.

Definition at line 4081 of file spline.c.

References _, dxf_spline_struct::control_point_tolerance, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.

double dxf_spline_get_fit_tolerance ( DxfSpline spline)

Get the fit_tolerance of a DXF SPLINE entity.

Returns:
the fit_tolerance.
Parameters:
splinea pointer to a DXF SPLINE entity.

Definition at line 4115 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::fit_tolerance.

DxfSpline* dxf_spline_set_fit_tolerance ( DxfSpline spline,
double  fit_tolerance 
)

Set the fit_tolerance of a DXF SPLINE entity.

Returns:
a pointer to spline when successful, or NULL when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE entity.
fit_tolerancethe fit_tolerance to be set for a DXF SPLINE entity.

Definition at line 4147 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::fit_tolerance.

int dxf_spline_get_flag ( DxfSpline spline)

Get the flag from a DXF SPLINE.

Returns:
flag when successful, or EXIT_FAILURE when an error occurred.
Parameters:
splinea pointer to a DXF SPLINE.

Definition at line 4182 of file spline.c.

References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_spline_struct::flag.