Revision 25329

View differences:

trunk/libraries/lib3DMap/src/org/gvsig/gvsig3d/cacheservices/VectorCacheService.java
409 409
			if (labelStrategy != null) {
410 410
				String[] usetFields = labelStrategy.getUsedFields();
411 411
			}
412
			
413 412

  
414 413
			// IFeatureIterator it = fLyrVect.getSource().getFeatureIterator(
415 414
			// fieldList.toArray(new String[0]), _viewProj);
416
			IFeatureIterator it = fLyrVect.getSource().getFeatureIterator(
417
					fieldList.toArray(new String[fieldList.size()]), _viewProj);
415
			ReadableVectorial source = fLyrVect.getSource();
416
			if (source != null) {
417
				IFeatureIterator it = fLyrVect.getSource().getFeatureIterator(
418
						fieldList.toArray(new String[fieldList.size()]),
419
						_viewProj);
418 420

  
419
			// Get the iterator over the visible features
420
			// IFeatureIterator ite = fLyrVect.getSource().getFeatureIterator(
421
			// viewPort.getAdjustedExtent(),
422
			// fieldList.toArray(new String[fieldList.size()]),
423
			// viewPort.getProjection(), true);
424
			try {
425
				while (it.hasNext()) {
426
					IFeature feat = it.next();
427
					ISymbol sym = legend.getSymbolByFeature(feat);
428
					if (sym == null )
429
						sym = legend.getDefaultSymbol();
430
					IGeometry geom = feat.getGeometry();
421
				// Get the iterator over the visible features
422
				// IFeatureIterator ite =
423
				// fLyrVect.getSource().getFeatureIterator(
424
				// viewPort.getAdjustedExtent(),
425
				// fieldList.toArray(new String[fieldList.size()]),
426
				// viewPort.getProjection(), true);
427
				try {
428
					while (it.hasNext()) {
429
						IFeature feat = it.next();
430
						ISymbol sym = legend.getSymbolByFeature(feat);
431
						if (sym == null)
432
							sym = legend.getDefaultSymbol();
433
						IGeometry geom = feat.getGeometry();
431 434

  
432
					ReadableVectorial rv = fLyrVect.getSource();
433
					int selectionIndex = -1;
434
					if (rv instanceof ISpatialDB) {
435
						selectionIndex = ((ISpatialDB) rv)
436
								.getRowIndexByFID(feat);
437
					} else {
438
						selectionIndex = Integer.parseInt(feat.getID());
439
					}
440
					if (selectionIndex != -1) {
441
						if (fLyrVect.getRecordset().getSelectionSupport()
442
								.isSelected(selectionIndex)) {
443
							sym = sym.getSymbolForSelection();
435
						ReadableVectorial rv = fLyrVect.getSource();
436
						int selectionIndex = -1;
437
						if (rv instanceof ISpatialDB) {
438
							selectionIndex = ((ISpatialDB) rv)
439
									.getRowIndexByFID(feat);
440
						} else {
441
							selectionIndex = Integer.parseInt(feat.getID());
444 442
						}
445
					}
443
						if (selectionIndex != -1) {
444
							if (fLyrVect.getRecordset().getSelectionSupport()
445
									.isSelected(selectionIndex)) {
446
								sym = sym.getSymbolForSelection();
447
							}
448
						}
446 449

  
447
					int geomType = geom.getGeometryType();
448
					// Line Type
449
					Layer3DProps props3D = Layer3DProps.getLayer3DProps(_layer);
450
					if ((geomType & FShape.LINE) == FShape.LINE) {
451
						Line3DFeature l3D = new Line3DFeature(sym, geom);
452
						l3D.setPlanet(this._planet);
453
						l3D.setHeigth(props3D.getHeigth());
454
						this._layerNode = l3D.Draw(this._layerNode);
455
					}
456
					// Polygon type
457
					if ((geomType & FShape.POLYGON) == FShape.POLYGON) {
458
						Polygon3DFeature poly3D = new Polygon3DFeature(sym,
459
								geom);
460
						poly3D.setPlanet(this._planet);
461
						poly3D.setHeigth(props3D.getHeigth());
462
						// StateSet s= new StateSet();
463
						// s.setPolygonOffset(1.0f,1.0f);
464
						// _layerNode.setStateSet(s);
465
						this._layerNode = poly3D.Draw(_layerNode);
466
					}
467
					// Point type
468
					if ((geomType & FShape.POINT) == FShape.POINT) {
450
						int geomType = geom.getGeometryType();
451
						// Line Type
452
						Layer3DProps props3D = Layer3DProps
453
								.getLayer3DProps(_layer);
454
						if ((geomType & FShape.LINE) == FShape.LINE) {
455
							Line3DFeature l3D = new Line3DFeature(sym, geom);
456
							l3D.setPlanet(this._planet);
457
							l3D.setHeigth(props3D.getHeigth());
458
							this._layerNode = l3D.Draw(this._layerNode);
459
						}
460
						// Polygon type
461
						if ((geomType & FShape.POLYGON) == FShape.POLYGON) {
462
							Polygon3DFeature poly3D = new Polygon3DFeature(sym,
463
									geom);
464
							poly3D.setPlanet(this._planet);
465
							poly3D.setHeigth(props3D.getHeigth());
466
							// StateSet s= new StateSet();
467
							// s.setPolygonOffset(1.0f,1.0f);
468
							// _layerNode.setStateSet(s);
469
							this._layerNode = poly3D.Draw(_layerNode);
470
						}
471
						// Point type
472
						if ((geomType & FShape.POINT) == FShape.POINT) {
469 473

  
470
						Point3DFeature point3D = new Point3DFeature(sym, geom);
471
						point3D.setPlanet(this._planet);
472
						point3D.setHeigth(props3D.getHeigth());
473
						this._layerNode = point3D.Draw(_layerNode);
474
							Point3DFeature point3D = new Point3DFeature(sym,
475
									geom);
476
							point3D.setPlanet(this._planet);
477
							point3D.setHeigth(props3D.getHeigth());
478
							this._layerNode = point3D.Draw(_layerNode);
479
						}
480

  
474 481
					}
482
				} catch (ExpansionFileReadException e) {
483
					// TODO Auto-generated catch block
484
					e.printStackTrace();
485
				}
475 486

  
476
				}
477
			} catch (ExpansionFileReadException e) {
478
				// TODO Auto-generated catch block
479
				e.printStackTrace();
480 487
			}
481

  
482 488
		} catch (ReadDriverException e) {
483 489
			// TODO Auto-generated catch block
484 490
			e.printStackTrace();
485 491
		}
492
			
486 493

  
487 494
	}
488 495

  

Also available in: Unified diff