/* 
* 
* Copyright (C) 2013 UMPC
* 
* This file is part of CLaRiNet.
*  
* CLaRiNet is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* 
* CLaRiNet is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with CLaRiNet.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GEOMORPH_H
#define GEOMORPH_H

typedef struct {

        int ncols;
	int nrows;
	double cellsize;
	double xll;
	double yll;
	float NODATA_value;
	int LL;				/* entier codant la convention : coin (0) ou centre (1) du pixel LL */ 
	
} esriheader ;

/* FloatRaster : carte de valeurs réelles */

typedef struct {

        char Nom[120];
	float ** Data;
	esriheader Header;

} FloatRaster ;

/* FlowDirGrid : grille de directions d'écoulement */

typedef struct {

        char Nom[120];
	unsigned char ** Data;
	esriheader Header;
        unsigned char Compass[3][3];    /* Tableau des codes de directions d'écoulement, statique */

} FlowDirGrid ;

/* CellTree */

typedef struct CellTree {

    // Attributs :

    int RootCell;
    float Size;
    
    // Topologie :

    struct CellTree * NextSibling;    // Pointer towards next sibling (i.e., tree having the same downstream pixel)
    struct CellTree * FirstChild;      // Pointer towards first child (i.e., largest upstream tree)
    
//    struct CellTree * Parent; // Redundant : pointer towards (unique) downstream cell

} CellTree ;

#endif
