mirror of https://github.com/CGAL/cgal
Cartesian->Simple_cartesian / float->double / int -> size_t
This commit is contained in:
parent
7762ed8e02
commit
d6d5c6c558
|
|
@ -2,7 +2,7 @@
|
|||
// The scanner triggers on Coordinate3, IndexedFaceSet, and IndexedLineSet
|
||||
// keywords. It does not recognize transformations nor groups.
|
||||
|
||||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/IO/Verbose_ostream.h>
|
||||
#include <CGAL/IO/File_writer_OFF.h>
|
||||
#include <cstddef>
|
||||
|
|
@ -14,11 +14,11 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
typedef CGAL::Cartesian<float> Kernel;
|
||||
typedef Kernel::Point_3 Point;
|
||||
typedef list<Point> Point_list;
|
||||
typedef list<int> Facet;
|
||||
typedef list<Facet> Facet_list;
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef Kernel::Point_3 Point;
|
||||
typedef list<Point> Point_list;
|
||||
typedef list<std::size_t> Facet;
|
||||
typedef list<Facet> Facet_list;
|
||||
|
||||
// Command line arguments
|
||||
// ======================
|
||||
|
|
@ -38,10 +38,10 @@ Facet_list facets;
|
|||
// iv File Scanner
|
||||
// ===============
|
||||
void iv_file_scanner( istream& in) {
|
||||
int offset = 0; // offset for the Index....Set
|
||||
char c; // one read character (comment, vertex, or facet)
|
||||
char str[2000]; // temporal storage for rest of identifier
|
||||
int blocks = 0; // Number of blocks found.
|
||||
std::size_t offset = 0; // offset for the Index....Set
|
||||
char c; // one read character (comment, vertex, or facet)
|
||||
char str[2000]; // temporal storage for rest of identifier
|
||||
int blocks = 0; // Number of blocks found.
|
||||
|
||||
CGAL::Verbose_ostream vout( verbose);
|
||||
in >> str;
|
||||
|
|
@ -94,7 +94,7 @@ void iv_file_scanner( istream& in) {
|
|||
vout << "\"IndexedFaceSet { coordIndex\" block found."
|
||||
<< endl;
|
||||
// indices start here
|
||||
int face_offset = facets.size();
|
||||
std::size_t face_offset = facets.size();
|
||||
in >> c;
|
||||
CGAL_assertion( c == '[');
|
||||
facets.push_back( Facet());
|
||||
|
|
@ -128,7 +128,7 @@ void iv_file_scanner( istream& in) {
|
|||
vout << "\"IndexedLineSet { coordIndex\" block found."
|
||||
<< endl;
|
||||
// indices start here
|
||||
int face_offset = facets.size();
|
||||
std::size_t face_offset = facets.size();
|
||||
in >> c;
|
||||
CGAL_assertion( c == '[');
|
||||
facets.push_back( Facet());
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
// Convert from OFF format to OpenInventor (.iv) format.
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/IO/Verbose_ostream.h>
|
||||
#include <CGAL/IO/Inventor_ostream.h>
|
||||
#include <CGAL/IO/File_writer_inventor.h>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
// Copies a file in OFF format.
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/IO/Verbose_ostream.h>
|
||||
#include <CGAL/IO/File_writer_OFF.h>
|
||||
#include <CGAL/IO/generic_copy_OFF.h>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
// Convert from OFF format to VRML (.wrl) 1.0 or 2.0 format.
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/IO/Verbose_ostream.h>
|
||||
#include <CGAL/IO/VRML_1_ostream.h>
|
||||
#include <CGAL/IO/VRML_2_ostream.h>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
// Convert from OFF format to Wavefront (.obj) format.
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/IO/Verbose_ostream.h>
|
||||
#include <CGAL/IO/File_writer_wavefront.h>
|
||||
#include <CGAL/IO/generic_copy_OFF.h>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
// computes bbox of an OFF object.
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Bbox_3.h>
|
||||
#include <CGAL/IO/Verbose_ostream.h>
|
||||
#include <CGAL/IO/File_scanner_OFF.h>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// Glue vertices of a polyhedron together that have equal coordinate values.
|
||||
|
||||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/IO/Verbose_ostream.h>
|
||||
#include <CGAL/IO/File_scanner_OFF.h>
|
||||
#include <CGAL/IO/File_writer_OFF.h>
|
||||
|
|
@ -14,9 +14,9 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
typedef CGAL::Cartesian<float> Kernel;
|
||||
typedef Kernel::Point_3 Point;
|
||||
typedef Kernel::Vector_3 Vector;
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef Kernel::Point_3 Point;
|
||||
typedef Kernel::Vector_3 Vector;
|
||||
struct Vertex {
|
||||
Point point;
|
||||
Vector normal;
|
||||
|
|
@ -179,11 +179,11 @@ int main( int argc, char **argv) {
|
|||
// Copy facets and translate vertex indices.
|
||||
writer.write_facet_header();
|
||||
for ( i = 0; i < scanner.size_of_facets(); i++) {
|
||||
int no; // number of vertices of a facet.
|
||||
std::size_t no; // number of vertices of a facet.
|
||||
scanner.scan_facet( no, i);
|
||||
writer.write_facet_begin( no);
|
||||
for ( int j = 0; j < no; j++) {
|
||||
int index;
|
||||
std::size_t index;
|
||||
scanner.scan_facet_vertex_index( index, i);
|
||||
writer.write_facet_vertex_index( vertices[index].index);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// Applies translation and scaling to an OFF object.
|
||||
|
||||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/IO/Verbose_ostream.h>
|
||||
#include <CGAL/IO/File_scanner_OFF.h>
|
||||
#include <CGAL/IO/File_writer_OFF.h>
|
||||
|
|
@ -12,9 +12,9 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
typedef CGAL::Cartesian<float> Kernel;
|
||||
typedef Kernel::Point_3 Point;
|
||||
typedef Kernel::Vector_3 Vector;
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef Kernel::Point_3 Point;
|
||||
typedef Kernel::Vector_3 Vector;
|
||||
|
||||
bool verbose = false;
|
||||
bool binary = false;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// Copies a CGAL::Polyhedron_3 from OFF format to OFF format.
|
||||
|
||||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
#include <CGAL/IO/Polyhedron_iostream.h>
|
||||
#include <CGAL/IO/Verbose_ostream.h>
|
||||
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
typedef CGAL::Cartesian<double> Kernel;
|
||||
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
|
||||
|
||||
bool verbose = false;
|
||||
bool binary = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue