throwQhullError(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
voidPointCoordinates::
setDimension(inti)
{
if(i<0){
throwQhullError(10062,"Qhull error: can not set PointCoordinates dimension to %d",i);
}
intcurrentDimension=QhullPoints::dimension();
if(currentDimension!=0&&i!=currentDimension){
throwQhullError(10063,"Qhull error: can not change PointCoordinates dimension (from %d to %d)",currentDimension,i);
throwQhullError(10065,"Qhull error: can not append a subset of PointCoordinates to itself. The coordinates for point %d may move.",indexOf(c,QhullError::NOthrow));
throwQhullError(10028,"Qhull argument error: comments can not start with a number or minus, %s",0,0,0.0,s.c_str());
}
}
point_comment+=s;
}//appendComment
//! Read PointCoordinates from istream. First two numbers are dimension and count. A non-digit starts a rboxCommand.
//! Overwrites point_comment. See qh_readpoints [io.c]
voidPointCoordinates::
appendPoints(istream&in)
{
intinDimension,inCount;
in>>ws>>inDimension>>ws;
if(!in.good()){
in.clear();
stringremainder;
getline(in,remainder);
throwQhullError(10005,"Qhull error: input did not start with dimension or count -- %s",0,0,0,remainder.c_str());
}
charc=(char)in.peek();
if(c!='-'&&!isdigit(c)){// Comments start with a non-digit
getline(in,point_comment);
in>>ws;
}
in>>inCount>>ws;
if(!in.good()){
in.clear();
stringremainder;
getline(in,remainder);
throwQhullError(10009,"Qhull error: input did not start with dimension and count -- %d %s",inDimension,0,0,remainder.c_str());
}
c=(char)in.peek();
if(c!='-'&&!isdigit(c)){// Comments start with a non-digit
getline(in,point_comment);
in>>ws;
}
if(inCount<inDimension){// Count may precede dimension
std::swap(inCount,inDimension);
}
setDimension(inDimension);
reserveCoordinates(inCount*inDimension);
intcoordinateCount=0;
while(!in.eof()){
realTp;
in>>p>>ws;
if(in.fail()){
in.clear();
stringremainder;
getline(in,remainder);
throwQhullError(10008,"Qhull error: failed to read coordinate %d of point %d\n %s",coordinateCount%inDimension,coordinateCount/inDimension,0,remainder.c_str());
}else{
point_coordinates.push_back(p);
coordinateCount++;
}
}
if(coordinateCount!=inCount*inDimension){
if(coordinateCount%inDimension==0){
throwQhullError(10006,"Qhull error: expected %d %d-d PointCoordinates but read %i PointCoordinates",int(inCount),inDimension,0.0,int(coordinateCount/inDimension));
}else{
throwQhullError(10012,"Qhull error: expected %d %d-d PointCoordinates but read %i PointCoordinates plus %f extra coordinates",inCount,inDimension,float(coordinateCount%inDimension),coordinateCount/inDimension);