CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

clip2d.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2000 by Jorrit Tyberghein
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #ifndef __CS_IGEOM_CLIP2D_H__
00020 #define __CS_IGEOM_CLIP2D_H__
00021 
00029 #include "csutil/scf.h"
00030 #include "csgeom/vector2.h"
00031 #include "csgeom/box.h"
00032 
00034 #define MAX_OUTPUT_VERTICES     64
00035 
00045 
00046 #define CS_CLIP_OUTSIDE         0
00047 
00048 #define CS_CLIP_INSIDE          1
00049 
00050 #define CS_CLIP_CLIPPED         2
00051 
00061 struct csVertexStatus
00062 {
00067   unsigned char Type;
00069   unsigned char Vertex;
00071   float Pos;
00072 };
00073 
00075 #define CS_VERTEX_ORIGINAL      0
00076 
00077 #define CS_VERTEX_ONEDGE        1
00078 
00079 #define CS_VERTEX_INSIDE        2
00080 
00083 SCF_VERSION (iClipper2D, 0, 0, 2);
00084 
00088 struct iClipper2D : public iBase
00089 {
00095   virtual uint8 Clip (csVector2 *InPolygon, int InCount,
00096     csVector2 *OutPolygon, int &OutCount) = 0;
00097 
00106   virtual uint8 Clip (csVector2 *InPolygon, int InCount,
00107     csVector2 *OutPolygon, int &OutCount, csBox2 &BoundingBox) = 0;
00108 
00118   virtual uint8 Clip (csVector2 *InPolygon, int InCount,
00119     csVector2 *OutPolygon, int &OutCount, csVertexStatus *OutStatus) = 0;
00120 
00125   virtual uint8 ClipInPlace (csVector2 *InPolygon, int &InOutCount, csBox2 &BoundingBox) = 0;
00126 
00136   virtual int ClassifyBox (const csBox2 &box) = 0;
00137 
00139   virtual bool IsInside (const csVector2& v) = 0;
00140 
00142   virtual int GetVertexCount () = 0;
00143 
00145   virtual csVector2 *GetClipPoly () = 0;
00146 };
00147 
00150 #endif // __CS_IGEOM_CLIP2D_H__
00151 

Generated for Crystal Space by doxygen 1.2.14