Import: handle OCC versions 7.4.1 and earlier

This commit is contained in:
wmayer
2020-05-30 11:56:14 +02:00
parent 22acaf4fdf
commit fed4265cfe

View File

@@ -34,6 +34,7 @@
# include <Interface_Static.hxx>
# include <Message_Messenger.hxx>
# include <Message_PrinterOStream.hxx>
# include <Standard_Version.hxx>
# include <Base/FileInfo.h>
# include <Base/Exception.h>
@@ -86,12 +87,22 @@ int StepShape::read(const char* fileName)
//rank = model->NextNumberForLabe(label, 0, Standard_False);
std::cout << "dump of step header:" << std::endl;
#if OCC_VERSION_HEX < 0x070401
Handle(Message_PrinterOStream) mstr = new Message_PrinterOStream();
Handle(Message_Messenger) msg = new Message_Messenger(mstr);
model->DumpHeader(msg);
#else
model->DumpHeader(std::cout);
#endif
for(int nent=1;nent<=model->NbEntities();nent++) {
for (int nent=1;nent<=model->NbEntities();nent++) {
Handle(Standard_Transient) entity=model->Entity(nent);
std::cout << "label entity " << nent << ":" ;
#if OCC_VERSION_HEX < 0x070401
model->PrintLabel(entity, msg);
#else
model->PrintLabel(entity, std::cout);
#endif
std::cout << ";"<< entity->DynamicType()->Name() << std::endl;
}