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
No related branches found
No related tags found
1 merge request!4Treewalk
......@@ -3,15 +3,16 @@ CFLAGS = -Iinclude -Wall -g3
LDFLAGS = -lm
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/libhqr.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/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 $@ $^
%.o : %.c
......@@ -23,6 +24,9 @@ testing_pivgen : testings/testing_pivgen.o ${LIBHQR}
testing_treewalk : testings/testing_treewalk.c ${LIBHQR}
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
testing_treedraw : testings/testing_treedraw.o ${LIBHQR}
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
clean :
rm -f include/*~
rm -f src/*.o src/*~
......@@ -30,4 +34,4 @@ clean :
cleanall: clean
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,
* Univ. Bordeaux. All rights reserved.
......@@ -18,15 +18,7 @@
#ifndef _LIBDRAW_H_
#define _LIBDRAW_H_
#undef BEGIN_C_DECLS
#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
#include <common.h>
BEGIN_C_DECLS
......
/**
*
* @file treedraw.c - All the functions required for drawing tree are here.
* TT and TS tiles are drawn in rectangle.
*
*
* PaStiX symbol structure routines
*
* @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
* @author Raphael Boucherie
* @author Mathieu Faverge
* @date 2017-04-04
*
**/
*
* @file treedraw.c
*
* All the functions required for drawing tree are here.
*
* @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
* @author Raphael Boucherie
* @author Mathieu Faverge
* @date 2017-04-04
*
*/
#include <string.h>
#include <stdio.h>
#include "libdraw.h"
/*
* functions writing in the svg file
*/
void libhqr_writeheader(FILE *tree){
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, "<svg width=\"2000\" height=\"2000\" version=\"1.1\" \n xmlns=\"http://www.w3.org/2000/svg\">\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, "<svg width=\"2000\" height=\"2000\" version=\"1.1\" \n xmlns=\"http://www.w3.org/2000/svg\">\n") <0) return;
}
void libhqr_writecss();
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){
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){
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){
if(fprintf(tree, "</svg>") < 0) return;
if(fprintf(tree, "</svg>") < 0) return;
}
/**
*
* @file testting_treedraw.c - Testing file for drawing functions and drawing tree
*
* PaStiX symbol structure routines
*
* @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
* @author Raphael Boucherie
* @author Mathieu Faverge
* @date 2017-04-04
*
**/
*
* @file testting_treedraw.c
*
* Testing file for drawing functions and drawing tree
*
* @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
* @author Raphael Boucherie
* @author Mathieu Faverge
* @date 2017-04-04
*
*/
#include <stdio.h>
......@@ -21,12 +21,12 @@
int main(int argc, char ** argv)
int
main(int argc, char ** argv)
{
FILE *tree = fopen("tree.svg","w+");
libhqr_writeheader(tree);
libhqr_drawTT(50,50,1,tree);
libhqr_drawTS(40,40,tree);
libhqr_drawline(50,50,40,40,tree);
libhqr_drawTS(30,30,tree);
libhqr_writeend(tree);
return 1;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment