Statistics
| Revision:

svn-gvsig-desktop / tags / 3D_Animation_v1_0alpha_Build_5 / libraries / lib3DMap / src / org / gvsig / gvsig3d / simbology3D / symbol3D / polyline / ExtrusionLine3DSymbol.java @ 25534

History | View | Annotate | Download (2.2 KB)

1 25228 afraile
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
4
*
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
*/
19
package org.gvsig.gvsig3d.simbology3D.symbol3D.polyline;
20
21
import java.awt.Color;
22
import java.util.List;
23
24
import org.gvsig.gvsig3d.gui.FeatureFactory;
25
import org.gvsig.gvsig3d.simbology3D.symbol3D.Abstract3DSymbol;
26
import org.gvsig.osgvp.Node;
27
import org.gvsig.osgvp.Vec3;
28
import org.gvsig.osgvp.Vec4;
29
30
import com.iver.ai2.gvsig3d.legend.symbols.BaseExtrusionSymbol;
31
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol;
32
33
public class ExtrusionLine3DSymbol extends Abstract3DSymbol{
34
35
        protected Vec4 rgba ;
36
        private double extrusion;
37
38
        public ExtrusionLine3DSymbol(ISymbol symbol) {
39
                super(symbol);
40
                BaseExtrusionSymbol baseExtrusionSymbol = (BaseExtrusionSymbol) symbol;
41
42
                //ILineSymbol fillSymbol = (ILineSymbol) symbol;
43
44
                // Getting symbol properties
45
46
                // Symbol color and alpha value
47
                Color color = baseExtrusionSymbol.getFillColor();
48
//                float alpha = baseExtrusionSymbol.getFillAlpha() / 255f;
49
                rgba = new Vec4(color.getRed() / 255f, color.getGreen() / 255f, color
50
                                .getBlue() / 255f, 0.7);
51
                extrusion = baseExtrusionSymbol.getExtrusion();
52
//                System.err.println("extrusion " + extrusion);
53
        }
54
55
        public Node generateSymbol(List<Vec3> position) {
56
                // TODO Auto-generated method stub
57
//                return FeatureFactory.insertPolygon(position, rgba, null);
58
                return FeatureFactory.insertLineExtruded(position,rgba , null,extrusion);
59
        }
60
61
}
62