Top | ![]() |
![]() |
![]() |
![]() |
enum | GwyGrainValueGroup |
enum | GwyGrainValueFlags |
GwyGrainValueData | |
struct | GwyGrainValue |
struct | GwyGrainValueClass |
GwyGrainValueGroup
gwy_grain_value_get_group (GwyGrainValue *gvalue
);
Gets the group of a grain value.
All user-defined grain values belong to GWY_GRAIN_VALUE_GROUP_USER
group,
built-in grain values belong to other groups.
Since: 2.8
const gchar *
gwy_grain_value_get_symbol (GwyGrainValue *gvalue
);
Gets the plain symbol representing a grain value.
The plain symbol is used in expressions. It has to be a valid identifier and it should be easy to type. (Note currently it is not possible to use user-defined grain quantities in expressions for other user-defined grain quantities.)
Since: 2.8
void gwy_grain_value_set_symbol (GwyGrainValue *gvalue
,const gchar *symbol
);
Sets the plain symbol representing a grain value.
See gwy_grain_value_get_symbol()
for details.
Since: 2.8
const gchar *
gwy_grain_value_get_symbol_markup (GwyGrainValue *gvalue
);
Gets the rich text symbol representing a grain value.
The returned value can contain Pango markup and is suitable for instance for graph axis labels.
Since: 2.8
void gwy_grain_value_set_symbol_markup (GwyGrainValue *gvalue
,const gchar *symbol
);
Sets the rich text symbol representing a grain value.
See gwy_grain_value_get_symbol_markup()
for details.
Since: 2.8
gint
gwy_grain_value_get_power_xy (GwyGrainValue *gvalue
);
Gets the power of lateral dimensions in a grain value.
The units of a grain value are determined as the product of lateral units and value units, raised to certain powers. For instance lengths in the horizontal plane have xy power of 1 and areas have 2, whereas volumes have xy power of 2 and value power of 1.
Since: 2.8
void gwy_grain_value_set_power_xy (GwyGrainValue *gvalue
,gint power_xy
);
Sets the power of lateral dimensions in a grain value.
Since: 2.8
gint
gwy_grain_value_get_power_z (GwyGrainValue *gvalue
);
Gets the power of value (height) in a grain value.
See gwy_grain_value_get_power_xy()
for details.
Since: 2.8
void gwy_grain_value_set_power_z (GwyGrainValue *gvalue
,gint power_z
);
Sets the power of value (height) in a grain value.
Since: 2.8
GwyGrainValueFlags
gwy_grain_value_get_flags (GwyGrainValue *gvalue
);
Obtains the special attributes of a grain quantity.
Since: 2.8
void gwy_grain_value_set_flags (GwyGrainValue *gvalue
,GwyGrainValueFlags flags
);
Sets the special attributes of a grain quantity.
The value of flags
determines the complete new set of flags. To set
individual flags, obtain the current set with gwy_grain_value_get_flags()
first and then set/unset individual flags.
Since: 2.8
GwyGrainQuantity
gwy_grain_value_get_quantity (GwyGrainValue *gvalue
);
Gets the built-in grain quantity corresponding to a grain value.
The corresponding built-in GwyGrainQuantity if gvalue
is a
built-it grain value, -1 if gvalue
is an user-defined grain value.
Since: 2.8
const gchar *
gwy_grain_value_get_expression (GwyGrainValue *gvalue
);
Gets the expression of a user-defined grain value.
Since: 2.8
gboolean gwy_grain_value_set_expression (GwyGrainValue *gvalue
,const gchar *expression
,GError **error
);
Sets the expression of a user-defined grain value.
It is an error to call this function on a built-in quantity.
gvalue |
A grain value object. |
|
expression |
New grain value expression. |
|
error |
Return location for the error, or |
TRUE
if the expression is compilable and references only known
grain quantities. FALSE
is the expression is not calculable,
in this case the gvalue
's expression is unchanged.
Since: 2.8
const gchar *
gwy_grain_value_group_name (GwyGrainValueGroup group
);
Obtains the name of a grain value group.
Since: 2.8
GwyInventory *
gwy_grain_values (void
);
Gets the inventory with all the grain values.
Since: 2.8
GwyGrainValue *
gwy_grain_values_get_grain_value (const gchar *name
);
Convenience function to get a grain quantity from gwy_grain_values()
by
name.
Since: 2.8
GwyGrainValue *
gwy_grain_values_get_grain_value_by_symbol
(const gchar *symbol
);
Convenience function to get a grain quantity from gwy_grain_values()
by
its symbol.
Since: 2.37
GwyGrainValue *
gwy_grain_values_get_builtin_grain_value
(GwyGrainQuantity quantity
);
Obtains the built-in grain value corresponding to given enum value.
Since: 2.8
void gwy_grain_values_calculate (gint nvalues
,GwyGrainValue **gvalues
,gdouble **results
,GwyDataField *data_field
,gint ngrains
,const gint *grains
);
Calculates a set of grain values.
See also gwy_data_field_grains_get_quantities()
for a simplier function
for built-in grain values.
nvalues |
Number of items in |
|
gvalues |
Array of grain value objects. |
|
results |
Array of length |
|
data_field |
Data field used for marking. For some values its values
are not used, but its dimensions determine the dimensions of
|
|
grains |
Grain numbers filled with |
|
ngrains |
The number of grains as returned by
|
Since: 2.8
Special attributes of grain values.
Certain grain quantities, such as the surface
area or absolute inclination, are only
meaningful if value (height) is the same
physical quantity as lateral dimensions. These
have this flag set to |
||
Angular quantities are internally always
calculated in radians, however they can be
presented in degrees in the user interface.
To enable such special handling, set this
flag to |
Since: 2.8
typedef struct { GwyGrainValueGroup group; gchar *symbol_markup; gchar *symbol; gchar *reserveds; gint power_xy; gint power_z; guint flags; gint reservedi; } GwyGrainValueData;