Removes accelerators from given geometry.
@param geometry The geometry instance to remove accelerators from.
350508
public static void deaccelerateGeometry(Geometry geometry) {
		Geometry.Type gt = geometry.getType();
		if (Geometry.isMultiVertex(gt.value()))
		{
			GeometryAccelerators accel = ((MultiVertexGeometryImpl) geometry
					._getImpl())._getAccelerators();
			if (accel != null){
				accel._setRasterizedGeometry(null);
				accel._setQuadTree(null);
			}
		}
	}
1063057
public void onGeometryEditStop(GeometryEditStopEvent event) {
		// Remove the vector container from the map:
		mapPresenter.getContainerManager().removeVectorContainer(container);
		container = null;
		shapes.clear();
	}
1175763
public boolean intersects(Geometry geometry) {
		if (geometry == null || isEmpty() || geometry.isEmpty()) {
			return false;
		}

		if (geometry.getNumGeometries() > 1) {
			for (int n = 0; n < geometry.getNumGeometries(); n++) {
				if (intersects(geometry.getGeometryN(n))) {
					return true;
				}
			}
		} else {
			final Coordinate[] coords = geometry.getCoordinates();
			if (coords.length > 1 && coordinates.length > 1) {
				for (int i = 0; i < coordinates.length - 1; i++) {
					for (int j = 0; j < coords.length - 1; j++) {
						if (Mathlib.lineIntersects(coordinates[i], coordinates[i + 1], coords[j], coords[j + 1])) {
							return true;
						}
					}
					if (Mathlib.touches(geometry, coordinates[i])) {
						return true;
					}
				}
			} else {
				// TODO implement me
			}
		}

		return false;
	}
1061763
function () {
    this.geometry.dispose();
    this.geometry = null;
    this.el.removeObject3D(this.attrName);
    this.material.dispose();
    this.material = null;
    this.texture.dispose();
    this.texture = null;
    if (this.shaderObject) {
      delete this.shaderObject;
    }
  }
38845
function( geometry ) {

		var vertices = [];

		for ( var i = 0, il = geometry.faces.length; i < il; i ++ ) {

			var n = vertices.length;

			var face = geometry.faces[ i ];

			if ( face instanceof THREE.Face4 ) {

				var a = face.a;
				var b = face.b;
				var c = face.c;
				var d = face.d;

				var va = geometry.vertices[ a ];
				var vb = geometry.vertices[ b ];
				var vc = geometry.vertices[ c ];
				var vd = geometry.vertices[ d ];

				vertices.push( va.clone() );
				vertices.push( vb.clone() );
				vertices.push( vc.clone() );
				vertices.push( vd.clone() );

				face.a = n;
				face.b = n + 1;
				face.c = n + 2;
				face.d = n + 3;

			} else {

				var a = face.a;
				var b = face.b;
				var c = face.c;

				var va = geometry.vertices[ a ];
				var vb = geometry.vertices[ b ];
				var vc = geometry.vertices[ c ];

				vertices.push( va.clone() );
				vertices.push( vb.clone() );
				vertices.push( vc.clone() );

				face.a = n;
				face.b = n + 1;
				face.c = n + 2;

			}

		}

		geometry.vertices = vertices;
		delete geometry.__tmpVertices;

	}
976913
public void clear()
    {
        DelaunayTriangle t;
        for( int i=0; i<3; i++ )
        {
            t = neighbors[i];
            if( t != null )
            {
                t.clearNeighbor( this );
            }
        }
        clearNeighbors();
        points[0]=points[1]=points[2]=null;
    }
941228
public static byte[] geometryToEsriShape(Geometry geometry) {
		if (geometry == null)
			throw new IllegalArgumentException();
		OperatorExportToESRIShape op = (OperatorExportToESRIShape) factory
				.getOperator(Operator.Type.ExportToESRIShape);
		return op.execute(0, geometry).array();
	}
589576
private boolean isAlone( Geometry geometryN ) {
        Coordinate[] coordinates = geometryN.getCoordinates();
        if (coordinates.length > 1) {
            Coordinate first = coordinates[0];
            Coordinate last = coordinates[coordinates.length - 1];
            for( SimpleFeature line : linesList ) {
                Geometry lineGeom = (Geometry) line.getDefaultGeometry();
                int numGeometries = lineGeom.getNumGeometries();
                for( int i = 0; i < numGeometries; i++ ) {
                    Geometry subGeom = lineGeom.getGeometryN(i);
                    Coordinate[] lineCoordinates = subGeom.getCoordinates();
                    if (lineCoordinates.length < 2) {
                        continue;
                    } else {
                        Coordinate tmpFirst = lineCoordinates[0];
                        Coordinate tmpLast = lineCoordinates[lineCoordinates.length - 1];
                        if (tmpFirst.distance(first) < SAMEPOINTTHRESHOLD || tmpFirst.distance(last) < SAMEPOINTTHRESHOLD
                                || tmpLast.distance(first) < SAMEPOINTTHRESHOLD || tmpLast.distance(last) < SAMEPOINTTHRESHOLD) {
                            return false;
                        }
                    }
                }
            }
        }
        // 1 point line or no connection, mark it as alone for removal
        return true;
    }
1333903
protected synchronized void removeShapeGeometryChangeListener(ShapeGeometryChangeListener listener) {
		assert listener != null : AssertMessages.notNullParameter();
		if (this.geometryListeners != null) {
			this.geometryListeners.remove(listener);
			if (this.geometryListeners.isEmpty()) {
				this.geometryListeners = null;
			}
		}
	}
602017
public void stop(final GeometryArrayFunction callback) {
		started = false;
		service.stop();
		if (callback != null) {
			calculate(new GeometryArrayFunction() {

				public void execute(Geometry[] geometries) {
					callback.execute(geometries);
					splitLine = null;
					eventBus.fireEvent(new GeometrySplitStopEvent(geometry));
				}
			});
		} else {
			eventBus.fireEvent(new GeometrySplitStopEvent(geometry));
			splitLine = null;
		}
	}
868919
public void onGeometryEditMove(GeometryEditMoveEvent event) {
		// Find the elements that need updating:
		Map<GeometryIndex, Boolean> indicesToUpdate = new HashMap<GeometryIndex, Boolean>();
		for (GeometryIndex index : event.getIndices()) {
			if (!indicesToUpdate.containsKey(index)) {
				indicesToUpdate.put(index, false);
				if (!Geometry.POINT.equals(editService.getGeometry().getGeometryType())
						&& !Geometry.MULTI_POINT.equals(editService.getGeometry().getGeometryType())) {
					try {
						List<GeometryIndex> neighbors;
						switch (editService.getIndexService().getType(index)) {
							case TYPE_VERTEX:
								// Move current vertex to the back. This helps the delete operation.
								indicesToUpdate.put(index, true);
								neighbors = editService.getIndexService().getAdjacentEdges(event.getGeometry(), index);
								if (neighbors != null) {
									for (GeometryIndex neighborIndex : neighbors) {
										if (!indicesToUpdate.containsKey(neighborIndex)) {
											indicesToUpdate.put(neighborIndex, false);
										}
									}
								}

								neighbors = editService.getIndexService().getAdjacentVertices(event.getGeometry(),
										index);
								if (neighbors != null) {
									for (GeometryIndex neighborIndex : neighbors) {
										if (!indicesToUpdate.containsKey(neighborIndex)) {
											indicesToUpdate.put(neighborIndex, false);
										}
									}
								}
								break;
							case TYPE_EDGE:
								neighbors = editService.getIndexService().getAdjacentVertices(event.getGeometry(),
										index);
								if (neighbors != null) {
									for (GeometryIndex neighborIndex : neighbors) {
										if (!indicesToUpdate.containsKey(neighborIndex)) {
											indicesToUpdate.put(neighborIndex, false);
										}
									}
								}
								break;
							default:
						}
					} catch (GeometryIndexNotFoundException e) {
						throw new IllegalStateException(e);
					}
				}
			}
		}

		// Check if we need to draw the background (nice, but slows down):
		if (styleProvider.getBackgroundStyle() != null && styleProvider.getBackgroundStyle().getFillOpacity() > 0) {
			if (event.getGeometry().getGeometryType().equals(Geometry.POLYGON)) {
				update(null, false);
			} else if (event.getGeometry().getGeometryType().equals(Geometry.MULTI_POLYGON)
					&& event.getGeometry().getGeometries() != null) {
				for (int i = 0; i < event.getGeometry().getGeometries().length; i++) {
					GeometryIndex index = editService.getIndexService().create(GeometryIndexType.TYPE_GEOMETRY, i);
					indicesToUpdate.put(index, false);
				}
			}
		}

		// Next, redraw the list:
		for (GeometryIndex index : indicesToUpdate.keySet()) {
			update(index, indicesToUpdate.get(index));
		}
	}
130389
private static void decompose(Geometry geometry, Collection<Geometry> list) {
        for (int i = 0; i < geometry.getNumGeometries(); i++) {
            Geometry component = geometry.getGeometryN(i);
            if (component instanceof GeometryCollection) {
                decompose(component, list);
            } else {
                list.add(component);
            }
        }
    }
1068467
@SuppressWarnings({"checkstyle:magicnumber", "checkstyle:cyclomaticcomplexity"})
	public boolean remove(Point3D<?, ?> point) {
		if (this.types != null && !this.types.isEmpty() && this.coords != null && !this.coords.isEmpty()) {
			for (int i = 0, j = 0; i < this.coords.size() && j < this.types.size(); j++) {
				final Point3dfx currentPoint = this.coords.get(i);
				switch (this.types.get(j)) {
				case MOVE_TO:
					//$FALL-THROUGH$
				case LINE_TO:
					if (point.equals(currentPoint)) {
						this.coords.remove(i);
						this.types.remove(j);
						return true;
					}
					i++;
					break;
				case CURVE_TO:
					final Point3dfx p2 = this.coords.get(i + 1);
					final Point3dfx p3 = this.coords.get(i + 2);
					if ((point.equals(currentPoint))
							|| (point.equals(p2))
							|| (point.equals(p3))) {
						this.coords.remove(i, i + 3);
						this.types.remove(j);
						return true;
					}
					i += 3;
					break;
				case QUAD_TO:
					final Point3dfx pt = this.coords.get(i + 1);
					if ((point.equals(currentPoint))
							|| (point.equals(pt))) {
						this.coords.remove(i, i + 2);
						this.types.remove(j);
						return true;
					}
					i += 2;
					break;
				case ARC_TO:
					throw new IllegalStateException();
					//$CASES-OMITTED$
				default:
					break;
				}
			}
		}
		return false;
	}
720708
public static <V> void removeVertices(DirectedGraph<V, DefaultEdge> graph, Set<V> vertices) {
        for (V vertex : vertices) {
            if (graph.containsVertex(vertex)) {
                graph.removeVertex(vertex);
            }
        }
    }
288592
public static Slice serialize(Geometry geometry)
    {
        requireNonNull(geometry, "input is null");
        DynamicSliceOutput output = new DynamicSliceOutput(100);
        writeGeometry(geometry, output);
        return output.slice();
    }
1352231
private void removePairs(GvmCluster<S,K> cluster) {
		GvmClusterPair<S,K>[] pairs = cluster.pairs;
		for (int i = 0; i < bound-1; i++) {
			GvmClusterPair<S,K> pair = pairs[i];
			if (pair.c1.removed || pair.c2.removed) continue;
			this.pairs.remove(pair);
		}
		
	}
203118
public void onGeometryEditMove(GeometryEditMoveEvent event) {
		
		// Find the elements that need updating:
		Map<GeometryIndex, Boolean> indicesToUpdate = new HashMap<GeometryIndex, Boolean>();
		for (GeometryIndex index : event.getIndices()) {
			if (!indicesToUpdate.containsKey(index)) {
				indicesToUpdate.put(index, false);
				if (!Geometry.POINT.equals(editingService.getGeometry().getGeometryType())
						&& !Geometry.MULTI_POINT.equals(editingService.getGeometry().getGeometryType())) {
					try {
						List<GeometryIndex> neighbors = null;
						switch (editingService.getIndexService().getType(index)) {
							case TYPE_VERTEX:
								// Move current vertex to the back. This helps the delete operation.
								indicesToUpdate.put(index, true);
								neighbors = editingService.getIndexService().getAdjacentEdges(event.getGeometry(),
										index);
								if (neighbors != null) {
									for (GeometryIndex neighborIndex : neighbors) {
										if (!indicesToUpdate.containsKey(neighborIndex)) {
											indicesToUpdate.put(neighborIndex, false);
										}
									}
								}

								neighbors = editingService.getIndexService().getAdjacentVertices(event.getGeometry(),
										index);
								if (neighbors != null) {
									for (GeometryIndex neighborIndex : neighbors) {
										if (!indicesToUpdate.containsKey(neighborIndex)) {
											indicesToUpdate.put(neighborIndex, false);
										}
									}
								}
								break;
							case TYPE_EDGE:
								neighbors = editingService.getIndexService().getAdjacentVertices(event.getGeometry(),
										index);
								if (neighbors != null) {
									for (GeometryIndex neighborIndex : neighbors) {
										if (!indicesToUpdate.containsKey(neighborIndex)) {
											indicesToUpdate.put(neighborIndex, false);
										}
									}
								}
								break;
							default:
						}
					} catch (GeometryIndexNotFoundException e) {
						throw new IllegalStateException(e);
					}
				}
			}
		}

		// Check if we need to draw the background (nice, but slows down):
		if (styleService.getBackgroundStyle() != null && styleService.getBackgroundStyle().getFillOpacity() > 0) {
			if (event.getGeometry().getGeometryType().equals(Geometry.POLYGON)) {
				org.geomajas.gwt.client.spatial.geometry.Geometry transformed = mapWidget.getMapModel()
						.getMapView().getWorldViewTransformer()
						.worldToPan(GeometryConverter.toGwt(event.getGeometry()));
				mapWidget.getVectorContext().drawPolygon(groups.get(baseName + ".background"), "background",
						(Polygon) transformed, styleService.getBackgroundStyle());
			} else if (event.getGeometry().getGeometryType().equals(Geometry.MULTI_POLYGON)
					&& event.getGeometry().getGeometries() != null) {
				for (int i = 0; i < event.getGeometry().getGeometries().length; i++) {
					Geometry polygon = event.getGeometry().getGeometries()[i];

					org.geomajas.gwt.client.spatial.geometry.Geometry transformed = mapWidget.getMapModel()
							.getMapView().getWorldViewTransformer().worldToPan(GeometryConverter.toGwt(polygon));
					mapWidget.getVectorContext().drawPolygon(
							groups.get(baseName + ".geometry" + i + ".background"), "background",
							(Polygon) transformed, styleService.getBackgroundStyle());
				}
			}
		}

		// Next, redraw the list:
		for (GeometryIndex index : indicesToUpdate.keySet()) {
			update(event.getGeometry(), index, indicesToUpdate.get(index));
		}

	}