Announcement

Collapse
No announcement yet.

How to use the PolygonFeature class?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to use the PolygonFeature class?

    Hello, any one can tell me how to use PolygonFeature class in PluginSDK,
    it seems polygon can be added to ww using this class, but i know nothing
    about the polygon config file, i have checked the LayerSet.xsd for some
    help, but i found nothing.

    Hopes anyone can tell me the usage about the PolygonFeature Class,
    and how to add polygon to WW?

    btw: I had build a worldwind using the source code I had checked out,
    the app version is 1.3.6.0, but the splash screen said it still was 1.3.5,
    did this mean there will be a new version in short future?
    A Beginor of the world!

  • #2
    Does this help?

    http://issues.worldwind.arc.nasa.gov...PolygonFeature

    Comment


    • #3
      Thanks, withak. I have seen the link you writed, and i know how to add a polygon to ww, but the polygon can not be rendered correctly, maybe i need to check out the latest source code from svn.
      A Beginor of the world!

      Comment


      • #4
        Which version is this polygonFeature class in?

        Comment


        • #5
          It's not in 1.3.5, only in the nightly builds. Or you can build it yourself. As of yesterday, it builds just fine in Visual C# Express, which is free from MS.

          Comment


          • #6
            Thanks, I got it from tom this morning, working with it now

            Comment


            • #7
              I am trying to do a proof on concept on the polygonFeature class before I go implementing things, and I get the layer to show up in layer manager, with all the correct properties, but the layer does not show on the screen. Mind you, this is at runtime, so it may be a little different.

              Here is the code that I have (everything hardcoded right now for POC)

              Code:
               
              WorldWind.Point3d[] points = new WorldWind.Point3d[]{new WorldWind.Point3d(-120,35,10000), new WorldWind.Point3d(-119,36,20000), new WorldWind.Point3d(-120,38,100000), new WorldWind.Point3d(-122,38,60000)};
               
              PolygonFeature pf = null;
              LinearRing outerRing = newLinearRing();
              outerRing.Points = points;
              pf = newPolygonFeature("test1", parentApplication, outerRing, null, Color.Red);
              pf.OutlineColor = Color.Black;
              pf.Outline = true;
              pf.Opacity = 100;
              pf.DistanceAboveSurface = 0;
              pf.MinimumDisplayAltitude = 0;
              pf.IsOn = true;
              pf.MaximumDisplayAltitude = 500000;
              pf.ParentList = parentApplication.RenderableObjects;
              parentApplication.RenderableObjects.ChildObjects.Add(pf);
              
              am I missing something? do I need to call a render?

              :edit: It works correctly when I use an XML file in config in the startup
              Last edited by swaggs21; 08-04-2006, 06:21 PM.

              Comment


              • #8
                Put a breakpoint in the PolyonFeature class to see if its gets called. it should be since you put in the renderable object list. Then see what isn't being set. Likely something is throwing an exception and you pop back out into the main loop.

                Comment


                • #9
                  I check out a new version of the code, and it works now.
                  A Beginor of the world!

                  Comment


                  • #10
                    Extensive use of polygons shown here:
                    http://issues.worldwind.arc.nasa.gov..._37.81601S.jpg
                    Via KML.
                    Coding This and That in World Wind and helping new people out, as long as they don't pester too much.
                    Currently blogging at: http://whatnicklife.blogspot.com
                    Working at:
                    Aerometrex - http://aerometrex.com.au/blog/
                    Impact so far:


                    Comment


                    • #11
                      Originally posted by nigel_ht
                      Put a breakpoint in the PolyonFeature class to see if its gets called. it should be since you put in the renderable object list. Then see what isn't being set. Likely something is throwing an exception and you pop back out into the main loop.
                      I tried doing this, no luck.

                      Like I said, I can watch the Configuration XML create one with no problem, with no errors and it shows, but when I try to do it in code (this has to be done at run-time, not start up) then it does not show.

                      I wonder if it is hiding behind the other layers?

                      Comment


                      • #12
                        Originally posted by what_nick
                        Extensive use of polygons shown here:
                        http://issues.worldwind.arc.nasa.gov..._37.81601S.jpg
                        Via KML.
                        I have seen those, and that is something I would like to get to, but I cannot use KML due to it being done all in code, not through startup.

                        I am going to pull down the new code when I get home tonight and see if it works like beginor said.

                        Comment


                        • #13
                          I was successfully able to create a poly after synching this morning.

                          I will be posting updates when I can.

                          Comment


                          • #14
                            Here is a sample of what I have been working on in WW with the new polygonFeature class. I have a couple of gripes with it, but overall it is an awesome product.

                            The couple of gripes/upgrades I would like:
                            1. There seems to be no easy way to change transparency (to say 50%). I used the opaque property to no avail, but I have seen them in examples, so I know it is there somewhere.
                            2. Mouseovers would be nice. This is a feature I am thinking off adding and then getting approval to add to WW.
                            3. PerformedSelectedAction implementations would be nice (also looking into coding this)
                            Other than that, it works awesome. On the grid below, all the boxes are of type PolygonFeature. The letters identify each box (these are icons with a drawtext graphic bitmap).

                            http://forum.worldwindcentral.com/at...1&d=1155128602
                            Attached Files

                            Comment

                            Working...
                            X