forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvtkPointsProjectedHull.cxx
813 lines (685 loc) · 21.3 KB
/
vtkPointsProjectedHull.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
/*=========================================================================
Program: Visualization Toolkit
Module: vtkPointsProjectedHull.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*----------------------------------------------------------------------------
Copyright (c) Sandia Corporation
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
----------------------------------------------------------------------------*/
#include "vtkPointsProjectedHull.h"
#include "vtkObjectFactory.h"
vtkStandardNewMacro(vtkPointsProjectedHull);
static const int xdim=0, ydim=1, zdim=2;
static const int xmin=0, xmax=1, ymin=2, ymax=3;
static double firstPt[3];
// Return: >0 for P2 left of the line through P0 and P1
// =0 for P2 on the line
// <0 for P2 right of the line
#define VTK_ISLEFT(P0, P1, P2) \
(((P1)[0] - (P0)[0])*((P2)[1] - (P0)[1]) - ((P2)[0] - (P0)[0])*((P1)[1] - (P0)[1]))
vtkPointsProjectedHull::vtkPointsProjectedHull()
{
this->InitFlags();
}
vtkPointsProjectedHull::~vtkPointsProjectedHull()
{
this->ClearAllocations();
}
void vtkPointsProjectedHull::Initialize()
{
this->ClearAllocations();
this->InitFlags();
vtkPoints::Initialize();
}
void vtkPointsProjectedHull::Update()
{
this->ClearAllocations();
this->InitFlags();
}
void vtkPointsProjectedHull::InitFlags()
{
int i;
this->Pts = NULL;
this->Npts = 0;
for (i=0; i<3; i++)
{
this->CCWHull[i] = NULL;
this->HullSize[i] = 0;
for (int j=0; j<4; j++)
{
this->HullBBox[i][j] = 0.0;
}
}
}
void vtkPointsProjectedHull::ClearAllocations()
{
int i;
for (i=0; i<3; i++)
{
if (this->CCWHull[i])
{
delete [] this->CCWHull[i];
this->CCWHull[i] = NULL;
}
}
if (this->Pts)
{
delete [] this->Pts;
this->Pts = NULL;
}
}
#define VTK_GETCCWHULL(which, dim) \
int vtkPointsProjectedHull::GetCCWHull##which(float *pts, int len)\
{ \
int i; \
double *dpts = new double [len*2]; \
int copypts = this->GetCCWHull##which(dpts, len); \
for (i=0; i<copypts*2; i++) \
{ \
pts[i] = static_cast<float>(dpts[i]); \
} \
delete [] dpts; \
return copypts; \
} \
int vtkPointsProjectedHull::GetCCWHull##which(double *pts, int len)\
{ \
if ((this->HullSize[dim] == 0) || (this->GetMTime() > this->HullTime[dim]))\
{ \
GrahamScanAlgorithm(dim); \
} \
int copylen = (this->HullSize[dim] <= len) ? this->HullSize[dim] : len; \
if (copylen <= 0) return 0; \
memcpy(pts, this->CCWHull[dim], sizeof(double) * 2 * copylen); \
return copylen; \
}
VTK_GETCCWHULL(X, 0);
VTK_GETCCWHULL(Y, 1);
VTK_GETCCWHULL(Z, 2);
#define VTK_GETSIZECCWHULL(which, dim) \
int vtkPointsProjectedHull::GetSizeCCWHull##which()\
{ \
if ((this->HullSize[dim] == 0) || (this->GetMTime() > this->HullTime[dim]))\
{ \
GrahamScanAlgorithm(dim); \
} \
return this->HullSize[dim]; \
}
VTK_GETSIZECCWHULL(X, 0);
VTK_GETSIZECCWHULL(Y, 1);
VTK_GETSIZECCWHULL(Z, 2);
#define VTK_RECTANGLEINTERSECTION(which, dim) \
int vtkPointsProjectedHull::RectangleIntersection##which(vtkPoints *R) \
{ \
double bounds[6]; \
R->Modified(); \
R->GetBounds(bounds); \
double hmin, hmax, vmin, vmax; \
\
hmin = bounds[(dim*2+2)%6]; \
hmax = bounds[(dim*2+2)%6+1]; \
vmin = bounds[(dim*2+4)%6]; \
vmax = bounds[(dim*2+4)%6 + 1]; \
\
return RectangleIntersection##which(hmin, hmax, vmin, vmax); \
} \
int vtkPointsProjectedHull::RectangleIntersection##which(float hmin, \
float hmax, float vmin, float vmax) \
{ \
return RectangleIntersection##which(static_cast<double>(hmin), static_cast<double>(hmax), \
static_cast<double>(vmin), static_cast<double>(vmax)); \
} \
int vtkPointsProjectedHull::RectangleIntersection##which(double hmin,\
double hmax, double vmin, double vmax) \
{ \
if ((this->HullSize[dim] == 0) || (this->GetMTime() > this->HullTime[dim]))\
{ \
GrahamScanAlgorithm(dim); \
} \
return RectangleIntersection(hmin, hmax, vmin, vmax ,dim); \
}
VTK_RECTANGLEINTERSECTION(X, 0);
VTK_RECTANGLEINTERSECTION(Y, 1);
VTK_RECTANGLEINTERSECTION(Z, 2);
// Does the axis-aligned rectangle R intersect the convex polygon
// given by the counter-clockwise enumeration of it's vertices.
//
// Graphics Gems IV, Rectangle-Polygon intersection: Rectangle R
// intersects polygon P if and only if (1) the bounding box
// of P intersects R and (2) R does not lie entirely outside
// any infinite line defined by P's edges. (Outside means if
// you are walking the line in the direction given by the
// ccw orientation of the points of P, R lies completely
// in the half plane on your right.) (Ned Greene)
int vtkPointsProjectedHull::RectangleIntersection(double hmin, double hmax,
double vmin, double vmax, int dim)
{
if (RectangleBoundingBoxIntersection(hmin,hmax,vmin,vmax,dim) == 0)
{
return 0;
}
if (RectangleOutside(hmin,hmax,vmin,vmax, dim) == 1)
{
return 0;
}
return 1;
}
//
// Suppose the points are projected orthogonally in the dir
// of the positive x, y or z axis. Compute the points (2 components)
// of the convex hull of that projection, in counter clockwise order.
//
// "Right hand rule":
//
// | | |
// Z| X| Y|
// | | |
// | | |
// ------- Y -------- Z -------X
// along X-axis along Y-axis along Z-axis
//
// Algorithm comes from Graphics Gems IV
//
extern "C"
{
int vtkPointsProjectedHullIncrVertAxis(const void *p1, const void *p2);
int vtkPointsProjectedHullCCW(const void *p1, const void *p2);
}
int vtkPointsProjectedHull::GrahamScanAlgorithm(int dir)
{
int horizAxis = 0, vertAxis = 0;
int i,j;
if ((this->Npts == 0) || (this->GetMTime() > this->PtsTime))
{
GetPoints();
}
// I'm not sure what I'm doing here but the current code is clearly screwed
// up and doesn't handle some degenerate cases
if (this->Npts == 0)
{
return 0;
}
switch (dir)
{
case xdim:
horizAxis = ydim;
vertAxis = zdim;
break;
case ydim:
horizAxis = zdim;
vertAxis = xdim;
break;
case zdim:
horizAxis = xdim;
vertAxis = ydim;
break;
}
// Find the lowest, rightmost point in the set
double *hullPts = new double[this->Npts*2];
for (i=0; i<this->Npts; i++)
{
hullPts[i*2] = this->Pts[i*3 + horizAxis];
hullPts[i*2 + 1] = this->Pts[i*3 + vertAxis];
}
qsort(hullPts, this->Npts, sizeof(double) * 2, vtkPointsProjectedHullIncrVertAxis);
int firstId = 0;
for (i=1; i<this->Npts; i++)
{
if (hullPts[i*2 + 1] != hullPts[1]) break;
if (hullPts[i*2] > hullPts[firstId*2])
{
firstId = i;
}
}
firstPt[0] = hullPts[firstId * 2]; // lowest, rightmost
firstPt[1] = hullPts[firstId * 2 + 1];
if (firstId != 0)
{
hullPts[2*firstId] = hullPts[0];
hullPts[2*firstId + 1] = hullPts[1];
hullPts[0] = firstPt[0];
hullPts[1] = firstPt[1];
}
// If there are duplicates of the first point in the
// projection, the vtkPointsProjectedHullCCW sort will fail.
int dups = 0;
for (j=1, i=1; j < this->Npts; j++)
{
if ( !dups && (hullPts[j*2+1] != hullPts[1])) break;
if ( (hullPts[j*2+1] != hullPts[1]) || (hullPts[j*2] != hullPts[0]))
{
if (j > i)
{
hullPts[i*2] = hullPts[j*2];
hullPts[i*2+1] = hullPts[j*2+1];
}
i++;
}
else
{
dups++;
}
}
int nHullPts = this->Npts - dups;
// I'm not sure what I'm doing here but the current code is clearly screwed
// up and doesn't handle some degenerate cases
if (nHullPts == 0)
{
return 0;
}
// Sort in counter clockwise order the other points by the angle
// they make with the line through firstPt parallel to the
// horizontal axis.
// (For a tie: choose the point furthest from firstPt.)
// P2 makes a greater angle than P1 if it is left of the line
// formed by firstPt - P1.
qsort(hullPts+2, nHullPts - 1, sizeof(double)*2, vtkPointsProjectedHullCCW);
// Remove sequences of duplicate points, and remove interior
// points on the same ray from the initial point
nHullPts = RemoveExtras(hullPts, nHullPts);
// Now make list of points on the convex hull.
int top = 1;
for (i=2; i<nHullPts; i++)
{
int newpos = PositionInHull(hullPts, hullPts + top*2, hullPts + i*2);
hullPts[newpos*2] = hullPts[i*2];
hullPts[newpos*2+ 1] = hullPts[i*2+ 1];
top = newpos;
}
nHullPts = top + 1;
// hull bounding box
double x0 = hullPts[0];
double x1 = hullPts[0];
double y0 = hullPts[1];
double y1 = hullPts[1];
for (i=1; i<nHullPts; i++)
{
if (hullPts[2*i] < x0)
{
x0 = hullPts[2*i];
}
else if (hullPts[2*i] > x1)
{
x1 = hullPts[2*i];
}
if (hullPts[2*i+1] < y0)
{
y0 = hullPts[2*i+1];
}
else if (hullPts[2*i+1] > y1)
{
y1 = hullPts[2*i+1];
}
}
this->HullBBox[dir][xmin] = static_cast<float>(x0);
this->HullBBox[dir][xmax] = static_cast<float>(x1);
this->HullBBox[dir][ymin] = static_cast<float>(y0);
this->HullBBox[dir][ymax] = static_cast<float>(y1);
this->HullSize[dir] = nHullPts;
if (this->CCWHull[dir])
{
delete [] this->CCWHull[dir];
}
this->CCWHull[dir] = new double[nHullPts*2];
memcpy(this->CCWHull[dir], hullPts, sizeof(double) * 2 * nHullPts);
delete [] hullPts;
this->HullTime[dir].Modified();
return 0;
}
double vtkPointsProjectedHull::Distance(double *p1, double *p2)
{
return (p1[0] - p2[0])*(p1[0] - p2[0]) + (p1[1] - p2[1])*(p1[1] - p2[1]);
}
int vtkPointsProjectedHull::RemoveExtras(double *pts, int n)
{
int i, prev, skipMe, coord;
double where;
prev = 0;
for (i=1; i<n; i++)
{
skipMe = 0;
// case: point is equal to previous point
if ((pts[i*2] == pts[prev*2]) && (pts[i*2+ 1] == pts[prev*2+ 1]))
{
skipMe = 1;
}
// case: point is at same angle as previous point -
// discard the point that is closest to first point
else if (prev >= 1)
{
where = VTK_ISLEFT(pts, pts + prev*2, pts + i*2);
if (where == 0) // on same ray from first point
{
double d1 = Distance(pts, pts + prev*2);
double d2 = Distance(pts, pts + i*2);
if (d2 > d1) // save only the most distant
{
for (coord=0; coord<2; coord++)
{
pts[prev*2+ coord] = pts[i*2+ coord];
}
}
skipMe = 1;
}
}
if (!skipMe)
{
prev++;
if (prev < i)
{
for (coord=0; coord<2; coord++)
{
pts[prev*2+ coord] = pts[i*2+ coord];
}
}
}
}
return prev+1; // size of new list
}
int vtkPointsProjectedHull::PositionInHull(double *base, double *top, double *pt)
{
double *p1, *p2;
double where;
p2 = top;
p1 = p2 - 2;
// Because of the way the vertices are sorted, the new vertex
// is part of convex hull so far. But the previous vertex
// could now be inside the convex hull if the new vertex is to
// the right of the line formed by the previous two vertices.
while (p2 > base)
{
where = VTK_ISLEFT(p1, p2, pt);
// If vertex is to left of line, don't remove previous points
if (where > 0)
{
break;
}
// If vertex is to right of line, remove previous point and
// check again. If vertex is on line, previous point is
// redundant.
p2 -= 2; // pop top of stack
p1 -= 2;
}
// return the position in the list where the new vertex goes
return ((p2 - base) / 2) + 1;
}
void vtkPointsProjectedHull::GetPoints()
{
int i;
if (this->Pts)
{
delete [] this->Pts;
}
this->Npts = this->Data->GetNumberOfTuples();
this->Pts = new double [this->Npts*3];
for (i=0; i<this->Npts; i++)
{
this->Pts[i*3] = this->Data->GetComponent(i, 0);
this->Pts[i*3 + 1] = this->Data->GetComponent(i, 1);
this->Pts[i*3 + 2] = this->Data->GetComponent(i, 2);
}
this->PtsTime.Modified();
}
int vtkPointsProjectedHull::
RectangleBoundingBoxIntersection(double hmin, double hmax,
double vmin, double vmax, int dim)
{
float *r2Bounds = this->HullBBox[dim];
if ((hmin > r2Bounds[xmax]) ||
(hmax < r2Bounds[xmin]) ||
(vmin > r2Bounds[ymax]) ||
(vmax < r2Bounds[ymin]))
{
return 0;
}
return 1;
}
#define sameDirection(a, b) ((((a)==0) && ((b)<0)) || (((a)>0) && ((b)>0)))
int vtkPointsProjectedHull::
OutsideHorizontalLine(double vmin, double vmax,
double *p0, double *, double *insidePt)
{
if (insidePt[1] > p0[1])
{
if (vmax <= p0[1])
{
return 1;
}
else
{
return 0;
}
}
else
{
if (vmin >= p0[1])
{
return 1;
}
else
{
return 0;
}
}
}
int vtkPointsProjectedHull::
OutsideVerticalLine(double hmin, double hmax,
double *p0, double *, double *insidePt)
{
if (insidePt[0] > p0[0])
{
if (hmax <= p0[0])
{
return 1;
}
else
{
return 0;
}
}
else
{
if (hmin >= p0[0])
{
return 1;
}
else
{
return 0;
}
}
}
int vtkPointsProjectedHull::
OutsideLine(double hmin, double hmax, double vmin, double vmax,
double *p0, double *p1, double *insidePt)
{
int i;
if ((p1[1] - p0[1]) == 0)
{
return OutsideHorizontalLine(vmin, vmax, p0, p1, insidePt);
}
if ((p1[0] - p0[0]) == 0)
{
return OutsideVerticalLine(hmin, hmax, p0, p1, insidePt);
}
// Are any of the points of the rectangle in the same half-plane as the
// inside point?
double ip = VTK_ISLEFT(p0, p1, insidePt);
double rp;
double pts[4][2];
pts[0][0] = hmin; pts[0][1] = vmin;
pts[1][0] = hmin; pts[1][1] = vmax;
pts[2][0] = hmax; pts[2][1] = vmax;
pts[3][0] = hmax; pts[3][1] = vmin;
for (i=0; i < 4; i++)
{
rp = VTK_ISLEFT(p0, p1, pts[i]);
if ( ((rp < 0) && (ip < 0)) || ((rp > 0) && (ip > 0)) )
{
return 0;
}
}
return 1;
}
int vtkPointsProjectedHull::RectangleOutside(double hmin, double hmax,
double vmin, double vmax, int dir)
{
int i;
int npts = this->HullSize[dir];
if (npts == 2)
{
return this->RectangleOutside1DPolygon(hmin, hmax, vmin, vmax, dir);
}
// a representative point inside the polygon
double *insidePt = new double[2];
insidePt[0] = this->CCWHull[dir][0];
insidePt[1] = this->CCWHull[dir][1];
insidePt[0] += this->CCWHull[dir][4];
insidePt[1] += this->CCWHull[dir][5];
if (npts == 3)
{
insidePt[0] += this->CCWHull[dir][2];
insidePt[1] += this->CCWHull[dir][3];
insidePt[0] /= 3;
insidePt[1] /= 3;
}
else
{
insidePt[0] /= 2;
insidePt[1] /= 2;
}
// For each infinite line given by the line segments of the
// polygon, determine if rectangle is entirely outside that line.
// If so, it must be outside the polygon.
for (i=0; i < npts-1; i++)
{
if (OutsideLine(hmin,hmax,vmin,vmax,
this->CCWHull[dir] + 2*i,
this->CCWHull[dir] + 2*i + 2,
insidePt))
{
return 1;
}
}
delete [] insidePt;
// KDM: The test above is sufficient for the polygon to be outside the box,
// but not necessary. Consider the following bounding box and triangle.
//
// +-----------------------+ //
// | | //
// | | //
// +-----------------------+ //
// //
// /\ //
// / \ //
// ---- //
//
// In this case, the triangle fails the test above but is still outside.
// Someone concerned about this should fix this test.
return 0;
}
int vtkPointsProjectedHull::RectangleOutside1DPolygon(double hmin, double hmax,
double vmin, double vmax, int dir)
{
int i;
double *p0 = this->CCWHull[dir];
double *p1 = this->CCWHull[dir] + 2;
double pts[4][2];
pts[0][0] = hmin; pts[0][1] = vmin;
pts[1][0] = hmin; pts[1][1] = vmax;
pts[2][0] = hmax; pts[2][1] = vmax;
pts[3][0] = hmax; pts[3][1] = vmin;
double side;
double reference=0.0;
for (i=0; i<4; i++)
{
side = VTK_ISLEFT(p0, p1,pts[i]);
if (reference != 0.0)
{
if (side != reference)
{
return 0; // two points are on opposite sides of the line
}
}
else if (side != 0.0)
{
reference = side;
}
}
// all four vertices are either on the line or on the same side
// of the line
return 1;
}
// The sort functions
extern "C"
{
int vtkPointsProjectedHullIncrVertAxis(const void *p1, const void *p2)
{
double *a, *b;
a = (double *)p1;
b = (double *)p2;
if (a[1] < b[1])
{
return -1;
}
else if (a[1] == b[1])
{
return 0;
}
else
{
return 1;
}
}
int vtkPointsProjectedHullCCW(const void *p1, const void *p2)
{
double *a, *b;
double val;
a = (double *)p1;
b = (double *)p2;
// sort in counter clockwise order from first point
val = VTK_ISLEFT(firstPt, a, b);
if (val < 0)
{
return 1; // b is right of line firstPt->a
}
else if (val == 0)
{
return 0; // b is on line firstPt->a
}
else
{
return -1; // b is left of line firstPt->a
}
}
}
void vtkPointsProjectedHull::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "Pts: " << this->Pts << endl;
os << indent << "Npts: " << this->Npts << endl;
os << indent << "PtsTime: " << this->PtsTime << endl;
os << indent << "CCWHull X: " << this->CCWHull[0] << endl;
os << indent << "HullBBox X: [" ;
os << this->HullBBox[0][0] << ", " << this->HullBBox[0][1] << "] [";
os << this->HullBBox[0][2] << ", " << this->HullBBox[0][3] << "] ";
os << indent << "HullSize X: " << this->HullSize[0] << endl;
os << indent << "HullTime X: " << this->HullTime[0] << endl;
os << indent << "CCWHull Y: " << this->CCWHull[1] << endl;
os << indent << "HullBBox Y: [" ;
os << this->HullBBox[1][0] << ", " << this->HullBBox[1][1] << "] [";
os << this->HullBBox[1][2] << ", " << this->HullBBox[1][3] << "] ";
os << indent << "HullSize Y: " << this->HullSize[1] << endl;
os << indent << "HullTime Y: " << this->HullTime[1] << endl;
os << indent << "CCWHull Z: " << this->CCWHull[2] << endl;
os << indent << "HullBBox Z: [" ;
os << this->HullBBox[2][0] << ", " << this->HullBBox[2][1] << "] [";
os << this->HullBBox[2][2] << ", " << this->HullBBox[2][3] << "] ";
os << indent << "HullSize Z: " << this->HullSize[2] << endl;
os << indent << "HullTime Z: " << this->HullTime[2] << endl;
}