- aggiornamento Vroni a 7.7.
This commit is contained in:
SaraP
2024-07-12 11:47:56 +02:00
parent 467692a363
commit 34454e573f
13 changed files with 174 additions and 23 deletions
+4 -2
View File
@@ -26,8 +26,8 @@
#include "mydefs.h"
#define PROG_NAME "V R O N I"
#define PROG_VERSION "7.6"
#define PROG_YEAR "1999-2023"
#define PROG_VERSION "7.7"
#define PROG_YEAR "1999-2024"
/* */
/* get the definitions for "exterior applications" */
@@ -67,6 +67,8 @@
#define SiteCurrColor VroniBlue
#define DTColor VroniWhite
#define OffColor VroniWhite
#define PathColor VroniMagenta
#define WMATColor VroniBlue
#define TOOLColor VroniWhite
#endif
-1
View File
@@ -1 +0,0 @@
+2 -1
View File
@@ -25,7 +25,6 @@
#include "defs.h"
#include <utility>
#include <tuple>
/* */
/* the following data types are used for user-defined entities that are to */
@@ -45,6 +44,7 @@ typedef int ean_type; /* ext. appl. hook for node */
typedef int eae_type; /* ext. appl. hook for edge */
typedef int eam_type; /* ext. appl. hook for wmat */
typedef int eao_type; /* ext. appl. hook for off_data */
typedef int eah_type; /* ext. appl. hook for path_data */
/*
* sample user-specific eap data:
@@ -61,6 +61,7 @@ extern const ean_type ean_NIL;
extern const eam_type eam_NIL;
extern const eao_type eao_NIL;
extern const eae_type eae_NIL;
extern const eah_type eah_NIL;
#define ExtApplFuncNewInput
+6 -6
View File
@@ -62,21 +62,21 @@ inline coord vroniObject::Centroid(coord pi, coord pj, coord pk)
/** Build linar combination of vectors p and r by parameter t */
inline coord vroniObject::LinearComb(const coord & p, const coord & r,
double_arg t)
double_arg t_param)
{
coord q;
q.x = p.x + t*(r.x-p.x);
q.y = p.y + t*(r.y-p.y);
q.x = p.x + t_param*(r.x-p.x);
q.y = p.y + t_param*(r.y-p.y);
return q;
}
/** Get the point q = p + t*v */
inline coord vroniObject::RayPnt(const coord & p, const coord & v,
double_arg t)
double_arg t_param)
{
coord q;
q.x = p.x + t*v.x;
q.y = p.y + t*v.y;
q.x = p.x + t_param*v.x;
q.y = p.y + t_param*v.y;
return q;
}
+22 -7
View File
@@ -37,19 +37,26 @@
#define LAYER1 "voronoi"
#define LAYER2 "MAT"
#define LAYER3 "delaunay"
#ifdef HSM
#define LAYER4 "path"
#else
#define LAYER4 "offset"
#endif
#define LAYER5 "MIC"
#define LAYER6 "bd_vertices"
#define LAYER7 "vd_nodes"
#define LAYER8 "tool"
#define COLOR0 "seagreen"
#define COLOR1 "red"
#define COLOR2 "black"
#define COLOR3 "blue"
#define COLOR4 "lightgray"
#define COLOR4 "purple"
//#define COLOR4 "lightgray"
#define COLOR5 "yellow"
#define COLOR6 "black"
#define COLOR7 "violet"
#define COLOR8 "brown"
#define PEN0 "ultrafat"
#define PEN1 "normal"
@@ -59,11 +66,13 @@
#define PEN5 "normal"
#define PEN6 "normal"
#define PEN7 "normal"
#define PEN8 "normal"
FILE *InitIpeFile(char *filename);
FILE *InitIpe(char *filename, double_arg xl, double_arg xr, double_arg yl, double_arg yr);
FILE *InitIpe(char *filename, double_arg xl, double_arg xr,
double_arg yl, double_arg yr);
void CloseIpeFile(FILE *ipe_file);
@@ -82,14 +91,18 @@ void WriteArcCW(FILE *ipe_file, double_arg xc, double_arg yc, double_arg r,
void WriteMark(FILE *ipe_file, int type, int size, double_arg x, double_arg y);
void SetIpeDimensions(double_arg xmin, double_arg xmax, double_arg ymin, double_arg ymax);
void SetIpeDimensions(double_arg xmin, double_arg xmax,
double_arg ymin, double_arg ymax);
void SetWorldDimensions(double_arg xmin, double_arg xmax, double_arg ymin, double_arg ymax);
void SetWorldDimensions(double_arg xmin, double_arg xmax,
double_arg ymin, double_arg ymax);
void SetScaleFactor(void);
void InitIpeDimensions(double_arg xmin, double_arg ymin, double_arg xmax, double_arg ymax,
double_arg ixmin, double_arg iymin, double_arg ixmax, double_arg iymax);
void InitIpeDimensions(double_arg xmin, double_arg ymin,
double_arg xmax, double_arg ymax,
double_arg ixmin, double_arg iymin,
double_arg ixmax, double_arg iymax);
double scaleX(double x);
double scaleY(double y);
@@ -98,7 +111,9 @@ void WriteLineSegment(FILE *ipe_file,
double x1, double y1, double x2, double y2);
void WriteCircularArc(FILE *ipe_file, double_arg xc, double_arg yc,
double_arg x1, double_arg y1, double_arg x2, double_arg y2, vr_bool ccw);
double_arg x1, double_arg y1, double_arg x2, double_arg y2,
vr_bool ccw);
void WriteCircle(FILE *ipe_file, double_arg xc, double_arg yc, double_arg rad);
#endif
+19
View File
@@ -0,0 +1,19 @@
#ifndef VRONI_PATH_H
#define VRONI_PATH_H
#include "coord.h"
#include "vddata.h"
struct pth_data {
t_site type; /* type of path element: SEG, CCW, or CW. */
coord start; /* coordinates of start point of element */
coord center; /* coordinates of center (if CW/CCW arc) */
#ifdef EXT_APPL_OFF
eah_type ext_appl;
#endif
//Ensure construction doesn't implicitly initialize elements - done explicitly later anyway
inline pth_data() {}
}; /* data for one path element */
#endif
+4 -2
View File
@@ -273,8 +273,10 @@ inline static double CubicRoot(double_arg x)
/* */
/* some macros for epsilon-based comparisons with respect to zero... */
/* */
/* some macros for epsilon-based comparisons with respect to zero. */
/* we assumed zero to be replaced by the interval [-b,b], for some small */
/* value b, and the comparisons are carried out accordingly. */
/* */
#define lt(a, b) ( ((a) < -b) )
#define ge(a, b) (! ((a) < -b) )
#define le(a, b) ( ((a) <= b) )
+117 -4
View File
@@ -56,6 +56,7 @@
#include "ext_appl_inout.h"
#include "defs.h"
#include "offset.h"
#include "path.h"
#include "util.h"
/* */
@@ -394,8 +395,36 @@ public:
int num_offset_loops,
int num_offset_segs,
int num_offset_arcs));
void apiResetPathData(void); /* discard path computed so far */
void apiOutputPath(void *output, /* this is a pointer to a */
/* user-defined object, such as */
/* a file or a structure; */
void (vroniObject::*StartPathFuncPtr)(
void *output,
int num_path_ele),
void (vroniObject::*WritePathSegFuncPtr)(
void *output,
#ifdef EXT_APPL_PATH
eah_type ext_appl_path,
#endif
double_arg x1, double_arg y1,
double_arg x2, double_arg y2),
void (vroniObject::*WritePathArcFuncPtr)(
void *output,
#ifdef EXT_APPL_PATH
eah_type ext_appl_path,
#endif
double_arg x1, double_arg y1,
double_arg x2, double_arg y2,
double_arg xc, double_arg yc,
vr_bool ccw),
void (vroniObject::*EndPathFuncPtr)(
void *output));
//
// INPUT GEOMETRY
//
@@ -991,6 +1020,7 @@ public:
vr_bool computed;
vr_bool wmat_computed;
vr_bool mic_computed;
vr_bool path_computed;
vr_bool vd_output;
vr_bool first_input;
int first_pnt;
@@ -1082,6 +1112,17 @@ public:
vronivector<cir_buffer> cir_buf;
int num_cir_buf, max_num_cir_buf;
struct dsk_buffer
{
coord cntr; /* center of a circle */
double radius; /* radius of a circle */
//Ensure construction doesn't implicitly initialize elements - done explicitly later anyway
inline dsk_buffer() {}
};
vronivector<dsk_buffer> dsk_buf;
int num_dsk_buf, max_num_dsk_buf;
#endif
/* api_functions.cc */
@@ -1096,6 +1137,7 @@ public:
vr_bool draw_dte;
vr_bool draw_mat;
vr_bool draw_mic;
vr_bool draw_tool;
#endif
/* data_off.cc */
@@ -1355,6 +1397,7 @@ public:
void AddEdgeToBuffer(double_arg x1, double_arg y1,
double_arg x2, double_arg y2, int color, double dPar1, double dPar2);
void AddCirToBuffer(coord cntr, double_arg radius);
void AddDskToBuffer(coord cntr, double_arg radius);
void WriteIpeOutput(char *filename);
void AddOffToBuffer(double_arg x1, double_arg y1,
double_arg x2, double_arg y2,
@@ -1386,8 +1429,6 @@ public:
/* driver.cc: */
void HandleWriteVDOutput(void);
void ParseCommandLineArgs(int argc, char *argv[], vr_bool *graphics,
vr_bool *color_graphics, vr_bool *full_screen);
@@ -1596,7 +1637,10 @@ public:
vr_bool *write_vd, char *vd_file, double *vd_apx_dist,
vr_bool *left_vd, vr_bool *right_vd,
vr_bool *vr_incr, char *vr_file,
int *inputprec, int *mpfr_prec, int *vr_seed);
int *inputprec, int *mpfr_prec, int *vr_seed,
vr_bool *compute_path, double *radius, double *angle,
double *step_over,
vr_bool *write_path, char *path_file);
void EvalError(void);
@@ -1808,6 +1852,12 @@ public:
void UpdateRecursive(int i, t_site t, int n, int e,
int *el, int *er, int *nl, int *nr);
void InsertBisectorClose(int i, t_site t, int e, int k,
int e1r, int e2l, int n1r, int n2l);
void InsertReplacement(int i, t_site t, int n, int e, int k,
int* el, int* er, int* nl, int* nr);
void ResetTreeDeleteStatus(int e, int n);
void InsertApexDegreeTwoNodeSeg(int e, int i, int i1, t_site t1);
@@ -2430,6 +2480,7 @@ public:
vr_bool pnts_deleted;
vr_bool desperate;
double cpu_time_path;
double cpu_time_pre;
double cpu_time_pnt;
double cpu_time_seg;
@@ -3072,6 +3123,68 @@ public:
double_arg y_max, int root);
#endif
/* hsm/path.cc */
vronivector<pth_data> path_data;
int num_path_data;
int max_num_path_data;
vr_bool compute_path;
double tool_rad;
double step_over;
double angle;
vr_bool write_path;
char path_file[256];
int path_VD_ID;
int GetNumPathData(void);
void StorePathData(coord start, coord center, t_site type,
double_arg tool_rad);
void FreePathData(void);
void ResetPathData(void);
coord GetPathPntCoords(int i);
coord GetPathCntrCoords(int i);
t_site GetPathEleType(int i);
void ComputePath(vr_bool time, char path_file[],
vr_bool write_path, vr_bool dxf_format,
double_arg tool_rad, double_arg step_over,
double_arg angle_);
#ifdef GRAPHICS
void StartPathBuf(void*, int);
void WritePathSegBuf(void*,
#ifdef EXT_APPL_PATH
eah_type ext_appl_path,
#endif
double_arg x1, double_arg y1,
double_arg x2, double_arg y2);
void WritePathArcBuf(void*,
#ifdef EXT_APPL_PATH
eah_type ext_appl_path,
#endif
double_arg x1, double_arg y1,
double_arg x2, double_arg y2,
double_arg xc, double_arg yc, vr_bool ccw);
void EndPathBuf(void*);
void AddPathToBuffer(void);
#endif
void StartPathDXF(void *output, int );
void EndPathDXF(void *output);
void WritePathDXF(char pth_file[]);
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.