1
/***************************************************************************
2
* Copyright (c) 2022 Werner Mayer <wmayer[at]users.sourceforge.net> *
4
* This file is part of the FreeCAD CAx development system. *
6
* This library is free software; you can redistribute it and/or *
7
* modify it under the terms of the GNU Library General Public *
8
* License as published by the Free Software Foundation; either *
9
* version 2 of the License, or (at your option) any later version. *
11
* This library is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU Library General Public License for more details. *
16
* You should have received a copy of the GNU Library General Public *
17
* License along with this library; see the file COPYING.LIB. If not, *
18
* write to the Free Software Foundation, Inc., 59 Temple Place, *
19
* Suite 330, Boston, MA 02111-1307, USA *
21
***************************************************************************/
23
#include "PreCompiled.h"
25
# include <Interface_Static.hxx>
28
#include "ImportExportSettings.h"
29
#include <App/Application.h>
35
ImportExportSettings::ImportExportSettings()
37
pGroup = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part/IGES");
40
bool ImportExportSettings::getSkipBlankEntities() const
42
return pGroup->GetBool("SkipBlankEntities", true);
45
void ImportExportSettings::setSkipBlankEntities(bool on) const
47
pGroup->SetBool("SkipBlankEntities", on);
50
bool ImportExportSettings::getBRepMode() const
52
int value = Part::Interface::writeIgesBrepMode();
53
return pGroup->GetBool("BrepMode", value > 0);
56
void ImportExportSettings::setBRepMode(bool on) const
58
pGroup->SetBool("BrepMode", on);
59
Part::Interface::writeIgesBrepMode(on ? 1 : 0);
62
Interface::Unit ImportExportSettings::getUnit() const
64
return static_cast<Interface::Unit>(pGroup->GetInt("Unit", 0));
67
void ImportExportSettings::setUnit(Interface::Unit unit)
69
pGroup->SetInt("Unit", static_cast<long>(unit));
70
Part::Interface::writeIgesUnit(unit);
73
std::string ImportExportSettings::getCompany() const
75
return pGroup->GetASCII("Company", Part::Interface::writeIgesHeaderCompany());
78
void ImportExportSettings::setCompany(const char* name)
80
pGroup->SetASCII("Company", name);
81
Part::Interface::writeIgesHeaderCompany(name);
84
std::string ImportExportSettings::getAuthor() const
86
return pGroup->GetASCII("Author", Part::Interface::writeIgesHeaderAuthor());
89
void ImportExportSettings::setAuthor(const char* name)
91
pGroup->SetASCII("Author", name);
92
Part::Interface::writeIgesHeaderAuthor(name);
95
std::string ImportExportSettings::getProductName() const
97
return Part::Interface::writeIgesHeaderProduct();
100
void ImportExportSettings::setProductName(const char* name)
102
Part::Interface::writeIgesHeaderProduct(name);