Ovis_Segmented_Line_Segment_Length_Set()
Abstract
Specifies the size (expressed in percentage) of an individual segment as it relates to the entire segmented line.
Syntax
Ovis_Segmented_Line_Segment_Length_Set (seg_line_ptr, index, percentage)
| Argument | Type | Description |
|---|---|---|
seg_line_ptr |
OvisT_Segmented_Line * |
Specifies the segmented line |
index |
unsigned char |
Specifies the index of the line segment |
percentage |
unsigned char |
Specifies the percentage of the offset |
Return Type
OvisT_Compcode
OvisC_Compcode_Success if the decoration is a valid 2D or 3D segmented line; OvisC_Compcode_Failure otherwise.
Header
ovis_decoration.h
Details
This function specifies the size (expressed in percentage) of an individual segment as it relates to the entire segmented line. The entire line is 100 percent; the subject segment represents a percentage of the segmented line.
A given segment starts at the percentage of line corresponding to the sum of offsets from the previous segments.
The display will only include segments or segment portions up to the sum of 100. If the sum of the segment offsets is more than 100, some segments or segment portions will not be shown. If the sum is less than 100, the last segment is automatically stretched in the display.
Note: This function was formerly called Ovis_Segmented_Line_Segment_Offset_Set(). The old name is available as an alias for the new one.
Example
OvisT_2D_Segmented_Line * line;
/* … .line created at some point with 3 segments */
/* Two short segments at the ends, and a big one in the middle */
Ovis_Segmented_Line_Segment_Length_Set (line, 0, 10);
Ovis_Segmented_Line_Segment_Length_Set (line, 1, 80);
Ovis_Segmented_Line_Segment_Length_Set (line, 2, 10);
Errors
- Decoration is not a segmented Line.
- Decoration is NIL.
- Can't use 'OVISC_SEGMENTED_LINE_ALL_SEGMENTS' index value.
- 0-based segment index (
<index>) is too large for<num>segments.
Reference
- Use the function
Ovis_Segmented_Line_Segment_Length_Get()to obtain the percentage size of a segment.