From 6f54f4bbef833c2fd13808f69321066ed4c59fb6 Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Tue, 27 Oct 2009 13:41:13 +0100 Subject: [PATCH] [ADG] Added AdgLocalMode A new enumeration to specify how the local matrix may be computed. The different options provided allow a good customization level on the local computation and using a dedicated type will avoid before / after problems introduced by using the more general AdgTransformMode. --- adg/adg-enums.c | 43 +++++++++++++++++++++++++++++++++---------- adg/adg-enums.h | 8 ++++++++ 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/adg/adg-enums.c b/adg/adg-enums.c index 3da58b5d..97ab2721 100644 --- a/adg/adg-enums.c +++ b/adg/adg-enums.c @@ -42,19 +42,42 @@ /** * AdgTransformMode: - * @ADG_TRANSFORM_NONE: do not apply any transformation - * @ADG_TRANSFORM_BEFORE: apply the transformation before the matrix using - * cairo_matrix_multiply(matrix, matrix, transformation) - * @ADG_TRANSFORM_AFTER: apply the transformation after the matrix using - * cairo_matrix_multiply(matrix, transformation, matrix) + * @ADG_TRANSFORM_NONE: do not apply any transformation: the + * matrix is returned unchanged + * @ADG_TRANSFORM_BEFORE: apply the transformation before the + * matrix: the result is equivalent to + * cairo_matrix_multiply(matrix, matrix, transformation) + * @ADG_TRANSFORM_AFTER: apply the transformation after the + * matrix: the result is equivalent to + * cairo_matrix_multiply(matrix, transformation, matrix) * @ADG_TRANSFORM_BEFORE_NORMALIZED: same as %ADG_TRANSFORM_BEFORE but * normalizing the transformation with * adg_matrix_normalize() before applying it - * @ADG_TRANSFORM_AFTER_NORMALIZED: same as %ADG_TRANSFORM_AFTER but - * normalizing the transformation with - * adg_matrix_normalize() before applying it + * @ADG_TRANSFORM_AFTER_NORMALIZED: same as %ADG_TRANSFORM_AFTER but + * normalizing the transformation with + * adg_matrix_normalize() before applying it * * Specifies the mode a generic transformation should be applied on - * a subject matrix. Although used in different places, the function - * performing the dirty work is always adg_matrix_transform(). + * a matrix. Although used in different places, the function performing + * the dirty work is always adg_matrix_transform(). + **/ + +/** + * AdgLocalMode: + * @ADG_LOCAL_NONE: local transformations are completely ignored: a + * local matrix request will always return an + * identity matrix + * @ADG_LOCAL_REGULAR: combine all the local maps of the parent hierarchy + * in the same way the global matrix is computed + * @ADG_LOCAL_NORMALIZED: work in the same way as %ADG_LOCAL_REGULAR, + * but the result is normalized with + * adg_matrix_normalize() before being returned + * @ADG_LOCAL_MAP: the local matrix is the local map + * @ADG_LOCAL_FROM_PARENT: apply the local map above the parent local map, + * ignoring any other ancestors in the hierarchy: + * if the entity has no parent, it returns the + * local map as in %ADG_LOCAL_MAP + * + * Specifies how the local matrix, as returned by adg_entity_local_matrix(), + * should be computed. **/ diff --git a/adg/adg-enums.h b/adg/adg-enums.h index e3a784bc..2cbd0f5f 100644 --- a/adg/adg-enums.h +++ b/adg/adg-enums.h @@ -40,6 +40,14 @@ typedef enum { ADG_TRANSFORM_AFTER_NORMALIZED } AdgTransformMode; +typedef enum { + ADG_LOCAL_NONE, + ADG_LOCAL_REGULAR, + ADG_LOCAL_NORMALIZED, + ADG_LOCAL_MAP, + ADG_LOCAL_FROM_PARENT +} AdgLocalMode; + G_END_DECLS -- 2.11.4.GIT