bf3a3fa297
- aggiunta libreria vroni 7.6.
131 lines
7.5 KiB
C
131 lines
7.5 KiB
C
// recupero le definizioni dal file api_functions.cc
|
|
|
|
#pragma once
|
|
|
|
/* */
|
|
/* get standard libraries */
|
|
/* */
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <math.h>
|
|
#include <limits.h>
|
|
#include <float.h>
|
|
#include <assert.h>
|
|
#include <string.h>
|
|
|
|
|
|
/* */
|
|
/* get my header files */
|
|
/* */
|
|
#include "fpkernel.h"
|
|
#include "coord.h"
|
|
#include "vroni_object.h"
|
|
|
|
|
|
/* */
|
|
/* function prototypes of functions provided in this file; see arg_eval.cc */
|
|
/* for the default values of most of those parameters. */
|
|
/* */
|
|
|
|
// get access to underlying VD
|
|
vroniObject& API_VD();
|
|
|
|
void API_ParseCommandLineArgs(int argc, char *argv[], vr_bool *graphics, vr_bool *color_graphics, vr_bool *full_screen);
|
|
|
|
// call this routine once prior calling any other routine of VRONI
|
|
void API_InitializeProgram(void);
|
|
|
|
void API_GetInputData(vr_bool *input_received);
|
|
|
|
void API_ProceedWithoutGraphics(vr_bool new_input);
|
|
|
|
// call this routine whenever new data is to be input and VRONI's data structures are to be reset;
|
|
// note that this function won't free memory allocated
|
|
void API_ResetAll(void);
|
|
|
|
// call this routine to release all memory allocated by VRONI
|
|
void API_TerminateProgram(void);
|
|
|
|
|
|
void API_HandleInput(char input_file[], // name of the input file
|
|
vr_bool *new_input, // true if new data has been read
|
|
vr_bool read_polygon, // read ".dat" format
|
|
vr_bool read_poly, // read ".poly" format
|
|
vr_bool read_sites, // read ".site" format
|
|
vr_bool read_xdr, // read ".xdr" format
|
|
vr_bool read_e00, // read ".e00" format
|
|
vr_bool read_polylines, // read ".polylines" format
|
|
vr_bool read_usgs, // read ".usgs" format
|
|
vr_bool read_dxf, // read ".dxf" format
|
|
vr_bool read_pnts, // read ".pnt" format
|
|
vr_bool read_graphml); // read ".graphml" format
|
|
|
|
// this function requires the user to stick to my naming convention for the extension of the input file relative to the data format used
|
|
void API_FileInput(char input_file[], // name of the input file
|
|
vr_bool *new_input); // true if new data has been read
|
|
|
|
void API_ArrayInput( int number_of_points, // data in point_data[0,..,k] for k := number_of_points-1
|
|
in_pnts *point_data, // see ext_appl_inout.h
|
|
int number_of_segments,
|
|
in_segs *segment_data, // see ext_appl_inout.h
|
|
int number_of_arcs,
|
|
in_arcs *arc_data, // see ext_appl_inout.h
|
|
vr_bool *new_input);
|
|
|
|
void API_ComputeVD( vr_bool save_data, // save input data to file?
|
|
vr_bool new_data, // first call for this data?
|
|
vr_bool time, // do you want to time the computation?
|
|
int bound, // scale factor for bounding box; default value: 3
|
|
int sample, // sampling factor for sampling segs/arcs; default: 0; see SampleData() in approx.cc
|
|
int approx, // approximation factor for circular arcs; default: 0; see ApproxArcsHeuristic() in approx.cc. obsolet by now!
|
|
char output_file[], // name of the output file; irrelevant if save_data is false
|
|
vr_bool discard_duplicate_sites, //d shall the code check prior to the computation whether duplicate segs/arcs have been input? default: false.
|
|
vr_bool pnts_only, // compute VD/DT of points only
|
|
vr_bool write_vd_dt, // output point VD/DT
|
|
char vd_dt_file[], // output file for point VD/DT
|
|
vr_bool clean_up); // shall we clean up the data prior to the VD computation?
|
|
|
|
void API_ComputeOff( vr_bool time, // do you want to time the computation?
|
|
char off_file[], // name of the file that will contain the offsets computed
|
|
vr_bool write_off, // shall we output the offsets to off_file[]?
|
|
vr_bool dxf_format, // if offsets are to be output: shall we use DXF format?
|
|
double t_offset, // compute offset curve(s) for offset distance t_offset
|
|
double d_offset, // incremental step-over distance for further offset curves
|
|
vr_bool auto_offset, // shall we use my heuristic for finding offset distances that create a family of offsets?
|
|
vr_bool left_offset, // true if offsets are to be computed only on the left side of input segments
|
|
vr_bool right_offset); // true if offsets are to be computed only on the right side of input segments
|
|
|
|
|
|
void API_ComputeWMAT( vr_bool auto_wmat, // shall we use my heuristic for finding nice WMAT thresholds?
|
|
double wmat_angle, // angle threshold for WMAT computation;in radians, out of the interval [0, pi]
|
|
double wmat_dist, // distance threshold for WMAT computation
|
|
vr_bool time, // do you want to time the computation?
|
|
vr_bool left_wmat, // true if WMAT is to be computed only on the left side of input segments
|
|
vr_bool right_wmat); // true if WMAT is to be computed only on the right side of input segments
|
|
|
|
|
|
#ifdef WRITE_VD
|
|
void API_Output_VD( char vd_file[], // name of the file that will contain the VD polygons
|
|
double vd_apx_dist, // sampling distance used for approximating conic VD edges
|
|
vr_bool left_vd, // true if VD is to be output only on the left side of input segments
|
|
vr_bool right_vd); // true if VD is to be output on the right side of input segments
|
|
#endif
|
|
|
|
void API_ComputeOutputMIC( vr_bool time, // do you want to time the computation?
|
|
vr_bool left_mic, // true if MIC is to be computed only on the left side of input segments
|
|
vr_bool right_mic, // true if MIC is to be computed only on the right side of input segments
|
|
coord *center, // x,y-coordinates of a MIC center
|
|
double *radius); // radius of a MIC circle
|
|
|
|
void API_OutputMA(char vdma_file[]) ;
|
|
|
|
// discard all offsets computed so far
|
|
void API_ResetOffsetData(void);
|
|
|
|
// VRONI exception handling
|
|
void API_HandleError(void);
|
|
|
|
const char* API_GetProgName();
|
|
const char* API_GetProgVersion();
|
|
const char* API_GetProgYear();
|