Skip to content

Commit

Permalink
+ split STEP and IGES settings into separate pages, handle Brep mode …
Browse files Browse the repository at this point in the history
…of IGES format
  • Loading branch information
wwmayer committed Oct 28, 2014
1 parent 9256de8 commit c67f326
Show file tree
Hide file tree
Showing 8 changed files with 352 additions and 76 deletions.
22 changes: 18 additions & 4 deletions src/Mod/Part/App/AppPart.cpp
Expand Up @@ -287,18 +287,32 @@ void PartExport initPart()
// set the user-defined units
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part");
int unit = hGrp->GetInt("Unit", 0);
switch (unit) {
int value = Interface_Static::IVal("write.iges.brep.mode");
bool brep = hGrp->GetBool("BrepMode", value > 0);
Interface_Static::SetIVal("write.iges.brep.mode",brep ? 1 : 0);

int unitIges = hGrp->GetInt("UnitIges", 0);
switch (unitIges) {
case 1:
Interface_Static::SetCVal("write.iges.unit","M");
Interface_Static::SetCVal("write.step.unit","M");
break;
case 2:
Interface_Static::SetCVal("write.iges.unit","IN");
Interface_Static::SetCVal("write.step.unit","IN");
break;
default:
Interface_Static::SetCVal("write.iges.unit","MM");
break;
}

int unitStep = hGrp->GetInt("UnitStep", 0);
switch (unitStep) {
case 1:
Interface_Static::SetCVal("write.step.unit","M");
break;
case 2:
Interface_Static::SetCVal("write.step.unit","IN");
break;
default:
Interface_Static::SetCVal("write.step.unit","MM");
break;
}
Expand Down
4 changes: 3 additions & 1 deletion src/Mod/Part/Gui/AppPartGui.cpp
Expand Up @@ -5,7 +5,7 @@
* published by the Free Software Foundation; either version 2 of the *
* License, or (at your option) any later version. *
* for detail see the LICENCE text file. *
* J�rgen Riegel 2002 *
* Juergen Riegel 2002 *
* *
***************************************************************************/

Expand Down Expand Up @@ -160,6 +160,8 @@ void PartGuiExport initPartGui()
// register preferences pages
(void)new Gui::PrefPageProducer<PartGui::DlgSettingsGeneral> ( QT_TRANSLATE_NOOP("QObject","Part design") );
(void)new Gui::PrefPageProducer<PartGui::DlgSettings3DViewPart> ( QT_TRANSLATE_NOOP("QObject","Part design") );
(void)new Gui::PrefPageProducer<PartGui::DlgImportExportIges> ( QT_TRANSLATE_NOOP("QObject","Import-Export") );
(void)new Gui::PrefPageProducer<PartGui::DlgImportExportStep> ( QT_TRANSLATE_NOOP("QObject","Import-Export") );
(void)new Gui::PrefPageProducer<PartGui::DlgSettingsObjectColor> ( QT_TRANSLATE_NOOP("QObject","Display") );
Gui::ViewProviderBuilder::add(
Part::PropertyPartShape::getClassTypeId(),
Expand Down
4 changes: 4 additions & 0 deletions src/Mod/Part/Gui/CMakeLists.txt
Expand Up @@ -59,6 +59,8 @@ set(PartGui_UIC_SRCS
DlgBooleanOperation.ui
DlgExtrusion.ui
DlgFilletEdges.ui
DlgImportExportIges.ui
DlgImportExportStep.ui
DlgPartBox.ui
DlgPartCylinder.ui
DlgPartImportIges.ui
Expand Down Expand Up @@ -99,6 +101,8 @@ SET(PartGui_SRCS
DlgFilletEdges.cpp
DlgFilletEdges.h
DlgFilletEdges.ui
DlgImportExportIges.ui
DlgImportExportStep.ui
DlgPartBox.ui
DlgPartBoxImp.cpp
DlgPartBoxImp.h
Expand Down
89 changes: 89 additions & 0 deletions src/Mod/Part/Gui/DlgImportExportIges.ui
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PartGui::DlgImportExportIges</class>
<widget class="QWidget" name="PartGui::DlgImportExportIges">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>445</width>
<height>187</height>
</rect>
</property>
<property name="windowTitle">
<string>IGES</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Export</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Units for export of IGES</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="comboBoxUnits">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Meter</string>
</property>
</item>
<item>
<property name="text">
<string>Inch</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="checkBrepMode">
<property name="text">
<string>Enable B-REP mode</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>82</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
82 changes: 82 additions & 0 deletions src/Mod/Part/Gui/DlgImportExportStep.ui
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PartGui::DlgImportExportStep</class>
<widget class="QWidget" name="PartGui::DlgImportExportStep">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>445</width>
<height>187</height>
</rect>
</property>
<property name="windowTitle">
<string>STEP</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Export</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Units for export of STEP</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="comboBoxUnits">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Meter</string>
</property>
</item>
<item>
<property name="text">
<string>Inch</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>82</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

0 comments on commit c67f326

Please sign in to comment.