src/coord.c File Reference

Implement coordination tranform mechanism.

This file implements coordination transforming for containers. More...

#include <stdio.h>
#include <string.h>
#include <math.h>
#include "mb_types.h"

Go to the source code of this file.

Defines

#define ASSERT(x)
#define MUL(a, b)   ((a) * (b))
#define ADD(a, b)   ((a) + (b))
#define DIV(a, b)   ((a) / (b))
#define SUB(a, b)   ((a) - (b))

Functions

static void mul_matrix (co_aix *m1, co_aix *m2, co_aix *dst)
static void compute_transform_function (coord_t *visit)
 Compute agrregated transform function.
void compute_aggr_of_coord (coord_t *coord)
void update_aggr_matrix (coord_t *start)
 Update aggregate matrices of elements under a sub-tree.
void coord_init (coord_t *co, coord_t *parent)
 Initialize a coord object.
void coord_trans_pos (coord_t *co, co_aix *x, co_aix *y)
co_aix coord_trans_size (coord_t *co, co_aix sz)
coord_tpreorder_coord_subtree (coord_t *root, coord_t *last)
coord_tpostorder_coord_subtree (coord_t *root, coord_t *last)


Detailed Description

Implement coordination tranform mechanism.

This file implements coordination transforming for containers.

Definition in file coord.c.


Define Documentation

#define ADD ( a,
 )     ((a) + (b))

Definition at line 15 of file coord.c.

#define ASSERT (  ) 

Definition at line 11 of file coord.c.

#define DIV ( a,
 )     ((a) / (b))

Definition at line 16 of file coord.c.

#define MUL ( a,
 )     ((a) * (b))

Definition at line 14 of file coord.c.

#define SUB ( a,
 )     ((a) - (b))

Definition at line 17 of file coord.c.


Function Documentation

void compute_aggr_of_coord ( coord_t coord  ) 

Definition at line 41 of file coord.c.

static void compute_transform_function ( coord_t visit  )  [static]

Compute agrregated transform function.

Base on parent's aggregated matrix if it is existed, or use transform matrix as aggregated matrix.

Definition at line 33 of file coord.c.

void coord_init ( coord_t co,
coord_t parent 
)

Initialize a coord object.

The object is cleared and matrix was initialized to ID. The object is be a children of specified parent.

Definition at line 86 of file coord.c.

void coord_trans_pos ( coord_t co,
co_aix x,
co_aix y 
)

Definition at line 101 of file coord.c.

co_aix coord_trans_size ( coord_t co,
co_aix  sz 
)

Definition at line 114 of file coord.c.

static void mul_matrix ( co_aix m1,
co_aix m2,
co_aix dst 
) [static]

Definition at line 19 of file coord.c.

coord_t* postorder_coord_subtree ( coord_t root,
coord_t last 
)

Definition at line 154 of file coord.c.

coord_t* preorder_coord_subtree ( coord_t root,
coord_t last 
)

Note:
Coords, marked with COF_SKIP_TRIVAL (for temporary), and descendants of them will not be trivaled and the flag with be removed after skipping them.

Definition at line 128 of file coord.c.

void update_aggr_matrix ( coord_t start  ) 

Update aggregate matrices of elements under a sub-tree.

A subtree is specified by the root of it. All elements in the subtree are effected by that changes of matrix of the subtree root.

Definition at line 50 of file coord.c.

SourceForge.net Logo