Mentions légales du service

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

Updated testing file for drawing the tree

parent 23cf009b
No related branches found
No related tags found
1 merge request!5Print tree
......@@ -82,9 +82,9 @@ typedef enum libhqr_typefacto_ {
* @brief Structure for stocking informations in order to draw the tree
*/
typedef struct libhqr_treedraw_s{
int k; /**<The factorization step for the color*/
int *tiles; /**<Table for tiles*/
int tiles_size; /**<Size of the table*/
int k; /**< The factorization step for the color */
int *tiles; /**< Table for tiles */
int tiles_size; /**< Size of the table */
} libhqr_treedraw_t;
/**
......
......@@ -17,7 +17,9 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "libdraw.h"
#include "libhqr.h"
#define WIDTH 50
#define HEIGHT 50
......@@ -25,17 +27,22 @@
int
main(int argc, char ** argv)
{
FILE *tree = fopen("tree.svg","w+");
int x,y,i,j;
libhqr_writeheader(tree);
libhqr_drawline(125,100,125,800,tree);
for (i = 1; i < 5; i++){
for (j = 1; j < 9; j++){
x = 100*i;
y = 100*j;
libhqr_drawTS(x,y,WIDTH,HEIGHT,3,tree);
}
}
libhqr_writeend(tree);
return 1;
libhqr_tree_t qrtree;
libhqr_tiledesc_t matrix;
int minMN;
libhqr_treedraw_t drawing;
matrix.nodes = 1;
matrix.p = 1;
matrix.mt = 8;
matrix.nt = 4;
libhqr_hqr_init( &qrtree, LIBHQR_QR, &matrix, LIBHQR_BINARY_TREE, LIBHQR_FLAT_TREE, 1, 1, 0, 0);
minMN = libhqr_imin(matrix.mt, matrix.nt );
drawing.tiles = (int*)malloc(minMN*sizeof(int));
drawing.tiles_size = minMN;
FILE *tree = fopen("tree.svg","w+");
libhqr_writeheader(tree);
libhqr_treewalk(&qrtree, 0);
libhqr_writeend(tree);
free(drawing.tiles);
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