#ifndef _Polygon3_h__ #define _Polygon3_h__ //#include //#include //#include "common.h" #include "Containers.h" #include class Mesh; class Plane3; class Face; namespace GtpVisibilityPreprocessor { /** Class representing a general planar polygon in 3d. */ class Polygon3 { public: Polygon3(); Polygon3(const VertexContainer &vertices); /** Copies all the vertices of the face. */ Polygon3(Face *face, Mesh *parent); /** Returns supporting plane of this polygon. */ Plane3 GetSupportingPlane(); /** Splits polygon. @param partition the split plane @param front the front polygon @param back the back polygon @param splits number of splits */ void Split(Plane3 *partition, Polygon3 *front, Polygon3 *back, int &splits); enum {BACK_SIDE, FRONT_SIDE, SPLIT, COINCIDENT}; /** Side of the plane where the polygon is located. @returns one of BACK_SIDE, FRONT_SIDE, SPLIT, COINCIDENT */ int Side(Plane3 *plane); /// vertices are connected in counterclockwise order. VertexContainer mVertices; }; } #endif