PointCoordinates(int pointDimension, const std::string &aComment, int coordinatesCount, const coordT *c)
: QhullPoints(pointDimension)
, point_coordinates()
, point_comment(aComment)
{
append(coordinatesCount, c);
}
PointCoordinates::
PointCoordinates(const PointCoordinates &other)
: QhullPoints(other)
, point_coordinates(other.point_coordinates)
, point_comment(other.point_comment)
{
makeValid();
}
PointCoordinates & PointCoordinates::
operator=(const PointCoordinates &other)
{
point_coordinates= other.point_coordinates;
point_comment= other.point_comment;
makeValid();
return *this;
}//operator=
PointCoordinates::
~PointCoordinates()
{ }
#//GetSet
void PointCoordinates::
checkValid() const
{
if(getCoordinates().data()!=data()
|| getCoordinates().count()!=coordinateCount()){
throw QhullError(10060, "Qhull error: first point (%x) is not PointCoordinates.data() or count (%d) is not PointCoordinates.count (%d)", coordinateCount(), getCoordinates().count(), 0.0, data());
}
}//checkValid
void PointCoordinates::
setDimension(int i)
{
if(i<0){
throw QhullError(10062, "Qhull error: can not set PointCoordinates dimension to %d", i);
}
int currentDimension=QhullPoints::dimension();
if(currentDimension!=0 && i!=currentDimension){
throw QhullError(10063, "Qhull error: can not change PointCoordinates dimension (from %d to %d)", currentDimension, i);
throw QhullError(10065, "Qhull error: can not append a subset of PointCoordinates to itself. The coordinates for point %d may move.", indexOf(c, QhullError::NOthrow));