uint8 csBoxClipper::Clip (csVector2 * InPolygon, size_t InCount, csVector2 * OutPolygon, size_t & OutCount) { BoxTestAll b; StatusOutputNone n; CS::BoxClipper < BoxTestAll, StatusOutputNone > boxClip (b, n, region, InPolygon, InCount, OutPolygon); uint8 Clipped = boxClip.Clip (); }
uint8 csBoxClipper::Clip ( csVector2 *InPolygon, size_t InCount, csVector2 *OutPolygon, size_t &OutCount, csVertexStatus *OutStatus) { csVertexStatus TempStatus [MAX_OUTPUT_VERTICES]; BoxTestAll b; StatusOutputDefault d(TempStatus, InCount, OutStatus); CS::BoxClipper<BoxTestAll, StatusOutputDefault> boxClip (b, d, region, InPolygon, InCount, OutPolygon); uint8 Clipped = boxClip.Clip(); OutCount = boxClip.GetOutputCount(); return Clipped; }
uint8 csBoxClipper::Clip ( csVector2 *InPolygon, size_t InCount, csVector2 *OutPolygon, size_t &OutCount, csBox2 &BoundingBox) { if (!region.Overlap (BoundingBox)) return CS_CLIP_OUTSIDE; CS::BoxClipper<BoxTestBbox, StatusOutputNone> boxClip (BoxTestBbox (BoundingBox, region), StatusOutputNone(), region, InPolygon, InCount, OutPolygon); uint8 Clipped = boxClip.Clip(); OutCount = boxClip.GetOutputCount(); BoundingBox.StartBoundingBox (OutPolygon[0]); size_t i; for (i = 1; i < OutCount; i++) BoundingBox.AddBoundingVertexSmart (OutPolygon[i]); return Clipped; }