root / branches / 3D_Animation_prepto_osgvp_2_2_0 / libraries / lib3DMap / src / org / gvsig / gvsig3d / simbology3D / Line3DFeature.java @ 26999
History | View | Annotate | Download (1.78 KB)
1 |
package org.gvsig.gvsig3d.simbology3D; |
---|---|
2 |
|
3 |
import org.apache.log4j.Logger; |
4 |
import org.gvsig.gvsig3d.simbology3D.geometry3D.Line3DGeometry; |
5 |
import org.gvsig.gvsig3d.simbology3D.symbol3D.Abstract3DSymbol; |
6 |
import org.gvsig.gvsig3d.simbology3D.symbol3D.polyline.ExtrusionLine3DSymbol; |
7 |
import org.gvsig.gvsig3d.simbology3D.symbol3D.polyline.SimpleLine3DSymbol; |
8 |
import org.gvsig.osgvp.core.osg.Group; |
9 |
import org.gvsig.osgvp.exceptions.node.NodeException; |
10 |
import org.gvsig.osgvp.planets.Planet; |
11 |
|
12 |
import com.iver.ai2.gvsig3d.legend.symbols.BaseExtrusionSymbol; |
13 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
14 |
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol; |
15 |
|
16 |
public class Line3DFeature extends AbstractFeature3D { |
17 |
|
18 |
private Line3DGeometry l3DGeometry;
|
19 |
private Abstract3DSymbol l3DSymbol;
|
20 |
|
21 |
private static Logger logger = Logger.getLogger(Line3DFeature.class |
22 |
.getName()); |
23 |
|
24 |
public Line3DFeature(ISymbol symbol, IGeometry geometry) {
|
25 |
super(symbol, geometry);
|
26 |
l3DGeometry = new Line3DGeometry(geometry);
|
27 |
// l3DGeometry = (Line3DGeometry) this.getGeometry();
|
28 |
// l3DSymbol = (SimpleLine3DSymbol) this.getSymbol();
|
29 |
|
30 |
if (this.getSymbol().getClass().equals(BaseExtrusionSymbol.class)) { |
31 |
l3DSymbol = new ExtrusionLine3DSymbol(symbol);
|
32 |
} else {
|
33 |
l3DSymbol = new SimpleLine3DSymbol(symbol);
|
34 |
} |
35 |
|
36 |
|
37 |
} |
38 |
|
39 |
public Group Draw(Group group) { |
40 |
try {
|
41 |
group.addChild(l3DGeometry.generateGeometry(l3DSymbol)); |
42 |
} catch (NodeException e) {
|
43 |
logger.error("Command:" + "Error adding new child.", e); |
44 |
} |
45 |
return group;
|
46 |
} |
47 |
|
48 |
public void setPlanet(Planet planet) { |
49 |
if (this.l3DGeometry != null) { |
50 |
this.l3DGeometry.setPlanet(planet);
|
51 |
} |
52 |
} |
53 |
|
54 |
public void setHeigth(float heigth) { |
55 |
if (this.l3DGeometry != null) { |
56 |
this.l3DGeometry.setHeigth(heigth);
|
57 |
} |
58 |
} |
59 |
} |