2013-02-11
03:08 AM
- last edited on
2023-08-02
03:25 PM
by
Doreena Deng
2013-02-14 12:29 PM
GSErrCode Convert_Polygon2DData_To_PGPOLYEXT (const Geometry::Polygon2DData& polygon2DData,
Geometry::PGPOLYEXT* pgPOLYEXT)
{
if (&polygon2DData == NULL)
return ErrParam;
BNZeroMemory (pgPOLYEXT, sizeof (Geometry::PGPOLYEXT));
// here comes a little bit ugly cast
pgPOLYEXT->data = reinterpret_cast<GSPtr> (const_cast<Geometry::Polygon2DData*> (&polygon2DData));
// Perhaps you need to set some other attributes too:
// pgPOLYEXT->status.isSameDirEdgeLegal = polygon2DData.status.isSameDirEdgeLegal;
// pgPOLYEXT->epsilon = SMALLEPS * 8;
// pgPOLYEXT->minVertexDist = 3 * pgPOLYEXT->epsilon;
return NoError;
}
/* --------------- Usage example: -------------------------- */
Geometry::Polygon2DData polygon2DData;
Geometry::PGPOLYEXT pgPOLYEXT;
Convert_Polygon2DData_To_PGPOLYEXT (polygon2DData, &pgPOLYEXT); 2013-02-16 09:44 AM
2013-05-15 12:28 PM
2013-05-29 01:43 AM
2013-05-30 04:48 PM
double Geometry::GetPolygon2DDataArea (const Polygon2DData& polygon2DData, bool isPolyLine = false);For example:
double area = Geometry::GetPolygon2DDataArea (myPolygon2DData);To find more geometry functions with Polygon2DData see the Polygon2DData.h header file in the DevKit's Support\Modules\Geometry\ folder.