/* Copyright (c) 1997-2004
Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany)
http://www.math.tu-berlin.de/polymake, mailto:polymake@math.tu-berlin.de
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version: http://www.gnu.org/licenses/gpl.txt.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
$Project: polymake $$Id: PointSet.java 6461 2005-11-01 09:15:11Z thilosch $
*/
package de.tuberlin.polymake.common;
public class PointSet {
/** the name of the pointset */
protected String name;
/** the coordinates of the pointset */
protected PolymakePoint[] points;
/** dimension */
int dim = 3;
public PointSet() {
name = null;
points = null;
}
public PointSet(String name, int nPoints) {
this.name = name;
points = new PolymakePoint[nPoints];
}
public void setName(String name) {
this.name = name;
}
public void setPoint(int index, PolymakePoint pt) {
points[index] = pt;
}
public void setPoints(PolymakePoint[] points) {
if(this.points == null)
this.points = new PolymakePoint[points.length];
System.arraycopy(points,0,this.points,0,points.length);
}
/*
public void setPoint(int index, double[] coords, String label) {
points[index] = new Point(coords,label);
}
public void setPoint(int index, double[] coords) {
points[index] = new Point(coords);
}
*/
public String getName() {
return name;
}
public PolymakePoint getPoint(int index) {
return points[index];
}
public PolymakePoint[] getPoints() {
return points;
}
public int getNPoints() {
return points.length;
}
/**
* @return Returns the dim.
*/
public int getDim() {
return dim;
}
/**
* @param dim The dim to set.
*/
public void setDim(int dim) {
this.dim = dim;
}
}
syntax highlighted by Code2HTML, v. 0.9.1