You can access several kind of semantic data for Dtk_Dimension.
Using Dtk_Text_subtype
Each Dtk_Text of Dtk_Dimension has a DTK_Text_subtype.
DTK_Text_subtype lets you flag each text with one or more subtype(s) to semantically define the Dtk_Text.
On this picture, you can see the easiest cases:
- The first Dtk_Dimension is a really basic case:
The only text provided is '69.76'.
It is flagged 'Mainvalpart' - because it is a part of the main value part of the dimension -, and 'basisval' - because it is the basisval of this part -.
- The second Dtk_Dimension contains 2 texts : '2.75' and ' " '.
Each text is a part of main value part, so they are both flagged 'Mainvalpart'.
The first one is also flagged 'basisval' whereas the other is flagged 'pow'.
- You can see on the third Dtk_Dimension some others subtypes not included into the mainvalpart - Up/Left/Right/Down/Prefix -.
This second picture shows you others DTK_Text_subtype:
- The first Dtk_Dimension is a dual dimension.
You can see that all texts in the second part of the dual are flagged 'dual'.
- The second Dtk_Dimension is a fraction form.
The fraction is a part of the mainval, so all the texts are flagged 'Mainvalpart'.
You have the 'basisval', and the 'fraction' part.
You still have the 'pow'.
Most complex cases follow on the 2 next pictures:
Using Dtk_Info
Each Dtk_Text has also a Dtk_Info giving you additionnal information.
You can access it using method Dtk_Info::FindAttribute (see sample below).
- DtkUnit gives the unit (as string) of the displayed value in the Dtk_Text
UnitType should be one of theses values :
DTK_UNIT_MM,
DTK_UNIT_MICRON
DTK_UNIT_CM
DTK_UNIT_M
DTK_UNIT_KM
DTK_UNIT_INCH
DTK_UNIT_RADIAN
DTK_UNIT_DMS
DTK_UNIT_GRADE
DMS (degree minuts seconds)
- DtkOriginalValue gives the semantic numerical value corresponding to main value of dimension.
- DtkOriginalTolMin gives the semantic numerical value corresponding to the minimum tolerance
- DtkOriginalTolMax gives the semantic numerical value corresponding to the maximum tolerance
- DtkOriginalTolMinSign gives the sign of the minimum tolerance
- DtkOriginalTolMaxSign gives the sign of the maximum tolerance
- DtkOriginalTolAbsolute gives a boolean to tell if tolerances values are relative to the original value or absolute
- DtkOriginalDataUnit gives unit of semantic numerical value as string like DtkUnit
- DtkSeparator gives the separator character for number '.' or ','
- DtkDisplayFinalZeros gives a boolean for Final Zero display
- DtkDisplayLeadingZeros gives a boolean for Leading Zero display
- DtkPrecision gives a double for precision to display
Following reader, theses information can also be set on the Dtk_CompositeText.
Library Use
{
const Dtk_Text& IthText = MyCompositeText[ i ];
{
}
}
{
{
}
}
}