Select to view content in your preferred language

Size of Bezier curve record

2605
3
10-18-2011 08:04 PM
__11
by
Deactivated User
According to footnote 12 of doc\html\extended_shapefile_format.pdf the size of a curve segment modifier is "4 + (28 per circular arc) + (24 per bezier curve) + (52 per elliptic arc)".

Is this value for Bezier curve correct?  I calculated it as

     offsetof(esriSegmentModifier, segmentParams) + sizeof(SegmentBezierCurve)
   = 2 * sizeof(int32)                            + 2 * sizeof(WKSPoint)
   = 2 * sizeof(int32)                            + 2 * (2 * sizeof(double))
   = 2 * 4                                        + 2 * (2 * 😎
   = 8                                            + 32
   = 40

(I'm using the fixed size int32 in my code instead of "long" which isn't necessarily a specific size.)

I verified my methodology thus:

#define esriSegmentModifierSizeCheck() \
{ assert(offsetof(esriSegmentModifier, segmentParams) +  sizeof(SegmentArc) == 28); \
assert(offsetof(esriSegmentModifier, segmentParams) +  sizeof(SegmentBezierCurve) == 40/*differs from doc - see comment above*/); \
assert(offsetof(esriSegmentModifier, segmentParams) +  sizeof(SegmentEllipticArc) == 52); \
0 Kudos
3 Replies
DavidSousa
Occasional Contributor
I believe that your calculations are correct.  It looks as though there is an error in the doc.
0 Kudos
__11
by
Deactivated User
This is fixed in API v1.2
0 Kudos
LanceShipman
Esri Regular Contributor
This was fixed in 1.2.
0 Kudos