ADG 

ADG Commit Details

Date:2011-03-18 02:08:14 (2 years 2 months ago)
Author:Nicola Fontana
Branch:master
Commit:9c953962b1d949b9161da1f1130f472ff36b5431
Parents: 5e114e0abea33cac6626c311461d1975e41add6c
Message:[AdgRDim] Added extents computation

Resolved TODO complaining about missing extents computation and changed
the TODO requesting outside radial dimensions on an XXX referring to the
proper issue on InDefero.
Changes:
Msrc/adg/adg-rdim.c (2 diffs)

File differences

src/adg/adg-rdim.c
343343
344344
345345
346
346347
347
348
348349
349350
351
350352
351
353
352354
353355
354356
355357
356358
357359
360
358361
359362
360363
361364
362365
363366
367
364368
365
366369
367370
368371
369372
370
371373
372374
373375
374376
377
378
375379
380
381
376382
377383
378384
......
391397
392398
393399
394
400
395401
396402
397403
398404
399
400
405
401406
402
403407
404408
405
406
407
408409
409410
411
410412
411413
412414
415
416
413417
414418
415419
416420
417421
418
419
420
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
421440
422441
423
442
424443
425444
426445
AdgRDimPrivate *data;
AdgAlignment *quote;
AdgDimStyle *dim_style;
AdgEntity *quote_entity;
gboolean outside;
const AdgMatrix *local;
const AdgMatrix *global, *local;
AdgPair ref1, ref2, base;
AdgPair pair;
CpmlExtents extents;
if (_ADG_OLD_ENTITY_CLASS->arrange)
if (_ADG_OLD_ENTITY_CLASS->arrange != NULL)
_ADG_OLD_ENTITY_CLASS->arrange(entity);
rdim = (AdgRDim *) entity;
dim = (AdgDim *) rdim;
data = rdim->data;
quote = adg_dim_get_quote(dim);
quote_entity = (AdgEntity *) quote;
if (!_adg_update_geometry(rdim))
return;
_adg_update_entities(rdim);
/* Check for cached result */
if (data->cpml.path.status == CAIRO_STATUS_SUCCESS) {
AdgEntity *quote_entity = (AdgEntity *) quote;
adg_entity_set_global_map(quote_entity, &data->quote.global_map);
return;
}
dim_style = _ADG_GET_DIM_STYLE(dim);
outside = adg_dim_get_outside(dim);
if (outside == ADG_THREE_STATE_UNKNOWN)
outside = ADG_THREE_STATE_OFF;
dim_style = _ADG_GET_DIM_STYLE(dim);
global = adg_entity_get_global_matrix(entity);
local = adg_entity_get_local_matrix(entity);
extents.is_defined = FALSE;
cpml_pair_copy(&ref1, adg_point_get_pair(adg_dim_get_ref1(dim)));
cpml_pair_copy(&ref2, adg_point_get_pair(adg_dim_get_ref2(dim)));
cpml_pair_copy(&base, &data->point.base);
if (outside) {
data->cpml.data[2].header.length = 2;
/* TODO: outside radius dimensions */
/* XXX: http://dev.entidi.com/p/adg/issues/9/ */
} else {
data->cpml.data[2].header.length = 6;
}
data->cpml.path.status = CAIRO_STATUS_SUCCESS;
/* Add the quote */
if (quote != NULL) {
AdgEntity *quote_entity;
AdgMatrix map;
quote_entity = (AdgEntity *) quote;
cpml_pair_from_cairo(&pair, &data->cpml.data[1]);
adg_alignment_set_factor_explicit(quote, 1, 0);
cpml_pair_from_cairo(&pair, &data->cpml.data[1]);
cairo_matrix_init_translate(&map, pair.x, pair.y);
cairo_matrix_rotate(&map, data->angle);
adg_entity_set_global_map(quote_entity, &map);
adg_entity_arrange(quote_entity);
cpml_extents_add(&extents, adg_entity_get_extents(quote_entity));
adg_matrix_copy(&data->quote.global_map,
adg_entity_get_global_map(quote_entity));
}
if (data->marker != NULL) {
adg_marker_set_segment(data->marker, data->trail, outside ? 2 : 1);
adg_entity_local_changed((AdgEntity *) data->marker);
data->cpml.path.status = CAIRO_STATUS_SUCCESS;
if (data->trail != NULL) {
CpmlExtents trail_extents;
AdgEntity *marker_entity;
cpml_extents_copy(&trail_extents, adg_trail_get_extents(data->trail));
cpml_extents_transform(&trail_extents, global);
cpml_extents_add(&extents, &trail_extents);
if (data->marker != NULL) {
marker_entity = (AdgEntity *) data->marker;
adg_marker_set_segment(data->marker, data->trail,
outside ? 2 : 1);
adg_entity_local_changed(marker_entity);
adg_entity_arrange(marker_entity);
cpml_extents_add(&extents, adg_entity_get_extents(marker_entity));
}
}
/* TODO: compute the extents */
adg_entity_set_extents(entity, &extents);
}
static void

Archive Download the corresponding diff file