IStripTopol Interface
- Break
- Delete
- SetType
- CloseLoop
- Add
This interface allows to perform topological operations on the strip, which
implements this interface. Normally this interface is obtained from the
correspondent IStrip interface.
See also StripTopol Sample, Segment strips,
Interface List
HRESULT Break(int index)
Parameters
index - [in] 0-based index of the segment,
to be divided in two
Return Values
- S_OK in case of
success.
Remarks
After call to this method segment index of the strip will be
evenly divided in two joined segments. Use this method to add new segments to
the strip.
HRESULT Delete(int index, VARIANT_BOOL segment)
Parameters
index - [in] zero-based index of the element.
segment - [in] if true index-th segment will
be deleted, if false index-th joint will be deleted.
ppIElem -
[out] returned pointer to the
interface.
Return Values
S_OK in case of
success.
DISP_E_BADINDEX if index is out of range.
DI_E_INVALIDGEOMETRY - if the segment
is true (not zero), the strip is closed and index is not 0 nor n-1, where n is
number of segments in the strip. See remarks
Remarks
If segment is true segment index
must be the index of the first or the last segment in the strip otherwise the
operation fails and method returns DI_E_INVALIDGEOMETRY. If the strip was closed segment
index will be always removed and the strip will become open. If segment
is false joint index of the strip will be deleted. If
the joint is not an end of the strip two ad joint segments will be replaced with
a new single segment.
HRESULT SetType(int index, ESegmentType eType)
Parameters
index - [in] zero-based index of
a segment.
eType -
[in] member of of ESegmentType
enumeration.
Return Values
S_OK in case of
success.
Remarks
This method will change type of the segment number index to eType.
In this version of software there only two types of segments, namely eSegmTypeLine
and eSegmTypeArc.
HRESULT CloseLoop()
Return Values
DI_E_INVALIDGEOMETRY if the strip is already closed
S_OK in case of
success.
Remarks
Call to this method will connect ends of an open strip thus making it
closed. If the strip is already closed the method has no effect.
HRESULT
Add(double x, double y, VARIANT_BOOL tail)
Parameters
x, y - Coordinates of the new joint.
tail - if true the strip will be extended by adding
new segment at the second end of the strip. Ignored if there is less than two
joints.
Return Values
DI_E_INVALIDGEOMETRY if the strip is closed
S_OK in case of
success.
Remarks
The method allows adding segments to the strip. If the strip had segments
prior to the operation tail parameter determines which end will be
extended. If the strip consists of a single joint ( a single 3D line in case of
3DO or circumference generated by a single point in case of SOR ) a new segment connecting the joints
will be added. If the strip is empty, as the result of the operation it will
consist of a single joint.
|