@@ -178,34 +178,66 @@ -(instancetype) initWithGeometryEnvelope: (SFGeometryEnvelope *) geometryEnvelop
178178    return  self;
179179}
180180
181+ -(double ) minXValue {
182+     return  [_minX doubleValue ];
183+ }
184+ 
181185-(void ) setMinXValue :  (double ) x {
182186    [self  setMinX: [[NSDecimalNumber  alloc ] initWithDouble: x]];
183187}
184188
189+ -(double ) maxXValue {
190+     return  [_maxX doubleValue ];
191+ }
192+ 
185193-(void ) setMaxXValue :  (double ) x {
186194    [self  setMaxX: [[NSDecimalNumber  alloc ] initWithDouble: x]];
187195}
188196
197+ -(double ) minYValue {
198+     return  [_minY doubleValue ];
199+ }
200+ 
189201-(void ) setMinYValue :  (double ) y {
190202    [self  setMinY: [[NSDecimalNumber  alloc ] initWithDouble: y]];
191203}
192204
205+ -(double ) maxYValue {
206+     return  [_maxY doubleValue ];
207+ }
208+ 
193209-(void ) setMaxYValue :  (double ) y {
194210    [self  setMaxY: [[NSDecimalNumber  alloc ] initWithDouble: y]];
195211}
196212
213+ -(double ) minZValue {
214+     return  [_minZ doubleValue ];
215+ }
216+ 
197217-(void ) setMinZValue :  (double ) z {
198218    [self  setMinZ: [[NSDecimalNumber  alloc ] initWithDouble: z]];
199219}
200220
221+ -(double ) maxZValue {
222+     return  [_maxZ doubleValue ];
223+ }
224+ 
201225-(void ) setMaxZValue :  (double ) z {
202226    [self  setMaxZ: [[NSDecimalNumber  alloc ] initWithDouble: z]];
203227}
204228
229+ -(double ) minMValue {
230+     return  [_minM doubleValue ];
231+ }
232+ 
205233-(void ) setMinMValue :  (double ) m {
206234    [self  setMinM: [[NSDecimalNumber  alloc ] initWithDouble: m]];
207235}
208236
237+ -(double ) maxMValue {
238+     return  [_maxM doubleValue ];
239+ }
240+ 
209241-(void ) setMaxMValue :  (double ) m {
210242    [self  setMaxM: [[NSDecimalNumber  alloc ] initWithDouble: m]];
211243}
@@ -219,11 +251,11 @@ -(BOOL) isMeasured{
219251}
220252
221253-(double ) xRange {
222-     return  [_maxX  doubleValue ] - [_minX  doubleValue ];
254+     return  [self   maxXValue ] - [self   minXValue ];
223255}
224256
225257-(double ) yRange {
226-     return  [_maxY  doubleValue ] - [_minY  doubleValue ];
258+     return  [self   maxYValue ] - [self   minYValue ];
227259}
228260
229261-(NSDecimalNumber  *) zRange {
@@ -262,6 +294,22 @@ -(SFPoint *) topRight{
262294    return  [SFPoint pointWithX: _maxX andY: _maxY];
263295}
264296
297+ -(SFPoint *) leftMid {
298+     return  [SFPoint pointWithX: _minX andY: [[NSDecimalNumber  alloc ] initWithDouble: [self  midY ]]];
299+ }
300+ 
301+ -(SFPoint *) bottomMid {
302+     return  [SFPoint pointWithX: [[NSDecimalNumber  alloc ] initWithDouble: [self  midX ]] andY: _minY];
303+ }
304+ 
305+ -(SFPoint *) rightMid {
306+     return  [SFPoint pointWithX: _maxX andY: [[NSDecimalNumber  alloc ] initWithDouble: [self  midY ]]];
307+ }
308+ 
309+ -(SFPoint *) topMid {
310+     return  [SFPoint pointWithX: [[NSDecimalNumber  alloc ] initWithDouble: [self  midX ]] andY: _maxY];
311+ }
312+ 
265313-(SFLine *) left {
266314    return  [SFLine lineWithPoint1: [self  topLeft ] andPoint2: [self  bottomLeft ]];
267315}
@@ -279,11 +327,11 @@ -(SFLine *) top{
279327}
280328
281329-(double ) midX {
282-     return  ([_minX  doubleValue ] + [_maxX  doubleValue ]) / 2.0 ;
330+     return  ([self   minXValue ] + [self   maxXValue ]) / 2.0 ;
283331}
284332
285333-(double ) midY {
286-     return  ([_minY  doubleValue ] + [_maxY  doubleValue ]) / 2.0 ;
334+     return  ([self   minYValue ] + [self   maxYValue ]) / 2.0 ;
287335}
288336
289337-(SFPoint *) centroid {
@@ -308,10 +356,10 @@ -(SFGeometryEnvelope *) overlapWithEnvelope: (SFGeometryEnvelope *) envelope{
308356
309357-(SFGeometryEnvelope *) overlapWithEnvelope :  (SFGeometryEnvelope *) envelope  withAllowEmpty :  (BOOL ) allowEmpty {
310358
311-     double  minX = MAX ([self .minX  doubleValue ], [envelope.minX  doubleValue ]);
312-     double  maxX = MIN ([self .maxX  doubleValue ], [envelope.maxX  doubleValue ]);
313-     double  minY = MAX ([self .minY  doubleValue ], [envelope.minY  doubleValue ]);
314-     double  maxY = MIN ([self .maxY  doubleValue ], [envelope.maxY  doubleValue ]);
359+     double  minX = MAX ([self   minXValue ], [envelope  minXValue ]);
360+     double  maxX = MIN ([self   maxXValue ], [envelope  maxXValue ]);
361+     double  minY = MAX ([self   minYValue ], [envelope  minYValue ]);
362+     double  maxY = MIN ([self   maxYValue ], [envelope  maxYValue ]);
315363
316364    SFGeometryEnvelope *overlap = nil ;
317365
@@ -324,10 +372,10 @@ -(SFGeometryEnvelope *) overlapWithEnvelope: (SFGeometryEnvelope *) envelope wit
324372
325373-(SFGeometryEnvelope *) unionWithEnvelope :  (SFGeometryEnvelope *) envelope {
326374
327-     double  minX = MIN ([self .minX  doubleValue ], [envelope.minX  doubleValue ]);
328-     double  maxX = MAX ([self .maxX  doubleValue ], [envelope.maxX  doubleValue ]);
329-     double  minY = MIN ([self .minY  doubleValue ], [envelope.minY  doubleValue ]);
330-     double  maxY = MAX ([self .maxY  doubleValue ], [envelope.maxY  doubleValue ]);
375+     double  minX = MIN ([self   minXValue ], [envelope  minXValue ]);
376+     double  maxX = MAX ([self   maxXValue ], [envelope  maxXValue ]);
377+     double  minY = MIN ([self   minYValue ], [envelope  minYValue ]);
378+     double  maxY = MAX ([self   maxYValue ], [envelope  maxYValue ]);
331379
332380    SFGeometryEnvelope *unionEnvelope = nil ;
333381
@@ -343,27 +391,27 @@ -(BOOL) containsPoint: (SFPoint *) point{
343391}
344392
345393-(BOOL ) containsPoint :  (SFPoint *) point  withEpsilon :  (double ) epsilon {
346-     return  [self  containsX: [point.x  doubleValue ] andY: [point.y  doubleValue ] withEpsilon: epsilon];
394+     return  [self  containsX: [point  xValue ] andY: [point  yValue ] withEpsilon: epsilon];
347395}
348396
349397-(BOOL ) containsX :  (double ) x  andY :  (double ) y {
350398    return  [self  containsX: x andY: y withEpsilon: 0.0 ];
351399}
352400
353401-(BOOL ) containsX :  (double ) x  andY :  (double ) y  withEpsilon :  (double ) epsilon {
354-     return  x >= [_minX  doubleValue ] - epsilon && x <= [_maxX  doubleValue ] + epsilon
355-         && y >= [_minY  doubleValue ] - epsilon && y <= [_maxY  doubleValue ] + epsilon;
402+     return  x >= [self   minXValue ] - epsilon && x <= [self   maxXValue ] + epsilon
403+         && y >= [self   minYValue ] - epsilon && y <= [self   maxYValue ] + epsilon;
356404}
357405
358406-(BOOL ) containsEnvelope :  (SFGeometryEnvelope *) envelope {
359407    return  [self  containsEnvelope: envelope withEpsilon: 0.0 ];
360408}
361409
362410-(BOOL ) containsEnvelope :  (SFGeometryEnvelope *) envelope  withEpsilon :  (double ) epsilon {
363-     return  [_minX  doubleValue ] - epsilon <= [envelope.minX  doubleValue ]
364-         && [_maxX  doubleValue ] + epsilon >= [envelope.maxX  doubleValue ]
365-         && [_minY  doubleValue ] - epsilon <= [envelope.minY  doubleValue ]
366-         && [_maxY  doubleValue ] + epsilon >= [envelope.maxY  doubleValue ];
411+     return  [self   minXValue ] - epsilon <= [envelope  minXValue ]
412+         && [self   maxXValue ] + epsilon >= [envelope  maxXValue ]
413+         && [self   minYValue ] - epsilon <= [envelope  minYValue ]
414+         && [self   maxYValue ] + epsilon >= [envelope  maxYValue ];
367415}
368416
369417-(SFGeometry *) buildGeometry {
0 commit comments