{"id":88,"date":"2015-11-30T18:41:25","date_gmt":"2015-11-30T18:41:25","guid":{"rendered":"http:\/\/o-calcpro.com\/wiki\/?p=88"},"modified":"2015-11-30T18:41:25","modified_gmt":"2015-11-30T18:41:25","slug":"the-show-on-google-earth-o-calc-pro-plugin-explained","status":"publish","type":"post","link":"http:\/\/o-calcpro.com\/wiki\/2015\/11\/30\/the-show-on-google-earth-o-calc-pro-plugin-explained\/","title":{"rendered":"The &#8216;Show on Google Earth&#8217; O-Calc Pro Plugin Explained"},"content":{"rendered":"<p>As a more advanced example of an O-Calc Pro plugin, this article describes the \u2018Show on Google Earth\u2019 Plugin. First to understand how this particular integration with Google Earth works from a user perspective, have a look at the following video.<\/p>\n<p><iframe width=\"420\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/O-5_592OdK0\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>The \u2018Show on Google Earth\u2019 plugin is a Menu Item style plugin and has been placed within the File drop down menu in the O-Calc Pro interface. The \u2018Show on Google Earth\u2019 menu pick also has four sub menu items called \u2018Show Marker\u2019, \u2018Render Structure\u2019, \u2018Batch Create Index\u2019, and \u2018Help\u2019. The code snippets below show some of this house keeping:<\/p>\n<div id=\"ig-sh-1\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">C#<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"csharp\" style=\"font-family:monospace\"><li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008080\">#region HOUSEKEEPING<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">PPL_Lib<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">PPLMain<\/span> cPPLMain <span style=\"color: #008000\">=<\/span> <span style=\"color: #0600FF;font-weight: bold\">null<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">public<\/span> PLUGIN_TYPE Type<\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">get<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">return<\/span> PLUGIN_TYPE<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">MENU_ITEM<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">public<\/span> <span style=\"color: #6666cc;font-weight: bold\">String<\/span> Name<\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">get<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">return<\/span> <span style=\"color: #666666\">&quot;Show on Google Earth&quot;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">public<\/span> <span style=\"color: #6666cc;font-weight: bold\">String<\/span> Description<\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">get<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">return<\/span> <span style=\"color: #666666\">&quot;Show on Google Earth&quot;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><span style=\"color: #0600FF;font-weight: bold\">public<\/span> <span style=\"color: #6666cc;font-weight: bold\">void<\/span> AddToMenu<span style=\"color: #008000\">&#040;<\/span>PPL_Lib<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">PPLMain<\/span> pPPLMain, <span style=\"color: #000000\">System<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Windows<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Forms<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">ToolStrip<\/span> pToolStrip<span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cPPLMain <span style=\"color: #008000\">=<\/span> pPPLMain<span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cShowOnGoogleEarthButton <span style=\"color: #008000\">=<\/span> <span style=\"color: #008000\">new<\/span> ToolStripMenuItem<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #666666\">&quot;Show on Google Earth&quot;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #6666cc;font-weight: bold\">int<\/span> itemindex <span style=\"color: #008000\">=<\/span> <span style=\"color: #FF0000\">0<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000\">System.<span style=\"color: #0000FF\">Diagnostics<\/span><\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Debug<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Assert<\/span><span style=\"color: #008000\">&#040;<\/span>pToolStrip<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Items<\/span><span style=\"color: #008000\">&#091;<\/span>itemindex<span style=\"color: #008000\">&#093;<\/span> <span style=\"color: #008000\">is<\/span> ToolStripDropDownButton<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">if<\/span> <span style=\"color: #008000\">&#040;<\/span>pToolStrip<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Items<\/span><span style=\"color: #008000\">&#091;<\/span>itemindex<span style=\"color: #008000\">&#093;<\/span> <span style=\"color: #008000\">is<\/span> ToolStripDropDownButton<span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">ToolStripDropDownButton tsb <span style=\"color: #008000\">=<\/span> pToolStrip<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Items<\/span><span style=\"color: #008000\">&#091;<\/span>itemindex<span style=\"color: #008000\">&#093;<\/span> <span style=\"color: #0600FF;font-weight: bold\">as<\/span> ToolStripDropDownButton<span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000\">System.<span style=\"color: #0000FF\">Diagnostics<\/span><\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Debug<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Assert<\/span><span style=\"color: #008000\">&#040;<\/span>tsb<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Text<\/span> <span style=\"color: #008000\">==<\/span> <span style=\"color: #666666\">&quot;&amp;amp;File&quot;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">tsb<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">DropDownItems<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Insert<\/span><span style=\"color: #008000\">&#040;<\/span>tsb<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">DropDownItems<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Count<\/span> <span style=\"color: #008000\">-<\/span> <span style=\"color: #FF0000\">1<\/span>, cShowOnGoogleEarthButton<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">tsb<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">DropDownItems<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Insert<\/span><span style=\"color: #008000\">&#040;<\/span>tsb<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">DropDownItems<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Count<\/span> <span style=\"color: #008000\">-<\/span> <span style=\"color: #FF0000\">1<\/span>, <span style=\"color: #008000\">new<\/span> ToolStripSeparator<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">tsb<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">DropDownOpened<\/span> <span style=\"color: #008000\">+=<\/span> tsb_DropDownOpened<span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cShowMarkerButton <span style=\"color: #008000\">=<\/span> <span style=\"color: #008000\">new<\/span> ToolStripMenuItem<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #666666\">&quot;Show Marker&quot;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cRenderStructureButton <span style=\"color: #008000\">=<\/span> <span style=\"color: #008000\">new<\/span> ToolStripMenuItem<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #666666\">&quot;Render Structure&quot;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cCreateIndexeButton <span style=\"color: #008000\">=<\/span> <span style=\"color: #008000\">new<\/span> ToolStripMenuItem<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #666666\">&quot;Batch Create Index&quot;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cHelpButton <span style=\"color: #008000\">=<\/span> <span style=\"color: #008000\">new<\/span> ToolStripMenuItem<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #666666\">&quot;Help&quot;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cShowOnGoogleEarthButton<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">DropDownItems<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span>cShowMarkerButton<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cShowMarkerButton<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Click<\/span> <span style=\"color: #008000\">+=<\/span> cShowMarkerButton_Click<span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cShowOnGoogleEarthButton<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">DropDownItems<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span>cRenderStructureButton<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cRenderStructureButton<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Click<\/span> <span style=\"color: #008000\">+=<\/span> cRenderStructureButton_Click<span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cShowOnGoogleEarthButton<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">DropDownItems<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">new<\/span> ToolStripSeparator<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cShowOnGoogleEarthButton<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">DropDownItems<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span>cCreateIndexeButton<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cCreateIndexeButton<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Click<\/span> <span style=\"color: #008000\">+=<\/span> cCreateIndexeButton_Click<span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cShowOnGoogleEarthButton<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">DropDownItems<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span>cHelpButton<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cHelpButton<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Click<\/span> <span style=\"color: #008000\">+=<\/span> cHelpButton_Click<span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>When the \u2018Render Structure\u2019 submenu option is clicked, the plugin makes a call to the private method \u201cExportToCollada()\u201d that has the principle function to create a KML file that gets sent to the Google Earth application. It does this by accomplishing three major tasks:<\/p>\n<ol>\n<li>It uses the PPLMain method GetMainStructure().GetValueAndConvertToString(\u201cPole Number\u201d) to get the pole number attribute of the pole to be used for the name of KML file.<\/li>\n<li>It obtains the Latitude and Longitude of the pole (provided they are not set to zero) and adds this coordinate pair to the KML file. It gets the Lat\/Long values using the PoleLocation members variables obtained with the PPLMain.GetMaintStructure() method.<\/li>\n<li>And finally, it creates a DAE (digital asset exchange) file, which is a 3D interchange file format based on the COLLADA XML schema (https:\/\/www.khronos.org\/collada\/ gives more information on the COLLADA specifications). The plugin has two privately defined methods BuildMesh() and BoundingMeshes() that creates a 3D mesh of the O-Calc Pro model geometry. The BuildMesh() method takes each element of the O-Calc Pro model and converts the 3D geometry model into a mesh geometry as required for the DAE file format.<\/li>\n<\/ol>\n<div id=\"ig-sh-2\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">C#<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"csharp\" style=\"font-family:monospace\"><li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">private<\/span> <span style=\"color: #6666cc;font-weight: bold\">void<\/span> BoundingMeshes<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #6666cc;font-weight: bold\">double<\/span> rangeX <span style=\"color: #008000\">=<\/span> <span style=\"color: #FF0000\">0<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #6666cc;font-weight: bold\">double<\/span> rangeZ <span style=\"color: #008000\">=<\/span> <span style=\"color: #FF0000\">0<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">foreach<\/span> <span style=\"color: #008000\">&#040;<\/span>Mesh mesh <span style=\"color: #0600FF;font-weight: bold\">in<\/span> cMeshes<span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">foreach<\/span> <span style=\"color: #008000\">&#040;<\/span>Point3D pt <span style=\"color: #0600FF;font-weight: bold\">in<\/span> mesh<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">cPoints<\/span><span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">rangeX <span style=\"color: #008000\">=<\/span> Math<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Max<\/span><span style=\"color: #008000\">&#040;<\/span>Math<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Abs<\/span><span style=\"color: #008000\">&#040;<\/span>pt<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">X<\/span><span style=\"color: #008000\">&#041;<\/span>, rangeX<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">rangeZ <span style=\"color: #008000\">=<\/span> Math<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Max<\/span><span style=\"color: #008000\">&#040;<\/span>Math<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Abs<\/span><span style=\"color: #008000\">&#040;<\/span>pt<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Z<\/span><span style=\"color: #008000\">&#041;<\/span>, rangeZ<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">Mesh result <span style=\"color: #008000\">=<\/span> <span style=\"color: #008000\">new<\/span> Mesh<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008080;font-style: italic\">\/\/add corner markers to make it center on the pole<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">for<\/span> <span style=\"color: #008000\">&#040;<\/span><span style=\"color: #6666cc;font-weight: bold\">int<\/span> xi <span style=\"color: #008000\">=<\/span> <span style=\"color: #008000\">-<\/span><span style=\"color: #FF0000\">1<\/span><span style=\"color: #008000\">;<\/span> xi <span style=\"color: #008000\">&amp;<\/span>lt<span style=\"color: #008000\">;=<\/span> <span style=\"color: #FF0000\">1<\/span><span style=\"color: #008000\">;<\/span> xi <span style=\"color: #008000\">+=<\/span> <span style=\"color: #FF0000\">2<\/span><span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">for<\/span> <span style=\"color: #008000\">&#040;<\/span><span style=\"color: #6666cc;font-weight: bold\">int<\/span> zi <span style=\"color: #008000\">=<\/span> <span style=\"color: #008000\">-<\/span><span style=\"color: #FF0000\">1<\/span><span style=\"color: #008000\">;<\/span> zi <span style=\"color: #008000\">&amp;<\/span>lt<span style=\"color: #008000\">;=<\/span> <span style=\"color: #FF0000\">1<\/span><span style=\"color: #008000\">;<\/span> zi <span style=\"color: #008000\">+=<\/span> <span style=\"color: #FF0000\">2<\/span><span style=\"color: #008000\">&#041;<\/span> <span style=\"color: #008000\">&#123;<\/span> result<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">cTrangles<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span>result<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">cPoints<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Count<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span> result<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">cPoints<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">new<\/span> Point3D<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">&#040;<\/span>xi <span style=\"color: #008000\">*<\/span> rangeX<span style=\"color: #008000\">&#041;<\/span> <span style=\"color: #008000\">-<\/span> <span style=\"color: #FF0000\">1<\/span>, <span style=\"color: #FF0000\">0<\/span>, zi <span style=\"color: #008000\">*<\/span> rangeZ<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span> result<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">cTrangles<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span>result<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">cPoints<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Count<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span> result<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">cPoints<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">new<\/span> Point3D<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">&#040;<\/span>xi <span style=\"color: #008000\">*<\/span> rangeX<span style=\"color: #008000\">&#041;<\/span>, <span style=\"color: #FF0000\">0<\/span>, zi <span style=\"color: #008000\">*<\/span> rangeZ<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span> result<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">cTrangles<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span>result<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">cPoints<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Count<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span> result<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">cPoints<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">new<\/span> Point3D<span style=\"color: #008000\">&#040;<\/span>xi <span style=\"color: #008000\">*<\/span> rangeX, <span style=\"color: #FF0000\">0<\/span>, <span style=\"color: #008000\">&#040;<\/span>zi <span style=\"color: #008000\">*<\/span> rangeZ<span style=\"color: #008000\">&#041;<\/span> <span style=\"color: #008000\">+<\/span> <span style=\"color: #FF0000\">1<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span> <span style=\"color: #008000\">&#125;<\/span> <span style=\"color: #008000\">&#125;<\/span> cMeshes<span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span>result<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span> <span style=\"color: #008000\">&#125;<\/span> <span style=\"color: #0600FF;font-weight: bold\">private<\/span> <span style=\"color: #6666cc;font-weight: bold\">void<\/span> BuildMesh<span style=\"color: #008000\">&#040;<\/span>PPLElement pElem<span style=\"color: #008000\">&#041;<\/span> <span style=\"color: #008000\">&#123;<\/span> <span style=\"color: #0600FF;font-weight: bold\">if<\/span> <span style=\"color: #008000\">&#040;<\/span>pElem<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">DisplayedGeometries<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Count<\/span> <span style=\"color: #008000\">&amp;<\/span>gt<span style=\"color: #008000\">;<\/span> <span style=\"color: #FF0000\">0<\/span><span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">foreach<\/span> <span style=\"color: #008000\">&#040;<\/span>GeometryModel3D gm <span style=\"color: #0600FF;font-weight: bold\">in<\/span> pElem<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">DisplayedGeometries<\/span><span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">if<\/span> <span style=\"color: #008000\">&#040;<\/span>gm<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Geometry<\/span> <span style=\"color: #008000\">is<\/span> MeshGeometry3D<span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">Mesh mesh <span style=\"color: #008000\">=<\/span> <span style=\"color: #008000\">new<\/span> Mesh<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">cMeshes<span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span>mesh<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">MeshGeometry3D m3d <span style=\"color: #008000\">=<\/span> <span style=\"color: #008000\">&#040;<\/span>gm<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Geometry<\/span> <span style=\"color: #0600FF;font-weight: bold\">as<\/span> MeshGeometry3D<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000\">System.<span style=\"color: #0000FF\">Diagnostics<\/span><\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Debug<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Assert<\/span><span style=\"color: #008000\">&#040;<\/span>gm<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Material<\/span> <span style=\"color: #008000\">is<\/span> DiffuseMaterial<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">if<\/span> <span style=\"color: #008000\">&#040;<\/span>gm<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Material<\/span> <span style=\"color: #008000\">is<\/span> DiffuseMaterial<span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">DiffuseMaterial dm <span style=\"color: #008000\">=<\/span> gm<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Material<\/span> <span style=\"color: #0600FF;font-weight: bold\">as<\/span> DiffuseMaterial<span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000\">System<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Windows<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Media<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">SolidColorBrush<\/span> sb <span style=\"color: #008000\">=<\/span> dm<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Brush<\/span> <span style=\"color: #0600FF;font-weight: bold\">as<\/span> <span style=\"color: #000000\">System<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Windows<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Media<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">SolidColorBrush<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">mesh<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">cColor<\/span> <span style=\"color: #008000\">=<\/span> <span style=\"color: #000000\">System.<span style=\"color: #0000FF\">Drawing<\/span><\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Color<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">FromArgb<\/span><span style=\"color: #008000\">&#040;<\/span>sb<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Color<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">R<\/span>, sb<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Color<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">G<\/span>, sb<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Color<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">B<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">foreach<\/span> <span style=\"color: #008000\">&#040;<\/span>Point3D pt <span style=\"color: #0600FF;font-weight: bold\">in<\/span> m3d<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Positions<\/span><span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">mesh<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">cPoints<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span>pt<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">foreach<\/span> <span style=\"color: #008000\">&#040;<\/span><span style=\"color: #6666cc;font-weight: bold\">int<\/span> tidx <span style=\"color: #0600FF;font-weight: bold\">in<\/span> m3d<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">TriangleIndices<\/span><span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">mesh<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">cTrangles<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span>tidx<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">foreach<\/span> <span style=\"color: #008000\">&#040;<\/span>PPLElement elem <span style=\"color: #0600FF;font-weight: bold\">in<\/span> pElem<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Children<\/span><span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">BuildMesh<span style=\"color: #008000\">&#040;<\/span>elem<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>The Show Marker option of the \u2018Show on Google Earth\u2019 plugin also creates a temporary KML file using the O-Calc Pro pole\u2019s coordinates and places a standard Google Earth pushpin at that location.<br \/>\nSimilarly, the Batch Create Index option performs a similar function as the Show Marker option, but creates a temporary KML file for all O-Calc Pro PPLX files found within the selected folder and subfolders if the user selected \u201cYes\u201d to the MessageBox call.<br \/>\nThe other interesting feature added to the Show Marker and Batch Create Index options is the added lines to the KML file that gives a link on the Google Earth pushpin to the full path and name of the PPLX file:<\/p>\n<div id=\"ig-sh-3\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">C#<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"csharp\" style=\"font-family:monospace\"><li><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">sw<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Write<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #666666\">&quot; &lt;!&amp;#91;CDATA&amp;#91;&lt;a href=<span style=\"color: #008080;font-weight: bold\">\\&quot;<\/span>file:\/\/\/&quot;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span> sw<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Write<\/span><span style=\"color: #008000\">&#040;<\/span>file<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Replace<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #666666\">&quot; &quot;<\/span>, <span style=\"color: #666666\">&quot;%20&quot;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Replace<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #666666\">&quot;<span style=\"color: #008080;font-weight: bold\">\\\\<\/span>&quot;<\/span>, <span style=\"color: #666666\">&quot;\/&quot;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Trim<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span> sw<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">WriteLine<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #666666\">&quot;<span style=\"color: #008080;font-weight: bold\">\\&quot;<\/span>&gt;O-Calc Pro&lt;\/a&gt;&amp;#93;&amp;#93;&gt;&quot;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>This enables one to click on the pushpin within Google Earth and have the O-Calc Pro application launched with the particular PPLX file loaded. But note, as the Help option indicates you need to have the \u201cShow web results in external browser\u201d and \u201cAllow access to local and personal data\u201d options checked within Google Earth to have the O-Calc Pro application launched.<br \/>\nWe hope this article has been useful and further shows the power of the O-Calc Pro Plugin architecture and API. A zip file of the full Visual Studio project of the \u2018Show on Google Earth\u2019 plugin can be downloaded from the O-Calc Pro User&#8217;s Website at:<\/p>\n<p><a href=\"http:\/\/www.osmoseutilities.com\/o-calcpro\">http:\/\/www.osmoseutilities.com\/o-calcpro<\/a> <\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=http%3A%2F%2Fo-calcpro.com%2Fwiki%2Fwp-json%2Fwp%2Fv2%2Fposts%2F88&#038;t=The%20%E2%80%98Show%20on%20Google%20Earth%E2%80%99%20O-Calc%20Pro%20Plugin%20Explained&#038;s=100&#038;p&#091;url&#093;=http%3A%2F%2Fo-calcpro.com%2Fwiki%2Fwp-json%2Fwp%2Fv2%2Fposts%2F88&#038;p&#091;images&#093;&#091;0&#093;=&#038;p&#091;title&#093;=The%20%E2%80%98Show%20on%20Google%20Earth%E2%80%99%20O-Calc%20Pro%20Plugin%20Explained\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"http:\/\/o-calcpro.com\/wiki\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?url=http%3A%2F%2Fo-calcpro.com%2Fwiki%2Fwp-json%2Fwp%2Fv2%2Fposts%2F88&#038;text=O-Calc%20Pro%20Information\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"http:\/\/o-calcpro.com\/wiki\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=http%3A%2F%2Fo-calcpro.com%2Fwiki%2Fwp-json%2Fwp%2Fv2%2Fposts%2F88&#038;title=The%20%E2%80%98Show%20on%20Google%20Earth%E2%80%99%20O-Calc%20Pro%20Plugin%20Explained\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"http:\/\/o-calcpro.com\/wiki\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=The%20%E2%80%98Show%20on%20Google%20Earth%E2%80%99%20O-Calc%20Pro%20Plugin%20Explained&#038;body=O-Calc%20Pro%20Information:%20http%3A%2F%2Fo-calcpro.com%2Fwiki%2Fwp-json%2Fwp%2Fv2%2Fposts%2F88\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px\"><img decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"http:\/\/o-calcpro.com\/wiki\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>As a more advanced example of an O-Calc Pro plugin, this article describes the \u2018Show on Google Earth\u2019 Plugin. First to understand how this particular integration with Google Earth works from a user perspective, have a look at the following video. The \u2018Show on Google Earth\u2019 plugin is a Menu Item style plugin and has ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"http:\/\/o-calcpro.com\/wiki\/2015\/11\/30\/the-show-on-google-earth-o-calc-pro-plugin-explained\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-88","post","type-post","status-publish","format-standard","hentry","category-plugin-development"],"_links":{"self":[{"href":"http:\/\/o-calcpro.com\/wiki\/wp-json\/wp\/v2\/posts\/88","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/o-calcpro.com\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/o-calcpro.com\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/o-calcpro.com\/wiki\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/o-calcpro.com\/wiki\/wp-json\/wp\/v2\/comments?post=88"}],"version-history":[{"count":6,"href":"http:\/\/o-calcpro.com\/wiki\/wp-json\/wp\/v2\/posts\/88\/revisions"}],"predecessor-version":[{"id":94,"href":"http:\/\/o-calcpro.com\/wiki\/wp-json\/wp\/v2\/posts\/88\/revisions\/94"}],"wp:attachment":[{"href":"http:\/\/o-calcpro.com\/wiki\/wp-json\/wp\/v2\/media?parent=88"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/o-calcpro.com\/wiki\/wp-json\/wp\/v2\/categories?post=88"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/o-calcpro.com\/wiki\/wp-json\/wp\/v2\/tags?post=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}