Skip to content

Commit 77e02dd

Browse files
committed
Remove all references to _newclass from wrapper code
1 parent b27482d commit 77e02dd

2 files changed

Lines changed: 82 additions & 97 deletions

File tree

src/ifcwrap/IfcGeomWrapper.i

Lines changed: 43 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -197,105 +197,95 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
197197

198198
%extend IfcGeom::Representation::Triangulation {
199199
%pythoncode %{
200-
if _newclass:
201-
# Hide the getters with read-only property implementations
202-
id = property(id)
203-
faces = property(faces)
204-
edges = property(edges)
205-
material_ids = property(material_ids)
206-
materials = property(materials)
200+
# Hide the getters with read-only property implementations
201+
id = property(id)
202+
faces = property(faces)
203+
edges = property(edges)
204+
material_ids = property(material_ids)
205+
materials = property(materials)
207206
%}
208207
};
209208

210209
// Specialized accessors follow later, for otherwise property definitions
211210
// would appear before templated getter functions are defined.
212211
%extend IfcGeom::Representation::Triangulation<float> {
213212
%pythoncode %{
214-
if _newclass:
215-
# Hide the getters with read-only property implementations
216-
verts = property(verts)
217-
normals = property(normals)
213+
# Hide the getters with read-only property implementations
214+
verts = property(verts)
215+
normals = property(normals)
218216
%}
219217
};
220218
%extend IfcGeom::Representation::Triangulation<double> {
221219
%pythoncode %{
222-
if _newclass:
223-
# Hide the getters with read-only property implementations
224-
verts = property(verts)
225-
normals = property(normals)
220+
# Hide the getters with read-only property implementations
221+
verts = property(verts)
222+
normals = property(normals)
226223
%}
227224
};
228225

229226
%extend IfcGeom::Representation::Serialization {
230227
%pythoncode %{
231-
if _newclass:
232-
# Hide the getters with read-only property implementations
233-
id = property(id)
234-
brep_data = property(brep_data)
235-
surface_styles = property(surface_styles)
228+
# Hide the getters with read-only property implementations
229+
id = property(id)
230+
brep_data = property(brep_data)
231+
surface_styles = property(surface_styles)
236232
%}
237233
};
238234

239235
%extend IfcGeom::Element {
240236
%pythoncode %{
241-
if _newclass:
242-
# Hide the getters with read-only property implementations
243-
id = property(id)
244-
parent_id = property(parent_id)
245-
name = property(name)
246-
type = property(type)
247-
guid = property(guid)
248-
context = property(context)
249-
unique_id = property(unique_id)
250-
transformation = property(transformation)
237+
# Hide the getters with read-only property implementations
238+
id = property(id)
239+
parent_id = property(parent_id)
240+
name = property(name)
241+
type = property(type)
242+
guid = property(guid)
243+
context = property(context)
244+
unique_id = property(unique_id)
245+
transformation = property(transformation)
251246
%}
252247
};
253248

254249
%extend IfcGeom::TriangulationElement {
255250
%pythoncode %{
256-
if _newclass:
257-
# Hide the getters with read-only property implementations
258-
geometry = property(geometry)
251+
# Hide the getters with read-only property implementations
252+
geometry = property(geometry)
259253
%}
260254
};
261255

262256
%extend IfcGeom::SerializedElement {
263257
%pythoncode %{
264-
if _newclass:
265-
# Hide the getters with read-only property implementations
266-
geometry = property(geometry)
258+
# Hide the getters with read-only property implementations
259+
geometry = property(geometry)
267260
%}
268261
};
269262

270263
%extend IfcGeom::Material {
271264
%pythoncode %{
272-
if _newclass:
273-
# Hide the getters with read-only property implementations
274-
has_diffuse = property(hasDiffuse)
275-
has_specular = property(hasSpecular)
276-
has_transparency = property(hasTransparency)
277-
has_specularity = property(hasSpecularity)
278-
diffuse = property(diffuse)
279-
specular = property(specular)
280-
transparency = property(transparency)
281-
specularity = property(specularity)
282-
name = property(name)
265+
# Hide the getters with read-only property implementations
266+
has_diffuse = property(hasDiffuse)
267+
has_specular = property(hasSpecular)
268+
has_transparency = property(hasTransparency)
269+
has_specularity = property(hasSpecularity)
270+
diffuse = property(diffuse)
271+
specular = property(specular)
272+
transparency = property(transparency)
273+
specularity = property(specularity)
274+
name = property(name)
283275
%}
284276
};
285277

286278
%extend IfcGeom::Transformation {
287279
%pythoncode %{
288-
if _newclass:
289-
# Hide the getters with read-only property implementations
290-
matrix = property(matrix)
280+
# Hide the getters with read-only property implementations
281+
matrix = property(matrix)
291282
%}
292283
};
293284

294285
%extend IfcGeom::Matrix {
295286
%pythoncode %{
296-
if _newclass:
297-
# Hide the getters with read-only property implementations
298-
data = property(data)
287+
# Hide the getters with read-only property implementations
288+
data = property(data)
299289
%}
300290
};
301291

src/ifcwrap/IfcParseWrapper.i

Lines changed: 39 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ private:
9999
}
100100

101101
%pythoncode %{
102-
if _newclass:
103-
# Hide the getters with read-only property implementations
104-
header = property(header)
102+
# Hide the getters with read-only property implementations
103+
header = property(header)
105104
%}
106105
}
107106

@@ -346,62 +345,58 @@ private:
346345

347346
%extend IfcParse::IfcSpfHeader {
348347
%pythoncode %{
349-
if _newclass:
350-
# Hide the getters with read-only property implementations
351-
file_description = property(file_description)
352-
file_name = property(file_name)
353-
file_schema = property(file_schema)
348+
# Hide the getters with read-only property implementations
349+
file_description = property(file_description)
350+
file_name = property(file_name)
351+
file_schema = property(file_schema)
354352
%}
355353
};
356354

357355
%extend IfcParse::FileDescription {
358356
%pythoncode %{
359-
if _newclass:
360-
# Hide the getters with read-write property implementations
361-
__swig_getmethods__["description"] = description
362-
__swig_setmethods__["description"] = description
363-
description = property(description, description)
364-
__swig_getmethods__["implementation_level"] = implementation_level
365-
__swig_setmethods__["implementation_level"] = implementation_level
366-
implementation_level = property(implementation_level, implementation_level)
357+
# Hide the getters with read-write property implementations
358+
__swig_getmethods__["description"] = description
359+
__swig_setmethods__["description"] = description
360+
description = property(description, description)
361+
__swig_getmethods__["implementation_level"] = implementation_level
362+
__swig_setmethods__["implementation_level"] = implementation_level
363+
implementation_level = property(implementation_level, implementation_level)
367364
%}
368365
};
369366

370367
%extend IfcParse::FileName {
371368
%pythoncode %{
372-
if _newclass:
373-
# Hide the getters with read-write property implementations
374-
__swig_getmethods__["name"] = name
375-
__swig_setmethods__["name"] = name
376-
name = property(name, name)
377-
__swig_getmethods__["time_stamp"] = time_stamp
378-
__swig_setmethods__["time_stamp"] = time_stamp
379-
time_stamp = property(time_stamp, time_stamp)
380-
__swig_getmethods__["author"] = author
381-
__swig_setmethods__["author"] = author
382-
author = property(author, author)
383-
__swig_getmethods__["organization"] = organization
384-
__swig_setmethods__["organization"] = organization
385-
organization = property(organization, organization)
386-
__swig_getmethods__["preprocessor_version"] = preprocessor_version
387-
__swig_setmethods__["preprocessor_version"] = preprocessor_version
388-
preprocessor_version = property(preprocessor_version, preprocessor_version)
389-
__swig_getmethods__["originating_system"] = originating_system
390-
__swig_setmethods__["originating_system"] = originating_system
391-
originating_system = property(originating_system, originating_system)
392-
__swig_getmethods__["authorization"] = authorization
393-
__swig_setmethods__["authorization"] = authorization
394-
authorization = property(authorization, authorization)
369+
# Hide the getters with read-write property implementations
370+
__swig_getmethods__["name"] = name
371+
__swig_setmethods__["name"] = name
372+
name = property(name, name)
373+
__swig_getmethods__["time_stamp"] = time_stamp
374+
__swig_setmethods__["time_stamp"] = time_stamp
375+
time_stamp = property(time_stamp, time_stamp)
376+
__swig_getmethods__["author"] = author
377+
__swig_setmethods__["author"] = author
378+
author = property(author, author)
379+
__swig_getmethods__["organization"] = organization
380+
__swig_setmethods__["organization"] = organization
381+
organization = property(organization, organization)
382+
__swig_getmethods__["preprocessor_version"] = preprocessor_version
383+
__swig_setmethods__["preprocessor_version"] = preprocessor_version
384+
preprocessor_version = property(preprocessor_version, preprocessor_version)
385+
__swig_getmethods__["originating_system"] = originating_system
386+
__swig_setmethods__["originating_system"] = originating_system
387+
originating_system = property(originating_system, originating_system)
388+
__swig_getmethods__["authorization"] = authorization
389+
__swig_setmethods__["authorization"] = authorization
390+
authorization = property(authorization, authorization)
395391
%}
396392
};
397393

398394
%extend IfcParse::FileSchema {
399395
%pythoncode %{
400-
if _newclass:
401-
# Hide the getters with read-write property implementations
402-
__swig_getmethods__["schema_identifiers"] = schema_identifiers
403-
__swig_setmethods__["schema_identifiers"] = schema_identifiers
404-
schema_identifiers = property(schema_identifiers, schema_identifiers)
396+
# Hide the getters with read-write property implementations
397+
__swig_getmethods__["schema_identifiers"] = schema_identifiers
398+
__swig_setmethods__["schema_identifiers"] = schema_identifiers
399+
schema_identifiers = property(schema_identifiers, schema_identifiers)
405400
%}
406401
};
407402

0 commit comments

Comments
 (0)