Generate a tin from a given coords list. The internal tin geoms array is set from the result.

@param coordinateList the coords to use for the tin generation.
9613
private void generateTin( List<Coordinate> coordinateList ) {
        pm.beginTask("Generate tin...", -1);
        DelaunayTriangulationBuilder b = new DelaunayTriangulationBuilder();
        b.setSites(coordinateList);
        Geometry tinTriangles = b.getTriangles(gf);
        tinGeometries = new Geometry[tinTriangles.getNumGeometries()];
        for( int i = 0; i < tinTriangles.getNumGeometries(); i++ ) {
            tinGeometries[i] = tinTriangles.getGeometryN(i);
        }
        pm.done();
    }
190703
public SimpleOrderedMap<Object> create(ComponentList list, Boolean encode) {
    SimpleOrderedMap<Object> mtasListResponse = new SimpleOrderedMap<>();
    mtasListResponse.add("key", list.key);
    if (list.number == 0) {
      mtasListResponse.add("total", list.total);
    }
    if (list.output != null) {
      ArrayList<NamedList<Object>> mtasListItemResponses = new ArrayList<>();
      if (list.output.equals(ComponentList.LIST_OUTPUT_HIT)) {
        mtasListResponse.add("number", list.hits.size());
        for (ListHit hit : list.hits) {
          NamedList<Object> mtasListItemResponse = new SimpleOrderedMap<>();
          mtasListItemResponse.add("documentKey",
              list.uniqueKey.get(hit.docId));
          mtasListItemResponse.add("documentHitPosition", hit.docPosition);
          mtasListItemResponse.add("documentHitTotal",
              list.subTotal.get(hit.docId));
          mtasListItemResponse.add("documentMinPosition",
              list.minPosition.get(hit.docId));
          mtasListItemResponse.add("documentMaxPosition",
              list.maxPosition.get(hit.docId));
          mtasListItemResponse.add("startPosition", hit.startPosition);
          mtasListItemResponse.add("endPosition", hit.endPosition);

          SortedMap<Integer, List<List<String>>> hitData = new TreeMap<>();
          SortedMap<Integer, List<List<String>>> leftData = null;
          SortedMap<Integer, List<List<String>>> rightData = null;
          if (list.left > 0) {
            leftData = new TreeMap<>();
          }
          if (list.right > 0) {
            rightData = new TreeMap<>();
          }
          for (int position = Math.max(0,
              hit.startPosition - list.left); position <= (hit.endPosition
                  + list.right); position++) {
            List<List<String>> hitDataItem = new ArrayList<>();
            if (hit.hits.containsKey(position)) {
              for (String term : hit.hits.get(position)) {
                List<String> hitDataSubItem = new ArrayList<>();
                hitDataSubItem.add(CodecUtil.termPrefix(term));
                hitDataSubItem.add(CodecUtil.termValue(term));
                hitDataItem.add(hitDataSubItem);
              }
            }
            if (position < hit.startPosition) {
              if (leftData != null) {
                leftData.put(position, hitDataItem);
              }
            } else if (position > hit.endPosition) {
              if (rightData != null) {
                rightData.put(position, hitDataItem);
              }
            } else {
              hitData.put(position, hitDataItem);
            }
          }
          if (list.left > 0) {
            mtasListItemResponse.add("left", leftData);
          }
          mtasListItemResponse.add("hit", hitData);
          if (list.right > 0) {
            mtasListItemResponse.add("right", rightData);
          }
          mtasListItemResponses.add(mtasListItemResponse);
        }
      } else if (list.output.equals(ComponentList.LIST_OUTPUT_TOKEN)) {
        mtasListResponse.add("number", list.tokens.size());
        for (ListToken tokenHit : list.tokens) {
          NamedList<Object> mtasListItemResponse = new SimpleOrderedMap<>();
          mtasListItemResponse.add("documentKey",
              list.uniqueKey.get(tokenHit.docId));
          mtasListItemResponse.add("documentHitPosition", tokenHit.docPosition);
          mtasListItemResponse.add("documentHitTotal",
              list.subTotal.get(tokenHit.docId));
          mtasListItemResponse.add("documentMinPosition",
              list.minPosition.get(tokenHit.docId));
          mtasListItemResponse.add("documentMaxPosition",
              list.maxPosition.get(tokenHit.docId));
          mtasListItemResponse.add("startPosition", tokenHit.startPosition);
          mtasListItemResponse.add("endPosition", tokenHit.endPosition);

          ArrayList<NamedList<Object>> mtasListItemResponseItemTokens = new ArrayList<>();
          for (MtasToken token : tokenHit.tokens) {
            NamedList<Object> mtasListItemResponseItemToken = new SimpleOrderedMap<>();
            if (token.getId() != null) {
              mtasListItemResponseItemToken.add("mtasId", token.getId());
            }
            mtasListItemResponseItemToken.add("prefix", token.getPrefix());
            mtasListItemResponseItemToken.add("value", token.getPostfix());
            if (token.getPositionStart() != null) {
              mtasListItemResponseItemToken.add("positionStart",
                  token.getPositionStart());
              mtasListItemResponseItemToken.add("positionEnd",
                  token.getPositionEnd());
            }
            if (token.getPositions() != null) {
              mtasListItemResponseItemToken.add("positions",
                  Arrays.toString(token.getPositions()));
            }
            if (token.getParentId() != null) {
              mtasListItemResponseItemToken.add("parentMtasId",
                  token.getParentId());
            }
            if (token.getPayload() != null) {
              mtasListItemResponseItemToken.add("payload", token.getPayload());
            }
            if (token.getOffsetStart() != null) {
              mtasListItemResponseItemToken.add("offsetStart",
                  token.getOffsetStart());
              mtasListItemResponseItemToken.add("offsetEnd",
                  token.getOffsetEnd());
            }
            if (token.getRealOffsetStart() != null) {
              mtasListItemResponseItemToken.add("realOffsetStart",
                  token.getRealOffsetStart());
              mtasListItemResponseItemToken.add("realOffsetEnd",
                  token.getRealOffsetEnd());
            }
            mtasListItemResponseItemTokens.add(mtasListItemResponseItemToken);
          }
          mtasListItemResponse.add("tokens", mtasListItemResponseItemTokens);
          mtasListItemResponses.add(mtasListItemResponse);
        }
      }
      mtasListResponse.add(NAME, mtasListItemResponses);
    }
    return mtasListResponse;
  }
764913
public List<Triangle> triangulate(List<Vector3> points) {
		init(points.size());

		Set<Vector3> vertices = new TreeSet<Vector3>(new PointComparator());

		bbMin = new Vector3(points.get(0));
		bbMax = new Vector3(points.get(0));

		//Insert Points
		for (Vector3 point:points) {
			this.insertPoint(vertices, point);
		}

		List<Triangle> triangles = null;

		if (modCount != modCount2 && vertices.size() > 2) {
			triangles = generateTriangles();
		}

		return triangles;
	}
185542
Collection<Point2d[]> getCoordinates(IAtomContainer mol) {
        try {
            // create the library key to lookup an entry, we also store
            // the canonical out ordering
            int n = mol.getAtomCount();
            int[] ordering = new int[n];
            String smiles = cansmi(mol, ordering);

            final Collection<Point2d[]> coordSet = templateMap.get(smiles);
            final List<Point2d[]> orderedCoordSet = new ArrayList<>(coordSet.size());

            for (Point2d[] coords : coordSet) {
                Point2d[] orderedCoords = new Point2d[coords.length];
                for (int i = 0; i < n; i++) {
                    orderedCoords[i] = new Point2d(coords[ordering[i]]);
                }
                orderedCoordSet.add(orderedCoords);
            }
            return Collections.unmodifiableList(orderedCoordSet);
        } catch (CDKException e) {
            return Collections.emptyList();
        }
    }
648174
private void addGeometry(Geometry geom) {
        if (geom != null) {
            if (geom instanceof GeometryCollection) {
                List<Geometry> toUnitTmp = new ArrayList<Geometry>(geom.getNumGeometries());
                for (int i = 0; i < geom.getNumGeometries(); i++) {
                    toUnitTmp.add(geom.getGeometryN(i));
                    feedDim(geom.getGeometryN(i));
                }
                toUnite.addAll(toUnitTmp);
            } else {
                toUnite.add(geom);
                feedDim(geom);
            }
        }
    }
586925
public static com.vividsolutions.jts.geom.Coordinate toJts(org.geomajas.geometry.Coordinate coordinate)
			throws JtsConversionException {
		if (coordinate == null) {
			throw new  JtsConversionException("Cannot convert null argument");
		}
		return new com.vividsolutions.jts.geom.Coordinate(coordinate.getX(), coordinate.getY());
	}
633384
public void drawLine(double[]... coord) {
        int[][] sc = new int[coord.length][];
        for (int i = 0; i < sc.length; i++) {
            sc[i] = projection.screenProjection(coord[i]);
        }

        drawLine(sc);
    }
721207
private static boolean processCoords(CharIter iter, CxSmilesState state) {
        if (state.atomCoords == null)
            state.atomCoords = new ArrayList<>();
        while (iter.hasNext()) {

            // end of coordinate list
            if (iter.curr() == ')') {
                iter.next();
                iter.nextIf(','); // optional
                return true;
            }

            double x = readDouble(iter);
            if (!iter.nextIf(','))
                return false;
            double y = readDouble(iter);
            if (!iter.nextIf(','))
                return false;
            double z = readDouble(iter);
            iter.nextIf(';');

            state.coordFlag = state.coordFlag || z != 0;
            state.atomCoords.add(new double[]{x, y, z});
        }
        return false;
    }
462570
def convert_coordinates(self):
        
        coord_list = []
        # strip out "null" elements, i.e. ''.  It might be possible to eliminate
        # these some other way, i.e. with regex directly, but I don't know how.
        # We need to copy in order not to burn up the iterators
        elements = [x for x in regex_splitter.split(self.coord_str) if x]
        element_parsers = self.language_spec[self.region_type]
        for ii, (element, element_parser) in enumerate(zip(elements,
                                                           element_parsers)):
            if element_parser is coordinate:
                unit = self.coordinate_units[self.coordsys][ii % 2]
                coord_list.append(element_parser(element, unit))
            elif self.coordinate_units[self.coordsys][0] is u.dimensionless_unscaled:
                    coord_list.append(element_parser(element, unit=u.dimensionless_unscaled))
            else:
                coord_list.append(element_parser(element))

        if self.region_type in ['ellipse', 'box'] and len(coord_list) % 2 == 1:
                coord_list[-1] = CoordinateParser.parse_angular_length_quantity(elements[len(coord_list)-1])

        # Reset iterator for ellipse and annulus
        # Note that this cannot be done with copy.deepcopy on python2
        if self.region_type in ['ellipse', 'annulus']:
            self.language_spec[self.region_type] = itertools.chain(
                (coordinate, coordinate), itertools.cycle((radius,)))

        self.coord = coord_list
65149
public void fillPolygon(double[]... coord) {
        int[][] c = new int[coord.length][2];
        for (int i = 0; i < coord.length; i++) {
            c[i] = projection.screenProjection(coord[i]);
        }

        int[] x = new int[c.length];
        for (int i = 0; i < c.length; i++) {
            x[i] = c[i][0];
        }
        int[] y = new int[c.length];
        for (int i = 0; i < c.length; i++) {
            y[i] = c[i][1];
        }

        g2d.fillPolygon(x, y, c.length);
    }
583746
public static List<LineString> getSectionsFromCoordinates( List<Coordinate> coordinates, double width ) {

        if (coordinates.size() < 3) {
            throw new IllegalArgumentException("This method works only on lines with at least 3 coordinates.");
        }
        double halfWidth = width / 2.0;
        List<LineString> linesList = new ArrayList<LineString>();
        // first section
        Coordinate centerCoordinate = coordinates.get(0);
        LineSegment l1 = new LineSegment(centerCoordinate, coordinates.get(1));
        Coordinate leftCoordinate = l1.pointAlongOffset(0.0, halfWidth);
        Coordinate rightCoordinate = l1.pointAlongOffset(0.0, -halfWidth);
        LineString lineString = geomFactory.createLineString(new Coordinate[]{leftCoordinate, centerCoordinate, rightCoordinate});
        linesList.add(lineString);

        for( int i = 1; i < coordinates.size() - 1; i++ ) {
            Coordinate previous = coordinates.get(i - 1);
            Coordinate current = coordinates.get(i);
            Coordinate after = coordinates.get(i + 1);

            double firstAngle = azimuth(current, previous);
            double secondAngle = azimuth(current, after);

            double a1 = min(firstAngle, secondAngle);
            double a2 = max(firstAngle, secondAngle);

            double centerAngle = a1 + (a2 - a1) / 2.0;

            AffineTransformation rotationInstance = AffineTransformation.rotationInstance(-toRadians(centerAngle), current.x,
                    current.y);

            LineString vertical = geomFactory.createLineString(new Coordinate[]{new Coordinate(current.x, current.y + halfWidth),
                    current, new Coordinate(current.x, current.y - halfWidth)});
            Geometry transformed = rotationInstance.transform(vertical);
            linesList.add((LineString) transformed);
        }

        // last section
        centerCoordinate = coordinates.get(coordinates.size() - 1);
        LineSegment l2 = new LineSegment(centerCoordinate, coordinates.get(coordinates.size() - 2));
        leftCoordinate = l2.pointAlongOffset(0.0, halfWidth);
        rightCoordinate = l2.pointAlongOffset(0.0, -halfWidth);
        lineString = geomFactory.createLineString(new Coordinate[]{leftCoordinate, centerCoordinate, rightCoordinate});
        linesList.add(lineString);

        return linesList;
    }
52506
private PointSequence createPointSequence(double[][] coordinates, CrsId crsId) {
        if (coordinates == null) {
            return null;
        } else if (coordinates.length == 0) {
            return PointCollectionFactory.createEmpty();
        }

        DimensionalFlag df = coordinates[0].length == 4 ? DimensionalFlag.d3DM  : coordinates[0].length == 3 ? DimensionalFlag.d3D : DimensionalFlag.d2D;
        PointSequenceBuilder psb = PointSequenceBuilders.variableSized(df, crsId);
        for (double[] point : coordinates) {
            psb.add(point);
        }
        return psb.toPointSequence();
    }
1329460
public Coordinate[] getCoordinates() {
		if (isEmpty()) {
			return null;
		}
		Coordinate[] coordinates = new Coordinate[getNumPoints()];
		int count = 0;
		for (LineString lineString : lineStrings) {
			for (int j = 0; j < lineString.getNumPoints(); j++) {
				coordinates[count++] = lineString.getCoordinateN(j);
			}
		}
		return coordinates;
	}
658334
public static void iterate(INDArray arr, CoordinateFunction coordinateFunction) {
        Shape.iterate(0, arr.rank(), arr.shape(), new long[arr.rank()], coordinateFunction);
    }
479611
public void init( List<T> list , int bucketSize ) {
		if( list.size() < bucketSize ) {
			throw new RuntimeException("There needs to be more than or equal to elements in the 'list' that there are in the bucket");
		}

		this.k = bucketSize;
		this.c = bucketSize - 1;
		N = list.size();

		bins = new int[ bucketSize ];

		for( int i = 0; i < bins.length; i++ ) {
			bins[i] = i;
		}

		this.a = list;
		state = 1;
	}
972037
public void addCoordinate(Coordinate coordinate) {
		Coordinate[] newCoords = new Coordinate[coordinates.length + 1];
		System.arraycopy(coordinates, 0, newCoords, 0, coordinates.length);
		newCoords[coordinates.length] = coordinate;
		setCoordinates(newCoords);
	}
1251661
public void setSourceIdsList(java.util.Collection<String> sourceIdsList) {
        if (sourceIdsList == null) {
            this.sourceIdsList = null;
            return;
        }

        this.sourceIdsList = new java.util.ArrayList<String>(sourceIdsList);
    }