From cca66b9ec4e494c1d919bff0f71a820d8afab1fa Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:24:48 +0200 Subject: Adding upstream version 1.2.2. Signed-off-by: Daniel Baumann --- src/livarot/ShapeDraw.cpp | 114 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 src/livarot/ShapeDraw.cpp (limited to 'src/livarot/ShapeDraw.cpp') diff --git a/src/livarot/ShapeDraw.cpp b/src/livarot/ShapeDraw.cpp new file mode 100644 index 0000000..79d070b --- /dev/null +++ b/src/livarot/ShapeDraw.cpp @@ -0,0 +1,114 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/** @file + * TODO: insert short description here + *//* + * Authors: see git history + * + * Copyright (C) 2018 Authors + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ +/* + * ShapeDraw.cpp + * nlivarot + * + * Created by fred on Mon Jun 16 2003. + * + */ + +#include +#include +#include +#include "Shape.h" +//#include + +// debug routine for vizualizing the polygons +void +Shape::Plot (double ix, double iy, double ir, double mx, double my, bool doPoint, + bool edgesNo, bool pointsNo, bool doDir,char* fileName) +{ + FILE* outFile=fopen(fileName,"w+"); +// fprintf(outFile,"\n\n\n"); + fprintf(outFile,"\n"); + fprintf(outFile,"\n"); + fprintf(outFile,"\n"); + fprintf(outFile," \n"); + fprintf(outFile," \n"); + + if ( doPoint ) { + for (int i=0;i\n",ph,pv); // localizing ok + } + } + if ( pointsNo ) { + for (int i=0;i\n",ph-2,pv+1); // localizing ok + fprintf(outFile,"%i\n",i); + fprintf(outFile," \n"); + } + } + { + for (int i=0;i\n",sh,sv,endh,endv); // localizing ok + } else { + fprintf(outFile," \n",sh,sv,eh,ev); // localizing ok + } + } + } + if ( edgesNo ) { + for (int i=0;i\n",(sh+eh)/2+2,(sv+ev)/2); // localizing ok + fprintf(outFile,"%i\n",i); + fprintf(outFile," \n"); + } + } + + fprintf(outFile,"\n"); + fclose(outFile); + +} -- cgit v1.2.3