+ fixes #0000763: Bad IGS import
This commit is contained in:
parent
ab24e9df6a
commit
ee86871bed
|
@ -116,10 +116,16 @@ static PyObject * importer(PyObject *self, PyObject *args)
|
|||
}
|
||||
}
|
||||
else if (file.hasExtension("igs") || file.hasExtension("iges")) {
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("IGES");
|
||||
|
||||
try {
|
||||
IGESControl_Controller::Init();
|
||||
Interface_Static::SetIVal("read.surfacecurve.mode",3);
|
||||
IGESCAFControl_Reader aReader;
|
||||
// http://www.opencascade.org/org/forum/thread_20603/?forum=3
|
||||
aReader.SetReadVisible(hGrp->GetBool("SkipBlankEntities", true)
|
||||
? Standard_True : Standard_False);
|
||||
aReader.SetColorMode(true);
|
||||
aReader.SetNameMode(true);
|
||||
aReader.SetLayerMode(true);
|
||||
|
|
|
@ -157,10 +157,16 @@ static PyObject * importer(PyObject *self, PyObject *args)
|
|||
}
|
||||
}
|
||||
else if (file.hasExtension("igs") || file.hasExtension("iges")) {
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("IGES");
|
||||
|
||||
try {
|
||||
IGESControl_Controller::Init();
|
||||
Interface_Static::SetIVal("read.surfacecurve.mode",3);
|
||||
IGESCAFControl_Reader aReader;
|
||||
// http://www.opencascade.org/org/forum/thread_20603/?forum=3
|
||||
aReader.SetReadVisible(hGrp->GetBool("SkipBlankEntities", true)
|
||||
? Standard_True : Standard_False);
|
||||
aReader.SetColorMode(true);
|
||||
aReader.SetNameMode(true);
|
||||
aReader.SetLayerMode(true);
|
||||
|
@ -509,9 +515,14 @@ static PyObject * ocaf(PyObject *self, PyObject *args)
|
|||
pi->EndScope();
|
||||
}
|
||||
else if (file.hasExtension("igs") || file.hasExtension("iges")) {
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("IGES");
|
||||
IGESControl_Controller::Init();
|
||||
Interface_Static::SetIVal("read.surfacecurve.mode",3);
|
||||
IGESCAFControl_Reader aReader;
|
||||
// http://www.opencascade.org/org/forum/thread_20603/?forum=3
|
||||
aReader.SetReadVisible(hGrp->GetBool("SkipBlankEntities", true)
|
||||
? Standard_True : Standard_False);
|
||||
aReader.SetColorMode(true);
|
||||
aReader.SetNameMode(true);
|
||||
aReader.SetLayerMode(true);
|
||||
|
|
|
@ -83,6 +83,10 @@ int Part::ImportIgesParts(App::Document *pcDoc, const char* FileName)
|
|||
if (aReader.ReadFile((const Standard_CString)FileName) != IFSelect_RetDone)
|
||||
throw Base::Exception("Error in reading IGES");
|
||||
|
||||
// Ignore construction elements
|
||||
// http://www.opencascade.org/org/forum/thread_20603/?forum=3
|
||||
aReader.SetReadVisible(Standard_True);
|
||||
|
||||
// check file conformity and output stats
|
||||
aReader.PrintCheckLoad(Standard_True,IFSelect_GeneralInfo);
|
||||
|
||||
|
|
|
@ -573,6 +573,9 @@ void TopoShape::importIges(const char *FileName)
|
|||
IGESControl_Controller::Init();
|
||||
Interface_Static::SetIVal("read.surfacecurve.mode",3);
|
||||
IGESControl_Reader aReader;
|
||||
// Ignore construction elements
|
||||
// http://www.opencascade.org/org/forum/thread_20603/?forum=3
|
||||
aReader.SetReadVisible(Standard_True);
|
||||
if (aReader.ReadFile(encodeFilename(FileName).c_str()) != IFSelect_RetDone)
|
||||
throw Base::Exception("Error in reading IGES");
|
||||
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>445</width>
|
||||
<height>270</height>
|
||||
<width>515</width>
|
||||
<height>349</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>IGES</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
|
@ -70,6 +70,22 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Import</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkSkipBlank">
|
||||
<property name="text">
|
||||
<string>Skip blank entities</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QGroupBox" name="groupBoxHeader">
|
||||
<property name="title">
|
||||
<string>Header</string>
|
||||
|
@ -108,7 +124,7 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="3" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
@ -126,6 +142,7 @@
|
|||
<tabstops>
|
||||
<tabstop>comboBoxUnits</tabstop>
|
||||
<tabstop>checkBrepMode</tabstop>
|
||||
<tabstop>checkSkipBlank</tabstop>
|
||||
<tabstop>lineEditCompany</tabstop>
|
||||
<tabstop>lineEditAuthor</tabstop>
|
||||
<tabstop>lineEditProduct</tabstop>
|
||||
|
|
|
@ -120,6 +120,9 @@ void DlgImportExportIges::saveSettings()
|
|||
hGrp->SetBool("BrepMode", ui->checkBrepMode->isChecked());
|
||||
Interface_Static::SetIVal("write.iges.brep.mode",ui->checkBrepMode->isChecked() ? 1 : 0);
|
||||
|
||||
// Import
|
||||
hGrp->SetBool("SkipBlankEntities", ui->checkSkipBlank->isChecked());
|
||||
|
||||
// header info
|
||||
hGrp->SetASCII("Company", ui->lineEditCompany->text().toLatin1());
|
||||
hGrp->SetASCII("Author", ui->lineEditAuthor->text().toLatin1());
|
||||
|
@ -141,6 +144,9 @@ void DlgImportExportIges::loadSettings()
|
|||
bool brep = hGrp->GetBool("BrepMode", value > 0);
|
||||
ui->checkBrepMode->setChecked(brep);
|
||||
|
||||
// Import
|
||||
ui->checkSkipBlank->setChecked(hGrp->GetBool("SkipBlankEntities", true));
|
||||
|
||||
// header info
|
||||
ui->lineEditCompany->setText(QString::fromStdString(hGrp->GetASCII("Company",
|
||||
Interface_Static::CVal("write.iges.header.company"))));
|
||||
|
|
Loading…
Reference in New Issue
Block a user