Overview

IFC uses several layers of nested selects for IfcValues and related instances. These functions, and the companion functions for units, simplify work with these types of quantities.

These functions are defined in ifcx_measure.h.

ifcx_measure_make()

IfcMeasureWithUnit * ifcx_measure_make(
	RoseDesign * design,
	double value, 
	RoseUnit ut
	);

The ifcx_measure_make() function creates an IfcMeasureWithUnit in the given design and populates it with the appropriate IfcValue and IfcUnit contents.

This function uses ifcx_value_make() and ifcx_unit_make_select() to build its contents.

ifcx_value_get()

double ifcx_value_get (IfcValue * val);
double ifcx_value_get (IfcMeasureValue * mv);
double ifcx_value_get (IfcDerivedMeasureValue * mv);
double ifcx_value_get (IfcSimpleValue * mv);

The ifcx_value_get() function returns the numeric value within an IfcValue or related object. IFC Value is a nested select, so these functions dig down through the layers to simplify use of the the contents.

The function returns ROSE_NULL_REAL if the IfcValue contains a description or some other non-numeric value.

ifcx_value_make()

IfcValue * ifcx_value_make(
	RoseDesign * design,
	double value, 
	RoseMeasureType vt
	);

The ifcx_value_make() function creates an IfcValue in the given design and creates any nested select objects needed to hold the type of measure.

For example, when creating a rosemeasure_length, the returned IfcValue will contain a nested IfcMeasureValue select which will contain an IfcLengthMeasure quantity.

ifcx_value_make_measure()

IfcMeasureValue * ifcx_value_make_measure(
	RoseDesign * design,
	double value, 
	RoseMeasureType vt
	);

The ifcx_value_make_measure() function an IfcMeasureValue in the given design and sets its contents to the given value and kind of quantity. This is similar to ifcx_value_make() but does not wrap the measure value with an IfcValue select type.