mirror of https://github.com/CGAL/cgal
re-add and fix OFF-output; size_t and static_cast
This commit is contained in:
parent
e7900a02a3
commit
d17c5a763a
|
|
@ -60,7 +60,7 @@ bool
|
|||
file_input(const Options& opt, std::vector<Point>& points)
|
||||
{
|
||||
const char* finput = opt.finname;
|
||||
int number_of_points = opt.number_of_points;
|
||||
std::size_t number_of_points = opt.number_of_points;
|
||||
bool xyz = opt.xyz;
|
||||
|
||||
std::ios::openmode mode = (opt.binary) ? std::ios::binary : std::ios::in;
|
||||
|
|
@ -78,17 +78,19 @@ file_input(const Options& opt, std::vector<Point>& points)
|
|||
else
|
||||
std::cout << "Input from file : " << finput << std::endl;
|
||||
|
||||
int n;
|
||||
std::size_t n;
|
||||
if(! xyz){
|
||||
is >> n;
|
||||
std::cout << " reading " << n << " points" << std::endl;
|
||||
points.reserve(n);
|
||||
CGAL::copy_n(std::istream_iterator<Point>(is), n, std::back_inserter(points));
|
||||
CGAL::cpp11::copy_n(std::istream_iterator<Point>(is), n, std::back_inserter(points));
|
||||
} else {
|
||||
// we do not know beforehand how many points we will read
|
||||
std::istream_iterator<Point> it(is), eof;
|
||||
char ignore[256];
|
||||
while(it!= eof){
|
||||
points.push_back(*it);
|
||||
is.getline(ignore,256);
|
||||
it++;
|
||||
}
|
||||
n = points.size();
|
||||
|
|
@ -478,7 +480,8 @@ int main(int argc, char* argv[])
|
|||
|
||||
|
||||
std::cout << "Total time: " << timer.time() << " sec." << std::endl;
|
||||
write_to_file_vrml2(opt.foutname, S, opt.contour, opt.red, opt.green, opt.blue, opt.no_header);
|
||||
// write_to_file_vrml2(opt.foutname, S, opt.contour, opt.red, opt.green, opt.blue, opt.no_header);
|
||||
write_to_file(opt.foutname, S, opt.contour, opt.out_format, opt.red, opt.green, opt.blue, opt.no_header);
|
||||
|
||||
|
||||
std::cout << " " << S.number_of_outliers()
|
||||
|
|
|
|||
|
|
@ -179,12 +179,12 @@ facet_number(int i)
|
|||
|
||||
inline bool is_selected_facet(const int& i)
|
||||
{
|
||||
return selected_facet & (1 << i);
|
||||
return (selected_facet & (1 << i)) != 0;
|
||||
}
|
||||
|
||||
inline bool has_facet_on_surface(const int& i)
|
||||
{
|
||||
return selected_facet & (1 << i);
|
||||
return (selected_facet & (1 << i)) != 0;
|
||||
}
|
||||
|
||||
#ifdef AFSR_LAZY
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ public:
|
|||
: T(T_), _number_of_border(1), SLIVER_ANGULUS(.86), DELTA(opt.delta), min_K(HUGE_VAL),
|
||||
eps(1e-7), inv_eps_2(coord_type(1)/(eps*eps)), eps_3(eps*eps*eps),
|
||||
STANDBY_CANDIDATE(3), STANDBY_CANDIDATE_BIS(STANDBY_CANDIDATE+1),
|
||||
NOT_VALID_CANDIDATE(STANDBY_CANDIDATE+2), _vh_number(T.number_of_vertices()), _facet_number(0),
|
||||
NOT_VALID_CANDIDATE(STANDBY_CANDIDATE+2), _vh_number(static_cast<int>(T.number_of_vertices())), _facet_number(0),
|
||||
_postprocessing_counter(0), _size_before_postprocessing(0), area(opt.area), perimeter(opt.perimeter),
|
||||
abs_area(opt.abs_area), abs_perimeter(opt.abs_perimeter),
|
||||
total_area(0), total_perimeter(0), _number_of_connected_components(0)
|
||||
|
|
@ -321,7 +321,7 @@ public:
|
|||
|
||||
int number_of_outliers() const
|
||||
{
|
||||
return outliers.size();
|
||||
return static_cast<int>(outliers.size());
|
||||
}
|
||||
|
||||
typedef typename std::list<Point>::const_iterator Outlier_iterator;
|
||||
|
|
@ -1060,7 +1060,7 @@ public:
|
|||
void
|
||||
ordered_map_erase(const criteria& value, const IO_edge_type* pkey)
|
||||
{
|
||||
int number_of_conflict = _ordered_border.count(value);
|
||||
std::size_t number_of_conflict = _ordered_border.count(value);
|
||||
if (number_of_conflict == 1)
|
||||
{
|
||||
_ordered_border.erase(_ordered_border.find(value));
|
||||
|
|
@ -1073,7 +1073,7 @@ public:
|
|||
_ordered_border.find(value);
|
||||
// si ca foire jamais on peut s'areter des que l'elt
|
||||
// est trouve!!!
|
||||
for(int jj=0; (jj<number_of_conflict); jj++)
|
||||
for(std::size_t jj=0; (jj<number_of_conflict); jj++)
|
||||
{
|
||||
if (((long) elt_it->second) == ((long) pkey))
|
||||
{
|
||||
|
|
@ -1908,7 +1908,7 @@ public:
|
|||
L_v.push_back(v_it);
|
||||
}
|
||||
|
||||
unsigned int itmp, L_v_size_mem;
|
||||
std::size_t itmp, L_v_size_mem;
|
||||
L_v_size_mem = L_v.size();
|
||||
if ((vh_on_border_inserted != 0)&& // pour ne post-traiter que les bords
|
||||
(L_v.size() < .1 * _size_before_postprocessing))
|
||||
|
|
|
|||
|
|
@ -59,9 +59,9 @@ write_to_file_medit(char* foutput, const Surface& S)
|
|||
CGAL::set_ascii_mode(os_faces);
|
||||
|
||||
// af: what is the relationship to _vh_number in Extract_surface
|
||||
int _vh_number = std::count_if(T.finite_vertices_begin(),
|
||||
T.finite_vertices_end(),
|
||||
Is_not_exterior<Vertex>());
|
||||
std::size_t _vh_number = std::count_if(T.finite_vertices_begin(),
|
||||
T.finite_vertices_end(),
|
||||
Is_not_exterior<Vertex>());
|
||||
|
||||
os_points << _vh_number << std::endl;
|
||||
|
||||
|
|
@ -147,9 +147,9 @@ write_to_file_gv(char* foutput, const Surface& S)
|
|||
|
||||
CGAL::set_ascii_mode(os);
|
||||
|
||||
int _vh_number = std::count_if(T.finite_vertices_begin(),
|
||||
T.finite_vertices_end(),
|
||||
Is_not_exterior<Vertex>());
|
||||
std::size_t _vh_number = std::count_if(T.finite_vertices_begin(),
|
||||
T.finite_vertices_end(),
|
||||
Is_not_exterior<Vertex>());
|
||||
// Header.
|
||||
os << "OFF" << std::endl
|
||||
<< _vh_number << " " << S.number_of_facets() << " " << 0 << std::endl;
|
||||
|
|
@ -186,10 +186,7 @@ write_to_file_gv(char* foutput, const Surface& S)
|
|||
os << 3 << " ";
|
||||
os << vertex_index_map[c->vertex(i1)] << " ";
|
||||
os << vertex_index_map[c->vertex(i2)] << " ";
|
||||
os << vertex_index_map[c->vertex(i3)] << " ";
|
||||
os << 0 << std::endl; // without color.
|
||||
// os << 4 << drand48() << drand48() << drand48() << 1.0; // random
|
||||
// color
|
||||
os << vertex_index_map[c->vertex(i3)] << "\n";
|
||||
}
|
||||
|
||||
if (n->is_selected_facet(ni))
|
||||
|
|
@ -200,10 +197,7 @@ write_to_file_gv(char* foutput, const Surface& S)
|
|||
os << 3 << " ";
|
||||
os << vertex_index_map[n->vertex(i1)] << " ";
|
||||
os << vertex_index_map[n->vertex(i2)] << " ";
|
||||
os << vertex_index_map[n->vertex(i3)] << " ";
|
||||
os << 0 << std::endl; // without color.
|
||||
// os << 4 << drand48() << drand48() << drand48() << 1.0; // random
|
||||
// color
|
||||
os << vertex_index_map[n->vertex(i3)] << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue