gvsig-3d / 2.0 / trunk / org.gvsig.gvsig3d / org.gvsig.gvsig3d.lib / org.gvsig.gvsig3d.lib.impl / src / main / java / org / gvsig / gvsig3d / impl / symbology3d / Symbol3DFactory.java @ 365
History | View | Annotate | Download (2.36 KB)
1 |
package org.gvsig.gvsig3d.impl.symbology3d; |
---|---|
2 |
|
3 |
import org.gvsig.gvsig3d.impl.symbology3d.extrusion.impl.ExtrusionPolygonSymbol; |
4 |
import org.gvsig.gvsig3d.impl.symbology3d.fill.impl.SimpleFill3DSymbol; |
5 |
import org.gvsig.gvsig3d.impl.symbology3d.line.impl.SimpleLine3DSymbol; |
6 |
import org.gvsig.gvsig3d.impl.symbology3d.marker.impl.GeometryMarker3DSymbol; |
7 |
import org.gvsig.gvsig3d.impl.symbology3d.marker.impl.NodeMarker3DSymbol; |
8 |
import org.gvsig.gvsig3d.impl.symbology3d.marker.impl.PictureMarker3DSymbol; |
9 |
import org.gvsig.gvsig3d.impl.symbology3d.marker.impl.SimpleMarker3DSymbol; |
10 |
import org.gvsig.gvsig3d.symbology3d.I3DSymbol; |
11 |
import org.gvsig.osgvp.exceptions.node.NodeException; |
12 |
import org.gvsig.osgvp.symbology.ISymbol3D; |
13 |
import org.gvsig.osgvp.symbology.fill.ExtrudedFill; |
14 |
import org.gvsig.osgvp.symbology.fill.SimpleFill; |
15 |
import org.gvsig.osgvp.symbology.line.SimpleLine; |
16 |
import org.gvsig.osgvp.symbology.marker.NodeMarker; |
17 |
import org.gvsig.osgvp.symbology.marker.PictureMarker; |
18 |
import org.gvsig.osgvp.symbology.marker.SimpleMarker; |
19 |
import org.gvsig.osgvp.symbology.marker.GeometryMarker; |
20 |
|
21 |
/**
|
22 |
* @author AI2
|
23 |
* @version $Id$
|
24 |
*
|
25 |
*/
|
26 |
public class Symbol3DFactory { |
27 |
|
28 |
public static ISymbol3D getSymbol3D(I3DSymbol symbol) throws NodeException { |
29 |
// Method to create osgVP symbol related to gvSIG 3D symbol
|
30 |
ISymbol3D newSymbol = null;
|
31 |
if (symbol instanceof SimpleFill3DSymbol) |
32 |
newSymbol= new SimpleFill();
|
33 |
|
34 |
if (symbol instanceof SimpleLine3DSymbol) |
35 |
newSymbol= new SimpleLine();
|
36 |
|
37 |
if (symbol instanceof NodeMarker3DSymbol) |
38 |
{ |
39 |
newSymbol = new NodeMarker();
|
40 |
((NodeMarker)newSymbol).setNodeFile(((NodeMarker3DSymbol)symbol).getNodeFileURL()); |
41 |
return newSymbol;
|
42 |
} |
43 |
if (symbol instanceof PictureMarker3DSymbol) |
44 |
{ |
45 |
newSymbol = new PictureMarker();
|
46 |
((PictureMarker)newSymbol).setPictureFile(((PictureMarker3DSymbol)symbol).getPictureFileURL()); |
47 |
((PictureMarker)newSymbol).setPointSize((float)((PictureMarker3DSymbol) symbol).getSize());
|
48 |
return newSymbol;
|
49 |
} |
50 |
if (symbol instanceof SimpleMarker3DSymbol) |
51 |
{ |
52 |
newSymbol= new SimpleMarker();
|
53 |
((SimpleMarker)newSymbol).setPointSize((float)((SimpleMarker3DSymbol) symbol).getSize());
|
54 |
} |
55 |
|
56 |
if (symbol instanceof GeometryMarker3DSymbol) |
57 |
newSymbol= new GeometryMarker();
|
58 |
if (symbol instanceof ExtrusionPolygonSymbol) |
59 |
newSymbol= new ExtrudedFill();
|
60 |
newSymbol.setColor(symbol.getColor()); |
61 |
|
62 |
return newSymbol;
|
63 |
} |
64 |
|
65 |
} |