Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ff18925f authored by BOUCHERIE Raphael's avatar BOUCHERIE Raphael
Browse files

Updated makefille for treedraw test, finalyzed drawing of TS tile

parent 0ab6a673
Branches
No related tags found
1 merge request!4Treewalk
...@@ -3,15 +3,16 @@ CFLAGS = -Iinclude -Wall -g3 ...@@ -3,15 +3,16 @@ CFLAGS = -Iinclude -Wall -g3
LDFLAGS = -lm LDFLAGS = -lm
LIBHQR=src/libhqr.a LIBHQR=src/libhqr.a
default: testing_pivgen testing_treewalk default: testing_pivgen testing_treewalk testing_treedraw
src/queue.o: include/queue.h include/common.h src/queue.o: include/queue.h include/common.h
src/libhqr.o: include/common.h include/libhqr.h src/libhqr.o: include/common.h include/libhqr.h
src/libhqr_dbg.o: include/common.h include/libhqr.h src/libhqr_dbg.o: include/common.h include/libhqr.h
src/libhqr_systolic.o: include/common.h include/libhqr.h src/libhqr_systolic.o: include/common.h include/libhqr.h
src/treewalk.o: include/common.h include/libhqr.h include/queue.h src/treewalk.o: include/common.h include/libhqr.h include/queue.h
src/treedraw.o: include/common.h include/libhqr.h include/libdraw.h
$(LIBHQR): src/libhqr.o src/libhqr_dbg.o src/libhqr_systolic.o src/treewalk.o src/queue.o $(LIBHQR): src/libhqr.o src/libhqr_dbg.o src/libhqr_systolic.o src/treewalk.o src/queue.o src/treedraw.o
ar cr $@ $^ ar cr $@ $^
%.o : %.c %.o : %.c
...@@ -23,6 +24,9 @@ testing_pivgen : testings/testing_pivgen.o ${LIBHQR} ...@@ -23,6 +24,9 @@ testing_pivgen : testings/testing_pivgen.o ${LIBHQR}
testing_treewalk : testings/testing_treewalk.c ${LIBHQR} testing_treewalk : testings/testing_treewalk.c ${LIBHQR}
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
testing_treedraw : testings/testing_treedraw.o ${LIBHQR}
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
clean : clean :
rm -f include/*~ rm -f include/*~
rm -f src/*.o src/*~ rm -f src/*.o src/*~
...@@ -30,4 +34,4 @@ clean : ...@@ -30,4 +34,4 @@ clean :
cleanall: clean cleanall: clean
rm -f ${LIBHQR} rm -f ${LIBHQR}
rm -f testing_pivgen testing_treewalk rm -f testing_pivgen testing_treewalk testing_treedraw tree.svg
/** /**
* *
* @file libdraw.h - header for all the functions of drawing. * @file libdraw.h
* *
* PaStiX symbol structure routines * Header file for all the functions of drawing.
* *
* @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, * @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved. * Univ. Bordeaux. All rights reserved.
...@@ -18,15 +18,7 @@ ...@@ -18,15 +18,7 @@
#ifndef _LIBDRAW_H_ #ifndef _LIBDRAW_H_
#define _LIBDRAW_H_ #define _LIBDRAW_H_
#undef BEGIN_C_DECLS #include <common.h>
#undef END_C_DECLS
#if defined(c_plusplus) || defined(__cplusplus)
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
#else
#define BEGIN_C_DECLS /* empty */
#define END_C_DECLS /* empty */
#endif
BEGIN_C_DECLS BEGIN_C_DECLS
......
/** /**
* *
* @file treedraw.c - All the functions required for drawing tree are here. * @file treedraw.c
* TT and TS tiles are drawn in rectangle. *
* * All the functions required for drawing tree are here.
* *
* PaStiX symbol structure routines * @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* * Univ. Bordeaux. All rights reserved.
* @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, *
* Univ. Bordeaux. All rights reserved. * @version 1.0.0
* * @author Raphael Boucherie
* @version 1.0.0 * @author Mathieu Faverge
* @author Raphael Boucherie * @date 2017-04-04
* @author Mathieu Faverge *
* @date 2017-04-04 */
*
**/
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include "libdraw.h" #include "libdraw.h"
/*
* functions writing in the svg file
*/
void libhqr_writeheader(FILE *tree){ void libhqr_writeheader(FILE *tree){
if(fprintf(tree, "<?xml version=\"1.0\" standalone=\"no\"?>\n") < 0) return; if(fprintf(tree, "<?xml version=\"1.0\" standalone=\"no\"?>\n") < 0) return;
if(fprintf(tree, "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n ") < 0) return; if(fprintf(tree, "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n ") < 0) return;
if(fprintf(tree, "<svg width=\"2000\" height=\"2000\" version=\"1.1\" \n xmlns=\"http://www.w3.org/2000/svg\">\n") <0) return; if(fprintf(tree, "<svg width=\"2000\" height=\"2000\" version=\"1.1\" \n xmlns=\"http://www.w3.org/2000/svg\">\n") <0) return;
} }
void libhqr_writecss(); void libhqr_writecss();
void libhqr_drawTT(int x, int y, int k, FILE *tree){ void libhqr_drawTT(int x, int y, int k, FILE *tree){
if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"50\" height=\"50\" fill=\"red\" /> \n", x, y) < 0 ) return; if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"50\" height=\"50\" fill=\"red\" /> \n", x, y) < 0 ) return;
} }
void libhqr_drawTS(int x, int y, FILE *tree){ void libhqr_drawTS(int x, int y, FILE *tree){
if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"50\" height=\"50\" /> \n", x, y) < 0 ) return; if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"50\" height=\"50\" fill =\"red\" /> \n", x, y) < 0 ) return;
int x2 = (x * 4)/3;
int y2 = (y * 4)/3;
if(fprintf(tree,"<rect x=\"%d\" y=\"%d\" width=\"25\" height=\"25\" fill =\"white\"/> \n", x2, y2) < 0 ) return;
} }
void libhqr_drawline(int x1, int y1, int x2, int y2, FILE *tree){ void libhqr_drawline(int x1, int y1, int x2, int y2, FILE *tree){
if(fprintf(tree,"<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" /> \n", x1, y1, x2, y2) < 0 ) return; if(fprintf(tree,"<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" /> \n", x1, y1, x2, y2) < 0 ) return;
} }
void libhqr_writeend(FILE *tree){ void libhqr_writeend(FILE *tree){
if(fprintf(tree, "</svg>") < 0) return; if(fprintf(tree, "</svg>") < 0) return;
} }
/** /**
* *
* @file testting_treedraw.c - Testing file for drawing functions and drawing tree * @file testting_treedraw.c
* *
* PaStiX symbol structure routines * Testing file for drawing functions and drawing tree
* *
* @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, * @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved. * Univ. Bordeaux. All rights reserved.
* *
* @version 1.0.0 * @version 1.0.0
* @author Raphael Boucherie * @author Raphael Boucherie
* @author Mathieu Faverge * @author Mathieu Faverge
* @date 2017-04-04 * @date 2017-04-04
* *
**/ */
#include <stdio.h> #include <stdio.h>
...@@ -21,12 +21,12 @@ ...@@ -21,12 +21,12 @@
int main(int argc, char ** argv) int
main(int argc, char ** argv)
{ {
FILE *tree = fopen("tree.svg","w+"); FILE *tree = fopen("tree.svg","w+");
libhqr_writeheader(tree); libhqr_writeheader(tree);
libhqr_drawTT(50,50,1,tree); libhqr_drawTS(30,30,tree);
libhqr_drawTS(40,40,tree);
libhqr_drawline(50,50,40,40,tree);
libhqr_writeend(tree); libhqr_writeend(tree);
return 1;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment