FreeCAD

Форк
0
/
ImportExportSettings.cpp 
106 строк · 3.5 Кб
1
/***************************************************************************
2
 *   Copyright (c) 2022 Werner Mayer <wmayer[at]users.sourceforge.net>     *
3
 *                                                                         *
4
 *   This file is part of the FreeCAD CAx development system.              *
5
 *                                                                         *
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.      *
10
 *                                                                         *
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.                  *
15
 *                                                                         *
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                                *
20
 *                                                                         *
21
 ***************************************************************************/
22

23
#include "PreCompiled.h"
24
#ifndef _PreComp_
25
# include <Interface_Static.hxx>
26
#endif
27

28
#include "ImportExportSettings.h"
29
#include <App/Application.h>
30

31

32
namespace Part {
33
namespace IGES {
34

35
ImportExportSettings::ImportExportSettings()
36
{
37
    pGroup = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part/IGES");
38
}
39

40
bool ImportExportSettings::getSkipBlankEntities() const
41
{
42
    return pGroup->GetBool("SkipBlankEntities", true);
43
}
44

45
void ImportExportSettings::setSkipBlankEntities(bool on) const
46
{
47
    pGroup->SetBool("SkipBlankEntities", on);
48
}
49

50
bool ImportExportSettings::getBRepMode() const
51
{
52
    int value = Part::Interface::writeIgesBrepMode();
53
    return pGroup->GetBool("BrepMode", value > 0);
54
}
55

56
void ImportExportSettings::setBRepMode(bool on) const
57
{
58
    pGroup->SetBool("BrepMode", on);
59
    Part::Interface::writeIgesBrepMode(on ? 1 : 0);
60
}
61

62
Interface::Unit ImportExportSettings::getUnit() const
63
{
64
    return static_cast<Interface::Unit>(pGroup->GetInt("Unit", 0));
65
}
66

67
void ImportExportSettings::setUnit(Interface::Unit unit)
68
{
69
    pGroup->SetInt("Unit", static_cast<long>(unit));
70
    Part::Interface::writeIgesUnit(unit);
71
}
72

73
std::string ImportExportSettings::getCompany() const
74
{
75
    return pGroup->GetASCII("Company", Part::Interface::writeIgesHeaderCompany());
76
}
77

78
void ImportExportSettings::setCompany(const char* name)
79
{
80
    pGroup->SetASCII("Company", name);
81
    Part::Interface::writeIgesHeaderCompany(name);
82
}
83

84
std::string ImportExportSettings::getAuthor() const
85
{
86
    return pGroup->GetASCII("Author", Part::Interface::writeIgesHeaderAuthor());
87
}
88

89
void ImportExportSettings::setAuthor(const char* name)
90
{
91
    pGroup->SetASCII("Author", name);
92
    Part::Interface::writeIgesHeaderAuthor(name);
93
}
94

95
std::string ImportExportSettings::getProductName() const
96
{
97
    return Part::Interface::writeIgesHeaderProduct();
98
}
99

100
void ImportExportSettings::setProductName(const char* name)
101
{
102
    Part::Interface::writeIgesHeaderProduct(name);
103
}
104

105
} // namespace IGES
106
} // namespace Part
107

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.