/* Copyright (C) 2018-2020, Dirk Krause SPDX-License-Identifier: BSD-3-Clause */ /* WARNING: This file was generated by the dkct program (see http://dktools.sourceforge.net/ for details). Changes you make here will be lost if dkct is run again! You should modify the original source and run dkct on it. Original source: wxd2lxs.ctr */ #ifndef WXD2LXS_H_INCLUDED /** Avoid multiple inclusions. */ #define WXD2LXS_H_INCLUDED 1 #line 9 "wxd2lxs.ctr" /** @file wxd2lxs.h X-spline handling in wxd2lat. */ #ifndef DK4ERROR_H_INCLUDED #include "dk4error.h" #endif #ifndef WXDTYPES_H_INCLUDED #include "wxdtypes.h" #endif #ifdef __cplusplus extern "C" { #endif /** Set up X-spline segment structure from X-spline data object. @param xs X-spline segment structure to set up. @param pobj X-spline object to obtain data from. @param ib Segment number. */ void wxd2lxs_set_xspline( dk4_xsp_2d_t *xs, wxd_object_t *pobj, uint16_t ib ); /** Check spline object, if necessary calculate the segment lengths. @param job Job structure. @param drw Drawing structure. @param pobj Object to process. @paam backptr Address of success variable to reset on error. */ void wxd2lxs_calculate_spline_segments( wxd2lat_job_t *job, wxd_object_t *pobj, int *backptr ); /** Calculate coordinates and optionally direction for a given t value. This function can only be used for open splines with at least one arrowhead attached. @param rp Address of result variable to set on success. If d=0 a 2 elements array is required to store x and y. If d!=0 a 3 elements array is required to store x, y and alpha (direction angle). @param pobj X-spline object. @param t Parameter t. @param d Flag: Calculate derivative values. @param erp Error report, may be NULL. @return 1 on success, 0 on error (calculation failed). */ int wxd2lxs_calculate( double *rp, wxd_object_t *pobj, double t, int d, dk4_er_t *erp ); /** Calculate partial X-spline length from 0 to a given t value. This function can only be used for open splines with at least one arrowhead attached. @param rp Address of result variable to set on success. @param pobj X-spline object. @param t Parameter t. @param eps Required precision. @param erp Error report, may be NULL. @return 1 on success, 0 on error (calculation failed). */ int wxd2lxs_length_to_parameter( double *rp, wxd_object_t *pobj, double t, double eps, dk4_er_t *erp ); /** Find t parameter for a given partial X-spline length l. @param rp Address of result variable for t value. @param pobj Open X-spline with arrowhead(s). @param l Length to search to for. @param xslp Precision for length calculation. @param xspp Iteration precision for t. @param erp Error report, may be NULL. @return 1 on success, 0 on error. */ int wxd2lxs_parameter_for_length( double *rp, wxd_object_t *pobj, double l, double xslp, double xspp, dk4_er_t *erp ); #ifdef __cplusplus } #endif /* vim: set ai sw=4 ts=4 : */ #endif