Synopsis

#include <adg-1/adg.h>

struct              AdgDimStyle;
struct              AdgDimStyleClass;
AdgDimStyle *       adg_dim_style_new                   (void);
void                adg_dim_style_set_marker1           (AdgDimStyle *dim_style,
                                                         AdgMarker *marker);
AdgMarker *         adg_dim_style_marker1_new           (AdgDimStyle *dim_style);
void                adg_dim_style_set_marker2           (AdgDimStyle *dim_style,
                                                         AdgMarker *marker);
AdgMarker *         adg_dim_style_marker2_new           (AdgDimStyle *dim_style);
void                adg_dim_style_set_color_dress       (AdgDimStyle *dim_style,
                                                         AdgDress dress);
AdgDress            adg_dim_style_get_color_dress       (AdgDimStyle *dim_style);
void                adg_dim_style_set_value_dress       (AdgDimStyle *dim_style,
                                                         AdgDress dress);
AdgDress            adg_dim_style_get_value_dress       (AdgDimStyle *dim_style);
void                adg_dim_style_set_min_dress         (AdgDimStyle *dim_style,
                                                         AdgDress dress);
AdgDress            adg_dim_style_get_min_dress         (AdgDimStyle *dim_style);
void                adg_dim_style_set_max_dress         (AdgDimStyle *dim_style,
                                                         AdgDress dress);
AdgDress            adg_dim_style_get_max_dress         (AdgDimStyle *dim_style);
void                adg_dim_style_set_line_dress        (AdgDimStyle *dim_style,
                                                         AdgDress dress);
AdgDress            adg_dim_style_get_line_dress        (AdgDimStyle *dim_style);
void                adg_dim_style_set_from_offset       (AdgDimStyle *dim_style,
                                                         gdouble offset);
gdouble             adg_dim_style_get_from_offset       (AdgDimStyle *dim_style);
void                adg_dim_style_set_to_offset         (AdgDimStyle *dim_style,
                                                         gdouble offset);
gdouble             adg_dim_style_get_to_offset         (AdgDimStyle *dim_style);
void                adg_dim_style_set_beyond            (AdgDimStyle *dim_style,
                                                         gdouble beyond);
gdouble             adg_dim_style_get_beyond            (AdgDimStyle *dim_style);
void                adg_dim_style_set_baseline_spacing  (AdgDimStyle *dim_style,
                                                         gdouble spacing);
gdouble             adg_dim_style_get_baseline_spacing  (AdgDimStyle *dim_style);
void                adg_dim_style_set_limits_spacing    (AdgDimStyle *dim_style,
                                                         gdouble spacing);
gdouble             adg_dim_style_get_limits_spacing    (AdgDimStyle *dim_style);
void                adg_dim_style_set_quote_shift       (AdgDimStyle *dim_style,
                                                         const CpmlPair *shift);
const CpmlPair *    adg_dim_style_get_quote_shift       (AdgDimStyle *dim_style);
void                adg_dim_style_set_limits_shift      (AdgDimStyle *dim_style,
                                                         const CpmlPair *shift);
const CpmlPair *    adg_dim_style_get_limits_shift      (AdgDimStyle *dim_style);
void                adg_dim_style_set_number_format     (AdgDimStyle *dim_style,
                                                         const gchar *format);
const gchar *       adg_dim_style_get_number_format     (AdgDimStyle *dim_style);
void                adg_dim_style_set_number_tag        (AdgDimStyle *dim_style,
                                                         const gchar *tag);
const gchar *       adg_dim_style_get_number_tag        (AdgDimStyle *dim_style);

Object Hierarchy

  GObject
   +----AdgStyle
         +----AdgDimStyle

Properties

  "baseline-spacing"         gdouble               : Read / Write
  "beyond"                   gdouble               : Read / Write
  "color-dress"              AdgDress              : Read / Write
  "from-offset"              gdouble               : Read / Write
  "limits-shift"             CpmlPair*             : Read / Write
  "limits-spacing"           gdouble               : Read / Write
  "line-dress"               AdgDress              : Read / Write
  "marker1"                  AdgMarker*            : Write
  "marker2"                  AdgMarker*            : Write
  "max-dress"                AdgDress              : Read / Write
  "min-dress"                AdgDress              : Read / Write
  "number-format"            gchar*                : Read / Write
  "number-tag"               gchar*                : Read / Write
  "quote-shift"              CpmlPair*             : Read / Write
  "to-offset"                gdouble               : Read / Write
  "value-dress"              AdgDress              : Read / Write

Description

Contains parameters on how to build dimensions such as the different font styles (for value and limits), line style, offsets of the various dimension components etc...

Details

struct AdgDimStyle

struct AdgDimStyle;

All fields are private and should not be used directly. Use its public methods instead.

Since 1.0


struct AdgDimStyleClass

struct AdgDimStyleClass {
};

adg_dim_style_new ()

AdgDimStyle *       adg_dim_style_new                   (void);

Constructs a new empty dimension style initialized with default params.

Returns :

a newly created dimension style. [transfer full]

Since 1.0


adg_dim_style_set_marker1 ()

void                adg_dim_style_set_marker1           (AdgDimStyle *dim_style,
                                                         AdgMarker *marker);

Uses marker as entity template to generate a new marker entity when a call to adg_dim_style_marker1_new() is made. It is allowed to pass NULL as marker, in which case the template data of the first marker are unset.

This method duplicates internally the property values of marker, so any further change to marker does not affect dim_style anymore. This also means marker could be destroyed without problems after this call because dim_style uses only its property values and does not add any references to marker.

dim_style :

an AdgStyle

marker :

an AdgMarker derived entity

Since 1.0


adg_dim_style_marker1_new ()

AdgMarker *         adg_dim_style_marker1_new           (AdgDimStyle *dim_style);

Creates a new marker entity by cloning the "marker1" object. The returned entity should be unreferenced with g_object_unref() when no longer needed.

dim_style :

an AdgDimStyle

Returns :

a newly created marker or NULL if the "marker1" property is not set or on errors. [transfer full]

Since 1.0


adg_dim_style_set_marker2 ()

void                adg_dim_style_set_marker2           (AdgDimStyle *dim_style,
                                                         AdgMarker *marker);

Uses marker as entity template to generate a new marker entity when a call to adg_dim_style_marker2_new() is made. It is allowed to pass NULL as marker, in which case the template data of the second marker are unset.

This method duplicates internally the property values of marker, so any further change to marker does not affect dim_style anymore. This also means marker could be destroyed without problems after this call because dim_style uses only its property values and does not add any references to marker.

dim_style :

an AdgStyle

marker :

an AdgMarker derived entity

Since 1.0


adg_dim_style_marker2_new ()

AdgMarker *         adg_dim_style_marker2_new           (AdgDimStyle *dim_style);

Creates a new marker entity by cloning the "marker2" object. The returned entity should be unreferenced with g_object_unref() when no longer needed.

dim_style :

an AdgDimStyle

Returns :

a newly created marker or NULL if the "marker2" property is not set or on errors. [transfer full]

Since 1.0


adg_dim_style_set_color_dress ()

void                adg_dim_style_set_color_dress       (AdgDimStyle *dim_style,
                                                         AdgDress dress);

Sets a new color dress on dim_style.

dim_style :

an AdgDimStyle object

dress :

the new color dress

Since 1.0


adg_dim_style_get_color_dress ()

AdgDress            adg_dim_style_get_color_dress       (AdgDimStyle *dim_style);

Gets the dim_style color dress to be used. This dress should be intended as a fallback color as it could be overriden by more specific dresses, such as a color explicitely specified on the "value-dress".

dim_style :

an AdgDimStyle object

Returns :

the color dress. [transfer none]

Since 1.0


adg_dim_style_set_value_dress ()

void                adg_dim_style_set_value_dress       (AdgDimStyle *dim_style,
                                                         AdgDress dress);

Sets a new dress on dim_style for the basic value.

dim_style :

an AdgDimStyle object

dress :

the new basic value font style

Since 1.0


adg_dim_style_get_value_dress ()

AdgDress            adg_dim_style_get_value_dress       (AdgDimStyle *dim_style);

Gets the font dress to be used for the basic value of dimensions with dim_style.

dim_style :

an AdgDimStyle object

Returns :

the font dress. [transfer none]

Since 1.0


adg_dim_style_set_min_dress ()

void                adg_dim_style_set_min_dress         (AdgDimStyle *dim_style,
                                                         AdgDress dress);

Sets a new dress on dim_style for the lower limit value.

dim_style :

an AdgDimStyle object

dress :

the new lower limit dress

Since 1.0


adg_dim_style_get_min_dress ()

AdgDress            adg_dim_style_get_min_dress         (AdgDimStyle *dim_style);

Gets the dim_style dress to be used for the lower limit.

dim_style :

an AdgDimStyle object

Returns :

the lower limit dress. [transfer none]

Since 1.0


adg_dim_style_set_max_dress ()

void                adg_dim_style_set_max_dress         (AdgDimStyle *dim_style,
                                                         AdgDress dress);

Sets a new dress on dim_style for the upper limit value.

dim_style :

an AdgDimStyle object

dress :

the new upper limit dress

Since 1.0


adg_dim_style_get_max_dress ()

AdgDress            adg_dim_style_get_max_dress         (AdgDimStyle *dim_style);

Gets the dim_style dress to be used for the upper limit.

dim_style :

an AdgDimStyle object

Returns :

the upper limit dress. [transfer none]

Since 1.0


adg_dim_style_set_line_dress ()

void                adg_dim_style_set_line_dress        (AdgDimStyle *dim_style,
                                                         AdgDress dress);

Sets a new line dress on dim_style.

dim_style :

an AdgDimStyle object

dress :

the new line dress

Since 1.0


adg_dim_style_get_line_dress ()

AdgDress            adg_dim_style_get_line_dress        (AdgDimStyle *dim_style);

Gets the line dress to be used for rendering the base and the extension lines with dim_style.

dim_style :

an AdgDimStyle object

Returns :

the line dress. [transfer none]

Since 1.0


adg_dim_style_set_from_offset ()

void                adg_dim_style_set_from_offset       (AdgDimStyle *dim_style,
                                                         gdouble offset);

Sets a new value in the "from-offset" property.

dim_style :

an AdgDimStyle object

offset :

the new offset

Since 1.0


adg_dim_style_get_from_offset ()

gdouble             adg_dim_style_get_from_offset       (AdgDimStyle *dim_style);

Gets the distance (in global space) the extension lines must keep from the sensed points.

dim_style :

an AdgDimStyle object

Returns :

the requested distance.

Since 1.0


adg_dim_style_set_to_offset ()

void                adg_dim_style_set_to_offset         (AdgDimStyle *dim_style,
                                                         gdouble offset);

Sets a new value in the "to-offset" property.

dim_style :

an AdgDimStyle object

offset :

the new offset

Since 1.0


adg_dim_style_get_to_offset ()

gdouble             adg_dim_style_get_to_offset         (AdgDimStyle *dim_style);

Gets how much (in global space) the extension lines must extend after crossing the baseline.

dim_style :

an AdgDimStyle object

Returns :

the requested distance.

Since 1.0


adg_dim_style_set_beyond ()

void                adg_dim_style_set_beyond            (AdgDimStyle *dim_style,
                                                         gdouble beyond);

Sets a new value in the "beyond" property.

dim_style :

an AdgDimStyle object

beyond :

the new length

Since 1.0


adg_dim_style_get_beyond ()

gdouble             adg_dim_style_get_beyond            (AdgDimStyle *dim_style);

Gets how much (in global space) the baseline should extend beyond the extension lines on dimension with outside markers.

dim_style :

an AdgDimStyle object

Returns :

the requested beyond length.

Since 1.0


adg_dim_style_set_baseline_spacing ()

void                adg_dim_style_set_baseline_spacing  (AdgDimStyle *dim_style,
                                                         gdouble spacing);

Sets a new value in the "baseline-spacing" value.

dim_style :

an AdgDimStyle object

spacing :

the new spacing

Since 1.0


adg_dim_style_get_baseline_spacing ()

gdouble             adg_dim_style_get_baseline_spacing  (AdgDimStyle *dim_style);

Gets the distance between two consecutive baselines while stacking dimensions.

dim_style :

an AdgDimStyle object

Returns :

the requested spacing.

Since 1.0


adg_dim_style_set_limits_spacing ()

void                adg_dim_style_set_limits_spacing    (AdgDimStyle *dim_style,
                                                         gdouble spacing);

Sets a new "limits-spacing" value.

dim_style :

an AdgDimStyle object

spacing :

the new spacing

Since 1.0


adg_dim_style_get_limits_spacing ()

gdouble             adg_dim_style_get_limits_spacing    (AdgDimStyle *dim_style);

Gets the distance (in global space) between the limits/tolerances.

dim_style :

an AdgDimStyle object

Returns :

the requested spacing.

Since 1.0


adg_dim_style_set_quote_shift ()

void                adg_dim_style_set_quote_shift       (AdgDimStyle *dim_style,
                                                         const CpmlPair *shift);

Sets a new "quote-shift" value.

dim_style :

an AdgDimStyle object

shift :

the new displacement

Since 1.0


adg_dim_style_get_quote_shift ()

const CpmlPair *    adg_dim_style_get_quote_shift       (AdgDimStyle *dim_style);

Gets the smooth displacement of the quote. The returned pointer refers to an internal allocated struct and must not be modified or freed.

dim_style :

an AdgDimStyle object

Returns :

the requested shift. [transfer none]

Since 1.0


adg_dim_style_set_limits_shift ()

void                adg_dim_style_set_limits_shift      (AdgDimStyle *dim_style,
                                                         const CpmlPair *shift);

Sets a new "limits-shift" value.

dim_style :

an AdgDimStyle object

shift :

the new displacement

Since 1.0


adg_dim_style_get_limits_shift ()

const CpmlPair *    adg_dim_style_get_limits_shift      (AdgDimStyle *dim_style);

Gets the smooth displacement for the limits. The returned pointer refers to an internal allocated struct and must not be modified or freed.

dim_style :

an AdgDimStyle object

Returns :

the requested shift. [transfer none]

Since 1.0


adg_dim_style_set_number_format ()

void                adg_dim_style_set_number_format     (AdgDimStyle *dim_style,
                                                         const gchar *format);

Sets a new value in the "number-format" property.

dim_style :

an AdgDimStyle object

format :

the new format to adopt

Since 1.0


adg_dim_style_get_number_format ()

const gchar *       adg_dim_style_get_number_format     (AdgDimStyle *dim_style);

Gets the number format (in printf style) of this quoting style. The returned pointer refers to internally managed text that must not be modified or freed.

dim_style :

an AdgDimStyle object

Returns :

the requested format. [transfer none]

Since 1.0


adg_dim_style_set_number_tag ()

void                adg_dim_style_set_number_tag        (AdgDimStyle *dim_style,
                                                         const gchar *tag);

Sets a new tag in the "number-tag" property.

dim_style :

an AdgDimStyle object

tag :

the new tag

Since 1.0


adg_dim_style_get_number_tag ()

const gchar *       adg_dim_style_get_number_tag        (AdgDimStyle *dim_style);

Gets the number tag of dim_style. This tag will be used while generating the set values of the dimensions bound to this style: check the "value" documentation for further details.

The returned pointer refers to internally managed text that must not be modified or freed.

dim_style :

an AdgDimStyle object

Returns :

the requested tag. [transfer none]

Since 1.0

Property Details

The "baseline-spacing" property

  "baseline-spacing"         gdouble               : Read / Write

Distance between two consecutive baselines while stacking dimensions.

Allowed values: >= 0

Default value: 32


The "beyond" property

  "beyond"                   gdouble               : Read / Write

How much the baseline should be extended (in global space) beyond the extension lines on dimensions with outside markers.

Allowed values: >= 0

Default value: 20


The "color-dress" property

  "color-dress"              AdgDress              : Read / Write

Color dress for the whole dimension.


The "from-offset" property

  "from-offset"              gdouble               : Read / Write

Offset (in global space) of the extension lines from the path to the quote.

Allowed values: >= 0

Default value: 5


The "limits-shift" property

  "limits-shift"             CpmlPair*             : Read / Write

Used to specify a smooth displacement (in global space) for the limits/tolerances by taking as reference the perfect compact position.


The "limits-spacing" property

  "limits-spacing"           gdouble               : Read / Write

Distance between limits/tolerances.

Allowed values: >= 0

Default value: 2


The "line-dress" property

  "line-dress"               AdgDress              : Read / Write

Line dress for the baseline and the extension lines.


The "marker1" property

  "marker1"                  AdgMarker*            : Write

The template entity to use as first marker.


The "marker2" property

  "marker2"                  AdgMarker*            : Write

The template entity to use as second marker.


The "max-dress" property

  "max-dress"                AdgDress              : Read / Write

Font dress for the upper limit value.


The "min-dress" property

  "min-dress"                AdgDress              : Read / Write

Font dress for the lower limit value.


The "number-format" property

  "number-format"            gchar*                : Read / Write

The format (in printf style) of the numeric component of the basic value.

Default value: "%-.7g"


The "number-tag" property

  "number-tag"               gchar*                : Read / Write

The tag to substitute inside the value template string.

Default value: "<>"


The "quote-shift" property

  "quote-shift"              CpmlPair*             : Read / Write

Used to specify a smooth displacement (in global space) of the quote by taking as reference the perfect compact position (the middle of the baseline on common linear dimension, for instance).


The "to-offset" property

  "to-offset"                gdouble               : Read / Write

How many extend (in global space) the extension lines after hitting the baseline.

Allowed values: >= 0

Default value: 5


The "value-dress" property

  "value-dress"              AdgDress              : Read / Write

Font dress for the nominal value of the dimension.