From b5d0950211a5017006bbae5d7e6b831536dfb4ca Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 10 Sep 2023 17:23:58 +0200 Subject: [PATCH] Import: Apply clang format --- src/Mod/Import/App/AppImport.cpp | 9 +- src/Mod/Import/App/AppImportPy.cpp | 468 +- src/Mod/Import/App/ExportOCAF.cpp | 178 +- src/Mod/Import/App/ExportOCAF.h | 79 +- src/Mod/Import/App/ImportOCAF.cpp | 340 +- src/Mod/Import/App/ImportOCAF.h | 50 +- src/Mod/Import/App/ImportOCAF2.cpp | 1117 +- src/Mod/Import/App/ImportOCAF2.h | 172 +- src/Mod/Import/App/ImportOCAFAssembly.cpp | 190 +- src/Mod/Import/App/ImportOCAFAssembly.h | 32 +- src/Mod/Import/App/PlmXmlParser.py | 185 +- src/Mod/Import/App/PreCompiled.cpp | 1 - src/Mod/Import/App/PreCompiled.h | 22 +- src/Mod/Import/App/StepShape.cpp | 20 +- src/Mod/Import/App/StepShape.h | 5 +- src/Mod/Import/App/StepShapePy.xml | 2 +- src/Mod/Import/App/StepShapePyImp.cpp | 8 +- src/Mod/Import/App/config_control_design.py | 27040 ++++++++++-------- src/Mod/Import/App/dxf/ImpExpDxf.cpp | 642 +- src/Mod/Import/App/dxf/ImpExpDxf.h | 190 +- src/Mod/Import/App/dxf/dxf.cpp | 3680 +-- src/Mod/Import/App/dxf/dxf.h | 255 +- src/Mod/Import/Gui/AppImportGui.cpp | 9 +- src/Mod/Import/Gui/AppImportGuiPy.cpp | 568 +- src/Mod/Import/Gui/Command.cpp | 87 +- src/Mod/Import/Gui/PreCompiled.h | 65 +- src/Mod/Import/Gui/Workbench.cpp | 1 - src/Mod/Import/Gui/Workbench.h | 9 +- 28 files changed, 20674 insertions(+), 14750 deletions(-) diff --git a/src/Mod/Import/App/AppImport.cpp b/src/Mod/Import/App/AppImport.cpp index db9c05f264..2c5f1f9eeb 100644 --- a/src/Mod/Import/App/AppImport.cpp +++ b/src/Mod/Import/App/AppImport.cpp @@ -30,8 +30,9 @@ #include "StepShapePy.h" -namespace Import { - extern PyObject* initModule(); +namespace Import +{ +extern PyObject* initModule(); } PyMOD_INIT_FUNC(Import) @@ -41,13 +42,13 @@ PyMOD_INIT_FUNC(Import) try { Base::Interpreter().loadModule("Part"); } - catch(const Base::Exception& e) { + catch (const Base::Exception& e) { PyErr_SetString(PyExc_ImportError, e.what()); PyMOD_Return(nullptr); } // add mesh elements - Base::Interpreter().addType(&Import::StepShapePy ::Type, importModule, "StepShape"); + Base::Interpreter().addType(&Import::StepShapePy ::Type, importModule, "StepShape"); Base::Console().Log("Loading Import module... done\n"); diff --git a/src/Mod/Import/App/AppImportPy.cpp b/src/Mod/Import/App/AppImportPy.cpp index fd3a62fb18..7ac523c6dd 100644 --- a/src/Mod/Import/App/AppImportPy.cpp +++ b/src/Mod/Import/App/AppImportPy.cpp @@ -22,121 +22,137 @@ #include "PreCompiled.h" #if defined(__MINGW32__) -# define WNT // avoid conflict with GUID +#define WNT// avoid conflict with GUID #endif #ifndef _PreComp_ -# include -# if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wextra-semi" -# endif -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# if OCC_VERSION_HEX >= 0x070500 -# include -# include -# endif -# if defined(__clang__) -# pragma clang diagnostic pop -# endif +#include +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wextra-semi" +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if OCC_VERSION_HEX >= 0x070500 +#include +#include +#endif +#if defined(__clang__) +#pragma clang diagnostic pop +#endif #endif +#include "dxf/ImpExpDxf.h" #include #include #include #include #include -#include "dxf/ImpExpDxf.h" -#include #include #include #include +#include +#include #include #include -#include -#include +#include #include "ImportOCAF2.h" -namespace Import { +namespace Import +{ -class ImportOCAFExt : public Import::ImportOCAF2 +class ImportOCAFExt: public Import::ImportOCAF2 { public: ImportOCAFExt(Handle(TDocStd_Document) hStdDoc, App::Document* doc, const std::string& name) : ImportOCAF2(hStdDoc, doc, name) - { - } + {} - std::map > partColors; + std::map> partColors; private: - void applyFaceColors(Part::Feature* part, const std::vector& colors) override { + void applyFaceColors(Part::Feature* part, const std::vector& colors) override + { partColors[part] = colors; } }; -class Module : public Py::ExtensionModule +class Module: public Py::ExtensionModule { public: - Module() : Py::ExtensionModule("Import") + Module() + : Py::ExtensionModule("Import") { - add_keyword_method("open",&Module::importer, - "open(string) -- Open the file and create a new document." - ); - add_keyword_method("insert",&Module::importer, - "insert(string,string) -- Insert the file into the given document." - ); - add_keyword_method("export",&Module::exporter, - "export(list,string) -- Export a list of objects into a single file." - ); - add_varargs_method("readDXF",&Module::readDXF, - "readDXF(filename,[document,ignore_errors,option_source]): Imports a DXF file into the given document. ignore_errors is True by default." - ); - add_varargs_method("writeDXFShape",&Module::writeDXFShape, - "writeDXFShape([shape],filename [version,usePolyline,optionSource]): Exports Shape(s) to a DXF file." - ); - add_varargs_method("writeDXFObject",&Module::writeDXFObject, - "writeDXFObject([objects],filename [,version,usePolyline,optionSource]): Exports DocumentObject(s) to a DXF file." - ); - initialize("This module is the Import module."); // register with Python + add_keyword_method("open", + &Module::importer, + "open(string) -- Open the file and create a new document."); + add_keyword_method("insert", + &Module::importer, + "insert(string,string) -- Insert the file into the given document."); + add_keyword_method("export", + &Module::exporter, + "export(list,string) -- Export a list of objects into a single file."); + add_varargs_method("readDXF", + &Module::readDXF, + "readDXF(filename,[document,ignore_errors,option_source]): Imports a " + "DXF file into the given document. ignore_errors is True by default."); + add_varargs_method("writeDXFShape", + &Module::writeDXFShape, + "writeDXFShape([shape],filename [version,usePolyline,optionSource]): " + "Exports Shape(s) to a DXF file."); + add_varargs_method( + "writeDXFObject", + &Module::writeDXFObject, + "writeDXFObject([objects],filename [,version,usePolyline,optionSource]): Exports " + "DocumentObject(s) to a DXF file."); + initialize("This module is the Import module.");// register with Python } ~Module() override = default; private: - Py::Object importer(const Py::Tuple& args, const Py::Dict &kwds) + Py::Object importer(const Py::Tuple& args, const Py::Dict& kwds) { char* Name; - char* DocName=nullptr; - PyObject *importHidden = Py_None; - PyObject *merge = Py_None; - PyObject *useLinkGroup = Py_None; + char* DocName = nullptr; + PyObject* importHidden = Py_None; + PyObject* merge = Py_None; + PyObject* useLinkGroup = Py_None; int mode = -1; - static const std::array kwd_list {"name", "docName", "importHidden", "merge", - "useLinkGroup", "mode", nullptr}; - if (!Base::Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "et|sO!O!O!i", - kwd_list, "utf-8", &Name, &DocName, &PyBool_Type, &importHidden, - &PyBool_Type, &merge, - &PyBool_Type, &useLinkGroup, &mode)) { + static const std::array + kwd_list {"name", "docName", "importHidden", "merge", "useLinkGroup", "mode", nullptr}; + if (!Base::Wrapped_ParseTupleAndKeywords(args.ptr(), + kwds.ptr(), + "et|sO!O!O!i", + kwd_list, + "utf-8", + &Name, + &DocName, + &PyBool_Type, + &importHidden, + &PyBool_Type, + &merge, + &PyBool_Type, + &useLinkGroup, + &mode)) { throw Py::Exception(); } @@ -147,7 +163,7 @@ private: try { Base::FileInfo file(Utf8Name.c_str()); - App::Document *pcDoc = nullptr; + App::Document* pcDoc = nullptr; if (DocName) { pcDoc = App::GetApplication().getDocument(DocName); } @@ -165,7 +181,8 @@ private: aReader.SetColorMode(true); aReader.SetNameMode(true); aReader.SetLayerMode(true); - if (aReader.ReadFile((Standard_CString)(name8bit.c_str())) != IFSelect_RetDone) { + if (aReader.ReadFile((Standard_CString)(name8bit.c_str())) + != IFSelect_RetDone) { throw Py::Exception(PyExc_IOError, "cannot read STEP file"); } @@ -184,24 +201,29 @@ private: Base::Console().Error("%s\n", e.GetMessageString()); Base::Console().Message("Try to load STEP file without colors...\n"); - Part::ImportStepParts(pcDoc,Utf8Name.c_str()); + Part::ImportStepParts(pcDoc, Utf8Name.c_str()); pcDoc->recompute(); } } else if (file.hasExtension({"igs", "iges"})) { - Base::Reference hGrp = App::GetApplication().GetUserParameter() - .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("IGES"); + Base::Reference hGrp = App::GetApplication() + .GetUserParameter() + .GetGroup("BaseApp") + ->GetGroup("Preferences") + ->GetGroup("Mod/Part") + ->GetGroup("IGES"); try { IGESControl_Controller::Init(); IGESCAFControl_Reader aReader; // http://www.opencascade.org/org/forum/thread_20603/?forum=3 - aReader.SetReadVisible(hGrp->GetBool("SkipBlankEntities", true) - ? Standard_True : Standard_False); + aReader.SetReadVisible( + hGrp->GetBool("SkipBlankEntities", true) ? Standard_True : Standard_False); aReader.SetColorMode(true); aReader.SetNameMode(true); aReader.SetLayerMode(true); - if (aReader.ReadFile((Standard_CString)(name8bit.c_str())) != IFSelect_RetDone) { + if (aReader.ReadFile((Standard_CString)(name8bit.c_str())) + != IFSelect_RetDone) { throw Py::Exception(PyExc_IOError, "cannot read IGES file"); } @@ -217,13 +239,13 @@ private: #endif // http://opencascade.blogspot.de/2009/03/unnoticeable-memory-leaks-part-2.html Handle(IGESToBRep_Actor)::DownCast(aReader.WS()->TransferReader()->Actor()) - ->SetModel(new IGESData_IGESModel); + ->SetModel(new IGESData_IGESModel); } catch (OSD_Exception& e) { Base::Console().Error("%s\n", e.GetMessageString()); Base::Console().Message("Try to load IGES file without colors...\n"); - Part::ImportIgesParts(pcDoc,Utf8Name.c_str()); + Part::ImportIgesParts(pcDoc, Utf8Name.c_str()); pcDoc->recompute(); } } @@ -233,21 +255,25 @@ private: ImportOCAFExt ocaf(hDoc, pcDoc, file.fileNamePure()); ocaf.setImportOptions(ImportOCAFExt::customImportOptions()); - if (merge != Py_None) + if (merge != Py_None) { ocaf.setMerge(Base::asBoolean(merge)); - if (importHidden != Py_None) + } + if (importHidden != Py_None) { ocaf.setImportHiddenObject(Base::asBoolean(importHidden)); - if (useLinkGroup != Py_None) + } + if (useLinkGroup != Py_None) { ocaf.setUseLinkGroup(Base::asBoolean(useLinkGroup)); - if (mode >= 0) + } + if (mode >= 0) { ocaf.setMode(mode); + } ocaf.loadShapes(); hApp->Close(hDoc); if (!ocaf.partColors.empty()) { Py::List list; - for (auto &it : ocaf.partColors) { + for (auto& it : ocaf.partColors) { Py::Tuple tuple(2); tuple.setItem(0, Py::asObject(it.first->getPyObject())); @@ -271,19 +297,32 @@ private: return Py::None(); } - Py::Object exporter(const Py::Tuple& args, const Py::Dict &kwds) + Py::Object exporter(const Py::Tuple& args, const Py::Dict& kwds) { PyObject* object; char* Name; - PyObject *exportHidden = Py_None; - PyObject *legacy = Py_None; - PyObject *keepPlacement = Py_None; - static const std::array kwd_list{"obj", "name", "exportHidden", "legacy", "keepPlacement", + PyObject* exportHidden = Py_None; + PyObject* legacy = Py_None; + PyObject* keepPlacement = Py_None; + static const std::array kwd_list {"obj", + "name", + "exportHidden", + "legacy", + "keepPlacement", nullptr}; - if (!Base::Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "Oet|O!O!O!", - kwd_list, &object, "utf-8", &Name, &PyBool_Type, &exportHidden, - &PyBool_Type, &legacy, - &PyBool_Type, &keepPlacement)) { + if (!Base::Wrapped_ParseTupleAndKeywords(args.ptr(), + kwds.ptr(), + "Oet|O!O!O!", + kwd_list, + &object, + "utf-8", + &Name, + &PyBool_Type, + &exportHidden, + &PyBool_Type, + &legacy, + &PyBool_Type, + &keepPlacement)) { throw Py::Exception(); } @@ -300,8 +339,10 @@ private: std::vector objs; for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { PyObject* item = (*it).ptr(); - if (PyObject_TypeCheck(item, &(App::DocumentObjectPy::Type))) - objs.push_back(static_cast(item)->getDocumentObjectPtr()); + if (PyObject_TypeCheck(item, &(App::DocumentObjectPy::Type))) { + objs.push_back( + static_cast(item)->getDocumentObjectPtr()); + } } if (legacy == Py_None) { @@ -313,10 +354,12 @@ private: if (!Base::asBoolean(legacy) || !ocaf.canFallback(objs)) { ocaf.setExportOptions(ExportOCAF2::customExportOptions()); - if (exportHidden != Py_None) + if (exportHidden != Py_None) { ocaf.setExportHiddenObject(Base::asBoolean(exportHidden)); - if (keepPlacement != Py_None) + } + if (keepPlacement != Py_None) { ocaf.setKeepPlacement(Base::asBoolean(keepPlacement)); + } ocaf.exportObjects(objs); } @@ -324,17 +367,19 @@ private: bool keepExplicitPlacement = Standard_True; ExportOCAF ocaf(hDoc, keepExplicitPlacement); // That stuff is exporting a list of selected objects into FreeCAD Tree - std::vector hierarchical_label; - std::vector hierarchical_loc; - std::vector hierarchical_part; - for(auto obj : objs) - ocaf.exportObject(obj,hierarchical_label, hierarchical_loc,hierarchical_part); + std::vector hierarchical_label; + std::vector hierarchical_loc; + std::vector hierarchical_part; + for (auto obj : objs) { + ocaf.exportObject(obj, hierarchical_label, hierarchical_loc, hierarchical_part); + } // Free Shapes must have absolute placement and not explicit - std::vector FreeLabels; - std::vector part_id; - ocaf.getFreeLabels(hierarchical_label,FreeLabels, part_id); - // Update is not performed automatically anymore: https://tracker.dev.opencascade.org/view.php?id=28055 + std::vector FreeLabels; + std::vector part_id; + ocaf.getFreeLabels(hierarchical_label, FreeLabels, part_id); + // Update is not performed automatically anymore: + // https://tracker.dev.opencascade.org/view.php?id=28055 XCAFDoc_DocumentTool::ShapeTool(hDoc->Main())->UpdateAssemblies(); } @@ -345,17 +390,27 @@ private: writer.Transfer(hDoc, STEPControl_AsIs); APIHeaderSection_MakeHeader makeHeader(writer.ChangeWriter().Model()); - Base::Reference hGrp = App::GetApplication().GetUserParameter() - .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("STEP"); + Base::Reference hGrp = App::GetApplication() + .GetUserParameter() + .GetGroup("BaseApp") + ->GetGroup("Preferences") + ->GetGroup("Mod/Part") + ->GetGroup("STEP"); // Don't set name because STEP doesn't support UTF-8 // https://forum.freecad.org/viewtopic.php?f=8&t=52967 - makeHeader.SetAuthorValue (1, new TCollection_HAsciiString(hGrp->GetASCII("Author", "Author").c_str())); - makeHeader.SetOrganizationValue (1, new TCollection_HAsciiString(hGrp->GetASCII("Company").c_str())); - makeHeader.SetOriginatingSystem(new TCollection_HAsciiString(App::Application::getExecutableName().c_str())); + makeHeader.SetAuthorValue( + 1, + new TCollection_HAsciiString(hGrp->GetASCII("Author", "Author").c_str())); + makeHeader.SetOrganizationValue( + 1, + new TCollection_HAsciiString(hGrp->GetASCII("Company").c_str())); + makeHeader.SetOriginatingSystem( + new TCollection_HAsciiString(App::Application::getExecutableName().c_str())); makeHeader.SetDescriptionValue(1, new TCollection_HAsciiString("FreeCAD Model")); IFSelect_ReturnStatus ret = writer.Write(name8bit.c_str()); - if (ret == IFSelect_RetError || ret == IFSelect_RetFail || ret == IFSelect_RetStop) { + if (ret == IFSelect_RetError || ret == IFSelect_RetFail + || ret == IFSelect_RetStop) { PyErr_Format(PyExc_IOError, "Cannot open file '%s'", Utf8Name.c_str()); throw Py::Exception(); } @@ -364,9 +419,12 @@ private: IGESControl_Controller::Init(); IGESCAFControl_Writer writer; IGESData_GlobalSection header = writer.Model()->GlobalSection(); - header.SetAuthorName(new TCollection_HAsciiString(Part::Interface::writeIgesHeaderAuthor())); - header.SetCompanyName(new TCollection_HAsciiString(Part::Interface::writeIgesHeaderCompany())); - header.SetSendName(new TCollection_HAsciiString(Part::Interface::writeIgesHeaderProduct())); + header.SetAuthorName( + new TCollection_HAsciiString(Part::Interface::writeIgesHeaderAuthor())); + header.SetCompanyName( + new TCollection_HAsciiString(Part::Interface::writeIgesHeaderCompany())); + header.SetSendName( + new TCollection_HAsciiString(Part::Interface::writeIgesHeaderProduct())); writer.Model()->SetGlobalSection(header); writer.Transfer(hDoc); Standard_Boolean ret = writer.Write(name8bit.c_str()); @@ -378,15 +436,16 @@ private: else if (file.hasExtension({"glb", "gltf"})) { #if OCC_VERSION_HEX >= 0x070500 TColStd_IndexedDataMapOfStringString aMetadata; - RWGltf_CafWriter aWriter (name8bit.c_str(), file.hasExtension("glb")); - aWriter.SetTransformationFormat (RWGltf_WriterTrsfFormat_Compact); + RWGltf_CafWriter aWriter(name8bit.c_str(), file.hasExtension("glb")); + aWriter.SetTransformationFormat(RWGltf_WriterTrsfFormat_Compact); // https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#coordinate-system-and-units - aWriter.ChangeCoordinateSystemConverter().SetInputLengthUnit (0.001); - aWriter.ChangeCoordinateSystemConverter().SetInputCoordinateSystem (RWMesh_CoordinateSystem_Zup); + aWriter.ChangeCoordinateSystemConverter().SetInputLengthUnit(0.001); + aWriter.ChangeCoordinateSystemConverter().SetInputCoordinateSystem( + RWMesh_CoordinateSystem_Zup); #if OCC_VERSION_HEX >= 0x070700 aWriter.SetParallel(true); #endif - Standard_Boolean ret = aWriter.Perform (hDoc, aMetadata, Message_ProgressRange()); + Standard_Boolean ret = aWriter.Perform(hDoc, aMetadata, Message_ProgressRange()); if (!ret) { PyErr_Format(PyExc_IOError, "Cannot save to file '%s'", Utf8Name.c_str()); throw Py::Exception(); @@ -412,34 +471,46 @@ private: Py::Object readDXF(const Py::Tuple& args) { char* Name; - const char* DocName=nullptr; + const char* DocName = nullptr; const char* optionSource = nullptr; std::string defaultOptions = "User parameter:BaseApp/Preferences/Mod/Draft"; - bool IgnoreErrors=true; - if (!PyArg_ParseTuple(args.ptr(), "et|sbs","utf-8",&Name,&DocName,&IgnoreErrors,&optionSource)) + bool IgnoreErrors = true; + if (!PyArg_ParseTuple(args.ptr(), + "et|sbs", + "utf-8", + &Name, + &DocName, + &IgnoreErrors, + &optionSource)) { throw Py::Exception(); + } std::string EncodedName = std::string(Name); PyMem_Free(Name); Base::FileInfo file(EncodedName.c_str()); - if (!file.exists()) + if (!file.exists()) { throw Py::RuntimeError("File doesn't exist"); + } - if (optionSource) + if (optionSource) { defaultOptions = optionSource; + } - App::Document *pcDoc; - if (DocName) + App::Document* pcDoc; + if (DocName) { pcDoc = App::GetApplication().getDocument(DocName); - else + } + else { pcDoc = App::GetApplication().getActiveDocument(); - if (!pcDoc) + } + if (!pcDoc) { pcDoc = App::GetApplication().newDocument(DocName); + } try { // read the DXF file - ImpExpDxfRead dxf_file(EncodedName,pcDoc); + ImpExpDxfRead dxf_file(EncodedName, pcDoc); dxf_file.setOptionSource(defaultOptions); dxf_file.setOptions(); dxf_file.DoRead(IgnoreErrors); @@ -456,35 +527,36 @@ private: Py::Object writeDXFShape(const Py::Tuple& args) { - PyObject *shapeObj; + PyObject* shapeObj; char* fname; std::string filePath; std::string layerName; const char* optionSource = nullptr; std::string defaultOptions = "User parameter:BaseApp/Preferences/Mod/Import"; - int versionParm = -1; - bool versionOverride = false; - bool polyOverride = false; - PyObject *usePolyline = Py_False; + int versionParm = -1; + bool versionOverride = false; + bool polyOverride = false; + PyObject* usePolyline = Py_False; - //handle list of shapes - if (PyArg_ParseTuple(args.ptr(), "O!et|iOs", &(PyList_Type) , - &shapeObj, - "utf-8", - &fname, - &versionParm, - &usePolyline, - &optionSource)) { + // handle list of shapes + if (PyArg_ParseTuple(args.ptr(), + "O!et|iOs", + &(PyList_Type), + &shapeObj, + "utf-8", + &fname, + &versionParm, + &usePolyline, + &optionSource)) { filePath = std::string(fname); layerName = "none"; PyMem_Free(fname); - if ((versionParm == 12) || - (versionParm == 14)) { - versionOverride = true; + if ((versionParm == 12) || (versionParm == 14)) { + versionOverride = true; } if (usePolyline == Py_True) { - polyOverride = true; + polyOverride = true; } if (optionSource) { defaultOptions = optionSource; @@ -503,7 +575,8 @@ private: Py::Sequence list(shapeObj); for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { if (PyObject_TypeCheck((*it).ptr(), &(Part::TopoShapePy::Type))) { - Part::TopoShape* ts = static_cast((*it).ptr())->getTopoShapePtr(); + Part::TopoShape* ts = + static_cast((*it).ptr())->getTopoShapePtr(); TopoDS_Shape shape = ts->getShape(); writer.exportShape(shape); } @@ -517,23 +590,24 @@ private: } PyErr_Clear(); - if (PyArg_ParseTuple(args.ptr(), "O!et|iOs", &(Part::TopoShapePy::Type) , - &shapeObj, - "utf-8", - &fname, - &versionParm, - &usePolyline, - &optionSource)) { + if (PyArg_ParseTuple(args.ptr(), + "O!et|iOs", + &(Part::TopoShapePy::Type), + &shapeObj, + "utf-8", + &fname, + &versionParm, + &usePolyline, + &optionSource)) { filePath = std::string(fname); layerName = "none"; PyMem_Free(fname); - if ((versionParm == 12) || - (versionParm == 14)) { - versionOverride = true; + if ((versionParm == 12) || (versionParm == 14)) { + versionOverride = true; } if (usePolyline == Py_True) { - polyOverride = true; + polyOverride = true; } if (optionSource) { defaultOptions = optionSource; @@ -565,34 +639,35 @@ private: Py::Object writeDXFObject(const Py::Tuple& args) { - PyObject *docObj; + PyObject* docObj; char* fname; std::string filePath; std::string layerName; const char* optionSource = nullptr; std::string defaultOptions = "User parameter:BaseApp/Preferences/Mod/Import"; - int versionParm = -1; - bool versionOverride = false; - bool polyOverride = false; - PyObject *usePolyline = Py_False; + int versionParm = -1; + bool versionOverride = false; + bool polyOverride = false; + PyObject* usePolyline = Py_False; - if (PyArg_ParseTuple(args.ptr(), "O!et|iOs", &(PyList_Type) , - &docObj, - "utf-8", - &fname, - &versionParm, - &usePolyline, - &optionSource)) { + if (PyArg_ParseTuple(args.ptr(), + "O!et|iOs", + &(PyList_Type), + &docObj, + "utf-8", + &fname, + &versionParm, + &usePolyline, + &optionSource)) { filePath = std::string(fname); layerName = "none"; PyMem_Free(fname); - if ((versionParm == 12) || - (versionParm == 14)) { - versionOverride = true; + if ((versionParm == 12) || (versionParm == 14)) { + versionOverride = true; } if (usePolyline == Py_True) { - polyOverride = true; + polyOverride = true; } if (optionSource) { @@ -613,7 +688,8 @@ private: for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { if (PyObject_TypeCheck((*it).ptr(), &(Part::PartFeaturePy::Type))) { PyObject* item = (*it).ptr(); - App::DocumentObject* obj = static_cast(item)->getDocumentObjectPtr(); + App::DocumentObject* obj = + static_cast(item)->getDocumentObjectPtr(); Part::Feature* part = static_cast(obj); layerName = part->getNameInDocument(); writer.setLayerName(layerName); @@ -630,29 +706,30 @@ private: } PyErr_Clear(); - if (PyArg_ParseTuple(args.ptr(), "O!et|iOs", &(App::DocumentObjectPy::Type) , - &docObj, - "utf-8", - &fname, - &versionParm, - &usePolyline, - &optionSource)) { + if (PyArg_ParseTuple(args.ptr(), + "O!et|iOs", + &(App::DocumentObjectPy::Type), + &docObj, + "utf-8", + &fname, + &versionParm, + &usePolyline, + &optionSource)) { filePath = std::string(fname); layerName = "none"; PyMem_Free(fname); - if ((versionParm == 12) || - (versionParm == 14)) { - versionOverride = true; + if ((versionParm == 12) || (versionParm == 14)) { + versionOverride = true; } if (usePolyline == Py_True) { - polyOverride = true; + polyOverride = true; } if (optionSource) { defaultOptions = optionSource; } - + try { ImpExpDxfWrite writer(filePath); writer.setOptionSource(defaultOptions); @@ -663,7 +740,8 @@ private: writer.setPolyOverride(polyOverride); writer.setLayerName(layerName); writer.init(); - App::DocumentObject* obj = static_cast(docObj)->getDocumentObjectPtr(); + App::DocumentObject* obj = + static_cast(docObj)->getDocumentObjectPtr(); Part::Feature* part = static_cast(obj); layerName = part->getNameInDocument(); writer.setLayerName(layerName); @@ -687,4 +765,4 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -} // namespace Import +}// namespace Import diff --git a/src/Mod/Import/App/ExportOCAF.cpp b/src/Mod/Import/App/ExportOCAF.cpp index cf9cd6327e..1dc37ad113 100644 --- a/src/Mod/Import/App/ExportOCAF.cpp +++ b/src/Mod/Import/App/ExportOCAF.cpp @@ -22,25 +22,25 @@ #include "PreCompiled.h" #if defined(__MINGW32__) -# define WNT // avoid conflict with GUID +#define WNT// avoid conflict with GUID #endif #ifndef _PreComp_ -# include -# include -# include -# include // for Precision::Confusion() -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // for Precision::Confusion() +#include #endif #include @@ -54,12 +54,12 @@ #if OCC_VERSION_HEX >= 0x070500 // See https://dev.opencascade.org/content/occt-3d-viewer-becomes-srgb-aware -# define OCC_COLOR_SPACE Quantity_TOC_sRGB +#define OCC_COLOR_SPACE Quantity_TOC_sRGB #else -# define OCC_COLOR_SPACE Quantity_TOC_RGB +#define OCC_COLOR_SPACE Quantity_TOC_RGB #endif -static inline Quantity_ColorRGBA convertColor(const App::Color &c) +static inline Quantity_ColorRGBA convertColor(const App::Color& c) { return Quantity_ColorRGBA(Quantity_Color(c.r, c.g, c.b, OCC_COLOR_SPACE), 1.0 - c.a); } @@ -118,8 +118,9 @@ std::vector ExportOCAF::filterPart(App::Part* part) const } } - if (accept) + if (accept) { keepObjects.push_back(it); + } } entries.swap(keepObjects); @@ -129,11 +130,11 @@ std::vector ExportOCAF::filterPart(App::Part* part) const } int ExportOCAF::exportObject(App::DocumentObject* obj, - std::vector & hierarchical_label, - std::vector & hierarchical_loc, - std::vector & hierarchical_part) + std::vector& hierarchical_label, + std::vector& hierarchical_loc, + std::vector& hierarchical_part) { - std::vector local_label; + std::vector local_label; int root_id; int return_label = -1; @@ -148,15 +149,16 @@ int ExportOCAF::exportObject(App::DocumentObject* obj, } for (it = entries.begin(); it != entries.end(); ++it) { - int new_label=0; - new_label = exportObject((*it), hierarchical_label, hierarchical_loc, hierarchical_part); + int new_label = 0; + new_label = + exportObject((*it), hierarchical_label, hierarchical_loc, hierarchical_part); local_label.push_back(new_label); } - createNode(part,root_id, hierarchical_label, hierarchical_loc, hierarchical_part); + createNode(part, root_id, hierarchical_label, hierarchical_loc, hierarchical_part); std::vector::iterator label_it; for (label_it = local_label.begin(); label_it != local_label.end(); ++label_it) { - pushNode(root_id,(*label_it), hierarchical_label,hierarchical_loc); + pushNode(root_id, (*label_it), hierarchical_label, hierarchical_loc); } return_label = root_id; @@ -167,17 +169,20 @@ int ExportOCAF::exportObject(App::DocumentObject* obj, std::vector colors; findColors(part, colors); - return_label = saveShape(part, colors, hierarchical_label, hierarchical_loc, hierarchical_part); + return_label = + saveShape(part, colors, hierarchical_label, hierarchical_loc, hierarchical_part); } return return_label; } -// This function creates an Assembly node in an XCAF document with its relative placement information -void ExportOCAF::createNode(App::Part* part, int& root_id, - std::vector & hierarchical_label, - std::vector & hierarchical_loc, - std::vector & hierarchical_part) +// This function creates an Assembly node in an XCAF document with its relative placement +// information +void ExportOCAF::createNode(App::Part* part, + int& root_id, + std::vector& hierarchical_label, + std::vector& hierarchical_loc, + std::vector& hierarchical_part) { TDF_Label shapeLabel = aShapeTool->NewShape(); Handle(TDataStd_Name) N; @@ -192,24 +197,26 @@ void ExportOCAF::createNode(App::Part* part, int& root_id, gp_Trsf trf; trf.SetRotation(gp_Ax1(gp_Pnt(), gp_Dir(axis.x, axis.y, axis.z)), angle); - trf.SetTranslationPart(gp_Vec(pl.getPosition().x,pl.getPosition().y,pl.getPosition().z)); + trf.SetTranslationPart(gp_Vec(pl.getPosition().x, pl.getPosition().y, pl.getPosition().z)); TopLoc_Location MyLoc = TopLoc_Location(trf); - XCAFDoc_Location::Set(shapeLabel,TopLoc_Location(trf)); + XCAFDoc_Location::Set(shapeLabel, TopLoc_Location(trf)); hierarchical_label.push_back(shapeLabel); hierarchical_loc.push_back(MyLoc); hierarchical_part.push_back(part); - root_id=hierarchical_label.size(); + root_id = hierarchical_label.size(); } -int ExportOCAF::saveShape(Part::Feature* part, const std::vector& colors, - std::vector & hierarchical_label, - std::vector & hierarchical_loc, - std::vector & hierarchical_part) +int ExportOCAF::saveShape(Part::Feature* part, + const std::vector& colors, + std::vector& hierarchical_label, + std::vector& hierarchical_loc, + std::vector& hierarchical_part) { const TopoDS_Shape& shape = part->Shape.getValue(); - if (shape.IsNull()) + if (shape.IsNull()) { return -1; + } TopoDS_Shape baseShape; TopLoc_Location aLoc; @@ -221,8 +228,8 @@ int ExportOCAF::saveShape(Part::Feature* part, const std::vector& co double angle; rot.getValue(axis, angle); gp_Trsf trf; - trf.SetRotation(gp_Ax1(gp_Pnt(0.,0.,0.), gp_Dir(axis.x, axis.y, axis.z)), angle); - trf.SetTranslationPart(gp_Vec(pl.getPosition().x,pl.getPosition().y,pl.getPosition().z)); + trf.SetRotation(gp_Ax1(gp_Pnt(0., 0., 0.), gp_Dir(axis.x, axis.y, axis.z)), angle); + trf.SetTranslationPart(gp_Vec(pl.getPosition().x, pl.getPosition().y, pl.getPosition().z)); TopLoc_Location MyLoc = TopLoc_Location(trf); if (keepExplicitPlacement) { @@ -241,19 +248,19 @@ int ExportOCAF::saveShape(Part::Feature* part, const std::vector& co TDataStd_Name::Set(shapeLabel, TCollection_ExtendedString(part->Label.getValue(), true)); -/* - if (keepExplicitPlacement) { - aShapeTool->AddComponent(aShapeTool->BaseLabel(), shapeLabel, aLoc); - XCAFDoc_Location::Set(shapeLabel,MyLoc); - } -*/ + /* + if (keepExplicitPlacement) { + aShapeTool->AddComponent(aShapeTool->BaseLabel(), shapeLabel, aLoc); + XCAFDoc_Location::Set(shapeLabel,MyLoc); + } + */ // Add color information Quantity_ColorRGBA col; std::set face_index; TopTools_IndexedMapOfShape faces; - TopExp_Explorer xp(baseShape,TopAbs_FACE); + TopExp_Explorer xp(baseShape, TopAbs_FACE); while (xp.More()) { face_index.insert(faces.Add(xp.Current())); xp.Next(); @@ -261,7 +268,7 @@ int ExportOCAF::saveShape(Part::Feature* part, const std::vector& co // define color per face? if (colors.size() == face_index.size()) { - xp.Init(baseShape,TopAbs_FACE); + xp.Init(baseShape, TopAbs_FACE); while (xp.More()) { int index = faces.FindIndex(xp.Current()); if (face_index.find(index) != face_index.end()) { @@ -281,7 +288,7 @@ int ExportOCAF::saveShape(Part::Feature* part, const std::vector& co } if (!faceLabel.IsNull()) { - const App::Color& color = colors[index-1]; + const App::Color& color = colors[index - 1]; col = convertColor(color); aColorTool->SetColor(faceLabel, col, XCAFDoc_ColorSurf); } @@ -299,16 +306,16 @@ int ExportOCAF::saveShape(Part::Feature* part, const std::vector& co hierarchical_loc.push_back(MyLoc); hierarchical_part.push_back(part); - return(hierarchical_label.size()); + return (hierarchical_label.size()); } // This function is scanning the OCAF doc for Free Shapes and returns the label attached to it // If this Free Shapes are regular Part::Feature, we must use absolute coordinate instead of // allocating a placement into the hierarchy as it is not attached to a hierarchical node -void ExportOCAF::getFreeLabels(std::vector & hierarchical_label, - std::vector & labels, - std::vector & label_part_id) +void ExportOCAF::getFreeLabels(std::vector& hierarchical_label, + std::vector& labels, + std::vector& label_part_id) { TDF_LabelSequence FreeLabels; aShapeTool->GetFreeShapes(FreeLabels); @@ -324,36 +331,38 @@ void ExportOCAF::getFreeLabels(std::vector & hierarchical_label, } } -void ExportOCAF::getPartColors(std::vector hierarchical_part, - std::vector FreeLabels, - std::vector part_id, - std::vector < std::vector >& Colors) const +void ExportOCAF::getPartColors(std::vector hierarchical_part, + std::vector FreeLabels, + std::vector part_id, + std::vector>& Colors) const { // I am seeking for the colors of each parts std::size_t n = FreeLabels.size(); for (std::size_t i = 0; i < n; i++) { std::vector colors; - Part::Feature * part = static_cast(hierarchical_part.at(part_id.at(i))); + Part::Feature* part = static_cast(hierarchical_part.at(part_id.at(i))); findColors(part, colors); Colors.push_back(colors); } } -void ExportOCAF::reallocateFreeShape(std::vector hierarchical_part, - std::vector FreeLabels, - std::vector part_id, - std::vector< std::vector >& Colors) +void ExportOCAF::reallocateFreeShape(std::vector hierarchical_part, + std::vector FreeLabels, + std::vector part_id, + std::vector>& Colors) { std::size_t n = FreeLabels.size(); for (std::size_t i = 0; i < n; i++) { TDF_Label label = FreeLabels.at(i); // hierarchical part does contain only part currently and not node I should add node - if (hierarchical_part.at(part_id.at(i))->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) { - Part::Feature * part = static_cast(hierarchical_part.at(part_id.at(i))); + if (hierarchical_part.at(part_id.at(i)) + ->getTypeId() + .isDerivedFrom(Part::Feature::getClassTypeId())) { + Part::Feature* part = static_cast(hierarchical_part.at(part_id.at(i))); aShapeTool->SetShape(label, part->Shape.getValue()); // Add color information std::vector colors; - colors=Colors.at(i); + colors = Colors.at(i); TopoDS_Shape baseShape = part->Shape.getValue(); // Add color information @@ -361,7 +370,7 @@ void ExportOCAF::reallocateFreeShape(std::vector hierarch std::set face_index; TopTools_IndexedMapOfShape faces; - TopExp_Explorer xp(baseShape,TopAbs_FACE); + TopExp_Explorer xp(baseShape, TopAbs_FACE); while (xp.More()) { face_index.insert(faces.Add(xp.Current())); xp.Next(); @@ -369,7 +378,7 @@ void ExportOCAF::reallocateFreeShape(std::vector hierarch // define color per face? if (colors.size() == face_index.size()) { - xp.Init(baseShape,TopAbs_FACE); + xp.Init(baseShape, TopAbs_FACE); while (xp.More()) { int index = faces.FindIndex(xp.Current()); if (face_index.find(index) != face_index.end()) { @@ -389,7 +398,7 @@ void ExportOCAF::reallocateFreeShape(std::vector hierarch } if (!faceLabel.IsNull()) { - const App::Color& color = colors[index-1]; + const App::Color& color = colors[index - 1]; col = convertColor(color); aColorTool->SetColor(faceLabel, col, XCAFDoc_ColorSurf); } @@ -408,26 +417,31 @@ void ExportOCAF::reallocateFreeShape(std::vector hierarch } // This function is moving a "standard" node into an Assembly node within an XCAF doc -void ExportOCAF::pushNode(int root_id, int node_id, std::vector & hierarchical_label,std::vector & hierarchical_loc) +void ExportOCAF::pushNode(int root_id, + int node_id, + std::vector& hierarchical_label, + std::vector& hierarchical_loc) { TDF_Label root; TDF_Label node; - root = hierarchical_label.at(root_id-1); - node = hierarchical_label.at(node_id-1); + root = hierarchical_label.at(root_id - 1); + node = hierarchical_label.at(node_id - 1); - XCAFDoc_DocumentTool::ShapeTool(root)->AddComponent(root, node, hierarchical_loc.at(node_id-1)); + XCAFDoc_DocumentTool::ShapeTool(root)->AddComponent(root, + node, + hierarchical_loc.at(node_id - 1)); } // ---------------------------------------------------------------------------- ExportOCAFCmd::ExportOCAFCmd(Handle(TDocStd_Document) h, bool explicitPlacement) - : ExportOCAF(h, explicitPlacement) -{ -} + : ExportOCAF(h, explicitPlacement) +{} void ExportOCAFCmd::findColors(Part::Feature* part, std::vector& colors) const { - std::map >::const_iterator it = partColors.find(part); - if (it != partColors.end()) + std::map>::const_iterator it = partColors.find(part); + if (it != partColors.end()) { colors = it->second; + } } diff --git a/src/Mod/Import/App/ExportOCAF.h b/src/Mod/Import/App/ExportOCAF.h index 5f7a5a71f0..b7c36c7a70 100644 --- a/src/Mod/Import/App/ExportOCAF.h +++ b/src/Mod/Import/App/ExportOCAF.h @@ -40,16 +40,19 @@ class TDF_Label; class TopLoc_Location; -namespace App { +namespace App +{ class Document; class DocumentObject; class Part; -} -namespace Part { +}// namespace App +namespace Part +{ class Feature; } -namespace Import { +namespace Import +{ class ImportExport ExportOCAF { @@ -57,33 +60,38 @@ public: ExportOCAF(Handle(TDocStd_Document) h, bool explicitPlacement); virtual ~ExportOCAF(); int exportObject(App::DocumentObject* obj, - std::vector & hierarchical_label, - std::vector & hierarchical_loc, - std::vector & hierarchical_part); - int saveShape(Part::Feature* part, const std::vector&, - std::vector & hierarchical_label, - std::vector & hierarchical_loc, - std::vector & hierarchical_part); - void getPartColors(std::vector hierarchical_part, - std::vector FreeLabels, - std::vector part_id, - std::vector < std::vector >& Colors) const; - void reallocateFreeShape(std::vector hierarchical_part, - std::vector FreeLabels, - std::vector part_id, - std::vector< std::vector >& Colors); - void getFreeLabels(std::vector & hierarchical_label, - std::vector & labels, - std::vector & label_part_id); - void createNode(App::Part* part, int& root_it, - std::vector & hierarchical_label, - std::vector & hierarchical_loc, - std::vector & hierarchical_part); - void pushNode(int root, int node, std::vector & hierarchical_label, - std::vector & hierarchical_loc); + std::vector& hierarchical_label, + std::vector& hierarchical_loc, + std::vector& hierarchical_part); + int saveShape(Part::Feature* part, + const std::vector&, + std::vector& hierarchical_label, + std::vector& hierarchical_loc, + std::vector& hierarchical_part); + void getPartColors(std::vector hierarchical_part, + std::vector FreeLabels, + std::vector part_id, + std::vector>& Colors) const; + void reallocateFreeShape(std::vector hierarchical_part, + std::vector FreeLabels, + std::vector part_id, + std::vector>& Colors); + void getFreeLabels(std::vector& hierarchical_label, + std::vector& labels, + std::vector& label_part_id); + void createNode(App::Part* part, + int& root_it, + std::vector& hierarchical_label, + std::vector& hierarchical_loc, + std::vector& hierarchical_part); + void pushNode(int root, + int node, + std::vector& hierarchical_label, + std::vector& hierarchical_loc); private: - virtual void findColors(Part::Feature*, std::vector&) const {} + virtual void findColors(Part::Feature*, std::vector&) const + {} std::vector filterPart(App::Part* part) const; private: @@ -92,14 +100,15 @@ private: Handle(XCAFDoc_ColorTool) aColorTool; TDF_Label rootLabel; bool keepExplicitPlacement; - bool filterBaseFeature{true}; + bool filterBaseFeature {true}; }; -class ImportExport ExportOCAFCmd : public ExportOCAF +class ImportExport ExportOCAFCmd: public ExportOCAF { public: ExportOCAFCmd(Handle(TDocStd_Document) h, bool explicitPlacement); - void setPartColorsMap(const std::map >& colors) { + void setPartColorsMap(const std::map>& colors) + { partColors = colors; } @@ -107,10 +116,10 @@ private: void findColors(Part::Feature*, std::vector&) const override; private: - std::map > partColors; + std::map> partColors; }; -} +}// namespace Import -#endif //IMPORT_EXPORTOCAF_H +#endif// IMPORT_EXPORTOCAF_H diff --git a/src/Mod/Import/App/ImportOCAF.cpp b/src/Mod/Import/App/ImportOCAF.cpp index ce4f8fb183..06c63d485b 100644 --- a/src/Mod/Import/App/ImportOCAF.cpp +++ b/src/Mod/Import/App/ImportOCAF.cpp @@ -22,29 +22,29 @@ #include "PreCompiled.h" #if defined(__MINGW32__) -# define WNT // avoid conflict with GUID +#define WNT// avoid conflict with GUID #endif #ifndef _PreComp_ -# include -# include // for Precision::Confusion() -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // for Precision::Confusion() +#include #endif #include @@ -57,21 +57,21 @@ #ifdef HAVE_TBB -# include -# include -# include +#include +#include +#include #endif using namespace Import; #if OCC_VERSION_HEX >= 0x070500 // See https://dev.opencascade.org/content/occt-3d-viewer-becomes-srgb-aware -# define OCC_COLOR_SPACE Quantity_TOC_sRGB +#define OCC_COLOR_SPACE Quantity_TOC_sRGB #else -# define OCC_COLOR_SPACE Quantity_TOC_RGB +#define OCC_COLOR_SPACE Quantity_TOC_RGB #endif -static inline App::Color convertColor(const Quantity_ColorRGBA &c) +static inline App::Color convertColor(const Quantity_ColorRGBA& c) { Standard_Real r, g, b; c.GetRGB().Values(r, g, b, OCC_COLOR_SPACE); @@ -84,9 +84,11 @@ static inline App::Color convertColor(const Quantity_ColorRGBA &c) #define OCAF_KEEP_PLACEMENT ImportOCAF::ImportOCAF(Handle(TDocStd_Document) h, App::Document* d, const std::string& name) - : pDoc(h), doc(d), default_name(name) + : pDoc(h) + , doc(d) + , default_name(name) { - aShapeTool = XCAFDoc_DocumentTool::ShapeTool (pDoc->Main()); + aShapeTool = XCAFDoc_DocumentTool::ShapeTool(pDoc->Main()); aColorTool = XCAFDoc_DocumentTool::ColorTool(pDoc->Main()); } @@ -129,11 +131,14 @@ void ImportOCAF::loadShapes() void ImportOCAF::setMerge(bool merge) { - this->merge=merge; + this->merge = merge; } -void ImportOCAF::loadShapes(const TDF_Label& label, const TopLoc_Location& loc, - const std::string& defaultname, const std::string& assembly, bool isRef, +void ImportOCAF::loadShapes(const TDF_Label& label, + const TopLoc_Location& loc, + const std::string& defaultname, + const std::string& assembly, + bool isRef, std::vector& lValue) { int hash = 0; @@ -143,59 +148,61 @@ void ImportOCAF::loadShapes(const TDF_Label& label, const TopLoc_Location& loc, #endif TopoDS_Shape aShape; - std::vector localValue; + std::vector localValue; - if (aShapeTool->GetShape(label,aShape)) { + if (aShapeTool->GetShape(label, aShape)) { hash = aShape.HashCode(HashUpper); } Handle(TDataStd_Name) name; std::string part_name = defaultname; - if (label.FindAttribute(TDataStd_Name::GetID(),name)) { + if (label.FindAttribute(TDataStd_Name::GetID(), name)) { TCollection_ExtendedString extstr = name->Get(); - char* str = new char[extstr.LengthOfCString()+1]; + char* str = new char[extstr.LengthOfCString() + 1]; extstr.ToUTF8CString(str); part_name = str; - delete [] str; + delete[] str; if (part_name.empty()) { part_name = defaultname; } else { - bool ws=true; + bool ws = true; for (char it : part_name) { if (it != ' ') { ws = false; break; } } - if (ws) + if (ws) { part_name = defaultname; + } } } TopLoc_Location part_loc = loc; Handle(XCAFDoc_Location) hLoc; if (label.FindAttribute(XCAFDoc_Location::GetID(), hLoc)) { - if (isRef) + if (isRef) { part_loc = part_loc * hLoc->Get(); - else + } + else { part_loc = hLoc->Get(); + } } #ifdef FC_DEBUG Base::Console().Log("H:%d, N:%s, T:%d, A:%d, S:%d, C:%d, SS:%d, F:%d, R:%d, C:%d, SS:%d\n", - hash, - part_name.c_str(), - aShapeTool->IsTopLevel(label), - aShapeTool->IsAssembly(label), - aShapeTool->IsShape(label), - aShapeTool->IsCompound(label), - aShapeTool->IsSimpleShape(label), - aShapeTool->IsFree(label), - aShapeTool->IsReference(label), - aShapeTool->IsComponent(label), - aShapeTool->IsSubShape(label) - ); + hash, + part_name.c_str(), + aShapeTool->IsTopLevel(label), + aShapeTool->IsAssembly(label), + aShapeTool->IsShape(label), + aShapeTool->IsCompound(label), + aShapeTool->IsSimpleShape(label), + aShapeTool->IsFree(label), + aShapeTool->IsReference(label), + aShapeTool->IsComponent(label), + aShapeTool->IsSubShape(label)); #endif #if defined(OCAF_KEEP_PLACEMENT) @@ -215,44 +222,50 @@ void ImportOCAF::loadShapes(const TDF_Label& label, const TopLoc_Location& loc, if (isRef || myRefShapes.find(hash) == myRefShapes.end()) { TopoDS_Shape aShape; - if (isRef && aShapeTool->GetShape(label, aShape)) + if (isRef && aShapeTool->GetShape(label, aShape)) { myRefShapes.insert(aShape.HashCode(HashUpper)); + } if (aShapeTool->IsSimpleShape(label) && (isRef || aShapeTool->IsFree(label))) { - if (!asm_name.empty()) + if (!asm_name.empty()) { part_name = asm_name; + } - // TODO: The merge parameter (last one from createShape) should become an Importer/Exporter - // option within the FreeCAD preference menu - // Currently it is merging STEP Compound Shape into a single Shape Part::Feature which - // is an OpenCascade computed Compound - if (isRef) + // TODO: The merge parameter (last one from createShape) should become an + // Importer/Exporter option within the FreeCAD preference menu Currently it is merging + // STEP Compound Shape into a single Shape Part::Feature which is an OpenCascade + // computed Compound + if (isRef) { createShape(label, loc, part_name, lValue, this->merge); - else + } + else { createShape(label, part_loc, part_name, localValue, this->merge); + } } else { if (aShapeTool->IsSimpleShape(label)) { // We are not creating a list of Part::Feature in that case but just // a single Part::Feature which has as a Shape a Compound of the Subshapes contained // within the global shape - // This is standard behavior of many STEP reader and avoid to register a crazy amount of - // Shape within the Tree as STEP file do mostly contain large assemblies + // This is standard behavior of many STEP reader and avoid to register a crazy + // amount of Shape within the Tree as STEP file do mostly contain large assemblies return; } // This is probably an Assembly let's try to create a Compound with the name for (TDF_ChildIterator it(label); it.More(); it.Next()) { - if (isRef) + if (isRef) { loadShapes(it.Value(), part_loc, part_name, asm_name, false, localValue); - else + } + else { loadShapes(it.Value(), part_loc, part_name, asm_name, isRef, localValue); + } } if (!localValue.empty()) { if (aShapeTool->IsAssembly(label)) { - App::Part *pcPart = nullptr; - pcPart = static_cast(doc->addObject("App::Part",asm_name.c_str())); + App::Part* pcPart = nullptr; + pcPart = static_cast(doc->addObject("App::Part", asm_name.c_str())); pcPart->Label.setValue(asm_name); pcPart->addObjects(localValue); @@ -268,8 +281,11 @@ void ImportOCAF::loadShapes(const TDF_Label& label, const TopLoc_Location& loc, } } -void ImportOCAF::createShape(const TDF_Label& label, const TopLoc_Location& loc, const std::string& name, - std::vector& lValue, bool mergeShape) +void ImportOCAF::createShape(const TDF_Label& label, + const TopLoc_Location& loc, + const std::string& name, + std::vector& lValue, + bool mergeShape) { const TopoDS_Shape& aShape = aShapeTool->GetShape(label); #ifdef HAVE_TBB @@ -280,8 +296,8 @@ void ImportOCAF::createShape(const TDF_Label& label, const TopLoc_Location& loc, if (!aShape.IsNull() && aShape.ShapeType() == TopAbs_COMPOUND) { TopExp_Explorer xp; int ctSolids = 0, ctShells = 0, ctVertices = 0, ctEdges = 0; - std::vector localValue; - App::Part *pcPart = nullptr; + std::vector localValue; + App::Part* pcPart = nullptr; if (mergeShape) { @@ -294,26 +310,26 @@ void ImportOCAF::createShape(const TDF_Label& label, const TopLoc_Location& loc, TopoDS_Compound comp; builder.MakeCompound(comp); -/* - std::vector colors; - for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) { - Quantity_Color aColor; - App::Color color(0.8f,0.8f,0.8f); - if (aColorTool->GetColor(xp.Current(), XCAFDoc_ColorGen, aColor) || - aColorTool->GetColor(xp.Current(), XCAFDoc_ColorSurf, aColor) || - aColorTool->GetColor(xp.Current(), XCAFDoc_ColorCurv, aColor)) { - color.r = (float)aColor.Red(); - color.g = (float)aColor.Green(); - color.b = (float)aColor.Blue(); - colors.push_back(color); - } - } + /* + std::vector colors; + for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) { + Quantity_Color aColor; + App::Color color(0.8f,0.8f,0.8f); + if (aColorTool->GetColor(xp.Current(), XCAFDoc_ColorGen, aColor) || + aColorTool->GetColor(xp.Current(), XCAFDoc_ColorSurf, aColor) || + aColorTool->GetColor(xp.Current(), XCAFDoc_ColorCurv, aColor)) { + color.r = (float)aColor.Red(); + color.g = (float)aColor.Green(); + color.b = (float)aColor.Blue(); + colors.push_back(color); + } + } - if (colors.size() > 1) { - createShape(label, loc, name, lValue, false); - return; - } -*/ + if (colors.size() > 1) { + createShape(label, loc, name, lValue, false); + return; + } + */ for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) { const TopoDS_Shape& sh = xp.Current(); if (!sh.IsNull()) { @@ -344,7 +360,7 @@ void ImportOCAF::createShape(const TDF_Label& label, const TopLoc_Location& loc, // Ok we got a Compound which is computed // Just need to add it to a Part::Feature and push it to lValue - if (!comp.IsNull() && (ctSolids||ctShells||ctEdges||ctVertices)) { + if (!comp.IsNull() && (ctSolids || ctShells || ctEdges || ctVertices)) { Part::Feature* part = static_cast(doc->addObject("Part::Feature")); // Let's allocate the relative placement of the Compound from the STEP file tryPlacementFromLoc(part, loc); @@ -371,7 +387,7 @@ void ImportOCAF::createShape(const TDF_Label& label, const TopLoc_Location& loc, } if (!localValue.empty() && !mergeShape) { - pcPart = static_cast(doc->addObject("App::Part",name.c_str())); + pcPart = static_cast(doc->addObject("App::Part", name.c_str())); pcPart->Label.setValue(name); // localValue contain the objects that must added to the local Part @@ -379,39 +395,44 @@ void ImportOCAF::createShape(const TDF_Label& label, const TopLoc_Location& loc, pcPart->addObjects(localValue); // Let's compute relative placement of the Part -/* - gp_Trsf trf; - Base::Matrix4D mtrx; - if ( loc.IsIdentity() ) - trf = loc.Transformation(); - else - trf = TopLoc_Location(loc.FirstDatum()).Transformation(); - Part::TopoShape::convertToMatrix(trf, mtrx); - Base::Placement pl; - pl.fromMatrix(mtrx); - pcPart->Placement.setValue(pl); -*/ + /* + gp_Trsf trf; + Base::Matrix4D mtrx; + if ( loc.IsIdentity() ) + trf = loc.Transformation(); + else + trf = TopLoc_Location(loc.FirstDatum()).Transformation(); + Part::TopoShape::convertToMatrix(trf, mtrx); + Base::Placement pl; + pl.fromMatrix(mtrx); + pcPart->Placement.setValue(pl); + */ lValue.push_back(pcPart); } - if (ctSolids > 0 || ctShells > 0) + if (ctSolids > 0 || ctShells > 0) { return; + } } else if (!aShape.IsNull()) { createShape(aShape, loc, name, lValue); } } -void ImportOCAF::createShape(const TopoDS_Shape& aShape, const TopLoc_Location& loc, const std::string& name, +void ImportOCAF::createShape(const TopoDS_Shape& aShape, + const TopLoc_Location& loc, + const std::string& name, std::vector& lvalue) { Part::Feature* part = static_cast(doc->addObject("Part::Feature")); - if (!loc.IsIdentity()) + if (!loc.IsIdentity()) { // part->Shape.setValue(aShape.Moved(TopLoc_Location(loc.FirstDatum()))); part->Shape.setValue(aShape.Moved(loc)); - else + } + else { part->Shape.setValue(aShape); + } part->Label.setValue(name); lvalue.push_back(part); @@ -422,10 +443,10 @@ void ImportOCAF::createShape(const TopoDS_Shape& aShape, const TopLoc_Location& void ImportOCAF::loadColors(Part::Feature* part, const TopoDS_Shape& aShape) { Quantity_ColorRGBA aColor; - App::Color color(0.8f,0.8f,0.8f); - if (aColorTool->GetColor(aShape, XCAFDoc_ColorGen, aColor) || - aColorTool->GetColor(aShape, XCAFDoc_ColorSurf, aColor) || - aColorTool->GetColor(aShape, XCAFDoc_ColorCurv, aColor)) { + App::Color color(0.8f, 0.8f, 0.8f); + if (aColorTool->GetColor(aShape, XCAFDoc_ColorGen, aColor) + || aColorTool->GetColor(aShape, XCAFDoc_ColorSurf, aColor) + || aColorTool->GetColor(aShape, XCAFDoc_ColorCurv, aColor)) { color = convertColor(aColor); std::vector colors; colors.push_back(color); @@ -433,7 +454,7 @@ void ImportOCAF::loadColors(Part::Feature* part, const TopoDS_Shape& aShape) } TopTools_IndexedMapOfShape faces; - TopExp_Explorer xp(aShape,TopAbs_FACE); + TopExp_Explorer xp(aShape, TopAbs_FACE); while (xp.More()) { faces.Add(xp.Current()); xp.Next(); @@ -442,14 +463,14 @@ void ImportOCAF::loadColors(Part::Feature* part, const TopoDS_Shape& aShape) bool found_face_color = false; std::vector faceColors; faceColors.resize(faces.Extent(), color); - xp.Init(aShape,TopAbs_FACE); + xp.Init(aShape, TopAbs_FACE); while (xp.More()) { - if (aColorTool->GetColor(xp.Current(), XCAFDoc_ColorGen, aColor) || - aColorTool->GetColor(xp.Current(), XCAFDoc_ColorSurf, aColor) || - aColorTool->GetColor(xp.Current(), XCAFDoc_ColorCurv, aColor)) { + if (aColorTool->GetColor(xp.Current(), XCAFDoc_ColorGen, aColor) + || aColorTool->GetColor(xp.Current(), XCAFDoc_ColorSurf, aColor) + || aColorTool->GetColor(xp.Current(), XCAFDoc_ColorCurv, aColor)) { int index = faces.FindIndex(xp.Current()); color = convertColor(aColor); - faceColors[index-1] = color; + faceColors[index - 1] = color; found_face_color = true; } xp.Next(); @@ -464,8 +485,7 @@ void ImportOCAF::loadColors(Part::Feature* part, const TopoDS_Shape& aShape) ImportOCAFCmd::ImportOCAFCmd(Handle(TDocStd_Document) h, App::Document* d, const std::string& name) : ImportOCAF(h, d, name) -{ -} +{} void ImportOCAFCmd::applyColors(Part::Feature* part, const std::vector& colors) { @@ -475,9 +495,11 @@ void ImportOCAFCmd::applyColors(Part::Feature* part, const std::vectorMain()); + aShapeTool = XCAFDoc_DocumentTool::ShapeTool(hdoc->Main()); hColors = XCAFDoc_DocumentTool::ColorTool(hdoc->Main()); } @@ -487,11 +509,11 @@ void ImportXCAF::loadShapes() { // collect sequence of labels to display TDF_LabelSequence shapeLabels, colorLabels; - aShapeTool->GetFreeShapes (shapeLabels); + aShapeTool->GetFreeShapes(shapeLabels); hColors->GetColors(colorLabels); // set presentations and show - for (Standard_Integer i=1; i <= shapeLabels.Length(); i++ ) { + for (Standard_Integer i = 1; i <= shapeLabels.Length(); i++) { // get the shapes and attributes const TDF_Label& label = shapeLabels.Value(i); loadShapes(label); @@ -530,8 +552,8 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna std::map::const_iterator jt; jt = myColorMap.find(shape.HashCode(INT_MAX)); - App::Color partColor(0.8f,0.8f,0.8f); -#if 0//TODO + App::Color partColor(0.8f, 0.8f, 0.8f); +#if 0// TODO Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider(part); if (vp && vp->isDerivedFrom(PartGui::ViewProviderPart::getClassTypeId())) { if (jt != myColorMap.end()) { @@ -558,7 +580,7 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna // check for colors per face if (perface && !myColorMap.empty()) { TopTools_IndexedMapOfShape faces; - TopExp_Explorer xp(shape,TopAbs_FACE); + TopExp_Explorer xp(shape, TopAbs_FACE); while (xp.More()) { faces.Add(xp.Current()); xp.Next(); @@ -567,19 +589,19 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna bool found_face_color = false; std::vector faceColors; faceColors.resize(faces.Extent(), partColor); - xp.Init(shape,TopAbs_FACE); + xp.Init(shape, TopAbs_FACE); while (xp.More()) { jt = myColorMap.find(xp.Current().HashCode(INT_MAX)); if (jt != myColorMap.end()) { int index = faces.FindIndex(xp.Current()); - faceColors[index-1] = convertColor(jt->second); + faceColors[index - 1] = convertColor(jt->second); found_face_color = true; } xp.Next(); } if (found_face_color) { -#if 0//TODO +#if 0// TODO Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider(part); if (vp && vp->isDerivedFrom(PartGui::ViewProviderPartExt::getClassTypeId())) { static_cast(vp)->DiffuseColor.setValues(faceColors); @@ -592,53 +614,60 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna void ImportXCAF::loadShapes(const TDF_Label& label) { TopoDS_Shape aShape; - if (aShapeTool->GetShape(label,aShape)) { - //if (aShapeTool->IsReference(label)) { - // TDF_Label reflabel; - // if (aShapeTool->GetReferredShape(label, reflabel)) { - // loadShapes(reflabel); - // } - //} + if (aShapeTool->GetShape(label, aShape)) { + // if (aShapeTool->IsReference(label)) { + // TDF_Label reflabel; + // if (aShapeTool->GetReferredShape(label, reflabel)) { + // loadShapes(reflabel); + // } + // } if (aShapeTool->IsTopLevel(label)) { int ctSolids = 0, ctShells = 0, ctComps = 0; // add the shapes TopExp_Explorer xp; - for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) + for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) { this->mySolids[xp.Current().HashCode(INT_MAX)] = (xp.Current()); - for (xp.Init(aShape, TopAbs_SHELL, TopAbs_SOLID); xp.More(); xp.Next(), ctShells++) + } + for (xp.Init(aShape, TopAbs_SHELL, TopAbs_SOLID); xp.More(); xp.Next(), ctShells++) { this->myShells[xp.Current().HashCode(INT_MAX)] = (xp.Current()); + } // if no solids and no shells were found then go for compounds if (ctSolids == 0 && ctShells == 0) { - for (xp.Init(aShape, TopAbs_COMPOUND); xp.More(); xp.Next(), ctComps++) + for (xp.Init(aShape, TopAbs_COMPOUND); xp.More(); xp.Next(), ctComps++) { this->myCompds[xp.Current().HashCode(INT_MAX)] = (xp.Current()); + } } if (ctComps == 0) { - for (xp.Init(aShape, TopAbs_FACE, TopAbs_SHELL); xp.More(); xp.Next()) + for (xp.Init(aShape, TopAbs_FACE, TopAbs_SHELL); xp.More(); xp.Next()) { this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current()); - for (xp.Init(aShape, TopAbs_WIRE, TopAbs_FACE); xp.More(); xp.Next()) + } + for (xp.Init(aShape, TopAbs_WIRE, TopAbs_FACE); xp.More(); xp.Next()) { this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current()); - for (xp.Init(aShape, TopAbs_EDGE, TopAbs_WIRE); xp.More(); xp.Next()) + } + for (xp.Init(aShape, TopAbs_EDGE, TopAbs_WIRE); xp.More(); xp.Next()) { this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current()); - for (xp.Init(aShape, TopAbs_VERTEX, TopAbs_EDGE); xp.More(); xp.Next()) + } + for (xp.Init(aShape, TopAbs_VERTEX, TopAbs_EDGE); xp.More(); xp.Next()) { this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current()); + } } } // getting color Quantity_ColorRGBA col; - if (hColors->GetColor(label, XCAFDoc_ColorGen, col) || - hColors->GetColor(label, XCAFDoc_ColorSurf, col) || - hColors->GetColor(label, XCAFDoc_ColorCurv, col)) { + if (hColors->GetColor(label, XCAFDoc_ColorGen, col) + || hColors->GetColor(label, XCAFDoc_ColorSurf, col) + || hColors->GetColor(label, XCAFDoc_ColorCurv, col)) { // add defined color myColorMap[aShape.HashCode(INT_MAX)] = col; } else { // http://www.opencascade.org/org/forum/thread_17107/ TopoDS_Iterator it; - for (it.Initialize(aShape);it.More(); it.Next()) { - if (hColors->GetColor(it.Value(), XCAFDoc_ColorGen, col) || - hColors->GetColor(it.Value(), XCAFDoc_ColorSurf, col) || - hColors->GetColor(it.Value(), XCAFDoc_ColorCurv, col)) { + for (it.Initialize(aShape); it.More(); it.Next()) { + if (hColors->GetColor(it.Value(), XCAFDoc_ColorGen, col) + || hColors->GetColor(it.Value(), XCAFDoc_ColorSurf, col) + || hColors->GetColor(it.Value(), XCAFDoc_ColorCurv, col)) { // add defined color myColorMap[it.Value().HashCode(INT_MAX)] = col; } @@ -647,14 +676,15 @@ void ImportXCAF::loadShapes(const TDF_Label& label) // getting names Handle(TDataStd_Name) name; - if (label.FindAttribute(TDataStd_Name::GetID(),name)) { + if (label.FindAttribute(TDataStd_Name::GetID(), name)) { TCollection_ExtendedString extstr = name->Get(); - char* str = new char[extstr.LengthOfCString()+1]; + char* str = new char[extstr.LengthOfCString() + 1]; extstr.ToUTF8CString(str); std::string labelName(str); - if (!labelName.empty()) + if (!labelName.empty()) { myNameMap[aShape.HashCode(INT_MAX)] = labelName; - delete [] str; + } + delete[] str; } #if 0 diff --git a/src/Mod/Import/App/ImportOCAF.h b/src/Mod/Import/App/ImportOCAF.h index 65549e32a7..42276e8477 100644 --- a/src/Mod/Import/App/ImportOCAF.h +++ b/src/Mod/Import/App/ImportOCAF.h @@ -43,15 +43,18 @@ class TDF_Label; class TopLoc_Location; -namespace App { +namespace App +{ class Document; class DocumentObject; -} -namespace Part { +}// namespace App +namespace Part +{ class Feature; } -namespace Import { +namespace Import +{ class ImportExport ImportOCAF { @@ -62,11 +65,24 @@ public: void setMerge(bool); private: - void loadShapes(const TDF_Label& label, const TopLoc_Location&, const std::string& partname, const std::string& assembly, bool isRef, std::vector &); - void createShape(const TDF_Label& label, const TopLoc_Location&, const std::string&, std::vector &, bool); - void createShape(const TopoDS_Shape& label, const TopLoc_Location&, const std::string&, std::vector &); + void loadShapes(const TDF_Label& label, + const TopLoc_Location&, + const std::string& partname, + const std::string& assembly, + bool isRef, + std::vector&); + void createShape(const TDF_Label& label, + const TopLoc_Location&, + const std::string&, + std::vector&, + bool); + void createShape(const TopoDS_Shape& label, + const TopLoc_Location&, + const std::string&, + std::vector&); void loadColors(Part::Feature* part, const TopoDS_Shape& aShape); - virtual void applyColors(Part::Feature*, const std::vector&){} + virtual void applyColors(Part::Feature*, const std::vector&) + {} static void tryPlacementFromLoc(App::GeoFeature*, const TopLoc_Location&); static void tryPlacementFromMatrix(App::GeoFeature*, const Base::Matrix4D&); @@ -75,17 +91,18 @@ private: App::Document* doc; Handle(XCAFDoc_ShapeTool) aShapeTool; Handle(XCAFDoc_ColorTool) aColorTool; - bool merge{true}; + bool merge {true}; std::string default_name; std::set myRefShapes; static const int HashUpper = INT_MAX; }; -class ImportExport ImportOCAFCmd : public ImportOCAF +class ImportExport ImportOCAFCmd: public ImportOCAF { public: ImportOCAFCmd(Handle(TDocStd_Document) h, App::Document* d, const std::string& name); - std::map > getPartColorsMap() const { + std::map> getPartColorsMap() const + { return partColors; } @@ -93,7 +110,7 @@ private: void applyColors(Part::Feature* part, const std::vector& colors) override; private: - std::map > partColors; + std::map> partColors; }; class ImportXCAF @@ -104,9 +121,10 @@ public: void loadShapes(); private: - void createShape(const TopoDS_Shape& shape, bool perface=false, bool setname=false) const; + void createShape(const TopoDS_Shape& shape, bool perface = false, bool setname = false) const; void loadShapes(const TDF_Label& label); - virtual void applyColors(Part::Feature*, const std::vector&){} + virtual void applyColors(Part::Feature*, const std::vector&) + {} private: Handle(TDocStd_Document) hdoc; @@ -122,6 +140,6 @@ private: std::map myNameMap; }; -} +}// namespace Import -#endif //IMPORT_IMPORTOCAF_H +#endif// IMPORT_IMPORTOCAF_H diff --git a/src/Mod/Import/App/ImportOCAF2.cpp b/src/Mod/Import/App/ImportOCAF2.cpp index 5156c2e904..40608722c5 100644 --- a/src/Mod/Import/App/ImportOCAF2.cpp +++ b/src/Mod/Import/App/ImportOCAF2.cpp @@ -22,32 +22,32 @@ #include "PreCompiled.h" #if defined(__MINGW32__) -# define WNT // avoid conflict with GUID +#define WNT// avoid conflict with GUID #endif #ifndef _PreComp_ -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif #include -#include #include +#include #include #include @@ -66,18 +66,18 @@ #if OCC_VERSION_HEX >= 0x070500 // See https://dev.opencascade.org/content/occt-3d-viewer-becomes-srgb-aware -# define OCC_COLOR_SPACE Quantity_TOC_sRGB +#define OCC_COLOR_SPACE Quantity_TOC_sRGB #else -# define OCC_COLOR_SPACE Quantity_TOC_RGB +#define OCC_COLOR_SPACE Quantity_TOC_RGB #endif -FC_LOG_LEVEL_INIT("Import",true,true) +FC_LOG_LEVEL_INIT("Import", true, true) using namespace Import; ///////////////////////////////////////////////////////////////////// -static inline App::Color convertColor(const Quantity_ColorRGBA &c) +static inline App::Color convertColor(const Quantity_ColorRGBA& c) { Standard_Real r, g, b; c.GetRGB().Values(r, g, b, OCC_COLOR_SPACE); @@ -87,23 +87,27 @@ static inline App::Color convertColor(const Quantity_ColorRGBA &c) 1.0f - static_cast(c.Alpha())); } -static inline Quantity_ColorRGBA convertColor(const App::Color &c) +static inline Quantity_ColorRGBA convertColor(const App::Color& c) { return Quantity_ColorRGBA(Quantity_Color(c.r, c.g, c.b, OCC_COLOR_SPACE), 1.0f - c.a); } -static inline std::ostream& operator<<(std::ostream& os, const Quantity_ColorRGBA &c) { +static inline std::ostream& operator<<(std::ostream& os, const Quantity_ColorRGBA& c) +{ App::Color color = convertColor(c); - auto toHex = [](float v) {return boost::format("%02X") % static_cast(v*255);}; + auto toHex = [](float v) { + return boost::format("%02X") % static_cast(v * 255); + }; return os << "#" << toHex(color.r) << toHex(color.g) << toHex(color.b) << toHex(color.a); } -static std::string labelName(TDF_Label label) { +static std::string labelName(TDF_Label label) +{ std::string txt; Handle(TDataStd_Name) name; - if (!label.IsNull() && label.FindAttribute(TDataStd_Name::GetID(),name)) { + if (!label.IsNull() && label.FindAttribute(TDataStd_Name::GetID(), name)) { TCollection_ExtendedString extstr = name->Get(); - char* str = new char[extstr.LengthOfCString()+1]; + char* str = new char[extstr.LengthOfCString() + 1]; extstr.ToUTF8CString(str); txt = str; delete[] str; @@ -112,52 +116,63 @@ static std::string labelName(TDF_Label label) { return txt; } -static void printLabel(TDF_Label label, Handle(XCAFDoc_ShapeTool) aShapeTool, - Handle(XCAFDoc_ColorTool) aColorTool, const char *msg = nullptr) +static void printLabel(TDF_Label label, + Handle(XCAFDoc_ShapeTool) aShapeTool, + Handle(XCAFDoc_ColorTool) aColorTool, + const char* msg = nullptr) { - if(label.IsNull() || !FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG)) + if (label.IsNull() || !FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG)) { return; - if(!msg) msg = "Label: "; - TCollection_AsciiString entry; - TDF_Tool::Entry(label,entry); - std::ostringstream ss; - ss << msg << entry << ", " << labelName(label) - << (aShapeTool->IsShape(label)?", shape":"") - << (aShapeTool->IsTopLevel(label)?", topLevel":"") - << (aShapeTool->IsFree(label)?", free":"") - << (aShapeTool->IsAssembly(label)?", assembly":"") - << (aShapeTool->IsSimpleShape(label)?", simple":"") - << (aShapeTool->IsCompound(label)?", compound":"") - << (aShapeTool->IsReference(label)?", reference":"") - << (aShapeTool->IsComponent(label)?", component":"") - << (aShapeTool->IsSubShape(label)?", subshape":""); - if(aShapeTool->IsSubShape(label)) { - auto shape = aShapeTool->GetShape(label); - if(!shape.IsNull()) - ss << ", " << Part::TopoShape::shapeName(shape.ShapeType(),true); } - if(aShapeTool->IsShape(label)) { + if (!msg) { + msg = "Label: "; + } + TCollection_AsciiString entry; + TDF_Tool::Entry(label, entry); + std::ostringstream ss; + ss << msg << entry << ", " << labelName(label) << (aShapeTool->IsShape(label) ? ", shape" : "") + << (aShapeTool->IsTopLevel(label) ? ", topLevel" : "") + << (aShapeTool->IsFree(label) ? ", free" : "") + << (aShapeTool->IsAssembly(label) ? ", assembly" : "") + << (aShapeTool->IsSimpleShape(label) ? ", simple" : "") + << (aShapeTool->IsCompound(label) ? ", compound" : "") + << (aShapeTool->IsReference(label) ? ", reference" : "") + << (aShapeTool->IsComponent(label) ? ", component" : "") + << (aShapeTool->IsSubShape(label) ? ", subshape" : ""); + if (aShapeTool->IsSubShape(label)) { + auto shape = aShapeTool->GetShape(label); + if (!shape.IsNull()) { + ss << ", " << Part::TopoShape::shapeName(shape.ShapeType(), true); + } + } + if (aShapeTool->IsShape(label)) { Quantity_ColorRGBA c; - if(aColorTool->GetColor(label,XCAFDoc_ColorGen,c)) + if (aColorTool->GetColor(label, XCAFDoc_ColorGen, c)) { ss << ", gc: " << c; - if(aColorTool->GetColor(label,XCAFDoc_ColorSurf,c)) + } + if (aColorTool->GetColor(label, XCAFDoc_ColorSurf, c)) { ss << ", sc: " << c; - if(aColorTool->GetColor(label,XCAFDoc_ColorCurv,c)) + } + if (aColorTool->GetColor(label, XCAFDoc_ColorCurv, c)) { ss << ", cc: " << c; + } } ss << std::endl; - Base::Console().Notify("ImportOCAF2",ss.str().c_str()); + Base::Console().Notify("ImportOCAF2", ss.str().c_str()); } -static void dumpLabels(TDF_Label label, Handle(XCAFDoc_ShapeTool) aShapeTool, - Handle(XCAFDoc_ColorTool) aColorTool, int depth=0) +static void dumpLabels(TDF_Label label, + Handle(XCAFDoc_ShapeTool) aShapeTool, + Handle(XCAFDoc_ColorTool) aColorTool, + int depth = 0) { - std::string indent(depth*2,' '); - printLabel(label,aShapeTool,aColorTool,indent.c_str()); + std::string indent(depth * 2, ' '); + printLabel(label, aShapeTool, aColorTool, indent.c_str()); TDF_ChildIterator it; - for (it.Initialize(label); it.More(); it.Next()) - dumpLabels(it.Value(),aShapeTool,aColorTool,depth+1); + for (it.Initialize(label); it.More(); it.Next()) { + dumpLabels(it.Value(), aShapeTool, aColorTool, depth + 1); + } } ///////////////////////////////////////////////////////////////////// @@ -172,9 +187,11 @@ ImportOCAFOptions::ImportOCAFOptions() } ImportOCAF2::ImportOCAF2(Handle(TDocStd_Document) h, App::Document* d, const std::string& name) - : pDoc(h), pDocument(d), default_name(name) + : pDoc(h) + , pDocument(d) + , default_name(name) { - aShapeTool = XCAFDoc_DocumentTool::ShapeTool (pDoc->Main()); + aShapeTool = XCAFDoc_DocumentTool::ShapeTool(pDoc->Main()); aColorTool = XCAFDoc_DocumentTool::ColorTool(pDoc->Main()); if (d->isSaved()) { @@ -201,11 +218,15 @@ ImportOCAFOptions ImportOCAF2::customImportOptions() defaultOptions.expandCompound = settings.getExpandCompound(); defaultOptions.mode = static_cast(settings.getImportMode()); - auto hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); - defaultOptions.defaultFaceColor.setPackedValue(hGrp->GetUnsigned("DefaultShapeColor", defaultOptions.defaultFaceColor.getPackedValue())); + auto hGrp = + App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); + defaultOptions.defaultFaceColor.setPackedValue( + hGrp->GetUnsigned("DefaultShapeColor", defaultOptions.defaultFaceColor.getPackedValue())); defaultOptions.defaultFaceColor.a = 0; - defaultOptions.defaultEdgeColor.setPackedValue(hGrp->GetUnsigned("DefaultShapeLineColor", defaultOptions.defaultEdgeColor.getPackedValue())); + defaultOptions.defaultEdgeColor.setPackedValue( + hGrp->GetUnsigned("DefaultShapeLineColor", + defaultOptions.defaultEdgeColor.getPackedValue())); defaultOptions.defaultEdgeColor.a = 0; return defaultOptions; @@ -227,7 +248,7 @@ void ImportOCAF2::setUseLinkGroup(bool enable) void ImportOCAF2::setMode(int m) { - if (m<0 || m >= ModeMax) { + if (m < 0 || m >= ModeMax) { FC_WARN("Invalid import mode " << m); } else { @@ -245,85 +266,98 @@ void ImportOCAF2::setMode(int m) } } -static void setPlacement(App::PropertyPlacement *prop, const TopoDS_Shape &shape) { - prop->setValue(Base::Placement( - Part::TopoShape::convert(shape.Location().Transformation()))*prop->getValue()); +static void setPlacement(App::PropertyPlacement* prop, const TopoDS_Shape& shape) +{ + prop->setValue(Base::Placement(Part::TopoShape::convert(shape.Location().Transformation())) + * prop->getValue()); } -std::string ImportOCAF2::getLabelName(TDF_Label label) { +std::string ImportOCAF2::getLabelName(TDF_Label label) +{ std::string name; - if(label.IsNull()) + if (label.IsNull()) { return name; - if(!XCAFDoc_ShapeTool::IsReference(label)) + } + if (!XCAFDoc_ShapeTool::IsReference(label)) { return labelName(label); - if(!options.useBaseName) + } + if (!options.useBaseName) { name = labelName(label); + } TDF_Label ref; - if(name.empty() && XCAFDoc_ShapeTool::GetReferredShape(label,ref)) + if (name.empty() && XCAFDoc_ShapeTool::GetReferredShape(label, ref)) { name = labelName(ref); + } return name; } -void ImportOCAF2::setObjectName(Info &info, TDF_Label label) { - if(!info.obj) +void ImportOCAF2::setObjectName(Info& info, TDF_Label label) +{ + if (!info.obj) { return; + } info.baseName = getLabelName(label); - if(!info.baseName.empty()) + if (!info.baseName.empty()) { info.obj->Label.setValue(info.baseName.c_str()); - else{ + } + else { auto linked = info.obj->getLinkedObject(false); - if(!linked || linked==info.obj) + if (!linked || linked == info.obj) { return; + } info.obj->Label.setValue(linked->Label.getValue()); } } -bool ImportOCAF2::getColor(const TopoDS_Shape &shape, Info &info, bool check, bool noDefault) { +bool ImportOCAF2::getColor(const TopoDS_Shape& shape, Info& info, bool check, bool noDefault) +{ bool ret = false; Quantity_ColorRGBA aColor; - if(aColorTool->GetColor(shape, XCAFDoc_ColorSurf, aColor)) { + if (aColorTool->GetColor(shape, XCAFDoc_ColorSurf, aColor)) { App::Color c = convertColor(aColor); - if(!check || info.faceColor!=c) { + if (!check || info.faceColor != c) { info.faceColor = c; info.hasFaceColor = true; ret = true; } } - if(!noDefault && !info.hasFaceColor && aColorTool->GetColor(shape, XCAFDoc_ColorGen, aColor)) { + if (!noDefault && !info.hasFaceColor && aColorTool->GetColor(shape, XCAFDoc_ColorGen, aColor)) { App::Color c = convertColor(aColor); - if(!check || info.faceColor!=c) { + if (!check || info.faceColor != c) { info.faceColor = c; info.hasFaceColor = true; ret = true; } } - if(aColorTool->GetColor(shape, XCAFDoc_ColorCurv, aColor)) { + if (aColorTool->GetColor(shape, XCAFDoc_ColorCurv, aColor)) { App::Color c = convertColor(aColor); // Some STEP include a curve color with the same value of the face // color. And this will look weird in FC. So for shape with face // we'll ignore the curve color, if it is the same as the face color. - if((c!=info.faceColor || !TopExp_Explorer(shape,TopAbs_FACE).More()) && - (!check || info.edgeColor!=c)) - { + if ((c != info.faceColor || !TopExp_Explorer(shape, TopAbs_FACE).More()) + && (!check || info.edgeColor != c)) { info.edgeColor = c; info.hasEdgeColor = true; ret = true; } } - if(!check) { - if(!info.hasFaceColor) + if (!check) { + if (!info.hasFaceColor) { info.faceColor = options.defaultFaceColor; - if(!info.hasEdgeColor) + } + if (!info.hasEdgeColor) { info.edgeColor = options.defaultEdgeColor; + } } return ret; } -App::DocumentObject *ImportOCAF2::expandShape( - App::Document *doc, TDF_Label label, const TopoDS_Shape &shape) +App::DocumentObject* +ImportOCAF2::expandShape(App::Document* doc, TDF_Label label, const TopoDS_Shape& shape) { - if(shape.IsNull() || !TopExp_Explorer(shape,TopAbs_VERTEX).More()) + if (shape.IsNull() || !TopExp_Explorer(shape, TopAbs_VERTEX).More()) { return nullptr; + } // When saved as compound, STEP file does not support instance sharing, // meaning that even if the source compound may contain child shapes of @@ -343,43 +377,49 @@ App::DocumentObject *ImportOCAF2::expandShape( #endif std::vector objs; - if(shape.ShapeType() == TopAbs_COMPOUND) { - for(TopoDS_Iterator it(shape,Standard_False,Standard_False);it.More();it.Next()) { + if (shape.ShapeType() == TopAbs_COMPOUND) { + for (TopoDS_Iterator it(shape, Standard_False, Standard_False); it.More(); it.Next()) { TDF_Label childLabel; - if(!label.IsNull()) - aShapeTool->FindSubShape(label,it.Value(),childLabel); - auto child = expandShape(doc,childLabel,it.Value()); - if(child) { + if (!label.IsNull()) { + aShapeTool->FindSubShape(label, it.Value(), childLabel); + } + auto child = expandShape(doc, childLabel, it.Value()); + if (child) { objs.push_back(child); Info info; info.free = false; info.obj = child; - myShapes.emplace(it.Value().Located(TopLoc_Location()),info); + myShapes.emplace(it.Value().Located(TopLoc_Location()), info); } } - if(objs.empty()) + if (objs.empty()) { return nullptr; - auto compound = static_cast(doc->addObject("Part::Compound2","Compound")); + } + auto compound = + static_cast(doc->addObject("Part::Compound2", "Compound")); compound->Links.setValues(objs); // compound->Visibility.setValue(false); - setPlacement(&compound->Placement,shape); + setPlacement(&compound->Placement, shape); return compound; } Info info; info.obj = nullptr; - createObject(doc,label,shape,info,false); + createObject(doc, label, shape, info, false); return info.obj; } -bool ImportOCAF2::createObject(App::Document *doc, TDF_Label label, - const TopoDS_Shape &shape, Info &info, bool newDoc) +bool ImportOCAF2::createObject(App::Document* doc, + TDF_Label label, + const TopoDS_Shape& shape, + Info& info, + bool newDoc) { - if(shape.IsNull() || !TopExp_Explorer(shape,TopAbs_VERTEX).More()) { + if (shape.IsNull() || !TopExp_Explorer(shape, TopAbs_VERTEX).More()) { FC_WARN(labelName(label) << " has empty shape"); return false; } - getColor(shape,info); + getColor(shape, info); bool hasFaceColors = false; bool hasEdgeColors = false; @@ -388,62 +428,67 @@ bool ImportOCAF2::createObject(App::Document *doc, TDF_Label label, std::vector edgeColors; TDF_LabelSequence seq; - if(!label.IsNull() && aShapeTool->GetSubShapes(label,seq)) { + if (!label.IsNull() && aShapeTool->GetSubShapes(label, seq)) { - TopTools_IndexedMapOfShape faceMap,edgeMap; + TopTools_IndexedMapOfShape faceMap, edgeMap; TopExp::MapShapes(tshape.getShape(), TopAbs_FACE, faceMap); TopExp::MapShapes(tshape.getShape(), TopAbs_EDGE, edgeMap); - faceColors.assign(faceMap.Extent(),info.faceColor); - edgeColors.assign(edgeMap.Extent(),info.edgeColor); + faceColors.assign(faceMap.Extent(), info.faceColor); + edgeColors.assign(edgeMap.Extent(), info.edgeColor); // Two passes to get sub shape colors. First pass, look for solid, and // second pass look for face and edges. This allows lower level // subshape to override color of higher level ones. - for(int j=0;j<2;++j) { - for(int i=1;i<=seq.Length();++i) { + for (int j = 0; j < 2; ++j) { + for (int i = 1; i <= seq.Length(); ++i) { TDF_Label l = seq.Value(i); TopoDS_Shape subShape = aShapeTool->GetShape(l); - if(subShape.IsNull()) + if (subShape.IsNull()) { continue; - if(subShape.ShapeType()==TopAbs_FACE || subShape.ShapeType()==TopAbs_EDGE) { - if(j==0) + } + if (subShape.ShapeType() == TopAbs_FACE || subShape.ShapeType() == TopAbs_EDGE) { + if (j == 0) { continue; - }else if(j!=0) + } + } + else if (j != 0) { continue; + } - bool foundFaceColor=false,foundEdgeColor=false; - App::Color faceColor,edgeColor; + bool foundFaceColor = false, foundEdgeColor = false; + App::Color faceColor, edgeColor; Quantity_ColorRGBA aColor; - if(aColorTool->GetColor(l, XCAFDoc_ColorSurf, aColor) || - aColorTool->GetColor(l, XCAFDoc_ColorGen, aColor)) - { + if (aColorTool->GetColor(l, XCAFDoc_ColorSurf, aColor) + || aColorTool->GetColor(l, XCAFDoc_ColorGen, aColor)) { faceColor = convertColor(aColor); foundFaceColor = true; } - if(aColorTool->GetColor(l, XCAFDoc_ColorCurv, aColor)) { + if (aColorTool->GetColor(l, XCAFDoc_ColorCurv, aColor)) { edgeColor = convertColor(aColor); foundEdgeColor = true; - if(j==0 && foundFaceColor && !faceColors.empty() && edgeColor==faceColor) { + if (j == 0 && foundFaceColor && !faceColors.empty() && edgeColor == faceColor) { // Do not set edge the same color as face foundEdgeColor = false; } } - if(foundFaceColor) { - for(TopExp_Explorer exp(subShape,TopAbs_FACE);exp.More();exp.Next()) { - int idx = faceMap.FindIndex(exp.Current())-1; - if(idx>=0 && idx<(int)faceColors.size()) { + if (foundFaceColor) { + for (TopExp_Explorer exp(subShape, TopAbs_FACE); exp.More(); exp.Next()) { + int idx = faceMap.FindIndex(exp.Current()) - 1; + if (idx >= 0 && idx < (int)faceColors.size()) { faceColors[idx] = faceColor; hasFaceColors = true; info.hasFaceColor = true; - }else + } + else { assert(0); + } } } - if(foundEdgeColor) { - for(TopExp_Explorer exp(subShape,TopAbs_EDGE);exp.More();exp.Next()) { - int idx = edgeMap.FindIndex(exp.Current())-1; - if(idx>=0 && idx<(int)edgeColors.size()) { + if (foundEdgeColor) { + for (TopExp_Explorer exp(subShape, TopAbs_EDGE); exp.More(); exp.Next()) { + int idx = edgeMap.FindIndex(exp.Current()) - 1; + if (idx >= 0 && idx < (int)edgeColors.size()) { edgeColors[idx] = edgeColor; hasEdgeColors = true; info.hasEdgeColor = true; @@ -454,58 +499,67 @@ bool ImportOCAF2::createObject(App::Document *doc, TDF_Label label, } } - Part::Feature *feature; + Part::Feature* feature; - if(newDoc && (options.mode == ObjectPerDoc || - options.mode == ObjectPerDir)) - doc = getDocument(doc,label); + if (newDoc && (options.mode == ObjectPerDoc || options.mode == ObjectPerDir)) { + doc = getDocument(doc, label); + } - if(options.expandCompound && - (tshape.countSubShapes(TopAbs_SOLID)>1 || - (!tshape.countSubShapes(TopAbs_SOLID) && tshape.countSubShapes(TopAbs_SHELL)>1))) - { - feature = dynamic_cast(expandShape(doc,label,shape)); + if (options.expandCompound + && (tshape.countSubShapes(TopAbs_SOLID) > 1 + || (!tshape.countSubShapes(TopAbs_SOLID) && tshape.countSubShapes(TopAbs_SHELL) > 1))) { + feature = dynamic_cast(expandShape(doc, label, shape)); assert(feature); - } else { - feature = static_cast(doc->addObject("Part::Feature",tshape.shapeName().c_str())); + } + else { + feature = static_cast( + doc->addObject("Part::Feature", tshape.shapeName().c_str())); feature->Shape.setValue(shape); // feature->Visibility.setValue(false); } - applyFaceColors(feature,{info.faceColor}); - applyEdgeColors(feature,{info.edgeColor}); - if(hasFaceColors) - applyFaceColors(feature,faceColors); - if(hasEdgeColors) - applyEdgeColors(feature,edgeColors); + applyFaceColors(feature, {info.faceColor}); + applyEdgeColors(feature, {info.edgeColor}); + if (hasFaceColors) { + applyFaceColors(feature, faceColors); + } + if (hasEdgeColors) { + applyEdgeColors(feature, edgeColors); + } info.propPlacement = &feature->Placement; info.obj = feature; return true; } -App::Document *ImportOCAF2::getDocument(App::Document *doc, TDF_Label label) { - if(filePath.empty() || options.mode==SingleDoc || options.merge) +App::Document* ImportOCAF2::getDocument(App::Document* doc, TDF_Label label) +{ + if (filePath.empty() || options.mode == SingleDoc || options.merge) { return doc; + } auto name = getLabelName(label); - if(name.empty()) + if (name.empty()) { return doc; + } - auto newDoc = App::GetApplication().newDocument(name.c_str(),name.c_str(),false); + auto newDoc = App::GetApplication().newDocument(name.c_str(), name.c_str(), false); std::ostringstream ss; Base::FileInfo fi(doc->FileName.getValue()); std::string path = fi.dirPath(); - if(options.mode == GroupPerDir || options.mode == ObjectPerDir) { - for(int i=0;i<1000;++i) { + if (options.mode == GroupPerDir || options.mode == ObjectPerDir) { + for (int i = 0; i < 1000; ++i) { ss.str(""); ss << path << '/' << fi.fileNamePure() << "_parts"; - if(i>0) + if (i > 0) { ss << '_' << std::setfill('0') << std::setw(3) << i; + } Base::FileInfo fi2(ss.str()); - if(fi2.exists()) { - if(!fi2.isDir()) + if (fi2.exists()) { + if (!fi2.isDir()) { continue; - }else if(!fi2.createDirectory()) { + } + } + else if (!fi2.createDirectory()) { FC_WARN("Failed to create directory " << fi2.filePath()); break; } @@ -513,15 +567,17 @@ App::Document *ImportOCAF2::getDocument(App::Document *doc, TDF_Label label) { break; } } - for(int i=0;i<1000;++i) { + for (int i = 0; i < 1000; ++i) { ss.str(""); ss << path << '/' << newDoc->getName() << ".fcstd"; - if(i>0) + if (i > 0) { ss << '_' << std::setfill('0') << std::setw(3) << i; + } Base::FileInfo fi(ss.str()); - if(!fi.exists()) { - if(!newDoc->saveAs(fi.filePath().c_str())) + if (!fi.exists()) { + if (!newDoc->saveAs(fi.filePath().c_str())) { break; + } return newDoc; } } @@ -530,32 +586,38 @@ App::Document *ImportOCAF2::getDocument(App::Document *doc, TDF_Label label) { return doc; } -bool ImportOCAF2::createGroup(App::Document *doc, Info &info, const TopoDS_Shape &shape, - std::vector &children, - const boost::dynamic_bitset<> &visibilities, - bool canReduce) +bool ImportOCAF2::createGroup(App::Document* doc, + Info& info, + const TopoDS_Shape& shape, + std::vector& children, + const boost::dynamic_bitset<>& visibilities, + bool canReduce) { assert(children.size() == visibilities.size()); - if(children.empty()) + if (children.empty()) { return false; - bool hasColor = getColor(shape,info,false,true); - if(canReduce && !hasColor && options.reduceObjects && children.size()==1 && visibilities[0]) { + } + bool hasColor = getColor(shape, info, false, true); + if (canReduce && !hasColor && options.reduceObjects && children.size() == 1 + && visibilities[0]) { info.obj = children.front(); info.free = true; - info.propPlacement = dynamic_cast(info.obj->getPropertyByName("Placement")); - myCollapsedObjects.emplace(info.obj,info.propPlacement); + info.propPlacement = + dynamic_cast(info.obj->getPropertyByName("Placement")); + myCollapsedObjects.emplace(info.obj, info.propPlacement); return true; } - auto group = static_cast(doc->addObject("App::LinkGroup","LinkGroup")); - for(auto &child : children) { - if(child->getDocument()!=doc) { - auto link = static_cast(doc->addObject("App::Link","Link")); + auto group = static_cast(doc->addObject("App::LinkGroup", "LinkGroup")); + for (auto& child : children) { + if (child->getDocument() != doc) { + auto link = static_cast(doc->addObject("App::Link", "Link")); link->Label.setValue(child->Label.getValue()); - link->setLink(-1,child); + link->setLink(-1, child); auto pla = Base::freecad_dynamic_cast( child->getPropertyByName("Placement")); - if(pla) + if (pla) { link->Placement.setValue(pla->getValue()); + } child = link; } } @@ -563,28 +625,30 @@ bool ImportOCAF2::createGroup(App::Document *doc, Info &info, const TopoDS_Shape group->VisibilityList.setValue(visibilities); info.obj = group; info.propPlacement = &group->Placement; - if(getColor(shape,info,false,true)) { - if(info.hasFaceColor) - applyLinkColor(group,-1,info.faceColor); + if (getColor(shape, info, false, true)) { + if (info.hasFaceColor) { + applyLinkColor(group, -1, info.faceColor); + } } return true; } App::DocumentObject* ImportOCAF2::loadShapes() { - if(!options.useLinkGroup) { + if (!options.useLinkGroup) { ImportLegacy legacy(*this); legacy.setMerge(options.merge); legacy.loadShapes(); return nullptr; } - if(FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG)) - dumpLabels(pDoc->Main(),aShapeTool,aColorTool); + if (FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG)) { + dumpLabels(pDoc->Main(), aShapeTool, aColorTool); + } TDF_LabelSequence labels; aShapeTool->GetShapes(labels); - Base::SequencerLauncher seq("Importing...",labels.Length()); + Base::SequencerLauncher seq("Importing...", labels.Length()); FC_MSG("free shape count " << labels.Length()); sequencer = options.showProgress ? &seq : nullptr; @@ -594,51 +658,56 @@ App::DocumentObject* ImportOCAF2::loadShapes() myCollapsedObjects.clear(); std::vector objs; - aShapeTool->GetFreeShapes (labels); + aShapeTool->GetFreeShapes(labels); boost::dynamic_bitset<> vis; int count = 0; - for (Standard_Integer i=1; i <= labels.Length(); i++ ) { + for (Standard_Integer i = 1; i <= labels.Length(); i++) { auto label = labels.Value(i); - if(!options.importHidden && !aColorTool->IsVisible(label)) + if (!options.importHidden && !aColorTool->IsVisible(label)) { continue; + } ++count; } - for (Standard_Integer i=1; i <= labels.Length(); i++ ) { + for (Standard_Integer i = 1; i <= labels.Length(); i++) { auto label = labels.Value(i); - if(!options.importHidden && !aColorTool->IsVisible(label)) + if (!options.importHidden && !aColorTool->IsVisible(label)) { continue; - auto obj = loadShape(pDocument, label, - aShapeTool->GetShape(label), false, count>1); - if(obj) { + } + auto obj = loadShape(pDocument, label, aShapeTool->GetShape(label), false, count > 1); + if (obj) { objs.push_back(obj); vis.push_back(aColorTool->IsVisible(label)); } } - App::DocumentObject *ret = nullptr; - if(objs.size()==1) { + App::DocumentObject* ret = nullptr; + if (objs.size() == 1) { ret = objs.front(); - }else { - Info info; - if(createGroup(pDocument,info,TopoDS_Shape(),objs,vis)) - ret = info.obj; } - if(ret) { + else { + Info info; + if (createGroup(pDocument, info, TopoDS_Shape(), objs, vis)) { + ret = info.obj; + } + } + if (ret) { ret->recomputeFeature(true); } - if(options.merge && ret && !ret->isDerivedFrom(Part::Feature::getClassTypeId())) { + if (options.merge && ret && !ret->isDerivedFrom(Part::Feature::getClassTypeId())) { auto shape = Part::Feature::getTopoShape(ret); - auto feature = static_cast( - pDocument->addObject("Part::Feature", "Feature")); + auto feature = + static_cast(pDocument->addObject("Part::Feature", "Feature")); auto name = labelName(pDoc->Main()); - feature->Label.setValue(name.empty()?default_name.c_str():name.c_str()); + feature->Label.setValue(name.empty() ? default_name.c_str() : name.c_str()); feature->Shape.setValue(shape); - applyFaceColors(feature,{}); + applyFaceColors(feature, {}); - std::vector > objNames; - for(auto obj : App::Document::getDependencyList(objs,App::Document::DepSort)) - objNames.emplace_back(obj->getDocument(),obj->getNameInDocument()); - for(auto &v : objNames) + std::vector> objNames; + for (auto obj : App::Document::getDependencyList(objs, App::Document::DepSort)) { + objNames.emplace_back(obj->getDocument(), obj->getNameInDocument()); + } + for (auto& v : objNames) { v.first->removeObject(v.second.c_str()); + } ret = feature; ret->recomputeFeature(true); } @@ -647,177 +716,207 @@ App::DocumentObject* ImportOCAF2::loadShapes() } void ImportOCAF2::getSHUOColors(TDF_Label label, - std::map &colors, bool appendFirst) + std::map& colors, + bool appendFirst) { TDF_AttributeSequence seq; - if(label.IsNull() || !aShapeTool->GetAllComponentSHUO(label,seq)) + if (label.IsNull() || !aShapeTool->GetAllComponentSHUO(label, seq)) { return; + } std::ostringstream ss; - for(int i=1;i<=seq.Length();++i) { + for (int i = 1; i <= seq.Length(); ++i) { Handle(XCAFDoc_GraphNode) shuo = Handle(XCAFDoc_GraphNode)::DownCast(seq.Value(i)); - if(shuo.IsNull()) + if (shuo.IsNull()) { continue; + } TDF_Label slabel = shuo->Label(); // We only want to process the main shuo, i.e. those without upper_usage TDF_LabelSequence uppers; aShapeTool->GetSHUOUpperUsage(slabel, uppers); - if(uppers.Length()) + if (uppers.Length()) { continue; + } // appendFirst tells us whether we shall append the object name of the first label bool skipFirst = !appendFirst; ss.str(""); - while(true) { - if(skipFirst) + while (true) { + if (skipFirst) { skipFirst = false; + } else { TDF_Label l = shuo->Label().Father(); auto it = myNames.find(l); - if(it == myNames.end()) { + if (it == myNames.end()) { FC_WARN("Failed to find object of label " << labelName(l)); ss.str(""); break; } - if(!it->second.empty()) + if (!it->second.empty()) { ss << it->second << '.'; + } } - if(!shuo->NbChildren()) + if (!shuo->NbChildren()) { break; + } shuo = shuo->GetChild(1); } std::string subname = ss.str(); - if(subname.empty()) + if (subname.empty()) { continue; - if(!aColorTool->IsVisible(slabel)) { + } + if (!aColorTool->IsVisible(slabel)) { subname += App::DocumentObject::hiddenMarker(); - colors.emplace(subname,App::Color()); - } else { + colors.emplace(subname, App::Color()); + } + else { Quantity_ColorRGBA aColor; - if(aColorTool->GetColor(slabel, XCAFDoc_ColorSurf, aColor) || - aColorTool->GetColor(slabel, XCAFDoc_ColorGen, aColor)) - { + if (aColorTool->GetColor(slabel, XCAFDoc_ColorSurf, aColor) + || aColorTool->GetColor(slabel, XCAFDoc_ColorGen, aColor)) { colors.emplace(subname, convertColor(aColor)); } } } } -App::DocumentObject *ImportOCAF2::loadShape(App::Document *doc, - TDF_Label label, const TopoDS_Shape &shape, bool baseOnly, bool newDoc) +App::DocumentObject* ImportOCAF2::loadShape(App::Document* doc, + TDF_Label label, + const TopoDS_Shape& shape, + bool baseOnly, + bool newDoc) { - if(shape.IsNull()) + if (shape.IsNull()) { return nullptr; + } auto baseShape = shape.Located(TopLoc_Location()); auto it = myShapes.find(baseShape); - if(it == myShapes.end()) { + if (it == myShapes.end()) { Info info; auto baseLabel = aShapeTool->FindShape(baseShape); - if(sequencer && !baseLabel.IsNull() && aShapeTool->IsTopLevel(baseLabel)) + if (sequencer && !baseLabel.IsNull() && aShapeTool->IsTopLevel(baseLabel)) { sequencer->next(true); + } bool res; - if(baseLabel.IsNull() || !aShapeTool->IsAssembly(baseLabel)) - res = createObject(doc,baseLabel,baseShape,info,newDoc); - else - res = createAssembly(doc,baseLabel,baseShape,info,newDoc); - if(!res) + if (baseLabel.IsNull() || !aShapeTool->IsAssembly(baseLabel)) { + res = createObject(doc, baseLabel, baseShape, info, newDoc); + } + else { + res = createAssembly(doc, baseLabel, baseShape, info, newDoc); + } + if (!res) { return nullptr; - setObjectName(info,baseLabel); - it = myShapes.emplace(baseShape,info).first; + } + setObjectName(info, baseLabel); + it = myShapes.emplace(baseShape, info).first; } - if(baseOnly) + if (baseOnly) { return it->second.obj; + } - std::map shuoColors; - if(!options.useLinkGroup) - getSHUOColors(label,shuoColors,false); + std::map shuoColors; + if (!options.useLinkGroup) { + getSHUOColors(label, shuoColors, false); + } auto info = it->second; - getColor(shape,info,true); + getColor(shape, info, true); - if(shuoColors.empty() && info.free && doc==info.obj->getDocument()) { + if (shuoColors.empty() && info.free && doc == info.obj->getDocument()) { it->second.free = false; auto name = getLabelName(label); - if(info.faceColor!=it->second.faceColor || - info.edgeColor!=it->second.edgeColor || - (!name.empty() && !info.baseName.empty() && name!=info.baseName)) - { - auto compound = static_cast(doc->addObject("Part::Compound2","Compound")); + if (info.faceColor != it->second.faceColor || info.edgeColor != it->second.edgeColor + || (!name.empty() && !info.baseName.empty() && name != info.baseName)) { + auto compound = + static_cast(doc->addObject("Part::Compound2", "Compound")); compound->Links.setValue(info.obj); // compound->Visibility.setValue(false); info.propPlacement = &compound->Placement; - if(info.faceColor!=it->second.faceColor) - applyFaceColors(compound,{info.faceColor}); - if(info.edgeColor!=it->second.edgeColor) - applyEdgeColors(compound,{info.edgeColor}); + if (info.faceColor != it->second.faceColor) { + applyFaceColors(compound, {info.faceColor}); + } + if (info.edgeColor != it->second.edgeColor) { + applyEdgeColors(compound, {info.edgeColor}); + } info.obj = compound; - setObjectName(info,label); + setObjectName(info, label); } - setPlacement(info.propPlacement,shape); - myNames.emplace(label,info.obj->getNameInDocument()); + setPlacement(info.propPlacement, shape); + myNames.emplace(label, info.obj->getNameInDocument()); return info.obj; } - auto link = static_cast(doc->addObject("App::Link","Link")); - link->setLink(-1,info.obj); - setPlacement(&link->Placement,shape); + auto link = static_cast(doc->addObject("App::Link", "Link")); + link->setLink(-1, info.obj); + setPlacement(&link->Placement, shape); info.obj = link; - setObjectName(info,label); - if(info.faceColor!=it->second.faceColor) - applyLinkColor(link,-1,info.faceColor); + setObjectName(info, label); + if (info.faceColor != it->second.faceColor) { + applyLinkColor(link, -1, info.faceColor); + } - myNames.emplace(label,link->getNameInDocument()); - if(!shuoColors.empty()) - applyElementColors(link,shuoColors); + myNames.emplace(label, link->getNameInDocument()); + if (!shuoColors.empty()) { + applyElementColors(link, shuoColors); + } return link; } -struct ChildInfo { +struct ChildInfo +{ std::vector plas; boost::dynamic_bitset<> vis; - std::map colors; + std::map colors; std::vector labels; TopoDS_Shape shape; }; -bool ImportOCAF2::createAssembly(App::Document *_doc, - TDF_Label label, const TopoDS_Shape &shape, Info &info, bool newDoc) +bool ImportOCAF2::createAssembly(App::Document* _doc, + TDF_Label label, + const TopoDS_Shape& shape, + Info& info, + bool newDoc) { (void)label; std::vector children; std::map childrenMap; boost::dynamic_bitset<> visibilities; - std::map shuoColors; + std::map shuoColors; auto doc = _doc; - if(newDoc) - doc = getDocument(_doc,label); + if (newDoc) { + doc = getDocument(_doc, label); + } - for(TopoDS_Iterator it(shape,Standard_False,Standard_False);it.More();it.Next()) { + for (TopoDS_Iterator it(shape, Standard_False, Standard_False); it.More(); it.Next()) { TopoDS_Shape childShape = it.Value(); - if(childShape.IsNull()) + if (childShape.IsNull()) { continue; + } TDF_Label childLabel; - aShapeTool->Search(childShape,childLabel,Standard_True,Standard_True,Standard_False); - if(!childLabel.IsNull() && !options.importHidden && !aColorTool->IsVisible(childLabel)) + aShapeTool->Search(childShape, childLabel, Standard_True, Standard_True, Standard_False); + if (!childLabel.IsNull() && !options.importHidden && !aColorTool->IsVisible(childLabel)) { continue; + } auto obj = loadShape(doc, childLabel, childShape, options.reduceObjects); - if(!obj) + if (!obj) { continue; + } bool vis = true; - if(!childLabel.IsNull() && aShapeTool->IsComponent(childLabel)) + if (!childLabel.IsNull() && aShapeTool->IsComponent(childLabel)) { vis = aColorTool->IsVisible(childLabel); - if(!options.reduceObjects) { + } + if (!options.reduceObjects) { visibilities.push_back(vis); children.push_back(obj); - getSHUOColors(childLabel,shuoColors,true); + getSHUOColors(childLabel, shuoColors, true); continue; } - auto &childInfo = childrenMap[obj]; + auto& childInfo = childrenMap[obj]; if (childInfo.plas.empty()) { children.push_back(obj); visibilities.push_back(vis); @@ -826,25 +925,27 @@ bool ImportOCAF2::createAssembly(App::Document *_doc, childInfo.vis.push_back(vis); childInfo.labels.push_back(childLabel); - childInfo.plas.emplace_back(Part::TopoShape::convert(childShape.Location().Transformation())); + childInfo.plas.emplace_back( + Part::TopoShape::convert(childShape.Location().Transformation())); Quantity_ColorRGBA aColor; if (aColorTool->GetColor(childShape, XCAFDoc_ColorSurf, aColor)) { - childInfo.colors[childInfo.plas.size()-1] = convertColor(aColor); + childInfo.colors[childInfo.plas.size() - 1] = convertColor(aColor); } } assert(visibilities.size() == children.size()); - if(children.empty()) { - if(doc!=_doc) + if (children.empty()) { + if (doc != _doc) { App::GetApplication().closeDocument(doc->getName()); + } return false; } - if(options.reduceObjects) { - int i=-1; - for(auto &child : children) { + if (options.reduceObjects) { + int i = -1; + for (auto& child : children) { ++i; - auto &childInfo = childrenMap[child]; + auto& childInfo = childrenMap[child]; if (childInfo.plas.size() == 1) { child = loadShape(doc, childInfo.labels.front(), childInfo.shape); getSHUOColors(childInfo.labels.front(), shuoColors, true); @@ -854,29 +955,31 @@ bool ImportOCAF2::createAssembly(App::Document *_doc, visibilities[i] = true; // Okay, we are creating a link array - auto link = static_cast(doc->addObject("App::Link","Link")); - link->setLink(-1,child); + auto link = static_cast(doc->addObject("App::Link", "Link")); + link->setLink(-1, child); link->ShowElement.setValue(false); link->ElementCount.setValue(childInfo.plas.size()); auto it = myCollapsedObjects.find(child); - if(it!=myCollapsedObjects.end()) { + if (it != myCollapsedObjects.end()) { // child is a single component assembly that has been // collapsed, so we have to honour its placement - for(auto &pla : childInfo.plas) + for (auto& pla : childInfo.plas) { pla *= it->second->getValue(); + } } link->PlacementList.setValue(childInfo.plas); link->VisibilityList.setValue(childInfo.vis); - for(auto &v : childInfo.colors) - applyLinkColor(link,v.first,v.second); + for (auto& v : childInfo.colors) { + applyLinkColor(link, v.first, v.second); + } - int i=0; + int i = 0; std::string name = link->getNameInDocument(); name += '.'; - for(auto childLabel : childInfo.labels) { - myNames.emplace(childLabel,name + std::to_string(i++)); - getSHUOColors(childLabel,shuoColors,true); + for (auto childLabel : childInfo.labels) { + myNames.emplace(childLabel, name + std::to_string(i++)); + getSHUOColors(childLabel, shuoColors, true); } child = link; @@ -886,13 +989,16 @@ bool ImportOCAF2::createAssembly(App::Document *_doc, } } - if(children.empty()) + if (children.empty()) { return false; + } - if(!createGroup(doc,info,shape,children,visibilities,shuoColors.empty())) + if (!createGroup(doc, info, shape, children, visibilities, shuoColors.empty())) { return false; - if(!shuoColors.empty()) - applyElementColors(info.obj,shuoColors); + } + if (!shuoColors.empty()) { + applyElementColors(info.obj, shuoColors); + } return true; } @@ -905,7 +1011,8 @@ ExportOCAFOptions::ExportOCAFOptions() } ExportOCAF2::ExportOCAF2(Handle(TDocStd_Document) h, GetShapeColorsFunc func) - : pDoc(h) , getShapeColors(func) + : pDoc(h) + , getShapeColors(func) { aShapeTool = XCAFDoc_DocumentTool::ShapeTool(pDoc->Main()); aColorTool = XCAFDoc_DocumentTool::ColorTool(pDoc->Main()); @@ -925,17 +1032,21 @@ ExportOCAFOptions ExportOCAF2::customExportOptions() defaultOptions.exportHidden = settings.getExportHiddenObject(); defaultOptions.keepPlacement = settings.getExportKeepPlacement(); - auto handle = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); - defaultOptions.defaultColor.setPackedValue(handle->GetUnsigned("DefaultShapeColor", defaultOptions.defaultColor.getPackedValue())); + auto handle = + App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); + defaultOptions.defaultColor.setPackedValue( + handle->GetUnsigned("DefaultShapeColor", defaultOptions.defaultColor.getPackedValue())); defaultOptions.defaultColor.a = 0; return defaultOptions; } -void ExportOCAF2::setName(TDF_Label label, App::DocumentObject *obj, const char *name) { - if(!name) { - if(!obj) +void ExportOCAF2::setName(TDF_Label label, App::DocumentObject* obj, const char* name) +{ + if (!name) { + if (!obj) { return; + } name = obj->Label.getValue(); } TDataStd_Name::Set(label, TCollection_ExtendedString(name, true)); @@ -944,74 +1055,83 @@ void ExportOCAF2::setName(TDF_Label label, App::DocumentObject *obj, const char // Similar to XCAFDoc_ShapeTool::FindSHUO but return only main SHUO, i.e. SHUO // with no upper_usage. It should not be necessary if we strictly export from // bottom up, but let's make sure of it. -static Standard_Boolean FindSHUO (const TDF_LabelSequence& theLabels, - Handle(XCAFDoc_GraphNode)& theSHUOAttr) +static Standard_Boolean FindSHUO(const TDF_LabelSequence& theLabels, + Handle(XCAFDoc_GraphNode) & theSHUOAttr) { - assert(theLabels.Length()>1); + assert(theLabels.Length() > 1); theSHUOAttr.Nullify(); TDF_AttributeSequence SHUOAttrs; TDF_Label aCompLabel = theLabels.Value(1); - if (! ::XCAFDoc_ShapeTool::GetAllComponentSHUO( aCompLabel, SHUOAttrs ) ) + if (!::XCAFDoc_ShapeTool::GetAllComponentSHUO(aCompLabel, SHUOAttrs)) { return Standard_False; + } for (Standard_Integer i = 1; i <= SHUOAttrs.Length(); i++) { Handle(XCAFDoc_GraphNode) anSHUO = Handle(XCAFDoc_GraphNode)::DownCast(SHUOAttrs.Value(i)); TDF_LabelSequence aUpLabels; // check for any upper_usage - ::XCAFDoc_ShapeTool::GetSHUOUpperUsage( anSHUO->Label(), aUpLabels ); - if ( aUpLabels.Length() > 0 ) - continue; // reject if there is one - int j=2; - for ( ; anSHUO->NbChildren() ; ++j ) { - if ( j>theLabels.Length() ) { - j=0; + ::XCAFDoc_ShapeTool::GetSHUOUpperUsage(anSHUO->Label(), aUpLabels); + if (aUpLabels.Length() > 0) { + continue;// reject if there is one + } + int j = 2; + for (; anSHUO->NbChildren(); ++j) { + if (j > theLabels.Length()) { + j = 0; break; } - anSHUO = anSHUO->GetChild( 1 ); - if ( theLabels.Value(j)!=anSHUO->Label().Father() ) { - j=0; + anSHUO = anSHUO->GetChild(1); + if (theLabels.Value(j) != anSHUO->Label().Father()) { + j = 0; break; } } - if( j!=theLabels.Length()+1 ) + if (j != theLabels.Length() + 1) { continue; + } theSHUOAttr = Handle(XCAFDoc_GraphNode)::DownCast(SHUOAttrs.Value(i)); break; } - return ( !theSHUOAttr.IsNull() ); + return (!theSHUOAttr.IsNull()); } -TDF_Label ExportOCAF2::findComponent(const char *subname, TDF_Label label, TDF_LabelSequence &labels) { - const char *dot = strchr(subname,'.'); - if(!dot) { - if(labels.Length()==1) +TDF_Label +ExportOCAF2::findComponent(const char* subname, TDF_Label label, TDF_LabelSequence& labels) +{ + const char* dot = strchr(subname, '.'); + if (!dot) { + if (labels.Length() == 1) { return labels.Value(1); + } Handle(XCAFDoc_GraphNode) ret; - if(labels.Length() && (FindSHUO(labels,ret) || aShapeTool->SetSHUO(labels,ret))) + if (labels.Length() && (FindSHUO(labels, ret) || aShapeTool->SetSHUO(labels, ret))) { return ret->Label(); + } return {}; } TDF_LabelSequence components; TDF_Label ref; - if(!aShapeTool->GetReferredShape(label,ref)) + if (!aShapeTool->GetReferredShape(label, ref)) { ref = label; - if(aShapeTool->GetComponents(ref,components)) { - for(int i=1;i<=components.Length();++i) { + } + if (aShapeTool->GetComponents(ref, components)) { + for (int i = 1; i <= components.Length(); ++i) { auto component = components.Value(i); - if(std::isdigit((int)subname[0])) { - auto n = std::to_string(i-1)+"."; - if(boost::starts_with(subname,n)) { + if (std::isdigit((int)subname[0])) { + auto n = std::to_string(i - 1) + "."; + if (boost::starts_with(subname, n)) { labels.Append(component); - return findComponent(subname+n.size(),component,labels); + return findComponent(subname + n.size(), component, labels); } } auto it = myNames.find(component); - if(it == myNames.end()) + if (it == myNames.end()) { continue; - for(auto &n : it->second) { - if(boost::starts_with(subname,n)) { + } + for (auto& n : it->second) { + if (boost::starts_with(subname, n)) { labels.Append(component); - return findComponent(subname+n.size(),component,labels); + return findComponent(subname + n.size(), component, labels); } } } @@ -1019,17 +1139,22 @@ TDF_Label ExportOCAF2::findComponent(const char *subname, TDF_Label label, TDF_L return {}; } -void ExportOCAF2::setupObject(TDF_Label label, App::DocumentObject *obj, - const Part::TopoShape &shape, const std::string &prefix, const char *name, bool force) +void ExportOCAF2::setupObject(TDF_Label label, + App::DocumentObject* obj, + const Part::TopoShape& shape, + const std::string& prefix, + const char* name, + bool force) { - setName(label,obj,name); - if(aShapeTool->IsComponent(label)) { - auto &names = myNames[label]; + setName(label, obj, name); + if (aShapeTool->IsComponent(label)) { + auto& names = myNames[label]; // The subname reference may contain several possible namings. - if(!name) { + if (!name) { // simple object internal name - names.push_back(prefix+obj->getNameInDocument()+"."); - } else { + names.push_back(prefix + obj->getNameInDocument() + "."); + } + else { // name is not NULL in case this is a collapsed link array element. // Collapsed means that the element is not an actual object, and // 'obj' here is actually the parent. The given 'name' is in fact @@ -1045,63 +1170,67 @@ void ExportOCAF2::setupObject(TDF_Label label, App::DocumentObject *obj, names.push_back(prefix + "$" + obj->Label.getValue() + "."); } - if(!getShapeColors || (!force && !mySetups.emplace(obj,name?name:"").second)) + if (!getShapeColors || (!force && !mySetups.emplace(obj, name ? name : "").second)) { return; + } - std::map > colors; - static std::string marker(App::DocumentObject::hiddenMarker()+"*"); - static std::array keys = {"Face*","Edge*",marker.c_str()}; + std::map> colors; + static std::string marker(App::DocumentObject::hiddenMarker() + "*"); + static std::array keys = {"Face*", "Edge*", marker.c_str()}; std::string childName; - if(name) { + if (name) { childName = name; childName += '.'; } - for(auto key : keys) { - for(auto &v : getShapeColors(obj,key)) { - const char *subname = v.first.c_str(); - if(name) { - if(!boost::starts_with(v.first,childName)) + for (auto key : keys) { + for (auto& v : getShapeColors(obj, key)) { + const char* subname = v.first.c_str(); + if (name) { + if (!boost::starts_with(v.first, childName)) { continue; + } subname += childName.size(); } - const char *dot = strrchr(subname,'.'); - if(!dot) - colors[""].emplace(subname,v.second); + const char* dot = strrchr(subname, '.'); + if (!dot) { + colors[""].emplace(subname, v.second); + } else { ++dot; - colors[std::string(subname,dot-subname)].emplace(dot,v.second); + colors[std::string(subname, dot - subname)].emplace(dot, v.second); } } } bool warned = false; - for(auto &v : colors) { + for (auto& v : colors) { TDF_Label nodeLabel = label; - if(!v.first.empty()) { + if (!v.first.empty()) { TDF_LabelSequence labels; - if(aShapeTool->IsComponent(label)) + if (aShapeTool->IsComponent(label)) { labels.Append(label); - nodeLabel = findComponent(v.first.c_str(),label,labels); - if(nodeLabel.IsNull()) { + } + nodeLabel = findComponent(v.first.c_str(), label, labels); + if (nodeLabel.IsNull()) { FC_WARN("Failed to find component " << v.first); continue; } } - for(auto &vv : v.second) { - if(vv.first == App::DocumentObject::hiddenMarker()) { - aColorTool->SetVisibility(nodeLabel,Standard_False); + for (auto& vv : v.second) { + if (vv.first == App::DocumentObject::hiddenMarker()) { + aColorTool->SetVisibility(nodeLabel, Standard_False); continue; } const App::Color& c = vv.second; Quantity_ColorRGBA color = convertColor(c); - auto colorType = vv.first[0]=='F'?XCAFDoc_ColorSurf:XCAFDoc_ColorCurv; - if(vv.first=="Face" || vv.first=="Edge") { + auto colorType = vv.first[0] == 'F' ? XCAFDoc_ColorSurf : XCAFDoc_ColorCurv; + if (vv.first == "Face" || vv.first == "Edge") { aColorTool->SetColor(nodeLabel, color, colorType); continue; } - if(nodeLabel!=label || aShapeTool->IsComponent(label)) { + if (nodeLabel != label || aShapeTool->IsComponent(label)) { // OCCT 7 seems to only support "Recommended practices for // model styling and organization" version 1.2 // (https://www.cax-if.org/documents/rec_prac_styling_org_v12.pdf). @@ -1113,7 +1242,7 @@ void ExportOCAF2::setupObject(TDF_Label label, App::DocumentObject *obj, // // The above observation is confirmed by further inspection of // OCCT code, XCAFDoc_ShapeTool.cxx and STEPCAFControl_Writer.cxx. - if(!warned) { + if (!warned) { warned = true; FC_WARN("Current OCCT does not support element color override, for object " << obj->getFullName()); @@ -1121,8 +1250,8 @@ void ExportOCAF2::setupObject(TDF_Label label, App::DocumentObject *obj, // continue; } - auto subShape = shape.getSubShape(vv.first.c_str(),true); - if(subShape.IsNull()) { + auto subShape = shape.getSubShape(vv.first.c_str(), true); + if (subShape.IsNull()) { FC_WARN("Failed to get subshape " << vv.first); continue; } @@ -1139,7 +1268,7 @@ void ExportOCAF2::setupObject(TDF_Label label, App::DocumentObject *obj, } TDF_Label subLabel = aShapeTool->AddSubShape(nodeLabel, subShape); - if(subLabel.IsNull()) { + if (subLabel.IsNull()) { FC_WARN("Failed to add subshape " << vv.first); continue; } @@ -1148,63 +1277,73 @@ void ExportOCAF2::setupObject(TDF_Label label, App::DocumentObject *obj, } } -void ExportOCAF2::exportObjects(std::vector &objs, const char *name) { - if(objs.empty()) +void ExportOCAF2::exportObjects(std::vector& objs, const char* name) +{ + if (objs.empty()) { return; + } myObjects.clear(); myNames.clear(); mySetups.clear(); - if(objs.size()==1) - exportObject(objs.front(),nullptr,TDF_Label()); + if (objs.size() == 1) { + exportObject(objs.front(), nullptr, TDF_Label()); + } else { auto label = aShapeTool->NewShape(); - App::Document *doc = nullptr; + App::Document* doc = nullptr; bool sameDoc = true; - for(auto obj : objs) { - if(doc) - sameDoc = sameDoc && doc==obj->getDocument(); - else + for (auto obj : objs) { + if (doc) { + sameDoc = sameDoc && doc == obj->getDocument(); + } + else { doc = obj->getDocument(); - exportObject(obj,nullptr,label); + } + exportObject(obj, nullptr, label); } - if(!name && doc && sameDoc) + if (!name && doc && sameDoc) { name = doc->getName(); - setName(label,nullptr,name); + } + setName(label, nullptr, name); } - if(FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG)) { - dumpLabels(pDoc->Main(),aShapeTool,aColorTool); + if (FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG)) { + dumpLabels(pDoc->Main(), aShapeTool, aColorTool); } - // Update is not performed automatically anymore: https://tracker.dev.opencascade.org/view.php?id=28055 + // Update is not performed automatically anymore: + // https://tracker.dev.opencascade.org/view.php?id=28055 aShapeTool->UpdateAssemblies(); } TDF_Label ExportOCAF2::exportObject(App::DocumentObject* parentObj, - const char *sub, TDF_Label parent, const char *name) + const char* sub, + TDF_Label parent, + const char* name) { - App::DocumentObject *obj; - auto shape = Part::Feature::getTopoShape(parentObj,sub,false,nullptr,&obj,false,!sub); - if(!obj || shape.isNull()) { - if (obj) + App::DocumentObject* obj; + auto shape = Part::Feature::getTopoShape(parentObj, sub, false, nullptr, &obj, false, !sub); + if (!obj || shape.isNull()) { + if (obj) { FC_WARN(obj->getFullName() << " has null shape"); + } return {}; } - //sub may contain more than one hierarchy, e.g. Assembly container may use - //getSubObjects to skip some hierarchy containing constraints and stuff - //when exporting. We search for extra '.', and set it as prefix if found. - //When setting SHUO's, we'll need this prefix for matching. + // sub may contain more than one hierarchy, e.g. Assembly container may use + // getSubObjects to skip some hierarchy containing constraints and stuff + // when exporting. We search for extra '.', and set it as prefix if found. + // When setting SHUO's, we'll need this prefix for matching. std::string prefix; - if(sub) { + if (sub) { auto len = strlen(sub); - if(len>1) { + if (len > 1) { --len; // The prefix ends with the second last '.', so search for it. - for(int i=0;len!=0;--len) { - if(sub[len]=='.' && ++i==2) { - prefix = std::string(sub,len+1); + for (int i = 0; len != 0; --len) { + if (sub[len] == '.' && ++i == 2) { + prefix = std::string(sub, len + 1); break; } } @@ -1212,24 +1351,26 @@ TDF_Label ExportOCAF2::exportObject(App::DocumentObject* parentObj, } TDF_Label label; - std::vector links; + std::vector links; int depth = 0; auto linked = obj; auto linkedShape = shape; - while(true) { + while (true) { auto s = Part::Feature::getTopoShape(linked); - if(s.isNull() || !s.getShape().IsPartner(shape.getShape())) + if (s.isNull() || !s.getShape().IsPartner(shape.getShape())) { break; + } linkedShape = s; // Search using our own cache. We can't rely on ShapeTool::FindShape() // in case this is an assembly. Because FindShape() search among its // own computed shape, i.e. its own created compound, and thus will // never match ours. auto it = myObjects.find(linked); - if(it != myObjects.end()) { - for(auto l : links) - myObjects.emplace(l,it->second); + if (it != myObjects.end()) { + for (auto l : links) { + myObjects.emplace(l, it->second); + } // Note: OCAF does not seem to support reference of references. We // have to flaten all multi-level link without scales. In other // word, all link will all be forced to refer to the same @@ -1239,45 +1380,49 @@ TDF_Label ExportOCAF2::exportObject(App::DocumentObject* parentObj, // a new shape every time Part::Feature::getTopoShape() is called. auto baseShape = aShapeTool->GetShape(it->second); shape.setShape(baseShape.Located(shape.getShape().Location())); - if(!parent.IsNull()) - label = aShapeTool->AddComponent(parent,shape.getShape(),Standard_False); - else - label = aShapeTool->AddShape(shape.getShape(),Standard_False,Standard_False); - setupObject(label,name?parentObj:obj,shape,prefix,name); + if (!parent.IsNull()) { + label = aShapeTool->AddComponent(parent, shape.getShape(), Standard_False); + } + else { + label = aShapeTool->AddShape(shape.getShape(), Standard_False, Standard_False); + } + setupObject(label, name ? parentObj : obj, shape, prefix, name); return label; } - auto next = linked->getLinkedObject(false,nullptr,false,depth++); - if(!next || linked==next) + auto next = linked->getLinkedObject(false, nullptr, false, depth++); + if (!next || linked == next) { break; + } linked = next; links.push_back(linked); } auto subs = obj->getSubObjects(); // subs empty means obj is not a container. - if(subs.empty()) { + if (subs.empty()) { - if(!parent.IsNull()) { + if (!parent.IsNull()) { // Search for non-located shape to see if we've stored the original shape before - if(!aShapeTool->FindShape(shape.getShape(),label)) { + if (!aShapeTool->FindShape(shape.getShape(), label)) { auto baseShape = linkedShape; - auto linked = links.empty()?obj:links.back(); + auto linked = links.empty() ? obj : links.back(); baseShape.setShape(baseShape.getShape().Located(TopLoc_Location())); label = aShapeTool->NewShape(); - aShapeTool->SetShape(label,baseShape.getShape()); - setupObject(label,linked,baseShape,prefix); + aShapeTool->SetShape(label, baseShape.getShape()); + setupObject(label, linked, baseShape, prefix); } - label = aShapeTool->AddComponent(parent,shape.getShape(),Standard_False); - setupObject(label,name?parentObj:obj,shape,prefix,name); - - }else{ + label = aShapeTool->AddComponent(parent, shape.getShape(), Standard_False); + setupObject(label, name ? parentObj : obj, shape, prefix, name); + } + else { // Here means we are exporting a single non-assembly object. We must // not call setupObject() on a non-located baseshape like above, // because OCCT does not respect shape style sharing when not // exporting assembly - if(!options.keepPlacement || shape.getPlacement() == Base::Placement()) + if (!options.keepPlacement || shape.getPlacement() == Base::Placement()) { shape.setShape(shape.getShape().Located(TopLoc_Location())); + } else { Base::Matrix4D mat = shape.getTransform(); shape.setShape(shape.getShape().Located(TopLoc_Location())); @@ -1287,59 +1432,68 @@ TDF_Label ExportOCAF2::exportObject(App::DocumentObject* parentObj, // a TopLoc_Location, so we need to clear it again. shape.setShape(shape.getShape().Located(TopLoc_Location())); } - label = aShapeTool->AddShape(shape.getShape(),Standard_False, Standard_False); - auto o = name?parentObj:obj; - if(o!=linked) - setupObject(label,linked,shape,prefix,nullptr,true); - setupObject(label,o,shape,prefix,name,true); + label = aShapeTool->AddShape(shape.getShape(), Standard_False, Standard_False); + auto o = name ? parentObj : obj; + if (o != linked) { + setupObject(label, linked, shape, prefix, nullptr, true); + } + setupObject(label, o, shape, prefix, name, true); } myObjects.emplace(obj, label); - for(auto link : links) + for (auto link : links) { myObjects.emplace(link, label); + } return label; } - if(obj->getExtensionByType(true) - || obj->getExtensionByType(true)) + if (obj->getExtensionByType(true) + || obj->getExtensionByType(true)) { groupLinks.push_back(obj); + } // Create a new assembly label = aShapeTool->NewShape(); // check for link array auto linkArray = obj->getLinkedObject(true)->getExtensionByType(true); - if(linkArray && (linkArray->getShowElementValue() || !linkArray->getElementCountValue())) + if (linkArray && (linkArray->getShowElementValue() || !linkArray->getElementCountValue())) { linkArray = nullptr; - for(auto &subobj : subs) { - App::DocumentObject *parentGrp = nullptr; + } + for (auto& subobj : subs) { + App::DocumentObject* parentGrp = nullptr; std::string childName; - auto sobj = obj->resolve(subobj.c_str(),&parentGrp,&childName); - if(!sobj) { + auto sobj = obj->resolve(subobj.c_str(), &parentGrp, &childName); + if (!sobj) { FC_WARN("Cannot find object " << obj->getFullName() << '.' << subobj); continue; } int vis = -1; - if(parentGrp) { - if(!groupLinks.empty() - && parentGrp->getExtensionByType(true,false)) - { + if (parentGrp) { + if (!groupLinks.empty() + && parentGrp->getExtensionByType(true, false)) { vis = groupLinks.back()->isElementVisible(childName.c_str()); - }else + } + else { vis = parentGrp->isElementVisible(childName.c_str()); + } } - if(vis < 0) - vis = sobj->Visibility.getValue()?1:0; + if (vis < 0) { + vis = sobj->Visibility.getValue() ? 1 : 0; + } - if(!vis && !options.exportHidden) + if (!vis && !options.exportHidden) { continue; + } - TDF_Label childLabel = exportObject(obj,subobj.c_str(),label,linkArray?childName.c_str():nullptr); - if(childLabel.IsNull()) + TDF_Label childLabel = + exportObject(obj, subobj.c_str(), label, linkArray ? childName.c_str() : nullptr); + if (childLabel.IsNull()) { continue; + } - if(!vis) { + if (!vis) { // Work around OCCT bug. If no color setting here, it will crash. // The culprit is at STEPCAFControl_Writer::1093 as shown below // @@ -1354,53 +1508,60 @@ TDF_Label ExportOCAF2::exportObject(App::DocumentObject* parentObj, // auto childShape = aShapeTool->GetShape(childLabel); Quantity_ColorRGBA col; - if(!aColorTool->GetInstanceColor(childShape,XCAFDoc_ColorGen,col) && - !aColorTool->GetInstanceColor(childShape,XCAFDoc_ColorSurf,col) && - !aColorTool->GetInstanceColor(childShape,XCAFDoc_ColorCurv,col)) - { - auto &c = options.defaultColor; + if (!aColorTool->GetInstanceColor(childShape, XCAFDoc_ColorGen, col) + && !aColorTool->GetInstanceColor(childShape, XCAFDoc_ColorSurf, col) + && !aColorTool->GetInstanceColor(childShape, XCAFDoc_ColorCurv, col)) { + auto& c = options.defaultColor; aColorTool->SetColor(childLabel, convertColor(c), XCAFDoc_ColorGen); FC_WARN(labelName(childLabel) << " set default color"); } - aColorTool->SetVisibility(childLabel,Standard_False); + aColorTool->SetVisibility(childLabel, Standard_False); } } - if (!groupLinks.empty() && groupLinks.back()==obj) + if (!groupLinks.empty() && groupLinks.back() == obj) { groupLinks.pop_back(); + } // Finished adding components. Now retrieve the computed non-located shape auto baseShape = shape; baseShape.setShape(aShapeTool->GetShape(label)); myObjects.emplace(obj, label); - for(auto link : links) + for (auto link : links) { myObjects.emplace(link, label); + } - if(!parent.IsNull() && !links.empty()) + if (!parent.IsNull() && !links.empty()) { linked = links.back(); - else + } + else { linked = obj; - setupObject(label,linked,baseShape,prefix); + } + setupObject(label, linked, baseShape, prefix); - if(!parent.IsNull()) { + if (!parent.IsNull()) { // If we are a component, swap in the base shape but keep our location. shape.setShape(baseShape.getShape().Located(shape.getShape().Location())); - label = aShapeTool->AddComponent(parent,label,shape.getShape().Location()); - setupObject(label,name?parentObj:obj,shape,prefix,name); + label = aShapeTool->AddComponent(parent, label, shape.getShape().Location()); + setupObject(label, name ? parentObj : obj, shape, prefix, name); } return label; } -bool ExportOCAF2::canFallback(std::vector objs) { - for(size_t i=0;i objs) +{ + for (size_t i = 0; i < objs.size(); ++i) { auto obj = objs[i]; - if(!obj || !obj->getNameInDocument()) + if (!obj || !obj->getNameInDocument()) { continue; - if(obj->getExtensionByType(true)) + } + if (obj->getExtensionByType(true)) { return false; - for(auto &sub : obj->getSubObjects()) + } + for (auto& sub : obj->getSubObjects()) { objs.push_back(obj->getSubObject(sub.c_str())); + } } return true; } diff --git a/src/Mod/Import/App/ImportOCAF2.h b/src/Mod/Import/App/ImportOCAF2.h index ef438b583d..f83689d889 100644 --- a/src/Mod/Import/App/ImportOCAF2.h +++ b/src/Mod/Import/App/ImportOCAF2.h @@ -39,32 +39,39 @@ #include #include -#include "ImportOCAF.h" #include "ExportOCAF.h" +#include "ImportOCAF.h" class TDF_Label; class TopLoc_Location; -namespace App { +namespace App +{ class Document; class DocumentObject; -} -namespace Part { +}// namespace App +namespace Part +{ class Feature; } -namespace Import { +namespace Import +{ -struct ShapeHasher { - std::size_t operator()(const TopoDS_Shape &s) const { +struct ShapeHasher +{ + std::size_t operator()(const TopoDS_Shape& s) const + { return s.HashCode(INT_MAX); } }; -struct LabelHasher { - std::size_t operator()(const TDF_Label &l) const { - return TDF_LabelMapHasher::HashCode(l,INT_MAX); +struct LabelHasher +{ + std::size_t operator()(const TDF_Label& l) const + { + return TDF_LabelMapHasher::HashCode(l, INT_MAX); } }; @@ -92,27 +99,34 @@ public: static ImportOCAFOptions customImportOptions(); void setImportOptions(ImportOCAFOptions opts); - void setMerge(bool enable) { + void setMerge(bool enable) + { options.merge = enable; } void setUseLinkGroup(bool enable); - void setBaseName(bool enable) { + void setBaseName(bool enable) + { options.useBaseName = enable; } - void setImportHiddenObject(bool enable) { + void setImportHiddenObject(bool enable) + { options.importHidden = enable; } - void setReduceObjects(bool enable) { + void setReduceObjects(bool enable) + { options.reduceObjects = enable; } - void setShowProgress(bool enable) { + void setShowProgress(bool enable) + { options.showProgress = enable; } - void setExpandCompound(bool enable) { + void setExpandCompound(bool enable) + { options.expandCompound = enable; } - enum ImportMode { + enum ImportMode + { SingleDoc = 0, GroupPerDoc = 1, GroupPerDir = 2, @@ -121,15 +135,17 @@ public: ModeMax, }; void setMode(int m); - int getMode() const { + int getMode() const + { return options.mode; } private: - struct Info { + struct Info + { std::string baseName; - App::DocumentObject *obj = nullptr; - App::PropertyPlacement *propPlacement = nullptr; + App::DocumentObject* obj = nullptr; + App::PropertyPlacement* propPlacement = nullptr; App::Color faceColor; App::Color edgeColor; bool hasFaceColor = false; @@ -137,40 +153,62 @@ private: int free = true; }; - App::DocumentObject *loadShape(App::Document *doc, TDF_Label label, - const TopoDS_Shape &shape, bool baseOnly=false, bool newDoc=true); - App::Document *getDocument(App::Document *doc, TDF_Label label); - bool createAssembly(App::Document *doc, TDF_Label label, - const TopoDS_Shape &shape, Info &info, bool newDoc); - bool createObject(App::Document *doc, TDF_Label label, - const TopoDS_Shape &shape, Info &info, bool newDoc); - bool createGroup(App::Document *doc, Info &info, - const TopoDS_Shape &shape, std::vector &children, - const boost::dynamic_bitset<> &visibilities, bool canReduce=false); - bool getColor(const TopoDS_Shape &shape, Info &info, bool check=false, bool noDefault=false); - void getSHUOColors(TDF_Label label, std::map &colors, bool appendFirst); - void setObjectName(Info &info, TDF_Label label); + App::DocumentObject* loadShape(App::Document* doc, + TDF_Label label, + const TopoDS_Shape& shape, + bool baseOnly = false, + bool newDoc = true); + App::Document* getDocument(App::Document* doc, TDF_Label label); + bool createAssembly(App::Document* doc, + TDF_Label label, + const TopoDS_Shape& shape, + Info& info, + bool newDoc); + bool createObject(App::Document* doc, + TDF_Label label, + const TopoDS_Shape& shape, + Info& info, + bool newDoc); + bool createGroup(App::Document* doc, + Info& info, + const TopoDS_Shape& shape, + std::vector& children, + const boost::dynamic_bitset<>& visibilities, + bool canReduce = false); + bool + getColor(const TopoDS_Shape& shape, Info& info, bool check = false, bool noDefault = false); + void + getSHUOColors(TDF_Label label, std::map& colors, bool appendFirst); + void setObjectName(Info& info, TDF_Label label); std::string getLabelName(TDF_Label label); - App::DocumentObject *expandShape(App::Document *doc, TDF_Label label, const TopoDS_Shape &shape); + App::DocumentObject* + expandShape(App::Document* doc, TDF_Label label, const TopoDS_Shape& shape); - virtual void applyEdgeColors(Part::Feature*, const std::vector&) {} - virtual void applyFaceColors(Part::Feature*, const std::vector&) {} - virtual void applyElementColors(App::DocumentObject*, const std::map&) {} - virtual void applyLinkColor(App::DocumentObject *, int /*index*/, App::Color){} + virtual void applyEdgeColors(Part::Feature*, const std::vector&) + {} + virtual void applyFaceColors(Part::Feature*, const std::vector&) + {} + virtual void applyElementColors(App::DocumentObject*, const std::map&) + {} + virtual void applyLinkColor(App::DocumentObject*, int /*index*/, App::Color) + {} private: - class ImportLegacy : public ImportOCAF { + class ImportLegacy: public ImportOCAF + { public: - explicit ImportLegacy(ImportOCAF2 &parent) - :ImportOCAF(parent.pDoc, parent.pDocument, parent.default_name),myParent(parent) + explicit ImportLegacy(ImportOCAF2& parent) + : ImportOCAF(parent.pDoc, parent.pDocument, parent.default_name) + , myParent(parent) {} private: - void applyColors(Part::Feature* part, const std::vector& colors) override { + void applyColors(Part::Feature* part, const std::vector& colors) override + { myParent.applyFaceColors(part, colors); } - ImportOCAF2 &myParent; + ImportOCAF2& myParent; }; friend class ImportLegacy; @@ -187,7 +225,7 @@ private: std::unordered_map myNames; std::unordered_map myCollapsedObjects; - Base::SequencerLauncher *sequencer{nullptr}; + Base::SequencerLauncher* sequencer {nullptr}; }; struct ImportExport ExportOCAFOptions @@ -201,41 +239,51 @@ struct ImportExport ExportOCAFOptions class ImportExport ExportOCAF2 { public: - using GetShapeColorsFunc = std::function( - App::DocumentObject*, const char*)>; - explicit ExportOCAF2(Handle(TDocStd_Document) h, GetShapeColorsFunc func=GetShapeColorsFunc()); + using GetShapeColorsFunc = + std::function(App::DocumentObject*, const char*)>; + explicit ExportOCAF2(Handle(TDocStd_Document) h, + GetShapeColorsFunc func = GetShapeColorsFunc()); static ExportOCAFOptions customExportOptions(); - void setExportOptions(ExportOCAFOptions opts) { + void setExportOptions(ExportOCAFOptions opts) + { options = opts; } - void setExportHiddenObject(bool enable) { + void setExportHiddenObject(bool enable) + { options.exportHidden = enable; } - void setKeepPlacement(bool enable) { + void setKeepPlacement(bool enable) + { options.keepPlacement = enable; } - void exportObjects(std::vector &objs, const char *name=nullptr); + void exportObjects(std::vector& objs, const char* name = nullptr); bool canFallback(std::vector objs); private: - TDF_Label exportObject(App::DocumentObject *obj, const char *sub, TDF_Label parent, const char *name=nullptr); - void setupObject(TDF_Label label, App::DocumentObject *obj, - const Part::TopoShape &shape, const std::string &prefix, - const char *name=nullptr, bool force=false); - void setName(TDF_Label label, App::DocumentObject *obj, const char *name=nullptr); - TDF_Label findComponent(const char *subname, TDF_Label label, TDF_LabelSequence &labels); + TDF_Label exportObject(App::DocumentObject* obj, + const char* sub, + TDF_Label parent, + const char* name = nullptr); + void setupObject(TDF_Label label, + App::DocumentObject* obj, + const Part::TopoShape& shape, + const std::string& prefix, + const char* name = nullptr, + bool force = false); + void setName(TDF_Label label, App::DocumentObject* obj, const char* name = nullptr); + TDF_Label findComponent(const char* subname, TDF_Label label, TDF_LabelSequence& labels); private: Handle(TDocStd_Document) pDoc; Handle(XCAFDoc_ShapeTool) aShapeTool; Handle(XCAFDoc_ColorTool) aColorTool; - std::unordered_map myObjects; + std::unordered_map myObjects; std::unordered_map, LabelHasher> myNames; - std::set > mySetups; + std::set> mySetups; std::vector groupLinks; @@ -244,6 +292,6 @@ private: ExportOCAFOptions options; }; -} +}// namespace Import -#endif //IMPORT_IMPORTOCAF2_H +#endif// IMPORT_IMPORTOCAF2_H diff --git a/src/Mod/Import/App/ImportOCAFAssembly.cpp b/src/Mod/Import/App/ImportOCAFAssembly.cpp index a95c981993..a298f34f55 100644 --- a/src/Mod/Import/App/ImportOCAFAssembly.cpp +++ b/src/Mod/Import/App/ImportOCAFAssembly.cpp @@ -22,23 +22,23 @@ #include "PreCompiled.h" #if defined(__MINGW32__) -# define WNT // avoid conflict with GUID +#define WNT// avoid conflict with GUID #endif #ifndef _PreComp_ -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif #include @@ -52,31 +52,33 @@ using namespace Import; -ImportOCAFAssembly::ImportOCAFAssembly(Handle(TDocStd_Document) h, App::Document* d, const std::string& name, App::DocumentObject *target) - : pDoc(h), - doc(d), - default_name(name), - targetObj(target) +ImportOCAFAssembly::ImportOCAFAssembly(Handle(TDocStd_Document) h, + App::Document* d, + const std::string& name, + App::DocumentObject* target) + : pDoc(h) + , doc(d) + , default_name(name) + , targetObj(target) { - aShapeTool = XCAFDoc_DocumentTool::ShapeTool (pDoc->Main()); + aShapeTool = XCAFDoc_DocumentTool::ShapeTool(pDoc->Main()); aColorTool = XCAFDoc_DocumentTool::ColorTool(pDoc->Main()); } ImportOCAFAssembly::~ImportOCAFAssembly() -{ -} +{} void ImportOCAFAssembly::loadShapes() { myRefShapes.clear(); - loadShapes(pDoc->Main(), TopLoc_Location(), default_name, "", false,0); + loadShapes(pDoc->Main(), TopLoc_Location(), default_name, "", false, 0); } void ImportOCAFAssembly::loadAssembly() { myRefShapes.clear(); - loadShapes(pDoc->Main(), TopLoc_Location(), default_name, "", false,0); + loadShapes(pDoc->Main(), TopLoc_Location(), default_name, "", false, 0); } @@ -84,88 +86,97 @@ std::string ImportOCAFAssembly::getName(const TDF_Label& label) { Handle(TDataStd_Name) name; std::string part_name; - if (label.FindAttribute(TDataStd_Name::GetID(),name)) { + if (label.FindAttribute(TDataStd_Name::GetID(), name)) { TCollection_ExtendedString extstr = name->Get(); - char* str = new char[extstr.LengthOfCString()+1]; + char* str = new char[extstr.LengthOfCString() + 1]; extstr.ToUTF8CString(str); part_name = str; - delete [] str; + delete[] str; return part_name; } return ""; - } -void ImportOCAFAssembly::loadShapes(const TDF_Label& label, const TopLoc_Location& loc, const std::string& defaultname, const std::string& assembly, bool isRef, int dep) +void ImportOCAFAssembly::loadShapes(const TDF_Label& label, + const TopLoc_Location& loc, + const std::string& defaultname, + const std::string& assembly, + bool isRef, + int dep) { int hash = 0; TopoDS_Shape aShape; - if (aShapeTool->GetShape(label,aShape)) { + if (aShapeTool->GetShape(label, aShape)) { hash = aShape.HashCode(HashUpper); } Handle(TDataStd_Name) name; std::string part_name = defaultname; - if (label.FindAttribute(TDataStd_Name::GetID(),name)) { + if (label.FindAttribute(TDataStd_Name::GetID(), name)) { TCollection_ExtendedString extstr = name->Get(); - char* str = new char[extstr.LengthOfCString()+1]; + char* str = new char[extstr.LengthOfCString() + 1]; extstr.ToUTF8CString(str); part_name = str; - delete [] str; + delete[] str; if (part_name.empty()) { part_name = defaultname; } else { - bool ws=true; + bool ws = true; for (std::string::iterator it = part_name.begin(); it != part_name.end(); ++it) { if (*it != ' ') { ws = false; break; } } - if (ws) + if (ws) { part_name = defaultname; + } } } TopLoc_Location part_loc = loc; Handle(XCAFDoc_Location) hLoc; if (label.FindAttribute(XCAFDoc_Location::GetID(), hLoc)) { - if (isRef) + if (isRef) { part_loc = part_loc * hLoc->Get(); - else + } + else { part_loc = hLoc->Get(); + } } #ifdef FC_DEBUG - const char *s; - if( !hLoc.IsNull() ) - s = hLoc->Get().IsIdentity()?"0":"1"; - else + const char* s; + if (!hLoc.IsNull()) { + s = hLoc->Get().IsIdentity() ? "0" : "1"; + } + else { s = "0"; + } std::stringstream str; - Base::Console().Log("H:%-9d \tN:%-30s \tTop:%d, Asm:%d, Shape:%d, Compound:%d, Simple:%d, Free:%d, Ref:%d, Component:%d, SubShape:%d\tTrf:%s-- Dep:%d \n", - hash, - part_name.c_str(), - aShapeTool->IsTopLevel(label), - aShapeTool->IsAssembly(label), - aShapeTool->IsShape(label), - aShapeTool->IsCompound(label), - aShapeTool->IsSimpleShape(label), - aShapeTool->IsFree(label), - aShapeTool->IsReference(label), - aShapeTool->IsComponent(label), - aShapeTool->IsSubShape(label), - s, - dep - ); + Base::Console().Log("H:%-9d \tN:%-30s \tTop:%d, Asm:%d, Shape:%d, Compound:%d, Simple:%d, " + "Free:%d, Ref:%d, Component:%d, SubShape:%d\tTrf:%s-- Dep:%d \n", + hash, + part_name.c_str(), + aShapeTool->IsTopLevel(label), + aShapeTool->IsAssembly(label), + aShapeTool->IsShape(label), + aShapeTool->IsCompound(label), + aShapeTool->IsSimpleShape(label), + aShapeTool->IsFree(label), + aShapeTool->IsReference(label), + aShapeTool->IsComponent(label), + aShapeTool->IsSubShape(label), + s, + dep); label.Dump(str); - Base::Console().Message(str.str().c_str() ); + Base::Console().Message(str.str().c_str()); #endif std::string asm_name = assembly; @@ -175,65 +186,74 @@ void ImportOCAFAssembly::loadShapes(const TDF_Label& label, const TopLoc_Locatio TDF_Label ref; if (aShapeTool->IsReference(label) && aShapeTool->GetReferredShape(label, ref)) { - loadShapes(ref, part_loc, part_name, asm_name, true,dep + 1); + loadShapes(ref, part_loc, part_name, asm_name, true, dep + 1); } if (isRef || myRefShapes.find(hash) == myRefShapes.end()) { TopoDS_Shape aShape; - if (isRef && aShapeTool->GetShape(label, aShape)) + if (isRef && aShapeTool->GetShape(label, aShape)) { myRefShapes.insert(aShape.HashCode(HashUpper)); + } if (aShapeTool->IsSimpleShape(label) && (isRef || aShapeTool->IsFree(label))) { - if (!asm_name.empty()) + if (!asm_name.empty()) { part_name = asm_name; - if (isRef) + } + if (isRef) { createShape(label, loc, part_name); - else + } + else { createShape(label, part_loc, part_name); + } } else { for (TDF_ChildIterator it(label); it.More(); it.Next()) { - loadShapes(it.Value(), part_loc, part_name, asm_name, isRef, dep+1); + loadShapes(it.Value(), part_loc, part_name, asm_name, isRef, dep + 1); } } } } -void ImportOCAFAssembly::createShape(const TDF_Label& label, const TopLoc_Location& loc, const std::string& name) +void ImportOCAFAssembly::createShape(const TDF_Label& label, + const TopLoc_Location& loc, + const std::string& name) { - Base::Console().Log("-create Shape\n"); + Base::Console().Log("-create Shape\n"); const TopoDS_Shape& aShape = aShapeTool->GetShape(label); if (!aShape.IsNull() && aShape.ShapeType() == TopAbs_COMPOUND) { TopExp_Explorer xp; int ctSolids = 0, ctShells = 0; - for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) - { + for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) { createShape(xp.Current(), loc, name); } - for (xp.Init(aShape, TopAbs_SHELL, TopAbs_SOLID); xp.More(); xp.Next(), ctShells++) - { + for (xp.Init(aShape, TopAbs_SHELL, TopAbs_SOLID); xp.More(); xp.Next(), ctShells++) { createShape(xp.Current(), loc, name); } - if (ctSolids > 0 || ctShells > 0) + if (ctSolids > 0 || ctShells > 0) { return; + } } createShape(aShape, loc, name); } -void ImportOCAFAssembly::createShape(const TopoDS_Shape& aShape, const TopLoc_Location& loc, const std::string& name) +void ImportOCAFAssembly::createShape(const TopoDS_Shape& aShape, + const TopLoc_Location& loc, + const std::string& name) { Part::Feature* part = static_cast(doc->addObject("Part::Feature")); - if (!loc.IsIdentity()) + if (!loc.IsIdentity()) { part->Shape.setValue(aShape.Moved(loc)); - else + } + else { part->Shape.setValue(aShape); + } part->Label.setValue(name); Quantity_Color aColor; - App::Color color(0.8f,0.8f,0.8f); - if (aColorTool->GetColor(aShape, XCAFDoc_ColorGen, aColor) || - aColorTool->GetColor(aShape, XCAFDoc_ColorSurf, aColor) || - aColorTool->GetColor(aShape, XCAFDoc_ColorCurv, aColor)) { + App::Color color(0.8f, 0.8f, 0.8f); + if (aColorTool->GetColor(aShape, XCAFDoc_ColorGen, aColor) + || aColorTool->GetColor(aShape, XCAFDoc_ColorSurf, aColor) + || aColorTool->GetColor(aShape, XCAFDoc_ColorCurv, aColor)) { color.r = (float)aColor.Red(); color.g = (float)aColor.Green(); color.b = (float)aColor.Blue(); @@ -243,7 +263,7 @@ void ImportOCAFAssembly::createShape(const TopoDS_Shape& aShape, const TopLoc_Lo } TopTools_IndexedMapOfShape faces; - TopExp_Explorer xp(aShape,TopAbs_FACE); + TopExp_Explorer xp(aShape, TopAbs_FACE); while (xp.More()) { faces.Add(xp.Current()); xp.Next(); @@ -251,16 +271,16 @@ void ImportOCAFAssembly::createShape(const TopoDS_Shape& aShape, const TopLoc_Lo bool found_face_color = false; std::vector faceColors; faceColors.resize(faces.Extent(), color); - xp.Init(aShape,TopAbs_FACE); + xp.Init(aShape, TopAbs_FACE); while (xp.More()) { - if (aColorTool->GetColor(xp.Current(), XCAFDoc_ColorGen, aColor) || - aColorTool->GetColor(xp.Current(), XCAFDoc_ColorSurf, aColor) || - aColorTool->GetColor(xp.Current(), XCAFDoc_ColorCurv, aColor)) { + if (aColorTool->GetColor(xp.Current(), XCAFDoc_ColorGen, aColor) + || aColorTool->GetColor(xp.Current(), XCAFDoc_ColorSurf, aColor) + || aColorTool->GetColor(xp.Current(), XCAFDoc_ColorCurv, aColor)) { int index = faces.FindIndex(xp.Current()); color.r = (float)aColor.Red(); color.g = (float)aColor.Green(); color.b = (float)aColor.Blue(); - faceColors[index-1] = color; + faceColors[index - 1] = color; found_face_color = true; } xp.Next(); @@ -270,5 +290,3 @@ void ImportOCAFAssembly::createShape(const TopoDS_Shape& aShape, const TopLoc_Lo applyColors(part, faceColors); } } - - diff --git a/src/Mod/Import/App/ImportOCAFAssembly.h b/src/Mod/Import/App/ImportOCAFAssembly.h index b88470de1e..1dd67c7036 100644 --- a/src/Mod/Import/App/ImportOCAFAssembly.h +++ b/src/Mod/Import/App/ImportOCAFAssembly.h @@ -38,34 +38,46 @@ class TDF_Label; class TopLoc_Location; -namespace App { +namespace App +{ class Document; class DocumentObject; -} -namespace Part { +}// namespace App +namespace Part +{ class Feature; } -namespace Import { +namespace Import +{ class ImportExport ImportOCAFAssembly { public: - ImportOCAFAssembly(Handle(TDocStd_Document) h, App::Document* d, const std::string& name, App::DocumentObject *target); + ImportOCAFAssembly(Handle(TDocStd_Document) h, + App::Document* d, + const std::string& name, + App::DocumentObject* target); virtual ~ImportOCAFAssembly(); void loadShapes(); void loadAssembly(); protected: std::string getName(const TDF_Label& label); - App::DocumentObject *targetObj; + App::DocumentObject* targetObj; private: - void loadShapes(const TDF_Label& label, const TopLoc_Location&, const std::string& partname, const std::string& assembly, bool isRef, int dep); + void loadShapes(const TDF_Label& label, + const TopLoc_Location&, + const std::string& partname, + const std::string& assembly, + bool isRef, + int dep); void createShape(const TDF_Label& label, const TopLoc_Location&, const std::string&); void createShape(const TopoDS_Shape& label, const TopLoc_Location&, const std::string&); - virtual void applyColors(Part::Feature*, const std::vector&){} + virtual void applyColors(Part::Feature*, const std::vector&) + {} private: Handle(TDocStd_Document) pDoc; @@ -78,6 +90,6 @@ private: }; -} // namespace Import { +}// namespace Import -#endif //IMPORT_ImportOCAFAssembly_H +#endif// IMPORT_ImportOCAFAssembly_H diff --git a/src/Mod/Import/App/PlmXmlParser.py b/src/Mod/Import/App/PlmXmlParser.py index 56e36750a9..c5ad90319e 100644 --- a/src/Mod/Import/App/PlmXmlParser.py +++ b/src/Mod/Import/App/PlmXmlParser.py @@ -1,26 +1,26 @@ # PlmXmlParser -#*************************************************************************** -#* Copyright (c) 2015 Juergen Riegel * -#* * -#* This file is part of the FreeCAD CAx development system. * -#* * -#* This program is free software; you can redistribute it and/or modify * -#* it under the terms of the GNU Lesser General Public License (LGPL) * -#* as published by the Free Software Foundation; either version 2 of * -#* the License, or (at your option) any later version. * -#* for detail see the LICENCE text file. * -#* * -#* FreeCAD is distributed in the hope that it will be useful, * -#* but WITHOUT ANY WARRANTY; without even the implied warranty of * -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -#* GNU Lesser General Public License for more details. * -#* * -#* You should have received a copy of the GNU Library General Public * -#* License along with FreeCAD; if not, write to the Free Software * -#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * -#* USA * -#* * -#***************************************************************************/ +# *************************************************************************** +# * Copyright (c) 2015 Juergen Riegel * +# * * +# * This file is part of the FreeCAD CAx development system. * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with FreeCAD; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# ***************************************************************************/ import xml.etree.ElementTree as ET @@ -29,131 +29,149 @@ FreeCAD_On = False FreeCAD_Doc = None FreeCAD_ObjList = [] + def ParseUserData(element): res = {} - for i in element.findall('{http://www.plmxml.org/Schemas/PLMXMLSchema}UserData'): - for value in i.findall('{http://www.plmxml.org/Schemas/PLMXMLSchema}UserValue'): - res[value.attrib['title']] = value.attrib['value'] + for i in element.findall("{http://www.plmxml.org/Schemas/PLMXMLSchema}UserData"): + for value in i.findall("{http://www.plmxml.org/Schemas/PLMXMLSchema}UserValue"): + res[value.attrib["title"]] = value.attrib["value"] return res + def addPart(partElement): - global FreeCAD_On,FreeCAD_Doc,FreeCAD_ObjList + global FreeCAD_On, FreeCAD_Doc, FreeCAD_ObjList print("=== Part ======================================================") - name = partElement.attrib['name'] - id = partElement.attrib['id'] + name = partElement.attrib["name"] + id = partElement.attrib["id"] userData = ParseUserData(partElement) - bound = partElement.find('{http://www.plmxml.org/Schemas/PLMXMLSchema}Bound') - print(bound.attrib['values']) + bound = partElement.find("{http://www.plmxml.org/Schemas/PLMXMLSchema}Bound") + print(bound.attrib["values"]) - representation = partElement.find('{http://www.plmxml.org/Schemas/PLMXMLSchema}Representation') - format = representation.attrib['format'] - location = representation.attrib['location'] + representation = partElement.find("{http://www.plmxml.org/Schemas/PLMXMLSchema}Representation") + format = representation.attrib["format"] + location = representation.attrib["location"] print(id, name, userData, format, location) if FreeCAD_On: - import FreeCAD,Assembly + import FreeCAD, Assembly + print("Create Reference") - partObject =FreeCAD_Doc.addObject("App::Part",id) + partObject = FreeCAD_Doc.addObject("App::Part", id) FreeCAD_ObjList.append(partObject) partObject.Label = name partObject.Meta = userData + def addAssembly(asmElement): - global FreeCAD_On,FreeCAD_Doc,FreeCAD_ObjList + global FreeCAD_On, FreeCAD_Doc, FreeCAD_ObjList print("=== Assembly ======================================================") userData = ParseUserData(asmElement) - name = asmElement.attrib['name'] - id = asmElement.attrib['id'] - instanceRefs = asmElement.attrib['instanceRefs'] - userData['instanceRefs'] = instanceRefs + name = asmElement.attrib["name"] + id = asmElement.attrib["id"] + instanceRefs = asmElement.attrib["instanceRefs"] + userData["instanceRefs"] = instanceRefs print(id, name, instanceRefs, userData) if FreeCAD_On: - import FreeCAD,Assembly + import FreeCAD, Assembly + print("Create Reference") - admObject =FreeCAD_Doc.addObject("Assembly::Product",id) + admObject = FreeCAD_Doc.addObject("Assembly::Product", id) FreeCAD_ObjList.append(admObject) admObject.Label = name admObject.Meta = userData + def addReference(refElement): - global FreeCAD_On,FreeCAD_Doc,FreeCAD_ObjList + global FreeCAD_On, FreeCAD_Doc, FreeCAD_ObjList print("=== Reference ======================================================") userData = ParseUserData(refElement) - partRef = refElement.attrib['partRef'][1:] - userData['partRef'] = partRef - id = refElement.attrib['id'] - name = refElement.attrib['name'] - transform = refElement.find('{http://www.plmxml.org/Schemas/PLMXMLSchema}Transform') - mtrx = [float(i) for i in transform.text.split(' ')] + partRef = refElement.attrib["partRef"][1:] + userData["partRef"] = partRef + id = refElement.attrib["id"] + name = refElement.attrib["name"] + transform = refElement.find("{http://www.plmxml.org/Schemas/PLMXMLSchema}Transform") + mtrx = [float(i) for i in transform.text.split(" ")] print(mtrx) - print(id,name,partRef) + print(id, name, partRef) if FreeCAD_On: - import FreeCAD,Assembly + import FreeCAD, Assembly + print("Create Reference") - refObject =FreeCAD_Doc.addObject("Assembly::ProductRef",id) + refObject = FreeCAD_Doc.addObject("Assembly::ProductRef", id) FreeCAD_ObjList.append(refObject) refObject.Label = name refObject.Meta = userData + def resolveRefs(): - global FreeCAD_On,FreeCAD_Doc,FreeCAD_ObjList + global FreeCAD_On, FreeCAD_Doc, FreeCAD_ObjList print("=== Resolve References ======================================================") if FreeCAD_On: for i in FreeCAD_ObjList: - if i.TypeId == 'Assembly::Product': + if i.TypeId == "Assembly::Product": objectList = [] - for l in i.Meta['instanceRefs'].split(' '): + for l in i.Meta["instanceRefs"].split(" "): objectList.append(FreeCAD_Doc.getObject(l)) i.Items = objectList - if i.TypeId == 'Assembly::ProductRef': - i.Item = FreeCAD_Doc.getObject(i.Meta['partRef']) + if i.TypeId == "Assembly::ProductRef": + i.Item = FreeCAD_Doc.getObject(i.Meta["partRef"]) + def open(fileName): """called when freecad opens an PlmXml file""" - global FreeCAD_On,FreeCAD_Doc - import FreeCAD,os + global FreeCAD_On, FreeCAD_Doc + import FreeCAD, os + docname = os.path.splitext(os.path.basename(fileName))[0] doc = FreeCAD.newDocument(docname) - message='Started with opening of "'+fileName+'" file\n' + message = 'Started with opening of "' + fileName + '" file\n' FreeCAD.Console.PrintMessage(message) FreeCAD_Doc = doc FreeCAD_On = True parse(fileName) resolveRefs() -def insert(filename,docname): + +def insert(filename, docname): """called when freecad imports an PlmXml file""" - global FreeCAD_On,FreeCAD_Doc + global FreeCAD_On, FreeCAD_Doc import FreeCAD + FreeCAD.setActiveDocument(docname) - doc=FreeCAD.getDocument(docname) - FreeCAD.Console.PrintMessage('Started import of "'+filename+'" file') + doc = FreeCAD.getDocument(docname) + FreeCAD.Console.PrintMessage('Started import of "' + filename + '" file') FreeCAD_Doc = doc FreeCAD_On = True parse(fileName) resolveRefs() + def main(): - parse('../../../../data/tests/Jt/Engine/2_Cylinder_Engine3.plmxml') + parse("../../../../data/tests/Jt/Engine/2_Cylinder_Engine3.plmxml") + def parse(fileName): tree = ET.parse(fileName) root = tree.getroot() - ProductDef = root.find('{http://www.plmxml.org/Schemas/PLMXMLSchema}ProductDef') + ProductDef = root.find("{http://www.plmxml.org/Schemas/PLMXMLSchema}ProductDef") - res = ParseUserData(ProductDef.find('{http://www.plmxml.org/Schemas/PLMXMLSchema}UserData')) + res = ParseUserData(ProductDef.find("{http://www.plmxml.org/Schemas/PLMXMLSchema}UserData")) - InstanceGraph = ProductDef.find('{http://www.plmxml.org/Schemas/PLMXMLSchema}InstanceGraph') + InstanceGraph = ProductDef.find("{http://www.plmxml.org/Schemas/PLMXMLSchema}InstanceGraph") # get all the special elements we can read - Instances = InstanceGraph.findall('{http://www.plmxml.org/Schemas/PLMXMLSchema}Instance') - Parts = InstanceGraph.findall('{http://www.plmxml.org/Schemas/PLMXMLSchema}Part') - ProductInstances = InstanceGraph.findall('{http://www.plmxml.org/Schemas/PLMXMLSchema}ProductInstance') - ProductRevisionViews = InstanceGraph.findall('{http://www.plmxml.org/Schemas/PLMXMLSchema}ProductRevisionView') + Instances = InstanceGraph.findall("{http://www.plmxml.org/Schemas/PLMXMLSchema}Instance") + Parts = InstanceGraph.findall("{http://www.plmxml.org/Schemas/PLMXMLSchema}Part") + ProductInstances = InstanceGraph.findall( + "{http://www.plmxml.org/Schemas/PLMXMLSchema}ProductInstance" + ) + ProductRevisionViews = InstanceGraph.findall( + "{http://www.plmxml.org/Schemas/PLMXMLSchema}ProductRevisionView" + ) instanceTypesSet = set() for child in InstanceGraph: @@ -163,28 +181,31 @@ def parse(fileName): print(i) print("") - print(len(Instances),'\t{http://www.plmxml.org/Schemas/PLMXMLSchema}Instance') - print(len(Parts),'\t{http://www.plmxml.org/Schemas/PLMXMLSchema}Part') - print(len(ProductInstances),'\t{http://www.plmxml.org/Schemas/PLMXMLSchema}ProductInstance') - print(len(ProductRevisionViews),'\t{http://www.plmxml.org/Schemas/PLMXMLSchema}ProductRevisionView') + print(len(Instances), "\t{http://www.plmxml.org/Schemas/PLMXMLSchema}Instance") + print(len(Parts), "\t{http://www.plmxml.org/Schemas/PLMXMLSchema}Part") + print(len(ProductInstances), "\t{http://www.plmxml.org/Schemas/PLMXMLSchema}ProductInstance") + print( + len(ProductRevisionViews), + "\t{http://www.plmxml.org/Schemas/PLMXMLSchema}ProductRevisionView", + ) # handle all instances for child in Instances: addReference(child) - #handle the parts and assemblies + # handle the parts and assemblies for child in Parts: - if 'type' in child.attrib: - if child.attrib['type'] == 'solid' : + if "type" in child.attrib: + if child.attrib["type"] == "solid": addPart(child) continue - if child.attrib['type'] == 'assembly' : + if child.attrib["type"] == "assembly": addAssembly(child) continue - print("Unknown Part type:",child) + print("Unknown Part type:", child) else: print("not Type in Part", child) -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/src/Mod/Import/App/PreCompiled.cpp b/src/Mod/Import/App/PreCompiled.cpp index cd345efad8..7b200a1bf2 100644 --- a/src/Mod/Import/App/PreCompiled.cpp +++ b/src/Mod/Import/App/PreCompiled.cpp @@ -22,4 +22,3 @@ #include "PreCompiled.h" - diff --git a/src/Mod/Import/App/PreCompiled.h b/src/Mod/Import/App/PreCompiled.h index f6501fd1a9..5d4a612fb2 100644 --- a/src/Mod/Import/App/PreCompiled.h +++ b/src/Mod/Import/App/PreCompiled.h @@ -29,30 +29,30 @@ /// point at which warnings of overly long specifiers disabled (needet for VC6) #ifdef _MSC_VER -# pragma warning( disable : 4251 ) -# pragma warning( disable : 4275 ) -# pragma warning( disable : 4503 ) -# pragma warning( disable : 4786 ) // specifier longer then 255 chars +#pragma warning(disable : 4251) +#pragma warning(disable : 4275) +#pragma warning(disable : 4503) +#pragma warning(disable : 4786)// specifier longer then 255 chars #endif #ifdef _PreComp_ // standard -#include -#include -#include -#include #include -#include +#include #include -#include +#include +#include +#include #include +#include +#include // OpenCasCade ===================================================================================== // Base #include -#endif //_PreComp_ +#endif//_PreComp_ #endif diff --git a/src/Mod/Import/App/StepShape.cpp b/src/Mod/Import/App/StepShape.cpp index d371895b55..87b793f17d 100644 --- a/src/Mod/Import/App/StepShape.cpp +++ b/src/Mod/Import/App/StepShape.cpp @@ -22,7 +22,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include +#include #endif #include @@ -31,8 +31,8 @@ #include #include #include -#include #include +#include #include #include "StepShape.h" @@ -63,8 +63,8 @@ int StepShape::read(const char* fileName) Handle(TColStd_HSequenceOfTransient) list = aReader.GiveList(); - //Use method StepData_StepModel::NextNumberForLabel to find its rank with the following: - //Standard_CString label = "#..."; + // Use method StepData_StepModel::NextNumberForLabel to find its rank with the following: + // Standard_CString label = "#..."; Handle(StepData_StepModel) model = aReader.StepModel(); @@ -77,15 +77,15 @@ int StepShape::read(const char* fileName) model->DumpHeader(std::cout); #endif - for (int nent=1;nent<=model->NbEntities();nent++) { - Handle(Standard_Transient) entity=model->Entity(nent); - std::cout << "label entity " << nent << ":" ; + for (int nent = 1; nent <= model->NbEntities(); nent++) { + Handle(Standard_Transient) entity = model->Entity(nent); + std::cout << "label entity " << nent << ":"; #if OCC_VERSION_HEX < 0x070401 - model->PrintLabel(entity, msg); + model->PrintLabel(entity, msg); #else - model->PrintLabel(entity, std::cout); + model->PrintLabel(entity, std::cout); #endif - std::cout << ";"<< entity->DynamicType()->Name() << std::endl; + std::cout << ";" << entity->DynamicType()->Name() << std::endl; } return 0; diff --git a/src/Mod/Import/App/StepShape.h b/src/Mod/Import/App/StepShape.h index 705e3c9f70..671971cb19 100644 --- a/src/Mod/Import/App/StepShape.h +++ b/src/Mod/Import/App/StepShape.h @@ -41,10 +41,9 @@ public: ~StepShape(); int read(const char* fileName); - }; -} // namespace Import +}// namespace Import -#endif // IMPORT_STEPSHAPE_H +#endif// IMPORT_STEPSHAPE_H diff --git a/src/Mod/Import/App/StepShapePy.xml b/src/Mod/Import/App/StepShapePy.xml index 1bbb901644..9605bc1e52 100644 --- a/src/Mod/Import/App/StepShapePy.xml +++ b/src/Mod/Import/App/StepShapePy.xml @@ -27,4 +27,4 @@ Read a STEP file into memory and make it accessible - \ No newline at end of file + diff --git a/src/Mod/Import/App/StepShapePyImp.cpp b/src/Mod/Import/App/StepShapePyImp.cpp index 752665c941..060c424697 100644 --- a/src/Mod/Import/App/StepShapePyImp.cpp +++ b/src/Mod/Import/App/StepShapePyImp.cpp @@ -22,9 +22,11 @@ #include "PreCompiled.h" +// clang-format off // inclusion of the generated files (generated out of StepShapePy.xml) #include "StepShapePy.h" #include "StepShapePy.cpp" +// clang-format on using namespace Import; @@ -34,7 +36,7 @@ std::string StepShapePy::representation() const return {""}; } -PyObject *StepShapePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper +PyObject* StepShapePy::PyMake(struct _typeobject*, PyObject*, PyObject*)// Python wrapper { // create a new instance of StepShapePy and the Twin object return new StepShapePy(new StepShape); @@ -53,13 +55,13 @@ int StepShapePy::PyInit(PyObject* args, PyObject* /*kwd*/) return -1; } -PyObject* StepShapePy::read(PyObject * /*args*/) +PyObject* StepShapePy::read(PyObject* /*args*/) { PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented"); return nullptr; } -PyObject *StepShapePy::getCustomAttributes(const char* /*attr*/) const +PyObject* StepShapePy::getCustomAttributes(const char* /*attr*/) const { return nullptr; } diff --git a/src/Mod/Import/App/config_control_design.py b/src/Mod/Import/App/config_control_design.py index 7228a4febd..7cf0c300b8 100644 --- a/src/Mod/Import/App/config_control_design.py +++ b/src/Mod/Import/App/config_control_design.py @@ -11,13720 +11,18432 @@ from SCL.TypeChecker import check_type from SCL.Builtin import * from SCL.Rules import * -schema_name = 'config_control_design' +schema_name = "config_control_design" schema_scope = sys.modules[__name__] # SELECT TYPE characterized_definition characterized_definition = SELECT( - 'characterized_product_definition', - 'shape_definition', - scope = schema_scope) + "characterized_product_definition", "shape_definition", scope=schema_scope +) # Defined datatype parameter_value class parameter_value(REAL): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # Defined datatype plane_angle_measure class plane_angle_measure(REAL): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # SELECT TYPE change_request_item -change_request_item = SELECT( - 'product_definition_formation', - scope = schema_scope) +change_request_item = SELECT("product_definition_formation", scope=schema_scope) # Defined datatype text class text(STRING): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # Defined datatype year_number class year_number(INTEGER): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # SELECT TYPE characterized_product_definition characterized_product_definition = SELECT( - 'product_definition', - 'product_definition_relationship', - scope = schema_scope) + "product_definition", "product_definition_relationship", scope=schema_scope +) # SELECT TYPE reversible_topology_item reversible_topology_item = SELECT( - 'edge', - 'path', - 'face', - 'face_bound', - 'closed_shell', - 'open_shell', - scope = schema_scope) + "edge", "path", "face", "face_bound", "closed_shell", "open_shell", scope=schema_scope +) # SELECT TYPE axis2_placement -axis2_placement = SELECT( - 'axis2_placement_2d', - 'axis2_placement_3d', - scope = schema_scope) -set_of_reversible_topology_item = SET(0,None,'reversible_topology_item', scope = schema_scope) +axis2_placement = SELECT("axis2_placement_2d", "axis2_placement_3d", scope=schema_scope) +set_of_reversible_topology_item = SET(0, None, "reversible_topology_item", scope=schema_scope) # Defined datatype week_in_year_number class week_in_year_number(INTEGER): - def __init__(self,*kargs): - pass - self.wr1() + def __init__(self, *kargs): + pass + self.wr1() + + def wr1(self): + eval_wr1_wr = (1 <= self) and (self <= 53) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr1(self): - eval_wr1_wr = ((1 <= self) and (self <= 53)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr # Defined datatype knot_type class knot_type(ENUMERATION): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # SELECT TYPE specified_item -specified_item = SELECT( - 'product_definition', - 'shape_aspect', - scope = schema_scope) +specified_item = SELECT("product_definition", "shape_aspect", scope=schema_scope) # Defined datatype minute_in_hour class minute_in_hour(INTEGER): - def __init__(self,*kargs): - pass - self.wr1() + def __init__(self, *kargs): + pass + self.wr1() + + def wr1(self): + eval_wr1_wr = (0 <= self) and (self <= 59) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr1(self): - eval_wr1_wr = ((0 <= self) and (self <= 59)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr # Defined datatype transition_code class transition_code(ENUMERATION): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # Defined datatype identifier class identifier(STRING): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # SELECT TYPE measure_value measure_value = SELECT( - 'length_measure', - 'mass_measure', - 'plane_angle_measure', - 'solid_angle_measure', - 'area_measure', - 'volume_measure', - 'parameter_value', - 'context_dependent_measure', - 'descriptive_measure', - 'positive_length_measure', - 'positive_plane_angle_measure', - 'count_measure', - scope = schema_scope) + "length_measure", + "mass_measure", + "plane_angle_measure", + "solid_angle_measure", + "area_measure", + "volume_measure", + "parameter_value", + "context_dependent_measure", + "descriptive_measure", + "positive_length_measure", + "positive_plane_angle_measure", + "count_measure", + scope=schema_scope, +) # SELECT TYPE person_organization_select person_organization_select = SELECT( - 'person', - 'organization', - 'person_and_organization', - scope = schema_scope) + "person", "organization", "person_and_organization", scope=schema_scope +) # Defined datatype preferred_surface_curve_representation class preferred_surface_curve_representation(ENUMERATION): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # Defined datatype dimension_count class dimension_count(INTEGER): - def __init__(self,*kargs): - pass - self.wr1() + def __init__(self, *kargs): + pass + self.wr1() + + def wr1(self): + eval_wr1_wr = self > 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr1(self): - eval_wr1_wr = (self > 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr # SELECT TYPE pcurve_or_surface -pcurve_or_surface = SELECT( - 'pcurve', - 'surface', - scope = schema_scope) +pcurve_or_surface = SELECT("pcurve", "surface", scope=schema_scope) # Defined datatype length_measure class length_measure(REAL): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass # Defined datatype positive_length_measure class positive_length_measure(length_measure): - def __init__(self,*kargs): - pass - self.wr1() + def __init__(self, *kargs): + pass + self.wr1() + + def wr1(self): + eval_wr1_wr = self > 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr1(self): - eval_wr1_wr = (self > 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr # Defined datatype b_spline_curve_form class b_spline_curve_form(ENUMERATION): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # Defined datatype hour_in_day class hour_in_day(INTEGER): - def __init__(self,*kargs): - pass - self.wr1() + def __init__(self, *kargs): + pass + self.wr1() + + def wr1(self): + eval_wr1_wr = (0 <= self) and (self < 24) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr1(self): - eval_wr1_wr = ((0 <= self) and (self < 24)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr # SELECT TYPE classified_item classified_item = SELECT( - 'product_definition_formation', - 'assembly_component_usage', - scope = schema_scope) + "product_definition_formation", "assembly_component_usage", scope=schema_scope +) # Defined datatype si_unit_name class si_unit_name(ENUMERATION): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # Defined datatype day_in_month_number class day_in_month_number(INTEGER): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # SELECT TYPE founded_item_select -founded_item_select = SELECT( - 'founded_item', - 'representation_item', - scope = schema_scope) +founded_item_select = SELECT("founded_item", "representation_item", scope=schema_scope) # Defined datatype trimming_preference class trimming_preference(ENUMERATION): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # SELECT TYPE vector_or_direction -vector_or_direction = SELECT( - 'vector', - 'direction', - scope = schema_scope) +vector_or_direction = SELECT("vector", "direction", scope=schema_scope) # SELECT TYPE wireframe_model wireframe_model = SELECT( - 'shell_based_wireframe_model', - 'edge_based_wireframe_model', - scope = schema_scope) + "shell_based_wireframe_model", "edge_based_wireframe_model", scope=schema_scope +) # Defined datatype volume_measure class volume_measure(REAL): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # SELECT TYPE geometric_set_select -geometric_set_select = SELECT( - 'point', - 'curve', - 'surface', - scope = schema_scope) +geometric_set_select = SELECT("point", "curve", "surface", scope=schema_scope) # Defined datatype positive_plane_angle_measure class positive_plane_angle_measure(plane_angle_measure): - def __init__(self,*kargs): - pass - self.wr1() + def __init__(self, *kargs): + pass + self.wr1() + + def wr1(self): + eval_wr1_wr = self > 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr1(self): - eval_wr1_wr = (self > 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr # SELECT TYPE start_request_item -start_request_item = SELECT( - 'product_definition_formation', - scope = schema_scope) +start_request_item = SELECT("product_definition_formation", scope=schema_scope) # Defined datatype b_spline_surface_form class b_spline_surface_form(ENUMERATION): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # SELECT TYPE person_organization_item person_organization_item = SELECT( - 'change', - 'start_work', - 'change_request', - 'start_request', - 'configuration_item', - 'product', - 'product_definition_formation', - 'product_definition', - 'contract', - 'security_classification', - scope = schema_scope) + "change", + "start_work", + "change_request", + "start_request", + "configuration_item", + "product", + "product_definition_formation", + "product_definition", + "contract", + "security_classification", + scope=schema_scope, +) # SELECT TYPE date_time_item date_time_item = SELECT( - 'product_definition', - 'change_request', - 'start_request', - 'change', - 'start_work', - 'approval_person_organization', - 'contract', - 'security_classification', - 'certification', - scope = schema_scope) + "product_definition", + "change_request", + "start_request", + "change", + "start_work", + "approval_person_organization", + "contract", + "security_classification", + "certification", + scope=schema_scope, +) # SELECT TYPE shell -shell = SELECT( - 'vertex_shell', - 'wire_shell', - 'open_shell', - 'closed_shell', - scope = schema_scope) +shell = SELECT("vertex_shell", "wire_shell", "open_shell", "closed_shell", scope=schema_scope) # SELECT TYPE transformation transformation = SELECT( - 'item_defined_transformation', - 'functionally_defined_transformation', - scope = schema_scope) + "item_defined_transformation", "functionally_defined_transformation", scope=schema_scope +) # Defined datatype day_in_week_number class day_in_week_number(INTEGER): - def __init__(self,*kargs): - pass - self.wr1() + def __init__(self, *kargs): + pass + self.wr1() + + def wr1(self): + eval_wr1_wr = (1 <= self) and (self <= 7) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr1(self): - eval_wr1_wr = ((1 <= self) and (self <= 7)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr # SELECT TYPE boolean_operand -boolean_operand = SELECT( - 'solid_model', - scope = schema_scope) +boolean_operand = SELECT("solid_model", scope=schema_scope) # SELECT TYPE certified_item -certified_item = SELECT( - 'supplied_part_relationship', - scope = schema_scope) +certified_item = SELECT("supplied_part_relationship", scope=schema_scope) # SELECT TYPE date_time_select -date_time_select = SELECT( - 'date', - 'local_time', - 'date_and_time', - scope = schema_scope) +date_time_select = SELECT("date", "local_time", "date_and_time", scope=schema_scope) # Defined datatype solid_angle_measure class solid_angle_measure(REAL): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # SELECT TYPE curve_on_surface curve_on_surface = SELECT( - 'pcurve', - 'surface_curve', - 'composite_curve_on_surface', - scope = schema_scope) + "pcurve", "surface_curve", "composite_curve_on_surface", scope=schema_scope +) # SELECT TYPE trimming_select -trimming_select = SELECT( - 'cartesian_point', - 'parameter_value', - scope = schema_scope) +trimming_select = SELECT("cartesian_point", "parameter_value", scope=schema_scope) # Defined datatype ahead_or_behind class ahead_or_behind(ENUMERATION): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # SELECT TYPE contracted_item -contracted_item = SELECT( - 'product_definition_formation', - scope = schema_scope) +contracted_item = SELECT("product_definition_formation", scope=schema_scope) # Defined datatype day_in_year_number class day_in_year_number(INTEGER): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # Defined datatype mass_measure class mass_measure(REAL): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # Defined datatype descriptive_measure class descriptive_measure(STRING): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # Defined datatype area_measure class area_measure(REAL): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # Defined datatype month_in_year_number class month_in_year_number(INTEGER): - def __init__(self,*kargs): - pass - self.wr1() + def __init__(self, *kargs): + pass + self.wr1() + + def wr1(self): + eval_wr1_wr = (1 <= self) and (self <= 12) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr1(self): - eval_wr1_wr = ((1 <= self) and (self <= 12)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr # Defined datatype source class source(ENUMERATION): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # SELECT TYPE unit -unit = SELECT( - 'named_unit', - scope = schema_scope) +unit = SELECT("named_unit", scope=schema_scope) # SELECT TYPE reversible_topology reversible_topology = SELECT( - 'reversible_topology_item', - 'list_of_reversible_topology_item', - 'set_of_reversible_topology_item', - scope = schema_scope) + "reversible_topology_item", + "list_of_reversible_topology_item", + "set_of_reversible_topology_item", + scope=schema_scope, +) # SELECT TYPE work_item -work_item = SELECT( - 'product_definition_formation', - scope = schema_scope) +work_item = SELECT("product_definition_formation", scope=schema_scope) # SELECT TYPE shape_definition shape_definition = SELECT( - 'product_definition_shape', - 'shape_aspect', - 'shape_aspect_relationship', - scope = schema_scope) + "product_definition_shape", "shape_aspect", "shape_aspect_relationship", scope=schema_scope +) # Defined datatype second_in_minute class second_in_minute(REAL): - def __init__(self,*kargs): - pass - self.wr1() + def __init__(self, *kargs): + pass + self.wr1() + + def wr1(self): + eval_wr1_wr = (0 <= self) and (self < 60) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr1(self): - eval_wr1_wr = ((0 <= self) and (self < 60)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr # Defined datatype label class label(STRING): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # Defined datatype context_dependent_measure class context_dependent_measure(REAL): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # SELECT TYPE supported_item -supported_item = SELECT( - 'action_directive', - 'action', - 'action_method', - scope = schema_scope) +supported_item = SELECT("action_directive", "action", "action_method", scope=schema_scope) # Defined datatype si_prefix class si_prefix(ENUMERATION): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass # SELECT TYPE approved_item approved_item = SELECT( - 'product_definition_formation', - 'product_definition', - 'configuration_effectivity', - 'configuration_item', - 'security_classification', - 'change_request', - 'change', - 'start_request', - 'start_work', - 'certification', - 'contract', - scope = schema_scope) + "product_definition_formation", + "product_definition", + "configuration_effectivity", + "configuration_item", + "security_classification", + "change_request", + "change", + "start_request", + "start_work", + "certification", + "contract", + scope=schema_scope, +) # Defined datatype count_measure class count_measure(NUMBER): - def __init__(self,*kargs): - pass + def __init__(self, *kargs): + pass + # SELECT TYPE surface_model -surface_model = SELECT( - 'shell_based_surface_model', - scope = schema_scope) -list_of_reversible_topology_item = LIST(0,None,'reversible_topology_item', scope = schema_scope) +surface_model = SELECT("shell_based_surface_model", scope=schema_scope) +list_of_reversible_topology_item = LIST(0, None, "reversible_topology_item", scope=schema_scope) #################### - # ENTITY representation_item # +# ENTITY representation_item # #################### class representation_item(BaseEntityClass): - '''Entity representation_item definition. + """Entity representation_item definition. - :param name - :type name:label - ''' - def __init__( self , name, ): - self.name = name + :param name + :type name:label + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (SIZEOF(using_representations(self)) > 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + name, + ): + self.name = name + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = SIZEOF(using_representations(self)) > 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY geometric_representation_item # +# ENTITY geometric_representation_item # #################### class geometric_representation_item(representation_item): - '''Entity geometric_representation_item definition. + """Entity geometric_representation_item definition. - :param dim - :type dim:dimension_count - ''' - def __init__( self , inherited0__name , ): - representation_item.__init__(self , inherited0__name , ) + :param dim + :type dim:dimension_count + """ - @apply - def dim(): - def fget( self ): - attribute_eval = dimension_of(self) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = (SIZEOF(None) == 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__name, + ): + representation_item.__init__( + self, + inherited0__name, + ) + + @apply + def dim(): + def fget(self): + attribute_eval = dimension_of(self) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument dim is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = SIZEOF(None) == 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY functionally_defined_transformation # +# ENTITY functionally_defined_transformation # #################### class functionally_defined_transformation(BaseEntityClass): - '''Entity functionally_defined_transformation definition. + """Entity functionally_defined_transformation definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text - ''' - def __init__( self , name,description, ): - self.name = name - self.description = description + :param description + :type description:text + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + ): + self.name = name + self.description = description - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name -#################### - # ENTITY cartesian_transformation_operator # -#################### -class cartesian_transformation_operator(geometric_representation_item,functionally_defined_transformation): - '''Entity cartesian_transformation_operator definition. + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value - :param axis1 - :type axis1:direction + return property(**locals()) - :param axis2 - :type axis2:direction + @apply + def description(): + def fget(self): + return self._description - :param local_origin - :type local_origin:cartesian_point + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value - :param scale - :type scale:REAL - - :param scl - :type scl:REAL - ''' - def __init__( self , inherited0__name , inherited1__name , inherited2__description , axis1,axis2,local_origin,scale, ): - geometric_representation_item.__init__(self , inherited0__name , ) - functionally_defined_transformation.__init__(self , inherited1__name , inherited2__description , ) - self.axis1 = axis1 - self.axis2 = axis2 - self.local_origin = local_origin - self.scale = scale - - @apply - def axis1(): - def fget( self ): - return self._axis1 - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,direction): - self._axis1 = direction(value) - else: - self._axis1 = value - else: - self._axis1 = value - return property(**locals()) - - @apply - def axis2(): - def fget( self ): - return self._axis2 - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,direction): - self._axis2 = direction(value) - else: - self._axis2 = value - else: - self._axis2 = value - return property(**locals()) - - @apply - def local_origin(): - def fget( self ): - return self._local_origin - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument local_origin is mantatory and can not be set to None') - if not check_type(value,cartesian_point): - self._local_origin = cartesian_point(value) - else: - self._local_origin = value - return property(**locals()) - - @apply - def scale(): - def fget( self ): - return self._scale - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,REAL): - self._scale = REAL(value) - else: - self._scale = value - else: - self._scale = value - return property(**locals()) - - @apply - def scl(): - def fget( self ): - attribute_eval = NVL(self.scale,1) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument scl is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.scl > 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + return property(**locals()) #################### - # ENTITY cartesian_transformation_operator_3d # +# ENTITY cartesian_transformation_operator # +#################### +class cartesian_transformation_operator( + geometric_representation_item, functionally_defined_transformation +): + """Entity cartesian_transformation_operator definition. + + :param axis1 + :type axis1:direction + + :param axis2 + :type axis2:direction + + :param local_origin + :type local_origin:cartesian_point + + :param scale + :type scale:REAL + + :param scl + :type scl:REAL + """ + + def __init__( + self, + inherited0__name, + inherited1__name, + inherited2__description, + axis1, + axis2, + local_origin, + scale, + ): + geometric_representation_item.__init__( + self, + inherited0__name, + ) + functionally_defined_transformation.__init__( + self, + inherited1__name, + inherited2__description, + ) + self.axis1 = axis1 + self.axis2 = axis2 + self.local_origin = local_origin + self.scale = scale + + @apply + def axis1(): + def fget(self): + return self._axis1 + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, direction): + self._axis1 = direction(value) + else: + self._axis1 = value + else: + self._axis1 = value + + return property(**locals()) + + @apply + def axis2(): + def fget(self): + return self._axis2 + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, direction): + self._axis2 = direction(value) + else: + self._axis2 = value + else: + self._axis2 = value + + return property(**locals()) + + @apply + def local_origin(): + def fget(self): + return self._local_origin + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument local_origin is mantatory and can not be set to None" + ) + if not check_type(value, cartesian_point): + self._local_origin = cartesian_point(value) + else: + self._local_origin = value + + return property(**locals()) + + @apply + def scale(): + def fget(self): + return self._scale + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, REAL): + self._scale = REAL(value) + else: + self._scale = value + else: + self._scale = value + + return property(**locals()) + + @apply + def scl(): + def fget(self): + attribute_eval = NVL(self.scale, 1) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument scl is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.scl > 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + +#################### +# ENTITY cartesian_transformation_operator_3d # #################### class cartesian_transformation_operator_3d(cartesian_transformation_operator): - '''Entity cartesian_transformation_operator_3d definition. + """Entity cartesian_transformation_operator_3d definition. - :param axis3 - :type axis3:direction + :param axis3 + :type axis3:direction - :param u - :type u:LIST(3,3,'direction', scope = schema_scope) - ''' - def __init__( self , inherited0__name , inherited1__name , inherited2__description , inherited3__axis1 , inherited4__axis2 , inherited5__local_origin , inherited6__scale , axis3, ): - cartesian_transformation_operator.__init__(self , inherited0__name , inherited1__name , inherited2__description , inherited3__axis1 , inherited4__axis2 , inherited5__local_origin , inherited6__scale , ) - self.axis3 = axis3 + :param u + :type u:LIST(3,3,'direction', scope = schema_scope) + """ - @apply - def axis3(): - def fget( self ): - return self._axis3 - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,direction): - self._axis3 = direction(value) - else: - self._axis3 = value - else: - self._axis3 = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__name, + inherited2__description, + inherited3__axis1, + inherited4__axis2, + inherited5__local_origin, + inherited6__scale, + axis3, + ): + cartesian_transformation_operator.__init__( + self, + inherited0__name, + inherited1__name, + inherited2__description, + inherited3__axis1, + inherited4__axis2, + inherited5__local_origin, + inherited6__scale, + ) + self.axis3 = axis3 - @apply - def u(): - def fget( self ): - attribute_eval = base_axis(3,self.self.cartesian_transformation_operator.self.axis1,self.self.cartesian_transformation_operator.self.axis2,self.axis3) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument u is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.self.geometric_representation_item.self.dim == 3) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def axis3(): + def fget(self): + return self._axis3 + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, direction): + self._axis3 = direction(value) + else: + self._axis3 = value + else: + self._axis3 = value + + return property(**locals()) + + @apply + def u(): + def fget(self): + attribute_eval = base_axis( + 3, + self.self.cartesian_transformation_operator.self.axis1, + self.self.cartesian_transformation_operator.self.axis2, + self.axis3, + ) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument u is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.self.geometric_representation_item.self.dim == 3 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY versioned_action_request # +# ENTITY versioned_action_request # #################### class versioned_action_request(BaseEntityClass): - '''Entity versioned_action_request definition. + """Entity versioned_action_request definition. - :param id - :type id:identifier + :param id + :type id:identifier - :param version - :type version:label + :param version + :type version:label - :param purpose - :type purpose:text + :param purpose + :type purpose:text - :param description - :type description:text - ''' - def __init__( self , id,version,purpose,description, ): - self.id = id - self.version = version - self.purpose = purpose - self.description = description + :param description + :type description:text + """ - @apply - def id(): - def fget( self ): - return self._id - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument id is mantatory and can not be set to None') - if not check_type(value,identifier): - self._id = identifier(value) - else: - self._id = value - return property(**locals()) + def __init__( + self, + id, + version, + purpose, + description, + ): + self.id = id + self.version = version + self.purpose = purpose + self.description = description - @apply - def version(): - def fget( self ): - return self._version - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument version is mantatory and can not be set to None') - if not check_type(value,label): - self._version = label(value) - else: - self._version = value - return property(**locals()) + @apply + def id(): + def fget(self): + return self._id - @apply - def purpose(): - def fget( self ): - return self._purpose - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument purpose is mantatory and can not be set to None') - if not check_type(value,text): - self._purpose = text(value) - else: - self._purpose = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument id is mantatory and can not be set to None") + if not check_type(value, identifier): + self._id = identifier(value) + else: + self._id = value + + return property(**locals()) + + @apply + def version(): + def fget(self): + return self._version + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument version is mantatory and can not be set to None") + if not check_type(value, label): + self._version = label(value) + else: + self._version = value + + return property(**locals()) + + @apply + def purpose(): + def fget(self): + return self._purpose + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument purpose is mantatory and can not be set to None") + if not check_type(value, text): + self._purpose = text(value) + else: + self._purpose = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) #################### - # ENTITY representation # +# ENTITY representation # #################### class representation(BaseEntityClass): - '''Entity representation definition. + """Entity representation definition. - :param name - :type name:label + :param name + :type name:label - :param items - :type items:SET(1,None,'representation_item', scope = schema_scope) + :param items + :type items:SET(1,None,'representation_item', scope = schema_scope) - :param context_of_items - :type context_of_items:representation_context - ''' - def __init__( self , name,items,context_of_items, ): - self.name = name - self.items = items - self.context_of_items = context_of_items + :param context_of_items + :type context_of_items:representation_context + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + items, + context_of_items, + ): + self.name = name + self.items = items + self.context_of_items = context_of_items - @apply - def items(): - def fget( self ): - return self._items - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument items is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'representation_item', scope = schema_scope)): - self._items = SET(value) - else: - self._items = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def items(): + def fget(self): + return self._items + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument items is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "representation_item", scope=schema_scope)): + self._items = SET(value) + else: + self._items = value + + return property(**locals()) + + @apply + def context_of_items(): + def fget(self): + return self._context_of_items + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument context_of_items is mantatory and can not be set to None" + ) + if not check_type(value, representation_context): + self._context_of_items = representation_context(value) + else: + self._context_of_items = value + + return property(**locals()) - @apply - def context_of_items(): - def fget( self ): - return self._context_of_items - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument context_of_items is mantatory and can not be set to None') - if not check_type(value,representation_context): - self._context_of_items = representation_context(value) - else: - self._context_of_items = value - return property(**locals()) #################### - # ENTITY shape_representation # +# ENTITY shape_representation # #################### class shape_representation(representation): - '''Entity shape_representation definition. - ''' - def __init__( self , inherited0__name , inherited1__items , inherited2__context_of_items , ): - representation.__init__(self , inherited0__name , inherited1__items , inherited2__context_of_items , ) + """Entity shape_representation definition.""" + + def __init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ): + representation.__init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ) + #################### - # ENTITY manifold_surface_shape_representation # +# ENTITY manifold_surface_shape_representation # #################### class manifold_surface_shape_representation(shape_representation): - '''Entity manifold_surface_shape_representation definition. - ''' - def __init__( self , inherited0__name , inherited1__items , inherited2__context_of_items , ): - shape_representation.__init__(self , inherited0__name , inherited1__items , inherited2__context_of_items , ) - def wr1(self): - eval_wr1_wr = (SIZEOF(None) == 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity manifold_surface_shape_representation definition.""" - def wr2(self): - eval_wr2_wr = (SIZEOF(None) > 0) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def __init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ): + shape_representation.__init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ) - def wr3(self): - eval_wr3_wr = (SIZEOF(None) == 0) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + def wr1(self): + eval_wr1_wr = SIZEOF(None) == 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr4(self): - eval_wr4_wr = (SIZEOF(None) == 0) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + def wr2(self): + eval_wr2_wr = SIZEOF(None) > 0 + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr - def wr5(self): - eval_wr5_wr = (SIZEOF(None) == 0) - if not eval_wr5_wr: - raise AssertionError('Rule wr5 violated') - else: - return eval_wr5_wr + def wr3(self): + eval_wr3_wr = SIZEOF(None) == 0 + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr - def wr6(self): - eval_wr6_wr = (SIZEOF(None) == 0) - if not eval_wr6_wr: - raise AssertionError('Rule wr6 violated') - else: - return eval_wr6_wr + def wr4(self): + eval_wr4_wr = SIZEOF(None) == 0 + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr - def wr7(self): - eval_wr7_wr = (SIZEOF(None) == 0) - if not eval_wr7_wr: - raise AssertionError('Rule wr7 violated') - else: - return eval_wr7_wr + def wr5(self): + eval_wr5_wr = SIZEOF(None) == 0 + if not eval_wr5_wr: + raise AssertionError("Rule wr5 violated") + else: + return eval_wr5_wr - def wr8(self): - eval_wr8_wr = (SIZEOF(None) == 0) - if not eval_wr8_wr: - raise AssertionError('Rule wr8 violated') - else: - return eval_wr8_wr + def wr6(self): + eval_wr6_wr = SIZEOF(None) == 0 + if not eval_wr6_wr: + raise AssertionError("Rule wr6 violated") + else: + return eval_wr6_wr - def wr9(self): - eval_wr9_wr = (SIZEOF(None) == 0) - if not eval_wr9_wr: - raise AssertionError('Rule wr9 violated') - else: - return eval_wr9_wr + def wr7(self): + eval_wr7_wr = SIZEOF(None) == 0 + if not eval_wr7_wr: + raise AssertionError("Rule wr7 violated") + else: + return eval_wr7_wr - def wr10(self): - eval_wr10_wr = (SIZEOF(None) == 0) - if not eval_wr10_wr: - raise AssertionError('Rule wr10 violated') - else: - return eval_wr10_wr + def wr8(self): + eval_wr8_wr = SIZEOF(None) == 0 + if not eval_wr8_wr: + raise AssertionError("Rule wr8 violated") + else: + return eval_wr8_wr - def wr11(self): - eval_wr11_wr = (SIZEOF(None) == 0) - if not eval_wr11_wr: - raise AssertionError('Rule wr11 violated') - else: - return eval_wr11_wr + def wr9(self): + eval_wr9_wr = SIZEOF(None) == 0 + if not eval_wr9_wr: + raise AssertionError("Rule wr9 violated") + else: + return eval_wr9_wr - def wr12(self): - eval_wr12_wr = (SIZEOF(None) == 0) - if not eval_wr12_wr: - raise AssertionError('Rule wr12 violated') - else: - return eval_wr12_wr + def wr10(self): + eval_wr10_wr = SIZEOF(None) == 0 + if not eval_wr10_wr: + raise AssertionError("Rule wr10 violated") + else: + return eval_wr10_wr - def wr13(self): - eval_wr13_wr = (SIZEOF(None) == 0) - if not eval_wr13_wr: - raise AssertionError('Rule wr13 violated') - else: - return eval_wr13_wr + def wr11(self): + eval_wr11_wr = SIZEOF(None) == 0 + if not eval_wr11_wr: + raise AssertionError("Rule wr11 violated") + else: + return eval_wr11_wr - def wr14(self): - eval_wr14_wr = (SIZEOF(None) == 0) - if not eval_wr14_wr: - raise AssertionError('Rule wr14 violated') - else: - return eval_wr14_wr + def wr12(self): + eval_wr12_wr = SIZEOF(None) == 0 + if not eval_wr12_wr: + raise AssertionError("Rule wr12 violated") + else: + return eval_wr12_wr - def wr15(self): - eval_wr15_wr = (SIZEOF(None) == 0) - if not eval_wr15_wr: - raise AssertionError('Rule wr15 violated') - else: - return eval_wr15_wr + def wr13(self): + eval_wr13_wr = SIZEOF(None) == 0 + if not eval_wr13_wr: + raise AssertionError("Rule wr13 violated") + else: + return eval_wr13_wr + + def wr14(self): + eval_wr14_wr = SIZEOF(None) == 0 + if not eval_wr14_wr: + raise AssertionError("Rule wr14 violated") + else: + return eval_wr14_wr + + def wr15(self): + eval_wr15_wr = SIZEOF(None) == 0 + if not eval_wr15_wr: + raise AssertionError("Rule wr15 violated") + else: + return eval_wr15_wr #################### - # ENTITY certification # +# ENTITY certification # #################### class certification(BaseEntityClass): - '''Entity certification definition. + """Entity certification definition. - :param name - :type name:label + :param name + :type name:label - :param purpose - :type purpose:text + :param purpose + :type purpose:text - :param kind - :type kind:certification_type - ''' - def __init__( self , name,purpose,kind, ): - self.name = name - self.purpose = purpose - self.kind = kind + :param kind + :type kind:certification_type + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + purpose, + kind, + ): + self.name = name + self.purpose = purpose + self.kind = kind - @apply - def purpose(): - def fget( self ): - return self._purpose - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument purpose is mantatory and can not be set to None') - if not check_type(value,text): - self._purpose = text(value) - else: - self._purpose = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def purpose(): + def fget(self): + return self._purpose + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument purpose is mantatory and can not be set to None") + if not check_type(value, text): + self._purpose = text(value) + else: + self._purpose = value + + return property(**locals()) + + @apply + def kind(): + def fget(self): + return self._kind + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument kind is mantatory and can not be set to None") + if not check_type(value, certification_type): + self._kind = certification_type(value) + else: + self._kind = value + + return property(**locals()) - @apply - def kind(): - def fget( self ): - return self._kind - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument kind is mantatory and can not be set to None') - if not check_type(value,certification_type): - self._kind = certification_type(value) - else: - self._kind = value - return property(**locals()) #################### - # ENTITY product_definition_relationship # +# ENTITY product_definition_relationship # #################### class product_definition_relationship(BaseEntityClass): - '''Entity product_definition_relationship definition. + """Entity product_definition_relationship definition. - :param id - :type id:identifier + :param id + :type id:identifier - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param relating_product_definition - :type relating_product_definition:product_definition + :param relating_product_definition + :type relating_product_definition:product_definition - :param related_product_definition - :type related_product_definition:product_definition - ''' - def __init__( self , id,name,description,relating_product_definition,related_product_definition, ): - self.id = id - self.name = name - self.description = description - self.relating_product_definition = relating_product_definition - self.related_product_definition = related_product_definition + :param related_product_definition + :type related_product_definition:product_definition + """ - @apply - def id(): - def fget( self ): - return self._id - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument id is mantatory and can not be set to None') - if not check_type(value,identifier): - self._id = identifier(value) - else: - self._id = value - return property(**locals()) + def __init__( + self, + id, + name, + description, + relating_product_definition, + related_product_definition, + ): + self.id = id + self.name = name + self.description = description + self.relating_product_definition = relating_product_definition + self.related_product_definition = related_product_definition - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + @apply + def id(): + def fget(self): + return self._id - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument id is mantatory and can not be set to None") + if not check_type(value, identifier): + self._id = identifier(value) + else: + self._id = value - @apply - def relating_product_definition(): - def fget( self ): - return self._relating_product_definition - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument relating_product_definition is mantatory and can not be set to None') - if not check_type(value,product_definition): - self._relating_product_definition = product_definition(value) - else: - self._relating_product_definition = value - return property(**locals()) + return property(**locals()) + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def relating_product_definition(): + def fget(self): + return self._relating_product_definition + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument relating_product_definition is mantatory and can not be set to None" + ) + if not check_type(value, product_definition): + self._relating_product_definition = product_definition(value) + else: + self._relating_product_definition = value + + return property(**locals()) + + @apply + def related_product_definition(): + def fget(self): + return self._related_product_definition + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument related_product_definition is mantatory and can not be set to None" + ) + if not check_type(value, product_definition): + self._related_product_definition = product_definition(value) + else: + self._related_product_definition = value + + return property(**locals()) - @apply - def related_product_definition(): - def fget( self ): - return self._related_product_definition - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument related_product_definition is mantatory and can not be set to None') - if not check_type(value,product_definition): - self._related_product_definition = product_definition(value) - else: - self._related_product_definition = value - return property(**locals()) #################### - # ENTITY product_definition_usage # +# ENTITY product_definition_usage # #################### class product_definition_usage(product_definition_relationship): - '''Entity product_definition_usage definition. - ''' - def __init__( self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , ): - product_definition_relationship.__init__(self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , ) - def wr1(self): - eval_wr1_wr = acyclic_product_definition_relationship(self,[self.self.product_definition_relationship.self.related_product_definition],'CONFIG_CONTROL_DESIGN.PRODUCT_DEFINITION_USAGE') - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity product_definition_usage definition.""" + + def __init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + ): + product_definition_relationship.__init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + ) + + def wr1(self): + eval_wr1_wr = acyclic_product_definition_relationship( + self, + [self.self.product_definition_relationship.self.related_product_definition], + "CONFIG_CONTROL_DESIGN.PRODUCT_DEFINITION_USAGE", + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY assembly_component_usage # +# ENTITY assembly_component_usage # #################### class assembly_component_usage(product_definition_usage): - '''Entity assembly_component_usage definition. + """Entity assembly_component_usage definition. - :param reference_designator - :type reference_designator:identifier - ''' - def __init__( self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , reference_designator, ): - product_definition_usage.__init__(self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , ) - self.reference_designator = reference_designator + :param reference_designator + :type reference_designator:identifier + """ + + def __init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + reference_designator, + ): + product_definition_usage.__init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + ) + self.reference_designator = reference_designator + + @apply + def reference_designator(): + def fget(self): + return self._reference_designator + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, identifier): + self._reference_designator = identifier(value) + else: + self._reference_designator = value + else: + self._reference_designator = value + + return property(**locals()) - @apply - def reference_designator(): - def fget( self ): - return self._reference_designator - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,identifier): - self._reference_designator = identifier(value) - else: - self._reference_designator = value - else: - self._reference_designator = value - return property(**locals()) #################### - # ENTITY quantified_assembly_component_usage # +# ENTITY quantified_assembly_component_usage # #################### class quantified_assembly_component_usage(assembly_component_usage): - '''Entity quantified_assembly_component_usage definition. + """Entity quantified_assembly_component_usage definition. - :param quantity - :type quantity:measure_with_unit - ''' - def __init__( self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , inherited5__reference_designator , quantity, ): - assembly_component_usage.__init__(self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , inherited5__reference_designator , ) - self.quantity = quantity + :param quantity + :type quantity:measure_with_unit + """ + + def __init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + inherited5__reference_designator, + quantity, + ): + assembly_component_usage.__init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + inherited5__reference_designator, + ) + self.quantity = quantity + + @apply + def quantity(): + def fget(self): + return self._quantity + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument quantity is mantatory and can not be set to None") + if not check_type(value, measure_with_unit): + self._quantity = measure_with_unit(value) + else: + self._quantity = value + + return property(**locals()) - @apply - def quantity(): - def fget( self ): - return self._quantity - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument quantity is mantatory and can not be set to None') - if not check_type(value,measure_with_unit): - self._quantity = measure_with_unit(value) - else: - self._quantity = value - return property(**locals()) #################### - # ENTITY solid_model # +# ENTITY solid_model # #################### class solid_model(geometric_representation_item): - '''Entity solid_model definition. - ''' - def __init__( self , inherited0__name , ): - geometric_representation_item.__init__(self , inherited0__name , ) + """Entity solid_model definition.""" + + def __init__( + self, + inherited0__name, + ): + geometric_representation_item.__init__( + self, + inherited0__name, + ) + #################### - # ENTITY manifold_solid_brep # +# ENTITY manifold_solid_brep # #################### class manifold_solid_brep(solid_model): - '''Entity manifold_solid_brep definition. + """Entity manifold_solid_brep definition. - :param outer - :type outer:closed_shell - ''' - def __init__( self , inherited0__name , outer, ): - solid_model.__init__(self , inherited0__name , ) - self.outer = outer + :param outer + :type outer:closed_shell + """ + + def __init__( + self, + inherited0__name, + outer, + ): + solid_model.__init__( + self, + inherited0__name, + ) + self.outer = outer + + @apply + def outer(): + def fget(self): + return self._outer + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument outer is mantatory and can not be set to None") + if not check_type(value, closed_shell): + self._outer = closed_shell(value) + else: + self._outer = value + + return property(**locals()) - @apply - def outer(): - def fget( self ): - return self._outer - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument outer is mantatory and can not be set to None') - if not check_type(value,closed_shell): - self._outer = closed_shell(value) - else: - self._outer = value - return property(**locals()) #################### - # ENTITY faceted_brep # +# ENTITY faceted_brep # #################### class faceted_brep(manifold_solid_brep): - '''Entity faceted_brep definition. - ''' - def __init__( self , inherited0__name , inherited1__outer , ): - manifold_solid_brep.__init__(self , inherited0__name , inherited1__outer , ) + """Entity faceted_brep definition.""" + + def __init__( + self, + inherited0__name, + inherited1__outer, + ): + manifold_solid_brep.__init__( + self, + inherited0__name, + inherited1__outer, + ) + #################### - # ENTITY action_directive # +# ENTITY action_directive # #################### class action_directive(BaseEntityClass): - '''Entity action_directive definition. + """Entity action_directive definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param analysis - :type analysis:text + :param analysis + :type analysis:text - :param comment - :type comment:text + :param comment + :type comment:text - :param requests - :type requests:SET(1,None,'versioned_action_request', scope = schema_scope) - ''' - def __init__( self , name,description,analysis,comment,requests, ): - self.name = name - self.description = description - self.analysis = analysis - self.comment = comment - self.requests = requests + :param requests + :type requests:SET(1,None,'versioned_action_request', scope = schema_scope) + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + analysis, + comment, + requests, + ): + self.name = name + self.description = description + self.analysis = analysis + self.comment = comment + self.requests = requests - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name - @apply - def analysis(): - def fget( self ): - return self._analysis - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument analysis is mantatory and can not be set to None') - if not check_type(value,text): - self._analysis = text(value) - else: - self._analysis = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value - @apply - def comment(): - def fget( self ): - return self._comment - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument comment is mantatory and can not be set to None') - if not check_type(value,text): - self._comment = text(value) - else: - self._comment = value - return property(**locals()) + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def analysis(): + def fget(self): + return self._analysis + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument analysis is mantatory and can not be set to None") + if not check_type(value, text): + self._analysis = text(value) + else: + self._analysis = value + + return property(**locals()) + + @apply + def comment(): + def fget(self): + return self._comment + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument comment is mantatory and can not be set to None") + if not check_type(value, text): + self._comment = text(value) + else: + self._comment = value + + return property(**locals()) + + @apply + def requests(): + def fget(self): + return self._requests + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument requests is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "versioned_action_request", scope=schema_scope)): + self._requests = SET(value) + else: + self._requests = value + + return property(**locals()) - @apply - def requests(): - def fget( self ): - return self._requests - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument requests is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'versioned_action_request', scope = schema_scope)): - self._requests = SET(value) - else: - self._requests = value - return property(**locals()) #################### - # ENTITY named_unit # +# ENTITY named_unit # #################### class named_unit(BaseEntityClass): - '''Entity named_unit definition. + """Entity named_unit definition. - :param dimensions - :type dimensions:dimensional_exponents - ''' - def __init__( self , dimensions, ): - self.dimensions = dimensions + :param dimensions + :type dimensions:dimensional_exponents + """ + + def __init__( + self, + dimensions, + ): + self.dimensions = dimensions + + @apply + def dimensions(): + def fget(self): + return self._dimensions + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument dimensions is mantatory and can not be set to None") + if not check_type(value, dimensional_exponents): + self._dimensions = dimensional_exponents(value) + else: + self._dimensions = value + + return property(**locals()) - @apply - def dimensions(): - def fget( self ): - return self._dimensions - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument dimensions is mantatory and can not be set to None') - if not check_type(value,dimensional_exponents): - self._dimensions = dimensional_exponents(value) - else: - self._dimensions = value - return property(**locals()) #################### - # ENTITY plane_angle_unit # +# ENTITY plane_angle_unit # #################### class plane_angle_unit(named_unit): - '''Entity plane_angle_unit definition. - ''' - def __init__( self , inherited0__dimensions , ): - named_unit.__init__(self , inherited0__dimensions , ) - def wr1(self): - eval_wr1_wr = (((((((self.self.named_unit.self.dimensions.self.length_exponent == 0) and (self.self.named_unit.self.dimensions.self.mass_exponent == 0)) and (self.self.named_unit.self.dimensions.self.time_exponent == 0)) and (self.self.named_unit.self.dimensions.self.electric_current_exponent == 0)) and (self.self.named_unit.self.dimensions.self.thermodynamic_temperature_exponent == 0)) and (self.self.named_unit.self.dimensions.self.amount_of_substance_exponent == 0)) and (self.self.named_unit.self.dimensions.self.luminous_intensity_exponent == 0)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity plane_angle_unit definition.""" + + def __init__( + self, + inherited0__dimensions, + ): + named_unit.__init__( + self, + inherited0__dimensions, + ) + + def wr1(self): + eval_wr1_wr = ( + ( + ( + ( + ( + (self.self.named_unit.self.dimensions.self.length_exponent == 0) + and (self.self.named_unit.self.dimensions.self.mass_exponent == 0) + ) + and (self.self.named_unit.self.dimensions.self.time_exponent == 0) + ) + and (self.self.named_unit.self.dimensions.self.electric_current_exponent == 0) + ) + and ( + self.self.named_unit.self.dimensions.self.thermodynamic_temperature_exponent + == 0 + ) + ) + and (self.self.named_unit.self.dimensions.self.amount_of_substance_exponent == 0) + ) and (self.self.named_unit.self.dimensions.self.luminous_intensity_exponent == 0) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY measure_with_unit # +# ENTITY measure_with_unit # #################### class measure_with_unit(BaseEntityClass): - '''Entity measure_with_unit definition. + """Entity measure_with_unit definition. - :param value_component - :type value_component:measure_value + :param value_component + :type value_component:measure_value - :param unit_component - :type unit_component:unit - ''' - def __init__( self , value_component,unit_component, ): - self.value_component = value_component - self.unit_component = unit_component + :param unit_component + :type unit_component:unit + """ - @apply - def value_component(): - def fget( self ): - return self._value_component - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument value_component is mantatory and can not be set to None') - if not check_type(value,measure_value): - self._value_component = measure_value(value) - else: - self._value_component = value - return property(**locals()) + def __init__( + self, + value_component, + unit_component, + ): + self.value_component = value_component + self.unit_component = unit_component - @apply - def unit_component(): - def fget( self ): - return self._unit_component - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument unit_component is mantatory and can not be set to None') - if not check_type(value,unit): - self._unit_component = unit(value) - else: - self._unit_component = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = valid_units(self) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def value_component(): + def fget(self): + return self._value_component + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument value_component is mantatory and can not be set to None" + ) + if not check_type(value, measure_value): + self._value_component = measure_value(value) + else: + self._value_component = value + + return property(**locals()) + + @apply + def unit_component(): + def fget(self): + return self._unit_component + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument unit_component is mantatory and can not be set to None" + ) + if not check_type(value, unit): + self._unit_component = unit(value) + else: + self._unit_component = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = valid_units(self) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY area_measure_with_unit # +# ENTITY area_measure_with_unit # #################### class area_measure_with_unit(measure_with_unit): - '''Entity area_measure_with_unit definition. - ''' - def __init__( self , inherited0__value_component , inherited1__unit_component , ): - measure_with_unit.__init__(self , inherited0__value_component , inherited1__unit_component , ) - def wr1(self): - eval_wr1_wr = ('CONFIG_CONTROL_DESIGN.AREA_UNIT' == TYPEOF(self.self.measure_with_unit.self.unit_component)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity area_measure_with_unit definition.""" + + def __init__( + self, + inherited0__value_component, + inherited1__unit_component, + ): + measure_with_unit.__init__( + self, + inherited0__value_component, + inherited1__unit_component, + ) + + def wr1(self): + eval_wr1_wr = "CONFIG_CONTROL_DESIGN.AREA_UNIT" == TYPEOF( + self.self.measure_with_unit.self.unit_component + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY effectivity # +# ENTITY effectivity # #################### class effectivity(BaseEntityClass): - '''Entity effectivity definition. + """Entity effectivity definition. - :param id - :type id:identifier - ''' - def __init__( self , id, ): - self.id = id + :param id + :type id:identifier + """ + + def __init__( + self, + id, + ): + self.id = id + + @apply + def id(): + def fget(self): + return self._id + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument id is mantatory and can not be set to None") + if not check_type(value, identifier): + self._id = identifier(value) + else: + self._id = value + + return property(**locals()) - @apply - def id(): - def fget( self ): - return self._id - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument id is mantatory and can not be set to None') - if not check_type(value,identifier): - self._id = identifier(value) - else: - self._id = value - return property(**locals()) #################### - # ENTITY serial_numbered_effectivity # +# ENTITY serial_numbered_effectivity # #################### class serial_numbered_effectivity(effectivity): - '''Entity serial_numbered_effectivity definition. + """Entity serial_numbered_effectivity definition. - :param effectivity_start_id - :type effectivity_start_id:identifier + :param effectivity_start_id + :type effectivity_start_id:identifier - :param effectivity_end_id - :type effectivity_end_id:identifier - ''' - def __init__( self , inherited0__id , effectivity_start_id,effectivity_end_id, ): - effectivity.__init__(self , inherited0__id , ) - self.effectivity_start_id = effectivity_start_id - self.effectivity_end_id = effectivity_end_id + :param effectivity_end_id + :type effectivity_end_id:identifier + """ - @apply - def effectivity_start_id(): - def fget( self ): - return self._effectivity_start_id - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument effectivity_start_id is mantatory and can not be set to None') - if not check_type(value,identifier): - self._effectivity_start_id = identifier(value) - else: - self._effectivity_start_id = value - return property(**locals()) + def __init__( + self, + inherited0__id, + effectivity_start_id, + effectivity_end_id, + ): + effectivity.__init__( + self, + inherited0__id, + ) + self.effectivity_start_id = effectivity_start_id + self.effectivity_end_id = effectivity_end_id + + @apply + def effectivity_start_id(): + def fget(self): + return self._effectivity_start_id + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument effectivity_start_id is mantatory and can not be set to None" + ) + if not check_type(value, identifier): + self._effectivity_start_id = identifier(value) + else: + self._effectivity_start_id = value + + return property(**locals()) + + @apply + def effectivity_end_id(): + def fget(self): + return self._effectivity_end_id + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, identifier): + self._effectivity_end_id = identifier(value) + else: + self._effectivity_end_id = value + else: + self._effectivity_end_id = value + + return property(**locals()) - @apply - def effectivity_end_id(): - def fget( self ): - return self._effectivity_end_id - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,identifier): - self._effectivity_end_id = identifier(value) - else: - self._effectivity_end_id = value - else: - self._effectivity_end_id = value - return property(**locals()) #################### - # ENTITY surface # +# ENTITY surface # #################### class surface(geometric_representation_item): - '''Entity surface definition. - ''' - def __init__( self , inherited0__name , ): - geometric_representation_item.__init__(self , inherited0__name , ) + """Entity surface definition.""" + + def __init__( + self, + inherited0__name, + ): + geometric_representation_item.__init__( + self, + inherited0__name, + ) + #################### - # ENTITY offset_surface # +# ENTITY offset_surface # #################### class offset_surface(surface): - '''Entity offset_surface definition. + """Entity offset_surface definition. - :param basis_surface - :type basis_surface:surface + :param basis_surface + :type basis_surface:surface - :param distance - :type distance:length_measure + :param distance + :type distance:length_measure - :param self_intersect - :type self_intersect:LOGICAL - ''' - def __init__( self , inherited0__name , basis_surface,distance,self_intersect, ): - surface.__init__(self , inherited0__name , ) - self.basis_surface = basis_surface - self.distance = distance - self.self_intersect = self_intersect + :param self_intersect + :type self_intersect:LOGICAL + """ - @apply - def basis_surface(): - def fget( self ): - return self._basis_surface - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument basis_surface is mantatory and can not be set to None') - if not check_type(value,surface): - self._basis_surface = surface(value) - else: - self._basis_surface = value - return property(**locals()) + def __init__( + self, + inherited0__name, + basis_surface, + distance, + self_intersect, + ): + surface.__init__( + self, + inherited0__name, + ) + self.basis_surface = basis_surface + self.distance = distance + self.self_intersect = self_intersect - @apply - def distance(): - def fget( self ): - return self._distance - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument distance is mantatory and can not be set to None') - if not check_type(value,length_measure): - self._distance = length_measure(value) - else: - self._distance = value - return property(**locals()) + @apply + def basis_surface(): + def fget(self): + return self._basis_surface + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument basis_surface is mantatory and can not be set to None" + ) + if not check_type(value, surface): + self._basis_surface = surface(value) + else: + self._basis_surface = value + + return property(**locals()) + + @apply + def distance(): + def fget(self): + return self._distance + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument distance is mantatory and can not be set to None") + if not check_type(value, length_measure): + self._distance = length_measure(value) + else: + self._distance = value + + return property(**locals()) + + @apply + def self_intersect(): + def fget(self): + return self._self_intersect + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument self_intersect is mantatory and can not be set to None" + ) + if not check_type(value, LOGICAL): + self._self_intersect = LOGICAL(value) + else: + self._self_intersect = value + + return property(**locals()) - @apply - def self_intersect(): - def fget( self ): - return self._self_intersect - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument self_intersect is mantatory and can not be set to None') - if not check_type(value,LOGICAL): - self._self_intersect = LOGICAL(value) - else: - self._self_intersect = value - return property(**locals()) #################### - # ENTITY placement # +# ENTITY placement # #################### class placement(geometric_representation_item): - '''Entity placement definition. + """Entity placement definition. - :param location - :type location:cartesian_point - ''' - def __init__( self , inherited0__name , location, ): - geometric_representation_item.__init__(self , inherited0__name , ) - self.location = location + :param location + :type location:cartesian_point + """ + + def __init__( + self, + inherited0__name, + location, + ): + geometric_representation_item.__init__( + self, + inherited0__name, + ) + self.location = location + + @apply + def location(): + def fget(self): + return self._location + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument location is mantatory and can not be set to None") + if not check_type(value, cartesian_point): + self._location = cartesian_point(value) + else: + self._location = value + + return property(**locals()) - @apply - def location(): - def fget( self ): - return self._location - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument location is mantatory and can not be set to None') - if not check_type(value,cartesian_point): - self._location = cartesian_point(value) - else: - self._location = value - return property(**locals()) #################### - # ENTITY axis2_placement_2d # +# ENTITY axis2_placement_2d # #################### class axis2_placement_2d(placement): - '''Entity axis2_placement_2d definition. + """Entity axis2_placement_2d definition. - :param ref_direction - :type ref_direction:direction + :param ref_direction + :type ref_direction:direction - :param p - :type p:LIST(2,2,'direction', scope = schema_scope) - ''' - def __init__( self , inherited0__name , inherited1__location , ref_direction, ): - placement.__init__(self , inherited0__name , inherited1__location , ) - self.ref_direction = ref_direction + :param p + :type p:LIST(2,2,'direction', scope = schema_scope) + """ - @apply - def ref_direction(): - def fget( self ): - return self._ref_direction - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,direction): - self._ref_direction = direction(value) - else: - self._ref_direction = value - else: - self._ref_direction = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__location, + ref_direction, + ): + placement.__init__( + self, + inherited0__name, + inherited1__location, + ) + self.ref_direction = ref_direction - @apply - def p(): - def fget( self ): - attribute_eval = build_2axes(self.ref_direction) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument p is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.self.geometric_representation_item.self.dim == 2) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def ref_direction(): + def fget(self): + return self._ref_direction + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, direction): + self._ref_direction = direction(value) + else: + self._ref_direction = value + else: + self._ref_direction = value + + return property(**locals()) + + @apply + def p(): + def fget(self): + attribute_eval = build_2axes(self.ref_direction) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument p is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.self.geometric_representation_item.self.dim == 2 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY product_category # +# ENTITY product_category # #################### class product_category(BaseEntityClass): - '''Entity product_category definition. + """Entity product_category definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text - ''' - def __init__( self , name,description, ): - self.name = name - self.description = description + :param description + :type description:text + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + ): + self.name = name + self.description = description + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + else: + self._description = value + + return property(**locals()) - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - else: - self._description = value - return property(**locals()) #################### - # ENTITY product_related_product_category # +# ENTITY product_related_product_category # #################### class product_related_product_category(product_category): - '''Entity product_related_product_category definition. + """Entity product_related_product_category definition. - :param products - :type products:SET(1,None,'product', scope = schema_scope) - ''' - def __init__( self , inherited0__name , inherited1__description , products, ): - product_category.__init__(self , inherited0__name , inherited1__description , ) - self.products = products + :param products + :type products:SET(1,None,'product', scope = schema_scope) + """ + + def __init__( + self, + inherited0__name, + inherited1__description, + products, + ): + product_category.__init__( + self, + inherited0__name, + inherited1__description, + ) + self.products = products + + @apply + def products(): + def fget(self): + return self._products + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument products is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "product", scope=schema_scope)): + self._products = SET(value) + else: + self._products = value + + return property(**locals()) - @apply - def products(): - def fget( self ): - return self._products - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument products is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'product', scope = schema_scope)): - self._products = SET(value) - else: - self._products = value - return property(**locals()) #################### - # ENTITY curve # +# ENTITY curve # #################### class curve(geometric_representation_item): - '''Entity curve definition. - ''' - def __init__( self , inherited0__name , ): - geometric_representation_item.__init__(self , inherited0__name , ) + """Entity curve definition.""" + + def __init__( + self, + inherited0__name, + ): + geometric_representation_item.__init__( + self, + inherited0__name, + ) + #################### - # ENTITY conic # +# ENTITY conic # #################### class conic(curve): - '''Entity conic definition. + """Entity conic definition. - :param position - :type position:axis2_placement - ''' - def __init__( self , inherited0__name , position, ): - curve.__init__(self , inherited0__name , ) - self.position = position + :param position + :type position:axis2_placement + """ + + def __init__( + self, + inherited0__name, + position, + ): + curve.__init__( + self, + inherited0__name, + ) + self.position = position + + @apply + def position(): + def fget(self): + return self._position + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument position is mantatory and can not be set to None") + if not check_type(value, axis2_placement): + self._position = axis2_placement(value) + else: + self._position = value + + return property(**locals()) - @apply - def position(): - def fget( self ): - return self._position - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument position is mantatory and can not be set to None') - if not check_type(value,axis2_placement): - self._position = axis2_placement(value) - else: - self._position = value - return property(**locals()) #################### - # ENTITY hyperbola # +# ENTITY hyperbola # #################### class hyperbola(conic): - '''Entity hyperbola definition. + """Entity hyperbola definition. - :param semi_axis - :type semi_axis:positive_length_measure + :param semi_axis + :type semi_axis:positive_length_measure - :param semi_imag_axis - :type semi_imag_axis:positive_length_measure - ''' - def __init__( self , inherited0__name , inherited1__position , semi_axis,semi_imag_axis, ): - conic.__init__(self , inherited0__name , inherited1__position , ) - self.semi_axis = semi_axis - self.semi_imag_axis = semi_imag_axis + :param semi_imag_axis + :type semi_imag_axis:positive_length_measure + """ - @apply - def semi_axis(): - def fget( self ): - return self._semi_axis - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument semi_axis is mantatory and can not be set to None') - if not check_type(value,positive_length_measure): - self._semi_axis = positive_length_measure(value) - else: - self._semi_axis = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__position, + semi_axis, + semi_imag_axis, + ): + conic.__init__( + self, + inherited0__name, + inherited1__position, + ) + self.semi_axis = semi_axis + self.semi_imag_axis = semi_imag_axis + + @apply + def semi_axis(): + def fget(self): + return self._semi_axis + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument semi_axis is mantatory and can not be set to None") + if not check_type(value, positive_length_measure): + self._semi_axis = positive_length_measure(value) + else: + self._semi_axis = value + + return property(**locals()) + + @apply + def semi_imag_axis(): + def fget(self): + return self._semi_imag_axis + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument semi_imag_axis is mantatory and can not be set to None" + ) + if not check_type(value, positive_length_measure): + self._semi_imag_axis = positive_length_measure(value) + else: + self._semi_imag_axis = value + + return property(**locals()) - @apply - def semi_imag_axis(): - def fget( self ): - return self._semi_imag_axis - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument semi_imag_axis is mantatory and can not be set to None') - if not check_type(value,positive_length_measure): - self._semi_imag_axis = positive_length_measure(value) - else: - self._semi_imag_axis = value - return property(**locals()) #################### - # ENTITY address # +# ENTITY address # #################### class address(BaseEntityClass): - '''Entity address definition. + """Entity address definition. - :param internal_location - :type internal_location:label + :param internal_location + :type internal_location:label - :param street_number - :type street_number:label + :param street_number + :type street_number:label - :param street - :type street:label + :param street + :type street:label - :param postal_box - :type postal_box:label + :param postal_box + :type postal_box:label - :param town - :type town:label + :param town + :type town:label - :param region - :type region:label + :param region + :type region:label - :param postal_code - :type postal_code:label + :param postal_code + :type postal_code:label - :param country - :type country:label + :param country + :type country:label - :param facsimile_number - :type facsimile_number:label + :param facsimile_number + :type facsimile_number:label - :param telephone_number - :type telephone_number:label + :param telephone_number + :type telephone_number:label - :param electronic_mail_address - :type electronic_mail_address:label + :param electronic_mail_address + :type electronic_mail_address:label - :param telex_number - :type telex_number:label - ''' - def __init__( self , internal_location,street_number,street,postal_box,town,region,postal_code,country,facsimile_number,telephone_number,electronic_mail_address,telex_number, ): - self.internal_location = internal_location - self.street_number = street_number - self.street = street - self.postal_box = postal_box - self.town = town - self.region = region - self.postal_code = postal_code - self.country = country - self.facsimile_number = facsimile_number - self.telephone_number = telephone_number - self.electronic_mail_address = electronic_mail_address - self.telex_number = telex_number + :param telex_number + :type telex_number:label + """ - @apply - def internal_location(): - def fget( self ): - return self._internal_location - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._internal_location = label(value) - else: - self._internal_location = value - else: - self._internal_location = value - return property(**locals()) + def __init__( + self, + internal_location, + street_number, + street, + postal_box, + town, + region, + postal_code, + country, + facsimile_number, + telephone_number, + electronic_mail_address, + telex_number, + ): + self.internal_location = internal_location + self.street_number = street_number + self.street = street + self.postal_box = postal_box + self.town = town + self.region = region + self.postal_code = postal_code + self.country = country + self.facsimile_number = facsimile_number + self.telephone_number = telephone_number + self.electronic_mail_address = electronic_mail_address + self.telex_number = telex_number - @apply - def street_number(): - def fget( self ): - return self._street_number - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._street_number = label(value) - else: - self._street_number = value - else: - self._street_number = value - return property(**locals()) + @apply + def internal_location(): + def fget(self): + return self._internal_location - @apply - def street(): - def fget( self ): - return self._street - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._street = label(value) - else: - self._street = value - else: - self._street = value - return property(**locals()) + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._internal_location = label(value) + else: + self._internal_location = value + else: + self._internal_location = value - @apply - def postal_box(): - def fget( self ): - return self._postal_box - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._postal_box = label(value) - else: - self._postal_box = value - else: - self._postal_box = value - return property(**locals()) + return property(**locals()) - @apply - def town(): - def fget( self ): - return self._town - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._town = label(value) - else: - self._town = value - else: - self._town = value - return property(**locals()) + @apply + def street_number(): + def fget(self): + return self._street_number - @apply - def region(): - def fget( self ): - return self._region - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._region = label(value) - else: - self._region = value - else: - self._region = value - return property(**locals()) + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._street_number = label(value) + else: + self._street_number = value + else: + self._street_number = value - @apply - def postal_code(): - def fget( self ): - return self._postal_code - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._postal_code = label(value) - else: - self._postal_code = value - else: - self._postal_code = value - return property(**locals()) + return property(**locals()) - @apply - def country(): - def fget( self ): - return self._country - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._country = label(value) - else: - self._country = value - else: - self._country = value - return property(**locals()) + @apply + def street(): + def fget(self): + return self._street - @apply - def facsimile_number(): - def fget( self ): - return self._facsimile_number - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._facsimile_number = label(value) - else: - self._facsimile_number = value - else: - self._facsimile_number = value - return property(**locals()) + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._street = label(value) + else: + self._street = value + else: + self._street = value - @apply - def telephone_number(): - def fget( self ): - return self._telephone_number - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._telephone_number = label(value) - else: - self._telephone_number = value - else: - self._telephone_number = value - return property(**locals()) + return property(**locals()) - @apply - def electronic_mail_address(): - def fget( self ): - return self._electronic_mail_address - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._electronic_mail_address = label(value) - else: - self._electronic_mail_address = value - else: - self._electronic_mail_address = value - return property(**locals()) + @apply + def postal_box(): + def fget(self): + return self._postal_box - @apply - def telex_number(): - def fget( self ): - return self._telex_number - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._telex_number = label(value) - else: - self._telex_number = value - else: - self._telex_number = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (((((((((((EXISTS(self.internal_location) or EXISTS(self.street_number)) or EXISTS(self.street)) or EXISTS(self.postal_box)) or EXISTS(self.town)) or EXISTS(self.region)) or EXISTS(self.postal_code)) or EXISTS(self.country)) or EXISTS(self.facsimile_number)) or EXISTS(self.telephone_number)) or EXISTS(self.electronic_mail_address)) or EXISTS(self.telex_number)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._postal_box = label(value) + else: + self._postal_box = value + else: + self._postal_box = value + + return property(**locals()) + + @apply + def town(): + def fget(self): + return self._town + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._town = label(value) + else: + self._town = value + else: + self._town = value + + return property(**locals()) + + @apply + def region(): + def fget(self): + return self._region + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._region = label(value) + else: + self._region = value + else: + self._region = value + + return property(**locals()) + + @apply + def postal_code(): + def fget(self): + return self._postal_code + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._postal_code = label(value) + else: + self._postal_code = value + else: + self._postal_code = value + + return property(**locals()) + + @apply + def country(): + def fget(self): + return self._country + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._country = label(value) + else: + self._country = value + else: + self._country = value + + return property(**locals()) + + @apply + def facsimile_number(): + def fget(self): + return self._facsimile_number + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._facsimile_number = label(value) + else: + self._facsimile_number = value + else: + self._facsimile_number = value + + return property(**locals()) + + @apply + def telephone_number(): + def fget(self): + return self._telephone_number + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._telephone_number = label(value) + else: + self._telephone_number = value + else: + self._telephone_number = value + + return property(**locals()) + + @apply + def electronic_mail_address(): + def fget(self): + return self._electronic_mail_address + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._electronic_mail_address = label(value) + else: + self._electronic_mail_address = value + else: + self._electronic_mail_address = value + + return property(**locals()) + + @apply + def telex_number(): + def fget(self): + return self._telex_number + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._telex_number = label(value) + else: + self._telex_number = value + else: + self._telex_number = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + EXISTS(self.internal_location) + or EXISTS(self.street_number) + ) + or EXISTS(self.street) + ) + or EXISTS(self.postal_box) + ) + or EXISTS(self.town) + ) + or EXISTS(self.region) + ) + or EXISTS(self.postal_code) + ) + or EXISTS(self.country) + ) + or EXISTS(self.facsimile_number) + ) + or EXISTS(self.telephone_number) + ) + or EXISTS(self.electronic_mail_address) + ) or EXISTS(self.telex_number) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY organizational_address # +# ENTITY organizational_address # #################### class organizational_address(address): - '''Entity organizational_address definition. + """Entity organizational_address definition. - :param organizations - :type organizations:SET(1,None,'organization', scope = schema_scope) + :param organizations + :type organizations:SET(1,None,'organization', scope = schema_scope) - :param description - :type description:text - ''' - def __init__( self , inherited0__internal_location , inherited1__street_number , inherited2__street , inherited3__postal_box , inherited4__town , inherited5__region , inherited6__postal_code , inherited7__country , inherited8__facsimile_number , inherited9__telephone_number , inherited10__electronic_mail_address , inherited11__telex_number , organizations,description, ): - address.__init__(self , inherited0__internal_location , inherited1__street_number , inherited2__street , inherited3__postal_box , inherited4__town , inherited5__region , inherited6__postal_code , inherited7__country , inherited8__facsimile_number , inherited9__telephone_number , inherited10__electronic_mail_address , inherited11__telex_number , ) - self.organizations = organizations - self.description = description + :param description + :type description:text + """ - @apply - def organizations(): - def fget( self ): - return self._organizations - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument organizations is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'organization', scope = schema_scope)): - self._organizations = SET(value) - else: - self._organizations = value - return property(**locals()) + def __init__( + self, + inherited0__internal_location, + inherited1__street_number, + inherited2__street, + inherited3__postal_box, + inherited4__town, + inherited5__region, + inherited6__postal_code, + inherited7__country, + inherited8__facsimile_number, + inherited9__telephone_number, + inherited10__electronic_mail_address, + inherited11__telex_number, + organizations, + description, + ): + address.__init__( + self, + inherited0__internal_location, + inherited1__street_number, + inherited2__street, + inherited3__postal_box, + inherited4__town, + inherited5__region, + inherited6__postal_code, + inherited7__country, + inherited8__facsimile_number, + inherited9__telephone_number, + inherited10__electronic_mail_address, + inherited11__telex_number, + ) + self.organizations = organizations + self.description = description + + @apply + def organizations(): + def fget(self): + return self._organizations + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument organizations is mantatory and can not be set to None" + ) + if not check_type(value, SET(1, None, "organization", scope=schema_scope)): + self._organizations = SET(value) + else: + self._organizations = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) #################### - # ENTITY bounded_surface # +# ENTITY bounded_surface # #################### class bounded_surface(surface): - '''Entity bounded_surface definition. - ''' - def __init__( self , inherited0__name , ): - surface.__init__(self , inherited0__name , ) + """Entity bounded_surface definition.""" + + def __init__( + self, + inherited0__name, + ): + surface.__init__( + self, + inherited0__name, + ) + #################### - # ENTITY b_spline_surface # +# ENTITY b_spline_surface # #################### class b_spline_surface(bounded_surface): - '''Entity b_spline_surface definition. + """Entity b_spline_surface definition. - :param u_degree - :type u_degree:INTEGER + :param u_degree + :type u_degree:INTEGER - :param v_degree - :type v_degree:INTEGER + :param v_degree + :type v_degree:INTEGER - :param control_points_list - :type control_points_list:LIST(2,None,LIST(2,None,'cartesian_point', scope = schema_scope)) + :param control_points_list + :type control_points_list:LIST(2,None,LIST(2,None,'cartesian_point', scope = schema_scope)) - :param surface_form - :type surface_form:b_spline_surface_form + :param surface_form + :type surface_form:b_spline_surface_form - :param u_closed - :type u_closed:LOGICAL + :param u_closed + :type u_closed:LOGICAL - :param v_closed - :type v_closed:LOGICAL + :param v_closed + :type v_closed:LOGICAL - :param self_intersect - :type self_intersect:LOGICAL + :param self_intersect + :type self_intersect:LOGICAL - :param u_upper - :type u_upper:INTEGER + :param u_upper + :type u_upper:INTEGER - :param v_upper - :type v_upper:INTEGER + :param v_upper + :type v_upper:INTEGER - :param control_points - :type control_points:ARRAY(0,u_upper,ARRAY(0,v_upper,'cartesian_point', scope = schema_scope)) - ''' - def __init__( self , inherited0__name , u_degree,v_degree,control_points_list,surface_form,u_closed,v_closed,self_intersect, ): - bounded_surface.__init__(self , inherited0__name , ) - self.u_degree = u_degree - self.v_degree = v_degree - self.control_points_list = control_points_list - self.surface_form = surface_form - self.u_closed = u_closed - self.v_closed = v_closed - self.self_intersect = self_intersect + :param control_points + :type control_points:ARRAY(0,u_upper,ARRAY(0,v_upper,'cartesian_point', scope = schema_scope)) + """ - @apply - def u_degree(): - def fget( self ): - return self._u_degree - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument u_degree is mantatory and can not be set to None') - if not check_type(value,INTEGER): - self._u_degree = INTEGER(value) - else: - self._u_degree = value - return property(**locals()) + def __init__( + self, + inherited0__name, + u_degree, + v_degree, + control_points_list, + surface_form, + u_closed, + v_closed, + self_intersect, + ): + bounded_surface.__init__( + self, + inherited0__name, + ) + self.u_degree = u_degree + self.v_degree = v_degree + self.control_points_list = control_points_list + self.surface_form = surface_form + self.u_closed = u_closed + self.v_closed = v_closed + self.self_intersect = self_intersect - @apply - def v_degree(): - def fget( self ): - return self._v_degree - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument v_degree is mantatory and can not be set to None') - if not check_type(value,INTEGER): - self._v_degree = INTEGER(value) - else: - self._v_degree = value - return property(**locals()) + @apply + def u_degree(): + def fget(self): + return self._u_degree - @apply - def control_points_list(): - def fget( self ): - return self._control_points_list - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument control_points_list is mantatory and can not be set to None') - if not check_type(value,LIST(2,None,LIST(2,None,'cartesian_point', scope = schema_scope))): - self._control_points_list = LIST(value) - else: - self._control_points_list = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument u_degree is mantatory and can not be set to None") + if not check_type(value, INTEGER): + self._u_degree = INTEGER(value) + else: + self._u_degree = value - @apply - def surface_form(): - def fget( self ): - return self._surface_form - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument surface_form is mantatory and can not be set to None') - if not check_type(value,b_spline_surface_form): - self._surface_form = b_spline_surface_form(value) - else: - self._surface_form = value - return property(**locals()) + return property(**locals()) - @apply - def u_closed(): - def fget( self ): - return self._u_closed - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument u_closed is mantatory and can not be set to None') - if not check_type(value,LOGICAL): - self._u_closed = LOGICAL(value) - else: - self._u_closed = value - return property(**locals()) + @apply + def v_degree(): + def fget(self): + return self._v_degree - @apply - def v_closed(): - def fget( self ): - return self._v_closed - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument v_closed is mantatory and can not be set to None') - if not check_type(value,LOGICAL): - self._v_closed = LOGICAL(value) - else: - self._v_closed = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument v_degree is mantatory and can not be set to None") + if not check_type(value, INTEGER): + self._v_degree = INTEGER(value) + else: + self._v_degree = value - @apply - def self_intersect(): - def fget( self ): - return self._self_intersect - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument self_intersect is mantatory and can not be set to None') - if not check_type(value,LOGICAL): - self._self_intersect = LOGICAL(value) - else: - self._self_intersect = value - return property(**locals()) + return property(**locals()) - @apply - def u_upper(): - def fget( self ): - attribute_eval = (SIZEOF(self.control_points_list) - 1) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument u_upper is DERIVED. It is computed and can not be set to any value') - return property(**locals()) + @apply + def control_points_list(): + def fget(self): + return self._control_points_list - @apply - def v_upper(): - def fget( self ): - attribute_eval = (SIZEOF(self.control_points_list[1]) - 1) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument v_upper is DERIVED. It is computed and can not be set to any value') - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument control_points_list is mantatory and can not be set to None" + ) + if not check_type( + value, LIST(2, None, LIST(2, None, "cartesian_point", scope=schema_scope)) + ): + self._control_points_list = LIST(value) + else: + self._control_points_list = value - @apply - def control_points(): - def fget( self ): - attribute_eval = make_array_of_array(self.control_points_list,0,self.u_upper,0,self.v_upper) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument control_points is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = (((('CONFIG_CONTROL_DESIGN.UNIFORM_SURFACE' == TYPEOF(self)) or ('CONFIG_CONTROL_DESIGN.QUASI_UNIFORM_SURFACE' == TYPEOF(self))) or ('CONFIG_CONTROL_DESIGN.BEZIER_SURFACE' == TYPEOF(self))) or ('CONFIG_CONTROL_DESIGN.B_SPLINE_SURFACE_WITH_KNOTS' == TYPEOF(self))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + return property(**locals()) + + @apply + def surface_form(): + def fget(self): + return self._surface_form + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument surface_form is mantatory and can not be set to None" + ) + if not check_type(value, b_spline_surface_form): + self._surface_form = b_spline_surface_form(value) + else: + self._surface_form = value + + return property(**locals()) + + @apply + def u_closed(): + def fget(self): + return self._u_closed + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument u_closed is mantatory and can not be set to None") + if not check_type(value, LOGICAL): + self._u_closed = LOGICAL(value) + else: + self._u_closed = value + + return property(**locals()) + + @apply + def v_closed(): + def fget(self): + return self._v_closed + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument v_closed is mantatory and can not be set to None") + if not check_type(value, LOGICAL): + self._v_closed = LOGICAL(value) + else: + self._v_closed = value + + return property(**locals()) + + @apply + def self_intersect(): + def fget(self): + return self._self_intersect + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument self_intersect is mantatory and can not be set to None" + ) + if not check_type(value, LOGICAL): + self._self_intersect = LOGICAL(value) + else: + self._self_intersect = value + + return property(**locals()) + + @apply + def u_upper(): + def fget(self): + attribute_eval = SIZEOF(self.control_points_list) - 1 + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument u_upper is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + @apply + def v_upper(): + def fget(self): + attribute_eval = SIZEOF(self.control_points_list[1]) - 1 + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument v_upper is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + @apply + def control_points(): + def fget(self): + attribute_eval = make_array_of_array( + self.control_points_list, 0, self.u_upper, 0, self.v_upper + ) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument control_points is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = ( + ( + ("CONFIG_CONTROL_DESIGN.UNIFORM_SURFACE" == TYPEOF(self)) + or ("CONFIG_CONTROL_DESIGN.QUASI_UNIFORM_SURFACE" == TYPEOF(self)) + ) + or ("CONFIG_CONTROL_DESIGN.BEZIER_SURFACE" == TYPEOF(self)) + ) or ("CONFIG_CONTROL_DESIGN.B_SPLINE_SURFACE_WITH_KNOTS" == TYPEOF(self)) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY uniform_surface # +# ENTITY uniform_surface # #################### class uniform_surface(b_spline_surface): - '''Entity uniform_surface definition. - ''' - def __init__( self , inherited0__name , inherited1__u_degree , inherited2__v_degree , inherited3__control_points_list , inherited4__surface_form , inherited5__u_closed , inherited6__v_closed , inherited7__self_intersect , ): - b_spline_surface.__init__(self , inherited0__name , inherited1__u_degree , inherited2__v_degree , inherited3__control_points_list , inherited4__surface_form , inherited5__u_closed , inherited6__v_closed , inherited7__self_intersect , ) + """Entity uniform_surface definition.""" + + def __init__( + self, + inherited0__name, + inherited1__u_degree, + inherited2__v_degree, + inherited3__control_points_list, + inherited4__surface_form, + inherited5__u_closed, + inherited6__v_closed, + inherited7__self_intersect, + ): + b_spline_surface.__init__( + self, + inherited0__name, + inherited1__u_degree, + inherited2__v_degree, + inherited3__control_points_list, + inherited4__surface_form, + inherited5__u_closed, + inherited6__v_closed, + inherited7__self_intersect, + ) + #################### - # ENTITY geometrically_bounded_surface_shape_representation # +# ENTITY geometrically_bounded_surface_shape_representation # #################### class geometrically_bounded_surface_shape_representation(shape_representation): - '''Entity geometrically_bounded_surface_shape_representation definition. - ''' - def __init__( self , inherited0__name , inherited1__items , inherited2__context_of_items , ): - shape_representation.__init__(self , inherited0__name , inherited1__items , inherited2__context_of_items , ) - def wr1(self): - eval_wr1_wr = (SIZEOF(None) == 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity geometrically_bounded_surface_shape_representation definition.""" - def wr2(self): - eval_wr2_wr = (SIZEOF(None) > 0) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def __init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ): + shape_representation.__init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ) - def wr3(self): - eval_wr3_wr = (SIZEOF(None) == 0) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + def wr1(self): + eval_wr1_wr = SIZEOF(None) == 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr4(self): - eval_wr4_wr = (SIZEOF(None) == 0) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + def wr2(self): + eval_wr2_wr = SIZEOF(None) > 0 + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr - def wr5(self): - eval_wr5_wr = (SIZEOF(None) == 0) - if not eval_wr5_wr: - raise AssertionError('Rule wr5 violated') - else: - return eval_wr5_wr + def wr3(self): + eval_wr3_wr = SIZEOF(None) == 0 + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr - def wr6(self): - eval_wr6_wr = (SIZEOF(None) == 0) - if not eval_wr6_wr: - raise AssertionError('Rule wr6 violated') - else: - return eval_wr6_wr + def wr4(self): + eval_wr4_wr = SIZEOF(None) == 0 + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr - def wr7(self): - eval_wr7_wr = (SIZEOF(None) > 0) - if not eval_wr7_wr: - raise AssertionError('Rule wr7 violated') - else: - return eval_wr7_wr + def wr5(self): + eval_wr5_wr = SIZEOF(None) == 0 + if not eval_wr5_wr: + raise AssertionError("Rule wr5 violated") + else: + return eval_wr5_wr + + def wr6(self): + eval_wr6_wr = SIZEOF(None) == 0 + if not eval_wr6_wr: + raise AssertionError("Rule wr6 violated") + else: + return eval_wr6_wr + + def wr7(self): + eval_wr7_wr = SIZEOF(None) > 0 + if not eval_wr7_wr: + raise AssertionError("Rule wr7 violated") + else: + return eval_wr7_wr #################### - # ENTITY axis1_placement # +# ENTITY axis1_placement # #################### class axis1_placement(placement): - '''Entity axis1_placement definition. + """Entity axis1_placement definition. - :param axis - :type axis:direction + :param axis + :type axis:direction - :param z - :type z:direction - ''' - def __init__( self , inherited0__name , inherited1__location , axis, ): - placement.__init__(self , inherited0__name , inherited1__location , ) - self.axis = axis + :param z + :type z:direction + """ - @apply - def axis(): - def fget( self ): - return self._axis - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,direction): - self._axis = direction(value) - else: - self._axis = value - else: - self._axis = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__location, + axis, + ): + placement.__init__( + self, + inherited0__name, + inherited1__location, + ) + self.axis = axis - @apply - def z(): - def fget( self ): - attribute_eval = NVL(normalise(self.axis),self.dummy_gri == direction([0,0,1])) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument z is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.self.geometric_representation_item.self.dim == 3) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def axis(): + def fget(self): + return self._axis + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, direction): + self._axis = direction(value) + else: + self._axis = value + else: + self._axis = value + + return property(**locals()) + + @apply + def z(): + def fget(self): + attribute_eval = NVL(normalise(self.axis), self.dummy_gri == direction([0, 0, 1])) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument z is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.self.geometric_representation_item.self.dim == 3 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY bounded_curve # +# ENTITY bounded_curve # #################### class bounded_curve(curve): - '''Entity bounded_curve definition. - ''' - def __init__( self , inherited0__name , ): - curve.__init__(self , inherited0__name , ) + """Entity bounded_curve definition.""" + + def __init__( + self, + inherited0__name, + ): + curve.__init__( + self, + inherited0__name, + ) + #################### - # ENTITY b_spline_curve # +# ENTITY b_spline_curve # #################### class b_spline_curve(bounded_curve): - '''Entity b_spline_curve definition. + """Entity b_spline_curve definition. - :param degree - :type degree:INTEGER + :param degree + :type degree:INTEGER - :param control_points_list - :type control_points_list:LIST(2,None,'cartesian_point', scope = schema_scope) + :param control_points_list + :type control_points_list:LIST(2,None,'cartesian_point', scope = schema_scope) - :param curve_form - :type curve_form:b_spline_curve_form + :param curve_form + :type curve_form:b_spline_curve_form - :param closed_curve - :type closed_curve:LOGICAL + :param closed_curve + :type closed_curve:LOGICAL - :param self_intersect - :type self_intersect:LOGICAL + :param self_intersect + :type self_intersect:LOGICAL - :param upper_index_on_control_points - :type upper_index_on_control_points:INTEGER + :param upper_index_on_control_points + :type upper_index_on_control_points:INTEGER - :param control_points - :type control_points:ARRAY(0,upper_index_on_control_points,'cartesian_point', scope = schema_scope) - ''' - def __init__( self , inherited0__name , degree,control_points_list,curve_form,closed_curve,self_intersect, ): - bounded_curve.__init__(self , inherited0__name , ) - self.degree = degree - self.control_points_list = control_points_list - self.curve_form = curve_form - self.closed_curve = closed_curve - self.self_intersect = self_intersect + :param control_points + :type control_points:ARRAY(0,upper_index_on_control_points,'cartesian_point', scope = schema_scope) + """ - @apply - def degree(): - def fget( self ): - return self._degree - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument degree is mantatory and can not be set to None') - if not check_type(value,INTEGER): - self._degree = INTEGER(value) - else: - self._degree = value - return property(**locals()) + def __init__( + self, + inherited0__name, + degree, + control_points_list, + curve_form, + closed_curve, + self_intersect, + ): + bounded_curve.__init__( + self, + inherited0__name, + ) + self.degree = degree + self.control_points_list = control_points_list + self.curve_form = curve_form + self.closed_curve = closed_curve + self.self_intersect = self_intersect - @apply - def control_points_list(): - def fget( self ): - return self._control_points_list - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument control_points_list is mantatory and can not be set to None') - if not check_type(value,LIST(2,None,'cartesian_point', scope = schema_scope)): - self._control_points_list = LIST(value) - else: - self._control_points_list = value - return property(**locals()) + @apply + def degree(): + def fget(self): + return self._degree - @apply - def curve_form(): - def fget( self ): - return self._curve_form - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument curve_form is mantatory and can not be set to None') - if not check_type(value,b_spline_curve_form): - self._curve_form = b_spline_curve_form(value) - else: - self._curve_form = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument degree is mantatory and can not be set to None") + if not check_type(value, INTEGER): + self._degree = INTEGER(value) + else: + self._degree = value - @apply - def closed_curve(): - def fget( self ): - return self._closed_curve - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument closed_curve is mantatory and can not be set to None') - if not check_type(value,LOGICAL): - self._closed_curve = LOGICAL(value) - else: - self._closed_curve = value - return property(**locals()) + return property(**locals()) - @apply - def self_intersect(): - def fget( self ): - return self._self_intersect - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument self_intersect is mantatory and can not be set to None') - if not check_type(value,LOGICAL): - self._self_intersect = LOGICAL(value) - else: - self._self_intersect = value - return property(**locals()) + @apply + def control_points_list(): + def fget(self): + return self._control_points_list - @apply - def upper_index_on_control_points(): - def fget( self ): - attribute_eval = (SIZEOF(self.control_points_list) - 1) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument upper_index_on_control_points is DERIVED. It is computed and can not be set to any value') - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument control_points_list is mantatory and can not be set to None" + ) + if not check_type(value, LIST(2, None, "cartesian_point", scope=schema_scope)): + self._control_points_list = LIST(value) + else: + self._control_points_list = value - @apply - def control_points(): - def fget( self ): - attribute_eval = list_to_array(self.control_points_list,0,self.upper_index_on_control_points) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument control_points is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = (((('CONFIG_CONTROL_DESIGN.UNIFORM_CURVE' == TYPEOF(self)) or ('CONFIG_CONTROL_DESIGN.QUASI_UNIFORM_CURVE' == TYPEOF(self))) or ('CONFIG_CONTROL_DESIGN.BEZIER_CURVE' == TYPEOF(self))) or ('CONFIG_CONTROL_DESIGN.B_SPLINE_CURVE_WITH_KNOTS' == TYPEOF(self))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + return property(**locals()) + + @apply + def curve_form(): + def fget(self): + return self._curve_form + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument curve_form is mantatory and can not be set to None") + if not check_type(value, b_spline_curve_form): + self._curve_form = b_spline_curve_form(value) + else: + self._curve_form = value + + return property(**locals()) + + @apply + def closed_curve(): + def fget(self): + return self._closed_curve + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument closed_curve is mantatory and can not be set to None" + ) + if not check_type(value, LOGICAL): + self._closed_curve = LOGICAL(value) + else: + self._closed_curve = value + + return property(**locals()) + + @apply + def self_intersect(): + def fget(self): + return self._self_intersect + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument self_intersect is mantatory and can not be set to None" + ) + if not check_type(value, LOGICAL): + self._self_intersect = LOGICAL(value) + else: + self._self_intersect = value + + return property(**locals()) + + @apply + def upper_index_on_control_points(): + def fget(self): + attribute_eval = SIZEOF(self.control_points_list) - 1 + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument upper_index_on_control_points is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + @apply + def control_points(): + def fget(self): + attribute_eval = list_to_array( + self.control_points_list, 0, self.upper_index_on_control_points + ) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument control_points is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = ( + ( + ("CONFIG_CONTROL_DESIGN.UNIFORM_CURVE" == TYPEOF(self)) + or ("CONFIG_CONTROL_DESIGN.QUASI_UNIFORM_CURVE" == TYPEOF(self)) + ) + or ("CONFIG_CONTROL_DESIGN.BEZIER_CURVE" == TYPEOF(self)) + ) or ("CONFIG_CONTROL_DESIGN.B_SPLINE_CURVE_WITH_KNOTS" == TYPEOF(self)) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY rational_b_spline_curve # +# ENTITY rational_b_spline_curve # #################### class rational_b_spline_curve(b_spline_curve): - '''Entity rational_b_spline_curve definition. + """Entity rational_b_spline_curve definition. - :param weights_data - :type weights_data:LIST(2,None,'REAL', scope = schema_scope) + :param weights_data + :type weights_data:LIST(2,None,'REAL', scope = schema_scope) - :param weights - :type weights:ARRAY(0,upper_index_on_control_points,'REAL', scope = schema_scope) - ''' - def __init__( self , inherited0__name , inherited1__degree , inherited2__control_points_list , inherited3__curve_form , inherited4__closed_curve , inherited5__self_intersect , weights_data, ): - b_spline_curve.__init__(self , inherited0__name , inherited1__degree , inherited2__control_points_list , inherited3__curve_form , inherited4__closed_curve , inherited5__self_intersect , ) - self.weights_data = weights_data + :param weights + :type weights:ARRAY(0,upper_index_on_control_points,'REAL', scope = schema_scope) + """ - @apply - def weights_data(): - def fget( self ): - return self._weights_data - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument weights_data is mantatory and can not be set to None') - if not check_type(value,LIST(2,None,'REAL', scope = schema_scope)): - self._weights_data = LIST(value) - else: - self._weights_data = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__degree, + inherited2__control_points_list, + inherited3__curve_form, + inherited4__closed_curve, + inherited5__self_intersect, + weights_data, + ): + b_spline_curve.__init__( + self, + inherited0__name, + inherited1__degree, + inherited2__control_points_list, + inherited3__curve_form, + inherited4__closed_curve, + inherited5__self_intersect, + ) + self.weights_data = weights_data - @apply - def weights(): - def fget( self ): - attribute_eval = list_to_array(self.weights_data,0,self.upper_index_on_control_points) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument weights is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = (SIZEOF(self.weights_data) == SIZEOF(self.self.b_spline_curve.self.control_points_list)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def weights_data(): + def fget(self): + return self._weights_data - def wr2(self): - eval_wr2_wr = curve_weights_positive(self) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument weights_data is mantatory and can not be set to None" + ) + if not check_type(value, LIST(2, None, "REAL", scope=schema_scope)): + self._weights_data = LIST(value) + else: + self._weights_data = value + + return property(**locals()) + + @apply + def weights(): + def fget(self): + attribute_eval = list_to_array(self.weights_data, 0, self.upper_index_on_control_points) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument weights is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = SIZEOF(self.weights_data) == SIZEOF( + self.self.b_spline_curve.self.control_points_list + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = curve_weights_positive(self) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr #################### - # ENTITY action_request_assignment # +# ENTITY action_request_assignment # #################### class action_request_assignment(BaseEntityClass): - '''Entity action_request_assignment definition. + """Entity action_request_assignment definition. - :param assigned_action_request - :type assigned_action_request:versioned_action_request - ''' - def __init__( self , assigned_action_request, ): - self.assigned_action_request = assigned_action_request + :param assigned_action_request + :type assigned_action_request:versioned_action_request + """ + + def __init__( + self, + assigned_action_request, + ): + self.assigned_action_request = assigned_action_request + + @apply + def assigned_action_request(): + def fget(self): + return self._assigned_action_request + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument assigned_action_request is mantatory and can not be set to None" + ) + if not check_type(value, versioned_action_request): + self._assigned_action_request = versioned_action_request(value) + else: + self._assigned_action_request = value + + return property(**locals()) - @apply - def assigned_action_request(): - def fget( self ): - return self._assigned_action_request - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument assigned_action_request is mantatory and can not be set to None') - if not check_type(value,versioned_action_request): - self._assigned_action_request = versioned_action_request(value) - else: - self._assigned_action_request = value - return property(**locals()) #################### - # ENTITY topological_representation_item # +# ENTITY topological_representation_item # #################### class topological_representation_item(representation_item): - '''Entity topological_representation_item definition. - ''' - def __init__( self , inherited0__name , ): - representation_item.__init__(self , inherited0__name , ) + """Entity topological_representation_item definition.""" + + def __init__( + self, + inherited0__name, + ): + representation_item.__init__( + self, + inherited0__name, + ) + #################### - # ENTITY face_bound # +# ENTITY face_bound # #################### class face_bound(topological_representation_item): - '''Entity face_bound definition. + """Entity face_bound definition. - :param bound - :type bound:loop + :param bound + :type bound:loop - :param orientation - :type orientation:BOOLEAN - ''' - def __init__( self , inherited0__name , bound,orientation, ): - topological_representation_item.__init__(self , inherited0__name , ) - self.bound = bound - self.orientation = orientation + :param orientation + :type orientation:BOOLEAN + """ - @apply - def bound(): - def fget( self ): - return self._bound - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument bound is mantatory and can not be set to None') - if not check_type(value,loop): - self._bound = loop(value) - else: - self._bound = value - return property(**locals()) + def __init__( + self, + inherited0__name, + bound, + orientation, + ): + topological_representation_item.__init__( + self, + inherited0__name, + ) + self.bound = bound + self.orientation = orientation + + @apply + def bound(): + def fget(self): + return self._bound + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument bound is mantatory and can not be set to None") + if not check_type(value, loop): + self._bound = loop(value) + else: + self._bound = value + + return property(**locals()) + + @apply + def orientation(): + def fget(self): + return self._orientation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument orientation is mantatory and can not be set to None") + if not check_type(value, BOOLEAN): + self._orientation = BOOLEAN(value) + else: + self._orientation = value + + return property(**locals()) - @apply - def orientation(): - def fget( self ): - return self._orientation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument orientation is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._orientation = BOOLEAN(value) - else: - self._orientation = value - return property(**locals()) #################### - # ENTITY length_measure_with_unit # +# ENTITY length_measure_with_unit # #################### class length_measure_with_unit(measure_with_unit): - '''Entity length_measure_with_unit definition. - ''' - def __init__( self , inherited0__value_component , inherited1__unit_component , ): - measure_with_unit.__init__(self , inherited0__value_component , inherited1__unit_component , ) - def wr1(self): - eval_wr1_wr = ('CONFIG_CONTROL_DESIGN.LENGTH_UNIT' == TYPEOF(self.self.measure_with_unit.self.unit_component)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity length_measure_with_unit definition.""" + + def __init__( + self, + inherited0__value_component, + inherited1__unit_component, + ): + measure_with_unit.__init__( + self, + inherited0__value_component, + inherited1__unit_component, + ) + + def wr1(self): + eval_wr1_wr = "CONFIG_CONTROL_DESIGN.LENGTH_UNIT" == TYPEOF( + self.self.measure_with_unit.self.unit_component + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY dated_effectivity # +# ENTITY dated_effectivity # #################### class dated_effectivity(effectivity): - '''Entity dated_effectivity definition. + """Entity dated_effectivity definition. - :param effectivity_start_date - :type effectivity_start_date:date_and_time + :param effectivity_start_date + :type effectivity_start_date:date_and_time - :param effectivity_end_date - :type effectivity_end_date:date_and_time - ''' - def __init__( self , inherited0__id , effectivity_start_date,effectivity_end_date, ): - effectivity.__init__(self , inherited0__id , ) - self.effectivity_start_date = effectivity_start_date - self.effectivity_end_date = effectivity_end_date + :param effectivity_end_date + :type effectivity_end_date:date_and_time + """ - @apply - def effectivity_start_date(): - def fget( self ): - return self._effectivity_start_date - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument effectivity_start_date is mantatory and can not be set to None') - if not check_type(value,date_and_time): - self._effectivity_start_date = date_and_time(value) - else: - self._effectivity_start_date = value - return property(**locals()) + def __init__( + self, + inherited0__id, + effectivity_start_date, + effectivity_end_date, + ): + effectivity.__init__( + self, + inherited0__id, + ) + self.effectivity_start_date = effectivity_start_date + self.effectivity_end_date = effectivity_end_date + + @apply + def effectivity_start_date(): + def fget(self): + return self._effectivity_start_date + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument effectivity_start_date is mantatory and can not be set to None" + ) + if not check_type(value, date_and_time): + self._effectivity_start_date = date_and_time(value) + else: + self._effectivity_start_date = value + + return property(**locals()) + + @apply + def effectivity_end_date(): + def fget(self): + return self._effectivity_end_date + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, date_and_time): + self._effectivity_end_date = date_and_time(value) + else: + self._effectivity_end_date = value + else: + self._effectivity_end_date = value + + return property(**locals()) - @apply - def effectivity_end_date(): - def fget( self ): - return self._effectivity_end_date - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,date_and_time): - self._effectivity_end_date = date_and_time(value) - else: - self._effectivity_end_date = value - else: - self._effectivity_end_date = value - return property(**locals()) #################### - # ENTITY direction # +# ENTITY direction # #################### class direction(geometric_representation_item): - '''Entity direction definition. + """Entity direction definition. - :param direction_ratios - :type direction_ratios:LIST(2,3,'REAL', scope = schema_scope) - ''' - def __init__( self , inherited0__name , direction_ratios, ): - geometric_representation_item.__init__(self , inherited0__name , ) - self.direction_ratios = direction_ratios + :param direction_ratios + :type direction_ratios:LIST(2,3,'REAL', scope = schema_scope) + """ - @apply - def direction_ratios(): - def fget( self ): - return self._direction_ratios - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument direction_ratios is mantatory and can not be set to None') - if not check_type(value,LIST(2,3,'REAL', scope = schema_scope)): - self._direction_ratios = LIST(value) - else: - self._direction_ratios = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (SIZEOF(None) > 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__name, + direction_ratios, + ): + geometric_representation_item.__init__( + self, + inherited0__name, + ) + self.direction_ratios = direction_ratios + + @apply + def direction_ratios(): + def fget(self): + return self._direction_ratios + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument direction_ratios is mantatory and can not be set to None" + ) + if not check_type(value, LIST(2, 3, "REAL", scope=schema_scope)): + self._direction_ratios = LIST(value) + else: + self._direction_ratios = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = SIZEOF(None) > 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY next_assembly_usage_occurrence # +# ENTITY next_assembly_usage_occurrence # #################### class next_assembly_usage_occurrence(assembly_component_usage): - '''Entity next_assembly_usage_occurrence definition. - ''' - def __init__( self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , inherited5__reference_designator , ): - assembly_component_usage.__init__(self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , inherited5__reference_designator , ) + """Entity next_assembly_usage_occurrence definition.""" + + def __init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + inherited5__reference_designator, + ): + assembly_component_usage.__init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + inherited5__reference_designator, + ) + #################### - # ENTITY edge # +# ENTITY edge # #################### class edge(topological_representation_item): - '''Entity edge definition. + """Entity edge definition. - :param edge_start - :type edge_start:vertex + :param edge_start + :type edge_start:vertex - :param edge_end - :type edge_end:vertex - ''' - def __init__( self , inherited0__name , edge_start,edge_end, ): - topological_representation_item.__init__(self , inherited0__name , ) - self.edge_start = edge_start - self.edge_end = edge_end + :param edge_end + :type edge_end:vertex + """ - @apply - def edge_start(): - def fget( self ): - return self._edge_start - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument edge_start is mantatory and can not be set to None') - if not check_type(value,vertex): - self._edge_start = vertex(value) - else: - self._edge_start = value - return property(**locals()) + def __init__( + self, + inherited0__name, + edge_start, + edge_end, + ): + topological_representation_item.__init__( + self, + inherited0__name, + ) + self.edge_start = edge_start + self.edge_end = edge_end + + @apply + def edge_start(): + def fget(self): + return self._edge_start + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument edge_start is mantatory and can not be set to None") + if not check_type(value, vertex): + self._edge_start = vertex(value) + else: + self._edge_start = value + + return property(**locals()) + + @apply + def edge_end(): + def fget(self): + return self._edge_end + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument edge_end is mantatory and can not be set to None") + if not check_type(value, vertex): + self._edge_end = vertex(value) + else: + self._edge_end = value + + return property(**locals()) - @apply - def edge_end(): - def fget( self ): - return self._edge_end - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument edge_end is mantatory and can not be set to None') - if not check_type(value,vertex): - self._edge_end = vertex(value) - else: - self._edge_end = value - return property(**locals()) #################### - # ENTITY oriented_edge # +# ENTITY oriented_edge # #################### class oriented_edge(edge): - '''Entity oriented_edge definition. + """Entity oriented_edge definition. - :param edge_element - :type edge_element:edge + :param edge_element + :type edge_element:edge - :param orientation - :type orientation:BOOLEAN + :param orientation + :type orientation:BOOLEAN - :param edge_edge_start - :type edge_edge_start:vertex + :param edge_edge_start + :type edge_edge_start:vertex - :param edge_edge_end - :type edge_edge_end:vertex - ''' - def __init__( self , inherited0__name , inherited1__edge_start , inherited2__edge_end , edge_element,orientation, ): - edge.__init__(self , inherited0__name , inherited1__edge_start , inherited2__edge_end , ) - self.edge_element = edge_element - self.orientation = orientation + :param edge_edge_end + :type edge_edge_end:vertex + """ - @apply - def edge_element(): - def fget( self ): - return self._edge_element - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument edge_element is mantatory and can not be set to None') - if not check_type(value,edge): - self._edge_element = edge(value) - else: - self._edge_element = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__edge_start, + inherited2__edge_end, + edge_element, + orientation, + ): + edge.__init__( + self, + inherited0__name, + inherited1__edge_start, + inherited2__edge_end, + ) + self.edge_element = edge_element + self.orientation = orientation - @apply - def orientation(): - def fget( self ): - return self._orientation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument orientation is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._orientation = BOOLEAN(value) - else: - self._orientation = value - return property(**locals()) + @apply + def edge_element(): + def fget(self): + return self._edge_element - @apply - def edge_edge_start(): - def fget( self ): - attribute_eval = boolean_choose(self.self.orientation,self.self.edge_element.self.edge_start,self.self.edge_element.self.edge_end) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument edge_edge_start is DERIVED. It is computed and can not be set to any value') - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument edge_element is mantatory and can not be set to None" + ) + if not check_type(value, edge): + self._edge_element = edge(value) + else: + self._edge_element = value - @apply - def edge_edge_end(): - def fget( self ): - attribute_eval = boolean_choose(self.self.orientation,self.self.edge_element.self.edge_end,self.self.edge_element.self.edge_start) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument edge_edge_end is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = ( not ('CONFIG_CONTROL_DESIGN.ORIENTED_EDGE' == TYPEOF(self.self.edge_element))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + return property(**locals()) + + @apply + def orientation(): + def fget(self): + return self._orientation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument orientation is mantatory and can not be set to None") + if not check_type(value, BOOLEAN): + self._orientation = BOOLEAN(value) + else: + self._orientation = value + + return property(**locals()) + + @apply + def edge_edge_start(): + def fget(self): + attribute_eval = boolean_choose( + self.self.orientation, + self.self.edge_element.self.edge_start, + self.self.edge_element.self.edge_end, + ) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument edge_edge_start is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + @apply + def edge_edge_end(): + def fget(self): + attribute_eval = boolean_choose( + self.self.orientation, + self.self.edge_element.self.edge_end, + self.self.edge_element.self.edge_start, + ) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument edge_edge_end is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = not ("CONFIG_CONTROL_DESIGN.ORIENTED_EDGE" == TYPEOF(self.self.edge_element)) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY person # +# ENTITY person # #################### class person(BaseEntityClass): - '''Entity person definition. + """Entity person definition. - :param id - :type id:identifier + :param id + :type id:identifier - :param last_name - :type last_name:label + :param last_name + :type last_name:label - :param first_name - :type first_name:label + :param first_name + :type first_name:label - :param middle_names - :type middle_names:LIST(1,None,'STRING', scope = schema_scope) + :param middle_names + :type middle_names:LIST(1,None,'STRING', scope = schema_scope) - :param prefix_titles - :type prefix_titles:LIST(1,None,'STRING', scope = schema_scope) + :param prefix_titles + :type prefix_titles:LIST(1,None,'STRING', scope = schema_scope) - :param suffix_titles - :type suffix_titles:LIST(1,None,'STRING', scope = schema_scope) - ''' - def __init__( self , id,last_name,first_name,middle_names,prefix_titles,suffix_titles, ): - self.id = id - self.last_name = last_name - self.first_name = first_name - self.middle_names = middle_names - self.prefix_titles = prefix_titles - self.suffix_titles = suffix_titles + :param suffix_titles + :type suffix_titles:LIST(1,None,'STRING', scope = schema_scope) + """ - @apply - def id(): - def fget( self ): - return self._id - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument id is mantatory and can not be set to None') - if not check_type(value,identifier): - self._id = identifier(value) - else: - self._id = value - return property(**locals()) + def __init__( + self, + id, + last_name, + first_name, + middle_names, + prefix_titles, + suffix_titles, + ): + self.id = id + self.last_name = last_name + self.first_name = first_name + self.middle_names = middle_names + self.prefix_titles = prefix_titles + self.suffix_titles = suffix_titles - @apply - def last_name(): - def fget( self ): - return self._last_name - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._last_name = label(value) - else: - self._last_name = value - else: - self._last_name = value - return property(**locals()) + @apply + def id(): + def fget(self): + return self._id - @apply - def first_name(): - def fget( self ): - return self._first_name - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._first_name = label(value) - else: - self._first_name = value - else: - self._first_name = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument id is mantatory and can not be set to None") + if not check_type(value, identifier): + self._id = identifier(value) + else: + self._id = value - @apply - def middle_names(): - def fget( self ): - return self._middle_names - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,LIST(1,None,'STRING', scope = schema_scope)): - self._middle_names = LIST(value) - else: - self._middle_names = value - else: - self._middle_names = value - return property(**locals()) + return property(**locals()) - @apply - def prefix_titles(): - def fget( self ): - return self._prefix_titles - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,LIST(1,None,'STRING', scope = schema_scope)): - self._prefix_titles = LIST(value) - else: - self._prefix_titles = value - else: - self._prefix_titles = value - return property(**locals()) + @apply + def last_name(): + def fget(self): + return self._last_name - @apply - def suffix_titles(): - def fget( self ): - return self._suffix_titles - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,LIST(1,None,'STRING', scope = schema_scope)): - self._suffix_titles = LIST(value) - else: - self._suffix_titles = value - else: - self._suffix_titles = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (EXISTS(self.last_name) or EXISTS(self.first_name)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._last_name = label(value) + else: + self._last_name = value + else: + self._last_name = value + + return property(**locals()) + + @apply + def first_name(): + def fget(self): + return self._first_name + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._first_name = label(value) + else: + self._first_name = value + else: + self._first_name = value + + return property(**locals()) + + @apply + def middle_names(): + def fget(self): + return self._middle_names + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, LIST(1, None, "STRING", scope=schema_scope)): + self._middle_names = LIST(value) + else: + self._middle_names = value + else: + self._middle_names = value + + return property(**locals()) + + @apply + def prefix_titles(): + def fget(self): + return self._prefix_titles + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, LIST(1, None, "STRING", scope=schema_scope)): + self._prefix_titles = LIST(value) + else: + self._prefix_titles = value + else: + self._prefix_titles = value + + return property(**locals()) + + @apply + def suffix_titles(): + def fget(self): + return self._suffix_titles + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, LIST(1, None, "STRING", scope=schema_scope)): + self._suffix_titles = LIST(value) + else: + self._suffix_titles = value + else: + self._suffix_titles = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = EXISTS(self.last_name) or EXISTS(self.first_name) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY document # +# ENTITY document # #################### class document(BaseEntityClass): - '''Entity document definition. + """Entity document definition. - :param id - :type id:identifier + :param id + :type id:identifier - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param kind - :type kind:document_type - ''' - def __init__( self , id,name,description,kind, ): - self.id = id - self.name = name - self.description = description - self.kind = kind + :param kind + :type kind:document_type + """ - @apply - def id(): - def fget( self ): - return self._id - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument id is mantatory and can not be set to None') - if not check_type(value,identifier): - self._id = identifier(value) - else: - self._id = value - return property(**locals()) + def __init__( + self, + id, + name, + description, + kind, + ): + self.id = id + self.name = name + self.description = description + self.kind = kind - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + @apply + def id(): + def fget(self): + return self._id - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument id is mantatory and can not be set to None") + if not check_type(value, identifier): + self._id = identifier(value) + else: + self._id = value + + return property(**locals()) + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def kind(): + def fget(self): + return self._kind + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument kind is mantatory and can not be set to None") + if not check_type(value, document_type): + self._kind = document_type(value) + else: + self._kind = value + + return property(**locals()) - @apply - def kind(): - def fget( self ): - return self._kind - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument kind is mantatory and can not be set to None') - if not check_type(value,document_type): - self._kind = document_type(value) - else: - self._kind = value - return property(**locals()) #################### - # ENTITY document_with_class # +# ENTITY document_with_class # #################### class document_with_class(document): - '''Entity document_with_class definition. + """Entity document_with_class definition. - :param class_ - :type class_:identifier - ''' - def __init__( self , inherited0__id , inherited1__name , inherited2__description , inherited3__kind , class_, ): - document.__init__(self , inherited0__id , inherited1__name , inherited2__description , inherited3__kind , ) - self.class_ = class_ + :param class_ + :type class_:identifier + """ + + def __init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__kind, + class_, + ): + document.__init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__kind, + ) + self.class_ = class_ + + @apply + def class_(): + def fget(self): + return self._class_ + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument class_ is mantatory and can not be set to None") + if not check_type(value, identifier): + self._class_ = identifier(value) + else: + self._class_ = value + + return property(**locals()) - @apply - def class_(): - def fget( self ): - return self._class_ - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument class_ is mantatory and can not be set to None') - if not check_type(value,identifier): - self._class_ = identifier(value) - else: - self._class_ = value - return property(**locals()) #################### - # ENTITY conversion_based_unit # +# ENTITY conversion_based_unit # #################### class conversion_based_unit(named_unit): - '''Entity conversion_based_unit definition. + """Entity conversion_based_unit definition. - :param name - :type name:label + :param name + :type name:label - :param conversion_factor - :type conversion_factor:measure_with_unit - ''' - def __init__( self , inherited0__dimensions , name,conversion_factor, ): - named_unit.__init__(self , inherited0__dimensions , ) - self.name = name - self.conversion_factor = conversion_factor + :param conversion_factor + :type conversion_factor:measure_with_unit + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + inherited0__dimensions, + name, + conversion_factor, + ): + named_unit.__init__( + self, + inherited0__dimensions, + ) + self.name = name + self.conversion_factor = conversion_factor + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def conversion_factor(): + def fget(self): + return self._conversion_factor + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument conversion_factor is mantatory and can not be set to None" + ) + if not check_type(value, measure_with_unit): + self._conversion_factor = measure_with_unit(value) + else: + self._conversion_factor = value + + return property(**locals()) - @apply - def conversion_factor(): - def fget( self ): - return self._conversion_factor - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument conversion_factor is mantatory and can not be set to None') - if not check_type(value,measure_with_unit): - self._conversion_factor = measure_with_unit(value) - else: - self._conversion_factor = value - return property(**locals()) #################### - # ENTITY point # +# ENTITY point # #################### class point(geometric_representation_item): - '''Entity point definition. - ''' - def __init__( self , inherited0__name , ): - geometric_representation_item.__init__(self , inherited0__name , ) + """Entity point definition.""" + + def __init__( + self, + inherited0__name, + ): + geometric_representation_item.__init__( + self, + inherited0__name, + ) + #################### - # ENTITY point_on_surface # +# ENTITY point_on_surface # #################### class point_on_surface(point): - '''Entity point_on_surface definition. + """Entity point_on_surface definition. - :param basis_surface - :type basis_surface:surface + :param basis_surface + :type basis_surface:surface - :param point_parameter_u - :type point_parameter_u:parameter_value + :param point_parameter_u + :type point_parameter_u:parameter_value - :param point_parameter_v - :type point_parameter_v:parameter_value - ''' - def __init__( self , inherited0__name , basis_surface,point_parameter_u,point_parameter_v, ): - point.__init__(self , inherited0__name , ) - self.basis_surface = basis_surface - self.point_parameter_u = point_parameter_u - self.point_parameter_v = point_parameter_v + :param point_parameter_v + :type point_parameter_v:parameter_value + """ - @apply - def basis_surface(): - def fget( self ): - return self._basis_surface - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument basis_surface is mantatory and can not be set to None') - if not check_type(value,surface): - self._basis_surface = surface(value) - else: - self._basis_surface = value - return property(**locals()) + def __init__( + self, + inherited0__name, + basis_surface, + point_parameter_u, + point_parameter_v, + ): + point.__init__( + self, + inherited0__name, + ) + self.basis_surface = basis_surface + self.point_parameter_u = point_parameter_u + self.point_parameter_v = point_parameter_v - @apply - def point_parameter_u(): - def fget( self ): - return self._point_parameter_u - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument point_parameter_u is mantatory and can not be set to None') - if not check_type(value,parameter_value): - self._point_parameter_u = parameter_value(value) - else: - self._point_parameter_u = value - return property(**locals()) + @apply + def basis_surface(): + def fget(self): + return self._basis_surface + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument basis_surface is mantatory and can not be set to None" + ) + if not check_type(value, surface): + self._basis_surface = surface(value) + else: + self._basis_surface = value + + return property(**locals()) + + @apply + def point_parameter_u(): + def fget(self): + return self._point_parameter_u + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument point_parameter_u is mantatory and can not be set to None" + ) + if not check_type(value, parameter_value): + self._point_parameter_u = parameter_value(value) + else: + self._point_parameter_u = value + + return property(**locals()) + + @apply + def point_parameter_v(): + def fget(self): + return self._point_parameter_v + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument point_parameter_v is mantatory and can not be set to None" + ) + if not check_type(value, parameter_value): + self._point_parameter_v = parameter_value(value) + else: + self._point_parameter_v = value + + return property(**locals()) - @apply - def point_parameter_v(): - def fget( self ): - return self._point_parameter_v - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument point_parameter_v is mantatory and can not be set to None') - if not check_type(value,parameter_value): - self._point_parameter_v = parameter_value(value) - else: - self._point_parameter_v = value - return property(**locals()) #################### - # ENTITY product_definition_formation # +# ENTITY product_definition_formation # #################### class product_definition_formation(BaseEntityClass): - '''Entity product_definition_formation definition. + """Entity product_definition_formation definition. - :param id - :type id:identifier + :param id + :type id:identifier - :param description - :type description:text + :param description + :type description:text - :param of_product - :type of_product:product - ''' - def __init__( self , id,description,of_product, ): - self.id = id - self.description = description - self.of_product = of_product + :param of_product + :type of_product:product + """ - @apply - def id(): - def fget( self ): - return self._id - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument id is mantatory and can not be set to None') - if not check_type(value,identifier): - self._id = identifier(value) - else: - self._id = value - return property(**locals()) + def __init__( + self, + id, + description, + of_product, + ): + self.id = id + self.description = description + self.of_product = of_product - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def id(): + def fget(self): + return self._id + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument id is mantatory and can not be set to None") + if not check_type(value, identifier): + self._id = identifier(value) + else: + self._id = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def of_product(): + def fget(self): + return self._of_product + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument of_product is mantatory and can not be set to None") + if not check_type(value, product): + self._of_product = product(value) + else: + self._of_product = value + + return property(**locals()) - @apply - def of_product(): - def fget( self ): - return self._of_product - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument of_product is mantatory and can not be set to None') - if not check_type(value,product): - self._of_product = product(value) - else: - self._of_product = value - return property(**locals()) #################### - # ENTITY person_and_organization_assignment # +# ENTITY person_and_organization_assignment # #################### class person_and_organization_assignment(BaseEntityClass): - '''Entity person_and_organization_assignment definition. + """Entity person_and_organization_assignment definition. - :param assigned_person_and_organization - :type assigned_person_and_organization:person_and_organization + :param assigned_person_and_organization + :type assigned_person_and_organization:person_and_organization - :param role - :type role:person_and_organization_role - ''' - def __init__( self , assigned_person_and_organization,role, ): - self.assigned_person_and_organization = assigned_person_and_organization - self.role = role + :param role + :type role:person_and_organization_role + """ - @apply - def assigned_person_and_organization(): - def fget( self ): - return self._assigned_person_and_organization - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument assigned_person_and_organization is mantatory and can not be set to None') - if not check_type(value,person_and_organization): - self._assigned_person_and_organization = person_and_organization(value) - else: - self._assigned_person_and_organization = value - return property(**locals()) + def __init__( + self, + assigned_person_and_organization, + role, + ): + self.assigned_person_and_organization = assigned_person_and_organization + self.role = role + + @apply + def assigned_person_and_organization(): + def fget(self): + return self._assigned_person_and_organization + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument assigned_person_and_organization is mantatory and can not be set to None" + ) + if not check_type(value, person_and_organization): + self._assigned_person_and_organization = person_and_organization(value) + else: + self._assigned_person_and_organization = value + + return property(**locals()) + + @apply + def role(): + def fget(self): + return self._role + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument role is mantatory and can not be set to None") + if not check_type(value, person_and_organization_role): + self._role = person_and_organization_role(value) + else: + self._role = value + + return property(**locals()) - @apply - def role(): - def fget( self ): - return self._role - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument role is mantatory and can not be set to None') - if not check_type(value,person_and_organization_role): - self._role = person_and_organization_role(value) - else: - self._role = value - return property(**locals()) #################### - # ENTITY cc_design_person_and_organization_assignment # +# ENTITY cc_design_person_and_organization_assignment # #################### class cc_design_person_and_organization_assignment(person_and_organization_assignment): - '''Entity cc_design_person_and_organization_assignment definition. + """Entity cc_design_person_and_organization_assignment definition. - :param items - :type items:SET(1,None,'person_organization_item', scope = schema_scope) - ''' - def __init__( self , inherited0__assigned_person_and_organization , inherited1__role , items, ): - person_and_organization_assignment.__init__(self , inherited0__assigned_person_and_organization , inherited1__role , ) - self.items = items + :param items + :type items:SET(1,None,'person_organization_item', scope = schema_scope) + """ - @apply - def items(): - def fget( self ): - return self._items - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument items is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'person_organization_item', scope = schema_scope)): - self._items = SET(value) - else: - self._items = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = cc_design_person_and_organization_correlation(self) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__assigned_person_and_organization, + inherited1__role, + items, + ): + person_and_organization_assignment.__init__( + self, + inherited0__assigned_person_and_organization, + inherited1__role, + ) + self.items = items + + @apply + def items(): + def fget(self): + return self._items + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument items is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "person_organization_item", scope=schema_scope)): + self._items = SET(value) + else: + self._items = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = cc_design_person_and_organization_correlation(self) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY offset_curve_3d # +# ENTITY offset_curve_3d # #################### class offset_curve_3d(curve): - '''Entity offset_curve_3d definition. + """Entity offset_curve_3d definition. - :param basis_curve - :type basis_curve:curve + :param basis_curve + :type basis_curve:curve - :param distance - :type distance:length_measure + :param distance + :type distance:length_measure - :param self_intersect - :type self_intersect:LOGICAL + :param self_intersect + :type self_intersect:LOGICAL - :param ref_direction - :type ref_direction:direction - ''' - def __init__( self , inherited0__name , basis_curve,distance,self_intersect,ref_direction, ): - curve.__init__(self , inherited0__name , ) - self.basis_curve = basis_curve - self.distance = distance - self.self_intersect = self_intersect - self.ref_direction = ref_direction + :param ref_direction + :type ref_direction:direction + """ - @apply - def basis_curve(): - def fget( self ): - return self._basis_curve - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument basis_curve is mantatory and can not be set to None') - if not check_type(value,curve): - self._basis_curve = curve(value) - else: - self._basis_curve = value - return property(**locals()) + def __init__( + self, + inherited0__name, + basis_curve, + distance, + self_intersect, + ref_direction, + ): + curve.__init__( + self, + inherited0__name, + ) + self.basis_curve = basis_curve + self.distance = distance + self.self_intersect = self_intersect + self.ref_direction = ref_direction - @apply - def distance(): - def fget( self ): - return self._distance - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument distance is mantatory and can not be set to None') - if not check_type(value,length_measure): - self._distance = length_measure(value) - else: - self._distance = value - return property(**locals()) + @apply + def basis_curve(): + def fget(self): + return self._basis_curve - @apply - def self_intersect(): - def fget( self ): - return self._self_intersect - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument self_intersect is mantatory and can not be set to None') - if not check_type(value,LOGICAL): - self._self_intersect = LOGICAL(value) - else: - self._self_intersect = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument basis_curve is mantatory and can not be set to None") + if not check_type(value, curve): + self._basis_curve = curve(value) + else: + self._basis_curve = value - @apply - def ref_direction(): - def fget( self ): - return self._ref_direction - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument ref_direction is mantatory and can not be set to None') - if not check_type(value,direction): - self._ref_direction = direction(value) - else: - self._ref_direction = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = ((self.basis_curve.self.dim == 3) and (self.ref_direction.self.dim == 3)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + return property(**locals()) + + @apply + def distance(): + def fget(self): + return self._distance + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument distance is mantatory and can not be set to None") + if not check_type(value, length_measure): + self._distance = length_measure(value) + else: + self._distance = value + + return property(**locals()) + + @apply + def self_intersect(): + def fget(self): + return self._self_intersect + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument self_intersect is mantatory and can not be set to None" + ) + if not check_type(value, LOGICAL): + self._self_intersect = LOGICAL(value) + else: + self._self_intersect = value + + return property(**locals()) + + @apply + def ref_direction(): + def fget(self): + return self._ref_direction + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument ref_direction is mantatory and can not be set to None" + ) + if not check_type(value, direction): + self._ref_direction = direction(value) + else: + self._ref_direction = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = (self.basis_curve.self.dim == 3) and (self.ref_direction.self.dim == 3) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY approval # +# ENTITY approval # #################### class approval(BaseEntityClass): - '''Entity approval definition. + """Entity approval definition. - :param status - :type status:approval_status + :param status + :type status:approval_status - :param level - :type level:label - ''' - def __init__( self , status,level, ): - self.status = status - self.level = level + :param level + :type level:label + """ - @apply - def status(): - def fget( self ): - return self._status - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument status is mantatory and can not be set to None') - if not check_type(value,approval_status): - self._status = approval_status(value) - else: - self._status = value - return property(**locals()) + def __init__( + self, + status, + level, + ): + self.status = status + self.level = level + + @apply + def status(): + def fget(self): + return self._status + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument status is mantatory and can not be set to None") + if not check_type(value, approval_status): + self._status = approval_status(value) + else: + self._status = value + + return property(**locals()) + + @apply + def level(): + def fget(self): + return self._level + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument level is mantatory and can not be set to None") + if not check_type(value, label): + self._level = label(value) + else: + self._level = value + + return property(**locals()) - @apply - def level(): - def fget( self ): - return self._level - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument level is mantatory and can not be set to None') - if not check_type(value,label): - self._level = label(value) - else: - self._level = value - return property(**locals()) #################### - # ENTITY composite_curve # +# ENTITY composite_curve # #################### class composite_curve(bounded_curve): - '''Entity composite_curve definition. + """Entity composite_curve definition. - :param segments - :type segments:LIST(1,None,'composite_curve_segment', scope = schema_scope) + :param segments + :type segments:LIST(1,None,'composite_curve_segment', scope = schema_scope) - :param self_intersect - :type self_intersect:LOGICAL + :param self_intersect + :type self_intersect:LOGICAL - :param n_segments - :type n_segments:INTEGER + :param n_segments + :type n_segments:INTEGER - :param closed_curve - :type closed_curve:LOGICAL - ''' - def __init__( self , inherited0__name , segments,self_intersect, ): - bounded_curve.__init__(self , inherited0__name , ) - self.segments = segments - self.self_intersect = self_intersect + :param closed_curve + :type closed_curve:LOGICAL + """ - @apply - def segments(): - def fget( self ): - return self._segments - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument segments is mantatory and can not be set to None') - if not check_type(value,LIST(1,None,'composite_curve_segment', scope = schema_scope)): - self._segments = LIST(value) - else: - self._segments = value - return property(**locals()) + def __init__( + self, + inherited0__name, + segments, + self_intersect, + ): + bounded_curve.__init__( + self, + inherited0__name, + ) + self.segments = segments + self.self_intersect = self_intersect - @apply - def self_intersect(): - def fget( self ): - return self._self_intersect - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument self_intersect is mantatory and can not be set to None') - if not check_type(value,LOGICAL): - self._self_intersect = LOGICAL(value) - else: - self._self_intersect = value - return property(**locals()) + @apply + def segments(): + def fget(self): + return self._segments - @apply - def n_segments(): - def fget( self ): - attribute_eval = SIZEOF(self.segments) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument n_segments is DERIVED. It is computed and can not be set to any value') - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument segments is mantatory and can not be set to None") + if not check_type(value, LIST(1, None, "composite_curve_segment", scope=schema_scope)): + self._segments = LIST(value) + else: + self._segments = value - @apply - def closed_curve(): - def fget( self ): - attribute_eval = (self.segments[self.n_segments].self.transition != discontinuous) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument closed_curve is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = ((( not self.closed_curve) and (SIZEOF(None) == 1)) or (self.closed_curve and (SIZEOF(None) == 0))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + return property(**locals()) + + @apply + def self_intersect(): + def fget(self): + return self._self_intersect + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument self_intersect is mantatory and can not be set to None" + ) + if not check_type(value, LOGICAL): + self._self_intersect = LOGICAL(value) + else: + self._self_intersect = value + + return property(**locals()) + + @apply + def n_segments(): + def fget(self): + attribute_eval = SIZEOF(self.segments) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument n_segments is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + @apply + def closed_curve(): + def fget(self): + attribute_eval = self.segments[self.n_segments].self.transition != discontinuous + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument closed_curve is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = ((not self.closed_curve) and (SIZEOF(None) == 1)) or ( + self.closed_curve and (SIZEOF(None) == 0) + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY composite_curve_on_surface # +# ENTITY composite_curve_on_surface # #################### class composite_curve_on_surface(composite_curve): - '''Entity composite_curve_on_surface definition. + """Entity composite_curve_on_surface definition. - :param basis_surface - :type basis_surface:SET(0,2,'surface', scope = schema_scope) - ''' - def __init__( self , inherited0__name , inherited1__segments , inherited2__self_intersect , ): - composite_curve.__init__(self , inherited0__name , inherited1__segments , inherited2__self_intersect , ) + :param basis_surface + :type basis_surface:SET(0,2,'surface', scope = schema_scope) + """ - @apply - def basis_surface(): - def fget( self ): - attribute_eval = get_basis_surface(self) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument basis_surface is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = (SIZEOF(self.basis_surface) > 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__name, + inherited1__segments, + inherited2__self_intersect, + ): + composite_curve.__init__( + self, + inherited0__name, + inherited1__segments, + inherited2__self_intersect, + ) - def wr2(self): - eval_wr2_wr = constraints_composite_curve_on_surface(self) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + @apply + def basis_surface(): + def fget(self): + attribute_eval = get_basis_surface(self) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument basis_surface is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = SIZEOF(self.basis_surface) > 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = constraints_composite_curve_on_surface(self) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr #################### - # ENTITY boundary_curve # +# ENTITY boundary_curve # #################### class boundary_curve(composite_curve_on_surface): - '''Entity boundary_curve definition. - ''' - def __init__( self , inherited0__name , inherited1__segments , inherited2__self_intersect , ): - composite_curve_on_surface.__init__(self , inherited0__name , inherited1__segments , inherited2__self_intersect , ) - def wr1(self): - eval_wr1_wr = self.self.composite_curve.self.closed_curve - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity boundary_curve definition.""" + + def __init__( + self, + inherited0__name, + inherited1__segments, + inherited2__self_intersect, + ): + composite_curve_on_surface.__init__( + self, + inherited0__name, + inherited1__segments, + inherited2__self_intersect, + ) + + def wr1(self): + eval_wr1_wr = self.self.composite_curve.self.closed_curve + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY representation_context # +# ENTITY representation_context # #################### class representation_context(BaseEntityClass): - '''Entity representation_context definition. + """Entity representation_context definition. - :param context_identifier - :type context_identifier:identifier + :param context_identifier + :type context_identifier:identifier - :param context_type - :type context_type:text + :param context_type + :type context_type:text - :param representations_in_context - :type representations_in_context:SET(1,None,'representation', scope = schema_scope) - ''' - def __init__( self , context_identifier,context_type, ): - self.context_identifier = context_identifier - self.context_type = context_type + :param representations_in_context + :type representations_in_context:SET(1,None,'representation', scope = schema_scope) + """ - @apply - def context_identifier(): - def fget( self ): - return self._context_identifier - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument context_identifier is mantatory and can not be set to None') - if not check_type(value,identifier): - self._context_identifier = identifier(value) - else: - self._context_identifier = value - return property(**locals()) + def __init__( + self, + context_identifier, + context_type, + ): + self.context_identifier = context_identifier + self.context_type = context_type - @apply - def context_type(): - def fget( self ): - return self._context_type - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument context_type is mantatory and can not be set to None') - if not check_type(value,text): - self._context_type = text(value) - else: - self._context_type = value - return property(**locals()) + @apply + def context_identifier(): + def fget(self): + return self._context_identifier + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument context_identifier is mantatory and can not be set to None" + ) + if not check_type(value, identifier): + self._context_identifier = identifier(value) + else: + self._context_identifier = value + + return property(**locals()) + + @apply + def context_type(): + def fget(self): + return self._context_type + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument context_type is mantatory and can not be set to None" + ) + if not check_type(value, text): + self._context_type = text(value) + else: + self._context_type = value + + return property(**locals()) + + @apply + def representations_in_context(): + def fget(self): + return self._representations_in_context + + def fset(self, value): + # INVERSE argument + raise AssertionError( + "Argument representations_in_context is INVERSE. It is computed and can not be set to any value" + ) + + return property(**locals()) - @apply - def representations_in_context(): - def fget( self ): - return self._representations_in_context - def fset( self, value ): - # INVERSE argument - raise AssertionError('Argument representations_in_context is INVERSE. It is computed and can not be set to any value') - return property(**locals()) #################### - # ENTITY geometric_representation_context # +# ENTITY geometric_representation_context # #################### class geometric_representation_context(representation_context): - '''Entity geometric_representation_context definition. + """Entity geometric_representation_context definition. - :param coordinate_space_dimension - :type coordinate_space_dimension:dimension_count - ''' - def __init__( self , inherited0__context_identifier , inherited1__context_type , coordinate_space_dimension, ): - representation_context.__init__(self , inherited0__context_identifier , inherited1__context_type , ) - self.coordinate_space_dimension = coordinate_space_dimension + :param coordinate_space_dimension + :type coordinate_space_dimension:dimension_count + """ + + def __init__( + self, + inherited0__context_identifier, + inherited1__context_type, + coordinate_space_dimension, + ): + representation_context.__init__( + self, + inherited0__context_identifier, + inherited1__context_type, + ) + self.coordinate_space_dimension = coordinate_space_dimension + + @apply + def coordinate_space_dimension(): + def fget(self): + return self._coordinate_space_dimension + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument coordinate_space_dimension is mantatory and can not be set to None" + ) + if not check_type(value, dimension_count): + self._coordinate_space_dimension = dimension_count(value) + else: + self._coordinate_space_dimension = value + + return property(**locals()) - @apply - def coordinate_space_dimension(): - def fget( self ): - return self._coordinate_space_dimension - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument coordinate_space_dimension is mantatory and can not be set to None') - if not check_type(value,dimension_count): - self._coordinate_space_dimension = dimension_count(value) - else: - self._coordinate_space_dimension = value - return property(**locals()) #################### - # ENTITY action_status # +# ENTITY action_status # #################### class action_status(BaseEntityClass): - '''Entity action_status definition. + """Entity action_status definition. - :param status - :type status:label + :param status + :type status:label - :param assigned_action - :type assigned_action:executed_action - ''' - def __init__( self , status,assigned_action, ): - self.status = status - self.assigned_action = assigned_action + :param assigned_action + :type assigned_action:executed_action + """ - @apply - def status(): - def fget( self ): - return self._status - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument status is mantatory and can not be set to None') - if not check_type(value,label): - self._status = label(value) - else: - self._status = value - return property(**locals()) + def __init__( + self, + status, + assigned_action, + ): + self.status = status + self.assigned_action = assigned_action + + @apply + def status(): + def fget(self): + return self._status + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument status is mantatory and can not be set to None") + if not check_type(value, label): + self._status = label(value) + else: + self._status = value + + return property(**locals()) + + @apply + def assigned_action(): + def fget(self): + return self._assigned_action + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument assigned_action is mantatory and can not be set to None" + ) + if not check_type(value, executed_action): + self._assigned_action = executed_action(value) + else: + self._assigned_action = value + + return property(**locals()) - @apply - def assigned_action(): - def fget( self ): - return self._assigned_action - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument assigned_action is mantatory and can not be set to None') - if not check_type(value,executed_action): - self._assigned_action = executed_action(value) - else: - self._assigned_action = value - return property(**locals()) #################### - # ENTITY application_context # +# ENTITY application_context # #################### class application_context(BaseEntityClass): - '''Entity application_context definition. + """Entity application_context definition. - :param application - :type application:text + :param application + :type application:text - :param context_elements - :type context_elements:SET(1,None,'application_context_element', scope = schema_scope) - ''' - def __init__( self , application, ): - self.application = application + :param context_elements + :type context_elements:SET(1,None,'application_context_element', scope = schema_scope) + """ - @apply - def application(): - def fget( self ): - return self._application - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument application is mantatory and can not be set to None') - if not check_type(value,text): - self._application = text(value) - else: - self._application = value - return property(**locals()) + def __init__( + self, + application, + ): + self.application = application + + @apply + def application(): + def fget(self): + return self._application + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument application is mantatory and can not be set to None") + if not check_type(value, text): + self._application = text(value) + else: + self._application = value + + return property(**locals()) + + @apply + def context_elements(): + def fget(self): + return self._context_elements + + def fset(self, value): + # INVERSE argument + raise AssertionError( + "Argument context_elements is INVERSE. It is computed and can not be set to any value" + ) + + return property(**locals()) - @apply - def context_elements(): - def fget( self ): - return self._context_elements - def fset( self, value ): - # INVERSE argument - raise AssertionError('Argument context_elements is INVERSE. It is computed and can not be set to any value') - return property(**locals()) #################### - # ENTITY change_request # +# ENTITY change_request # #################### class change_request(action_request_assignment): - '''Entity change_request definition. + """Entity change_request definition. - :param items - :type items:SET(1,None,'change_request_item', scope = schema_scope) - ''' - def __init__( self , inherited0__assigned_action_request , items, ): - action_request_assignment.__init__(self , inherited0__assigned_action_request , ) - self.items = items + :param items + :type items:SET(1,None,'change_request_item', scope = schema_scope) + """ + + def __init__( + self, + inherited0__assigned_action_request, + items, + ): + action_request_assignment.__init__( + self, + inherited0__assigned_action_request, + ) + self.items = items + + @apply + def items(): + def fget(self): + return self._items + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument items is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "change_request_item", scope=schema_scope)): + self._items = SET(value) + else: + self._items = value + + return property(**locals()) - @apply - def items(): - def fget( self ): - return self._items - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument items is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'change_request_item', scope = schema_scope)): - self._items = SET(value) - else: - self._items = value - return property(**locals()) #################### - # ENTITY date_and_time # +# ENTITY date_and_time # #################### class date_and_time(BaseEntityClass): - '''Entity date_and_time definition. + """Entity date_and_time definition. - :param date_component - :type date_component:date + :param date_component + :type date_component:date - :param time_component - :type time_component:local_time - ''' - def __init__( self , date_component,time_component, ): - self.date_component = date_component - self.time_component = time_component + :param time_component + :type time_component:local_time + """ - @apply - def date_component(): - def fget( self ): - return self._date_component - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument date_component is mantatory and can not be set to None') - if not check_type(value,date): - self._date_component = date(value) - else: - self._date_component = value - return property(**locals()) + def __init__( + self, + date_component, + time_component, + ): + self.date_component = date_component + self.time_component = time_component + + @apply + def date_component(): + def fget(self): + return self._date_component + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument date_component is mantatory and can not be set to None" + ) + if not check_type(value, date): + self._date_component = date(value) + else: + self._date_component = value + + return property(**locals()) + + @apply + def time_component(): + def fget(self): + return self._time_component + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument time_component is mantatory and can not be set to None" + ) + if not check_type(value, local_time): + self._time_component = local_time(value) + else: + self._time_component = value + + return property(**locals()) - @apply - def time_component(): - def fget( self ): - return self._time_component - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument time_component is mantatory and can not be set to None') - if not check_type(value,local_time): - self._time_component = local_time(value) - else: - self._time_component = value - return property(**locals()) #################### - # ENTITY approval_date_time # +# ENTITY approval_date_time # #################### class approval_date_time(BaseEntityClass): - '''Entity approval_date_time definition. + """Entity approval_date_time definition. - :param date_time - :type date_time:date_time_select + :param date_time + :type date_time:date_time_select - :param dated_approval - :type dated_approval:approval - ''' - def __init__( self , date_time,dated_approval, ): - self.date_time = date_time - self.dated_approval = dated_approval + :param dated_approval + :type dated_approval:approval + """ - @apply - def date_time(): - def fget( self ): - return self._date_time - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument date_time is mantatory and can not be set to None') - if not check_type(value,date_time_select): - self._date_time = date_time_select(value) - else: - self._date_time = value - return property(**locals()) + def __init__( + self, + date_time, + dated_approval, + ): + self.date_time = date_time + self.dated_approval = dated_approval + + @apply + def date_time(): + def fget(self): + return self._date_time + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument date_time is mantatory and can not be set to None") + if not check_type(value, date_time_select): + self._date_time = date_time_select(value) + else: + self._date_time = value + + return property(**locals()) + + @apply + def dated_approval(): + def fget(self): + return self._dated_approval + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument dated_approval is mantatory and can not be set to None" + ) + if not check_type(value, approval): + self._dated_approval = approval(value) + else: + self._dated_approval = value + + return property(**locals()) - @apply - def dated_approval(): - def fget( self ): - return self._dated_approval - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument dated_approval is mantatory and can not be set to None') - if not check_type(value,approval): - self._dated_approval = approval(value) - else: - self._dated_approval = value - return property(**locals()) #################### - # ENTITY approval_role # +# ENTITY approval_role # #################### class approval_role(BaseEntityClass): - '''Entity approval_role definition. + """Entity approval_role definition. - :param role - :type role:label - ''' - def __init__( self , role, ): - self.role = role + :param role + :type role:label + """ + + def __init__( + self, + role, + ): + self.role = role + + @apply + def role(): + def fget(self): + return self._role + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument role is mantatory and can not be set to None") + if not check_type(value, label): + self._role = label(value) + else: + self._role = value + + return property(**locals()) - @apply - def role(): - def fget( self ): - return self._role - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument role is mantatory and can not be set to None') - if not check_type(value,label): - self._role = label(value) - else: - self._role = value - return property(**locals()) #################### - # ENTITY application_context_element # +# ENTITY application_context_element # #################### class application_context_element(BaseEntityClass): - '''Entity application_context_element definition. + """Entity application_context_element definition. - :param name - :type name:label + :param name + :type name:label - :param frame_of_reference - :type frame_of_reference:application_context - ''' - def __init__( self , name,frame_of_reference, ): - self.name = name - self.frame_of_reference = frame_of_reference + :param frame_of_reference + :type frame_of_reference:application_context + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + frame_of_reference, + ): + self.name = name + self.frame_of_reference = frame_of_reference + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def frame_of_reference(): + def fget(self): + return self._frame_of_reference + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument frame_of_reference is mantatory and can not be set to None" + ) + if not check_type(value, application_context): + self._frame_of_reference = application_context(value) + else: + self._frame_of_reference = value + + return property(**locals()) - @apply - def frame_of_reference(): - def fget( self ): - return self._frame_of_reference - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument frame_of_reference is mantatory and can not be set to None') - if not check_type(value,application_context): - self._frame_of_reference = application_context(value) - else: - self._frame_of_reference = value - return property(**locals()) #################### - # ENTITY product_context # +# ENTITY product_context # #################### class product_context(application_context_element): - '''Entity product_context definition. + """Entity product_context definition. - :param discipline_type - :type discipline_type:label - ''' - def __init__( self , inherited0__name , inherited1__frame_of_reference , discipline_type, ): - application_context_element.__init__(self , inherited0__name , inherited1__frame_of_reference , ) - self.discipline_type = discipline_type + :param discipline_type + :type discipline_type:label + """ + + def __init__( + self, + inherited0__name, + inherited1__frame_of_reference, + discipline_type, + ): + application_context_element.__init__( + self, + inherited0__name, + inherited1__frame_of_reference, + ) + self.discipline_type = discipline_type + + @apply + def discipline_type(): + def fget(self): + return self._discipline_type + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument discipline_type is mantatory and can not be set to None" + ) + if not check_type(value, label): + self._discipline_type = label(value) + else: + self._discipline_type = value + + return property(**locals()) - @apply - def discipline_type(): - def fget( self ): - return self._discipline_type - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument discipline_type is mantatory and can not be set to None') - if not check_type(value,label): - self._discipline_type = label(value) - else: - self._discipline_type = value - return property(**locals()) #################### - # ENTITY elementary_surface # +# ENTITY elementary_surface # #################### class elementary_surface(surface): - '''Entity elementary_surface definition. + """Entity elementary_surface definition. - :param position - :type position:axis2_placement_3d - ''' - def __init__( self , inherited0__name , position, ): - surface.__init__(self , inherited0__name , ) - self.position = position + :param position + :type position:axis2_placement_3d + """ + + def __init__( + self, + inherited0__name, + position, + ): + surface.__init__( + self, + inherited0__name, + ) + self.position = position + + @apply + def position(): + def fget(self): + return self._position + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument position is mantatory and can not be set to None") + if not check_type(value, axis2_placement_3d): + self._position = axis2_placement_3d(value) + else: + self._position = value + + return property(**locals()) - @apply - def position(): - def fget( self ): - return self._position - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument position is mantatory and can not be set to None') - if not check_type(value,axis2_placement_3d): - self._position = axis2_placement_3d(value) - else: - self._position = value - return property(**locals()) #################### - # ENTITY spherical_surface # +# ENTITY spherical_surface # #################### class spherical_surface(elementary_surface): - '''Entity spherical_surface definition. + """Entity spherical_surface definition. - :param radius - :type radius:positive_length_measure - ''' - def __init__( self , inherited0__name , inherited1__position , radius, ): - elementary_surface.__init__(self , inherited0__name , inherited1__position , ) - self.radius = radius + :param radius + :type radius:positive_length_measure + """ + + def __init__( + self, + inherited0__name, + inherited1__position, + radius, + ): + elementary_surface.__init__( + self, + inherited0__name, + inherited1__position, + ) + self.radius = radius + + @apply + def radius(): + def fget(self): + return self._radius + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument radius is mantatory and can not be set to None") + if not check_type(value, positive_length_measure): + self._radius = positive_length_measure(value) + else: + self._radius = value + + return property(**locals()) - @apply - def radius(): - def fget( self ): - return self._radius - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument radius is mantatory and can not be set to None') - if not check_type(value,positive_length_measure): - self._radius = positive_length_measure(value) - else: - self._radius = value - return property(**locals()) #################### - # ENTITY application_protocol_definition # +# ENTITY application_protocol_definition # #################### class application_protocol_definition(BaseEntityClass): - '''Entity application_protocol_definition definition. + """Entity application_protocol_definition definition. - :param status - :type status:label + :param status + :type status:label - :param application_interpreted_model_schema_name - :type application_interpreted_model_schema_name:label + :param application_interpreted_model_schema_name + :type application_interpreted_model_schema_name:label - :param application_protocol_year - :type application_protocol_year:year_number + :param application_protocol_year + :type application_protocol_year:year_number - :param application - :type application:application_context - ''' - def __init__( self , status,application_interpreted_model_schema_name,application_protocol_year,application, ): - self.status = status - self.application_interpreted_model_schema_name = application_interpreted_model_schema_name - self.application_protocol_year = application_protocol_year - self.application = application + :param application + :type application:application_context + """ - @apply - def status(): - def fget( self ): - return self._status - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument status is mantatory and can not be set to None') - if not check_type(value,label): - self._status = label(value) - else: - self._status = value - return property(**locals()) + def __init__( + self, + status, + application_interpreted_model_schema_name, + application_protocol_year, + application, + ): + self.status = status + self.application_interpreted_model_schema_name = application_interpreted_model_schema_name + self.application_protocol_year = application_protocol_year + self.application = application - @apply - def application_interpreted_model_schema_name(): - def fget( self ): - return self._application_interpreted_model_schema_name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument application_interpreted_model_schema_name is mantatory and can not be set to None') - if not check_type(value,label): - self._application_interpreted_model_schema_name = label(value) - else: - self._application_interpreted_model_schema_name = value - return property(**locals()) + @apply + def status(): + def fget(self): + return self._status - @apply - def application_protocol_year(): - def fget( self ): - return self._application_protocol_year - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument application_protocol_year is mantatory and can not be set to None') - if not check_type(value,year_number): - self._application_protocol_year = year_number(value) - else: - self._application_protocol_year = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument status is mantatory and can not be set to None") + if not check_type(value, label): + self._status = label(value) + else: + self._status = value + + return property(**locals()) + + @apply + def application_interpreted_model_schema_name(): + def fget(self): + return self._application_interpreted_model_schema_name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument application_interpreted_model_schema_name is mantatory and can not be set to None" + ) + if not check_type(value, label): + self._application_interpreted_model_schema_name = label(value) + else: + self._application_interpreted_model_schema_name = value + + return property(**locals()) + + @apply + def application_protocol_year(): + def fget(self): + return self._application_protocol_year + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument application_protocol_year is mantatory and can not be set to None" + ) + if not check_type(value, year_number): + self._application_protocol_year = year_number(value) + else: + self._application_protocol_year = value + + return property(**locals()) + + @apply + def application(): + def fget(self): + return self._application + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument application is mantatory and can not be set to None") + if not check_type(value, application_context): + self._application = application_context(value) + else: + self._application = value + + return property(**locals()) - @apply - def application(): - def fget( self ): - return self._application - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument application is mantatory and can not be set to None') - if not check_type(value,application_context): - self._application = application_context(value) - else: - self._application = value - return property(**locals()) #################### - # ENTITY specified_higher_usage_occurrence # +# ENTITY specified_higher_usage_occurrence # #################### class specified_higher_usage_occurrence(assembly_component_usage): - '''Entity specified_higher_usage_occurrence definition. + """Entity specified_higher_usage_occurrence definition. - :param upper_usage - :type upper_usage:assembly_component_usage + :param upper_usage + :type upper_usage:assembly_component_usage - :param next_usage - :type next_usage:next_assembly_usage_occurrence - ''' - def __init__( self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , inherited5__reference_designator , upper_usage,next_usage, ): - assembly_component_usage.__init__(self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , inherited5__reference_designator , ) - self.upper_usage = upper_usage - self.next_usage = next_usage + :param next_usage + :type next_usage:next_assembly_usage_occurrence + """ - @apply - def upper_usage(): - def fget( self ): - return self._upper_usage - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument upper_usage is mantatory and can not be set to None') - if not check_type(value,assembly_component_usage): - self._upper_usage = assembly_component_usage(value) - else: - self._upper_usage = value - return property(**locals()) + def __init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + inherited5__reference_designator, + upper_usage, + next_usage, + ): + assembly_component_usage.__init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + inherited5__reference_designator, + ) + self.upper_usage = upper_usage + self.next_usage = next_usage - @apply - def next_usage(): - def fget( self ): - return self._next_usage - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument next_usage is mantatory and can not be set to None') - if not check_type(value,next_assembly_usage_occurrence): - self._next_usage = next_assembly_usage_occurrence(value) - else: - self._next_usage = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self != self.upper_usage) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def upper_usage(): + def fget(self): + return self._upper_usage - def wr2(self): - eval_wr2_wr = (self.self.product_definition_relationship.self.relating_product_definition == self.upper_usage.self.relating_product_definition) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument upper_usage is mantatory and can not be set to None") + if not check_type(value, assembly_component_usage): + self._upper_usage = assembly_component_usage(value) + else: + self._upper_usage = value - def wr3(self): - eval_wr3_wr = (self.self.product_definition_relationship.self.related_product_definition == self.next_usage.self.related_product_definition) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + return property(**locals()) - def wr4(self): - eval_wr4_wr = (self.upper_usage.self.related_product_definition == self.next_usage.self.relating_product_definition) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + @apply + def next_usage(): + def fget(self): + return self._next_usage - def wr5(self): - eval_wr5_wr = ( not ('CONFIG_CONTROL_DESIGN.PROMISSORY_USAGE_OCCURRENCE' == TYPEOF(self.upper_usage))) - if not eval_wr5_wr: - raise AssertionError('Rule wr5 violated') - else: - return eval_wr5_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument next_usage is mantatory and can not be set to None") + if not check_type(value, next_assembly_usage_occurrence): + self._next_usage = next_assembly_usage_occurrence(value) + else: + self._next_usage = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self != self.upper_usage + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = ( + self.self.product_definition_relationship.self.relating_product_definition + == self.upper_usage.self.relating_product_definition + ) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr + + def wr3(self): + eval_wr3_wr = ( + self.self.product_definition_relationship.self.related_product_definition + == self.next_usage.self.related_product_definition + ) + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr + + def wr4(self): + eval_wr4_wr = ( + self.upper_usage.self.related_product_definition + == self.next_usage.self.relating_product_definition + ) + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr + + def wr5(self): + eval_wr5_wr = not ( + "CONFIG_CONTROL_DESIGN.PROMISSORY_USAGE_OCCURRENCE" == TYPEOF(self.upper_usage) + ) + if not eval_wr5_wr: + raise AssertionError("Rule wr5 violated") + else: + return eval_wr5_wr #################### - # ENTITY product_definition_formation_with_specified_source # +# ENTITY product_definition_formation_with_specified_source # #################### class product_definition_formation_with_specified_source(product_definition_formation): - '''Entity product_definition_formation_with_specified_source definition. + """Entity product_definition_formation_with_specified_source definition. - :param make_or_buy - :type make_or_buy:source - ''' - def __init__( self , inherited0__id , inherited1__description , inherited2__of_product , make_or_buy, ): - product_definition_formation.__init__(self , inherited0__id , inherited1__description , inherited2__of_product , ) - self.make_or_buy = make_or_buy + :param make_or_buy + :type make_or_buy:source + """ + + def __init__( + self, + inherited0__id, + inherited1__description, + inherited2__of_product, + make_or_buy, + ): + product_definition_formation.__init__( + self, + inherited0__id, + inherited1__description, + inherited2__of_product, + ) + self.make_or_buy = make_or_buy + + @apply + def make_or_buy(): + def fget(self): + return self._make_or_buy + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument make_or_buy is mantatory and can not be set to None") + if not check_type(value, source): + self._make_or_buy = source(value) + else: + self._make_or_buy = value + + return property(**locals()) - @apply - def make_or_buy(): - def fget( self ): - return self._make_or_buy - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument make_or_buy is mantatory and can not be set to None') - if not check_type(value,source): - self._make_or_buy = source(value) - else: - self._make_or_buy = value - return property(**locals()) #################### - # ENTITY action_request_solution # +# ENTITY action_request_solution # #################### class action_request_solution(BaseEntityClass): - '''Entity action_request_solution definition. + """Entity action_request_solution definition. - :param method - :type method:action_method + :param method + :type method:action_method - :param request - :type request:versioned_action_request - ''' - def __init__( self , method,request, ): - self.method = method - self.request = request + :param request + :type request:versioned_action_request + """ - @apply - def method(): - def fget( self ): - return self._method - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument method is mantatory and can not be set to None') - if not check_type(value,action_method): - self._method = action_method(value) - else: - self._method = value - return property(**locals()) + def __init__( + self, + method, + request, + ): + self.method = method + self.request = request + + @apply + def method(): + def fget(self): + return self._method + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument method is mantatory and can not be set to None") + if not check_type(value, action_method): + self._method = action_method(value) + else: + self._method = value + + return property(**locals()) + + @apply + def request(): + def fget(self): + return self._request + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument request is mantatory and can not be set to None") + if not check_type(value, versioned_action_request): + self._request = versioned_action_request(value) + else: + self._request = value + + return property(**locals()) - @apply - def request(): - def fget( self ): - return self._request - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument request is mantatory and can not be set to None') - if not check_type(value,versioned_action_request): - self._request = versioned_action_request(value) - else: - self._request = value - return property(**locals()) #################### - # ENTITY uncertainty_measure_with_unit # +# ENTITY uncertainty_measure_with_unit # #################### class uncertainty_measure_with_unit(measure_with_unit): - '''Entity uncertainty_measure_with_unit definition. + """Entity uncertainty_measure_with_unit definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text - ''' - def __init__( self , inherited0__value_component , inherited1__unit_component , name,description, ): - measure_with_unit.__init__(self , inherited0__value_component , inherited1__unit_component , ) - self.name = name - self.description = description + :param description + :type description:text + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + inherited0__value_component, + inherited1__unit_component, + name, + description, + ): + measure_with_unit.__init__( + self, + inherited0__value_component, + inherited1__unit_component, + ) + self.name = name + self.description = description - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = valid_measure_value(self.self.measure_with_unit.self.value_component) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = valid_measure_value(self.self.measure_with_unit.self.value_component) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY edge_based_wireframe_model # +# ENTITY edge_based_wireframe_model # #################### class edge_based_wireframe_model(geometric_representation_item): - '''Entity edge_based_wireframe_model definition. + """Entity edge_based_wireframe_model definition. - :param ebwm_boundary - :type ebwm_boundary:SET(1,None,'connected_edge_set', scope = schema_scope) - ''' - def __init__( self , inherited0__name , ebwm_boundary, ): - geometric_representation_item.__init__(self , inherited0__name , ) - self.ebwm_boundary = ebwm_boundary + :param ebwm_boundary + :type ebwm_boundary:SET(1,None,'connected_edge_set', scope = schema_scope) + """ + + def __init__( + self, + inherited0__name, + ebwm_boundary, + ): + geometric_representation_item.__init__( + self, + inherited0__name, + ) + self.ebwm_boundary = ebwm_boundary + + @apply + def ebwm_boundary(): + def fget(self): + return self._ebwm_boundary + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument ebwm_boundary is mantatory and can not be set to None" + ) + if not check_type(value, SET(1, None, "connected_edge_set", scope=schema_scope)): + self._ebwm_boundary = SET(value) + else: + self._ebwm_boundary = value + + return property(**locals()) - @apply - def ebwm_boundary(): - def fget( self ): - return self._ebwm_boundary - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument ebwm_boundary is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'connected_edge_set', scope = schema_scope)): - self._ebwm_boundary = SET(value) - else: - self._ebwm_boundary = value - return property(**locals()) #################### - # ENTITY path # +# ENTITY path # #################### class path(topological_representation_item): - '''Entity path definition. + """Entity path definition. - :param edge_list - :type edge_list:LIST(1,None,'oriented_edge', scope = schema_scope) - ''' - def __init__( self , inherited0__name , edge_list, ): - topological_representation_item.__init__(self , inherited0__name , ) - self.edge_list = edge_list + :param edge_list + :type edge_list:LIST(1,None,'oriented_edge', scope = schema_scope) + """ - @apply - def edge_list(): - def fget( self ): - return self._edge_list - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument edge_list is mantatory and can not be set to None') - if not check_type(value,LIST(1,None,'oriented_edge', scope = schema_scope)): - self._edge_list = LIST(value) - else: - self._edge_list = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = path_head_to_tail(self) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__name, + edge_list, + ): + topological_representation_item.__init__( + self, + inherited0__name, + ) + self.edge_list = edge_list + + @apply + def edge_list(): + def fget(self): + return self._edge_list + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument edge_list is mantatory and can not be set to None") + if not check_type(value, LIST(1, None, "oriented_edge", scope=schema_scope)): + self._edge_list = LIST(value) + else: + self._edge_list = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = path_head_to_tail(self) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY connected_face_set # +# ENTITY connected_face_set # #################### class connected_face_set(topological_representation_item): - '''Entity connected_face_set definition. + """Entity connected_face_set definition. - :param cfs_faces - :type cfs_faces:SET(1,None,'face', scope = schema_scope) - ''' - def __init__( self , inherited0__name , cfs_faces, ): - topological_representation_item.__init__(self , inherited0__name , ) - self.cfs_faces = cfs_faces + :param cfs_faces + :type cfs_faces:SET(1,None,'face', scope = schema_scope) + """ + + def __init__( + self, + inherited0__name, + cfs_faces, + ): + topological_representation_item.__init__( + self, + inherited0__name, + ) + self.cfs_faces = cfs_faces + + @apply + def cfs_faces(): + def fget(self): + return self._cfs_faces + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument cfs_faces is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "face", scope=schema_scope)): + self._cfs_faces = SET(value) + else: + self._cfs_faces = value + + return property(**locals()) - @apply - def cfs_faces(): - def fget( self ): - return self._cfs_faces - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument cfs_faces is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'face', scope = schema_scope)): - self._cfs_faces = SET(value) - else: - self._cfs_faces = value - return property(**locals()) #################### - # ENTITY open_shell # +# ENTITY open_shell # #################### class open_shell(connected_face_set): - '''Entity open_shell definition. - ''' - def __init__( self , inherited0__name , inherited1__cfs_faces , ): - connected_face_set.__init__(self , inherited0__name , inherited1__cfs_faces , ) + """Entity open_shell definition.""" + + def __init__( + self, + inherited0__name, + inherited1__cfs_faces, + ): + connected_face_set.__init__( + self, + inherited0__name, + inherited1__cfs_faces, + ) + #################### - # ENTITY oriented_open_shell # +# ENTITY oriented_open_shell # #################### class oriented_open_shell(open_shell): - '''Entity oriented_open_shell definition. + """Entity oriented_open_shell definition. - :param open_shell_element - :type open_shell_element:open_shell + :param open_shell_element + :type open_shell_element:open_shell - :param orientation - :type orientation:BOOLEAN + :param orientation + :type orientation:BOOLEAN - :param connected_face_set_cfs_faces - :type connected_face_set_cfs_faces:SET(1,None,'face', scope = schema_scope) - ''' - def __init__( self , inherited0__name , inherited1__cfs_faces , open_shell_element,orientation, ): - open_shell.__init__(self , inherited0__name , inherited1__cfs_faces , ) - self.open_shell_element = open_shell_element - self.orientation = orientation + :param connected_face_set_cfs_faces + :type connected_face_set_cfs_faces:SET(1,None,'face', scope = schema_scope) + """ - @apply - def open_shell_element(): - def fget( self ): - return self._open_shell_element - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument open_shell_element is mantatory and can not be set to None') - if not check_type(value,open_shell): - self._open_shell_element = open_shell(value) - else: - self._open_shell_element = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__cfs_faces, + open_shell_element, + orientation, + ): + open_shell.__init__( + self, + inherited0__name, + inherited1__cfs_faces, + ) + self.open_shell_element = open_shell_element + self.orientation = orientation - @apply - def orientation(): - def fget( self ): - return self._orientation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument orientation is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._orientation = BOOLEAN(value) - else: - self._orientation = value - return property(**locals()) + @apply + def open_shell_element(): + def fget(self): + return self._open_shell_element - @apply - def connected_face_set_cfs_faces(): - def fget( self ): - attribute_eval = conditional_reverse(self.self.orientation,self.self.open_shell_element.self.cfs_faces) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument connected_face_set_cfs_faces is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = ( not ('CONFIG_CONTROL_DESIGN.ORIENTED_OPEN_SHELL' == TYPEOF(self.self.open_shell_element))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument open_shell_element is mantatory and can not be set to None" + ) + if not check_type(value, open_shell): + self._open_shell_element = open_shell(value) + else: + self._open_shell_element = value + + return property(**locals()) + + @apply + def orientation(): + def fget(self): + return self._orientation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument orientation is mantatory and can not be set to None") + if not check_type(value, BOOLEAN): + self._orientation = BOOLEAN(value) + else: + self._orientation = value + + return property(**locals()) + + @apply + def connected_face_set_cfs_faces(): + def fget(self): + attribute_eval = conditional_reverse( + self.self.orientation, self.self.open_shell_element.self.cfs_faces + ) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument connected_face_set_cfs_faces is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = not ( + "CONFIG_CONTROL_DESIGN.ORIENTED_OPEN_SHELL" == TYPEOF(self.self.open_shell_element) + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY solid_angle_unit # +# ENTITY solid_angle_unit # #################### class solid_angle_unit(named_unit): - '''Entity solid_angle_unit definition. - ''' - def __init__( self , inherited0__dimensions , ): - named_unit.__init__(self , inherited0__dimensions , ) - def wr1(self): - eval_wr1_wr = (((((((self.self.named_unit.self.dimensions.self.length_exponent == 0) and (self.self.named_unit.self.dimensions.self.mass_exponent == 0)) and (self.self.named_unit.self.dimensions.self.time_exponent == 0)) and (self.self.named_unit.self.dimensions.self.electric_current_exponent == 0)) and (self.self.named_unit.self.dimensions.self.thermodynamic_temperature_exponent == 0)) and (self.self.named_unit.self.dimensions.self.amount_of_substance_exponent == 0)) and (self.self.named_unit.self.dimensions.self.luminous_intensity_exponent == 0)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity solid_angle_unit definition.""" + + def __init__( + self, + inherited0__dimensions, + ): + named_unit.__init__( + self, + inherited0__dimensions, + ) + + def wr1(self): + eval_wr1_wr = ( + ( + ( + ( + ( + (self.self.named_unit.self.dimensions.self.length_exponent == 0) + and (self.self.named_unit.self.dimensions.self.mass_exponent == 0) + ) + and (self.self.named_unit.self.dimensions.self.time_exponent == 0) + ) + and (self.self.named_unit.self.dimensions.self.electric_current_exponent == 0) + ) + and ( + self.self.named_unit.self.dimensions.self.thermodynamic_temperature_exponent + == 0 + ) + ) + and (self.self.named_unit.self.dimensions.self.amount_of_substance_exponent == 0) + ) and (self.self.named_unit.self.dimensions.self.luminous_intensity_exponent == 0) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY coordinated_universal_time_offset # +# ENTITY coordinated_universal_time_offset # #################### class coordinated_universal_time_offset(BaseEntityClass): - '''Entity coordinated_universal_time_offset definition. + """Entity coordinated_universal_time_offset definition. - :param hour_offset - :type hour_offset:hour_in_day + :param hour_offset + :type hour_offset:hour_in_day - :param minute_offset - :type minute_offset:minute_in_hour + :param minute_offset + :type minute_offset:minute_in_hour - :param sense - :type sense:ahead_or_behind - ''' - def __init__( self , hour_offset,minute_offset,sense, ): - self.hour_offset = hour_offset - self.minute_offset = minute_offset - self.sense = sense + :param sense + :type sense:ahead_or_behind + """ - @apply - def hour_offset(): - def fget( self ): - return self._hour_offset - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument hour_offset is mantatory and can not be set to None') - if not check_type(value,hour_in_day): - self._hour_offset = hour_in_day(value) - else: - self._hour_offset = value - return property(**locals()) + def __init__( + self, + hour_offset, + minute_offset, + sense, + ): + self.hour_offset = hour_offset + self.minute_offset = minute_offset + self.sense = sense - @apply - def minute_offset(): - def fget( self ): - return self._minute_offset - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,minute_in_hour): - self._minute_offset = minute_in_hour(value) - else: - self._minute_offset = value - else: - self._minute_offset = value - return property(**locals()) + @apply + def hour_offset(): + def fget(self): + return self._hour_offset + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument hour_offset is mantatory and can not be set to None") + if not check_type(value, hour_in_day): + self._hour_offset = hour_in_day(value) + else: + self._hour_offset = value + + return property(**locals()) + + @apply + def minute_offset(): + def fget(self): + return self._minute_offset + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, minute_in_hour): + self._minute_offset = minute_in_hour(value) + else: + self._minute_offset = value + else: + self._minute_offset = value + + return property(**locals()) + + @apply + def sense(): + def fget(self): + return self._sense + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument sense is mantatory and can not be set to None") + if not check_type(value, ahead_or_behind): + self._sense = ahead_or_behind(value) + else: + self._sense = value + + return property(**locals()) - @apply - def sense(): - def fget( self ): - return self._sense - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument sense is mantatory and can not be set to None') - if not check_type(value,ahead_or_behind): - self._sense = ahead_or_behind(value) - else: - self._sense = value - return property(**locals()) #################### - # ENTITY curve_replica # +# ENTITY curve_replica # #################### class curve_replica(curve): - '''Entity curve_replica definition. + """Entity curve_replica definition. - :param parent_curve - :type parent_curve:curve + :param parent_curve + :type parent_curve:curve - :param transformation - :type transformation:cartesian_transformation_operator - ''' - def __init__( self , inherited0__name , parent_curve,transformation, ): - curve.__init__(self , inherited0__name , ) - self.parent_curve = parent_curve - self.transformation = transformation + :param transformation + :type transformation:cartesian_transformation_operator + """ - @apply - def parent_curve(): - def fget( self ): - return self._parent_curve - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument parent_curve is mantatory and can not be set to None') - if not check_type(value,curve): - self._parent_curve = curve(value) - else: - self._parent_curve = value - return property(**locals()) + def __init__( + self, + inherited0__name, + parent_curve, + transformation, + ): + curve.__init__( + self, + inherited0__name, + ) + self.parent_curve = parent_curve + self.transformation = transformation - @apply - def transformation(): - def fget( self ): - return self._transformation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument transformation is mantatory and can not be set to None') - if not check_type(value,cartesian_transformation_operator): - self._transformation = cartesian_transformation_operator(value) - else: - self._transformation = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.transformation.self.dim == self.parent_curve.self.dim) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def parent_curve(): + def fget(self): + return self._parent_curve - def wr2(self): - eval_wr2_wr = acyclic_curve_replica(self,self.parent_curve) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument parent_curve is mantatory and can not be set to None" + ) + if not check_type(value, curve): + self._parent_curve = curve(value) + else: + self._parent_curve = value + + return property(**locals()) + + @apply + def transformation(): + def fget(self): + return self._transformation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument transformation is mantatory and can not be set to None" + ) + if not check_type(value, cartesian_transformation_operator): + self._transformation = cartesian_transformation_operator(value) + else: + self._transformation = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.transformation.self.dim == self.parent_curve.self.dim + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = acyclic_curve_replica(self, self.parent_curve) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr #################### - # ENTITY quasi_uniform_surface # +# ENTITY quasi_uniform_surface # #################### class quasi_uniform_surface(b_spline_surface): - '''Entity quasi_uniform_surface definition. - ''' - def __init__( self , inherited0__name , inherited1__u_degree , inherited2__v_degree , inherited3__control_points_list , inherited4__surface_form , inherited5__u_closed , inherited6__v_closed , inherited7__self_intersect , ): - b_spline_surface.__init__(self , inherited0__name , inherited1__u_degree , inherited2__v_degree , inherited3__control_points_list , inherited4__surface_form , inherited5__u_closed , inherited6__v_closed , inherited7__self_intersect , ) + """Entity quasi_uniform_surface definition.""" + + def __init__( + self, + inherited0__name, + inherited1__u_degree, + inherited2__v_degree, + inherited3__control_points_list, + inherited4__surface_form, + inherited5__u_closed, + inherited6__v_closed, + inherited7__self_intersect, + ): + b_spline_surface.__init__( + self, + inherited0__name, + inherited1__u_degree, + inherited2__v_degree, + inherited3__control_points_list, + inherited4__surface_form, + inherited5__u_closed, + inherited6__v_closed, + inherited7__self_intersect, + ) + #################### - # ENTITY surface_curve # +# ENTITY surface_curve # #################### class surface_curve(curve): - '''Entity surface_curve definition. + """Entity surface_curve definition. - :param curve_3d - :type curve_3d:curve + :param curve_3d + :type curve_3d:curve - :param associated_geometry - :type associated_geometry:LIST(1,2,'pcurve_or_surface', scope = schema_scope) + :param associated_geometry + :type associated_geometry:LIST(1,2,'pcurve_or_surface', scope = schema_scope) - :param master_representation - :type master_representation:preferred_surface_curve_representation + :param master_representation + :type master_representation:preferred_surface_curve_representation - :param basis_surface - :type basis_surface:SET(1,2,'surface', scope = schema_scope) - ''' - def __init__( self , inherited0__name , curve_3d,associated_geometry,master_representation, ): - curve.__init__(self , inherited0__name , ) - self.curve_3d = curve_3d - self.associated_geometry = associated_geometry - self.master_representation = master_representation + :param basis_surface + :type basis_surface:SET(1,2,'surface', scope = schema_scope) + """ - @apply - def curve_3d(): - def fget( self ): - return self._curve_3d - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument curve_3d is mantatory and can not be set to None') - if not check_type(value,curve): - self._curve_3d = curve(value) - else: - self._curve_3d = value - return property(**locals()) + def __init__( + self, + inherited0__name, + curve_3d, + associated_geometry, + master_representation, + ): + curve.__init__( + self, + inherited0__name, + ) + self.curve_3d = curve_3d + self.associated_geometry = associated_geometry + self.master_representation = master_representation - @apply - def associated_geometry(): - def fget( self ): - return self._associated_geometry - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument associated_geometry is mantatory and can not be set to None') - if not check_type(value,LIST(1,2,'pcurve_or_surface', scope = schema_scope)): - self._associated_geometry = LIST(value) - else: - self._associated_geometry = value - return property(**locals()) + @apply + def curve_3d(): + def fget(self): + return self._curve_3d - @apply - def master_representation(): - def fget( self ): - return self._master_representation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument master_representation is mantatory and can not be set to None') - if not check_type(value,preferred_surface_curve_representation): - self._master_representation = preferred_surface_curve_representation(value) - else: - self._master_representation = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument curve_3d is mantatory and can not be set to None") + if not check_type(value, curve): + self._curve_3d = curve(value) + else: + self._curve_3d = value - @apply - def basis_surface(): - def fget( self ): - attribute_eval = get_basis_surface(self) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument basis_surface is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.curve_3d.self.dim == 3) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + return property(**locals()) - def wr2(self): - eval_wr2_wr = (('CONFIG_CONTROL_DESIGN.PCURVE' == TYPEOF(self.associated_geometry[1])) or (self.master_representation != pcurve_s1)) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + @apply + def associated_geometry(): + def fget(self): + return self._associated_geometry - def wr3(self): - eval_wr3_wr = (('CONFIG_CONTROL_DESIGN.PCURVE' == TYPEOF(self.associated_geometry[2])) or (self.master_representation != pcurve_s2)) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument associated_geometry is mantatory and can not be set to None" + ) + if not check_type(value, LIST(1, 2, "pcurve_or_surface", scope=schema_scope)): + self._associated_geometry = LIST(value) + else: + self._associated_geometry = value - def wr4(self): - eval_wr4_wr = ( not ('CONFIG_CONTROL_DESIGN.PCURVE' == TYPEOF(self.curve_3d))) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + return property(**locals()) + + @apply + def master_representation(): + def fget(self): + return self._master_representation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument master_representation is mantatory and can not be set to None" + ) + if not check_type(value, preferred_surface_curve_representation): + self._master_representation = preferred_surface_curve_representation(value) + else: + self._master_representation = value + + return property(**locals()) + + @apply + def basis_surface(): + def fget(self): + attribute_eval = get_basis_surface(self) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument basis_surface is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.curve_3d.self.dim == 3 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = ("CONFIG_CONTROL_DESIGN.PCURVE" == TYPEOF(self.associated_geometry[1])) or ( + self.master_representation != pcurve_s1 + ) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr + + def wr3(self): + eval_wr3_wr = ("CONFIG_CONTROL_DESIGN.PCURVE" == TYPEOF(self.associated_geometry[2])) or ( + self.master_representation != pcurve_s2 + ) + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr + + def wr4(self): + eval_wr4_wr = not ("CONFIG_CONTROL_DESIGN.PCURVE" == TYPEOF(self.curve_3d)) + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr #################### - # ENTITY action_request_status # +# ENTITY action_request_status # #################### class action_request_status(BaseEntityClass): - '''Entity action_request_status definition. + """Entity action_request_status definition. - :param status - :type status:label + :param status + :type status:label - :param assigned_request - :type assigned_request:versioned_action_request - ''' - def __init__( self , status,assigned_request, ): - self.status = status - self.assigned_request = assigned_request + :param assigned_request + :type assigned_request:versioned_action_request + """ - @apply - def status(): - def fget( self ): - return self._status - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument status is mantatory and can not be set to None') - if not check_type(value,label): - self._status = label(value) - else: - self._status = value - return property(**locals()) + def __init__( + self, + status, + assigned_request, + ): + self.status = status + self.assigned_request = assigned_request + + @apply + def status(): + def fget(self): + return self._status + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument status is mantatory and can not be set to None") + if not check_type(value, label): + self._status = label(value) + else: + self._status = value + + return property(**locals()) + + @apply + def assigned_request(): + def fget(self): + return self._assigned_request + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument assigned_request is mantatory and can not be set to None" + ) + if not check_type(value, versioned_action_request): + self._assigned_request = versioned_action_request(value) + else: + self._assigned_request = value + + return property(**locals()) - @apply - def assigned_request(): - def fget( self ): - return self._assigned_request - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument assigned_request is mantatory and can not be set to None') - if not check_type(value,versioned_action_request): - self._assigned_request = versioned_action_request(value) - else: - self._assigned_request = value - return property(**locals()) #################### - # ENTITY founded_item # +# ENTITY founded_item # #################### class founded_item(BaseEntityClass): - '''Entity founded_item definition. - ''' - # This class does not define any attribute. - pass + """Entity founded_item definition.""" + + # This class does not define any attribute. + pass + #################### - # ENTITY composite_curve_segment # +# ENTITY composite_curve_segment # #################### class composite_curve_segment(founded_item): - '''Entity composite_curve_segment definition. + """Entity composite_curve_segment definition. - :param transition - :type transition:transition_code + :param transition + :type transition:transition_code - :param same_sense - :type same_sense:BOOLEAN + :param same_sense + :type same_sense:BOOLEAN - :param parent_curve - :type parent_curve:curve + :param parent_curve + :type parent_curve:curve - :param using_curves - :type using_curves:BAG(1,None,'composite_curve', scope = schema_scope) - ''' - def __init__( self , transition,same_sense,parent_curve, ): - founded_item.__init__(self , ) - self.transition = transition - self.same_sense = same_sense - self.parent_curve = parent_curve + :param using_curves + :type using_curves:BAG(1,None,'composite_curve', scope = schema_scope) + """ - @apply - def transition(): - def fget( self ): - return self._transition - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument transition is mantatory and can not be set to None') - if not check_type(value,transition_code): - self._transition = transition_code(value) - else: - self._transition = value - return property(**locals()) + def __init__( + self, + transition, + same_sense, + parent_curve, + ): + founded_item.__init__( + self, + ) + self.transition = transition + self.same_sense = same_sense + self.parent_curve = parent_curve - @apply - def same_sense(): - def fget( self ): - return self._same_sense - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument same_sense is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._same_sense = BOOLEAN(value) - else: - self._same_sense = value - return property(**locals()) + @apply + def transition(): + def fget(self): + return self._transition - @apply - def parent_curve(): - def fget( self ): - return self._parent_curve - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument parent_curve is mantatory and can not be set to None') - if not check_type(value,curve): - self._parent_curve = curve(value) - else: - self._parent_curve = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument transition is mantatory and can not be set to None") + if not check_type(value, transition_code): + self._transition = transition_code(value) + else: + self._transition = value - @apply - def using_curves(): - def fget( self ): - return self._using_curves - def fset( self, value ): - # INVERSE argument - raise AssertionError('Argument using_curves is INVERSE. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = ('CONFIG_CONTROL_DESIGN.BOUNDED_CURVE' == TYPEOF(self.parent_curve)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + return property(**locals()) + + @apply + def same_sense(): + def fget(self): + return self._same_sense + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument same_sense is mantatory and can not be set to None") + if not check_type(value, BOOLEAN): + self._same_sense = BOOLEAN(value) + else: + self._same_sense = value + + return property(**locals()) + + @apply + def parent_curve(): + def fget(self): + return self._parent_curve + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument parent_curve is mantatory and can not be set to None" + ) + if not check_type(value, curve): + self._parent_curve = curve(value) + else: + self._parent_curve = value + + return property(**locals()) + + @apply + def using_curves(): + def fget(self): + return self._using_curves + + def fset(self, value): + # INVERSE argument + raise AssertionError( + "Argument using_curves is INVERSE. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = "CONFIG_CONTROL_DESIGN.BOUNDED_CURVE" == TYPEOF(self.parent_curve) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY reparametrised_composite_curve_segment # +# ENTITY reparametrised_composite_curve_segment # #################### class reparametrised_composite_curve_segment(composite_curve_segment): - '''Entity reparametrised_composite_curve_segment definition. + """Entity reparametrised_composite_curve_segment definition. - :param param_length - :type param_length:parameter_value - ''' - def __init__( self , inherited0__transition , inherited1__same_sense , inherited2__parent_curve , param_length, ): - composite_curve_segment.__init__(self , inherited0__transition , inherited1__same_sense , inherited2__parent_curve , ) - self.param_length = param_length + :param param_length + :type param_length:parameter_value + """ - @apply - def param_length(): - def fget( self ): - return self._param_length - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument param_length is mantatory and can not be set to None') - if not check_type(value,parameter_value): - self._param_length = parameter_value(value) - else: - self._param_length = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.param_length > 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__transition, + inherited1__same_sense, + inherited2__parent_curve, + param_length, + ): + composite_curve_segment.__init__( + self, + inherited0__transition, + inherited1__same_sense, + inherited2__parent_curve, + ) + self.param_length = param_length + + @apply + def param_length(): + def fget(self): + return self._param_length + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument param_length is mantatory and can not be set to None" + ) + if not check_type(value, parameter_value): + self._param_length = parameter_value(value) + else: + self._param_length = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.param_length > 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY representation_relationship # +# ENTITY representation_relationship # #################### class representation_relationship(BaseEntityClass): - '''Entity representation_relationship definition. + """Entity representation_relationship definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param rep_1 - :type rep_1:representation + :param rep_1 + :type rep_1:representation - :param rep_2 - :type rep_2:representation - ''' - def __init__( self , name,description,rep_1,rep_2, ): - self.name = name - self.description = description - self.rep_1 = rep_1 - self.rep_2 = rep_2 + :param rep_2 + :type rep_2:representation + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + rep_1, + rep_2, + ): + self.name = name + self.description = description + self.rep_1 = rep_1 + self.rep_2 = rep_2 - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name - @apply - def rep_1(): - def fget( self ): - return self._rep_1 - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument rep_1 is mantatory and can not be set to None') - if not check_type(value,representation): - self._rep_1 = representation(value) - else: - self._rep_1 = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def rep_1(): + def fget(self): + return self._rep_1 + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument rep_1 is mantatory and can not be set to None") + if not check_type(value, representation): + self._rep_1 = representation(value) + else: + self._rep_1 = value + + return property(**locals()) + + @apply + def rep_2(): + def fget(self): + return self._rep_2 + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument rep_2 is mantatory and can not be set to None") + if not check_type(value, representation): + self._rep_2 = representation(value) + else: + self._rep_2 = value + + return property(**locals()) - @apply - def rep_2(): - def fget( self ): - return self._rep_2 - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument rep_2 is mantatory and can not be set to None') - if not check_type(value,representation): - self._rep_2 = representation(value) - else: - self._rep_2 = value - return property(**locals()) #################### - # ENTITY representation_relationship_with_transformation # +# ENTITY representation_relationship_with_transformation # #################### class representation_relationship_with_transformation(representation_relationship): - '''Entity representation_relationship_with_transformation definition. + """Entity representation_relationship_with_transformation definition. - :param transformation_operator - :type transformation_operator:transformation - ''' - def __init__( self , inherited0__name , inherited1__description , inherited2__rep_1 , inherited3__rep_2 , transformation_operator, ): - representation_relationship.__init__(self , inherited0__name , inherited1__description , inherited2__rep_1 , inherited3__rep_2 , ) - self.transformation_operator = transformation_operator + :param transformation_operator + :type transformation_operator:transformation + """ - @apply - def transformation_operator(): - def fget( self ): - return self._transformation_operator - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument transformation_operator is mantatory and can not be set to None') - if not check_type(value,transformation): - self._transformation_operator = transformation(value) - else: - self._transformation_operator = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.self.representation_relationship.self.rep_1.self.context_of_items != self.self.representation_relationship.self.rep_2.self.context_of_items) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__name, + inherited1__description, + inherited2__rep_1, + inherited3__rep_2, + transformation_operator, + ): + representation_relationship.__init__( + self, + inherited0__name, + inherited1__description, + inherited2__rep_1, + inherited3__rep_2, + ) + self.transformation_operator = transformation_operator + + @apply + def transformation_operator(): + def fget(self): + return self._transformation_operator + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument transformation_operator is mantatory and can not be set to None" + ) + if not check_type(value, transformation): + self._transformation_operator = transformation(value) + else: + self._transformation_operator = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = ( + self.self.representation_relationship.self.rep_1.self.context_of_items + != self.self.representation_relationship.self.rep_2.self.context_of_items + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY person_and_organization_role # +# ENTITY person_and_organization_role # #################### class person_and_organization_role(BaseEntityClass): - '''Entity person_and_organization_role definition. + """Entity person_and_organization_role definition. - :param name - :type name:label - ''' - def __init__( self , name, ): - self.name = name + :param name + :type name:label + """ + + def __init__( + self, + name, + ): + self.name = name + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) #################### - # ENTITY quasi_uniform_curve # +# ENTITY quasi_uniform_curve # #################### class quasi_uniform_curve(b_spline_curve): - '''Entity quasi_uniform_curve definition. - ''' - def __init__( self , inherited0__name , inherited1__degree , inherited2__control_points_list , inherited3__curve_form , inherited4__closed_curve , inherited5__self_intersect , ): - b_spline_curve.__init__(self , inherited0__name , inherited1__degree , inherited2__control_points_list , inherited3__curve_form , inherited4__closed_curve , inherited5__self_intersect , ) + """Entity quasi_uniform_curve definition.""" + + def __init__( + self, + inherited0__name, + inherited1__degree, + inherited2__control_points_list, + inherited3__curve_form, + inherited4__closed_curve, + inherited5__self_intersect, + ): + b_spline_curve.__init__( + self, + inherited0__name, + inherited1__degree, + inherited2__control_points_list, + inherited3__curve_form, + inherited4__closed_curve, + inherited5__self_intersect, + ) + #################### - # ENTITY swept_surface # +# ENTITY swept_surface # #################### class swept_surface(surface): - '''Entity swept_surface definition. + """Entity swept_surface definition. - :param swept_curve - :type swept_curve:curve - ''' - def __init__( self , inherited0__name , swept_curve, ): - surface.__init__(self , inherited0__name , ) - self.swept_curve = swept_curve + :param swept_curve + :type swept_curve:curve + """ + + def __init__( + self, + inherited0__name, + swept_curve, + ): + surface.__init__( + self, + inherited0__name, + ) + self.swept_curve = swept_curve + + @apply + def swept_curve(): + def fget(self): + return self._swept_curve + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument swept_curve is mantatory and can not be set to None") + if not check_type(value, curve): + self._swept_curve = curve(value) + else: + self._swept_curve = value + + return property(**locals()) - @apply - def swept_curve(): - def fget( self ): - return self._swept_curve - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument swept_curve is mantatory and can not be set to None') - if not check_type(value,curve): - self._swept_curve = curve(value) - else: - self._swept_curve = value - return property(**locals()) #################### - # ENTITY property_definition # +# ENTITY property_definition # #################### class property_definition(BaseEntityClass): - '''Entity property_definition definition. + """Entity property_definition definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param definition - :type definition:characterized_definition - ''' - def __init__( self , name,description,definition, ): - self.name = name - self.description = description - self.definition = definition + :param definition + :type definition:characterized_definition + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + definition, + ): + self.name = name + self.description = description + self.definition = definition - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def definition(): + def fget(self): + return self._definition + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument definition is mantatory and can not be set to None") + if not check_type(value, characterized_definition): + self._definition = characterized_definition(value) + else: + self._definition = value + + return property(**locals()) - @apply - def definition(): - def fget( self ): - return self._definition - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument definition is mantatory and can not be set to None') - if not check_type(value,characterized_definition): - self._definition = characterized_definition(value) - else: - self._definition = value - return property(**locals()) #################### - # ENTITY global_uncertainty_assigned_context # +# ENTITY global_uncertainty_assigned_context # #################### class global_uncertainty_assigned_context(representation_context): - '''Entity global_uncertainty_assigned_context definition. + """Entity global_uncertainty_assigned_context definition. - :param uncertainty - :type uncertainty:SET(1,None,'uncertainty_measure_with_unit', scope = schema_scope) - ''' - def __init__( self , inherited0__context_identifier , inherited1__context_type , uncertainty, ): - representation_context.__init__(self , inherited0__context_identifier , inherited1__context_type , ) - self.uncertainty = uncertainty + :param uncertainty + :type uncertainty:SET(1,None,'uncertainty_measure_with_unit', scope = schema_scope) + """ + + def __init__( + self, + inherited0__context_identifier, + inherited1__context_type, + uncertainty, + ): + representation_context.__init__( + self, + inherited0__context_identifier, + inherited1__context_type, + ) + self.uncertainty = uncertainty + + @apply + def uncertainty(): + def fget(self): + return self._uncertainty + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument uncertainty is mantatory and can not be set to None") + if not check_type( + value, SET(1, None, "uncertainty_measure_with_unit", scope=schema_scope) + ): + self._uncertainty = SET(value) + else: + self._uncertainty = value + + return property(**locals()) - @apply - def uncertainty(): - def fget( self ): - return self._uncertainty - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument uncertainty is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'uncertainty_measure_with_unit', scope = schema_scope)): - self._uncertainty = SET(value) - else: - self._uncertainty = value - return property(**locals()) #################### - # ENTITY organization_relationship # +# ENTITY organization_relationship # #################### class organization_relationship(BaseEntityClass): - '''Entity organization_relationship definition. + """Entity organization_relationship definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param relating_organization - :type relating_organization:organization + :param relating_organization + :type relating_organization:organization - :param related_organization - :type related_organization:organization - ''' - def __init__( self , name,description,relating_organization,related_organization, ): - self.name = name - self.description = description - self.relating_organization = relating_organization - self.related_organization = related_organization + :param related_organization + :type related_organization:organization + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + relating_organization, + related_organization, + ): + self.name = name + self.description = description + self.relating_organization = relating_organization + self.related_organization = related_organization - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name - @apply - def relating_organization(): - def fget( self ): - return self._relating_organization - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument relating_organization is mantatory and can not be set to None') - if not check_type(value,organization): - self._relating_organization = organization(value) - else: - self._relating_organization = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def relating_organization(): + def fget(self): + return self._relating_organization + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument relating_organization is mantatory and can not be set to None" + ) + if not check_type(value, organization): + self._relating_organization = organization(value) + else: + self._relating_organization = value + + return property(**locals()) + + @apply + def related_organization(): + def fget(self): + return self._related_organization + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument related_organization is mantatory and can not be set to None" + ) + if not check_type(value, organization): + self._related_organization = organization(value) + else: + self._related_organization = value + + return property(**locals()) - @apply - def related_organization(): - def fget( self ): - return self._related_organization - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument related_organization is mantatory and can not be set to None') - if not check_type(value,organization): - self._related_organization = organization(value) - else: - self._related_organization = value - return property(**locals()) #################### - # ENTITY parabola # +# ENTITY parabola # #################### class parabola(conic): - '''Entity parabola definition. + """Entity parabola definition. - :param focal_dist - :type focal_dist:length_measure - ''' - def __init__( self , inherited0__name , inherited1__position , focal_dist, ): - conic.__init__(self , inherited0__name , inherited1__position , ) - self.focal_dist = focal_dist + :param focal_dist + :type focal_dist:length_measure + """ - @apply - def focal_dist(): - def fget( self ): - return self._focal_dist - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument focal_dist is mantatory and can not be set to None') - if not check_type(value,length_measure): - self._focal_dist = length_measure(value) - else: - self._focal_dist = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.focal_dist != 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__name, + inherited1__position, + focal_dist, + ): + conic.__init__( + self, + inherited0__name, + inherited1__position, + ) + self.focal_dist = focal_dist + + @apply + def focal_dist(): + def fget(self): + return self._focal_dist + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument focal_dist is mantatory and can not be set to None") + if not check_type(value, length_measure): + self._focal_dist = length_measure(value) + else: + self._focal_dist = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.focal_dist != 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY rectangular_composite_surface # +# ENTITY rectangular_composite_surface # #################### class rectangular_composite_surface(bounded_surface): - '''Entity rectangular_composite_surface definition. + """Entity rectangular_composite_surface definition. - :param segments - :type segments:LIST(1,None,LIST(1,None,'surface_patch', scope = schema_scope)) + :param segments + :type segments:LIST(1,None,LIST(1,None,'surface_patch', scope = schema_scope)) - :param n_u - :type n_u:INTEGER + :param n_u + :type n_u:INTEGER - :param n_v - :type n_v:INTEGER - ''' - def __init__( self , inherited0__name , segments, ): - bounded_surface.__init__(self , inherited0__name , ) - self.segments = segments + :param n_v + :type n_v:INTEGER + """ - @apply - def segments(): - def fget( self ): - return self._segments - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument segments is mantatory and can not be set to None') - if not check_type(value,LIST(1,None,LIST(1,None,'surface_patch', scope = schema_scope))): - self._segments = LIST(value) - else: - self._segments = value - return property(**locals()) + def __init__( + self, + inherited0__name, + segments, + ): + bounded_surface.__init__( + self, + inherited0__name, + ) + self.segments = segments - @apply - def n_u(): - def fget( self ): - attribute_eval = SIZEOF(self.segments) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument n_u is DERIVED. It is computed and can not be set to any value') - return property(**locals()) + @apply + def segments(): + def fget(self): + return self._segments - @apply - def n_v(): - def fget( self ): - attribute_eval = SIZEOF(self.segments[1]) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument n_v is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = ([] == None) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument segments is mantatory and can not be set to None") + if not check_type( + value, LIST(1, None, LIST(1, None, "surface_patch", scope=schema_scope)) + ): + self._segments = LIST(value) + else: + self._segments = value - def wr2(self): - eval_wr2_wr = constraints_rectangular_composite_surface(self) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + return property(**locals()) + + @apply + def n_u(): + def fget(self): + attribute_eval = SIZEOF(self.segments) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument n_u is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + @apply + def n_v(): + def fget(self): + attribute_eval = SIZEOF(self.segments[1]) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument n_v is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = [] == None + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = constraints_rectangular_composite_surface(self) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr #################### - # ENTITY lot_effectivity # +# ENTITY lot_effectivity # #################### class lot_effectivity(effectivity): - '''Entity lot_effectivity definition. + """Entity lot_effectivity definition. - :param effectivity_lot_id - :type effectivity_lot_id:identifier + :param effectivity_lot_id + :type effectivity_lot_id:identifier - :param effectivity_lot_size - :type effectivity_lot_size:measure_with_unit - ''' - def __init__( self , inherited0__id , effectivity_lot_id,effectivity_lot_size, ): - effectivity.__init__(self , inherited0__id , ) - self.effectivity_lot_id = effectivity_lot_id - self.effectivity_lot_size = effectivity_lot_size + :param effectivity_lot_size + :type effectivity_lot_size:measure_with_unit + """ - @apply - def effectivity_lot_id(): - def fget( self ): - return self._effectivity_lot_id - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument effectivity_lot_id is mantatory and can not be set to None') - if not check_type(value,identifier): - self._effectivity_lot_id = identifier(value) - else: - self._effectivity_lot_id = value - return property(**locals()) + def __init__( + self, + inherited0__id, + effectivity_lot_id, + effectivity_lot_size, + ): + effectivity.__init__( + self, + inherited0__id, + ) + self.effectivity_lot_id = effectivity_lot_id + self.effectivity_lot_size = effectivity_lot_size + + @apply + def effectivity_lot_id(): + def fget(self): + return self._effectivity_lot_id + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument effectivity_lot_id is mantatory and can not be set to None" + ) + if not check_type(value, identifier): + self._effectivity_lot_id = identifier(value) + else: + self._effectivity_lot_id = value + + return property(**locals()) + + @apply + def effectivity_lot_size(): + def fget(self): + return self._effectivity_lot_size + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument effectivity_lot_size is mantatory and can not be set to None" + ) + if not check_type(value, measure_with_unit): + self._effectivity_lot_size = measure_with_unit(value) + else: + self._effectivity_lot_size = value + + return property(**locals()) - @apply - def effectivity_lot_size(): - def fget( self ): - return self._effectivity_lot_size - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument effectivity_lot_size is mantatory and can not be set to None') - if not check_type(value,measure_with_unit): - self._effectivity_lot_size = measure_with_unit(value) - else: - self._effectivity_lot_size = value - return property(**locals()) #################### - # ENTITY surface_of_linear_extrusion # +# ENTITY surface_of_linear_extrusion # #################### class surface_of_linear_extrusion(swept_surface): - '''Entity surface_of_linear_extrusion definition. + """Entity surface_of_linear_extrusion definition. - :param extrusion_axis - :type extrusion_axis:vector - ''' - def __init__( self , inherited0__name , inherited1__swept_curve , extrusion_axis, ): - swept_surface.__init__(self , inherited0__name , inherited1__swept_curve , ) - self.extrusion_axis = extrusion_axis + :param extrusion_axis + :type extrusion_axis:vector + """ + + def __init__( + self, + inherited0__name, + inherited1__swept_curve, + extrusion_axis, + ): + swept_surface.__init__( + self, + inherited0__name, + inherited1__swept_curve, + ) + self.extrusion_axis = extrusion_axis + + @apply + def extrusion_axis(): + def fget(self): + return self._extrusion_axis + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument extrusion_axis is mantatory and can not be set to None" + ) + if not check_type(value, vector): + self._extrusion_axis = vector(value) + else: + self._extrusion_axis = value + + return property(**locals()) - @apply - def extrusion_axis(): - def fget( self ): - return self._extrusion_axis - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument extrusion_axis is mantatory and can not be set to None') - if not check_type(value,vector): - self._extrusion_axis = vector(value) - else: - self._extrusion_axis = value - return property(**locals()) #################### - # ENTITY shell_based_surface_model # +# ENTITY shell_based_surface_model # #################### class shell_based_surface_model(geometric_representation_item): - '''Entity shell_based_surface_model definition. + """Entity shell_based_surface_model definition. - :param sbsm_boundary - :type sbsm_boundary:SET(1,None,'shell', scope = schema_scope) - ''' - def __init__( self , inherited0__name , sbsm_boundary, ): - geometric_representation_item.__init__(self , inherited0__name , ) - self.sbsm_boundary = sbsm_boundary + :param sbsm_boundary + :type sbsm_boundary:SET(1,None,'shell', scope = schema_scope) + """ - @apply - def sbsm_boundary(): - def fget( self ): - return self._sbsm_boundary - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument sbsm_boundary is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'shell', scope = schema_scope)): - self._sbsm_boundary = SET(value) - else: - self._sbsm_boundary = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = constraints_geometry_shell_based_surface_model(self) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__name, + sbsm_boundary, + ): + geometric_representation_item.__init__( + self, + inherited0__name, + ) + self.sbsm_boundary = sbsm_boundary + + @apply + def sbsm_boundary(): + def fget(self): + return self._sbsm_boundary + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument sbsm_boundary is mantatory and can not be set to None" + ) + if not check_type(value, SET(1, None, "shell", scope=schema_scope)): + self._sbsm_boundary = SET(value) + else: + self._sbsm_boundary = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = constraints_geometry_shell_based_surface_model(self) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY uniform_curve # +# ENTITY uniform_curve # #################### class uniform_curve(b_spline_curve): - '''Entity uniform_curve definition. - ''' - def __init__( self , inherited0__name , inherited1__degree , inherited2__control_points_list , inherited3__curve_form , inherited4__closed_curve , inherited5__self_intersect , ): - b_spline_curve.__init__(self , inherited0__name , inherited1__degree , inherited2__control_points_list , inherited3__curve_form , inherited4__closed_curve , inherited5__self_intersect , ) + """Entity uniform_curve definition.""" + + def __init__( + self, + inherited0__name, + inherited1__degree, + inherited2__control_points_list, + inherited3__curve_form, + inherited4__closed_curve, + inherited5__self_intersect, + ): + b_spline_curve.__init__( + self, + inherited0__name, + inherited1__degree, + inherited2__control_points_list, + inherited3__curve_form, + inherited4__closed_curve, + inherited5__self_intersect, + ) + #################### - # ENTITY bezier_curve # +# ENTITY bezier_curve # #################### class bezier_curve(b_spline_curve): - '''Entity bezier_curve definition. - ''' - def __init__( self , inherited0__name , inherited1__degree , inherited2__control_points_list , inherited3__curve_form , inherited4__closed_curve , inherited5__self_intersect , ): - b_spline_curve.__init__(self , inherited0__name , inherited1__degree , inherited2__control_points_list , inherited3__curve_form , inherited4__closed_curve , inherited5__self_intersect , ) + """Entity bezier_curve definition.""" + + def __init__( + self, + inherited0__name, + inherited1__degree, + inherited2__control_points_list, + inherited3__curve_form, + inherited4__closed_curve, + inherited5__self_intersect, + ): + b_spline_curve.__init__( + self, + inherited0__name, + inherited1__degree, + inherited2__control_points_list, + inherited3__curve_form, + inherited4__closed_curve, + inherited5__self_intersect, + ) + #################### - # ENTITY loop # +# ENTITY loop # #################### class loop(topological_representation_item): - '''Entity loop definition. - ''' - def __init__( self , inherited0__name , ): - topological_representation_item.__init__(self , inherited0__name , ) + """Entity loop definition.""" -#################### - # ENTITY edge_loop # -#################### -class edge_loop(loop,path): - '''Entity edge_loop definition. - - :param ne - :type ne:INTEGER - ''' - def __init__( self , inherited0__name , inherited1__name , inherited2__edge_list , ): - loop.__init__(self , inherited0__name , ) - path.__init__(self , inherited1__name , inherited2__edge_list , ) - - @apply - def ne(): - def fget( self ): - attribute_eval = SIZEOF(self.self.path.self.edge_list) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument ne is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.self.path.self.edge_list[1].self.edge_start == self.self.path.self.edge_list[self.ne].self.edge_end) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__name, + ): + topological_representation_item.__init__( + self, + inherited0__name, + ) #################### - # ENTITY date # +# ENTITY edge_loop # +#################### +class edge_loop(loop, path): + """Entity edge_loop definition. + + :param ne + :type ne:INTEGER + """ + + def __init__( + self, + inherited0__name, + inherited1__name, + inherited2__edge_list, + ): + loop.__init__( + self, + inherited0__name, + ) + path.__init__( + self, + inherited1__name, + inherited2__edge_list, + ) + + @apply + def ne(): + def fget(self): + attribute_eval = SIZEOF(self.self.path.self.edge_list) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument ne is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = ( + self.self.path.self.edge_list[1].self.edge_start + == self.self.path.self.edge_list[self.ne].self.edge_end + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + +#################### +# ENTITY date # #################### class date(BaseEntityClass): - '''Entity date definition. + """Entity date definition. - :param year_component - :type year_component:year_number - ''' - def __init__( self , year_component, ): - self.year_component = year_component + :param year_component + :type year_component:year_number + """ + + def __init__( + self, + year_component, + ): + self.year_component = year_component + + @apply + def year_component(): + def fget(self): + return self._year_component + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument year_component is mantatory and can not be set to None" + ) + if not check_type(value, year_number): + self._year_component = year_number(value) + else: + self._year_component = value + + return property(**locals()) - @apply - def year_component(): - def fget( self ): - return self._year_component - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument year_component is mantatory and can not be set to None') - if not check_type(value,year_number): - self._year_component = year_number(value) - else: - self._year_component = value - return property(**locals()) #################### - # ENTITY calendar_date # +# ENTITY calendar_date # #################### class calendar_date(date): - '''Entity calendar_date definition. + """Entity calendar_date definition. - :param day_component - :type day_component:day_in_month_number + :param day_component + :type day_component:day_in_month_number - :param month_component - :type month_component:month_in_year_number - ''' - def __init__( self , inherited0__year_component , day_component,month_component, ): - date.__init__(self , inherited0__year_component , ) - self.day_component = day_component - self.month_component = month_component + :param month_component + :type month_component:month_in_year_number + """ - @apply - def day_component(): - def fget( self ): - return self._day_component - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument day_component is mantatory and can not be set to None') - if not check_type(value,day_in_month_number): - self._day_component = day_in_month_number(value) - else: - self._day_component = value - return property(**locals()) + def __init__( + self, + inherited0__year_component, + day_component, + month_component, + ): + date.__init__( + self, + inherited0__year_component, + ) + self.day_component = day_component + self.month_component = month_component - @apply - def month_component(): - def fget( self ): - return self._month_component - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument month_component is mantatory and can not be set to None') - if not check_type(value,month_in_year_number): - self._month_component = month_in_year_number(value) - else: - self._month_component = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = valid_calendar_date(self) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def day_component(): + def fget(self): + return self._day_component + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument day_component is mantatory and can not be set to None" + ) + if not check_type(value, day_in_month_number): + self._day_component = day_in_month_number(value) + else: + self._day_component = value + + return property(**locals()) + + @apply + def month_component(): + def fget(self): + return self._month_component + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument month_component is mantatory and can not be set to None" + ) + if not check_type(value, month_in_year_number): + self._month_component = month_in_year_number(value) + else: + self._month_component = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = valid_calendar_date(self) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY toroidal_surface # +# ENTITY toroidal_surface # #################### class toroidal_surface(elementary_surface): - '''Entity toroidal_surface definition. + """Entity toroidal_surface definition. - :param major_radius - :type major_radius:positive_length_measure + :param major_radius + :type major_radius:positive_length_measure - :param minor_radius - :type minor_radius:positive_length_measure - ''' - def __init__( self , inherited0__name , inherited1__position , major_radius,minor_radius, ): - elementary_surface.__init__(self , inherited0__name , inherited1__position , ) - self.major_radius = major_radius - self.minor_radius = minor_radius + :param minor_radius + :type minor_radius:positive_length_measure + """ - @apply - def major_radius(): - def fget( self ): - return self._major_radius - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument major_radius is mantatory and can not be set to None') - if not check_type(value,positive_length_measure): - self._major_radius = positive_length_measure(value) - else: - self._major_radius = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__position, + major_radius, + minor_radius, + ): + elementary_surface.__init__( + self, + inherited0__name, + inherited1__position, + ) + self.major_radius = major_radius + self.minor_radius = minor_radius + + @apply + def major_radius(): + def fget(self): + return self._major_radius + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument major_radius is mantatory and can not be set to None" + ) + if not check_type(value, positive_length_measure): + self._major_radius = positive_length_measure(value) + else: + self._major_radius = value + + return property(**locals()) + + @apply + def minor_radius(): + def fget(self): + return self._minor_radius + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument minor_radius is mantatory and can not be set to None" + ) + if not check_type(value, positive_length_measure): + self._minor_radius = positive_length_measure(value) + else: + self._minor_radius = value + + return property(**locals()) - @apply - def minor_radius(): - def fget( self ): - return self._minor_radius - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument minor_radius is mantatory and can not be set to None') - if not check_type(value,positive_length_measure): - self._minor_radius = positive_length_measure(value) - else: - self._minor_radius = value - return property(**locals()) #################### - # ENTITY promissory_usage_occurrence # +# ENTITY promissory_usage_occurrence # #################### class promissory_usage_occurrence(assembly_component_usage): - '''Entity promissory_usage_occurrence definition. - ''' - def __init__( self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , inherited5__reference_designator , ): - assembly_component_usage.__init__(self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , inherited5__reference_designator , ) + """Entity promissory_usage_occurrence definition.""" + + def __init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + inherited5__reference_designator, + ): + assembly_component_usage.__init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + inherited5__reference_designator, + ) + #################### - # ENTITY approval_assignment # +# ENTITY approval_assignment # #################### class approval_assignment(BaseEntityClass): - '''Entity approval_assignment definition. + """Entity approval_assignment definition. - :param assigned_approval - :type assigned_approval:approval - ''' - def __init__( self , assigned_approval, ): - self.assigned_approval = assigned_approval + :param assigned_approval + :type assigned_approval:approval + """ + + def __init__( + self, + assigned_approval, + ): + self.assigned_approval = assigned_approval + + @apply + def assigned_approval(): + def fget(self): + return self._assigned_approval + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument assigned_approval is mantatory and can not be set to None" + ) + if not check_type(value, approval): + self._assigned_approval = approval(value) + else: + self._assigned_approval = value + + return property(**locals()) - @apply - def assigned_approval(): - def fget( self ): - return self._assigned_approval - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument assigned_approval is mantatory and can not be set to None') - if not check_type(value,approval): - self._assigned_approval = approval(value) - else: - self._assigned_approval = value - return property(**locals()) #################### - # ENTITY configuration_item # +# ENTITY configuration_item # #################### class configuration_item(BaseEntityClass): - '''Entity configuration_item definition. + """Entity configuration_item definition. - :param id - :type id:identifier + :param id + :type id:identifier - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param item_concept - :type item_concept:product_concept + :param item_concept + :type item_concept:product_concept - :param purpose - :type purpose:label - ''' - def __init__( self , id,name,description,item_concept,purpose, ): - self.id = id - self.name = name - self.description = description - self.item_concept = item_concept - self.purpose = purpose + :param purpose + :type purpose:label + """ - @apply - def id(): - def fget( self ): - return self._id - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument id is mantatory and can not be set to None') - if not check_type(value,identifier): - self._id = identifier(value) - else: - self._id = value - return property(**locals()) + def __init__( + self, + id, + name, + description, + item_concept, + purpose, + ): + self.id = id + self.name = name + self.description = description + self.item_concept = item_concept + self.purpose = purpose - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + @apply + def id(): + def fget(self): + return self._id - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - else: - self._description = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument id is mantatory and can not be set to None") + if not check_type(value, identifier): + self._id = identifier(value) + else: + self._id = value - @apply - def item_concept(): - def fget( self ): - return self._item_concept - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument item_concept is mantatory and can not be set to None') - if not check_type(value,product_concept): - self._item_concept = product_concept(value) - else: - self._item_concept = value - return property(**locals()) + return property(**locals()) + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + else: + self._description = value + + return property(**locals()) + + @apply + def item_concept(): + def fget(self): + return self._item_concept + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument item_concept is mantatory and can not be set to None" + ) + if not check_type(value, product_concept): + self._item_concept = product_concept(value) + else: + self._item_concept = value + + return property(**locals()) + + @apply + def purpose(): + def fget(self): + return self._purpose + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, label): + self._purpose = label(value) + else: + self._purpose = value + else: + self._purpose = value + + return property(**locals()) - @apply - def purpose(): - def fget( self ): - return self._purpose - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,label): - self._purpose = label(value) - else: - self._purpose = value - else: - self._purpose = value - return property(**locals()) #################### - # ENTITY contract_assignment # +# ENTITY contract_assignment # #################### class contract_assignment(BaseEntityClass): - '''Entity contract_assignment definition. + """Entity contract_assignment definition. - :param assigned_contract - :type assigned_contract:contract - ''' - def __init__( self , assigned_contract, ): - self.assigned_contract = assigned_contract + :param assigned_contract + :type assigned_contract:contract + """ + + def __init__( + self, + assigned_contract, + ): + self.assigned_contract = assigned_contract + + @apply + def assigned_contract(): + def fget(self): + return self._assigned_contract + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument assigned_contract is mantatory and can not be set to None" + ) + if not check_type(value, contract): + self._assigned_contract = contract(value) + else: + self._assigned_contract = value + + return property(**locals()) - @apply - def assigned_contract(): - def fget( self ): - return self._assigned_contract - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument assigned_contract is mantatory and can not be set to None') - if not check_type(value,contract): - self._assigned_contract = contract(value) - else: - self._assigned_contract = value - return property(**locals()) #################### - # ENTITY vector # +# ENTITY vector # #################### class vector(geometric_representation_item): - '''Entity vector definition. + """Entity vector definition. - :param orientation - :type orientation:direction + :param orientation + :type orientation:direction - :param magnitude - :type magnitude:length_measure - ''' - def __init__( self , inherited0__name , orientation,magnitude, ): - geometric_representation_item.__init__(self , inherited0__name , ) - self.orientation = orientation - self.magnitude = magnitude + :param magnitude + :type magnitude:length_measure + """ - @apply - def orientation(): - def fget( self ): - return self._orientation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument orientation is mantatory and can not be set to None') - if not check_type(value,direction): - self._orientation = direction(value) - else: - self._orientation = value - return property(**locals()) + def __init__( + self, + inherited0__name, + orientation, + magnitude, + ): + geometric_representation_item.__init__( + self, + inherited0__name, + ) + self.orientation = orientation + self.magnitude = magnitude - @apply - def magnitude(): - def fget( self ): - return self._magnitude - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument magnitude is mantatory and can not be set to None') - if not check_type(value,length_measure): - self._magnitude = length_measure(value) - else: - self._magnitude = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.magnitude >= 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def orientation(): + def fget(self): + return self._orientation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument orientation is mantatory and can not be set to None") + if not check_type(value, direction): + self._orientation = direction(value) + else: + self._orientation = value + + return property(**locals()) + + @apply + def magnitude(): + def fget(self): + return self._magnitude + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument magnitude is mantatory and can not be set to None") + if not check_type(value, length_measure): + self._magnitude = length_measure(value) + else: + self._magnitude = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.magnitude >= 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY pcurve # +# ENTITY pcurve # #################### class pcurve(curve): - '''Entity pcurve definition. + """Entity pcurve definition. - :param basis_surface - :type basis_surface:surface + :param basis_surface + :type basis_surface:surface - :param reference_to_curve - :type reference_to_curve:definitional_representation - ''' - def __init__( self , inherited0__name , basis_surface,reference_to_curve, ): - curve.__init__(self , inherited0__name , ) - self.basis_surface = basis_surface - self.reference_to_curve = reference_to_curve + :param reference_to_curve + :type reference_to_curve:definitional_representation + """ - @apply - def basis_surface(): - def fget( self ): - return self._basis_surface - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument basis_surface is mantatory and can not be set to None') - if not check_type(value,surface): - self._basis_surface = surface(value) - else: - self._basis_surface = value - return property(**locals()) + def __init__( + self, + inherited0__name, + basis_surface, + reference_to_curve, + ): + curve.__init__( + self, + inherited0__name, + ) + self.basis_surface = basis_surface + self.reference_to_curve = reference_to_curve - @apply - def reference_to_curve(): - def fget( self ): - return self._reference_to_curve - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument reference_to_curve is mantatory and can not be set to None') - if not check_type(value,definitional_representation): - self._reference_to_curve = definitional_representation(value) - else: - self._reference_to_curve = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (SIZEOF(self.reference_to_curve.self.representation.self.items) == 1) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def basis_surface(): + def fget(self): + return self._basis_surface - def wr2(self): - eval_wr2_wr = ('CONFIG_CONTROL_DESIGN.CURVE' == TYPEOF(self.reference_to_curve.self.representation.self.items[1])) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument basis_surface is mantatory and can not be set to None" + ) + if not check_type(value, surface): + self._basis_surface = surface(value) + else: + self._basis_surface = value - def wr3(self): - eval_wr3_wr = (self.reference_to_curve.self.representation.self.items[1].self.geometric_representation_item.self.dim == 2) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + return property(**locals()) + + @apply + def reference_to_curve(): + def fget(self): + return self._reference_to_curve + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument reference_to_curve is mantatory and can not be set to None" + ) + if not check_type(value, definitional_representation): + self._reference_to_curve = definitional_representation(value) + else: + self._reference_to_curve = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = SIZEOF(self.reference_to_curve.self.representation.self.items) == 1 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = "CONFIG_CONTROL_DESIGN.CURVE" == TYPEOF( + self.reference_to_curve.self.representation.self.items[1] + ) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr + + def wr3(self): + eval_wr3_wr = ( + self.reference_to_curve.self.representation.self.items[ + 1 + ].self.geometric_representation_item.self.dim + == 2 + ) + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr #################### - # ENTITY bounded_pcurve # +# ENTITY bounded_pcurve # #################### -class bounded_pcurve(pcurve,bounded_curve): - '''Entity bounded_pcurve definition. - ''' - def __init__( self , inherited0__name , inherited1__basis_surface , inherited2__reference_to_curve , inherited3__name , ): - pcurve.__init__(self , inherited0__name , inherited1__basis_surface , inherited2__reference_to_curve , ) - bounded_curve.__init__(self , inherited3__name , ) - def wr1(self): - eval_wr1_wr = ('CONFIG_CONTROL_DESIGN.BOUNDED_CURVE' == TYPEOF(self.self.pcurve.self.reference_to_curve.self.items[1])) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr +class bounded_pcurve(pcurve, bounded_curve): + """Entity bounded_pcurve definition.""" + + def __init__( + self, + inherited0__name, + inherited1__basis_surface, + inherited2__reference_to_curve, + inherited3__name, + ): + pcurve.__init__( + self, + inherited0__name, + inherited1__basis_surface, + inherited2__reference_to_curve, + ) + bounded_curve.__init__( + self, + inherited3__name, + ) + + def wr1(self): + eval_wr1_wr = "CONFIG_CONTROL_DESIGN.BOUNDED_CURVE" == TYPEOF( + self.self.pcurve.self.reference_to_curve.self.items[1] + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY intersection_curve # +# ENTITY intersection_curve # #################### class intersection_curve(surface_curve): - '''Entity intersection_curve definition. - ''' - def __init__( self , inherited0__name , inherited1__curve_3d , inherited2__associated_geometry , inherited3__master_representation , ): - surface_curve.__init__(self , inherited0__name , inherited1__curve_3d , inherited2__associated_geometry , inherited3__master_representation , ) - def wr1(self): - eval_wr1_wr = (SIZEOF(self.self.surface_curve.self.associated_geometry) == 2) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity intersection_curve definition.""" - def wr2(self): - eval_wr2_wr = (associated_surface(self.self.surface_curve.self.associated_geometry[1]) != associated_surface(self.self.surface_curve.self.associated_geometry[2])) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def __init__( + self, + inherited0__name, + inherited1__curve_3d, + inherited2__associated_geometry, + inherited3__master_representation, + ): + surface_curve.__init__( + self, + inherited0__name, + inherited1__curve_3d, + inherited2__associated_geometry, + inherited3__master_representation, + ) + + def wr1(self): + eval_wr1_wr = SIZEOF(self.self.surface_curve.self.associated_geometry) == 2 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = associated_surface( + self.self.surface_curve.self.associated_geometry[1] + ) != associated_surface(self.self.surface_curve.self.associated_geometry[2]) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr #################### - # ENTITY trimmed_curve # +# ENTITY trimmed_curve # #################### class trimmed_curve(bounded_curve): - '''Entity trimmed_curve definition. + """Entity trimmed_curve definition. - :param basis_curve - :type basis_curve:curve + :param basis_curve + :type basis_curve:curve - :param trim_1 - :type trim_1:SET(1,2,'trimming_select', scope = schema_scope) + :param trim_1 + :type trim_1:SET(1,2,'trimming_select', scope = schema_scope) - :param trim_2 - :type trim_2:SET(1,2,'trimming_select', scope = schema_scope) + :param trim_2 + :type trim_2:SET(1,2,'trimming_select', scope = schema_scope) - :param sense_agreement - :type sense_agreement:BOOLEAN + :param sense_agreement + :type sense_agreement:BOOLEAN - :param master_representation - :type master_representation:trimming_preference - ''' - def __init__( self , inherited0__name , basis_curve,trim_1,trim_2,sense_agreement,master_representation, ): - bounded_curve.__init__(self , inherited0__name , ) - self.basis_curve = basis_curve - self.trim_1 = trim_1 - self.trim_2 = trim_2 - self.sense_agreement = sense_agreement - self.master_representation = master_representation + :param master_representation + :type master_representation:trimming_preference + """ - @apply - def basis_curve(): - def fget( self ): - return self._basis_curve - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument basis_curve is mantatory and can not be set to None') - if not check_type(value,curve): - self._basis_curve = curve(value) - else: - self._basis_curve = value - return property(**locals()) + def __init__( + self, + inherited0__name, + basis_curve, + trim_1, + trim_2, + sense_agreement, + master_representation, + ): + bounded_curve.__init__( + self, + inherited0__name, + ) + self.basis_curve = basis_curve + self.trim_1 = trim_1 + self.trim_2 = trim_2 + self.sense_agreement = sense_agreement + self.master_representation = master_representation - @apply - def trim_1(): - def fget( self ): - return self._trim_1 - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument trim_1 is mantatory and can not be set to None') - if not check_type(value,SET(1,2,'trimming_select', scope = schema_scope)): - self._trim_1 = SET(value) - else: - self._trim_1 = value - return property(**locals()) + @apply + def basis_curve(): + def fget(self): + return self._basis_curve - @apply - def trim_2(): - def fget( self ): - return self._trim_2 - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument trim_2 is mantatory and can not be set to None') - if not check_type(value,SET(1,2,'trimming_select', scope = schema_scope)): - self._trim_2 = SET(value) - else: - self._trim_2 = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument basis_curve is mantatory and can not be set to None") + if not check_type(value, curve): + self._basis_curve = curve(value) + else: + self._basis_curve = value - @apply - def sense_agreement(): - def fget( self ): - return self._sense_agreement - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument sense_agreement is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._sense_agreement = BOOLEAN(value) - else: - self._sense_agreement = value - return property(**locals()) + return property(**locals()) - @apply - def master_representation(): - def fget( self ): - return self._master_representation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument master_representation is mantatory and can not be set to None') - if not check_type(value,trimming_preference): - self._master_representation = trimming_preference(value) - else: - self._master_representation = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = ((HIINDEX(self.trim_1) == 1) or (TYPEOF(self.trim_1[1]) != TYPEOF(self.trim_1[2]))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def trim_1(): + def fget(self): + return self._trim_1 - def wr2(self): - eval_wr2_wr = ((HIINDEX(self.trim_2) == 1) or (TYPEOF(self.trim_2[1]) != TYPEOF(self.trim_2[2]))) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument trim_1 is mantatory and can not be set to None") + if not check_type(value, SET(1, 2, "trimming_select", scope=schema_scope)): + self._trim_1 = SET(value) + else: + self._trim_1 = value + + return property(**locals()) + + @apply + def trim_2(): + def fget(self): + return self._trim_2 + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument trim_2 is mantatory and can not be set to None") + if not check_type(value, SET(1, 2, "trimming_select", scope=schema_scope)): + self._trim_2 = SET(value) + else: + self._trim_2 = value + + return property(**locals()) + + @apply + def sense_agreement(): + def fget(self): + return self._sense_agreement + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument sense_agreement is mantatory and can not be set to None" + ) + if not check_type(value, BOOLEAN): + self._sense_agreement = BOOLEAN(value) + else: + self._sense_agreement = value + + return property(**locals()) + + @apply + def master_representation(): + def fget(self): + return self._master_representation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument master_representation is mantatory and can not be set to None" + ) + if not check_type(value, trimming_preference): + self._master_representation = trimming_preference(value) + else: + self._master_representation = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = (HIINDEX(self.trim_1) == 1) or ( + TYPEOF(self.trim_1[1]) != TYPEOF(self.trim_1[2]) + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = (HIINDEX(self.trim_2) == 1) or ( + TYPEOF(self.trim_2[1]) != TYPEOF(self.trim_2[2]) + ) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr #################### - # ENTITY product_definition_context # +# ENTITY product_definition_context # #################### class product_definition_context(application_context_element): - '''Entity product_definition_context definition. + """Entity product_definition_context definition. - :param life_cycle_stage - :type life_cycle_stage:label - ''' - def __init__( self , inherited0__name , inherited1__frame_of_reference , life_cycle_stage, ): - application_context_element.__init__(self , inherited0__name , inherited1__frame_of_reference , ) - self.life_cycle_stage = life_cycle_stage + :param life_cycle_stage + :type life_cycle_stage:label + """ - @apply - def life_cycle_stage(): - def fget( self ): - return self._life_cycle_stage - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument life_cycle_stage is mantatory and can not be set to None') - if not check_type(value,label): - self._life_cycle_stage = label(value) - else: - self._life_cycle_stage = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__frame_of_reference, + life_cycle_stage, + ): + application_context_element.__init__( + self, + inherited0__name, + inherited1__frame_of_reference, + ) + self.life_cycle_stage = life_cycle_stage -#################### - # ENTITY bounded_surface_curve # -#################### -class bounded_surface_curve(surface_curve,bounded_curve): - '''Entity bounded_surface_curve definition. - ''' - def __init__( self , inherited0__name , inherited1__curve_3d , inherited2__associated_geometry , inherited3__master_representation , inherited4__name , ): - surface_curve.__init__(self , inherited0__name , inherited1__curve_3d , inherited2__associated_geometry , inherited3__master_representation , ) - bounded_curve.__init__(self , inherited4__name , ) - def wr1(self): - eval_wr1_wr = ('CONFIG_CONTROL_DESIGN.BOUNDED_CURVE' == TYPEOF(self.self.surface_curve.self.curve_3d)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def life_cycle_stage(): + def fget(self): + return self._life_cycle_stage + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument life_cycle_stage is mantatory and can not be set to None" + ) + if not check_type(value, label): + self._life_cycle_stage = label(value) + else: + self._life_cycle_stage = value + + return property(**locals()) #################### - # ENTITY item_defined_transformation # +# ENTITY bounded_surface_curve # +#################### +class bounded_surface_curve(surface_curve, bounded_curve): + """Entity bounded_surface_curve definition.""" + + def __init__( + self, + inherited0__name, + inherited1__curve_3d, + inherited2__associated_geometry, + inherited3__master_representation, + inherited4__name, + ): + surface_curve.__init__( + self, + inherited0__name, + inherited1__curve_3d, + inherited2__associated_geometry, + inherited3__master_representation, + ) + bounded_curve.__init__( + self, + inherited4__name, + ) + + def wr1(self): + eval_wr1_wr = "CONFIG_CONTROL_DESIGN.BOUNDED_CURVE" == TYPEOF( + self.self.surface_curve.self.curve_3d + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + +#################### +# ENTITY item_defined_transformation # #################### class item_defined_transformation(BaseEntityClass): - '''Entity item_defined_transformation definition. + """Entity item_defined_transformation definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param transform_item_1 - :type transform_item_1:representation_item + :param transform_item_1 + :type transform_item_1:representation_item - :param transform_item_2 - :type transform_item_2:representation_item - ''' - def __init__( self , name,description,transform_item_1,transform_item_2, ): - self.name = name - self.description = description - self.transform_item_1 = transform_item_1 - self.transform_item_2 = transform_item_2 + :param transform_item_2 + :type transform_item_2:representation_item + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + transform_item_1, + transform_item_2, + ): + self.name = name + self.description = description + self.transform_item_1 = transform_item_1 + self.transform_item_2 = transform_item_2 - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name - @apply - def transform_item_1(): - def fget( self ): - return self._transform_item_1 - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument transform_item_1 is mantatory and can not be set to None') - if not check_type(value,representation_item): - self._transform_item_1 = representation_item(value) - else: - self._transform_item_1 = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def transform_item_1(): + def fget(self): + return self._transform_item_1 + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument transform_item_1 is mantatory and can not be set to None" + ) + if not check_type(value, representation_item): + self._transform_item_1 = representation_item(value) + else: + self._transform_item_1 = value + + return property(**locals()) + + @apply + def transform_item_2(): + def fget(self): + return self._transform_item_2 + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument transform_item_2 is mantatory and can not be set to None" + ) + if not check_type(value, representation_item): + self._transform_item_2 = representation_item(value) + else: + self._transform_item_2 = value + + return property(**locals()) - @apply - def transform_item_2(): - def fget( self ): - return self._transform_item_2 - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument transform_item_2 is mantatory and can not be set to None') - if not check_type(value,representation_item): - self._transform_item_2 = representation_item(value) - else: - self._transform_item_2 = value - return property(**locals()) #################### - # ENTITY action_method # +# ENTITY action_method # #################### class action_method(BaseEntityClass): - '''Entity action_method definition. + """Entity action_method definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param consequence - :type consequence:text + :param consequence + :type consequence:text - :param purpose - :type purpose:text - ''' - def __init__( self , name,description,consequence,purpose, ): - self.name = name - self.description = description - self.consequence = consequence - self.purpose = purpose + :param purpose + :type purpose:text + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + consequence, + purpose, + ): + self.name = name + self.description = description + self.consequence = consequence + self.purpose = purpose - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name - @apply - def consequence(): - def fget( self ): - return self._consequence - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument consequence is mantatory and can not be set to None') - if not check_type(value,text): - self._consequence = text(value) - else: - self._consequence = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def consequence(): + def fget(self): + return self._consequence + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument consequence is mantatory and can not be set to None") + if not check_type(value, text): + self._consequence = text(value) + else: + self._consequence = value + + return property(**locals()) + + @apply + def purpose(): + def fget(self): + return self._purpose + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument purpose is mantatory and can not be set to None") + if not check_type(value, text): + self._purpose = text(value) + else: + self._purpose = value + + return property(**locals()) - @apply - def purpose(): - def fget( self ): - return self._purpose - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument purpose is mantatory and can not be set to None') - if not check_type(value,text): - self._purpose = text(value) - else: - self._purpose = value - return property(**locals()) #################### - # ENTITY product_category_relationship # +# ENTITY product_category_relationship # #################### class product_category_relationship(BaseEntityClass): - '''Entity product_category_relationship definition. + """Entity product_category_relationship definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param category - :type category:product_category + :param category + :type category:product_category - :param sub_category - :type sub_category:product_category - ''' - def __init__( self , name,description,category,sub_category, ): - self.name = name - self.description = description - self.category = category - self.sub_category = sub_category + :param sub_category + :type sub_category:product_category + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + category, + sub_category, + ): + self.name = name + self.description = description + self.category = category + self.sub_category = sub_category - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name - @apply - def category(): - def fget( self ): - return self._category - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument category is mantatory and can not be set to None') - if not check_type(value,product_category): - self._category = product_category(value) - else: - self._category = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value - @apply - def sub_category(): - def fget( self ): - return self._sub_category - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument sub_category is mantatory and can not be set to None') - if not check_type(value,product_category): - self._sub_category = product_category(value) - else: - self._sub_category = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = acyclic_product_category_relationship(self,[self.self.sub_category]) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def category(): + def fget(self): + return self._category + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument category is mantatory and can not be set to None") + if not check_type(value, product_category): + self._category = product_category(value) + else: + self._category = value + + return property(**locals()) + + @apply + def sub_category(): + def fget(self): + return self._sub_category + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument sub_category is mantatory and can not be set to None" + ) + if not check_type(value, product_category): + self._sub_category = product_category(value) + else: + self._sub_category = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = acyclic_product_category_relationship(self, [self.self.sub_category]) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY plane_angle_measure_with_unit # +# ENTITY plane_angle_measure_with_unit # #################### class plane_angle_measure_with_unit(measure_with_unit): - '''Entity plane_angle_measure_with_unit definition. - ''' - def __init__( self , inherited0__value_component , inherited1__unit_component , ): - measure_with_unit.__init__(self , inherited0__value_component , inherited1__unit_component , ) - def wr1(self): - eval_wr1_wr = ('CONFIG_CONTROL_DESIGN.PLANE_ANGLE_UNIT' == TYPEOF(self.self.measure_with_unit.self.unit_component)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity plane_angle_measure_with_unit definition.""" + + def __init__( + self, + inherited0__value_component, + inherited1__unit_component, + ): + measure_with_unit.__init__( + self, + inherited0__value_component, + inherited1__unit_component, + ) + + def wr1(self): + eval_wr1_wr = "CONFIG_CONTROL_DESIGN.PLANE_ANGLE_UNIT" == TYPEOF( + self.self.measure_with_unit.self.unit_component + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY vertex # +# ENTITY vertex # #################### class vertex(topological_representation_item): - '''Entity vertex definition. - ''' - def __init__( self , inherited0__name , ): - topological_representation_item.__init__(self , inherited0__name , ) + """Entity vertex definition.""" + + def __init__( + self, + inherited0__name, + ): + topological_representation_item.__init__( + self, + inherited0__name, + ) + #################### - # ENTITY representation_map # +# ENTITY representation_map # #################### class representation_map(BaseEntityClass): - '''Entity representation_map definition. + """Entity representation_map definition. - :param mapping_origin - :type mapping_origin:representation_item + :param mapping_origin + :type mapping_origin:representation_item - :param mapped_representation - :type mapped_representation:representation + :param mapped_representation + :type mapped_representation:representation - :param map_usage - :type map_usage:SET(1,None,'mapped_item', scope = schema_scope) - ''' - def __init__( self , mapping_origin,mapped_representation, ): - self.mapping_origin = mapping_origin - self.mapped_representation = mapped_representation + :param map_usage + :type map_usage:SET(1,None,'mapped_item', scope = schema_scope) + """ - @apply - def mapping_origin(): - def fget( self ): - return self._mapping_origin - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument mapping_origin is mantatory and can not be set to None') - if not check_type(value,representation_item): - self._mapping_origin = representation_item(value) - else: - self._mapping_origin = value - return property(**locals()) + def __init__( + self, + mapping_origin, + mapped_representation, + ): + self.mapping_origin = mapping_origin + self.mapped_representation = mapped_representation - @apply - def mapped_representation(): - def fget( self ): - return self._mapped_representation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument mapped_representation is mantatory and can not be set to None') - if not check_type(value,representation): - self._mapped_representation = representation(value) - else: - self._mapped_representation = value - return property(**locals()) + @apply + def mapping_origin(): + def fget(self): + return self._mapping_origin - @apply - def map_usage(): - def fget( self ): - return self._map_usage - def fset( self, value ): - # INVERSE argument - raise AssertionError('Argument map_usage is INVERSE. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = item_in_context(self.self.mapping_origin,self.self.mapped_representation.self.context_of_items) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument mapping_origin is mantatory and can not be set to None" + ) + if not check_type(value, representation_item): + self._mapping_origin = representation_item(value) + else: + self._mapping_origin = value + + return property(**locals()) + + @apply + def mapped_representation(): + def fget(self): + return self._mapped_representation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument mapped_representation is mantatory and can not be set to None" + ) + if not check_type(value, representation): + self._mapped_representation = representation(value) + else: + self._mapped_representation = value + + return property(**locals()) + + @apply + def map_usage(): + def fget(self): + return self._map_usage + + def fset(self, value): + # INVERSE argument + raise AssertionError( + "Argument map_usage is INVERSE. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = item_in_context( + self.self.mapping_origin, self.self.mapped_representation.self.context_of_items + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY product_definition_effectivity # +# ENTITY product_definition_effectivity # #################### class product_definition_effectivity(effectivity): - '''Entity product_definition_effectivity definition. + """Entity product_definition_effectivity definition. - :param usage - :type usage:product_definition_relationship - ''' - def __init__( self , inherited0__id , usage, ): - effectivity.__init__(self , inherited0__id , ) - self.usage = usage + :param usage + :type usage:product_definition_relationship + """ + + def __init__( + self, + inherited0__id, + usage, + ): + effectivity.__init__( + self, + inherited0__id, + ) + self.usage = usage + + @apply + def usage(): + def fget(self): + return self._usage + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument usage is mantatory and can not be set to None") + if not check_type(value, product_definition_relationship): + self._usage = product_definition_relationship(value) + else: + self._usage = value + + return property(**locals()) - @apply - def usage(): - def fget( self ): - return self._usage - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument usage is mantatory and can not be set to None') - if not check_type(value,product_definition_relationship): - self._usage = product_definition_relationship(value) - else: - self._usage = value - return property(**locals()) #################### - # ENTITY configuration_effectivity # +# ENTITY configuration_effectivity # #################### class configuration_effectivity(product_definition_effectivity): - '''Entity configuration_effectivity definition. + """Entity configuration_effectivity definition. - :param configuration - :type configuration:configuration_design - ''' - def __init__( self , inherited0__id , inherited1__usage , configuration, ): - product_definition_effectivity.__init__(self , inherited0__id , inherited1__usage , ) - self.configuration = configuration + :param configuration + :type configuration:configuration_design + """ - @apply - def configuration(): - def fget( self ): - return self._configuration - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument configuration is mantatory and can not be set to None') - if not check_type(value,configuration_design): - self._configuration = configuration_design(value) - else: - self._configuration = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = ('CONFIG_CONTROL_DESIGN.PRODUCT_DEFINITION_USAGE' == TYPEOF(self.self.product_definition_effectivity.self.usage)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__id, + inherited1__usage, + configuration, + ): + product_definition_effectivity.__init__( + self, + inherited0__id, + inherited1__usage, + ) + self.configuration = configuration + + @apply + def configuration(): + def fget(self): + return self._configuration + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument configuration is mantatory and can not be set to None" + ) + if not check_type(value, configuration_design): + self._configuration = configuration_design(value) + else: + self._configuration = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = "CONFIG_CONTROL_DESIGN.PRODUCT_DEFINITION_USAGE" == TYPEOF( + self.self.product_definition_effectivity.self.usage + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY ellipse # +# ENTITY ellipse # #################### class ellipse(conic): - '''Entity ellipse definition. + """Entity ellipse definition. - :param semi_axis_1 - :type semi_axis_1:positive_length_measure + :param semi_axis_1 + :type semi_axis_1:positive_length_measure - :param semi_axis_2 - :type semi_axis_2:positive_length_measure - ''' - def __init__( self , inherited0__name , inherited1__position , semi_axis_1,semi_axis_2, ): - conic.__init__(self , inherited0__name , inherited1__position , ) - self.semi_axis_1 = semi_axis_1 - self.semi_axis_2 = semi_axis_2 + :param semi_axis_2 + :type semi_axis_2:positive_length_measure + """ - @apply - def semi_axis_1(): - def fget( self ): - return self._semi_axis_1 - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument semi_axis_1 is mantatory and can not be set to None') - if not check_type(value,positive_length_measure): - self._semi_axis_1 = positive_length_measure(value) - else: - self._semi_axis_1 = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__position, + semi_axis_1, + semi_axis_2, + ): + conic.__init__( + self, + inherited0__name, + inherited1__position, + ) + self.semi_axis_1 = semi_axis_1 + self.semi_axis_2 = semi_axis_2 + + @apply + def semi_axis_1(): + def fget(self): + return self._semi_axis_1 + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument semi_axis_1 is mantatory and can not be set to None") + if not check_type(value, positive_length_measure): + self._semi_axis_1 = positive_length_measure(value) + else: + self._semi_axis_1 = value + + return property(**locals()) + + @apply + def semi_axis_2(): + def fget(self): + return self._semi_axis_2 + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument semi_axis_2 is mantatory and can not be set to None") + if not check_type(value, positive_length_measure): + self._semi_axis_2 = positive_length_measure(value) + else: + self._semi_axis_2 = value + + return property(**locals()) - @apply - def semi_axis_2(): - def fget( self ): - return self._semi_axis_2 - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument semi_axis_2 is mantatory and can not be set to None') - if not check_type(value,positive_length_measure): - self._semi_axis_2 = positive_length_measure(value) - else: - self._semi_axis_2 = value - return property(**locals()) #################### - # ENTITY context_dependent_unit # +# ENTITY context_dependent_unit # #################### class context_dependent_unit(named_unit): - '''Entity context_dependent_unit definition. + """Entity context_dependent_unit definition. - :param name - :type name:label - ''' - def __init__( self , inherited0__dimensions , name, ): - named_unit.__init__(self , inherited0__dimensions , ) - self.name = name + :param name + :type name:label + """ + + def __init__( + self, + inherited0__dimensions, + name, + ): + named_unit.__init__( + self, + inherited0__dimensions, + ) + self.name = name + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) #################### - # ENTITY alternate_product_relationship # +# ENTITY alternate_product_relationship # #################### class alternate_product_relationship(BaseEntityClass): - '''Entity alternate_product_relationship definition. + """Entity alternate_product_relationship definition. - :param name - :type name:label + :param name + :type name:label - :param definition - :type definition:text + :param definition + :type definition:text - :param alternate - :type alternate:product + :param alternate + :type alternate:product - :param base - :type base:product + :param base + :type base:product - :param basis - :type basis:text - ''' - def __init__( self , name,definition,alternate,base,basis, ): - self.name = name - self.definition = definition - self.alternate = alternate - self.base = base - self.basis = basis + :param basis + :type basis:text + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + definition, + alternate, + base, + basis, + ): + self.name = name + self.definition = definition + self.alternate = alternate + self.base = base + self.basis = basis - @apply - def definition(): - def fget( self ): - return self._definition - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument definition is mantatory and can not be set to None') - if not check_type(value,text): - self._definition = text(value) - else: - self._definition = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name - @apply - def alternate(): - def fget( self ): - return self._alternate - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument alternate is mantatory and can not be set to None') - if not check_type(value,product): - self._alternate = product(value) - else: - self._alternate = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value - @apply - def base(): - def fget( self ): - return self._base - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument base is mantatory and can not be set to None') - if not check_type(value,product): - self._base = product(value) - else: - self._base = value - return property(**locals()) + return property(**locals()) - @apply - def basis(): - def fget( self ): - return self._basis - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument basis is mantatory and can not be set to None') - if not check_type(value,text): - self._basis = text(value) - else: - self._basis = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.alternate != self.base) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def definition(): + def fget(self): + return self._definition + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument definition is mantatory and can not be set to None") + if not check_type(value, text): + self._definition = text(value) + else: + self._definition = value + + return property(**locals()) + + @apply + def alternate(): + def fget(self): + return self._alternate + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument alternate is mantatory and can not be set to None") + if not check_type(value, product): + self._alternate = product(value) + else: + self._alternate = value + + return property(**locals()) + + @apply + def base(): + def fget(self): + return self._base + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument base is mantatory and can not be set to None") + if not check_type(value, product): + self._base = product(value) + else: + self._base = value + + return property(**locals()) + + @apply + def basis(): + def fget(self): + return self._basis + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument basis is mantatory and can not be set to None") + if not check_type(value, text): + self._basis = text(value) + else: + self._basis = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.alternate != self.base + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY document_type # +# ENTITY document_type # #################### class document_type(BaseEntityClass): - '''Entity document_type definition. + """Entity document_type definition. - :param product_data_type - :type product_data_type:label - ''' - def __init__( self , product_data_type, ): - self.product_data_type = product_data_type + :param product_data_type + :type product_data_type:label + """ + + def __init__( + self, + product_data_type, + ): + self.product_data_type = product_data_type + + @apply + def product_data_type(): + def fget(self): + return self._product_data_type + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument product_data_type is mantatory and can not be set to None" + ) + if not check_type(value, label): + self._product_data_type = label(value) + else: + self._product_data_type = value + + return property(**locals()) - @apply - def product_data_type(): - def fget( self ): - return self._product_data_type - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument product_data_type is mantatory and can not be set to None') - if not check_type(value,label): - self._product_data_type = label(value) - else: - self._product_data_type = value - return property(**locals()) #################### - # ENTITY document_reference # +# ENTITY document_reference # #################### class document_reference(BaseEntityClass): - '''Entity document_reference definition. + """Entity document_reference definition. - :param assigned_document - :type assigned_document:document + :param assigned_document + :type assigned_document:document - :param source - :type source:label - ''' - def __init__( self , assigned_document,source, ): - self.assigned_document = assigned_document - self.source = source + :param source + :type source:label + """ - @apply - def assigned_document(): - def fget( self ): - return self._assigned_document - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument assigned_document is mantatory and can not be set to None') - if not check_type(value,document): - self._assigned_document = document(value) - else: - self._assigned_document = value - return property(**locals()) + def __init__( + self, + assigned_document, + source, + ): + self.assigned_document = assigned_document + self.source = source + + @apply + def assigned_document(): + def fget(self): + return self._assigned_document + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument assigned_document is mantatory and can not be set to None" + ) + if not check_type(value, document): + self._assigned_document = document(value) + else: + self._assigned_document = value + + return property(**locals()) + + @apply + def source(): + def fget(self): + return self._source + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument source is mantatory and can not be set to None") + if not check_type(value, label): + self._source = label(value) + else: + self._source = value + + return property(**locals()) - @apply - def source(): - def fget( self ): - return self._source - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument source is mantatory and can not be set to None') - if not check_type(value,label): - self._source = label(value) - else: - self._source = value - return property(**locals()) #################### - # ENTITY mechanical_context # +# ENTITY mechanical_context # #################### class mechanical_context(product_context): - '''Entity mechanical_context definition. - ''' - def __init__( self , inherited0__name , inherited1__frame_of_reference , inherited2__discipline_type , ): - product_context.__init__(self , inherited0__name , inherited1__frame_of_reference , inherited2__discipline_type , ) - def wr1(self): - eval_wr1_wr = (self.self.discipline_type == 'mechanical') - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity mechanical_context definition.""" + + def __init__( + self, + inherited0__name, + inherited1__frame_of_reference, + inherited2__discipline_type, + ): + product_context.__init__( + self, + inherited0__name, + inherited1__frame_of_reference, + inherited2__discipline_type, + ) + + def wr1(self): + eval_wr1_wr = self.self.discipline_type == "mechanical" + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY shell_based_wireframe_model # +# ENTITY shell_based_wireframe_model # #################### class shell_based_wireframe_model(geometric_representation_item): - '''Entity shell_based_wireframe_model definition. + """Entity shell_based_wireframe_model definition. - :param sbwm_boundary - :type sbwm_boundary:SET(1,None,'shell', scope = schema_scope) - ''' - def __init__( self , inherited0__name , sbwm_boundary, ): - geometric_representation_item.__init__(self , inherited0__name , ) - self.sbwm_boundary = sbwm_boundary + :param sbwm_boundary + :type sbwm_boundary:SET(1,None,'shell', scope = schema_scope) + """ - @apply - def sbwm_boundary(): - def fget( self ): - return self._sbwm_boundary - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument sbwm_boundary is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'shell', scope = schema_scope)): - self._sbwm_boundary = SET(value) - else: - self._sbwm_boundary = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = constraints_geometry_shell_based_wireframe_model(self) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__name, + sbwm_boundary, + ): + geometric_representation_item.__init__( + self, + inherited0__name, + ) + self.sbwm_boundary = sbwm_boundary + + @apply + def sbwm_boundary(): + def fget(self): + return self._sbwm_boundary + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument sbwm_boundary is mantatory and can not be set to None" + ) + if not check_type(value, SET(1, None, "shell", scope=schema_scope)): + self._sbwm_boundary = SET(value) + else: + self._sbwm_boundary = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = constraints_geometry_shell_based_wireframe_model(self) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY contract # +# ENTITY contract # #################### class contract(BaseEntityClass): - '''Entity contract definition. + """Entity contract definition. - :param name - :type name:label + :param name + :type name:label - :param purpose - :type purpose:text + :param purpose + :type purpose:text - :param kind - :type kind:contract_type - ''' - def __init__( self , name,purpose,kind, ): - self.name = name - self.purpose = purpose - self.kind = kind + :param kind + :type kind:contract_type + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + purpose, + kind, + ): + self.name = name + self.purpose = purpose + self.kind = kind - @apply - def purpose(): - def fget( self ): - return self._purpose - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument purpose is mantatory and can not be set to None') - if not check_type(value,text): - self._purpose = text(value) - else: - self._purpose = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def purpose(): + def fget(self): + return self._purpose + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument purpose is mantatory and can not be set to None") + if not check_type(value, text): + self._purpose = text(value) + else: + self._purpose = value + + return property(**locals()) + + @apply + def kind(): + def fget(self): + return self._kind + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument kind is mantatory and can not be set to None") + if not check_type(value, contract_type): + self._kind = contract_type(value) + else: + self._kind = value + + return property(**locals()) - @apply - def kind(): - def fget( self ): - return self._kind - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument kind is mantatory and can not be set to None') - if not check_type(value,contract_type): - self._kind = contract_type(value) - else: - self._kind = value - return property(**locals()) #################### - # ENTITY dimensional_exponents # +# ENTITY dimensional_exponents # #################### class dimensional_exponents(BaseEntityClass): - '''Entity dimensional_exponents definition. + """Entity dimensional_exponents definition. - :param length_exponent - :type length_exponent:REAL + :param length_exponent + :type length_exponent:REAL - :param mass_exponent - :type mass_exponent:REAL + :param mass_exponent + :type mass_exponent:REAL - :param time_exponent - :type time_exponent:REAL + :param time_exponent + :type time_exponent:REAL - :param electric_current_exponent - :type electric_current_exponent:REAL + :param electric_current_exponent + :type electric_current_exponent:REAL - :param thermodynamic_temperature_exponent - :type thermodynamic_temperature_exponent:REAL + :param thermodynamic_temperature_exponent + :type thermodynamic_temperature_exponent:REAL - :param amount_of_substance_exponent - :type amount_of_substance_exponent:REAL + :param amount_of_substance_exponent + :type amount_of_substance_exponent:REAL - :param luminous_intensity_exponent - :type luminous_intensity_exponent:REAL - ''' - def __init__( self , length_exponent,mass_exponent,time_exponent,electric_current_exponent,thermodynamic_temperature_exponent,amount_of_substance_exponent,luminous_intensity_exponent, ): - self.length_exponent = length_exponent - self.mass_exponent = mass_exponent - self.time_exponent = time_exponent - self.electric_current_exponent = electric_current_exponent - self.thermodynamic_temperature_exponent = thermodynamic_temperature_exponent - self.amount_of_substance_exponent = amount_of_substance_exponent - self.luminous_intensity_exponent = luminous_intensity_exponent + :param luminous_intensity_exponent + :type luminous_intensity_exponent:REAL + """ - @apply - def length_exponent(): - def fget( self ): - return self._length_exponent - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument length_exponent is mantatory and can not be set to None') - if not check_type(value,REAL): - self._length_exponent = REAL(value) - else: - self._length_exponent = value - return property(**locals()) + def __init__( + self, + length_exponent, + mass_exponent, + time_exponent, + electric_current_exponent, + thermodynamic_temperature_exponent, + amount_of_substance_exponent, + luminous_intensity_exponent, + ): + self.length_exponent = length_exponent + self.mass_exponent = mass_exponent + self.time_exponent = time_exponent + self.electric_current_exponent = electric_current_exponent + self.thermodynamic_temperature_exponent = thermodynamic_temperature_exponent + self.amount_of_substance_exponent = amount_of_substance_exponent + self.luminous_intensity_exponent = luminous_intensity_exponent - @apply - def mass_exponent(): - def fget( self ): - return self._mass_exponent - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument mass_exponent is mantatory and can not be set to None') - if not check_type(value,REAL): - self._mass_exponent = REAL(value) - else: - self._mass_exponent = value - return property(**locals()) + @apply + def length_exponent(): + def fget(self): + return self._length_exponent - @apply - def time_exponent(): - def fget( self ): - return self._time_exponent - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument time_exponent is mantatory and can not be set to None') - if not check_type(value,REAL): - self._time_exponent = REAL(value) - else: - self._time_exponent = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument length_exponent is mantatory and can not be set to None" + ) + if not check_type(value, REAL): + self._length_exponent = REAL(value) + else: + self._length_exponent = value - @apply - def electric_current_exponent(): - def fget( self ): - return self._electric_current_exponent - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument electric_current_exponent is mantatory and can not be set to None') - if not check_type(value,REAL): - self._electric_current_exponent = REAL(value) - else: - self._electric_current_exponent = value - return property(**locals()) + return property(**locals()) - @apply - def thermodynamic_temperature_exponent(): - def fget( self ): - return self._thermodynamic_temperature_exponent - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument thermodynamic_temperature_exponent is mantatory and can not be set to None') - if not check_type(value,REAL): - self._thermodynamic_temperature_exponent = REAL(value) - else: - self._thermodynamic_temperature_exponent = value - return property(**locals()) + @apply + def mass_exponent(): + def fget(self): + return self._mass_exponent - @apply - def amount_of_substance_exponent(): - def fget( self ): - return self._amount_of_substance_exponent - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument amount_of_substance_exponent is mantatory and can not be set to None') - if not check_type(value,REAL): - self._amount_of_substance_exponent = REAL(value) - else: - self._amount_of_substance_exponent = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument mass_exponent is mantatory and can not be set to None" + ) + if not check_type(value, REAL): + self._mass_exponent = REAL(value) + else: + self._mass_exponent = value + + return property(**locals()) + + @apply + def time_exponent(): + def fget(self): + return self._time_exponent + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument time_exponent is mantatory and can not be set to None" + ) + if not check_type(value, REAL): + self._time_exponent = REAL(value) + else: + self._time_exponent = value + + return property(**locals()) + + @apply + def electric_current_exponent(): + def fget(self): + return self._electric_current_exponent + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument electric_current_exponent is mantatory and can not be set to None" + ) + if not check_type(value, REAL): + self._electric_current_exponent = REAL(value) + else: + self._electric_current_exponent = value + + return property(**locals()) + + @apply + def thermodynamic_temperature_exponent(): + def fget(self): + return self._thermodynamic_temperature_exponent + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument thermodynamic_temperature_exponent is mantatory and can not be set to None" + ) + if not check_type(value, REAL): + self._thermodynamic_temperature_exponent = REAL(value) + else: + self._thermodynamic_temperature_exponent = value + + return property(**locals()) + + @apply + def amount_of_substance_exponent(): + def fget(self): + return self._amount_of_substance_exponent + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument amount_of_substance_exponent is mantatory and can not be set to None" + ) + if not check_type(value, REAL): + self._amount_of_substance_exponent = REAL(value) + else: + self._amount_of_substance_exponent = value + + return property(**locals()) + + @apply + def luminous_intensity_exponent(): + def fget(self): + return self._luminous_intensity_exponent + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument luminous_intensity_exponent is mantatory and can not be set to None" + ) + if not check_type(value, REAL): + self._luminous_intensity_exponent = REAL(value) + else: + self._luminous_intensity_exponent = value + + return property(**locals()) - @apply - def luminous_intensity_exponent(): - def fget( self ): - return self._luminous_intensity_exponent - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument luminous_intensity_exponent is mantatory and can not be set to None') - if not check_type(value,REAL): - self._luminous_intensity_exponent = REAL(value) - else: - self._luminous_intensity_exponent = value - return property(**locals()) #################### - # ENTITY start_request # +# ENTITY start_request # #################### class start_request(action_request_assignment): - '''Entity start_request definition. + """Entity start_request definition. - :param items - :type items:SET(1,None,'start_request_item', scope = schema_scope) - ''' - def __init__( self , inherited0__assigned_action_request , items, ): - action_request_assignment.__init__(self , inherited0__assigned_action_request , ) - self.items = items + :param items + :type items:SET(1,None,'start_request_item', scope = schema_scope) + """ + + def __init__( + self, + inherited0__assigned_action_request, + items, + ): + action_request_assignment.__init__( + self, + inherited0__assigned_action_request, + ) + self.items = items + + @apply + def items(): + def fget(self): + return self._items + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument items is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "start_request_item", scope=schema_scope)): + self._items = SET(value) + else: + self._items = value + + return property(**locals()) - @apply - def items(): - def fget( self ): - return self._items - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument items is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'start_request_item', scope = schema_scope)): - self._items = SET(value) - else: - self._items = value - return property(**locals()) #################### - # ENTITY cc_design_specification_reference # +# ENTITY cc_design_specification_reference # #################### class cc_design_specification_reference(document_reference): - '''Entity cc_design_specification_reference definition. + """Entity cc_design_specification_reference definition. - :param items - :type items:SET(1,None,'specified_item', scope = schema_scope) - ''' - def __init__( self , inherited0__assigned_document , inherited1__source , items, ): - document_reference.__init__(self , inherited0__assigned_document , inherited1__source , ) - self.items = items + :param items + :type items:SET(1,None,'specified_item', scope = schema_scope) + """ + + def __init__( + self, + inherited0__assigned_document, + inherited1__source, + items, + ): + document_reference.__init__( + self, + inherited0__assigned_document, + inherited1__source, + ) + self.items = items + + @apply + def items(): + def fget(self): + return self._items + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument items is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "specified_item", scope=schema_scope)): + self._items = SET(value) + else: + self._items = value + + return property(**locals()) - @apply - def items(): - def fget( self ): - return self._items - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument items is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'specified_item', scope = schema_scope)): - self._items = SET(value) - else: - self._items = value - return property(**locals()) #################### - # ENTITY supplied_part_relationship # +# ENTITY supplied_part_relationship # #################### class supplied_part_relationship(product_definition_relationship): - '''Entity supplied_part_relationship definition. - ''' - def __init__( self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , ): - product_definition_relationship.__init__(self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , ) + """Entity supplied_part_relationship definition.""" + + def __init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + ): + product_definition_relationship.__init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + ) + #################### - # ENTITY context_dependent_shape_representation # +# ENTITY context_dependent_shape_representation # #################### class context_dependent_shape_representation(BaseEntityClass): - '''Entity context_dependent_shape_representation definition. + """Entity context_dependent_shape_representation definition. - :param representation_relation - :type representation_relation:shape_representation_relationship + :param representation_relation + :type representation_relation:shape_representation_relationship - :param represented_product_relation - :type represented_product_relation:product_definition_shape - ''' - def __init__( self , representation_relation,represented_product_relation, ): - self.representation_relation = representation_relation - self.represented_product_relation = represented_product_relation + :param represented_product_relation + :type represented_product_relation:product_definition_shape + """ - @apply - def representation_relation(): - def fget( self ): - return self._representation_relation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument representation_relation is mantatory and can not be set to None') - if not check_type(value,shape_representation_relationship): - self._representation_relation = shape_representation_relationship(value) - else: - self._representation_relation = value - return property(**locals()) + def __init__( + self, + representation_relation, + represented_product_relation, + ): + self.representation_relation = representation_relation + self.represented_product_relation = represented_product_relation - @apply - def represented_product_relation(): - def fget( self ): - return self._represented_product_relation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument represented_product_relation is mantatory and can not be set to None') - if not check_type(value,product_definition_shape): - self._represented_product_relation = product_definition_shape(value) - else: - self._represented_product_relation = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = ('CONFIG_CONTROL_DESIGN.PRODUCT_DEFINITION_RELATIONSHIP' == TYPEOF(self.self.represented_product_relation.self.definition)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def representation_relation(): + def fget(self): + return self._representation_relation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument representation_relation is mantatory and can not be set to None" + ) + if not check_type(value, shape_representation_relationship): + self._representation_relation = shape_representation_relationship(value) + else: + self._representation_relation = value + + return property(**locals()) + + @apply + def represented_product_relation(): + def fget(self): + return self._represented_product_relation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument represented_product_relation is mantatory and can not be set to None" + ) + if not check_type(value, product_definition_shape): + self._represented_product_relation = product_definition_shape(value) + else: + self._represented_product_relation = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = "CONFIG_CONTROL_DESIGN.PRODUCT_DEFINITION_RELATIONSHIP" == TYPEOF( + self.self.represented_product_relation.self.definition + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY degenerate_toroidal_surface # +# ENTITY degenerate_toroidal_surface # #################### class degenerate_toroidal_surface(toroidal_surface): - '''Entity degenerate_toroidal_surface definition. + """Entity degenerate_toroidal_surface definition. - :param select_outer - :type select_outer:BOOLEAN - ''' - def __init__( self , inherited0__name , inherited1__position , inherited2__major_radius , inherited3__minor_radius , select_outer, ): - toroidal_surface.__init__(self , inherited0__name , inherited1__position , inherited2__major_radius , inherited3__minor_radius , ) - self.select_outer = select_outer + :param select_outer + :type select_outer:BOOLEAN + """ - @apply - def select_outer(): - def fget( self ): - return self._select_outer - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument select_outer is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._select_outer = BOOLEAN(value) - else: - self._select_outer = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.major_radius < self.minor_radius) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__name, + inherited1__position, + inherited2__major_radius, + inherited3__minor_radius, + select_outer, + ): + toroidal_surface.__init__( + self, + inherited0__name, + inherited1__position, + inherited2__major_radius, + inherited3__minor_radius, + ) + self.select_outer = select_outer + + @apply + def select_outer(): + def fget(self): + return self._select_outer + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument select_outer is mantatory and can not be set to None" + ) + if not check_type(value, BOOLEAN): + self._select_outer = BOOLEAN(value) + else: + self._select_outer = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.major_radius < self.minor_radius + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY ordinal_date # +# ENTITY ordinal_date # #################### class ordinal_date(date): - '''Entity ordinal_date definition. + """Entity ordinal_date definition. - :param day_component - :type day_component:day_in_year_number - ''' - def __init__( self , inherited0__year_component , day_component, ): - date.__init__(self , inherited0__year_component , ) - self.day_component = day_component + :param day_component + :type day_component:day_in_year_number + """ - @apply - def day_component(): - def fget( self ): - return self._day_component - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument day_component is mantatory and can not be set to None') - if not check_type(value,day_in_year_number): - self._day_component = day_in_year_number(value) - else: - self._day_component = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (((( not leap_year(self.self.year_component)) and (1 <= self.day_component)) and (self.day_component <= 365)) or ((leap_year(self.self.year_component) and (1 <= self.day_component)) and (self.day_component <= 366))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__year_component, + day_component, + ): + date.__init__( + self, + inherited0__year_component, + ) + self.day_component = day_component + + @apply + def day_component(): + def fget(self): + return self._day_component + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument day_component is mantatory and can not be set to None" + ) + if not check_type(value, day_in_year_number): + self._day_component = day_in_year_number(value) + else: + self._day_component = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = ( + ((not leap_year(self.self.year_component)) and (1 <= self.day_component)) + and (self.day_component <= 365) + ) or ( + (leap_year(self.self.year_component) and (1 <= self.day_component)) + and (self.day_component <= 366) + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY face_outer_bound # +# ENTITY face_outer_bound # #################### class face_outer_bound(face_bound): - '''Entity face_outer_bound definition. - ''' - def __init__( self , inherited0__name , inherited1__bound , inherited2__orientation , ): - face_bound.__init__(self , inherited0__name , inherited1__bound , inherited2__orientation , ) + """Entity face_outer_bound definition.""" + + def __init__( + self, + inherited0__name, + inherited1__bound, + inherited2__orientation, + ): + face_bound.__init__( + self, + inherited0__name, + inherited1__bound, + inherited2__orientation, + ) + #################### - # ENTITY mass_measure_with_unit # +# ENTITY mass_measure_with_unit # #################### class mass_measure_with_unit(measure_with_unit): - '''Entity mass_measure_with_unit definition. - ''' - def __init__( self , inherited0__value_component , inherited1__unit_component , ): - measure_with_unit.__init__(self , inherited0__value_component , inherited1__unit_component , ) - def wr1(self): - eval_wr1_wr = ('CONFIG_CONTROL_DESIGN.MASS_UNIT' == TYPEOF(self.self.measure_with_unit.self.unit_component)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity mass_measure_with_unit definition.""" + + def __init__( + self, + inherited0__value_component, + inherited1__unit_component, + ): + measure_with_unit.__init__( + self, + inherited0__value_component, + inherited1__unit_component, + ) + + def wr1(self): + eval_wr1_wr = "CONFIG_CONTROL_DESIGN.MASS_UNIT" == TYPEOF( + self.self.measure_with_unit.self.unit_component + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY brep_with_voids # +# ENTITY brep_with_voids # #################### class brep_with_voids(manifold_solid_brep): - '''Entity brep_with_voids definition. + """Entity brep_with_voids definition. - :param voids - :type voids:SET(1,None,'oriented_closed_shell', scope = schema_scope) - ''' - def __init__( self , inherited0__name , inherited1__outer , voids, ): - manifold_solid_brep.__init__(self , inherited0__name , inherited1__outer , ) - self.voids = voids + :param voids + :type voids:SET(1,None,'oriented_closed_shell', scope = schema_scope) + """ + + def __init__( + self, + inherited0__name, + inherited1__outer, + voids, + ): + manifold_solid_brep.__init__( + self, + inherited0__name, + inherited1__outer, + ) + self.voids = voids + + @apply + def voids(): + def fget(self): + return self._voids + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument voids is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "oriented_closed_shell", scope=schema_scope)): + self._voids = SET(value) + else: + self._voids = value + + return property(**locals()) - @apply - def voids(): - def fget( self ): - return self._voids - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument voids is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'oriented_closed_shell', scope = schema_scope)): - self._voids = SET(value) - else: - self._voids = value - return property(**locals()) #################### - # ENTITY week_of_year_and_day_date # +# ENTITY week_of_year_and_day_date # #################### class week_of_year_and_day_date(date): - '''Entity week_of_year_and_day_date definition. + """Entity week_of_year_and_day_date definition. - :param week_component - :type week_component:week_in_year_number + :param week_component + :type week_component:week_in_year_number - :param day_component - :type day_component:day_in_week_number - ''' - def __init__( self , inherited0__year_component , week_component,day_component, ): - date.__init__(self , inherited0__year_component , ) - self.week_component = week_component - self.day_component = day_component + :param day_component + :type day_component:day_in_week_number + """ - @apply - def week_component(): - def fget( self ): - return self._week_component - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument week_component is mantatory and can not be set to None') - if not check_type(value,week_in_year_number): - self._week_component = week_in_year_number(value) - else: - self._week_component = value - return property(**locals()) + def __init__( + self, + inherited0__year_component, + week_component, + day_component, + ): + date.__init__( + self, + inherited0__year_component, + ) + self.week_component = week_component + self.day_component = day_component + + @apply + def week_component(): + def fget(self): + return self._week_component + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument week_component is mantatory and can not be set to None" + ) + if not check_type(value, week_in_year_number): + self._week_component = week_in_year_number(value) + else: + self._week_component = value + + return property(**locals()) + + @apply + def day_component(): + def fget(self): + return self._day_component + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, day_in_week_number): + self._day_component = day_in_week_number(value) + else: + self._day_component = value + else: + self._day_component = value + + return property(**locals()) - @apply - def day_component(): - def fget( self ): - return self._day_component - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,day_in_week_number): - self._day_component = day_in_week_number(value) - else: - self._day_component = value - else: - self._day_component = value - return property(**locals()) #################### - # ENTITY point_on_curve # +# ENTITY point_on_curve # #################### class point_on_curve(point): - '''Entity point_on_curve definition. + """Entity point_on_curve definition. - :param basis_curve - :type basis_curve:curve + :param basis_curve + :type basis_curve:curve - :param point_parameter - :type point_parameter:parameter_value - ''' - def __init__( self , inherited0__name , basis_curve,point_parameter, ): - point.__init__(self , inherited0__name , ) - self.basis_curve = basis_curve - self.point_parameter = point_parameter + :param point_parameter + :type point_parameter:parameter_value + """ - @apply - def basis_curve(): - def fget( self ): - return self._basis_curve - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument basis_curve is mantatory and can not be set to None') - if not check_type(value,curve): - self._basis_curve = curve(value) - else: - self._basis_curve = value - return property(**locals()) + def __init__( + self, + inherited0__name, + basis_curve, + point_parameter, + ): + point.__init__( + self, + inherited0__name, + ) + self.basis_curve = basis_curve + self.point_parameter = point_parameter + + @apply + def basis_curve(): + def fget(self): + return self._basis_curve + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument basis_curve is mantatory and can not be set to None") + if not check_type(value, curve): + self._basis_curve = curve(value) + else: + self._basis_curve = value + + return property(**locals()) + + @apply + def point_parameter(): + def fget(self): + return self._point_parameter + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument point_parameter is mantatory and can not be set to None" + ) + if not check_type(value, parameter_value): + self._point_parameter = parameter_value(value) + else: + self._point_parameter = value + + return property(**locals()) - @apply - def point_parameter(): - def fget( self ): - return self._point_parameter - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument point_parameter is mantatory and can not be set to None') - if not check_type(value,parameter_value): - self._point_parameter = parameter_value(value) - else: - self._point_parameter = value - return property(**locals()) #################### - # ENTITY shell_based_wireframe_shape_representation # +# ENTITY shell_based_wireframe_shape_representation # #################### class shell_based_wireframe_shape_representation(shape_representation): - '''Entity shell_based_wireframe_shape_representation definition. - ''' - def __init__( self , inherited0__name , inherited1__items , inherited2__context_of_items , ): - shape_representation.__init__(self , inherited0__name , inherited1__items , inherited2__context_of_items , ) - def wr1(self): - eval_wr1_wr = (SIZEOF(None) == 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity shell_based_wireframe_shape_representation definition.""" - def wr2(self): - eval_wr2_wr = (SIZEOF(None) >= 1) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def __init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ): + shape_representation.__init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ) - def wr3(self): - eval_wr3_wr = (SIZEOF(None) == 0) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + def wr1(self): + eval_wr1_wr = SIZEOF(None) == 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr4(self): - eval_wr4_wr = (SIZEOF(None) == 0) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + def wr2(self): + eval_wr2_wr = SIZEOF(None) >= 1 + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr - def wr5(self): - eval_wr5_wr = (SIZEOF(None) == 0) - if not eval_wr5_wr: - raise AssertionError('Rule wr5 violated') - else: - return eval_wr5_wr + def wr3(self): + eval_wr3_wr = SIZEOF(None) == 0 + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr - def wr6(self): - eval_wr6_wr = (SIZEOF(None) == 0) - if not eval_wr6_wr: - raise AssertionError('Rule wr6 violated') - else: - return eval_wr6_wr + def wr4(self): + eval_wr4_wr = SIZEOF(None) == 0 + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr - def wr7(self): - eval_wr7_wr = (SIZEOF(None) == 0) - if not eval_wr7_wr: - raise AssertionError('Rule wr7 violated') - else: - return eval_wr7_wr + def wr5(self): + eval_wr5_wr = SIZEOF(None) == 0 + if not eval_wr5_wr: + raise AssertionError("Rule wr5 violated") + else: + return eval_wr5_wr - def wr8(self): - eval_wr8_wr = (SIZEOF(None) == 0) - if not eval_wr8_wr: - raise AssertionError('Rule wr8 violated') - else: - return eval_wr8_wr + def wr6(self): + eval_wr6_wr = SIZEOF(None) == 0 + if not eval_wr6_wr: + raise AssertionError("Rule wr6 violated") + else: + return eval_wr6_wr - def wr9(self): - eval_wr9_wr = (SIZEOF(None) == 0) - if not eval_wr9_wr: - raise AssertionError('Rule wr9 violated') - else: - return eval_wr9_wr + def wr7(self): + eval_wr7_wr = SIZEOF(None) == 0 + if not eval_wr7_wr: + raise AssertionError("Rule wr7 violated") + else: + return eval_wr7_wr - def wr10(self): - eval_wr10_wr = (SIZEOF(None) == 0) - if not eval_wr10_wr: - raise AssertionError('Rule wr10 violated') - else: - return eval_wr10_wr + def wr8(self): + eval_wr8_wr = SIZEOF(None) == 0 + if not eval_wr8_wr: + raise AssertionError("Rule wr8 violated") + else: + return eval_wr8_wr - def wr11(self): - eval_wr11_wr = (SIZEOF(None) == 0) - if not eval_wr11_wr: - raise AssertionError('Rule wr11 violated') - else: - return eval_wr11_wr + def wr9(self): + eval_wr9_wr = SIZEOF(None) == 0 + if not eval_wr9_wr: + raise AssertionError("Rule wr9 violated") + else: + return eval_wr9_wr - def wr12(self): - eval_wr12_wr = (SIZEOF(None) == 0) - if not eval_wr12_wr: - raise AssertionError('Rule wr12 violated') - else: - return eval_wr12_wr + def wr10(self): + eval_wr10_wr = SIZEOF(None) == 0 + if not eval_wr10_wr: + raise AssertionError("Rule wr10 violated") + else: + return eval_wr10_wr - def wr13(self): - eval_wr13_wr = (self.self.context_of_items.self.geometric_representation_context.self.coordinate_space_dimension == 3) - if not eval_wr13_wr: - raise AssertionError('Rule wr13 violated') - else: - return eval_wr13_wr + def wr11(self): + eval_wr11_wr = SIZEOF(None) == 0 + if not eval_wr11_wr: + raise AssertionError("Rule wr11 violated") + else: + return eval_wr11_wr + + def wr12(self): + eval_wr12_wr = SIZEOF(None) == 0 + if not eval_wr12_wr: + raise AssertionError("Rule wr12 violated") + else: + return eval_wr12_wr + + def wr13(self): + eval_wr13_wr = ( + self.self.context_of_items.self.geometric_representation_context.self.coordinate_space_dimension + == 3 + ) + if not eval_wr13_wr: + raise AssertionError("Rule wr13 violated") + else: + return eval_wr13_wr #################### - # ENTITY face # +# ENTITY face # #################### class face(topological_representation_item): - '''Entity face definition. + """Entity face definition. - :param bounds - :type bounds:SET(1,None,'face_bound', scope = schema_scope) - ''' - def __init__( self , inherited0__name , bounds, ): - topological_representation_item.__init__(self , inherited0__name , ) - self.bounds = bounds + :param bounds + :type bounds:SET(1,None,'face_bound', scope = schema_scope) + """ - @apply - def bounds(): - def fget( self ): - return self._bounds - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument bounds is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'face_bound', scope = schema_scope)): - self._bounds = SET(value) - else: - self._bounds = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = ( not mixed_loop_type_set(list_to_set(list_face_loops(self)))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__name, + bounds, + ): + topological_representation_item.__init__( + self, + inherited0__name, + ) + self.bounds = bounds - def wr2(self): - eval_wr2_wr = (SIZEOF(None) <= 1) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + @apply + def bounds(): + def fget(self): + return self._bounds + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument bounds is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "face_bound", scope=schema_scope)): + self._bounds = SET(value) + else: + self._bounds = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = not mixed_loop_type_set(list_to_set(list_face_loops(self))) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = SIZEOF(None) <= 1 + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr #################### - # ENTITY face_surface # +# ENTITY face_surface # #################### -class face_surface(face,geometric_representation_item): - '''Entity face_surface definition. +class face_surface(face, geometric_representation_item): + """Entity face_surface definition. - :param face_geometry - :type face_geometry:surface + :param face_geometry + :type face_geometry:surface - :param same_sense - :type same_sense:BOOLEAN - ''' - def __init__( self , inherited0__name , inherited1__bounds , inherited2__name , face_geometry,same_sense, ): - face.__init__(self , inherited0__name , inherited1__bounds , ) - geometric_representation_item.__init__(self , inherited2__name , ) - self.face_geometry = face_geometry - self.same_sense = same_sense + :param same_sense + :type same_sense:BOOLEAN + """ - @apply - def face_geometry(): - def fget( self ): - return self._face_geometry - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument face_geometry is mantatory and can not be set to None') - if not check_type(value,surface): - self._face_geometry = surface(value) - else: - self._face_geometry = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__bounds, + inherited2__name, + face_geometry, + same_sense, + ): + face.__init__( + self, + inherited0__name, + inherited1__bounds, + ) + geometric_representation_item.__init__( + self, + inherited2__name, + ) + self.face_geometry = face_geometry + self.same_sense = same_sense + + @apply + def face_geometry(): + def fget(self): + return self._face_geometry + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument face_geometry is mantatory and can not be set to None" + ) + if not check_type(value, surface): + self._face_geometry = surface(value) + else: + self._face_geometry = value + + return property(**locals()) + + @apply + def same_sense(): + def fget(self): + return self._same_sense + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument same_sense is mantatory and can not be set to None") + if not check_type(value, BOOLEAN): + self._same_sense = BOOLEAN(value) + else: + self._same_sense = value + + return property(**locals()) - @apply - def same_sense(): - def fget( self ): - return self._same_sense - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument same_sense is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._same_sense = BOOLEAN(value) - else: - self._same_sense = value - return property(**locals()) #################### - # ENTITY oriented_face # +# ENTITY oriented_face # #################### class oriented_face(face): - '''Entity oriented_face definition. + """Entity oriented_face definition. - :param face_element - :type face_element:face + :param face_element + :type face_element:face - :param orientation - :type orientation:BOOLEAN + :param orientation + :type orientation:BOOLEAN - :param face_bounds - :type face_bounds:SET(1,None,'face_bound', scope = schema_scope) - ''' - def __init__( self , inherited0__name , inherited1__bounds , face_element,orientation, ): - face.__init__(self , inherited0__name , inherited1__bounds , ) - self.face_element = face_element - self.orientation = orientation + :param face_bounds + :type face_bounds:SET(1,None,'face_bound', scope = schema_scope) + """ - @apply - def face_element(): - def fget( self ): - return self._face_element - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument face_element is mantatory and can not be set to None') - if not check_type(value,face): - self._face_element = face(value) - else: - self._face_element = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__bounds, + face_element, + orientation, + ): + face.__init__( + self, + inherited0__name, + inherited1__bounds, + ) + self.face_element = face_element + self.orientation = orientation - @apply - def orientation(): - def fget( self ): - return self._orientation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument orientation is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._orientation = BOOLEAN(value) - else: - self._orientation = value - return property(**locals()) + @apply + def face_element(): + def fget(self): + return self._face_element - @apply - def face_bounds(): - def fget( self ): - attribute_eval = conditional_reverse(self.self.orientation,self.self.face_element.self.bounds) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument face_bounds is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = ( not ('CONFIG_CONTROL_DESIGN.ORIENTED_FACE' == TYPEOF(self.self.face_element))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument face_element is mantatory and can not be set to None" + ) + if not check_type(value, face): + self._face_element = face(value) + else: + self._face_element = value + + return property(**locals()) + + @apply + def orientation(): + def fget(self): + return self._orientation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument orientation is mantatory and can not be set to None") + if not check_type(value, BOOLEAN): + self._orientation = BOOLEAN(value) + else: + self._orientation = value + + return property(**locals()) + + @apply + def face_bounds(): + def fget(self): + attribute_eval = conditional_reverse( + self.self.orientation, self.self.face_element.self.bounds + ) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument face_bounds is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = not ("CONFIG_CONTROL_DESIGN.ORIENTED_FACE" == TYPEOF(self.self.face_element)) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY surface_of_revolution # +# ENTITY surface_of_revolution # #################### class surface_of_revolution(swept_surface): - '''Entity surface_of_revolution definition. + """Entity surface_of_revolution definition. - :param axis_position - :type axis_position:axis1_placement + :param axis_position + :type axis_position:axis1_placement - :param axis_line - :type axis_line:line - ''' - def __init__( self , inherited0__name , inherited1__swept_curve , axis_position, ): - swept_surface.__init__(self , inherited0__name , inherited1__swept_curve , ) - self.axis_position = axis_position + :param axis_line + :type axis_line:line + """ - @apply - def axis_position(): - def fget( self ): - return self._axis_position - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument axis_position is mantatory and can not be set to None') - if not check_type(value,axis1_placement): - self._axis_position = axis1_placement(value) - else: - self._axis_position = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__swept_curve, + axis_position, + ): + swept_surface.__init__( + self, + inherited0__name, + inherited1__swept_curve, + ) + self.axis_position = axis_position + + @apply + def axis_position(): + def fget(self): + return self._axis_position + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument axis_position is mantatory and can not be set to None" + ) + if not check_type(value, axis1_placement): + self._axis_position = axis1_placement(value) + else: + self._axis_position = value + + return property(**locals()) + + @apply + def axis_line(): + def fget(self): + attribute_eval = (self.dummy_gri == curve()) == line( + self.axis_position.self.location, + self.dummy_gri == vector(self.axis_position.self.z, 1), + ) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument axis_line is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) - @apply - def axis_line(): - def fget( self ): - attribute_eval = ((self.dummy_gri == curve()) == line(self.axis_position.self.location,self.dummy_gri == vector(self.axis_position.self.z,1))) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument axis_line is DERIVED. It is computed and can not be set to any value') - return property(**locals()) #################### - # ENTITY advanced_brep_shape_representation # +# ENTITY advanced_brep_shape_representation # #################### class advanced_brep_shape_representation(shape_representation): - '''Entity advanced_brep_shape_representation definition. - ''' - def __init__( self , inherited0__name , inherited1__items , inherited2__context_of_items , ): - shape_representation.__init__(self , inherited0__name , inherited1__items , inherited2__context_of_items , ) - def wr1(self): - eval_wr1_wr = (SIZEOF(None) == 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity advanced_brep_shape_representation definition.""" - def wr2(self): - eval_wr2_wr = (SIZEOF(None) > 0) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def __init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ): + shape_representation.__init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ) - def wr3(self): - eval_wr3_wr = (SIZEOF(None) == 0) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + def wr1(self): + eval_wr1_wr = SIZEOF(None) == 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr4(self): - eval_wr4_wr = (SIZEOF(None) == 0) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + def wr2(self): + eval_wr2_wr = SIZEOF(None) > 0 + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr - def wr5(self): - eval_wr5_wr = (SIZEOF(None) == 0) - if not eval_wr5_wr: - raise AssertionError('Rule wr5 violated') - else: - return eval_wr5_wr + def wr3(self): + eval_wr3_wr = SIZEOF(None) == 0 + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr - def wr6(self): - eval_wr6_wr = (SIZEOF(None) == 0) - if not eval_wr6_wr: - raise AssertionError('Rule wr6 violated') - else: - return eval_wr6_wr + def wr4(self): + eval_wr4_wr = SIZEOF(None) == 0 + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr + + def wr5(self): + eval_wr5_wr = SIZEOF(None) == 0 + if not eval_wr5_wr: + raise AssertionError("Rule wr5 violated") + else: + return eval_wr5_wr + + def wr6(self): + eval_wr6_wr = SIZEOF(None) == 0 + if not eval_wr6_wr: + raise AssertionError("Rule wr6 violated") + else: + return eval_wr6_wr #################### - # ENTITY edge_curve # +# ENTITY edge_curve # #################### -class edge_curve(edge,geometric_representation_item): - '''Entity edge_curve definition. +class edge_curve(edge, geometric_representation_item): + """Entity edge_curve definition. - :param edge_geometry - :type edge_geometry:curve + :param edge_geometry + :type edge_geometry:curve - :param same_sense - :type same_sense:BOOLEAN - ''' - def __init__( self , inherited0__name , inherited1__edge_start , inherited2__edge_end , inherited3__name , edge_geometry,same_sense, ): - edge.__init__(self , inherited0__name , inherited1__edge_start , inherited2__edge_end , ) - geometric_representation_item.__init__(self , inherited3__name , ) - self.edge_geometry = edge_geometry - self.same_sense = same_sense + :param same_sense + :type same_sense:BOOLEAN + """ - @apply - def edge_geometry(): - def fget( self ): - return self._edge_geometry - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument edge_geometry is mantatory and can not be set to None') - if not check_type(value,curve): - self._edge_geometry = curve(value) - else: - self._edge_geometry = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__edge_start, + inherited2__edge_end, + inherited3__name, + edge_geometry, + same_sense, + ): + edge.__init__( + self, + inherited0__name, + inherited1__edge_start, + inherited2__edge_end, + ) + geometric_representation_item.__init__( + self, + inherited3__name, + ) + self.edge_geometry = edge_geometry + self.same_sense = same_sense + + @apply + def edge_geometry(): + def fget(self): + return self._edge_geometry + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument edge_geometry is mantatory and can not be set to None" + ) + if not check_type(value, curve): + self._edge_geometry = curve(value) + else: + self._edge_geometry = value + + return property(**locals()) + + @apply + def same_sense(): + def fget(self): + return self._same_sense + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument same_sense is mantatory and can not be set to None") + if not check_type(value, BOOLEAN): + self._same_sense = BOOLEAN(value) + else: + self._same_sense = value + + return property(**locals()) - @apply - def same_sense(): - def fget( self ): - return self._same_sense - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument same_sense is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._same_sense = BOOLEAN(value) - else: - self._same_sense = value - return property(**locals()) #################### - # ENTITY point_replica # +# ENTITY point_replica # #################### class point_replica(point): - '''Entity point_replica definition. + """Entity point_replica definition. - :param parent_pt - :type parent_pt:point + :param parent_pt + :type parent_pt:point - :param transformation - :type transformation:cartesian_transformation_operator - ''' - def __init__( self , inherited0__name , parent_pt,transformation, ): - point.__init__(self , inherited0__name , ) - self.parent_pt = parent_pt - self.transformation = transformation + :param transformation + :type transformation:cartesian_transformation_operator + """ - @apply - def parent_pt(): - def fget( self ): - return self._parent_pt - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument parent_pt is mantatory and can not be set to None') - if not check_type(value,point): - self._parent_pt = point(value) - else: - self._parent_pt = value - return property(**locals()) + def __init__( + self, + inherited0__name, + parent_pt, + transformation, + ): + point.__init__( + self, + inherited0__name, + ) + self.parent_pt = parent_pt + self.transformation = transformation - @apply - def transformation(): - def fget( self ): - return self._transformation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument transformation is mantatory and can not be set to None') - if not check_type(value,cartesian_transformation_operator): - self._transformation = cartesian_transformation_operator(value) - else: - self._transformation = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.transformation.self.dim == self.parent_pt.self.dim) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def parent_pt(): + def fget(self): + return self._parent_pt - def wr2(self): - eval_wr2_wr = acyclic_point_replica(self,self.parent_pt) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument parent_pt is mantatory and can not be set to None") + if not check_type(value, point): + self._parent_pt = point(value) + else: + self._parent_pt = value + + return property(**locals()) + + @apply + def transformation(): + def fget(self): + return self._transformation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument transformation is mantatory and can not be set to None" + ) + if not check_type(value, cartesian_transformation_operator): + self._transformation = cartesian_transformation_operator(value) + else: + self._transformation = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.transformation.self.dim == self.parent_pt.self.dim + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = acyclic_point_replica(self, self.parent_pt) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr #################### - # ENTITY product # +# ENTITY product # #################### class product(BaseEntityClass): - '''Entity product definition. + """Entity product definition. - :param id - :type id:identifier + :param id + :type id:identifier - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param frame_of_reference - :type frame_of_reference:SET(1,None,'product_context', scope = schema_scope) - ''' - def __init__( self , id,name,description,frame_of_reference, ): - self.id = id - self.name = name - self.description = description - self.frame_of_reference = frame_of_reference + :param frame_of_reference + :type frame_of_reference:SET(1,None,'product_context', scope = schema_scope) + """ - @apply - def id(): - def fget( self ): - return self._id - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument id is mantatory and can not be set to None') - if not check_type(value,identifier): - self._id = identifier(value) - else: - self._id = value - return property(**locals()) + def __init__( + self, + id, + name, + description, + frame_of_reference, + ): + self.id = id + self.name = name + self.description = description + self.frame_of_reference = frame_of_reference - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + @apply + def id(): + def fget(self): + return self._id - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument id is mantatory and can not be set to None") + if not check_type(value, identifier): + self._id = identifier(value) + else: + self._id = value + + return property(**locals()) + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def frame_of_reference(): + def fget(self): + return self._frame_of_reference + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument frame_of_reference is mantatory and can not be set to None" + ) + if not check_type(value, SET(1, None, "product_context", scope=schema_scope)): + self._frame_of_reference = SET(value) + else: + self._frame_of_reference = value + + return property(**locals()) - @apply - def frame_of_reference(): - def fget( self ): - return self._frame_of_reference - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument frame_of_reference is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'product_context', scope = schema_scope)): - self._frame_of_reference = SET(value) - else: - self._frame_of_reference = value - return property(**locals()) #################### - # ENTITY shape_aspect_relationship # +# ENTITY shape_aspect_relationship # #################### class shape_aspect_relationship(BaseEntityClass): - '''Entity shape_aspect_relationship definition. + """Entity shape_aspect_relationship definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param relating_shape_aspect - :type relating_shape_aspect:shape_aspect + :param relating_shape_aspect + :type relating_shape_aspect:shape_aspect - :param related_shape_aspect - :type related_shape_aspect:shape_aspect - ''' - def __init__( self , name,description,relating_shape_aspect,related_shape_aspect, ): - self.name = name - self.description = description - self.relating_shape_aspect = relating_shape_aspect - self.related_shape_aspect = related_shape_aspect + :param related_shape_aspect + :type related_shape_aspect:shape_aspect + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + relating_shape_aspect, + related_shape_aspect, + ): + self.name = name + self.description = description + self.relating_shape_aspect = relating_shape_aspect + self.related_shape_aspect = related_shape_aspect - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name - @apply - def relating_shape_aspect(): - def fget( self ): - return self._relating_shape_aspect - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument relating_shape_aspect is mantatory and can not be set to None') - if not check_type(value,shape_aspect): - self._relating_shape_aspect = shape_aspect(value) - else: - self._relating_shape_aspect = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def relating_shape_aspect(): + def fget(self): + return self._relating_shape_aspect + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument relating_shape_aspect is mantatory and can not be set to None" + ) + if not check_type(value, shape_aspect): + self._relating_shape_aspect = shape_aspect(value) + else: + self._relating_shape_aspect = value + + return property(**locals()) + + @apply + def related_shape_aspect(): + def fget(self): + return self._related_shape_aspect + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument related_shape_aspect is mantatory and can not be set to None" + ) + if not check_type(value, shape_aspect): + self._related_shape_aspect = shape_aspect(value) + else: + self._related_shape_aspect = value + + return property(**locals()) - @apply - def related_shape_aspect(): - def fget( self ): - return self._related_shape_aspect - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument related_shape_aspect is mantatory and can not be set to None') - if not check_type(value,shape_aspect): - self._related_shape_aspect = shape_aspect(value) - else: - self._related_shape_aspect = value - return property(**locals()) #################### - # ENTITY rectangular_trimmed_surface # +# ENTITY rectangular_trimmed_surface # #################### class rectangular_trimmed_surface(bounded_surface): - '''Entity rectangular_trimmed_surface definition. + """Entity rectangular_trimmed_surface definition. - :param basis_surface - :type basis_surface:surface + :param basis_surface + :type basis_surface:surface - :param u1 - :type u1:parameter_value + :param u1 + :type u1:parameter_value - :param u2 - :type u2:parameter_value + :param u2 + :type u2:parameter_value - :param v1 - :type v1:parameter_value + :param v1 + :type v1:parameter_value - :param v2 - :type v2:parameter_value + :param v2 + :type v2:parameter_value - :param usense - :type usense:BOOLEAN + :param usense + :type usense:BOOLEAN - :param vsense - :type vsense:BOOLEAN - ''' - def __init__( self , inherited0__name , basis_surface,u1,u2,v1,v2,usense,vsense, ): - bounded_surface.__init__(self , inherited0__name , ) - self.basis_surface = basis_surface - self.u1 = u1 - self.u2 = u2 - self.v1 = v1 - self.v2 = v2 - self.usense = usense - self.vsense = vsense + :param vsense + :type vsense:BOOLEAN + """ - @apply - def basis_surface(): - def fget( self ): - return self._basis_surface - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument basis_surface is mantatory and can not be set to None') - if not check_type(value,surface): - self._basis_surface = surface(value) - else: - self._basis_surface = value - return property(**locals()) + def __init__( + self, + inherited0__name, + basis_surface, + u1, + u2, + v1, + v2, + usense, + vsense, + ): + bounded_surface.__init__( + self, + inherited0__name, + ) + self.basis_surface = basis_surface + self.u1 = u1 + self.u2 = u2 + self.v1 = v1 + self.v2 = v2 + self.usense = usense + self.vsense = vsense - @apply - def u1(): - def fget( self ): - return self._u1 - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument u1 is mantatory and can not be set to None') - if not check_type(value,parameter_value): - self._u1 = parameter_value(value) - else: - self._u1 = value - return property(**locals()) + @apply + def basis_surface(): + def fget(self): + return self._basis_surface - @apply - def u2(): - def fget( self ): - return self._u2 - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument u2 is mantatory and can not be set to None') - if not check_type(value,parameter_value): - self._u2 = parameter_value(value) - else: - self._u2 = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument basis_surface is mantatory and can not be set to None" + ) + if not check_type(value, surface): + self._basis_surface = surface(value) + else: + self._basis_surface = value - @apply - def v1(): - def fget( self ): - return self._v1 - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument v1 is mantatory and can not be set to None') - if not check_type(value,parameter_value): - self._v1 = parameter_value(value) - else: - self._v1 = value - return property(**locals()) + return property(**locals()) - @apply - def v2(): - def fget( self ): - return self._v2 - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument v2 is mantatory and can not be set to None') - if not check_type(value,parameter_value): - self._v2 = parameter_value(value) - else: - self._v2 = value - return property(**locals()) + @apply + def u1(): + def fget(self): + return self._u1 - @apply - def usense(): - def fget( self ): - return self._usense - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument usense is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._usense = BOOLEAN(value) - else: - self._usense = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument u1 is mantatory and can not be set to None") + if not check_type(value, parameter_value): + self._u1 = parameter_value(value) + else: + self._u1 = value - @apply - def vsense(): - def fget( self ): - return self._vsense - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument vsense is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._vsense = BOOLEAN(value) - else: - self._vsense = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.u1 != self.u2) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + return property(**locals()) - def wr2(self): - eval_wr2_wr = (self.v1 != self.v2) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + @apply + def u2(): + def fget(self): + return self._u2 - def wr3(self): - eval_wr3_wr = (((('CONFIG_CONTROL_DESIGN.ELEMENTARY_SURFACE' == TYPEOF(self.basis_surface)) and ( not ('CONFIG_CONTROL_DESIGN.PLANE' == TYPEOF(self.basis_surface)))) or ('CONFIG_CONTROL_DESIGN.SURFACE_OF_REVOLUTION' == TYPEOF(self.basis_surface))) or (self.usense == (self.u2 > self.u1))) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument u2 is mantatory and can not be set to None") + if not check_type(value, parameter_value): + self._u2 = parameter_value(value) + else: + self._u2 = value - def wr4(self): - eval_wr4_wr = ((('CONFIG_CONTROL_DESIGN.SPHERICAL_SURFACE' == TYPEOF(self.basis_surface)) or ('CONFIG_CONTROL_DESIGN.TOROIDAL_SURFACE' == TYPEOF(self.basis_surface))) or (self.vsense == (self.v2 > self.v1))) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + return property(**locals()) + + @apply + def v1(): + def fget(self): + return self._v1 + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument v1 is mantatory and can not be set to None") + if not check_type(value, parameter_value): + self._v1 = parameter_value(value) + else: + self._v1 = value + + return property(**locals()) + + @apply + def v2(): + def fget(self): + return self._v2 + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument v2 is mantatory and can not be set to None") + if not check_type(value, parameter_value): + self._v2 = parameter_value(value) + else: + self._v2 = value + + return property(**locals()) + + @apply + def usense(): + def fget(self): + return self._usense + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument usense is mantatory and can not be set to None") + if not check_type(value, BOOLEAN): + self._usense = BOOLEAN(value) + else: + self._usense = value + + return property(**locals()) + + @apply + def vsense(): + def fget(self): + return self._vsense + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument vsense is mantatory and can not be set to None") + if not check_type(value, BOOLEAN): + self._vsense = BOOLEAN(value) + else: + self._vsense = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.u1 != self.u2 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = self.v1 != self.v2 + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr + + def wr3(self): + eval_wr3_wr = ( + ( + ("CONFIG_CONTROL_DESIGN.ELEMENTARY_SURFACE" == TYPEOF(self.basis_surface)) + and (not ("CONFIG_CONTROL_DESIGN.PLANE" == TYPEOF(self.basis_surface))) + ) + or ("CONFIG_CONTROL_DESIGN.SURFACE_OF_REVOLUTION" == TYPEOF(self.basis_surface)) + ) or (self.usense == (self.u2 > self.u1)) + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr + + def wr4(self): + eval_wr4_wr = ( + ("CONFIG_CONTROL_DESIGN.SPHERICAL_SURFACE" == TYPEOF(self.basis_surface)) + or ("CONFIG_CONTROL_DESIGN.TOROIDAL_SURFACE" == TYPEOF(self.basis_surface)) + ) or (self.vsense == (self.v2 > self.v1)) + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr #################### - # ENTITY plane # +# ENTITY plane # #################### class plane(elementary_surface): - '''Entity plane definition. - ''' - def __init__( self , inherited0__name , inherited1__position , ): - elementary_surface.__init__(self , inherited0__name , inherited1__position , ) + """Entity plane definition.""" + + def __init__( + self, + inherited0__name, + inherited1__position, + ): + elementary_surface.__init__( + self, + inherited0__name, + inherited1__position, + ) + #################### - # ENTITY action_assignment # +# ENTITY action_assignment # #################### class action_assignment(BaseEntityClass): - '''Entity action_assignment definition. + """Entity action_assignment definition. - :param assigned_action - :type assigned_action:action - ''' - def __init__( self , assigned_action, ): - self.assigned_action = assigned_action + :param assigned_action + :type assigned_action:action + """ + + def __init__( + self, + assigned_action, + ): + self.assigned_action = assigned_action + + @apply + def assigned_action(): + def fget(self): + return self._assigned_action + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument assigned_action is mantatory and can not be set to None" + ) + if not check_type(value, action): + self._assigned_action = action(value) + else: + self._assigned_action = value + + return property(**locals()) - @apply - def assigned_action(): - def fget( self ): - return self._assigned_action - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument assigned_action is mantatory and can not be set to None') - if not check_type(value,action): - self._assigned_action = action(value) - else: - self._assigned_action = value - return property(**locals()) #################### - # ENTITY change # +# ENTITY change # #################### class change(action_assignment): - '''Entity change definition. + """Entity change definition. - :param items - :type items:SET(1,None,'work_item', scope = schema_scope) - ''' - def __init__( self , inherited0__assigned_action , items, ): - action_assignment.__init__(self , inherited0__assigned_action , ) - self.items = items + :param items + :type items:SET(1,None,'work_item', scope = schema_scope) + """ + + def __init__( + self, + inherited0__assigned_action, + items, + ): + action_assignment.__init__( + self, + inherited0__assigned_action, + ) + self.items = items + + @apply + def items(): + def fget(self): + return self._items + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument items is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "work_item", scope=schema_scope)): + self._items = SET(value) + else: + self._items = value + + return property(**locals()) - @apply - def items(): - def fget( self ): - return self._items - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument items is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'work_item', scope = schema_scope)): - self._items = SET(value) - else: - self._items = value - return property(**locals()) #################### - # ENTITY circle # +# ENTITY circle # #################### class circle(conic): - '''Entity circle definition. + """Entity circle definition. - :param radius - :type radius:positive_length_measure - ''' - def __init__( self , inherited0__name , inherited1__position , radius, ): - conic.__init__(self , inherited0__name , inherited1__position , ) - self.radius = radius + :param radius + :type radius:positive_length_measure + """ + + def __init__( + self, + inherited0__name, + inherited1__position, + radius, + ): + conic.__init__( + self, + inherited0__name, + inherited1__position, + ) + self.radius = radius + + @apply + def radius(): + def fget(self): + return self._radius + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument radius is mantatory and can not be set to None") + if not check_type(value, positive_length_measure): + self._radius = positive_length_measure(value) + else: + self._radius = value + + return property(**locals()) - @apply - def radius(): - def fget( self ): - return self._radius - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument radius is mantatory and can not be set to None') - if not check_type(value,positive_length_measure): - self._radius = positive_length_measure(value) - else: - self._radius = value - return property(**locals()) #################### - # ENTITY line # +# ENTITY line # #################### class line(curve): - '''Entity line definition. + """Entity line definition. - :param pnt - :type pnt:cartesian_point + :param pnt + :type pnt:cartesian_point - :param dir - :type dir:vector - ''' - def __init__( self , inherited0__name , pnt,dir, ): - curve.__init__(self , inherited0__name , ) - self.pnt = pnt - self.dir = dir + :param dir + :type dir:vector + """ - @apply - def pnt(): - def fget( self ): - return self._pnt - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument pnt is mantatory and can not be set to None') - if not check_type(value,cartesian_point): - self._pnt = cartesian_point(value) - else: - self._pnt = value - return property(**locals()) + def __init__( + self, + inherited0__name, + pnt, + dir, + ): + curve.__init__( + self, + inherited0__name, + ) + self.pnt = pnt + self.dir = dir - @apply - def dir(): - def fget( self ): - return self._dir - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument dir is mantatory and can not be set to None') - if not check_type(value,vector): - self._dir = vector(value) - else: - self._dir = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.dir.self.dim == self.pnt.self.dim) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def pnt(): + def fget(self): + return self._pnt + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument pnt is mantatory and can not be set to None") + if not check_type(value, cartesian_point): + self._pnt = cartesian_point(value) + else: + self._pnt = value + + return property(**locals()) + + @apply + def dir(): + def fget(self): + return self._dir + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument dir is mantatory and can not be set to None") + if not check_type(value, vector): + self._dir = vector(value) + else: + self._dir = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.dir.self.dim == self.pnt.self.dim + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY property_definition_representation # +# ENTITY property_definition_representation # #################### class property_definition_representation(BaseEntityClass): - '''Entity property_definition_representation definition. + """Entity property_definition_representation definition. - :param definition - :type definition:property_definition + :param definition + :type definition:property_definition - :param used_representation - :type used_representation:representation - ''' - def __init__( self , definition,used_representation, ): - self.definition = definition - self.used_representation = used_representation + :param used_representation + :type used_representation:representation + """ - @apply - def definition(): - def fget( self ): - return self._definition - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument definition is mantatory and can not be set to None') - if not check_type(value,property_definition): - self._definition = property_definition(value) - else: - self._definition = value - return property(**locals()) + def __init__( + self, + definition, + used_representation, + ): + self.definition = definition + self.used_representation = used_representation + + @apply + def definition(): + def fget(self): + return self._definition + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument definition is mantatory and can not be set to None") + if not check_type(value, property_definition): + self._definition = property_definition(value) + else: + self._definition = value + + return property(**locals()) + + @apply + def used_representation(): + def fget(self): + return self._used_representation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument used_representation is mantatory and can not be set to None" + ) + if not check_type(value, representation): + self._used_representation = representation(value) + else: + self._used_representation = value + + return property(**locals()) - @apply - def used_representation(): - def fget( self ): - return self._used_representation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument used_representation is mantatory and can not be set to None') - if not check_type(value,representation): - self._used_representation = representation(value) - else: - self._used_representation = value - return property(**locals()) #################### - # ENTITY geometric_set # +# ENTITY geometric_set # #################### class geometric_set(geometric_representation_item): - '''Entity geometric_set definition. + """Entity geometric_set definition. - :param elements - :type elements:SET(1,None,'geometric_set_select', scope = schema_scope) - ''' - def __init__( self , inherited0__name , elements, ): - geometric_representation_item.__init__(self , inherited0__name , ) - self.elements = elements + :param elements + :type elements:SET(1,None,'geometric_set_select', scope = schema_scope) + """ + + def __init__( + self, + inherited0__name, + elements, + ): + geometric_representation_item.__init__( + self, + inherited0__name, + ) + self.elements = elements + + @apply + def elements(): + def fget(self): + return self._elements + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument elements is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "geometric_set_select", scope=schema_scope)): + self._elements = SET(value) + else: + self._elements = value + + return property(**locals()) - @apply - def elements(): - def fget( self ): - return self._elements - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument elements is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'geometric_set_select', scope = schema_scope)): - self._elements = SET(value) - else: - self._elements = value - return property(**locals()) #################### - # ENTITY geometric_curve_set # +# ENTITY geometric_curve_set # #################### class geometric_curve_set(geometric_set): - '''Entity geometric_curve_set definition. - ''' - def __init__( self , inherited0__name , inherited1__elements , ): - geometric_set.__init__(self , inherited0__name , inherited1__elements , ) - def wr1(self): - eval_wr1_wr = (SIZEOF(None) == 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity geometric_curve_set definition.""" + + def __init__( + self, + inherited0__name, + inherited1__elements, + ): + geometric_set.__init__( + self, + inherited0__name, + inherited1__elements, + ) + + def wr1(self): + eval_wr1_wr = SIZEOF(None) == 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY personal_address # +# ENTITY personal_address # #################### class personal_address(address): - '''Entity personal_address definition. + """Entity personal_address definition. - :param people - :type people:SET(1,None,'person', scope = schema_scope) + :param people + :type people:SET(1,None,'person', scope = schema_scope) - :param description - :type description:text - ''' - def __init__( self , inherited0__internal_location , inherited1__street_number , inherited2__street , inherited3__postal_box , inherited4__town , inherited5__region , inherited6__postal_code , inherited7__country , inherited8__facsimile_number , inherited9__telephone_number , inherited10__electronic_mail_address , inherited11__telex_number , people,description, ): - address.__init__(self , inherited0__internal_location , inherited1__street_number , inherited2__street , inherited3__postal_box , inherited4__town , inherited5__region , inherited6__postal_code , inherited7__country , inherited8__facsimile_number , inherited9__telephone_number , inherited10__electronic_mail_address , inherited11__telex_number , ) - self.people = people - self.description = description + :param description + :type description:text + """ - @apply - def people(): - def fget( self ): - return self._people - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument people is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'person', scope = schema_scope)): - self._people = SET(value) - else: - self._people = value - return property(**locals()) + def __init__( + self, + inherited0__internal_location, + inherited1__street_number, + inherited2__street, + inherited3__postal_box, + inherited4__town, + inherited5__region, + inherited6__postal_code, + inherited7__country, + inherited8__facsimile_number, + inherited9__telephone_number, + inherited10__electronic_mail_address, + inherited11__telex_number, + people, + description, + ): + address.__init__( + self, + inherited0__internal_location, + inherited1__street_number, + inherited2__street, + inherited3__postal_box, + inherited4__town, + inherited5__region, + inherited6__postal_code, + inherited7__country, + inherited8__facsimile_number, + inherited9__telephone_number, + inherited10__electronic_mail_address, + inherited11__telex_number, + ) + self.people = people + self.description = description + + @apply + def people(): + def fget(self): + return self._people + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument people is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "person", scope=schema_scope)): + self._people = SET(value) + else: + self._people = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) #################### - # ENTITY document_relationship # +# ENTITY document_relationship # #################### class document_relationship(BaseEntityClass): - '''Entity document_relationship definition. + """Entity document_relationship definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param relating_document - :type relating_document:document + :param relating_document + :type relating_document:document - :param related_document - :type related_document:document - ''' - def __init__( self , name,description,relating_document,related_document, ): - self.name = name - self.description = description - self.relating_document = relating_document - self.related_document = related_document + :param related_document + :type related_document:document + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + relating_document, + related_document, + ): + self.name = name + self.description = description + self.relating_document = relating_document + self.related_document = related_document - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name - @apply - def relating_document(): - def fget( self ): - return self._relating_document - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument relating_document is mantatory and can not be set to None') - if not check_type(value,document): - self._relating_document = document(value) - else: - self._relating_document = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def relating_document(): + def fget(self): + return self._relating_document + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument relating_document is mantatory and can not be set to None" + ) + if not check_type(value, document): + self._relating_document = document(value) + else: + self._relating_document = value + + return property(**locals()) + + @apply + def related_document(): + def fget(self): + return self._related_document + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument related_document is mantatory and can not be set to None" + ) + if not check_type(value, document): + self._related_document = document(value) + else: + self._related_document = value + + return property(**locals()) - @apply - def related_document(): - def fget( self ): - return self._related_document - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument related_document is mantatory and can not be set to None') - if not check_type(value,document): - self._related_document = document(value) - else: - self._related_document = value - return property(**locals()) #################### - # ENTITY outer_boundary_curve # +# ENTITY outer_boundary_curve # #################### class outer_boundary_curve(boundary_curve): - '''Entity outer_boundary_curve definition. - ''' - def __init__( self , inherited0__name , inherited1__segments , inherited2__self_intersect , ): - boundary_curve.__init__(self , inherited0__name , inherited1__segments , inherited2__self_intersect , ) + """Entity outer_boundary_curve definition.""" + + def __init__( + self, + inherited0__name, + inherited1__segments, + inherited2__self_intersect, + ): + boundary_curve.__init__( + self, + inherited0__name, + inherited1__segments, + inherited2__self_intersect, + ) + #################### - # ENTITY shape_representation_relationship # +# ENTITY shape_representation_relationship # #################### class shape_representation_relationship(representation_relationship): - '''Entity shape_representation_relationship definition. - ''' - def __init__( self , inherited0__name , inherited1__description , inherited2__rep_1 , inherited3__rep_2 , ): - representation_relationship.__init__(self , inherited0__name , inherited1__description , inherited2__rep_1 , inherited3__rep_2 , ) - def wr1(self): - eval_wr1_wr = ('CONFIG_CONTROL_DESIGN.SHAPE_REPRESENTATION' == (TYPEOF(self.self.representation_relationship.self.rep_1) + TYPEOF(self.self.representation_relationship.self.rep_2))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity shape_representation_relationship definition.""" + + def __init__( + self, + inherited0__name, + inherited1__description, + inherited2__rep_1, + inherited3__rep_2, + ): + representation_relationship.__init__( + self, + inherited0__name, + inherited1__description, + inherited2__rep_1, + inherited3__rep_2, + ) + + def wr1(self): + eval_wr1_wr = "CONFIG_CONTROL_DESIGN.SHAPE_REPRESENTATION" == ( + TYPEOF(self.self.representation_relationship.self.rep_1) + + TYPEOF(self.self.representation_relationship.self.rep_2) + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY assembly_component_usage_substitute # +# ENTITY assembly_component_usage_substitute # #################### class assembly_component_usage_substitute(BaseEntityClass): - '''Entity assembly_component_usage_substitute definition. + """Entity assembly_component_usage_substitute definition. - :param name - :type name:label + :param name + :type name:label - :param definition - :type definition:text + :param definition + :type definition:text - :param base - :type base:assembly_component_usage + :param base + :type base:assembly_component_usage - :param substitute - :type substitute:assembly_component_usage - ''' - def __init__( self , name,definition,base,substitute, ): - self.name = name - self.definition = definition - self.base = base - self.substitute = substitute + :param substitute + :type substitute:assembly_component_usage + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + definition, + base, + substitute, + ): + self.name = name + self.definition = definition + self.base = base + self.substitute = substitute - @apply - def definition(): - def fget( self ): - return self._definition - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument definition is mantatory and can not be set to None') - if not check_type(value,text): - self._definition = text(value) - else: - self._definition = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name - @apply - def base(): - def fget( self ): - return self._base - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument base is mantatory and can not be set to None') - if not check_type(value,assembly_component_usage): - self._base = assembly_component_usage(value) - else: - self._base = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value - @apply - def substitute(): - def fget( self ): - return self._substitute - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument substitute is mantatory and can not be set to None') - if not check_type(value,assembly_component_usage): - self._substitute = assembly_component_usage(value) - else: - self._substitute = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.base.self.relating_product_definition == self.substitute.self.relating_product_definition) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + return property(**locals()) - def wr2(self): - eval_wr2_wr = (self.base != self.substitute) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + @apply + def definition(): + def fget(self): + return self._definition + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument definition is mantatory and can not be set to None") + if not check_type(value, text): + self._definition = text(value) + else: + self._definition = value + + return property(**locals()) + + @apply + def base(): + def fget(self): + return self._base + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument base is mantatory and can not be set to None") + if not check_type(value, assembly_component_usage): + self._base = assembly_component_usage(value) + else: + self._base = value + + return property(**locals()) + + @apply + def substitute(): + def fget(self): + return self._substitute + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument substitute is mantatory and can not be set to None") + if not check_type(value, assembly_component_usage): + self._substitute = assembly_component_usage(value) + else: + self._substitute = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = ( + self.base.self.relating_product_definition + == self.substitute.self.relating_product_definition + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = self.base != self.substitute + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr #################### - # ENTITY degenerate_pcurve # +# ENTITY degenerate_pcurve # #################### class degenerate_pcurve(point): - '''Entity degenerate_pcurve definition. + """Entity degenerate_pcurve definition. - :param basis_surface - :type basis_surface:surface + :param basis_surface + :type basis_surface:surface - :param reference_to_curve - :type reference_to_curve:definitional_representation - ''' - def __init__( self , inherited0__name , basis_surface,reference_to_curve, ): - point.__init__(self , inherited0__name , ) - self.basis_surface = basis_surface - self.reference_to_curve = reference_to_curve + :param reference_to_curve + :type reference_to_curve:definitional_representation + """ - @apply - def basis_surface(): - def fget( self ): - return self._basis_surface - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument basis_surface is mantatory and can not be set to None') - if not check_type(value,surface): - self._basis_surface = surface(value) - else: - self._basis_surface = value - return property(**locals()) + def __init__( + self, + inherited0__name, + basis_surface, + reference_to_curve, + ): + point.__init__( + self, + inherited0__name, + ) + self.basis_surface = basis_surface + self.reference_to_curve = reference_to_curve - @apply - def reference_to_curve(): - def fget( self ): - return self._reference_to_curve - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument reference_to_curve is mantatory and can not be set to None') - if not check_type(value,definitional_representation): - self._reference_to_curve = definitional_representation(value) - else: - self._reference_to_curve = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (SIZEOF(self.reference_to_curve.self.representation.self.items) == 1) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def basis_surface(): + def fget(self): + return self._basis_surface - def wr2(self): - eval_wr2_wr = ('CONFIG_CONTROL_DESIGN.CURVE' == TYPEOF(self.reference_to_curve.self.representation.self.items[1])) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument basis_surface is mantatory and can not be set to None" + ) + if not check_type(value, surface): + self._basis_surface = surface(value) + else: + self._basis_surface = value - def wr3(self): - eval_wr3_wr = (self.reference_to_curve.self.representation.self.items[1].self.geometric_representation_item.self.dim == 2) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + return property(**locals()) + + @apply + def reference_to_curve(): + def fget(self): + return self._reference_to_curve + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument reference_to_curve is mantatory and can not be set to None" + ) + if not check_type(value, definitional_representation): + self._reference_to_curve = definitional_representation(value) + else: + self._reference_to_curve = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = SIZEOF(self.reference_to_curve.self.representation.self.items) == 1 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = "CONFIG_CONTROL_DESIGN.CURVE" == TYPEOF( + self.reference_to_curve.self.representation.self.items[1] + ) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr + + def wr3(self): + eval_wr3_wr = ( + self.reference_to_curve.self.representation.self.items[ + 1 + ].self.geometric_representation_item.self.dim + == 2 + ) + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr #################### - # ENTITY evaluated_degenerate_pcurve # +# ENTITY evaluated_degenerate_pcurve # #################### class evaluated_degenerate_pcurve(degenerate_pcurve): - '''Entity evaluated_degenerate_pcurve definition. + """Entity evaluated_degenerate_pcurve definition. - :param equivalent_point - :type equivalent_point:cartesian_point - ''' - def __init__( self , inherited0__name , inherited1__basis_surface , inherited2__reference_to_curve , equivalent_point, ): - degenerate_pcurve.__init__(self , inherited0__name , inherited1__basis_surface , inherited2__reference_to_curve , ) - self.equivalent_point = equivalent_point + :param equivalent_point + :type equivalent_point:cartesian_point + """ + + def __init__( + self, + inherited0__name, + inherited1__basis_surface, + inherited2__reference_to_curve, + equivalent_point, + ): + degenerate_pcurve.__init__( + self, + inherited0__name, + inherited1__basis_surface, + inherited2__reference_to_curve, + ) + self.equivalent_point = equivalent_point + + @apply + def equivalent_point(): + def fget(self): + return self._equivalent_point + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument equivalent_point is mantatory and can not be set to None" + ) + if not check_type(value, cartesian_point): + self._equivalent_point = cartesian_point(value) + else: + self._equivalent_point = value + + return property(**locals()) - @apply - def equivalent_point(): - def fget( self ): - return self._equivalent_point - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument equivalent_point is mantatory and can not be set to None') - if not check_type(value,cartesian_point): - self._equivalent_point = cartesian_point(value) - else: - self._equivalent_point = value - return property(**locals()) #################### - # ENTITY solid_angle_measure_with_unit # +# ENTITY solid_angle_measure_with_unit # #################### class solid_angle_measure_with_unit(measure_with_unit): - '''Entity solid_angle_measure_with_unit definition. - ''' - def __init__( self , inherited0__value_component , inherited1__unit_component , ): - measure_with_unit.__init__(self , inherited0__value_component , inherited1__unit_component , ) - def wr1(self): - eval_wr1_wr = ('CONFIG_CONTROL_DESIGN.SOLID_ANGLE_UNIT' == TYPEOF(self.self.measure_with_unit.self.unit_component)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity solid_angle_measure_with_unit definition.""" + + def __init__( + self, + inherited0__value_component, + inherited1__unit_component, + ): + measure_with_unit.__init__( + self, + inherited0__value_component, + inherited1__unit_component, + ) + + def wr1(self): + eval_wr1_wr = "CONFIG_CONTROL_DESIGN.SOLID_ANGLE_UNIT" == TYPEOF( + self.self.measure_with_unit.self.unit_component + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY connected_edge_set # +# ENTITY connected_edge_set # #################### class connected_edge_set(topological_representation_item): - '''Entity connected_edge_set definition. + """Entity connected_edge_set definition. - :param ces_edges - :type ces_edges:SET(1,None,'edge', scope = schema_scope) - ''' - def __init__( self , inherited0__name , ces_edges, ): - topological_representation_item.__init__(self , inherited0__name , ) - self.ces_edges = ces_edges + :param ces_edges + :type ces_edges:SET(1,None,'edge', scope = schema_scope) + """ + + def __init__( + self, + inherited0__name, + ces_edges, + ): + topological_representation_item.__init__( + self, + inherited0__name, + ) + self.ces_edges = ces_edges + + @apply + def ces_edges(): + def fget(self): + return self._ces_edges + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument ces_edges is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "edge", scope=schema_scope)): + self._ces_edges = SET(value) + else: + self._ces_edges = value + + return property(**locals()) - @apply - def ces_edges(): - def fget( self ): - return self._ces_edges - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument ces_edges is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'edge', scope = schema_scope)): - self._ces_edges = SET(value) - else: - self._ces_edges = value - return property(**locals()) #################### - # ENTITY action # +# ENTITY action # #################### class action(BaseEntityClass): - '''Entity action definition. + """Entity action definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param chosen_method - :type chosen_method:action_method - ''' - def __init__( self , name,description,chosen_method, ): - self.name = name - self.description = description - self.chosen_method = chosen_method + :param chosen_method + :type chosen_method:action_method + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + chosen_method, + ): + self.name = name + self.description = description + self.chosen_method = chosen_method - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def chosen_method(): + def fget(self): + return self._chosen_method + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument chosen_method is mantatory and can not be set to None" + ) + if not check_type(value, action_method): + self._chosen_method = action_method(value) + else: + self._chosen_method = value + + return property(**locals()) - @apply - def chosen_method(): - def fget( self ): - return self._chosen_method - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument chosen_method is mantatory and can not be set to None') - if not check_type(value,action_method): - self._chosen_method = action_method(value) - else: - self._chosen_method = value - return property(**locals()) #################### - # ENTITY executed_action # +# ENTITY executed_action # #################### class executed_action(action): - '''Entity executed_action definition. - ''' - def __init__( self , inherited0__name , inherited1__description , inherited2__chosen_method , ): - action.__init__(self , inherited0__name , inherited1__description , inherited2__chosen_method , ) + """Entity executed_action definition.""" + + def __init__( + self, + inherited0__name, + inherited1__description, + inherited2__chosen_method, + ): + action.__init__( + self, + inherited0__name, + inherited1__description, + inherited2__chosen_method, + ) + #################### - # ENTITY directed_action # +# ENTITY directed_action # #################### class directed_action(executed_action): - '''Entity directed_action definition. + """Entity directed_action definition. - :param directive - :type directive:action_directive - ''' - def __init__( self , inherited0__name , inherited1__description , inherited2__chosen_method , directive, ): - executed_action.__init__(self , inherited0__name , inherited1__description , inherited2__chosen_method , ) - self.directive = directive + :param directive + :type directive:action_directive + """ + + def __init__( + self, + inherited0__name, + inherited1__description, + inherited2__chosen_method, + directive, + ): + executed_action.__init__( + self, + inherited0__name, + inherited1__description, + inherited2__chosen_method, + ) + self.directive = directive + + @apply + def directive(): + def fget(self): + return self._directive + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument directive is mantatory and can not be set to None") + if not check_type(value, action_directive): + self._directive = action_directive(value) + else: + self._directive = value + + return property(**locals()) - @apply - def directive(): - def fget( self ): - return self._directive - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument directive is mantatory and can not be set to None') - if not check_type(value,action_directive): - self._directive = action_directive(value) - else: - self._directive = value - return property(**locals()) #################### - # ENTITY organizational_project # +# ENTITY organizational_project # #################### class organizational_project(BaseEntityClass): - '''Entity organizational_project definition. + """Entity organizational_project definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param responsible_organizations - :type responsible_organizations:SET(1,None,'organization', scope = schema_scope) - ''' - def __init__( self , name,description,responsible_organizations, ): - self.name = name - self.description = description - self.responsible_organizations = responsible_organizations + :param responsible_organizations + :type responsible_organizations:SET(1,None,'organization', scope = schema_scope) + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + responsible_organizations, + ): + self.name = name + self.description = description + self.responsible_organizations = responsible_organizations - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def responsible_organizations(): + def fget(self): + return self._responsible_organizations + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument responsible_organizations is mantatory and can not be set to None" + ) + if not check_type(value, SET(1, None, "organization", scope=schema_scope)): + self._responsible_organizations = SET(value) + else: + self._responsible_organizations = value + + return property(**locals()) - @apply - def responsible_organizations(): - def fget( self ): - return self._responsible_organizations - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument responsible_organizations is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'organization', scope = schema_scope)): - self._responsible_organizations = SET(value) - else: - self._responsible_organizations = value - return property(**locals()) #################### - # ENTITY date_time_role # +# ENTITY date_time_role # #################### class date_time_role(BaseEntityClass): - '''Entity date_time_role definition. + """Entity date_time_role definition. - :param name - :type name:label - ''' - def __init__( self , name, ): - self.name = name + :param name + :type name:label + """ + + def __init__( + self, + name, + ): + self.name = name + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) #################### - # ENTITY curve_bounded_surface # +# ENTITY curve_bounded_surface # #################### class curve_bounded_surface(bounded_surface): - '''Entity curve_bounded_surface definition. + """Entity curve_bounded_surface definition. - :param basis_surface - :type basis_surface:surface + :param basis_surface + :type basis_surface:surface - :param boundaries - :type boundaries:SET(1,None,'boundary_curve', scope = schema_scope) + :param boundaries + :type boundaries:SET(1,None,'boundary_curve', scope = schema_scope) - :param implicit_outer - :type implicit_outer:BOOLEAN - ''' - def __init__( self , inherited0__name , basis_surface,boundaries,implicit_outer, ): - bounded_surface.__init__(self , inherited0__name , ) - self.basis_surface = basis_surface - self.boundaries = boundaries - self.implicit_outer = implicit_outer + :param implicit_outer + :type implicit_outer:BOOLEAN + """ - @apply - def basis_surface(): - def fget( self ): - return self._basis_surface - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument basis_surface is mantatory and can not be set to None') - if not check_type(value,surface): - self._basis_surface = surface(value) - else: - self._basis_surface = value - return property(**locals()) + def __init__( + self, + inherited0__name, + basis_surface, + boundaries, + implicit_outer, + ): + bounded_surface.__init__( + self, + inherited0__name, + ) + self.basis_surface = basis_surface + self.boundaries = boundaries + self.implicit_outer = implicit_outer - @apply - def boundaries(): - def fget( self ): - return self._boundaries - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument boundaries is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'boundary_curve', scope = schema_scope)): - self._boundaries = SET(value) - else: - self._boundaries = value - return property(**locals()) + @apply + def basis_surface(): + def fget(self): + return self._basis_surface - @apply - def implicit_outer(): - def fget( self ): - return self._implicit_outer - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument implicit_outer is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._implicit_outer = BOOLEAN(value) - else: - self._implicit_outer = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = ( not (self.implicit_outer and ('CONFIG_CONTROL_DESIGN.OUTER_BOUNDARY_CURVE' == TYPEOF(self.boundaries)))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument basis_surface is mantatory and can not be set to None" + ) + if not check_type(value, surface): + self._basis_surface = surface(value) + else: + self._basis_surface = value - def wr2(self): - eval_wr2_wr = (( not self.implicit_outer) or ('CONFIG_CONTROL_DESIGN.BOUNDED_SURFACE' == TYPEOF(self.basis_surface))) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + return property(**locals()) - def wr3(self): - eval_wr3_wr = (SIZEOF(None) <= 1) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + @apply + def boundaries(): + def fget(self): + return self._boundaries - def wr4(self): - eval_wr4_wr = (SIZEOF(None) == 0) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument boundaries is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "boundary_curve", scope=schema_scope)): + self._boundaries = SET(value) + else: + self._boundaries = value + + return property(**locals()) + + @apply + def implicit_outer(): + def fget(self): + return self._implicit_outer + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument implicit_outer is mantatory and can not be set to None" + ) + if not check_type(value, BOOLEAN): + self._implicit_outer = BOOLEAN(value) + else: + self._implicit_outer = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = not ( + self.implicit_outer + and ("CONFIG_CONTROL_DESIGN.OUTER_BOUNDARY_CURVE" == TYPEOF(self.boundaries)) + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = (not self.implicit_outer) or ( + "CONFIG_CONTROL_DESIGN.BOUNDED_SURFACE" == TYPEOF(self.basis_surface) + ) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr + + def wr3(self): + eval_wr3_wr = SIZEOF(None) <= 1 + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr + + def wr4(self): + eval_wr4_wr = SIZEOF(None) == 0 + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr #################### - # ENTITY closed_shell # +# ENTITY closed_shell # #################### class closed_shell(connected_face_set): - '''Entity closed_shell definition. - ''' - def __init__( self , inherited0__name , inherited1__cfs_faces , ): - connected_face_set.__init__(self , inherited0__name , inherited1__cfs_faces , ) + """Entity closed_shell definition.""" + + def __init__( + self, + inherited0__name, + inherited1__cfs_faces, + ): + connected_face_set.__init__( + self, + inherited0__name, + inherited1__cfs_faces, + ) + #################### - # ENTITY design_make_from_relationship # +# ENTITY design_make_from_relationship # #################### class design_make_from_relationship(product_definition_relationship): - '''Entity design_make_from_relationship definition. - ''' - def __init__( self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , ): - product_definition_relationship.__init__(self , inherited0__id , inherited1__name , inherited2__description , inherited3__relating_product_definition , inherited4__related_product_definition , ) + """Entity design_make_from_relationship definition.""" + + def __init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + ): + product_definition_relationship.__init__( + self, + inherited0__id, + inherited1__name, + inherited2__description, + inherited3__relating_product_definition, + inherited4__related_product_definition, + ) + #################### - # ENTITY definitional_representation # +# ENTITY definitional_representation # #################### class definitional_representation(representation): - '''Entity definitional_representation definition. - ''' - def __init__( self , inherited0__name , inherited1__items , inherited2__context_of_items , ): - representation.__init__(self , inherited0__name , inherited1__items , inherited2__context_of_items , ) - def wr1(self): - eval_wr1_wr = ('CONFIG_CONTROL_DESIGN.PARAMETRIC_REPRESENTATION_CONTEXT' == TYPEOF(self.self.representation.self.context_of_items)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity definitional_representation definition.""" + + def __init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ): + representation.__init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ) + + def wr1(self): + eval_wr1_wr = "CONFIG_CONTROL_DESIGN.PARAMETRIC_REPRESENTATION_CONTEXT" == TYPEOF( + self.self.representation.self.context_of_items + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY product_definition_shape # +# ENTITY product_definition_shape # #################### class product_definition_shape(property_definition): - '''Entity product_definition_shape definition. - ''' - def __init__( self , inherited0__name , inherited1__description , inherited2__definition , ): - property_definition.__init__(self , inherited0__name , inherited1__description , inherited2__definition , ) - def wr1(self): - eval_wr1_wr = ( not ('CONFIG_CONTROL_DESIGN.SHAPE_DEFINITION' == TYPEOF(self.self.property_definition.self.definition))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity product_definition_shape definition.""" + + def __init__( + self, + inherited0__name, + inherited1__description, + inherited2__definition, + ): + property_definition.__init__( + self, + inherited0__name, + inherited1__description, + inherited2__definition, + ) + + def wr1(self): + eval_wr1_wr = not ( + "CONFIG_CONTROL_DESIGN.SHAPE_DEFINITION" + == TYPEOF(self.self.property_definition.self.definition) + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY si_unit # +# ENTITY si_unit # #################### class si_unit(named_unit): - '''Entity si_unit definition. + """Entity si_unit definition. - :param prefix - :type prefix:si_prefix + :param prefix + :type prefix:si_prefix - :param name - :type name:si_unit_name + :param name + :type name:si_unit_name - :param named_unit_dimensions - :type named_unit_dimensions:dimensional_exponents - ''' - def __init__( self , inherited0__dimensions , prefix,name, ): - named_unit.__init__(self , inherited0__dimensions , ) - self.prefix = prefix - self.name = name + :param named_unit_dimensions + :type named_unit_dimensions:dimensional_exponents + """ - @apply - def prefix(): - def fget( self ): - return self._prefix - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,si_prefix): - self._prefix = si_prefix(value) - else: - self._prefix = value - else: - self._prefix = value - return property(**locals()) + def __init__( + self, + inherited0__dimensions, + prefix, + name, + ): + named_unit.__init__( + self, + inherited0__dimensions, + ) + self.prefix = prefix + self.name = name - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,si_unit_name): - self._name = si_unit_name(value) - else: - self._name = value - return property(**locals()) + @apply + def prefix(): + def fget(self): + return self._prefix + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, si_prefix): + self._prefix = si_prefix(value) + else: + self._prefix = value + else: + self._prefix = value + + return property(**locals()) + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, si_unit_name): + self._name = si_unit_name(value) + else: + self._name = value + + return property(**locals()) + + @apply + def named_unit_dimensions(): + def fget(self): + attribute_eval = dimensions_for_si_unit(self.self.name) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument named_unit_dimensions is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) - @apply - def named_unit_dimensions(): - def fget( self ): - attribute_eval = dimensions_for_si_unit(self.self.name) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument named_unit_dimensions is DERIVED. It is computed and can not be set to any value') - return property(**locals()) #################### - # ENTITY bezier_surface # +# ENTITY bezier_surface # #################### class bezier_surface(b_spline_surface): - '''Entity bezier_surface definition. - ''' - def __init__( self , inherited0__name , inherited1__u_degree , inherited2__v_degree , inherited3__control_points_list , inherited4__surface_form , inherited5__u_closed , inherited6__v_closed , inherited7__self_intersect , ): - b_spline_surface.__init__(self , inherited0__name , inherited1__u_degree , inherited2__v_degree , inherited3__control_points_list , inherited4__surface_form , inherited5__u_closed , inherited6__v_closed , inherited7__self_intersect , ) + """Entity bezier_surface definition.""" + + def __init__( + self, + inherited0__name, + inherited1__u_degree, + inherited2__v_degree, + inherited3__control_points_list, + inherited4__surface_form, + inherited5__u_closed, + inherited6__v_closed, + inherited7__self_intersect, + ): + b_spline_surface.__init__( + self, + inherited0__name, + inherited1__u_degree, + inherited2__v_degree, + inherited3__control_points_list, + inherited4__surface_form, + inherited5__u_closed, + inherited6__v_closed, + inherited7__self_intersect, + ) + #################### - # ENTITY certification_assignment # +# ENTITY certification_assignment # #################### class certification_assignment(BaseEntityClass): - '''Entity certification_assignment definition. + """Entity certification_assignment definition. - :param assigned_certification - :type assigned_certification:certification - ''' - def __init__( self , assigned_certification, ): - self.assigned_certification = assigned_certification + :param assigned_certification + :type assigned_certification:certification + """ + + def __init__( + self, + assigned_certification, + ): + self.assigned_certification = assigned_certification + + @apply + def assigned_certification(): + def fget(self): + return self._assigned_certification + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument assigned_certification is mantatory and can not be set to None" + ) + if not check_type(value, certification): + self._assigned_certification = certification(value) + else: + self._assigned_certification = value + + return property(**locals()) - @apply - def assigned_certification(): - def fget( self ): - return self._assigned_certification - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument assigned_certification is mantatory and can not be set to None') - if not check_type(value,certification): - self._assigned_certification = certification(value) - else: - self._assigned_certification = value - return property(**locals()) #################### - # ENTITY start_work # +# ENTITY start_work # #################### class start_work(action_assignment): - '''Entity start_work definition. + """Entity start_work definition. - :param items - :type items:SET(1,None,'work_item', scope = schema_scope) - ''' - def __init__( self , inherited0__assigned_action , items, ): - action_assignment.__init__(self , inherited0__assigned_action , ) - self.items = items + :param items + :type items:SET(1,None,'work_item', scope = schema_scope) + """ + + def __init__( + self, + inherited0__assigned_action, + items, + ): + action_assignment.__init__( + self, + inherited0__assigned_action, + ) + self.items = items + + @apply + def items(): + def fget(self): + return self._items + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument items is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "work_item", scope=schema_scope)): + self._items = SET(value) + else: + self._items = value + + return property(**locals()) - @apply - def items(): - def fget( self ): - return self._items - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument items is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'work_item', scope = schema_scope)): - self._items = SET(value) - else: - self._items = value - return property(**locals()) #################### - # ENTITY contract_type # +# ENTITY contract_type # #################### class contract_type(BaseEntityClass): - '''Entity contract_type definition. + """Entity contract_type definition. - :param description - :type description:label - ''' - def __init__( self , description, ): - self.description = description + :param description + :type description:label + """ + + def __init__( + self, + description, + ): + self.description = description + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, label): + self._description = label(value) + else: + self._description = value + + return property(**locals()) - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,label): - self._description = label(value) - else: - self._description = value - return property(**locals()) #################### - # ENTITY b_spline_curve_with_knots # +# ENTITY b_spline_curve_with_knots # #################### class b_spline_curve_with_knots(b_spline_curve): - '''Entity b_spline_curve_with_knots definition. + """Entity b_spline_curve_with_knots definition. - :param knot_multiplicities - :type knot_multiplicities:LIST(2,None,'INTEGER', scope = schema_scope) + :param knot_multiplicities + :type knot_multiplicities:LIST(2,None,'INTEGER', scope = schema_scope) - :param knots - :type knots:LIST(2,None,'REAL', scope = schema_scope) + :param knots + :type knots:LIST(2,None,'REAL', scope = schema_scope) - :param knot_spec - :type knot_spec:knot_type + :param knot_spec + :type knot_spec:knot_type - :param upper_index_on_knots - :type upper_index_on_knots:INTEGER - ''' - def __init__( self , inherited0__name , inherited1__degree , inherited2__control_points_list , inherited3__curve_form , inherited4__closed_curve , inherited5__self_intersect , knot_multiplicities,knots,knot_spec, ): - b_spline_curve.__init__(self , inherited0__name , inherited1__degree , inherited2__control_points_list , inherited3__curve_form , inherited4__closed_curve , inherited5__self_intersect , ) - self.knot_multiplicities = knot_multiplicities - self.knots = knots - self.knot_spec = knot_spec + :param upper_index_on_knots + :type upper_index_on_knots:INTEGER + """ - @apply - def knot_multiplicities(): - def fget( self ): - return self._knot_multiplicities - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument knot_multiplicities is mantatory and can not be set to None') - if not check_type(value,LIST(2,None,'INTEGER', scope = schema_scope)): - self._knot_multiplicities = LIST(value) - else: - self._knot_multiplicities = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__degree, + inherited2__control_points_list, + inherited3__curve_form, + inherited4__closed_curve, + inherited5__self_intersect, + knot_multiplicities, + knots, + knot_spec, + ): + b_spline_curve.__init__( + self, + inherited0__name, + inherited1__degree, + inherited2__control_points_list, + inherited3__curve_form, + inherited4__closed_curve, + inherited5__self_intersect, + ) + self.knot_multiplicities = knot_multiplicities + self.knots = knots + self.knot_spec = knot_spec - @apply - def knots(): - def fget( self ): - return self._knots - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument knots is mantatory and can not be set to None') - if not check_type(value,LIST(2,None,'REAL', scope = schema_scope)): - self._knots = LIST(value) - else: - self._knots = value - return property(**locals()) + @apply + def knot_multiplicities(): + def fget(self): + return self._knot_multiplicities - @apply - def knot_spec(): - def fget( self ): - return self._knot_spec - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument knot_spec is mantatory and can not be set to None') - if not check_type(value,knot_type): - self._knot_spec = knot_type(value) - else: - self._knot_spec = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument knot_multiplicities is mantatory and can not be set to None" + ) + if not check_type(value, LIST(2, None, "INTEGER", scope=schema_scope)): + self._knot_multiplicities = LIST(value) + else: + self._knot_multiplicities = value - @apply - def upper_index_on_knots(): - def fget( self ): - attribute_eval = SIZEOF(self.knots) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument upper_index_on_knots is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = constraints_param_b_spline(self.degree,self.upper_index_on_knots,self.upper_index_on_control_points,self.knot_multiplicities,self.knots) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + return property(**locals()) - def wr2(self): - eval_wr2_wr = (SIZEOF(self.knot_multiplicities) == self.upper_index_on_knots) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + @apply + def knots(): + def fget(self): + return self._knots + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument knots is mantatory and can not be set to None") + if not check_type(value, LIST(2, None, "REAL", scope=schema_scope)): + self._knots = LIST(value) + else: + self._knots = value + + return property(**locals()) + + @apply + def knot_spec(): + def fget(self): + return self._knot_spec + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument knot_spec is mantatory and can not be set to None") + if not check_type(value, knot_type): + self._knot_spec = knot_type(value) + else: + self._knot_spec = value + + return property(**locals()) + + @apply + def upper_index_on_knots(): + def fget(self): + attribute_eval = SIZEOF(self.knots) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument upper_index_on_knots is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = constraints_param_b_spline( + self.degree, + self.upper_index_on_knots, + self.upper_index_on_control_points, + self.knot_multiplicities, + self.knots, + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = SIZEOF(self.knot_multiplicities) == self.upper_index_on_knots + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr #################### - # ENTITY cc_design_approval # +# ENTITY cc_design_approval # #################### class cc_design_approval(approval_assignment): - '''Entity cc_design_approval definition. + """Entity cc_design_approval definition. - :param items - :type items:SET(1,None,'approved_item', scope = schema_scope) - ''' - def __init__( self , inherited0__assigned_approval , items, ): - approval_assignment.__init__(self , inherited0__assigned_approval , ) - self.items = items + :param items + :type items:SET(1,None,'approved_item', scope = schema_scope) + """ + + def __init__( + self, + inherited0__assigned_approval, + items, + ): + approval_assignment.__init__( + self, + inherited0__assigned_approval, + ) + self.items = items + + @apply + def items(): + def fget(self): + return self._items + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument items is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "approved_item", scope=schema_scope)): + self._items = SET(value) + else: + self._items = value + + return property(**locals()) - @apply - def items(): - def fget( self ): - return self._items - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument items is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'approved_item', scope = schema_scope)): - self._items = SET(value) - else: - self._items = value - return property(**locals()) #################### - # ENTITY edge_based_wireframe_shape_representation # +# ENTITY edge_based_wireframe_shape_representation # #################### class edge_based_wireframe_shape_representation(shape_representation): - '''Entity edge_based_wireframe_shape_representation definition. - ''' - def __init__( self , inherited0__name , inherited1__items , inherited2__context_of_items , ): - shape_representation.__init__(self , inherited0__name , inherited1__items , inherited2__context_of_items , ) - def wr1(self): - eval_wr1_wr = (SIZEOF(None) == 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity edge_based_wireframe_shape_representation definition.""" - def wr2(self): - eval_wr2_wr = (SIZEOF(None) >= 1) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def __init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ): + shape_representation.__init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ) - def wr3(self): - eval_wr3_wr = (SIZEOF(None) == 0) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + def wr1(self): + eval_wr1_wr = SIZEOF(None) == 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr4(self): - eval_wr4_wr = (SIZEOF(None) == 0) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + def wr2(self): + eval_wr2_wr = SIZEOF(None) >= 1 + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr - def wr5(self): - eval_wr5_wr = (SIZEOF(None) == 0) - if not eval_wr5_wr: - raise AssertionError('Rule wr5 violated') - else: - return eval_wr5_wr + def wr3(self): + eval_wr3_wr = SIZEOF(None) == 0 + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr - def wr6(self): - eval_wr6_wr = (SIZEOF(None) == 0) - if not eval_wr6_wr: - raise AssertionError('Rule wr6 violated') - else: - return eval_wr6_wr + def wr4(self): + eval_wr4_wr = SIZEOF(None) == 0 + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr - def wr7(self): - eval_wr7_wr = (SIZEOF(None) == 0) - if not eval_wr7_wr: - raise AssertionError('Rule wr7 violated') - else: - return eval_wr7_wr + def wr5(self): + eval_wr5_wr = SIZEOF(None) == 0 + if not eval_wr5_wr: + raise AssertionError("Rule wr5 violated") + else: + return eval_wr5_wr - def wr8(self): - eval_wr8_wr = (SIZEOF(None) == 0) - if not eval_wr8_wr: - raise AssertionError('Rule wr8 violated') - else: - return eval_wr8_wr + def wr6(self): + eval_wr6_wr = SIZEOF(None) == 0 + if not eval_wr6_wr: + raise AssertionError("Rule wr6 violated") + else: + return eval_wr6_wr - def wr9(self): - eval_wr9_wr = (self.self.context_of_items.self.geometric_representation_context.self.coordinate_space_dimension == 3) - if not eval_wr9_wr: - raise AssertionError('Rule wr9 violated') - else: - return eval_wr9_wr + def wr7(self): + eval_wr7_wr = SIZEOF(None) == 0 + if not eval_wr7_wr: + raise AssertionError("Rule wr7 violated") + else: + return eval_wr7_wr + + def wr8(self): + eval_wr8_wr = SIZEOF(None) == 0 + if not eval_wr8_wr: + raise AssertionError("Rule wr8 violated") + else: + return eval_wr8_wr + + def wr9(self): + eval_wr9_wr = ( + self.self.context_of_items.self.geometric_representation_context.self.coordinate_space_dimension + == 3 + ) + if not eval_wr9_wr: + raise AssertionError("Rule wr9 violated") + else: + return eval_wr9_wr #################### - # ENTITY geometrically_bounded_wireframe_shape_representation # +# ENTITY geometrically_bounded_wireframe_shape_representation # #################### class geometrically_bounded_wireframe_shape_representation(shape_representation): - '''Entity geometrically_bounded_wireframe_shape_representation definition. - ''' - def __init__( self , inherited0__name , inherited1__items , inherited2__context_of_items , ): - shape_representation.__init__(self , inherited0__name , inherited1__items , inherited2__context_of_items , ) - def wr1(self): - eval_wr1_wr = (SIZEOF(None) == 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity geometrically_bounded_wireframe_shape_representation definition.""" - def wr2(self): - eval_wr2_wr = (SIZEOF(None) >= 1) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def __init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ): + shape_representation.__init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ) - def wr3(self): - eval_wr3_wr = (SIZEOF(None) == 0) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + def wr1(self): + eval_wr1_wr = SIZEOF(None) == 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr4(self): - eval_wr4_wr = (SIZEOF(None) == 0) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + def wr2(self): + eval_wr2_wr = SIZEOF(None) >= 1 + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr - def wr5(self): - eval_wr5_wr = (SIZEOF(None) == 0) - if not eval_wr5_wr: - raise AssertionError('Rule wr5 violated') - else: - return eval_wr5_wr + def wr3(self): + eval_wr3_wr = SIZEOF(None) == 0 + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr - def wr6(self): - eval_wr6_wr = (SIZEOF(None) == 0) - if not eval_wr6_wr: - raise AssertionError('Rule wr6 violated') - else: - return eval_wr6_wr + def wr4(self): + eval_wr4_wr = SIZEOF(None) == 0 + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr - def wr7(self): - eval_wr7_wr = (SIZEOF(None) == 0) - if not eval_wr7_wr: - raise AssertionError('Rule wr7 violated') - else: - return eval_wr7_wr + def wr5(self): + eval_wr5_wr = SIZEOF(None) == 0 + if not eval_wr5_wr: + raise AssertionError("Rule wr5 violated") + else: + return eval_wr5_wr + + def wr6(self): + eval_wr6_wr = SIZEOF(None) == 0 + if not eval_wr6_wr: + raise AssertionError("Rule wr6 violated") + else: + return eval_wr6_wr + + def wr7(self): + eval_wr7_wr = SIZEOF(None) == 0 + if not eval_wr7_wr: + raise AssertionError("Rule wr7 violated") + else: + return eval_wr7_wr #################### - # ENTITY product_concept # +# ENTITY product_concept # #################### class product_concept(BaseEntityClass): - '''Entity product_concept definition. + """Entity product_concept definition. - :param id - :type id:identifier + :param id + :type id:identifier - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param market_context - :type market_context:product_concept_context - ''' - def __init__( self , id,name,description,market_context, ): - self.id = id - self.name = name - self.description = description - self.market_context = market_context + :param market_context + :type market_context:product_concept_context + """ - @apply - def id(): - def fget( self ): - return self._id - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument id is mantatory and can not be set to None') - if not check_type(value,identifier): - self._id = identifier(value) - else: - self._id = value - return property(**locals()) + def __init__( + self, + id, + name, + description, + market_context, + ): + self.id = id + self.name = name + self.description = description + self.market_context = market_context - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + @apply + def id(): + def fget(self): + return self._id - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument id is mantatory and can not be set to None") + if not check_type(value, identifier): + self._id = identifier(value) + else: + self._id = value + + return property(**locals()) + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def market_context(): + def fget(self): + return self._market_context + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument market_context is mantatory and can not be set to None" + ) + if not check_type(value, product_concept_context): + self._market_context = product_concept_context(value) + else: + self._market_context = value + + return property(**locals()) - @apply - def market_context(): - def fget( self ): - return self._market_context - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument market_context is mantatory and can not be set to None') - if not check_type(value,product_concept_context): - self._market_context = product_concept_context(value) - else: - self._market_context = value - return property(**locals()) #################### - # ENTITY cc_design_contract # +# ENTITY cc_design_contract # #################### class cc_design_contract(contract_assignment): - '''Entity cc_design_contract definition. + """Entity cc_design_contract definition. - :param items - :type items:SET(1,None,'contracted_item', scope = schema_scope) - ''' - def __init__( self , inherited0__assigned_contract , items, ): - contract_assignment.__init__(self , inherited0__assigned_contract , ) - self.items = items + :param items + :type items:SET(1,None,'contracted_item', scope = schema_scope) + """ + + def __init__( + self, + inherited0__assigned_contract, + items, + ): + contract_assignment.__init__( + self, + inherited0__assigned_contract, + ) + self.items = items + + @apply + def items(): + def fget(self): + return self._items + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument items is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "contracted_item", scope=schema_scope)): + self._items = SET(value) + else: + self._items = value + + return property(**locals()) - @apply - def items(): - def fget( self ): - return self._items - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument items is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'contracted_item', scope = schema_scope)): - self._items = SET(value) - else: - self._items = value - return property(**locals()) #################### - # ENTITY seam_curve # +# ENTITY seam_curve # #################### class seam_curve(surface_curve): - '''Entity seam_curve definition. - ''' - def __init__( self , inherited0__name , inherited1__curve_3d , inherited2__associated_geometry , inherited3__master_representation , ): - surface_curve.__init__(self , inherited0__name , inherited1__curve_3d , inherited2__associated_geometry , inherited3__master_representation , ) - def wr1(self): - eval_wr1_wr = (SIZEOF(self.self.surface_curve.self.associated_geometry) == 2) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity seam_curve definition.""" - def wr2(self): - eval_wr2_wr = (associated_surface(self.self.surface_curve.self.associated_geometry[1]) == associated_surface(self.self.surface_curve.self.associated_geometry[2])) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def __init__( + self, + inherited0__name, + inherited1__curve_3d, + inherited2__associated_geometry, + inherited3__master_representation, + ): + surface_curve.__init__( + self, + inherited0__name, + inherited1__curve_3d, + inherited2__associated_geometry, + inherited3__master_representation, + ) - def wr3(self): - eval_wr3_wr = ('CONFIG_CONTROL_DESIGN.PCURVE' == TYPEOF(self.self.surface_curve.self.associated_geometry[1])) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + def wr1(self): + eval_wr1_wr = SIZEOF(self.self.surface_curve.self.associated_geometry) == 2 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr4(self): - eval_wr4_wr = ('CONFIG_CONTROL_DESIGN.PCURVE' == TYPEOF(self.self.surface_curve.self.associated_geometry[2])) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + def wr2(self): + eval_wr2_wr = associated_surface( + self.self.surface_curve.self.associated_geometry[1] + ) == associated_surface(self.self.surface_curve.self.associated_geometry[2]) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr + + def wr3(self): + eval_wr3_wr = "CONFIG_CONTROL_DESIGN.PCURVE" == TYPEOF( + self.self.surface_curve.self.associated_geometry[1] + ) + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr + + def wr4(self): + eval_wr4_wr = "CONFIG_CONTROL_DESIGN.PCURVE" == TYPEOF( + self.self.surface_curve.self.associated_geometry[2] + ) + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr #################### - # ENTITY axis2_placement_3d # +# ENTITY axis2_placement_3d # #################### class axis2_placement_3d(placement): - '''Entity axis2_placement_3d definition. + """Entity axis2_placement_3d definition. - :param axis - :type axis:direction + :param axis + :type axis:direction - :param ref_direction - :type ref_direction:direction + :param ref_direction + :type ref_direction:direction - :param p - :type p:LIST(3,3,'direction', scope = schema_scope) - ''' - def __init__( self , inherited0__name , inherited1__location , axis,ref_direction, ): - placement.__init__(self , inherited0__name , inherited1__location , ) - self.axis = axis - self.ref_direction = ref_direction + :param p + :type p:LIST(3,3,'direction', scope = schema_scope) + """ - @apply - def axis(): - def fget( self ): - return self._axis - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,direction): - self._axis = direction(value) - else: - self._axis = value - else: - self._axis = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__location, + axis, + ref_direction, + ): + placement.__init__( + self, + inherited0__name, + inherited1__location, + ) + self.axis = axis + self.ref_direction = ref_direction - @apply - def ref_direction(): - def fget( self ): - return self._ref_direction - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,direction): - self._ref_direction = direction(value) - else: - self._ref_direction = value - else: - self._ref_direction = value - return property(**locals()) + @apply + def axis(): + def fget(self): + return self._axis - @apply - def p(): - def fget( self ): - attribute_eval = build_axes(self.axis,self.ref_direction) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument p is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.self.placement.self.location.self.dim == 3) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, direction): + self._axis = direction(value) + else: + self._axis = value + else: + self._axis = value - def wr2(self): - eval_wr2_wr = (( not EXISTS(self.axis)) or (self.axis.self.dim == 3)) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + return property(**locals()) - def wr3(self): - eval_wr3_wr = (( not EXISTS(self.ref_direction)) or (self.ref_direction.self.dim == 3)) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + @apply + def ref_direction(): + def fget(self): + return self._ref_direction - def wr4(self): - eval_wr4_wr = ((( not EXISTS(self.axis)) or ( not EXISTS(self.ref_direction))) or (cross_product(self.axis,self.ref_direction).self.magnitude > 0)) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, direction): + self._ref_direction = direction(value) + else: + self._ref_direction = value + else: + self._ref_direction = value + + return property(**locals()) + + @apply + def p(): + def fget(self): + attribute_eval = build_axes(self.axis, self.ref_direction) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument p is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.self.placement.self.location.self.dim == 3 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = (not EXISTS(self.axis)) or (self.axis.self.dim == 3) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr + + def wr3(self): + eval_wr3_wr = (not EXISTS(self.ref_direction)) or (self.ref_direction.self.dim == 3) + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr + + def wr4(self): + eval_wr4_wr = ((not EXISTS(self.axis)) or (not EXISTS(self.ref_direction))) or ( + cross_product(self.axis, self.ref_direction).self.magnitude > 0 + ) + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr #################### - # ENTITY rational_b_spline_surface # +# ENTITY rational_b_spline_surface # #################### class rational_b_spline_surface(b_spline_surface): - '''Entity rational_b_spline_surface definition. + """Entity rational_b_spline_surface definition. - :param weights_data - :type weights_data:LIST(2,None,LIST(2,None,'REAL', scope = schema_scope)) + :param weights_data + :type weights_data:LIST(2,None,LIST(2,None,'REAL', scope = schema_scope)) - :param weights - :type weights:ARRAY(0,u_upper,ARRAY(0,v_upper,'REAL', scope = schema_scope)) - ''' - def __init__( self , inherited0__name , inherited1__u_degree , inherited2__v_degree , inherited3__control_points_list , inherited4__surface_form , inherited5__u_closed , inherited6__v_closed , inherited7__self_intersect , weights_data, ): - b_spline_surface.__init__(self , inherited0__name , inherited1__u_degree , inherited2__v_degree , inherited3__control_points_list , inherited4__surface_form , inherited5__u_closed , inherited6__v_closed , inherited7__self_intersect , ) - self.weights_data = weights_data + :param weights + :type weights:ARRAY(0,u_upper,ARRAY(0,v_upper,'REAL', scope = schema_scope)) + """ - @apply - def weights_data(): - def fget( self ): - return self._weights_data - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument weights_data is mantatory and can not be set to None') - if not check_type(value,LIST(2,None,LIST(2,None,'REAL', scope = schema_scope))): - self._weights_data = LIST(value) - else: - self._weights_data = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__u_degree, + inherited2__v_degree, + inherited3__control_points_list, + inherited4__surface_form, + inherited5__u_closed, + inherited6__v_closed, + inherited7__self_intersect, + weights_data, + ): + b_spline_surface.__init__( + self, + inherited0__name, + inherited1__u_degree, + inherited2__v_degree, + inherited3__control_points_list, + inherited4__surface_form, + inherited5__u_closed, + inherited6__v_closed, + inherited7__self_intersect, + ) + self.weights_data = weights_data - @apply - def weights(): - def fget( self ): - attribute_eval = make_array_of_array(self.weights_data,0,self.u_upper,0,self.v_upper) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument weights is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = ((SIZEOF(self.weights_data) == SIZEOF(self.self.b_spline_surface.self.control_points_list)) and (SIZEOF(self.weights_data[1]) == SIZEOF(self.self.b_spline_surface.self.control_points_list[1]))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def weights_data(): + def fget(self): + return self._weights_data - def wr2(self): - eval_wr2_wr = surface_weights_positive(self) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument weights_data is mantatory and can not be set to None" + ) + if not check_type(value, LIST(2, None, LIST(2, None, "REAL", scope=schema_scope))): + self._weights_data = LIST(value) + else: + self._weights_data = value + + return property(**locals()) + + @apply + def weights(): + def fget(self): + attribute_eval = make_array_of_array( + self.weights_data, 0, self.u_upper, 0, self.v_upper + ) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument weights is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = ( + SIZEOF(self.weights_data) == SIZEOF(self.self.b_spline_surface.self.control_points_list) + ) and ( + SIZEOF(self.weights_data[1]) + == SIZEOF(self.self.b_spline_surface.self.control_points_list[1]) + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = surface_weights_positive(self) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr #################### - # ENTITY configuration_design # +# ENTITY configuration_design # #################### class configuration_design(BaseEntityClass): - '''Entity configuration_design definition. + """Entity configuration_design definition. - :param configuration - :type configuration:configuration_item + :param configuration + :type configuration:configuration_item - :param design - :type design:product_definition_formation - ''' - def __init__( self , configuration,design, ): - self.configuration = configuration - self.design = design + :param design + :type design:product_definition_formation + """ - @apply - def configuration(): - def fget( self ): - return self._configuration - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument configuration is mantatory and can not be set to None') - if not check_type(value,configuration_item): - self._configuration = configuration_item(value) - else: - self._configuration = value - return property(**locals()) + def __init__( + self, + configuration, + design, + ): + self.configuration = configuration + self.design = design + + @apply + def configuration(): + def fget(self): + return self._configuration + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument configuration is mantatory and can not be set to None" + ) + if not check_type(value, configuration_item): + self._configuration = configuration_item(value) + else: + self._configuration = value + + return property(**locals()) + + @apply + def design(): + def fget(self): + return self._design + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument design is mantatory and can not be set to None") + if not check_type(value, product_definition_formation): + self._design = product_definition_formation(value) + else: + self._design = value + + return property(**locals()) - @apply - def design(): - def fget( self ): - return self._design - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument design is mantatory and can not be set to None') - if not check_type(value,product_definition_formation): - self._design = product_definition_formation(value) - else: - self._design = value - return property(**locals()) #################### - # ENTITY design_context # +# ENTITY design_context # #################### class design_context(product_definition_context): - '''Entity design_context definition. - ''' - def __init__( self , inherited0__name , inherited1__frame_of_reference , inherited2__life_cycle_stage , ): - product_definition_context.__init__(self , inherited0__name , inherited1__frame_of_reference , inherited2__life_cycle_stage , ) - def wr1(self): - eval_wr1_wr = (self.self.life_cycle_stage == 'design') - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity design_context definition.""" + + def __init__( + self, + inherited0__name, + inherited1__frame_of_reference, + inherited2__life_cycle_stage, + ): + product_definition_context.__init__( + self, + inherited0__name, + inherited1__frame_of_reference, + inherited2__life_cycle_stage, + ) + + def wr1(self): + eval_wr1_wr = self.self.life_cycle_stage == "design" + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY product_definition # +# ENTITY product_definition # #################### class product_definition(BaseEntityClass): - '''Entity product_definition definition. + """Entity product_definition definition. - :param id - :type id:identifier + :param id + :type id:identifier - :param description - :type description:text + :param description + :type description:text - :param formation - :type formation:product_definition_formation + :param formation + :type formation:product_definition_formation - :param frame_of_reference - :type frame_of_reference:product_definition_context - ''' - def __init__( self , id,description,formation,frame_of_reference, ): - self.id = id - self.description = description - self.formation = formation - self.frame_of_reference = frame_of_reference + :param frame_of_reference + :type frame_of_reference:product_definition_context + """ - @apply - def id(): - def fget( self ): - return self._id - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument id is mantatory and can not be set to None') - if not check_type(value,identifier): - self._id = identifier(value) - else: - self._id = value - return property(**locals()) + def __init__( + self, + id, + description, + formation, + frame_of_reference, + ): + self.id = id + self.description = description + self.formation = formation + self.frame_of_reference = frame_of_reference - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def id(): + def fget(self): + return self._id - @apply - def formation(): - def fget( self ): - return self._formation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument formation is mantatory and can not be set to None') - if not check_type(value,product_definition_formation): - self._formation = product_definition_formation(value) - else: - self._formation = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument id is mantatory and can not be set to None") + if not check_type(value, identifier): + self._id = identifier(value) + else: + self._id = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def formation(): + def fget(self): + return self._formation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument formation is mantatory and can not be set to None") + if not check_type(value, product_definition_formation): + self._formation = product_definition_formation(value) + else: + self._formation = value + + return property(**locals()) + + @apply + def frame_of_reference(): + def fget(self): + return self._frame_of_reference + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument frame_of_reference is mantatory and can not be set to None" + ) + if not check_type(value, product_definition_context): + self._frame_of_reference = product_definition_context(value) + else: + self._frame_of_reference = value + + return property(**locals()) - @apply - def frame_of_reference(): - def fget( self ): - return self._frame_of_reference - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument frame_of_reference is mantatory and can not be set to None') - if not check_type(value,product_definition_context): - self._frame_of_reference = product_definition_context(value) - else: - self._frame_of_reference = value - return property(**locals()) #################### - # ENTITY product_definition_with_associated_documents # +# ENTITY product_definition_with_associated_documents # #################### class product_definition_with_associated_documents(product_definition): - '''Entity product_definition_with_associated_documents definition. + """Entity product_definition_with_associated_documents definition. - :param documentation_ids - :type documentation_ids:SET(1,None,'document', scope = schema_scope) - ''' - def __init__( self , inherited0__id , inherited1__description , inherited2__formation , inherited3__frame_of_reference , documentation_ids, ): - product_definition.__init__(self , inherited0__id , inherited1__description , inherited2__formation , inherited3__frame_of_reference , ) - self.documentation_ids = documentation_ids + :param documentation_ids + :type documentation_ids:SET(1,None,'document', scope = schema_scope) + """ + + def __init__( + self, + inherited0__id, + inherited1__description, + inherited2__formation, + inherited3__frame_of_reference, + documentation_ids, + ): + product_definition.__init__( + self, + inherited0__id, + inherited1__description, + inherited2__formation, + inherited3__frame_of_reference, + ) + self.documentation_ids = documentation_ids + + @apply + def documentation_ids(): + def fget(self): + return self._documentation_ids + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument documentation_ids is mantatory and can not be set to None" + ) + if not check_type(value, SET(1, None, "document", scope=schema_scope)): + self._documentation_ids = SET(value) + else: + self._documentation_ids = value + + return property(**locals()) - @apply - def documentation_ids(): - def fget( self ): - return self._documentation_ids - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument documentation_ids is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'document', scope = schema_scope)): - self._documentation_ids = SET(value) - else: - self._documentation_ids = value - return property(**locals()) #################### - # ENTITY organization # +# ENTITY organization # #################### class organization(BaseEntityClass): - '''Entity organization definition. + """Entity organization definition. - :param id - :type id:identifier + :param id + :type id:identifier - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text - ''' - def __init__( self , id,name,description, ): - self.id = id - self.name = name - self.description = description + :param description + :type description:text + """ - @apply - def id(): - def fget( self ): - return self._id - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,identifier): - self._id = identifier(value) - else: - self._id = value - else: - self._id = value - return property(**locals()) + def __init__( + self, + id, + name, + description, + ): + self.id = id + self.name = name + self.description = description - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + @apply + def id(): + def fget(self): + return self._id + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, identifier): + self._id = identifier(value) + else: + self._id = value + else: + self._id = value + + return property(**locals()) + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) #################### - # ENTITY cc_design_certification # +# ENTITY cc_design_certification # #################### class cc_design_certification(certification_assignment): - '''Entity cc_design_certification definition. + """Entity cc_design_certification definition. - :param items - :type items:SET(1,None,'certified_item', scope = schema_scope) - ''' - def __init__( self , inherited0__assigned_certification , items, ): - certification_assignment.__init__(self , inherited0__assigned_certification , ) - self.items = items + :param items + :type items:SET(1,None,'certified_item', scope = schema_scope) + """ + + def __init__( + self, + inherited0__assigned_certification, + items, + ): + certification_assignment.__init__( + self, + inherited0__assigned_certification, + ) + self.items = items + + @apply + def items(): + def fget(self): + return self._items + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument items is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "certified_item", scope=schema_scope)): + self._items = SET(value) + else: + self._items = value + + return property(**locals()) - @apply - def items(): - def fget( self ): - return self._items - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument items is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'certified_item', scope = schema_scope)): - self._items = SET(value) - else: - self._items = value - return property(**locals()) #################### - # ENTITY b_spline_surface_with_knots # +# ENTITY b_spline_surface_with_knots # #################### class b_spline_surface_with_knots(b_spline_surface): - '''Entity b_spline_surface_with_knots definition. + """Entity b_spline_surface_with_knots definition. - :param u_multiplicities - :type u_multiplicities:LIST(2,None,'INTEGER', scope = schema_scope) + :param u_multiplicities + :type u_multiplicities:LIST(2,None,'INTEGER', scope = schema_scope) - :param v_multiplicities - :type v_multiplicities:LIST(2,None,'INTEGER', scope = schema_scope) + :param v_multiplicities + :type v_multiplicities:LIST(2,None,'INTEGER', scope = schema_scope) - :param u_knots - :type u_knots:LIST(2,None,'REAL', scope = schema_scope) + :param u_knots + :type u_knots:LIST(2,None,'REAL', scope = schema_scope) - :param v_knots - :type v_knots:LIST(2,None,'REAL', scope = schema_scope) + :param v_knots + :type v_knots:LIST(2,None,'REAL', scope = schema_scope) - :param knot_spec - :type knot_spec:knot_type + :param knot_spec + :type knot_spec:knot_type - :param knot_u_upper - :type knot_u_upper:INTEGER + :param knot_u_upper + :type knot_u_upper:INTEGER - :param knot_v_upper - :type knot_v_upper:INTEGER - ''' - def __init__( self , inherited0__name , inherited1__u_degree , inherited2__v_degree , inherited3__control_points_list , inherited4__surface_form , inherited5__u_closed , inherited6__v_closed , inherited7__self_intersect , u_multiplicities,v_multiplicities,u_knots,v_knots,knot_spec, ): - b_spline_surface.__init__(self , inherited0__name , inherited1__u_degree , inherited2__v_degree , inherited3__control_points_list , inherited4__surface_form , inherited5__u_closed , inherited6__v_closed , inherited7__self_intersect , ) - self.u_multiplicities = u_multiplicities - self.v_multiplicities = v_multiplicities - self.u_knots = u_knots - self.v_knots = v_knots - self.knot_spec = knot_spec + :param knot_v_upper + :type knot_v_upper:INTEGER + """ - @apply - def u_multiplicities(): - def fget( self ): - return self._u_multiplicities - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument u_multiplicities is mantatory and can not be set to None') - if not check_type(value,LIST(2,None,'INTEGER', scope = schema_scope)): - self._u_multiplicities = LIST(value) - else: - self._u_multiplicities = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__u_degree, + inherited2__v_degree, + inherited3__control_points_list, + inherited4__surface_form, + inherited5__u_closed, + inherited6__v_closed, + inherited7__self_intersect, + u_multiplicities, + v_multiplicities, + u_knots, + v_knots, + knot_spec, + ): + b_spline_surface.__init__( + self, + inherited0__name, + inherited1__u_degree, + inherited2__v_degree, + inherited3__control_points_list, + inherited4__surface_form, + inherited5__u_closed, + inherited6__v_closed, + inherited7__self_intersect, + ) + self.u_multiplicities = u_multiplicities + self.v_multiplicities = v_multiplicities + self.u_knots = u_knots + self.v_knots = v_knots + self.knot_spec = knot_spec - @apply - def v_multiplicities(): - def fget( self ): - return self._v_multiplicities - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument v_multiplicities is mantatory and can not be set to None') - if not check_type(value,LIST(2,None,'INTEGER', scope = schema_scope)): - self._v_multiplicities = LIST(value) - else: - self._v_multiplicities = value - return property(**locals()) + @apply + def u_multiplicities(): + def fget(self): + return self._u_multiplicities - @apply - def u_knots(): - def fget( self ): - return self._u_knots - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument u_knots is mantatory and can not be set to None') - if not check_type(value,LIST(2,None,'REAL', scope = schema_scope)): - self._u_knots = LIST(value) - else: - self._u_knots = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument u_multiplicities is mantatory and can not be set to None" + ) + if not check_type(value, LIST(2, None, "INTEGER", scope=schema_scope)): + self._u_multiplicities = LIST(value) + else: + self._u_multiplicities = value - @apply - def v_knots(): - def fget( self ): - return self._v_knots - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument v_knots is mantatory and can not be set to None') - if not check_type(value,LIST(2,None,'REAL', scope = schema_scope)): - self._v_knots = LIST(value) - else: - self._v_knots = value - return property(**locals()) + return property(**locals()) - @apply - def knot_spec(): - def fget( self ): - return self._knot_spec - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument knot_spec is mantatory and can not be set to None') - if not check_type(value,knot_type): - self._knot_spec = knot_type(value) - else: - self._knot_spec = value - return property(**locals()) + @apply + def v_multiplicities(): + def fget(self): + return self._v_multiplicities - @apply - def knot_u_upper(): - def fget( self ): - attribute_eval = SIZEOF(self.u_knots) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument knot_u_upper is DERIVED. It is computed and can not be set to any value') - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument v_multiplicities is mantatory and can not be set to None" + ) + if not check_type(value, LIST(2, None, "INTEGER", scope=schema_scope)): + self._v_multiplicities = LIST(value) + else: + self._v_multiplicities = value - @apply - def knot_v_upper(): - def fget( self ): - attribute_eval = SIZEOF(self.v_knots) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument knot_v_upper is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = constraints_param_b_spline(self.self.b_spline_surface.self.u_degree,self.knot_u_upper,self.self.b_spline_surface.self.u_upper,self.u_multiplicities,self.u_knots) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + return property(**locals()) - def wr2(self): - eval_wr2_wr = constraints_param_b_spline(self.self.b_spline_surface.self.v_degree,self.knot_v_upper,self.self.b_spline_surface.self.v_upper,self.v_multiplicities,self.v_knots) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + @apply + def u_knots(): + def fget(self): + return self._u_knots - def wr3(self): - eval_wr3_wr = (SIZEOF(self.u_multiplicities) == self.knot_u_upper) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument u_knots is mantatory and can not be set to None") + if not check_type(value, LIST(2, None, "REAL", scope=schema_scope)): + self._u_knots = LIST(value) + else: + self._u_knots = value - def wr4(self): - eval_wr4_wr = (SIZEOF(self.v_multiplicities) == self.knot_v_upper) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + return property(**locals()) + + @apply + def v_knots(): + def fget(self): + return self._v_knots + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument v_knots is mantatory and can not be set to None") + if not check_type(value, LIST(2, None, "REAL", scope=schema_scope)): + self._v_knots = LIST(value) + else: + self._v_knots = value + + return property(**locals()) + + @apply + def knot_spec(): + def fget(self): + return self._knot_spec + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument knot_spec is mantatory and can not be set to None") + if not check_type(value, knot_type): + self._knot_spec = knot_type(value) + else: + self._knot_spec = value + + return property(**locals()) + + @apply + def knot_u_upper(): + def fget(self): + attribute_eval = SIZEOF(self.u_knots) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument knot_u_upper is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + @apply + def knot_v_upper(): + def fget(self): + attribute_eval = SIZEOF(self.v_knots) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument knot_v_upper is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = constraints_param_b_spline( + self.self.b_spline_surface.self.u_degree, + self.knot_u_upper, + self.self.b_spline_surface.self.u_upper, + self.u_multiplicities, + self.u_knots, + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = constraints_param_b_spline( + self.self.b_spline_surface.self.v_degree, + self.knot_v_upper, + self.self.b_spline_surface.self.v_upper, + self.v_multiplicities, + self.v_knots, + ) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr + + def wr3(self): + eval_wr3_wr = SIZEOF(self.u_multiplicities) == self.knot_u_upper + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr + + def wr4(self): + eval_wr4_wr = SIZEOF(self.v_multiplicities) == self.knot_v_upper + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr #################### - # ENTITY certification_type # +# ENTITY certification_type # #################### class certification_type(BaseEntityClass): - '''Entity certification_type definition. + """Entity certification_type definition. - :param description - :type description:label - ''' - def __init__( self , description, ): - self.description = description + :param description + :type description:label + """ + + def __init__( + self, + description, + ): + self.description = description + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, label): + self._description = label(value) + else: + self._description = value + + return property(**locals()) - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,label): - self._description = label(value) - else: - self._description = value - return property(**locals()) #################### - # ENTITY oriented_path # +# ENTITY oriented_path # #################### class oriented_path(path): - '''Entity oriented_path definition. + """Entity oriented_path definition. - :param path_element - :type path_element:path + :param path_element + :type path_element:path - :param orientation - :type orientation:BOOLEAN + :param orientation + :type orientation:BOOLEAN - :param path_edge_list - :type path_edge_list:LIST(1,None,'oriented_edge', scope = schema_scope) - ''' - def __init__( self , inherited0__name , inherited1__edge_list , path_element,orientation, ): - path.__init__(self , inherited0__name , inherited1__edge_list , ) - self.path_element = path_element - self.orientation = orientation + :param path_edge_list + :type path_edge_list:LIST(1,None,'oriented_edge', scope = schema_scope) + """ - @apply - def path_element(): - def fget( self ): - return self._path_element - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument path_element is mantatory and can not be set to None') - if not check_type(value,path): - self._path_element = path(value) - else: - self._path_element = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__edge_list, + path_element, + orientation, + ): + path.__init__( + self, + inherited0__name, + inherited1__edge_list, + ) + self.path_element = path_element + self.orientation = orientation - @apply - def orientation(): - def fget( self ): - return self._orientation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument orientation is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._orientation = BOOLEAN(value) - else: - self._orientation = value - return property(**locals()) + @apply + def path_element(): + def fget(self): + return self._path_element - @apply - def path_edge_list(): - def fget( self ): - attribute_eval = conditional_reverse(self.self.orientation,self.self.path_element.self.edge_list) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument path_edge_list is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = ( not ('CONFIG_CONTROL_DESIGN.ORIENTED_PATH' == TYPEOF(self.self.path_element))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument path_element is mantatory and can not be set to None" + ) + if not check_type(value, path): + self._path_element = path(value) + else: + self._path_element = value + + return property(**locals()) + + @apply + def orientation(): + def fget(self): + return self._orientation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument orientation is mantatory and can not be set to None") + if not check_type(value, BOOLEAN): + self._orientation = BOOLEAN(value) + else: + self._orientation = value + + return property(**locals()) + + @apply + def path_edge_list(): + def fget(self): + attribute_eval = conditional_reverse( + self.self.orientation, self.self.path_element.self.edge_list + ) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument path_edge_list is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = not ("CONFIG_CONTROL_DESIGN.ORIENTED_PATH" == TYPEOF(self.self.path_element)) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY security_classification # +# ENTITY security_classification # #################### class security_classification(BaseEntityClass): - '''Entity security_classification definition. + """Entity security_classification definition. - :param name - :type name:label + :param name + :type name:label - :param purpose - :type purpose:text + :param purpose + :type purpose:text - :param security_level - :type security_level:security_classification_level - ''' - def __init__( self , name,purpose,security_level, ): - self.name = name - self.purpose = purpose - self.security_level = security_level + :param security_level + :type security_level:security_classification_level + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + purpose, + security_level, + ): + self.name = name + self.purpose = purpose + self.security_level = security_level - @apply - def purpose(): - def fget( self ): - return self._purpose - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument purpose is mantatory and can not be set to None') - if not check_type(value,text): - self._purpose = text(value) - else: - self._purpose = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def purpose(): + def fget(self): + return self._purpose + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument purpose is mantatory and can not be set to None") + if not check_type(value, text): + self._purpose = text(value) + else: + self._purpose = value + + return property(**locals()) + + @apply + def security_level(): + def fget(self): + return self._security_level + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument security_level is mantatory and can not be set to None" + ) + if not check_type(value, security_classification_level): + self._security_level = security_classification_level(value) + else: + self._security_level = value + + return property(**locals()) - @apply - def security_level(): - def fget( self ): - return self._security_level - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument security_level is mantatory and can not be set to None') - if not check_type(value,security_classification_level): - self._security_level = security_classification_level(value) - else: - self._security_level = value - return property(**locals()) #################### - # ENTITY vertex_loop # +# ENTITY vertex_loop # #################### class vertex_loop(loop): - '''Entity vertex_loop definition. + """Entity vertex_loop definition. - :param loop_vertex - :type loop_vertex:vertex - ''' - def __init__( self , inherited0__name , loop_vertex, ): - loop.__init__(self , inherited0__name , ) - self.loop_vertex = loop_vertex + :param loop_vertex + :type loop_vertex:vertex + """ + + def __init__( + self, + inherited0__name, + loop_vertex, + ): + loop.__init__( + self, + inherited0__name, + ) + self.loop_vertex = loop_vertex + + @apply + def loop_vertex(): + def fget(self): + return self._loop_vertex + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument loop_vertex is mantatory and can not be set to None") + if not check_type(value, vertex): + self._loop_vertex = vertex(value) + else: + self._loop_vertex = value + + return property(**locals()) - @apply - def loop_vertex(): - def fget( self ): - return self._loop_vertex - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument loop_vertex is mantatory and can not be set to None') - if not check_type(value,vertex): - self._loop_vertex = vertex(value) - else: - self._loop_vertex = value - return property(**locals()) #################### - # ENTITY approval_status # +# ENTITY approval_status # #################### class approval_status(BaseEntityClass): - '''Entity approval_status definition. + """Entity approval_status definition. - :param name - :type name:label - ''' - def __init__( self , name, ): - self.name = name + :param name + :type name:label + """ + + def __init__( + self, + name, + ): + self.name = name + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) #################### - # ENTITY cartesian_point # +# ENTITY cartesian_point # #################### class cartesian_point(point): - '''Entity cartesian_point definition. + """Entity cartesian_point definition. - :param coordinates - :type coordinates:LIST(1,3,'REAL', scope = schema_scope) - ''' - def __init__( self , inherited0__name , coordinates, ): - point.__init__(self , inherited0__name , ) - self.coordinates = coordinates + :param coordinates + :type coordinates:LIST(1,3,'REAL', scope = schema_scope) + """ + + def __init__( + self, + inherited0__name, + coordinates, + ): + point.__init__( + self, + inherited0__name, + ) + self.coordinates = coordinates + + @apply + def coordinates(): + def fget(self): + return self._coordinates + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument coordinates is mantatory and can not be set to None") + if not check_type(value, LIST(1, 3, "REAL", scope=schema_scope)): + self._coordinates = LIST(value) + else: + self._coordinates = value + + return property(**locals()) - @apply - def coordinates(): - def fget( self ): - return self._coordinates - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument coordinates is mantatory and can not be set to None') - if not check_type(value,LIST(1,3,'REAL', scope = schema_scope)): - self._coordinates = LIST(value) - else: - self._coordinates = value - return property(**locals()) #################### - # ENTITY date_and_time_assignment # +# ENTITY date_and_time_assignment # #################### class date_and_time_assignment(BaseEntityClass): - '''Entity date_and_time_assignment definition. + """Entity date_and_time_assignment definition. - :param assigned_date_and_time - :type assigned_date_and_time:date_and_time + :param assigned_date_and_time + :type assigned_date_and_time:date_and_time - :param role - :type role:date_time_role - ''' - def __init__( self , assigned_date_and_time,role, ): - self.assigned_date_and_time = assigned_date_and_time - self.role = role + :param role + :type role:date_time_role + """ - @apply - def assigned_date_and_time(): - def fget( self ): - return self._assigned_date_and_time - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument assigned_date_and_time is mantatory and can not be set to None') - if not check_type(value,date_and_time): - self._assigned_date_and_time = date_and_time(value) - else: - self._assigned_date_and_time = value - return property(**locals()) + def __init__( + self, + assigned_date_and_time, + role, + ): + self.assigned_date_and_time = assigned_date_and_time + self.role = role + + @apply + def assigned_date_and_time(): + def fget(self): + return self._assigned_date_and_time + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument assigned_date_and_time is mantatory and can not be set to None" + ) + if not check_type(value, date_and_time): + self._assigned_date_and_time = date_and_time(value) + else: + self._assigned_date_and_time = value + + return property(**locals()) + + @apply + def role(): + def fget(self): + return self._role + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument role is mantatory and can not be set to None") + if not check_type(value, date_time_role): + self._role = date_time_role(value) + else: + self._role = value + + return property(**locals()) - @apply - def role(): - def fget( self ): - return self._role - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument role is mantatory and can not be set to None') - if not check_type(value,date_time_role): - self._role = date_time_role(value) - else: - self._role = value - return property(**locals()) #################### - # ENTITY parametric_representation_context # +# ENTITY parametric_representation_context # #################### class parametric_representation_context(representation_context): - '''Entity parametric_representation_context definition. - ''' - def __init__( self , inherited0__context_identifier , inherited1__context_type , ): - representation_context.__init__(self , inherited0__context_identifier , inherited1__context_type , ) + """Entity parametric_representation_context definition.""" + + def __init__( + self, + inherited0__context_identifier, + inherited1__context_type, + ): + representation_context.__init__( + self, + inherited0__context_identifier, + inherited1__context_type, + ) + #################### - # ENTITY product_concept_context # +# ENTITY product_concept_context # #################### class product_concept_context(application_context_element): - '''Entity product_concept_context definition. + """Entity product_concept_context definition. - :param market_segment_type - :type market_segment_type:label - ''' - def __init__( self , inherited0__name , inherited1__frame_of_reference , market_segment_type, ): - application_context_element.__init__(self , inherited0__name , inherited1__frame_of_reference , ) - self.market_segment_type = market_segment_type + :param market_segment_type + :type market_segment_type:label + """ + + def __init__( + self, + inherited0__name, + inherited1__frame_of_reference, + market_segment_type, + ): + application_context_element.__init__( + self, + inherited0__name, + inherited1__frame_of_reference, + ) + self.market_segment_type = market_segment_type + + @apply + def market_segment_type(): + def fget(self): + return self._market_segment_type + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument market_segment_type is mantatory and can not be set to None" + ) + if not check_type(value, label): + self._market_segment_type = label(value) + else: + self._market_segment_type = value + + return property(**locals()) - @apply - def market_segment_type(): - def fget( self ): - return self._market_segment_type - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument market_segment_type is mantatory and can not be set to None') - if not check_type(value,label): - self._market_segment_type = label(value) - else: - self._market_segment_type = value - return property(**locals()) #################### - # ENTITY surface_patch # +# ENTITY surface_patch # #################### class surface_patch(founded_item): - '''Entity surface_patch definition. + """Entity surface_patch definition. - :param parent_surface - :type parent_surface:bounded_surface + :param parent_surface + :type parent_surface:bounded_surface - :param u_transition - :type u_transition:transition_code + :param u_transition + :type u_transition:transition_code - :param v_transition - :type v_transition:transition_code + :param v_transition + :type v_transition:transition_code - :param u_sense - :type u_sense:BOOLEAN + :param u_sense + :type u_sense:BOOLEAN - :param v_sense - :type v_sense:BOOLEAN + :param v_sense + :type v_sense:BOOLEAN - :param using_surfaces - :type using_surfaces:BAG(1,None,'rectangular_composite_surface', scope = schema_scope) - ''' - def __init__( self , parent_surface,u_transition,v_transition,u_sense,v_sense, ): - founded_item.__init__(self , ) - self.parent_surface = parent_surface - self.u_transition = u_transition - self.v_transition = v_transition - self.u_sense = u_sense - self.v_sense = v_sense + :param using_surfaces + :type using_surfaces:BAG(1,None,'rectangular_composite_surface', scope = schema_scope) + """ - @apply - def parent_surface(): - def fget( self ): - return self._parent_surface - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument parent_surface is mantatory and can not be set to None') - if not check_type(value,bounded_surface): - self._parent_surface = bounded_surface(value) - else: - self._parent_surface = value - return property(**locals()) + def __init__( + self, + parent_surface, + u_transition, + v_transition, + u_sense, + v_sense, + ): + founded_item.__init__( + self, + ) + self.parent_surface = parent_surface + self.u_transition = u_transition + self.v_transition = v_transition + self.u_sense = u_sense + self.v_sense = v_sense - @apply - def u_transition(): - def fget( self ): - return self._u_transition - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument u_transition is mantatory and can not be set to None') - if not check_type(value,transition_code): - self._u_transition = transition_code(value) - else: - self._u_transition = value - return property(**locals()) + @apply + def parent_surface(): + def fget(self): + return self._parent_surface - @apply - def v_transition(): - def fget( self ): - return self._v_transition - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument v_transition is mantatory and can not be set to None') - if not check_type(value,transition_code): - self._v_transition = transition_code(value) - else: - self._v_transition = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument parent_surface is mantatory and can not be set to None" + ) + if not check_type(value, bounded_surface): + self._parent_surface = bounded_surface(value) + else: + self._parent_surface = value - @apply - def u_sense(): - def fget( self ): - return self._u_sense - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument u_sense is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._u_sense = BOOLEAN(value) - else: - self._u_sense = value - return property(**locals()) + return property(**locals()) - @apply - def v_sense(): - def fget( self ): - return self._v_sense - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument v_sense is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._v_sense = BOOLEAN(value) - else: - self._v_sense = value - return property(**locals()) + @apply + def u_transition(): + def fget(self): + return self._u_transition - @apply - def using_surfaces(): - def fget( self ): - return self._using_surfaces - def fset( self, value ): - # INVERSE argument - raise AssertionError('Argument using_surfaces is INVERSE. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = ( not ('CONFIG_CONTROL_DESIGN.CURVE_BOUNDED_SURFACE' == TYPEOF(self.parent_surface))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument u_transition is mantatory and can not be set to None" + ) + if not check_type(value, transition_code): + self._u_transition = transition_code(value) + else: + self._u_transition = value + + return property(**locals()) + + @apply + def v_transition(): + def fget(self): + return self._v_transition + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument v_transition is mantatory and can not be set to None" + ) + if not check_type(value, transition_code): + self._v_transition = transition_code(value) + else: + self._v_transition = value + + return property(**locals()) + + @apply + def u_sense(): + def fget(self): + return self._u_sense + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument u_sense is mantatory and can not be set to None") + if not check_type(value, BOOLEAN): + self._u_sense = BOOLEAN(value) + else: + self._u_sense = value + + return property(**locals()) + + @apply + def v_sense(): + def fget(self): + return self._v_sense + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument v_sense is mantatory and can not be set to None") + if not check_type(value, BOOLEAN): + self._v_sense = BOOLEAN(value) + else: + self._v_sense = value + + return property(**locals()) + + @apply + def using_surfaces(): + def fget(self): + return self._using_surfaces + + def fset(self, value): + # INVERSE argument + raise AssertionError( + "Argument using_surfaces is INVERSE. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = not ( + "CONFIG_CONTROL_DESIGN.CURVE_BOUNDED_SURFACE" == TYPEOF(self.parent_surface) + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY length_unit # +# ENTITY length_unit # #################### class length_unit(named_unit): - '''Entity length_unit definition. - ''' - def __init__( self , inherited0__dimensions , ): - named_unit.__init__(self , inherited0__dimensions , ) - def wr1(self): - eval_wr1_wr = (((((((self.self.named_unit.self.dimensions.self.length_exponent == 1) and (self.self.named_unit.self.dimensions.self.mass_exponent == 0)) and (self.self.named_unit.self.dimensions.self.time_exponent == 0)) and (self.self.named_unit.self.dimensions.self.electric_current_exponent == 0)) and (self.self.named_unit.self.dimensions.self.thermodynamic_temperature_exponent == 0)) and (self.self.named_unit.self.dimensions.self.amount_of_substance_exponent == 0)) and (self.self.named_unit.self.dimensions.self.luminous_intensity_exponent == 0)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity length_unit definition.""" + + def __init__( + self, + inherited0__dimensions, + ): + named_unit.__init__( + self, + inherited0__dimensions, + ) + + def wr1(self): + eval_wr1_wr = ( + ( + ( + ( + ( + (self.self.named_unit.self.dimensions.self.length_exponent == 1) + and (self.self.named_unit.self.dimensions.self.mass_exponent == 0) + ) + and (self.self.named_unit.self.dimensions.self.time_exponent == 0) + ) + and (self.self.named_unit.self.dimensions.self.electric_current_exponent == 0) + ) + and ( + self.self.named_unit.self.dimensions.self.thermodynamic_temperature_exponent + == 0 + ) + ) + and (self.self.named_unit.self.dimensions.self.amount_of_substance_exponent == 0) + ) and (self.self.named_unit.self.dimensions.self.luminous_intensity_exponent == 0) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY shape_aspect # +# ENTITY shape_aspect # #################### class shape_aspect(BaseEntityClass): - '''Entity shape_aspect definition. + """Entity shape_aspect definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param of_shape - :type of_shape:product_definition_shape + :param of_shape + :type of_shape:product_definition_shape - :param product_definitional - :type product_definitional:LOGICAL - ''' - def __init__( self , name,description,of_shape,product_definitional, ): - self.name = name - self.description = description - self.of_shape = of_shape - self.product_definitional = product_definitional + :param product_definitional + :type product_definitional:LOGICAL + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + of_shape, + product_definitional, + ): + self.name = name + self.description = description + self.of_shape = of_shape + self.product_definitional = product_definitional - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name - @apply - def of_shape(): - def fget( self ): - return self._of_shape - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument of_shape is mantatory and can not be set to None') - if not check_type(value,product_definition_shape): - self._of_shape = product_definition_shape(value) - else: - self._of_shape = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def of_shape(): + def fget(self): + return self._of_shape + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument of_shape is mantatory and can not be set to None") + if not check_type(value, product_definition_shape): + self._of_shape = product_definition_shape(value) + else: + self._of_shape = value + + return property(**locals()) + + @apply + def product_definitional(): + def fget(self): + return self._product_definitional + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument product_definitional is mantatory and can not be set to None" + ) + if not check_type(value, LOGICAL): + self._product_definitional = LOGICAL(value) + else: + self._product_definitional = value + + return property(**locals()) - @apply - def product_definitional(): - def fget( self ): - return self._product_definitional - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument product_definitional is mantatory and can not be set to None') - if not check_type(value,LOGICAL): - self._product_definitional = LOGICAL(value) - else: - self._product_definitional = value - return property(**locals()) #################### - # ENTITY volume_measure_with_unit # +# ENTITY volume_measure_with_unit # #################### class volume_measure_with_unit(measure_with_unit): - '''Entity volume_measure_with_unit definition. - ''' - def __init__( self , inherited0__value_component , inherited1__unit_component , ): - measure_with_unit.__init__(self , inherited0__value_component , inherited1__unit_component , ) - def wr1(self): - eval_wr1_wr = ('CONFIG_CONTROL_DESIGN.VOLUME_UNIT' == TYPEOF(self.self.measure_with_unit.self.unit_component)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity volume_measure_with_unit definition.""" + + def __init__( + self, + inherited0__value_component, + inherited1__unit_component, + ): + measure_with_unit.__init__( + self, + inherited0__value_component, + inherited1__unit_component, + ) + + def wr1(self): + eval_wr1_wr = "CONFIG_CONTROL_DESIGN.VOLUME_UNIT" == TYPEOF( + self.self.measure_with_unit.self.unit_component + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY advanced_face # +# ENTITY advanced_face # #################### class advanced_face(face_surface): - '''Entity advanced_face definition. - ''' - def __init__( self , inherited0__name , inherited1__bounds , inherited2__name , inherited3__face_geometry , inherited4__same_sense , ): - face_surface.__init__(self , inherited0__name , inherited1__bounds , inherited2__name , inherited3__face_geometry , inherited4__same_sense , ) - def wr1(self): - eval_wr1_wr = (SIZEOF(['CONFIG_CONTROL_DESIGN.ELEMENTARY_SURFACE','CONFIG_CONTROL_DESIGN.B_SPLINE_SURFACE','CONFIG_CONTROL_DESIGN.SWEPT_SURFACE'] * TYPEOF(self.face_geometry)) == 1) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity advanced_face definition.""" - def wr2(self): - eval_wr2_wr = (SIZEOF(None) == 0) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def __init__( + self, + inherited0__name, + inherited1__bounds, + inherited2__name, + inherited3__face_geometry, + inherited4__same_sense, + ): + face_surface.__init__( + self, + inherited0__name, + inherited1__bounds, + inherited2__name, + inherited3__face_geometry, + inherited4__same_sense, + ) - def wr3(self): - eval_wr3_wr = (SIZEOF(None) == 0) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + def wr1(self): + eval_wr1_wr = ( + SIZEOF( + [ + "CONFIG_CONTROL_DESIGN.ELEMENTARY_SURFACE", + "CONFIG_CONTROL_DESIGN.B_SPLINE_SURFACE", + "CONFIG_CONTROL_DESIGN.SWEPT_SURFACE", + ] + * TYPEOF(self.face_geometry) + ) + == 1 + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr4(self): - eval_wr4_wr = (SIZEOF(None) == 0) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + def wr2(self): + eval_wr2_wr = SIZEOF(None) == 0 + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr - def wr5(self): - eval_wr5_wr = (SIZEOF(None) == 0) - if not eval_wr5_wr: - raise AssertionError('Rule wr5 violated') - else: - return eval_wr5_wr + def wr3(self): + eval_wr3_wr = SIZEOF(None) == 0 + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr - def wr6(self): - eval_wr6_wr = (( not ('CONFIG_CONTROL_DESIGN.SWEPT_SURFACE' == TYPEOF(self.face_geometry))) or (SIZEOF(['CONFIG_CONTROL_DESIGN.LINE','CONFIG_CONTROL_DESIGN.CONIC','CONFIG_CONTROL_DESIGN.POLYLINE','CONFIG_CONTROL_DESIGN.B_SPLINE_CURVE'] * TYPEOF(self.face_geometry.self.swept_surface.self.swept_curve)) == 1)) - if not eval_wr6_wr: - raise AssertionError('Rule wr6 violated') - else: - return eval_wr6_wr + def wr4(self): + eval_wr4_wr = SIZEOF(None) == 0 + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr - def wr7(self): - eval_wr7_wr = (SIZEOF(None) == 0) - if not eval_wr7_wr: - raise AssertionError('Rule wr7 violated') - else: - return eval_wr7_wr + def wr5(self): + eval_wr5_wr = SIZEOF(None) == 0 + if not eval_wr5_wr: + raise AssertionError("Rule wr5 violated") + else: + return eval_wr5_wr - def wr8(self): - eval_wr8_wr = (SIZEOF(None) == 0) - if not eval_wr8_wr: - raise AssertionError('Rule wr8 violated') - else: - return eval_wr8_wr + def wr6(self): + eval_wr6_wr = ( + not ("CONFIG_CONTROL_DESIGN.SWEPT_SURFACE" == TYPEOF(self.face_geometry)) + ) or ( + SIZEOF( + [ + "CONFIG_CONTROL_DESIGN.LINE", + "CONFIG_CONTROL_DESIGN.CONIC", + "CONFIG_CONTROL_DESIGN.POLYLINE", + "CONFIG_CONTROL_DESIGN.B_SPLINE_CURVE", + ] + * TYPEOF(self.face_geometry.self.swept_surface.self.swept_curve) + ) + == 1 + ) + if not eval_wr6_wr: + raise AssertionError("Rule wr6 violated") + else: + return eval_wr6_wr - def wr9(self): - eval_wr9_wr = (SIZEOF(None) == 0) - if not eval_wr9_wr: - raise AssertionError('Rule wr9 violated') - else: - return eval_wr9_wr + def wr7(self): + eval_wr7_wr = SIZEOF(None) == 0 + if not eval_wr7_wr: + raise AssertionError("Rule wr7 violated") + else: + return eval_wr7_wr - def wr10(self): - eval_wr10_wr = (((( not ('CONFIG_CONTROL_DESIGN.SWEPT_SURFACE' == TYPEOF(self.face_geometry))) or ( not ('CONFIG_CONTROL_DESIGN.POLYLINE' == TYPEOF(self.face_geometry.self.swept_surface.self.swept_curve)))) or (SIZEOF(self.face_geometry.self.swept_surface.self.swept_curve.self.polyline.self.points) >= 3)) and (SIZEOF(None) == 0)) - if not eval_wr10_wr: - raise AssertionError('Rule wr10 violated') - else: - return eval_wr10_wr + def wr8(self): + eval_wr8_wr = SIZEOF(None) == 0 + if not eval_wr8_wr: + raise AssertionError("Rule wr8 violated") + else: + return eval_wr8_wr + + def wr9(self): + eval_wr9_wr = SIZEOF(None) == 0 + if not eval_wr9_wr: + raise AssertionError("Rule wr9 violated") + else: + return eval_wr9_wr + + def wr10(self): + eval_wr10_wr = ( + ( + (not ("CONFIG_CONTROL_DESIGN.SWEPT_SURFACE" == TYPEOF(self.face_geometry))) + or ( + not ( + "CONFIG_CONTROL_DESIGN.POLYLINE" + == TYPEOF(self.face_geometry.self.swept_surface.self.swept_curve) + ) + ) + ) + or ( + SIZEOF( + self.face_geometry.self.swept_surface.self.swept_curve.self.polyline.self.points + ) + >= 3 + ) + ) and (SIZEOF(None) == 0) + if not eval_wr10_wr: + raise AssertionError("Rule wr10 violated") + else: + return eval_wr10_wr #################### - # ENTITY security_classification_level # +# ENTITY security_classification_level # #################### class security_classification_level(BaseEntityClass): - '''Entity security_classification_level definition. + """Entity security_classification_level definition. - :param name - :type name:label - ''' - def __init__( self , name, ): - self.name = name + :param name + :type name:label + """ + + def __init__( + self, + name, + ): + self.name = name + + @apply + def name(): + def fget(self): + return self._name + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) #################### - # ENTITY approval_relationship # +# ENTITY approval_relationship # #################### class approval_relationship(BaseEntityClass): - '''Entity approval_relationship definition. + """Entity approval_relationship definition. - :param name - :type name:label + :param name + :type name:label - :param description - :type description:text + :param description + :type description:text - :param relating_approval - :type relating_approval:approval + :param relating_approval + :type relating_approval:approval - :param related_approval - :type related_approval:approval - ''' - def __init__( self , name,description,relating_approval,related_approval, ): - self.name = name - self.description = description - self.relating_approval = relating_approval - self.related_approval = related_approval + :param related_approval + :type related_approval:approval + """ - @apply - def name(): - def fget( self ): - return self._name - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument name is mantatory and can not be set to None') - if not check_type(value,label): - self._name = label(value) - else: - self._name = value - return property(**locals()) + def __init__( + self, + name, + description, + relating_approval, + related_approval, + ): + self.name = name + self.description = description + self.relating_approval = relating_approval + self.related_approval = related_approval - @apply - def description(): - def fget( self ): - return self._description - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument description is mantatory and can not be set to None') - if not check_type(value,text): - self._description = text(value) - else: - self._description = value - return property(**locals()) + @apply + def name(): + def fget(self): + return self._name - @apply - def relating_approval(): - def fget( self ): - return self._relating_approval - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument relating_approval is mantatory and can not be set to None') - if not check_type(value,approval): - self._relating_approval = approval(value) - else: - self._relating_approval = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument name is mantatory and can not be set to None") + if not check_type(value, label): + self._name = label(value) + else: + self._name = value + + return property(**locals()) + + @apply + def description(): + def fget(self): + return self._description + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument description is mantatory and can not be set to None") + if not check_type(value, text): + self._description = text(value) + else: + self._description = value + + return property(**locals()) + + @apply + def relating_approval(): + def fget(self): + return self._relating_approval + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument relating_approval is mantatory and can not be set to None" + ) + if not check_type(value, approval): + self._relating_approval = approval(value) + else: + self._relating_approval = value + + return property(**locals()) + + @apply + def related_approval(): + def fget(self): + return self._related_approval + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument related_approval is mantatory and can not be set to None" + ) + if not check_type(value, approval): + self._related_approval = approval(value) + else: + self._related_approval = value + + return property(**locals()) - @apply - def related_approval(): - def fget( self ): - return self._related_approval - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument related_approval is mantatory and can not be set to None') - if not check_type(value,approval): - self._related_approval = approval(value) - else: - self._related_approval = value - return property(**locals()) #################### - # ENTITY polyline # +# ENTITY polyline # #################### class polyline(bounded_curve): - '''Entity polyline definition. + """Entity polyline definition. - :param points - :type points:LIST(2,None,'cartesian_point', scope = schema_scope) - ''' - def __init__( self , inherited0__name , points, ): - bounded_curve.__init__(self , inherited0__name , ) - self.points = points + :param points + :type points:LIST(2,None,'cartesian_point', scope = schema_scope) + """ + + def __init__( + self, + inherited0__name, + points, + ): + bounded_curve.__init__( + self, + inherited0__name, + ) + self.points = points + + @apply + def points(): + def fget(self): + return self._points + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument points is mantatory and can not be set to None") + if not check_type(value, LIST(2, None, "cartesian_point", scope=schema_scope)): + self._points = LIST(value) + else: + self._points = value + + return property(**locals()) - @apply - def points(): - def fget( self ): - return self._points - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument points is mantatory and can not be set to None') - if not check_type(value,LIST(2,None,'cartesian_point', scope = schema_scope)): - self._points = LIST(value) - else: - self._points = value - return property(**locals()) #################### - # ENTITY approval_person_organization # +# ENTITY approval_person_organization # #################### class approval_person_organization(BaseEntityClass): - '''Entity approval_person_organization definition. + """Entity approval_person_organization definition. - :param person_organization - :type person_organization:person_organization_select + :param person_organization + :type person_organization:person_organization_select - :param authorized_approval - :type authorized_approval:approval + :param authorized_approval + :type authorized_approval:approval - :param role - :type role:approval_role - ''' - def __init__( self , person_organization,authorized_approval,role, ): - self.person_organization = person_organization - self.authorized_approval = authorized_approval - self.role = role + :param role + :type role:approval_role + """ - @apply - def person_organization(): - def fget( self ): - return self._person_organization - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument person_organization is mantatory and can not be set to None') - if not check_type(value,person_organization_select): - self._person_organization = person_organization_select(value) - else: - self._person_organization = value - return property(**locals()) + def __init__( + self, + person_organization, + authorized_approval, + role, + ): + self.person_organization = person_organization + self.authorized_approval = authorized_approval + self.role = role - @apply - def authorized_approval(): - def fget( self ): - return self._authorized_approval - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument authorized_approval is mantatory and can not be set to None') - if not check_type(value,approval): - self._authorized_approval = approval(value) - else: - self._authorized_approval = value - return property(**locals()) + @apply + def person_organization(): + def fget(self): + return self._person_organization + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument person_organization is mantatory and can not be set to None" + ) + if not check_type(value, person_organization_select): + self._person_organization = person_organization_select(value) + else: + self._person_organization = value + + return property(**locals()) + + @apply + def authorized_approval(): + def fget(self): + return self._authorized_approval + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument authorized_approval is mantatory and can not be set to None" + ) + if not check_type(value, approval): + self._authorized_approval = approval(value) + else: + self._authorized_approval = value + + return property(**locals()) + + @apply + def role(): + def fget(self): + return self._role + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument role is mantatory and can not be set to None") + if not check_type(value, approval_role): + self._role = approval_role(value) + else: + self._role = value + + return property(**locals()) - @apply - def role(): - def fget( self ): - return self._role - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument role is mantatory and can not be set to None') - if not check_type(value,approval_role): - self._role = approval_role(value) - else: - self._role = value - return property(**locals()) #################### - # ENTITY surface_replica # +# ENTITY surface_replica # #################### class surface_replica(surface): - '''Entity surface_replica definition. + """Entity surface_replica definition. - :param parent_surface - :type parent_surface:surface + :param parent_surface + :type parent_surface:surface - :param transformation - :type transformation:cartesian_transformation_operator_3d - ''' - def __init__( self , inherited0__name , parent_surface,transformation, ): - surface.__init__(self , inherited0__name , ) - self.parent_surface = parent_surface - self.transformation = transformation + :param transformation + :type transformation:cartesian_transformation_operator_3d + """ - @apply - def parent_surface(): - def fget( self ): - return self._parent_surface - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument parent_surface is mantatory and can not be set to None') - if not check_type(value,surface): - self._parent_surface = surface(value) - else: - self._parent_surface = value - return property(**locals()) + def __init__( + self, + inherited0__name, + parent_surface, + transformation, + ): + surface.__init__( + self, + inherited0__name, + ) + self.parent_surface = parent_surface + self.transformation = transformation - @apply - def transformation(): - def fget( self ): - return self._transformation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument transformation is mantatory and can not be set to None') - if not check_type(value,cartesian_transformation_operator_3d): - self._transformation = cartesian_transformation_operator_3d(value) - else: - self._transformation = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = acyclic_surface_replica(self,self.parent_surface) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def parent_surface(): + def fget(self): + return self._parent_surface + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument parent_surface is mantatory and can not be set to None" + ) + if not check_type(value, surface): + self._parent_surface = surface(value) + else: + self._parent_surface = value + + return property(**locals()) + + @apply + def transformation(): + def fget(self): + return self._transformation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument transformation is mantatory and can not be set to None" + ) + if not check_type(value, cartesian_transformation_operator_3d): + self._transformation = cartesian_transformation_operator_3d(value) + else: + self._transformation = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = acyclic_surface_replica(self, self.parent_surface) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY security_classification_assignment # +# ENTITY security_classification_assignment # #################### class security_classification_assignment(BaseEntityClass): - '''Entity security_classification_assignment definition. + """Entity security_classification_assignment definition. - :param assigned_security_classification - :type assigned_security_classification:security_classification - ''' - def __init__( self , assigned_security_classification, ): - self.assigned_security_classification = assigned_security_classification + :param assigned_security_classification + :type assigned_security_classification:security_classification + """ + + def __init__( + self, + assigned_security_classification, + ): + self.assigned_security_classification = assigned_security_classification + + @apply + def assigned_security_classification(): + def fget(self): + return self._assigned_security_classification + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument assigned_security_classification is mantatory and can not be set to None" + ) + if not check_type(value, security_classification): + self._assigned_security_classification = security_classification(value) + else: + self._assigned_security_classification = value + + return property(**locals()) - @apply - def assigned_security_classification(): - def fget( self ): - return self._assigned_security_classification - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument assigned_security_classification is mantatory and can not be set to None') - if not check_type(value,security_classification): - self._assigned_security_classification = security_classification(value) - else: - self._assigned_security_classification = value - return property(**locals()) #################### - # ENTITY cc_design_security_classification # +# ENTITY cc_design_security_classification # #################### class cc_design_security_classification(security_classification_assignment): - '''Entity cc_design_security_classification definition. + """Entity cc_design_security_classification definition. - :param items - :type items:SET(1,None,'classified_item', scope = schema_scope) - ''' - def __init__( self , inherited0__assigned_security_classification , items, ): - security_classification_assignment.__init__(self , inherited0__assigned_security_classification , ) - self.items = items + :param items + :type items:SET(1,None,'classified_item', scope = schema_scope) + """ + + def __init__( + self, + inherited0__assigned_security_classification, + items, + ): + security_classification_assignment.__init__( + self, + inherited0__assigned_security_classification, + ) + self.items = items + + @apply + def items(): + def fget(self): + return self._items + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument items is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "classified_item", scope=schema_scope)): + self._items = SET(value) + else: + self._items = value + + return property(**locals()) - @apply - def items(): - def fget( self ): - return self._items - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument items is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'classified_item', scope = schema_scope)): - self._items = SET(value) - else: - self._items = value - return property(**locals()) #################### - # ENTITY faceted_brep_shape_representation # +# ENTITY faceted_brep_shape_representation # #################### class faceted_brep_shape_representation(shape_representation): - '''Entity faceted_brep_shape_representation definition. - ''' - def __init__( self , inherited0__name , inherited1__items , inherited2__context_of_items , ): - shape_representation.__init__(self , inherited0__name , inherited1__items , inherited2__context_of_items , ) - def wr1(self): - eval_wr1_wr = (SIZEOF(None) == 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity faceted_brep_shape_representation definition.""" - def wr2(self): - eval_wr2_wr = (SIZEOF(None) > 0) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def __init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ): + shape_representation.__init__( + self, + inherited0__name, + inherited1__items, + inherited2__context_of_items, + ) - def wr3(self): - eval_wr3_wr = (SIZEOF(None) == 0) - if not eval_wr3_wr: - raise AssertionError('Rule wr3 violated') - else: - return eval_wr3_wr + def wr1(self): + eval_wr1_wr = SIZEOF(None) == 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr - def wr4(self): - eval_wr4_wr = (SIZEOF(None) == 0) - if not eval_wr4_wr: - raise AssertionError('Rule wr4 violated') - else: - return eval_wr4_wr + def wr2(self): + eval_wr2_wr = SIZEOF(None) > 0 + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr - def wr5(self): - eval_wr5_wr = (SIZEOF(None) == 0) - if not eval_wr5_wr: - raise AssertionError('Rule wr5 violated') - else: - return eval_wr5_wr + def wr3(self): + eval_wr3_wr = SIZEOF(None) == 0 + if not eval_wr3_wr: + raise AssertionError("Rule wr3 violated") + else: + return eval_wr3_wr - def wr6(self): - eval_wr6_wr = (SIZEOF(None) == 0) - if not eval_wr6_wr: - raise AssertionError('Rule wr6 violated') - else: - return eval_wr6_wr + def wr4(self): + eval_wr4_wr = SIZEOF(None) == 0 + if not eval_wr4_wr: + raise AssertionError("Rule wr4 violated") + else: + return eval_wr4_wr - def wr7(self): - eval_wr7_wr = (SIZEOF(None) == 0) - if not eval_wr7_wr: - raise AssertionError('Rule wr7 violated') - else: - return eval_wr7_wr + def wr5(self): + eval_wr5_wr = SIZEOF(None) == 0 + if not eval_wr5_wr: + raise AssertionError("Rule wr5 violated") + else: + return eval_wr5_wr + + def wr6(self): + eval_wr6_wr = SIZEOF(None) == 0 + if not eval_wr6_wr: + raise AssertionError("Rule wr6 violated") + else: + return eval_wr6_wr + + def wr7(self): + eval_wr7_wr = SIZEOF(None) == 0 + if not eval_wr7_wr: + raise AssertionError("Rule wr7 violated") + else: + return eval_wr7_wr #################### - # ENTITY document_usage_constraint # +# ENTITY document_usage_constraint # #################### class document_usage_constraint(BaseEntityClass): - '''Entity document_usage_constraint definition. + """Entity document_usage_constraint definition. - :param source - :type source:document + :param source + :type source:document - :param subject_element - :type subject_element:label + :param subject_element + :type subject_element:label - :param subject_element_value - :type subject_element_value:text - ''' - def __init__( self , source,subject_element,subject_element_value, ): - self.source = source - self.subject_element = subject_element - self.subject_element_value = subject_element_value + :param subject_element_value + :type subject_element_value:text + """ - @apply - def source(): - def fget( self ): - return self._source - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument source is mantatory and can not be set to None') - if not check_type(value,document): - self._source = document(value) - else: - self._source = value - return property(**locals()) + def __init__( + self, + source, + subject_element, + subject_element_value, + ): + self.source = source + self.subject_element = subject_element + self.subject_element_value = subject_element_value - @apply - def subject_element(): - def fget( self ): - return self._subject_element - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument subject_element is mantatory and can not be set to None') - if not check_type(value,label): - self._subject_element = label(value) - else: - self._subject_element = value - return property(**locals()) + @apply + def source(): + def fget(self): + return self._source + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument source is mantatory and can not be set to None") + if not check_type(value, document): + self._source = document(value) + else: + self._source = value + + return property(**locals()) + + @apply + def subject_element(): + def fget(self): + return self._subject_element + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument subject_element is mantatory and can not be set to None" + ) + if not check_type(value, label): + self._subject_element = label(value) + else: + self._subject_element = value + + return property(**locals()) + + @apply + def subject_element_value(): + def fget(self): + return self._subject_element_value + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument subject_element_value is mantatory and can not be set to None" + ) + if not check_type(value, text): + self._subject_element_value = text(value) + else: + self._subject_element_value = value + + return property(**locals()) - @apply - def subject_element_value(): - def fget( self ): - return self._subject_element_value - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument subject_element_value is mantatory and can not be set to None') - if not check_type(value,text): - self._subject_element_value = text(value) - else: - self._subject_element_value = value - return property(**locals()) #################### - # ENTITY vertex_point # +# ENTITY vertex_point # #################### -class vertex_point(vertex,geometric_representation_item): - '''Entity vertex_point definition. +class vertex_point(vertex, geometric_representation_item): + """Entity vertex_point definition. - :param vertex_geometry - :type vertex_geometry:point - ''' - def __init__( self , inherited0__name , inherited1__name , vertex_geometry, ): - vertex.__init__(self , inherited0__name , ) - geometric_representation_item.__init__(self , inherited1__name , ) - self.vertex_geometry = vertex_geometry + :param vertex_geometry + :type vertex_geometry:point + """ + + def __init__( + self, + inherited0__name, + inherited1__name, + vertex_geometry, + ): + vertex.__init__( + self, + inherited0__name, + ) + geometric_representation_item.__init__( + self, + inherited1__name, + ) + self.vertex_geometry = vertex_geometry + + @apply + def vertex_geometry(): + def fget(self): + return self._vertex_geometry + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument vertex_geometry is mantatory and can not be set to None" + ) + if not check_type(value, point): + self._vertex_geometry = point(value) + else: + self._vertex_geometry = value + + return property(**locals()) - @apply - def vertex_geometry(): - def fget( self ): - return self._vertex_geometry - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument vertex_geometry is mantatory and can not be set to None') - if not check_type(value,point): - self._vertex_geometry = point(value) - else: - self._vertex_geometry = value - return property(**locals()) #################### - # ENTITY cc_design_date_and_time_assignment # +# ENTITY cc_design_date_and_time_assignment # #################### class cc_design_date_and_time_assignment(date_and_time_assignment): - '''Entity cc_design_date_and_time_assignment definition. + """Entity cc_design_date_and_time_assignment definition. - :param items - :type items:SET(1,None,'date_time_item', scope = schema_scope) - ''' - def __init__( self , inherited0__assigned_date_and_time , inherited1__role , items, ): - date_and_time_assignment.__init__(self , inherited0__assigned_date_and_time , inherited1__role , ) - self.items = items + :param items + :type items:SET(1,None,'date_time_item', scope = schema_scope) + """ - @apply - def items(): - def fget( self ): - return self._items - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument items is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'date_time_item', scope = schema_scope)): - self._items = SET(value) - else: - self._items = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = cc_design_date_time_correlation(self) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__assigned_date_and_time, + inherited1__role, + items, + ): + date_and_time_assignment.__init__( + self, + inherited0__assigned_date_and_time, + inherited1__role, + ) + self.items = items + + @apply + def items(): + def fget(self): + return self._items + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument items is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "date_time_item", scope=schema_scope)): + self._items = SET(value) + else: + self._items = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = cc_design_date_time_correlation(self) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY oriented_closed_shell # +# ENTITY oriented_closed_shell # #################### class oriented_closed_shell(closed_shell): - '''Entity oriented_closed_shell definition. + """Entity oriented_closed_shell definition. - :param closed_shell_element - :type closed_shell_element:closed_shell + :param closed_shell_element + :type closed_shell_element:closed_shell - :param orientation - :type orientation:BOOLEAN + :param orientation + :type orientation:BOOLEAN - :param connected_face_set_cfs_faces - :type connected_face_set_cfs_faces:SET(1,None,'face', scope = schema_scope) - ''' - def __init__( self , inherited0__name , inherited1__cfs_faces , closed_shell_element,orientation, ): - closed_shell.__init__(self , inherited0__name , inherited1__cfs_faces , ) - self.closed_shell_element = closed_shell_element - self.orientation = orientation + :param connected_face_set_cfs_faces + :type connected_face_set_cfs_faces:SET(1,None,'face', scope = schema_scope) + """ - @apply - def closed_shell_element(): - def fget( self ): - return self._closed_shell_element - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument closed_shell_element is mantatory and can not be set to None') - if not check_type(value,closed_shell): - self._closed_shell_element = closed_shell(value) - else: - self._closed_shell_element = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__cfs_faces, + closed_shell_element, + orientation, + ): + closed_shell.__init__( + self, + inherited0__name, + inherited1__cfs_faces, + ) + self.closed_shell_element = closed_shell_element + self.orientation = orientation - @apply - def orientation(): - def fget( self ): - return self._orientation - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument orientation is mantatory and can not be set to None') - if not check_type(value,BOOLEAN): - self._orientation = BOOLEAN(value) - else: - self._orientation = value - return property(**locals()) + @apply + def closed_shell_element(): + def fget(self): + return self._closed_shell_element - @apply - def connected_face_set_cfs_faces(): - def fget( self ): - attribute_eval = conditional_reverse(self.self.orientation,self.self.closed_shell_element.self.cfs_faces) - return attribute_eval - def fset( self, value ): - # DERIVED argument - raise AssertionError('Argument connected_face_set_cfs_faces is DERIVED. It is computed and can not be set to any value') - return property(**locals()) - def wr1(self): - eval_wr1_wr = ( not ('CONFIG_CONTROL_DESIGN.ORIENTED_CLOSED_SHELL' == TYPEOF(self.self.closed_shell_element))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument closed_shell_element is mantatory and can not be set to None" + ) + if not check_type(value, closed_shell): + self._closed_shell_element = closed_shell(value) + else: + self._closed_shell_element = value + + return property(**locals()) + + @apply + def orientation(): + def fget(self): + return self._orientation + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument orientation is mantatory and can not be set to None") + if not check_type(value, BOOLEAN): + self._orientation = BOOLEAN(value) + else: + self._orientation = value + + return property(**locals()) + + @apply + def connected_face_set_cfs_faces(): + def fget(self): + attribute_eval = conditional_reverse( + self.self.orientation, self.self.closed_shell_element.self.cfs_faces + ) + return attribute_eval + + def fset(self, value): + # DERIVED argument + raise AssertionError( + "Argument connected_face_set_cfs_faces is DERIVED. It is computed and can not be set to any value" + ) + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = not ( + "CONFIG_CONTROL_DESIGN.ORIENTED_CLOSED_SHELL" == TYPEOF(self.self.closed_shell_element) + ) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY person_and_organization # +# ENTITY person_and_organization # #################### class person_and_organization(BaseEntityClass): - '''Entity person_and_organization definition. + """Entity person_and_organization definition. - :param the_person - :type the_person:person + :param the_person + :type the_person:person - :param the_organization - :type the_organization:organization - ''' - def __init__( self , the_person,the_organization, ): - self.the_person = the_person - self.the_organization = the_organization + :param the_organization + :type the_organization:organization + """ - @apply - def the_person(): - def fget( self ): - return self._the_person - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument the_person is mantatory and can not be set to None') - if not check_type(value,person): - self._the_person = person(value) - else: - self._the_person = value - return property(**locals()) + def __init__( + self, + the_person, + the_organization, + ): + self.the_person = the_person + self.the_organization = the_organization + + @apply + def the_person(): + def fget(self): + return self._the_person + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument the_person is mantatory and can not be set to None") + if not check_type(value, person): + self._the_person = person(value) + else: + self._the_person = value + + return property(**locals()) + + @apply + def the_organization(): + def fget(self): + return self._the_organization + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument the_organization is mantatory and can not be set to None" + ) + if not check_type(value, organization): + self._the_organization = organization(value) + else: + self._the_organization = value + + return property(**locals()) - @apply - def the_organization(): - def fget( self ): - return self._the_organization - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument the_organization is mantatory and can not be set to None') - if not check_type(value,organization): - self._the_organization = organization(value) - else: - self._the_organization = value - return property(**locals()) #################### - # ENTITY cylindrical_surface # +# ENTITY cylindrical_surface # #################### class cylindrical_surface(elementary_surface): - '''Entity cylindrical_surface definition. + """Entity cylindrical_surface definition. - :param radius - :type radius:positive_length_measure - ''' - def __init__( self , inherited0__name , inherited1__position , radius, ): - elementary_surface.__init__(self , inherited0__name , inherited1__position , ) - self.radius = radius + :param radius + :type radius:positive_length_measure + """ + + def __init__( + self, + inherited0__name, + inherited1__position, + radius, + ): + elementary_surface.__init__( + self, + inherited0__name, + inherited1__position, + ) + self.radius = radius + + @apply + def radius(): + def fget(self): + return self._radius + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument radius is mantatory and can not be set to None") + if not check_type(value, positive_length_measure): + self._radius = positive_length_measure(value) + else: + self._radius = value + + return property(**locals()) - @apply - def radius(): - def fget( self ): - return self._radius - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument radius is mantatory and can not be set to None') - if not check_type(value,positive_length_measure): - self._radius = positive_length_measure(value) - else: - self._radius = value - return property(**locals()) #################### - # ENTITY local_time # +# ENTITY local_time # #################### class local_time(BaseEntityClass): - '''Entity local_time definition. + """Entity local_time definition. - :param hour_component - :type hour_component:hour_in_day + :param hour_component + :type hour_component:hour_in_day - :param minute_component - :type minute_component:minute_in_hour + :param minute_component + :type minute_component:minute_in_hour - :param second_component - :type second_component:second_in_minute + :param second_component + :type second_component:second_in_minute - :param zone - :type zone:coordinated_universal_time_offset - ''' - def __init__( self , hour_component,minute_component,second_component,zone, ): - self.hour_component = hour_component - self.minute_component = minute_component - self.second_component = second_component - self.zone = zone + :param zone + :type zone:coordinated_universal_time_offset + """ - @apply - def hour_component(): - def fget( self ): - return self._hour_component - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument hour_component is mantatory and can not be set to None') - if not check_type(value,hour_in_day): - self._hour_component = hour_in_day(value) - else: - self._hour_component = value - return property(**locals()) + def __init__( + self, + hour_component, + minute_component, + second_component, + zone, + ): + self.hour_component = hour_component + self.minute_component = minute_component + self.second_component = second_component + self.zone = zone - @apply - def minute_component(): - def fget( self ): - return self._minute_component - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,minute_in_hour): - self._minute_component = minute_in_hour(value) - else: - self._minute_component = value - else: - self._minute_component = value - return property(**locals()) + @apply + def hour_component(): + def fget(self): + return self._hour_component - @apply - def second_component(): - def fget( self ): - return self._second_component - def fset( self, value ): - if value != None: # OPTIONAL attribute - if not check_type(value,second_in_minute): - self._second_component = second_in_minute(value) - else: - self._second_component = value - else: - self._second_component = value - return property(**locals()) + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument hour_component is mantatory and can not be set to None" + ) + if not check_type(value, hour_in_day): + self._hour_component = hour_in_day(value) + else: + self._hour_component = value - @apply - def zone(): - def fget( self ): - return self._zone - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument zone is mantatory and can not be set to None') - if not check_type(value,coordinated_universal_time_offset): - self._zone = coordinated_universal_time_offset(value) - else: - self._zone = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = valid_time(self) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + return property(**locals()) + + @apply + def minute_component(): + def fget(self): + return self._minute_component + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, minute_in_hour): + self._minute_component = minute_in_hour(value) + else: + self._minute_component = value + else: + self._minute_component = value + + return property(**locals()) + + @apply + def second_component(): + def fget(self): + return self._second_component + + def fset(self, value): + if value != None: # OPTIONAL attribute + if not check_type(value, second_in_minute): + self._second_component = second_in_minute(value) + else: + self._second_component = value + else: + self._second_component = value + + return property(**locals()) + + @apply + def zone(): + def fget(self): + return self._zone + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument zone is mantatory and can not be set to None") + if not check_type(value, coordinated_universal_time_offset): + self._zone = coordinated_universal_time_offset(value) + else: + self._zone = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = valid_time(self) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY mass_unit # +# ENTITY mass_unit # #################### class mass_unit(named_unit): - '''Entity mass_unit definition. - ''' - def __init__( self , inherited0__dimensions , ): - named_unit.__init__(self , inherited0__dimensions , ) - def wr1(self): - eval_wr1_wr = (((((((self.self.named_unit.self.dimensions.self.length_exponent == 0) and (self.self.named_unit.self.dimensions.self.mass_exponent == 1)) and (self.self.named_unit.self.dimensions.self.time_exponent == 0)) and (self.self.named_unit.self.dimensions.self.electric_current_exponent == 0)) and (self.self.named_unit.self.dimensions.self.thermodynamic_temperature_exponent == 0)) and (self.self.named_unit.self.dimensions.self.amount_of_substance_exponent == 0)) and (self.self.named_unit.self.dimensions.self.luminous_intensity_exponent == 0)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity mass_unit definition.""" + + def __init__( + self, + inherited0__dimensions, + ): + named_unit.__init__( + self, + inherited0__dimensions, + ) + + def wr1(self): + eval_wr1_wr = ( + ( + ( + ( + ( + (self.self.named_unit.self.dimensions.self.length_exponent == 0) + and (self.self.named_unit.self.dimensions.self.mass_exponent == 1) + ) + and (self.self.named_unit.self.dimensions.self.time_exponent == 0) + ) + and (self.self.named_unit.self.dimensions.self.electric_current_exponent == 0) + ) + and ( + self.self.named_unit.self.dimensions.self.thermodynamic_temperature_exponent + == 0 + ) + ) + and (self.self.named_unit.self.dimensions.self.amount_of_substance_exponent == 0) + ) and (self.self.named_unit.self.dimensions.self.luminous_intensity_exponent == 0) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY vertex_shell # +# ENTITY vertex_shell # #################### class vertex_shell(topological_representation_item): - '''Entity vertex_shell definition. + """Entity vertex_shell definition. - :param vertex_shell_extent - :type vertex_shell_extent:vertex_loop - ''' - def __init__( self , inherited0__name , vertex_shell_extent, ): - topological_representation_item.__init__(self , inherited0__name , ) - self.vertex_shell_extent = vertex_shell_extent + :param vertex_shell_extent + :type vertex_shell_extent:vertex_loop + """ + + def __init__( + self, + inherited0__name, + vertex_shell_extent, + ): + topological_representation_item.__init__( + self, + inherited0__name, + ) + self.vertex_shell_extent = vertex_shell_extent + + @apply + def vertex_shell_extent(): + def fget(self): + return self._vertex_shell_extent + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument vertex_shell_extent is mantatory and can not be set to None" + ) + if not check_type(value, vertex_loop): + self._vertex_shell_extent = vertex_loop(value) + else: + self._vertex_shell_extent = value + + return property(**locals()) - @apply - def vertex_shell_extent(): - def fget( self ): - return self._vertex_shell_extent - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument vertex_shell_extent is mantatory and can not be set to None') - if not check_type(value,vertex_loop): - self._vertex_shell_extent = vertex_loop(value) - else: - self._vertex_shell_extent = value - return property(**locals()) #################### - # ENTITY poly_loop # +# ENTITY poly_loop # #################### -class poly_loop(loop,geometric_representation_item): - '''Entity poly_loop definition. +class poly_loop(loop, geometric_representation_item): + """Entity poly_loop definition. - :param polygon - :type polygon:LIST(3,None,'cartesian_point', scope = schema_scope) - ''' - def __init__( self , inherited0__name , inherited1__name , polygon, ): - loop.__init__(self , inherited0__name , ) - geometric_representation_item.__init__(self , inherited1__name , ) - self.polygon = polygon + :param polygon + :type polygon:LIST(3,None,'cartesian_point', scope = schema_scope) + """ + + def __init__( + self, + inherited0__name, + inherited1__name, + polygon, + ): + loop.__init__( + self, + inherited0__name, + ) + geometric_representation_item.__init__( + self, + inherited1__name, + ) + self.polygon = polygon + + @apply + def polygon(): + def fget(self): + return self._polygon + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument polygon is mantatory and can not be set to None") + if not check_type(value, LIST(3, None, "cartesian_point", scope=schema_scope)): + self._polygon = LIST(value) + else: + self._polygon = value + + return property(**locals()) - @apply - def polygon(): - def fget( self ): - return self._polygon - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument polygon is mantatory and can not be set to None') - if not check_type(value,LIST(3,None,'cartesian_point', scope = schema_scope)): - self._polygon = LIST(value) - else: - self._polygon = value - return property(**locals()) #################### - # ENTITY wire_shell # +# ENTITY wire_shell # #################### class wire_shell(topological_representation_item): - '''Entity wire_shell definition. + """Entity wire_shell definition. - :param wire_shell_extent - :type wire_shell_extent:SET(1,None,'loop', scope = schema_scope) - ''' - def __init__( self , inherited0__name , wire_shell_extent, ): - topological_representation_item.__init__(self , inherited0__name , ) - self.wire_shell_extent = wire_shell_extent + :param wire_shell_extent + :type wire_shell_extent:SET(1,None,'loop', scope = schema_scope) + """ - @apply - def wire_shell_extent(): - def fget( self ): - return self._wire_shell_extent - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument wire_shell_extent is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'loop', scope = schema_scope)): - self._wire_shell_extent = SET(value) - else: - self._wire_shell_extent = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = ( not mixed_loop_type_set(self.wire_shell_extent)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + def __init__( + self, + inherited0__name, + wire_shell_extent, + ): + topological_representation_item.__init__( + self, + inherited0__name, + ) + self.wire_shell_extent = wire_shell_extent + + @apply + def wire_shell_extent(): + def fget(self): + return self._wire_shell_extent + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument wire_shell_extent is mantatory and can not be set to None" + ) + if not check_type(value, SET(1, None, "loop", scope=schema_scope)): + self._wire_shell_extent = SET(value) + else: + self._wire_shell_extent = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = not mixed_loop_type_set(self.wire_shell_extent) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY area_unit # +# ENTITY area_unit # #################### class area_unit(named_unit): - '''Entity area_unit definition. - ''' - def __init__( self , inherited0__dimensions , ): - named_unit.__init__(self , inherited0__dimensions , ) - def wr1(self): - eval_wr1_wr = (((((((self.self.named_unit.self.dimensions.self.length_exponent == 2) and (self.self.named_unit.self.dimensions.self.mass_exponent == 0)) and (self.self.named_unit.self.dimensions.self.time_exponent == 0)) and (self.self.named_unit.self.dimensions.self.electric_current_exponent == 0)) and (self.self.named_unit.self.dimensions.self.thermodynamic_temperature_exponent == 0)) and (self.self.named_unit.self.dimensions.self.amount_of_substance_exponent == 0)) and (self.self.named_unit.self.dimensions.self.luminous_intensity_exponent == 0)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity area_unit definition.""" + + def __init__( + self, + inherited0__dimensions, + ): + named_unit.__init__( + self, + inherited0__dimensions, + ) + + def wr1(self): + eval_wr1_wr = ( + ( + ( + ( + ( + (self.self.named_unit.self.dimensions.self.length_exponent == 2) + and (self.self.named_unit.self.dimensions.self.mass_exponent == 0) + ) + and (self.self.named_unit.self.dimensions.self.time_exponent == 0) + ) + and (self.self.named_unit.self.dimensions.self.electric_current_exponent == 0) + ) + and ( + self.self.named_unit.self.dimensions.self.thermodynamic_temperature_exponent + == 0 + ) + ) + and (self.self.named_unit.self.dimensions.self.amount_of_substance_exponent == 0) + ) and (self.self.named_unit.self.dimensions.self.luminous_intensity_exponent == 0) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY mapped_item # +# ENTITY mapped_item # #################### class mapped_item(representation_item): - '''Entity mapped_item definition. + """Entity mapped_item definition. - :param mapping_source - :type mapping_source:representation_map + :param mapping_source + :type mapping_source:representation_map - :param mapping_target - :type mapping_target:representation_item - ''' - def __init__( self , inherited0__name , mapping_source,mapping_target, ): - representation_item.__init__(self , inherited0__name , ) - self.mapping_source = mapping_source - self.mapping_target = mapping_target + :param mapping_target + :type mapping_target:representation_item + """ - @apply - def mapping_source(): - def fget( self ): - return self._mapping_source - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument mapping_source is mantatory and can not be set to None') - if not check_type(value,representation_map): - self._mapping_source = representation_map(value) - else: - self._mapping_source = value - return property(**locals()) + def __init__( + self, + inherited0__name, + mapping_source, + mapping_target, + ): + representation_item.__init__( + self, + inherited0__name, + ) + self.mapping_source = mapping_source + self.mapping_target = mapping_target - @apply - def mapping_target(): - def fget( self ): - return self._mapping_target - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument mapping_target is mantatory and can not be set to None') - if not check_type(value,representation_item): - self._mapping_target = representation_item(value) - else: - self._mapping_target = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = acyclic_mapped_representation(using_representations(self),[self]) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def mapping_source(): + def fget(self): + return self._mapping_source + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument mapping_source is mantatory and can not be set to None" + ) + if not check_type(value, representation_map): + self._mapping_source = representation_map(value) + else: + self._mapping_source = value + + return property(**locals()) + + @apply + def mapping_target(): + def fget(self): + return self._mapping_target + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError( + "Argument mapping_target is mantatory and can not be set to None" + ) + if not check_type(value, representation_item): + self._mapping_target = representation_item(value) + else: + self._mapping_target = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = acyclic_mapped_representation(using_representations(self), [self]) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY shape_definition_representation # +# ENTITY shape_definition_representation # #################### class shape_definition_representation(property_definition_representation): - '''Entity shape_definition_representation definition. - ''' - def __init__( self , inherited0__definition , inherited1__used_representation , ): - property_definition_representation.__init__(self , inherited0__definition , inherited1__used_representation , ) - def wr1(self): - eval_wr1_wr = (('CONFIG_CONTROL_DESIGN.SHAPE_DEFINITION' == TYPEOF(self.self.definition.self.definition)) or ('CONFIG_CONTROL_DESIGN.PRODUCT_DEFINITION_SHAPE' == TYPEOF(self.self.definition))) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity shape_definition_representation definition.""" - def wr2(self): - eval_wr2_wr = ('CONFIG_CONTROL_DESIGN.SHAPE_REPRESENTATION' == TYPEOF(self.self.used_representation)) - if not eval_wr2_wr: - raise AssertionError('Rule wr2 violated') - else: - return eval_wr2_wr + def __init__( + self, + inherited0__definition, + inherited1__used_representation, + ): + property_definition_representation.__init__( + self, + inherited0__definition, + inherited1__used_representation, + ) + + def wr1(self): + eval_wr1_wr = ( + "CONFIG_CONTROL_DESIGN.SHAPE_DEFINITION" == TYPEOF(self.self.definition.self.definition) + ) or ("CONFIG_CONTROL_DESIGN.PRODUCT_DEFINITION_SHAPE" == TYPEOF(self.self.definition)) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr + + def wr2(self): + eval_wr2_wr = "CONFIG_CONTROL_DESIGN.SHAPE_REPRESENTATION" == TYPEOF( + self.self.used_representation + ) + if not eval_wr2_wr: + raise AssertionError("Rule wr2 violated") + else: + return eval_wr2_wr #################### - # ENTITY volume_unit # +# ENTITY volume_unit # #################### class volume_unit(named_unit): - '''Entity volume_unit definition. - ''' - def __init__( self , inherited0__dimensions , ): - named_unit.__init__(self , inherited0__dimensions , ) - def wr1(self): - eval_wr1_wr = (((((((self.self.named_unit.self.dimensions.self.length_exponent == 3) and (self.self.named_unit.self.dimensions.self.mass_exponent == 0)) and (self.self.named_unit.self.dimensions.self.time_exponent == 0)) and (self.self.named_unit.self.dimensions.self.electric_current_exponent == 0)) and (self.self.named_unit.self.dimensions.self.thermodynamic_temperature_exponent == 0)) and (self.self.named_unit.self.dimensions.self.amount_of_substance_exponent == 0)) and (self.self.named_unit.self.dimensions.self.luminous_intensity_exponent == 0)) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + """Entity volume_unit definition.""" + + def __init__( + self, + inherited0__dimensions, + ): + named_unit.__init__( + self, + inherited0__dimensions, + ) + + def wr1(self): + eval_wr1_wr = ( + ( + ( + ( + ( + (self.self.named_unit.self.dimensions.self.length_exponent == 3) + and (self.self.named_unit.self.dimensions.self.mass_exponent == 0) + ) + and (self.self.named_unit.self.dimensions.self.time_exponent == 0) + ) + and (self.self.named_unit.self.dimensions.self.electric_current_exponent == 0) + ) + and ( + self.self.named_unit.self.dimensions.self.thermodynamic_temperature_exponent + == 0 + ) + ) + and (self.self.named_unit.self.dimensions.self.amount_of_substance_exponent == 0) + ) and (self.self.named_unit.self.dimensions.self.luminous_intensity_exponent == 0) + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY conical_surface # +# ENTITY conical_surface # #################### class conical_surface(elementary_surface): - '''Entity conical_surface definition. + """Entity conical_surface definition. - :param radius - :type radius:length_measure + :param radius + :type radius:length_measure - :param semi_angle - :type semi_angle:plane_angle_measure - ''' - def __init__( self , inherited0__name , inherited1__position , radius,semi_angle, ): - elementary_surface.__init__(self , inherited0__name , inherited1__position , ) - self.radius = radius - self.semi_angle = semi_angle + :param semi_angle + :type semi_angle:plane_angle_measure + """ - @apply - def radius(): - def fget( self ): - return self._radius - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument radius is mantatory and can not be set to None') - if not check_type(value,length_measure): - self._radius = length_measure(value) - else: - self._radius = value - return property(**locals()) + def __init__( + self, + inherited0__name, + inherited1__position, + radius, + semi_angle, + ): + elementary_surface.__init__( + self, + inherited0__name, + inherited1__position, + ) + self.radius = radius + self.semi_angle = semi_angle - @apply - def semi_angle(): - def fget( self ): - return self._semi_angle - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument semi_angle is mantatory and can not be set to None') - if not check_type(value,plane_angle_measure): - self._semi_angle = plane_angle_measure(value) - else: - self._semi_angle = value - return property(**locals()) - def wr1(self): - eval_wr1_wr = (self.radius >= 0) - if not eval_wr1_wr: - raise AssertionError('Rule wr1 violated') - else: - return eval_wr1_wr + @apply + def radius(): + def fget(self): + return self._radius + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument radius is mantatory and can not be set to None") + if not check_type(value, length_measure): + self._radius = length_measure(value) + else: + self._radius = value + + return property(**locals()) + + @apply + def semi_angle(): + def fget(self): + return self._semi_angle + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument semi_angle is mantatory and can not be set to None") + if not check_type(value, plane_angle_measure): + self._semi_angle = plane_angle_measure(value) + else: + self._semi_angle = value + + return property(**locals()) + + def wr1(self): + eval_wr1_wr = self.radius >= 0 + if not eval_wr1_wr: + raise AssertionError("Rule wr1 violated") + else: + return eval_wr1_wr #################### - # ENTITY global_unit_assigned_context # +# ENTITY global_unit_assigned_context # #################### class global_unit_assigned_context(representation_context): - '''Entity global_unit_assigned_context definition. - - :param units - :type units:SET(1,None,'unit', scope = schema_scope) - ''' - def __init__( self , inherited0__context_identifier , inherited1__context_type , units, ): - representation_context.__init__(self , inherited0__context_identifier , inherited1__context_type , ) - self.units = units - - @apply - def units(): - def fget( self ): - return self._units - def fset( self, value ): - # Mandatory argument - if value==None: - raise AssertionError('Argument units is mantatory and can not be set to None') - if not check_type(value,SET(1,None,'unit', scope = schema_scope)): - self._units = SET(value) - else: - self._units = value - return property(**locals()) - -#################### - # FUNCTION build_2axes # -#################### -def build_2axes(ref_direction,): - ''' - :param ref_direction - :type ref_direction:direction - ''' - return [d,orthogonal_complement(d)] - -#################### - # FUNCTION item_in_context # -#################### -def item_in_context(item,cntxt,): - ''' - :param item - :type item:representation_item - :param cntxt - :type cntxt:representation_context - ''' - if (SIZEOF(USEDIN(item,'CONFIG_CONTROL_DESIGN.REPRESENTATION.ITEMS') * cntxt.representations_in_context) > 0): - return TRUE - else: - y = None - if (SIZEOF(y) > 0): - for i in range(1,HIINDEX(y),1): - if (item_in_context(y[i],cntxt)): - return TRUE - return FALSE - -#################### - # FUNCTION gbsf_check_point # -#################### -def gbsf_check_point(pnt,): - ''' - :param pnt - :type pnt:point - ''' - if ('CONFIG_CONTROL_DESIGN.CARTESIAN_POINT' == TYPEOF(pnt)): - return TRUE - else: - if ('CONFIG_CONTROL_DESIGN.POINT_ON_CURVE' == TYPEOF(pnt)): - return gbsf_check_curve(pnt.point_on_curve.basis_curve) - else: - if ('CONFIG_CONTROL_DESIGN.POINT_ON_SURFACE' == TYPEOF(pnt)): - return gbsf_check_surface(pnt.point_on_surface.basis_surface) - else: - if ('CONFIG_CONTROL_DESIGN.DEGENERATE_PCURVE' == TYPEOF(pnt)): - return gbsf_check_curve(pnt.degenerate_pcurve.reference_to_curve.representation.items[1]) and gbsf_check_surface(pnt.degenerate_pcurve.basis_surface) - return FALSE - -#################### - # FUNCTION build_axes # -#################### -def build_axes(axis,ref_direction,): - ''' - :param axis - :type axis:direction - :param ref_direction - :type ref_direction:direction - ''' - d1 = NVL(normalise(axis),dummy_gri == direction([0,0,1])) - d2 = first_proj_axis(d1,ref_direction) - return [d2,normalise(cross_product(d1,d2)).orientation,d1] - -#################### - # FUNCTION edge_reversed # -#################### -def edge_reversed(an_edge,): - ''' - :param an_edge - :type an_edge:edge - ''' - if ('CONFIG_CONTROL_DESIGN.ORIENTED_EDGE' == TYPEOF(an_edge)): - the_reverse = (dummy_tri == edge(an_edge.edge_end,an_edge.edge_start)) == oriented_edge(an_edge.oriented_edge.edge_element, not an_edge.oriented_edge.orientation) - else: - the_reverse = (dummy_tri == edge(an_edge.edge_end,an_edge.edge_start)) == oriented_edge(an_edge,FALSE) - return the_reverse - -#################### - # FUNCTION cc_design_person_and_organization_correlation # -#################### -def cc_design_person_and_organization_correlation(e,): - ''' - :param e - :type e:cc_design_person_and_organization_assignment - ''' - po_role = e.person_and_organization_assignment.role.name - case_selector = po_role - if case_selector == 'request_recipient': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'initiator': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'creator': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'part_supplier': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'design_supplier': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'design_owner': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'configuration_manager': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'contractor': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'classification_officer': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - else: - return TRUE - return TRUE - -#################### - # FUNCTION constraints_composite_curve_on_surface # -#################### -def constraints_composite_curve_on_surface(c,): - ''' - :param c - :type c:composite_curve_on_surface - ''' - for k in range(1,n_segments,1): - if ((( not ('CONFIG_CONTROL_DESIGN.PCURVE' == TYPEOF(c.composite_curve.segments[k].parent_curve))) and ( not ('CONFIG_CONTROL_DESIGN.SURFACE_CURVE' == TYPEOF(c.composite_curve.segments[k].parent_curve)))) and ( not ('CONFIG_CONTROL_DESIGN.COMPOSITE_CURVE_ON_SURFACE' == TYPEOF(c.composite_curve.segments[k].parent_curve)))): - return FALSE - return TRUE - -#################### - # FUNCTION acyclic_mapped_representation # -#################### -def acyclic_mapped_representation(parent_set,children_set,): - ''' - :param parent_set - :type parent_set:(null) - :param children_set - :type children_set:(null) - ''' - x = None - if (SIZEOF(x) > 0): - for i in range(1,HIINDEX(x),1): - if (x[i].mapped_item.mapping_source.mapped_representation == parent_set): - return FALSE - if ( not acyclic_mapped_representation(parent_set + x[i].mapped_item.mapping_source.mapped_representation,x[i].mapped_item.mapping_source.mapped_representation.items)): - return FALSE - x = children_set - x - if (SIZEOF(x) > 0): - for i in range(1,HIINDEX(x),1): - y = None - if ( not acyclic_mapped_representation(parent_set,y)): - return FALSE - return TRUE - -#################### - # FUNCTION conditional_reverse # -#################### -def conditional_reverse(p,an_item,): - ''' - :param p - :type p:BOOLEAN - :param an_item - :type an_item:reversible_topology - ''' - if (p): - return an_item - else: - return topology_reversed(an_item) - -#################### - # FUNCTION valid_measure_value # -#################### -def valid_measure_value(m,): - ''' - :param m - :type m:measure_value - ''' - if ('REAL' == TYPEOF(m)): - return m > 0 - else: - if ('INTEGER' == TYPEOF(m)): - return m > 0 - else: - return TRUE - -#################### - # FUNCTION gbsf_check_curve # -#################### -def gbsf_check_curve(cv,): - ''' - :param cv - :type cv:curve - ''' - if (SIZEOF(['CONFIG_CONTROL_DESIGN.BOUNDED_CURVE','CONFIG_CONTROL_DESIGN.CONIC','CONFIG_CONTROL_DESIGN.CURVE_REPLICA','CONFIG_CONTROL_DESIGN.LINE','CONFIG_CONTROL_DESIGN.OFFSET_CURVE_3D'] * TYPEOF(cv)) > 1): - return FALSE - else: - if (SIZEOF(['CONFIG_CONTROL_DESIGN.CIRCLE','CONFIG_CONTROL_DESIGN.ELLIPSE'] * TYPEOF(cv)) == 1): - return TRUE - else: - if ((('CONFIG_CONTROL_DESIGN.B_SPLINE_CURVE' == TYPEOF(cv)) and (cv.b_spline_curve.self_intersect == FALSE)) or (cv.b_spline_curve.self_intersect == UNKNOWN)): - return TRUE - else: - if ((('CONFIG_CONTROL_DESIGN.COMPOSITE_CURVE' == TYPEOF(cv)) and (cv.composite_curve.self_intersect == FALSE)) or (cv.composite_curve.self_intersect == UNKNOWN)): - return SIZEOF(None) == 0 - else: - if ('CONFIG_CONTROL_DESIGN.CURVE_REPLICA' == TYPEOF(cv)): - return gbsf_check_curve(cv.curve_replica.parent_curve) - else: - if ((('CONFIG_CONTROL_DESIGN.OFFSET_CURVE_3D' == TYPEOF(cv)) and ((cv.offset_curve_3d.self_intersect == FALSE) or (cv.offset_curve_3d.self_intersect == UNKNOWN))) and ( not ('CONFIG_CONTROL_DESIGN.POLYLINE' == TYPEOF(cv.basis_curve)))): - return gbsf_check_curve(cv.offset_curve_3d.basis_curve) - else: - if ('CONFIG_CONTROL_DESIGN.PCURVE' == TYPEOF(cv)): - return gbsf_check_curve(cv.pcurve.reference_to_curve.representation.items[1]) and gbsf_check_surface(cv.pcurve.basis_surface) - else: - if ('CONFIG_CONTROL_DESIGN.POLYLINE' == TYPEOF(cv)): - if (SIZEOF(cv.polyline.points) >= 3): - return TRUE - else: - if ('CONFIG_CONTROL_DESIGN.SURFACE_CURVE' == TYPEOF(cv)): - if (gbsf_check_curve(cv.surface_curve.curve_3d)): - for i in range(1,SIZEOF(cv.surface_curve.associated_geometry),1): - if ('CONFIG_CONTROL_DESIGN.SURFACE' == TYPEOF(cv.surface_curve.associated_geometry[i])): - if ( not gbsf_check_surface(cv.surface_curve.associated_geometry[i])): - return FALSE - else: - if ('CONFIG_CONTROL_DESIGN.PCURVE' == TYPEOF(cv.surface_curve.associated_geometry[i])): - if ( not gbsf_check_curve(cv.surface_curve.associated_geometry[i])): - return FALSE - return TRUE - else: - if ('CONFIG_CONTROL_DESIGN.TRIMMED_CURVE' == TYPEOF(cv)): - if (SIZEOF(['CONFIG_CONTROL_DESIGN.LINE','CONFIG_CONTROL_DESIGN.PARABOLA','CONFIG_CONTROL_DESIGN.HYPERBOLA'] * TYPEOF(cv.trimmed_curve.basis_curve)) == 1): - return TRUE - else: - return gbsf_check_curve(cv.trimmed_curve.basis_curve) - return FALSE - -#################### - # FUNCTION unique_version_change_order # -#################### -def unique_version_change_order(c,): - ''' - :param c - :type c:action - ''' - for i in range(1,SIZEOF(ords.requests),1): - assign = assign + None - for k in range(1,SIZEOF(assign),1): - versions = versions + assign[k].items - return SIZEOF(None) == 0 - -#################### - # FUNCTION base_axis # -#################### -def base_axis(dim,axis1,axis2,axis3,): - ''' - :param dim - :type dim:INTEGER - :param axis1 - :type axis1:direction - :param axis2 - :type axis2:direction - :param axis3 - :type axis3:direction - ''' - if (dim == 3): - d1 = NVL(normalise(axis3),dummy_gri == direction([0,0,1])) - d2 = first_proj_axis(d1,axis1) - u = [d2,second_proj_axis(d1,d2,axis2),d1] - else: - if (EXISTS(axis1)): - d1 = normalise(axis1) - u = [d1,orthogonal_complement(d1)] - if (EXISTS(axis2)): - factor = dot_product(axis2,u[2]) - if (factor < 0): - u[2].direction_ratios[1] = -u[2].direction_ratios[1] - u[2].direction_ratios[2] = -u[2].direction_ratios[2] - else: - if (EXISTS(axis2)): - d1 = normalise(axis2) - u = [orthogonal_complement(d1),d1] - u[1].direction_ratios[1] = -u[1].direction_ratios[1] - u[1].direction_ratios[2] = -u[1].direction_ratios[2] - else: - u = [dummy_gri == direction([1,0]),dummy_gri == direction([0,1])] - return u - -#################### - # FUNCTION get_basis_surface # -#################### -def get_basis_surface(c,): - ''' - :param c - :type c:curve_on_surface - ''' - surfs = [] - if ('CONFIG_CONTROL_DESIGN.PCURVE' == TYPEOF(c)): - surfs = [c.pcurve.basis_surface] - else: - if ('CONFIG_CONTROL_DESIGN.SURFACE_CURVE' == TYPEOF(c)): - n = SIZEOF(c.surface_curve.associated_geometry) - for i in range(1,n,1): - surfs = surfs + associated_surface(c.surface_curve.associated_geometry[i]) - if ('CONFIG_CONTROL_DESIGN.COMPOSITE_CURVE_ON_SURFACE' == TYPEOF(c)): - n = SIZEOF(c.composite_curve.segments) - surfs = get_basis_surface(c.composite_curve.segments[1].parent_curve) - if (n > 1): - for i in range(2,n,1): - surfs = surfs * get_basis_surface(c.composite_curve.segments[i].parent_curve) - return surfs - -#################### - # FUNCTION cc_design_date_time_correlation # -#################### -def cc_design_date_time_correlation(e,): - ''' - :param e - :type e:cc_design_date_and_time_assignment - ''' - dt_role = e.date_and_time_assignment.role.name - case_selector = dt_role - if case_selector == 'creation_date': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'request_date': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'release_date': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'start_date': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'sign_off_date': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'contract_date': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'certification_date': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'classification_date': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - elif case_selector == 'declassification_date': - if (SIZEOF(e.items) != SIZEOF(None)): - return FALSE - else: - return TRUE - return TRUE - -#################### - # FUNCTION list_face_loops # -#################### -def list_face_loops(f,): - ''' - :param f - :type f:face - ''' - for i in range(1,SIZEOF(f.bounds),1): - loops = loops + f.bounds[i].bound - return loops - -#################### - # FUNCTION list_of_topology_reversed # -#################### -def list_of_topology_reversed(a_list,): - ''' - :param a_list - :type a_list:list_of_reversible_topology_item - ''' - the_reverse = [] - for i in range(1,SIZEOF(a_list),1): - the_reverse = topology_reversed(a_list[i]) + the_reverse - return the_reverse - -#################### - # FUNCTION msf_curve_check # -#################### -def msf_curve_check(cv,): - ''' - :param cv - :type cv:curve - ''' - if (SIZEOF(['CONFIG_CONTROL_DESIGN.BOUNDED_CURVE','CONFIG_CONTROL_DESIGN.CONIC','CONFIG_CONTROL_DESIGN.CURVE_REPLICA','CONFIG_CONTROL_DESIGN.LINE','CONFIG_CONTROL_DESIGN.OFFSET_CURVE_3D'] * TYPEOF(cv)) > 1): - return FALSE - else: - if ((('CONFIG_CONTROL_DESIGN.B_SPLINE_CURVE' == TYPEOF(cv)) and (cv.b_spline_curve.self_intersect == FALSE)) or (cv.b_spline_curve.self_intersect == UNKNOWN)): - return TRUE - else: - if (SIZEOF(['CONFIG_CONTROL_DESIGN.CONIC','CONFIG_CONTROL_DESIGN.LINE'] * TYPEOF(cv)) == 1): - return TRUE - else: - if ('CONFIG_CONTROL_DESIGN.CURVE_REPLICA' == TYPEOF(cv)): - return msf_curve_check(cv.curve_replica.parent_curve) - else: - if ((('CONFIG_CONTROL_DESIGN.OFFSET_CURVE_3D' == TYPEOF(cv)) and ((cv.offset_curve_3d.self_intersect == FALSE) or (cv.offset_curve_3d.self_intersect == UNKNOWN))) and ( not ('CONFIG_CONTROL_DESIGN.POLYLINE' == TYPEOF(cv.basis_curve)))): - return msf_curve_check(cv.offset_curve_3d.basis_curve) - else: - if ('CONFIG_CONTROL_DESIGN.PCURVE' == TYPEOF(cv)): - return msf_curve_check(cv.pcurve.reference_to_curve.representation.items[1]) and msf_surface_check(cv.pcurve.basis_surface) - else: - if ('CONFIG_CONTROL_DESIGN.SURFACE_CURVE' == TYPEOF(cv)): - if (msf_curve_check(cv.surface_curve.curve_3d)): - for i in range(1,SIZEOF(cv.surface_curve.associated_geometry),1): - if ('CONFIG_CONTROL_DESIGN.SURFACE' == TYPEOF(cv.surface_curve.associated_geometry[i])): - if ( not msf_surface_check(cv.surface_curve.associated_geometry[i])): - return FALSE - else: - if ('CONFIG_CONTROL_DESIGN.PCURVE' == TYPEOF(cv.surface_curve.associated_geometry[i])): - if ( not msf_curve_check(cv.surface_curve.associated_geometry[i])): - return FALSE - return TRUE - else: - if ('CONFIG_CONTROL_DESIGN.POLYLINE' == TYPEOF(cv)): - if (SIZEOF(cv.polyline.points) >= 3): - return TRUE - return FALSE - -#################### - # FUNCTION shell_reversed # -#################### -def shell_reversed(a_shell,): - ''' - :param a_shell - :type a_shell:shell - ''' - if ('CONFIG_CONTROL_DESIGN.OPEN_SHELL' == TYPEOF(a_shell)): - return open_shell_reversed(a_shell) - else: - if ('CONFIG_CONTROL_DESIGN.CLOSED_SHELL' == TYPEOF(a_shell)): - return closed_shell_reversed(a_shell) - else: - return None - -#################### - # FUNCTION topology_reversed # -#################### -def topology_reversed(an_item,): - ''' - :param an_item - :type an_item:reversible_topology - ''' - if ('CONFIG_CONTROL_DESIGN.EDGE' == TYPEOF(an_item)): - return edge_reversed(an_item) - if ('CONFIG_CONTROL_DESIGN.PATH' == TYPEOF(an_item)): - return path_reversed(an_item) - if ('CONFIG_CONTROL_DESIGN.FACE_BOUND' == TYPEOF(an_item)): - return face_bound_reversed(an_item) - if ('CONFIG_CONTROL_DESIGN.FACE' == TYPEOF(an_item)): - return face_reversed(an_item) - if ('CONFIG_CONTROL_DESIGN.SHELL' == TYPEOF(an_item)): - return shell_reversed(an_item) - if ('SET' == TYPEOF(an_item)): - return set_of_topology_reversed(an_item) - if ('LIST' == TYPEOF(an_item)): - return list_of_topology_reversed(an_item) - return None - -#################### - # FUNCTION first_proj_axis # -#################### -def first_proj_axis(z_axis,arg,): - ''' - :param z_axis - :type z_axis:direction - :param arg - :type arg:direction - ''' - if ( not EXISTS(z_axis)): - return None - else: - z = normalise(z_axis) - if ( not EXISTS(arg)): - if (z.direction_ratios != [1,0,0]): - v = dummy_gri == direction([1,0,0]) - else: - v = dummy_gri == direction([0,1,0]) - else: - if (arg.dim != 3): - return None - if (cross_product(arg,z).magnitude == 0): - return None - else: - v = normalise(arg) - x_vec = scalar_times_vector(dot_product(v,z),z) - x_axis = vector_difference(v,x_vec).orientation - x_axis = normalise(x_axis) - return x_axis - -#################### - # FUNCTION orthogonal_complement # -#################### -def orthogonal_complement(vec,): - ''' - :param vec - :type vec:direction - ''' - if ((vec.dim != 2) or ( not EXISTS(vec))): - return None - else: - result = dummy_gri == direction([-vec.direction_ratios[2],vec.direction_ratios[1]]) - return result - -#################### - # FUNCTION make_array_of_array # -#################### -def make_array_of_array(lis,low1,u1,low2,u2,): - ''' - :param lis - :type lis:(null) - :param low1 - :type low1:INTEGER - :param u1 - :type u1:INTEGER - :param low2 - :type low2:INTEGER - :param u2 - :type u2:INTEGER - ''' - if (((u1 - low1) + 1) != SIZEOF(lis)): - return None - if (((u2 - low2) + 1) != SIZEOF(lis[1])): - return None - res = [list_to_array(lis[1],low2,u2),(u1 - low1) + 1] - for i in range(2,HIINDEX(lis),1): - if (((u2 - low2) + 1) != SIZEOF(lis[i])): - return None - res[(low1 + i) - 1] = list_to_array(lis[i],low2,u2) - return res - -#################### - # FUNCTION second_proj_axis # -#################### -def second_proj_axis(z_axis,x_axis,arg,): - ''' - :param z_axis - :type z_axis:direction - :param x_axis - :type x_axis:direction - :param arg - :type arg:direction - ''' - if ( not EXISTS(arg)): - v = dummy_gri == direction([0,1,0]) - else: - v = arg - temp = scalar_times_vector(dot_product(v,z_axis),z_axis) - y_axis = vector_difference(v,temp) - temp = scalar_times_vector(dot_product(v,x_axis),x_axis) - y_axis = vector_difference(y_axis,temp) - y_axis = normalise(y_axis) - return y_axis.orientation - -#################### - # FUNCTION bag_to_set # -#################### -def bag_to_set(the_bag,): - ''' - :param the_bag - :type the_bag:(null) - ''' - if (SIZEOF(the_bag) > 0): - for i in range(1,HIINDEX(the_bag),1): - the_set = the_set + the_bag[i] - return the_set - -#################### - # FUNCTION valid_wireframe_edge_curve # -#################### -def valid_wireframe_edge_curve(crv,): - ''' - :param crv - :type crv:curve - ''' - if (SIZEOF(['CONFIG_CONTROL_DESIGN.LINE','CONFIG_CONTROL_DESIGN.CONIC','CONFIG_CONTROL_DESIGN.B_SPLINE_CURVE','CONFIG_CONTROL_DESIGN.POLYLINE'] * TYPEOF(crv)) == 1): - return TRUE - else: - if ('CONFIG_CONTROL_DESIGN.CURVE_REPLICA' == TYPEOF(crv)): - return valid_wireframe_edge_curve(crv.curve_replica.parent_curve) - else: - if ('CONFIG_CONTROL_DESIGN.OFFSET_CURVE_3D' == TYPEOF(crv)): - return valid_wireframe_edge_curve(crv.offset_curve_3d.basis_curve) - return FALSE - -#################### - # FUNCTION acyclic_product_category_relationship # -#################### -def acyclic_product_category_relationship(relation,children,): - ''' - :param relation - :type relation:product_category_relationship - :param children - :type children:(null) - ''' - for i in range(1,HIINDEX(children),1): - if (relation.category == children[i]): - return FALSE - x = bag_to_set(USEDIN(relation.category,'CONFIG_CONTROL_DESIGN.' + 'PRODUCT_CATEGORY_RELATIONSHIP.SUB_CATEGORY')) - local_children = children + relation.category - if (SIZEOF(x) > 0): - for i in range(1,HIINDEX(x),1): - if ( not acyclic_product_category_relationship(x[i],local_children)): - return FALSE - return TRUE - -#################### - # FUNCTION surface_weights_positive # -#################### -def surface_weights_positive(b,): - ''' - :param b - :type b:rational_b_spline_surface - ''' - for i in range(0,b.u_upper,1): - for j in range(0,b.v_upper,1): - if (b.weights[i][j] <= 0): - result = FALSE - return result - return result - -#################### - # FUNCTION vector_difference # -#################### -def vector_difference(arg1,arg2,): - ''' - :param arg1 - :type arg1:vector_or_direction - :param arg2 - :type arg2:vector_or_direction - ''' - if ((( not EXISTS(arg1)) or ( not EXISTS(arg2))) or (arg1.dim != arg2.dim)): - return None - else: - # begin/end block - if ('CONFIG_CONTROL_DESIGN.VECTOR' == TYPEOF(arg1)): - mag1 = arg1.magnitude - vec1 = arg1.orientation - else: - mag1 = 1 - vec1 = arg1 - if ('CONFIG_CONTROL_DESIGN.VECTOR' == TYPEOF(arg2)): - mag2 = arg2.magnitude - vec2 = arg2.orientation - else: - mag2 = 1 - vec2 = arg2 - vec1 = normalise(vec1) - vec2 = normalise(vec2) - ndim = SIZEOF(vec1.direction_ratios) - mag = 0 - res = dummy_gri == direction(vec1.direction_ratios) - for i in range(1,ndim,1): - res.direction_ratios[i] = (mag1 * vec1.direction_ratios[i]) + (mag2 * vec2.direction_ratios[i]) - mag = mag + (res.direction_ratios[i] * res.direction_ratios[i]) - if (mag > 0): - result = dummy_gri == vector(res,SQRT(mag)) - else: - result = dummy_gri == vector(vec1,0) - return result - -#################### - # FUNCTION acyclic_product_definition_relationship # -#################### -def acyclic_product_definition_relationship(relation,relatives,specific_relation,): - ''' - :param relation - :type relation:product_definition_relationship - :param relatives - :type relatives:(null) - :param specific_relation - :type specific_relation:STRING - ''' - if (relation.relating_product_definition == relatives): - return FALSE - x = None - for i in range(1,HIINDEX(x),1): - if ( not acyclic_product_definition_relationship(x[i],relatives + relation.relating_product_definition,specific_relation)): - return FALSE - return TRUE - -#################### - # FUNCTION constraints_geometry_shell_based_wireframe_model # -#################### -def constraints_geometry_shell_based_wireframe_model(m,): - ''' - :param m - :type m:shell_based_wireframe_model - ''' - for j in range(1,SIZEOF(m.sbwm_boundary),1): - if (( not ('CONFIG_CONTROL_DESIGN.WIRE_SHELL' == TYPEOF(m.sbwm_boundary[j]))) and ( not ('CONFIG_CONTROL_DESIGN.VERTEX_SHELL' == TYPEOF(m.sbwm_boundary[j])))): - result = FALSE - return result - return result - -#################### - # FUNCTION list_to_set # -#################### -def list_to_set(l,): - ''' - :param l - :type l:(null) - ''' - for i in range(1,SIZEOF(l),1): - s = s + l[i] - return s - -#################### - # FUNCTION valid_calendar_date # -#################### -def valid_calendar_date(date,): - ''' - :param date - :type date:calendar_date - ''' - if ( not ((1 <= date.day_component) and (date.day_component <= 31))): - return FALSE - case_selector = date.month_component - if case_selector == 4: - return (1 <= date.day_component) and (date.day_component <= 30) - elif case_selector == 6: - return (1 <= date.day_component) and (date.day_component <= 30) - elif case_selector == 9: - return (1 <= date.day_component) and (date.day_component <= 30) - elif case_selector == 11: - return (1 <= date.day_component) and (date.day_component <= 30) - elif case_selector == 2: - # begin/end block - if (leap_year(date.year_component)): - return (1 <= date.day_component) and (date.day_component <= 29) - else: - return (1 <= date.day_component) and (date.day_component <= 28) - else: - return TRUE - -#################### - # FUNCTION valid_wireframe_vertex_point # -#################### -def valid_wireframe_vertex_point(pnt,): - ''' - :param pnt - :type pnt:point - ''' - if ('CONFIG_CONTROL_DESIGN.CARTESIAN_POINT' == TYPEOF(pnt)): - return TRUE - else: - if ('CONFIG_CONTROL_DESIGN.POINT_REPLICA' == TYPEOF(pnt)): - return valid_wireframe_vertex_point(pnt.point_replica.parent_pt) - return FALSE - -#################### - # FUNCTION list_to_array # -#################### -def list_to_array(lis,low,u,): - ''' - :param lis - :type lis:(null) - :param low - :type low:INTEGER - :param u - :type u:INTEGER - ''' - n = SIZEOF(lis) - if (n != ((u - low) + 1)): - return None - else: - res = [lis[1],n] - for i in range(2,n,1): - res[(low + i) - 1] = lis[i] - return res - -#################### - # FUNCTION using_items # -#################### -def using_items(item,checked_items,): - ''' - :param item - :type item:founded_item_select - :param checked_items - :type checked_items:(null) - ''' - result_items = [] - new_check_items = checked_items + item - next_items = None - if (SIZEOF(next_items) > 0): - for i in range(1,HIINDEX(next_items),1): - if ( not (next_items[i] == new_check_items)): - result_items = (result_items + next_items[i]) + using_items(next_items[i],new_check_items) - return result_items - -#################### - # FUNCTION constraints_geometry_shell_based_surface_model # -#################### -def constraints_geometry_shell_based_surface_model(m,): - ''' - :param m - :type m:shell_based_surface_model - ''' - for j in range(1,SIZEOF(m.sbsm_boundary),1): - if (( not ('CONFIG_CONTROL_DESIGN.OPEN_SHELL' == TYPEOF(m.sbsm_boundary[j]))) and ( not ('CONFIG_CONTROL_DESIGN.CLOSED_SHELL' == TYPEOF(m.sbsm_boundary[j])))): - result = FALSE - return result - return result - -#################### - # FUNCTION face_bound_reversed # -#################### -def face_bound_reversed(a_face_bound,): - ''' - :param a_face_bound - :type a_face_bound:face_bound - ''' - if ('CONFIG_CONTROL_DESIGN.FACE_OUTER_BOUND' == TYPEOF(a_face_bound)): - the_reverse = (dummy_tri == face_bound(a_face_bound.face_bound.bound, not a_face_bound.face_bound.orientation)) == face_outer_bound() - else: - the_reverse = dummy_tri == face_bound(a_face_bound.bound, not a_face_bound.orientation) - return the_reverse - -#################### - # FUNCTION set_of_topology_reversed # -#################### -def set_of_topology_reversed(a_set,): - ''' - :param a_set - :type a_set:set_of_reversible_topology_item - ''' - the_reverse = [] - for i in range(1,SIZEOF(a_set),1): - the_reverse = the_reverse + topology_reversed(a_set[i]) - return the_reverse - -#################### - # FUNCTION dimension_of # -#################### -def dimension_of(item,): - ''' - :param item - :type item:geometric_representation_item - ''' - x = using_representations(item) - y = x[1].context_of_items - return y.geometric_representation_context.coordinate_space_dimension - -#################### - # FUNCTION scalar_times_vector # -#################### -def scalar_times_vector(scalar,vec,): - ''' - :param scalar - :type scalar:REAL - :param vec - :type vec:vector_or_direction - ''' - if (( not EXISTS(scalar)) or ( not EXISTS(vec))): - return None - else: - if ('CONFIG_CONTROL_DESIGN.VECTOR' == TYPEOF(vec)): - v = dummy_gri == direction(vec.orientation.direction_ratios) - mag = scalar * vec.magnitude - else: - v = dummy_gri == direction(vec.direction_ratios) - mag = scalar - if (mag < 0): - for i in range(1,SIZEOF(v.direction_ratios),1): - v.direction_ratios[i] = -v.direction_ratios[i] - mag = -mag - result = dummy_gri == vector(normalise(v),mag) - return result - -#################### - # FUNCTION dimensions_for_si_unit # -#################### -def dimensions_for_si_unit(n,): - ''' - :param n - :type n:si_unit_name - ''' - case_selector = n - if case_selector == metre: - return dimensional_exponents(1,0,0,0,0,0,0) - elif case_selector == gram: - return dimensional_exponents(0,1,0,0,0,0,0) - elif case_selector == second: - return dimensional_exponents(0,0,1,0,0,0,0) - elif case_selector == ampere: - return dimensional_exponents(0,0,0,1,0,0,0) - elif case_selector == kelvin: - return dimensional_exponents(0,0,0,0,1,0,0) - elif case_selector == mole: - return dimensional_exponents(0,0,0,0,0,1,0) - elif case_selector == candela: - return dimensional_exponents(0,0,0,0,0,0,1) - elif case_selector == radian: - return dimensional_exponents(0,0,0,0,0,0,0) - elif case_selector == steradian: - return dimensional_exponents(0,0,0,0,0,0,0) - elif case_selector == hertz: - return dimensional_exponents(0,0,-1,0,0,0,0) - elif case_selector == newton: - return dimensional_exponents(1,1,-2,0,0,0,0) - elif case_selector == pascal: - return dimensional_exponents(-1,1,-2,0,0,0,0) - elif case_selector == joule: - return dimensional_exponents(2,1,-2,0,0,0,0) - elif case_selector == watt: - return dimensional_exponents(2,1,-3,0,0,0,0) - elif case_selector == coulomb: - return dimensional_exponents(0,0,1,1,0,0,0) - elif case_selector == volt: - return dimensional_exponents(2,1,-3,-1,0,0,0) - elif case_selector == farad: - return dimensional_exponents(-2,-1,4,1,0,0,0) - elif case_selector == ohm: - return dimensional_exponents(2,1,-3,-2,0,0,0) - elif case_selector == siemens: - return dimensional_exponents(-2,-1,3,2,0,0,0) - elif case_selector == weber: - return dimensional_exponents(2,1,-2,-1,0,0,0) - elif case_selector == tesla: - return dimensional_exponents(0,1,-2,-1,0,0,0) - elif case_selector == henry: - return dimensional_exponents(2,1,-2,-2,0,0,0) - elif case_selector == degree_celsius: - return dimensional_exponents(0,0,0,0,1,0,0) - elif case_selector == lumen: - return dimensional_exponents(0,0,0,0,0,0,1) - elif case_selector == lux: - return dimensional_exponents(-2,0,0,0,0,0,1) - elif case_selector == becquerel: - return dimensional_exponents(0,0,-1,0,0,0,0) - elif case_selector == gray: - return dimensional_exponents(2,0,-2,0,0,0,0) - elif case_selector == sievert: - return dimensional_exponents(2,0,-2,0,0,0,0) - -#################### - # FUNCTION assembly_shape_is_defined # -#################### -def assembly_shape_is_defined(assy,schma,): - ''' - :param assy - :type assy:next_assembly_usage_occurrence - :param schma - :type schma:STRING - ''' - pr1_set = bag_to_set(USEDIN(assy.related_product_definition,schma + '.PROPERTY_DEFINITION.DEFINITION')) - for i in range(1,HIINDEX(pr1_set),1): - sdr_set = sdr_set + None - pdrel_set = bag_to_set(USEDIN(assy.related_product_definition,(schma + '.PRODUCT_DEFINITION_RELATIONSHIP.') + 'RELATED_PRODUCT_DEFINITION')) - for j in range(1,HIINDEX(pdrel_set),1): - pr2_set = pr2_set + USEDIN(pdrel_set[j],schma + '.PROPERTY_DEFINITION.DEFINITION') - for i in range(1,HIINDEX(pr2_set),1): - sdr_set = sdr_set + None - if (SIZEOF(sdr_set) > 0): - for i in range(1,HIINDEX(sdr_set),1): - srr_set = None - if (SIZEOF(srr_set) > 0): - for j in range(1,HIINDEX(srr_set),1): - if (SIZEOF(None * None) >= 1): - if (SIZEOF(None) > 0): - return FALSE - return TRUE - -#################### - # FUNCTION open_shell_reversed # -#################### -def open_shell_reversed(a_shell,): - ''' - :param a_shell - :type a_shell:open_shell - ''' - if ('CONFIG_CONTROL_DESIGN.ORIENTED_OPEN_SHELL' == TYPEOF(a_shell)): - the_reverse = ((dummy_tri == connected_face_set(a_shell.connected_face_set.cfs_faces)) == open_shell()) == oriented_open_shell(a_shell.oriented_open_shell.open_shell_element, not a_shell.oriented_open_shell.orientation) - else: - the_reverse = ((dummy_tri == connected_face_set(a_shell.connected_face_set.cfs_faces)) == open_shell()) == oriented_open_shell(a_shell,FALSE) - return the_reverse - -#################### - # FUNCTION acyclic_surface_replica # -#################### -def acyclic_surface_replica(rep,parent,): - ''' - :param rep - :type rep:surface_replica - :param parent - :type parent:surface - ''' - if ( not ('CONFIG_CONTROL_DESIGN.SURFACE_REPLICA' == TYPEOF(parent))): - return TRUE - if (parent == rep): - return FALSE - else: - return acyclic_surface_replica(rep,parent.surface_replica.parent_surface) - -#################### - # FUNCTION gbsf_check_surface # -#################### -def gbsf_check_surface(sf,): - ''' - :param sf - :type sf:surface - ''' - if ((('CONFIG_CONTROL_DESIGN.B_SPLINE_SURFACE' == TYPEOF(sf)) and (sf.b_spline_surface.self_intersect == FALSE)) or (sf.b_spline_surface.self_intersect == UNKNOWN)): - return TRUE - else: - if (SIZEOF(['CONFIG_CONTROL_DESIGN.SPHERICAL_SURFACE','CONFIG_CONTROL_DESIGN.TOROIDAL_SURFACE'] * TYPEOF(sf)) == 1): - return TRUE - else: - if ('CONFIG_CONTROL_DESIGN.CURVE_BOUNDED_SURFACE' == TYPEOF(sf)): - if (SIZEOF(['CONFIG_CONTROL_DESIGN.CONICAL_SURFACE','CONFIG_CONTROL_DESIGN.CYLINDRICAL_SURFACE','CONFIG_CONTROL_DESIGN.PLANE'] * TYPEOF(sf.curve_bounded_surface.basis_surface)) == 1): - return SIZEOF(None) == 0 - else: - if (gbsf_check_surface(sf.curve_bounded_surface.basis_surface)): - return SIZEOF(None) == 0 - else: - if ((('CONFIG_CONTROL_DESIGN.OFFSET_SURFACE' == TYPEOF(sf)) and (sf.offset_surface.self_intersect == FALSE)) or (sf.offset_surface.self_intersect == UNKNOWN)): - return gbsf_check_surface(sf.offset_surface.basis_surface) - else: - if ('CONFIG_CONTROL_DESIGN.RECTANGULAR_COMPOSITE_SURFACE' == TYPEOF(sf)): - for i in range(1,SIZEOF(sf.rectangular_composite_surface.segments),1): - for j in range(1,SIZEOF(sf.rectangular_composite_surface.segments[i]),1): - if ( not gbsf_check_surface(sf.rectangular_composite_surface.segments[i][j].parent_surface)): - return FALSE - return TRUE - else: - if ('CONFIG_CONTROL_DESIGN.RECTANGULAR_TRIMMED_SURFACE' == TYPEOF(sf)): - if (SIZEOF(['CONFIG_CONTROL_DESIGN.CONICAL_SURFACE','CONFIG_CONTROL_DESIGN.CYLINDRICAL_SURFACE','CONFIG_CONTROL_DESIGN.PLANE'] * TYPEOF(sf.rectangular_trimmed_surface.basis_surface)) == 1): - return TRUE - else: - return gbsf_check_surface(sf.rectangular_trimmed_surface.basis_surface) - else: - if ('CONFIG_CONTROL_DESIGN.SURFACE_REPLICA' == TYPEOF(sf)): - return gbsf_check_surface(sf.surface_replica.parent_surface) - else: - if ('CONFIG_CONTROL_DESIGN.SWEPT_SURFACE' == TYPEOF(sf)): - return gbsf_check_curve(sf.swept_surface.swept_curve) - return FALSE - -#################### - # FUNCTION msf_surface_check # -#################### -def msf_surface_check(surf,): - ''' - :param surf - :type surf:surface - ''' - if ('CONFIG_CONTROL_DESIGN.ELEMENTARY_SURFACE' == TYPEOF(surf)): - return TRUE - else: - if ('CONFIG_CONTROL_DESIGN.SWEPT_SURFACE' == TYPEOF(surf)): - return msf_curve_check(surf.swept_surface.swept_curve) - else: - if ((('CONFIG_CONTROL_DESIGN.OFFSET_SURFACE' == TYPEOF(surf)) and (surf.offset_surface.self_intersect == FALSE)) or (surf.offset_surface.self_intersect == UNKNOWN)): - return msf_surface_check(surf.offset_surface.basis_surface) - else: - if ('CONFIG_CONTROL_DESIGN.SURFACE_REPLICA' == TYPEOF(surf)): - return msf_surface_check(surf.surface_replica.parent_surface) - else: - if ((('CONFIG_CONTROL_DESIGN.B_SPLINE_SURFACE' == TYPEOF(surf)) and (surf.b_spline_surface.self_intersect == FALSE)) or (surf.b_spline_surface.self_intersect == UNKNOWN)): - return TRUE - return FALSE - -#################### - # FUNCTION normalise # -#################### -def normalise(arg,): - ''' - :param arg - :type arg:vector_or_direction - ''' - if ( not EXISTS(arg)): - result = None - else: - ndim = arg.dim - if ('CONFIG_CONTROL_DESIGN.VECTOR' == TYPEOF(arg)): - # begin/end block - v = dummy_gri == direction(arg.orientation.direction_ratios) - if (arg.magnitude == 0): - return None - else: - vec = dummy_gri == vector(v,1) - else: - v = dummy_gri == direction(arg.direction_ratios) - mag = 0 - for i in range(1,ndim,1): - mag = mag + (v.direction_ratios[i] * v.direction_ratios[i]) - if (mag > 0): - mag = SQRT(mag) - for i in range(1,ndim,1): - v.direction_ratios[i] = v.direction_ratios[i] / mag - if ('CONFIG_CONTROL_DESIGN.VECTOR' == TYPEOF(arg)): - vec.orientation = v - result = vec - else: - result = v - else: - return None - return result - -#################### - # FUNCTION msb_shells # -#################### -def msb_shells(brep,): - ''' - :param brep - :type brep:manifold_solid_brep - ''' - if (SIZEOF(None) >= 1): - return brep.brep_with_voids.voids + brep.outer - else: - return [brep.outer] - -#################### - # FUNCTION mixed_loop_type_set # -#################### -def mixed_loop_type_set(l,): - ''' - :param l - :type l:(null) - ''' - if (SIZEOF(l) <= 1): - return FALSE - poly_loop_type = 'CONFIG_CONTROL_DESIGN.POLY_LOOP' == TYPEOF(l[1]) - for i in range(2,SIZEOF(l),1): - if (('CONFIG_CONTROL_DESIGN.POLY_LOOP' == TYPEOF(l[i])) != poly_loop_type): - return TRUE - return FALSE - -#################### - # FUNCTION derive_dimensional_exponents # -#################### -def derive_dimensional_exponents(x,): - ''' - :param x - :type x:unit - ''' - result = x.dimensions - return result - -#################### - # FUNCTION curve_weights_positive # -#################### -def curve_weights_positive(b,): - ''' - :param b - :type b:rational_b_spline_curve - ''' - for i in range(0,b.upper_index_on_control_points,1): - if (b.weights[i] <= 0): - result = FALSE - return result - return result - -#################### - # FUNCTION valid_geometrically_bounded_wf_point # -#################### -def valid_geometrically_bounded_wf_point(pnt,): - ''' - :param pnt - :type pnt:point - ''' - if ('CONFIG_CONTROL_DESIGN.CARTESIAN_POINT' == TYPEOF(pnt)): - return TRUE - else: - if ('CONFIG_CONTROL_DESIGN.POINT_ON_CURVE' == TYPEOF(pnt)): - return valid_geometrically_bounded_wf_curve(pnt.point_on_curve.basis_curve) - else: - if ('CONFIG_CONTROL_DESIGN.POINT_REPLICA' == TYPEOF(pnt)): - return valid_geometrically_bounded_wf_point(pnt.point_replica.parent_pt) - return FALSE - -#################### - # FUNCTION path_head_to_tail # -#################### -def path_head_to_tail(a_path,): - ''' - :param a_path - :type a_path:path - ''' - n = SIZEOF(a_path.edge_list) - for i in range(2,n,1): - p = p and (a_path.edge_list[i - 1].edge_end == a_path.edge_list[i].edge_start) - return p - -#################### - # FUNCTION path_reversed # -#################### -def path_reversed(a_path,): - ''' - :param a_path - :type a_path:path - ''' - if ('CONFIG_CONTROL_DESIGN.ORIENTED_PATH' == TYPEOF(a_path)): - the_reverse = (dummy_tri == path(list_of_topology_reversed(a_path.edge_list))) == oriented_path(a_path.oriented_path.path_element, not a_path.oriented_path.orientation) - else: - the_reverse = (dummy_tri == path(list_of_topology_reversed(a_path.edge_list))) == oriented_path(a_path,FALSE) - return the_reverse - -#################### - # FUNCTION leap_year # -#################### -def leap_year(year,): - ''' - :param year - :type year:INTEGER - ''' - if ((((year % 4) == 0) and ((year % 100) != 0)) or ((year % 400) == 0)): - return TRUE - else: - return FALSE - -#################### - # FUNCTION face_reversed # -#################### -def face_reversed(a_face,): - ''' - :param a_face - :type a_face:face - ''' - if ('CONFIG_CONTROL_DESIGN.ORIENTED_FACE' == TYPEOF(a_face)): - the_reverse = (dummy_tri == face(set_of_topology_reversed(a_face.bounds))) == oriented_face(a_face.oriented_face.face_element, not a_face.oriented_face.orientation) - else: - the_reverse = (dummy_tri == face(set_of_topology_reversed(a_face.bounds))) == oriented_face(a_face,FALSE) - return the_reverse - -#################### - # FUNCTION constraints_param_b_spline # -#################### -def constraints_param_b_spline(degree,up_knots,up_cp,knot_mult,knots,): - ''' - :param degree - :type degree:INTEGER - :param up_knots - :type up_knots:INTEGER - :param up_cp - :type up_cp:INTEGER - :param knot_mult - :type knot_mult:(null) - :param knots - :type knots:(null) - ''' - sum = knot_mult[1] - for i in range(2,up_knots,1): - sum = sum + knot_mult[i] - if ((((degree < 1) or (up_knots < 2)) or (up_cp < degree)) or (sum != ((degree + up_cp) + 2))): - result = FALSE - return result - k = knot_mult[1] - if ((k < 1) or (k > (degree + 1))): - result = FALSE - return result - for i in range(2,up_knots,1): - if ((knot_mult[i] < 1) or (knots[i] <= knots[i - 1])): - result = FALSE - return result - k = knot_mult[i] - if ((i < up_knots) and (k > degree)): - result = FALSE - return result - if ((i == up_knots) and (k > (degree + 1))): - result = FALSE - return result - return result - -#################### - # FUNCTION using_representations # -#################### -def using_representations(item,): - ''' - :param item - :type item:founded_item_select - ''' - results = [] - result_bag = USEDIN(item,'CONFIG_CONTROL_DESIGN.REPRESENTATION.ITEMS') - if (SIZEOF(result_bag) > 0): - for i in range(1,HIINDEX(result_bag),1): - results = results + result_bag[i] - intermediate_items = using_items(item,[]) - if (SIZEOF(intermediate_items) > 0): - for i in range(1,HIINDEX(intermediate_items),1): - result_bag = USEDIN(intermediate_items[i],'CONFIG_CONTROL_DESIGN.REPRESENTATION.ITEMS') - if (SIZEOF(result_bag) > 0): - for j in range(1,HIINDEX(result_bag),1): - results = results + result_bag[j] - return results - -#################### - # FUNCTION associated_surface # -#################### -def associated_surface(arg,): - ''' - :param arg - :type arg:pcurve_or_surface - ''' - if ('CONFIG_CONTROL_DESIGN.PCURVE' == TYPEOF(arg)): - surf = arg.basis_surface - else: - surf = arg - return surf - -#################### - # FUNCTION acyclic_point_replica # -#################### -def acyclic_point_replica(rep,parent,): - ''' - :param rep - :type rep:point_replica - :param parent - :type parent:point - ''' - if ( not ('CONFIG_CONTROL_DESIGN.POINT_REPLICA' == TYPEOF(parent))): - return TRUE - if (parent == rep): - return FALSE - else: - return acyclic_point_replica(rep,parent.point_replica.parent_pt) - -#################### - # FUNCTION cross_product # -#################### -def cross_product(arg1,arg2,): - ''' - :param arg1 - :type arg1:direction - :param arg2 - :type arg2:direction - ''' - if (((( not EXISTS(arg1)) or (arg1.dim == 2)) or ( not EXISTS(arg2))) or (arg2.dim == 2)): - return None - else: - # begin/end block - v1 = normalise(arg1).direction_ratios - v2 = normalise(arg2).direction_ratios - res = dummy_gri == direction([(v1[2] * v2[3]) - (v1[3] * v2[2]),(v1[3] * v2[1]) - (v1[1] * v2[3]),(v1[1] * v2[2]) - (v1[2] * v2[1])]) - mag = 0 - for i in range(1,3,1): - mag = mag + (res.direction_ratios[i] * res.direction_ratios[i]) - if (mag > 0): - result = dummy_gri == vector(res,SQRT(mag)) - else: - result = dummy_gri == vector(arg1,0) - return result - -#################### - # FUNCTION valid_units # -#################### -def valid_units(m,): - ''' - :param m - :type m:measure_with_unit - ''' - if ('CONFIG_CONTROL_DESIGN.LENGTH_MEASURE' == TYPEOF(m.value_component)): - if (derive_dimensional_exponents(m.unit_component) != dimensional_exponents(1,0,0,0,0,0,0)): - return FALSE - if ('CONFIG_CONTROL_DESIGN.MASS_MEASURE' == TYPEOF(m.value_component)): - if (derive_dimensional_exponents(m.unit_component) != dimensional_exponents(0,1,0,0,0,0,0)): - return FALSE - if ('CONFIG_CONTROL_DESIGN.TIME_MEASURE' == TYPEOF(m.value_component)): - if (derive_dimensional_exponents(m.unit_component) != dimensional_exponents(0,0,1,0,0,0,0)): - return FALSE - if ('CONFIG_CONTROL_DESIGN.ELECTRIC_CURRENT_MEASURE' == TYPEOF(m.value_component)): - if (derive_dimensional_exponents(m.unit_component) != dimensional_exponents(0,0,0,1,0,0,0)): - return FALSE - if ('CONFIG_CONTROL_DESIGN.THERMODYNAMIC_TEMPERATURE_MEASURE' == TYPEOF(m.value_component)): - if (derive_dimensional_exponents(m.unit_component) != dimensional_exponents(0,0,0,0,1,0,0)): - return FALSE - if ('CONFIG_CONTROL_DESIGN.AMOUNT_OF_SUBSTANCE_MEASURE' == TYPEOF(m.value_component)): - if (derive_dimensional_exponents(m.unit_component) != dimensional_exponents(0,0,0,0,0,1,0)): - return FALSE - if ('CONFIG_CONTROL_DESIGN.LUMINOUS_INTENSITY_MEASURE' == TYPEOF(m.value_component)): - if (derive_dimensional_exponents(m.unit_component) != dimensional_exponents(0,0,0,0,0,0,1)): - return FALSE - if ('CONFIG_CONTROL_DESIGN.PLANE_ANGLE_MEASURE' == TYPEOF(m.value_component)): - if (derive_dimensional_exponents(m.unit_component) != dimensional_exponents(0,0,0,0,0,0,0)): - return FALSE - if ('CONFIG_CONTROL_DESIGN.SOLID_ANGLE_MEASURE' == TYPEOF(m.value_component)): - if (derive_dimensional_exponents(m.unit_component) != dimensional_exponents(0,0,0,0,0,0,0)): - return FALSE - if ('CONFIG_CONTROL_DESIGN.AREA_MEASURE' == TYPEOF(m.value_component)): - if (derive_dimensional_exponents(m.unit_component) != dimensional_exponents(2,0,0,0,0,0,0)): - return FALSE - if ('CONFIG_CONTROL_DESIGN.VOLUME_MEASURE' == TYPEOF(m.value_component)): - if (derive_dimensional_exponents(m.unit_component) != dimensional_exponents(3,0,0,0,0,0,0)): - return FALSE - if ('CONFIG_CONTROL_DESIGN.RATIO_MEASURE' == TYPEOF(m.value_component)): - if (derive_dimensional_exponents(m.unit_component) != dimensional_exponents(0,0,0,0,0,0,0)): - return FALSE - if ('CONFIG_CONTROL_DESIGN.POSITIVE_LENGTH_MEASURE' == TYPEOF(m.value_component)): - if (derive_dimensional_exponents(m.unit_component) != dimensional_exponents(1,0,0,0,0,0,0)): - return FALSE - if ('CONFIG_CONTROL_DESIGN.POSITIVE_PLANE_ANGLE_MEASURE' == TYPEOF(m.value_component)): - if (derive_dimensional_exponents(m.unit_component) != dimensional_exponents(0,0,0,0,0,0,0)): - return FALSE - return TRUE - -#################### - # FUNCTION constraints_rectangular_composite_surface # -#################### -def constraints_rectangular_composite_surface(s,): - ''' - :param s - :type s:rectangular_composite_surface - ''' - for i in range(1,s.n_u,1): - for j in range(1,s.n_v,1): - if ( not (('CONFIG_CONTROL_DESIGN.B_SPLINE_SURFACE' == TYPEOF(s.segments[i][j].parent_surface)) or ('CONFIG_CONTROL_DESIGN.RECTANGULAR_TRIMMED_SURFACE' == TYPEOF(s.segments[i][j].parent_surface)))): - return FALSE - for i in range(1,s.n_u - 1,1): - for j in range(1,s.n_v,1): - if (s.segments[i][j].u_transition == discontinuous): - return FALSE - for i in range(1,s.n_u,1): - for j in range(1,s.n_v - 1,1): - if (s.segments[i][j].v_transition == discontinuous): - return FALSE - return TRUE - -#################### - # FUNCTION closed_shell_reversed # -#################### -def closed_shell_reversed(a_shell,): - ''' - :param a_shell - :type a_shell:closed_shell - ''' - if ('CONFIG_CONTROL_DESIGN.ORIENTED_CLOSED_SHELL' == TYPEOF(a_shell)): - the_reverse = ((dummy_tri == connected_face_set(a_shell.connected_face_set.cfs_faces)) == closed_shell()) == oriented_closed_shell(a_shell.oriented_closed_shell.closed_shell_element, not a_shell.oriented_closed_shell.orientation) - else: - the_reverse = ((dummy_tri == connected_face_set(a_shell.connected_face_set.cfs_faces)) == closed_shell()) == oriented_closed_shell(a_shell,FALSE) - return the_reverse - -#################### - # FUNCTION boolean_choose # -#################### -def boolean_choose(b,choice1,choice2,): - ''' - :param b - :type b:BOOLEAN - :param choice1 - :type choice1:(null) - :param choice2 - :type choice2:(null) - ''' - if (b): - return choice1 - else: - return choice2 - -#################### - # FUNCTION valid_time # -#################### -def valid_time(time,): - ''' - :param time - :type time:local_time - ''' - if (EXISTS(time.second_component)): - return EXISTS(time.minute_component) - else: - return TRUE - -#################### - # FUNCTION valid_geometrically_bounded_wf_curve # -#################### -def valid_geometrically_bounded_wf_curve(crv,): - ''' - :param crv - :type crv:curve - ''' - if (SIZEOF(['CONFIG_CONTROL_DESIGN.POLYLINE','CONFIG_CONTROL_DESIGN.B_SPLINE_CURVE','CONFIG_CONTROL_DESIGN.ELLIPSE','CONFIG_CONTROL_DESIGN.CIRCLE'] * TYPEOF(crv)) == 1): - return TRUE - else: - if ('CONFIG_CONTROL_DESIGN.TRIMMED_CURVE' == TYPEOF(crv)): - if (SIZEOF(['CONFIG_CONTROL_DESIGN.LINE','CONFIG_CONTROL_DESIGN.PARABOLA','CONFIG_CONTROL_DESIGN.HYPERBOLA'] * TYPEOF(crv.trimmed_curve.basis_curve)) == 1): - return TRUE - else: - return valid_geometrically_bounded_wf_curve(crv.trimmed_curve.basis_curve) - else: - if ('CONFIG_CONTROL_DESIGN.OFFSET_CURVE_3D' == TYPEOF(crv)): - return valid_geometrically_bounded_wf_curve(crv.offset_curve_3d.basis_curve) - else: - if ('CONFIG_CONTROL_DESIGN.CURVE_REPLICA' == TYPEOF(crv)): - return valid_geometrically_bounded_wf_curve(crv.curve_replica.parent_curve) - else: - if ('CONFIG_CONTROL_DESIGN.COMPOSITE_CURVE' == TYPEOF(crv)): - return SIZEOF(None) == 0 - return FALSE - -#################### - # FUNCTION dot_product # -#################### -def dot_product(arg1,arg2,): - ''' - :param arg1 - :type arg1:direction - :param arg2 - :type arg2:direction - ''' - if (( not EXISTS(arg1)) or ( not EXISTS(arg2))): - scalar = None - else: - if (arg1.dim != arg2.dim): - scalar = None - else: - # begin/end block - vec1 = normalise(arg1) - vec2 = normalise(arg2) - ndim = arg1.dim - scalar = 0 - for i in range(1,ndim,1): - scalar = scalar + (vec1.direction_ratios[i] * vec2.direction_ratios[i]) - return scalar - -#################### - # FUNCTION acyclic_curve_replica # -#################### -def acyclic_curve_replica(rep,parent,): - ''' - :param rep - :type rep:curve_replica - :param parent - :type parent:curve - ''' - if ( not ('CONFIG_CONTROL_DESIGN.CURVE_REPLICA' == TYPEOF(parent))): - return TRUE - if (parent == rep): - return FALSE - else: - return acyclic_curve_replica(rep,parent.curve_replica.parent_curve) - -#################### - # RULE change_request_requires_approval # + """Entity global_unit_assigned_context definition. + + :param units + :type units:SET(1,None,'unit', scope = schema_scope) + """ + + def __init__( + self, + inherited0__context_identifier, + inherited1__context_type, + units, + ): + representation_context.__init__( + self, + inherited0__context_identifier, + inherited1__context_type, + ) + self.units = units + + @apply + def units(): + def fget(self): + return self._units + + def fset(self, value): + # Mandatory argument + if value == None: + raise AssertionError("Argument units is mantatory and can not be set to None") + if not check_type(value, SET(1, None, "unit", scope=schema_scope)): + self._units = SET(value) + else: + self._units = value + + return property(**locals()) + + +#################### +# FUNCTION build_2axes # +#################### +def build_2axes( + ref_direction, +): + """ + :param ref_direction + :type ref_direction:direction + """ + return [d, orthogonal_complement(d)] + + +#################### +# FUNCTION item_in_context # +#################### +def item_in_context( + item, + cntxt, +): + """ + :param item + :type item:representation_item + :param cntxt + :type cntxt:representation_context + """ + if ( + SIZEOF( + USEDIN(item, "CONFIG_CONTROL_DESIGN.REPRESENTATION.ITEMS") + * cntxt.representations_in_context + ) + > 0 + ): + return TRUE + else: + y = None + if SIZEOF(y) > 0: + for i in range(1, HIINDEX(y), 1): + if item_in_context(y[i], cntxt): + return TRUE + return FALSE + + +#################### +# FUNCTION gbsf_check_point # +#################### +def gbsf_check_point( + pnt, +): + """ + :param pnt + :type pnt:point + """ + if "CONFIG_CONTROL_DESIGN.CARTESIAN_POINT" == TYPEOF(pnt): + return TRUE + else: + if "CONFIG_CONTROL_DESIGN.POINT_ON_CURVE" == TYPEOF(pnt): + return gbsf_check_curve(pnt.point_on_curve.basis_curve) + else: + if "CONFIG_CONTROL_DESIGN.POINT_ON_SURFACE" == TYPEOF(pnt): + return gbsf_check_surface(pnt.point_on_surface.basis_surface) + else: + if "CONFIG_CONTROL_DESIGN.DEGENERATE_PCURVE" == TYPEOF(pnt): + return gbsf_check_curve( + pnt.degenerate_pcurve.reference_to_curve.representation.items[1] + ) and gbsf_check_surface(pnt.degenerate_pcurve.basis_surface) + return FALSE + + +#################### +# FUNCTION build_axes # +#################### +def build_axes( + axis, + ref_direction, +): + """ + :param axis + :type axis:direction + :param ref_direction + :type ref_direction:direction + """ + d1 = NVL(normalise(axis), dummy_gri == direction([0, 0, 1])) + d2 = first_proj_axis(d1, ref_direction) + return [d2, normalise(cross_product(d1, d2)).orientation, d1] + + +#################### +# FUNCTION edge_reversed # +#################### +def edge_reversed( + an_edge, +): + """ + :param an_edge + :type an_edge:edge + """ + if "CONFIG_CONTROL_DESIGN.ORIENTED_EDGE" == TYPEOF(an_edge): + the_reverse = (dummy_tri == edge(an_edge.edge_end, an_edge.edge_start)) == oriented_edge( + an_edge.oriented_edge.edge_element, not an_edge.oriented_edge.orientation + ) + else: + the_reverse = (dummy_tri == edge(an_edge.edge_end, an_edge.edge_start)) == oriented_edge( + an_edge, FALSE + ) + return the_reverse + + +#################### +# FUNCTION cc_design_person_and_organization_correlation # +#################### +def cc_design_person_and_organization_correlation( + e, +): + """ + :param e + :type e:cc_design_person_and_organization_assignment + """ + po_role = e.person_and_organization_assignment.role.name + case_selector = po_role + if case_selector == "request_recipient": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "initiator": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "creator": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "part_supplier": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "design_supplier": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "design_owner": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "configuration_manager": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "contractor": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "classification_officer": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + else: + return TRUE + return TRUE + + +#################### +# FUNCTION constraints_composite_curve_on_surface # +#################### +def constraints_composite_curve_on_surface( + c, +): + """ + :param c + :type c:composite_curve_on_surface + """ + for k in range(1, n_segments, 1): + if ( + ( + not ( + "CONFIG_CONTROL_DESIGN.PCURVE" + == TYPEOF(c.composite_curve.segments[k].parent_curve) + ) + ) + and ( + not ( + "CONFIG_CONTROL_DESIGN.SURFACE_CURVE" + == TYPEOF(c.composite_curve.segments[k].parent_curve) + ) + ) + ) and ( + not ( + "CONFIG_CONTROL_DESIGN.COMPOSITE_CURVE_ON_SURFACE" + == TYPEOF(c.composite_curve.segments[k].parent_curve) + ) + ): + return FALSE + return TRUE + + +#################### +# FUNCTION acyclic_mapped_representation # +#################### +def acyclic_mapped_representation( + parent_set, + children_set, +): + """ + :param parent_set + :type parent_set:(null) + :param children_set + :type children_set:(null) + """ + x = None + if SIZEOF(x) > 0: + for i in range(1, HIINDEX(x), 1): + if x[i].mapped_item.mapping_source.mapped_representation == parent_set: + return FALSE + if not acyclic_mapped_representation( + parent_set + x[i].mapped_item.mapping_source.mapped_representation, + x[i].mapped_item.mapping_source.mapped_representation.items, + ): + return FALSE + x = children_set - x + if SIZEOF(x) > 0: + for i in range(1, HIINDEX(x), 1): + y = None + if not acyclic_mapped_representation(parent_set, y): + return FALSE + return TRUE + + +#################### +# FUNCTION conditional_reverse # +#################### +def conditional_reverse( + p, + an_item, +): + """ + :param p + :type p:BOOLEAN + :param an_item + :type an_item:reversible_topology + """ + if p: + return an_item + else: + return topology_reversed(an_item) + + +#################### +# FUNCTION valid_measure_value # +#################### +def valid_measure_value( + m, +): + """ + :param m + :type m:measure_value + """ + if "REAL" == TYPEOF(m): + return m > 0 + else: + if "INTEGER" == TYPEOF(m): + return m > 0 + else: + return TRUE + + +#################### +# FUNCTION gbsf_check_curve # +#################### +def gbsf_check_curve( + cv, +): + """ + :param cv + :type cv:curve + """ + if ( + SIZEOF( + [ + "CONFIG_CONTROL_DESIGN.BOUNDED_CURVE", + "CONFIG_CONTROL_DESIGN.CONIC", + "CONFIG_CONTROL_DESIGN.CURVE_REPLICA", + "CONFIG_CONTROL_DESIGN.LINE", + "CONFIG_CONTROL_DESIGN.OFFSET_CURVE_3D", + ] + * TYPEOF(cv) + ) + > 1 + ): + return FALSE + else: + if ( + SIZEOF(["CONFIG_CONTROL_DESIGN.CIRCLE", "CONFIG_CONTROL_DESIGN.ELLIPSE"] * TYPEOF(cv)) + == 1 + ): + return TRUE + else: + if ( + ("CONFIG_CONTROL_DESIGN.B_SPLINE_CURVE" == TYPEOF(cv)) + and (cv.b_spline_curve.self_intersect == FALSE) + ) or (cv.b_spline_curve.self_intersect == UNKNOWN): + return TRUE + else: + if ( + ("CONFIG_CONTROL_DESIGN.COMPOSITE_CURVE" == TYPEOF(cv)) + and (cv.composite_curve.self_intersect == FALSE) + ) or (cv.composite_curve.self_intersect == UNKNOWN): + return SIZEOF(None) == 0 + else: + if "CONFIG_CONTROL_DESIGN.CURVE_REPLICA" == TYPEOF(cv): + return gbsf_check_curve(cv.curve_replica.parent_curve) + else: + if ( + ("CONFIG_CONTROL_DESIGN.OFFSET_CURVE_3D" == TYPEOF(cv)) + and ( + (cv.offset_curve_3d.self_intersect == FALSE) + or (cv.offset_curve_3d.self_intersect == UNKNOWN) + ) + ) and (not ("CONFIG_CONTROL_DESIGN.POLYLINE" == TYPEOF(cv.basis_curve))): + return gbsf_check_curve(cv.offset_curve_3d.basis_curve) + else: + if "CONFIG_CONTROL_DESIGN.PCURVE" == TYPEOF(cv): + return gbsf_check_curve( + cv.pcurve.reference_to_curve.representation.items[1] + ) and gbsf_check_surface(cv.pcurve.basis_surface) + else: + if "CONFIG_CONTROL_DESIGN.POLYLINE" == TYPEOF(cv): + if SIZEOF(cv.polyline.points) >= 3: + return TRUE + else: + if "CONFIG_CONTROL_DESIGN.SURFACE_CURVE" == TYPEOF(cv): + if gbsf_check_curve(cv.surface_curve.curve_3d): + for i in range( + 1, SIZEOF(cv.surface_curve.associated_geometry), 1 + ): + if "CONFIG_CONTROL_DESIGN.SURFACE" == TYPEOF( + cv.surface_curve.associated_geometry[i] + ): + if not gbsf_check_surface( + cv.surface_curve.associated_geometry[i] + ): + return FALSE + else: + if "CONFIG_CONTROL_DESIGN.PCURVE" == TYPEOF( + cv.surface_curve.associated_geometry[i] + ): + if not gbsf_check_curve( + cv.surface_curve.associated_geometry[i] + ): + return FALSE + return TRUE + else: + if "CONFIG_CONTROL_DESIGN.TRIMMED_CURVE" == TYPEOF(cv): + if ( + SIZEOF( + [ + "CONFIG_CONTROL_DESIGN.LINE", + "CONFIG_CONTROL_DESIGN.PARABOLA", + "CONFIG_CONTROL_DESIGN.HYPERBOLA", + ] + * TYPEOF(cv.trimmed_curve.basis_curve) + ) + == 1 + ): + return TRUE + else: + return gbsf_check_curve( + cv.trimmed_curve.basis_curve + ) + return FALSE + + +#################### +# FUNCTION unique_version_change_order # +#################### +def unique_version_change_order( + c, +): + """ + :param c + :type c:action + """ + for i in range(1, SIZEOF(ords.requests), 1): + assign = assign + None + for k in range(1, SIZEOF(assign), 1): + versions = versions + assign[k].items + return SIZEOF(None) == 0 + + +#################### +# FUNCTION base_axis # +#################### +def base_axis( + dim, + axis1, + axis2, + axis3, +): + """ + :param dim + :type dim:INTEGER + :param axis1 + :type axis1:direction + :param axis2 + :type axis2:direction + :param axis3 + :type axis3:direction + """ + if dim == 3: + d1 = NVL(normalise(axis3), dummy_gri == direction([0, 0, 1])) + d2 = first_proj_axis(d1, axis1) + u = [d2, second_proj_axis(d1, d2, axis2), d1] + else: + if EXISTS(axis1): + d1 = normalise(axis1) + u = [d1, orthogonal_complement(d1)] + if EXISTS(axis2): + factor = dot_product(axis2, u[2]) + if factor < 0: + u[2].direction_ratios[1] = -u[2].direction_ratios[1] + u[2].direction_ratios[2] = -u[2].direction_ratios[2] + else: + if EXISTS(axis2): + d1 = normalise(axis2) + u = [orthogonal_complement(d1), d1] + u[1].direction_ratios[1] = -u[1].direction_ratios[1] + u[1].direction_ratios[2] = -u[1].direction_ratios[2] + else: + u = [dummy_gri == direction([1, 0]), dummy_gri == direction([0, 1])] + return u + + +#################### +# FUNCTION get_basis_surface # +#################### +def get_basis_surface( + c, +): + """ + :param c + :type c:curve_on_surface + """ + surfs = [] + if "CONFIG_CONTROL_DESIGN.PCURVE" == TYPEOF(c): + surfs = [c.pcurve.basis_surface] + else: + if "CONFIG_CONTROL_DESIGN.SURFACE_CURVE" == TYPEOF(c): + n = SIZEOF(c.surface_curve.associated_geometry) + for i in range(1, n, 1): + surfs = surfs + associated_surface(c.surface_curve.associated_geometry[i]) + if "CONFIG_CONTROL_DESIGN.COMPOSITE_CURVE_ON_SURFACE" == TYPEOF(c): + n = SIZEOF(c.composite_curve.segments) + surfs = get_basis_surface(c.composite_curve.segments[1].parent_curve) + if n > 1: + for i in range(2, n, 1): + surfs = surfs * get_basis_surface(c.composite_curve.segments[i].parent_curve) + return surfs + + +#################### +# FUNCTION cc_design_date_time_correlation # +#################### +def cc_design_date_time_correlation( + e, +): + """ + :param e + :type e:cc_design_date_and_time_assignment + """ + dt_role = e.date_and_time_assignment.role.name + case_selector = dt_role + if case_selector == "creation_date": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "request_date": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "release_date": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "start_date": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "sign_off_date": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "contract_date": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "certification_date": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "classification_date": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + elif case_selector == "declassification_date": + if SIZEOF(e.items) != SIZEOF(None): + return FALSE + else: + return TRUE + return TRUE + + +#################### +# FUNCTION list_face_loops # +#################### +def list_face_loops( + f, +): + """ + :param f + :type f:face + """ + for i in range(1, SIZEOF(f.bounds), 1): + loops = loops + f.bounds[i].bound + return loops + + +#################### +# FUNCTION list_of_topology_reversed # +#################### +def list_of_topology_reversed( + a_list, +): + """ + :param a_list + :type a_list:list_of_reversible_topology_item + """ + the_reverse = [] + for i in range(1, SIZEOF(a_list), 1): + the_reverse = topology_reversed(a_list[i]) + the_reverse + return the_reverse + + +#################### +# FUNCTION msf_curve_check # +#################### +def msf_curve_check( + cv, +): + """ + :param cv + :type cv:curve + """ + if ( + SIZEOF( + [ + "CONFIG_CONTROL_DESIGN.BOUNDED_CURVE", + "CONFIG_CONTROL_DESIGN.CONIC", + "CONFIG_CONTROL_DESIGN.CURVE_REPLICA", + "CONFIG_CONTROL_DESIGN.LINE", + "CONFIG_CONTROL_DESIGN.OFFSET_CURVE_3D", + ] + * TYPEOF(cv) + ) + > 1 + ): + return FALSE + else: + if ( + ("CONFIG_CONTROL_DESIGN.B_SPLINE_CURVE" == TYPEOF(cv)) + and (cv.b_spline_curve.self_intersect == FALSE) + ) or (cv.b_spline_curve.self_intersect == UNKNOWN): + return TRUE + else: + if ( + SIZEOF(["CONFIG_CONTROL_DESIGN.CONIC", "CONFIG_CONTROL_DESIGN.LINE"] * TYPEOF(cv)) + == 1 + ): + return TRUE + else: + if "CONFIG_CONTROL_DESIGN.CURVE_REPLICA" == TYPEOF(cv): + return msf_curve_check(cv.curve_replica.parent_curve) + else: + if ( + ("CONFIG_CONTROL_DESIGN.OFFSET_CURVE_3D" == TYPEOF(cv)) + and ( + (cv.offset_curve_3d.self_intersect == FALSE) + or (cv.offset_curve_3d.self_intersect == UNKNOWN) + ) + ) and (not ("CONFIG_CONTROL_DESIGN.POLYLINE" == TYPEOF(cv.basis_curve))): + return msf_curve_check(cv.offset_curve_3d.basis_curve) + else: + if "CONFIG_CONTROL_DESIGN.PCURVE" == TYPEOF(cv): + return msf_curve_check( + cv.pcurve.reference_to_curve.representation.items[1] + ) and msf_surface_check(cv.pcurve.basis_surface) + else: + if "CONFIG_CONTROL_DESIGN.SURFACE_CURVE" == TYPEOF(cv): + if msf_curve_check(cv.surface_curve.curve_3d): + for i in range( + 1, SIZEOF(cv.surface_curve.associated_geometry), 1 + ): + if "CONFIG_CONTROL_DESIGN.SURFACE" == TYPEOF( + cv.surface_curve.associated_geometry[i] + ): + if not msf_surface_check( + cv.surface_curve.associated_geometry[i] + ): + return FALSE + else: + if "CONFIG_CONTROL_DESIGN.PCURVE" == TYPEOF( + cv.surface_curve.associated_geometry[i] + ): + if not msf_curve_check( + cv.surface_curve.associated_geometry[i] + ): + return FALSE + return TRUE + else: + if "CONFIG_CONTROL_DESIGN.POLYLINE" == TYPEOF(cv): + if SIZEOF(cv.polyline.points) >= 3: + return TRUE + return FALSE + + +#################### +# FUNCTION shell_reversed # +#################### +def shell_reversed( + a_shell, +): + """ + :param a_shell + :type a_shell:shell + """ + if "CONFIG_CONTROL_DESIGN.OPEN_SHELL" == TYPEOF(a_shell): + return open_shell_reversed(a_shell) + else: + if "CONFIG_CONTROL_DESIGN.CLOSED_SHELL" == TYPEOF(a_shell): + return closed_shell_reversed(a_shell) + else: + return None + + +#################### +# FUNCTION topology_reversed # +#################### +def topology_reversed( + an_item, +): + """ + :param an_item + :type an_item:reversible_topology + """ + if "CONFIG_CONTROL_DESIGN.EDGE" == TYPEOF(an_item): + return edge_reversed(an_item) + if "CONFIG_CONTROL_DESIGN.PATH" == TYPEOF(an_item): + return path_reversed(an_item) + if "CONFIG_CONTROL_DESIGN.FACE_BOUND" == TYPEOF(an_item): + return face_bound_reversed(an_item) + if "CONFIG_CONTROL_DESIGN.FACE" == TYPEOF(an_item): + return face_reversed(an_item) + if "CONFIG_CONTROL_DESIGN.SHELL" == TYPEOF(an_item): + return shell_reversed(an_item) + if "SET" == TYPEOF(an_item): + return set_of_topology_reversed(an_item) + if "LIST" == TYPEOF(an_item): + return list_of_topology_reversed(an_item) + return None + + +#################### +# FUNCTION first_proj_axis # +#################### +def first_proj_axis( + z_axis, + arg, +): + """ + :param z_axis + :type z_axis:direction + :param arg + :type arg:direction + """ + if not EXISTS(z_axis): + return None + else: + z = normalise(z_axis) + if not EXISTS(arg): + if z.direction_ratios != [1, 0, 0]: + v = dummy_gri == direction([1, 0, 0]) + else: + v = dummy_gri == direction([0, 1, 0]) + else: + if arg.dim != 3: + return None + if cross_product(arg, z).magnitude == 0: + return None + else: + v = normalise(arg) + x_vec = scalar_times_vector(dot_product(v, z), z) + x_axis = vector_difference(v, x_vec).orientation + x_axis = normalise(x_axis) + return x_axis + + +#################### +# FUNCTION orthogonal_complement # +#################### +def orthogonal_complement( + vec, +): + """ + :param vec + :type vec:direction + """ + if (vec.dim != 2) or (not EXISTS(vec)): + return None + else: + result = dummy_gri == direction([-vec.direction_ratios[2], vec.direction_ratios[1]]) + return result + + +#################### +# FUNCTION make_array_of_array # +#################### +def make_array_of_array( + lis, + low1, + u1, + low2, + u2, +): + """ + :param lis + :type lis:(null) + :param low1 + :type low1:INTEGER + :param u1 + :type u1:INTEGER + :param low2 + :type low2:INTEGER + :param u2 + :type u2:INTEGER + """ + if ((u1 - low1) + 1) != SIZEOF(lis): + return None + if ((u2 - low2) + 1) != SIZEOF(lis[1]): + return None + res = [list_to_array(lis[1], low2, u2), (u1 - low1) + 1] + for i in range(2, HIINDEX(lis), 1): + if ((u2 - low2) + 1) != SIZEOF(lis[i]): + return None + res[(low1 + i) - 1] = list_to_array(lis[i], low2, u2) + return res + + +#################### +# FUNCTION second_proj_axis # +#################### +def second_proj_axis( + z_axis, + x_axis, + arg, +): + """ + :param z_axis + :type z_axis:direction + :param x_axis + :type x_axis:direction + :param arg + :type arg:direction + """ + if not EXISTS(arg): + v = dummy_gri == direction([0, 1, 0]) + else: + v = arg + temp = scalar_times_vector(dot_product(v, z_axis), z_axis) + y_axis = vector_difference(v, temp) + temp = scalar_times_vector(dot_product(v, x_axis), x_axis) + y_axis = vector_difference(y_axis, temp) + y_axis = normalise(y_axis) + return y_axis.orientation + + +#################### +# FUNCTION bag_to_set # +#################### +def bag_to_set( + the_bag, +): + """ + :param the_bag + :type the_bag:(null) + """ + if SIZEOF(the_bag) > 0: + for i in range(1, HIINDEX(the_bag), 1): + the_set = the_set + the_bag[i] + return the_set + + +#################### +# FUNCTION valid_wireframe_edge_curve # +#################### +def valid_wireframe_edge_curve( + crv, +): + """ + :param crv + :type crv:curve + """ + if ( + SIZEOF( + [ + "CONFIG_CONTROL_DESIGN.LINE", + "CONFIG_CONTROL_DESIGN.CONIC", + "CONFIG_CONTROL_DESIGN.B_SPLINE_CURVE", + "CONFIG_CONTROL_DESIGN.POLYLINE", + ] + * TYPEOF(crv) + ) + == 1 + ): + return TRUE + else: + if "CONFIG_CONTROL_DESIGN.CURVE_REPLICA" == TYPEOF(crv): + return valid_wireframe_edge_curve(crv.curve_replica.parent_curve) + else: + if "CONFIG_CONTROL_DESIGN.OFFSET_CURVE_3D" == TYPEOF(crv): + return valid_wireframe_edge_curve(crv.offset_curve_3d.basis_curve) + return FALSE + + +#################### +# FUNCTION acyclic_product_category_relationship # +#################### +def acyclic_product_category_relationship( + relation, + children, +): + """ + :param relation + :type relation:product_category_relationship + :param children + :type children:(null) + """ + for i in range(1, HIINDEX(children), 1): + if relation.category == children[i]: + return FALSE + x = bag_to_set( + USEDIN( + relation.category, + "CONFIG_CONTROL_DESIGN." + "PRODUCT_CATEGORY_RELATIONSHIP.SUB_CATEGORY", + ) + ) + local_children = children + relation.category + if SIZEOF(x) > 0: + for i in range(1, HIINDEX(x), 1): + if not acyclic_product_category_relationship(x[i], local_children): + return FALSE + return TRUE + + +#################### +# FUNCTION surface_weights_positive # +#################### +def surface_weights_positive( + b, +): + """ + :param b + :type b:rational_b_spline_surface + """ + for i in range(0, b.u_upper, 1): + for j in range(0, b.v_upper, 1): + if b.weights[i][j] <= 0: + result = FALSE + return result + return result + + +#################### +# FUNCTION vector_difference # +#################### +def vector_difference( + arg1, + arg2, +): + """ + :param arg1 + :type arg1:vector_or_direction + :param arg2 + :type arg2:vector_or_direction + """ + if ((not EXISTS(arg1)) or (not EXISTS(arg2))) or (arg1.dim != arg2.dim): + return None + else: + # begin/end block + if "CONFIG_CONTROL_DESIGN.VECTOR" == TYPEOF(arg1): + mag1 = arg1.magnitude + vec1 = arg1.orientation + else: + mag1 = 1 + vec1 = arg1 + if "CONFIG_CONTROL_DESIGN.VECTOR" == TYPEOF(arg2): + mag2 = arg2.magnitude + vec2 = arg2.orientation + else: + mag2 = 1 + vec2 = arg2 + vec1 = normalise(vec1) + vec2 = normalise(vec2) + ndim = SIZEOF(vec1.direction_ratios) + mag = 0 + res = dummy_gri == direction(vec1.direction_ratios) + for i in range(1, ndim, 1): + res.direction_ratios[i] = (mag1 * vec1.direction_ratios[i]) + ( + mag2 * vec2.direction_ratios[i] + ) + mag = mag + (res.direction_ratios[i] * res.direction_ratios[i]) + if mag > 0: + result = dummy_gri == vector(res, SQRT(mag)) + else: + result = dummy_gri == vector(vec1, 0) + return result + + +#################### +# FUNCTION acyclic_product_definition_relationship # +#################### +def acyclic_product_definition_relationship( + relation, + relatives, + specific_relation, +): + """ + :param relation + :type relation:product_definition_relationship + :param relatives + :type relatives:(null) + :param specific_relation + :type specific_relation:STRING + """ + if relation.relating_product_definition == relatives: + return FALSE + x = None + for i in range(1, HIINDEX(x), 1): + if not acyclic_product_definition_relationship( + x[i], relatives + relation.relating_product_definition, specific_relation + ): + return FALSE + return TRUE + + +#################### +# FUNCTION constraints_geometry_shell_based_wireframe_model # +#################### +def constraints_geometry_shell_based_wireframe_model( + m, +): + """ + :param m + :type m:shell_based_wireframe_model + """ + for j in range(1, SIZEOF(m.sbwm_boundary), 1): + if (not ("CONFIG_CONTROL_DESIGN.WIRE_SHELL" == TYPEOF(m.sbwm_boundary[j]))) and ( + not ("CONFIG_CONTROL_DESIGN.VERTEX_SHELL" == TYPEOF(m.sbwm_boundary[j])) + ): + result = FALSE + return result + return result + + +#################### +# FUNCTION list_to_set # +#################### +def list_to_set( + l, +): + """ + :param l + :type l:(null) + """ + for i in range(1, SIZEOF(l), 1): + s = s + l[i] + return s + + +#################### +# FUNCTION valid_calendar_date # +#################### +def valid_calendar_date( + date, +): + """ + :param date + :type date:calendar_date + """ + if not ((1 <= date.day_component) and (date.day_component <= 31)): + return FALSE + case_selector = date.month_component + if case_selector == 4: + return (1 <= date.day_component) and (date.day_component <= 30) + elif case_selector == 6: + return (1 <= date.day_component) and (date.day_component <= 30) + elif case_selector == 9: + return (1 <= date.day_component) and (date.day_component <= 30) + elif case_selector == 11: + return (1 <= date.day_component) and (date.day_component <= 30) + elif case_selector == 2: + # begin/end block + if leap_year(date.year_component): + return (1 <= date.day_component) and (date.day_component <= 29) + else: + return (1 <= date.day_component) and (date.day_component <= 28) + else: + return TRUE + + +#################### +# FUNCTION valid_wireframe_vertex_point # +#################### +def valid_wireframe_vertex_point( + pnt, +): + """ + :param pnt + :type pnt:point + """ + if "CONFIG_CONTROL_DESIGN.CARTESIAN_POINT" == TYPEOF(pnt): + return TRUE + else: + if "CONFIG_CONTROL_DESIGN.POINT_REPLICA" == TYPEOF(pnt): + return valid_wireframe_vertex_point(pnt.point_replica.parent_pt) + return FALSE + + +#################### +# FUNCTION list_to_array # +#################### +def list_to_array( + lis, + low, + u, +): + """ + :param lis + :type lis:(null) + :param low + :type low:INTEGER + :param u + :type u:INTEGER + """ + n = SIZEOF(lis) + if n != ((u - low) + 1): + return None + else: + res = [lis[1], n] + for i in range(2, n, 1): + res[(low + i) - 1] = lis[i] + return res + + +#################### +# FUNCTION using_items # +#################### +def using_items( + item, + checked_items, +): + """ + :param item + :type item:founded_item_select + :param checked_items + :type checked_items:(null) + """ + result_items = [] + new_check_items = checked_items + item + next_items = None + if SIZEOF(next_items) > 0: + for i in range(1, HIINDEX(next_items), 1): + if not (next_items[i] == new_check_items): + result_items = (result_items + next_items[i]) + using_items( + next_items[i], new_check_items + ) + return result_items + + +#################### +# FUNCTION constraints_geometry_shell_based_surface_model # +#################### +def constraints_geometry_shell_based_surface_model( + m, +): + """ + :param m + :type m:shell_based_surface_model + """ + for j in range(1, SIZEOF(m.sbsm_boundary), 1): + if (not ("CONFIG_CONTROL_DESIGN.OPEN_SHELL" == TYPEOF(m.sbsm_boundary[j]))) and ( + not ("CONFIG_CONTROL_DESIGN.CLOSED_SHELL" == TYPEOF(m.sbsm_boundary[j])) + ): + result = FALSE + return result + return result + + +#################### +# FUNCTION face_bound_reversed # +#################### +def face_bound_reversed( + a_face_bound, +): + """ + :param a_face_bound + :type a_face_bound:face_bound + """ + if "CONFIG_CONTROL_DESIGN.FACE_OUTER_BOUND" == TYPEOF(a_face_bound): + the_reverse = ( + dummy_tri + == face_bound(a_face_bound.face_bound.bound, not a_face_bound.face_bound.orientation) + ) == face_outer_bound() + else: + the_reverse = dummy_tri == face_bound(a_face_bound.bound, not a_face_bound.orientation) + return the_reverse + + +#################### +# FUNCTION set_of_topology_reversed # +#################### +def set_of_topology_reversed( + a_set, +): + """ + :param a_set + :type a_set:set_of_reversible_topology_item + """ + the_reverse = [] + for i in range(1, SIZEOF(a_set), 1): + the_reverse = the_reverse + topology_reversed(a_set[i]) + return the_reverse + + +#################### +# FUNCTION dimension_of # +#################### +def dimension_of( + item, +): + """ + :param item + :type item:geometric_representation_item + """ + x = using_representations(item) + y = x[1].context_of_items + return y.geometric_representation_context.coordinate_space_dimension + + +#################### +# FUNCTION scalar_times_vector # +#################### +def scalar_times_vector( + scalar, + vec, +): + """ + :param scalar + :type scalar:REAL + :param vec + :type vec:vector_or_direction + """ + if (not EXISTS(scalar)) or (not EXISTS(vec)): + return None + else: + if "CONFIG_CONTROL_DESIGN.VECTOR" == TYPEOF(vec): + v = dummy_gri == direction(vec.orientation.direction_ratios) + mag = scalar * vec.magnitude + else: + v = dummy_gri == direction(vec.direction_ratios) + mag = scalar + if mag < 0: + for i in range(1, SIZEOF(v.direction_ratios), 1): + v.direction_ratios[i] = -v.direction_ratios[i] + mag = -mag + result = dummy_gri == vector(normalise(v), mag) + return result + + +#################### +# FUNCTION dimensions_for_si_unit # +#################### +def dimensions_for_si_unit( + n, +): + """ + :param n + :type n:si_unit_name + """ + case_selector = n + if case_selector == metre: + return dimensional_exponents(1, 0, 0, 0, 0, 0, 0) + elif case_selector == gram: + return dimensional_exponents(0, 1, 0, 0, 0, 0, 0) + elif case_selector == second: + return dimensional_exponents(0, 0, 1, 0, 0, 0, 0) + elif case_selector == ampere: + return dimensional_exponents(0, 0, 0, 1, 0, 0, 0) + elif case_selector == kelvin: + return dimensional_exponents(0, 0, 0, 0, 1, 0, 0) + elif case_selector == mole: + return dimensional_exponents(0, 0, 0, 0, 0, 1, 0) + elif case_selector == candela: + return dimensional_exponents(0, 0, 0, 0, 0, 0, 1) + elif case_selector == radian: + return dimensional_exponents(0, 0, 0, 0, 0, 0, 0) + elif case_selector == steradian: + return dimensional_exponents(0, 0, 0, 0, 0, 0, 0) + elif case_selector == hertz: + return dimensional_exponents(0, 0, -1, 0, 0, 0, 0) + elif case_selector == newton: + return dimensional_exponents(1, 1, -2, 0, 0, 0, 0) + elif case_selector == pascal: + return dimensional_exponents(-1, 1, -2, 0, 0, 0, 0) + elif case_selector == joule: + return dimensional_exponents(2, 1, -2, 0, 0, 0, 0) + elif case_selector == watt: + return dimensional_exponents(2, 1, -3, 0, 0, 0, 0) + elif case_selector == coulomb: + return dimensional_exponents(0, 0, 1, 1, 0, 0, 0) + elif case_selector == volt: + return dimensional_exponents(2, 1, -3, -1, 0, 0, 0) + elif case_selector == farad: + return dimensional_exponents(-2, -1, 4, 1, 0, 0, 0) + elif case_selector == ohm: + return dimensional_exponents(2, 1, -3, -2, 0, 0, 0) + elif case_selector == siemens: + return dimensional_exponents(-2, -1, 3, 2, 0, 0, 0) + elif case_selector == weber: + return dimensional_exponents(2, 1, -2, -1, 0, 0, 0) + elif case_selector == tesla: + return dimensional_exponents(0, 1, -2, -1, 0, 0, 0) + elif case_selector == henry: + return dimensional_exponents(2, 1, -2, -2, 0, 0, 0) + elif case_selector == degree_celsius: + return dimensional_exponents(0, 0, 0, 0, 1, 0, 0) + elif case_selector == lumen: + return dimensional_exponents(0, 0, 0, 0, 0, 0, 1) + elif case_selector == lux: + return dimensional_exponents(-2, 0, 0, 0, 0, 0, 1) + elif case_selector == becquerel: + return dimensional_exponents(0, 0, -1, 0, 0, 0, 0) + elif case_selector == gray: + return dimensional_exponents(2, 0, -2, 0, 0, 0, 0) + elif case_selector == sievert: + return dimensional_exponents(2, 0, -2, 0, 0, 0, 0) + + +#################### +# FUNCTION assembly_shape_is_defined # +#################### +def assembly_shape_is_defined( + assy, + schma, +): + """ + :param assy + :type assy:next_assembly_usage_occurrence + :param schma + :type schma:STRING + """ + pr1_set = bag_to_set( + USEDIN(assy.related_product_definition, schma + ".PROPERTY_DEFINITION.DEFINITION") + ) + for i in range(1, HIINDEX(pr1_set), 1): + sdr_set = sdr_set + None + pdrel_set = bag_to_set( + USEDIN( + assy.related_product_definition, + (schma + ".PRODUCT_DEFINITION_RELATIONSHIP.") + "RELATED_PRODUCT_DEFINITION", + ) + ) + for j in range(1, HIINDEX(pdrel_set), 1): + pr2_set = pr2_set + USEDIN(pdrel_set[j], schma + ".PROPERTY_DEFINITION.DEFINITION") + for i in range(1, HIINDEX(pr2_set), 1): + sdr_set = sdr_set + None + if SIZEOF(sdr_set) > 0: + for i in range(1, HIINDEX(sdr_set), 1): + srr_set = None + if SIZEOF(srr_set) > 0: + for j in range(1, HIINDEX(srr_set), 1): + if SIZEOF(None * None) >= 1: + if SIZEOF(None) > 0: + return FALSE + return TRUE + + +#################### +# FUNCTION open_shell_reversed # +#################### +def open_shell_reversed( + a_shell, +): + """ + :param a_shell + :type a_shell:open_shell + """ + if "CONFIG_CONTROL_DESIGN.ORIENTED_OPEN_SHELL" == TYPEOF(a_shell): + the_reverse = ( + (dummy_tri == connected_face_set(a_shell.connected_face_set.cfs_faces)) == open_shell() + ) == oriented_open_shell( + a_shell.oriented_open_shell.open_shell_element, + not a_shell.oriented_open_shell.orientation, + ) + else: + the_reverse = ( + (dummy_tri == connected_face_set(a_shell.connected_face_set.cfs_faces)) == open_shell() + ) == oriented_open_shell(a_shell, FALSE) + return the_reverse + + +#################### +# FUNCTION acyclic_surface_replica # +#################### +def acyclic_surface_replica( + rep, + parent, +): + """ + :param rep + :type rep:surface_replica + :param parent + :type parent:surface + """ + if not ("CONFIG_CONTROL_DESIGN.SURFACE_REPLICA" == TYPEOF(parent)): + return TRUE + if parent == rep: + return FALSE + else: + return acyclic_surface_replica(rep, parent.surface_replica.parent_surface) + + +#################### +# FUNCTION gbsf_check_surface # +#################### +def gbsf_check_surface( + sf, +): + """ + :param sf + :type sf:surface + """ + if ( + ("CONFIG_CONTROL_DESIGN.B_SPLINE_SURFACE" == TYPEOF(sf)) + and (sf.b_spline_surface.self_intersect == FALSE) + ) or (sf.b_spline_surface.self_intersect == UNKNOWN): + return TRUE + else: + if ( + SIZEOF( + [ + "CONFIG_CONTROL_DESIGN.SPHERICAL_SURFACE", + "CONFIG_CONTROL_DESIGN.TOROIDAL_SURFACE", + ] + * TYPEOF(sf) + ) + == 1 + ): + return TRUE + else: + if "CONFIG_CONTROL_DESIGN.CURVE_BOUNDED_SURFACE" == TYPEOF(sf): + if ( + SIZEOF( + [ + "CONFIG_CONTROL_DESIGN.CONICAL_SURFACE", + "CONFIG_CONTROL_DESIGN.CYLINDRICAL_SURFACE", + "CONFIG_CONTROL_DESIGN.PLANE", + ] + * TYPEOF(sf.curve_bounded_surface.basis_surface) + ) + == 1 + ): + return SIZEOF(None) == 0 + else: + if gbsf_check_surface(sf.curve_bounded_surface.basis_surface): + return SIZEOF(None) == 0 + else: + if ( + ("CONFIG_CONTROL_DESIGN.OFFSET_SURFACE" == TYPEOF(sf)) + and (sf.offset_surface.self_intersect == FALSE) + ) or (sf.offset_surface.self_intersect == UNKNOWN): + return gbsf_check_surface(sf.offset_surface.basis_surface) + else: + if "CONFIG_CONTROL_DESIGN.RECTANGULAR_COMPOSITE_SURFACE" == TYPEOF(sf): + for i in range(1, SIZEOF(sf.rectangular_composite_surface.segments), 1): + for j in range( + 1, SIZEOF(sf.rectangular_composite_surface.segments[i]), 1 + ): + if not gbsf_check_surface( + sf.rectangular_composite_surface.segments[i][j].parent_surface + ): + return FALSE + return TRUE + else: + if "CONFIG_CONTROL_DESIGN.RECTANGULAR_TRIMMED_SURFACE" == TYPEOF(sf): + if ( + SIZEOF( + [ + "CONFIG_CONTROL_DESIGN.CONICAL_SURFACE", + "CONFIG_CONTROL_DESIGN.CYLINDRICAL_SURFACE", + "CONFIG_CONTROL_DESIGN.PLANE", + ] + * TYPEOF(sf.rectangular_trimmed_surface.basis_surface) + ) + == 1 + ): + return TRUE + else: + return gbsf_check_surface( + sf.rectangular_trimmed_surface.basis_surface + ) + else: + if "CONFIG_CONTROL_DESIGN.SURFACE_REPLICA" == TYPEOF(sf): + return gbsf_check_surface(sf.surface_replica.parent_surface) + else: + if "CONFIG_CONTROL_DESIGN.SWEPT_SURFACE" == TYPEOF(sf): + return gbsf_check_curve(sf.swept_surface.swept_curve) + return FALSE + + +#################### +# FUNCTION msf_surface_check # +#################### +def msf_surface_check( + surf, +): + """ + :param surf + :type surf:surface + """ + if "CONFIG_CONTROL_DESIGN.ELEMENTARY_SURFACE" == TYPEOF(surf): + return TRUE + else: + if "CONFIG_CONTROL_DESIGN.SWEPT_SURFACE" == TYPEOF(surf): + return msf_curve_check(surf.swept_surface.swept_curve) + else: + if ( + ("CONFIG_CONTROL_DESIGN.OFFSET_SURFACE" == TYPEOF(surf)) + and (surf.offset_surface.self_intersect == FALSE) + ) or (surf.offset_surface.self_intersect == UNKNOWN): + return msf_surface_check(surf.offset_surface.basis_surface) + else: + if "CONFIG_CONTROL_DESIGN.SURFACE_REPLICA" == TYPEOF(surf): + return msf_surface_check(surf.surface_replica.parent_surface) + else: + if ( + ("CONFIG_CONTROL_DESIGN.B_SPLINE_SURFACE" == TYPEOF(surf)) + and (surf.b_spline_surface.self_intersect == FALSE) + ) or (surf.b_spline_surface.self_intersect == UNKNOWN): + return TRUE + return FALSE + + +#################### +# FUNCTION normalise # +#################### +def normalise( + arg, +): + """ + :param arg + :type arg:vector_or_direction + """ + if not EXISTS(arg): + result = None + else: + ndim = arg.dim + if "CONFIG_CONTROL_DESIGN.VECTOR" == TYPEOF(arg): + # begin/end block + v = dummy_gri == direction(arg.orientation.direction_ratios) + if arg.magnitude == 0: + return None + else: + vec = dummy_gri == vector(v, 1) + else: + v = dummy_gri == direction(arg.direction_ratios) + mag = 0 + for i in range(1, ndim, 1): + mag = mag + (v.direction_ratios[i] * v.direction_ratios[i]) + if mag > 0: + mag = SQRT(mag) + for i in range(1, ndim, 1): + v.direction_ratios[i] = v.direction_ratios[i] / mag + if "CONFIG_CONTROL_DESIGN.VECTOR" == TYPEOF(arg): + vec.orientation = v + result = vec + else: + result = v + else: + return None + return result + + +#################### +# FUNCTION msb_shells # +#################### +def msb_shells( + brep, +): + """ + :param brep + :type brep:manifold_solid_brep + """ + if SIZEOF(None) >= 1: + return brep.brep_with_voids.voids + brep.outer + else: + return [brep.outer] + + +#################### +# FUNCTION mixed_loop_type_set # +#################### +def mixed_loop_type_set( + l, +): + """ + :param l + :type l:(null) + """ + if SIZEOF(l) <= 1: + return FALSE + poly_loop_type = "CONFIG_CONTROL_DESIGN.POLY_LOOP" == TYPEOF(l[1]) + for i in range(2, SIZEOF(l), 1): + if ("CONFIG_CONTROL_DESIGN.POLY_LOOP" == TYPEOF(l[i])) != poly_loop_type: + return TRUE + return FALSE + + +#################### +# FUNCTION derive_dimensional_exponents # +#################### +def derive_dimensional_exponents( + x, +): + """ + :param x + :type x:unit + """ + result = x.dimensions + return result + + +#################### +# FUNCTION curve_weights_positive # +#################### +def curve_weights_positive( + b, +): + """ + :param b + :type b:rational_b_spline_curve + """ + for i in range(0, b.upper_index_on_control_points, 1): + if b.weights[i] <= 0: + result = FALSE + return result + return result + + +#################### +# FUNCTION valid_geometrically_bounded_wf_point # +#################### +def valid_geometrically_bounded_wf_point( + pnt, +): + """ + :param pnt + :type pnt:point + """ + if "CONFIG_CONTROL_DESIGN.CARTESIAN_POINT" == TYPEOF(pnt): + return TRUE + else: + if "CONFIG_CONTROL_DESIGN.POINT_ON_CURVE" == TYPEOF(pnt): + return valid_geometrically_bounded_wf_curve(pnt.point_on_curve.basis_curve) + else: + if "CONFIG_CONTROL_DESIGN.POINT_REPLICA" == TYPEOF(pnt): + return valid_geometrically_bounded_wf_point(pnt.point_replica.parent_pt) + return FALSE + + +#################### +# FUNCTION path_head_to_tail # +#################### +def path_head_to_tail( + a_path, +): + """ + :param a_path + :type a_path:path + """ + n = SIZEOF(a_path.edge_list) + for i in range(2, n, 1): + p = p and (a_path.edge_list[i - 1].edge_end == a_path.edge_list[i].edge_start) + return p + + +#################### +# FUNCTION path_reversed # +#################### +def path_reversed( + a_path, +): + """ + :param a_path + :type a_path:path + """ + if "CONFIG_CONTROL_DESIGN.ORIENTED_PATH" == TYPEOF(a_path): + the_reverse = ( + dummy_tri == path(list_of_topology_reversed(a_path.edge_list)) + ) == oriented_path(a_path.oriented_path.path_element, not a_path.oriented_path.orientation) + else: + the_reverse = ( + dummy_tri == path(list_of_topology_reversed(a_path.edge_list)) + ) == oriented_path(a_path, FALSE) + return the_reverse + + +#################### +# FUNCTION leap_year # +#################### +def leap_year( + year, +): + """ + :param year + :type year:INTEGER + """ + if (((year % 4) == 0) and ((year % 100) != 0)) or ((year % 400) == 0): + return TRUE + else: + return FALSE + + +#################### +# FUNCTION face_reversed # +#################### +def face_reversed( + a_face, +): + """ + :param a_face + :type a_face:face + """ + if "CONFIG_CONTROL_DESIGN.ORIENTED_FACE" == TYPEOF(a_face): + the_reverse = (dummy_tri == face(set_of_topology_reversed(a_face.bounds))) == oriented_face( + a_face.oriented_face.face_element, not a_face.oriented_face.orientation + ) + else: + the_reverse = (dummy_tri == face(set_of_topology_reversed(a_face.bounds))) == oriented_face( + a_face, FALSE + ) + return the_reverse + + +#################### +# FUNCTION constraints_param_b_spline # +#################### +def constraints_param_b_spline( + degree, + up_knots, + up_cp, + knot_mult, + knots, +): + """ + :param degree + :type degree:INTEGER + :param up_knots + :type up_knots:INTEGER + :param up_cp + :type up_cp:INTEGER + :param knot_mult + :type knot_mult:(null) + :param knots + :type knots:(null) + """ + sum = knot_mult[1] + for i in range(2, up_knots, 1): + sum = sum + knot_mult[i] + if (((degree < 1) or (up_knots < 2)) or (up_cp < degree)) or (sum != ((degree + up_cp) + 2)): + result = FALSE + return result + k = knot_mult[1] + if (k < 1) or (k > (degree + 1)): + result = FALSE + return result + for i in range(2, up_knots, 1): + if (knot_mult[i] < 1) or (knots[i] <= knots[i - 1]): + result = FALSE + return result + k = knot_mult[i] + if (i < up_knots) and (k > degree): + result = FALSE + return result + if (i == up_knots) and (k > (degree + 1)): + result = FALSE + return result + return result + + +#################### +# FUNCTION using_representations # +#################### +def using_representations( + item, +): + """ + :param item + :type item:founded_item_select + """ + results = [] + result_bag = USEDIN(item, "CONFIG_CONTROL_DESIGN.REPRESENTATION.ITEMS") + if SIZEOF(result_bag) > 0: + for i in range(1, HIINDEX(result_bag), 1): + results = results + result_bag[i] + intermediate_items = using_items(item, []) + if SIZEOF(intermediate_items) > 0: + for i in range(1, HIINDEX(intermediate_items), 1): + result_bag = USEDIN(intermediate_items[i], "CONFIG_CONTROL_DESIGN.REPRESENTATION.ITEMS") + if SIZEOF(result_bag) > 0: + for j in range(1, HIINDEX(result_bag), 1): + results = results + result_bag[j] + return results + + +#################### +# FUNCTION associated_surface # +#################### +def associated_surface( + arg, +): + """ + :param arg + :type arg:pcurve_or_surface + """ + if "CONFIG_CONTROL_DESIGN.PCURVE" == TYPEOF(arg): + surf = arg.basis_surface + else: + surf = arg + return surf + + +#################### +# FUNCTION acyclic_point_replica # +#################### +def acyclic_point_replica( + rep, + parent, +): + """ + :param rep + :type rep:point_replica + :param parent + :type parent:point + """ + if not ("CONFIG_CONTROL_DESIGN.POINT_REPLICA" == TYPEOF(parent)): + return TRUE + if parent == rep: + return FALSE + else: + return acyclic_point_replica(rep, parent.point_replica.parent_pt) + + +#################### +# FUNCTION cross_product # +#################### +def cross_product( + arg1, + arg2, +): + """ + :param arg1 + :type arg1:direction + :param arg2 + :type arg2:direction + """ + if (((not EXISTS(arg1)) or (arg1.dim == 2)) or (not EXISTS(arg2))) or (arg2.dim == 2): + return None + else: + # begin/end block + v1 = normalise(arg1).direction_ratios + v2 = normalise(arg2).direction_ratios + res = dummy_gri == direction( + [ + (v1[2] * v2[3]) - (v1[3] * v2[2]), + (v1[3] * v2[1]) - (v1[1] * v2[3]), + (v1[1] * v2[2]) - (v1[2] * v2[1]), + ] + ) + mag = 0 + for i in range(1, 3, 1): + mag = mag + (res.direction_ratios[i] * res.direction_ratios[i]) + if mag > 0: + result = dummy_gri == vector(res, SQRT(mag)) + else: + result = dummy_gri == vector(arg1, 0) + return result + + +#################### +# FUNCTION valid_units # +#################### +def valid_units( + m, +): + """ + :param m + :type m:measure_with_unit + """ + if "CONFIG_CONTROL_DESIGN.LENGTH_MEASURE" == TYPEOF(m.value_component): + if derive_dimensional_exponents(m.unit_component) != dimensional_exponents( + 1, 0, 0, 0, 0, 0, 0 + ): + return FALSE + if "CONFIG_CONTROL_DESIGN.MASS_MEASURE" == TYPEOF(m.value_component): + if derive_dimensional_exponents(m.unit_component) != dimensional_exponents( + 0, 1, 0, 0, 0, 0, 0 + ): + return FALSE + if "CONFIG_CONTROL_DESIGN.TIME_MEASURE" == TYPEOF(m.value_component): + if derive_dimensional_exponents(m.unit_component) != dimensional_exponents( + 0, 0, 1, 0, 0, 0, 0 + ): + return FALSE + if "CONFIG_CONTROL_DESIGN.ELECTRIC_CURRENT_MEASURE" == TYPEOF(m.value_component): + if derive_dimensional_exponents(m.unit_component) != dimensional_exponents( + 0, 0, 0, 1, 0, 0, 0 + ): + return FALSE + if "CONFIG_CONTROL_DESIGN.THERMODYNAMIC_TEMPERATURE_MEASURE" == TYPEOF(m.value_component): + if derive_dimensional_exponents(m.unit_component) != dimensional_exponents( + 0, 0, 0, 0, 1, 0, 0 + ): + return FALSE + if "CONFIG_CONTROL_DESIGN.AMOUNT_OF_SUBSTANCE_MEASURE" == TYPEOF(m.value_component): + if derive_dimensional_exponents(m.unit_component) != dimensional_exponents( + 0, 0, 0, 0, 0, 1, 0 + ): + return FALSE + if "CONFIG_CONTROL_DESIGN.LUMINOUS_INTENSITY_MEASURE" == TYPEOF(m.value_component): + if derive_dimensional_exponents(m.unit_component) != dimensional_exponents( + 0, 0, 0, 0, 0, 0, 1 + ): + return FALSE + if "CONFIG_CONTROL_DESIGN.PLANE_ANGLE_MEASURE" == TYPEOF(m.value_component): + if derive_dimensional_exponents(m.unit_component) != dimensional_exponents( + 0, 0, 0, 0, 0, 0, 0 + ): + return FALSE + if "CONFIG_CONTROL_DESIGN.SOLID_ANGLE_MEASURE" == TYPEOF(m.value_component): + if derive_dimensional_exponents(m.unit_component) != dimensional_exponents( + 0, 0, 0, 0, 0, 0, 0 + ): + return FALSE + if "CONFIG_CONTROL_DESIGN.AREA_MEASURE" == TYPEOF(m.value_component): + if derive_dimensional_exponents(m.unit_component) != dimensional_exponents( + 2, 0, 0, 0, 0, 0, 0 + ): + return FALSE + if "CONFIG_CONTROL_DESIGN.VOLUME_MEASURE" == TYPEOF(m.value_component): + if derive_dimensional_exponents(m.unit_component) != dimensional_exponents( + 3, 0, 0, 0, 0, 0, 0 + ): + return FALSE + if "CONFIG_CONTROL_DESIGN.RATIO_MEASURE" == TYPEOF(m.value_component): + if derive_dimensional_exponents(m.unit_component) != dimensional_exponents( + 0, 0, 0, 0, 0, 0, 0 + ): + return FALSE + if "CONFIG_CONTROL_DESIGN.POSITIVE_LENGTH_MEASURE" == TYPEOF(m.value_component): + if derive_dimensional_exponents(m.unit_component) != dimensional_exponents( + 1, 0, 0, 0, 0, 0, 0 + ): + return FALSE + if "CONFIG_CONTROL_DESIGN.POSITIVE_PLANE_ANGLE_MEASURE" == TYPEOF(m.value_component): + if derive_dimensional_exponents(m.unit_component) != dimensional_exponents( + 0, 0, 0, 0, 0, 0, 0 + ): + return FALSE + return TRUE + + +#################### +# FUNCTION constraints_rectangular_composite_surface # +#################### +def constraints_rectangular_composite_surface( + s, +): + """ + :param s + :type s:rectangular_composite_surface + """ + for i in range(1, s.n_u, 1): + for j in range(1, s.n_v, 1): + if not ( + ( + "CONFIG_CONTROL_DESIGN.B_SPLINE_SURFACE" + == TYPEOF(s.segments[i][j].parent_surface) + ) + or ( + "CONFIG_CONTROL_DESIGN.RECTANGULAR_TRIMMED_SURFACE" + == TYPEOF(s.segments[i][j].parent_surface) + ) + ): + return FALSE + for i in range(1, s.n_u - 1, 1): + for j in range(1, s.n_v, 1): + if s.segments[i][j].u_transition == discontinuous: + return FALSE + for i in range(1, s.n_u, 1): + for j in range(1, s.n_v - 1, 1): + if s.segments[i][j].v_transition == discontinuous: + return FALSE + return TRUE + + +#################### +# FUNCTION closed_shell_reversed # +#################### +def closed_shell_reversed( + a_shell, +): + """ + :param a_shell + :type a_shell:closed_shell + """ + if "CONFIG_CONTROL_DESIGN.ORIENTED_CLOSED_SHELL" == TYPEOF(a_shell): + the_reverse = ( + (dummy_tri == connected_face_set(a_shell.connected_face_set.cfs_faces)) + == closed_shell() + ) == oriented_closed_shell( + a_shell.oriented_closed_shell.closed_shell_element, + not a_shell.oriented_closed_shell.orientation, + ) + else: + the_reverse = ( + (dummy_tri == connected_face_set(a_shell.connected_face_set.cfs_faces)) + == closed_shell() + ) == oriented_closed_shell(a_shell, FALSE) + return the_reverse + + +#################### +# FUNCTION boolean_choose # +#################### +def boolean_choose( + b, + choice1, + choice2, +): + """ + :param b + :type b:BOOLEAN + :param choice1 + :type choice1:(null) + :param choice2 + :type choice2:(null) + """ + if b: + return choice1 + else: + return choice2 + + +#################### +# FUNCTION valid_time # +#################### +def valid_time( + time, +): + """ + :param time + :type time:local_time + """ + if EXISTS(time.second_component): + return EXISTS(time.minute_component) + else: + return TRUE + + +#################### +# FUNCTION valid_geometrically_bounded_wf_curve # +#################### +def valid_geometrically_bounded_wf_curve( + crv, +): + """ + :param crv + :type crv:curve + """ + if ( + SIZEOF( + [ + "CONFIG_CONTROL_DESIGN.POLYLINE", + "CONFIG_CONTROL_DESIGN.B_SPLINE_CURVE", + "CONFIG_CONTROL_DESIGN.ELLIPSE", + "CONFIG_CONTROL_DESIGN.CIRCLE", + ] + * TYPEOF(crv) + ) + == 1 + ): + return TRUE + else: + if "CONFIG_CONTROL_DESIGN.TRIMMED_CURVE" == TYPEOF(crv): + if ( + SIZEOF( + [ + "CONFIG_CONTROL_DESIGN.LINE", + "CONFIG_CONTROL_DESIGN.PARABOLA", + "CONFIG_CONTROL_DESIGN.HYPERBOLA", + ] + * TYPEOF(crv.trimmed_curve.basis_curve) + ) + == 1 + ): + return TRUE + else: + return valid_geometrically_bounded_wf_curve(crv.trimmed_curve.basis_curve) + else: + if "CONFIG_CONTROL_DESIGN.OFFSET_CURVE_3D" == TYPEOF(crv): + return valid_geometrically_bounded_wf_curve(crv.offset_curve_3d.basis_curve) + else: + if "CONFIG_CONTROL_DESIGN.CURVE_REPLICA" == TYPEOF(crv): + return valid_geometrically_bounded_wf_curve(crv.curve_replica.parent_curve) + else: + if "CONFIG_CONTROL_DESIGN.COMPOSITE_CURVE" == TYPEOF(crv): + return SIZEOF(None) == 0 + return FALSE + + +#################### +# FUNCTION dot_product # +#################### +def dot_product( + arg1, + arg2, +): + """ + :param arg1 + :type arg1:direction + :param arg2 + :type arg2:direction + """ + if (not EXISTS(arg1)) or (not EXISTS(arg2)): + scalar = None + else: + if arg1.dim != arg2.dim: + scalar = None + else: + # begin/end block + vec1 = normalise(arg1) + vec2 = normalise(arg2) + ndim = arg1.dim + scalar = 0 + for i in range(1, ndim, 1): + scalar = scalar + (vec1.direction_ratios[i] * vec2.direction_ratios[i]) + return scalar + + +#################### +# FUNCTION acyclic_curve_replica # +#################### +def acyclic_curve_replica( + rep, + parent, +): + """ + :param rep + :type rep:curve_replica + :param parent + :type parent:curve + """ + if not ("CONFIG_CONTROL_DESIGN.CURVE_REPLICA" == TYPEOF(parent)): + return TRUE + if parent == rep: + return FALSE + else: + return acyclic_curve_replica(rep, parent.curve_replica.parent_curve) + + +#################### +# RULE change_request_requires_approval # #################### change_request_requires_approval = Rule() #################### - # RULE restrict_date_time_role # +# RULE restrict_date_time_role # #################### restrict_date_time_role = Rule() #################### - # RULE versioned_action_request_requires_status # +# RULE versioned_action_request_requires_status # #################### versioned_action_request_requires_status = Rule() #################### - # RULE acu_requires_security_classification # +# RULE acu_requires_security_classification # #################### acu_requires_security_classification = Rule() #################### - # RULE no_shape_for_supplied_part # +# RULE no_shape_for_supplied_part # #################### no_shape_for_supplied_part = Rule() #################### - # RULE dependent_instantiable_person_and_organization_role # +# RULE dependent_instantiable_person_and_organization_role # #################### dependent_instantiable_person_and_organization_role = Rule() #################### - # RULE product_definition_requires_date_time # +# RULE product_definition_requires_date_time # #################### product_definition_requires_date_time = Rule() #################### - # RULE compatible_dimension # +# RULE compatible_dimension # #################### compatible_dimension = Rule() #################### - # RULE product_version_requires_approval # +# RULE product_version_requires_approval # #################### product_version_requires_approval = Rule() #################### - # RULE change_requires_approval # +# RULE change_requires_approval # #################### change_requires_approval = Rule() #################### - # RULE product_requires_version # +# RULE product_requires_version # #################### product_requires_version = Rule() #################### - # RULE product_definition_requires_person_organization # +# RULE product_definition_requires_person_organization # #################### product_definition_requires_person_organization = Rule() #################### - # RULE product_concept_requires_configuration_item # +# RULE product_concept_requires_configuration_item # #################### product_concept_requires_configuration_item = Rule() #################### - # RULE certification_requires_date_time # +# RULE certification_requires_date_time # #################### certification_requires_date_time = Rule() #################### - # RULE certification_requires_approval # +# RULE certification_requires_approval # #################### certification_requires_approval = Rule() #################### - # RULE subtype_mandatory_effectivity # +# RULE subtype_mandatory_effectivity # #################### subtype_mandatory_effectivity = Rule() #################### - # RULE versioned_action_request_requires_solution # +# RULE versioned_action_request_requires_solution # #################### versioned_action_request_requires_solution = Rule() #################### - # RULE effectivity_requires_approval # +# RULE effectivity_requires_approval # #################### effectivity_requires_approval = Rule() #################### - # RULE unique_version_change_order_rule # +# RULE unique_version_change_order_rule # #################### unique_version_change_order_rule = Rule() #################### - # RULE dependent_instantiable_named_unit # +# RULE dependent_instantiable_named_unit # #################### dependent_instantiable_named_unit = Rule() #################### - # RULE subtype_mandatory_product_definition_formation # +# RULE subtype_mandatory_product_definition_formation # #################### subtype_mandatory_product_definition_formation = Rule() #################### - # RULE approval_requires_approval_person_organization # +# RULE approval_requires_approval_person_organization # #################### approval_requires_approval_person_organization = Rule() #################### - # RULE approvals_are_assigned # +# RULE approvals_are_assigned # #################### approvals_are_assigned = Rule() #################### - # RULE start_work_requires_approval # +# RULE start_work_requires_approval # #################### start_work_requires_approval = Rule() #################### - # RULE approval_person_organization_constraints # +# RULE approval_person_organization_constraints # #################### approval_person_organization_constraints = Rule() #################### - # RULE configuration_item_requires_approval # +# RULE configuration_item_requires_approval # #################### configuration_item_requires_approval = Rule() #################### - # RULE contract_requires_person_organization # +# RULE contract_requires_person_organization # #################### contract_requires_person_organization = Rule() #################### - # RULE dependent_instantiable_date_time_role # +# RULE dependent_instantiable_date_time_role # #################### dependent_instantiable_date_time_role = Rule() #################### - # RULE restrict_product_category_value # +# RULE restrict_product_category_value # #################### restrict_product_category_value = Rule() #################### - # RULE start_work_requires_date_time # +# RULE start_work_requires_date_time # #################### start_work_requires_date_time = Rule() #################### - # RULE product_requires_product_category # +# RULE product_requires_product_category # #################### product_requires_product_category = Rule() #################### - # RULE dependent_instantiable_representation_item # +# RULE dependent_instantiable_representation_item # #################### dependent_instantiable_representation_item = Rule() #################### - # RULE change_request_requires_person_organization # +# RULE change_request_requires_person_organization # #################### change_request_requires_person_organization = Rule() #################### - # RULE product_definition_requires_approval # +# RULE product_definition_requires_approval # #################### product_definition_requires_approval = Rule() #################### - # RULE subtype_mandatory_representation_context # +# RULE subtype_mandatory_representation_context # #################### subtype_mandatory_representation_context = Rule() #################### - # RULE security_classification_requires_date_time # +# RULE security_classification_requires_date_time # #################### security_classification_requires_date_time = Rule() #################### - # RULE security_classification_optional_date_time # +# RULE security_classification_optional_date_time # #################### security_classification_optional_date_time = Rule() #################### - # RULE as_required_quantity # +# RULE as_required_quantity # #################### as_required_quantity = Rule() #################### - # RULE start_request_requires_approval # +# RULE start_request_requires_approval # #################### start_request_requires_approval = Rule() #################### - # RULE geometric_representation_item_3d # +# RULE geometric_representation_item_3d # #################### geometric_representation_item_3d = Rule() #################### - # RULE application_context_requires_ap_definition # +# RULE application_context_requires_ap_definition # #################### application_context_requires_ap_definition = Rule() #################### - # RULE subtype_mandatory_representation # +# RULE subtype_mandatory_representation # #################### subtype_mandatory_representation = Rule() #################### - # RULE change_requires_date_time # +# RULE change_requires_date_time # #################### change_requires_date_time = Rule() #################### - # RULE dependent_instantiable_action_directive # +# RULE dependent_instantiable_action_directive # #################### dependent_instantiable_action_directive = Rule() #################### - # RULE restrict_security_classification_level # +# RULE restrict_security_classification_level # #################### restrict_security_classification_level = Rule() #################### - # RULE approval_requires_approval_date_time # +# RULE approval_requires_approval_date_time # #################### approval_requires_approval_date_time = Rule() #################### - # RULE subtype_mandatory_product_definition_usage # +# RULE subtype_mandatory_product_definition_usage # #################### subtype_mandatory_product_definition_usage = Rule() #################### - # RULE restrict_approval_status # +# RULE restrict_approval_status # #################### restrict_approval_status = Rule() #################### - # RULE change_request_requires_date_time # +# RULE change_request_requires_date_time # #################### change_request_requires_date_time = Rule() #################### - # RULE dependent_instantiable_contract_type # +# RULE dependent_instantiable_contract_type # #################### dependent_instantiable_contract_type = Rule() #################### - # RULE contract_requires_approval # +# RULE contract_requires_approval # #################### contract_requires_approval = Rule() #################### - # RULE restrict_document_type # +# RULE restrict_document_type # #################### restrict_document_type = Rule() #################### - # RULE dependent_instantiable_certification_type # +# RULE dependent_instantiable_certification_type # #################### dependent_instantiable_certification_type = Rule() #################### - # RULE design_context_for_property # +# RULE design_context_for_property # #################### design_context_for_property = Rule() #################### - # RULE product_version_requires_person_organization # +# RULE product_version_requires_person_organization # #################### product_version_requires_person_organization = Rule() #################### - # RULE dependent_instantiable_approval_status # +# RULE dependent_instantiable_approval_status # #################### dependent_instantiable_approval_status = Rule() #################### - # RULE subtype_mandatory_shape_representation # +# RULE subtype_mandatory_shape_representation # #################### subtype_mandatory_shape_representation = Rule() #################### - # RULE dependent_instantiable_date # +# RULE dependent_instantiable_date # #################### dependent_instantiable_date = Rule() #################### - # RULE configuration_item_requires_person_organization # +# RULE configuration_item_requires_person_organization # #################### configuration_item_requires_person_organization = Rule() #################### - # RULE dependent_instantiable_document_type # +# RULE dependent_instantiable_document_type # #################### dependent_instantiable_document_type = Rule() #################### - # RULE restrict_contract_type # +# RULE restrict_contract_type # #################### restrict_contract_type = Rule() #################### - # RULE subtype_mandatory_product_context # +# RULE subtype_mandatory_product_context # #################### subtype_mandatory_product_context = Rule() #################### - # RULE dependent_instantiable_parametric_representation_context # +# RULE dependent_instantiable_parametric_representation_context # #################### dependent_instantiable_parametric_representation_context = Rule() #################### - # RULE security_classification_requires_person_organization # +# RULE security_classification_requires_person_organization # #################### security_classification_requires_person_organization = Rule() #################### - # RULE dependent_instantiable_shape_representation # +# RULE dependent_instantiable_shape_representation # #################### dependent_instantiable_shape_representation = Rule() #################### - # RULE restrict_action_request_status # +# RULE restrict_action_request_status # #################### restrict_action_request_status = Rule() #################### - # RULE restrict_certification_type # +# RULE restrict_certification_type # #################### restrict_certification_type = Rule() #################### - # RULE subtype_mandatory_action # +# RULE subtype_mandatory_action # #################### subtype_mandatory_action = Rule() #################### - # RULE product_requires_person_organization # +# RULE product_requires_person_organization # #################### product_requires_person_organization = Rule() #################### - # RULE product_version_requires_security_classification # +# RULE product_version_requires_security_classification # #################### product_version_requires_security_classification = Rule() #################### - # RULE document_to_product_definition # +# RULE document_to_product_definition # #################### document_to_product_definition = Rule() #################### - # RULE start_request_requires_date_time # +# RULE start_request_requires_date_time # #################### start_request_requires_date_time = Rule() #################### - # RULE dependent_instantiable_security_classification_level # +# RULE dependent_instantiable_security_classification_level # #################### dependent_instantiable_security_classification_level = Rule() #################### - # RULE global_unit_assignment # +# RULE global_unit_assignment # #################### global_unit_assignment = Rule() #################### - # RULE restrict_person_organization_role # +# RULE restrict_person_organization_role # #################### restrict_person_organization_role = Rule() #################### - # RULE coordinated_assembly_and_shape # +# RULE coordinated_assembly_and_shape # #################### coordinated_assembly_and_shape = Rule() #################### - # RULE start_request_requires_person_organization # +# RULE start_request_requires_person_organization # #################### start_request_requires_person_organization = Rule() #################### - # RULE no_shape_for_make_from # +# RULE no_shape_for_make_from # #################### no_shape_for_make_from = Rule() #################### - # RULE approval_date_time_constraints # +# RULE approval_date_time_constraints # #################### approval_date_time_constraints = Rule() #################### - # RULE security_classification_requires_approval # +# RULE security_classification_requires_approval # #################### security_classification_requires_approval = Rule() diff --git a/src/Mod/Import/App/dxf/ImpExpDxf.cpp b/src/Mod/Import/App/dxf/ImpExpDxf.cpp index 3366f173d1..7d02d0b088 100644 --- a/src/Mod/Import/App/dxf/ImpExpDxf.cpp +++ b/src/Mod/Import/App/dxf/ImpExpDxf.cpp @@ -23,33 +23,33 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include -# if OCC_VERSION_HEX < 0x070600 -# include -# endif -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include +#include +#if OCC_VERSION_HEX < 0x070600 +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif #include @@ -74,7 +74,8 @@ using BRepAdaptor_HCurve = BRepAdaptor_Curve; //****************************************************************************** // reading -ImpExpDxfRead::ImpExpDxfRead(std::string filepath, App::Document *pcDoc) : CDxfRead(filepath.c_str()) +ImpExpDxfRead::ImpExpDxfRead(std::string filepath, App::Document* pcDoc) + : CDxfRead(filepath.c_str()) { document = pcDoc; setOptionSource("User parameter:BaseApp/Preferences/Mod/Draft"); @@ -83,10 +84,11 @@ ImpExpDxfRead::ImpExpDxfRead(std::string filepath, App::Document *pcDoc) : CDxfR void ImpExpDxfRead::setOptions() { - ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(getOptionSource().c_str()); - optionGroupLayers = hGrp->GetBool("groupLayers",false); - optionImportAnnotations = hGrp->GetBool("dxftext",false); - optionScaling = hGrp->GetFloat("dxfScaling",1.0); + ParameterGrp::handle hGrp = + App::GetApplication().GetParameterGroupByPath(getOptionSource().c_str()); + optionGroupLayers = hGrp->GetBool("groupLayers", false); + optionImportAnnotations = hGrp->GetBool("dxftext", false); + optionScaling = hGrp->GetFloat("dxfScaling", 1.0); } gp_Pnt ImpExpDxfRead::makePoint(const double* p) @@ -99,15 +101,16 @@ gp_Pnt ImpExpDxfRead::makePoint(const double* p) sp2 = sp2 * optionScaling; sp3 = sp3 * optionScaling; } - return {sp1,sp2,sp3}; + return {sp1, sp2, sp3}; } void ImpExpDxfRead::OnReadLine(const double* s, const double* e, bool /*hidden*/) { gp_Pnt p0 = makePoint(s); gp_Pnt p1 = makePoint(e); - if (p0.IsEqual(p1,0.00000001)) + if (p0.IsEqual(p1, 0.00000001)) { return; + } BRepBuilderAPI_MakeEdge makeEdge(p0, p1); TopoDS_Edge edge = makeEdge.Edge(); AddObject(new Part::TopoShape(edge)); @@ -122,13 +125,18 @@ void ImpExpDxfRead::OnReadPoint(const double* s) } -void ImpExpDxfRead::OnReadArc(const double* s, const double* e, const double* c, bool dir, bool /*hidden*/) +void ImpExpDxfRead::OnReadArc(const double* s, + const double* e, + const double* c, + bool dir, + bool /*hidden*/) { gp_Pnt p0 = makePoint(s); gp_Pnt p1 = makePoint(e); gp_Dir up(0, 0, 1); - if (!dir) + if (!dir) { up = -up; + } gp_Pnt pc = makePoint(c); gp_Circ circle(gp_Ax2(pc, up), p0.Distance(pc)); if (circle.Radius() > 0) { @@ -146,8 +154,9 @@ void ImpExpDxfRead::OnReadCircle(const double* s, const double* c, bool dir, boo { gp_Pnt p0 = makePoint(s); gp_Dir up(0, 0, 1); - if (!dir) + if (!dir) { up = -up; + } gp_Pnt pc = makePoint(c); gp_Circ circle(gp_Ax2(pc, up), p0.Distance(pc)); if (circle.Radius() > 0) { @@ -164,8 +173,8 @@ void ImpExpDxfRead::OnReadCircle(const double* s, const double* c, bool dir, boo Handle(Geom_BSplineCurve) getSplineFromPolesAndKnots(struct SplineData& sd) { std::size_t numPoles = sd.control_points; - if (sd.controlx.size() > numPoles || sd.controly.size() > numPoles || - sd.controlz.size() > numPoles || sd.weight.size() > numPoles) { + if (sd.controlx.size() > numPoles || sd.controly.size() > numPoles + || sd.controlz.size() > numPoles || sd.weight.size() > numPoles) { return nullptr; } @@ -211,13 +220,14 @@ Handle(Geom_BSplineCurve) getSplineFromPolesAndKnots(struct SplineData& sd) } else { // non-rational - for (int i=occweights.Lower(); i<=occweights.Upper(); i++) { + for (int i = occweights.Lower(); i <= occweights.Upper(); i++) { occweights(i) = 1.0; } } Standard_Boolean periodic = sd.flag == 2; - Handle(Geom_BSplineCurve) geom = new Geom_BSplineCurve(occpoles, occweights, occknots, occmults, sd.degree, periodic); + Handle(Geom_BSplineCurve) geom = + new Geom_BSplineCurve(occpoles, occweights, occknots, occmults, sd.degree, periodic); return geom; } @@ -259,13 +269,16 @@ void ImpExpDxfRead::OnReadSpline(struct SplineData& sd) try { Handle(Geom_BSplineCurve) geom; - if (sd.control_points > 0) + if (sd.control_points > 0) { geom = getSplineFromPolesAndKnots(sd); - else if (sd.fit_points > 0) + } + else if (sd.fit_points > 0) { geom = getInterpolationSpline(sd); + } - if (geom.IsNull()) + if (geom.IsNull()) { throw Standard_Failure(); + } BRepBuilderAPI_MakeEdge makeEdge(geom); TopoDS_Edge edge = makeEdge.Edge(); @@ -277,14 +290,21 @@ void ImpExpDxfRead::OnReadSpline(struct SplineData& sd) } -void ImpExpDxfRead::OnReadEllipse(const double* c, double major_radius, double minor_radius, double rotation, double /*start_angle*/, double /*end_angle*/, bool dir) +void ImpExpDxfRead::OnReadEllipse(const double* c, + double major_radius, + double minor_radius, + double rotation, + double /*start_angle*/, + double /*end_angle*/, + bool dir) { gp_Dir up(0, 0, 1); - if(!dir) + if (!dir) { up = -up; + } gp_Pnt pc = makePoint(c); gp_Elips ellipse(gp_Ax2(pc, up), major_radius * optionScaling, minor_radius * optionScaling); - ellipse.Rotate(gp_Ax1(pc,up),rotation); + ellipse.Rotate(gp_Ax1(pc, up), rotation); if (ellipse.MinorRadius() > 0) { BRepBuilderAPI_MakeEdge makeEdge(ellipse); TopoDS_Edge edge = makeEdge.Edge(); @@ -296,48 +316,61 @@ void ImpExpDxfRead::OnReadEllipse(const double* c, double major_radius, double m } -void ImpExpDxfRead::OnReadText(const double *point, const double /*height*/, const char* text) +void ImpExpDxfRead::OnReadText(const double* point, const double /*height*/, const char* text) { if (optionImportAnnotations) { - Base::Vector3d pt(point[0] * optionScaling, point[1] * optionScaling, point[2] * optionScaling); - if(LayerName().substr(0, 6) != "BLOCKS") { - App::Annotation *pcFeature = static_cast(document->addObject("App::Annotation", "Text")); + Base::Vector3d pt(point[0] * optionScaling, + point[1] * optionScaling, + point[2] * optionScaling); + if (LayerName().substr(0, 6) != "BLOCKS") { + App::Annotation* pcFeature = + static_cast(document->addObject("App::Annotation", "Text")); pcFeature->LabelText.setValue(Deformat(text)); pcFeature->Position.setValue(pt); } - //else std::cout << "skipped text in block: " << LayerName() << std::endl; + // else std::cout << "skipped text in block: " << LayerName() << std::endl; } } -void ImpExpDxfRead::OnReadInsert(const double* point, const double* scale, const char* name, double rotation) +void ImpExpDxfRead::OnReadInsert(const double* point, + const double* scale, + const char* name, + double rotation) { - //std::cout << "Inserting block " << name << " rotation " << rotation << " pos " << point[0] << "," << point[1] << "," << point[2] << " scale " << scale[0] << "," << scale[1] << "," << scale[2] << std::endl; + // std::cout << "Inserting block " << name << " rotation " << rotation << " pos " << point[0] << + // "," << point[1] << "," << point[2] << " scale " << scale[0] << "," << scale[1] << "," << + // scale[2] << std::endl; std::string prefix = "BLOCKS "; prefix += name; prefix += " "; auto checkScale = [=](double v) { return v != 0.0 ? v : 1.0; }; - for(std::map > ::const_iterator i = layers.begin(); i != layers.end(); ++i) { + for (std::map>::const_iterator i = layers.begin(); + i != layers.end(); + ++i) { std::string k = i->first; - if(k.substr(0, prefix.size()) == prefix) { + if (k.substr(0, prefix.size()) == prefix) { BRep_Builder builder; TopoDS_Compound comp; builder.MakeCompound(comp); std::vector v = i->second; - for(std::vector::const_iterator j = v.begin(); j != v.end(); ++j) { + for (std::vector::const_iterator j = v.begin(); j != v.end(); ++j) { const TopoDS_Shape& sh = (*j)->getShape(); - if (!sh.IsNull()) + if (!sh.IsNull()) { builder.Add(comp, sh); + } } if (!comp.IsNull()) { Part::TopoShape* pcomp = new Part::TopoShape(comp); Base::Matrix4D mat; - mat.scale(checkScale(scale[0]),checkScale(scale[1]),checkScale(scale[2])); + mat.scale(checkScale(scale[0]), checkScale(scale[1]), checkScale(scale[2])); mat.rotZ(rotation); - mat.move(point[0]*optionScaling,point[1]*optionScaling,point[2]*optionScaling); - pcomp->transformShape(mat,true); + mat.move(point[0] * optionScaling, + point[1] * optionScaling, + point[2] * optionScaling); + pcomp->transformShape(mat, true); AddObject(pcomp); } } @@ -345,29 +378,43 @@ void ImpExpDxfRead::OnReadInsert(const double* point, const double* scale, const } -void ImpExpDxfRead::OnReadDimension(const double* s, const double* e, const double* point, double /*rotation*/) +void ImpExpDxfRead::OnReadDimension(const double* s, + const double* e, + const double* point, + double /*rotation*/) { if (optionImportAnnotations) { Base::Interpreter().runString("import Draft"); - Base::Interpreter().runStringArg("p1=FreeCAD.Vector(%f,%f,%f)",s[0]*optionScaling,s[1]*optionScaling,s[2]*optionScaling); - Base::Interpreter().runStringArg("p2=FreeCAD.Vector(%f,%f,%f)",e[0]*optionScaling,e[1]*optionScaling,e[2]*optionScaling); - Base::Interpreter().runStringArg("p3=FreeCAD.Vector(%f,%f,%f)",point[0]*optionScaling,point[1]*optionScaling,point[2]*optionScaling); + Base::Interpreter().runStringArg("p1=FreeCAD.Vector(%f,%f,%f)", + s[0] * optionScaling, + s[1] * optionScaling, + s[2] * optionScaling); + Base::Interpreter().runStringArg("p2=FreeCAD.Vector(%f,%f,%f)", + e[0] * optionScaling, + e[1] * optionScaling, + e[2] * optionScaling); + Base::Interpreter().runStringArg("p3=FreeCAD.Vector(%f,%f,%f)", + point[0] * optionScaling, + point[1] * optionScaling, + point[2] * optionScaling); Base::Interpreter().runString("Draft.makeDimension(p1,p2,p3)"); } } -void ImpExpDxfRead::AddObject(Part::TopoShape *shape) +void ImpExpDxfRead::AddObject(Part::TopoShape* shape) { - //std::cout << "layer:" << LayerName() << std::endl; - std::vector vec; - if (layers.count(LayerName())) + // std::cout << "layer:" << LayerName() << std::endl; + std::vector vec; + if (layers.count(LayerName())) { vec = layers[LayerName()]; + } vec.push_back(shape); layers[LayerName()] = vec; if (!optionGroupLayers) { - if(LayerName().substr(0, 6) != "BLOCKS") { - Part::Feature *pcFeature = static_cast(document->addObject("Part::Feature", "Shape")); + if (LayerName().substr(0, 6) != "BLOCKS") { + Part::Feature* pcFeature = + static_cast(document->addObject("Part::Feature", "Shape")); pcFeature->Shape.setValue(shape->getShape()); } } @@ -378,34 +425,35 @@ std::string ImpExpDxfRead::Deformat(const char* text) { // this function removes DXF formatting from texts std::stringstream ss; - bool escape = false; // turned on when finding an escape character - bool longescape = false; // turned on for certain escape codes that expect additional chars - for(unsigned int i = 0; i > ::const_iterator i = layers.begin(); i != layers.end(); ++i) { + for (std::map>::const_iterator i = + layers.begin(); + i != layers.end(); + ++i) { BRep_Builder builder; TopoDS_Compound comp; builder.MakeCompound(comp); std::string k = i->first; - if (k == "0") // FreeCAD doesn't like an object name being '0'... + if (k == "0") {// FreeCAD doesn't like an object name being '0'... k = "LAYER_0"; + } std::vector v = i->second; - if(k.substr(0, 6) != "BLOCKS") { - for(std::vector::const_iterator j = v.begin(); j != v.end(); ++j) { + if (k.substr(0, 6) != "BLOCKS") { + for (std::vector::const_iterator j = v.begin(); j != v.end(); + ++j) { const TopoDS_Shape& sh = (*j)->getShape(); - if (!sh.IsNull()) + if (!sh.IsNull()) { builder.Add(comp, sh); + } } if (!comp.IsNull()) { - Part::Feature *pcFeature = static_cast(document->addObject("Part::Feature", k.c_str())); + Part::Feature* pcFeature = static_cast( + document->addObject("Part::Feature", k.c_str())); pcFeature->Shape.setValue(comp); } } @@ -444,22 +499,22 @@ void ImpExpDxfRead::AddGraphics() const void gPntToTuple(double* result, gp_Pnt& p) { - result[0] = p.X(); - result[1] = p.Y(); - result[2] = p.Z(); + result[0] = p.X(); + result[1] = p.Y(); + result[2] = p.Z(); } point3D gPntTopoint3D(gp_Pnt& p) { - point3D result; - result.x = p.X(); - result.y = p.Y(); - result.z = p.Z(); - return result; + point3D result; + result.x = p.X(); + result.y = p.Y(); + result.z = p.Z(); + return result; } -ImpExpDxfWrite::ImpExpDxfWrite(std::string filepath) : - CDxfWrite(filepath.c_str()) +ImpExpDxfWrite::ImpExpDxfWrite(std::string filepath) + : CDxfWrite(filepath.c_str()) { setOptionSource("User parameter:BaseApp/Preferences/Mod/Import"); setOptions(); @@ -469,20 +524,21 @@ ImpExpDxfWrite::~ImpExpDxfWrite() = default; void ImpExpDxfWrite::setOptions() { - ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(getOptionSource().c_str()); - optionMaxLength = hGrp->GetFloat("maxsegmentlength",5.0); - optionExpPoints = hGrp->GetBool("ExportPoints",false); - m_version = hGrp->GetInt("DxfVersionOut",14); - optionPolyLine = hGrp->GetBool("DiscretizeEllipses",false); - m_polyOverride = hGrp->GetBool("DiscretizeEllipses",false); + ParameterGrp::handle hGrp = + App::GetApplication().GetParameterGroupByPath(getOptionSource().c_str()); + optionMaxLength = hGrp->GetFloat("maxsegmentlength", 5.0); + optionExpPoints = hGrp->GetBool("ExportPoints", false); + m_version = hGrp->GetInt("DxfVersionOut", 14); + optionPolyLine = hGrp->GetBool("DiscretizeEllipses", false); + m_polyOverride = hGrp->GetBool("DiscretizeEllipses", false); setDataDir(App::Application::getResourceDir() + "Mod/Import/DxfPlate/"); } void ImpExpDxfWrite::exportShape(const TopoDS_Shape input) { - //export Edges + // export Edges TopExp_Explorer edges(input, TopAbs_EDGE); - for (int i = 1 ; edges.More(); edges.Next(),i++) { + for (int i = 1; edges.More(); edges.Next(), i++) { const TopoDS_Edge& edge = TopoDS::Edge(edges.Current()); BRepAdaptor_Curve adapt(edge); if (adapt.GetType() == GeomAbs_Circle) { @@ -490,100 +546,124 @@ void ImpExpDxfWrite::exportShape(const TopoDS_Shape input) double l = adapt.LastParameter(); gp_Pnt s = adapt.Value(f); gp_Pnt e = adapt.Value(l); - if (fabs(l-f) > 1.0 && s.SquareDistance(e) < 0.001) { + if (fabs(l - f) > 1.0 && s.SquareDistance(e) < 0.001) { exportCircle(adapt); - } else { + } + else { exportArc(adapt); } - } else if (adapt.GetType() == GeomAbs_Ellipse) { + } + else if (adapt.GetType() == GeomAbs_Ellipse) { double f = adapt.FirstParameter(); double l = adapt.LastParameter(); gp_Pnt s = adapt.Value(f); gp_Pnt e = adapt.Value(l); - if (fabs(l-f) > 1.0 && s.SquareDistance(e) < 0.001) { + if (fabs(l - f) > 1.0 && s.SquareDistance(e) < 0.001) { if (m_polyOverride) { if (m_version >= 14) { exportLWPoly(adapt); - } else { //m_version < 14 - exportPolyline(adapt); } - } else if (optionPolyLine) { - if (m_version >= 14) { - exportLWPoly(adapt); - } else { //m_version < 14 + else {// m_version < 14 exportPolyline(adapt); } - } else { //no overrides, do what's right! - if (m_version < 14) { - exportPolyline(adapt); - } else { - exportEllipse(adapt); - } } - } else { // it's an arc + else if (optionPolyLine) { + if (m_version >= 14) { + exportLWPoly(adapt); + } + else {// m_version < 14 + exportPolyline(adapt); + } + } + else {// no overrides, do what's right! + if (m_version < 14) { + exportPolyline(adapt); + } + else { + exportEllipse(adapt); + } + } + } + else {// it's an arc if (m_polyOverride) { if (m_version >= 14) { exportLWPoly(adapt); - } else { //m_version < 14 + } + else {// m_version < 14 exportPolyline(adapt); } - } else if (optionPolyLine) { + } + else if (optionPolyLine) { if (m_version >= 14) { exportLWPoly(adapt); - } else { //m_version < 14 + } + else {// m_version < 14 exportPolyline(adapt); } - } else { //no overrides, do what's right! + } + else {// no overrides, do what's right! if (m_version < 14) { exportPolyline(adapt); - } else { + } + else { exportEllipseArc(adapt); } } } - } else if (adapt.GetType() == GeomAbs_BSplineCurve) { - if (m_polyOverride) { - if (m_version >= 14) { - exportLWPoly(adapt); - } else { //m_version < 14 - exportPolyline(adapt); - } - } else if (optionPolyLine) { - if (m_version >= 14) { - exportLWPoly(adapt); - } else { //m_version < 14 - exportPolyline(adapt); - } - } else { //no overrides, do what's right! - if (m_version < 14) { - exportPolyline(adapt); - } else { - exportBSpline(adapt); - } + } + else if (adapt.GetType() == GeomAbs_BSplineCurve) { + if (m_polyOverride) { + if (m_version >= 14) { + exportLWPoly(adapt); } - } else if (adapt.GetType() == GeomAbs_BezierCurve) { + else {// m_version < 14 + exportPolyline(adapt); + } + } + else if (optionPolyLine) { + if (m_version >= 14) { + exportLWPoly(adapt); + } + else {// m_version < 14 + exportPolyline(adapt); + } + } + else {// no overrides, do what's right! + if (m_version < 14) { + exportPolyline(adapt); + } + else { + exportBSpline(adapt); + } + } + } + else if (adapt.GetType() == GeomAbs_BezierCurve) { exportBCurve(adapt); - } else if (adapt.GetType() == GeomAbs_Line) { + } + else if (adapt.GetType() == GeomAbs_Line) { exportLine(adapt); - } else { - Base::Console().Warning("ImpExpDxf - unknown curve type: %d\n", static_cast(adapt.GetType())); + } + else { + Base::Console().Warning("ImpExpDxf - unknown curve type: %d\n", + static_cast(adapt.GetType())); } } if (optionExpPoints) { TopExp_Explorer verts(input, TopAbs_VERTEX); std::vector duplicates; - for (int i = 1 ; verts.More(); verts.Next(),i++) { + for (int i = 1; verts.More(); verts.Next(), i++) { const TopoDS_Vertex& v = TopoDS::Vertex(verts.Current()); gp_Pnt p = BRep_Tool::Pnt(v); duplicates.push_back(p); } - std::sort(duplicates.begin(),duplicates.end(),ImpExpDxfWrite::gp_PntCompare); - auto newEnd = std::unique(duplicates.begin(),duplicates.end(),ImpExpDxfWrite::gp_PntEqual); - std::vector uniquePts(duplicates.begin(),newEnd); + std::sort(duplicates.begin(), duplicates.end(), ImpExpDxfWrite::gp_PntCompare); + auto newEnd = + std::unique(duplicates.begin(), duplicates.end(), ImpExpDxfWrite::gp_PntEqual); + std::vector uniquePts(duplicates.begin(), newEnd); for (auto& p : uniquePts) { - double point[3] = {0,0,0}; + double point[3] = {0, 0, 0}; gPntToTuple(point, p); writePoint(point); } @@ -593,22 +673,24 @@ void ImpExpDxfWrite::exportShape(const TopoDS_Shape input) bool ImpExpDxfWrite::gp_PntEqual(gp_Pnt p1, gp_Pnt p2) { bool result = false; - if (p1.IsEqual(p2,Precision::Confusion())) { + if (p1.IsEqual(p2, Precision::Confusion())) { result = true; } return result; } -//is p1 "less than" p2? +// is p1 "less than" p2? bool ImpExpDxfWrite::gp_PntCompare(gp_Pnt p1, gp_Pnt p2) { bool result = false; - if (!(p1.IsEqual(p2,Precision::Confusion()))) { //ie v1 != v2 - if (!(fabs(p1.X() - p2.X()) < Precision::Confusion())) { // x1 != x2 + if (!(p1.IsEqual(p2, Precision::Confusion()))) { // ie v1 != v2 + if (!(fabs(p1.X() - p2.X()) < Precision::Confusion())) {// x1 != x2 result = p1.X() < p2.X(); - } else if (!(fabs(p1.Y() - p2.Y()) < Precision::Confusion())) { // y1 != y2 + } + else if (!(fabs(p1.Y() - p2.Y()) < Precision::Confusion())) {// y1 != y2 result = p1.Y() < p2.Y(); - } else { + } + else { result = p1.Z() < p2.Z(); } } @@ -620,10 +702,10 @@ void ImpExpDxfWrite::exportCircle(BRepAdaptor_Curve& c) { gp_Circ circ = c.Circle(); gp_Pnt p = circ.Location(); - double center[3] = {0,0,0}; + double center[3] = {0, 0, 0}; gPntToTuple(center, p); - double radius = circ.Radius(); + double radius = circ.Radius(); writeCircle(center, radius); } @@ -632,26 +714,26 @@ void ImpExpDxfWrite::exportEllipse(BRepAdaptor_Curve& c) { gp_Elips ellp = c.Ellipse(); gp_Pnt p = ellp.Location(); - double center[3] = {0,0,0}; + double center[3] = {0, 0, 0}; gPntToTuple(center, p); double major = ellp.MajorRadius(); double minor = ellp.MinorRadius(); - gp_Dir xaxis = ellp.XAxis().Direction(); //direction of major axis - //rotation appears to be the clockwise(?) angle between major & +Y?? + gp_Dir xaxis = ellp.XAxis().Direction();// direction of major axis + // rotation appears to be the clockwise(?) angle between major & +Y?? double rotation = xaxis.AngleWithRef(gp_Dir(0, 1, 0), gp_Dir(0, 0, 1)); - //2*M_PI = 6.28319 is invalid(doesn't display in LibreCAD), but 2PI = 6.28318 is valid! - //writeEllipse(center, major, minor, rotation, 0.0, 2 * M_PI, true ); - writeEllipse(center, major, minor, rotation, 0.0, 6.28318, true ); + // 2*M_PI = 6.28319 is invalid(doesn't display in LibreCAD), but 2PI = 6.28318 is valid! + // writeEllipse(center, major, minor, rotation, 0.0, 2 * M_PI, true ); + writeEllipse(center, major, minor, rotation, 0.0, 6.28318, true); } void ImpExpDxfWrite::exportArc(BRepAdaptor_Curve& c) { gp_Circ circ = c.Circle(); gp_Pnt p = circ.Location(); - double center[3] = {0,0,0}; + double center[3] = {0, 0, 0}; gPntToTuple(center, p); double f = c.FirstParameter(); @@ -659,55 +741,55 @@ void ImpExpDxfWrite::exportArc(BRepAdaptor_Curve& c) gp_Pnt s = c.Value(f); double start[3]; gPntToTuple(start, s); - gp_Pnt m = c.Value((l+f)/2.0); + gp_Pnt m = c.Value((l + f) / 2.0); gp_Pnt e = c.Value(l); - double end[3] = {0,0,0}; + double end[3] = {0, 0, 0}; gPntToTuple(end, e); - gp_Vec v1(m,s); - gp_Vec v2(m,e); - gp_Vec v3(0,0,1); - double a = v3.DotCross(v1,v2); + gp_Vec v1(m, s); + gp_Vec v2(m, e); + gp_Vec v3(0, 0, 1); + double a = v3.DotCross(v1, v2); - bool dir = (a < 0) ? true: false; - writeArc(start, end, center, dir ); + bool dir = (a < 0) ? true : false; + writeArc(start, end, center, dir); } void ImpExpDxfWrite::exportEllipseArc(BRepAdaptor_Curve& c) { gp_Elips ellp = c.Ellipse(); gp_Pnt p = ellp.Location(); - double center[3] = {0,0,0}; + double center[3] = {0, 0, 0}; gPntToTuple(center, p); double major = ellp.MajorRadius(); double minor = ellp.MinorRadius(); - gp_Dir xaxis = ellp.XAxis().Direction(); //direction of major axis - //rotation appears to be the clockwise angle between major & +Y?? + gp_Dir xaxis = ellp.XAxis().Direction();// direction of major axis + // rotation appears to be the clockwise angle between major & +Y?? double rotation = xaxis.AngleWithRef(gp_Dir(0, 1, 0), gp_Dir(0, 0, 1)); double f = c.FirstParameter(); double l = c.LastParameter(); gp_Pnt s = c.Value(f); - gp_Pnt m = c.Value((l+f)/2.0); + gp_Pnt m = c.Value((l + f) / 2.0); gp_Pnt e = c.Value(l); - gp_Vec v1(m,s); - gp_Vec v2(m,e); - gp_Vec v3(0,0,1); - double a = v3.DotCross(v1,v2); // a = v3 dot (v1 cross v2) - // relates to "handedness" of 3 vectors - // a > 0 ==> v2 is CCW from v1 (righthanded)? - // a < 0 ==> v2 is CW from v1 (lefthanded)? + gp_Vec v1(m, s); + gp_Vec v2(m, e); + gp_Vec v3(0, 0, 1); + double a = v3.DotCross(v1, v2);// a = v3 dot (v1 cross v2) + // relates to "handedness" of 3 vectors + // a > 0 ==> v2 is CCW from v1 (righthanded)? + // a < 0 ==> v2 is CW from v1 (lefthanded)? - double startAngle = fmod(f,2.0*M_PI); //revolutions - double endAngle = fmod(l,2.0*M_PI); - bool endIsCW = (a < 0) ? true: false; //if !endIsCW swap(start,end) - //not sure if this is a hack or not. seems to make valid arcs. + double startAngle = fmod(f, 2.0 * M_PI);// revolutions + double endAngle = fmod(l, 2.0 * M_PI); + bool endIsCW = (a < 0) ? true : false;// if !endIsCW swap(start,end) + // not sure if this is a hack or not. seems to make valid arcs. if (!endIsCW) { startAngle = -startAngle; - endAngle = -endAngle; + endAngle = -endAngle; } writeEllipse(center, major, minor, rotation, startAngle, endAngle, endIsCW); @@ -717,8 +799,8 @@ void ImpExpDxfWrite::exportBSpline(BRepAdaptor_Curve& c) { SplineDataOut sd; Handle(Geom_BSplineCurve) spline; - double f,l; - gp_Pnt s,ePt; + double f, l; + gp_Pnt s, ePt; Standard_Real tol3D = 0.001; Standard_Integer maxDegree = 3, maxSegment = 200; @@ -726,71 +808,79 @@ void ImpExpDxfWrite::exportBSpline(BRepAdaptor_Curve& c) Approx_Curve3d approx(hCurve, tol3D, GeomAbs_C0, maxSegment, maxDegree); if (approx.IsDone() && approx.HasResult()) { spline = approx.Curve(); - } else { - if (approx.HasResult()) { //result, but not within tolerance + } + else { + if (approx.HasResult()) {// result, but not within tolerance spline = approx.Curve(); Base::Console().Message("DxfWrite::exportBSpline - result not within tolerance\n"); - } else { + } + else { f = c.FirstParameter(); l = c.LastParameter(); s = c.Value(f); ePt = c.Value(l); - Base::Console().Message("DxfWrite::exportBSpline - no result- from:(%.3f,%.3f) to:(%.3f,%.3f) poles: %d\n", - s.X(),s.Y(),ePt.X(),ePt.Y(),spline->NbPoles()); - TColgp_Array1OfPnt controlPoints(0,1); - controlPoints.SetValue(0,s); - controlPoints.SetValue(1,ePt); - spline = GeomAPI_PointsToBSpline(controlPoints,1).Curve(); + Base::Console().Message( + "DxfWrite::exportBSpline - no result- from:(%.3f,%.3f) to:(%.3f,%.3f) poles: %d\n", + s.X(), + s.Y(), + ePt.X(), + ePt.Y(), + spline->NbPoles()); + TColgp_Array1OfPnt controlPoints(0, 1); + controlPoints.SetValue(0, s); + controlPoints.SetValue(1, ePt); + spline = GeomAPI_PointsToBSpline(controlPoints, 1).Curve(); } } - //WF? norm of surface containing curve?? + // WF? norm of surface containing curve?? sd.norm.x = 0.0; sd.norm.y = 0.0; sd.norm.z = 1.0; sd.flag = spline->IsClosed(); - sd.flag += spline->IsPeriodic()*2; - sd.flag += spline->IsRational()*4; - sd.flag += 8; //planar spline + sd.flag += spline->IsPeriodic() * 2; + sd.flag += spline->IsRational() * 4; + sd.flag += 8;// planar spline sd.degree = spline->Degree(); sd.control_points = spline->NbPoles(); - sd.knots = spline->NbKnots(); + sd.knots = spline->NbKnots(); gp_Pnt p; - spline->D0(spline->FirstParameter(),p); + spline->D0(spline->FirstParameter(), p); sd.starttan = gPntTopoint3D(p); - spline->D0(spline->LastParameter(),p); + spline->D0(spline->LastParameter(), p); sd.endtan = gPntTopoint3D(p); - //next bit is from DrawingExport.cpp (Dan Falk?). + // next bit is from DrawingExport.cpp (Dan Falk?). Standard_Integer m = 0; if (spline->IsPeriodic()) { - m = spline->NbPoles() + 2*spline->Degree() - spline->Multiplicity(1) + 2; + m = spline->NbPoles() + 2 * spline->Degree() - spline->Multiplicity(1) + 2; } else { - for (int i=1; i<= spline->NbKnots(); i++) + for (int i = 1; i <= spline->NbKnots(); i++) { m += spline->Multiplicity(i); + } } - TColStd_Array1OfReal knotsequence(1,m); + TColStd_Array1OfReal knotsequence(1, m); spline->KnotSequence(knotsequence); - for (int i = knotsequence.Lower() ; i <= knotsequence.Upper(); i++) { - sd.knot.push_back(knotsequence(i)); + for (int i = knotsequence.Lower(); i <= knotsequence.Upper(); i++) { + sd.knot.push_back(knotsequence(i)); } sd.knots = knotsequence.Length(); - TColgp_Array1OfPnt poles(1,spline->NbPoles()); + TColgp_Array1OfPnt poles(1, spline->NbPoles()); spline->Poles(poles); for (int i = poles.Lower(); i <= poles.Upper(); i++) { sd.control.push_back(gPntTopoint3D(poles(i))); } - //OCC doesn't have separate lists for control points and fit points. + // OCC doesn't have separate lists for control points and fit points. writeSpline(sd); } void ImpExpDxfWrite::exportBCurve(BRepAdaptor_Curve& c) { - (void) c; + (void)c; Base::Console().Message("BCurve dxf export not yet supported\n"); } @@ -799,10 +889,10 @@ void ImpExpDxfWrite::exportLine(BRepAdaptor_Curve& c) double f = c.FirstParameter(); double l = c.LastParameter(); gp_Pnt s = c.Value(f); - double start[3] = {0,0,0}; + double start[3] = {0, 0, 0}; gPntToTuple(start, s); gp_Pnt e = c.Value(l); - double end[3] = {0,0,0}; + double end[3] = {0, 0, 0}; gPntToTuple(end, e); writeLine(start, end); } @@ -819,15 +909,15 @@ void ImpExpDxfWrite::exportLWPoly(BRepAdaptor_Curve& c) pd.nVert = 0; GCPnts_UniformAbscissa discretizer; - discretizer.Initialize (c, optionMaxLength); + discretizer.Initialize(c, optionMaxLength); std::vector points; - if (discretizer.IsDone () && discretizer.NbPoints () > 0) { - int nbPoints = discretizer.NbPoints (); - for (int i=1; i<=nbPoints; i++) { - gp_Pnt p = c.Value (discretizer.Parameter (i)); + if (discretizer.IsDone() && discretizer.NbPoints() > 0) { + int nbPoints = discretizer.NbPoints(); + for (int i = 1; i <= nbPoints; i++) { + gp_Pnt p = c.Value(discretizer.Parameter(i)); pd.Verts.push_back(gPntTopoint3D(p)); } - pd.nVert = discretizer.NbPoints (); + pd.nVert = discretizer.NbPoints(); writeLWPolyLine(pd); } } @@ -844,26 +934,30 @@ void ImpExpDxfWrite::exportPolyline(BRepAdaptor_Curve& c) pd.nVert = 0; GCPnts_UniformAbscissa discretizer; - discretizer.Initialize (c, optionMaxLength); + discretizer.Initialize(c, optionMaxLength); std::vector points; - if (discretizer.IsDone () && discretizer.NbPoints () > 0) { - int nbPoints = discretizer.NbPoints (); - for (int i=1; i<=nbPoints; i++) { - gp_Pnt p = c.Value (discretizer.Parameter (i)); + if (discretizer.IsDone() && discretizer.NbPoints() > 0) { + int nbPoints = discretizer.NbPoints(); + for (int i = 1; i <= nbPoints; i++) { + gp_Pnt p = c.Value(discretizer.Parameter(i)); pd.Verts.push_back(gPntTopoint3D(p)); } - pd.nVert = discretizer.NbPoints (); + pd.nVert = discretizer.NbPoints(); writePolyline(pd); } } -void ImpExpDxfWrite::exportText(const char* text, Base::Vector3d position1, Base::Vector3d position2, double size, int just) +void ImpExpDxfWrite::exportText(const char* text, + Base::Vector3d position1, + Base::Vector3d position2, + double size, + int just) { - double location1[3] = {0,0,0}; + double location1[3] = {0, 0, 0}; location1[0] = position1.x; location1[1] = position1.y; location1[2] = position1.z; - double location2[3] = {0,0,0}; + double location2[3] = {0, 0, 0}; location2[0] = position2.x; location2[1] = position2.y; location2[2] = position2.z; @@ -871,90 +965,96 @@ void ImpExpDxfWrite::exportText(const char* text, Base::Vector3d position1, Base writeText(text, location1, location2, size, just); } -void ImpExpDxfWrite::exportLinearDim(Base::Vector3d textLocn, Base::Vector3d lineLocn, - Base::Vector3d extLine1Start, Base::Vector3d extLine2Start, - char* dimText, int type) +void ImpExpDxfWrite::exportLinearDim(Base::Vector3d textLocn, + Base::Vector3d lineLocn, + Base::Vector3d extLine1Start, + Base::Vector3d extLine2Start, + char* dimText, + int type) { - double text[3] = {0,0,0}; + double text[3] = {0, 0, 0}; text[0] = textLocn.x; text[1] = textLocn.y; text[2] = textLocn.z; - double line[3] = {0,0,0}; + double line[3] = {0, 0, 0}; line[0] = lineLocn.x; line[1] = lineLocn.y; line[2] = lineLocn.z; - double ext1[3] = {0,0,0}; + double ext1[3] = {0, 0, 0}; ext1[0] = extLine1Start.x; ext1[1] = extLine1Start.y; ext1[2] = extLine1Start.z; - double ext2[3] = {0,0,0}; + double ext2[3] = {0, 0, 0}; ext2[0] = extLine2Start.x; ext2[1] = extLine2Start.y; ext2[2] = extLine2Start.z; - writeLinearDim(text, line, ext1,ext2,dimText, type); + writeLinearDim(text, line, ext1, ext2, dimText, type); } -void ImpExpDxfWrite::exportAngularDim(Base::Vector3d textLocn, Base::Vector3d lineLocn, - Base::Vector3d extLine1End, Base::Vector3d extLine2End, - Base::Vector3d apexPoint, - char* dimText) +void ImpExpDxfWrite::exportAngularDim(Base::Vector3d textLocn, + Base::Vector3d lineLocn, + Base::Vector3d extLine1End, + Base::Vector3d extLine2End, + Base::Vector3d apexPoint, + char* dimText) { - double text[3] = {0,0,0}; + double text[3] = {0, 0, 0}; text[0] = textLocn.x; text[1] = textLocn.y; text[2] = textLocn.z; - double line[3] = {0,0,0}; + double line[3] = {0, 0, 0}; line[0] = lineLocn.x; line[1] = lineLocn.y; line[2] = lineLocn.z; - double ext1[3] = {0,0,0}; + double ext1[3] = {0, 0, 0}; ext1[0] = extLine1End.x; ext1[1] = extLine1End.y; ext1[2] = extLine1End.z; - double ext2[3] = {0,0,0}; + double ext2[3] = {0, 0, 0}; ext2[0] = extLine2End.x; ext2[1] = extLine2End.y; ext2[2] = extLine2End.z; - double apex[3] = {0,0,0}; + double apex[3] = {0, 0, 0}; apex[0] = apexPoint.x; apex[1] = apexPoint.y; apex[2] = apexPoint.z; writeAngularDim(text, line, apex, ext1, apex, ext2, dimText); } -void ImpExpDxfWrite::exportRadialDim(Base::Vector3d centerPoint, Base::Vector3d textLocn, - Base::Vector3d arcPoint, - char* dimText) +void ImpExpDxfWrite::exportRadialDim(Base::Vector3d centerPoint, + Base::Vector3d textLocn, + Base::Vector3d arcPoint, + char* dimText) { - double center[3] = {0,0,0}; + double center[3] = {0, 0, 0}; center[0] = centerPoint.x; center[1] = centerPoint.y; center[2] = centerPoint.z; - double text[3] = {0,0,0}; + double text[3] = {0, 0, 0}; text[0] = textLocn.x; text[1] = textLocn.y; text[2] = textLocn.z; - double arc[3] = {0,0,0}; + double arc[3] = {0, 0, 0}; arc[0] = arcPoint.x; arc[1] = arcPoint.y; arc[2] = arcPoint.z; writeRadialDim(center, text, arc, dimText); - } void ImpExpDxfWrite::exportDiametricDim(Base::Vector3d textLocn, - Base::Vector3d arcPoint1, Base::Vector3d arcPoint2, - char* dimText) + Base::Vector3d arcPoint1, + Base::Vector3d arcPoint2, + char* dimText) { - double text[3] = {0,0,0}; + double text[3] = {0, 0, 0}; text[0] = textLocn.x; text[1] = textLocn.y; text[2] = textLocn.z; - double arc1[3] = {0,0,0}; + double arc1[3] = {0, 0, 0}; arc1[0] = arcPoint1.x; arc1[1] = arcPoint1.y; arc1[2] = arcPoint1.z; - double arc2[3] = {0,0,0}; + double arc2[3] = {0, 0, 0}; arc2[0] = arcPoint2.x; arc2[1] = arcPoint2.y; arc2[2] = arcPoint2.z; diff --git a/src/Mod/Import/App/dxf/ImpExpDxf.h b/src/Mod/Import/App/dxf/ImpExpDxf.h index 17e5f42705..8f248d3e92 100644 --- a/src/Mod/Import/App/dxf/ImpExpDxf.h +++ b/src/Mod/Import/App/dxf/ImpExpDxf.h @@ -35,90 +35,126 @@ class BRepAdaptor_Curve; namespace Import { - class ImportExport ImpExpDxfRead : public CDxfRead +class ImportExport ImpExpDxfRead: public CDxfRead +{ +public: + ImpExpDxfRead(std::string filepath, App::Document* pcDoc); + + // CDxfRead's virtual functions + void OnReadLine(const double* s, const double* e, bool hidden) override; + void OnReadPoint(const double* s) override; + void OnReadText(const double* point, const double height, const char* text) override; + void + OnReadArc(const double* s, const double* e, const double* c, bool dir, bool hidden) override; + void OnReadCircle(const double* s, const double* c, bool dir, bool hidden) override; + void OnReadEllipse(const double* c, + double major_radius, + double minor_radius, + double rotation, + double start_angle, + double end_angle, + bool dir) override; + void OnReadSpline(struct SplineData& sd) override; + void OnReadInsert(const double* point, + const double* scale, + const char* name, + double rotation) override; + void OnReadDimension(const double* s, + const double* e, + const double* point, + double rotation) override; + void AddGraphics() const override; + + // FreeCAD-specific functions + void AddObject(Part::TopoShape* shape);// Called by OnRead functions to add Part objects + std::string Deformat(const char* text);// Removes DXF formatting from texts + + std::string getOptionSource() { - public: - ImpExpDxfRead(std::string filepath, App::Document *pcDoc); - - // CDxfRead's virtual functions - void OnReadLine(const double* s, const double* e, bool hidden) override; - void OnReadPoint(const double* s) override; - void OnReadText(const double* point, const double height, const char* text) override; - void OnReadArc(const double* s, const double* e, const double* c, bool dir, bool hidden) override; - void OnReadCircle(const double* s, const double* c, bool dir, bool hidden) override; - void OnReadEllipse(const double* c, double major_radius, double minor_radius, double rotation, double start_angle, double end_angle, bool dir) override; - void OnReadSpline(struct SplineData& sd) override; - void OnReadInsert(const double* point, const double* scale, const char* name, double rotation) override; - void OnReadDimension(const double* s, const double* e, const double* point, double rotation) override; - void AddGraphics() const override; - - // FreeCAD-specific functions - void AddObject(Part::TopoShape *shape); //Called by OnRead functions to add Part objects - std::string Deformat(const char* text); // Removes DXF formatting from texts - - std::string getOptionSource() { return m_optionSource; } - void setOptionSource(std::string s) { m_optionSource = s; } - void setOptions(); - - private: - gp_Pnt makePoint(const double* p); - - protected: - App::Document *document; - bool optionGroupLayers; - bool optionImportAnnotations; - double optionScaling; - std::map > layers; - std::string m_optionSource; - }; - - class ImportExport ImpExpDxfWrite : public CDxfWrite + return m_optionSource; + } + void setOptionSource(std::string s) { - public: - explicit ImpExpDxfWrite(std::string filepath); - ~ImpExpDxfWrite(); + m_optionSource = s; + } + void setOptions(); - void exportShape(const TopoDS_Shape input); - std::string getOptionSource() { return m_optionSource; } - void setOptionSource(std::string s) { m_optionSource = s; } - void setOptions(); +private: + gp_Pnt makePoint(const double* p); - void exportText(const char* text, Base::Vector3d position1, Base::Vector3d position2, double size, int just); - void exportLinearDim(Base::Vector3d textLocn, Base::Vector3d lineLocn, - Base::Vector3d extLine1Start, Base::Vector3d extLine2Start, - char* dimText, int type); - void exportAngularDim(Base::Vector3d textLocn, Base::Vector3d lineLocn, - Base::Vector3d extLine1Start, Base::Vector3d extLine2Start, - Base::Vector3d apexPoint, - char* dimText); - void exportRadialDim(Base::Vector3d centerPoint, Base::Vector3d textLocn, - Base::Vector3d arcPoint, - char* dimText); - void exportDiametricDim(Base::Vector3d textLocn, - Base::Vector3d arcPoint1, Base::Vector3d arcPoint2, - char* dimText); +protected: + App::Document* document; + bool optionGroupLayers; + bool optionImportAnnotations; + double optionScaling; + std::map> layers; + std::string m_optionSource; +}; + +class ImportExport ImpExpDxfWrite: public CDxfWrite +{ +public: + explicit ImpExpDxfWrite(std::string filepath); + ~ImpExpDxfWrite(); + + void exportShape(const TopoDS_Shape input); + std::string getOptionSource() + { + return m_optionSource; + } + void setOptionSource(std::string s) + { + m_optionSource = s; + } + void setOptions(); + + void exportText(const char* text, + Base::Vector3d position1, + Base::Vector3d position2, + double size, + int just); + void exportLinearDim(Base::Vector3d textLocn, + Base::Vector3d lineLocn, + Base::Vector3d extLine1Start, + Base::Vector3d extLine2Start, + char* dimText, + int type); + void exportAngularDim(Base::Vector3d textLocn, + Base::Vector3d lineLocn, + Base::Vector3d extLine1Start, + Base::Vector3d extLine2Start, + Base::Vector3d apexPoint, + char* dimText); + void exportRadialDim(Base::Vector3d centerPoint, + Base::Vector3d textLocn, + Base::Vector3d arcPoint, + char* dimText); + void exportDiametricDim(Base::Vector3d textLocn, + Base::Vector3d arcPoint1, + Base::Vector3d arcPoint2, + char* dimText); - static bool gp_PntEqual(gp_Pnt p1, gp_Pnt p2); - static bool gp_PntCompare(gp_Pnt p1, gp_Pnt p2); + static bool gp_PntEqual(gp_Pnt p1, gp_Pnt p2); + static bool gp_PntCompare(gp_Pnt p1, gp_Pnt p2); - protected: - void exportCircle(BRepAdaptor_Curve& c); - void exportEllipse(BRepAdaptor_Curve& c); - void exportArc(BRepAdaptor_Curve& c); - void exportEllipseArc(BRepAdaptor_Curve& c); - void exportBSpline(BRepAdaptor_Curve& c); - void exportBCurve(BRepAdaptor_Curve& c); - void exportLine(BRepAdaptor_Curve& c); - void exportLWPoly(BRepAdaptor_Curve& c); //LWPolyline not supported in R12? - void exportPolyline(BRepAdaptor_Curve& c); +protected: + void exportCircle(BRepAdaptor_Curve& c); + void exportEllipse(BRepAdaptor_Curve& c); + void exportArc(BRepAdaptor_Curve& c); + void exportEllipseArc(BRepAdaptor_Curve& c); + void exportBSpline(BRepAdaptor_Curve& c); + void exportBCurve(BRepAdaptor_Curve& c); + void exportLine(BRepAdaptor_Curve& c); + void exportLWPoly(BRepAdaptor_Curve& c);// LWPolyline not supported in R12? + void exportPolyline(BRepAdaptor_Curve& c); -// std::string m_optionSource; - double optionMaxLength; - bool optionPolyLine; - bool optionExpPoints; - }; + // std::string m_optionSource; + double optionMaxLength; + bool optionPolyLine; + bool optionExpPoints; +}; -} +}// namespace Import -#endif // IMPEXPDXF_H +#endif// IMPEXPDXF_H diff --git a/src/Mod/Import/App/dxf/dxf.cpp b/src/Mod/Import/App/dxf/dxf.cpp index e25c40c1ab..d8e6d10ff4 100644 --- a/src/Mod/Import/App/dxf/dxf.cpp +++ b/src/Mod/Import/App/dxf/dxf.cpp @@ -5,7 +5,7 @@ #include "PreCompiled.h" -//required by windows for M_PI definition +// required by windows for M_PI definition #define _USE_MATH_DEFINES #include #include @@ -13,13 +13,13 @@ #include #include +#include "dxf.h" #include #include #include +#include #include #include -#include -#include "dxf.h" using namespace std; @@ -33,32 +33,33 @@ Base::Vector3d toVector3d(const double* a) return result; } -CDxfWrite::CDxfWrite(const char* filepath) : -//TODO: these should probably be parameters in config file -//handles: -//boilerplate 0 - A00 -//used by dxf.cpp A01 - FFFE -//ACAD HANDSEED FFFF +CDxfWrite::CDxfWrite(const char* filepath) + :// TODO: these should probably be parameters in config file + // handles: + // boilerplate 0 - A00 + // used by dxf.cpp A01 - FFFE + // ACAD HANDSEED FFFF -m_handle(0xA00), //room for 2560 handles in boilerplate files -//m_entityHandle(0x300), //don't need special ranges for handles -//m_layerHandle(0x30), -//m_blockHandle(0x210), -//m_blkRecordHandle(0x110), -m_polyOverride(false), -m_layerName("none") + m_handle(0xA00) + ,// room for 2560 handles in boilerplate files + // m_entityHandle(0x300), //don't need special ranges for handles + // m_layerHandle(0x30), + // m_blockHandle(0x210), + // m_blkRecordHandle(0x110), + m_polyOverride(false) + , m_layerName("none") { // start the file m_fail = false; m_version = 12; Base::FileInfo fi(filepath); m_ofs = new Base::ofstream(fi, ios::out); - m_ssBlock = new std::ostringstream(); + m_ssBlock = new std::ostringstream(); m_ssBlkRecord = new std::ostringstream(); - m_ssEntity = new std::ostringstream(); - m_ssLayer = new std::ostringstream(); + m_ssEntity = new std::ostringstream(); + m_ssLayer = new std::ostringstream(); - if(!(*m_ofs)){ + if (!(*m_ofs)) { m_fail = true; return; } @@ -93,28 +94,25 @@ void CDxfWrite::endRun() writeEntitiesSection(); writeObjectsSection(); - (*m_ofs) << " 0" << endl; + (*m_ofs) << " 0" << endl; (*m_ofs) << "EOF"; } //*************************** -//writeHeaderSection -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// writeHeaderSection +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::writeHeaderSection() { std::stringstream ss; - ss << "FreeCAD v" - << App::Application::Config()["BuildVersionMajor"] - << "." - << App::Application::Config()["BuildVersionMinor"] - << " " - << App::Application::Config()["BuildRevision"]; + ss << "FreeCAD v" << App::Application::Config()["BuildVersionMajor"] << "." + << App::Application::Config()["BuildVersionMinor"] << " " + << App::Application::Config()["BuildRevision"]; - //header & version - (*m_ofs) << "999" << endl; - (*m_ofs) << ss.str() << endl; + // header & version + (*m_ofs) << "999" << endl; + (*m_ofs) << ss.str() << endl; - //static header content + // static header content ss.str(""); ss.clear(); ss << "header" << m_version << ".rub"; @@ -123,15 +121,15 @@ void CDxfWrite::writeHeaderSection() } //*************************** -//writeClassesSection -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// writeClassesSection +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::writeClassesSection() { if (m_version < 14) { return; } - //static classes section content + // static classes section content std::stringstream ss; ss << "classes" << m_version << ".rub"; std::string fileSpec = m_dataDir + ss.str(); @@ -139,11 +137,11 @@ void CDxfWrite::writeClassesSection() } //*************************** -//writeTablesSection -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// writeTablesSection +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::writeTablesSection() { - //static tables section head end content + // static tables section head end content std::stringstream ss; ss << "tables1" << m_version << ".rub"; std::string fileSpec = m_dataDir + ss.str(); @@ -151,7 +149,7 @@ void CDxfWrite::writeTablesSection() (*m_ofs) << (*m_ssLayer).str(); - //static tables section tail end content + // static tables section tail end content ss.str(""); ss.clear(); ss << "tables2" << m_version << ".rub"; @@ -160,140 +158,140 @@ void CDxfWrite::writeTablesSection() if (m_version > 12) { (*m_ofs) << (*m_ssBlkRecord).str(); - (*m_ofs) << " 0" << endl; - (*m_ofs) << "ENDTAB" << endl; + (*m_ofs) << " 0" << endl; + (*m_ofs) << "ENDTAB" << endl; } - (*m_ofs) << " 0" << endl; - (*m_ofs) << "ENDSEC" << endl; + (*m_ofs) << " 0" << endl; + (*m_ofs) << "ENDSEC" << endl; } //*************************** -//makeLayerTable -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// makeLayerTable +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::makeLayerTable() { std::string tablehash = getLayerHandle(); - (*m_ssLayer) << " 0" << endl; - (*m_ssLayer) << "TABLE" << endl; - (*m_ssLayer) << " 2" << endl; - (*m_ssLayer) << "LAYER" << endl; - (*m_ssLayer) << " 5" << endl; - (*m_ssLayer) << tablehash << endl; + (*m_ssLayer) << " 0" << endl; + (*m_ssLayer) << "TABLE" << endl; + (*m_ssLayer) << " 2" << endl; + (*m_ssLayer) << "LAYER" << endl; + (*m_ssLayer) << " 5" << endl; + (*m_ssLayer) << tablehash << endl; if (m_version > 12) { - (*m_ssLayer) << "330" << endl; - (*m_ssLayer) << 0 << endl; - (*m_ssLayer) << "100" << endl; - (*m_ssLayer) << "AcDbSymbolTable" << endl; + (*m_ssLayer) << "330" << endl; + (*m_ssLayer) << 0 << endl; + (*m_ssLayer) << "100" << endl; + (*m_ssLayer) << "AcDbSymbolTable" << endl; } - (*m_ssLayer) << " 70" << endl; + (*m_ssLayer) << " 70" << endl; (*m_ssLayer) << m_layerList.size() + 1 << endl; - (*m_ssLayer) << " 0" << endl; - (*m_ssLayer) << "LAYER" << endl; - (*m_ssLayer) << " 5" << endl; - (*m_ssLayer) << getLayerHandle() << endl; + (*m_ssLayer) << " 0" << endl; + (*m_ssLayer) << "LAYER" << endl; + (*m_ssLayer) << " 5" << endl; + (*m_ssLayer) << getLayerHandle() << endl; if (m_version > 12) { - (*m_ssLayer) << "330" << endl; - (*m_ssLayer) << tablehash << endl; - (*m_ssLayer) << "100" << endl; - (*m_ssLayer) << "AcDbSymbolTableRecord" << endl; - (*m_ssLayer) << "100" << endl; - (*m_ssLayer) << "AcDbLayerTableRecord" << endl; + (*m_ssLayer) << "330" << endl; + (*m_ssLayer) << tablehash << endl; + (*m_ssLayer) << "100" << endl; + (*m_ssLayer) << "AcDbSymbolTableRecord" << endl; + (*m_ssLayer) << "100" << endl; + (*m_ssLayer) << "AcDbLayerTableRecord" << endl; } - (*m_ssLayer) << " 2" << endl; - (*m_ssLayer) << "0" << endl; - (*m_ssLayer) << " 70" << endl; - (*m_ssLayer) << " 0" << endl; - (*m_ssLayer) << " 62" << endl; - (*m_ssLayer) << " 7" << endl; - (*m_ssLayer) << " 6" << endl; + (*m_ssLayer) << " 2" << endl; + (*m_ssLayer) << "0" << endl; + (*m_ssLayer) << " 70" << endl; + (*m_ssLayer) << " 0" << endl; + (*m_ssLayer) << " 62" << endl; + (*m_ssLayer) << " 7" << endl; + (*m_ssLayer) << " 6" << endl; (*m_ssLayer) << "CONTINUOUS" << endl; for (auto& l : m_layerList) { - (*m_ssLayer) << " 0" << endl; - (*m_ssLayer) << "LAYER" << endl; - (*m_ssLayer) << " 5" << endl; + (*m_ssLayer) << " 0" << endl; + (*m_ssLayer) << "LAYER" << endl; + (*m_ssLayer) << " 5" << endl; (*m_ssLayer) << getLayerHandle() << endl; if (m_version > 12) { - (*m_ssLayer) << "330" << endl; - (*m_ssLayer) << tablehash << endl; - (*m_ssLayer) << "100" << endl; - (*m_ssLayer) << "AcDbSymbolTableRecord" << endl; - (*m_ssLayer) << "100" << endl; - (*m_ssLayer) << "AcDbLayerTableRecord" << endl; + (*m_ssLayer) << "330" << endl; + (*m_ssLayer) << tablehash << endl; + (*m_ssLayer) << "100" << endl; + (*m_ssLayer) << "AcDbSymbolTableRecord" << endl; + (*m_ssLayer) << "100" << endl; + (*m_ssLayer) << "AcDbLayerTableRecord" << endl; } - (*m_ssLayer) << " 2" << endl; + (*m_ssLayer) << " 2" << endl; (*m_ssLayer) << l << endl; - (*m_ssLayer) << " 70" << endl; - (*m_ssLayer) << " 0" << endl; - (*m_ssLayer) << " 62" << endl; - (*m_ssLayer) << " 7" << endl; - (*m_ssLayer) << " 6" << endl; - (*m_ssLayer) << "CONTINUOUS" << endl; + (*m_ssLayer) << " 70" << endl; + (*m_ssLayer) << " 0" << endl; + (*m_ssLayer) << " 62" << endl; + (*m_ssLayer) << " 7" << endl; + (*m_ssLayer) << " 6" << endl; + (*m_ssLayer) << "CONTINUOUS" << endl; } - (*m_ssLayer) << " 0" << endl; - (*m_ssLayer) << "ENDTAB" << endl; + (*m_ssLayer) << " 0" << endl; + (*m_ssLayer) << "ENDTAB" << endl; } //*************************** -//makeBlockRecordTableHead -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// makeBlockRecordTableHead +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::makeBlockRecordTableHead() { if (m_version < 14) { return; } - std::string tablehash = getBlkRecordHandle(); - m_saveBlockRecordTableHandle = tablehash; - (*m_ssBlkRecord) << " 0" << endl; - (*m_ssBlkRecord) << "TABLE" << endl; - (*m_ssBlkRecord) << " 2" << endl; - (*m_ssBlkRecord) << "BLOCK_RECORD" << endl; - (*m_ssBlkRecord) << " 5" << endl; - (*m_ssBlkRecord) << tablehash << endl; - (*m_ssBlkRecord) << "330" << endl; - (*m_ssBlkRecord) << "0" << endl; - (*m_ssBlkRecord) << "100" << endl; - (*m_ssBlkRecord) << "AcDbSymbolTable" << endl; - (*m_ssBlkRecord) << " 70" << endl; - (*m_ssBlkRecord) << (m_blockList.size() + 5) << endl; + std::string tablehash = getBlkRecordHandle(); + m_saveBlockRecordTableHandle = tablehash; + (*m_ssBlkRecord) << " 0" << endl; + (*m_ssBlkRecord) << "TABLE" << endl; + (*m_ssBlkRecord) << " 2" << endl; + (*m_ssBlkRecord) << "BLOCK_RECORD" << endl; + (*m_ssBlkRecord) << " 5" << endl; + (*m_ssBlkRecord) << tablehash << endl; + (*m_ssBlkRecord) << "330" << endl; + (*m_ssBlkRecord) << "0" << endl; + (*m_ssBlkRecord) << "100" << endl; + (*m_ssBlkRecord) << "AcDbSymbolTable" << endl; + (*m_ssBlkRecord) << " 70" << endl; + (*m_ssBlkRecord) << (m_blockList.size() + 5) << endl; - m_saveModelSpaceHandle = getBlkRecordHandle(); - (*m_ssBlkRecord) << " 0" << endl; - (*m_ssBlkRecord) << "BLOCK_RECORD" << endl; - (*m_ssBlkRecord) << " 5" << endl; - (*m_ssBlkRecord) << m_saveModelSpaceHandle << endl; - (*m_ssBlkRecord) << "330" << endl; - (*m_ssBlkRecord) << tablehash << endl; - (*m_ssBlkRecord) << "100" << endl; - (*m_ssBlkRecord) << "AcDbSymbolTableRecord" << endl; - (*m_ssBlkRecord) << "100" << endl; - (*m_ssBlkRecord) << "AcDbBlockTableRecord" << endl; - (*m_ssBlkRecord) << " 2" << endl; - (*m_ssBlkRecord) << "*MODEL_SPACE" << endl; -// (*m_ssBlkRecord) << " 1" << endl; -// (*m_ssBlkRecord) << " " << endl; + m_saveModelSpaceHandle = getBlkRecordHandle(); + (*m_ssBlkRecord) << " 0" << endl; + (*m_ssBlkRecord) << "BLOCK_RECORD" << endl; + (*m_ssBlkRecord) << " 5" << endl; + (*m_ssBlkRecord) << m_saveModelSpaceHandle << endl; + (*m_ssBlkRecord) << "330" << endl; + (*m_ssBlkRecord) << tablehash << endl; + (*m_ssBlkRecord) << "100" << endl; + (*m_ssBlkRecord) << "AcDbSymbolTableRecord" << endl; + (*m_ssBlkRecord) << "100" << endl; + (*m_ssBlkRecord) << "AcDbBlockTableRecord" << endl; + (*m_ssBlkRecord) << " 2" << endl; + (*m_ssBlkRecord) << "*MODEL_SPACE" << endl; + // (*m_ssBlkRecord) << " 1" << endl; + // (*m_ssBlkRecord) << " " << endl; - m_savePaperSpaceHandle = getBlkRecordHandle(); - (*m_ssBlkRecord) << " 0" << endl; - (*m_ssBlkRecord) << "BLOCK_RECORD" << endl; - (*m_ssBlkRecord) << " 5" << endl; - (*m_ssBlkRecord) << m_savePaperSpaceHandle << endl; - (*m_ssBlkRecord) << "330" << endl; - (*m_ssBlkRecord) << tablehash << endl; - (*m_ssBlkRecord) << "100" << endl; - (*m_ssBlkRecord) << "AcDbSymbolTableRecord" << endl; - (*m_ssBlkRecord) << "100" << endl; - (*m_ssBlkRecord) << "AcDbBlockTableRecord" << endl; - (*m_ssBlkRecord) << " 2" << endl; - (*m_ssBlkRecord) << "*PAPER_SPACE" << endl; -// (*m_ssBlkRecord) << " 1" << endl; -// (*m_ssBlkRecord) << " " << endl; + m_savePaperSpaceHandle = getBlkRecordHandle(); + (*m_ssBlkRecord) << " 0" << endl; + (*m_ssBlkRecord) << "BLOCK_RECORD" << endl; + (*m_ssBlkRecord) << " 5" << endl; + (*m_ssBlkRecord) << m_savePaperSpaceHandle << endl; + (*m_ssBlkRecord) << "330" << endl; + (*m_ssBlkRecord) << tablehash << endl; + (*m_ssBlkRecord) << "100" << endl; + (*m_ssBlkRecord) << "AcDbSymbolTableRecord" << endl; + (*m_ssBlkRecord) << "100" << endl; + (*m_ssBlkRecord) << "AcDbBlockTableRecord" << endl; + (*m_ssBlkRecord) << " 2" << endl; + (*m_ssBlkRecord) << "*PAPER_SPACE" << endl; + // (*m_ssBlkRecord) << " 1" << endl; + // (*m_ssBlkRecord) << " " << endl; } //*************************** -//makeBlockRecordTableBody -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// makeBlockRecordTableBody +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::makeBlockRecordTableBody() { if (m_version < 14) { @@ -302,130 +300,130 @@ void CDxfWrite::makeBlockRecordTableBody() int iBlkRecord = 0; for (auto& b : m_blockList) { - (*m_ssBlkRecord) << " 0" << endl; - (*m_ssBlkRecord) << "BLOCK_RECORD" << endl; - (*m_ssBlkRecord) << " 5" << endl; - (*m_ssBlkRecord) << m_blkRecordList.at(iBlkRecord) << endl; - (*m_ssBlkRecord) << "330" << endl; - (*m_ssBlkRecord) << m_saveBlockRecordTableHandle << endl; - (*m_ssBlkRecord) << "100" << endl; - (*m_ssBlkRecord) << "AcDbSymbolTableRecord" << endl; - (*m_ssBlkRecord) << "100" << endl; - (*m_ssBlkRecord) << "AcDbBlockTableRecord" << endl; - (*m_ssBlkRecord) << " 2" << endl; - (*m_ssBlkRecord) << b << endl; -// (*m_ssBlkRecord) << " 70" << endl; -// (*m_ssBlkRecord) << " 0" << endl; + (*m_ssBlkRecord) << " 0" << endl; + (*m_ssBlkRecord) << "BLOCK_RECORD" << endl; + (*m_ssBlkRecord) << " 5" << endl; + (*m_ssBlkRecord) << m_blkRecordList.at(iBlkRecord) << endl; + (*m_ssBlkRecord) << "330" << endl; + (*m_ssBlkRecord) << m_saveBlockRecordTableHandle << endl; + (*m_ssBlkRecord) << "100" << endl; + (*m_ssBlkRecord) << "AcDbSymbolTableRecord" << endl; + (*m_ssBlkRecord) << "100" << endl; + (*m_ssBlkRecord) << "AcDbBlockTableRecord" << endl; + (*m_ssBlkRecord) << " 2" << endl; + (*m_ssBlkRecord) << b << endl; + // (*m_ssBlkRecord) << " 70" << endl; + // (*m_ssBlkRecord) << " 0" << endl; iBlkRecord++; } } //*************************** -//makeBlockSectionHead -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// makeBlockSectionHead +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::makeBlockSectionHead() { - (*m_ssBlock) << " 0" << endl; - (*m_ssBlock) << "SECTION" << endl; - (*m_ssBlock) << " 2" << endl; - (*m_ssBlock) << "BLOCKS" << endl; - (*m_ssBlock) << " 0" << endl; - (*m_ssBlock) << "BLOCK" << endl; - (*m_ssBlock) << " 5" << endl; + (*m_ssBlock) << " 0" << endl; + (*m_ssBlock) << "SECTION" << endl; + (*m_ssBlock) << " 2" << endl; + (*m_ssBlock) << "BLOCKS" << endl; + (*m_ssBlock) << " 0" << endl; + (*m_ssBlock) << "BLOCK" << endl; + (*m_ssBlock) << " 5" << endl; m_currentBlock = getBlockHandle(); (*m_ssBlock) << m_currentBlock << endl; if (m_version > 12) { - (*m_ssBlock) << "330" << endl; + (*m_ssBlock) << "330" << endl; (*m_ssBlock) << m_saveModelSpaceHandle << endl; - (*m_ssBlock) << "100" << endl; - (*m_ssBlock) << "AcDbEntity" << endl; + (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "AcDbEntity" << endl; } - (*m_ssBlock) << " 8" << endl; - (*m_ssBlock) << "0" << endl; + (*m_ssBlock) << " 8" << endl; + (*m_ssBlock) << "0" << endl; if (m_version > 12) { - (*m_ssBlock) << "100" << endl; - (*m_ssBlock) << "AcDbBlockBegin" << endl; + (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "AcDbBlockBegin" << endl; } - (*m_ssBlock) << " 2" << endl; + (*m_ssBlock) << " 2" << endl; (*m_ssBlock) << "*MODEL_SPACE" << endl; - (*m_ssBlock) << " 70" << endl; - (*m_ssBlock) << " 0" << endl; - (*m_ssBlock) << " 10" << endl; - (*m_ssBlock) << 0.0 << endl; - (*m_ssBlock) << " 20" << endl; - (*m_ssBlock) << 0.0 << endl; - (*m_ssBlock) << " 30" << endl; - (*m_ssBlock) << 0.0 << endl; - (*m_ssBlock) << " 3" << endl; + (*m_ssBlock) << " 70" << endl; + (*m_ssBlock) << " 0" << endl; + (*m_ssBlock) << " 10" << endl; + (*m_ssBlock) << 0.0 << endl; + (*m_ssBlock) << " 20" << endl; + (*m_ssBlock) << 0.0 << endl; + (*m_ssBlock) << " 30" << endl; + (*m_ssBlock) << 0.0 << endl; + (*m_ssBlock) << " 3" << endl; (*m_ssBlock) << "*MODEL_SPACE" << endl; - (*m_ssBlock) << " 1" << endl; - (*m_ssBlock) << " " << endl; - (*m_ssBlock) << " 0" << endl; - (*m_ssBlock) << "ENDBLK" << endl; - (*m_ssBlock) << " 5" << endl; - (*m_ssBlock) << getBlockHandle() << endl; + (*m_ssBlock) << " 1" << endl; + (*m_ssBlock) << " " << endl; + (*m_ssBlock) << " 0" << endl; + (*m_ssBlock) << "ENDBLK" << endl; + (*m_ssBlock) << " 5" << endl; + (*m_ssBlock) << getBlockHandle() << endl; if (m_version > 12) { - (*m_ssBlock) << "330" << endl; + (*m_ssBlock) << "330" << endl; (*m_ssBlock) << m_saveModelSpaceHandle << endl; - (*m_ssBlock) << "100" << endl; - (*m_ssBlock) << "AcDbEntity" << endl; + (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "AcDbEntity" << endl; } - (*m_ssBlock) << " 8" << endl; - (*m_ssBlock) << "0" << endl; + (*m_ssBlock) << " 8" << endl; + (*m_ssBlock) << "0" << endl; if (m_version > 12) { - (*m_ssBlock) << "100" << endl; - (*m_ssBlock) << "AcDbBlockEnd" << endl; + (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "AcDbBlockEnd" << endl; } - (*m_ssBlock) << " 0" << endl; - (*m_ssBlock) << "BLOCK" << endl; - (*m_ssBlock) << " 5" << endl; + (*m_ssBlock) << " 0" << endl; + (*m_ssBlock) << "BLOCK" << endl; + (*m_ssBlock) << " 5" << endl; m_currentBlock = getBlockHandle(); (*m_ssBlock) << m_currentBlock << endl; if (m_version > 12) { - (*m_ssBlock) << "330" << endl; + (*m_ssBlock) << "330" << endl; (*m_ssBlock) << m_savePaperSpaceHandle << endl; - (*m_ssBlock) << "100" << endl; - (*m_ssBlock) << "AcDbEntity" << endl; - (*m_ssBlock) << " 67" << endl; - (*m_ssBlock) << "1" << endl; + (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "AcDbEntity" << endl; + (*m_ssBlock) << " 67" << endl; + (*m_ssBlock) << "1" << endl; } - (*m_ssBlock) << " 8" << endl; - (*m_ssBlock) << "0" << endl; + (*m_ssBlock) << " 8" << endl; + (*m_ssBlock) << "0" << endl; if (m_version > 12) { - (*m_ssBlock) << "100" << endl; - (*m_ssBlock) << "AcDbBlockBegin" << endl; + (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "AcDbBlockBegin" << endl; } - (*m_ssBlock) << " 2" << endl; + (*m_ssBlock) << " 2" << endl; (*m_ssBlock) << "*PAPER_SPACE" << endl; - (*m_ssBlock) << " 70" << endl; - (*m_ssBlock) << " 0" << endl; - (*m_ssBlock) << " 10" << endl; - (*m_ssBlock) << 0.0 << endl; - (*m_ssBlock) << " 20" << endl; - (*m_ssBlock) << 0.0 << endl; - (*m_ssBlock) << " 30" << endl; - (*m_ssBlock) << 0.0 << endl; - (*m_ssBlock) << " 3" << endl; + (*m_ssBlock) << " 70" << endl; + (*m_ssBlock) << " 0" << endl; + (*m_ssBlock) << " 10" << endl; + (*m_ssBlock) << 0.0 << endl; + (*m_ssBlock) << " 20" << endl; + (*m_ssBlock) << 0.0 << endl; + (*m_ssBlock) << " 30" << endl; + (*m_ssBlock) << 0.0 << endl; + (*m_ssBlock) << " 3" << endl; (*m_ssBlock) << "*PAPER_SPACE" << endl; - (*m_ssBlock) << " 1" << endl; - (*m_ssBlock) << " " << endl; - (*m_ssBlock) << " 0" << endl; - (*m_ssBlock) << "ENDBLK" << endl; - (*m_ssBlock) << " 5" << endl; - (*m_ssBlock) << getBlockHandle() << endl; + (*m_ssBlock) << " 1" << endl; + (*m_ssBlock) << " " << endl; + (*m_ssBlock) << " 0" << endl; + (*m_ssBlock) << "ENDBLK" << endl; + (*m_ssBlock) << " 5" << endl; + (*m_ssBlock) << getBlockHandle() << endl; if (m_version > 12) { - (*m_ssBlock) << "330" << endl; + (*m_ssBlock) << "330" << endl; (*m_ssBlock) << m_savePaperSpaceHandle << endl; - (*m_ssBlock) << "100" << endl; - (*m_ssBlock) << "AcDbEntity" << endl; - (*m_ssBlock) << " 67" << endl; //paper_space flag - (*m_ssBlock) << " 1" << endl; + (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "AcDbEntity" << endl; + (*m_ssBlock) << " 67" << endl;// paper_space flag + (*m_ssBlock) << " 1" << endl; } - (*m_ssBlock) << " 8" << endl; - (*m_ssBlock) << "0" << endl; + (*m_ssBlock) << " 8" << endl; + (*m_ssBlock) << "0" << endl; if (m_version > 12) { - (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "100" << endl; (*m_ssBlock) << "AcDbBlockEnd" << endl; } } @@ -435,14 +433,14 @@ std::string CDxfWrite::getPlateFile(std::string fileSpec) std::stringstream outString; Base::FileInfo fi(fileSpec); if (!fi.isReadable()) { - Base::Console().Message("dxf unable to open %s!\n",fileSpec.c_str()); - } else { + Base::Console().Message("dxf unable to open %s!\n", fileSpec.c_str()); + } + else { string line; - ifstream inFile (fi.filePath().c_str()); + ifstream inFile(fi.filePath().c_str()); - while (!inFile.eof()) - { - getline(inFile,line); + while (!inFile.eof()) { + getline(inFile, line); if (!inFile.eof()) { outString << line << '\n'; } @@ -463,41 +461,41 @@ std::string CDxfWrite::getHandle() std::string CDxfWrite::getEntityHandle() { return getHandle(); -// m_entityHandle++; -// std::stringstream ss; -// ss << std::uppercase << std::hex << std::setfill('0') << std::setw(2); -// ss << m_entityHandle; -// return ss.str(); + // m_entityHandle++; + // std::stringstream ss; + // ss << std::uppercase << std::hex << std::setfill('0') << std::setw(2); + // ss << m_entityHandle; + // return ss.str(); } std::string CDxfWrite::getLayerHandle() { return getHandle(); -// m_layerHandle++; -// std::stringstream ss; -// ss << std::uppercase << std::hex << std::setfill('0') << std::setw(2); -// ss << m_layerHandle; -// return ss.str(); + // m_layerHandle++; + // std::stringstream ss; + // ss << std::uppercase << std::hex << std::setfill('0') << std::setw(2); + // ss << m_layerHandle; + // return ss.str(); } std::string CDxfWrite::getBlockHandle() { return getHandle(); -// m_blockHandle++; -// std::stringstream ss; -// ss << std::uppercase << std::hex << std::setfill('0') << std::setw(2); -// ss << m_blockHandle; -// return ss.str(); + // m_blockHandle++; + // std::stringstream ss; + // ss << std::uppercase << std::hex << std::setfill('0') << std::setw(2); + // ss << m_blockHandle; + // return ss.str(); } std::string CDxfWrite::getBlkRecordHandle() { return getHandle(); -// m_blkRecordHandle++; -// std::stringstream ss; -// ss << std::uppercase << std::hex << std::setfill('0') << std::setw(2); -// ss << m_blkRecordHandle; -// return ss.str(); + // m_blkRecordHandle++; + // std::stringstream ss; + // ss << std::uppercase << std::hex << std::setfill('0') << std::setw(2); + // ss << m_blkRecordHandle; + // return ss.str(); } void CDxfWrite::addBlockName(std::string b, std::string h) @@ -508,185 +506,187 @@ void CDxfWrite::addBlockName(std::string b, std::string h) void CDxfWrite::setLayerName(std::string s) { - m_layerName = s; - m_layerList.push_back(s); + m_layerName = s; + m_layerList.push_back(s); } void CDxfWrite::writeLine(const double* s, const double* e) { - putLine(toVector3d(s),toVector3d(e),m_ssEntity, getEntityHandle(), m_saveModelSpaceHandle); + putLine(toVector3d(s), toVector3d(e), m_ssEntity, getEntityHandle(), m_saveModelSpaceHandle); } -void CDxfWrite::putLine(const Base::Vector3d s, const Base::Vector3d e, - std::ostringstream* outStream, const std::string handle, - const std::string ownerHandle) +void CDxfWrite::putLine(const Base::Vector3d s, + const Base::Vector3d e, + std::ostringstream* outStream, + const std::string handle, + const std::string ownerHandle) { - (*outStream) << " 0" << endl; - (*outStream) << "LINE" << endl; - (*outStream) << " 5" << endl; - (*outStream) << handle << endl; + (*outStream) << " 0" << endl; + (*outStream) << "LINE" << endl; + (*outStream) << " 5" << endl; + (*outStream) << handle << endl; if (m_version > 12) { - (*outStream) << "330" << endl; - (*outStream) << ownerHandle << endl; - (*outStream) << "100" << endl; - (*outStream) << "AcDbEntity" << endl; + (*outStream) << "330" << endl; + (*outStream) << ownerHandle << endl; + (*outStream) << "100" << endl; + (*outStream) << "AcDbEntity" << endl; } - (*outStream) << " 8" << endl; // Group code for layer name - (*outStream) << getLayerName() << endl; // Layer number + (*outStream) << " 8" << endl; // Group code for layer name + (*outStream) << getLayerName() << endl;// Layer number if (m_version > 12) { - (*outStream) << "100" << endl; + (*outStream) << "100" << endl; (*outStream) << "AcDbLine" << endl; } - (*outStream) << " 10" << endl; // Start point of line - (*outStream) << s.x << endl; // X in WCS coordinates - (*outStream) << " 20" << endl; - (*outStream) << s.y << endl; // Y in WCS coordinates - (*outStream) << " 30" << endl; - (*outStream) << s.z << endl; // Z in WCS coordinates - (*outStream) << " 11" << endl; // End point of line - (*outStream) << e.x << endl; // X in WCS coordinates - (*outStream) << " 21" << endl; - (*outStream) << e.y << endl; // Y in WCS coordinates - (*outStream) << " 31" << endl; - (*outStream) << e.z << endl; // Z in WCS coordinates + (*outStream) << " 10" << endl;// Start point of line + (*outStream) << s.x << endl; // X in WCS coordinates + (*outStream) << " 20" << endl; + (*outStream) << s.y << endl;// Y in WCS coordinates + (*outStream) << " 30" << endl; + (*outStream) << s.z << endl; // Z in WCS coordinates + (*outStream) << " 11" << endl;// End point of line + (*outStream) << e.x << endl; // X in WCS coordinates + (*outStream) << " 21" << endl; + (*outStream) << e.y << endl;// Y in WCS coordinates + (*outStream) << " 31" << endl; + (*outStream) << e.z << endl;// Z in WCS coordinates } //*************************** -//writeLWPolyLine (Note: LWPolyline might not be supported in R12 -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project -void CDxfWrite::writeLWPolyLine(const LWPolyDataOut &pd) +// writeLWPolyLine (Note: LWPolyline might not be supported in R12 +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +void CDxfWrite::writeLWPolyLine(const LWPolyDataOut& pd) { - (*m_ssEntity) << " 0" << endl; - (*m_ssEntity) << "LWPOLYLINE" << endl; - (*m_ssEntity) << " 5" << endl; + (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << "LWPOLYLINE" << endl; + (*m_ssEntity) << " 5" << endl; (*m_ssEntity) << getEntityHandle() << endl; if (m_version > 12) { - (*m_ssEntity) << "330" << endl; - (*m_ssEntity) << m_saveModelSpaceHandle << endl; - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbEntity" << endl; + (*m_ssEntity) << "330" << endl; + (*m_ssEntity) << m_saveModelSpaceHandle << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbEntity" << endl; } if (m_version > 12) { - (*m_ssEntity) << "100" << endl; //100 groups are not part of R12 - (*m_ssEntity) << "AcDbPolyline" << endl; + (*m_ssEntity) << "100" << endl;// 100 groups are not part of R12 + (*m_ssEntity) << "AcDbPolyline" << endl; } - (*m_ssEntity) << " 8" << endl; // Group code for layer name - (*m_ssEntity) << getLayerName() << endl; // Layer name - (*m_ssEntity) << " 90" << endl; - (*m_ssEntity) << pd.nVert << endl; // number of vertices - (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << pd.Flag << endl; - (*m_ssEntity) << " 43" << endl; - (*m_ssEntity) << "0" << endl; //Constant width opt -// (*m_ssEntity) << pd.Width << endl; //Constant width opt -// (*m_ssEntity) << " 38" << endl; -// (*m_ssEntity) << pd.Elev << endl; // Elevation -// (*m_ssEntity) << " 39" << endl; -// (*m_ssEntity) << pd.Thick << endl; // Thickness + (*m_ssEntity) << " 8" << endl; // Group code for layer name + (*m_ssEntity) << getLayerName() << endl;// Layer name + (*m_ssEntity) << " 90" << endl; + (*m_ssEntity) << pd.nVert << endl;// number of vertices + (*m_ssEntity) << " 70" << endl; + (*m_ssEntity) << pd.Flag << endl; + (*m_ssEntity) << " 43" << endl; + (*m_ssEntity) << "0" << endl;// Constant width opt + // (*m_ssEntity) << pd.Width << endl; //Constant width opt + // (*m_ssEntity) << " 38" << endl; + // (*m_ssEntity) << pd.Elev << endl; // Elevation + // (*m_ssEntity) << " 39" << endl; + // (*m_ssEntity) << pd.Thick << endl; // Thickness for (auto& p : pd.Verts) { - (*m_ssEntity) << " 10" << endl; // Vertices - (*m_ssEntity) << p.x << endl; - (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << p.y << endl; + (*m_ssEntity) << " 10" << endl;// Vertices + (*m_ssEntity) << p.x << endl; + (*m_ssEntity) << " 20" << endl; + (*m_ssEntity) << p.y << endl; } for (auto& s : pd.StartWidth) { - (*m_ssEntity) << " 40" << endl; - (*m_ssEntity) << s << endl; // Start Width + (*m_ssEntity) << " 40" << endl; + (*m_ssEntity) << s << endl;// Start Width } for (auto& e : pd.EndWidth) { - (*m_ssEntity) << " 41" << endl; - (*m_ssEntity) << e << endl; // End Width + (*m_ssEntity) << " 41" << endl; + (*m_ssEntity) << e << endl;// End Width } - for (auto& b : pd.Bulge) { // Bulge - (*m_ssEntity) << " 42" << endl; - (*m_ssEntity) << b << endl; + for (auto& b : pd.Bulge) {// Bulge + (*m_ssEntity) << " 42" << endl; + (*m_ssEntity) << b << endl; } -// (*m_ssEntity) << "210" << endl; //Extrusion dir -// (*m_ssEntity) << pd.Extr.x << endl; -// (*m_ssEntity) << "220" << endl; -// (*m_ssEntity) << pd.Extr.y << endl; -// (*m_ssEntity) << "230" << endl; -// (*m_ssEntity) << pd.Extr.z << endl; + // (*m_ssEntity) << "210" << endl; //Extrusion dir + // (*m_ssEntity) << pd.Extr.x << endl; + // (*m_ssEntity) << "220" << endl; + // (*m_ssEntity) << pd.Extr.y << endl; + // (*m_ssEntity) << "230" << endl; + // (*m_ssEntity) << pd.Extr.z << endl; } //*************************** -//writePolyline -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project -void CDxfWrite::writePolyline(const LWPolyDataOut &pd) +// writePolyline +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +void CDxfWrite::writePolyline(const LWPolyDataOut& pd) { - (*m_ssEntity) << " 0" << endl; - (*m_ssEntity) << "POLYLINE" << endl; - (*m_ssEntity) << " 5" << endl; + (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << "POLYLINE" << endl; + (*m_ssEntity) << " 5" << endl; (*m_ssEntity) << getEntityHandle() << endl; if (m_version > 12) { - (*m_ssEntity) << "330" << endl; - (*m_ssEntity) << m_saveModelSpaceHandle << endl; - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbEntity" << endl; + (*m_ssEntity) << "330" << endl; + (*m_ssEntity) << m_saveModelSpaceHandle << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; - (*m_ssEntity) << getLayerName() << endl; // Layer name + (*m_ssEntity) << " 8" << endl; + (*m_ssEntity) << getLayerName() << endl;// Layer name if (m_version > 12) { - (*m_ssEntity) << "100" << endl; //100 groups are not part of R12 - (*m_ssEntity) << "AcDbPolyline" << endl; + (*m_ssEntity) << "100" << endl;// 100 groups are not part of R12 + (*m_ssEntity) << "AcDbPolyline" << endl; } - (*m_ssEntity) << " 66" << endl; - (*m_ssEntity) << " 1" << endl; // vertices follow - (*m_ssEntity) << " 10" << endl; - (*m_ssEntity) << "0.0" << endl; - (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << "0.0" << endl; - (*m_ssEntity) << " 30" << endl; - (*m_ssEntity) << "0.0" << endl; - (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << "0" << endl; + (*m_ssEntity) << " 66" << endl; + (*m_ssEntity) << " 1" << endl;// vertices follow + (*m_ssEntity) << " 10" << endl; + (*m_ssEntity) << "0.0" << endl; + (*m_ssEntity) << " 20" << endl; + (*m_ssEntity) << "0.0" << endl; + (*m_ssEntity) << " 30" << endl; + (*m_ssEntity) << "0.0" << endl; + (*m_ssEntity) << " 70" << endl; + (*m_ssEntity) << "0" << endl; for (auto& p : pd.Verts) { - (*m_ssEntity) << " 0" << endl; - (*m_ssEntity) << "VERTEX" << endl; - (*m_ssEntity) << " 5" << endl; + (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << "VERTEX" << endl; + (*m_ssEntity) << " 5" << endl; (*m_ssEntity) << getEntityHandle() << endl; - (*m_ssEntity) << " 8" << endl; - (*m_ssEntity) << getLayerName() << endl; - (*m_ssEntity) << " 10" << endl; - (*m_ssEntity) << p.x << endl; - (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << p.y << endl; - (*m_ssEntity) << " 30" << endl; - (*m_ssEntity) << "0.0" << endl; + (*m_ssEntity) << " 8" << endl; + (*m_ssEntity) << getLayerName() << endl; + (*m_ssEntity) << " 10" << endl; + (*m_ssEntity) << p.x << endl; + (*m_ssEntity) << " 20" << endl; + (*m_ssEntity) << p.y << endl; + (*m_ssEntity) << " 30" << endl; + (*m_ssEntity) << "0.0" << endl; } - (*m_ssEntity) << " 0" << endl; - (*m_ssEntity) << "SEQEND" << endl; - (*m_ssEntity) << " 5" << endl; - (*m_ssEntity) << getEntityHandle() << endl; - (*m_ssEntity) << " 8" << endl; - (*m_ssEntity) << getLayerName() << endl; + (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << "SEQEND" << endl; + (*m_ssEntity) << " 5" << endl; + (*m_ssEntity) << getEntityHandle() << endl; + (*m_ssEntity) << " 8" << endl; + (*m_ssEntity) << getLayerName() << endl; } void CDxfWrite::writePoint(const double* s) { - (*m_ssEntity) << " 0" << endl; - (*m_ssEntity) << "POINT" << endl; - (*m_ssEntity) << " 5" << endl; + (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << "POINT" << endl; + (*m_ssEntity) << " 5" << endl; (*m_ssEntity) << getEntityHandle() << endl; if (m_version > 12) { - (*m_ssEntity) << "330" << endl; - (*m_ssEntity) << m_saveModelSpaceHandle << endl; - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbEntity" << endl; + (*m_ssEntity) << "330" << endl; + (*m_ssEntity) << m_saveModelSpaceHandle << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; // Group code for layer name - (*m_ssEntity) << getLayerName() << endl; // Layer name + (*m_ssEntity) << " 8" << endl; // Group code for layer name + (*m_ssEntity) << getLayerName() << endl;// Layer name if (m_version > 12) { - (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "100" << endl; (*m_ssEntity) << "AcDbPoint" << endl; } - (*m_ssEntity) << " 10" << endl; - (*m_ssEntity) << s[0] << endl; // X in WCS coordinates - (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << s[1] << endl; // Y in WCS coordinates - (*m_ssEntity) << " 30" << endl; - (*m_ssEntity) << s[2] << endl; // Z in WCS coordinates + (*m_ssEntity) << " 10" << endl; + (*m_ssEntity) << s[0] << endl;// X in WCS coordinates + (*m_ssEntity) << " 20" << endl; + (*m_ssEntity) << s[1] << endl;// Y in WCS coordinates + (*m_ssEntity) << " 30" << endl; + (*m_ssEntity) << s[2] << endl;// Z in WCS coordinates } void CDxfWrite::writeArc(const double* s, const double* e, const double* c, bool dir) @@ -696,615 +696,639 @@ void CDxfWrite::writeArc(const double* s, const double* e, const double* c, bool double bx = e[0] - c[0]; double by = e[1] - c[1]; - double start_angle = atan2(ay, ax) * 180/M_PI; - double end_angle = atan2(by, bx) * 180/M_PI; - double radius = sqrt(ax*ax + ay*ay); - if(!dir){ + double start_angle = atan2(ay, ax) * 180 / M_PI; + double end_angle = atan2(by, bx) * 180 / M_PI; + double radius = sqrt(ax * ax + ay * ay); + if (!dir) { double temp = start_angle; start_angle = end_angle; end_angle = temp; } - (*m_ssEntity) << " 0" << endl; - (*m_ssEntity) << "ARC" << endl; - (*m_ssEntity) << " 5" << endl; + (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << "ARC" << endl; + (*m_ssEntity) << " 5" << endl; (*m_ssEntity) << getEntityHandle() << endl; if (m_version > 12) { - (*m_ssEntity) << "330" << endl; - (*m_ssEntity) << m_saveModelSpaceHandle << endl; - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbEntity" << endl; + (*m_ssEntity) << "330" << endl; + (*m_ssEntity) << m_saveModelSpaceHandle << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; // Group code for layer name - (*m_ssEntity) << getLayerName() << endl; // Layer number -// (*m_ssEntity) << " 62" << endl; -// (*m_ssEntity) << " 0" << endl; - if (m_version > 12) { - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbCircle" << endl; + (*m_ssEntity) << " 8" << endl; // Group code for layer name + (*m_ssEntity) << getLayerName() << endl;// Layer number + // (*m_ssEntity) << " 62" << endl; + // (*m_ssEntity) << " 0" << endl; + if (m_version > 12) { + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbCircle" << endl; } - (*m_ssEntity) << " 10" << endl; // Centre X - (*m_ssEntity) << c[0] << endl; // X in WCS coordinates - (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << c[1] << endl; // Y in WCS coordinates - (*m_ssEntity) << " 30" << endl; - (*m_ssEntity) << c[2] << endl; // Z in WCS coordinates - (*m_ssEntity) << " 40" << endl; // - (*m_ssEntity) << radius << endl; // Radius + (*m_ssEntity) << " 10" << endl;// Centre X + (*m_ssEntity) << c[0] << endl; // X in WCS coordinates + (*m_ssEntity) << " 20" << endl; + (*m_ssEntity) << c[1] << endl;// Y in WCS coordinates + (*m_ssEntity) << " 30" << endl; + (*m_ssEntity) << c[2] << endl; // Z in WCS coordinates + (*m_ssEntity) << " 40" << endl; // + (*m_ssEntity) << radius << endl;// Radius if (m_version > 12) { - (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "100" << endl; (*m_ssEntity) << "AcDbArc" << endl; } - (*m_ssEntity) << " 50" << endl; - (*m_ssEntity) << start_angle << endl; // Start angle - (*m_ssEntity) << " 51" << endl; - (*m_ssEntity) << end_angle << endl; // End angle + (*m_ssEntity) << " 50" << endl; + (*m_ssEntity) << start_angle << endl;// Start angle + (*m_ssEntity) << " 51" << endl; + (*m_ssEntity) << end_angle << endl;// End angle } void CDxfWrite::writeCircle(const double* c, double radius) { - (*m_ssEntity) << " 0" << endl; - (*m_ssEntity) << "CIRCLE" << endl; - (*m_ssEntity) << " 5" << endl; + (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << "CIRCLE" << endl; + (*m_ssEntity) << " 5" << endl; (*m_ssEntity) << getEntityHandle() << endl; if (m_version > 12) { - (*m_ssEntity) << "330" << endl; - (*m_ssEntity) << m_saveModelSpaceHandle << endl; - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbEntity" << endl; + (*m_ssEntity) << "330" << endl; + (*m_ssEntity) << m_saveModelSpaceHandle << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; // Group code for layer name - (*m_ssEntity) << getLayerName() << endl; // Layer number - if (m_version > 12) { - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbCircle" << endl; + (*m_ssEntity) << " 8" << endl; // Group code for layer name + (*m_ssEntity) << getLayerName() << endl;// Layer number + if (m_version > 12) { + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbCircle" << endl; } - (*m_ssEntity) << " 10" << endl; // Centre X - (*m_ssEntity) << c[0] << endl; // X in WCS coordinates - (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << c[1] << endl; // Y in WCS coordinates -// (*m_ssEntity) << " 30" << endl; -// (*m_ssEntity) << c[2] << endl; // Z in WCS coordinates - (*m_ssEntity) << " 40" << endl; // - (*m_ssEntity) << radius << endl; // Radius + (*m_ssEntity) << " 10" << endl;// Centre X + (*m_ssEntity) << c[0] << endl; // X in WCS coordinates + (*m_ssEntity) << " 20" << endl; + (*m_ssEntity) << c[1] << endl;// Y in WCS coordinates + // (*m_ssEntity) << " 30" << endl; + // (*m_ssEntity) << c[2] << endl; // Z in WCS coordinates + (*m_ssEntity) << " 40" << endl; // + (*m_ssEntity) << radius << endl;// Radius } -void CDxfWrite::writeEllipse(const double* c, double major_radius, double minor_radius, - double rotation, double start_angle, double end_angle, +void CDxfWrite::writeEllipse(const double* c, + double major_radius, + double minor_radius, + double rotation, + double start_angle, + double end_angle, bool endIsCW) { double m[3]; - m[2]=0; + m[2] = 0; m[0] = major_radius * sin(rotation); m[1] = major_radius * cos(rotation); - double ratio = minor_radius/major_radius; + double ratio = minor_radius / major_radius; - if(!endIsCW){ //end is NOT CW from start + if (!endIsCW) {// end is NOT CW from start double temp = start_angle; start_angle = end_angle; end_angle = temp; } - (*m_ssEntity) << " 0" << endl; - (*m_ssEntity) << "ELLIPSE" << endl; - (*m_ssEntity) << " 5" << endl; + (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << "ELLIPSE" << endl; + (*m_ssEntity) << " 5" << endl; (*m_ssEntity) << getEntityHandle() << endl; if (m_version > 12) { - (*m_ssEntity) << "330" << endl; - (*m_ssEntity) << m_saveModelSpaceHandle << endl; - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbEntity" << endl; + (*m_ssEntity) << "330" << endl; + (*m_ssEntity) << m_saveModelSpaceHandle << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; // Group code for layer name - (*m_ssEntity) << getLayerName() << endl; // Layer number - if (m_version > 12) { - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbEllipse" << endl; + (*m_ssEntity) << " 8" << endl; // Group code for layer name + (*m_ssEntity) << getLayerName() << endl;// Layer number + if (m_version > 12) { + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbEllipse" << endl; } - (*m_ssEntity) << " 10" << endl; // Centre X - (*m_ssEntity) << c[0] << endl; // X in WCS coordinates - (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << c[1] << endl; // Y in WCS coordinates - (*m_ssEntity) << " 30" << endl; - (*m_ssEntity) << c[2] << endl; // Z in WCS coordinates - (*m_ssEntity) << " 11" << endl; // - (*m_ssEntity) << m[0] << endl; // Major X - (*m_ssEntity) << " 21" << endl; - (*m_ssEntity) << m[1] << endl; // Major Y - (*m_ssEntity) << " 31" << endl; - (*m_ssEntity) << m[2] << endl; // Major Z - (*m_ssEntity) << " 40" << endl; // - (*m_ssEntity) << ratio << endl; // Ratio -// (*m_ssEntity) << "210" << endl; //extrusion dir?? -// (*m_ssEntity) << "0" << endl; -// (*m_ssEntity) << "220" << endl; -// (*m_ssEntity) << "0" << endl; -// (*m_ssEntity) << "230" << endl; -// (*m_ssEntity) << "1" << endl; - (*m_ssEntity) << " 41" << endl; - (*m_ssEntity) << start_angle << endl; // Start angle (radians [0..2pi]) - (*m_ssEntity) << " 42" << endl; - (*m_ssEntity) << end_angle << endl; // End angle + (*m_ssEntity) << " 10" << endl;// Centre X + (*m_ssEntity) << c[0] << endl; // X in WCS coordinates + (*m_ssEntity) << " 20" << endl; + (*m_ssEntity) << c[1] << endl;// Y in WCS coordinates + (*m_ssEntity) << " 30" << endl; + (*m_ssEntity) << c[2] << endl; // Z in WCS coordinates + (*m_ssEntity) << " 11" << endl;// + (*m_ssEntity) << m[0] << endl; // Major X + (*m_ssEntity) << " 21" << endl; + (*m_ssEntity) << m[1] << endl;// Major Y + (*m_ssEntity) << " 31" << endl; + (*m_ssEntity) << m[2] << endl; // Major Z + (*m_ssEntity) << " 40" << endl;// + (*m_ssEntity) << ratio << endl;// Ratio + // (*m_ssEntity) << "210" << endl; //extrusion dir?? + // (*m_ssEntity) << "0" << endl; + // (*m_ssEntity) << "220" << endl; + // (*m_ssEntity) << "0" << endl; + // (*m_ssEntity) << "230" << endl; + // (*m_ssEntity) << "1" << endl; + (*m_ssEntity) << " 41" << endl; + (*m_ssEntity) << start_angle << endl;// Start angle (radians [0..2pi]) + (*m_ssEntity) << " 42" << endl; + (*m_ssEntity) << end_angle << endl;// End angle } //*************************** -//writeSpline -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project -void CDxfWrite::writeSpline(const SplineDataOut &sd) +// writeSpline +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +void CDxfWrite::writeSpline(const SplineDataOut& sd) { - (*m_ssEntity) << " 0" << endl; - (*m_ssEntity) << "SPLINE" << endl; - (*m_ssEntity) << " 5" << endl; + (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << "SPLINE" << endl; + (*m_ssEntity) << " 5" << endl; (*m_ssEntity) << getEntityHandle() << endl; if (m_version > 12) { - (*m_ssEntity) << "330" << endl; - (*m_ssEntity) << m_saveModelSpaceHandle << endl; - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbEntity" << endl; + (*m_ssEntity) << "330" << endl; + (*m_ssEntity) << m_saveModelSpaceHandle << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; // Group code for layer name - (*m_ssEntity) << getLayerName() << endl; // Layer name + (*m_ssEntity) << " 8" << endl; // Group code for layer name + (*m_ssEntity) << getLayerName() << endl;// Layer name if (m_version > 12) { - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbSpline" << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbSpline" << endl; } - (*m_ssEntity) << "210" << endl; - (*m_ssEntity) << "0" << endl; - (*m_ssEntity) << "220" << endl; - (*m_ssEntity) << "0" << endl; - (*m_ssEntity) << "230" << endl; - (*m_ssEntity) << "1" << endl; + (*m_ssEntity) << "210" << endl; + (*m_ssEntity) << "0" << endl; + (*m_ssEntity) << "220" << endl; + (*m_ssEntity) << "0" << endl; + (*m_ssEntity) << "230" << endl; + (*m_ssEntity) << "1" << endl; - (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << sd.flag << endl; //flags - (*m_ssEntity) << " 71" << endl; - (*m_ssEntity) << sd.degree << endl; - (*m_ssEntity) << " 72" << endl; - (*m_ssEntity) << sd.knots << endl; - (*m_ssEntity) << " 73" << endl; - (*m_ssEntity) << sd.control_points << endl; - (*m_ssEntity) << " 74" << endl; - (*m_ssEntity) << 0 << endl; + (*m_ssEntity) << " 70" << endl; + (*m_ssEntity) << sd.flag << endl;// flags + (*m_ssEntity) << " 71" << endl; + (*m_ssEntity) << sd.degree << endl; + (*m_ssEntity) << " 72" << endl; + (*m_ssEntity) << sd.knots << endl; + (*m_ssEntity) << " 73" << endl; + (*m_ssEntity) << sd.control_points << endl; + (*m_ssEntity) << " 74" << endl; + (*m_ssEntity) << 0 << endl; -// (*m_ssEntity) << " 12" << endl; -// (*m_ssEntity) << sd.starttan.x << endl; -// (*m_ssEntity) << " 22" << endl; -// (*m_ssEntity) << sd.starttan.y << endl; -// (*m_ssEntity) << " 32" << endl; -// (*m_ssEntity) << sd.starttan.z << endl; -// (*m_ssEntity) << " 13" << endl; -// (*m_ssEntity) << sd.endtan.x << endl; -// (*m_ssEntity) << " 23" << endl; -// (*m_ssEntity) << sd.endtan.y << endl; -// (*m_ssEntity) << " 33" << endl; -// (*m_ssEntity) << sd.endtan.z << endl; + // (*m_ssEntity) << " 12" << endl; + // (*m_ssEntity) << sd.starttan.x << endl; + // (*m_ssEntity) << " 22" << endl; + // (*m_ssEntity) << sd.starttan.y << endl; + // (*m_ssEntity) << " 32" << endl; + // (*m_ssEntity) << sd.starttan.z << endl; + // (*m_ssEntity) << " 13" << endl; + // (*m_ssEntity) << sd.endtan.x << endl; + // (*m_ssEntity) << " 23" << endl; + // (*m_ssEntity) << sd.endtan.y << endl; + // (*m_ssEntity) << " 33" << endl; + // (*m_ssEntity) << sd.endtan.z << endl; for (auto& k : sd.knot) { - (*m_ssEntity) << " 40" << endl; - (*m_ssEntity) << k << endl; + (*m_ssEntity) << " 40" << endl; + (*m_ssEntity) << k << endl; } for (auto& w : sd.weight) { - (*m_ssEntity) << " 41" << endl; - (*m_ssEntity) << w << endl; + (*m_ssEntity) << " 41" << endl; + (*m_ssEntity) << w << endl; } for (auto& c : sd.control) { - (*m_ssEntity) << " 10" << endl; - (*m_ssEntity) << c.x << endl; // X in WCS coordinates - (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << c.y << endl; // Y in WCS coordinates - (*m_ssEntity) << " 30" << endl; - (*m_ssEntity) << c.z << endl; // Z in WCS coordinates + (*m_ssEntity) << " 10" << endl; + (*m_ssEntity) << c.x << endl;// X in WCS coordinates + (*m_ssEntity) << " 20" << endl; + (*m_ssEntity) << c.y << endl;// Y in WCS coordinates + (*m_ssEntity) << " 30" << endl; + (*m_ssEntity) << c.z << endl;// Z in WCS coordinates } for (auto& f : sd.fit) { - (*m_ssEntity) << " 11" << endl; - (*m_ssEntity) << f.x << endl; // X in WCS coordinates - (*m_ssEntity) << " 21" << endl; - (*m_ssEntity) << f.y << endl; // Y in WCS coordinates - (*m_ssEntity) << " 31" << endl; - (*m_ssEntity) << f.z << endl; // Z in WCS coordinates + (*m_ssEntity) << " 11" << endl; + (*m_ssEntity) << f.x << endl;// X in WCS coordinates + (*m_ssEntity) << " 21" << endl; + (*m_ssEntity) << f.y << endl;// Y in WCS coordinates + (*m_ssEntity) << " 31" << endl; + (*m_ssEntity) << f.z << endl;// Z in WCS coordinates } } //*************************** -//writeVertex -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// writeVertex +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::writeVertex(double x, double y, double z) { - (*m_ssEntity) << " 0" << endl; - (*m_ssEntity) << "VERTEX" << endl; - (*m_ssEntity) << " 5" << endl; + (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << "VERTEX" << endl; + (*m_ssEntity) << " 5" << endl; (*m_ssEntity) << getEntityHandle() << endl; if (m_version > 12) { - (*m_ssEntity) << "330" << endl; - (*m_ssEntity) << m_saveModelSpaceHandle << endl; - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbEntity" << endl; + (*m_ssEntity) << "330" << endl; + (*m_ssEntity) << m_saveModelSpaceHandle << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; - (*m_ssEntity) << getLayerName() << endl; + (*m_ssEntity) << " 8" << endl; + (*m_ssEntity) << getLayerName() << endl; if (m_version > 12) { - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbVertex" << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbVertex" << endl; } - (*m_ssEntity) << " 10" << endl; - (*m_ssEntity) << x << endl; - (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << y << endl; - (*m_ssEntity) << " 30" << endl; - (*m_ssEntity) << z << endl; - (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << 0 << endl; + (*m_ssEntity) << " 10" << endl; + (*m_ssEntity) << x << endl; + (*m_ssEntity) << " 20" << endl; + (*m_ssEntity) << y << endl; + (*m_ssEntity) << " 30" << endl; + (*m_ssEntity) << z << endl; + (*m_ssEntity) << " 70" << endl; + (*m_ssEntity) << 0 << endl; } -void CDxfWrite::writeText(const char* text, const double* location1, const double* location2, - const double height, const int horizJust) +void CDxfWrite::writeText(const char* text, + const double* location1, + const double* location2, + const double height, + const int horizJust) { - putText(text, toVector3d(location1), toVector3d(location2), - height, horizJust, - m_ssEntity, getEntityHandle(), m_saveModelSpaceHandle); + putText(text, + toVector3d(location1), + toVector3d(location2), + height, + horizJust, + m_ssEntity, + getEntityHandle(), + m_saveModelSpaceHandle); } //*************************** -//putText -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project -void CDxfWrite::putText(const char* text, const Base::Vector3d location1, const Base::Vector3d location2, - const double height, const int horizJust, - std::ostringstream* outStream, const std::string handle, - const std::string ownerHandle) +// putText +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +void CDxfWrite::putText(const char* text, + const Base::Vector3d location1, + const Base::Vector3d location2, + const double height, + const int horizJust, + std::ostringstream* outStream, + const std::string handle, + const std::string ownerHandle) { - (void) location2; + (void)location2; - (*outStream) << " 0" << endl; - (*outStream) << "TEXT" << endl; - (*outStream) << " 5" << endl; + (*outStream) << " 0" << endl; + (*outStream) << "TEXT" << endl; + (*outStream) << " 5" << endl; (*outStream) << handle << endl; if (m_version > 12) { - (*outStream) << "330" << endl; - (*outStream) << ownerHandle << endl; - (*outStream) << "100" << endl; - (*outStream) << "AcDbEntity" << endl; + (*outStream) << "330" << endl; + (*outStream) << ownerHandle << endl; + (*outStream) << "100" << endl; + (*outStream) << "AcDbEntity" << endl; } - (*outStream) << " 8" << endl; - (*outStream) << getLayerName() << endl; + (*outStream) << " 8" << endl; + (*outStream) << getLayerName() << endl; if (m_version > 12) { - (*outStream) << "100" << endl; - (*outStream) << "AcDbText" << endl; + (*outStream) << "100" << endl; + (*outStream) << "AcDbText" << endl; } -// (*outStream) << " 39" << endl; -// (*outStream) << 0 << endl; //thickness - (*outStream) << " 10" << endl; //first alignment point - (*outStream) << location1.x << endl; - (*outStream) << " 20" << endl; - (*outStream) << location1.y << endl; - (*outStream) << " 30" << endl; - (*outStream) << location1.z << endl; - (*outStream) << " 40" << endl; - (*outStream) << height << endl; - (*outStream) << " 1" << endl; - (*outStream) << text << endl; -// (*outStream) << " 50" << endl; -// (*outStream) << 0 << endl; //rotation -// (*outStream) << " 41" << endl; -// (*outStream) << 1 << endl; -// (*outStream) << " 51" << endl; -// (*outStream) << 0 << endl; + // (*outStream) << " 39" << endl; + // (*outStream) << 0 << endl; //thickness + (*outStream) << " 10" << endl;// first alignment point + (*outStream) << location1.x << endl; + (*outStream) << " 20" << endl; + (*outStream) << location1.y << endl; + (*outStream) << " 30" << endl; + (*outStream) << location1.z << endl; + (*outStream) << " 40" << endl; + (*outStream) << height << endl; + (*outStream) << " 1" << endl; + (*outStream) << text << endl; + // (*outStream) << " 50" << endl; + // (*outStream) << 0 << endl; //rotation + // (*outStream) << " 41" << endl; + // (*outStream) << 1 << endl; + // (*outStream) << " 51" << endl; + // (*outStream) << 0 << endl; - (*outStream) << " 7" << endl; - (*outStream) << "STANDARD" << endl; //style -// (*outStream) << " 71" << endl; //default -// (*outStream) << "0" << endl; - (*outStream) << " 72" << endl; - (*outStream) << horizJust << endl; -//// (*outStream) << " 73" << endl; -//// (*outStream) << "0" << endl; - (*outStream) << " 11" << endl; //second alignment point - (*outStream) << location2.x << endl; - (*outStream) << " 21" << endl; - (*outStream) << location2.y << endl; - (*outStream) << " 31" << endl; - (*outStream) << location2.z << endl; -// (*outStream) << "210" << endl; -// (*outStream) << "0" << endl; -// (*outStream) << "220" << endl; -// (*outStream) << "0" << endl; -// (*outStream) << "230" << endl; -// (*outStream) << "1" << endl; + (*outStream) << " 7" << endl; + (*outStream) << "STANDARD" << endl;// style + // (*outStream) << " 71" << endl; //default + // (*outStream) << "0" << endl; + (*outStream) << " 72" << endl; + (*outStream) << horizJust << endl; + //// (*outStream) << " 73" << endl; + //// (*outStream) << "0" << endl; + (*outStream) << " 11" << endl;// second alignment point + (*outStream) << location2.x << endl; + (*outStream) << " 21" << endl; + (*outStream) << location2.y << endl; + (*outStream) << " 31" << endl; + (*outStream) << location2.z << endl; + // (*outStream) << "210" << endl; + // (*outStream) << "0" << endl; + // (*outStream) << "220" << endl; + // (*outStream) << "0" << endl; + // (*outStream) << "230" << endl; + // (*outStream) << "1" << endl; if (m_version > 12) { - (*outStream) << "100" << endl; - (*outStream) << "AcDbText" << endl; + (*outStream) << "100" << endl; + (*outStream) << "AcDbText" << endl; } - } -void CDxfWrite::putArrow(Base::Vector3d arrowPos, Base::Vector3d barb1Pos, Base::Vector3d barb2Pos, - std::ostringstream* outStream, const std::string handle, +void CDxfWrite::putArrow(Base::Vector3d arrowPos, + Base::Vector3d barb1Pos, + Base::Vector3d barb2Pos, + std::ostringstream* outStream, + const std::string handle, const std::string ownerHandle) { - (*outStream) << " 0" << endl; - (*outStream) << "SOLID" << endl; - (*outStream) << " 5" << endl; - (*outStream) << handle << endl; + (*outStream) << " 0" << endl; + (*outStream) << "SOLID" << endl; + (*outStream) << " 5" << endl; + (*outStream) << handle << endl; if (m_version > 12) { - (*outStream) << "330" << endl; + (*outStream) << "330" << endl; (*outStream) << ownerHandle << endl; - (*outStream) << "100" << endl; - (*outStream) << "AcDbEntity" << endl; + (*outStream) << "100" << endl; + (*outStream) << "AcDbEntity" << endl; } - (*outStream) << " 8" << endl; - (*outStream) << "0" << endl; - (*outStream) << " 62" << endl; - (*outStream) << " 0" << endl; + (*outStream) << " 8" << endl; + (*outStream) << "0" << endl; + (*outStream) << " 62" << endl; + (*outStream) << " 0" << endl; if (m_version > 12) { - (*outStream) << "100" << endl; + (*outStream) << "100" << endl; (*outStream) << "AcDbTrace" << endl; } - (*outStream) << " 10" << endl; - (*outStream) << barb1Pos.x << endl; - (*outStream) << " 20" << endl; - (*outStream) << barb1Pos.y << endl; - (*outStream) << " 30" << endl; - (*outStream) << barb1Pos.z << endl; - (*outStream) << " 11" << endl; - (*outStream) << barb2Pos.x << endl; - (*outStream) << " 21" << endl; - (*outStream) << barb2Pos.y << endl; - (*outStream) << " 31" << endl; - (*outStream) << barb2Pos.z << endl; - (*outStream) << " 12" << endl; - (*outStream) << arrowPos.x << endl; - (*outStream) << " 22" << endl; - (*outStream) << arrowPos.y << endl; - (*outStream) << " 32" << endl; - (*outStream) << arrowPos.z << endl; - (*outStream) << " 13" << endl; - (*outStream) << arrowPos.x << endl; - (*outStream) << " 23" << endl; - (*outStream) << arrowPos.y << endl; - (*outStream) << " 33" << endl; - (*outStream) << arrowPos.z << endl; + (*outStream) << " 10" << endl; + (*outStream) << barb1Pos.x << endl; + (*outStream) << " 20" << endl; + (*outStream) << barb1Pos.y << endl; + (*outStream) << " 30" << endl; + (*outStream) << barb1Pos.z << endl; + (*outStream) << " 11" << endl; + (*outStream) << barb2Pos.x << endl; + (*outStream) << " 21" << endl; + (*outStream) << barb2Pos.y << endl; + (*outStream) << " 31" << endl; + (*outStream) << barb2Pos.z << endl; + (*outStream) << " 12" << endl; + (*outStream) << arrowPos.x << endl; + (*outStream) << " 22" << endl; + (*outStream) << arrowPos.y << endl; + (*outStream) << " 32" << endl; + (*outStream) << arrowPos.z << endl; + (*outStream) << " 13" << endl; + (*outStream) << arrowPos.x << endl; + (*outStream) << " 23" << endl; + (*outStream) << arrowPos.y << endl; + (*outStream) << " 33" << endl; + (*outStream) << arrowPos.z << endl; } //*************************** -//writeLinearDim -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// writeLinearDim +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project #define ALIGNED 0 #define HORIZONTAL 1 #define VERTICAL 2 -void CDxfWrite::writeLinearDim(const double* textMidPoint, const double* lineDefPoint, - const double* extLine1, const double* extLine2, - const char* dimText, int type) +void CDxfWrite::writeLinearDim(const double* textMidPoint, + const double* lineDefPoint, + const double* extLine1, + const double* extLine2, + const char* dimText, + int type) { - (*m_ssEntity) << " 0" << endl; - (*m_ssEntity) << "DIMENSION" << endl; - (*m_ssEntity) << " 5" << endl; + (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << "DIMENSION" << endl; + (*m_ssEntity) << " 5" << endl; (*m_ssEntity) << getEntityHandle() << endl; if (m_version > 12) { - (*m_ssEntity) << "330" << endl; - (*m_ssEntity) << m_saveModelSpaceHandle << endl; - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbEntity" << endl; + (*m_ssEntity) << "330" << endl; + (*m_ssEntity) << m_saveModelSpaceHandle << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; - (*m_ssEntity) << getLayerName() << endl; + (*m_ssEntity) << " 8" << endl; + (*m_ssEntity) << getLayerName() << endl; if (m_version > 12) { - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbDimension" << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbDimension" << endl; } - (*m_ssEntity) << " 2" << endl; - (*m_ssEntity) << "*" << getLayerName() << endl; // blockName - (*m_ssEntity) << " 10" << endl; //dimension line definition point - (*m_ssEntity) << lineDefPoint[0] << endl; - (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << lineDefPoint[1] << endl; - (*m_ssEntity) << " 30" << endl; - (*m_ssEntity) << lineDefPoint[2] << endl; - (*m_ssEntity) << " 11" << endl; //text mid point - (*m_ssEntity) << textMidPoint[0] << endl; - (*m_ssEntity) << " 21" << endl; - (*m_ssEntity) << textMidPoint[1] << endl; - (*m_ssEntity) << " 31" << endl; - (*m_ssEntity) << textMidPoint[2] << endl; + (*m_ssEntity) << " 2" << endl; + (*m_ssEntity) << "*" << getLayerName() << endl;// blockName + (*m_ssEntity) << " 10" << endl; // dimension line definition point + (*m_ssEntity) << lineDefPoint[0] << endl; + (*m_ssEntity) << " 20" << endl; + (*m_ssEntity) << lineDefPoint[1] << endl; + (*m_ssEntity) << " 30" << endl; + (*m_ssEntity) << lineDefPoint[2] << endl; + (*m_ssEntity) << " 11" << endl;// text mid point + (*m_ssEntity) << textMidPoint[0] << endl; + (*m_ssEntity) << " 21" << endl; + (*m_ssEntity) << textMidPoint[1] << endl; + (*m_ssEntity) << " 31" << endl; + (*m_ssEntity) << textMidPoint[2] << endl; if (type == ALIGNED) { - (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << 1 << endl; // dimType1 = Aligned + (*m_ssEntity) << " 70" << endl; + (*m_ssEntity) << 1 << endl;// dimType1 = Aligned } - if ( (type == HORIZONTAL) || - (type == VERTICAL) ) { - (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << 32 << endl; // dimType0 = Aligned + 32 (bit for unique block)? + if ((type == HORIZONTAL) || (type == VERTICAL)) { + (*m_ssEntity) << " 70" << endl; + (*m_ssEntity) << 32 << endl;// dimType0 = Aligned + 32 (bit for unique block)? } -// (*m_ssEntity) << " 71" << endl; // not R12 -// (*m_ssEntity) << 1 << endl; // attachPoint ??1 = topleft - (*m_ssEntity) << " 1" << endl; - (*m_ssEntity) << dimText << endl; - (*m_ssEntity) << " 3" << endl; - (*m_ssEntity) << "STANDARD" << endl; //style -//linear dims + // (*m_ssEntity) << " 71" << endl; // not R12 + // (*m_ssEntity) << 1 << endl; // attachPoint ??1 = topleft + (*m_ssEntity) << " 1" << endl; + (*m_ssEntity) << dimText << endl; + (*m_ssEntity) << " 3" << endl; + (*m_ssEntity) << "STANDARD" << endl;// style + // linear dims if (m_version > 12) { - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbAlignedDimension" << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbAlignedDimension" << endl; } - (*m_ssEntity) << " 13" << endl; - (*m_ssEntity) << extLine1[0] << endl; - (*m_ssEntity) << " 23" << endl; - (*m_ssEntity) << extLine1[1] << endl; - (*m_ssEntity) << " 33" << endl; - (*m_ssEntity) << extLine1[2] << endl; - (*m_ssEntity) << " 14" << endl; - (*m_ssEntity) << extLine2[0] << endl; - (*m_ssEntity) << " 24" << endl; - (*m_ssEntity) << extLine2[1] << endl; - (*m_ssEntity) << " 34" << endl; - (*m_ssEntity) << extLine2[2] << endl; + (*m_ssEntity) << " 13" << endl; + (*m_ssEntity) << extLine1[0] << endl; + (*m_ssEntity) << " 23" << endl; + (*m_ssEntity) << extLine1[1] << endl; + (*m_ssEntity) << " 33" << endl; + (*m_ssEntity) << extLine1[2] << endl; + (*m_ssEntity) << " 14" << endl; + (*m_ssEntity) << extLine2[0] << endl; + (*m_ssEntity) << " 24" << endl; + (*m_ssEntity) << extLine2[1] << endl; + (*m_ssEntity) << " 34" << endl; + (*m_ssEntity) << extLine2[2] << endl; if (m_version > 12) { if (type == VERTICAL) { - (*m_ssEntity) << " 50" << endl; - (*m_ssEntity) << "90" << endl; + (*m_ssEntity) << " 50" << endl; + (*m_ssEntity) << "90" << endl; } - if ( (type == HORIZONTAL) || - (type == VERTICAL) ) { - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbRotatedDimension" << endl; + if ((type == HORIZONTAL) || (type == VERTICAL)) { + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbRotatedDimension" << endl; } } writeDimBlockPreamble(); - writeLinearDimBlock(textMidPoint,lineDefPoint, - extLine1, extLine2, - dimText, type); + writeLinearDimBlock(textMidPoint, lineDefPoint, extLine1, extLine2, dimText, type); writeBlockTrailer(); } //*************************** -//writeAngularDim -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project -void CDxfWrite::writeAngularDim(const double* textMidPoint, const double* lineDefPoint, - const double* startExt1, const double* endExt1, - const double* startExt2, const double* endExt2, - const char* dimText) +// writeAngularDim +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +void CDxfWrite::writeAngularDim(const double* textMidPoint, + const double* lineDefPoint, + const double* startExt1, + const double* endExt1, + const double* startExt2, + const double* endExt2, + const char* dimText) { - (*m_ssEntity) << " 0" << endl; - (*m_ssEntity) << "DIMENSION" << endl; - (*m_ssEntity) << " 5" << endl; + (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << "DIMENSION" << endl; + (*m_ssEntity) << " 5" << endl; (*m_ssEntity) << getEntityHandle() << endl; if (m_version > 12) { - (*m_ssEntity) << "330" << endl; - (*m_ssEntity) << m_saveModelSpaceHandle << endl; - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbEntity" << endl; + (*m_ssEntity) << "330" << endl; + (*m_ssEntity) << m_saveModelSpaceHandle << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; - (*m_ssEntity) << getLayerName() << endl; + (*m_ssEntity) << " 8" << endl; + (*m_ssEntity) << getLayerName() << endl; if (m_version > 12) { - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbDimension" << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbDimension" << endl; } - (*m_ssEntity) << " 2" << endl; - (*m_ssEntity) << "*" << getLayerName() << endl; // blockName + (*m_ssEntity) << " 2" << endl; + (*m_ssEntity) << "*" << getLayerName() << endl;// blockName - (*m_ssEntity) << " 10" << endl; - (*m_ssEntity) << endExt2[0] << endl; - (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << endExt2[1] << endl; - (*m_ssEntity) << " 30" << endl; - (*m_ssEntity) << endExt2[2] << endl; + (*m_ssEntity) << " 10" << endl; + (*m_ssEntity) << endExt2[0] << endl; + (*m_ssEntity) << " 20" << endl; + (*m_ssEntity) << endExt2[1] << endl; + (*m_ssEntity) << " 30" << endl; + (*m_ssEntity) << endExt2[2] << endl; - (*m_ssEntity) << " 11" << endl; - (*m_ssEntity) << textMidPoint[0] << endl; - (*m_ssEntity) << " 21" << endl; - (*m_ssEntity) << textMidPoint[1] << endl; - (*m_ssEntity) << " 31" << endl; - (*m_ssEntity) << textMidPoint[2] << endl; + (*m_ssEntity) << " 11" << endl; + (*m_ssEntity) << textMidPoint[0] << endl; + (*m_ssEntity) << " 21" << endl; + (*m_ssEntity) << textMidPoint[1] << endl; + (*m_ssEntity) << " 31" << endl; + (*m_ssEntity) << textMidPoint[2] << endl; - (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << 2 << endl; // dimType 2 = Angular 5 = Angular 3 point - // +32 for block?? (not R12) -// (*m_ssEntity) << " 71" << endl; // not R12? not required? -// (*m_ssEntity) << 5 << endl; // attachPoint 5 = middle - (*m_ssEntity) << " 1" << endl; - (*m_ssEntity) << dimText << endl; - (*m_ssEntity) << " 3" << endl; - (*m_ssEntity) << "STANDARD" << endl; //style -//angular dims + (*m_ssEntity) << " 70" << endl; + (*m_ssEntity) << 2 << endl;// dimType 2 = Angular 5 = Angular 3 point + // +32 for block?? (not R12) + // (*m_ssEntity) << " 71" << endl; // not R12? not required? + // (*m_ssEntity) << 5 << endl; // attachPoint 5 = middle + (*m_ssEntity) << " 1" << endl; + (*m_ssEntity) << dimText << endl; + (*m_ssEntity) << " 3" << endl; + (*m_ssEntity) << "STANDARD" << endl;// style + // angular dims if (m_version > 12) { - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDb2LineAngularDimension" << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDb2LineAngularDimension" << endl; } - (*m_ssEntity) << " 13" << endl; - (*m_ssEntity) << startExt1[0] << endl; - (*m_ssEntity) << " 23" << endl; - (*m_ssEntity) << startExt1[1] << endl; - (*m_ssEntity) << " 33" << endl; - (*m_ssEntity) << startExt1[2] << endl; + (*m_ssEntity) << " 13" << endl; + (*m_ssEntity) << startExt1[0] << endl; + (*m_ssEntity) << " 23" << endl; + (*m_ssEntity) << startExt1[1] << endl; + (*m_ssEntity) << " 33" << endl; + (*m_ssEntity) << startExt1[2] << endl; - (*m_ssEntity) << " 14" << endl; - (*m_ssEntity) << endExt1[0] << endl; - (*m_ssEntity) << " 24" << endl; - (*m_ssEntity) << endExt1[1] << endl; - (*m_ssEntity) << " 34" << endl; - (*m_ssEntity) << endExt1[2] << endl; + (*m_ssEntity) << " 14" << endl; + (*m_ssEntity) << endExt1[0] << endl; + (*m_ssEntity) << " 24" << endl; + (*m_ssEntity) << endExt1[1] << endl; + (*m_ssEntity) << " 34" << endl; + (*m_ssEntity) << endExt1[2] << endl; - (*m_ssEntity) << " 15" << endl; - (*m_ssEntity) << startExt2[0] << endl; - (*m_ssEntity) << " 25" << endl; - (*m_ssEntity) << startExt2[1] << endl; - (*m_ssEntity) << " 35" << endl; - (*m_ssEntity) << startExt2[2] << endl; + (*m_ssEntity) << " 15" << endl; + (*m_ssEntity) << startExt2[0] << endl; + (*m_ssEntity) << " 25" << endl; + (*m_ssEntity) << startExt2[1] << endl; + (*m_ssEntity) << " 35" << endl; + (*m_ssEntity) << startExt2[2] << endl; - (*m_ssEntity) << " 16" << endl; + (*m_ssEntity) << " 16" << endl; (*m_ssEntity) << lineDefPoint[0] << endl; - (*m_ssEntity) << " 26" << endl; + (*m_ssEntity) << " 26" << endl; (*m_ssEntity) << lineDefPoint[1] << endl; - (*m_ssEntity) << " 36" << endl; + (*m_ssEntity) << " 36" << endl; (*m_ssEntity) << lineDefPoint[2] << endl; writeDimBlockPreamble(); - writeAngularDimBlock(textMidPoint, lineDefPoint, - startExt1, endExt1, - startExt2, endExt2, + writeAngularDimBlock(textMidPoint, + lineDefPoint, + startExt1, + endExt1, + startExt2, + endExt2, dimText); writeBlockTrailer(); } //*************************** -//writeRadialDim -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project -void CDxfWrite::writeRadialDim(const double* centerPoint, const double* textMidPoint, - const double* arcPoint, - const char* dimText) +// writeRadialDim +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +void CDxfWrite::writeRadialDim(const double* centerPoint, + const double* textMidPoint, + const double* arcPoint, + const char* dimText) { - (*m_ssEntity) << " 0" << endl; - (*m_ssEntity) << "DIMENSION" << endl; - (*m_ssEntity) << " 5" << endl; + (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << "DIMENSION" << endl; + (*m_ssEntity) << " 5" << endl; (*m_ssEntity) << getEntityHandle() << endl; if (m_version > 12) { - (*m_ssEntity) << "330" << endl; - (*m_ssEntity) << m_saveModelSpaceHandle << endl; - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbEntity" << endl; + (*m_ssEntity) << "330" << endl; + (*m_ssEntity) << m_saveModelSpaceHandle << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; - (*m_ssEntity) << getLayerName() << endl; + (*m_ssEntity) << " 8" << endl; + (*m_ssEntity) << getLayerName() << endl; if (m_version > 12) { - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbDimension" << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbDimension" << endl; } - (*m_ssEntity) << " 2" << endl; - (*m_ssEntity) << "*" << getLayerName() << endl; // blockName - (*m_ssEntity) << " 10" << endl; // arc center point + (*m_ssEntity) << " 2" << endl; + (*m_ssEntity) << "*" << getLayerName() << endl;// blockName + (*m_ssEntity) << " 10" << endl; // arc center point (*m_ssEntity) << centerPoint[0] << endl; - (*m_ssEntity) << " 20" << endl; + (*m_ssEntity) << " 20" << endl; (*m_ssEntity) << centerPoint[1] << endl; - (*m_ssEntity) << " 30" << endl; + (*m_ssEntity) << " 30" << endl; (*m_ssEntity) << centerPoint[2] << endl; - (*m_ssEntity) << " 11" << endl; //text mid point - (*m_ssEntity) << textMidPoint[0] << endl; - (*m_ssEntity) << " 21" << endl; - (*m_ssEntity) << textMidPoint[1] << endl; - (*m_ssEntity) << " 31" << endl; - (*m_ssEntity) << textMidPoint[2] << endl; - (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << 4 << endl; // dimType 4 = Radius -// (*m_ssEntity) << " 71" << endl; // not R12 -// (*m_ssEntity) << 1 << endl; // attachPoint 5 = middle center - (*m_ssEntity) << " 1" << endl; - (*m_ssEntity) << dimText << endl; - (*m_ssEntity) << " 3" << endl; - (*m_ssEntity) << "STANDARD" << endl; //style -//radial dims + (*m_ssEntity) << " 11" << endl;// text mid point + (*m_ssEntity) << textMidPoint[0] << endl; + (*m_ssEntity) << " 21" << endl; + (*m_ssEntity) << textMidPoint[1] << endl; + (*m_ssEntity) << " 31" << endl; + (*m_ssEntity) << textMidPoint[2] << endl; + (*m_ssEntity) << " 70" << endl; + (*m_ssEntity) << 4 << endl;// dimType 4 = Radius + // (*m_ssEntity) << " 71" << endl; // not R12 + // (*m_ssEntity) << 1 << endl; // attachPoint 5 = middle center + (*m_ssEntity) << " 1" << endl; + (*m_ssEntity) << dimText << endl; + (*m_ssEntity) << " 3" << endl; + (*m_ssEntity) << "STANDARD" << endl;// style + // radial dims if (m_version > 12) { - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbRadialDimension" << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbRadialDimension" << endl; } - (*m_ssEntity) << " 15" << endl; - (*m_ssEntity) << arcPoint[0] << endl; - (*m_ssEntity) << " 25" << endl; - (*m_ssEntity) << arcPoint[1] << endl; - (*m_ssEntity) << " 35" << endl; - (*m_ssEntity) << arcPoint[2] << endl; - (*m_ssEntity) << " 40" << endl; // leader length???? - (*m_ssEntity) << 0 << endl; + (*m_ssEntity) << " 15" << endl; + (*m_ssEntity) << arcPoint[0] << endl; + (*m_ssEntity) << " 25" << endl; + (*m_ssEntity) << arcPoint[1] << endl; + (*m_ssEntity) << " 35" << endl; + (*m_ssEntity) << arcPoint[2] << endl; + (*m_ssEntity) << " 40" << endl;// leader length???? + (*m_ssEntity) << 0 << endl; writeDimBlockPreamble(); writeRadialDimBlock(centerPoint, textMidPoint, arcPoint, dimText); @@ -1312,63 +1336,64 @@ void CDxfWrite::writeRadialDim(const double* centerPoint, const double* textMidP } //*************************** -//writeDiametricDim -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// writeDiametricDim +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::writeDiametricDim(const double* textMidPoint, - const double* arcPoint1, const double* arcPoint2, - const char* dimText) + const double* arcPoint1, + const double* arcPoint2, + const char* dimText) { - (*m_ssEntity) << " 0" << endl; - (*m_ssEntity) << "DIMENSION" << endl; - (*m_ssEntity) << " 5" << endl; + (*m_ssEntity) << " 0" << endl; + (*m_ssEntity) << "DIMENSION" << endl; + (*m_ssEntity) << " 5" << endl; (*m_ssEntity) << getEntityHandle() << endl; if (m_version > 12) { - (*m_ssEntity) << "330" << endl; - (*m_ssEntity) << m_saveModelSpaceHandle << endl; - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbEntity" << endl; + (*m_ssEntity) << "330" << endl; + (*m_ssEntity) << m_saveModelSpaceHandle << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbEntity" << endl; } - (*m_ssEntity) << " 8" << endl; - (*m_ssEntity) << getLayerName() << endl; + (*m_ssEntity) << " 8" << endl; + (*m_ssEntity) << getLayerName() << endl; if (m_version > 12) { - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbDimension" << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbDimension" << endl; } - (*m_ssEntity) << " 2" << endl; - (*m_ssEntity) << "*" << getLayerName() << endl; // blockName - (*m_ssEntity) << " 10" << endl; - (*m_ssEntity) << arcPoint1[0] << endl; - (*m_ssEntity) << " 20" << endl; - (*m_ssEntity) << arcPoint1[1] << endl; - (*m_ssEntity) << " 30" << endl; - (*m_ssEntity) << arcPoint1[2] << endl; - (*m_ssEntity) << " 11" << endl; //text mid point - (*m_ssEntity) << textMidPoint[0] << endl; - (*m_ssEntity) << " 21" << endl; - (*m_ssEntity) << textMidPoint[1] << endl; - (*m_ssEntity) << " 31" << endl; - (*m_ssEntity) << textMidPoint[2] << endl; - (*m_ssEntity) << " 70" << endl; - (*m_ssEntity) << 3 << endl; // dimType 3 = Diameter -// (*m_ssEntity) << " 71" << endl; // not R12 -// (*m_ssEntity) << 5 << endl; // attachPoint 5 = middle center - (*m_ssEntity) << " 1" << endl; - (*m_ssEntity) << dimText << endl; - (*m_ssEntity) << " 3" << endl; - (*m_ssEntity) << "STANDARD" << endl; //style -//diametric dims + (*m_ssEntity) << " 2" << endl; + (*m_ssEntity) << "*" << getLayerName() << endl;// blockName + (*m_ssEntity) << " 10" << endl; + (*m_ssEntity) << arcPoint1[0] << endl; + (*m_ssEntity) << " 20" << endl; + (*m_ssEntity) << arcPoint1[1] << endl; + (*m_ssEntity) << " 30" << endl; + (*m_ssEntity) << arcPoint1[2] << endl; + (*m_ssEntity) << " 11" << endl;// text mid point + (*m_ssEntity) << textMidPoint[0] << endl; + (*m_ssEntity) << " 21" << endl; + (*m_ssEntity) << textMidPoint[1] << endl; + (*m_ssEntity) << " 31" << endl; + (*m_ssEntity) << textMidPoint[2] << endl; + (*m_ssEntity) << " 70" << endl; + (*m_ssEntity) << 3 << endl;// dimType 3 = Diameter + // (*m_ssEntity) << " 71" << endl; // not R12 + // (*m_ssEntity) << 5 << endl; // attachPoint 5 = middle center + (*m_ssEntity) << " 1" << endl; + (*m_ssEntity) << dimText << endl; + (*m_ssEntity) << " 3" << endl; + (*m_ssEntity) << "STANDARD" << endl;// style + // diametric dims if (m_version > 12) { - (*m_ssEntity) << "100" << endl; - (*m_ssEntity) << "AcDbDiametricDimension" << endl; + (*m_ssEntity) << "100" << endl; + (*m_ssEntity) << "AcDbDiametricDimension" << endl; } - (*m_ssEntity) << " 15" << endl; - (*m_ssEntity) << arcPoint2[0] << endl; - (*m_ssEntity) << " 25" << endl; - (*m_ssEntity) << arcPoint2[1] << endl; - (*m_ssEntity) << " 35" << endl; - (*m_ssEntity) << arcPoint2[2] << endl; - (*m_ssEntity) << " 40" << endl; // leader length???? - (*m_ssEntity) << 0 << endl; + (*m_ssEntity) << " 15" << endl; + (*m_ssEntity) << arcPoint2[0] << endl; + (*m_ssEntity) << " 25" << endl; + (*m_ssEntity) << arcPoint2[1] << endl; + (*m_ssEntity) << " 35" << endl; + (*m_ssEntity) << arcPoint2[2] << endl; + (*m_ssEntity) << " 40" << endl;// leader length???? + (*m_ssEntity) << 0 << endl; writeDimBlockPreamble(); writeDiametricDimBlock(textMidPoint, arcPoint1, arcPoint2, dimText); @@ -1376,110 +1401,115 @@ void CDxfWrite::writeDiametricDim(const double* textMidPoint, } //*************************** -//writeDimBlockPreamble -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// writeDimBlockPreamble +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::writeDimBlockPreamble() { if (m_version > 12) { std::string blockName("*"); blockName += getLayerName(); m_saveBlkRecordHandle = getBlkRecordHandle(); - addBlockName(blockName,m_saveBlkRecordHandle); + addBlockName(blockName, m_saveBlkRecordHandle); } m_currentBlock = getBlockHandle(); - (*m_ssBlock) << " 0" << endl; - (*m_ssBlock) << "BLOCK" << endl; - (*m_ssBlock) << " 5" << endl; + (*m_ssBlock) << " 0" << endl; + (*m_ssBlock) << "BLOCK" << endl; + (*m_ssBlock) << " 5" << endl; (*m_ssBlock) << m_currentBlock << endl; if (m_version > 12) { - (*m_ssBlock) << "330" << endl; + (*m_ssBlock) << "330" << endl; (*m_ssBlock) << m_saveBlkRecordHandle << endl; - (*m_ssBlock) << "100" << endl; - (*m_ssBlock) << "AcDbEntity" << endl; + (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "AcDbEntity" << endl; } - (*m_ssBlock) << " 8" << endl; + (*m_ssBlock) << " 8" << endl; (*m_ssBlock) << getLayerName() << endl; if (m_version > 12) { - (*m_ssBlock) << "100" << endl; - (*m_ssBlock) << "AcDbBlockBegin" << endl; + (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "AcDbBlockBegin" << endl; } - (*m_ssBlock) << " 2" << endl; - (*m_ssBlock) << "*" << getLayerName() << endl; // blockName - (*m_ssBlock) << " 70" << endl; - (*m_ssBlock) << " 1" << endl; - (*m_ssBlock) << " 10" << endl; - (*m_ssBlock) << 0.0 << endl; - (*m_ssBlock) << " 20" << endl; - (*m_ssBlock) << 0.0 << endl; - (*m_ssBlock) << " 30" << endl; - (*m_ssBlock) << 0.0 << endl; - (*m_ssBlock) << " 3" << endl; - (*m_ssBlock) << "*" << getLayerName() << endl; // blockName - (*m_ssBlock) << " 1" << endl; - (*m_ssBlock) << " " << endl; + (*m_ssBlock) << " 2" << endl; + (*m_ssBlock) << "*" << getLayerName() << endl;// blockName + (*m_ssBlock) << " 70" << endl; + (*m_ssBlock) << " 1" << endl; + (*m_ssBlock) << " 10" << endl; + (*m_ssBlock) << 0.0 << endl; + (*m_ssBlock) << " 20" << endl; + (*m_ssBlock) << 0.0 << endl; + (*m_ssBlock) << " 30" << endl; + (*m_ssBlock) << 0.0 << endl; + (*m_ssBlock) << " 3" << endl; + (*m_ssBlock) << "*" << getLayerName() << endl;// blockName + (*m_ssBlock) << " 1" << endl; + (*m_ssBlock) << " " << endl; } //*************************** -//writeBlockTrailer -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// writeBlockTrailer +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::writeBlockTrailer() { - (*m_ssBlock) << " 0" << endl; + (*m_ssBlock) << " 0" << endl; (*m_ssBlock) << "ENDBLK" << endl; - (*m_ssBlock) << " 5" << endl; + (*m_ssBlock) << " 5" << endl; (*m_ssBlock) << getBlockHandle() << endl; if (m_version > 12) { - (*m_ssBlock) << "330" << endl; - (*m_ssBlock) << m_saveBlkRecordHandle << endl; - (*m_ssBlock) << "100" << endl; - (*m_ssBlock) << "AcDbEntity" << endl; + (*m_ssBlock) << "330" << endl; + (*m_ssBlock) << m_saveBlkRecordHandle << endl; + (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "AcDbEntity" << endl; } -// (*m_ssBlock) << " 67" << endl; -// (*m_ssBlock) << "1" << endl; - (*m_ssBlock) << " 8" << endl; + // (*m_ssBlock) << " 67" << endl; + // (*m_ssBlock) << "1" << endl; + (*m_ssBlock) << " 8" << endl; (*m_ssBlock) << getLayerName() << endl; if (m_version > 12) { - (*m_ssBlock) << "100" << endl; - (*m_ssBlock) << "AcDbBlockEnd" << endl; + (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "AcDbBlockEnd" << endl; } } //*************************** -//writeLinearDimBlock -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project -void CDxfWrite::writeLinearDimBlock(const double* textMidPoint, const double* dimLine, - const double* e1Start, const double* e2Start, - const char* dimText, int type) +// writeLinearDimBlock +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +void CDxfWrite::writeLinearDimBlock(const double* textMidPoint, + const double* dimLine, + const double* e1Start, + const double* e2Start, + const char* dimText, + int type) { - Base::Vector3d e1S(e1Start[0],e1Start[1],e1Start[2]); - Base::Vector3d e2S(e2Start[0],e2Start[1],e2Start[2]); - Base::Vector3d dl(dimLine[0],dimLine[1],dimLine[2]); //point on DimLine (somewhere!) - Base::Vector3d perp = dl.DistanceToLineSegment(e2S,e1S); + Base::Vector3d e1S(e1Start[0], e1Start[1], e1Start[2]); + Base::Vector3d e2S(e2Start[0], e2Start[1], e2Start[2]); + Base::Vector3d dl(dimLine[0], dimLine[1], dimLine[2]);// point on DimLine (somewhere!) + Base::Vector3d perp = dl.DistanceToLineSegment(e2S, e1S); Base::Vector3d e1E = e1S - perp; Base::Vector3d e2E = e2S - perp; Base::Vector3d para = e1E - e2E; - Base::Vector3d X(1.0,0.0,0.0); + Base::Vector3d X(1.0, 0.0, 0.0); double angle = para.GetAngle(X); angle = angle * 180.0 / M_PI; if (type == ALIGNED) { - //NOP - } else if (type == HORIZONTAL) { + // NOP + } + else if (type == HORIZONTAL) { double x = e1Start[0]; double y = dimLine[1]; e1E = Base::Vector3d(x, y, 0.0); x = e2Start[0]; e2E = Base::Vector3d(x, y, 0.0); - perp = Base::Vector3d(0, -1, 0); //down - para = Base::Vector3d(1, 0, 0); //right + perp = Base::Vector3d(0, -1, 0);// down + para = Base::Vector3d(1, 0, 0); // right if (dimLine[1] > e1Start[1]) { - perp = Base::Vector3d(0, 1, 0); //up + perp = Base::Vector3d(0, 1, 0);// up } if (e1Start[0] > e2Start[0]) { - para = Base::Vector3d(-1, 0, 0); //left + para = Base::Vector3d(-1, 0, 0);// left } angle = 0; - } else if (type == VERTICAL) { + } + else if (type == VERTICAL) { double x = dimLine[0]; double y = e1Start[1]; e1E = Base::Vector3d(x, y, 0.0); @@ -1496,206 +1526,226 @@ void CDxfWrite::writeLinearDimBlock(const double* textMidPoint, const double* di angle = 90; } - double arrowLen = 5.0; //magic number - double arrowWidth = arrowLen/6.0/2.0; //magic number calc! + double arrowLen = 5.0; // magic number + double arrowWidth = arrowLen / 6.0 / 2.0;// magic number calc! - putLine(e2S, e2E, - m_ssBlock, getBlockHandle(), + putLine(e2S, e2E, m_ssBlock, getBlockHandle(), m_saveBlkRecordHandle); + + putLine(e1S, e1E, m_ssBlock, getBlockHandle(), m_saveBlkRecordHandle); + + putLine(e1E, e2E, m_ssBlock, getBlockHandle(), m_saveBlkRecordHandle); + + putText(dimText, + toVector3d(textMidPoint), + toVector3d(dimLine), + 3.5, + 1, + m_ssBlock, + getBlockHandle(), m_saveBlkRecordHandle); - putLine(e1S, e1E, - m_ssBlock, getBlockHandle(), - m_saveBlkRecordHandle); - - putLine(e1E, e2E, - m_ssBlock, getBlockHandle(), - m_saveBlkRecordHandle); - - putText(dimText,toVector3d(textMidPoint), toVector3d(dimLine),3.5,1, - m_ssBlock,getBlockHandle(),m_saveBlkRecordHandle); - perp.Normalize(); para.Normalize(); Base::Vector3d arrowStart = e1E; - Base::Vector3d barb1 = arrowStart + perp*arrowWidth - para*arrowLen; - Base::Vector3d barb2 = arrowStart - perp*arrowWidth - para*arrowLen; - putArrow(arrowStart, barb1, barb2, - m_ssBlock,getBlockHandle(),m_saveBlkRecordHandle); + Base::Vector3d barb1 = arrowStart + perp * arrowWidth - para * arrowLen; + Base::Vector3d barb2 = arrowStart - perp * arrowWidth - para * arrowLen; + putArrow(arrowStart, barb1, barb2, m_ssBlock, getBlockHandle(), m_saveBlkRecordHandle); arrowStart = e2E; - barb1 = arrowStart + perp*arrowWidth + para*arrowLen; - barb2 = arrowStart - perp*arrowWidth + para*arrowLen; - putArrow(arrowStart, barb1, barb2, - m_ssBlock,getBlockHandle(),m_saveBlkRecordHandle); + barb1 = arrowStart + perp * arrowWidth + para * arrowLen; + barb2 = arrowStart - perp * arrowWidth + para * arrowLen; + putArrow(arrowStart, barb1, barb2, m_ssBlock, getBlockHandle(), m_saveBlkRecordHandle); } //*************************** -//writeAngularDimBlock -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project -void CDxfWrite::writeAngularDimBlock(const double* textMidPoint, const double* lineDefPoint, - const double* startExt1, const double* endExt1, - const double* startExt2, const double* endExt2, - const char* dimText) +// writeAngularDimBlock +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +void CDxfWrite::writeAngularDimBlock(const double* textMidPoint, + const double* lineDefPoint, + const double* startExt1, + const double* endExt1, + const double* startExt2, + const double* endExt2, + const char* dimText) { - Base::Vector3d e1S(startExt1[0],startExt1[1],startExt1[2]); //apex - Base::Vector3d e2S(startExt2[0],startExt2[1],startExt2[2]); - Base::Vector3d e1E(endExt1[0],endExt1[1],endExt1[2]); - Base::Vector3d e2E(endExt2[0],endExt2[1],endExt2[2]); + Base::Vector3d e1S(startExt1[0], startExt1[1], startExt1[2]);// apex + Base::Vector3d e2S(startExt2[0], startExt2[1], startExt2[2]); + Base::Vector3d e1E(endExt1[0], endExt1[1], endExt1[2]); + Base::Vector3d e2E(endExt2[0], endExt2[1], endExt2[2]); Base::Vector3d e1 = e1E - e1S; Base::Vector3d e2 = e2E - e2S; - double startAngle = atan2(e2.y,e2.x); - double endAngle = atan2(e1.y,e1.x); + double startAngle = atan2(e2.y, e2.x); + double endAngle = atan2(e1.y, e1.x); double span = fabs(endAngle - startAngle); double offset = span * 0.10; if (startAngle < 0) { - startAngle += 2.0 * M_PI; + startAngle += 2.0 * M_PI; } if (endAngle < 0) { - endAngle += 2.0 * M_PI; + endAngle += 2.0 * M_PI; } - Base::Vector3d startOff(cos(startAngle + offset),sin(startAngle + offset),0.0); - Base::Vector3d endOff(cos(endAngle - offset),sin(endAngle - offset),0.0); + Base::Vector3d startOff(cos(startAngle + offset), sin(startAngle + offset), 0.0); + Base::Vector3d endOff(cos(endAngle - offset), sin(endAngle - offset), 0.0); startAngle = startAngle * 180.0 / M_PI; endAngle = endAngle * 180.0 / M_PI; - Base::Vector3d linePt(lineDefPoint[0],lineDefPoint[1],lineDefPoint[2]); + Base::Vector3d linePt(lineDefPoint[0], lineDefPoint[1], lineDefPoint[2]); double radius = (e2S - linePt).Length(); - (*m_ssBlock) << " 0" << endl; - (*m_ssBlock) << "ARC" << endl; //dimline arc - (*m_ssBlock) << " 5" << endl; + (*m_ssBlock) << " 0" << endl; + (*m_ssBlock) << "ARC" << endl;// dimline arc + (*m_ssBlock) << " 5" << endl; (*m_ssBlock) << getBlockHandle() << endl; if (m_version > 12) { - (*m_ssBlock) << "330" << endl; + (*m_ssBlock) << "330" << endl; (*m_ssBlock) << m_saveBlkRecordHandle << endl; - (*m_ssBlock) << "100" << endl; - (*m_ssBlock) << "AcDbEntity" << endl; + (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "AcDbEntity" << endl; } - (*m_ssBlock) << " 8" << endl; - (*m_ssBlock) << "0" << endl; -// (*m_ssBlock) << " 62" << endl; -// (*m_ssBlock) << " 0" << endl; + (*m_ssBlock) << " 8" << endl; + (*m_ssBlock) << "0" << endl; + // (*m_ssBlock) << " 62" << endl; + // (*m_ssBlock) << " 0" << endl; if (m_version > 12) { - (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "100" << endl; (*m_ssBlock) << "AcDbCircle" << endl; } - (*m_ssBlock) << " 10" << endl; - (*m_ssBlock) << startExt2[0] << endl; //arc center - (*m_ssBlock) << " 20" << endl; - (*m_ssBlock) << startExt2[1] << endl; - (*m_ssBlock) << " 30" << endl; - (*m_ssBlock) << startExt2[2] << endl; - (*m_ssBlock) << " 40" << endl; - (*m_ssBlock) << radius << endl; //radius + (*m_ssBlock) << " 10" << endl; + (*m_ssBlock) << startExt2[0] << endl;// arc center + (*m_ssBlock) << " 20" << endl; + (*m_ssBlock) << startExt2[1] << endl; + (*m_ssBlock) << " 30" << endl; + (*m_ssBlock) << startExt2[2] << endl; + (*m_ssBlock) << " 40" << endl; + (*m_ssBlock) << radius << endl;// radius if (m_version > 12) { - (*m_ssBlock) << "100" << endl; + (*m_ssBlock) << "100" << endl; (*m_ssBlock) << "AcDbArc" << endl; } - (*m_ssBlock) << " 50" << endl; - (*m_ssBlock) << startAngle << endl; //start angle - (*m_ssBlock) << " 51" << endl; - (*m_ssBlock) << endAngle << endl; //end angle + (*m_ssBlock) << " 50" << endl; + (*m_ssBlock) << startAngle << endl;// start angle + (*m_ssBlock) << " 51" << endl; + (*m_ssBlock) << endAngle << endl;// end angle - putText(dimText,toVector3d(textMidPoint), toVector3d(textMidPoint),3.5,1, - m_ssBlock,getBlockHandle(),m_saveBlkRecordHandle); + putText(dimText, + toVector3d(textMidPoint), + toVector3d(textMidPoint), + 3.5, + 1, + m_ssBlock, + getBlockHandle(), + m_saveBlkRecordHandle); e1.Normalize(); e2.Normalize(); Base::Vector3d arrow1Start = e1S + e1 * radius; Base::Vector3d arrow2Start = e2S + e2 * radius; - //wf: idk why the Tan pts have to be reversed. something to do with CW angles in Dxf? + // wf: idk why the Tan pts have to be reversed. something to do with CW angles in Dxf? Base::Vector3d endTan = e1S + (startOff * radius); Base::Vector3d startTan = e2S + (endOff * radius); Base::Vector3d tanP1 = (arrow1Start - startTan).Normalize(); - Base::Vector3d perp1(-tanP1.y,tanP1.x,tanP1.z); + Base::Vector3d perp1(-tanP1.y, tanP1.x, tanP1.z); Base::Vector3d tanP2 = (arrow2Start - endTan).Normalize(); - Base::Vector3d perp2(-tanP2.y,tanP2.x,tanP2.z); - double arrowLen = 5.0; //magic number - double arrowWidth = arrowLen/6.0/2.0; //magic number calc! + Base::Vector3d perp2(-tanP2.y, tanP2.x, tanP2.z); + double arrowLen = 5.0; // magic number + double arrowWidth = arrowLen / 6.0 / 2.0;// magic number calc! - Base::Vector3d barb1 = arrow1Start + perp1*arrowWidth - tanP1*arrowLen; - Base::Vector3d barb2 = arrow1Start - perp1*arrowWidth - tanP1*arrowLen; + Base::Vector3d barb1 = arrow1Start + perp1 * arrowWidth - tanP1 * arrowLen; + Base::Vector3d barb2 = arrow1Start - perp1 * arrowWidth - tanP1 * arrowLen; - putArrow(arrow1Start, barb1, barb2, - m_ssBlock,getBlockHandle(),m_saveBlkRecordHandle); + putArrow(arrow1Start, barb1, barb2, m_ssBlock, getBlockHandle(), m_saveBlkRecordHandle); - barb1 = arrow2Start + perp2*arrowWidth - tanP2*arrowLen; - barb2 = arrow2Start - perp2*arrowWidth - tanP2*arrowLen; + barb1 = arrow2Start + perp2 * arrowWidth - tanP2 * arrowLen; + barb2 = arrow2Start - perp2 * arrowWidth - tanP2 * arrowLen; - putArrow(arrow2Start, barb1, barb2, - m_ssBlock,getBlockHandle(),m_saveBlkRecordHandle); + putArrow(arrow2Start, barb1, barb2, m_ssBlock, getBlockHandle(), m_saveBlkRecordHandle); } //*************************** -//writeRadialDimBlock -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project -void CDxfWrite::writeRadialDimBlock(const double* centerPoint, const double* textMidPoint, - const double* arcPoint, const char* dimText) +// writeRadialDimBlock +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +void CDxfWrite::writeRadialDimBlock(const double* centerPoint, + const double* textMidPoint, + const double* arcPoint, + const char* dimText) { - putLine(toVector3d(centerPoint), toVector3d(arcPoint), - m_ssBlock, getBlockHandle(), + putLine(toVector3d(centerPoint), + toVector3d(arcPoint), + m_ssBlock, + getBlockHandle(), m_saveBlkRecordHandle); - putText(dimText,toVector3d(textMidPoint), toVector3d(textMidPoint),3.5,1, - m_ssBlock,getBlockHandle(),m_saveBlkRecordHandle); + putText(dimText, + toVector3d(textMidPoint), + toVector3d(textMidPoint), + 3.5, + 1, + m_ssBlock, + getBlockHandle(), + m_saveBlkRecordHandle); - Base::Vector3d c(centerPoint[0],centerPoint[1],centerPoint[2]); - Base::Vector3d a(arcPoint[0],arcPoint[1],arcPoint[2]); + Base::Vector3d c(centerPoint[0], centerPoint[1], centerPoint[2]); + Base::Vector3d a(arcPoint[0], arcPoint[1], arcPoint[2]); Base::Vector3d para = a - c; - double arrowLen = 5.0; //magic number - double arrowWidth = arrowLen/6.0/2.0; //magic number calc! + double arrowLen = 5.0; // magic number + double arrowWidth = arrowLen / 6.0 / 2.0;// magic number calc! para.Normalize(); - Base::Vector3d perp(-para.y,para.x,para.z); + Base::Vector3d perp(-para.y, para.x, para.z); Base::Vector3d arrowStart = a; - Base::Vector3d barb1 = arrowStart + perp*arrowWidth - para*arrowLen; - Base::Vector3d barb2 = arrowStart - perp*arrowWidth - para*arrowLen; + Base::Vector3d barb1 = arrowStart + perp * arrowWidth - para * arrowLen; + Base::Vector3d barb2 = arrowStart - perp * arrowWidth - para * arrowLen; - putArrow(arrowStart, barb1, barb2, - m_ssBlock,getBlockHandle(),m_saveBlkRecordHandle); + putArrow(arrowStart, barb1, barb2, m_ssBlock, getBlockHandle(), m_saveBlkRecordHandle); } //*************************** -//writeDiametricDimBlock -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// writeDiametricDimBlock +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::writeDiametricDimBlock(const double* textMidPoint, - const double* arcPoint1, const double* arcPoint2, - const char* dimText) + const double* arcPoint1, + const double* arcPoint2, + const char* dimText) { - putLine(toVector3d(arcPoint1), toVector3d(arcPoint2), - m_ssBlock, getBlockHandle(), + putLine(toVector3d(arcPoint1), + toVector3d(arcPoint2), + m_ssBlock, + getBlockHandle(), m_saveBlkRecordHandle); - putText(dimText,toVector3d(textMidPoint), toVector3d(textMidPoint),3.5,1, - m_ssBlock,getBlockHandle(),m_saveBlkRecordHandle); + putText(dimText, + toVector3d(textMidPoint), + toVector3d(textMidPoint), + 3.5, + 1, + m_ssBlock, + getBlockHandle(), + m_saveBlkRecordHandle); - Base::Vector3d a1(arcPoint1[0],arcPoint1[1],arcPoint1[2]); - Base::Vector3d a2(arcPoint2[0],arcPoint2[1],arcPoint2[2]); + Base::Vector3d a1(arcPoint1[0], arcPoint1[1], arcPoint1[2]); + Base::Vector3d a2(arcPoint2[0], arcPoint2[1], arcPoint2[2]); Base::Vector3d para = a2 - a1; - double arrowLen = 5.0; //magic number - double arrowWidth = arrowLen/6.0/2.0; //magic number calc! + double arrowLen = 5.0; // magic number + double arrowWidth = arrowLen / 6.0 / 2.0;// magic number calc! para.Normalize(); - Base::Vector3d perp(-para.y,para.x,para.z); + Base::Vector3d perp(-para.y, para.x, para.z); Base::Vector3d arrowStart = a1; - Base::Vector3d barb1 = arrowStart + perp*arrowWidth + para*arrowLen; - Base::Vector3d barb2 = arrowStart - perp*arrowWidth + para*arrowLen; + Base::Vector3d barb1 = arrowStart + perp * arrowWidth + para * arrowLen; + Base::Vector3d barb2 = arrowStart - perp * arrowWidth + para * arrowLen; - putArrow(arrowStart, barb1, barb2, - m_ssBlock,getBlockHandle(),m_saveBlkRecordHandle); + putArrow(arrowStart, barb1, barb2, m_ssBlock, getBlockHandle(), m_saveBlkRecordHandle); arrowStart = a2; - barb1 = arrowStart + perp*arrowWidth - para*arrowLen; - barb2 = arrowStart - perp*arrowWidth - para*arrowLen; - putArrow(arrowStart, barb1, barb2, - m_ssBlock,getBlockHandle(),m_saveBlkRecordHandle); - + barb1 = arrowStart + perp * arrowWidth - para * arrowLen; + barb2 = arrowStart - perp * arrowWidth - para * arrowLen; + putArrow(arrowStart, barb1, barb2, m_ssBlock, getBlockHandle(), m_saveBlkRecordHandle); } //*************************** -//writeBlocksSection -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// writeBlocksSection +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::writeBlocksSection() { if (m_version < 14) { @@ -1705,16 +1755,16 @@ void CDxfWrite::writeBlocksSection() (*m_ofs) << getPlateFile(fileSpec); } - //write blocks content + // write blocks content (*m_ofs) << (*m_ssBlock).str(); - (*m_ofs) << " 0" << endl; - (*m_ofs) << "ENDSEC" << endl; + (*m_ofs) << " 0" << endl; + (*m_ofs) << "ENDSEC" << endl; } //*************************** -//writeEntitiesSection -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// writeEntitiesSection +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::writeEntitiesSection() { std::stringstream ss; @@ -1722,17 +1772,17 @@ void CDxfWrite::writeEntitiesSection() std::string fileSpec = m_dataDir + ss.str(); (*m_ofs) << getPlateFile(fileSpec); - //write entities content + // write entities content (*m_ofs) << (*m_ssEntity).str(); - (*m_ofs) << " 0" << endl; - (*m_ofs) << "ENDSEC" << endl; + (*m_ofs) << " 0" << endl; + (*m_ofs) << "ENDSEC" << endl; } //*************************** -//writeObjectsSection -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// writeObjectsSection +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project void CDxfWrite::writeObjectsSection() { if (m_version < 14) { @@ -1747,19 +1797,19 @@ void CDxfWrite::writeObjectsSection() CDxfRead::CDxfRead(const char* filepath) { // start the file - memset( m_str, '\0', sizeof(m_str) ); - memset( m_unused_line, '\0', sizeof(m_unused_line) ); + memset(m_str, '\0', sizeof(m_str)); + memset(m_unused_line, '\0', sizeof(m_unused_line)); m_fail = false; m_ColorIndex = 0; m_eUnits = eMillimeters; m_measurement_inch = false; - strcpy(m_layer_name, "0"); // Default layer name - memset( m_section_name, '\0', sizeof(m_section_name) ); - memset( m_block_name, '\0', sizeof(m_block_name) ); + strcpy(m_layer_name, "0");// Default layer name + memset(m_section_name, '\0', sizeof(m_section_name)); + memset(m_block_name, '\0', sizeof(m_block_name)); m_ignore_errors = true; m_ifs = new ifstream(filepath); - if(!(*m_ifs)){ + if (!(*m_ifs)) { m_fail = true; printf("DXF file didn't load\n"); return; @@ -1779,45 +1829,64 @@ CDxfRead::~CDxfRead() delete m_encoding; } -double CDxfRead::mm( double value ) const +double CDxfRead::mm(double value) const { - //re #6461 - //this if handles situation of malformed DXF file where - //MEASUREMENT specifies English units, but - //INSUNITS specifies millimeters or is not specified + // re #6461 + // this if handles situation of malformed DXF file where + // MEASUREMENT specifies English units, but + // INSUNITS specifies millimeters or is not specified //(millimeters is our default) - if(m_measurement_inch && - (m_eUnits == eMillimeters)) - { + if (m_measurement_inch && (m_eUnits == eMillimeters)) { value *= 25.4; } - switch(m_eUnits) - { - case eUnspecified: return(value * 1.0); // We don't know any better. - case eInches: return(value * 25.4); - case eFeet: return(value * 25.4 * 12); - case eMiles: return(value * 1609344.0); - case eMillimeters: return(value * 1.0); - case eCentimeters: return(value * 10.0); - case eMeters: return(value * 1000.0); - case eKilometers: return(value * 1000000.0); - case eMicroinches: return(value * 25.4 / 1000.0); - case eMils: return(value * 25.4 / 1000.0); - case eYards: return(value * 3 * 12 * 25.4); - case eAngstroms: return(value * 0.0000001); - case eNanometers: return(value * 0.000001); - case eMicrons: return(value * 0.001); - case eDecimeters: return(value * 100.0); - case eDekameters: return(value * 10000.0); - case eHectometers: return(value * 100000.0); - case eGigameters: return(value * 1000000000000.0); - case eAstronomicalUnits: return(value * 149597870690000.0); - case eLightYears: return(value * 9454254955500000000.0); - case eParsecs: return(value * 30856774879000000000.0); - default: return(value * 1.0); // We don't know any better. - } // End switch -} // End mm() method + switch (m_eUnits) { + case eUnspecified: + return (value * 1.0);// We don't know any better. + case eInches: + return (value * 25.4); + case eFeet: + return (value * 25.4 * 12); + case eMiles: + return (value * 1609344.0); + case eMillimeters: + return (value * 1.0); + case eCentimeters: + return (value * 10.0); + case eMeters: + return (value * 1000.0); + case eKilometers: + return (value * 1000000.0); + case eMicroinches: + return (value * 25.4 / 1000.0); + case eMils: + return (value * 25.4 / 1000.0); + case eYards: + return (value * 3 * 12 * 25.4); + case eAngstroms: + return (value * 0.0000001); + case eNanometers: + return (value * 0.000001); + case eMicrons: + return (value * 0.001); + case eDecimeters: + return (value * 100.0); + case eDekameters: + return (value * 10000.0); + case eHectometers: + return (value * 100000.0); + case eGigameters: + return (value * 1000000000000.0); + case eAstronomicalUnits: + return (value * 149597870690000.0); + case eLightYears: + return (value * 9454254955500000000.0); + case eParsecs: + return (value * 30856774879000000000.0); + default: + return (value * 1.0);// We don't know any better. + } // End switch +}// End mm() method bool CDxfRead::ReadLine() @@ -1826,71 +1895,105 @@ bool CDxfRead::ReadLine() double e[3] = {0, 0, 0}; bool hidden = false; - while(!((*m_ifs).eof())) - { + while (!((*m_ifs).eof())) { get_line(); int n; - if(sscanf(m_str, "%d", &n) != 1) - { - printf("CDxfRead::ReadLine() Failed to read integer from '%s'\n", m_str ); + if (sscanf(m_str, "%d", &n) != 1) { + printf("CDxfRead::ReadLine() Failed to read integer from '%s'\n", m_str); return false; } std::istringstream ss; ss.imbue(std::locale("C")); - switch(n){ + switch (n) { case 0: // next item found, so finish with line - ResolveColorIndex(); - OnReadLine(s, e, hidden); - hidden = false; + ResolveColorIndex(); + OnReadLine(s, e, hidden); + hidden = false; return true; - case 8: // Layer name follows + case 8:// Layer name follows get_line(); strcpy(m_layer_name, m_str); break; - case 6: // line style name follows + case 6:// line style name follows get_line(); - if(m_str[0] == 'h' || m_str[0] == 'H')hidden = true; + if (m_str[0] == 'h' || m_str[0] == 'H') { + hidden = true; + } break; case 10: // start x get_line(); - ss.str(m_str); ss >> s[0]; s[0] = mm(s[0]); if(ss.fail()) return false; + ss.str(m_str); + ss >> s[0]; + s[0] = mm(s[0]); + if (ss.fail()) { + return false; + } break; case 20: // start y get_line(); - ss.str(m_str); ss >> s[1]; s[1] = mm(s[1]); if(ss.fail()) return false; + ss.str(m_str); + ss >> s[1]; + s[1] = mm(s[1]); + if (ss.fail()) { + return false; + } break; case 30: // start z get_line(); - ss.str(m_str); ss >> s[2]; s[2] = mm(s[2]); if(ss.fail()) return false; + ss.str(m_str); + ss >> s[2]; + s[2] = mm(s[2]); + if (ss.fail()) { + return false; + } break; case 11: // end x get_line(); - ss.str(m_str); ss >> e[0]; e[0] = mm(e[0]); if(ss.fail()) return false; + ss.str(m_str); + ss >> e[0]; + e[0] = mm(e[0]); + if (ss.fail()) { + return false; + } break; case 21: // end y get_line(); - ss.str(m_str); ss >> e[1]; e[1] = mm(e[1]); if(ss.fail()) return false; + ss.str(m_str); + ss >> e[1]; + e[1] = mm(e[1]); + if (ss.fail()) { + return false; + } break; case 31: // end z get_line(); - ss.str(m_str); ss >> e[2]; e[2] = mm(e[2]); if(ss.fail()) return false; + ss.str(m_str); + ss >> e[2]; + e[2] = mm(e[2]); + if (ss.fail()) { + return false; + } break; - case 62: + case 62: // color index get_line(); - ss.str(m_str); ss >> m_ColorIndex; if(ss.fail()) return false; + ss.str(m_str); + ss >> m_ColorIndex; + if (ss.fail()) { + return false; + } break; case 100: @@ -1912,9 +2015,10 @@ bool CDxfRead::ReadLine() ResolveColorIndex(); OnReadLine(s, e, false); } - catch(...) - { - if (! IgnoreErrors()) throw; // Re-throw the exception. + catch (...) { + if (!IgnoreErrors()) { + throw;// Re-throw the exception. + } } return false; @@ -1924,27 +2028,25 @@ bool CDxfRead::ReadPoint() { double s[3] = {0, 0, 0}; - while(!((*m_ifs).eof())) - { + while (!((*m_ifs).eof())) { get_line(); int n; - if(sscanf(m_str, "%d", &n) != 1) - { - printf("CDxfRead::ReadPoint() Failed to read integer from '%s'\n", m_str ); + if (sscanf(m_str, "%d", &n) != 1) { + printf("CDxfRead::ReadPoint() Failed to read integer from '%s'\n", m_str); return false; } std::istringstream ss; ss.imbue(std::locale("C")); - switch(n){ + switch (n) { case 0: // next item found, so finish with line - ResolveColorIndex(); + ResolveColorIndex(); OnReadPoint(s); return true; - case 8: // Layer name follows + case 8:// Layer name follows get_line(); strcpy(m_layer_name, m_str); break; @@ -1952,23 +2054,42 @@ bool CDxfRead::ReadPoint() case 10: // start x get_line(); - ss.str(m_str); ss >> s[0]; s[0] = mm(s[0]); if(ss.fail()) return false; + ss.str(m_str); + ss >> s[0]; + s[0] = mm(s[0]); + if (ss.fail()) { + return false; + } break; case 20: // start y get_line(); - ss.str(m_str); ss >> s[1]; s[1] = mm(s[1]); if(ss.fail()) return false; + ss.str(m_str); + ss >> s[1]; + s[1] = mm(s[1]); + if (ss.fail()) { + return false; + } break; case 30: // start z get_line(); - ss.str(m_str); ss >> s[2]; s[2] = mm(s[2]); if(ss.fail()) return false; + ss.str(m_str); + ss >> s[2]; + s[2] = mm(s[2]); + if (ss.fail()) { + return false; + } break; - case 62: + case 62: // color index get_line(); - ss.str(m_str); ss >> m_ColorIndex; if(ss.fail()) return false; + ss.str(m_str); + ss >> m_ColorIndex; + if (ss.fail()) { + return false; + } break; case 100: @@ -1984,16 +2105,16 @@ bool CDxfRead::ReadPoint() get_line(); break; } - } try { ResolveColorIndex(); OnReadPoint(s); } - catch(...) - { - if (! IgnoreErrors()) throw; // Re-throw the exception. + catch (...) { + if (!IgnoreErrors()) { + throw;// Re-throw the exception. + } } return false; @@ -2004,78 +2125,109 @@ bool CDxfRead::ReadArc() double start_angle = 0.0;// in degrees double end_angle = 0.0; double radius = 0.0; - double c[3] = {0,0,0}; // centre + double c[3] = {0, 0, 0};// centre double z_extrusion_dir = 1.0; bool hidden = false; - while(!((*m_ifs).eof())) - { + while (!((*m_ifs).eof())) { get_line(); int n; - if(sscanf(m_str, "%d", &n) != 1) - { + if (sscanf(m_str, "%d", &n) != 1) { printf("CDxfRead::ReadArc() Failed to read integer from '%s'\n", m_str); return false; } std::istringstream ss; ss.imbue(std::locale("C")); - switch(n){ + switch (n) { case 0: // next item found, so finish with arc - ResolveColorIndex(); - OnReadArc(start_angle, end_angle, radius, c,z_extrusion_dir, hidden); - hidden = false; - return true; + ResolveColorIndex(); + OnReadArc(start_angle, end_angle, radius, c, z_extrusion_dir, hidden); + hidden = false; + return true; - case 8: // Layer name follows + case 8:// Layer name follows get_line(); strcpy(m_layer_name, m_str); break; - case 6: // line style name follows + case 6:// line style name follows get_line(); - if(m_str[0] == 'h' || m_str[0] == 'H')hidden = true; + if (m_str[0] == 'h' || m_str[0] == 'H') { + hidden = true; + } break; case 10: // centre x get_line(); - ss.str(m_str); ss >> c[0]; c[0] = mm(c[0]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[0]; + c[0] = mm(c[0]); + if (ss.fail()) { + return false; + } break; case 20: // centre y get_line(); - ss.str(m_str); ss >> c[1]; c[1] = mm(c[1]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[1]; + c[1] = mm(c[1]); + if (ss.fail()) { + return false; + } break; case 30: // centre z get_line(); - ss.str(m_str); ss >> c[2]; c[2] = mm(c[2]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[2]; + c[2] = mm(c[2]); + if (ss.fail()) { + return false; + } break; case 40: // radius get_line(); - ss.str(m_str); ss >> radius; radius = mm(radius); if(ss.fail()) return false; + ss.str(m_str); + ss >> radius; + radius = mm(radius); + if (ss.fail()) { + return false; + } break; case 50: // start angle get_line(); - ss.str(m_str); ss >> start_angle; if(ss.fail()) return false; + ss.str(m_str); + ss >> start_angle; + if (ss.fail()) { + return false; + } break; case 51: // end angle get_line(); - ss.str(m_str); ss >> end_angle; if(ss.fail()) return false; + ss.str(m_str); + ss >> end_angle; + if (ss.fail()) { + return false; + } break; - case 62: + case 62: // color index get_line(); - ss.str(m_str); ss >> m_ColorIndex; if(ss.fail()) return false; + ss.str(m_str); + ss >> m_ColorIndex; + if (ss.fail()) { + return false; + } break; - case 100: case 39: case 210: @@ -2084,9 +2236,13 @@ bool CDxfRead::ReadArc() get_line(); break; case 230: - //Z extrusion direction for arc + // Z extrusion direction for arc get_line(); - ss.str(m_str); ss >> z_extrusion_dir; if(ss.fail()) return false; + ss.str(m_str); + ss >> z_extrusion_dir; + if (ss.fail()) { + return false; + } break; default: @@ -2114,154 +2270,258 @@ bool CDxfRead::ReadSpline() double temp_double; - while(!((*m_ifs).eof())) - { + while (!((*m_ifs).eof())) { get_line(); int n; - if(sscanf(m_str, "%d", &n) != 1) - { + if (sscanf(m_str, "%d", &n) != 1) { printf("CDxfRead::ReadSpline() Failed to read integer from '%s'\n", m_str); return false; } std::istringstream ss; ss.imbue(std::locale("C")); - switch(n){ + switch (n) { case 0: // next item found, so finish with Spline - ResolveColorIndex(); + ResolveColorIndex(); OnReadSpline(sd); return true; - case 8: // Layer name follows + case 8:// Layer name follows get_line(); strcpy(m_layer_name, m_str); break; - case 62: + case 62: // color index get_line(); - ss.str(m_str); ss >> m_ColorIndex; if(ss.fail()) return false; + ss.str(m_str); + ss >> m_ColorIndex; + if (ss.fail()) { + return false; + } break; case 210: // normal x get_line(); - ss.str(m_str); ss >> sd.norm[0]; if(ss.fail()) return false; + ss.str(m_str); + ss >> sd.norm[0]; + if (ss.fail()) { + return false; + } break; case 220: // normal y get_line(); - ss.str(m_str); ss >> sd.norm[1]; if(ss.fail()) return false; + ss.str(m_str); + ss >> sd.norm[1]; + if (ss.fail()) { + return false; + } break; case 230: // normal z get_line(); - ss.str(m_str); ss >> sd.norm[2]; if(ss.fail()) return false; + ss.str(m_str); + ss >> sd.norm[2]; + if (ss.fail()) { + return false; + } break; case 70: // flag get_line(); - ss.str(m_str); ss >> sd.flag; if(ss.fail()) return false; + ss.str(m_str); + ss >> sd.flag; + if (ss.fail()) { + return false; + } break; case 71: // degree get_line(); - ss.str(m_str); ss >> sd.degree; if(ss.fail()) return false; + ss.str(m_str); + ss >> sd.degree; + if (ss.fail()) { + return false; + } break; case 72: // knots get_line(); - ss.str(m_str); ss >> sd.knots; if(ss.fail()) return false; + ss.str(m_str); + ss >> sd.knots; + if (ss.fail()) { + return false; + } break; case 73: // control points get_line(); - ss.str(m_str); ss >> sd.control_points; if(ss.fail()) return false; + ss.str(m_str); + ss >> sd.control_points; + if (ss.fail()) { + return false; + } break; case 74: // fit points get_line(); - ss.str(m_str); ss >> sd.fit_points; if(ss.fail()) return false; + ss.str(m_str); + ss >> sd.fit_points; + if (ss.fail()) { + return false; + } break; case 12: // starttan x get_line(); - ss.str(m_str); ss >> temp_double; temp_double = mm(temp_double); if(ss.fail()) return false; + ss.str(m_str); + ss >> temp_double; + temp_double = mm(temp_double); + if (ss.fail()) { + return false; + } sd.starttanx.push_back(temp_double); break; case 22: // starttan y get_line(); - ss.str(m_str); ss >> temp_double; temp_double = mm(temp_double); if(ss.fail()) return false; + ss.str(m_str); + ss >> temp_double; + temp_double = mm(temp_double); + if (ss.fail()) { + return false; + } sd.starttany.push_back(temp_double); break; case 32: // starttan z get_line(); - ss.str(m_str); ss >> temp_double; temp_double = mm(temp_double); if(ss.fail()) return false; + ss.str(m_str); + ss >> temp_double; + temp_double = mm(temp_double); + if (ss.fail()) { + return false; + } sd.starttanz.push_back(temp_double); break; case 13: // endtan x get_line(); - ss.str(m_str); ss >> temp_double; temp_double = mm(temp_double); if(ss.fail()) return false; + ss.str(m_str); + ss >> temp_double; + temp_double = mm(temp_double); + if (ss.fail()) { + return false; + } sd.endtanx.push_back(temp_double); break; case 23: // endtan y get_line(); - ss.str(m_str); ss >> temp_double; temp_double = mm(temp_double); if(ss.fail()) return false; + ss.str(m_str); + ss >> temp_double; + temp_double = mm(temp_double); + if (ss.fail()) { + return false; + } sd.endtany.push_back(temp_double); break; case 33: // endtan z get_line(); - ss.str(m_str); ss >> temp_double; temp_double = mm(temp_double); if(ss.fail()) return false; + ss.str(m_str); + ss >> temp_double; + temp_double = mm(temp_double); + if (ss.fail()) { + return false; + } sd.endtanz.push_back(temp_double); break; case 40: // knot get_line(); - ss.str(m_str); ss >> temp_double; temp_double = mm(temp_double); if(ss.fail()) return false; + ss.str(m_str); + ss >> temp_double; + temp_double = mm(temp_double); + if (ss.fail()) { + return false; + } sd.knot.push_back(temp_double); break; case 41: // weight get_line(); - ss.str(m_str); ss >> temp_double; temp_double = mm(temp_double); if(ss.fail()) return false; + ss.str(m_str); + ss >> temp_double; + temp_double = mm(temp_double); + if (ss.fail()) { + return false; + } sd.weight.push_back(temp_double); break; case 10: // control x get_line(); - ss.str(m_str); ss >> temp_double; temp_double = mm(temp_double); if(ss.fail()) return false; + ss.str(m_str); + ss >> temp_double; + temp_double = mm(temp_double); + if (ss.fail()) { + return false; + } sd.controlx.push_back(temp_double); break; case 20: // control y get_line(); - ss.str(m_str); ss >> temp_double; temp_double = mm(temp_double); if(ss.fail()) return false; + ss.str(m_str); + ss >> temp_double; + temp_double = mm(temp_double); + if (ss.fail()) { + return false; + } sd.controly.push_back(temp_double); break; case 30: // control z get_line(); - ss.str(m_str); ss >> temp_double; temp_double = mm(temp_double); if(ss.fail()) return false; + ss.str(m_str); + ss >> temp_double; + temp_double = mm(temp_double); + if (ss.fail()) { + return false; + } sd.controlz.push_back(temp_double); break; case 11: // fit x get_line(); - ss.str(m_str); ss >> temp_double; temp_double = mm(temp_double); if(ss.fail()) return false; + ss.str(m_str); + ss >> temp_double; + temp_double = mm(temp_double); + if (ss.fail()) { + return false; + } sd.fitx.push_back(temp_double); break; case 21: // fit y get_line(); - ss.str(m_str); ss >> temp_double; temp_double = mm(temp_double); if(ss.fail()) return false; + ss.str(m_str); + ss >> temp_double; + temp_double = mm(temp_double); + if (ss.fail()) { + return false; + } sd.fity.push_back(temp_double); break; case 31: // fit z get_line(); - ss.str(m_str); ss >> temp_double; temp_double = mm(temp_double); if(ss.fail()) return false; + ss.str(m_str); + ss >> temp_double; + temp_double = mm(temp_double); + if (ss.fail()) { + return false; + } sd.fitz.push_back(temp_double); break; case 42: @@ -2285,21 +2545,19 @@ bool CDxfRead::ReadSpline() bool CDxfRead::ReadCircle() { double radius = 0.0; - double c[3] = {0,0,0}; // centre + double c[3] = {0, 0, 0};// centre bool hidden = false; - while(!((*m_ifs).eof())) - { + while (!((*m_ifs).eof())) { get_line(); int n; - if(sscanf(m_str, "%d", &n) != 1) - { + if (sscanf(m_str, "%d", &n) != 1) { printf("CDxfRead::ReadCircle() Failed to read integer from '%s'\n", m_str); return false; } std::istringstream ss; ss.imbue(std::locale("C")); - switch(n){ + switch (n) { case 0: // next item found, so finish with Circle ResolveColorIndex(); @@ -2307,12 +2565,14 @@ bool CDxfRead::ReadCircle() hidden = false; return true; - case 6: // line style name follows + case 6:// line style name follows get_line(); - if(m_str[0] == 'h' || m_str[0] == 'H')hidden = true; + if (m_str[0] == 'h' || m_str[0] == 'H') { + hidden = true; + } break; - case 8: // Layer name follows + case 8:// Layer name follows get_line(); strcpy(m_layer_name, m_str); break; @@ -2320,27 +2580,51 @@ bool CDxfRead::ReadCircle() case 10: // centre x get_line(); - ss.str(m_str); ss >> c[0]; c[0] = mm(c[0]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[0]; + c[0] = mm(c[0]); + if (ss.fail()) { + return false; + } break; case 20: // centre y get_line(); - ss.str(m_str); ss >> c[1]; c[1] = mm(c[1]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[1]; + c[1] = mm(c[1]); + if (ss.fail()) { + return false; + } break; case 30: // centre z get_line(); - ss.str(m_str); ss >> c[2]; c[2] = mm(c[2]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[2]; + c[2] = mm(c[2]); + if (ss.fail()) { + return false; + } break; case 40: // radius get_line(); - ss.str(m_str); ss >> radius; radius = mm(radius); if(ss.fail()) return false; + ss.str(m_str); + ss >> radius; + radius = mm(radius); + if (ss.fail()) { + return false; + } break; - case 62: + case 62: // color index get_line(); - ss.str(m_str); ss >> m_ColorIndex; if(ss.fail()) return false; + ss.str(m_str); + ss >> m_ColorIndex; + if (ss.fail()) { + return false; + } break; case 100: @@ -2365,27 +2649,25 @@ bool CDxfRead::ReadCircle() bool CDxfRead::ReadText() { - double c[3]; // coordinate + double c[3];// coordinate double height = 0.03082; std::string textPrefix; - memset( c, 0, sizeof(c) ); + memset(c, 0, sizeof(c)); - while(!((*m_ifs).eof())) - { + while (!((*m_ifs).eof())) { get_line(); int n; - if(sscanf(m_str, "%d", &n) != 1) - { + if (sscanf(m_str, "%d", &n) != 1) { printf("CDxfRead::ReadText() Failed to read integer from '%s'\n", m_str); return false; } std::istringstream ss; ss.imbue(std::locale("C")); - switch(n){ + switch (n) { case 0: return false; - case 8: // Layer name follows + case 8:// Layer name follows get_line(); strcpy(m_layer_name, m_str); break; @@ -2393,38 +2675,59 @@ bool CDxfRead::ReadText() case 10: // centre x get_line(); - ss.str(m_str); ss >> c[0]; c[0] = mm(c[0]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[0]; + c[0] = mm(c[0]); + if (ss.fail()) { + return false; + } break; case 20: // centre y get_line(); - ss.str(m_str); ss >> c[1]; c[1] = mm(c[1]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[1]; + c[1] = mm(c[1]); + if (ss.fail()) { + return false; + } break; case 30: // centre z get_line(); - ss.str(m_str); ss >> c[2]; c[2] = mm(c[2]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[2]; + c[2] = mm(c[2]); + if (ss.fail()) { + return false; + } break; case 40: // text height get_line(); - ss.str(m_str); ss >> height; height = mm(height); if(ss.fail()) return false; + ss.str(m_str); + ss >> height; + height = mm(height); + if (ss.fail()) { + return false; + } break; case 3: // Additional text that goes before the type 1 text - // Note that if breaking the text into type-3 records splits a UFT-8 encoding we do the decoding - // after splicing the lines together. I'm not sure if this actually occurs, but handling the text - // this way will treat this condition properly. + // Note that if breaking the text into type-3 records splits a UFT-8 encoding we do + // the decoding after splicing the lines together. I'm not sure if this actually + // occurs, but handling the text this way will treat this condition properly. get_line(); textPrefix.append(m_str); break; case 1: // final text - // Note that we treat this as the end of the TEXT or MTEXT entity but this may cause us to miss - // other properties. Officially the entity ends at the start of the next entity, the BLKEND record - // that ends the containing BLOCK, or the ENDSEC record that ends the ENTITIES section. These are - // all code 0 records. Changing this would require either some sort of peek/pushback ability or the understanding - // that ReadText() and all the other Read... methods return having already read a code 0. + // Note that we treat this as the end of the TEXT or MTEXT entity but this may cause + // us to miss other properties. Officially the entity ends at the start of the next + // entity, the BLKEND record that ends the containing BLOCK, or the ENDSEC record + // that ends the ENTITIES section. These are all code 0 records. Changing this would + // require either some sort of peek/pushback ability or the understanding that + // ReadText() and all the other Read... methods return having already read a code 0. get_line(); textPrefix.append(m_str); ResolveColorIndex(); @@ -2435,12 +2738,16 @@ bool CDxfRead::ReadText() delete utfStr; } } - return(true); + return (true); case 62: // color index get_line(); - ss.str(m_str); ss >> m_ColorIndex; if(ss.fail()) return false; + ss.str(m_str); + ss >> m_ColorIndex; + if (ss.fail()) { + return false; + } break; case 100: @@ -2464,30 +2771,28 @@ bool CDxfRead::ReadText() bool CDxfRead::ReadEllipse() { - double c[3] = {0,0,0}; // centre - double m[3] = {0,0,0}; //major axis point - double ratio=0; //ratio of major to minor axis - double start=0; //start of arc - double end=0; // end of arc + double c[3] = {0, 0, 0};// centre + double m[3] = {0, 0, 0};// major axis point + double ratio = 0; // ratio of major to minor axis + double start = 0; // start of arc + double end = 0; // end of arc - while(!((*m_ifs).eof())) - { + while (!((*m_ifs).eof())) { get_line(); int n; - if(sscanf(m_str, "%d", &n) != 1) - { + if (sscanf(m_str, "%d", &n) != 1) { printf("CDxfRead::ReadEllipse() Failed to read integer from '%s'\n", m_str); return false; } std::istringstream ss; ss.imbue(std::locale("C")); - switch(n){ + switch (n) { case 0: // next item found, so finish with Ellipse - ResolveColorIndex(); + ResolveColorIndex(); OnReadEllipse(c, m, ratio, start, end); return true; - case 8: // Layer name follows + case 8:// Layer name follows get_line(); strcpy(m_layer_name, m_str); break; @@ -2495,52 +2800,98 @@ bool CDxfRead::ReadEllipse() case 10: // centre x get_line(); - ss.str(m_str); ss >> c[0]; c[0] = mm(c[0]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[0]; + c[0] = mm(c[0]); + if (ss.fail()) { + return false; + } break; case 20: // centre y get_line(); - ss.str(m_str); ss >> c[1]; c[1] = mm(c[1]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[1]; + c[1] = mm(c[1]); + if (ss.fail()) { + return false; + } break; case 30: // centre z get_line(); - ss.str(m_str); ss >> c[2]; c[2] = mm(c[2]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[2]; + c[2] = mm(c[2]); + if (ss.fail()) { + return false; + } break; case 11: // major x get_line(); - ss.str(m_str); ss >> m[0]; m[0] = mm(m[0]); if(ss.fail()) return false; + ss.str(m_str); + ss >> m[0]; + m[0] = mm(m[0]); + if (ss.fail()) { + return false; + } break; case 21: // major y get_line(); - ss.str(m_str); ss >> m[1]; m[1] = mm(m[1]); if(ss.fail()) return false; + ss.str(m_str); + ss >> m[1]; + m[1] = mm(m[1]); + if (ss.fail()) { + return false; + } break; case 31: // major z get_line(); - ss.str(m_str); ss >> m[2]; m[2] = mm(m[2]); if(ss.fail()) return false; + ss.str(m_str); + ss >> m[2]; + m[2] = mm(m[2]); + if (ss.fail()) { + return false; + } break; case 40: // ratio get_line(); - ss.str(m_str); ss >> ratio; if(ss.fail()) return false; + ss.str(m_str); + ss >> ratio; + if (ss.fail()) { + return false; + } break; case 41: // start get_line(); - ss.str(m_str); ss >> start; if(ss.fail()) return false; + ss.str(m_str); + ss >> start; + if (ss.fail()) { + return false; + } break; case 42: // end get_line(); - ss.str(m_str); ss >> end; if(ss.fail()) return false; + ss.str(m_str); + ss >> end; + if (ss.fail()) { + return false; + } break; - case 62: + case 62: // color index get_line(); - ss.str(m_str); ss >> m_ColorIndex; if(ss.fail()) return false; + ss.str(m_str); + ss >> m_ColorIndex; + if (ss.fail()) { + return false; + } break; case 100: case 210: @@ -2572,27 +2923,25 @@ static double poly_first_x; static double poly_first_y; static double poly_first_z; -static void AddPolyLinePoint(CDxfRead* dxf_read, double x, double y, double z, bool bulge_found, double bulge) +static void +AddPolyLinePoint(CDxfRead* dxf_read, double x, double y, double z, bool bulge_found, double bulge) { try { - if(poly_prev_found) - { + if (poly_prev_found) { bool arc_done = false; - if(poly_prev_bulge_found) - { + if (poly_prev_bulge_found) { double cot = 0.5 * ((1.0 / poly_prev_bulge) - poly_prev_bulge); double cx = ((poly_prev_x + x) - ((y - poly_prev_y) * cot)) / 2.0; double cy = ((poly_prev_y + y) + ((x - poly_prev_x) * cot)) / 2.0; double ps[3] = {poly_prev_x, poly_prev_y, poly_prev_z}; double pe[3] = {x, y, z}; - double pc[3] = {cx, cy, (poly_prev_z + z)/2.0}; + double pc[3] = {cx, cy, (poly_prev_z + z) / 2.0}; dxf_read->OnReadArc(ps, pe, pc, poly_prev_bulge >= 0, false); arc_done = true; } - if(!arc_done) - { + if (!arc_done) { double s[3] = {poly_prev_x, poly_prev_y, poly_prev_z}; double e[3] = {x, y, z}; dxf_read->OnReadLine(s, e, false); @@ -2603,8 +2952,7 @@ static void AddPolyLinePoint(CDxfRead* dxf_read, double x, double y, double z, b poly_prev_x = x; poly_prev_y = y; poly_prev_z = z; - if(!poly_first_found) - { + if (!poly_first_found) { poly_first_x = x; poly_first_y = y; poly_first_z = z; @@ -2613,9 +2961,10 @@ static void AddPolyLinePoint(CDxfRead* dxf_read, double x, double y, double z, b poly_prev_bulge_found = bulge_found; poly_prev_bulge = bulge; } - catch(...) - { - if (! dxf_read->IgnoreErrors()) throw; // Re-throw it. + catch (...) { + if (!dxf_read->IgnoreErrors()) { + throw;// Re-throw it. + } } } @@ -2640,23 +2989,21 @@ bool CDxfRead::ReadLwPolyLine() int flags; bool next_item_found = false; - while(!((*m_ifs).eof()) && !next_item_found) - { + while (!((*m_ifs).eof()) && !next_item_found) { get_line(); int n; - if(sscanf(m_str, "%d", &n) != 1) - { + if (sscanf(m_str, "%d", &n) != 1) { printf("CDxfRead::ReadLwPolyLine() Failed to read integer from '%s'\n", m_str); return false; } std::istringstream ss; ss.imbue(std::locale("C")); - switch(n){ + switch (n) { case 0: // next item found - ResolveColorIndex(); - if(x_found && y_found){ + ResolveColorIndex(); + if (x_found && y_found) { // add point AddPolyLinePoint(this, x, y, z, bulge_found, bulge); bulge_found = false; @@ -2665,51 +3012,75 @@ bool CDxfRead::ReadLwPolyLine() } next_item_found = true; break; - case 8: // Layer name follows + case 8:// Layer name follows get_line(); strcpy(m_layer_name, m_str); break; case 10: // x get_line(); - if(x_found && y_found){ + if (x_found && y_found) { // add point AddPolyLinePoint(this, x, y, z, bulge_found, bulge); bulge_found = false; x_found = false; y_found = false; } - ss.str(m_str); ss >> x; x = mm(x); if(ss.fail()) return false; + ss.str(m_str); + ss >> x; + x = mm(x); + if (ss.fail()) { + return false; + } x_found = true; break; case 20: // y get_line(); - ss.str(m_str); ss >> y; y = mm(y); if(ss.fail()) return false; + ss.str(m_str); + ss >> y; + y = mm(y); + if (ss.fail()) { + return false; + } y_found = true; break; case 38: // elevation get_line(); - ss.str(m_str); ss >> z; z = mm(z); if(ss.fail()) return false; + ss.str(m_str); + ss >> z; + z = mm(z); + if (ss.fail()) { + return false; + } break; case 42: // bulge get_line(); - ss.str(m_str); ss >> bulge; if(ss.fail()) return false; + ss.str(m_str); + ss >> bulge; + if (ss.fail()) { + return false; + } bulge_found = true; break; case 70: // flags get_line(); - if(sscanf(m_str, "%d", &flags) != 1) + if (sscanf(m_str, "%d", &flags) != 1) { return false; + } closed = ((flags & 1) != 0); break; - case 62: + case 62: // color index get_line(); - ss.str(m_str); ss >> m_ColorIndex; if(ss.fail()) return false; + ss.str(m_str); + ss >> m_ColorIndex; + if (ss.fail()) { + return false; + } break; default: // skip the next line @@ -2718,12 +3089,10 @@ bool CDxfRead::ReadLwPolyLine() } } - if(next_item_found) - { - if(closed && poly_first_found) - { + if (next_item_found) { + if (closed && poly_first_found) { // repeat the first point - ResolveColorIndex(); + ResolveColorIndex(); AddPolyLinePoint(this, poly_first_x, poly_first_y, poly_first_z, false, 0.0); } return true; @@ -2733,7 +3102,7 @@ bool CDxfRead::ReadLwPolyLine() } -bool CDxfRead::ReadVertex(double *pVertex, bool *bulge_found, double *bulge) +bool CDxfRead::ReadVertex(double* pVertex, bool* bulge_found, double* bulge) { bool x_found = false; bool y_found = false; @@ -2748,60 +3117,83 @@ bool CDxfRead::ReadVertex(double *pVertex, bool *bulge_found, double *bulge) pVertex[1] = 0.0; pVertex[2] = 0.0; - while(!(*m_ifs).eof()) { + while (!(*m_ifs).eof()) { get_line(); int n; - if(sscanf(m_str, "%d", &n) != 1) { + if (sscanf(m_str, "%d", &n) != 1) { printf("CDxfRead::ReadVertex() Failed to read integer from '%s'\n", m_str); return false; } std::istringstream ss; ss.imbue(std::locale("C")); - switch(n){ - case 0: - ResolveColorIndex(); - put_line(m_str); // read one line too many. put it back. - return(x_found && y_found); - break; + switch (n) { + case 0: + ResolveColorIndex(); + put_line(m_str);// read one line too many. put it back. + return (x_found && y_found); + break; - case 8: // Layer name follows - get_line(); - strcpy(m_layer_name, m_str); - break; + case 8:// Layer name follows + get_line(); + strcpy(m_layer_name, m_str); + break; - case 10: - // x - get_line(); - ss.str(m_str); ss >> x; pVertex[0] = mm(x); if(ss.fail()) return false; - x_found = true; - break; - case 20: - // y - get_line(); - ss.str(m_str); ss >> y; pVertex[1] = mm(y); if(ss.fail()) return false; - y_found = true; - break; - case 30: - // z - get_line(); - ss.str(m_str); ss >> z; pVertex[2] = mm(z); if(ss.fail()) return false; - break; + case 10: + // x + get_line(); + ss.str(m_str); + ss >> x; + pVertex[0] = mm(x); + if (ss.fail()) { + return false; + } + x_found = true; + break; + case 20: + // y + get_line(); + ss.str(m_str); + ss >> y; + pVertex[1] = mm(y); + if (ss.fail()) { + return false; + } + y_found = true; + break; + case 30: + // z + get_line(); + ss.str(m_str); + ss >> z; + pVertex[2] = mm(z); + if (ss.fail()) { + return false; + } + break; - case 42: - get_line(); - *bulge_found = true; - ss.str(m_str); ss >> *bulge; if(ss.fail()) return false; - break; - case 62: - // color index - get_line(); - ss.str(m_str); ss >> m_ColorIndex; if(ss.fail()) return false; - break; + case 42: + get_line(); + *bulge_found = true; + ss.str(m_str); + ss >> *bulge; + if (ss.fail()) { + return false; + } + break; + case 62: + // color index + get_line(); + ss.str(m_str); + ss >> m_ColorIndex; + if (ss.fail()) { + return false; + } + break; - default: - // skip the next line - get_line(); - break; + default: + // skip the next line + get_line(); + break; } } @@ -2809,7 +3201,6 @@ bool CDxfRead::ReadVertex(double *pVertex, bool *bulge_found, double *bulge) } - bool CDxfRead::ReadPolyLine() { PolyLineStart(); @@ -2817,60 +3208,65 @@ bool CDxfRead::ReadPolyLine() bool closed = false; int flags; bool first_vertex_section_found = false; - double first_vertex[3] = {0,0,0}; + double first_vertex[3] = {0, 0, 0}; bool bulge_found; double bulge; - while(!(*m_ifs).eof()) - { + while (!(*m_ifs).eof()) { get_line(); int n; - if(sscanf(m_str, "%d", &n) != 1) - { + if (sscanf(m_str, "%d", &n) != 1) { printf("CDxfRead::ReadPolyLine() Failed to read integer from '%s'\n", m_str); return false; } std::istringstream ss; ss.imbue(std::locale("C")); - switch(n){ + switch (n) { case 0: // next item found - ResolveColorIndex(); + ResolveColorIndex(); get_line(); - if (! strcmp(m_str,"VERTEX")) - { - double vertex[3] = {0,0,0}; - if (CDxfRead::ReadVertex(vertex, &bulge_found, &bulge)) - { - if(!first_vertex_section_found) { + if (!strcmp(m_str, "VERTEX")) { + double vertex[3] = {0, 0, 0}; + if (CDxfRead::ReadVertex(vertex, &bulge_found, &bulge)) { + if (!first_vertex_section_found) { first_vertex_section_found = true; - memcpy(first_vertex, vertex, 3*sizeof(double)); + memcpy(first_vertex, vertex, 3 * sizeof(double)); } AddPolyLinePoint(this, vertex[0], vertex[1], vertex[2], bulge_found, bulge); break; } } - if (! strcmp(m_str,"SEQEND")) - { - if(closed && first_vertex_section_found) { - AddPolyLinePoint(this, first_vertex[0], first_vertex[1], first_vertex[2], 0, 0); + if (!strcmp(m_str, "SEQEND")) { + if (closed && first_vertex_section_found) { + AddPolyLinePoint(this, + first_vertex[0], + first_vertex[1], + first_vertex[2], + 0, + 0); } first_vertex_section_found = false; PolyLineStart(); - return(true); + return (true); } break; case 70: // flags get_line(); - if(sscanf(m_str, "%d", &flags) != 1) + if (sscanf(m_str, "%d", &flags) != 1) { return false; + } closed = ((flags & 1) != 0); break; - case 62: + case 62: // color index get_line(); - ss.str(m_str); ss >> m_ColorIndex; if(ss.fail()) return false; + ss.str(m_str); + ss >> m_ColorIndex; + if (ss.fail()) { + return false; + } break; default: // skip the next line @@ -2882,55 +3278,67 @@ bool CDxfRead::ReadPolyLine() return false; } -void CDxfRead::OnReadArc(double start_angle, double end_angle, double radius, const double* c, double z_extrusion_dir, bool hidden){ - double s[3] = {0,0,0}, e[3] = {0,0,0}, temp[3] = {0,0,0}; - if (z_extrusion_dir==1.0) - { - temp[0] =c[0]; - temp[1] =c[1]; - temp[2] =c[2]; - s[0] = c[0] + radius * cos(start_angle * M_PI/180); - s[1] = c[1] + radius * sin(start_angle * M_PI/180); - s[2] = c[2]; - e[0] = c[0] + radius * cos(end_angle * M_PI/180); - e[1] = c[1] + radius * sin(end_angle * M_PI/180); - e[2] = c[2]; - } - else - { - temp[0] =-c[0]; - temp[1] =c[1]; - temp[2] =c[2]; - - e[0] = -(c[0] + radius * cos(start_angle * M_PI/180)); - e[1] = (c[1] + radius * sin(start_angle * M_PI/180)); - e[2] = c[2]; - s[0] = -(c[0] + radius * cos(end_angle * M_PI/180)); - s[1] = (c[1] + radius * sin(end_angle * M_PI/180)); - s[2] = c[2]; +void CDxfRead::OnReadArc(double start_angle, + double end_angle, + double radius, + const double* c, + double z_extrusion_dir, + bool hidden) +{ + double s[3] = {0, 0, 0}, e[3] = {0, 0, 0}, temp[3] = {0, 0, 0}; + if (z_extrusion_dir == 1.0) { + temp[0] = c[0]; + temp[1] = c[1]; + temp[2] = c[2]; + s[0] = c[0] + radius * cos(start_angle * M_PI / 180); + s[1] = c[1] + radius * sin(start_angle * M_PI / 180); + s[2] = c[2]; + e[0] = c[0] + radius * cos(end_angle * M_PI / 180); + e[1] = c[1] + radius * sin(end_angle * M_PI / 180); + e[2] = c[2]; + } + else { + temp[0] = -c[0]; + temp[1] = c[1]; + temp[2] = c[2]; + e[0] = -(c[0] + radius * cos(start_angle * M_PI / 180)); + e[1] = (c[1] + radius * sin(start_angle * M_PI / 180)); + e[2] = c[2]; + s[0] = -(c[0] + radius * cos(end_angle * M_PI / 180)); + s[1] = (c[1] + radius * sin(end_angle * M_PI / 180)); + s[2] = c[2]; } OnReadArc(s, e, temp, true, hidden); } -void CDxfRead::OnReadCircle(const double* c, double radius, bool hidden){ +void CDxfRead::OnReadCircle(const double* c, double radius, bool hidden) +{ double s[3]; double start_angle = 0; - s[0] = c[0] + radius * cos(start_angle * M_PI/180); - s[1] = c[1] + radius * sin(start_angle * M_PI/180); + s[0] = c[0] + radius * cos(start_angle * M_PI / 180); + s[1] = c[1] + radius * sin(start_angle * M_PI / 180); s[2] = c[2]; - OnReadCircle(s, c, false, hidden); //false to change direction because otherwise the arc length is zero + OnReadCircle(s, + c, + false, + hidden);// false to change direction because otherwise the arc length is zero } -void CDxfRead::OnReadEllipse(const double* c, const double* m, double ratio, double start_angle, double end_angle){ - double major_radius = sqrt(m[0]*m[0] + m[1]*m[1] + m[2]*m[2]); +void CDxfRead::OnReadEllipse(const double* c, + const double* m, + double ratio, + double start_angle, + double end_angle) +{ + double major_radius = sqrt(m[0] * m[0] + m[1] * m[1] + m[2] * m[2]); double minor_radius = major_radius * ratio; - //Since we only support 2d stuff, we can calculate the rotation from the major axis x and y value only, - //since z is zero, major_radius is the vector length + // Since we only support 2d stuff, we can calculate the rotation from the major axis x and y + // value only, since z is zero, major_radius is the vector length - double rotation = atan2(m[1]/major_radius,m[0]/major_radius); + double rotation = atan2(m[1] / major_radius, m[0] / major_radius); OnReadEllipse(c, major_radius, minor_radius, rotation, start_angle, end_angle, true); @@ -2939,28 +3347,26 @@ void CDxfRead::OnReadEllipse(const double* c, const double* m, double ratio, dou bool CDxfRead::ReadInsert() { - double c[3] = {0,0,0}; // coordinate - double s[3] = {1,1,1}; // scale - double rot = 0.0; // rotation + double c[3] = {0, 0, 0};// coordinate + double s[3] = {1, 1, 1};// scale + double rot = 0.0; // rotation char name[1024] = {0}; - while(!((*m_ifs).eof())) - { + while (!((*m_ifs).eof())) { get_line(); int n; - if(sscanf(m_str, "%d", &n) != 1) - { + if (sscanf(m_str, "%d", &n) != 1) { printf("CDxfRead::ReadInsert() Failed to read integer from '%s'\n", m_str); return false; } std::istringstream ss; ss.imbue(std::locale("C")); - switch(n){ + switch (n) { case 0: // next item found ResolveColorIndex(); - OnReadInsert(c, s, name, rot * M_PI/180); - return(true); + OnReadInsert(c, s, name, rot * M_PI / 180); + return (true); case 8: // Layer name follows get_line(); @@ -2969,37 +3375,68 @@ bool CDxfRead::ReadInsert() case 10: // coord x get_line(); - ss.str(m_str); ss >> c[0]; c[0] = mm(c[0]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[0]; + c[0] = mm(c[0]); + if (ss.fail()) { + return false; + } break; case 20: // coord y get_line(); - ss.str(m_str); ss >> c[1]; c[1] = mm(c[1]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[1]; + c[1] = mm(c[1]); + if (ss.fail()) { + return false; + } break; case 30: // coord z get_line(); - ss.str(m_str); ss >> c[2]; c[2] = mm(c[2]); if(ss.fail()) return false; + ss.str(m_str); + ss >> c[2]; + c[2] = mm(c[2]); + if (ss.fail()) { + return false; + } break; case 41: // scale x get_line(); - ss.str(m_str); ss >> s[0]; if(ss.fail()) return false; + ss.str(m_str); + ss >> s[0]; + if (ss.fail()) { + return false; + } break; case 42: // scale y get_line(); - ss.str(m_str); ss >> s[1]; if(ss.fail()) return false; + ss.str(m_str); + ss >> s[1]; + if (ss.fail()) { + return false; + } break; case 43: // scale z get_line(); - ss.str(m_str); ss >> s[2]; if(ss.fail()) return false; + ss.str(m_str); + ss >> s[2]; + if (ss.fail()) { + return false; + } break; case 50: // rotation get_line(); - ss.str(m_str); ss >> rot; if(ss.fail()) return false; + ss.str(m_str); + ss >> rot; + if (ss.fail()) { + return false; + } break; case 2: // block name @@ -3009,7 +3446,11 @@ bool CDxfRead::ReadInsert() case 62: // color index get_line(); - ss.str(m_str); ss >> m_ColorIndex; if(ss.fail()) return false; + ss.str(m_str); + ss >> m_ColorIndex; + if (ss.fail()) { + return false; + } break; case 100: case 39: @@ -3031,28 +3472,26 @@ bool CDxfRead::ReadInsert() bool CDxfRead::ReadDimension() { - double s[3] = {0,0,0}; // startpoint - double e[3] = {0,0,0}; // endpoint - double p[3] = {0,0,0}; // dimpoint - double rot = -1.0; // rotation + double s[3] = {0, 0, 0};// startpoint + double e[3] = {0, 0, 0};// endpoint + double p[3] = {0, 0, 0};// dimpoint + double rot = -1.0; // rotation - while(!((*m_ifs).eof())) - { + while (!((*m_ifs).eof())) { get_line(); int n; - if(sscanf(m_str, "%d", &n) != 1) - { + if (sscanf(m_str, "%d", &n) != 1) { printf("CDxfRead::ReadInsert() Failed to read integer from '%s'\n", m_str); return false; } std::istringstream ss; ss.imbue(std::locale("C")); - switch(n){ + switch (n) { case 0: // next item found ResolveColorIndex(); - OnReadDimension(s, e, p, rot * M_PI/180); - return(true); + OnReadDimension(s, e, p, rot * M_PI / 180); + return (true); case 8: // Layer name follows get_line(); @@ -3061,57 +3500,110 @@ bool CDxfRead::ReadDimension() case 13: // start x get_line(); - ss.str(m_str); ss >> s[0]; s[0] = mm(s[0]); if(ss.fail()) return false; + ss.str(m_str); + ss >> s[0]; + s[0] = mm(s[0]); + if (ss.fail()) { + return false; + } break; case 23: // start y get_line(); - ss.str(m_str); ss >> s[1]; s[1] = mm(s[1]); if(ss.fail()) return false; + ss.str(m_str); + ss >> s[1]; + s[1] = mm(s[1]); + if (ss.fail()) { + return false; + } break; case 33: // start z get_line(); - ss.str(m_str); ss >> s[2]; s[2] = mm(s[2]); if(ss.fail()) return false; + ss.str(m_str); + ss >> s[2]; + s[2] = mm(s[2]); + if (ss.fail()) { + return false; + } break; case 14: // end x get_line(); - ss.str(m_str); ss >> e[0]; e[0] = mm(e[0]); if(ss.fail()) return false; + ss.str(m_str); + ss >> e[0]; + e[0] = mm(e[0]); + if (ss.fail()) { + return false; + } break; case 24: // end y get_line(); - ss.str(m_str); ss >> e[1]; e[1] = mm(e[1]); if(ss.fail()) return false; + ss.str(m_str); + ss >> e[1]; + e[1] = mm(e[1]); + if (ss.fail()) { + return false; + } break; case 34: // end z get_line(); - ss.str(m_str); ss >> e[2]; e[2] = mm(e[2]); if(ss.fail()) return false; + ss.str(m_str); + ss >> e[2]; + e[2] = mm(e[2]); + if (ss.fail()) { + return false; + } break; case 10: // dimline x get_line(); - ss.str(m_str); ss >> p[0]; p[0] = mm(p[0]); if(ss.fail()) return false; + ss.str(m_str); + ss >> p[0]; + p[0] = mm(p[0]); + if (ss.fail()) { + return false; + } break; case 20: // dimline y get_line(); - ss.str(m_str); ss >> p[1]; p[1] = mm(p[1]); if(ss.fail()) return false; + ss.str(m_str); + ss >> p[1]; + p[1] = mm(p[1]); + if (ss.fail()) { + return false; + } break; case 30: // dimline z get_line(); - ss.str(m_str); ss >> p[2]; p[2] = mm(p[2]); if(ss.fail()) return false; + ss.str(m_str); + ss >> p[2]; + p[2] = mm(p[2]); + if (ss.fail()) { + return false; + } break; case 50: // rotation get_line(); - ss.str(m_str); ss >> rot; if(ss.fail()) return false; + ss.str(m_str); + ss >> rot; + if (ss.fail()) { + return false; + } break; case 62: // color index get_line(); - ss.str(m_str); ss >> m_ColorIndex; if(ss.fail()) return false; + ss.str(m_str); + ss >> m_ColorIndex; + if (ss.fail()) { + return false; + } break; case 100: case 39: @@ -3133,18 +3625,16 @@ bool CDxfRead::ReadDimension() bool CDxfRead::ReadBlockInfo() { - while(!((*m_ifs).eof())) - { + while (!((*m_ifs).eof())) { get_line(); int n; - if(sscanf(m_str, "%d", &n) != 1) - { + if (sscanf(m_str, "%d", &n) != 1) { printf("CDxfRead::ReadBlockInfo() Failed to read integer from '%s'\n", m_str); return false; } std::istringstream ss; ss.imbue(std::locale("C")); - switch(n){ + switch (n) { case 2: // block name get_line(); @@ -3167,10 +3657,9 @@ bool CDxfRead::ReadBlockInfo() void CDxfRead::get_line() { - if (m_unused_line[0] != '\0') - { + if (m_unused_line[0] != '\0') { strcpy(m_str, m_unused_line); - memset( m_unused_line, '\0', sizeof(m_unused_line)); + memset(m_unused_line, '\0', sizeof(m_unused_line)); return; } @@ -3180,11 +3669,11 @@ void CDxfRead::get_line() size_t len = strlen(m_str); int j = 0; bool non_white_found = false; - for(size_t i = 0; i::const_iterator first = VersionNames.cbegin(); std::vector::const_iterator last = VersionNames.cend(); std::vector::const_iterator found = std::lower_bound(first, last, m_str); - if (found == last) + if (found == last) { m_version = RNewer; - else if (*found == m_str) + } + else if (*found == m_str) { m_version = (eDXFVersion_t)(std::distance(first, found) + (ROlder + 1)); - else if (found == first) + } + else if (found == first) { m_version = ROlder; - else + } + else { m_version = RUnknown; + } return ResolveEncoding(); } @@ -3323,7 +3812,8 @@ bool CDxfRead::ReadDWGCodePage() { get_line(); get_line(); - assert(m_CodePage == nullptr); // If not, we have found two DWGCODEPAGE variables or DoRead was called twice on the same CDxfRead object. + assert(m_CodePage == nullptr);// If not, we have found two DWGCODEPAGE variables or DoRead was + // called twice on the same CDxfRead object. m_CodePage = new std::string(m_str); return ResolveEncoding(); @@ -3335,7 +3825,7 @@ bool CDxfRead::ResolveEncoding() delete m_encoding; m_encoding = nullptr; } - if (m_version >= R2007) { // Note this does not include RUnknown, but does include RLater + if (m_version >= R2007) {// Note this does not include RUnknown, but does include RLater m_encoding = new std::string("utf_8"); stringToUTF8 = &CDxfRead::UTF8ToUTF8; } @@ -3345,31 +3835,37 @@ bool CDxfRead::ResolveEncoding() stringToUTF8 = &CDxfRead::GeneralToUTF8; } else { - // Codepage names may be of the form "ansi_1252" which we map to "cp1252" but we don't map "ansi_x3xxxx" (which happens to mean "ascii") + // Codepage names may be of the form "ansi_1252" which we map to "cp1252" but we don't map + // "ansi_x3xxxx" (which happens to mean "ascii") std::string* p = new std::string(*m_CodePage); std::string p_lower; - for (std::string::const_iterator i = p->begin(); i != p->end(); ++i) + for (std::string::const_iterator i = p->begin(); i != p->end(); ++i) { p_lower += tolower(*i); - if (p_lower.substr(0, 5) == "ansi_" - && p_lower.substr(0, 7) != "ansi_x3") + } + if (p_lower.substr(0, 5) == "ansi_" && p_lower.substr(0, 7) != "ansi_x3") { p->replace(0, 5, "cp"); + } m_encoding = p; - // At this point we want to recognize synonyms for "utf_8" and use the custom decoder function. - // This is because this is one of the common cases and our decoder function is a fast no-op. - // We don't actually use the decoder function we get from PyCodec_Decoder because to call it we have to convert the (char *) text into - // a 'bytes' object first so we can pass it to the function using PyObject_Callxxx(), getting the PYObject containing the - // Python string, which we then decode back to UTF-8. It is simpler to call PyUnicode_DecodeXxxx which takes a (const char *) - // and is just a direct c++ callable. + // At this point we want to recognize synonyms for "utf_8" and use the custom decoder + // function. This is because this is one of the common cases and our decoder function is a + // fast no-op. We don't actually use the decoder function we get from PyCodec_Decoder + // because to call it we have to convert the (char *) text into a 'bytes' object first so we + // can pass it to the function using PyObject_Callxxx(), getting the PYObject containing the + // Python string, which we then decode back to UTF-8. It is simpler to call + // PyUnicode_DecodeXxxx which takes a (const char *) and is just a direct c++ callable. Base::PyGILStateLocker lock; PyObject* pyDecoder = PyCodec_Decoder(m_encoding->c_str()); - if (pyDecoder == nullptr) - return false; // A key error exception will have been placed. + if (pyDecoder == nullptr) { + return false;// A key error exception will have been placed. + } PyObject* pyUTF8Decoder = PyCodec_Decoder("utf_8"); assert(pyUTF8Decoder != nullptr); - if (pyDecoder == pyUTF8Decoder) + if (pyDecoder == pyUTF8Decoder) { stringToUTF8 = &CDxfRead::UTF8ToUTF8; - else + } + else { stringToUTF8 = &CDxfRead::GeneralToUTF8; + } Py_DECREF(pyDecoder); Py_DECREF(pyUTF8Decoder); } @@ -3385,18 +3881,21 @@ const char* CDxfRead::GeneralToUTF8(const char* encoded) const { Base::PyGILStateLocker lock; PyObject* decoded = PyUnicode_Decode(encoded, strlen(encoded), m_encoding->c_str(), "strict"); - if (decoded == nullptr) + if (decoded == nullptr) { return nullptr; + } Py_ssize_t len; const char* converted = PyUnicode_AsUTF8AndSize(decoded, &len); char* result = nullptr; if (converted != nullptr) { // converted only has lifetime of decoded so we must save a copy. - result = (char *)malloc(len + 1); - if (result == nullptr) + result = (char*)malloc(len + 1); + if (result == nullptr) { PyErr_SetString(PyExc_MemoryError, "Out of memory"); - else + } + else { memcpy(result, converted, len + 1); + } } Py_DECREF(decoded); return result; @@ -3405,174 +3904,164 @@ const char* CDxfRead::GeneralToUTF8(const char* encoded) const void CDxfRead::DoRead(const bool ignore_errors /* = false */) { m_ignore_errors = ignore_errors; - if(m_fail) + if (m_fail) { return; + } get_line(); - while(!((*m_ifs).eof())) - { - if (!strcmp( m_str, "$INSUNITS" )){ - if (!ReadUnits()) + while (!((*m_ifs).eof())) { + if (!strcmp(m_str, "$INSUNITS")) { + if (!ReadUnits()) { return; + } continue; - } // End if - then + }// End if - then - if (!strcmp( m_str, "$MEASUREMENT" )){ + if (!strcmp(m_str, "$MEASUREMENT")) { get_line(); get_line(); int n = 1; - if(sscanf(m_str, "%d", &n) == 1) - { - if(n == 0)m_measurement_inch = true; + if (sscanf(m_str, "%d", &n) == 1) { + if (n == 0) { + m_measurement_inch = true; + } } continue; - } // End if - then + }// End if - then if (!strcmp(m_str, "$ACADVER")) { - if (!ReadVersion()) + if (!ReadVersion()) { return; + } continue; }// End if - then if (!strcmp(m_str, "$DWGCODEPAGE")) { - if (!ReadDWGCodePage()) - return; - continue; - }// End if - then - - if (!strcmp(m_str, "0")) - { - get_line(); - if (!strcmp( m_str, "SECTION" )){ - strcpy(m_section_name, ""); - get_line(); - get_line(); - if (strcmp( m_str, "ENTITIES" )) - strcpy(m_section_name, m_str); - strcpy(m_block_name, ""); - - } // End if - then - else if (!strcmp( m_str, "TABLE" )){ - get_line(); - get_line(); - } - - else if (!strcmp( m_str, "LAYER" )){ - get_line(); - get_line(); - if(!ReadLayer()) - { - printf("CDxfRead::DoRead() Failed to read layer\n"); - //return; Some objects or tables can have "LAYER" as name... - } - continue; - } - - else if (!strcmp( m_str, "BLOCK" )) { - if(!ReadBlockInfo()) - { - printf("CDxfRead::DoRead() Failed to read block info\n"); + if (!ReadDWGCodePage()) { return; } continue; - } // End if - then + }// End if - then - else if (!strcmp( m_str, "ENDSEC" )){ - strcpy(m_section_name, ""); - strcpy(m_block_name, ""); - } // End if - then - else if(!strcmp(m_str, "LINE")){ - if(!ReadLine()) - { + if (!strcmp(m_str, "0")) { + get_line(); + if (!strcmp(m_str, "SECTION")) { + strcpy(m_section_name, ""); + get_line(); + get_line(); + if (strcmp(m_str, "ENTITIES")) { + strcpy(m_section_name, m_str); + } + strcpy(m_block_name, ""); + + }// End if - then + else if (!strcmp(m_str, "TABLE")) { + get_line(); + get_line(); + } + + else if (!strcmp(m_str, "LAYER")) { + get_line(); + get_line(); + if (!ReadLayer()) { + printf("CDxfRead::DoRead() Failed to read layer\n"); + // return; Some objects or tables can have "LAYER" as name... + } + continue; + } + + else if (!strcmp(m_str, "BLOCK")) { + if (!ReadBlockInfo()) { + printf("CDxfRead::DoRead() Failed to read block info\n"); + return; + } + continue; + }// End if - then + + else if (!strcmp(m_str, "ENDSEC")) { + strcpy(m_section_name, ""); + strcpy(m_block_name, ""); + }// End if - then + else if (!strcmp(m_str, "LINE")) { + if (!ReadLine()) { printf("CDxfRead::DoRead() Failed to read line\n"); return; } continue; } - else if(!strcmp(m_str, "ARC")){ - if(!ReadArc()) - { + else if (!strcmp(m_str, "ARC")) { + if (!ReadArc()) { printf("CDxfRead::DoRead() Failed to read arc\n"); return; } continue; } - else if(!strcmp(m_str, "CIRCLE")){ - if(!ReadCircle()) - { + else if (!strcmp(m_str, "CIRCLE")) { + if (!ReadCircle()) { printf("CDxfRead::DoRead() Failed to read circle\n"); return; } continue; } - else if(!strcmp(m_str, "MTEXT")){ - if(!ReadText()) - { + else if (!strcmp(m_str, "MTEXT")) { + if (!ReadText()) { printf("CDxfRead::DoRead() Failed to read text\n"); return; } continue; } - else if(!strcmp(m_str, "TEXT")){ - if(!ReadText()) - { + else if (!strcmp(m_str, "TEXT")) { + if (!ReadText()) { printf("CDxfRead::DoRead() Failed to read text\n"); return; } continue; } - else if(!strcmp(m_str, "ELLIPSE")){ - if(!ReadEllipse()) - { + else if (!strcmp(m_str, "ELLIPSE")) { + if (!ReadEllipse()) { printf("CDxfRead::DoRead() Failed to read ellipse\n"); return; } continue; } - else if(!strcmp(m_str, "SPLINE")){ - if(!ReadSpline()) - { + else if (!strcmp(m_str, "SPLINE")) { + if (!ReadSpline()) { printf("CDxfRead::DoRead() Failed to read spline\n"); return; } continue; } else if (!strcmp(m_str, "LWPOLYLINE")) { - if(!ReadLwPolyLine()) - { + if (!ReadLwPolyLine()) { printf("CDxfRead::DoRead() Failed to read LW Polyline\n"); return; } continue; } else if (!strcmp(m_str, "POLYLINE")) { - if(!ReadPolyLine()) - { + if (!ReadPolyLine()) { printf("CDxfRead::DoRead() Failed to read Polyline\n"); return; } continue; } else if (!strcmp(m_str, "POINT")) { - if(!ReadPoint()) - { + if (!ReadPoint()) { printf("CDxfRead::DoRead() Failed to read Point\n"); return; } continue; } else if (!strcmp(m_str, "INSERT")) { - if(!ReadInsert()) - { + if (!ReadInsert()) { printf("CDxfRead::DoRead() Failed to read Insert\n"); return; } continue; } else if (!strcmp(m_str, "DIMENSION")) { - if(!ReadDimension()) - { + if (!ReadDimension()) { printf("CDxfRead::DoRead() Failed to read Dimension\n"); return; } @@ -3586,12 +4075,12 @@ void CDxfRead::DoRead(const bool ignore_errors /* = false */) } -void CDxfRead::ResolveColorIndex() +void CDxfRead::ResolveColorIndex() { - if (m_ColorIndex == ColorBylayer) // if color = layer color, replace by color from layer + if (m_ColorIndex == ColorBylayer)// if color = layer color, replace by color from layer { - m_ColorIndex = m_layer_ColorIndex_map[std::string(m_layer_name)]; + m_ColorIndex = m_layer_ColorIndex_map[std::string(m_layer_name)]; } } @@ -3599,22 +4088,19 @@ std::string CDxfRead::LayerName() const { std::string result; - if (strlen(m_section_name) > 0) - { + if (strlen(m_section_name) > 0) { result.append(m_section_name); result.append(" "); } - if (strlen(m_block_name) > 0) - { + if (strlen(m_block_name) > 0) { result.append(m_block_name); result.append(" "); } - if (strlen(m_layer_name) > 0) - { + if (strlen(m_layer_name) > 0) { result.append(m_layer_name); } - return(result); + return (result); } diff --git a/src/Mod/Import/App/dxf/dxf.h b/src/Mod/Import/App/dxf/dxf.h index b7bf67c69d..ab22e11ad4 100644 --- a/src/Mod/Import/App/dxf/dxf.h +++ b/src/Mod/Import/App/dxf/dxf.h @@ -21,12 +21,11 @@ #include - -typedef int ColorIndex_t; // DXF color index +typedef int ColorIndex_t;// DXF color index typedef enum { - eUnspecified = 0, // Unspecified (No units) + eUnspecified = 0,// Unspecified (No units) eInches, eFeet, eMiles, @@ -50,7 +49,7 @@ typedef enum } eDxfUnits_t; -//spline data for reading +// spline data for reading struct SplineData { double norm[3]; @@ -76,8 +75,8 @@ struct SplineData }; //*************************** -//data structures for writing -//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project +// data structures for writing +// added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project struct point3D { double x; @@ -104,7 +103,7 @@ struct SplineDataOut struct LWPolyDataOut { double nVert; - int Flag; + int Flag; double Width; double Elev; double Thick; @@ -132,7 +131,8 @@ typedef enum } eDXFVersion_t; //******************** -class CDxfWrite{ +class CDxfWrite +{ private: std::ofstream* m_ofs; bool m_fail; @@ -142,20 +142,32 @@ private: std::ostringstream* m_ssLayer; protected: - void putLine(const Base::Vector3d s, const Base::Vector3d e, - std::ostringstream* outStream, const std::string handle, + void putLine(const Base::Vector3d s, + const Base::Vector3d e, + std::ostringstream* outStream, + const std::string handle, const std::string ownerHandle); - void putText(const char* text, const Base::Vector3d location1, const Base::Vector3d location2, - const double height, const int horizJust, - std::ostringstream* outStream, const std::string handle, + void putText(const char* text, + const Base::Vector3d location1, + const Base::Vector3d location2, + const double height, + const int horizJust, + std::ostringstream* outStream, + const std::string handle, const std::string ownerHandle); - void putArrow(Base::Vector3d arrowPos, Base::Vector3d barb1Pos, Base::Vector3d barb2Pos, - std::ostringstream* outStream, const std::string handle, + void putArrow(Base::Vector3d arrowPos, + Base::Vector3d barb1Pos, + Base::Vector3d barb2Pos, + std::ostringstream* outStream, + const std::string handle, const std::string ownerHandle); //! copy boiler plate file std::string getPlateFile(std::string fileSpec); - void setDataDir(std::string s) { m_dataDir = s; } + void setDataDir(std::string s) + { + m_dataDir = s; + } std::string getHandle(); std::string getEntityHandle(); std::string getLayerHandle(); @@ -170,7 +182,7 @@ protected: int m_blockHandle; int m_blkRecordHandle; bool m_polyOverride; - + std::string m_saveModelSpaceHandle; std::string m_savePaperSpaceHandle; std::string m_saveBlockRecordTableHandle; @@ -185,56 +197,93 @@ protected: public: ImportExport CDxfWrite(const char* filepath); ImportExport ~CDxfWrite(); - + ImportExport void init(); ImportExport void endRun(); - ImportExport bool Failed(){return m_fail;} -// void setOptions(void); -// bool isVersionValid(int vers); - ImportExport std::string getLayerName() { return m_layerName; } + ImportExport bool Failed() + { + return m_fail; + } + // void setOptions(void); + // bool isVersionValid(int vers); + ImportExport std::string getLayerName() + { + return m_layerName; + } ImportExport void setLayerName(std::string s); - ImportExport void setVersion(int v) { m_version = v;} - ImportExport void setPolyOverride(bool b) { m_polyOverride = b; } + ImportExport void setVersion(int v) + { + m_version = v; + } + ImportExport void setPolyOverride(bool b) + { + m_polyOverride = b; + } ImportExport void addBlockName(std::string s, std::string blkRecordHandle); ImportExport void writeLine(const double* s, const double* e); ImportExport void writePoint(const double*); ImportExport void writeArc(const double* s, const double* e, const double* c, bool dir); - ImportExport void writeEllipse(const double* c, double major_radius, double minor_radius, - double rotation, double start_angle, double end_angle, bool endIsCW); - ImportExport void writeCircle(const double* c, double radius ); - ImportExport void writeSpline(const SplineDataOut &sd); - ImportExport void writeLWPolyLine(const LWPolyDataOut &pd); - ImportExport void writePolyline(const LWPolyDataOut &pd); + ImportExport void writeEllipse(const double* c, + double major_radius, + double minor_radius, + double rotation, + double start_angle, + double end_angle, + bool endIsCW); + ImportExport void writeCircle(const double* c, double radius); + ImportExport void writeSpline(const SplineDataOut& sd); + ImportExport void writeLWPolyLine(const LWPolyDataOut& pd); + ImportExport void writePolyline(const LWPolyDataOut& pd); ImportExport void writeVertex(double x, double y, double z); - ImportExport void writeText(const char* text, const double* location1, const double* location2, - const double height, const int horizJust); - ImportExport void writeLinearDim(const double* textMidPoint, const double* lineDefPoint, - const double* extLine1, const double* extLine2, - const char* dimText, int type); - ImportExport void writeLinearDimBlock(const double* textMidPoint, const double* lineDefPoint, - const double* extLine1, const double* extLine2, - const char* dimText, int type); - ImportExport void writeAngularDim(const double* textMidPoint, const double* lineDefPoint, - const double* startExt1, const double* endExt1, - const double* startExt2, const double* endExt2, - const char* dimText); - ImportExport void writeAngularDimBlock(const double* textMidPoint, const double* lineDefPoint, - const double* startExt1, const double* endExt1, - const double* startExt2, const double* endExt2, - const char* dimText); - ImportExport void writeRadialDim(const double* centerPoint, const double* textMidPoint, - const double* arcPoint, - const char* dimText); - ImportExport void writeRadialDimBlock(const double* centerPoint, const double* textMidPoint, - const double* arcPoint, const char* dimText); + ImportExport void writeText(const char* text, + const double* location1, + const double* location2, + const double height, + const int horizJust); + ImportExport void writeLinearDim(const double* textMidPoint, + const double* lineDefPoint, + const double* extLine1, + const double* extLine2, + const char* dimText, + int type); + ImportExport void writeLinearDimBlock(const double* textMidPoint, + const double* lineDefPoint, + const double* extLine1, + const double* extLine2, + const char* dimText, + int type); + ImportExport void writeAngularDim(const double* textMidPoint, + const double* lineDefPoint, + const double* startExt1, + const double* endExt1, + const double* startExt2, + const double* endExt2, + const char* dimText); + ImportExport void writeAngularDimBlock(const double* textMidPoint, + const double* lineDefPoint, + const double* startExt1, + const double* endExt1, + const double* startExt2, + const double* endExt2, + const char* dimText); + ImportExport void writeRadialDim(const double* centerPoint, + const double* textMidPoint, + const double* arcPoint, + const char* dimText); + ImportExport void writeRadialDimBlock(const double* centerPoint, + const double* textMidPoint, + const double* arcPoint, + const char* dimText); ImportExport void writeDiametricDim(const double* textMidPoint, - const double* arcPoint1, const double* arcPoint2, - const char* dimText); + const double* arcPoint1, + const double* arcPoint2, + const char* dimText); ImportExport void writeDiametricDimBlock(const double* textMidPoint, - const double* arcPoint1, const double* arcPoint2, - const char* dimText); + const double* arcPoint1, + const double* arcPoint2, + const char* dimText); ImportExport void writeDimBlockPreamble(); ImportExport void writeBlockTrailer(); @@ -253,7 +302,8 @@ public: }; // derive a class from this and implement it's virtual functions -class CDxfRead{ +class CDxfRead +{ private: std::ifstream* m_ifs; @@ -268,7 +318,8 @@ private: bool m_ignore_errors; - std::map m_layer_ColorIndex_map; // Mapping from layer name -> layer color index + std::map + m_layer_ColorIndex_map;// Mapping from layer name -> layer color index const ColorIndex_t ColorBylayer = 256; const ColorIndex_t ColorByBlock = 0; @@ -283,10 +334,19 @@ private: bool ReadSpline(); bool ReadLwPolyLine(); bool ReadPolyLine(); - bool ReadVertex(double *pVertex, bool *bulge_found, double *bulge); - void OnReadArc(double start_angle, double end_angle, double radius, const double* c, double z_extrusion_dir, bool hidden); + bool ReadVertex(double* pVertex, bool* bulge_found, double* bulge); + void OnReadArc(double start_angle, + double end_angle, + double radius, + const double* c, + double z_extrusion_dir, + bool hidden); void OnReadCircle(const double* c, double radius, bool hidden); - void OnReadEllipse(const double* c, const double* m, double ratio, double start_angle, double end_angle); + void OnReadEllipse(const double* c, + const double* m, + double ratio, + double start_angle, + double end_angle); bool ReadInsert(); bool ReadDimension(); bool ReadBlockInfo(); @@ -295,7 +355,7 @@ private: bool ResolveEncoding(); void get_line(); - void put_line(const char *value); + void put_line(const char* value); void ResolveColorIndex(); protected: @@ -304,35 +364,70 @@ protected: const char* (CDxfRead::*stringToUTF8)(const char*) const; private: - const std::string* m_CodePage; // Code Page name from $DWGCODEPAGE or null if none/not read yet - // The following was going to be python's canonical name for the encoding, but this is (a) not easily found and (b) does not speed up finding the encoding object. + const std::string* m_CodePage;// Code Page name from $DWGCODEPAGE or null if none/not read yet + // The following was going to be python's canonical name for the encoding, but this is (a) not + // easily found and (b) does not speed up finding the encoding object. const std::string* m_encoding;// A name for the encoding implied by m_version and m_CodePage const char* UTF8ToUTF8(const char* encoded) const; const char* GeneralToUTF8(const char* encoded) const; public: - ImportExport CDxfRead(const char* filepath); // this opens the file - ImportExport virtual ~CDxfRead(); // this closes the file + ImportExport CDxfRead(const char* filepath);// this opens the file + ImportExport virtual ~CDxfRead(); // this closes the file - ImportExport bool Failed(){return m_fail;} - ImportExport void DoRead(const bool ignore_errors = false); // this reads the file and calls the following functions + ImportExport bool Failed() + { + return m_fail; + } + ImportExport void DoRead( + const bool ignore_errors = false);// this reads the file and calls the following functions - ImportExport double mm( double value ) const; + ImportExport double mm(double value) const; - ImportExport bool IgnoreErrors() const { return(m_ignore_errors); } + ImportExport bool IgnoreErrors() const + { + return (m_ignore_errors); + } - ImportExport virtual void OnReadLine(const double* /*s*/, const double* /*e*/, bool /*hidden*/){} - ImportExport virtual void OnReadPoint(const double* /*s*/){} - ImportExport virtual void OnReadText(const double* /*point*/, const double /*height*/, const char* /*text*/){} - ImportExport virtual void OnReadArc(const double* /*s*/, const double* /*e*/, const double* /*c*/, bool /*dir*/, bool /*hidden*/){} - ImportExport virtual void OnReadCircle(const double* /*s*/, const double* /*c*/, bool /*dir*/, bool /*hidden*/){} - ImportExport virtual void OnReadEllipse(const double* /*c*/, double /*major_radius*/, double /*minor_radius*/, double /*rotation*/, double /*start_angle*/, double /*end_angle*/, bool /*dir*/){} - ImportExport virtual void OnReadSpline(struct SplineData& /*sd*/){} - ImportExport virtual void OnReadInsert(const double* /*point*/, const double* /*scale*/, const char* /*name*/, double /*rotation*/){} - ImportExport virtual void OnReadDimension(const double* /*s*/, const double* /*e*/, const double* /*point*/, double /*rotation*/){} - ImportExport virtual void AddGraphics() const { } + ImportExport virtual void OnReadLine(const double* /*s*/, const double* /*e*/, bool /*hidden*/) + {} + ImportExport virtual void OnReadPoint(const double* /*s*/) + {} + ImportExport virtual void + OnReadText(const double* /*point*/, const double /*height*/, const char* /*text*/) + {} + ImportExport virtual void OnReadArc(const double* /*s*/, + const double* /*e*/, + const double* /*c*/, + bool /*dir*/, + bool /*hidden*/) + {} + ImportExport virtual void + OnReadCircle(const double* /*s*/, const double* /*c*/, bool /*dir*/, bool /*hidden*/) + {} + ImportExport virtual void OnReadEllipse(const double* /*c*/, + double /*major_radius*/, + double /*minor_radius*/, + double /*rotation*/, + double /*start_angle*/, + double /*end_angle*/, + bool /*dir*/) + {} + ImportExport virtual void OnReadSpline(struct SplineData& /*sd*/) + {} + ImportExport virtual void OnReadInsert(const double* /*point*/, + const double* /*scale*/, + const char* /*name*/, + double /*rotation*/) + {} + ImportExport virtual void OnReadDimension(const double* /*s*/, + const double* /*e*/, + const double* /*point*/, + double /*rotation*/) + {} + ImportExport virtual void AddGraphics() const + {} ImportExport std::string LayerName() const; - }; #endif diff --git a/src/Mod/Import/Gui/AppImportGui.cpp b/src/Mod/Import/Gui/AppImportGui.cpp index 99e8aea2e9..e1d815bc98 100644 --- a/src/Mod/Import/Gui/AppImportGui.cpp +++ b/src/Mod/Import/Gui/AppImportGui.cpp @@ -10,12 +10,12 @@ * for detail see the LICENCE text file. * * * * FreeCAD is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Library General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * - * License along with FreeCAD; if not, write to the Free Software * + * License along with FreeCAD; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * * USA * * * @@ -35,7 +35,8 @@ void CreateImportCommands(); -namespace ImportGui { +namespace ImportGui +{ extern PyObject* initModule(); } @@ -49,7 +50,7 @@ PyMOD_INIT_FUNC(ImportGui) try { Base::Interpreter().loadModule("PartGui"); } - catch(const Base::Exception& e) { + catch (const Base::Exception& e) { PyErr_SetString(PyExc_ImportError, e.what()); PyMOD_Return(nullptr); } diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index 6ef4d14b70..1b6fbc461e 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -22,77 +22,77 @@ #include "PreCompiled.h" #if defined(__MINGW32__) -# define WNT // avoid conflict with GUID +#define WNT// avoid conflict with GUID #endif #ifndef _PreComp_ -# include -# include +#include +#include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wextra-semi" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wextra-semi" #endif -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -# if OCC_VERSION_HEX >= 0x070500 -# include -# include -# endif -# if defined(__clang__) -# pragma clang diagnostic pop -# endif +#if OCC_VERSION_HEX >= 0x070500 +#include +#include +#endif +#if defined(__clang__) +#pragma clang diagnostic pop +#endif #endif #include @@ -105,19 +105,20 @@ #include #include #include -#include -#include -#include #include #include #include +#include #include +#include #include +#include FC_LOG_LEVEL_INIT("Import", true, true) -namespace ImportGui { +namespace ImportGui +{ class OCAFBrowser { public: @@ -146,10 +147,10 @@ private: void load(const TDF_Label& label, QTreeWidgetItem* item, const QString&); std::string toString(const TCollection_ExtendedString& extstr) const { - char* str = new char[extstr.LengthOfCString()+1]; + char* str = new char[extstr.LengthOfCString() + 1]; extstr.ToUTF8CString(str); std::string text(str); - delete [] str; + delete[] str; return text; } @@ -176,15 +177,16 @@ void OCAFBrowser::load(const TDF_Label& label, QTreeWidgetItem* item, const QStr label.Dump(std::cout); Handle(TDataStd_Name) name; - if (label.FindAttribute(TDataStd_Name::GetID(),name)) { - QString text = QString::fromLatin1("%1 %2").arg(s, QString::fromUtf8(toString(name->Get()).c_str())); + if (label.FindAttribute(TDataStd_Name::GetID(), name)) { + QString text = + QString::fromLatin1("%1 %2").arg(s, QString::fromUtf8(toString(name->Get()).c_str())); item->setText(0, text); } TDF_IDList localList; - TDF_AttributeIterator itr (label); - for ( ; itr.More(); itr.Next()) { + TDF_AttributeIterator itr(label); + for (; itr.More(); itr.Next()) { localList.Append(itr.Value()->ID()); } @@ -221,33 +223,33 @@ void OCAFBrowser::load(const TDF_Label& label, QTreeWidgetItem* item, const QStr str << attr->DynamicType()->Name() << " = "; if (!shape.IsNull()) { switch (shape.ShapeType()) { - case TopAbs_COMPOUND: - str << "COMPOUND PRIMITIVE"; - break; - case TopAbs_COMPSOLID: - str << "COMPSOLID PRIMITIVE"; - break; - case TopAbs_SOLID: - str << "SOLID PRIMITIVE"; - break; - case TopAbs_SHELL: - str << "SHELL PRIMITIVE"; - break; - case TopAbs_FACE: - str << "FACE PRIMITIVE"; - break; - case TopAbs_WIRE: - str << "WIRE PRIMITIVE"; - break; - case TopAbs_EDGE: - str << "EDGE PRIMITIVE"; - break; - case TopAbs_VERTEX: - str << "VERTEX PRIMITIVE"; - break; - case TopAbs_SHAPE: - str << "SHAPE PRIMITIVE"; - break; + case TopAbs_COMPOUND: + str << "COMPOUND PRIMITIVE"; + break; + case TopAbs_COMPSOLID: + str << "COMPSOLID PRIMITIVE"; + break; + case TopAbs_SOLID: + str << "SOLID PRIMITIVE"; + break; + case TopAbs_SHELL: + str << "SHELL PRIMITIVE"; + break; + case TopAbs_FACE: + str << "FACE PRIMITIVE"; + break; + case TopAbs_WIRE: + str << "WIRE PRIMITIVE"; + break; + case TopAbs_EDGE: + str << "EDGE PRIMITIVE"; + break; + case TopAbs_VERTEX: + str << "VERTEX PRIMITIVE"; + break; + case TopAbs_SHAPE: + str << "SHAPE PRIMITIVE"; + break; } } child->setText(0, text); @@ -259,8 +261,8 @@ void OCAFBrowser::load(const TDF_Label& label, QTreeWidgetItem* item, const QStr } - int i=1; - for (TDF_ChildIterator it(label); it.More(); it.Next(),i++) { + int i = 1; + for (TDF_ChildIterator it(label); it.More(); it.Next(), i++) { QString text = QString::fromLatin1("%1:%2").arg(s).arg(i); QTreeWidgetItem* child = new QTreeWidgetItem(); child->setText(0, text); @@ -270,24 +272,26 @@ void OCAFBrowser::load(const TDF_Label& label, QTreeWidgetItem* item, const QStr } } -class ImportOCAFExt : public Import::ImportOCAF2 +class ImportOCAFExt: public Import::ImportOCAF2 { public: ImportOCAFExt(Handle(TDocStd_Document) h, App::Document* d, const std::string& name) : ImportOCAF2(h, d, name) - { - } + {} private: - void applyFaceColors(Part::Feature* part, const std::vector& colors) override { - auto vp = dynamic_cast(Gui::Application::Instance->getViewProvider(part)); - if (!vp) + void applyFaceColors(Part::Feature* part, const std::vector& colors) override + { + auto vp = dynamic_cast( + Gui::Application::Instance->getViewProvider(part)); + if (!vp) { return; - if(colors.empty()) { + } + if (colors.empty()) { return; } - if(colors.size() == 1) { + if (colors.size() == 1) { vp->ShapeColor.setValue(colors.front()); vp->Transparency.setValue(100 * colors.front().a); } @@ -295,99 +299,120 @@ private: vp->DiffuseColor.setValues(colors); } } - void applyEdgeColors(Part::Feature* part, const std::vector& colors) override { - auto vp = dynamic_cast(Gui::Application::Instance->getViewProvider(part)); - if (!vp) + void applyEdgeColors(Part::Feature* part, const std::vector& colors) override + { + auto vp = dynamic_cast( + Gui::Application::Instance->getViewProvider(part)); + if (!vp) { return; - if(colors.size() == 1) + } + if (colors.size() == 1) { vp->LineColor.setValue(colors.front()); - else + } + else { vp->LineColorArray.setValues(colors); + } } - void applyLinkColor(App::DocumentObject *obj, int index, App::Color color) override { - auto vp = dynamic_cast(Gui::Application::Instance->getViewProvider(obj)); - if(!vp) + void applyLinkColor(App::DocumentObject* obj, int index, App::Color color) override + { + auto vp = + dynamic_cast(Gui::Application::Instance->getViewProvider(obj)); + if (!vp) { return; - if(index<0) { + } + if (index < 0) { vp->OverrideMaterial.setValue(true); vp->ShapeMaterial.setDiffuseColor(color); return; } - if(vp->OverrideMaterialList.getSize()<=index) - vp->OverrideMaterialList.setSize(index+1); - vp->OverrideMaterialList.set1Value(index,true); + if (vp->OverrideMaterialList.getSize() <= index) { + vp->OverrideMaterialList.setSize(index + 1); + } + vp->OverrideMaterialList.set1Value(index, true); App::Material mat(App::Material::DEFAULT); - if(vp->MaterialList.getSize()<=index) - vp->MaterialList.setSize(index+1,mat); + if (vp->MaterialList.getSize() <= index) { + vp->MaterialList.setSize(index + 1, mat); + } mat.diffuseColor = color; - vp->MaterialList.set1Value(index,mat); + vp->MaterialList.set1Value(index, mat); } - void applyElementColors(App::DocumentObject *obj, - const std::map &colors) override + void applyElementColors(App::DocumentObject* obj, + const std::map& colors) override { auto vp = Gui::Application::Instance->getViewProvider(obj); - if(!vp) + if (!vp) { return; + } (void)colors; } }; -class ExportOCAFGui : public Import::ExportOCAF +class ExportOCAFGui: public Import::ExportOCAF { public: ExportOCAFGui(Handle(TDocStd_Document) h, bool explicitPlacement) : ExportOCAF(h, explicitPlacement) - { - } + {} void findColors(Part::Feature* part, std::vector& colors) const override { Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider(part); if (vp && vp->isDerivedFrom(PartGui::ViewProviderPartExt::getClassTypeId())) { colors = static_cast(vp)->DiffuseColor.getValues(); - if (colors.empty()) - colors.push_back(static_cast(vp)->ShapeColor.getValue()); + if (colors.empty()) { + colors.push_back( + static_cast(vp)->ShapeColor.getValue()); + } } } }; -class Module : public Py::ExtensionModule +class Module: public Py::ExtensionModule { public: - Module() : Py::ExtensionModule("ImportGui") + Module() + : Py::ExtensionModule("ImportGui") { - add_keyword_method("open",&Module::insert, - "open(string) -- Open the file and create a new document." - ); - add_keyword_method("insert",&Module::insert, - "insert(string,string) -- Insert the file into the given document." - ); - add_varargs_method("exportOptions",&Module::exportOptions, - "exportOptions(string) -- Return the export options of a file type." - ); - add_keyword_method("export",&Module::exporter, - "export(list,string) -- Export a list of objects into a single file." - ); - add_varargs_method("ocaf",&Module::ocaf, - "ocaf(string) -- Browse the ocaf structure." - ); - initialize("This module is the ImportGui module."); // register with Python + add_keyword_method("open", + &Module::insert, + "open(string) -- Open the file and create a new document."); + add_keyword_method("insert", + &Module::insert, + "insert(string,string) -- Insert the file into the given document."); + add_varargs_method("exportOptions", + &Module::exportOptions, + "exportOptions(string) -- Return the export options of a file type."); + add_keyword_method("export", + &Module::exporter, + "export(list,string) -- Export a list of objects into a single file."); + add_varargs_method("ocaf", &Module::ocaf, "ocaf(string) -- Browse the ocaf structure."); + initialize("This module is the ImportGui module.");// register with Python } private: - Py::Object insert(const Py::Tuple& args, const Py::Dict &kwds) + Py::Object insert(const Py::Tuple& args, const Py::Dict& kwds) { char* Name; - char* DocName=nullptr; - PyObject *importHidden = Py_None; - PyObject *merge = Py_None; - PyObject *useLinkGroup = Py_None; + char* DocName = nullptr; + PyObject* importHidden = Py_None; + PyObject* merge = Py_None; + PyObject* useLinkGroup = Py_None; int mode = -1; - static const std::array kwd_list{"name", "docName", "importHidden", "merge", "useLinkGroup", - "mode", nullptr}; - if (!Base::Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "et|sO!O!O!i", - kwd_list, "utf-8", &Name, &DocName, &PyBool_Type, &importHidden, - &PyBool_Type, &merge, - &PyBool_Type, &useLinkGroup, &mode)) { + static const std::array + kwd_list {"name", "docName", "importHidden", "merge", "useLinkGroup", "mode", nullptr}; + if (!Base::Wrapped_ParseTupleAndKeywords(args.ptr(), + kwds.ptr(), + "et|sO!O!O!i", + kwd_list, + "utf-8", + &Name, + &DocName, + &PyBool_Type, + &importHidden, + &PyBool_Type, + &merge, + &PyBool_Type, + &useLinkGroup, + &mode)) { throw Py::Exception(); } @@ -398,7 +423,7 @@ private: try { Base::FileInfo file(Utf8Name.c_str()); - App::Document *pcDoc = nullptr; + App::Document* pcDoc = nullptr; if (DocName) { pcDoc = App::GetApplication().getDocument(DocName); } @@ -412,16 +437,18 @@ private: ImportOCAFExt ocaf(hDoc, pcDoc, file.fileNamePure()); ocaf.setImportOptions(ImportOCAFExt::customImportOptions()); FC_TIME_INIT(t); - FC_DURATION_DECL_INIT2(d1,d2); + FC_DURATION_DECL_INIT2(d1, d2); if (file.hasExtension({"stp", "step"})) { - if(mode<0) + if (mode < 0) { mode = ocaf.getMode(); - if(mode && !pcDoc->isSaved()) { + } + if (mode && !pcDoc->isSaved()) { auto gdoc = Gui::Application::Instance->getDocument(pcDoc); - if(!gdoc->save()) + if (!gdoc->save()) { return Py::Object(); + } } try { @@ -449,20 +476,24 @@ private: Base::Console().Error("%s\n", e.GetMessageString()); Base::Console().Message("Try to load STEP file without colors...\n"); - Part::ImportStepParts(pcDoc,Utf8Name.c_str()); + Part::ImportStepParts(pcDoc, Utf8Name.c_str()); pcDoc->recompute(); } } else if (file.hasExtension({"igs", "iges"})) { - Base::Reference hGrp = App::GetApplication().GetUserParameter() - .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("IGES"); + Base::Reference hGrp = App::GetApplication() + .GetUserParameter() + .GetGroup("BaseApp") + ->GetGroup("Preferences") + ->GetGroup("Mod/Part") + ->GetGroup("IGES"); try { IGESControl_Controller::Init(); IGESCAFControl_Reader aReader; // http://www.opencascade.org/org/forum/thread_20603/?forum=3 - aReader.SetReadVisible(hGrp->GetBool("SkipBlankEntities", true) - ? Standard_True : Standard_False); + aReader.SetReadVisible( + hGrp->GetBool("SkipBlankEntities", true) ? Standard_True : Standard_False); aReader.SetColorMode(true); aReader.SetNameMode(true); aReader.SetLayerMode(true); @@ -482,13 +513,13 @@ private: #endif // http://opencascade.blogspot.de/2009/03/unnoticeable-memory-leaks-part-2.html Handle(IGESToBRep_Actor)::DownCast(aReader.WS()->TransferReader()->Actor()) - ->SetModel(new IGESData_IGESModel); + ->SetModel(new IGESData_IGESModel); } catch (OSD_Exception& e) { Base::Console().Error("%s\n", e.GetMessageString()); Base::Console().Message("Try to load IGES file without colors...\n"); - Part::ImportIgesParts(pcDoc,Utf8Name.c_str()); + Part::ImportIgesParts(pcDoc, Utf8Name.c_str()); pcDoc->recompute(); } } @@ -496,25 +527,28 @@ private: throw Py::Exception(PyExc_IOError, "no supported file format"); } - FC_DURATION_PLUS(d1,t); - if (merge != Py_None) + FC_DURATION_PLUS(d1, t); + if (merge != Py_None) { ocaf.setMerge(Base::asBoolean(merge)); - if (importHidden != Py_None) + } + if (importHidden != Py_None) { ocaf.setImportHiddenObject(Base::asBoolean(importHidden)); - if (useLinkGroup != Py_None) + } + if (useLinkGroup != Py_None) { ocaf.setUseLinkGroup(Base::asBoolean(useLinkGroup)); + } ocaf.setMode(mode); auto ret = ocaf.loadShapes(); hApp->Close(hDoc); - FC_DURATION_PLUS(d2,t); - FC_DURATION_LOG(d1,"file read"); - FC_DURATION_LOG(d2,"import"); - FC_DURATION_LOG((d1+d2),"total"); + FC_DURATION_PLUS(d2, t); + FC_DURATION_LOG(d1, "file read"); + FC_DURATION_LOG(d2, "import"); + FC_DURATION_LOG((d1 + d2), "total"); - if(ret) { + if (ret) { App::GetApplication().setActiveDocument(pcDoc); auto gdoc = Gui::Application::Instance->getDocument(pcDoc); - if(gdoc) { + if (gdoc) { gdoc->setActiveView(); Gui::Application::Instance->commandManager().runCommandByName("Std_ViewFitAll"); } @@ -532,18 +566,22 @@ private: return Py::None(); } - static std::map getShapeColors(App::DocumentObject *obj, const char *subname) { + static std::map getShapeColors(App::DocumentObject* obj, + const char* subname) + { auto vp = Gui::Application::Instance->getViewProvider(obj); - if(vp) + if (vp) { return vp->getElementColors(subname); + } return {}; } Py::Object exportOptions(const Py::Tuple& args) { char* Name; - if (!PyArg_ParseTuple(args.ptr(), "et", "utf-8", &Name)) + if (!PyArg_ParseTuple(args.ptr(), "et", "utf-8", &Name)) { throw Py::Exception(); + } std::string Utf8Name = std::string(Name); PyMem_Free(Name); @@ -565,23 +603,31 @@ private: return options; } - Py::Object exporter(const Py::Tuple& args, const Py::Dict &kwds) + Py::Object exporter(const Py::Tuple& args, const Py::Dict& kwds) { PyObject* object; char* Name; - PyObject *pyoptions = nullptr; - PyObject *pyexportHidden = Py_None; - PyObject *pylegacy = Py_None; - PyObject *pykeepPlacement = Py_None; - static const std::array kwd_list{"obj", "name", "options", "exportHidden", "legacy", - "keepPlacement", nullptr}; - if (!Base::Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "Oet|O!O!O!O!", - kwd_list, &object, - "utf-8", &Name, - &PyDict_Type, &pyoptions, - &PyBool_Type, &pyexportHidden, - &PyBool_Type, &pylegacy, - &PyBool_Type, &pykeepPlacement)) { + PyObject* pyoptions = nullptr; + PyObject* pyexportHidden = Py_None; + PyObject* pylegacy = Py_None; + PyObject* pykeepPlacement = Py_None; + static const std::array + kwd_list {"obj", "name", "options", "exportHidden", "legacy", "keepPlacement", nullptr}; + if (!Base::Wrapped_ParseTupleAndKeywords(args.ptr(), + kwds.ptr(), + "Oet|O!O!O!O!", + kwd_list, + &object, + "utf-8", + &Name, + &PyDict_Type, + &pyoptions, + &PyBool_Type, + &pyexportHidden, + &PyBool_Type, + &pylegacy, + &PyBool_Type, + &pykeepPlacement)) { throw Py::Exception(); } @@ -593,9 +639,12 @@ private: Part::OCAF::ImportExportSettings settings; // still support old way - bool legacyExport = (pylegacy == Py_None ? settings.getExportLegacy() : Base::asBoolean(pylegacy)); - bool exportHidden = (pyexportHidden == Py_None ? settings.getExportHiddenObject() : Base::asBoolean(pyexportHidden)); - bool keepPlacement = (pykeepPlacement == Py_None ? settings.getExportKeepPlacement() : Base::asBoolean(pykeepPlacement)); + bool legacyExport = + (pylegacy == Py_None ? settings.getExportLegacy() : Base::asBoolean(pylegacy)); + bool exportHidden = (pyexportHidden == Py_None ? settings.getExportHiddenObject() + : Base::asBoolean(pyexportHidden)); + bool keepPlacement = (pykeepPlacement == Py_None ? settings.getExportKeepPlacement() + : Base::asBoolean(pykeepPlacement)); // new way if (pyoptions) { @@ -617,11 +666,13 @@ private: Handle(TDocStd_Document) hDoc; hApp->NewDocument(TCollection_ExtendedString("MDTV-CAF"), hDoc); - std::vector objs; + std::vector objs; for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { PyObject* item = (*it).ptr(); - if (PyObject_TypeCheck(item, &(App::DocumentObjectPy::Type))) - objs.push_back(static_cast(item)->getDocumentObjectPtr()); + if (PyObject_TypeCheck(item, &(App::DocumentObjectPy::Type))) { + objs.push_back( + static_cast(item)->getDocumentObjectPtr()); + } } Import::ExportOCAF2 ocaf(hDoc, &getShapeColors); @@ -636,32 +687,36 @@ private: bool keepExplicitPlacement = Standard_True; ExportOCAFGui ocaf(hDoc, keepExplicitPlacement); // That stuff is exporting a list of selected objects into FreeCAD Tree - std::vector hierarchical_label; - std::vector hierarchical_loc; - std::vector hierarchical_part; - for(auto obj : objs) - ocaf.exportObject(obj,hierarchical_label, hierarchical_loc,hierarchical_part); + std::vector hierarchical_label; + std::vector hierarchical_loc; + std::vector hierarchical_part; + for (auto obj : objs) { + ocaf.exportObject(obj, hierarchical_label, hierarchical_loc, hierarchical_part); + } // Free Shapes must have absolute placement and not explicit - std::vector FreeLabels; - std::vector part_id; - ocaf.getFreeLabels(hierarchical_label,FreeLabels, part_id); - // Got issue with the colors as they are coming from the View Provider they can't be determined into - // the App Code. - std::vector< std::vector > Colors; - ocaf.getPartColors(hierarchical_part,FreeLabels,part_id,Colors); - ocaf.reallocateFreeShape(hierarchical_part,FreeLabels,part_id,Colors); + std::vector FreeLabels; + std::vector part_id; + ocaf.getFreeLabels(hierarchical_label, FreeLabels, part_id); + // Got issue with the colors as they are coming from the View Provider they can't be + // determined into the App Code. + std::vector> Colors; + ocaf.getPartColors(hierarchical_part, FreeLabels, part_id, Colors); + ocaf.reallocateFreeShape(hierarchical_part, FreeLabels, part_id, Colors); XCAFDoc_DocumentTool::ShapeTool(hDoc->Main())->UpdateAssemblies(); } Base::FileInfo file(Utf8Name.c_str()); if (file.hasExtension({"stp", "step"})) { - ParameterGrp::handle hGrp_stp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part/STEP"); - std::string scheme = hGrp_stp->GetASCII("Scheme", Part::Interface::writeStepScheme()); + ParameterGrp::handle hGrp_stp = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Part/STEP"); + std::string scheme = + hGrp_stp->GetASCII("Scheme", Part::Interface::writeStepScheme()); std::list supported = Part::supportedSTEPSchemes(); - if (std::find(supported.begin(), supported.end(), scheme) != supported.end()) + if (std::find(supported.begin(), supported.end(), scheme) != supported.end()) { Part::Interface::writeStepScheme(scheme.c_str()); + } STEPCAFControl_Writer writer; Part::Interface::writeStepAssembly(Part::Interface::Assembly::On); @@ -670,17 +725,27 @@ private: // edit STEP header APIHeaderSection_MakeHeader makeHeader(writer.ChangeWriter().Model()); - Base::Reference hGrp = App::GetApplication().GetUserParameter() - .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("STEP"); + Base::Reference hGrp = App::GetApplication() + .GetUserParameter() + .GetGroup("BaseApp") + ->GetGroup("Preferences") + ->GetGroup("Mod/Part") + ->GetGroup("STEP"); // Don't set name because STEP doesn't support UTF-8 // https://forum.freecad.org/viewtopic.php?f=8&t=52967 - makeHeader.SetAuthorValue (1, new TCollection_HAsciiString(hGrp->GetASCII("Author", "Author").c_str())); - makeHeader.SetOrganizationValue (1, new TCollection_HAsciiString(hGrp->GetASCII("Company").c_str())); - makeHeader.SetOriginatingSystem(new TCollection_HAsciiString(App::Application::getExecutableName().c_str())); + makeHeader.SetAuthorValue( + 1, + new TCollection_HAsciiString(hGrp->GetASCII("Author", "Author").c_str())); + makeHeader.SetOrganizationValue( + 1, + new TCollection_HAsciiString(hGrp->GetASCII("Company").c_str())); + makeHeader.SetOriginatingSystem( + new TCollection_HAsciiString(App::Application::getExecutableName().c_str())); makeHeader.SetDescriptionValue(1, new TCollection_HAsciiString("FreeCAD Model")); IFSelect_ReturnStatus ret = writer.Write(name8bit.c_str()); - if (ret == IFSelect_RetError || ret == IFSelect_RetFail || ret == IFSelect_RetStop) { + if (ret == IFSelect_RetError || ret == IFSelect_RetFail + || ret == IFSelect_RetStop) { PyErr_Format(PyExc_IOError, "Cannot open file '%s'", Utf8Name.c_str()); throw Py::Exception(); } @@ -689,9 +754,12 @@ private: IGESControl_Controller::Init(); IGESCAFControl_Writer writer; IGESData_GlobalSection header = writer.Model()->GlobalSection(); - header.SetAuthorName(new TCollection_HAsciiString(Part::Interface::writeIgesHeaderAuthor())); - header.SetCompanyName(new TCollection_HAsciiString(Part::Interface::writeIgesHeaderCompany())); - header.SetSendName(new TCollection_HAsciiString(Part::Interface::writeIgesHeaderProduct())); + header.SetAuthorName( + new TCollection_HAsciiString(Part::Interface::writeIgesHeaderAuthor())); + header.SetCompanyName( + new TCollection_HAsciiString(Part::Interface::writeIgesHeaderCompany())); + header.SetSendName( + new TCollection_HAsciiString(Part::Interface::writeIgesHeaderProduct())); writer.Model()->SetGlobalSection(header); writer.Transfer(hDoc); Standard_Boolean ret = writer.Write((const char*)name8bit.c_str()); @@ -703,15 +771,16 @@ private: else if (file.hasExtension({"glb", "gltf"})) { #if OCC_VERSION_HEX >= 0x070500 TColStd_IndexedDataMapOfStringString aMetadata; - RWGltf_CafWriter aWriter (name8bit.c_str(), file.hasExtension("glb")); - aWriter.SetTransformationFormat (RWGltf_WriterTrsfFormat_Compact); + RWGltf_CafWriter aWriter(name8bit.c_str(), file.hasExtension("glb")); + aWriter.SetTransformationFormat(RWGltf_WriterTrsfFormat_Compact); // https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#coordinate-system-and-units - aWriter.ChangeCoordinateSystemConverter().SetInputLengthUnit (0.001); - aWriter.ChangeCoordinateSystemConverter().SetInputCoordinateSystem (RWMesh_CoordinateSystem_Zup); + aWriter.ChangeCoordinateSystemConverter().SetInputLengthUnit(0.001); + aWriter.ChangeCoordinateSystemConverter().SetInputCoordinateSystem( + RWMesh_CoordinateSystem_Zup); #if OCC_VERSION_HEX >= 0x070700 aWriter.SetParallel(true); #endif - Standard_Boolean ret = aWriter.Perform (hDoc, aMetadata, Message_ProgressRange()); + Standard_Boolean ret = aWriter.Perform(hDoc, aMetadata, Message_ProgressRange()); if (!ret) { PyErr_Format(PyExc_IOError, "Cannot save to file '%s'", Utf8Name.c_str()); throw Py::Exception(); @@ -736,8 +805,9 @@ private: Py::Object ocaf(const Py::Tuple& args) { const char* Name; - if (!PyArg_ParseTuple(args.ptr(), "s",&Name)) + if (!PyArg_ParseTuple(args.ptr(), "s", &Name)) { throw Py::Exception(); + } try { Base::FileInfo file(Name); @@ -751,7 +821,7 @@ private: aReader.SetColorMode(true); aReader.SetNameMode(true); aReader.SetLayerMode(true); - aReader.SetSHUOMode(true); + aReader.SetSHUOMode(true); if (aReader.ReadFile((Standard_CString)Name) != IFSelect_RetDone) { throw Py::Exception(PyExc_IOError, "cannot read STEP file"); } @@ -768,13 +838,17 @@ private: #endif } else if (file.hasExtension({"igs", "iges"})) { - Base::Reference hGrp = App::GetApplication().GetUserParameter() - .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("IGES"); + Base::Reference hGrp = App::GetApplication() + .GetUserParameter() + .GetGroup("BaseApp") + ->GetGroup("Preferences") + ->GetGroup("Mod/Part") + ->GetGroup("IGES"); IGESControl_Controller::Init(); IGESCAFControl_Reader aReader; // http://www.opencascade.org/org/forum/thread_20603/?forum=3 - aReader.SetReadVisible(hGrp->GetBool("SkipBlankEntities", true) - ? Standard_True : Standard_False); + aReader.SetReadVisible(hGrp->GetBool("SkipBlankEntities", true) ? Standard_True + : Standard_False); aReader.SetColorMode(true); aReader.SetNameMode(true); aReader.SetLayerMode(true); @@ -794,7 +868,7 @@ private: #endif // http://opencascade.blogspot.de/2009/03/unnoticeable-memory-leaks-part-2.html Handle(IGESToBRep_Actor)::DownCast(aReader.WS()->TransferReader()->Actor()) - ->SetModel(new IGESData_IGESModel); + ->SetModel(new IGESData_IGESModel); } else { throw Py::Exception(PyExc_IOError, "no supported file format"); @@ -806,14 +880,14 @@ private: QTreeWidget* tree = new QTreeWidget(); tree->setHeaderLabel(QString::fromLatin1("OCAF Browser")); - QVBoxLayout *layout = new QVBoxLayout; + QVBoxLayout* layout = new QVBoxLayout; layout->addWidget(tree); dlg->setLayout(layout); QDialogButtonBox* btn = new QDialogButtonBox(dlg); btn->setStandardButtons(QDialogButtonBox::Close); QObject::connect(btn, &QDialogButtonBox::rejected, dlg, &QDialog::reject); - QHBoxLayout *boxlayout = new QHBoxLayout; + QHBoxLayout* boxlayout = new QHBoxLayout; boxlayout->addWidget(btn); layout->addLayout(boxlayout); } @@ -843,4 +917,4 @@ PyObject* initModule() return Base::Interpreter().addModule(new Module); } -} // namespace ImportGui +}// namespace ImportGui diff --git a/src/Mod/Import/Gui/Command.cpp b/src/Mod/Import/Gui/Command.cpp index ad333559bb..9f83693807 100644 --- a/src/Mod/Import/Gui/Command.cpp +++ b/src/Mod/Import/Gui/Command.cpp @@ -38,29 +38,32 @@ using Gui::FileDialog; DEF_STD_CMD_A(FCCmdImportReadBREP) FCCmdImportReadBREP::FCCmdImportReadBREP() - : Command("Import_ReadBREP") + : Command("Import_ReadBREP") { - sAppModule = "Import"; - sGroup = "Import"; - sMenuText = "Read BREP"; - sToolTipText = "Read a BREP file"; - sWhatsThis = "Import_ReadBREP"; - sStatusTip = sToolTipText; - sPixmap = "Std_Tool1"; + sAppModule = "Import"; + sGroup = "Import"; + sMenuText = "Read BREP"; + sToolTipText = "Read a BREP file"; + sWhatsThis = "Import_ReadBREP"; + sStatusTip = sToolTipText; + sPixmap = "Std_Tool1"; } void FCCmdImportReadBREP::activated(int iMsg) { Q_UNUSED(iMsg); openCommand(QT_TRANSLATE_NOOP("Command", "Read BREP")); - QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QString(), QString(), QLatin1String("BREP (*.brep *.rle)")); + QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), + QString(), + QString(), + QLatin1String("BREP (*.brep *.rle)")); if (fn.isEmpty()) { abortCommand(); return; } fn = Base::Tools::escapeEncodeFilename(fn); - doCommand(Doc,"TopoShape = Import.ReadBREP(\"%s\")",(const char*)fn.toUtf8()); + doCommand(Doc, "TopoShape = Import.ReadBREP(\"%s\")", (const char*)fn.toUtf8()); commitCommand(); } @@ -75,27 +78,30 @@ bool FCCmdImportReadBREP::isActive() DEF_STD_CMD_A(ImportStep) ImportStep::ImportStep() - : Command("Part_ImportStep") + : Command("Part_ImportStep") { - sAppModule = "Part"; - sGroup = "Part"; - sMenuText = "Import STEP"; - sToolTipText = "Create or change a Import STEP feature"; - sWhatsThis = "Part_ImportStep"; - sStatusTip = sToolTipText; - sPixmap = "Save"; + sAppModule = "Part"; + sGroup = "Part"; + sMenuText = "Import STEP"; + sToolTipText = "Create or change a Import STEP feature"; + sWhatsThis = "Part_ImportStep"; + sStatusTip = sToolTipText; + sPixmap = "Save"; } void ImportStep::activated(int iMsg) { Q_UNUSED(iMsg); - QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QString(), QString(), QLatin1String("STEP (*.stp *.step)")); + QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), + QString(), + QString(), + QLatin1String("STEP (*.stp *.step)")); if (!fn.isEmpty()) { openCommand(QT_TRANSLATE_NOOP("Command", "Part ImportSTEP Create")); - doCommand(Doc,"f = App.document().addObject(\"ImportStep\",\"ImportStep\")"); + doCommand(Doc, "f = App.document().addObject(\"ImportStep\",\"ImportStep\")"); fn = Base::Tools::escapeEncodeFilename(fn); - doCommand(Doc,"f.FileName = \"%s\"",(const char*)fn.toUtf8()); + doCommand(Doc, "f.FileName = \"%s\"", (const char*)fn.toUtf8()); commitCommand(); updateActive(); } @@ -103,10 +109,12 @@ void ImportStep::activated(int iMsg) bool ImportStep::isActive() { - if (getActiveGuiDocument()) + if (getActiveGuiDocument()) { return true; - else + } + else { return false; + } } @@ -116,26 +124,29 @@ bool ImportStep::isActive() DEF_STD_CMD_A(ImportIges) ImportIges::ImportIges() - : Command("Import_Iges") + : Command("Import_Iges") { - sAppModule = "Import"; - sGroup = "Part"; - sMenuText = "Import IGES"; - sToolTipText = "Create or change a Import IGES feature"; - sWhatsThis = "Import_Iges"; - sStatusTip = sToolTipText; - sPixmap = "Save"; + sAppModule = "Import"; + sGroup = "Part"; + sMenuText = "Import IGES"; + sToolTipText = "Create or change a Import IGES feature"; + sWhatsThis = "Import_Iges"; + sStatusTip = sToolTipText; + sPixmap = "Save"; } void ImportIges::activated(int iMsg) { Q_UNUSED(iMsg); - QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QString(), QString(), QLatin1String("IGES (*.igs *.iges)")); + QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), + QString(), + QString(), + QLatin1String("IGES (*.igs *.iges)")); if (!fn.isEmpty()) { openCommand(QT_TRANSLATE_NOOP("Command", "ImportIGES Create")); - doCommand(Doc,"f = App.document().addObject(\"ImportIges\",\"ImportIges\")"); + doCommand(Doc, "f = App.document().addObject(\"ImportIges\",\"ImportIges\")"); fn = Base::Tools::escapeEncodeFilename(fn); - doCommand(Doc,"f.FileName = \"%s\"",(const char*)fn.toUtf8()); + doCommand(Doc, "f.FileName = \"%s\"", (const char*)fn.toUtf8()); commitCommand(); updateActive(); } @@ -143,15 +154,17 @@ void ImportIges::activated(int iMsg) bool ImportIges::isActive() { - if (getActiveGuiDocument()) + if (getActiveGuiDocument()) { return true; - else + } + else { return false; + } } void CreateImportCommands() { - Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager(); + Gui::CommandManager& rcCmdMgr = Gui::Application::Instance->commandManager(); rcCmdMgr.addCommand(new FCCmdImportReadBREP()); } diff --git a/src/Mod/Import/Gui/PreCompiled.h b/src/Mod/Import/Gui/PreCompiled.h index 54ece8376f..b8418248df 100644 --- a/src/Mod/Import/Gui/PreCompiled.h +++ b/src/Mod/Import/Gui/PreCompiled.h @@ -29,61 +29,58 @@ // point at which warnings of overly long specifiers disabled (needed for VC6) #ifdef _MSC_VER -# pragma warning(disable : 4005) -# pragma warning(disable : 4251) -# pragma warning(disable : 4503) -# pragma warning(disable : 4786) // specifier longer then 255 chars +#pragma warning(disable : 4005) +#pragma warning(disable : 4251) +#pragma warning(disable : 4503) +#pragma warning(disable : 4786)// specifier longer then 255 chars #endif #ifdef _PreComp_ // standard -#include -#include #include +#include +#include // STL -#include #include -#include #include +#include +#include #ifndef FC_OS_WIN32 -# include +#include #endif // OpenCasCade Base #include // OpenCascade View +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifndef FC_OS_WIN32 #include @@ -93,10 +90,10 @@ // Qt Toolkit #ifndef __QtAll__ -# include +#include #endif -#endif //_PreComp_ +#endif//_PreComp_ -#endif // __PRECOMPILED_GUI__ +#endif// __PRECOMPILED_GUI__ diff --git a/src/Mod/Import/Gui/Workbench.cpp b/src/Mod/Import/Gui/Workbench.cpp index 8a31896fdd..ebdbbf7e7d 100644 --- a/src/Mod/Import/Gui/Workbench.cpp +++ b/src/Mod/Import/Gui/Workbench.cpp @@ -46,4 +46,3 @@ Gui::ToolBarItem* Workbench::setupCommandBars() const Gui::ToolBarItem* root = new Gui::ToolBarItem; return root; } - diff --git a/src/Mod/Import/Gui/Workbench.h b/src/Mod/Import/Gui/Workbench.h index 3a8271fffc..5c5cac7272 100644 --- a/src/Mod/Import/Gui/Workbench.h +++ b/src/Mod/Import/Gui/Workbench.h @@ -26,12 +26,13 @@ #include -namespace ImportGui { +namespace ImportGui +{ /** * @author Werner Mayer */ -class Workbench : public Gui::StdWorkbench +class Workbench: public Gui::StdWorkbench { TYPESYSTEM_HEADER_WITH_OVERRIDE(); @@ -44,7 +45,7 @@ protected: Gui::ToolBarItem* setupCommandBars() const override; }; -} // namespace ImportGui +}// namespace ImportGui -#endif // IMPORT_WORKBENCH_H +#endif// IMPORT_WORKBENCH_H