If you encounter such a problem, how can you determine whether the Polyline Object is an arc? After a simple thought, you can directly determine the gemetrytype of polyline, but this is wrong.
The correct method is to obtain the corresponding isegmentcollection interface from QI. query the gemetrytype of each segment in segmentcollection to determine the construction line of the polyline.
The reason is very simple. The complex polyline can be considered as a set of multiple segments. However, each of my polyline objects is composed of a segment, so you can write code as follows:
Ippolylinefeatureclass-> Search (null, variant_false, & ipfeaturecursor );
Ipfeaturecursor-> nextfeature (& ipfeature );
Igeometryptr ipgeometry;
Ipolylineptr ippolyline;
Long loid;
Esrigeometrytype enugeomtype;
Ipfeature-> get_shape (& ipgeometry );
Ipfeature-> get_oid (& loid );
// Ipgeometry-> get_geometrytype (& enugeomtype );
Igeometrycollectionptr ipgeometrycollection;
HR = ipgeometry-> QueryInterface (iid_ipolyline, (void **) & ippolyline );
If (failed (HR ))
Return;
HR = ippolyline-> QueryInterface (iid_igeometrycollection, (void **) & ipgeometrycollection );
If (failed (HR ))
Return;
Long lgeometrycount;
HR = ipgeometrycollection-> get_geometrycount (& lgeometrycount );
If (failed (HR ))
Return;
Isegmentcollectionptr ipsegmentcollection;
Ipsegmentcollection = ipgeometry;
Long lsegmentcount;
Ipsegmentcollection-> get_segmentcount (& lsegmentcount );
If (failed (HR ))
Return;
Isegmentptr ipsegment;
Ipsegmentcollection-> get_segment (0, & ipsegment );
If (failed (HR ))
Return;
Esrigeometrytype enusegmentgeomtype;
HR = ipsegment-> get_geometrytype (& enusegmentgeomtype );
If (failed (HR ))
Return;