gmio/tests/bench_occ/main.cpp

39 lines
946 B
C++
Raw Normal View History

2013-02-20 19:29:34 +08:00
extern "C" {
#include "../commons/bench_tools.h"
}
2012-02-29 03:27:32 +08:00
#include <OSD_Path.hxx>
#include <RWStl.hxx>
#include <StlMesh_Mesh.hxx>
2013-02-20 19:29:34 +08:00
#include <StlAPI_Reader.hxx>
#include <TopoDS_Shape.hxx>
2012-02-29 03:27:32 +08:00
2013-02-20 19:29:34 +08:00
static void occ_RWStl_ReadBinary(const char* filepath)
2012-02-29 03:27:32 +08:00
{
2013-02-20 19:29:34 +08:00
/*Handle_StlMesh_Mesh stlMesh = */RWStl::ReadBinary(OSD_Path(filepath));
}
2012-02-29 03:27:32 +08:00
2013-02-20 19:29:34 +08:00
static void occ_StlAPI_Reader(const char* filepath)
{
StlAPI_Reader reader;
TopoDS_Shape shape;
reader.Read(shape, filepath);
}
2012-02-29 03:27:32 +08:00
int main(int argc, char** argv)
{
2013-02-20 19:29:34 +08:00
if (argc > 1)
benchmark(&occ_RWStl_ReadBinary, "RWStl::ReadBinary()", argc - 1, argv + 1);
// startTick = std::clock();
// std::cout << "Read with StlAPI_Reader::Read() ..." << std::endl;
// for (int iarg = 1; iarg < argc; ++iarg) {
// StlAPI_Reader reader;
// TopoDS_Shape shape;
// reader.Read(shape, argv[iarg]);
// }
// std::cout << " StlAPI_Reader::Read() read time: " << elapsed_secs(startTick) << "s" << std::endl;
2012-02-29 03:27:32 +08:00
return 0;
}