gmio_support: fix compilation error with OpenCascade v6.8.0
This commit is contained in:
parent
8d91deb116
commit
362c789f5b
@ -156,22 +156,34 @@ static void RWStl_WriteBinary(const void* filepath)
|
|||||||
|
|
||||||
static void StlAPI_WriteAscii(const void* filepath)
|
static void StlAPI_WriteAscii(const void* filepath)
|
||||||
{
|
{
|
||||||
StlAPI_Writer writer;
|
if (!BmkBRep::inputShape.IsNull()) {
|
||||||
writer.ASCIIMode() = Standard_True;
|
StlAPI_Writer writer;
|
||||||
const char* cfilepath = static_cast<const char*>(filepath);
|
writer.ASCIIMode() = Standard_True;
|
||||||
const StlAPI_ErrorStatus err = writer.Write(BmkBRep::inputShape, cfilepath);
|
const char* cfilepath = static_cast<const char*>(filepath);
|
||||||
if (err != StlAPI_StatusOK)
|
#if OCC_VERSION_HEX >= 0x060900
|
||||||
std::cerr << "StlAPI_Writer::Write() error: " << err << std::endl;
|
const StlAPI_ErrorStatus err = writer.Write(BmkBRep::inputShape, cfilepath);
|
||||||
|
if (err != StlAPI_StatusOK)
|
||||||
|
std::cerr << "StlAPI_Writer::Write() error: " << err << std::endl;
|
||||||
|
#else
|
||||||
|
writer.Write(BmkBRep::inputShape, cfilepath);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void StlAPI_WriteBinary(const void* filepath)
|
static void StlAPI_WriteBinary(const void* filepath)
|
||||||
{
|
{
|
||||||
StlAPI_Writer writer;
|
if (!BmkBRep::inputShape.IsNull()) {
|
||||||
writer.ASCIIMode() = Standard_False;
|
StlAPI_Writer writer;
|
||||||
const char* cfilepath = static_cast<const char*>(filepath);
|
writer.ASCIIMode() = Standard_False;
|
||||||
const StlAPI_ErrorStatus err = writer.Write(BmkBRep::inputShape, cfilepath);
|
const char* cfilepath = static_cast<const char*>(filepath);
|
||||||
if (err != StlAPI_StatusOK)
|
#if OCC_VERSION_HEX >= 0x060900
|
||||||
std::cerr << "StlAPI_Writer::Write() error: " << err << std::endl;
|
const StlAPI_ErrorStatus err = writer.Write(BmkBRep::inputShape, cfilepath);
|
||||||
|
if (err != StlAPI_StatusOK)
|
||||||
|
std::cerr << "StlAPI_Writer::Write() error: " << err << std::endl;
|
||||||
|
#else
|
||||||
|
writer.Write(BmkBRep::inputShape, cfilepath);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace BmkOcc
|
} // namespace BmkOcc
|
||||||
|
@ -95,17 +95,23 @@ void gmio_stl_mesh_occmesh::init_cache()
|
|||||||
this->triangle_count += m_mesh->NbTriangles(dom_id);
|
this->triangle_count += m_mesh->NbTriangles(dom_id);
|
||||||
|
|
||||||
// Fill vector of triangle data
|
// Fill vector of triangle data
|
||||||
|
m_vec_domain_data.reserve(domain_count);
|
||||||
m_vec_triangle_data.reserve(this->triangle_count);
|
m_vec_triangle_data.reserve(this->triangle_count);
|
||||||
for (int dom_id = 1; dom_id <= domain_count; ++dom_id) {
|
for (int dom_id = 1; dom_id <= domain_count; ++dom_id) {
|
||||||
// Cache vertex indexes
|
// Cache vertex indexes
|
||||||
// TColgp_SequenceOfXYZ::Value(int) is slow(linear search)
|
// TColgp_SequenceOfXYZ::Value(int) is slow(linear search)
|
||||||
const TColgp_SequenceOfXYZ& seq_vertices = m_mesh->Vertices(dom_id);
|
const TColgp_SequenceOfXYZ& seq_vertices = m_mesh->Vertices(dom_id);
|
||||||
struct domain_data domdata;
|
struct domain_data domdata;
|
||||||
domdata.vec_coords.reserve(seq_vertices.Size());
|
domdata.vec_coords.reserve(seq_vertices.Length());
|
||||||
|
#if OCC_VERSION_HEX >= 0x070000
|
||||||
typedef TColgp_SequenceOfXYZ::const_iterator ConstIterSeqXYZ;
|
typedef TColgp_SequenceOfXYZ::const_iterator ConstIterSeqXYZ;
|
||||||
const ConstIterSeqXYZ seq_end = seq_vertices.cend();
|
const ConstIterSeqXYZ seq_end = seq_vertices.cend();
|
||||||
for (ConstIterSeqXYZ it = seq_vertices.cbegin(); it != seq_end; ++it)
|
for (ConstIterSeqXYZ it = seq_vertices.cbegin(); it != seq_end; ++it)
|
||||||
domdata.vec_coords.push_back(&(*it));
|
domdata.vec_coords.push_back(&(*it));
|
||||||
|
#else
|
||||||
|
for (int i = 1; i <= seq_vertices.Length(); ++i)
|
||||||
|
domdata.vec_coords.push_back(&seq_vertices.Value(i));
|
||||||
|
#endif
|
||||||
m_vec_domain_data.push_back(std::move(domdata));
|
m_vec_domain_data.push_back(std::move(domdata));
|
||||||
|
|
||||||
// Cache triangles
|
// Cache triangles
|
||||||
|
@ -21,6 +21,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
int Size() const { return 0; }
|
int Size() const { return 0; }
|
||||||
|
int Length() const { return this->Size(); }
|
||||||
|
|
||||||
const gp_XYZ& Value(const int /*Index*/) const
|
const gp_XYZ& Value(const int /*Index*/) const
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user