remove size of data files

This commit is contained in:
Shlomo Golubev 2007-09-26 09:30:01 +00:00
parent 982a8c33be
commit aab3d2f90b
3 changed files with 30 additions and 32 deletions

View File

@ -560,32 +560,26 @@ bool Traits_test<T_Traits>::start()
template <class T_Traits>
bool Traits_test<T_Traits>::read_input(std::ifstream & is ,Read_object_type obj_t)
{
int num=0;
char one_line[128];
skip_comments(is, one_line);
std::istringstream str_stream(one_line, std::istringstream::in);
str_stream >> num;
str_stream.clear();
if (num > 0)
{
try
{
for (int i = 0; !is.eof() ; ++i)
{
switch (obj_t)
{
case POINT :
m_points.resize(num);
m_points.resize(m_points.size()+1);
break;
case CURVE :
m_curves.resize(num);
m_curves.resize(m_curves.size()+1);
break;
case XCURVE :
m_xcurves.resize(num);
m_xcurves.resize(m_xcurves.size()+1);
break;
}//switch
for (int i = 0; i < num; ++i)
{
skip_comments(is, one_line);
str_stream.str(one_line);
switch (obj_t)
{
case POINT :
@ -614,6 +608,8 @@ bool Traits_test<T_Traits>::read_input(std::ifstream & is ,Read_object_type obj_
break;
}//switch
str_stream.clear();
skip_comments(is, one_line);
str_stream.str(one_line);
}//for
/*for (int i = 0; i < num; ++i)
{ //for debug
@ -651,7 +647,6 @@ bool Traits_test<T_Traits>::read_input(std::ifstream & is ,Read_object_type obj_
is.close();
return false;
}//catch
} //if num>0
return true;
}

View File

@ -671,10 +671,13 @@ test_spherical_arc_traits()
echo " ERROR: not executed test_traits spherical_arc_traits" >> $ERRORFILE
else
execute_commands_old_structure spherical_arcs spherical_arc_traits \
COMPARE_Y_AT_X_LEFT COMPARE_Y_AT_X_RIGHT \
COMPARE_Y_AT_X_LEFT COMPARE_Y_AT_X_RIGHT INTERSECT \
BOUNDARY_IN_X BOUNDARY_IN_Y CONSTRUCTOR \
COMPARE MAKE_X_MONOTONE SPLIT MERGE ERRORS
execute_commands_new_structure spherical_arcs spherical_arc_traits \
INTERSECT
run_trapped_test test_traits \
data/spherical_arcs/compare.pt data/spherical_arcs/compare.xcv \
data/empty.zero data/spherical_arcs/compare spherical_arc_traits

View File

@ -83,6 +83,7 @@ read_point(stream & is, Point_2 & p)
{
Basic_number_type x, y, z;
is >> x >> y >> z;
//std::cout << "x " << x << " y " << y << " z " << z << std::endl;
p = Point_2(x, y, z);
return true;
}
@ -93,14 +94,14 @@ template <class stream>
bool
Traits_test<Traits>::read_xcurve(stream & is, X_monotone_curve_2 & xcv)
{
Basic_number_type x1, y1, z1, x2, y2, z2;
is >> x1 >> y1 >> z1 >> x2 >> y2 >> z2;
Point_2 p1(x1, y1, z1);
Point_2 p2(x2, y2, z2);
CGAL_assertion(p1 != p2);
xcv = X_monotone_curve_2(p1, p2);
Curve_2 cv;
if (read_curve(is,cv))
{
xcv = X_monotone_curve_2(cv);
return true;
}
return false;
}
/*! Read a curve */
template <>
@ -108,10 +109,9 @@ template <class stream>
bool
Traits_test<Traits>::read_curve(stream & is, Curve_2 & cv)
{
Basic_number_type x1, y1, z1, x2, y2, z2;
is >> x1 >> y1 >> z1 >> x2 >> y2 >> z2;
Point_2 p1(x1, y1, z1);
Point_2 p2(x2, y2, z2);
Point_2 p1,p2;
read_point(is,p1);
read_point(is,p2);
CGAL_assertion(p1 != p2);
cv = Curve_2(p1, p2);
return true;