Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
Satellite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christopher Reis
Satellite
Commits
eb5767f3
Commit
eb5767f3
authored
Nov 21, 2015
by
Christopher Reis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reworked how Placemarks are added
parent
7e3dd6df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
17 deletions
+52
-17
.gitignore
bin/.gitignore
+0
-1
TrackerList.class
bin/satellite/TrackerList.class
+0
-0
view3D.java
src/GUI/view3D.java
+52
-16
No files found.
bin/.gitignore
View file @
eb5767f3
/GUI/
/GUI/
/satellite/
bin/satellite/TrackerList.class
0 → 100644
View file @
eb5767f3
File added
src/GUI/view3D.java
View file @
eb5767f3
...
@@ -10,14 +10,19 @@ import gov.nasa.worldwind.BasicModel;
...
@@ -10,14 +10,19 @@ import gov.nasa.worldwind.BasicModel;
import
gov.nasa.worldwind.WorldWind
;
import
gov.nasa.worldwind.WorldWind
;
import
gov.nasa.worldwind.avlist.AVKey
;
import
gov.nasa.worldwind.avlist.AVKey
;
import
gov.nasa.worldwind.awt.WorldWindowGLCanvas
;
import
gov.nasa.worldwind.awt.WorldWindowGLCanvas
;
import
gov.nasa.worldwind.geom.LatLon
;
import
gov.nasa.worldwind.geom.Position
;
import
gov.nasa.worldwind.geom.Position
;
import
gov.nasa.worldwind.layers.Layer
;
import
gov.nasa.worldwind.layers.Layer
;
import
gov.nasa.worldwind.layers.LayerList
;
import
gov.nasa.worldwind.layers.LayerList
;
import
gov.nasa.worldwind.layers.RenderableLayer
;
import
gov.nasa.worldwind.layers.RenderableLayer
;
import
gov.nasa.worldwind.render.BasicShapeAttributes
;
import
gov.nasa.worldwind.render.Cone
;
import
gov.nasa.worldwind.render.Material
;
import
gov.nasa.worldwind.render.Offset
;
import
gov.nasa.worldwind.render.Offset
;
import
gov.nasa.worldwind.render.PointPlacemark
;
import
gov.nasa.worldwind.render.PointPlacemark
;
import
gov.nasa.worldwind.render.PointPlacemarkAttributes
;
import
gov.nasa.worldwind.render.PointPlacemarkAttributes
;
import
gov.nasa.worldwind.render.Renderable
;
import
gov.nasa.worldwind.render.Renderable
;
import
gov.nasa.worldwind.render.ShapeAttributes
;
import
satellite.satPosition
;
import
satellite.satPosition
;
public
class
view3D
extends
JInternalFrame
{
public
class
view3D
extends
JInternalFrame
{
...
@@ -84,27 +89,39 @@ public class view3D extends JInternalFrame{
...
@@ -84,27 +89,39 @@ public class view3D extends JInternalFrame{
public
void
addTrack
(
String
name
,
Double
lat
,
Double
lon
,
Double
alt
){
public
void
addTrack
(
String
name
,
Double
lat
,
Double
lon
,
Double
alt
){
List
<
Renderable
>
rList
=
new
ArrayList
<
Renderable
>();
Iterable
<
Renderable
>
iter
=
layer
.
getRenderables
();
Iterable
<
Renderable
>
iter
=
layer
.
getRenderables
();
while
(
iter
.
iterator
().
hasNext
()){
for
(
int
i
=
0
;
i
<
layer
.
getNumRenderables
();
i
++){
System
.
out
.
println
(
"Iterator "
);
if
(
iter
.
iterator
().
next
()
instanceof
PointPlacemark
){
Renderable
rend
=
iter
.
iterator
().
next
();
PointPlacemark
pp
=
(
PointPlacemark
)
rList
.
get
(
i
);
if
(
rend
instanceof
PointPlacemark
){
if
(
pp
.
getLabelText
().
equals
(
name
)){
PointPlacemark
delp
=
(
PointPlacemark
)
rend
;
pp
.
setPosition
(
Position
.
fromDegrees
(
lat
,
lon
,
alt
*
1000
));
System
.
out
.
println
(
delp
.
getLabelText
());
System
.
out
.
println
(
name
+
" updated"
);
if
(
delp
.
getLabelText
().
equals
(
name
)){
delp
.
setPosition
(
Position
.
fromDegrees
(
lat
,
lon
,
alt
*
1000
));
System
.
out
.
println
(
lat
+
" "
+
lon
+
" "
+
alt
*
1000
);
wwd
.
redraw
();
wwd
.
redraw
();
return
;
return
;
}
else
{
return
;
}
}
}
else
{
System
.
out
.
println
(
"Not a PP"
);
}
}
}
}
PointPlacemark
pp
=
new
PointPlacemark
(
Position
.
fromDegrees
(
lat
,
lon
,
alt
*
1000
));
// while(iter.iterator().hasNext()){
// System.out.println("Iterator ");
// Renderable rend = iter.iterator().next();
// if(rend instanceof PointPlacemark){
// PointPlacemark delp = (PointPlacemark)rend;
// System.out.println(delp.getLabelText());
// if(delp.getLabelText().equals(name)){
// delp.setPosition(Position.fromDegrees(lat, lon, alt* 1000));
// System.out.println(lat + " " + lon + " " + alt*1000);
// wwd.redraw();
// return;
// }else{
// return;
// }
// } else {
// System.out.println("Not a PP");
// }
// }
//Satellite Placemark
PointPlacemark
pp
=
new
PointPlacemark
(
Position
.
fromDegrees
(
lat
,
lon
,
alt
*
1000
));
pp
.
setLabelText
(
name
);
pp
.
setLabelText
(
name
);
pp
.
setValue
(
AVKey
.
DISPLAY_NAME
,
"Label, Semi-transparent, Audio icon"
);
pp
.
setValue
(
AVKey
.
DISPLAY_NAME
,
"Label, Semi-transparent, Audio icon"
);
pp
.
setLineEnabled
(
false
);
pp
.
setLineEnabled
(
false
);
...
@@ -113,9 +130,27 @@ public class view3D extends JInternalFrame{
...
@@ -113,9 +130,27 @@ public class view3D extends JInternalFrame{
attrsP
.
setImageAddress
(
"satellite.png"
);
attrsP
.
setImageAddress
(
"satellite.png"
);
//attrsP.setImageColor(new Color(1f, 1f, 1f, 0.6f));
//attrsP.setImageColor(new Color(1f, 1f, 1f, 0.6f));
attrsP
.
setScale
(
0.1
);
attrsP
.
setScale
(
0.1
);
attrsP
.
setImageOffset
(
new
Offset
(
175
d
,
175
d
,
AVKey
.
PIXELS
,
AVKey
.
PIXELS
));
//
attrsP.setImageOffset(new Offset(175d,175d,AVKey.PIXELS, AVKey.PIXELS));
pp
.
setAttributes
(
attrsP
);
pp
.
setAttributes
(
attrsP
);
layer
.
addRenderable
(
pp
);
layer
.
addRenderable
(
pp
);
// Create and set an attribute bundle.
ShapeAttributes
attrs
=
new
BasicShapeAttributes
();
attrs
.
setInteriorMaterial
(
Material
.
YELLOW
);
attrs
.
setInteriorOpacity
(
0.03
);
attrs
.
setEnableLighting
(
true
);
attrs
.
setOutlineMaterial
(
Material
.
RED
);
attrs
.
setOutlineWidth
(
2
d
);
attrs
.
setDrawInterior
(
true
);
attrs
.
setDrawOutline
(
false
);
// Cone with a texture, using Cone(position, height, radius) constructor
Cone
cone9
=
new
Cone
(
Position
.
fromDegrees
(
lat
,
lon
),
alt
*
3000
,
600000
);
cone9
.
setAltitudeMode
(
WorldWind
.
RELATIVE_TO_GROUND
);
cone9
.
setAttributes
(
attrs
);
cone9
.
setVisible
(
true
);
cone9
.
setValue
(
AVKey
.
DISPLAY_NAME
,
"Cone with a texture"
);
layer
.
addRenderable
(
cone9
);
// Add the layer to the model.
// Add the layer to the model.
wwd
.
getModel
().
getLayers
().
add
(
layer
);
wwd
.
getModel
().
getLayers
().
add
(
layer
);
...
@@ -125,6 +160,7 @@ public class view3D extends JInternalFrame{
...
@@ -125,6 +160,7 @@ public class view3D extends JInternalFrame{
public
void
addSatellite
(
List
<
satPosition
>
positions
){
public
void
addSatellite
(
List
<
satPosition
>
positions
){
System
.
out
.
println
(
"Size "
+
positions
.
size
());
System
.
out
.
println
(
"Size "
+
positions
.
size
());
//layer.dispose();
for
(
int
i
=
0
;
i
<
positions
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
positions
.
size
();
i
++){
addTrack
(
positions
.
get
(
i
).
getName
(),
positions
.
get
(
i
).
getLat
(),
positions
.
get
(
i
).
getLon
(),
positions
.
get
(
i
).
getAlt
());
addTrack
(
positions
.
get
(
i
).
getName
(),
positions
.
get
(
i
).
getLat
(),
positions
.
get
(
i
).
getLon
(),
positions
.
get
(
i
).
getAlt
());
System
.
out
.
println
(
positions
.
get
(
i
).
getName
()+
" Added!"
);
System
.
out
.
println
(
positions
.
get
(
i
).
getName
()+
" Added!"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment