FreeCAD

Форк
0
/
Interface.cpp 
200 строк · 5.8 Кб
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 "Interface.h"
29

30

31
using namespace Part;
32

33
/* Further parameters from
34
 * https://dev.opencascade.org/doc/overview/html/occt_user_guides__step.html and
35
 * https://dev.opencascade.org/doc/overview/html/occt_user_guides__iges.html
36
 */
37

38
/* Common:
39
 * read.precision.mode
40
 * read.precision.val
41
 * read.maxprecision.mode
42
 * read.maxprecision.val
43
 * read.stdsameparameter.mode
44
 * read.surfacecurve.mode
45
 * read.encoderegularity.angle
46
 * xstep.cascade.unit
47
 *
48
 * write.precision.mode
49
 * write.precision.val
50
 * write.surfacecurve.mode
51
 */
52

53
/* Undocumented
54
 * read.stepcaf.subshapes.name
55
 * write.stepcaf.subshapes.name
56
 * write.convertsurface.mode
57
 * write.step.nonmanifold
58
 * read.iges.onlyvisible
59
 * write.iges.offset.mode
60
 * write.iges.plane.mode
61
 */
62

63
/* STEP specific:
64
 * step.angleunit.mode
65
 * read.step.resource.name
66
 * read.step.sequence
67
 * read.step.product.mode
68
 * read.step.product.context
69
 * read.step.shape.repr
70
 * read.step.assembly.level
71
 * read.step.shape.relationship
72
 * read.step.shape.aspect
73
 * read.step.constructivegeom.relationship
74
 * read.step.tessellated
75
 *
76
 * write.step.resource.name
77
 * write.step.sequence
78
 * write.step.vertex.mode
79
 * write.step.tessellated
80
 */
81

82
/* IGES specific:
83
 * read.iges.bspline.continuity
84
 * read.iges.bspline.approxd1.mode
85
 * read.iges.resource.name
86
 * read.iges.sequence
87
 *
88
 * write.iges.header.receiver
89
 * write.iges.resource.name
90
 * write.iges.sequence
91
 */
92

93
void Interface::writeStepAssembly(Interface::Assembly mode)
94
{
95
    Interface_Static::SetIVal("write.step.assembly", static_cast<int>(mode));
96
}
97

98
Standard_CString Interface::writeStepScheme()
99
{
100
    return Interface_Static::CVal("write.step.schema");
101
}
102

103
bool Interface::writeStepScheme(Standard_CString scheme)
104
{
105
    return Interface_Static::SetCVal("write.step.schema", scheme);
106
}
107

108
bool Interface::writeStepUnit(Standard_CString unit)
109
{
110
    return Interface_Static::SetCVal("write.step.unit", unit);
111
}
112

113
bool Interface::writeStepUnit(Interface::Unit unit)
114
{
115
    switch (unit) {
116
    case Interface::Unit::Meter:
117
        return Interface_Static::SetCVal("write.step.unit","M");
118
    case Interface::Unit::Inch:
119
        return Interface_Static::SetCVal("write.step.unit","INCH");
120
    default:
121
        return Interface_Static::SetCVal("write.step.unit","MM");
122
    }
123
}
124

125
Standard_CString Interface::writeStepUnit()
126
{
127
    return Interface_Static::CVal("write.step.unit");
128
}
129

130
Standard_CString Interface::writeStepHeaderProduct()
131
{
132
    return Interface_Static::CVal("write.step.product.name");
133
}
134

135
bool Interface::writeStepHeaderProduct(Standard_CString name)
136
{
137
    return Interface_Static::SetCVal("write.step.product.name", name);
138
}
139

140
Standard_CString Interface::writeIgesHeaderAuthor()
141
{
142
    return Interface_Static::CVal("write.iges.header.author");
143
}
144

145
bool Interface::writeIgesHeaderAuthor(Standard_CString name)
146
{
147
    return Interface_Static::SetCVal("write.iges.header.author", name);
148
}
149

150
Standard_CString Interface::writeIgesHeaderCompany()
151
{
152
    return Interface_Static::CVal("write.iges.header.company");
153
}
154

155
bool Interface::writeIgesHeaderCompany(Standard_CString name)
156
{
157
    return Interface_Static::SetCVal("write.iges.header.company", name);
158
}
159

160
Standard_CString Interface::writeIgesHeaderProduct()
161
{
162
    return Interface_Static::CVal("write.iges.header.product");
163
}
164

165
bool Interface::writeIgesHeaderProduct(Standard_CString name)
166
{
167
    return Interface_Static::SetCVal("write.iges.header.product", name);
168
}
169

170
bool Interface::writeIgesUnit(Standard_CString unit)
171
{
172
    return Interface_Static::SetCVal("write.iges.unit", unit);
173
}
174

175
bool Interface::writeIgesUnit(Interface::Unit unit)
176
{
177
    switch (unit) {
178
    case Unit::Meter:
179
        return Interface_Static::SetCVal("write.iges.unit","M");
180
    case Unit::Inch:
181
        return Interface_Static::SetCVal("write.iges.unit","INCH");
182
    default:
183
        return Interface_Static::SetCVal("write.iges.unit","MM");
184
    }
185
}
186

187
Standard_CString Interface::writeIgesUnit()
188
{
189
    return Interface_Static::CVal("write.iges.unit");
190
}
191

192
int Interface::writeIgesBrepMode()
193
{
194
    return Interface_Static::IVal("write.iges.brep.mode");
195
}
196

197
bool Interface::writeIgesBrepMode(int mode)
198
{
199
    return Interface_Static::SetIVal("write.iges.brep.mode", mode);
200
}
201

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

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

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

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