<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PGPOLYEXT data type in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/PGPOLYEXT-data-type/m-p/116323#M5722</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
if you want to get the area from your Polygon2DData, you don't have to convert it! Sorry if I was misleading.&lt;BR /&gt;
&lt;BR /&gt;
You can use the following function:
&lt;PRE&gt;double Geometry::GetPolygon2DDataArea (const Polygon2DData&amp;amp; polygon2DData, bool isPolyLine = false);&lt;/PRE&gt;

For example:
&lt;PRE&gt;double area = Geometry::GetPolygon2DDataArea (myPolygon2DData);&lt;/PRE&gt;

To find more geometry functions with Polygon2DData see the Polygon2DData.h header file in the DevKit's Support\Modules\Geometry\ folder.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Tibi</description>
    <pubDate>Thu, 30 May 2013 14:48:15 GMT</pubDate>
    <dc:creator>Tibor Lorantfy</dc:creator>
    <dc:date>2013-05-30T14:48:15Z</dc:date>
    <item>
      <title>PGPOLYEXT data type</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/PGPOLYEXT-data-type/m-p/116318#M5717</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I want to use some of the geometry functions;&lt;BR /&gt;&lt;BR /&gt;Geometry::PGPolyAreaExt&lt;BR /&gt;Geometry::PGPolyPositionExt&lt;BR /&gt;&lt;BR /&gt;To find area &amp;amp; polygon position status for two polygons.&lt;BR /&gt;&lt;BR /&gt;I have the 2 polygons as type Polygon2Ddata. Can anyone explain how to convert from Polygon2Ddata to PGPOLYEXT type?&lt;BR /&gt;&lt;BR /&gt;Any ideas would be appreciated.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Danny&lt;/DIV&gt;</description>
      <pubDate>Wed, 02 Aug 2023 13:25:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/PGPOLYEXT-data-type/m-p/116318#M5717</guid>
      <dc:creator>Danny Sparks-Cousins</dc:creator>
      <dc:date>2023-08-02T13:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: PGPOLYEXT data type</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/PGPOLYEXT-data-type/m-p/116319#M5718</link>
      <description>Hi Danny, &lt;BR /&gt;
 &lt;BR /&gt;
Here's a short example code for you to convert Polygon2Ddata to PGPOLYEXT: &lt;BR /&gt;
 
&lt;PRE&gt;GSErrCode Convert_Polygon2DData_To_PGPOLYEXT (const Geometry::Polygon2DData&amp;amp; 	polygon2DData, 
																Geometry::PGPOLYEXT*			pgPOLYEXT) 
{ 
	if (&amp;amp;polygon2DData == NULL) 
		return ErrParam; 
 
	BNZeroMemory (pgPOLYEXT, sizeof (Geometry::PGPOLYEXT)); 
 
	// here comes a little bit ugly cast 
	pgPOLYEXT-&amp;gt;data = reinterpret_cast&amp;lt;GSPtr&amp;gt; (const_cast&amp;lt;Geometry::Polygon2DData*&amp;gt; (&amp;amp;polygon2DData)); 
 
	// Perhaps you need to set some other attributes too: 
	//  pgPOLYEXT-&amp;gt;status.isSameDirEdgeLegal = polygon2DData.status.isSameDirEdgeLegal; 
	//  pgPOLYEXT-&amp;gt;epsilon = SMALLEPS * 8; 
	//  pgPOLYEXT-&amp;gt;minVertexDist = 3 * pgPOLYEXT-&amp;gt;epsilon; 
 
	return NoError; 
} 
 
/* --------------- Usage example: -------------------------- */ 
 
Geometry::Polygon2DData 	polygon2DData;
Geometry::PGPOLYEXT 		pgPOLYEXT;
 
Convert_Polygon2DData_To_PGPOLYEXT (polygon2DData, &amp;amp;pgPOLYEXT);&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
Sorry, I've never tried that, but it seems correct.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Tibi</description>
      <pubDate>Thu, 14 Feb 2013 11:29:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/PGPOLYEXT-data-type/m-p/116319#M5718</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2013-02-14T11:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: PGPOLYEXT data type</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/PGPOLYEXT-data-type/m-p/116320#M5719</link>
      <description>Excellent - thanks Tibor</description>
      <pubDate>Sat, 16 Feb 2013 08:44:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/PGPOLYEXT-data-type/m-p/116320#M5719</guid>
      <dc:creator>Danny Sparks-Cousins</dc:creator>
      <dc:date>2013-02-16T08:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: PGPOLYEXT data type</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/PGPOLYEXT-data-type/m-p/116321#M5720</link>
      <description>OK - I havent quite got my head around how to use the PGPOLYEXT data and functions.&lt;BR /&gt;
&lt;BR /&gt;
I have a need to perform some operations on two existing zones - from the documentation it looks like the following functions would work well for what I need;&lt;BR /&gt;
&lt;BR /&gt;
PGPolyUnionExt to combine two different zone polygons&lt;BR /&gt;
PGPolyIntersectionExt to intersect two different zone polygons&lt;BR /&gt;
PGCoordInPolyExt to check if a point is within a zone polygon &lt;BR /&gt;
PGPolyAreaExt to calculate the area of the PGPoly results&lt;BR /&gt;
&lt;BR /&gt;
I am having trouble doing anything with PGPOLYEXT data at all though. I tried Tibor's example to convert a simple Polygon2DData to PGPOLYEXT but still couldnt get actual results even from PGPolyAreaExt.&lt;BR /&gt;
&lt;BR /&gt;
Am I on the right track in using this data type and these functions for what I want to achieve with the zone polygon data? If anyone has some thoughts and ideas to step me through that would be greatly appreciated - or even some very simple example using polygon data and PGPOLYEXT data functions?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Danny</description>
      <pubDate>Wed, 15 May 2013 10:28:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/PGPOLYEXT-data-type/m-p/116321#M5720</guid>
      <dc:creator>Danny Sparks-Cousins</dc:creator>
      <dc:date>2013-05-15T10:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: PGPOLYEXT data type</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/PGPOLYEXT-data-type/m-p/116322#M5721</link>
      <description>Bump.&lt;BR /&gt;
&lt;BR /&gt;
Does anyone have any thoughts about this, or used the PGPOLYEXT functions?</description>
      <pubDate>Tue, 28 May 2013 23:43:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/PGPOLYEXT-data-type/m-p/116322#M5721</guid>
      <dc:creator>Danny Sparks-Cousins</dc:creator>
      <dc:date>2013-05-28T23:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: PGPOLYEXT data type</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/PGPOLYEXT-data-type/m-p/116323#M5722</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
if you want to get the area from your Polygon2DData, you don't have to convert it! Sorry if I was misleading.&lt;BR /&gt;
&lt;BR /&gt;
You can use the following function:
&lt;PRE&gt;double Geometry::GetPolygon2DDataArea (const Polygon2DData&amp;amp; polygon2DData, bool isPolyLine = false);&lt;/PRE&gt;

For example:
&lt;PRE&gt;double area = Geometry::GetPolygon2DDataArea (myPolygon2DData);&lt;/PRE&gt;

To find more geometry functions with Polygon2DData see the Polygon2DData.h header file in the DevKit's Support\Modules\Geometry\ folder.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Tibi</description>
      <pubDate>Thu, 30 May 2013 14:48:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/PGPOLYEXT-data-type/m-p/116323#M5722</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2013-05-30T14:48:15Z</dc:date>
    </item>
  </channel>
</rss>

