From 1f9a3ab462b9eea34bea5f0b9d7eb5f14acddcbd Mon Sep 17 00:00:00 2001 From: Onur Rauf Bingol Date: Tue, 18 Jul 2017 01:25:35 -0500 Subject: [PATCH 1/9] Updated module documentation --- src/acis_geometric_atoms.cpp | 2 +- src/acis_geometric_operators.cpp | 2 +- src/acis_geometry.cpp | 2 +- src/acis_licensing.cpp | 2 +- src/acis_lists.cpp | 2 +- src/acis_query.cpp | 2 +- src/acis_sweeping.cpp | 2 +- src/acis_topology.cpp | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/acis_geometric_atoms.cpp b/src/acis_geometric_atoms.cpp index 989a994..d559cef 100644 --- a/src/acis_geometric_atoms.cpp +++ b/src/acis_geometric_atoms.cpp @@ -1558,7 +1558,7 @@ static PyTypeObject */ // Module documentation can be accessible via __doc__ -const char *module_documentation = "Contains geometric atoms, e.g. SPAposition, SPApar_pos, etc."; +const char *module_documentation = "Contains 3D ACIS Modeler geometric atoms, e.g. SPAposition, SPApar_pos, etc."; static PyModuleDef ACIS_GeometricAtoms_module = diff --git a/src/acis_geometric_operators.cpp b/src/acis_geometric_operators.cpp index e3433e1..d097773 100644 --- a/src/acis_geometric_operators.cpp +++ b/src/acis_geometric_operators.cpp @@ -46,7 +46,7 @@ static PyMethodDef }; // Module documentation can be accessible via __doc__ -const char *module_documentation = "Contains geometric operators"; +const char *module_documentation = "Contains 3D ACIS Modeler geometric operators"; static struct PyModuleDef ACIS_GeometricOperators_module = diff --git a/src/acis_geometry.cpp b/src/acis_geometry.cpp index 8c9cd6b..0805540 100644 --- a/src/acis_geometry.cpp +++ b/src/acis_geometry.cpp @@ -582,7 +582,7 @@ static PyTypeObject */ // Module documentation can be accessible via __doc__ -const char *module_documentation = "A placeholder for accessing all 3D ACIS Modeler geometry objects, such as SURFACE, CONE, TORUS, etc."; +const char *module_documentation = "Contains 3D ACIS Modeler geometry objects, such as SURFACE, CONE, TORUS, etc."; static PyModuleDef ACIS_Geometry_module = diff --git a/src/acis_licensing.cpp b/src/acis_licensing.cpp index cb893e3..486d06f 100644 --- a/src/acis_licensing.cpp +++ b/src/acis_licensing.cpp @@ -36,7 +36,7 @@ static PyMethodDef }; // Module documentation can be accessible via __doc__ -const char *module_documentation = "Spatial Corporation Products Licensing Subsystem"; +const char *module_documentation = "Contains 3D ACIS Modeler licensing API related functions and classes"; static struct PyModuleDef ACIS_Licensing_module = diff --git a/src/acis_lists.cpp b/src/acis_lists.cpp index e303309..208bbb1 100644 --- a/src/acis_lists.cpp +++ b/src/acis_lists.cpp @@ -311,7 +311,7 @@ static PyTypeObject */ // Module documentation can be accessible via __doc__ -const char *module_documentation = "A placeholder for accessing all 3D ACIS Modeler lists and containers, such as ENTITY_LIST"; +const char *module_documentation = "Contains 3D ACIS Modeler lists and containers, such as ENTITY_LIST"; static PyModuleDef ACIS_Lists_module = diff --git a/src/acis_query.cpp b/src/acis_query.cpp index 91cf4ff..728189c 100644 --- a/src/acis_query.cpp +++ b/src/acis_query.cpp @@ -155,7 +155,7 @@ static PyMethodDef }; // Module documentation can be accessible via __doc__ -const char *module_documentation = "ACIS queries to get information about entities, etc."; +const char *module_documentation = "Contains 3D Modeler ACIS geometric and topological queries"; static struct PyModuleDef ACIS_Query_module = diff --git a/src/acis_sweeping.cpp b/src/acis_sweeping.cpp index 743d0a0..34e05f4 100644 --- a/src/acis_sweeping.cpp +++ b/src/acis_sweeping.cpp @@ -463,7 +463,7 @@ static PyMethodDef }; // Module documentation can be accessible via __doc__ -const char *module_documentation = "ACIS Sweeping API"; +const char *module_documentation = "Contains 3D ACIS Modeler sweeping API related classes and functions"; static struct PyModuleDef ACIS_Sweeping_module = diff --git a/src/acis_topology.cpp b/src/acis_topology.cpp index 585d90e..01a80ac 100644 --- a/src/acis_topology.cpp +++ b/src/acis_topology.cpp @@ -1196,7 +1196,7 @@ static PyTypeObject */ // Module documentation can be accessible via __doc__ -const char *module_documentation = "A placeholder for accessing all 3D ACIS Modeler topology objects, such as BODY, FACE, WIRE, etc."; +const char *module_documentation = "Contains 3D ACIS Modeler topology objects, such as BODY, FACE, WIRE, etc."; static PyModuleDef ACIS_Topology_module = From 4e9e457de99c950a9790467aaa4007071a33431f Mon Sep 17 00:00:00 2001 From: Onur Rauf Bingol Date: Tue, 18 Jul 2017 01:26:19 -0500 Subject: [PATCH 2/9] Renamed some API calls into proper format --- src/acis_query.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/acis_query.cpp b/src/acis_query.cpp index 728189c..6d8b1f9 100644 --- a/src/acis_query.cpp +++ b/src/acis_query.cpp @@ -38,7 +38,7 @@ ACIS_Query_method_get_owner_transf(PyObject *self, PyObject *args, PyObject *kwa } static PyObject * -ACIS_Query_method_api_get_faces(PyObject *self, PyObject *args, PyObject *kwargs) +ACIS_api_get_faces(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *input_ent = NULL, *input_ent_list = NULL; @@ -92,7 +92,7 @@ ACIS_Query_method_api_get_faces(PyObject *self, PyObject *args, PyObject *kwargs } static PyObject * -ACIS_Query_method_api_get_edges(PyObject *self, PyObject *args, PyObject *kwargs) +ACIS_api_get_edges(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *input_ent = NULL, *input_ent_list = NULL; @@ -149,8 +149,8 @@ static PyMethodDef ACIS_Query_methods[] = { { "get_owner_transf", (PyCFunction) ACIS_Query_method_get_owner_transf, METH_VARARGS | METH_KEYWORDS, "Gets a copy of the SPAtransf from the owner of an ENTITY" }, - { "api_get_faces", (PyCFunction) ACIS_Query_method_api_get_faces, METH_VARARGS | METH_KEYWORDS, "Gets all faces related to an entity" }, - { "api_get_edges", (PyCFunction) ACIS_Query_method_api_get_edges, METH_VARARGS | METH_KEYWORDS, "Gets all the edges related to an entity" }, + { "api_get_faces", (PyCFunction) ACIS_api_get_faces, METH_VARARGS | METH_KEYWORDS, "Gets all faces related to an entity" }, + { "api_get_edges", (PyCFunction) ACIS_api_get_edges, METH_VARARGS | METH_KEYWORDS, "Gets all the edges related to an entity" }, { NULL, NULL, 0, NULL } }; From 21b90dc7a73f602f89b8d1281ee37b32471c7f6a Mon Sep 17 00:00:00 2001 From: Onur Rauf Bingol Date: Tue, 18 Jul 2017 01:26:47 -0500 Subject: [PATCH 3/9] Forgot to update SaveRestore module documentation --- src/acis_saverestore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/acis_saverestore.cpp b/src/acis_saverestore.cpp index 67a94b3..a4ec86a 100644 --- a/src/acis_saverestore.cpp +++ b/src/acis_saverestore.cpp @@ -470,7 +470,7 @@ static PyMethodDef }; // Module documentation can be accessible via __doc__ -const char *module_documentation = "A placeholder for accessing save & restore related ACIS classes"; +const char *module_documentation = "Contains 3D ACIS Modeler save & restore related classes and functions"; static PyModuleDef ACIS_SaveRestore_module = From 8db162e6329193b9f4510a1fbdf2bbfe4ca104f4 Mon Sep 17 00:00:00 2001 From: Onur Rauf Bingol Date: Tue, 18 Jul 2017 01:28:42 -0500 Subject: [PATCH 4/9] Fixed list/tuple traversing issues in Sweeping and Modeler --- src/acis_modeler.cpp | 16 ++++++++-------- src/acis_sweeping.cpp | 21 +++++++++++---------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/acis_modeler.cpp b/src/acis_modeler.cpp index 63289dd..8cf01ec 100644 --- a/src/acis_modeler.cpp +++ b/src/acis_modeler.cpp @@ -830,17 +830,14 @@ ACIS_api_sheet_from_ff(PyObject *self, PyObject *args, PyObject *kwargs) return NULL; // First argument must be a tuple of faces - if (!PyTuple_Check(input_faces)) - { - PyErr_SetString(PyExc_TypeError, "First argument must be a tuple of FACE objects"); - return NULL; - } + PyObject *seq = PySequence_Fast(input_faces, "First argument must be a sequence of FACE objects"); // ACIS API has a limitation in api_sheet_from_ff function: As of version R2017, it can handle only 1 face - Py_ssize_t face_array_size = PyTuple_Size(input_faces); + Py_ssize_t face_array_size = PySequence_Fast_GET_SIZE(seq); if (face_array_size <= 0) { - PyErr_SetString(PyExc_ValueError, "Tuple cannot be empty"); + PyErr_SetString(PyExc_ValueError, "Sequence cannot be empty"); + Py_DECREF(seq); return NULL; } else if (face_array_size > 1) @@ -848,7 +845,7 @@ ACIS_api_sheet_from_ff(PyObject *self, PyObject *args, PyObject *kwargs) PyErr_WarnEx(PyExc_Warning, "ACIS API does not support generation of sheet bodies from multiple faces.", 0); } - PyObject *faceobj = PyTuple_GetItem(input_faces, 0); + PyObject *faceobj = PySequence_Fast_GET_ITEM(seq, 0); API_BEGIN @@ -863,6 +860,9 @@ ACIS_api_sheet_from_ff(PyObject *self, PyObject *args, PyObject *kwargs) API_END + // PySequence_Fast generates a new reference + Py_DECREF(seq); + // Check outcome if (!check_outcome(result)) { diff --git a/src/acis_sweeping.cpp b/src/acis_sweeping.cpp index 34e05f4..cbd9b8d 100644 --- a/src/acis_sweeping.cpp +++ b/src/acis_sweeping.cpp @@ -262,17 +262,14 @@ ACIS_api_make_sweep_path(PyObject *self, PyObject *args, PyObject *kwargs) return NULL; } - // The first object must be a python tuple containing SPAposition objects - if (PyTuple_Check(input_pts)) - { - PyErr_SetString(PyExc_TypeError, "First argument (pts) must be a tuple containing SPAposition objects"); - return NULL; - } + // The first object must be a python sequence containing SPAposition objects + PyObject *seq = PySequence_Fast(input_pts, "First argument (pts) must be a sequence of SPAposition objects, such as a list or a tuple"); - Py_ssize_t position_vector_size = PyTuple_Size(input_pts); + Py_ssize_t position_vector_size = PySequence_Fast_GET_SIZE(seq); if (position_vector_size <= 0) { - PyErr_SetString(PyExc_ValueError, "Tuple cannot be empty"); + PyErr_SetString(PyExc_ValueError, "Sequence cannot be empty"); + Py_DECREF(seq); return NULL; } @@ -282,10 +279,11 @@ ACIS_api_make_sweep_path(PyObject *self, PyObject *args, PyObject *kwargs) for (Py_ssize_t i = 0; i < position_vector_size; i++) { PyObject *pt_temp; - pt_temp = PyTuple_GetItem(input_pts, i); + pt_temp = PySequence_Fast_GET_ITEM(seq, i); if (!_ACIS_check_SPAposition(pt_temp)) { - PyErr_SetString(PyExc_TypeError, "Tuple must contain SPAposition objects"); + PyErr_SetString(PyExc_TypeError, "Sequence must contain SPAposition objects"); + Py_DECREF(seq); return NULL; } _pts.push_back(*((ACIS_GeometricAtoms_SPAposition *) pt_temp)->_acis_obj); @@ -300,6 +298,9 @@ ACIS_api_make_sweep_path(PyObject *self, PyObject *args, PyObject *kwargs) API_END + // PySequence_Fast returns a new reference + Py_DECREF(seq); + // Check outcome if (!check_outcome(result)) { From df012cd831d0273c7970aaa19a16a4cae8fdf04f Mon Sep 17 00:00:00 2001 From: Onur Rauf Bingol Date: Tue, 18 Jul 2017 01:29:04 -0500 Subject: [PATCH 5/9] Added a sweeping example --- examples/03_sweeping.py | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 examples/03_sweeping.py diff --git a/examples/03_sweeping.py b/examples/03_sweeping.py new file mode 100644 index 0000000..7d4e491 --- /dev/null +++ b/examples/03_sweeping.py @@ -0,0 +1,68 @@ +""" + Examples for the Python 3 wrapper module for Spatial Corporation's 3D ACIS Modeler + + ACIS and SAT are registered trademarks of Spatial Corporation. + + The Python module is developed by Onur R. Bingol and released under MIT license. + Please see the LICENSE file for details. +""" + +from ACIS import Modeler, Licensing, SaveRestore, Topology, Lists, GeometricAtoms, GeometricOperators, Sweeping, Query + +# Start ACIS Modeler +Modeler.api_start_modeller(0) + +# Unlock ACIS Modeler components +unlock_key = "Your ACIS Unlock Key here" +Licensing.spa_unlock_products(unlock_key) + +# Make a cuboid +block = Topology.BODY() +Modeler.api_make_cuboid(150, 75, 25, block) + +# Get faces of the cuboid +face_list = Lists.ENTITY_LIST() +Query.api_get_faces(block, face_list) + +# Choose any face from the cuboid's face list +block_face = face_list.first() + +# Convert the chosen face into a sheet body +sheet_body = Topology.BODY() +Modeler.api_sheet_from_ff([block_face], sheet_body) + +# Make a sweep path +pt1 = GeometricAtoms.SPAposition(0.0, 0.0, 0.0) +pt2 = GeometricAtoms.SPAposition(10.0, 55.0, 23.0) +sweep_path = Topology.EDGE() +Sweeping.api_make_sweep_path([pt1, pt2], sweep_path) + +# Sweep the chosen face using the sweep path +opts = Sweeping.sweep_options() +swept_body = Topology.BODY() +Sweeping.api_sweep_with_options(sheet_body, sweep_path, opts, swept_body) + +# Assign attributes after generation +sheet_body.name = "Swept FACE" +sheet_body.id = 1 + +# Prepare for saving +save_list = Lists.ENTITY_LIST() +# api_sweep_with_options will modify sheet_body object as defined in its documentation +save_list.add(sheet_body) + +# Set file name +filename = "ACIS_Ex03.SAT" + +# ACIS requires FileInfo object to be set before saving SAT files +file_info = SaveRestore.FileInfo() +file_info.set_product_id(filename) +file_info.set_units(1.0) # milimeters + +SaveRestore.api_set_file_info(file_info, product_id=True, units=True) + +# Save the model as a SAT file +SaveRestore.api_save_entity_list(filename, True, save_list) + +# Stop ACIS Modeler +Modeler.api_stop_modeller() From e45a809a2a735c7688165c634bc2824143553e75 Mon Sep 17 00:00:00 2001 From: Onur Rauf Bingol Date: Tue, 18 Jul 2017 08:51:17 -0500 Subject: [PATCH 6/9] Updated variables defining module name and methods --- src/acis_geometric_atoms.cpp | 3 ++- src/acis_geometric_operators.cpp | 7 ++++--- src/acis_geometry.cpp | 3 ++- src/acis_lists.cpp | 3 ++- src/acis_modeler.cpp | 7 ++++--- src/acis_query.cpp | 7 ++++--- src/acis_saverestore.cpp | 7 ++++--- src/acis_sweeping.cpp | 7 ++++--- src/acis_topology.cpp | 3 ++- 9 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/acis_geometric_atoms.cpp b/src/acis_geometric_atoms.cpp index d559cef..e4c5e68 100644 --- a/src/acis_geometric_atoms.cpp +++ b/src/acis_geometric_atoms.cpp @@ -1558,13 +1558,14 @@ static PyTypeObject */ // Module documentation can be accessible via __doc__ +const char *module_name = "GeometricAtoms"; const char *module_documentation = "Contains 3D ACIS Modeler geometric atoms, e.g. SPAposition, SPApar_pos, etc."; static PyModuleDef ACIS_GeometricAtoms_module = { PyModuleDef_HEAD_INIT, - "GeometricAtoms", + module_name, module_documentation, -1, NULL, NULL, NULL, NULL, NULL diff --git a/src/acis_geometric_operators.cpp b/src/acis_geometric_operators.cpp index d097773..e462850 100644 --- a/src/acis_geometric_operators.cpp +++ b/src/acis_geometric_operators.cpp @@ -39,23 +39,24 @@ ACIS_GeometricOperators_method_translate_transf(PyObject *self, PyObject *args, } static PyMethodDef - ACIS_GeometricOperators_methods[] = + module_methods[] = { { "translate_transf", (PyCFunction) ACIS_GeometricOperators_method_translate_transf, METH_VARARGS | METH_KEYWORDS, "Constructs a transformation corresponding to a translation by a given vector" }, { NULL, NULL, 0, NULL } }; // Module documentation can be accessible via __doc__ +const char *module_name = "GeometricOperators"; const char *module_documentation = "Contains 3D ACIS Modeler geometric operators"; static struct PyModuleDef ACIS_GeometricOperators_module = { PyModuleDef_HEAD_INIT, - "GeometricOperators", // name of the module + module_name, // name of the module module_documentation, // module documentation, may be NULL -1, // size of per-interpreter state of the module, or -1 if the module keeps state in global variables. - ACIS_GeometricOperators_methods + module_methods }; PyMODINIT_FUNC diff --git a/src/acis_geometry.cpp b/src/acis_geometry.cpp index 0805540..f6913cd 100644 --- a/src/acis_geometry.cpp +++ b/src/acis_geometry.cpp @@ -582,13 +582,14 @@ static PyTypeObject */ // Module documentation can be accessible via __doc__ +const char *module_name = "Geometry"; const char *module_documentation = "Contains 3D ACIS Modeler geometry objects, such as SURFACE, CONE, TORUS, etc."; static PyModuleDef ACIS_Geometry_module = { PyModuleDef_HEAD_INIT, - "Geometry", + module_name, module_documentation, -1, NULL, NULL, NULL, NULL, NULL diff --git a/src/acis_lists.cpp b/src/acis_lists.cpp index 208bbb1..37be677 100644 --- a/src/acis_lists.cpp +++ b/src/acis_lists.cpp @@ -311,13 +311,14 @@ static PyTypeObject */ // Module documentation can be accessible via __doc__ +const char *module_name = "Lists"; const char *module_documentation = "Contains 3D ACIS Modeler lists and containers, such as ENTITY_LIST"; static PyModuleDef ACIS_Lists_module = { PyModuleDef_HEAD_INIT, - "Lists", + module_name, module_documentation, -1, NULL, NULL, NULL, NULL, NULL diff --git a/src/acis_modeler.cpp b/src/acis_modeler.cpp index 8cf01ec..41bf4bf 100644 --- a/src/acis_modeler.cpp +++ b/src/acis_modeler.cpp @@ -884,7 +884,7 @@ ACIS_api_boolean_chop_body(PyObject *self, PyObject *args, PyObject *kwargs) } static PyMethodDef - ACIS_Modeler_methods[] = + module_methods[] = { { "api_start_modeller", (PyCFunction) ACIS_api_start_modeller, METH_VARARGS | METH_KEYWORDS, "Starts the 3D ACIS Modeler" }, { "api_stop_modeller", (PyCFunction) ACIS_api_stop_modeller, METH_NOARGS, "Stops the 3D ACIS Modeler" }, @@ -913,16 +913,17 @@ static PyMethodDef }; // Module documentation can be accessible via __doc__ +const char *module_name = "Modeler"; const char *module_documentation = "3D ACIS Modeler main modeling component"; static struct PyModuleDef ACIS_Modeler_module = { PyModuleDef_HEAD_INIT, - "Modeler", // name of the module + module_name, // name of the module module_documentation, // module documentation, may be NULL -1, // size of per-interpreter state of the module, or -1 if the module keeps state in global variables. - ACIS_Modeler_methods + module_methods }; PyMODINIT_FUNC diff --git a/src/acis_query.cpp b/src/acis_query.cpp index 6d8b1f9..31b68f1 100644 --- a/src/acis_query.cpp +++ b/src/acis_query.cpp @@ -146,7 +146,7 @@ ACIS_api_get_edges(PyObject *self, PyObject *args, PyObject *kwargs) } static PyMethodDef - ACIS_Query_methods[] = + module_methods[] = { { "get_owner_transf", (PyCFunction) ACIS_Query_method_get_owner_transf, METH_VARARGS | METH_KEYWORDS, "Gets a copy of the SPAtransf from the owner of an ENTITY" }, { "api_get_faces", (PyCFunction) ACIS_api_get_faces, METH_VARARGS | METH_KEYWORDS, "Gets all faces related to an entity" }, @@ -155,16 +155,17 @@ static PyMethodDef }; // Module documentation can be accessible via __doc__ +const char *module_name = "Query"; const char *module_documentation = "Contains 3D Modeler ACIS geometric and topological queries"; static struct PyModuleDef ACIS_Query_module = { PyModuleDef_HEAD_INIT, - "Query", // name of the module + module_name, // name of the module module_documentation, // module documentation, may be NULL -1, // size of per-interpreter state of the module, or -1 if the module keeps state in global variables. - ACIS_Query_methods + module_methods }; PyMODINIT_FUNC diff --git a/src/acis_saverestore.cpp b/src/acis_saverestore.cpp index a4ec86a..6a3f1a9 100644 --- a/src/acis_saverestore.cpp +++ b/src/acis_saverestore.cpp @@ -460,7 +460,7 @@ ACIS_api_save_version(PyObject *self, PyObject *args, PyObject *kwargs) static PyMethodDef - ACIS_SaveRestore_methods[] = + module_methods[] = { { "api_save_entity_list", (PyCFunction) ACIS_api_save_entity_list, METH_VARARGS | METH_KEYWORDS, "Writes entities to a file in text or binary format" }, { "api_set_file_info", (PyCFunction) ACIS_api_set_file_info, METH_VARARGS | METH_KEYWORDS, "Sets required header info to be written to ACIS save files" }, @@ -470,16 +470,17 @@ static PyMethodDef }; // Module documentation can be accessible via __doc__ +const char *module_name = "SaveRestore"; const char *module_documentation = "Contains 3D ACIS Modeler save & restore related classes and functions"; static PyModuleDef ACIS_SaveRestore_module = { PyModuleDef_HEAD_INIT, - "SaveRestore", + module_name, module_documentation, -1, - ACIS_SaveRestore_methods + module_methods }; PyMODINIT_FUNC diff --git a/src/acis_sweeping.cpp b/src/acis_sweeping.cpp index cbd9b8d..61df954 100644 --- a/src/acis_sweeping.cpp +++ b/src/acis_sweeping.cpp @@ -456,7 +456,7 @@ ACIS_api_sweep_with_options(PyObject *self, PyObject *args, PyObject *kwargs) } static PyMethodDef - ACIS_Sweeping_methods[] = + module_methods[] = { { "api_make_sweep_path", (PyCFunction) ACIS_api_make_sweep_path, METH_VARARGS | METH_KEYWORDS, "Constructs a path useful for creating a swept surface" }, { "api_sweep_with_options", (PyCFunction) ACIS_api_sweep_with_options, METH_VARARGS | METH_KEYWORDS, "Sweeps the given profile along an edge, a distance, a vector or an axis" }, @@ -464,16 +464,17 @@ static PyMethodDef }; // Module documentation can be accessible via __doc__ +const char *module_name = "Sweeping"; const char *module_documentation = "Contains 3D ACIS Modeler sweeping API related classes and functions"; static struct PyModuleDef ACIS_Sweeping_module = { PyModuleDef_HEAD_INIT, - "Sweeping", // name of the module + module_name, // name of the module module_documentation, // module documentation, may be NULL -1, // size of per-interpreter state of the module, or -1 if the module keeps state in global variables. - ACIS_Sweeping_methods + module_methods }; PyMODINIT_FUNC diff --git a/src/acis_topology.cpp b/src/acis_topology.cpp index 01a80ac..d134731 100644 --- a/src/acis_topology.cpp +++ b/src/acis_topology.cpp @@ -1196,13 +1196,14 @@ static PyTypeObject */ // Module documentation can be accessible via __doc__ +const char *module_name = "Topology"; const char *module_documentation = "Contains 3D ACIS Modeler topology objects, such as BODY, FACE, WIRE, etc."; static PyModuleDef ACIS_Topology_module = { PyModuleDef_HEAD_INIT, - "Topology", + module_name, module_documentation, -1, NULL, NULL, NULL, NULL, NULL From 7a55f174a315f898ed87cf47ae1a274af1817eb1 Mon Sep 17 00:00:00 2001 From: Onur Rauf Bingol Date: Tue, 18 Jul 2017 22:19:15 -0500 Subject: [PATCH 7/9] Renamed Topology to Entity and combined some functionality together --- src/acis_entity.cpp | 2101 ++++++++++++++++++++++++++++++ src/acis_entity.h | 307 +++++ src/acis_geometric_atoms.cpp | 54 +- src/acis_geometric_operators.cpp | 72 - src/acis_geometric_operators.h | 29 - src/acis_geometry.cpp | 711 ---------- src/acis_geometry.h | 100 -- src/acis_lists.cpp | 12 +- src/acis_lists.h | 2 +- src/acis_modeler.cpp | 38 +- src/acis_modeler.h | 2 +- src/acis_query.cpp | 6 +- src/acis_query.h | 2 +- src/acis_sweeping.cpp | 10 +- src/acis_sweeping.h | 2 +- src/acis_topology.cpp | 1423 -------------------- src/acis_topology.h | 247 ---- 17 files changed, 2494 insertions(+), 2624 deletions(-) create mode 100644 src/acis_entity.cpp create mode 100644 src/acis_entity.h delete mode 100644 src/acis_geometric_operators.cpp delete mode 100644 src/acis_geometric_operators.h delete mode 100644 src/acis_geometry.cpp delete mode 100644 src/acis_geometry.h delete mode 100644 src/acis_topology.cpp delete mode 100644 src/acis_topology.h diff --git a/src/acis_entity.cpp b/src/acis_entity.cpp new file mode 100644 index 0000000..d7bb2a4 --- /dev/null +++ b/src/acis_entity.cpp @@ -0,0 +1,2101 @@ +#include "acis_entity.h" + + +/** + * 3D ACIS Modeler - ENTITY wrapper + */ + +int +ACIS_Entity_traverse_ENTITY(ACIS_Entity_ENTITY *self, visitproc visit, void *arg) +{ + // Use Py_VISIT macro for PyObject-type variables + Py_VISIT(self->attrib_name); + Py_VISIT(self->attrib_object_id); + + return 0; +} + +int +ACIS_Entity_clear_ENTITY(ACIS_Entity_ENTITY *self) +{ + // Set ACIS object to NULL to allow it automatically deleted by ACIS memory manager + //self->_acis_obj = NULL; + + // Use Py_CLEAR macro for PyObject variables + Py_CLEAR(self->attrib_name); + Py_CLEAR(self->attrib_object_id); + + return 0; +} + +void +ACIS_Entity_dealloc_ENTITY(ACIS_Entity_ENTITY *self) +{ + ACIS_Entity_clear_ENTITY(self); + Py_TYPE(self)->tp_free((PyObject *) self); +} + +PyObject * +ACIS_Entity_new_ENTITY(PyTypeObject *type, PyObject *args, PyObject *kwargs) +{ + // First check if the modeler has been started + if(!is_modeler_started()) + { + PyErr_SetString(PyExc_RuntimeError, "ACIS is not running!"); + return NULL; + } + + ACIS_Entity_ENTITY *self; + + self = (ACIS_Entity_ENTITY *) type->tp_alloc(type, 0); + if (self != NULL) + { + self->attrib_name = PyUnicode_FromString(""); + if (self->attrib_name == NULL) + { + Py_DECREF(self); + return NULL; + } + + self->attrib_object_id = PyLong_FromLong(-1L); + if (self->attrib_object_id == NULL) + { + Py_DECREF(self); + return NULL; + } + + // Just getting rid of the dangling pointer + self->_acis_obj = NULL; + } + + return (PyObject *) self; +} + +int +ACIS_Entity_init_ENTITY(ACIS_Entity_ENTITY *self, PyObject *args, PyObject *kwargs) +{ +// PyObject *input_name = NULL; +// PyObject *input_id = NULL; +// PyObject *tmp; +// +// static char *kwlist[] = +// { +// (char *) "name", +// (char *) "id", +// NULL +// }; +// +// if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO", kwlist, &input_name, &input_id)) +// return -1; +// +// if (input_name != NULL) +// { +// if (!PyUnicode_Check(input_name)) +// { +// PyErr_SetString(PyExc_ValueError, "The first argument (name) must be a string"); +// return -1; +// } +// +// tmp = self->attrib_name; +// Py_INCREF(input_name); +// self->attrib_name = input_name; +// Py_XDECREF(tmp); +// } else +// { +// // Set name to an empty string +// self->attrib_name = PyUnicode_FromString(""); +// } +// +// if (input_id != NULL) +// { +// if (!PyLong_Check(input_id)) +// { +// PyErr_SetString(PyExc_ValueError, "The second argument (id) must be an integer"); +// return -1; +// } +// +// tmp = self->attrib_object_id; +// Py_INCREF(input_id); +// self->attrib_object_id = input_id; +// Py_XDECREF(tmp); +// } else +// { +// // Set object id to zero +// self->attrib_object_id = PyLong_FromLong(-1L); +// } + + return 0; +} + +PyObject * +ACIS_Entity_repr_ENTITY(ACIS_Entity_ENTITY *self) +{ + const char *_name = PyUnicode_AsUTF8(self->attrib_name); + int _id = (int)PyLong_AsLong(self->attrib_object_id); + return PyUnicode_FromFormat("ACIS ENTITY object with name '%s' and ID '%i'", _name, _id); +} + +PyObject * +ACIS_Entity_str_ENTITY(ACIS_Entity_ENTITY *self) +{ + const char *acis_obj_status = NULL; + if (self->_acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS ENTITY object (%s)", acis_obj_status); +} + +PyObject * +ACIS_Entity_method_ENTITY_get_attrib_name(ACIS_Entity_ENTITY *self, PyObject *value, void *closure) +{ + Py_INCREF(self->attrib_name); + return self->attrib_name; +} + +int +ACIS_Entity_method_ENTITY_set_attrib_name(ACIS_Entity_ENTITY *self, PyObject *value, void *closure) +{ + if (value == NULL) + { + PyErr_SetString(PyExc_TypeError, "Cannot delete NAME attribute"); + return -1; + } + + if (!PyUnicode_Check(value)) + { + PyErr_SetString(PyExc_TypeError, "The NAME attribute value must be a str"); + return -1; + } + + Py_DECREF(self->attrib_name); + Py_INCREF(value); + self->attrib_name = value; + + // Extract the C-style string from PyObject + const char *_attrib_data = PyUnicode_AsUTF8(value); + + // Set the attribute of the ACIS object + ATTRIB_GEN_NAME *my_att = (ATTRIB_GEN_NAME *) find_attrib((ENTITY *) self->_acis_obj); + if (my_att != NULL) + { + my_att->lose(); + } + ACIS_NEW ATTRIB_GEN_NAME(self->_acis_obj, _attrib_data); + + return 0; +} + +PyObject * +ACIS_Entity_method_ENTITY_get_attrib_obj_id(ACIS_Entity_ENTITY *self, PyObject *value, void *closure) +{ + Py_INCREF(self->attrib_object_id); + return self->attrib_object_id; +} + +int +ACIS_Entity_method_ENTITY_set_attrib_obj_id(ACIS_Entity_ENTITY *self, PyObject *value, void *closure) +{ + if (value == NULL) + { + PyErr_SetString(PyExc_TypeError, "Cannot delete ID attribute"); + return -1; + } + + if (!PyLong_Check(value)) + { + PyErr_SetString(PyExc_TypeError, "The ID attribute value must be an integer"); + return -1; + } + + Py_DECREF(self->attrib_object_id); + Py_INCREF(value); + self->attrib_object_id = value; + + // Extract the integer value from PyObject + int _attrib_data = (int) PyLong_AsLong(value); + + // Extract the C-style string from PyObject + const char *_attrib_data_name = PyUnicode_AsUTF8(self->attrib_name); + + // Set the attribute of the ACIS object (a named integer attribute) + ATTRIB_GEN_INTEGER *my_att = (ATTRIB_GEN_INTEGER *) find_attrib((ENTITY *) self->_acis_obj); + if (my_att != NULL) + { + my_att->lose(); + } + ACIS_NEW ATTRIB_GEN_INTEGER(self->_acis_obj, _attrib_data_name, _attrib_data); + + return 0; +} + + +/** + * 3D ACIS Modeler - BODY wrapper + */ + +static int +ACIS_Entity_init_BODY(ACIS_Entity_BODY *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_BODY(ACIS_Entity_BODY *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS BODY object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_BODY(ACIS_Entity_BODY *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS BODY object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_BODY[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_BODY[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_BODY[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_BODY = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.BODY", /* tp_name */ + sizeof(ACIS_Entity_BODY), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_BODY, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_BODY, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS BODY class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_BODY, /* tp_methods */ + ACIS_Entity_members_BODY, /* tp_members */ + ACIS_Entity_getseters_BODY, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_BODY, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - FACE wrapper + */ + +static int +ACIS_Entity_init_FACE(ACIS_Entity_FACE *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_FACE(ACIS_Entity_FACE *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS FACE object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_FACE(ACIS_Entity_FACE *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS FACE object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_FACE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_FACE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_FACE[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_FACE = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.FACE", /* tp_name */ + sizeof(ACIS_Entity_FACE), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_FACE, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_FACE, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS FACE class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_FACE, /* tp_methods */ + ACIS_Entity_members_FACE, /* tp_members */ + ACIS_Entity_getseters_FACE, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_FACE, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - EDGE wrapper + */ + +static int +ACIS_Entity_init_EDGE(ACIS_Entity_EDGE *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_EDGE(ACIS_Entity_EDGE *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS EDGE object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_EDGE(ACIS_Entity_EDGE *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS EDGE object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_EDGE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_EDGE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_EDGE[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_EDGE = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.EDGE", /* tp_name */ + sizeof(ACIS_Entity_EDGE), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_EDGE, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_EDGE, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS EDGE class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_EDGE, /* tp_methods */ + ACIS_Entity_members_EDGE, /* tp_members */ + ACIS_Entity_getseters_EDGE, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_EDGE, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - WIRE wrapper + */ + +static int +ACIS_Entity_init_WIRE(ACIS_Entity_WIRE *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_WIRE(ACIS_Entity_WIRE *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS WIRE object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_WIRE(ACIS_Entity_WIRE *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS WIRE object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_WIRE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_WIRE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_WIRE[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_WIRE = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.WIRE", /* tp_name */ + sizeof(ACIS_Entity_WIRE), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_WIRE, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_WIRE, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS WIRE class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_WIRE, /* tp_methods */ + ACIS_Entity_members_WIRE, /* tp_members */ + ACIS_Entity_getseters_WIRE, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_WIRE, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - LUMP wrapper + */ + +static int +ACIS_Entity_init_LUMP(ACIS_Entity_LUMP *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_LUMP(ACIS_Entity_LUMP *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS LUMP object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_LUMP(ACIS_Entity_LUMP *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS LUMP object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_LUMP[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_LUMP[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_LUMP[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_LUMP = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.LUMP", /* tp_name */ + sizeof(ACIS_Entity_LUMP), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_LUMP, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_LUMP, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS LUMP class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_LUMP, /* tp_methods */ + ACIS_Entity_members_LUMP, /* tp_members */ + ACIS_Entity_getseters_LUMP, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_LUMP, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - SHELL wrapper + */ + +static int +ACIS_Entity_init_SHELL(ACIS_Entity_SHELL *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_SHELL(ACIS_Entity_SHELL *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS SHELL object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_SHELL(ACIS_Entity_SHELL *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS SHELL object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_SHELL[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_SHELL[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_SHELL[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_SHELL = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.SHELL", /* tp_name */ + sizeof(ACIS_Entity_SHELL), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_SHELL, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_SHELL, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS SHELL class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_SHELL, /* tp_methods */ + ACIS_Entity_members_SHELL, /* tp_members */ + ACIS_Entity_getseters_SHELL, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_SHELL, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - SUBSHELL wrapper + */ + +static int +ACIS_Entity_init_SUBSHELL(ACIS_Entity_SUBSHELL *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_SUBSHELL(ACIS_Entity_SUBSHELL *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS SUBSHELL object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_SUBSHELL(ACIS_Entity_SUBSHELL *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS SUBSHELL object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_SUBSHELL[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_SUBSHELL[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_SUBSHELL[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_SUBSHELL = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.SUBSHELL", /* tp_name */ + sizeof(ACIS_Entity_SUBSHELL), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_SUBSHELL, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_SUBSHELL, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS SUBSHELL class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_SUBSHELL, /* tp_methods */ + ACIS_Entity_members_SUBSHELL, /* tp_members */ + ACIS_Entity_getseters_SUBSHELL, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_SUBSHELL, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - COEDGE wrapper + */ + +static int +ACIS_Entity_init_COEDGE(ACIS_Entity_COEDGE *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_COEDGE(ACIS_Entity_COEDGE *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS COEDGE object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_COEDGE(ACIS_Entity_COEDGE *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS COEDGE object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_COEDGE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_COEDGE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_COEDGE[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_COEDGE = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.COEDGE", /* tp_name */ + sizeof(ACIS_Entity_COEDGE), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_COEDGE, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_COEDGE, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS COEDGE class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_COEDGE, /* tp_methods */ + ACIS_Entity_members_COEDGE, /* tp_members */ + ACIS_Entity_getseters_COEDGE, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_COEDGE, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - LOOP wrapper + */ + +static int +ACIS_Entity_init_LOOP(ACIS_Entity_LOOP *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_LOOP(ACIS_Entity_LOOP *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS LOOP object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_LOOP(ACIS_Entity_LOOP *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS LOOP object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_LOOP[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_LOOP[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_LOOP[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_LOOP = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.LOOP", /* tp_name */ + sizeof(ACIS_Entity_LOOP), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_LOOP, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_LOOP, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS LOOP class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_LOOP, /* tp_methods */ + ACIS_Entity_members_LOOP, /* tp_members */ + ACIS_Entity_getseters_LOOP, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_LOOP, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - VERTEX wrapper + */ + +static int +ACIS_Entity_init_VERTEX(ACIS_Entity_VERTEX *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_VERTEX(ACIS_Entity_VERTEX *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS VERTEX object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_VERTEX(ACIS_Entity_VERTEX *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS VERTEX object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_VERTEX[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_VERTEX[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_VERTEX[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_VERTEX = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.VERTEX", /* tp_name */ + sizeof(ACIS_Entity_VERTEX), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_VERTEX, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_VERTEX, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS VERTEX class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_VERTEX, /* tp_methods */ + ACIS_Entity_members_VERTEX, /* tp_members */ + ACIS_Entity_getseters_VERTEX, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_VERTEX, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - SURFACE wrapper + */ + +static int +ACIS_Entity_init_SURFACE(ACIS_Entity_SURFACE *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *) self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_SURFACE(ACIS_Entity_SURFACE *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int) PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS SURFACE object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_SURFACE(ACIS_Entity_SURFACE *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS SURFACE object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_SURFACE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_SURFACE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_SURFACE[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_SURFACE = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.SURFACE", /* tp_name */ + sizeof(ACIS_Entity_SURFACE), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_SURFACE, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_SURFACE, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS SURFACE class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_SURFACE, /* tp_methods */ + ACIS_Entity_members_SURFACE, /* tp_members */ + ACIS_Entity_getseters_SURFACE, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_SURFACE, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - CONE wrapper + */ + +static int +ACIS_Entity_init_CONE(ACIS_Entity_CONE *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *) self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_CONE(ACIS_Entity_CONE *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int) PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS CONE object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_CONE(ACIS_Entity_CONE *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS CONE object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_CONE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_CONE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_CONE[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_CONE = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.CONE", /* tp_name */ + sizeof(ACIS_Entity_CONE), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_CONE, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_CONE, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS CONE class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_CONE, /* tp_methods */ + ACIS_Entity_members_CONE, /* tp_members */ + ACIS_Entity_getseters_CONE, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_CONE, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - PLANE wrapper + */ + +static int +ACIS_Entity_init_PLANE(ACIS_Entity_PLANE *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *) self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_PLANE(ACIS_Entity_PLANE *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int) PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS PLANE object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_PLANE(ACIS_Entity_PLANE *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS PLANE object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_PLANE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_PLANE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_PLANE[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_PLANE = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.PLANE", /* tp_name */ + sizeof(ACIS_Entity_PLANE), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_PLANE, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_PLANE, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS PLANE class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_PLANE, /* tp_methods */ + ACIS_Entity_members_PLANE, /* tp_members */ + ACIS_Entity_getseters_PLANE, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_PLANE, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - SPHERE wrapper + */ + +static int +ACIS_Entity_init_SPHERE(ACIS_Entity_SPHERE *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *) self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_SPHERE(ACIS_Entity_SPHERE *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int) PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS SPHERE object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_SPHERE(ACIS_Entity_SPHERE *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS SPHERE object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_SPHERE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_SPHERE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_SPHERE[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_SPHERE = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.SPHERE", /* tp_name */ + sizeof(ACIS_Entity_SPHERE), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_SPHERE, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_SPHERE, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS SPHERE class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_SPHERE, /* tp_methods */ + ACIS_Entity_members_SPHERE, /* tp_members */ + ACIS_Entity_getseters_SPHERE, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_SPHERE, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - SPLINE wrapper + */ + +static int +ACIS_Entity_init_SPLINE(ACIS_Entity_SPLINE *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *) self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_SPLINE(ACIS_Entity_SPLINE *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int) PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS SPLINE object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_SPLINE(ACIS_Entity_SPLINE *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS SPLINE object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_SPLINE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_SPLINE[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_SPLINE[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_SPLINE = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.SPLINE", /* tp_name */ + sizeof(ACIS_Entity_SPLINE), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_SPLINE, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_SPLINE, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS SPLINE class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_SPLINE, /* tp_methods */ + ACIS_Entity_members_SPLINE, /* tp_members */ + ACIS_Entity_getseters_SPLINE, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_SPLINE, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/** + * 3D ACIS Modeler - TORUS wrapper + */ + +static int +ACIS_Entity_init_TORUS(ACIS_Entity_TORUS *self, PyObject *args, PyObject *kwargs) +{ + // Initialize the base class + if (ACIS_Entity_type_ENTITY.tp_init((PyObject *) self, args, kwargs) < 0) + return -1; + + return 0; +} + +static PyObject * +ACIS_Entity_repr_TORUS(ACIS_Entity_TORUS *self) +{ + const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); + int _id = (int) PyLong_AsLong(self->base_obj.attrib_object_id); + return PyUnicode_FromFormat("ACIS TORUS object with name '%s' and ID '%i'", _name, _id); +} + +static PyObject * +ACIS_Entity_str_TORUS(ACIS_Entity_TORUS *self) +{ + const char *acis_obj_status = NULL; + if (self->base_obj._acis_obj == NULL) + acis_obj_status = "Empty"; + else + acis_obj_status = "Valid"; + + return PyUnicode_FromFormat("ACIS TORUS object (%s)", acis_obj_status); +} + +static PyGetSetDef + ACIS_Entity_getseters_TORUS[] = + { + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_TORUS[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_TORUS[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_TORUS = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.TORUS", /* tp_name */ + sizeof(ACIS_Entity_TORUS), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_TORUS, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_TORUS, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "ACIS TORUS class", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_TORUS, /* tp_methods */ + ACIS_Entity_members_TORUS, /* tp_members */ + ACIS_Entity_getseters_TORUS, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_TORUS, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + }; + + +/* + * Python Module Definitions + */ + +// Module documentation can be accessible via __doc__ +const char *module_name = "Entity"; +const char *module_documentation = "Contains 3D ACIS Modeler entities, such as BODY, FACE, WIRE, etc."; + +static PyModuleDef + ACIS_Entity_module = + { + PyModuleDef_HEAD_INIT, + module_name, + module_documentation, + -1, + NULL, NULL, NULL, NULL, NULL + }; + +PyMODINIT_FUNC +PyInit_Entity(void) +{ + // Create a Python module, ACIS.Topology + PyObject *m; + m = PyModule_Create(&ACIS_Entity_module); + if (m == NULL) + return NULL; + + // Add ENTITY to the Topology module + if (PyType_Ready(&ACIS_Entity_type_ENTITY) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_ENTITY); + PyModule_AddObject(m, "ENTITY", (PyObject *) &ACIS_Entity_type_ENTITY); + + // Add BODY to the Topology module + ACIS_Entity_type_BODY.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_BODY) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_BODY); + PyModule_AddObject(m, "BODY", (PyObject *) &ACIS_Entity_type_BODY); + + // Add FACE to the Topology module + ACIS_Entity_type_FACE.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_FACE) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_FACE); + PyModule_AddObject(m, "FACE", (PyObject *) &ACIS_Entity_type_FACE); + + // Add EDGE to the Topology module + ACIS_Entity_type_EDGE.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_EDGE) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_EDGE); + PyModule_AddObject(m, "EDGE", (PyObject *) &ACIS_Entity_type_EDGE); + + // Add WIRE to the Topology module + ACIS_Entity_type_WIRE.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_WIRE) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_WIRE); + PyModule_AddObject(m, "WIRE", (PyObject *) &ACIS_Entity_type_WIRE); + + // Add LUMP to the Topology module + ACIS_Entity_type_LUMP.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_LUMP) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_LUMP); + PyModule_AddObject(m, "LUMP", (PyObject *) &ACIS_Entity_type_LUMP); + + // Add SHELL to the Topology module + ACIS_Entity_type_SHELL.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_SHELL) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_SHELL); + PyModule_AddObject(m, "SHELL", (PyObject *) &ACIS_Entity_type_SHELL); + + // Add SUBSHELL to the Topology module + ACIS_Entity_type_SUBSHELL.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_SUBSHELL) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_SUBSHELL); + PyModule_AddObject(m, "SUBSHELL", (PyObject *) &ACIS_Entity_type_SUBSHELL); + + // Add COEDGE to the Topology module + ACIS_Entity_type_COEDGE.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_COEDGE) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_COEDGE); + PyModule_AddObject(m, "COEDGE", (PyObject *) &ACIS_Entity_type_COEDGE); + + // Add LOOP to the Topology module + ACIS_Entity_type_LOOP.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_LOOP) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_LOOP); + PyModule_AddObject(m, "LOOP", (PyObject *) &ACIS_Entity_type_LOOP); + + // Add VERTEX to the Topology module + ACIS_Entity_type_VERTEX.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_VERTEX) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_VERTEX); + PyModule_AddObject(m, "VERTEX", (PyObject *) &ACIS_Entity_type_VERTEX); + + // Add SURFACE to the Geometry module + ACIS_Entity_type_SURFACE.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_SURFACE) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_SURFACE); + PyModule_AddObject(m, "SURFACE", (PyObject *) &ACIS_Entity_type_SURFACE); + + // Add CONE to the Geometry module + ACIS_Entity_type_CONE.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_CONE) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_CONE); + PyModule_AddObject(m, "CONE", (PyObject *) &ACIS_Entity_type_CONE); + + // Add PLANE to the Geometry module + ACIS_Entity_type_PLANE.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_PLANE) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_PLANE); + PyModule_AddObject(m, "PLANE", (PyObject *) &ACIS_Entity_type_PLANE); + + // Add SPHERE to the Geometry module + ACIS_Entity_type_SPHERE.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_SPHERE) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_SPHERE); + PyModule_AddObject(m, "SPHERE", (PyObject *) &ACIS_Entity_type_SPHERE); + + // Add SPLINE to the Geometry module + ACIS_Entity_type_SPLINE.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_SPLINE) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_SPLINE); + PyModule_AddObject(m, "SPLINE", (PyObject *) &ACIS_Entity_type_SPLINE); + + // Add TORUS to the Geometry module + ACIS_Entity_type_TORUS.tp_base = &ACIS_Entity_type_ENTITY; + if (PyType_Ready(&ACIS_Entity_type_TORUS) < 0) + return NULL; + Py_INCREF(&ACIS_Entity_type_TORUS); + PyModule_AddObject(m, "TORUS", (PyObject *) &ACIS_Entity_type_TORUS); + + // Return the module and all included objects + return m; +} + +PyObject *_ACIS_new_ENTITY() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_ENTITY, NULL); +} + +bool _ACIS_check_ENTITY(PyObject *ob) +{ + int retval = PyObject_IsInstance(ob, (PyObject *)&ACIS_Entity_type_ENTITY); + if (retval < 0) + { + PyErr_SetString(PyExc_TypeError, "Problem with ENTITY type cheking"); + return false; + } + return retval != 0; +} + +PyObject *_ACIS_new_BODY() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_BODY, NULL); +} + +bool _ACIS_check_BODY(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_BODY; +} + +PyObject *_ACIS_new_FACE() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_FACE, NULL); +} + +bool _ACIS_check_FACE(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_FACE; +} + +PyObject *_ACIS_new_EDGE() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_EDGE, NULL); +} + +bool _ACIS_check_EDGE(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_EDGE; +} + +PyObject *_ACIS_new_WIRE() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_WIRE, NULL); +} + +bool _ACIS_check_WIRE(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_WIRE; +} + +PyObject *_ACIS_new_LUMP() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_LUMP, NULL); +} + +bool _ACIS_check_LUMP(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_LUMP; +} + +PyObject *_ACIS_new_SHELL() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_SHELL, NULL); +} + +bool _ACIS_check_SHELL(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_SHELL; +} + +PyObject *_ACIS_new_SUBSHELL() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_SUBSHELL, NULL); +} + +bool _ACIS_check_SUBSHELL(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_SUBSHELL; +} + +PyObject *_ACIS_new_COEDGE() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_COEDGE, NULL); +} + +bool _ACIS_check_COEDGE(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_COEDGE; +} + +PyObject *_ACIS_new_LOOP() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_LOOP, NULL); +} + +bool _ACIS_check_LOOP(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_LOOP; +} + +PyObject *_ACIS_new_VERTEX() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_VERTEX, NULL); +} + +bool _ACIS_check_VERTEX(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_VERTEX; +} + +PyObject *_ACIS_new_SURFACE() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_SURFACE, NULL); +} + +bool _ACIS_check_SURFACE(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_SURFACE; +} + +PyObject *_ACIS_new_CONE() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_CONE, NULL); +} + +bool _ACIS_check_CONE(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_CONE; +} + +PyObject *_ACIS_new_PLANE() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_PLANE, NULL); +} + +bool _ACIS_check_PLANE(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_PLANE; +} + +PyObject *_ACIS_new_SPHERE() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_SPHERE, NULL); +} + +bool _ACIS_check_SPHERE(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_SPHERE; +} + +PyObject *_ACIS_new_SPLINE() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_SPLINE, NULL); +} + +bool _ACIS_check_SPLINE(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_SPLINE; +} + +PyObject *_ACIS_new_TORUS() +{ + return PyObject_CallObject((PyObject *) &ACIS_Entity_type_TORUS, NULL); +} + +bool _ACIS_check_TORUS(PyObject *ob) +{ + return Py_TYPE(ob) == &ACIS_Entity_type_TORUS; +} + +void _ACIS_make_null(PyObject *ob) +{ + if (_ACIS_check_ENTITY(ob)) + { + ((ACIS_Entity_ENTITY *) ob)->_acis_obj = NULL; + } +} diff --git a/src/acis_entity.h b/src/acis_entity.h new file mode 100644 index 0000000..80459d8 --- /dev/null +++ b/src/acis_entity.h @@ -0,0 +1,307 @@ +/** + * + * Python 3 wrapper module for Spatial Corporation's 3D ACIS Modeler + * + * ACIS and SAT are registered trademarks of Spatial Corporation. + * + * The Python module is developed by Onur R. Bingol and released under MIT license. + * Please see the LICENSE file for details. + * + */ + +#ifndef ACIS_ENTITY_H +#define ACIS_ENTITY_H + +#include +#include + +#include "kernapi.hxx" +#include +#include +#include +#include +#include + +#include "acis_entity_export.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +// Types and their functions + +// Define ENTITY as a base class +typedef struct +{ + PyObject_HEAD + ENTITY *_acis_obj; + PyObject *attrib_name; + PyObject *attrib_object_id; +} ACIS_Entity_ENTITY; + +int ACIS_ENTITY_EXPORT ACIS_Entity_traverse_ENTITY(ACIS_Entity_ENTITY *self, visitproc visit, void *arg); + +int ACIS_ENTITY_EXPORT ACIS_Entity_clear_ENTITY(ACIS_Entity_ENTITY *self); + +void ACIS_ENTITY_EXPORT ACIS_Entity_dealloc_ENTITY(ACIS_Entity_ENTITY *self); + +PyObject ACIS_ENTITY_EXPORT *ACIS_Entity_new_ENTITY(PyTypeObject *type, PyObject *args, PyObject *kwargs); + +int ACIS_ENTITY_EXPORT ACIS_Entity_init_ENTITY(ACIS_Entity_ENTITY *self, PyObject *args, PyObject *kwargs); + +PyObject ACIS_ENTITY_EXPORT *ACIS_Entity_repr_ENTITY(ACIS_Entity_ENTITY *self); + +PyObject ACIS_ENTITY_EXPORT *ACIS_Entity_str_ENTITY(ACIS_Entity_ENTITY *self); + +PyObject ACIS_ENTITY_EXPORT *ACIS_Entity_method_ENTITY_get_attrib_name(ACIS_Entity_ENTITY *self, PyObject *value, void *closure); + +int ACIS_ENTITY_EXPORT ACIS_Entity_method_ENTITY_set_attrib_name(ACIS_Entity_ENTITY *self, PyObject *value, void *closure); + +PyObject ACIS_ENTITY_EXPORT *ACIS_Entity_method_ENTITY_get_attrib_obj_id(ACIS_Entity_ENTITY *self, PyObject *value, void *closure); + +int ACIS_ENTITY_EXPORT ACIS_Entity_method_ENTITY_set_attrib_obj_id(ACIS_Entity_ENTITY *self, PyObject *value, void *closure); + +static PyGetSetDef + ACIS_Entity_getseters_ENTITY[] = + { + { (char *) "name", (getter) ACIS_Entity_method_ENTITY_get_attrib_name, (setter) ACIS_Entity_method_ENTITY_set_attrib_name, (char *) "object name", NULL }, + { (char *) "id", (getter) ACIS_Entity_method_ENTITY_get_attrib_obj_id, (setter) ACIS_Entity_method_ENTITY_set_attrib_obj_id, (char *) "object id", NULL }, + { NULL } /* Sentinel */ + }; + +static PyMemberDef + ACIS_Entity_members_ENTITY[] = + { + { NULL } /* Sentinel */ + }; + +static PyMethodDef + ACIS_Entity_methods_ENTITY[] = + { + { NULL } /* Sentinel */ + }; + +static PyTypeObject + ACIS_Entity_type_ENTITY = + { + PyVarObject_HEAD_INIT(NULL, 0) + "ACIS.ENTITY", /* tp_name */ + sizeof(ACIS_Entity_ENTITY), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor) ACIS_Entity_dealloc_ENTITY, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + (reprfunc) ACIS_Entity_repr_ENTITY, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc) ACIS_Entity_str_ENTITY, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | + Py_TPFLAGS_BASETYPE | + Py_TPFLAGS_HAVE_GC, /* tp_flags */ + "ACIS ENTITY class", /* tp_doc */ + (traverseproc) ACIS_Entity_traverse_ENTITY, /* tp_traverse */ + (inquiry) ACIS_Entity_clear_ENTITY, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + ACIS_Entity_methods_ENTITY, /* tp_methods */ + ACIS_Entity_members_ENTITY, /* tp_members */ + ACIS_Entity_getseters_ENTITY, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc) ACIS_Entity_init_ENTITY, /* tp_init */ + 0, /* tp_alloc */ + ACIS_Entity_new_ENTITY, /* tp_new */ + }; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_ENTITY(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_ENTITY(PyObject *ob); + +// Define BODY +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_BODY; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_BODY(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_BODY(PyObject *ob); + +// Define FACE +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_FACE; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_FACE(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_FACE(PyObject *ob); + +// Define EDGE +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_EDGE; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_EDGE(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_EDGE(PyObject *ob); + +// Define WIRE +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_WIRE; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_WIRE(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_WIRE(PyObject *ob); + +// Define LUMP +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_LUMP; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_LUMP(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_LUMP(PyObject *ob); + +// Define SHELL +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_SHELL; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_SHELL(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_SHELL(PyObject *ob); + +// Define SUBSHELL +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_SUBSHELL; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_SUBSHELL(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_SUBSHELL(PyObject *ob); + +// Define COEDGE +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_COEDGE; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_COEDGE(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_COEDGE(PyObject *ob); + +// Define LOOP +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_LOOP; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_LOOP(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_LOOP(PyObject *ob); + +// Define VERTEX +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_VERTEX; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_VERTEX(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_VERTEX(PyObject *ob); + +// Define SURFACE +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_SURFACE; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_SURFACE(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_SURFACE(PyObject *ob); + +// Define CONE +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_CONE; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_CONE(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_CONE(PyObject *ob); + +// Define PLANE +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_PLANE; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_PLANE(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_PLANE(PyObject *ob); + +// Define SPHERE +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_SPHERE; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_SPHERE(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_SPHERE(PyObject *ob); + +// Define SPLINE +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_SPLINE; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_SPLINE(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_SPLINE(PyObject *ob); + +// Define TORUS +typedef struct +{ + ACIS_Entity_ENTITY base_obj; +} ACIS_Entity_TORUS; + +PyObject ACIS_ENTITY_EXPORT *_ACIS_new_TORUS(); + +bool ACIS_ENTITY_EXPORT _ACIS_check_TORUS(PyObject *ob); + + +// Additional functions + +/** + * Sets the internal ocis_obj variable to NULL + * @param ob Topology object, such as ENTITY, BODY, FACE, etc. + */ +void ACIS_ENTITY_EXPORT _ACIS_make_null(PyObject *ob); + +#ifdef __cplusplus +} +#endif + +#endif // !ACIS_ENTITY_H diff --git a/src/acis_geometric_atoms.cpp b/src/acis_geometric_atoms.cpp index e4c5e68..e7fd67a 100644 --- a/src/acis_geometric_atoms.cpp +++ b/src/acis_geometric_atoms.cpp @@ -1557,18 +1557,62 @@ static PyTypeObject * Python module definitions */ +static PyObject * +ACIS_GeometricAtoms_method_translate_transf(PyObject *self, PyObject *args, PyObject *kwargs) +{ + PyObject *input_disp = NULL; + + // List of keyword arguments that this function can take + static char *kwlist[] = + { + (char *) "disp", + NULL + }; + + // Try to parse input arguments and/or keywords + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O", kwlist, &input_disp)) + return NULL; + + // "disp" must be a SPAvector object + if (!_ACIS_check_SPAvector(input_disp)) + { + PyErr_SetString(PyExc_TypeError, "Expecting SPAvector object"); + return NULL; + } + + // Get the ACIS object from the user input + SPAvector *&_disp = ((ACIS_GeometricAtoms_SPAvector *) input_disp)->_acis_obj; + + // Execute ACIS function + SPAtransf retval = translate_transf(*_disp); + + // Generate a new SPAtransf python object and set its ACIS object value + PyObject *retobj = _ACIS_new_SPAtransf(); + *((ACIS_GeometricAtoms_SPAtransf *) retobj)->_acis_obj = retval; + + // Return SPAtransf python object + return retobj; +} + +static PyMethodDef + module_methods[] = + { + { "translate_transf", (PyCFunction) ACIS_GeometricAtoms_method_translate_transf, METH_VARARGS | METH_KEYWORDS, "Constructs a transformation corresponding to a translation by a given vector" }, + { NULL, NULL, 0, NULL } + }; + // Module documentation can be accessible via __doc__ const char *module_name = "GeometricAtoms"; const char *module_documentation = "Contains 3D ACIS Modeler geometric atoms, e.g. SPAposition, SPApar_pos, etc."; -static PyModuleDef +static struct PyModuleDef ACIS_GeometricAtoms_module = { PyModuleDef_HEAD_INIT, - module_name, - module_documentation, - -1, - NULL, NULL, NULL, NULL, NULL + module_name, // name of the module + module_documentation, // module documentation, may be NULL + -1, // size of per-interpreter state of the module, or -1 if the module keeps state in global variables. + module_methods }; PyMODINIT_FUNC diff --git a/src/acis_geometric_operators.cpp b/src/acis_geometric_operators.cpp deleted file mode 100644 index e462850..0000000 --- a/src/acis_geometric_operators.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include "acis_geometric_operators.h" - - -static PyObject * -ACIS_GeometricOperators_method_translate_transf(PyObject *self, PyObject *args, PyObject *kwargs) -{ - PyObject *input_disp = NULL; - - // List of keyword arguments that this function can take - static char *kwlist[] = - { - (char *) "disp", - NULL - }; - - // Try to parse input arguments and/or keywords - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O", kwlist, &input_disp)) - return NULL; - - // "disp" must be a SPAvector object - if (!_ACIS_check_SPAvector(input_disp)) - { - PyErr_SetString(PyExc_TypeError, "Expecting SPAvector object"); - return NULL; - } - - // Get the ACIS object from the user input - SPAvector *&_disp = ((ACIS_GeometricAtoms_SPAvector *) input_disp)->_acis_obj; - - // Execute ACIS function - SPAtransf retval = translate_transf(*_disp); - - // Generate a new SPAtransf python object and set its ACIS object value - PyObject *retobj = _ACIS_new_SPAtransf(); - *((ACIS_GeometricAtoms_SPAtransf *) retobj)->_acis_obj = retval; - - // Return SPAtransf python object - return retobj; -} - -static PyMethodDef - module_methods[] = - { - { "translate_transf", (PyCFunction) ACIS_GeometricOperators_method_translate_transf, METH_VARARGS | METH_KEYWORDS, "Constructs a transformation corresponding to a translation by a given vector" }, - { NULL, NULL, 0, NULL } - }; - -// Module documentation can be accessible via __doc__ -const char *module_name = "GeometricOperators"; -const char *module_documentation = "Contains 3D ACIS Modeler geometric operators"; - -static struct PyModuleDef - ACIS_GeometricOperators_module = - { - PyModuleDef_HEAD_INIT, - module_name, // name of the module - module_documentation, // module documentation, may be NULL - -1, // size of per-interpreter state of the module, or -1 if the module keeps state in global variables. - module_methods - }; - -PyMODINIT_FUNC -PyInit_GeometricOperators(void) -{ - PyObject *m; - - m = PyModule_Create(&ACIS_GeometricOperators_module); - if (m == NULL) - return NULL; - - return m; -} diff --git a/src/acis_geometric_operators.h b/src/acis_geometric_operators.h deleted file mode 100644 index 5e4a695..0000000 --- a/src/acis_geometric_operators.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * - * Python 3 wrapper module for Spatial Corporation's 3D ACIS Modeler - * - * ACIS and SAT are registered trademarks of Spatial Corporation. - * - * The Python module is developed by Onur R. Bingol and released under MIT license. - * Please see the LICENSE file for details. - * - */ - -#ifndef ACIS_GEOMETRIC_OPERATORS_H -#define ACIS_GEOMETRIC_OPERATORS_H - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "acis_geometric_atoms.h" - -#include "acis_geometric_operators_export.h" - -#endif // !ACIS_GEOMETRIC_OPERATORS_H diff --git a/src/acis_geometry.cpp b/src/acis_geometry.cpp deleted file mode 100644 index f6913cd..0000000 --- a/src/acis_geometry.cpp +++ /dev/null @@ -1,711 +0,0 @@ -#include "acis_geometry.h" - - -/** - * 3D ACIS Modeler - SURFACE wrapper - */ - -static int -ACIS_Geometry_init_SURFACE(ACIS_Geometry_SURFACE *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *) self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Geometry_repr_SURFACE(ACIS_Geometry_SURFACE *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int) PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS SURFACE object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Geometry_str_SURFACE(ACIS_Geometry_SURFACE *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS SURFACE object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Geometry_getseters_SURFACE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Geometry_members_SURFACE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Geometry_methods_SURFACE[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Geometry_type_SURFACE = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.SURFACE", /* tp_name */ - sizeof(ACIS_Geometry_SURFACE), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Geometry_repr_SURFACE, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Geometry_str_SURFACE, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS SURFACE class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Geometry_methods_SURFACE, /* tp_methods */ - ACIS_Geometry_members_SURFACE, /* tp_members */ - ACIS_Geometry_getseters_SURFACE, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Geometry_init_SURFACE, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/** - * 3D ACIS Modeler - CONE wrapper - */ - -static int -ACIS_Geometry_init_CONE(ACIS_Geometry_CONE *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *) self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Geometry_repr_CONE(ACIS_Geometry_CONE *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int) PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS CONE object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Geometry_str_CONE(ACIS_Geometry_CONE *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS CONE object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Geometry_getseters_CONE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Geometry_members_CONE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Geometry_methods_CONE[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Geometry_type_CONE = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.CONE", /* tp_name */ - sizeof(ACIS_Geometry_CONE), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Geometry_repr_CONE, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Geometry_str_CONE, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS CONE class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Geometry_methods_CONE, /* tp_methods */ - ACIS_Geometry_members_CONE, /* tp_members */ - ACIS_Geometry_getseters_CONE, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Geometry_init_CONE, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/** - * 3D ACIS Modeler - PLANE wrapper - */ - -static int -ACIS_Geometry_init_PLANE(ACIS_Geometry_PLANE *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *) self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Geometry_repr_PLANE(ACIS_Geometry_PLANE *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int) PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS PLANE object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Geometry_str_PLANE(ACIS_Geometry_PLANE *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS PLANE object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Geometry_getseters_PLANE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Geometry_members_PLANE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Geometry_methods_PLANE[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Geometry_type_PLANE = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.PLANE", /* tp_name */ - sizeof(ACIS_Geometry_PLANE), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Geometry_repr_PLANE, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Geometry_str_PLANE, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS PLANE class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Geometry_methods_PLANE, /* tp_methods */ - ACIS_Geometry_members_PLANE, /* tp_members */ - ACIS_Geometry_getseters_PLANE, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Geometry_init_PLANE, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/** - * 3D ACIS Modeler - SPHERE wrapper - */ - -static int -ACIS_Geometry_init_SPHERE(ACIS_Geometry_SPHERE *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *) self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Geometry_repr_SPHERE(ACIS_Geometry_SPHERE *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int) PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS SPHERE object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Geometry_str_SPHERE(ACIS_Geometry_SPHERE *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS SPHERE object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Geometry_getseters_SPHERE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Geometry_members_SPHERE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Geometry_methods_SPHERE[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Geometry_type_SPHERE = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.SPHERE", /* tp_name */ - sizeof(ACIS_Geometry_SPHERE), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Geometry_repr_SPHERE, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Geometry_str_SPHERE, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS SPHERE class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Geometry_methods_SPHERE, /* tp_methods */ - ACIS_Geometry_members_SPHERE, /* tp_members */ - ACIS_Geometry_getseters_SPHERE, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Geometry_init_SPHERE, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/** - * 3D ACIS Modeler - SPLINE wrapper - */ - -static int -ACIS_Geometry_init_SPLINE(ACIS_Geometry_SPLINE *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *) self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Geometry_repr_SPLINE(ACIS_Geometry_SPLINE *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int) PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS SPLINE object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Geometry_str_SPLINE(ACIS_Geometry_SPLINE *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS SPLINE object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Geometry_getseters_SPLINE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Geometry_members_SPLINE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Geometry_methods_SPLINE[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Geometry_type_SPLINE = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.SPLINE", /* tp_name */ - sizeof(ACIS_Geometry_SPLINE), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Geometry_repr_SPLINE, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Geometry_str_SPLINE, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS SPLINE class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Geometry_methods_SPLINE, /* tp_methods */ - ACIS_Geometry_members_SPLINE, /* tp_members */ - ACIS_Geometry_getseters_SPLINE, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Geometry_init_SPLINE, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/** - * 3D ACIS Modeler - TORUS wrapper - */ - -static int -ACIS_Geometry_init_TORUS(ACIS_Geometry_TORUS *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *) self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Geometry_repr_TORUS(ACIS_Geometry_TORUS *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int) PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS TORUS object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Geometry_str_TORUS(ACIS_Geometry_TORUS *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS TORUS object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Geometry_getseters_TORUS[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Geometry_members_TORUS[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Geometry_methods_TORUS[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Geometry_type_TORUS = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.TORUS", /* tp_name */ - sizeof(ACIS_Geometry_TORUS), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Geometry_repr_TORUS, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Geometry_str_TORUS, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS TORUS class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Geometry_methods_TORUS, /* tp_methods */ - ACIS_Geometry_members_TORUS, /* tp_members */ - ACIS_Geometry_getseters_TORUS, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Geometry_init_TORUS, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/* - * Python Module Definitions - */ - -// Module documentation can be accessible via __doc__ -const char *module_name = "Geometry"; -const char *module_documentation = "Contains 3D ACIS Modeler geometry objects, such as SURFACE, CONE, TORUS, etc."; - -static PyModuleDef - ACIS_Geometry_module = - { - PyModuleDef_HEAD_INIT, - module_name, - module_documentation, - -1, - NULL, NULL, NULL, NULL, NULL - }; - -PyMODINIT_FUNC -PyInit_Geometry(void) -{ - // Create a Python module, ACIS.Geometry - PyObject *m; - m = PyModule_Create(&ACIS_Geometry_module); - if (m == NULL) - return NULL; - - // Add SURFACE to the Geometry module - ACIS_Geometry_type_SURFACE.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Geometry_type_SURFACE) < 0) - return NULL; - Py_INCREF(&ACIS_Geometry_type_SURFACE); - PyModule_AddObject(m, "SURFACE", (PyObject *) &ACIS_Geometry_type_SURFACE); - - // Add CONE to the Geometry module - ACIS_Geometry_type_CONE.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Geometry_type_CONE) < 0) - return NULL; - Py_INCREF(&ACIS_Geometry_type_CONE); - PyModule_AddObject(m, "CONE", (PyObject *) &ACIS_Geometry_type_CONE); - - // Add PLANE to the Geometry module - ACIS_Geometry_type_PLANE.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Geometry_type_PLANE) < 0) - return NULL; - Py_INCREF(&ACIS_Geometry_type_PLANE); - PyModule_AddObject(m, "PLANE", (PyObject *) &ACIS_Geometry_type_PLANE); - - // Add SPHERE to the Geometry module - ACIS_Geometry_type_SPHERE.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Geometry_type_SPHERE) < 0) - return NULL; - Py_INCREF(&ACIS_Geometry_type_SPHERE); - PyModule_AddObject(m, "SPHERE", (PyObject *) &ACIS_Geometry_type_SPHERE); - - // Add SPLINE to the Geometry module - ACIS_Geometry_type_SPLINE.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Geometry_type_SPLINE) < 0) - return NULL; - Py_INCREF(&ACIS_Geometry_type_SPLINE); - PyModule_AddObject(m, "SPLINE", (PyObject *) &ACIS_Geometry_type_SPLINE); - - // Add TORUS to the Geometry module - ACIS_Geometry_type_TORUS.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Geometry_type_TORUS) < 0) - return NULL; - Py_INCREF(&ACIS_Geometry_type_TORUS); - PyModule_AddObject(m, "TORUS", (PyObject *) &ACIS_Geometry_type_TORUS); - - // Return the module and all included objects - return m; -} - -PyObject *_ACIS_new_SURFACE() -{ - return PyObject_CallObject((PyObject *) &ACIS_Geometry_type_SURFACE, NULL); -} - -bool _ACIS_check_SURFACE(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Geometry_type_SURFACE; -} - -PyObject *_ACIS_new_CONE() -{ - return PyObject_CallObject((PyObject *) &ACIS_Geometry_type_CONE, NULL); -} - -bool _ACIS_check_CONE(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Geometry_type_CONE; -} - -PyObject *_ACIS_new_PLANE() -{ - return PyObject_CallObject((PyObject *) &ACIS_Geometry_type_PLANE, NULL); -} - -bool _ACIS_check_PLANE(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Geometry_type_PLANE; -} - -PyObject *_ACIS_new_SPHERE() -{ - return PyObject_CallObject((PyObject *) &ACIS_Geometry_type_SPHERE, NULL); -} - -bool _ACIS_check_SPHERE(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Geometry_type_SPHERE; -} - -PyObject *_ACIS_new_SPLINE() -{ - return PyObject_CallObject((PyObject *) &ACIS_Geometry_type_SPLINE, NULL); -} - -bool _ACIS_check_SPLINE(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Geometry_type_SPLINE; -} - -PyObject *_ACIS_new_TORUS() -{ - return PyObject_CallObject((PyObject *) &ACIS_Geometry_type_TORUS, NULL); -} - -bool _ACIS_check_TORUS(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Geometry_type_TORUS; -} diff --git a/src/acis_geometry.h b/src/acis_geometry.h deleted file mode 100644 index d73d786..0000000 --- a/src/acis_geometry.h +++ /dev/null @@ -1,100 +0,0 @@ -/** - * - * Python 3 wrapper module for Spatial Corporation's 3D ACIS Modeler - * - * ACIS and SAT are registered trademarks of Spatial Corporation. - * - * The Python module is developed by Onur R. Bingol and released under MIT license. - * Please see the LICENSE file for details. - * - */ - -#ifndef ACIS_GEOMETRY_H -#define ACIS_GEOMETRY_H - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "acis_topology.h" - -#include "acis_geometry_export.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -// Types and their functions - -// Define SURFACE -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Geometry_SURFACE; - -PyObject ACIS_GEOMETRY_EXPORT *_ACIS_new_SURFACE(); - -bool ACIS_GEOMETRY_EXPORT _ACIS_check_SURFACE(PyObject *ob); - -// Define CONE -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Geometry_CONE; - -PyObject ACIS_GEOMETRY_EXPORT *_ACIS_new_CONE(); - -bool ACIS_GEOMETRY_EXPORT _ACIS_check_CONE(PyObject *ob); - -// Define PLANE -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Geometry_PLANE; - -PyObject ACIS_GEOMETRY_EXPORT *_ACIS_new_PLANE(); - -bool ACIS_GEOMETRY_EXPORT _ACIS_check_PLANE(PyObject *ob); - -// Define SPHERE -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Geometry_SPHERE; - -PyObject ACIS_GEOMETRY_EXPORT *_ACIS_new_SPHERE(); - -bool ACIS_GEOMETRY_EXPORT _ACIS_check_SPHERE(PyObject *ob); - -// Define SPLINE -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Geometry_SPLINE; - -PyObject ACIS_GEOMETRY_EXPORT *_ACIS_new_SPLINE(); - -bool ACIS_GEOMETRY_EXPORT _ACIS_check_SPLINE(PyObject *ob); - -// Define TORUS -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Geometry_TORUS; - -PyObject ACIS_GEOMETRY_EXPORT *_ACIS_new_TORUS(); - -bool ACIS_GEOMETRY_EXPORT _ACIS_check_TORUS(PyObject *ob); - -#ifdef __cplusplus -} -#endif - -#endif // !ACIS_GEOMETRY_H diff --git a/src/acis_lists.cpp b/src/acis_lists.cpp index 37be677..ae16b51 100644 --- a/src/acis_lists.cpp +++ b/src/acis_lists.cpp @@ -79,7 +79,7 @@ ACIS_Lists_method_ENTITY_LIST_add(ACIS_Lists_ENTITY_LIST *self, PyObject *arg) else { // This function returns the added ENTITY's index number - index = self->_acis_obj->add(((ACIS_Topology_ENTITY *) arg)->_acis_obj); + index = self->_acis_obj->add(((ACIS_Entity_ENTITY *) arg)->_acis_obj); } // Treat arg as a borrowed reference @@ -128,7 +128,7 @@ ACIS_Lists_method_ENTITY_LIST_remove(ACIS_Lists_ENTITY_LIST *self, PyObject *arg else { // This function returns the removed ENTITY's index number - index = self->_acis_obj->remove(((ACIS_Topology_ENTITY *) arg)->_acis_obj); + index = self->_acis_obj->remove(((ACIS_Entity_ENTITY *) arg)->_acis_obj); } // Treat arg as a borrowed reference @@ -176,7 +176,7 @@ ACIS_Lists_method_ENTITY_LIST_lookup(ACIS_Lists_ENTITY_LIST *self, PyObject *arg return NULL; } - int index = self->_acis_obj->lookup(((ACIS_Topology_ENTITY *) arg)->_acis_obj); + int index = self->_acis_obj->lookup(((ACIS_Entity_ENTITY *) arg)->_acis_obj); // Treat arg as a borrowed reference Py_DECREF(arg); @@ -196,7 +196,7 @@ ACIS_Lists_method_ENTITY_LIST_first(ACIS_Lists_ENTITY_LIST *self) { PyObject *retobj = _ACIS_new_ENTITY(); ENTITY *_elem = self->_acis_obj->first(); - ((ACIS_Topology_ENTITY *) retobj)->_acis_obj = _elem; + ((ACIS_Entity_ENTITY *) retobj)->_acis_obj = _elem; return retobj; } @@ -205,7 +205,7 @@ ACIS_Lists_method_ENTITY_LIST_next(ACIS_Lists_ENTITY_LIST *self) { PyObject *retobj = _ACIS_new_ENTITY(); ENTITY *_elem = self->_acis_obj->next(); - ((ACIS_Topology_ENTITY *) retobj)->_acis_obj = _elem; + ((ACIS_Entity_ENTITY *) retobj)->_acis_obj = _elem; return retobj; } @@ -223,7 +223,7 @@ ACIS_Lists_method_ENTITY_LIST_next_from(ACIS_Lists_ENTITY_LIST *self, PyObject * PyObject *retobj = _ACIS_new_ENTITY(); ENTITY *_elem = self->_acis_obj->next_from(_from_index); - ((ACIS_Topology_ENTITY *) retobj)->_acis_obj = _elem; + ((ACIS_Entity_ENTITY *) retobj)->_acis_obj = _elem; Py_DECREF(arg); diff --git a/src/acis_lists.h b/src/acis_lists.h index 57488af..694bcd0 100644 --- a/src/acis_lists.h +++ b/src/acis_lists.h @@ -17,7 +17,7 @@ #include -#include "acis_topology.h" +#include "acis_entity.h" #include "acis_lists_export.h" diff --git a/src/acis_modeler.cpp b/src/acis_modeler.cpp index 41bf4bf..672af2f 100644 --- a/src/acis_modeler.cpp +++ b/src/acis_modeler.cpp @@ -219,7 +219,7 @@ ACIS_api_solid_block(PyObject *self, PyObject *args, PyObject *kwargs) // Convert PyObject to ACIS objects SPAposition *_pt1 = ((ACIS_GeometricAtoms_SPAposition *) input_pt1)->_acis_obj; SPAposition *_pt2 = ((ACIS_GeometricAtoms_SPAposition *) input_pt2)->_acis_obj; - BODY *&_block = (BODY *&) ((ACIS_Topology_BODY *) input_block)->base_obj._acis_obj; + BODY *&_block = (BODY *&) ((ACIS_Entity_BODY *) input_block)->base_obj._acis_obj; // Call ACIS API result = api_solid_block(*_pt1, *_pt2, _block); @@ -263,7 +263,7 @@ ACIS_api_make_cuboid(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN // Convert PyObject to ACIS objects - BODY *&_body = (BODY *&) ((ACIS_Topology_BODY *) input_body)->base_obj._acis_obj; + BODY *&_body = (BODY *&) ((ACIS_Entity_BODY *) input_body)->base_obj._acis_obj; // Call ACIS API result = api_make_cuboid(input_x, input_y, input_z, _body); @@ -308,7 +308,7 @@ ACIS_api_make_frustum(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN // Convert PyObject to ACIS objects - BODY *&_frust = (BODY *&) ((ACIS_Topology_BODY *) input_frust)->base_obj._acis_obj; + BODY *&_frust = (BODY *&) ((ACIS_Entity_BODY *) input_frust)->base_obj._acis_obj; // Call ACIS API result = api_make_frustum(input_height, input_radius1, input_radius2, input_top, _frust); @@ -354,7 +354,7 @@ ACIS_api_make_prism(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN // Convert PyObject to ACIS objects - BODY *&_prism = (BODY *&) ((ACIS_Topology_BODY *) input_prism)->base_obj._acis_obj; + BODY *&_prism = (BODY *&) ((ACIS_Entity_BODY *) input_prism)->base_obj._acis_obj; // Call ACIS API result = api_make_prism(input_height, input_radius1, input_radius2, input_nsides, _prism); @@ -401,7 +401,7 @@ ACIS_api_make_pyramid(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN // Convert PyObject to ACIS objects - BODY *&_pyramid = (BODY *&) ((ACIS_Topology_BODY *) input_pyramid)->base_obj._acis_obj; + BODY *&_pyramid = (BODY *&) ((ACIS_Entity_BODY *) input_pyramid)->base_obj._acis_obj; // Call ACIS API result = api_make_pyramid(input_height, input_radius1, input_radius2, input_top, input_nsides, _pyramid); @@ -443,7 +443,7 @@ ACIS_api_make_sphere(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN // Convert PyObject to ACIS objects - BODY *&_sph = (BODY *&) ((ACIS_Topology_BODY *) input_sph)->base_obj._acis_obj; + BODY *&_sph = (BODY *&) ((ACIS_Entity_BODY *) input_sph)->base_obj._acis_obj; // Call ACIS API result = api_make_sphere(input_radius, _sph); @@ -486,7 +486,7 @@ ACIS_api_make_torus(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN // Convert PyObject to ACIS objects - BODY *&_tor = (BODY *&) ((ACIS_Topology_BODY *) input_tor)->base_obj._acis_obj; + BODY *&_tor = (BODY *&) ((ACIS_Entity_BODY *) input_tor)->base_obj._acis_obj; // Call ACIS API result = api_make_torus(input_major_r, input_minor_r, _tor); @@ -533,7 +533,7 @@ ACIS_api_apply_transf(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN // Convert PyObject to ACIS objects - ENTITY *&_entity = ((ACIS_Topology_BODY *) input_entity)->base_obj._acis_obj; + ENTITY *&_entity = ((ACIS_Entity_BODY *) input_entity)->base_obj._acis_obj; SPAtransf *&_trans = ((ACIS_GeometricAtoms_SPAtransf *) input_trans)->_acis_obj; // Call ACIS API @@ -574,7 +574,7 @@ ACIS_api_remove_transf(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN // Convert PyObject to ACIS objects - ENTITY *&_entity = ((ACIS_Topology_BODY *) input_entity)->base_obj._acis_obj; + ENTITY *&_entity = ((ACIS_Entity_BODY *) input_entity)->base_obj._acis_obj; // Call ACIS API result = api_remove_transf(_entity); @@ -621,8 +621,8 @@ ACIS_api_unite(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN // Convert PyObject to ACIS objects - BODY *&_tool = (BODY *&) ((ACIS_Topology_BODY *) input_tool)->base_obj._acis_obj; - BODY *&_blank = (BODY *&) ((ACIS_Topology_BODY *) input_blank)->base_obj._acis_obj; + BODY *&_tool = (BODY *&) ((ACIS_Entity_BODY *) input_tool)->base_obj._acis_obj; + BODY *&_blank = (BODY *&) ((ACIS_Entity_BODY *) input_blank)->base_obj._acis_obj; // Call ACIS API result = api_unite(_tool, _blank); @@ -677,8 +677,8 @@ ACIS_api_intersect(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN // Convert PyObject to ACIS objects - BODY *&_tool = (BODY *&) ((ACIS_Topology_BODY *) input_tool)->base_obj._acis_obj; - BODY *&_blank = (BODY *&) ((ACIS_Topology_BODY *) input_blank)->base_obj._acis_obj; + BODY *&_tool = (BODY *&) ((ACIS_Entity_BODY *) input_tool)->base_obj._acis_obj; + BODY *&_blank = (BODY *&) ((ACIS_Entity_BODY *) input_blank)->base_obj._acis_obj; // Call ACIS API result = api_intersect(_tool, _blank); @@ -733,8 +733,8 @@ ACIS_api_subtract(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN // Convert PyObject to ACIS objects - BODY *&_tool = (BODY *&) ((ACIS_Topology_BODY *) input_tool)->base_obj._acis_obj; - BODY *&_blank = (BODY *&) ((ACIS_Topology_BODY *) input_blank)->base_obj._acis_obj; + BODY *&_tool = (BODY *&) ((ACIS_Entity_BODY *) input_tool)->base_obj._acis_obj; + BODY *&_blank = (BODY *&) ((ACIS_Entity_BODY *) input_blank)->base_obj._acis_obj; // Call ACIS API result = api_subtract(_tool, _blank); @@ -789,8 +789,8 @@ ACIS_api_imprint(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN // Convert PyObject to ACIS objects - BODY *&_tool = (BODY *&) ((ACIS_Topology_BODY *) input_tool)->base_obj._acis_obj; - BODY *&_blank = (BODY *&) ((ACIS_Topology_BODY *) input_blank)->base_obj._acis_obj; + BODY *&_tool = (BODY *&) ((ACIS_Entity_BODY *) input_tool)->base_obj._acis_obj; + BODY *&_blank = (BODY *&) ((ACIS_Entity_BODY *) input_blank)->base_obj._acis_obj; // Call ACIS API result = api_imprint(_tool, _blank); @@ -849,12 +849,12 @@ ACIS_api_sheet_from_ff(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN - FACE *&_face = (FACE *&) ((ACIS_Topology_FACE *) faceobj)->base_obj._acis_obj; + FACE *&_face = (FACE *&) ((ACIS_Entity_FACE *) faceobj)->base_obj._acis_obj; FACE *_faces[1]; _faces[0] = _face; - BODY *&_body = (BODY *&) ((ACIS_Topology_BODY *) input_body)->base_obj._acis_obj; + BODY *&_body = (BODY *&) ((ACIS_Entity_BODY *) input_body)->base_obj._acis_obj; result = api_sheet_from_ff(1, _faces, _body); diff --git a/src/acis_modeler.h b/src/acis_modeler.h index 4872ea5..338fd13 100644 --- a/src/acis_modeler.h +++ b/src/acis_modeler.h @@ -19,7 +19,7 @@ #include #include -#include "acis_topology.h" +#include "acis_entity.h" #include "acis_geometric_atoms.h" #include "acis_saverestore.h" #include "acis_lists.h" diff --git a/src/acis_query.cpp b/src/acis_query.cpp index 31b68f1..5a84d17 100644 --- a/src/acis_query.cpp +++ b/src/acis_query.cpp @@ -24,7 +24,7 @@ ACIS_Query_method_get_owner_transf(PyObject *self, PyObject *args, PyObject *kwa } // Get the ACIS object from the user input - ENTITY *&_ent = ((ACIS_Topology_ENTITY *) input_ent)->_acis_obj; + ENTITY *&_ent = ((ACIS_Entity_ENTITY *) input_ent)->_acis_obj; // Execute ACIS function SPAtransf retval = get_owner_transf(_ent); @@ -69,7 +69,7 @@ ACIS_api_get_faces(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN // Get the ACIS objects from the user input - ENTITY *&_ent = ((ACIS_Topology_ENTITY *) input_ent)->_acis_obj; + ENTITY *&_ent = ((ACIS_Entity_ENTITY *) input_ent)->_acis_obj; ENTITY_LIST *&_face_list = ((ACIS_Lists_ENTITY_LIST *) input_ent_list)->_acis_obj; // Call ACIS function @@ -123,7 +123,7 @@ ACIS_api_get_edges(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN // Get the ACIS objects from the user input - ENTITY *&_ent = ((ACIS_Topology_ENTITY *) input_ent)->_acis_obj; + ENTITY *&_ent = ((ACIS_Entity_ENTITY *) input_ent)->_acis_obj; ENTITY_LIST *&_edge_list = ((ACIS_Lists_ENTITY_LIST *) input_ent_list)->_acis_obj; // Call ACIS function diff --git a/src/acis_query.h b/src/acis_query.h index d103d17..e176d95 100644 --- a/src/acis_query.h +++ b/src/acis_query.h @@ -16,7 +16,7 @@ #include -#include "acis_topology.h" +#include "acis_entity.h" #include "acis_geometric_atoms.h" #include "acis_lists.h" #include "utilities.h" diff --git a/src/acis_sweeping.cpp b/src/acis_sweeping.cpp index 61df954..89f6e65 100644 --- a/src/acis_sweeping.cpp +++ b/src/acis_sweeping.cpp @@ -291,7 +291,7 @@ ACIS_api_make_sweep_path(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN - EDGE *&_path = (EDGE *&) ((ACIS_Topology_EDGE *) input_path)->base_obj._acis_obj; + EDGE *&_path = (EDGE *&) ((ACIS_Entity_EDGE *) input_path)->base_obj._acis_obj; // Don't use make_sweep_path_options for now result = api_make_sweep_path(_pts, _path); @@ -350,7 +350,7 @@ ACIS_api_sweep_with_options(PyObject *self, PyObject *args, PyObject *kwargs) API_BEGIN - ENTITY *&_ent = (ENTITY *&) ((ACIS_Topology_ENTITY *) input_arg1)->_acis_obj; + ENTITY *&_ent = (ENTITY *&) ((ACIS_Entity_ENTITY *) input_arg1)->_acis_obj; // Check if we are using the sweep along the axis overload if (input_arg5 != NULL) @@ -382,7 +382,7 @@ ACIS_api_sweep_with_options(PyObject *self, PyObject *args, PyObject *kwargs) SPAposition *&_root = (SPAposition *&) ((ACIS_GeometricAtoms_SPAposition *) input_arg2)->_acis_obj; SPAvector *&_axis = (SPAvector *&) ((ACIS_GeometricAtoms_SPAvector *) input_arg3)->_acis_obj; sweep_options *&_opts = (sweep_options *&) ((ACIS_Sweeping_SweepOptions *) input_arg4)->_acis_obj; - BODY *&_new_body = (BODY *&) ((ACIS_Topology_BODY *) input_arg5)->base_obj._acis_obj; + BODY *&_new_body = (BODY *&) ((ACIS_Entity_BODY *) input_arg5)->base_obj._acis_obj; // Call ACIS Sweeping API result = api_sweep_with_options(_ent, *_root, *_axis, _opts, _new_body); @@ -406,12 +406,12 @@ ACIS_api_sweep_with_options(PyObject *self, PyObject *args, PyObject *kwargs) return NULL; } - BODY *&_new_body = (BODY *&) ((ACIS_Topology_BODY *) input_arg4)->base_obj._acis_obj; + BODY *&_new_body = (BODY *&) ((ACIS_Entity_BODY *) input_arg4)->base_obj._acis_obj; // Check for sweeping along a given edge or a wire overload if (_ACIS_check_ENTITY(input_arg2)) { - ENTITY *&_path = (ENTITY *&) ((ACIS_Topology_ENTITY *) input_arg2)->_acis_obj; + ENTITY *&_path = (ENTITY *&) ((ACIS_Entity_ENTITY *) input_arg2)->_acis_obj; // Call ACIS Sweeping API result = api_sweep_with_options(_ent, _path, _opts, _new_body); diff --git a/src/acis_sweeping.h b/src/acis_sweeping.h index 2fd2c29..0a5d9da 100644 --- a/src/acis_sweeping.h +++ b/src/acis_sweeping.h @@ -20,7 +20,7 @@ #include #include -#include "acis_topology.h" +#include "acis_entity.h" #include "acis_geometric_atoms.h" #include "utilities.h" diff --git a/src/acis_topology.cpp b/src/acis_topology.cpp deleted file mode 100644 index d134731..0000000 --- a/src/acis_topology.cpp +++ /dev/null @@ -1,1423 +0,0 @@ -#include "acis_topology.h" - - -/** - * 3D ACIS Modeler - ENTITY wrapper - */ - -int -ACIS_Topology_traverse_ENTITY(ACIS_Topology_ENTITY *self, visitproc visit, void *arg) -{ - // Use Py_VISIT macro for PyObject-type variables - Py_VISIT(self->attrib_name); - Py_VISIT(self->attrib_object_id); - - return 0; -} - -int -ACIS_Topology_clear_ENTITY(ACIS_Topology_ENTITY *self) -{ - // Set ACIS object to NULL to allow it automatically deleted by ACIS memory manager - //self->_acis_obj = NULL; - - // Use Py_CLEAR macro for PyObject variables - Py_CLEAR(self->attrib_name); - Py_CLEAR(self->attrib_object_id); - - return 0; -} - -void -ACIS_Topology_dealloc_ENTITY(ACIS_Topology_ENTITY *self) -{ - ACIS_Topology_clear_ENTITY(self); - Py_TYPE(self)->tp_free((PyObject *) self); -} - -PyObject * -ACIS_Topology_new_ENTITY(PyTypeObject *type, PyObject *args, PyObject *kwargs) -{ - // First check if the modeler has been started - if(!is_modeler_started()) - { - PyErr_SetString(PyExc_RuntimeError, "ACIS is not running!"); - return NULL; - } - - ACIS_Topology_ENTITY *self; - - self = (ACIS_Topology_ENTITY *) type->tp_alloc(type, 0); - if (self != NULL) - { - self->attrib_name = PyUnicode_FromString(""); - if (self->attrib_name == NULL) - { - Py_DECREF(self); - return NULL; - } - - self->attrib_object_id = PyLong_FromLong(-1L); - if (self->attrib_object_id == NULL) - { - Py_DECREF(self); - return NULL; - } - - // Just getting rid of the dangling pointer - self->_acis_obj = NULL; - } - - return (PyObject *) self; -} - -int -ACIS_Topology_init_ENTITY(ACIS_Topology_ENTITY *self, PyObject *args, PyObject *kwargs) -{ -// PyObject *input_name = NULL; -// PyObject *input_id = NULL; -// PyObject *tmp; -// -// static char *kwlist[] = -// { -// (char *) "name", -// (char *) "id", -// NULL -// }; -// -// if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO", kwlist, &input_name, &input_id)) -// return -1; -// -// if (input_name != NULL) -// { -// if (!PyUnicode_Check(input_name)) -// { -// PyErr_SetString(PyExc_ValueError, "The first argument (name) must be a string"); -// return -1; -// } -// -// tmp = self->attrib_name; -// Py_INCREF(input_name); -// self->attrib_name = input_name; -// Py_XDECREF(tmp); -// } else -// { -// // Set name to an empty string -// self->attrib_name = PyUnicode_FromString(""); -// } -// -// if (input_id != NULL) -// { -// if (!PyLong_Check(input_id)) -// { -// PyErr_SetString(PyExc_ValueError, "The second argument (id) must be an integer"); -// return -1; -// } -// -// tmp = self->attrib_object_id; -// Py_INCREF(input_id); -// self->attrib_object_id = input_id; -// Py_XDECREF(tmp); -// } else -// { -// // Set object id to zero -// self->attrib_object_id = PyLong_FromLong(-1L); -// } - - return 0; -} - -PyObject * -ACIS_Topology_repr_ENTITY(ACIS_Topology_ENTITY *self) -{ - const char *_name = PyUnicode_AsUTF8(self->attrib_name); - int _id = (int)PyLong_AsLong(self->attrib_object_id); - return PyUnicode_FromFormat("ACIS ENTITY object with name '%s' and ID '%i'", _name, _id); -} - -PyObject * -ACIS_Topology_str_ENTITY(ACIS_Topology_ENTITY *self) -{ - const char *acis_obj_status = NULL; - if (self->_acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS ENTITY object (%s)", acis_obj_status); -} - -PyObject * -ACIS_Topology_method_ENTITY_get_attrib_name(ACIS_Topology_ENTITY *self, PyObject *value, void *closure) -{ - Py_INCREF(self->attrib_name); - return self->attrib_name; -} - -int -ACIS_Topology_method_ENTITY_set_attrib_name(ACIS_Topology_ENTITY *self, PyObject *value, void *closure) -{ - if (value == NULL) - { - PyErr_SetString(PyExc_TypeError, "Cannot delete NAME attribute"); - return -1; - } - - if (!PyUnicode_Check(value)) - { - PyErr_SetString(PyExc_TypeError, "The NAME attribute value must be a str"); - return -1; - } - - Py_DECREF(self->attrib_name); - Py_INCREF(value); - self->attrib_name = value; - - // Extract the C-style string from PyObject - const char *_attrib_data = PyUnicode_AsUTF8(value); - - // Set the attribute of the ACIS object - ATTRIB_GEN_NAME *my_att = (ATTRIB_GEN_NAME *) find_attrib((ENTITY *) self->_acis_obj); - if (my_att != NULL) - { - my_att->lose(); - } - ACIS_NEW ATTRIB_GEN_NAME(self->_acis_obj, _attrib_data); - - return 0; -} - -PyObject * -ACIS_Topology_method_ENTITY_get_attrib_obj_id(ACIS_Topology_ENTITY *self, PyObject *value, void *closure) -{ - Py_INCREF(self->attrib_object_id); - return self->attrib_object_id; -} - -int -ACIS_Topology_method_ENTITY_set_attrib_obj_id(ACIS_Topology_ENTITY *self, PyObject *value, void *closure) -{ - if (value == NULL) - { - PyErr_SetString(PyExc_TypeError, "Cannot delete ID attribute"); - return -1; - } - - if (!PyLong_Check(value)) - { - PyErr_SetString(PyExc_TypeError, "The ID attribute value must be an integer"); - return -1; - } - - Py_DECREF(self->attrib_object_id); - Py_INCREF(value); - self->attrib_object_id = value; - - // Extract the integer value from PyObject - int _attrib_data = (int) PyLong_AsLong(value); - - // Extract the C-style string from PyObject - const char *_attrib_data_name = PyUnicode_AsUTF8(self->attrib_name); - - // Set the attribute of the ACIS object (a named integer attribute) - ATTRIB_GEN_INTEGER *my_att = (ATTRIB_GEN_INTEGER *) find_attrib((ENTITY *) self->_acis_obj); - if (my_att != NULL) - { - my_att->lose(); - } - ACIS_NEW ATTRIB_GEN_INTEGER(self->_acis_obj, _attrib_data_name, _attrib_data); - - return 0; -} - - -/** - * 3D ACIS Modeler - BODY wrapper - */ - -static int -ACIS_Topology_init_BODY(ACIS_Topology_BODY *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Topology_repr_BODY(ACIS_Topology_BODY *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS BODY object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Topology_str_BODY(ACIS_Topology_BODY *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS BODY object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Topology_getseters_BODY[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Topology_members_BODY[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Topology_methods_BODY[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Topology_type_BODY = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.BODY", /* tp_name */ - sizeof(ACIS_Topology_BODY), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Topology_repr_BODY, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Topology_str_BODY, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS BODY class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Topology_methods_BODY, /* tp_methods */ - ACIS_Topology_members_BODY, /* tp_members */ - ACIS_Topology_getseters_BODY, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Topology_init_BODY, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/** - * 3D ACIS Modeler - FACE wrapper - */ - -static int -ACIS_Topology_init_FACE(ACIS_Topology_FACE *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Topology_repr_FACE(ACIS_Topology_FACE *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS FACE object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Topology_str_FACE(ACIS_Topology_FACE *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS FACE object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Topology_getseters_FACE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Topology_members_FACE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Topology_methods_FACE[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Topology_type_FACE = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.FACE", /* tp_name */ - sizeof(ACIS_Topology_FACE), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Topology_repr_FACE, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Topology_str_FACE, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS FACE class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Topology_methods_FACE, /* tp_methods */ - ACIS_Topology_members_FACE, /* tp_members */ - ACIS_Topology_getseters_FACE, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Topology_init_FACE, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/** - * 3D ACIS Modeler - EDGE wrapper - */ - -static int -ACIS_Topology_init_EDGE(ACIS_Topology_EDGE *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Topology_repr_EDGE(ACIS_Topology_EDGE *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS EDGE object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Topology_str_EDGE(ACIS_Topology_EDGE *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS EDGE object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Topology_getseters_EDGE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Topology_members_EDGE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Topology_methods_EDGE[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Topology_type_EDGE = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.EDGE", /* tp_name */ - sizeof(ACIS_Topology_EDGE), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Topology_repr_EDGE, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Topology_str_EDGE, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS EDGE class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Topology_methods_EDGE, /* tp_methods */ - ACIS_Topology_members_EDGE, /* tp_members */ - ACIS_Topology_getseters_EDGE, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Topology_init_EDGE, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/** - * 3D ACIS Modeler - WIRE wrapper - */ - -static int -ACIS_Topology_init_WIRE(ACIS_Topology_WIRE *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Topology_repr_WIRE(ACIS_Topology_WIRE *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS WIRE object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Topology_str_WIRE(ACIS_Topology_WIRE *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS WIRE object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Topology_getseters_WIRE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Topology_members_WIRE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Topology_methods_WIRE[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Topology_type_WIRE = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.WIRE", /* tp_name */ - sizeof(ACIS_Topology_WIRE), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Topology_repr_WIRE, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Topology_str_WIRE, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS WIRE class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Topology_methods_WIRE, /* tp_methods */ - ACIS_Topology_members_WIRE, /* tp_members */ - ACIS_Topology_getseters_WIRE, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Topology_init_WIRE, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/** - * 3D ACIS Modeler - LUMP wrapper - */ - -static int -ACIS_Topology_init_LUMP(ACIS_Topology_LUMP *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Topology_repr_LUMP(ACIS_Topology_LUMP *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS LUMP object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Topology_str_LUMP(ACIS_Topology_LUMP *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS LUMP object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Topology_getseters_LUMP[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Topology_members_LUMP[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Topology_methods_LUMP[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Topology_type_LUMP = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.LUMP", /* tp_name */ - sizeof(ACIS_Topology_LUMP), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Topology_repr_LUMP, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Topology_str_LUMP, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS LUMP class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Topology_methods_LUMP, /* tp_methods */ - ACIS_Topology_members_LUMP, /* tp_members */ - ACIS_Topology_getseters_LUMP, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Topology_init_LUMP, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/** - * 3D ACIS Modeler - SHELL wrapper - */ - -static int -ACIS_Topology_init_SHELL(ACIS_Topology_SHELL *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Topology_repr_SHELL(ACIS_Topology_SHELL *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS SHELL object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Topology_str_SHELL(ACIS_Topology_SHELL *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS SHELL object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Topology_getseters_SHELL[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Topology_members_SHELL[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Topology_methods_SHELL[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Topology_type_SHELL = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.SHELL", /* tp_name */ - sizeof(ACIS_Topology_SHELL), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Topology_repr_SHELL, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Topology_str_SHELL, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS SHELL class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Topology_methods_SHELL, /* tp_methods */ - ACIS_Topology_members_SHELL, /* tp_members */ - ACIS_Topology_getseters_SHELL, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Topology_init_SHELL, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/** - * 3D ACIS Modeler - SUBSHELL wrapper - */ - -static int -ACIS_Topology_init_SUBSHELL(ACIS_Topology_SUBSHELL *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Topology_repr_SUBSHELL(ACIS_Topology_SUBSHELL *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS SUBSHELL object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Topology_str_SUBSHELL(ACIS_Topology_SUBSHELL *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS SUBSHELL object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Topology_getseters_SUBSHELL[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Topology_members_SUBSHELL[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Topology_methods_SUBSHELL[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Topology_type_SUBSHELL = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.SUBSHELL", /* tp_name */ - sizeof(ACIS_Topology_SUBSHELL), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Topology_repr_SUBSHELL, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Topology_str_SUBSHELL, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS SUBSHELL class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Topology_methods_SUBSHELL, /* tp_methods */ - ACIS_Topology_members_SUBSHELL, /* tp_members */ - ACIS_Topology_getseters_SUBSHELL, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Topology_init_SUBSHELL, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/** - * 3D ACIS Modeler - COEDGE wrapper - */ - -static int -ACIS_Topology_init_COEDGE(ACIS_Topology_COEDGE *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Topology_repr_COEDGE(ACIS_Topology_COEDGE *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS COEDGE object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Topology_str_COEDGE(ACIS_Topology_COEDGE *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS COEDGE object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Topology_getseters_COEDGE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Topology_members_COEDGE[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Topology_methods_COEDGE[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Topology_type_COEDGE = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.COEDGE", /* tp_name */ - sizeof(ACIS_Topology_COEDGE), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Topology_repr_COEDGE, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Topology_str_COEDGE, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS COEDGE class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Topology_methods_COEDGE, /* tp_methods */ - ACIS_Topology_members_COEDGE, /* tp_members */ - ACIS_Topology_getseters_COEDGE, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Topology_init_COEDGE, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/** - * 3D ACIS Modeler - LOOP wrapper - */ - -static int -ACIS_Topology_init_LOOP(ACIS_Topology_LOOP *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Topology_repr_LOOP(ACIS_Topology_LOOP *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS LOOP object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Topology_str_LOOP(ACIS_Topology_LOOP *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS LOOP object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Topology_getseters_LOOP[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Topology_members_LOOP[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Topology_methods_LOOP[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Topology_type_LOOP = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.LOOP", /* tp_name */ - sizeof(ACIS_Topology_LOOP), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Topology_repr_LOOP, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Topology_str_LOOP, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS LOOP class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Topology_methods_LOOP, /* tp_methods */ - ACIS_Topology_members_LOOP, /* tp_members */ - ACIS_Topology_getseters_LOOP, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Topology_init_LOOP, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/** - * 3D ACIS Modeler - VERTEX wrapper - */ - -static int -ACIS_Topology_init_VERTEX(ACIS_Topology_VERTEX *self, PyObject *args, PyObject *kwargs) -{ - // Initialize the base class - if (ACIS_Topology_type_ENTITY.tp_init((PyObject *)self, args, kwargs) < 0) - return -1; - - return 0; -} - -static PyObject * -ACIS_Topology_repr_VERTEX(ACIS_Topology_VERTEX *self) -{ - const char *_name = PyUnicode_AsUTF8(self->base_obj.attrib_name); - int _id = (int)PyLong_AsLong(self->base_obj.attrib_object_id); - return PyUnicode_FromFormat("ACIS VERTEX object with name '%s' and ID '%i'", _name, _id); -} - -static PyObject * -ACIS_Topology_str_VERTEX(ACIS_Topology_VERTEX *self) -{ - const char *acis_obj_status = NULL; - if (self->base_obj._acis_obj == NULL) - acis_obj_status = "Empty"; - else - acis_obj_status = "Valid"; - - return PyUnicode_FromFormat("ACIS VERTEX object (%s)", acis_obj_status); -} - -static PyGetSetDef - ACIS_Topology_getseters_VERTEX[] = - { - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Topology_members_VERTEX[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Topology_methods_VERTEX[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Topology_type_VERTEX = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.VERTEX", /* tp_name */ - sizeof(ACIS_Topology_VERTEX), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Topology_repr_VERTEX, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Topology_str_VERTEX, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "ACIS VERTEX class", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Topology_methods_VERTEX, /* tp_methods */ - ACIS_Topology_members_VERTEX, /* tp_members */ - ACIS_Topology_getseters_VERTEX, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Topology_init_VERTEX, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - }; - - -/* - * Python Module Definitions - */ - -// Module documentation can be accessible via __doc__ -const char *module_name = "Topology"; -const char *module_documentation = "Contains 3D ACIS Modeler topology objects, such as BODY, FACE, WIRE, etc."; - -static PyModuleDef - ACIS_Topology_module = - { - PyModuleDef_HEAD_INIT, - module_name, - module_documentation, - -1, - NULL, NULL, NULL, NULL, NULL - }; - -PyMODINIT_FUNC -PyInit_Topology(void) -{ - // Create a Python module, ACIS.Topology - PyObject *m; - m = PyModule_Create(&ACIS_Topology_module); - if (m == NULL) - return NULL; - - // Add ENTITY to the Topology module - if (PyType_Ready(&ACIS_Topology_type_ENTITY) < 0) - return NULL; - Py_INCREF(&ACIS_Topology_type_ENTITY); - PyModule_AddObject(m, "ENTITY", (PyObject *) &ACIS_Topology_type_ENTITY); - - // Add BODY to the Topology module - ACIS_Topology_type_BODY.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Topology_type_BODY) < 0) - return NULL; - Py_INCREF(&ACIS_Topology_type_BODY); - PyModule_AddObject(m, "BODY", (PyObject *) &ACIS_Topology_type_BODY); - - // Add FACE to the Topology module - ACIS_Topology_type_FACE.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Topology_type_FACE) < 0) - return NULL; - Py_INCREF(&ACIS_Topology_type_FACE); - PyModule_AddObject(m, "FACE", (PyObject *) &ACIS_Topology_type_FACE); - - // Add EDGE to the Topology module - ACIS_Topology_type_EDGE.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Topology_type_EDGE) < 0) - return NULL; - Py_INCREF(&ACIS_Topology_type_EDGE); - PyModule_AddObject(m, "EDGE", (PyObject *) &ACIS_Topology_type_EDGE); - - // Add WIRE to the Topology module - ACIS_Topology_type_WIRE.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Topology_type_WIRE) < 0) - return NULL; - Py_INCREF(&ACIS_Topology_type_WIRE); - PyModule_AddObject(m, "WIRE", (PyObject *) &ACIS_Topology_type_WIRE); - - // Add LUMP to the Topology module - ACIS_Topology_type_LUMP.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Topology_type_LUMP) < 0) - return NULL; - Py_INCREF(&ACIS_Topology_type_LUMP); - PyModule_AddObject(m, "LUMP", (PyObject *) &ACIS_Topology_type_LUMP); - - // Add SHELL to the Topology module - ACIS_Topology_type_SHELL.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Topology_type_SHELL) < 0) - return NULL; - Py_INCREF(&ACIS_Topology_type_SHELL); - PyModule_AddObject(m, "SHELL", (PyObject *) &ACIS_Topology_type_SHELL); - - // Add SUBSHELL to the Topology module - ACIS_Topology_type_SUBSHELL.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Topology_type_SUBSHELL) < 0) - return NULL; - Py_INCREF(&ACIS_Topology_type_SUBSHELL); - PyModule_AddObject(m, "SUBSHELL", (PyObject *) &ACIS_Topology_type_SUBSHELL); - - // Add COEDGE to the Topology module - ACIS_Topology_type_COEDGE.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Topology_type_COEDGE) < 0) - return NULL; - Py_INCREF(&ACIS_Topology_type_COEDGE); - PyModule_AddObject(m, "COEDGE", (PyObject *) &ACIS_Topology_type_COEDGE); - - // Add LOOP to the Topology module - ACIS_Topology_type_LOOP.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Topology_type_LOOP) < 0) - return NULL; - Py_INCREF(&ACIS_Topology_type_LOOP); - PyModule_AddObject(m, "LOOP", (PyObject *) &ACIS_Topology_type_LOOP); - - // Add VERTEX to the Topology module - ACIS_Topology_type_VERTEX.tp_base = &ACIS_Topology_type_ENTITY; - if (PyType_Ready(&ACIS_Topology_type_VERTEX) < 0) - return NULL; - Py_INCREF(&ACIS_Topology_type_VERTEX); - PyModule_AddObject(m, "VERTEX", (PyObject *) &ACIS_Topology_type_VERTEX); - - // Return the module and all included objects - return m; -} - -PyObject *_ACIS_new_ENTITY() -{ - return PyObject_CallObject((PyObject *) &ACIS_Topology_type_ENTITY, NULL); -} - -bool _ACIS_check_ENTITY(PyObject *ob) -{ - int retval = PyObject_IsInstance(ob, (PyObject *)&ACIS_Topology_type_ENTITY); - if (retval < 0) - { - PyErr_SetString(PyExc_TypeError, "Problem with ENTITY type cheking"); - return false; - } - return retval != 0; -} - -PyObject *_ACIS_new_BODY() -{ - return PyObject_CallObject((PyObject *) &ACIS_Topology_type_BODY, NULL); -} - -bool _ACIS_check_BODY(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Topology_type_BODY; -} - -PyObject *_ACIS_new_FACE() -{ - return PyObject_CallObject((PyObject *) &ACIS_Topology_type_FACE, NULL); -} - -bool _ACIS_check_FACE(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Topology_type_FACE; -} - -PyObject *_ACIS_new_EDGE() -{ - return PyObject_CallObject((PyObject *) &ACIS_Topology_type_EDGE, NULL); -} - -bool _ACIS_check_EDGE(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Topology_type_EDGE; -} - -PyObject *_ACIS_new_WIRE() -{ - return PyObject_CallObject((PyObject *) &ACIS_Topology_type_WIRE, NULL); -} - -bool _ACIS_check_WIRE(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Topology_type_WIRE; -} - -PyObject *_ACIS_new_LUMP() -{ - return PyObject_CallObject((PyObject *) &ACIS_Topology_type_LUMP, NULL); -} - -bool _ACIS_check_LUMP(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Topology_type_LUMP; -} - -PyObject *_ACIS_new_SHELL() -{ - return PyObject_CallObject((PyObject *) &ACIS_Topology_type_SHELL, NULL); -} - -bool _ACIS_check_SHELL(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Topology_type_SHELL; -} - -PyObject *_ACIS_new_SUBSHELL() -{ - return PyObject_CallObject((PyObject *) &ACIS_Topology_type_SUBSHELL, NULL); -} - -bool _ACIS_check_SUBSHELL(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Topology_type_SUBSHELL; -} - -PyObject *_ACIS_new_COEDGE() -{ - return PyObject_CallObject((PyObject *) &ACIS_Topology_type_COEDGE, NULL); -} - -bool _ACIS_check_COEDGE(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Topology_type_COEDGE; -} - -PyObject *_ACIS_new_LOOP() -{ - return PyObject_CallObject((PyObject *) &ACIS_Topology_type_LOOP, NULL); -} - -bool _ACIS_check_LOOP(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Topology_type_LOOP; -} - -PyObject *_ACIS_new_VERTEX() -{ - return PyObject_CallObject((PyObject *) &ACIS_Topology_type_VERTEX, NULL); -} - -bool _ACIS_check_VERTEX(PyObject *ob) -{ - return Py_TYPE(ob) == &ACIS_Topology_type_VERTEX; -} - -void _ACIS_make_null(PyObject *ob) -{ - if (_ACIS_check_ENTITY(ob)) - { - ((ACIS_Topology_ENTITY *) ob)->_acis_obj = NULL; - } -} diff --git a/src/acis_topology.h b/src/acis_topology.h deleted file mode 100644 index 5d2d875..0000000 --- a/src/acis_topology.h +++ /dev/null @@ -1,247 +0,0 @@ -/** - * - * Python 3 wrapper module for Spatial Corporation's 3D ACIS Modeler - * - * ACIS and SAT are registered trademarks of Spatial Corporation. - * - * The Python module is developed by Onur R. Bingol and released under MIT license. - * Please see the LICENSE file for details. - * - */ - -#ifndef ACIS_TOPOLOGY_H -#define ACIS_TOPOLOGY_H - -#include -#include - -#include "kernapi.hxx" -#include -#include -#include -#include -#include - -#include "acis_topology_export.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -// Types and their functions - -// Define ENTITY as a base class -typedef struct -{ - PyObject_HEAD - ENTITY *_acis_obj; - PyObject *attrib_name; - PyObject *attrib_object_id; -} ACIS_Topology_ENTITY; - -int ACIS_TOPOLOGY_EXPORT ACIS_Topology_traverse_ENTITY(ACIS_Topology_ENTITY *self, visitproc visit, void *arg); - -int ACIS_TOPOLOGY_EXPORT ACIS_Topology_clear_ENTITY(ACIS_Topology_ENTITY *self); - -void ACIS_TOPOLOGY_EXPORT ACIS_Topology_dealloc_ENTITY(ACIS_Topology_ENTITY *self); - -PyObject ACIS_TOPOLOGY_EXPORT *ACIS_Topology_new_ENTITY(PyTypeObject *type, PyObject *args, PyObject *kwargs); - -int ACIS_TOPOLOGY_EXPORT ACIS_Topology_init_ENTITY(ACIS_Topology_ENTITY *self, PyObject *args, PyObject *kwargs); - -PyObject ACIS_TOPOLOGY_EXPORT *ACIS_Topology_repr_ENTITY(ACIS_Topology_ENTITY *self); - -PyObject ACIS_TOPOLOGY_EXPORT *ACIS_Topology_str_ENTITY(ACIS_Topology_ENTITY *self); - -PyObject ACIS_TOPOLOGY_EXPORT *ACIS_Topology_method_ENTITY_get_attrib_name(ACIS_Topology_ENTITY *self, PyObject *value, void *closure); - -int ACIS_TOPOLOGY_EXPORT ACIS_Topology_method_ENTITY_set_attrib_name(ACIS_Topology_ENTITY *self, PyObject *value, void *closure); - -PyObject ACIS_TOPOLOGY_EXPORT *ACIS_Topology_method_ENTITY_get_attrib_obj_id(ACIS_Topology_ENTITY *self, PyObject *value, void *closure); - -int ACIS_TOPOLOGY_EXPORT ACIS_Topology_method_ENTITY_set_attrib_obj_id(ACIS_Topology_ENTITY *self, PyObject *value, void *closure); - -static PyGetSetDef - ACIS_Topology_getseters_ENTITY[] = - { - { (char *) "name", (getter) ACIS_Topology_method_ENTITY_get_attrib_name, (setter) ACIS_Topology_method_ENTITY_set_attrib_name, (char *) "object name", NULL }, - { (char *) "id", (getter) ACIS_Topology_method_ENTITY_get_attrib_obj_id, (setter) ACIS_Topology_method_ENTITY_set_attrib_obj_id, (char *) "object id", NULL }, - { NULL } /* Sentinel */ - }; - -static PyMemberDef - ACIS_Topology_members_ENTITY[] = - { - { NULL } /* Sentinel */ - }; - -static PyMethodDef - ACIS_Topology_methods_ENTITY[] = - { - { NULL } /* Sentinel */ - }; - -static PyTypeObject - ACIS_Topology_type_ENTITY = - { - PyVarObject_HEAD_INIT(NULL, 0) - "ACIS.ENTITY", /* tp_name */ - sizeof(ACIS_Topology_ENTITY), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor) ACIS_Topology_dealloc_ENTITY, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - (reprfunc) ACIS_Topology_repr_ENTITY, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) ACIS_Topology_str_ENTITY, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | - Py_TPFLAGS_BASETYPE | - Py_TPFLAGS_HAVE_GC, /* tp_flags */ - "ACIS ENTITY class", /* tp_doc */ - (traverseproc) ACIS_Topology_traverse_ENTITY, /* tp_traverse */ - (inquiry) ACIS_Topology_clear_ENTITY, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - ACIS_Topology_methods_ENTITY, /* tp_methods */ - ACIS_Topology_members_ENTITY, /* tp_members */ - ACIS_Topology_getseters_ENTITY, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) ACIS_Topology_init_ENTITY, /* tp_init */ - 0, /* tp_alloc */ - ACIS_Topology_new_ENTITY, /* tp_new */ - }; - -PyObject ACIS_TOPOLOGY_EXPORT *_ACIS_new_ENTITY(); - -bool ACIS_TOPOLOGY_EXPORT _ACIS_check_ENTITY(PyObject *ob); - -// Define BODY -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Topology_BODY; - -PyObject ACIS_TOPOLOGY_EXPORT *_ACIS_new_BODY(); - -bool ACIS_TOPOLOGY_EXPORT _ACIS_check_BODY(PyObject *ob); - -// Define FACE -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Topology_FACE; - -PyObject ACIS_TOPOLOGY_EXPORT *_ACIS_new_FACE(); - -bool ACIS_TOPOLOGY_EXPORT _ACIS_check_FACE(PyObject *ob); - -// Define EDGE -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Topology_EDGE; - -PyObject ACIS_TOPOLOGY_EXPORT *_ACIS_new_EDGE(); - -bool ACIS_TOPOLOGY_EXPORT _ACIS_check_EDGE(PyObject *ob); - -// Define WIRE -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Topology_WIRE; - -PyObject ACIS_TOPOLOGY_EXPORT *_ACIS_new_WIRE(); - -bool ACIS_TOPOLOGY_EXPORT _ACIS_check_WIRE(PyObject *ob); - -// Define LUMP -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Topology_LUMP; - -PyObject ACIS_TOPOLOGY_EXPORT *_ACIS_new_LUMP(); - -bool ACIS_TOPOLOGY_EXPORT _ACIS_check_LUMP(PyObject *ob); - -// Define SHELL -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Topology_SHELL; - -PyObject ACIS_TOPOLOGY_EXPORT *_ACIS_new_SHELL(); - -bool ACIS_TOPOLOGY_EXPORT _ACIS_check_SHELL(PyObject *ob); - -// Define SUBSHELL -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Topology_SUBSHELL; - -PyObject ACIS_TOPOLOGY_EXPORT *_ACIS_new_SUBSHELL(); - -bool ACIS_TOPOLOGY_EXPORT _ACIS_check_SUBSHELL(PyObject *ob); - -// Define COEDGE -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Topology_COEDGE; - -PyObject ACIS_TOPOLOGY_EXPORT *_ACIS_new_COEDGE(); - -bool ACIS_TOPOLOGY_EXPORT _ACIS_check_COEDGE(PyObject *ob); - -// Define LOOP -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Topology_LOOP; - -PyObject ACIS_TOPOLOGY_EXPORT *_ACIS_new_LOOP(); - -bool ACIS_TOPOLOGY_EXPORT _ACIS_check_LOOP(PyObject *ob); - -// Define VERTEX -typedef struct -{ - ACIS_Topology_ENTITY base_obj; -} ACIS_Topology_VERTEX; - -PyObject ACIS_TOPOLOGY_EXPORT *_ACIS_new_VERTEX(); - -bool ACIS_TOPOLOGY_EXPORT _ACIS_check_VERTEX(PyObject *ob); - - -// Additional functions - -/** - * Sets the internal ocis_obj variable to NULL - * @param ob Topology object, such as ENTITY, BODY, FACE, etc. - */ -void ACIS_TOPOLOGY_EXPORT _ACIS_make_null(PyObject *ob); - -#ifdef __cplusplus -} -#endif - -#endif // !ACIS_TOPOLOGY_H From d6dd8e31c42c53770c964b2f8da6fbb86943c2ac Mon Sep 17 00:00:00 2001 From: Onur Rauf Bingol Date: Tue, 18 Jul 2017 22:20:13 -0500 Subject: [PATCH 8/9] Updated examples after renames and module combines --- examples/01_generate_solid_block.py | 4 ++-- examples/02_boolean_subtract.py | 10 +++++----- examples/03_sweeping.py | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/01_generate_solid_block.py b/examples/01_generate_solid_block.py index 20d87d2..ddd10e3 100644 --- a/examples/01_generate_solid_block.py +++ b/examples/01_generate_solid_block.py @@ -7,7 +7,7 @@ Please see the LICENSE file for details. """ -from ACIS import Modeler, Licensing, SaveRestore, Topology, Lists, GeometricAtoms +from ACIS import Modeler, Licensing, SaveRestore, Entity, Lists, GeometricAtoms # Start ACIS Modeler Modeler.api_start_modeller(0) @@ -19,7 +19,7 @@ # Generate a simple solid block pt1 = GeometricAtoms.SPAposition(0.0, 0.0, 0.0) pt2 = GeometricAtoms.SPAposition(50.0, 50.0, 25.0) -block = Topology.BODY() +block = Entity.BODY() Modeler.api_solid_block(pt1, pt2, block) diff --git a/examples/02_boolean_subtract.py b/examples/02_boolean_subtract.py index adc134f..f26b287 100644 --- a/examples/02_boolean_subtract.py +++ b/examples/02_boolean_subtract.py @@ -9,7 +9,7 @@ # This example is taken from the book "Rapid Prototyping and Engineering Applications" by Frank W. Liou (Example 5.1) -from ACIS import Modeler, Licensing, SaveRestore, Topology, Lists, GeometricAtoms, GeometricOperators +from ACIS import Modeler, Licensing, SaveRestore, Entity, Lists, GeometricAtoms # Start ACIS Modeler Modeler.api_start_modeller(0) @@ -19,21 +19,21 @@ Licensing.spa_unlock_products(unlock_key) # Make a cuboid -block = Topology.BODY() +block = Entity.BODY() Modeler.api_make_cuboid(150, 75, 25, block) # Generate and apply transformation to the cuboid block_vector = GeometricAtoms.SPAvector(0.0, 0.0, 12.7) -block_transf = GeometricOperators.translate_transf(block_vector) +block_transf = GeometricAtoms.translate_transf(block_vector) Modeler.api_apply_transf(block, block_transf) # Make a frustum -cylinder = Topology.BODY() +cylinder = Entity.BODY() Modeler.api_make_frustum(19.05, 12.7, 12.7, 12.7, cylinder) # Generate and apply transformation to the frustum cylinder_vector = GeometricAtoms.SPAvector(0.0, 0.0, 6.35) -cylinder_transf = GeometricOperators.translate_transf(cylinder_vector) +cylinder_transf = GeometricAtoms.translate_transf(cylinder_vector) Modeler.api_apply_transf(cylinder, cylinder_transf) # Subtract frustum from cuboid diff --git a/examples/03_sweeping.py b/examples/03_sweeping.py index 7d4e491..fbc8ec6 100644 --- a/examples/03_sweeping.py +++ b/examples/03_sweeping.py @@ -7,7 +7,7 @@ Please see the LICENSE file for details. """ -from ACIS import Modeler, Licensing, SaveRestore, Topology, Lists, GeometricAtoms, GeometricOperators, Sweeping, Query +from ACIS import Modeler, Licensing, SaveRestore, Entity, Lists, GeometricAtoms, Sweeping, Query # Start ACIS Modeler Modeler.api_start_modeller(0) @@ -17,7 +17,7 @@ Licensing.spa_unlock_products(unlock_key) # Make a cuboid -block = Topology.BODY() +block = Entity.BODY() Modeler.api_make_cuboid(150, 75, 25, block) # Get faces of the cuboid @@ -28,18 +28,18 @@ block_face = face_list.first() # Convert the chosen face into a sheet body -sheet_body = Topology.BODY() +sheet_body = Entity.BODY() Modeler.api_sheet_from_ff([block_face], sheet_body) # Make a sweep path pt1 = GeometricAtoms.SPAposition(0.0, 0.0, 0.0) pt2 = GeometricAtoms.SPAposition(10.0, 55.0, 23.0) -sweep_path = Topology.EDGE() +sweep_path = Entity.EDGE() Sweeping.api_make_sweep_path([pt1, pt2], sweep_path) # Sweep the chosen face using the sweep path opts = Sweeping.sweep_options() -swept_body = Topology.BODY() +swept_body = Entity.BODY() Sweeping.api_sweep_with_options(sheet_body, sweep_path, opts, swept_body) # Assign attributes after generation From 8129d811c4bcc4b2af6535a0c68d1e5dda81bcc4 Mon Sep 17 00:00:00 2001 From: Onur Rauf Bingol Date: Tue, 18 Jul 2017 22:20:27 -0500 Subject: [PATCH 9/9] Updated function reference after renames --- FUNCTION_REFERENCE.md | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/FUNCTION_REFERENCE.md b/FUNCTION_REFERENCE.md index fea6400..ebdabe8 100644 --- a/FUNCTION_REFERENCE.md +++ b/FUNCTION_REFERENCE.md @@ -28,7 +28,7 @@ * api_sheet_from_ff * api_boolean_chop_body -## Topology +## Entity ### Classes @@ -42,11 +42,6 @@ * COEDGE * VERTEX * WIRE - -## Geometry - -### Classes - * SURFACE * CONE * PLANE @@ -64,8 +59,6 @@ * SPAvector * SPAunit_vector -## Geometric Operators - ### Functions * translate_transf @@ -99,17 +92,17 @@ ## Sweeping -### Functions - -* api_make_sweep_path -* api_sweep_with_options - ### Classes / Enums * sweep_bool_type * sweep_options * make_sweep_path_options +### Functions + +* api_make_sweep_path +* api_sweep_with_options + ## Licensing ### Functions