From c012bb846edd7285b78637e415102730f45102da Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 19 Oct 2022 22:13:03 +0200 Subject: [PATCH 01/15] Cherry-picked Python type hint enhancements from master --- .gitignore | 2 + setup.py | 634 +-- src/db/db/gsiDeclDbLibrary.cc | 39 +- src/db/db/gsiDeclDbPoint.cc | 10 +- src/db/db/gsiDeclDbRegion.cc | 73 +- src/db/db/gsiDeclDbVector.cc | 6 + src/pya/pya/pya.h | 13 +- src/pya/pya/pyaConvert.cc | 49 +- src/pya/pya/pyaMarshal.cc | 8 +- src/pya/pya/pyaMarshal.h | 3 +- src/pya/pya/pyaModule.cc | 32 +- src/pya/pya/pyaUtils.h | 5 +- .../distutils_src/klayout/db/__init__.py | 75 +- .../klayout/db/pcell_declaration_helper.py | 35 +- src/pymod/distutils_src/klayout/dbcore.pyi | 3682 ++++++++++++++--- src/pymod/distutils_src/klayout/rdbcore.pyi | 46 +- src/pymod/distutils_src/klayout/tlcore.pyi | 92 +- src/pymod/stubgen.py | 114 +- src/tl/tl/tlException.h | 18 +- testdata/pymod/import_db.py | 15 +- 20 files changed, 3940 insertions(+), 1011 deletions(-) diff --git a/.gitignore b/.gitignore index 93210c161..8c62f3f05 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,5 @@ dist/ # Macos artifacts *.dmg *.dmg.md5 +.DS_Store + diff --git a/setup.py b/setup.py index 1c4871bf6..d2e3e70c5 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,3 @@ - """ KLayout standalone Python module setup script @@ -55,6 +54,7 @@ and won't find them. So we need to take away the path with "-Wl,-soname" on Linux (see Config.link_args). """ +from typing import List from setuptools import setup, Distribution, find_packages from setuptools.extension import Extension, Library import glob @@ -70,17 +70,28 @@ import multiprocessing # for Jenkins we do not want to be greedy multicore = os.getenv("KLAYOUT_SETUP_MULTICORE") if multicore: - N_cores = int(multicore) + N_cores = int(multicore) else: - N_cores = multiprocessing.cpu_count() + N_cores = multiprocessing.cpu_count() # monkey-patch for parallel compilation # from https://stackoverflow.com/questions/11013851/speeding-up-build-process-with-distutils -def parallelCCompile(self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None, depends=None): +def parallelCCompile( + self, + sources, + output_dir=None, + macros=None, + include_dirs=None, + debug=0, + extra_preargs=None, + extra_postargs=None, + depends=None, +): # those lines are copied from distutils.ccompiler.CCompiler directly macros, objects, extra_postargs, pp_opts, build = self._setup_compile( - output_dir, macros, include_dirs, sources, depends, extra_postargs) + output_dir, macros, include_dirs, sources, depends, extra_postargs + ) cc_args = self._get_cc_args(pp_opts, debug, extra_preargs) # parallel code @@ -104,6 +115,7 @@ def parallelCCompile(self, sources, output_dir=None, macros=None, include_dirs=N print("Building", obj, "has failed. Trying again.") else: break + # convert to list, imap is evaluated on-demand list(multiprocessing.pool.ThreadPool(N).map(_single_compile, objects)) return objects @@ -112,6 +124,7 @@ def parallelCCompile(self, sources, output_dir=None, macros=None, include_dirs=N # only if python version > 2.6, somehow the travis compiler hangs in 2.6 if sys.version_info[0] * 100 + sys.version_info[1] > 206: import distutils.ccompiler + distutils.ccompiler.CCompiler.compile = parallelCCompile @@ -119,7 +132,7 @@ if sys.version_info[0] * 100 + sys.version_info[1] > 206: def quote_path(path): # looks like disutils don't need path quoting in version >= 3.9: if " " in path and sys.version_info[0] * 100 + sys.version_info[1] < 309: - return "\"" + path + "\"" + return '"' + path + '"' else: return path @@ -127,6 +140,7 @@ def quote_path(path): # TODO: delete (Obsolete) # patch get_ext_filename from distutils.command.build_ext import build_ext + _old_get_ext_filename = build_ext.get_ext_filename @@ -137,8 +151,8 @@ def patched_get_ext_filename(self, ext_name): """ filename = _old_get_ext_filename(self, ext_name) # Making sure this matches qmake's default extension .dylib, instead of .so - if platform.system() == "Darwin" and '_dbpi' in ext_name: - filename = filename.replace('.so', '.dylib') + if platform.system() == "Darwin" and "_dbpi" in ext_name: + filename = filename.replace(".so", ".dylib") return filename @@ -152,15 +166,18 @@ distutils.command.build_ext.build_ext.get_ext_filename = patched_get_ext_filenam # hence the patch from distutils.ccompiler import CCompiler + old_library_filename = CCompiler.library_filename -def patched_library_filename(self, libname, lib_type='static', # or 'shared' - strip_dir=0, output_dir=''): - if platform.system() == "Darwin" and '_dbpi' in libname: - lib_type = 'dylib' - return old_library_filename(self, libname, lib_type=lib_type, - strip_dir=strip_dir, output_dir=output_dir) +def patched_library_filename( + self, libname, lib_type="static", strip_dir=0, output_dir="" # or 'shared' +): + if platform.system() == "Darwin" and "_dbpi" in libname: + lib_type = "dylib" + return old_library_filename( + self, libname, lib_type=lib_type, strip_dir=strip_dir, output_dir=output_dir + ) distutils.ccompiler.CCompiler.library_filename = patched_library_filename @@ -172,16 +189,36 @@ distutils.ccompiler.CCompiler.library_filename = patched_library_filename # link a shared object on Linux, but a static library and patches distutils # for this ... We're patching this back now. + def always_link_shared_object( - self, objects, output_libname, output_dir=None, libraries=None, - library_dirs=None, runtime_library_dirs=None, export_symbols=None, - debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, - target_lang=None): + self, + objects, + output_libname, + output_dir=None, + libraries=None, + library_dirs=None, + runtime_library_dirs=None, + export_symbols=None, + debug=0, + extra_preargs=None, + extra_postargs=None, + build_temp=None, + target_lang=None, +): self.link( - self.SHARED_LIBRARY, objects, output_libname, - output_dir, libraries, library_dirs, runtime_library_dirs, - export_symbols, debug, extra_preargs, extra_postargs, - build_temp, target_lang + self.SHARED_LIBRARY, + objects, + output_libname, + output_dir, + libraries, + library_dirs, + runtime_library_dirs, + export_symbols, + debug, + extra_preargs, + extra_postargs, + build_temp, + target_lang, ) @@ -201,7 +238,7 @@ class Config(object): # TODO: is this really how we get the build paths? - build_cmd = Distribution().get_command_obj('build') + build_cmd = Distribution().get_command_obj("build") build_cmd.finalize_options() self.build_platlib = build_cmd.build_platlib self.build_temp = build_cmd.build_temp @@ -212,7 +249,7 @@ class Config(object): else: self.build_temp = os.path.join(self.build_temp, "Release") - build_ext_cmd = Distribution().get_command_obj('build_ext') + build_ext_cmd = Distribution().get_command_obj("build_ext") build_ext_cmd.initialize_options() build_ext_cmd.setup_shlib_compiler() @@ -230,7 +267,7 @@ class Config(object): This code was extracted from the source in setuptools.command.build_ext.build_ext """ libtype = setuptools.command.build_ext.libtype - full_mod = self.root + '.' + mod + full_mod = self.root + "." + mod if is_lib is True: # Here we are guessing it is a library and that the filename # is to be computed by shlib_compiler. @@ -246,8 +283,8 @@ class Config(object): ext_filename = os.path.basename(ext_path) # Exception for database plugins, which will always be dylib. - if platform.system() == "Darwin" and '_dbpi' in mod: - ext_filename = ext_filename.replace('.so', '.dylib') + if platform.system() == "Darwin" and "_dbpi" in mod: + ext_filename = ext_filename.replace(".so", ".dylib") return ext_filename def path_of(self, mod, mod_src_path): @@ -265,20 +302,25 @@ class Config(object): """ Gets additional compiler arguments """ + args: List[str] if platform.system() == "Windows": bits = os.getenv("KLAYOUT_BITS") if bits: - return [quote_path("-I" + os.path.join(bits, "zlib", "include")), - quote_path("-I" + os.path.join(bits, "ptw", "include")), - quote_path("-I" + os.path.join(bits, "png", "include")), - quote_path("-I" + os.path.join(bits, "expat", "include")), - quote_path("-I" + os.path.join(bits, "curl", "include"))] + args = [ + quote_path("-I" + os.path.join(bits, "zlib", "include")), + quote_path("-I" + os.path.join(bits, "ptw", "include")), + quote_path("-I" + os.path.join(bits, "png", "include")), + quote_path("-I" + os.path.join(bits, "expat", "include")), + quote_path("-I" + os.path.join(bits, "curl", "include")), + ] else: - return [] + args = [] else: - return ["-Wno-strict-aliasing", # Avoids many "type-punned pointer" warnings - "-std=c++11", # because we use unordered_map/unordered_set - ] + args = [ + "-Wno-strict-aliasing", # Avoids many "type-punned pointer" warnings + "-std=c++11", # because we use unordered_map/unordered_set + ] + return args def libraries(self, mod): """ @@ -286,10 +328,10 @@ class Config(object): """ if platform.system() == "Windows": if mod == "_tl": - return [ "libcurl", "expat", "pthreadVCE2", "zlib", "wsock32", "libpng16" ] + return ["libcurl", "expat", "pthreadVCE2", "zlib", "wsock32", "libpng16"] else: if mod == "_tl": - return [ "curl", "expat", "png" ] + return ["curl", "expat", "png"] return [] def link_args(self, mod): @@ -300,19 +342,24 @@ class Config(object): args = ["/DLL"] bits = os.getenv("KLAYOUT_BITS") if bits: - args += [quote_path("/LIBPATH:" + os.path.join(bits, "zlib", "lib")), - quote_path("/LIBPATH:" + os.path.join(bits, "ptw", "libraries")), - quote_path("/LIBPATH:" + os.path.join(bits, "png", "libraries")), - quote_path("/LIBPATH:" + os.path.join(bits, "expat", "libraries")), - quote_path("/LIBPATH:" + os.path.join(bits, "curl", "libraries"))] + args += [ + quote_path("/LIBPATH:" + os.path.join(bits, "zlib", "libraries")), + quote_path("/LIBPATH:" + os.path.join(bits, "ptw", "libraries")), + quote_path("/LIBPATH:" + os.path.join(bits, "png", "libraries")), + quote_path("/LIBPATH:" + os.path.join(bits, "expat", "libraries")), + quote_path("/LIBPATH:" + os.path.join(bits, "curl", "libraries")), + ] return args elif platform.system() == "Darwin": # For the dependency modules, make sure we produce a dylib. # We can only link against such, but the bundles produced otherwise. args = [] if mod[0] == "_": - args += ["-Wl,-dylib", '-Wl,-install_name,@rpath/%s' % self.libname_of(mod, is_lib=True)] - args += ['-Wl,-rpath,@loader_path/'] + args += [ + "-Wl,-dylib", + "-Wl,-install_name,@rpath/%s" % self.libname_of(mod, is_lib=True), + ] + args += ["-Wl,-rpath,@loader_path/"] return args else: # this makes the libraries suitable for linking with a path - @@ -321,23 +368,30 @@ class Config(object): # will look for the path-qualified library. But that's the # build path and the loader will fail. args = [] - args += ['-Wl,-soname,' + self.libname_of(mod, is_lib=True)] - if '_dbpi' not in mod: - loader_path = '$ORIGIN' + args += ["-Wl,-soname," + self.libname_of(mod, is_lib=True)] + if "_dbpi" not in mod: + loader_path = "$ORIGIN" else: - loader_path = '$ORIGIN/..' - args += ['-Wl,-rpath,' + loader_path] + loader_path = "$ORIGIN/.." + args += ["-Wl,-rpath," + loader_path] # default linux shared object compilation uses the '-g' flag, # which generates unnecessary debug information # removing with strip-all during the linking stage - args += ['-Wl,--strip-all'] + args += ["-Wl,--strip-all"] return args def macros(self): """ Returns the macros to use for building """ - return [('HAVE_PNG', 1), ('HAVE_CURL', 1), ('HAVE_EXPAT', 1), ('KLAYOUT_MAJOR_VERSION', self.major_version()), ('KLAYOUT_MINOR_VERSION', self.minor_version())] + return [ + ("HAVE_PNG", 1), + ("HAVE_CURL", 1), + ("HAVE_EXPAT", 1), + ("KLAYOUT_MAJOR_VERSION", self.major_version()), + ("KLAYOUT_MINOR_VERSION", self.minor_version()), + ("GSI_ALIAS_INSPECT", 1), + ] def minor_version(self): """ @@ -349,7 +403,9 @@ class Config(object): version_file = os.path.join(os.path.dirname(__file__), "version.sh") with open(version_file, "r") as file: version_txt = file.read() - rm = re.search(r"KLAYOUT_VERSION\s*=\s*\"(.*?)\.(.*?)(\..*)?\".*", version_txt) + rm = re.search( + r"KLAYOUT_VERSION\s*=\s*\"(.*?)\.(.*?)(\..*)?\".*", version_txt + ) if rm: version_string = rm.group(2) return version_string @@ -366,7 +422,9 @@ class Config(object): version_file = os.path.join(os.path.dirname(__file__), "version.sh") with open(version_file, "r") as file: version_txt = file.read() - rm = re.search(r"KLAYOUT_VERSION\s*=\s*\"(.*?)\.(.*?)(\..*)?\".*", version_txt) + rm = re.search( + r"KLAYOUT_VERSION\s*=\s*\"(.*?)\.(.*?)(\..*)?\".*", version_txt + ) if rm: version_string = rm.group(1) return version_string @@ -407,13 +465,15 @@ _tl_sources.discard(os.path.join(_tl_path, "tlHttpStreamNoQt.cc")) _tl_sources.discard(os.path.join(_tl_path, "tlFileSystemWatcher.cc")) _tl_sources.discard(os.path.join(_tl_path, "tlDeferredExecutionQt.cc")) -_tl = Library(config.root + '._tl', - define_macros=config.macros() + [('MAKE_TL_LIBRARY', 1)], - language='c++', - libraries=config.libraries('_tl'), - extra_link_args=config.link_args('_tl'), - extra_compile_args=config.compile_args('_tl'), - sources=list(_tl_sources)) +_tl = Library( + config.root + "._tl", + define_macros=config.macros() + [("MAKE_TL_LIBRARY", 1)], + language="c++", + libraries=config.libraries("_tl"), + extra_link_args=config.link_args("_tl"), + extra_compile_args=config.compile_args("_tl"), + sources=list(_tl_sources), +) config.add_extension(_tl) @@ -423,15 +483,17 @@ config.add_extension(_tl) _gsi_path = os.path.join("src", "gsi", "gsi") _gsi_sources = set(glob.glob(os.path.join(_gsi_path, "*.cc"))) -_gsi = Library(config.root + '._gsi', - define_macros=config.macros() + [('MAKE_GSI_LIBRARY', 1)], - include_dirs=[_tl_path], - extra_objects=[config.path_of('_tl', _tl_path)], - language='c++', - libraries=config.libraries('_gsi'), - extra_link_args=config.link_args('_gsi'), - extra_compile_args=config.compile_args('_gsi'), - sources=list(_gsi_sources)) +_gsi = Library( + config.root + "._gsi", + define_macros=config.macros() + [("MAKE_GSI_LIBRARY", 1)], + include_dirs=[_tl_path], + extra_objects=[config.path_of("_tl", _tl_path)], + language="c++", + libraries=config.libraries('_gsi'), + extra_link_args=config.link_args("_gsi"), + extra_compile_args=config.compile_args("_gsi"), + sources=list(_gsi_sources), +) config.add_extension(_gsi) # ------------------------------------------------------------------ @@ -440,15 +502,17 @@ config.add_extension(_gsi) _pya_path = os.path.join("src", "pya", "pya") _pya_sources = set(glob.glob(os.path.join(_pya_path, "*.cc"))) -_pya = Library(config.root + '._pya', - define_macros=config.macros() + [('MAKE_PYA_LIBRARY', 1)], - include_dirs=[_tl_path, _gsi_path], - extra_objects=[config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path)], - language='c++', - libraries=config.libraries('_pya'), - extra_link_args=config.link_args('_pya'), - extra_compile_args=config.compile_args('_pya'), - sources=list(_pya_sources)) +_pya = Library( + config.root + "._pya", + define_macros=config.macros() + [("MAKE_PYA_LIBRARY", 1)], + include_dirs=[_tl_path, _gsi_path], + extra_objects=[config.path_of("_tl", _tl_path), config.path_of("_gsi", _gsi_path)], + language="c++", + libraries=config.libraries('_pya'), + extra_link_args=config.link_args("_pya"), + extra_compile_args=config.compile_args("_pya"), + sources=list(_pya_sources), +) config.add_extension(_pya) # ------------------------------------------------------------------ @@ -457,15 +521,17 @@ config.add_extension(_pya) _rba_path = os.path.join("src", "rbastub") _rba_sources = set(glob.glob(os.path.join(_rba_path, "*.cc"))) -_rba = Library(config.root + '._rba', - define_macros=config.macros() + [('MAKE_RBA_LIBRARY', 1)], - include_dirs=[_tl_path, _gsi_path], - extra_objects=[config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path)], - language='c++', - libraries=config.libraries('_rba'), - extra_link_args=config.link_args('_rba'), - extra_compile_args=config.compile_args('_rba'), - sources=list(_rba_sources)) +_rba = Library( + config.root + '._rba', + define_macros=config.macros() + [('MAKE_RBA_LIBRARY', 1)], + include_dirs=[_tl_path, _gsi_path], + extra_objects=[config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path)], + language='c++', + libraries=config.libraries('_rba'), + extra_link_args=config.link_args('_rba'), + extra_compile_args=config.compile_args('_rba'), + sources=list(_rba_sources) +) config.add_extension(_rba) # ------------------------------------------------------------------ @@ -474,15 +540,17 @@ config.add_extension(_rba) _db_path = os.path.join("src", "db", "db") _db_sources = set(glob.glob(os.path.join(_db_path, "*.cc"))) -_db = Library(config.root + '._db', - define_macros=config.macros() + [('MAKE_DB_LIBRARY', 1)], - include_dirs=[_tl_path, _gsi_path, _db_path], - extra_objects=[config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path)], - language='c++', - libraries=config.libraries('_db'), - extra_link_args=config.link_args('_db'), - extra_compile_args=config.compile_args('_db'), - sources=list(_db_sources)) +_db = Library( + config.root + "._db", + define_macros=config.macros() + [("MAKE_DB_LIBRARY", 1)], + include_dirs=[_tl_path, _gsi_path, _db_path], + extra_objects=[config.path_of("_tl", _tl_path), config.path_of("_gsi", _gsi_path)], + language="c++", + libraries=config.libraries('_db'), + extra_link_args=config.link_args("_db"), + extra_compile_args=config.compile_args("_db"), + sources=list(_db_sources), +) config.add_extension(_db) # ------------------------------------------------------------------ @@ -491,15 +559,21 @@ config.add_extension(_db) _lib_path = os.path.join("src", "lib", "lib") _lib_sources = set(glob.glob(os.path.join(_lib_path, "*.cc"))) -_lib = Library(config.root + '._lib', - define_macros=config.macros() + [('MAKE_LIB_LIBRARY', 1)], - include_dirs=[_tl_path, _gsi_path, _db_path, _lib_path], - extra_objects=[config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], - language='c++', - libraries=config.libraries('_lib'), - extra_link_args=config.link_args('_lib'), - extra_compile_args=config.compile_args('_lib'), - sources=list(_lib_sources)) +_lib = Library( + config.root + "._lib", + define_macros=config.macros() + [("MAKE_LIB_LIBRARY", 1)], + include_dirs=[_tl_path, _gsi_path, _db_path, _lib_path], + extra_objects=[ + config.path_of("_tl", _tl_path), + config.path_of("_gsi", _gsi_path), + config.path_of("_db", _db_path), + ], + language="c++", + libraries=config.libraries('_lib'), + extra_link_args=config.link_args("_lib"), + extra_compile_args=config.compile_args("_lib"), + sources=list(_lib_sources), +) config.add_extension(_lib) # ------------------------------------------------------------------ @@ -508,15 +582,21 @@ config.add_extension(_lib) _rdb_path = os.path.join("src", "rdb", "rdb") _rdb_sources = set(glob.glob(os.path.join(_rdb_path, "*.cc"))) -_rdb = Library(config.root + '._rdb', - define_macros=config.macros() + [('MAKE_RDB_LIBRARY', 1)], - include_dirs=[_db_path, _tl_path, _gsi_path], - extra_objects=[config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], - language='c++', - libraries=config.libraries('_rdb'), - extra_link_args=config.link_args('_rdb'), - extra_compile_args=config.compile_args('_rdb'), - sources=list(_rdb_sources)) +_rdb = Library( + config.root + "._rdb", + define_macros=config.macros() + [("MAKE_RDB_LIBRARY", 1)], + include_dirs=[_db_path, _tl_path, _gsi_path], + extra_objects=[ + config.path_of("_tl", _tl_path), + config.path_of("_gsi", _gsi_path), + config.path_of("_db", _db_path), + ], + language="c++", + libraries=config.libraries('_rdb'), + extra_link_args=config.link_args("_rdb"), + extra_compile_args=config.compile_args("_rdb"), + sources=list(_rdb_sources), +) config.add_extension(_rdb) # ------------------------------------------------------------------ @@ -525,15 +605,22 @@ config.add_extension(_rdb) _laybasic_path = os.path.join("src", "laybasic", "laybasic") _laybasic_sources = set(glob.glob(os.path.join(_laybasic_path, "*.cc"))) -_laybasic = Library(config.root + '._laybasic', - define_macros=config.macros() + [('MAKE_LAYBASIC_LIBRARY', 1)], - include_dirs=[_rdb_path, _db_path, _tl_path, _gsi_path], - extra_objects=[config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], - language='c++', - libraries=config.libraries('_laybasic'), - extra_link_args=config.link_args('_laybasic'), - extra_compile_args=config.compile_args('_laybasic'), - sources=list(_laybasic_sources)) +_laybasic = Library( + config.root + '._laybasic', + define_macros=config.macros() + [('MAKE_LAYBASIC_LIBRARY', 1)], + include_dirs=[_rdb_path, _db_path, _tl_path, _gsi_path], + extra_objects=[ + config.path_of('_rdb', _rdb_path), + config.path_of('_tl', _tl_path), + config.path_of('_gsi', _gsi_path), + config.path_of('_db', _db_path) + ], + language='c++', + libraries=config.libraries('_laybasic'), + extra_link_args=config.link_args('_laybasic'), + extra_compile_args=config.compile_args('_laybasic'), + sources=list(_laybasic_sources) +) config.add_extension(_laybasic) # ------------------------------------------------------------------ @@ -542,15 +629,23 @@ config.add_extension(_laybasic) _layview_path = os.path.join("src", "layview", "layview") _layview_sources = set(glob.glob(os.path.join(_layview_path, "*.cc"))) -_layview = Library(config.root + '._layview', - define_macros=config.macros() + [('MAKE_LAYVIEW_LIBRARY', 1)], - include_dirs=[_laybasic_path, _rdb_path, _db_path, _tl_path, _gsi_path], - extra_objects=[config.path_of('_laybasic', _laybasic_path), config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], - language='c++', - libraries=config.libraries('_layview'), - extra_link_args=config.link_args('_layview'), - extra_compile_args=config.compile_args('_layview'), - sources=list(_layview_sources)) +_layview = Library( + config.root + '._layview', + define_macros=config.macros() + [('MAKE_LAYVIEW_LIBRARY', 1)], + include_dirs=[_laybasic_path, _rdb_path, _db_path, _tl_path, _gsi_path], + extra_objects=[ + config.path_of('_laybasic', _laybasic_path), + config.path_of('_rdb', _rdb_path), + config.path_of('_tl', _tl_path), + config.path_of('_gsi', _gsi_path), + config.path_of('_db', _db_path) + ], + language='c++', + libraries=config.libraries('_layview'), + extra_link_args=config.link_args('_layview'), + extra_compile_args=config.compile_args('_layview'), + sources=list(_layview_sources) +) config.add_extension(_layview) # ------------------------------------------------------------------ @@ -559,15 +654,22 @@ config.add_extension(_layview) _lym_path = os.path.join("src", "lym", "lym") _lym_sources = set(glob.glob(os.path.join(_lym_path, "*.cc"))) -_lym = Library(config.root + '._lym', - define_macros=config.macros() + [('MAKE_LYM_LIBRARY', 1)], - include_dirs=[_pya_path, _rba_path, _tl_path, _gsi_path], - extra_objects=[config.path_of('_rba', _rba_path), config.path_of('_pya', _pya_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path)], - language='c++', - libraries=config.libraries('_lym'), - extra_link_args=config.link_args('_lym'), - extra_compile_args=config.compile_args('_lym'), - sources=list(_lym_sources)) +_lym = Library( + config.root + '._lym', + define_macros=config.macros() + [('MAKE_LYM_LIBRARY', 1)], + include_dirs=[_pya_path, _rba_path, _tl_path, _gsi_path], + extra_objects=[ + config.path_of('_rba', _rba_path), + config.path_of('_pya', _pya_path), + config.path_of('_tl', _tl_path), + config.path_of('_gsi', _gsi_path) + ], + language='c++', + libraries=config.libraries('_lym'), + extra_link_args=config.link_args('_lym'), + extra_compile_args=config.compile_args('_lym'), + sources=list(_lym_sources) +) config.add_extension(_lym) # ------------------------------------------------------------------ @@ -576,15 +678,24 @@ config.add_extension(_lym) _ant_path = os.path.join("src", "ant", "ant") _ant_sources = set(glob.glob(os.path.join(_ant_path, "*.cc"))) -_ant = Library(config.root + '._ant', - define_macros=config.macros() + [('MAKE_ANT_LIBRARY', 1)], - include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path], - extra_objects=[config.path_of('_laybasic', _laybasic_path), config.path_of('_layview', _layview_path), config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], - language='c++', - libraries=config.libraries('_ant'), - extra_link_args=config.link_args('_ant'), - extra_compile_args=config.compile_args('_ant'), - sources=list(_ant_sources)) +_ant = Library( + config.root + '._ant', + define_macros=config.macros() + [('MAKE_ANT_LIBRARY', 1)], + include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path], + extra_objects=[ + config.path_of('_laybasic', _laybasic_path), + config.path_of('_layview', _layview_path), + config.path_of('_rdb', _rdb_path), + config.path_of('_tl', _tl_path), + config.path_of('_gsi', _gsi_path), + config.path_of('_db', _db_path) + ], + language='c++', + libraries=config.libraries('_ant'), + extra_link_args=config.link_args('_ant'), + extra_compile_args=config.compile_args('_ant'), + sources=list(_ant_sources) +) config.add_extension(_ant) # ------------------------------------------------------------------ @@ -593,15 +704,24 @@ config.add_extension(_ant) _img_path = os.path.join("src", "img", "img") _img_sources = set(glob.glob(os.path.join(_img_path, "*.cc"))) -_img = Library(config.root + '._img', - define_macros=config.macros() + [('MAKE_IMG_LIBRARY', 1)], - include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path], - extra_objects=[config.path_of('_laybasic', _laybasic_path), config.path_of('_layview', _layview_path), config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], - language='c++', - libraries=config.libraries('_img'), - extra_link_args=config.link_args('_img'), - extra_compile_args=config.compile_args('_img'), - sources=list(_img_sources)) +_img = Library( + config.root + '._img', + define_macros=config.macros() + [('MAKE_IMG_LIBRARY', 1)], + include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path], + extra_objects=[ + config.path_of('_laybasic', _laybasic_path), + config.path_of('_layview', _layview_path), + config.path_of('_rdb', _rdb_path), + config.path_of('_tl', _tl_path), + config.path_of('_gsi', _gsi_path), + config.path_of('_db', _db_path) + ], + language='c++', + libraries=config.libraries('_img'), + extra_link_args=config.link_args('_img'), + extra_compile_args=config.compile_args('_img'), + sources=list(_img_sources) +) config.add_extension(_img) # ------------------------------------------------------------------ @@ -610,15 +730,24 @@ config.add_extension(_img) _edt_path = os.path.join("src", "edt", "edt") _edt_sources = set(glob.glob(os.path.join(_edt_path, "*.cc"))) -_edt = Library(config.root + '._edt', - define_macros=config.macros() + [('MAKE_EDT_LIBRARY', 1)], - include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path], - extra_objects=[config.path_of('_laybasic', _laybasic_path), config.path_of('_layview', _layview_path), config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], - language='c++', - libraries=config.libraries('_edt'), - extra_link_args=config.link_args('_edt'), - extra_compile_args=config.compile_args('_edt'), - sources=list(_edt_sources)) +_edt = Library( + config.root + '._edt', + define_macros=config.macros() + [('MAKE_EDT_LIBRARY', 1)], + include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path], + extra_objects=[ + config.path_of('_laybasic', _laybasic_path), + config.path_of('_layview', _layview_path), + config.path_of('_rdb', _rdb_path), + config.path_of('_tl', _tl_path), + config.path_of('_gsi', _gsi_path), + config.path_of('_db', _db_path) + ], + language='c++', + libraries=config.libraries('_edt'), + extra_link_args=config.link_args('_edt'), + extra_compile_args=config.compile_args('_edt'), + sources=list(_edt_sources) +) config.add_extension(_edt) # ------------------------------------------------------------------ @@ -635,15 +764,25 @@ for pi in dbpi_dirs: pi_sources = glob.glob(os.path.join(pi, "*.cc")) - pi_ext = Library(config.root + '.db_plugins.' + mod_name, - define_macros=config.macros() + [('MAKE_DB_PLUGIN_LIBRARY', 1)], - include_dirs=[os.path.join("src", "plugins", "common"), - _db_path, _tl_path, _gsi_path], - extra_objects=[config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], - language='c++', - extra_link_args=config.link_args(mod_name), - extra_compile_args=config.compile_args(mod_name), - sources=pi_sources) + pi_ext = Library( + config.root + ".db_plugins." + mod_name, + define_macros=config.macros() + [("MAKE_DB_PLUGIN_LIBRARY", 1)], + include_dirs=[ + os.path.join("src", "plugins", "common"), + _db_path, + _tl_path, + _gsi_path, + ], + extra_objects=[ + config.path_of("_tl", _tl_path), + config.path_of("_gsi", _gsi_path), + config.path_of("_db", _db_path), + ], + language="c++", + extra_link_args=config.link_args(mod_name), + extra_compile_args=config.compile_args(mod_name), + sources=pi_sources, + ) db_plugins.append(pi_ext) config.add_extension(pi_ext) @@ -654,13 +793,19 @@ for pi in dbpi_dirs: tl_path = os.path.join("src", "pymod", "tl") tl_sources = set(glob.glob(os.path.join(tl_path, "*.cc"))) -tl = Extension(config.root + '.tlcore', - define_macros=config.macros(), - include_dirs=[_tl_path, _gsi_path, _pya_path], - extra_objects=[config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)], - extra_link_args=config.link_args('tlcore'), - extra_compile_args=config.compile_args('tlcore'), - sources=list(tl_sources)) +tl = Extension( + config.root + ".tlcore", + define_macros=config.macros(), + include_dirs=[_tl_path, _gsi_path, _pya_path], + extra_objects=[ + config.path_of("_tl", _tl_path), + config.path_of("_gsi", _gsi_path), + config.path_of("_pya", _pya_path), + ], + extra_link_args=config.link_args("tlcore"), + extra_compile_args=config.compile_args("tlcore"), + sources=list(tl_sources), +) # ------------------------------------------------------------------ # db extension library @@ -668,13 +813,20 @@ tl = Extension(config.root + '.tlcore', db_path = os.path.join("src", "pymod", "db") db_sources = set(glob.glob(os.path.join(db_path, "*.cc"))) -db = Extension(config.root + '.dbcore', - define_macros=config.macros(), - include_dirs=[_db_path, _tl_path, _gsi_path, _pya_path], - extra_objects=[config.path_of('_db', _db_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)], - extra_link_args=config.link_args('dbcore'), - extra_compile_args=config.compile_args('dbcore'), - sources=list(db_sources)) +db = Extension( + config.root + ".dbcore", + define_macros=config.macros(), + include_dirs=[_db_path, _tl_path, _gsi_path, _pya_path], + extra_objects=[ + config.path_of("_db", _db_path), + config.path_of("_tl", _tl_path), + config.path_of("_gsi", _gsi_path), + config.path_of("_pya", _pya_path), + ], + extra_link_args=config.link_args("dbcore"), + extra_compile_args=config.compile_args("dbcore"), + sources=list(db_sources), +) # ------------------------------------------------------------------ # lib extension library @@ -682,13 +834,20 @@ db = Extension(config.root + '.dbcore', lib_path = os.path.join("src", "pymod", "lib") lib_sources = set(glob.glob(os.path.join(lib_path, "*.cc"))) -lib = Extension(config.root + '.libcore', - define_macros=config.macros(), - include_dirs=[_lib_path, _tl_path, _gsi_path, _pya_path], - extra_objects=[config.path_of('_lib', _lib_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)], - extra_link_args=config.link_args('libcore'), - extra_compile_args=config.compile_args('libcore'), - sources=list(lib_sources)) +lib = Extension( + config.root + ".libcore", + define_macros=config.macros(), + include_dirs=[_lib_path, _tl_path, _gsi_path, _pya_path], + extra_objects=[ + config.path_of("_lib", _lib_path), + config.path_of("_tl", _tl_path), + config.path_of("_gsi", _gsi_path), + config.path_of("_pya", _pya_path), + ], + extra_link_args=config.link_args("libcore"), + extra_compile_args=config.compile_args("libcore"), + sources=list(lib_sources), +) # ------------------------------------------------------------------ # rdb extension library @@ -696,13 +855,20 @@ lib = Extension(config.root + '.libcore', rdb_path = os.path.join("src", "pymod", "rdb") rdb_sources = set(glob.glob(os.path.join(rdb_path, "*.cc"))) -rdb = Extension(config.root + '.rdbcore', - define_macros=config.macros(), - include_dirs=[_rdb_path, _tl_path, _gsi_path, _pya_path], - extra_objects=[config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)], - extra_link_args=config.link_args('rdbcore'), - extra_compile_args=config.compile_args('rdbcore'), - sources=list(rdb_sources)) +rdb = Extension( + config.root + ".rdbcore", + define_macros=config.macros(), + include_dirs=[_rdb_path, _tl_path, _gsi_path, _pya_path], + extra_objects=[ + config.path_of("_rdb", _rdb_path), + config.path_of("_tl", _tl_path), + config.path_of("_gsi", _gsi_path), + config.path_of("_pya", _pya_path), + ], + extra_link_args=config.link_args("rdbcore"), + extra_compile_args=config.compile_args("rdbcore"), + sources=list(rdb_sources), +) # ------------------------------------------------------------------ # lay extension library @@ -737,28 +903,34 @@ lay = Extension(config.root + '.laycore', # ------------------------------------------------------------------ # Core setup function -if __name__ == '__main__': - setup(name=config.root, - version=config.version(), - license='GNU GPLv3', - description='KLayout standalone Python package', - long_description='This package is a standalone distribution of KLayout\'s Python API.\n\nFor more details see here: https://www.klayout.org/klayout-pypi', - author='Matthias Koefferlein', - author_email='matthias@klayout.de', - classifiers=[ - # Recommended classifiers - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 3", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - "Operating System :: MacOS :: MacOS X", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX :: Linux", - # Optional classifiers - "Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)", - ], - url='https://github.com/klayout/klayout', - packages=find_packages('src/pymod/distutils_src'), - package_dir={'': 'src/pymod/distutils_src'}, # https://github.com/pypa/setuptools/issues/230 - package_data={config.root: ["src/pymod/distutils_src/klayout/*.pyi"]}, - include_package_data=True, - ext_modules=[_tl, _gsi, _pya, _rba, _db, _lib, _rdb, _lym, _laybasic, _layview, _ant, _edt, _img] + db_plugins + [tl, db, lib, rdb, lay]) +if __name__ == "__main__": + setup( + name=config.root, + version=config.version(), + license="GNU GPLv3", + description="KLayout standalone Python package", + long_description="This package is a standalone distribution of KLayout's Python API.\n\nFor more details see here: https://www.klayout.org/klayout-pypi", + author="Matthias Koefferlein", + author_email="matthias@klayout.de", + classifiers=[ + # Recommended classifiers + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + # Optional classifiers + "Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)", + ], + url="https://github.com/klayout/klayout", + packages=find_packages("src/pymod/distutils_src"), + package_dir={ + "": "src/pymod/distutils_src" + }, # https://github.com/pypa/setuptools/issues/230 + package_data={config.root: ["src/pymod/distutils_src/klayout/*.pyi"]}, + include_package_data=True, + ext_modules=[_tl, _gsi, _pya, _rba, _db, _lib, _rdb, _lym, _laybasic, _layview, _ant, _edt, _img] + + db_plugins + + [tl, db, lib, rdb, lay]) + ) diff --git a/src/db/db/gsiDeclDbLibrary.cc b/src/db/db/gsiDeclDbLibrary.cc index d6537599f..5ef242944 100644 --- a/src/db/db/gsiDeclDbLibrary.cc +++ b/src/db/db/gsiDeclDbLibrary.cc @@ -36,7 +36,7 @@ namespace gsi // db::Library binding /** - * @brief A basic implementation of the library + * @brief A basic implementation of the library */ static db::Library *new_lib () { @@ -172,15 +172,15 @@ LibraryClass decl_Library ("db", "Library", "\n" "This method has been introduced in version 0.25.\n" ) + - gsi::method ("name", &db::Library::get_name, + gsi::method ("name", &db::Library::get_name, "@brief Returns the libraries' name\n" "The name is set when the library is registered and cannot be changed\n" ) + - gsi::method ("id", &db::Library::get_id, + gsi::method ("id", &db::Library::get_id, "@brief Returns the library's ID\n" "The ID is set when the library is registered and cannot be changed \n" ) + - gsi::method ("description", &db::Library::get_description, + gsi::method ("description", &db::Library::get_description, "@brief Returns the libraries' description text\n" ) + gsi::method ("description=", &db::Library::set_description, gsi::arg ("description"), @@ -231,7 +231,7 @@ LibraryClass decl_Library ("db", "Library", gsi::method ("layout_const", (const db::Layout &(db::Library::*)() const) &db::Library::layout, "@brief The layout object where the cells reside that this library defines (const version)\n" ) + - gsi::method ("layout", (db::Layout &(db::Library::*)()) &db::Library::layout, + gsi::method ("layout", (db::Layout &(db::Library::*)()) &db::Library::layout, "@brief The layout object where the cells reside that this library defines\n" ) + gsi::method ("refresh", &db::Library::refresh, @@ -303,7 +303,7 @@ class PCellDeclarationImpl : public db::PCellDeclaration { public: - // dummy implementation to provide the signature + // dummy implementation to provide the signature virtual std::vector get_layer_declarations_impl (const db::pcell_parameters_type &) const { return std::vector (); @@ -340,7 +340,7 @@ public: } } - // dummy implementation to provide the signature + // dummy implementation to provide the signature virtual db::pcell_parameters_type coerce_parameters_impl (const db::Layout & /*layout*/, const db::pcell_parameters_type &input) const { return input; @@ -472,7 +472,7 @@ Class decl_PCellDeclaration (decl_PCellDeclaration_Native, "This method receives the PCell parameters which allows it to deduce layers\n" "from the parameters." ) + - gsi::callback ("get_parameters", &PCellDeclarationImpl::get_parameter_declarations, &PCellDeclarationImpl::cb_get_parameter_declarations, + gsi::callback ("get_parameters", &PCellDeclarationImpl::get_parameter_declarations, &PCellDeclarationImpl::cb_get_parameter_declarations, "@brief Returns a list of parameter declarations\n" "Reimplement this method to return a list of parameters used in that PCell \n" "implementation. A parameter declaration is a PCellParameterDeclaration object\n" @@ -691,33 +691,33 @@ Class decl_PCellParameterDeclaration ("db", "PCel "@param default The default (initial) value\n" "@param unit The unit string\n" ) + - gsi::method ("name", &db::PCellParameterDeclaration::get_name, + gsi::method ("name", &db::PCellParameterDeclaration::get_name, "@brief Gets the name\n" ) + gsi::method ("name=", &db::PCellParameterDeclaration::set_name, gsi::arg ("value"), "@brief Sets the name\n" ) + - gsi::method ("unit", &db::PCellParameterDeclaration::get_unit, + gsi::method ("unit", &db::PCellParameterDeclaration::get_unit, "@brief Gets the unit string\n" ) + gsi::method ("unit=", &db::PCellParameterDeclaration::set_unit, gsi::arg ("unit"), "@brief Sets the unit string\n" "The unit string is shown right to the edit fields for numeric parameters.\n" ) + - gsi::method_ext ("type", &get_type, + gsi::method_ext ("type", &get_type, "@brief Gets the type\n" "The type is one of the T... constants." ) + gsi::method_ext ("type=", &set_type, gsi::arg ("type"), "@brief Sets the type\n" ) + - gsi::method ("description", &db::PCellParameterDeclaration::get_description, + gsi::method ("description", &db::PCellParameterDeclaration::get_description, "@brief Gets the description text\n" ) + gsi::method ("description=", &db::PCellParameterDeclaration::set_description, gsi::arg ("description"), "@brief Sets the description\n" ) + - gsi::method ("hidden?", &db::PCellParameterDeclaration::is_hidden, + gsi::method ("hidden?", &db::PCellParameterDeclaration::is_hidden, "@brief Returns true, if the parameter is a hidden parameter that should not be shown in the user interface\n" "By making a parameter hidden, it is possible to create internal parameters which cannot be\n" "edited.\n" @@ -725,7 +725,7 @@ Class decl_PCellParameterDeclaration ("db", "PCel gsi::method ("hidden=", &db::PCellParameterDeclaration::set_hidden, gsi::arg ("flag"), "@brief Makes the parameter hidden if this attribute is set to true\n" ) + - gsi::method ("readonly?", &db::PCellParameterDeclaration::is_readonly, + gsi::method ("readonly?", &db::PCellParameterDeclaration::is_readonly, "@brief Returns true, if the parameter is a read-only parameter\n" "By making a parameter read-only, it is shown but cannot be\n" "edited.\n" @@ -733,7 +733,7 @@ Class decl_PCellParameterDeclaration ("db", "PCel gsi::method ("readonly=", &db::PCellParameterDeclaration::set_readonly, gsi::arg ("flag"), "@brief Makes the parameter read-only if this attribute is set to true\n" ) + - gsi::method_ext ("clear_choices", &clear_choices, + gsi::method_ext ("clear_choices", &clear_choices, "@brief Clears the list of choices\n" ) + gsi::method_ext ("add_choice", &add_choice, gsi::arg ("description"), gsi::arg ("value"), @@ -742,13 +742,13 @@ Class decl_PCellParameterDeclaration ("db", "PCel "choices. If choices are defined, KLayout will show a drop-down box instead of an\n" "entry field in the parameter user interface.\n" ) + - gsi::method ("choice_values", &db::PCellParameterDeclaration::get_choices, + gsi::method ("choice_values", &db::PCellParameterDeclaration::get_choices, "@brief Returns a list of choice values\n" ) + - gsi::method ("choice_descriptions", &db::PCellParameterDeclaration::get_choice_descriptions, + gsi::method ("choice_descriptions", &db::PCellParameterDeclaration::get_choice_descriptions, "@brief Returns a list of choice descriptions\n" ) + - gsi::method ("default", &db::PCellParameterDeclaration::get_default, + gsi::method ("default", &db::PCellParameterDeclaration::get_default, "@brief Gets the default value\n" ) + gsi::method ("default=", &db::PCellParameterDeclaration::set_default, gsi::arg ("value"), @@ -763,7 +763,7 @@ Class decl_PCellParameterDeclaration ("db", "PCel gsi::method ("TypeList", &pd_type_list, "@brief Type code: a list of variants") + gsi::method ("TypeLayer", &pd_type_layer, "@brief Type code: a layer (a \\LayerInfo object)") + gsi::method ("TypeShape", &pd_type_shape, "@brief Type code: a guiding shape (Box, Edge, Point, Polygon or Path)") + - gsi::method ("TypeNone", &pd_type_none, "@brief Type code: unspecific type") + gsi::method ("TypeNone", &pd_type_none, "@brief Type code: unspecific type") , "@brief A PCell parameter declaration\n" "\n" @@ -776,4 +776,3 @@ Class decl_PCellParameterDeclaration ("db", "PCel ); } - diff --git a/src/db/db/gsiDeclDbPoint.cc b/src/db/db/gsiDeclDbPoint.cc index 9f3d45e7a..8302beca8 100644 --- a/src/db/db/gsiDeclDbPoint.cc +++ b/src/db/db/gsiDeclDbPoint.cc @@ -33,7 +33,7 @@ namespace gsi // point binding template -struct point_defs +struct point_defs { typedef typename C::coord_type coord_type; @@ -141,6 +141,14 @@ struct point_defs "\n" "Starting with version 0.25, this method renders a vector." ) + + method ("-", (C (C::*) (const db::vector &) const) &C::subtract, gsi::arg ("v"), + "@brief Subtract one vector from a point\n" + "\n" + "\n" + "Subtract vector v from from self by subtracting the coordinates. This renders a point.\n" + "\n" + "This method has been added in version 0.27." + ) + method ("<", &C::less, gsi::arg ("p"), "@brief \"less\" comparison operator\n" "\n" diff --git a/src/db/db/gsiDeclDbRegion.cc b/src/db/db/gsiDeclDbRegion.cc index 0cc777b8b..27b4cec35 100644 --- a/src/db/db/gsiDeclDbRegion.cc +++ b/src/db/db/gsiDeclDbRegion.cc @@ -752,7 +752,7 @@ extern Class decl_dbShapeCollection; Class decl_Region (decl_dbShapeCollection, "db", "Region", - constructor ("new", &new_v, + constructor ("new", &new_v, "@brief Default constructor\n" "\n" "This constructor creates an empty region.\n" @@ -798,8 +798,8 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "@code\n" "layout = ... # a layout\n" - "cell = ... # the index of the initial cell\n" - "layer = ... # the index of the layer from where to take the shapes from\n" + "cell = ... # the index of the initial cell\n" + "layer = ... # the index of the layer from where to take the shapes from\n" "r = RBA::Region::new(layout.begin_shapes(cell, layer))\n" "@/code\n" ) + @@ -814,8 +814,8 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "@code\n" "layout = ... # a layout\n" - "cell = ... # the index of the initial cell\n" - "layer = ... # the index of the layer from where to take the shapes from\n" + "cell = ... # the index of the initial cell\n" + "layer = ... # the index of the layer from where to take the shapes from\n" "dbu = 0.1 # the target database unit\n" "r = RBA::Region::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu))\n" "@/code\n" @@ -925,11 +925,11 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "as single regions and artificial edges such as cut-lines will not be considered.\n" "Merged semantics thus is equivalent to considering coherent areas rather than\n" "single polygons\n" - ) + + ) + method ("merged_semantics?", &db::Region::merged_semantics, "@brief Gets a flag indicating whether merged semantics is enabled\n" "See \\merged_semantics= for a description of this attribute.\n" - ) + + ) + method ("strict_handling=", &db::Region::set_strict_handling, gsi::arg ("f"), "@brief Enables or disables strict handling\n" "\n" @@ -941,7 +941,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "Strict handling is disabled by default and optimization is in place.\n" "\n" "This method has been introduced in version 0.23.2." - ) + + ) + method ("strict_handling?", &db::Region::strict_handling, "@brief Gets a flag indicating whether merged semantics is enabled\n" "See \\strict_handling= for a description of this attribute.\n" @@ -957,11 +957,11 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "created which touch at a corner).\n" "\n" "The default setting is maximum coherence (min_coherence = false).\n" - ) + + ) + method ("min_coherence?", &db::Region::min_coherence, "@brief Gets a flag indicating whether minimum coherence is selected\n" "See \\min_coherence= for a description of this attribute.\n" - ) + + ) + method_ext ("complex_op", &complex_op, gsi::arg ("node"), "@brief Executes a complex operation (see \\CompoundRegionOperationNode for details)\n" "\n" @@ -1337,7 +1337,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "of these boxes for example.\n" "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" - ) + + ) + method_ext ("extents", &extents1, gsi::arg ("d"), "@brief Returns a region with the enlarged bounding boxes of the polygons\n" "This method will return a region consisting of the bounding boxes of the polygons enlarged by the given distance d.\n" @@ -1346,7 +1346,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "of these boxes for example.\n" "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" - ) + + ) + method_ext ("extents", &extents2, gsi::arg ("dx"), gsi::arg ("dy"), "@brief Returns a region with the enlarged bounding boxes of the polygons\n" "This method will return a region consisting of the bounding boxes of the polygons enlarged by the given distance dx in x direction and dy in y direction.\n" @@ -1355,7 +1355,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "of these boxes for example.\n" "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" - ) + + ) + method_ext ("extent_refs", &extent_refs, "@hide\n" "This method is provided for DRC implementation.\n" @@ -1589,7 +1589,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "This method returns the sized region (see \\size), but does not modify self.\n" "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" - ) + + ) + method_ext ("andnot", &andnot, gsi::arg ("other"), "@brief Returns the boolean AND and NOT between self and the other region\n" "\n" @@ -1607,7 +1607,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method will compute the boolean AND (intersection) between two regions. " "The result is often but not necessarily always merged.\n" - ) + + ) + method ("&=", &db::Region::operator&=, gsi::arg ("other"), "@brief Performs the boolean AND between self and the other region\n" "\n" @@ -1615,7 +1615,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method will compute the boolean AND (intersection) between two regions. " "The result is often but not necessarily always merged.\n" - ) + + ) + method ("-", &db::Region::operator-, gsi::arg ("other"), "@brief Returns the boolean NOT between self and the other region\n" "\n" @@ -1623,7 +1623,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method will compute the boolean NOT (intersection) between two regions. " "The result is often but not necessarily always merged.\n" - ) + + ) + method ("-=", &db::Region::operator-=, gsi::arg ("other"), "@brief Performs the boolean NOT between self and the other region\n" "\n" @@ -1631,15 +1631,15 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method will compute the boolean NOT (intersection) between two regions. " "The result is often but not necessarily always merged.\n" - ) + + ) + method ("^", &db::Region::operator^, gsi::arg ("other"), - "@brief Returns the boolean NOT between self and the other region\n" + "@brief Returns the boolean XOR between self and the other region\n" "\n" "@return The result of the boolean XOR operation\n" "\n" "This method will compute the boolean XOR (intersection) between two regions. " "The result is often but not necessarily always merged.\n" - ) + + ) + method ("^=", &db::Region::operator^=, gsi::arg ("other"), "@brief Performs the boolean XOR between self and the other region\n" "\n" @@ -1647,7 +1647,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method will compute the boolean XOR (intersection) between two regions. " "The result is often but not necessarily always merged.\n" - ) + + ) + method ("\\|", &db::Region::operator|, gsi::arg ("other"), "@brief Returns the boolean OR between self and the other region\n" "\n" @@ -1655,7 +1655,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "The boolean OR is implemented by merging the polygons of both regions. To simply join the regions " "without merging, the + operator is more efficient." - ) + + ) + method ("\\|=", &db::Region::operator|=, gsi::arg ("other"), "@brief Performs the boolean OR between self and the other region\n" "\n" @@ -1663,7 +1663,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "The boolean OR is implemented by merging the polygons of both regions. To simply join the regions " "without merging, the + operator is more efficient." - ) + + ) + method ("+", &db::Region::operator+, gsi::arg ("other"), "@brief Returns the combined region of self and the other region\n" "\n" @@ -1671,7 +1671,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This operator adds the polygons of the other region to self and returns a new combined region. " "This usually creates unmerged regions and polygons may overlap. Use \\merge if you want to ensure the result region is merged.\n" - ) + + ) + method ("+=", &db::Region::operator+=, gsi::arg ("other"), "@brief Adds the polygons of the other region to self\n" "\n" @@ -1679,7 +1679,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This operator adds the polygons of the other region to self. " "This usually creates unmerged regions and polygons may overlap. Use \\merge if you want to ensure the result region is merged.\n" - ) + + ) + method ("covering", &db::Region::selected_enclosing, gsi::arg ("other"), gsi::arg ("min_count", size_t (1)), gsi::arg ("max_count", size_t (std::numeric_limits::max ()), "unlimited"), "@brief Returns the polygons of this region which are completely covering polygons from the other region\n" "\n" @@ -1740,14 +1740,14 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "@return A new region containing the polygons which are inside polygons from the other region\n" "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" - ) + + ) + method ("not_inside", &db::Region::selected_not_inside, gsi::arg ("other"), "@brief Returns the polygons of this region which are not completely inside polygons from the other region\n" "\n" "@return A new region containing the polygons which are not inside polygons from the other region\n" "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" - ) + + ) + method_ext ("split_inside", &split_inside, gsi::arg ("other"), "@brief Returns the polygons of this region which are completely inside polygons from the other region and the ones which are not at the same time\n" "\n" @@ -1764,28 +1764,28 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "@return The region after the polygons have been selected (self)\n" "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" - ) + + ) + method ("select_not_inside", &db::Region::select_not_inside, gsi::arg ("other"), "@brief Selects the polygons of this region which are not completely inside polygons from the other region\n" "\n" "@return The region after the polygons have been selected (self)\n" "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" - ) + + ) + method ("outside", &db::Region::selected_outside, gsi::arg ("other"), "@brief Returns the polygons of this region which are completely outside polygons from the other region\n" "\n" "@return A new region containing the polygons which are outside polygons from the other region\n" "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" - ) + + ) + method ("not_outside", &db::Region::selected_not_outside, gsi::arg ("other"), "@brief Returns the polygons of this region which are not completely outside polygons from the other region\n" "\n" "@return A new region containing the polygons which are not outside polygons from the other region\n" "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" - ) + + ) + method_ext ("split_outside", &split_outside, gsi::arg ("other"), "@brief Returns the polygons of this region which are completely outside polygons from the other region and the ones which are not at the same time\n" "\n" @@ -1802,14 +1802,14 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "@return The region after the polygons have been selected (self)\n" "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" - ) + + ) + method ("select_not_outside", &db::Region::select_not_outside, gsi::arg ("other"), "@brief Selects the polygons of this region which are not completely outside polygons from the other region\n" "\n" "@return The region after the polygons have been selected (self)\n" "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" - ) + + ) + method ("interacting", (db::Region (db::Region::*) (const db::Region &, size_t, size_t) const) &db::Region::selected_interacting, gsi::arg ("other"), gsi::arg ("min_count", size_t (1)), gsi::arg ("max_count", size_t (std::numeric_limits::max ()), "unlimited"), "@brief Returns the polygons of this region which overlap or touch polygons from the other region\n" "\n" @@ -2020,7 +2020,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" "\n" "The count options have been introduced in version 0.27." - ) + + ) + method ("not_overlapping", &db::Region::selected_not_overlapping, gsi::arg ("other"), gsi::arg ("min_count", size_t (1)), gsi::arg ("max_count", size_t (std::numeric_limits::max ()), "unlimited"), "@brief Returns the polygons of this region which do not overlap polygons from the other region\n" "\n" @@ -2129,7 +2129,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "possibilities of the edge collection.\n" "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" - ) + + ) + factory_ext ("decompose_convex", &decompose_convex, gsi::arg ("preferred_orientation", po_any (), "\\Polygon#PO_any"), "@brief Decomposes the region into convex pieces.\n" "\n" @@ -2166,7 +2166,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", method ("swap", &db::Region::swap, gsi::arg ("other"), "@brief Swap the contents of this region with the contents of another region\n" "This method is useful to avoid excessive memory allocation in some cases. " - "For managed memory languages such as Ruby, those cases will be rare. " + "For managed memory languages such as Ruby, those cases will be rare. " ) + method ("holes", &db::Region::holes, "@brief Returns the holes of the region\n" @@ -3099,4 +3099,3 @@ gsi::EnumIn decl_Region_OppositeFilter ("db", "O gsi::ClassExt inject_OppositeFilter_in_parent (decl_Region_OppositeFilter.defs ()); } - diff --git a/src/db/db/gsiDeclDbVector.cc b/src/db/db/gsiDeclDbVector.cc index 0e895435c..4de490437 100644 --- a/src/db/db/gsiDeclDbVector.cc +++ b/src/db/db/gsiDeclDbVector.cc @@ -246,6 +246,12 @@ struct vector_defs "\n" "The scalar product of a and b is defined as: vp = ax*bx+ay*by.\n" ) + + method_ext ("*", &sprod, gsi::arg ("v"), + "@brief Computes the scalar product between self and the given vector\n" + "\n" + "\n" + "The scalar product of a and b is defined as: vp = ax*bx+ay*by.\n" + ) + method_ext ("sprod_sign", &sprod_sign, gsi::arg ("v"), "@brief Computes the scalar product between self and the given vector and returns a value indicating the sign of the product\n" "\n" diff --git a/src/pya/pya/pya.h b/src/pya/pya/pya.h index fe1337b40..b2b26fed0 100644 --- a/src/pya/pya/pya.h +++ b/src/pya/pya/pya.h @@ -68,7 +68,7 @@ namespace pya } catch (...) { \ if (PythonInterpreter::instance ()) { PythonInterpreter::instance ()->end_execution (); } \ throw; \ - } + } /** * @brief A class encapsulating a python exception @@ -92,7 +92,7 @@ class PYA_PUBLIC PythonInterpreter { public: /** - * @brief The constructor + * @brief The constructor * * If embedded is true, the interpreter is an embedded one. Only in this case, the * Python interpreter is initialized. Otherwise, it is assumed the interpreter @@ -101,7 +101,7 @@ public: PythonInterpreter (bool embedded = true); /** - * @brief The destructor + * @brief The destructor */ ~PythonInterpreter (); @@ -160,10 +160,10 @@ public: * @brief Implementation of gsi::Interpreter::eval_expr */ tl::Variant eval_expr (const char *string, const char *filename = 0, int line = 1, int context = -1); - + /** * @brief Implementation of gsi::Interpreter::eval_string_and_print - */ + */ void eval_string_and_print (const char *string, const char *filename = 0, int line = 1, int context = -1); /** @@ -172,7 +172,7 @@ public: virtual gsi::Inspector *inspector (int context = -1); /** - * @brief Defines a global variable with the given name and value + * @brief Defines a global variable with the given name and value */ void define_variable (const std::string &name, const tl::Variant &value); @@ -284,4 +284,3 @@ private: } #endif - diff --git a/src/pya/pya/pyaConvert.cc b/src/pya/pya/pyaConvert.cc index fb24e5732..066ec3feb 100644 --- a/src/pya/pya/pyaConvert.cc +++ b/src/pya/pya/pyaConvert.cc @@ -45,14 +45,14 @@ long python2c_func::operator() (PyObject *rval) #if PY_MAJOR_VERSION < 3 if (PyInt_Check (rval)) { return PyInt_AsLong (rval); - } else + } else #endif if (PyLong_Check (rval)) { return PyLong_AsLong (rval); } else if (PyFloat_Check (rval)) { return (long) (PyFloat_AsDouble (rval)); } else { - throw tl::Exception (tl::to_string (tr ("Value cannot be converted to an integer"))); + throw tl::TypeError (tl::to_string (tr ("Value cannot be converted to an integer"))); } } @@ -68,14 +68,14 @@ char python2c_func::operator() (PyObject *rval) #if PY_MAJOR_VERSION < 3 if (PyInt_Check (rval)) { return char (PyInt_AsLong (rval)); - } else + } else #endif if (PyLong_Check (rval)) { return char (PyLong_AsLong (rval)); } else if (PyFloat_Check (rval)) { return char (PyFloat_AsDouble (rval)); } else { - throw tl::Exception (tl::to_string (tr ("Value cannot be converted to a character"))); + throw tl::TypeError (tl::to_string (tr ("Value cannot be converted to a character"))); } } @@ -85,14 +85,14 @@ unsigned long python2c_func::operator() (PyObject *rval) #if PY_MAJOR_VERSION < 3 if (PyInt_Check (rval)) { return PyInt_AsUnsignedLongMask (rval); - } else + } else #endif if (PyLong_Check (rval)) { return PyLong_AsUnsignedLongMask (rval); } else if (PyFloat_Check (rval)) { return (unsigned long) (PyFloat_AsDouble (rval)); } else { - throw tl::Exception (tl::to_string (tr ("Value cannot be converted to an integer"))); + throw tl::TypeError (tl::to_string (tr ("Value cannot be converted to an integer"))); } } @@ -102,14 +102,14 @@ long long python2c_func::operator() (PyObject *rval) #if PY_MAJOR_VERSION < 3 if (PyInt_Check (rval)) { return PyInt_AsLong (rval); - } else + } else #endif if (PyLong_Check (rval)) { return PyLong_AsLongLong (rval); } else if (PyFloat_Check (rval)) { return (long long) (PyFloat_AsDouble (rval)); } else { - throw tl::Exception (tl::to_string (tr ("Value cannot be converted to an integer"))); + throw tl::TypeError (tl::to_string (tr ("Value cannot be converted to an integer"))); } } @@ -119,14 +119,14 @@ unsigned long long python2c_func::operator() (PyObject *rval #if PY_MAJOR_VERSION < 3 if (PyInt_Check (rval)) { return PyInt_AsUnsignedLongMask (rval); - } else + } else #endif if (PyLong_Check (rval)) { return PyLong_AsUnsignedLongLongMask (rval); } else if (PyFloat_Check (rval)) { return (unsigned long long) (PyFloat_AsDouble (rval)); } else { - throw tl::Exception (tl::to_string (tr ("Value cannot be converted to an integer"))); + throw tl::TypeError (tl::to_string (tr ("Value cannot be converted to an integer"))); } } @@ -138,14 +138,14 @@ __int128 python2c_func<__int128>::operator() (PyObject *rval) #if PY_MAJOR_VERSION < 3 if (PyInt_Check (rval)) { return PyInt_AsLong (rval); - } else + } else #endif if (PyLong_Check (rval)) { return PyLong_AsLongLong (rval); } else if (PyFloat_Check (rval)) { return PyFloat_AsDouble (rval); } else { - throw tl::Exception (tl::to_string (tr ("Value cannot be converted to an integer"))); + throw tl::TypeError (tl::to_string (tr ("Value cannot be converted to an integer"))); } } #endif @@ -156,14 +156,14 @@ double python2c_func::operator() (PyObject *rval) #if PY_MAJOR_VERSION < 3 if (PyInt_Check (rval)) { return PyInt_AsLong (rval); - } else + } else #endif if (PyLong_Check (rval)) { return PyLong_AsLongLong (rval); } else if (PyFloat_Check (rval)) { return PyFloat_AsDouble (rval); } else { - throw tl::Exception (tl::to_string (tr ("Value cannot be converted to a floating-point value"))); + throw tl::TypeError (tl::to_string (tr ("Value cannot be converted to a floating-point value"))); } } @@ -173,11 +173,11 @@ std::string python2c_func::operator() (PyObject *rval) #if PY_MAJOR_VERSION < 3 if (PyString_Check (rval)) { return std::string (PyString_AsString (rval), PyString_Size (rval)); - } else + } else #else if (PyBytes_Check (rval)) { return std::string (PyBytes_AsString (rval), PyBytes_Size (rval)); - } else + } else #endif if (PyUnicode_Check (rval)) { PythonRef ba (PyUnicode_AsUTF8String (rval)); @@ -188,7 +188,7 @@ std::string python2c_func::operator() (PyObject *rval) } else if (PyByteArray_Check (rval)) { return std::string (PyByteArray_AsString (rval), PyByteArray_Size (rval)); } else { - throw tl::Exception (tl::to_string (tr ("Value cannot be converted to a string"))); + throw tl::TypeError (tl::to_string (tr ("Value cannot be converted to a string"))); } } @@ -224,7 +224,7 @@ std::vector python2c_func >::operator() (PyObject *rval) Py_ssize_t sz = PyByteArray_Size (rval); return std::vector (cp, cp + sz); } else { - throw tl::Exception (tl::to_string (tr ("Value cannot be converted to a byte array"))); + throw tl::TypeError (tl::to_string (tr ("Value cannot be converted to a byte array"))); } } @@ -235,11 +235,11 @@ QByteArray python2c_func::operator() (PyObject *rval) #if PY_MAJOR_VERSION < 3 if (PyString_Check (rval)) { return QByteArray (PyString_AsString (rval), PyString_Size (rval)); - } else + } else #else if (PyBytes_Check (rval)) { return QByteArray (PyBytes_AsString (rval), PyBytes_Size (rval)); - } else + } else #endif if (PyUnicode_Check (rval)) { PythonRef ba (PyUnicode_AsUTF8String (rval)); @@ -250,7 +250,7 @@ QByteArray python2c_func::operator() (PyObject *rval) } else if (PyByteArray_Check (rval)) { return QByteArray (PyByteArray_AsString (rval), PyByteArray_Size (rval)); } else { - throw tl::Exception (tl::to_string (tr ("Value cannot be converted to a byte array"))); + throw tl::TypeError (tl::to_string (tr ("Value cannot be converted to a byte array"))); } } @@ -325,13 +325,13 @@ tl::Variant python2c_func::operator() (PyObject *rval) return r; } else { - + const gsi::ClassBase *cls = PythonModule::cls_for_type (Py_TYPE (rval)); if (cls) { PYAObjectBase *p = PYAObjectBase::from_pyobject (rval); - // employ the tl::Variant binding capabilities of the Expression binding to derive the + // employ the tl::Variant binding capabilities of the Expression binding to derive the // variant value. void *obj = p->obj (); @@ -519,7 +519,7 @@ PyObject *c2python_func::operator() (const tl::Variant &c) PyDict_SetItem (ret, c2python (i->first), c2python (i->second)); } return ret; - + } else if (c.is_list ()) { PyObject *ret = PyList_New (c.get_list ().size ()); @@ -619,4 +619,3 @@ PyObject *c2python_func::operator() (const QString &qs) #endif } - diff --git a/src/pya/pya/pyaMarshal.cc b/src/pya/pya/pyaMarshal.cc index 2913c1ace..d905f1a91 100644 --- a/src/pya/pya/pyaMarshal.cc +++ b/src/pya/pya/pyaMarshal.cc @@ -469,7 +469,7 @@ struct writer const gsi::ClassBase *cls_decl = PythonModule::cls_for_type (Py_TYPE (arg)); if (! cls_decl) { - throw tl::Exception (tl::sprintf (tl::to_string (tr ("Unexpected object type (expected argument of class %s, got %s)")), atype.cls ()->name (), Py_TYPE (arg)->tp_name)); + throw tl::TypeError (tl::sprintf (tl::to_string (tr ("Unexpected object type (expected argument of class %s, got %s)")), atype.cls ()->name (), Py_TYPE (arg)->tp_name)); } if (cls_decl->is_derived_from (atype.cls ())) { @@ -494,14 +494,14 @@ struct writer aa->write (new_obj); } else { - throw tl::Exception (tl::sprintf (tl::to_string (tr ("Unexpected object type (expected argument of class %s, got %s)")), atype.cls ()->name (), cls_decl->name ())); + throw tl::TypeError (tl::sprintf (tl::to_string (tr ("Unexpected object type (expected argument of class %s, got %s)")), atype.cls ()->name (), cls_decl->name ())); } } else { const gsi::ClassBase *cls_decl = PythonModule::cls_for_type (Py_TYPE (arg)); if (! cls_decl) { - throw tl::Exception (tl::sprintf (tl::to_string (tr ("Unexpected object type (expected argument of class %s, got %s)")), atype.cls ()->name (), Py_TYPE (arg)->tp_name)); + throw tl::TypeError (tl::sprintf (tl::to_string (tr ("Unexpected object type (expected argument of class %s, got %s)")), atype.cls ()->name (), Py_TYPE (arg)->tp_name)); } if (cls_decl->is_derived_from (atype.cls ())) { @@ -521,7 +521,7 @@ struct writer aa->write (atype.cls ()->create_obj_from (cls_decl, p->obj ())); } else { - throw tl::Exception (tl::sprintf (tl::to_string (tr ("Unexpected object type (expected argument of class %s, got %s)")), atype.cls ()->name (), cls_decl->name ())); + throw tl::TypeError (tl::sprintf (tl::to_string (tr ("Unexpected object type (expected argument of class %s, got %s)")), atype.cls ()->name (), cls_decl->name ())); } } diff --git a/src/pya/pya/pyaMarshal.h b/src/pya/pya/pyaMarshal.h index 6556d10df..7370bf7d3 100644 --- a/src/pya/pya/pyaMarshal.h +++ b/src/pya/pya/pyaMarshal.h @@ -43,7 +43,7 @@ class PYAObjectBase; * @param arg The argument to serialize (a Python object) * @param heap A heap for temporary objects * - * The heap collects objects created while filling the buffer. + * The heap collects objects created while filling the buffer. * The stack must persist as long as the serial buffer is used. */ void @@ -84,4 +84,3 @@ void correct_constness (PyObject *obj, bool const_required); } #endif - diff --git a/src/pya/pya/pyaModule.cc b/src/pya/pya/pyaModule.cc index 191adb70d..ac5de2ffb 100644 --- a/src/pya/pya/pyaModule.cc +++ b/src/pya/pya/pyaModule.cc @@ -920,7 +920,7 @@ match_method (int mid, PyObject *self, PyObject *args, bool strict) if (! strict) { return 0; } else { - throw tl::Exception (tl::to_string (tr ("No overload with matching arguments"))); + throw tl::TypeError (tl::to_string (tr ("No overload with matching arguments"))); } } @@ -928,7 +928,7 @@ match_method (int mid, PyObject *self, PyObject *args, bool strict) if (! strict) { return 0; } else { - throw tl::Exception (tl::to_string (tr ("Ambiguous overload variants - multiple method declarations match arguments"))); + throw tl::TypeError (tl::to_string (tr ("Ambiguous overload variants - multiple method declarations match arguments"))); } } @@ -2734,10 +2734,26 @@ public: alt_names.push_back ("__iter__"); } else if (name == "__mul__") { - // Adding right multiplication - // Rationale: if pyaObj * x works, so should x * pyaObj - mp_module->add_python_doc (*cls, mt, int (mid), tl::to_string (tr ("This method is also available as '__mul__'"))); - alt_names.push_back ("__rmul__"); + + // Adding right multiplication + // Rationale: if pyaObj * x works, so should x * pyaObj + // But this should only apply if the multiplication is commutative + // There are a few exceptions like Trans * Trans, so we support this case only if + // the second argument is double (scaling). + gsi::ArgType double_argtype; + double_argtype.template init (); + if (m_first->arg (0) == double_argtype) { + add_python_doc (**c, mt, int (mid), tl::to_string (tr ("This method is also available as '__rmul__'"))); + alt_names.push_back ("__rmul__"); + } + + } else if (name == "dup" && m_first->compatible_with_num_args (0) ) { + + // If the object supports the dup method, then it is a good + // idea to define the __copy__ method. + add_python_doc (**c, mt, int (mid), tl::to_string (tr ("This method also implements '__copy__'"))); + alt_names.push_back ("__copy__"); + } for (std::vector ::const_iterator an = alt_names.begin (); an != alt_names.end (); ++an) { @@ -2901,11 +2917,13 @@ public: PyObject *attr_class = PyObject_GetAttrString ((PyObject *) type, ("_class_" + *a).c_str ()); if (attr_inst == NULL || attr_class == NULL) { - // some error or disambiguator is not required -> don't install it + // some error -> don't install the disambiguator Py_XDECREF (attr_inst); Py_XDECREF (attr_class); PyErr_Clear (); + tl::warn << "Unable to install a static/non-static disambiguator for " << *a << " in class " << (*c)->name (); + } else { PyObject *desc = PYAAmbiguousMethodDispatcher::create (attr_inst, attr_class); diff --git a/src/pya/pya/pyaUtils.h b/src/pya/pya/pyaUtils.h index b37de3518..6f1294f72 100644 --- a/src/pya/pya/pyaUtils.h +++ b/src/pya/pya/pyaUtils.h @@ -43,6 +43,10 @@ namespace pya } catch (std::exception &ex) { \ std::string msg = std::string(ex.what ()) + tl::to_string (tr (" in ")) + (where); \ PyErr_SetString (PyExc_RuntimeError, msg.c_str ()); \ + } catch (tl::TypeError &ex) { \ + std::string msg; \ + msg = ex.msg () + tl::to_string (tr (" in ")) + (where); \ + PyErr_SetString (PyExc_TypeError, msg.c_str ()); \ } catch (tl::Exception &ex) { \ std::string msg; \ msg = ex.msg () + tl::to_string (tr (" in ")) + (where); \ @@ -73,4 +77,3 @@ void check_error (); } #endif - diff --git a/src/pymod/distutils_src/klayout/db/__init__.py b/src/pymod/distutils_src/klayout/db/__init__.py index ed86dcf86..362acbffd 100644 --- a/src/pymod/distutils_src/klayout/db/__init__.py +++ b/src/pymod/distutils_src/klayout/db/__init__.py @@ -1,6 +1,79 @@ +import functools +from typing import Type import klayout.dbcore from klayout.dbcore import * from klayout.db.pcell_declaration_helper import PCellDeclarationHelper -__all__ = klayout.dbcore.__all__ + ['PCellDeclarationHelper'] +__all__ = klayout.dbcore.__all__ + ["PCellDeclarationHelper"] # type: ignore + +# Implementing deepcopy of common objects +# Point-like classes +PointLike = (Point, DPoint, DVector, Vector) + + +def pyaPoint__deepcopy__(self, memo): + return self.dup() + + +def convert_type_error_to_not_implemented(cls, method): + """If cls.method exists raises a TypeError, patch it so + it returns a NotImplemented error instead. + + + """ + if not hasattr(cls, method): + return + + old_func = getattr(cls, method) + + @functools.wraps(old_func) + def new_func(*args, **kwargs): + try: + return old_func(*args, **kwargs) + except TypeError: + return NotImplemented + try: + setattr(cls, method, new_func) + except TypeError: + # Some classes are immutable and cannot be changed. + # At the time of writing, this happens to (_StaticAttribute, _AmbiguousMethodDispatcher, _Iterator, _Signal).__or__ + return + +for PClass in PointLike: + PClass.__deepcopy__ = pyaPoint__deepcopy__ # type: ignore + +for cls in klayout.dbcore.__dict__.values(): + if not isinstance(cls, type): # skip if not a class + continue + for method in ( + "__add__", + "__sub__", + "__mul__", + "__matmul__", + "__truediv__", + "__floordiv__", + "__mod__", + "__divmod__", + "__pow__", + "__lshift__", + "__rshift__", + "__and__", + "__xor__", + "__or__", + ): + # list of methods extracted from https://docs.python.org/3.7/reference/datamodel.html#emulating-numeric-types + convert_type_error_to_not_implemented(cls, method) + + +# If class has from_s, to_s, and assign, use them to +# enable serialization. +for name, cls in klayout.dbcore.__dict__.items(): + if not isinstance(cls, type): + continue + if hasattr(cls, 'from_s') and hasattr(cls, 'to_s') and hasattr(cls, 'assign'): + cls.__getstate__ = cls.to_s # type: ignore + def _setstate(self, str): + cls = self.__class__ + self.assign(cls.from_s(str)) + cls.__setstate__ = _setstate # type: ignore diff --git a/src/pymod/distutils_src/klayout/db/pcell_declaration_helper.py b/src/pymod/distutils_src/klayout/db/pcell_declaration_helper.py index 2945acdbb..bf10d5bb5 100644 --- a/src/pymod/distutils_src/klayout/db/pcell_declaration_helper.py +++ b/src/pymod/distutils_src/klayout/db/pcell_declaration_helper.py @@ -63,7 +63,17 @@ class _PCellDeclarationHelper(PCellDeclaration): self.layer = None self.cell = None - def param(self, name, value_type, description, hidden=False, readonly=False, unit=None, default=None, choices=None): + def param( + self, + name, + value_type, + description, + hidden=False, + readonly=False, + unit=None, + default=None, + choices=None, + ): """ Defines a parameter name -> the short name of the parameter @@ -84,11 +94,16 @@ class _PCellDeclarationHelper(PCellDeclaration): # create accessor methods for the parameters param_index = len(self._param_decls) - setattr(type(self), name, _PCellDeclarationHelperParameterDescriptor(param_index)) + setattr( + type(self), name, _PCellDeclarationHelperParameterDescriptor(param_index) + ) if value_type == type(self).TypeLayer: - setattr(type(self), name + "_layer", - _PCellDeclarationHelperLayerDescriptor(len(self._layer_param_index))) + setattr( + type(self), + name + "_layer", + _PCellDeclarationHelperLayerDescriptor(len(self._layer_param_index)), + ) self._layer_param_index.append(param_index) # store the parameter declarations @@ -104,10 +119,16 @@ class _PCellDeclarationHelper(PCellDeclaration): pdecl.unit = unit if not (choices is None): if not isinstance(choices, list) and not isinstance(choices, tuple): - raise Exception("choices value must be an list/tuple of two-element arrays (description, value)") + raise Exception( + "choices value must be an list/tuple of two-element arrays (description, value)" + ) for c in choices: - if (not isinstance(choices, list) and not isinstance(choices, tuple)) or len(c) != 2: - raise Exception("choices value must be an list/tuple of two-element arrays (description, value)") + if ( + not isinstance(choices, list) and not isinstance(choices, tuple) + ) or len(c) != 2: + raise Exception( + "choices value must be an list/tuple of two-element arrays (description, value)" + ) pdecl.add_choice(c[0], c[1]) # return the declaration object for further operations diff --git a/src/pymod/distutils_src/klayout/dbcore.pyi b/src/pymod/distutils_src/klayout/dbcore.pyi index 08f63718b..40b890ac0 100644 --- a/src/pymod/distutils_src/klayout/dbcore.pyi +++ b/src/pymod/distutils_src/klayout/dbcore.pyi @@ -1,4 +1,4 @@ -from typing import Any, ClassVar, Dict, Iterable, Optional +from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional from typing import overload import klayout.rdb as rdb import klayout.tl as tl @@ -104,11 +104,22 @@ class Box: @return The intersection box """ + def __copy__(self) -> Box: + r""" + @brief Creates a copy of self + """ def __eq__(self, box: object) -> bool: r""" @brief Returns true if this box is equal to the other box Returns true, if this box and the given box are equal """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given box. This method enables boxes as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -179,6 +190,42 @@ class Box: @brief Returns true if this box is not equal to the other box Returns true, if this box and the given box are not equal """ + def __repr__(self) -> str: + r""" + @brief Returns a string representing this box + + This string can be turned into a box again by using \from_s + """ + @overload + def __rmul__(self, box: Box) -> Box: + r""" + @brief Returns the convolution product from this box with another box + + + The * operator convolves the firstbox with the one given as + the second argument. The box resulting from "convolution" is the + outer boundary of the union set formed by placing + the second box at every point of the first. In other words, + the returned box of (p1,p2)*(q1,q2) is (p1+q1,p2+q2). + + @param box The box to convolve with this box. + + @return The convolved box + """ + @overload + def __rmul__(self, scale_factor: float) -> Box: + r""" + @brief Returns the scaled box + + + The * operator scales the box with the given factor and returns the result. + + This method has been introduced in version 0.22. + + @param scale_factor The scaling factor + + @return The scaled box + """ def __str__(self) -> str: r""" @brief Returns a string representing this box @@ -580,11 +627,22 @@ class DBox: @return The intersection box """ + def __copy__(self) -> DBox: + r""" + @brief Creates a copy of self + """ def __eq__(self, box: object) -> bool: r""" @brief Returns true if this box is equal to the other box Returns true, if this box and the given box are equal """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given box. This method enables boxes as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -655,6 +713,42 @@ class DBox: @brief Returns true if this box is not equal to the other box Returns true, if this box and the given box are not equal """ + def __repr__(self) -> str: + r""" + @brief Returns a string representing this box + + This string can be turned into a box again by using \from_s + """ + @overload + def __rmul__(self, box: DBox) -> DBox: + r""" + @brief Returns the convolution product from this box with another box + + + The * operator convolves the firstbox with the one given as + the second argument. The box resulting from "convolution" is the + outer boundary of the union set formed by placing + the second box at every point of the first. In other words, + the returned box of (p1,p2)*(q1,q2) is (p1+q1,p2+q2). + + @param box The box to convolve with this box. + + @return The convolved box + """ + @overload + def __rmul__(self, scale_factor: float) -> DBox: + r""" + @brief Returns the scaled box + + + The * operator scales the box with the given factor and returns the result. + + This method has been introduced in version 0.22. + + @param scale_factor The scaling factor + + @return The scaled box + """ def __str__(self) -> str: r""" @brief Returns a string representing this box @@ -1001,6 +1095,14 @@ class Cell: This method has been introduced in version 0.23. """ + def __copy__(self) -> Cell: + r""" + @brief Creates a copy of the cell + + This method will create a copy of the cell. The new cell will be member of the same layout the original cell was member of. The copy will inherit all shapes and instances, but get a different cell_index and a modified name as duplicate cell names are not allowed in the same layout. + + This method has been introduced in version 0.27. + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -1188,7 +1290,7 @@ class Cell: This variant has been added in version 0.25. """ - def called_cells(self) -> Iterable[int]: + def called_cells(self) -> List[int]: r""" @brief Gets a list of all called cells @@ -1199,7 +1301,7 @@ class Cell: @return A list of cell indices. """ - def caller_cells(self) -> Iterable[int]: + def caller_cells(self) -> List[int]: r""" @brief Gets a list of all caller cells @@ -1225,7 +1327,7 @@ class Cell: This method has been introduced in version 0.23. """ @overload - def change_pcell_parameters(self, instance: Instance, parameters: Iterable[Any]) -> Instance: + def change_pcell_parameters(self, instance: Instance, parameters: Sequence[Any]) -> Instance: r""" @brief Changes the parameters for an individual PCell instance @return The new instance (the old may be invalid) @@ -1346,7 +1448,7 @@ class Cell: This method has been added in version 0.23. """ - def copy_tree(self, source_cell: Cell) -> Iterable[int]: + def copy_tree(self, source_cell: Cell) -> List[int]: r""" @brief Copies the cell tree of the given cell into this cell @param source_cell The cell from where to copy the cell tree @@ -1456,20 +1558,20 @@ class Cell: This method has been introduced in version 0.27. """ - def each_child_cell(self) -> Iterable[int]: + def each_child_cell(self) -> Iterator[int]: r""" @brief Iterates over all child cells This iterator will report the child cell indices, not every instance. """ - def each_inst(self) -> Iterable[Instance]: + def each_inst(self) -> Iterator[Instance]: r""" @brief Iterates over all child instances (which may actually be instance arrays) Starting with version 0.15, this iterator delivers \Instance objects rather than \CellInstArray objects. """ @overload - def each_overlapping_inst(self, b: Box) -> Iterable[Instance]: + def each_overlapping_inst(self, b: Box) -> Iterator[Instance]: r""" @brief Gets the instances overlapping the given rectangle @@ -1481,7 +1583,7 @@ class Cell: Starting with version 0.15, this iterator delivers \Instance objects rather than \CellInstArray objects. """ @overload - def each_overlapping_inst(self, b: DBox) -> Iterable[Instance]: + def each_overlapping_inst(self, b: DBox) -> Iterator[Instance]: r""" @brief Gets the instances overlapping the given rectangle, with the rectangle in micrometer units @@ -1493,7 +1595,7 @@ class Cell: This variant has been introduced in version 0.25. """ @overload - def each_overlapping_shape(self, layer_index: int, box: Box) -> Iterable[Shape]: + def each_overlapping_shape(self, layer_index: int, box: Box) -> Iterator[Shape]: r""" @brief Iterates over all shapes of a given layer that overlap the given box @@ -1504,7 +1606,7 @@ class Cell: This convenience method has been introduced in version 0.16. """ @overload - def each_overlapping_shape(self, layer_index: int, box: DBox) -> Iterable[Shape]: + def each_overlapping_shape(self, layer_index: int, box: DBox) -> Iterator[Shape]: r""" @brief Iterates over all shapes of a given layer that overlap the given box, with the box given in micrometer units @@ -1515,7 +1617,7 @@ class Cell: This convenience method has been introduced in version 0.16. """ @overload - def each_overlapping_shape(self, layer_index: int, box: Box, flags: int) -> Iterable[Shape]: + def each_overlapping_shape(self, layer_index: int, box: Box, flags: int) -> Iterator[Shape]: r""" @brief Iterates over all shapes of a given layer that overlap the given box @@ -1524,7 +1626,7 @@ class Cell: @param layer_index The layer on which to run the query """ @overload - def each_overlapping_shape(self, layer_index: int, box: DBox, flags: int) -> Iterable[Shape]: + def each_overlapping_shape(self, layer_index: int, box: DBox, flags: int) -> Iterator[Shape]: r""" @brief Iterates over all shapes of a given layer that overlap the given box, with the box given in micrometer units @@ -1532,21 +1634,21 @@ class Cell: @param box The box by which to query the shapes as a \DBox object in micrometer units @param layer_index The layer on which to run the query """ - def each_parent_cell(self) -> Iterable[int]: + def each_parent_cell(self) -> Iterator[int]: r""" @brief Iterates over all parent cells This iterator will iterate over the parent cells, just returning their cell index. """ - def each_parent_inst(self) -> Iterable[ParentInstArray]: + def each_parent_inst(self) -> Iterator[ParentInstArray]: r""" @brief Iterates over the parent instance list (which may actually be instance arrays) The parent instances are basically inversions of the instances. Using parent instances it is possible to determine how a specific cell is called from where. """ @overload - def each_shape(self, layer_index: int) -> Iterable[Shape]: + def each_shape(self, layer_index: int) -> Iterator[Shape]: r""" @brief Iterates over all shapes of a given layer @@ -1556,7 +1658,7 @@ class Cell: This convenience method has been introduced in version 0.16. """ @overload - def each_shape(self, layer_index: int, flags: int) -> Iterable[Shape]: + def each_shape(self, layer_index: int, flags: int) -> Iterator[Shape]: r""" @brief Iterates over all shapes of a given layer @@ -1566,7 +1668,7 @@ class Cell: This iterator is equivalent to 'shapes(layer).each'. """ @overload - def each_touching_inst(self, b: Box) -> Iterable[Instance]: + def each_touching_inst(self, b: Box) -> Iterator[Instance]: r""" @brief Gets the instances touching the given rectangle @@ -1578,7 +1680,7 @@ class Cell: Starting with version 0.15, this iterator delivers \Instance objects rather than \CellInstArray objects. """ @overload - def each_touching_inst(self, b: DBox) -> Iterable[Instance]: + def each_touching_inst(self, b: DBox) -> Iterator[Instance]: r""" @brief Gets the instances touching the given rectangle, with the rectangle in micrometer units @@ -1590,7 +1692,7 @@ class Cell: This variant has been introduced in version 0.25. """ @overload - def each_touching_shape(self, layer_index: int, box: Box) -> Iterable[Shape]: + def each_touching_shape(self, layer_index: int, box: Box) -> Iterator[Shape]: r""" @brief Iterates over all shapes of a given layer that touch the given box @@ -1601,7 +1703,7 @@ class Cell: This convenience method has been introduced in version 0.16. """ @overload - def each_touching_shape(self, layer_index: int, box: DBox) -> Iterable[Shape]: + def each_touching_shape(self, layer_index: int, box: DBox) -> Iterator[Shape]: r""" @brief Iterates over all shapes of a given layer that touch the given box, with the box given in micrometer units @@ -1612,7 +1714,7 @@ class Cell: This convenience method has been introduced in version 0.16. """ @overload - def each_touching_shape(self, layer_index: int, box: Box, flags: int) -> Iterable[Shape]: + def each_touching_shape(self, layer_index: int, box: Box, flags: int) -> Iterator[Shape]: r""" @brief Iterates over all shapes of a given layer that touch the given box @@ -1621,7 +1723,7 @@ class Cell: @param layer_index The layer on which to run the query """ @overload - def each_touching_shape(self, layer_index: int, box: DBox, flags: int) -> Iterable[Shape]: + def each_touching_shape(self, layer_index: int, box: DBox, flags: int) -> Iterator[Shape]: r""" @brief Iterates over all shapes of a given layer that touch the given box, with the box given in micrometer units @@ -1978,7 +2080,7 @@ class Cell: This method has been added in version 0.23. """ - def move_tree(self, source_cell: Cell) -> Iterable[int]: + def move_tree(self, source_cell: Cell) -> List[int]: r""" @brief Moves the cell tree of the given cell into this cell @param source_cell The cell from where to move the cell tree @@ -2092,7 +2194,7 @@ class Cell: This method has been introduced in version 0.25. """ @overload - def pcell_parameters(self) -> Iterable[Any]: + def pcell_parameters(self) -> List[Any]: r""" @brief Returns the PCell parameters for a pcell variant If the cell is a PCell variant, this method returns a list of @@ -2103,7 +2205,7 @@ class Cell: This method has been introduced in version 0.22. """ @overload - def pcell_parameters(self, instance: Instance) -> Iterable[Any]: + def pcell_parameters(self, instance: Instance) -> List[Any]: r""" @brief Returns the PCell parameters for a pcell instance If the given instance is a PCell instance, this method returns a list of @@ -2610,6 +2712,10 @@ class Instance: This method has been introduced in version 0.23. """ + def __copy__(self) -> Instance: + r""" + @brief Creates a copy of self + """ def __eq__(self, b: object) -> bool: r""" @brief Tests for equality of two Instance objects @@ -2625,6 +2731,11 @@ class Instance: r""" @brief Creates a new object of this class """ + def __len__(self) -> int: + r""" + @brief Gets the number of single instances in the instance array + If the instance represents a single instance, the count is 1. Otherwise it is na*nb. + """ def __lt__(self, b: Instance) -> bool: r""" @brief Provides an order criterion for two Instance objects @@ -2635,28 +2746,24 @@ class Instance: @brief Tests for inequality of two Instance objects Warning: this operator returns true if both objects refer to the same instance, not just identical ones. """ + def __repr__(self) -> str: + r""" + @brief Creates a string showing the contents of the reference + + This method has been introduced with version 0.16. + """ def __setitem__(self, key: Any, value: Any) -> None: r""" @brief Sets the user property with the given key or, if available, the PCell parameter with the name given by the key Setting the PCell parameter has priority over the user property. This method has been introduced in version 0.25. """ - @overload def __str__(self) -> str: r""" @brief Creates a string showing the contents of the reference This method has been introduced with version 0.16. """ - @overload - def __str__(self, with_cellname: bool) -> str: - r""" - @brief Creates a string showing the contents of the reference - - Passing true to with_cellname makes the string contain the cellname instead of the cell index - - This method has been introduced with version 0.23. - """ def _create(self) -> None: r""" @brief Ensures the C++ object is created @@ -2720,7 +2827,7 @@ class Instance: This method has been introduced in version 0.24. """ @overload - def change_pcell_parameters(self, params: Iterable[Any]) -> None: + def change_pcell_parameters(self, params: Sequence[Any]) -> None: r""" @brief Changes the parameters of a PCell instance to the list of parameters @@ -2863,7 +2970,7 @@ class Instance: This method has been introduced in version 0.25. """ - def pcell_parameters(self) -> Iterable[Any]: + def pcell_parameters(self) -> List[Any]: r""" @brief Gets the parameters of a PCell instance as a list of values @return A list of values @@ -2998,6 +3105,10 @@ class ParentInstArray: See @The Database API@ for more details about the database objects. """ + def __copy__(self) -> ParentInstArray: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -3134,10 +3245,21 @@ class CellInstArray: This method was introduced in version 0.22. """ + def __copy__(self) -> CellInstArray: + r""" + @brief Creates a copy of self + """ def __eq__(self, other: object) -> bool: r""" @brief Compares two arrays for equality """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given cell instance. This method enables cell instances as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -3183,6 +3305,11 @@ class CellInstArray: Starting with version 0.25 the displacements are of vector type. """ + def __len__(self) -> int: + r""" + @brief Gets the number of single instances in the array + If the instance represents a single instance, the count is 1. Otherwise it is na*nb. Starting with version 0.27, there may be iterated instances for which the size is larger than 1, but \is_regular_array? will return false. In this case, use \each_trans or \each_cplx_trans to retrieve the individual placements of the iterated instance. + """ def __lt__(self, other: CellInstArray) -> bool: r""" @brief Compares two arrays for 'less' @@ -3192,6 +3319,12 @@ class CellInstArray: r""" @brief Compares two arrays for inequality """ + def __repr__(self) -> str: + r""" + @brief Converts the array to a string + + This method was introduced in version 0.22. + """ def __str__(self) -> str: r""" @brief Converts the array to a string @@ -3253,7 +3386,7 @@ class CellInstArray: r""" @brief Creates a copy of self """ - def each_cplx_trans(self) -> Iterable[ICplxTrans]: + def each_cplx_trans(self) -> Iterator[ICplxTrans]: r""" @brief Gets the complex transformations represented by this instance For a single instance, this iterator will deliver the single, complex transformation. For array instances, the iterator will deliver each complex transformation of the expanded array. @@ -3261,7 +3394,7 @@ class CellInstArray: This method has been introduced in version 0.25. """ - def each_trans(self) -> Iterable[Trans]: + def each_trans(self) -> Iterator[Trans]: r""" @brief Gets the simple transformations represented by this instance For a single instance, this iterator will deliver the single, simple transformation. For array instances, the iterator will deliver each simple transformation of the expanded array. @@ -3387,10 +3520,21 @@ class DCellInstArray: @brief Gets the transformation of the first instance in the array The transformation returned is only valid if the array does not represent a complex transformation array@brief Sets the transformation of the instance or the first instance in the array """ + def __copy__(self) -> DCellInstArray: + r""" + @brief Creates a copy of self + """ def __eq__(self, other: object) -> bool: r""" @brief Compares two arrays for equality """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given cell instance. This method enables cell instances as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -3432,6 +3576,11 @@ class DCellInstArray: @param na The number of placements in the 'a' axis @param nb The number of placements in the 'b' axis """ + def __len__(self) -> int: + r""" + @brief Gets the number of single instances in the array + If the instance represents a single instance, the count is 1. Otherwise it is na*nb. Starting with version 0.27, there may be iterated instances for which the size is larger than 1, but \is_regular_array? will return false. In this case, use \each_trans or \each_cplx_trans to retrieve the individual placements of the iterated instance. + """ def __lt__(self, other: DCellInstArray) -> bool: r""" @brief Compares two arrays for 'less' @@ -3441,6 +3590,10 @@ class DCellInstArray: r""" @brief Compares two arrays for inequality """ + def __repr__(self) -> str: + r""" + @brief Converts the array to a string + """ def __str__(self) -> str: r""" @brief Converts the array to a string @@ -3500,13 +3653,13 @@ class DCellInstArray: r""" @brief Creates a copy of self """ - def each_cplx_trans(self) -> Iterable[DCplxTrans]: + def each_cplx_trans(self) -> Iterator[DCplxTrans]: r""" @brief Gets the complex transformations represented by this instance For a single instance, this iterator will deliver the single, complex transformation. For array instances, the iterator will deliver each complex transformation of the expanded array. This iterator is a generalization of \each_trans for general complex transformations. """ - def each_trans(self) -> Iterable[DTrans]: + def each_trans(self) -> Iterator[DTrans]: r""" @brief Gets the simple transformations represented by this instance For a single instance, this iterator will deliver the single, simple transformation. For array instances, the iterator will deliver each simple transformation of the expanded array. @@ -3618,6 +3771,10 @@ class CellMapping: This constant has been introduced in version 0.25. """ + def __copy__(self) -> CellMapping: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -3683,7 +3840,7 @@ class CellMapping: r""" @brief Creates a copy of self """ - def for_multi_cells(self, layout_a: Layout, cell_indexes_a: Iterable[int], layout_b: Layout, cell_indexes_b: Iterable[int]) -> None: + def for_multi_cells(self, layout_a: Layout, cell_indexes_a: Sequence[int], layout_b: Layout, cell_indexes_b: Sequence[int]) -> None: r""" @brief Initializes the cell mapping for top-level identity @@ -3698,7 +3855,7 @@ class CellMapping: This method has been introduced in version 0.27. """ - def for_multi_cells_full(self, layout_a: Layout, cell_indexes_a: Iterable[int], layout_b: Layout, cell_indexes_b: Iterable[int]) -> Iterable[int]: + def for_multi_cells_full(self, layout_a: Layout, cell_indexes_a: Sequence[int], layout_b: Layout, cell_indexes_b: Sequence[int]) -> List[int]: r""" @brief Initializes the cell mapping for top-level identity @@ -3726,7 +3883,7 @@ class CellMapping: This method has been introduced in version 0.23. """ - def for_single_cell_full(self, layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> Iterable[int]: + def for_single_cell_full(self, layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> List[int]: r""" @brief Initializes the cell mapping for top-level identity @@ -3753,7 +3910,7 @@ class CellMapping: This method has been introduced in version 0.23. """ - def from_geometry_full(self, layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> Iterable[int]: + def from_geometry_full(self, layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> List[int]: r""" @brief Initializes the cell mapping using the geometrical identity in full mapping mode @@ -3784,7 +3941,7 @@ class CellMapping: This method has been introduced in version 0.23. """ - def from_names_full(self, layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> Iterable[int]: + def from_names_full(self, layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> List[int]: r""" @brief Initializes the cell mapping using the name identity in full mapping mode @@ -3883,6 +4040,10 @@ class CompoundRegionOperationNode: r""" @brief Compares two enums for inequality """ + def __repr__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ def __str__(self) -> str: r""" @brief Gets the symbolic string from an enum @@ -3943,6 +4104,10 @@ class CompoundRegionOperationNode: r""" @brief Compares two enums for inequality """ + def __repr__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ def __str__(self) -> str: r""" @brief Gets the symbolic string from an enum @@ -3999,6 +4164,10 @@ class CompoundRegionOperationNode: r""" @brief Compares two enums for inequality """ + def __repr__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ def __str__(self) -> str: r""" @brief Gets the symbolic string from an enum @@ -4063,6 +4232,10 @@ class CompoundRegionOperationNode: r""" @brief Compares two enums for inequality """ + def __repr__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ def __str__(self) -> str: r""" @brief Gets the symbolic string from an enum @@ -4119,6 +4292,10 @@ class CompoundRegionOperationNode: r""" @brief Compares two enums for inequality """ + def __repr__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ def __str__(self) -> str: r""" @brief Gets the symbolic string from an enum @@ -4162,7 +4339,7 @@ class CompoundRegionOperationNode: This node renders the input if the specified bounding box parameter of the input shape is between pmin and pmax (exclusively). If 'inverse' is set to true, the input shape is returned if the parameter is less than pmin (exclusively) or larger than pmax (inclusively). """ @classmethod - def new_case(cls, inputs: Iterable[CompoundRegionOperationNode]) -> CompoundRegionOperationNode: + def new_case(cls, inputs: Sequence[CompoundRegionOperationNode]) -> CompoundRegionOperationNode: r""" @brief Creates a 'switch ladder' (case statement) compound operation node. @@ -4321,12 +4498,12 @@ class CompoundRegionOperationNode: @brief Creates a node providing a isolated polygons (space between different polygons) check. """ @classmethod - def new_join(cls, inputs: Iterable[CompoundRegionOperationNode]) -> CompoundRegionOperationNode: + def new_join(cls, inputs: Sequence[CompoundRegionOperationNode]) -> CompoundRegionOperationNode: r""" @brief Creates a node that joins the inputs. """ @classmethod - def new_logical_boolean(cls, op: CompoundRegionOperationNode.LogicalOp, invert: bool, inputs: Iterable[CompoundRegionOperationNode]) -> CompoundRegionOperationNode: + def new_logical_boolean(cls, op: CompoundRegionOperationNode.LogicalOp, invert: bool, inputs: Sequence[CompoundRegionOperationNode]) -> CompoundRegionOperationNode: r""" @brief Creates a node representing a logical boolean operation between the inputs. @@ -4351,16 +4528,16 @@ class CompoundRegionOperationNode: """ @overload @classmethod - def new_minkowski_sum(cls, input: CompoundRegionOperationNode, p: Iterable[Point]) -> CompoundRegionOperationNode: - r""" - @brief Creates a node providing a Minkowski sum with a point sequence forming a contour. - """ - @overload - @classmethod def new_minkowski_sum(cls, input: CompoundRegionOperationNode, p: Polygon) -> CompoundRegionOperationNode: r""" @brief Creates a node providing a Minkowski sum with a polygon. """ + @overload + @classmethod + def new_minkowski_sum(cls, input: CompoundRegionOperationNode, p: Sequence[Point]) -> CompoundRegionOperationNode: + r""" + @brief Creates a node providing a Minkowski sum with a point sequence forming a contour. + """ @classmethod def new_notch_check(cls, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: r""" @@ -4554,6 +4731,10 @@ class TrapezoidDecompositionMode: r""" @brief Indicates vertical trapezoid decomposition. """ + def __copy__(self) -> TrapezoidDecompositionMode: + r""" + @brief Creates a copy of self + """ def __eq__(self, other: object) -> bool: r""" @brief Compares two enums @@ -4576,6 +4757,10 @@ class TrapezoidDecompositionMode: r""" @brief Compares two enums for inequality """ + def __repr__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ def __str__(self) -> str: r""" @brief Gets the symbolic string from an enum @@ -4664,6 +4849,10 @@ class PreferredOrientation: r""" @brief Indicates vertical trapezoid decomposition. """ + def __copy__(self) -> PreferredOrientation: + r""" + @brief Creates a copy of self + """ def __eq__(self, other: object) -> bool: r""" @brief Compares two enums @@ -4686,6 +4875,10 @@ class PreferredOrientation: r""" @brief Compares two enums for inequality """ + def __repr__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ def __str__(self) -> str: r""" @brief Gets the symbolic string from an enum @@ -4765,10 +4958,6 @@ class DeepShapeStore: This class has been introduced in version 0.26. """ - instance_count: ClassVar[int] - r""" - @hide - """ max_area_ratio: float r""" @brief Gets the max. area ratio. @@ -4821,6 +5010,11 @@ class DeepShapeStore: @brief Gets the number of threads. @brief Sets the number of threads to allocate for the hierarchical processor """ + @classmethod + def instance_count(cls) -> int: + r""" + @hide + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -4862,7 +5056,7 @@ class DeepShapeStore: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def add_breakout_cell(self, layout_index: int, cell_index: Iterable[int]) -> None: + def add_breakout_cell(self, layout_index: int, cell_index: Sequence[int]) -> None: r""" @brief Adds a cell indexe to the breakout cell list for the given layout inside the store See \clear_breakout_cells for an explanation of breakout cells. @@ -4878,7 +5072,7 @@ class DeepShapeStore: This method has been added in version 0.26.1 """ @overload - def add_breakout_cells(self, layout_index: int, cells: Iterable[int]) -> None: + def add_breakout_cells(self, layout_index: int, cells: Sequence[int]) -> None: r""" @brief Adds cell indexes to the breakout cell list for the given layout inside the store See \clear_breakout_cells for an explanation of breakout cells. @@ -4940,7 +5134,7 @@ class DeepShapeStore: This method has been added in version 0.26.1 """ @overload - def set_breakout_cells(self, layout_index: int, cells: Iterable[int]) -> None: + def set_breakout_cells(self, layout_index: int, cells: Sequence[int]) -> None: r""" @brief Sets the breakout cell list (as cell indexes) for the given layout inside the store See \clear_breakout_cells for an explanation of breakout cells. @@ -5009,11 +5203,22 @@ class Edge: This method has been added in version 0.23. """ + def __copy__(self) -> Edge: + r""" + @brief Creates a copy of self + """ def __eq__(self, e: object) -> bool: r""" @brief Equality test @param e The object to compare against """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given edge. This method enables edges as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -5063,6 +5268,22 @@ class Edge: @brief Inequality test @param e The object to compare against """ + def __repr__(self) -> str: + r""" + @brief Returns a string representing the edge + """ + def __rmul__(self, scale_factor: float) -> Edge: + r""" + @brief Scale edge + + The * operator scales self with the given factor. + + This method has been introduced in version 0.22. + + @param scale_factor The scaling factor + + @return The scaled edge + """ def __str__(self) -> str: r""" @brief Returns a string representing the edge @@ -5583,11 +5804,22 @@ class DEdge: This method has been added in version 0.23. """ + def __copy__(self) -> DEdge: + r""" + @brief Creates a copy of self + """ def __eq__(self, e: object) -> bool: r""" @brief Equality test @param e The object to compare against """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given edge. This method enables edges as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -5637,6 +5869,22 @@ class DEdge: @brief Inequality test @param e The object to compare against """ + def __repr__(self) -> str: + r""" + @brief Returns a string representing the edge + """ + def __rmul__(self, scale_factor: float) -> DEdge: + r""" + @brief Scale edge + + The * operator scales self with the given factor. + + This method has been introduced in version 0.22. + + @param scale_factor The scaling factor + + @return The scaled edge + """ def __str__(self) -> str: r""" @brief Returns a string representing the edge @@ -6137,11 +6385,22 @@ class EdgePair: This method has been added in version 0.23. """ + def __copy__(self) -> EdgePair: + r""" + @brief Creates a copy of self + """ def __eq__(self, box: object) -> bool: r""" @brief Equality Returns true, if this edge pair and the given one are equal + This method has been introduced in version 0.25. + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given edge pair. This method enables edge pairs as hash keys. + This method has been introduced in version 0.25. """ @overload @@ -6180,6 +6439,10 @@ class EdgePair: This method has been introduced in version 0.25. """ + def __repr__(self) -> str: + r""" + @brief Returns a string representing the edge pair + """ def __str__(self) -> str: r""" @brief Returns a string representing the edge pair @@ -6367,11 +6630,22 @@ class DEdgePair: This method has been added in version 0.23. """ + def __copy__(self) -> DEdgePair: + r""" + @brief Creates a copy of self + """ def __eq__(self, box: object) -> bool: r""" @brief Equality Returns true, if this edge pair and the given one are equal + This method has been introduced in version 0.25. + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given edge pair. This method enables edge pairs as hash keys. + This method has been introduced in version 0.25. """ @overload @@ -6410,6 +6684,10 @@ class DEdgePair: This method has been introduced in version 0.25. """ + def __repr__(self) -> str: + r""" + @brief Returns a string representing the edge pair + """ def __str__(self) -> str: r""" @brief Returns a string representing the edge pair @@ -6576,6 +6854,10 @@ class EdgePairs(ShapeCollection): This method has been introduced in version 0.24. """ + def __copy__(self) -> EdgePairs: + r""" + @brief Creates a copy of self + """ def __getitem__(self, n: int) -> EdgePair: r""" @brief Returns the nth edge pair @@ -6602,7 +6884,7 @@ class EdgePairs(ShapeCollection): This constructor creates an empty edge pair collection. """ @overload - def __init__(self, array: Iterable[EdgePair]) -> None: + def __init__(self, array: Sequence[EdgePair]) -> None: r""" @brief Constructor from an edge pair array @@ -6709,17 +6991,19 @@ class EdgePairs(ShapeCollection): This constructor has been introduced in version 0.26. """ - @overload - def __str__(self) -> str: + def __iter__(self) -> Iterator[EdgePair]: + r""" + @brief Returns each edge pair of the edge pair collection + """ + def __repr__(self) -> str: r""" @brief Converts the edge pair collection to a string The length of the output is limited to 20 edge pairs to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. """ - @overload - def __str__(self, max_count: int) -> str: + def __str__(self) -> str: r""" @brief Converts the edge pair collection to a string - This version allows specification of the maximum number of edge pairs contained in the string. + The length of the output is limited to 20 edge pairs to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. """ def _create(self) -> None: r""" @@ -6794,7 +7078,7 @@ class EdgePairs(ShapeCollection): r""" @brief Creates a copy of self """ - def each(self) -> Iterable[EdgePair]: + def each(self) -> Iterator[EdgePair]: r""" @brief Returns each edge pair of the edge pair collection """ @@ -7276,6 +7560,10 @@ class EdgeProcessor: r""" @brief boolean method's mode value for XOR operation """ + def __copy__(self) -> EdgeProcessor: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -7321,7 +7609,7 @@ class EdgeProcessor: r""" @brief Assigns another object to self """ - def boolean_e2e(self, a: Iterable[Edge], b: Iterable[Edge], mode: int) -> Iterable[Edge]: + def boolean_e2e(self, a: Sequence[Edge], b: Sequence[Edge], mode: int) -> List[Edge]: r""" @brief Boolean operation for a set of given edges, creating edges @@ -7339,7 +7627,7 @@ class EdgeProcessor: @param mode The boolean mode (one of the Mode.. values) @return The output edges """ - def boolean_e2p(self, a: Iterable[Edge], b: Iterable[Edge], mode: int, resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def boolean_e2p(self, a: Sequence[Edge], b: Sequence[Edge], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Boolean operation for a set of given edges, creating polygons @@ -7358,7 +7646,7 @@ class EdgeProcessor: @param min_coherence true, if touching corners should be resolved into less connected contours @return The output polygons """ - def boolean_p2e(self, a: Iterable[Polygon], b: Iterable[Polygon], mode: int) -> Iterable[Edge]: + def boolean_p2e(self, a: Sequence[Polygon], b: Sequence[Polygon], mode: int) -> List[Edge]: r""" @brief Boolean operation for a set of given polygons, creating edges @@ -7376,7 +7664,7 @@ class EdgeProcessor: @param mode The boolean mode @return The output edges """ - def boolean_p2p(self, a: Iterable[Polygon], b: Iterable[Polygon], mode: int, resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def boolean_p2p(self, a: Sequence[Polygon], b: Sequence[Polygon], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Boolean operation for a set of given polygons, creating polygons @@ -7415,7 +7703,7 @@ class EdgeProcessor: This method has been introduced in version 0.23. """ - def merge_p2e(self, in_: Iterable[Polygon], min_wc: int) -> Iterable[Edge]: + def merge_p2e(self, in_: Sequence[Polygon], min_wc: int) -> List[Edge]: r""" @brief Merge the given polygons @@ -7434,7 +7722,7 @@ class EdgeProcessor: @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) @return The output edges """ - def merge_p2p(self, in_: Iterable[Polygon], min_wc: int, resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def merge_p2p(self, in_: Sequence[Polygon], min_wc: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Merge the given polygons @@ -7455,7 +7743,7 @@ class EdgeProcessor: @return The output polygons """ @overload - def simple_merge_e2e(self, in_: Iterable[Edge]) -> Iterable[Edge]: + def simple_merge_e2e(self, in_: Sequence[Edge]) -> List[Edge]: r""" @brief Merge the given edges in a simple "non-zero wrapcount" fashion @@ -7474,7 +7762,7 @@ class EdgeProcessor: @return The output edges """ @overload - def simple_merge_e2e(self, in_: Iterable[Edge], mode: int) -> Iterable[Edge]: + def simple_merge_e2e(self, in_: Sequence[Edge], mode: int) -> List[Edge]: r""" @brief Merge the given polygons and specify the merge mode @@ -7496,7 +7784,7 @@ class EdgeProcessor: @return The output edges """ @overload - def simple_merge_e2p(self, in_: Iterable[Edge], resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def simple_merge_e2p(self, in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Merge the given edges in a simple "non-zero wrapcount" fashion into polygons @@ -7516,7 +7804,7 @@ class EdgeProcessor: @return The output polygons """ @overload - def simple_merge_e2p(self, in_: Iterable[Edge], resolve_holes: bool, min_coherence: bool, mode: int) -> Iterable[Polygon]: + def simple_merge_e2p(self, in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]: r""" @brief Merge the given polygons and specify the merge mode @@ -7539,7 +7827,7 @@ class EdgeProcessor: @return The output polygons """ @overload - def simple_merge_p2e(self, in_: Iterable[Polygon]) -> Iterable[Edge]: + def simple_merge_p2e(self, in_: Sequence[Polygon]) -> List[Edge]: r""" @brief Merge the given polygons in a simple "non-zero wrapcount" fashion @@ -7560,7 +7848,7 @@ class EdgeProcessor: @return The output edges """ @overload - def simple_merge_p2e(self, in_: Iterable[Polygon], mode: int) -> Iterable[Edge]: + def simple_merge_p2e(self, in_: Sequence[Polygon], mode: int) -> List[Edge]: r""" @brief Merge the given polygons and specify the merge mode @@ -7584,7 +7872,7 @@ class EdgeProcessor: @return The output edges """ @overload - def simple_merge_p2p(self, in_: Iterable[Polygon], resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def simple_merge_p2p(self, in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Merge the given polygons in a simple "non-zero wrapcount" fashion into polygons @@ -7606,7 +7894,7 @@ class EdgeProcessor: @return The output polygons """ @overload - def simple_merge_p2p(self, in_: Iterable[Polygon], resolve_holes: bool, min_coherence: bool, mode: int) -> Iterable[Polygon]: + def simple_merge_p2p(self, in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]: r""" @brief Merge the given polygons and specify the merge mode @@ -7631,7 +7919,7 @@ class EdgeProcessor: @return The output polygons """ @overload - def size_p2e(self, in_: Iterable[Polygon], d: int, mode: int) -> Iterable[Edge]: + def size_p2e(self, in_: Sequence[Polygon], d: int, mode: int) -> List[Edge]: r""" @brief Size the given polygons (isotropic) @@ -7645,7 +7933,7 @@ class EdgeProcessor: @return The output edges """ @overload - def size_p2e(self, in_: Iterable[Polygon], dx: int, dy: int, mode: int) -> Iterable[Edge]: + def size_p2e(self, in_: Sequence[Polygon], dx: int, dy: int, mode: int) -> List[Edge]: r""" @brief Size the given polygons @@ -7669,7 +7957,7 @@ class EdgeProcessor: @return The output edges """ @overload - def size_p2p(self, in_: Iterable[Polygon], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def size_p2p(self, in_: Sequence[Polygon], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Size the given polygons into polygons (isotropic) @@ -7685,7 +7973,7 @@ class EdgeProcessor: @return The output polygons """ @overload - def size_p2p(self, in_: Iterable[Polygon], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def size_p2p(self, in_: Sequence[Polygon], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Size the given polygons into polygons @@ -7796,6 +8084,10 @@ class Edges(ShapeCollection): This method has been introduced in version 0.24. """ + def __copy__(self) -> Edges: + r""" + @brief Creates a copy of self + """ def __getitem__(self, n: int) -> Edge: r""" @brief Returns the nth edge of the collection @@ -7844,14 +8136,14 @@ class Edges(ShapeCollection): This constructor creates an empty edge collection. """ @overload - def __init__(self, array: Iterable[Edge]) -> None: + def __init__(self, array: Sequence[Edge]) -> None: r""" @brief Constructor from an edge array This constructor creates an edge collection from an array of edges. """ @overload - def __init__(self, array: Iterable[Polygon]) -> None: + def __init__(self, array: Sequence[Polygon]) -> None: r""" @brief Constructor from a polygon array @@ -8058,6 +8350,10 @@ class Edges(ShapeCollection): This method has been introduced in version 0.24. """ + def __iter__(self) -> Iterator[Edge]: + r""" + @brief Returns each edge of the region + """ def __ixor__(self, other: Edges) -> Edges: r""" @brief Performs the boolean XOR between self and the other edge collection @@ -8075,17 +8371,15 @@ class Edges(ShapeCollection): The boolean OR is implemented by merging the edges of both edge sets. To simply join the edge collections without merging, the + operator is more efficient. """ - @overload - def __str__(self) -> str: + def __repr__(self) -> str: r""" @brief Converts the edge collection to a string The length of the output is limited to 20 edges to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. """ - @overload - def __str__(self, max_count: int) -> str: + def __str__(self) -> str: r""" @brief Converts the edge collection to a string - This version allows specification of the maximum number of edges contained in the string. + The length of the output is limited to 20 edges to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. """ @overload def __sub__(self, other: Edges) -> Edges: @@ -8209,11 +8503,11 @@ class Edges(ShapeCollection): r""" @brief Creates a copy of self """ - def each(self) -> Iterable[Edge]: + def each(self) -> Iterator[Edge]: r""" @brief Returns each edge of the region """ - def each_merged(self) -> Iterable[Edge]: + def each_merged(self) -> Iterator[Edge]: r""" @brief Returns each edge of the region @@ -8228,6 +8522,30 @@ class Edges(ShapeCollection): The label is a text which is put in front of the progress bar. Using a progress bar will imply a performance penalty of a few percent typically. """ + def enclosed_check(self, other: Edges, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: + r""" + Note: This is an alias of 'inside_check'. + @brief Performs an inside check with options + @param d The minimum distance for which the edges are checked + @param other The other edge collection against which to check + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The threshold angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper threshold of the projected length of one edge onto another + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. + + The 'enclosed_check' alias was introduced in version 0.27.5. + """ def enclosing_check(self, other: Edges, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: r""" @brief Performs an enclosing check with options @@ -8365,7 +8683,7 @@ class Edges(ShapeCollection): This method has been introduced in version 0.25. """ @overload - def insert(self, edges: Iterable[Edge]) -> None: + def insert(self, edges: Sequence[Edge]) -> None: r""" @brief Inserts all edges from the array into this edge collection """ @@ -8391,7 +8709,7 @@ class Edges(ShapeCollection): Inserts the edges that form the contour of the simple polygon into the edge collection. """ @overload - def insert(self, polygons: Iterable[Polygon]) -> None: + def insert(self, polygons: Sequence[Polygon]) -> None: r""" @brief Inserts all polygons from the array into this edge collection """ @@ -9052,23 +9370,30 @@ class TextGenerator: This class has been introduced in version 0.25. """ - default_generator: ClassVar[TextGenerator] - r""" - @brief Gets the default text generator (a standard font) - This method delivers the default generator or nil if no such generator is installed. - """ - font_paths: ClassVar[Iterable[str]] - r""" - @brief Gets the paths where to look for font files - See \set_font_paths for a description of this function. + @classmethod + def default_generator(cls) -> TextGenerator: + r""" + @brief Gets the default text generator (a standard font) + This method delivers the default generator or nil if no such generator is installed. + """ + @classmethod + def font_paths(cls) -> List[str]: + r""" + @brief Gets the paths where to look for font files + See \set_font_paths for a description of this function. - This method has been introduced in version 0.27.4. - """ - generators: ClassVar[Iterable[TextGenerator]] - r""" - @brief Gets the generators registered in the system - This method delivers a list of generator objects that can be used to create texts. - """ + This method has been introduced in version 0.27.4. + """ + @classmethod + def generators(cls) -> List[TextGenerator]: + r""" + @brief Gets the generators registered in the system + This method delivers a list of generator objects that can be used to create texts. + """ + def __copy__(self) -> TextGenerator: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -9193,7 +9518,7 @@ class TextGenerator: @brief Gets the name of the generator The generator's name is the basic key by which the generator is identified. """ - def set_font_paths(self, arg0: Iterable[str]) -> None: + def set_font_paths(self, arg0: Sequence[str]) -> None: r""" @brief Sets the paths where to look for font files This function sets the paths where to look for font files. After setting such a path, each font found will render a specific generator. The generator can be found under the font file's name. As the text generator is also the basis for the Basic.TEXT PCell, using this function also allows configuring custom fonts for this library cell. @@ -9232,6 +9557,10 @@ class Connectivity: The connectivity object also manages the global nets. Global nets are substrate for example and they are propagated automatically from subcircuits to circuits. Global nets are defined by name and are managed through IDs. To get the name for a given ID, use \global_net_name. This class has been introduced in version 0.26. """ + def __copy__(self) -> Connectivity: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -9311,6 +9640,10 @@ class InstElement: This objects are used to reference a single instance in a instantiation path. The object is composed of a \CellInstArray object (accessible through the \cell_inst accessor) that describes the basic instance, which may be an array. The particular instance within the array can be further retrieved using the \array_member_trans, \specific_trans or \specific_cplx_trans methods. """ + def __copy__(self) -> InstElement: + r""" + @brief Creates a copy of self + """ def __eq__(self, b: object) -> bool: r""" @brief Equality of two InstElement objects @@ -9473,6 +9806,10 @@ class LayerMapping: This class has been introduced in version 0.23. """ + def __copy__(self) -> LayerMapping: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -9532,7 +9869,7 @@ class LayerMapping: The layer mapping is created by looking up each layer of layout_b in layout_a. All layers with matching specifications (\LayerInfo) are mapped. Layouts without a layer/datatype/name specification will not be mapped. \create_full is a version of this method which creates new layers in layout_a if no corresponding layer is found. """ - def create_full(self, layout_a: Layout, layout_b: Layout) -> Iterable[int]: + def create_full(self, layout_a: Layout, layout_b: Layout) -> List[int]: r""" @brief Initialize the layer mapping from two layouts @@ -9609,6 +9946,10 @@ class LayerInfo: @brief Set the layer name The name is set on OASIS input for example, if the layer has a name. """ + def __copy__(self) -> LayerInfo: + r""" + @brief Creates a copy of self + """ def __eq__(self, b: object) -> bool: r""" @brief Compares two layer info objects @@ -9616,6 +9957,13 @@ class LayerInfo: This method was added in version 0.18. """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given layer info object. This method enables layer info objects as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -9661,16 +10009,6 @@ class LayerInfo: This method was added in version 0.18. """ - def __str__(self, as_target: Optional[bool] = ...) -> str: - r""" - @brief Convert the layer info object to a string - @return The string - - If 'as_target' is true, wildcard and relative specifications are formatted such such. - - This method was added in version 0.18. - The 'as_target' argument has been added in version 0.26.5. - """ def _create(self) -> None: r""" @brief Ensures the C++ object is created @@ -9796,6 +10134,10 @@ class LayoutMetaInfo: @brief Gets the value of the layout meta info object @brief Sets the value of the layout meta info object """ + def __copy__(self) -> LayoutMetaInfo: + r""" + @brief Creates a copy of self + """ def __init__(self, name: str, value: str, description: Optional[str] = ...) -> None: r""" @brief Creates a layout meta info object @@ -9907,6 +10249,10 @@ class Layout: This method has been introduced in version 0.27. """ + def __copy__(self) -> Layout: + r""" + @brief Creates a copy of self + """ @overload def __init__(self) -> None: r""" @@ -9978,13 +10324,6 @@ class Layout: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def add_cell(self, name: str) -> int: - r""" - @brief Adds a cell with the given name - @return The index of the newly created cell. - - From version 0.23 on this method is deprecated because another method exists which is more convenient because is returns a \Cell object (\create_cell). - """ def add_lib_cell(self, library: Library, lib_cell_index: int) -> int: r""" @brief Imports a cell from the library @@ -10005,7 +10344,7 @@ class Layout: This method has been introduced in version 0.25. """ @overload - def add_pcell_variant(self, pcell_id: int, parameters: Iterable[Any]) -> int: + def add_pcell_variant(self, pcell_id: int, parameters: Sequence[Any]) -> int: r""" @brief Creates a PCell variant for the given PCell ID with the given parameters @return The cell index of the pcell variant proxy cell @@ -10022,7 +10361,7 @@ class Layout: This method has been introduced in version 0.22. """ @overload - def add_pcell_variant(self, library: Library, pcell_id: int, parameters: Iterable[Any]) -> int: + def add_pcell_variant(self, library: Library, pcell_id: int, parameters: Sequence[Any]) -> int: r""" @brief Creates a PCell variant for a PCell located in an external library @return The cell index of the new proxy cell in this layout @@ -10082,7 +10421,6 @@ class Layout: r""" @brief Assigns another object to self """ - @overload def begin_shapes(self, cell: Cell, layer: int) -> RecursiveShapeIterator: r""" @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer @@ -10098,152 +10436,6 @@ class Layout: This method has been added in version 0.24. """ @overload - def begin_shapes(self, cell_index: int, layer: int) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer - @param cell_index The index of the initial (top) cell - @param layer The layer from which to get the shapes - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - - This method is deprecated. Use \Cell#begin_shapes_rec instead. - - This method has been added in version 0.18. - """ - @overload - def begin_shapes_overlapping(self, cell: Cell, layer: int, region: DBox) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units - @param cell The cell object for the starting cell - @param layer The layer from which to get the shapes - @param region The search region as a \DBox object in micrometer units - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box overlaps the given region. - It is convenience overload which takes a cell object instead of a cell index. - - This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. - - This variant has been added in version 0.25. - """ - @overload - def begin_shapes_overlapping(self, cell_index: int, layer: int, region: Box) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search - @param cell_index The index of the starting cell - @param layer The layer from which to get the shapes - @param region The search region - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box overlaps the given region. - - This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. - - This method has been added in version 0.18. - """ - @overload - def begin_shapes_overlapping(self, cell_index: int, layer: int, region: DBox) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units - @param cell_index The index of the starting cell - @param layer The layer from which to get the shapes - @param region The search region as a \DBox object in micrometer units - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box overlaps the given region. - - This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. - - This variant has been added in version 0.25. - """ - @overload - def begin_shapes_overlapping(self, cell_index: Cell, layer: int, region: Box) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search - @param cell The cell object for the starting cell - @param layer The layer from which to get the shapes - @param region The search region - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box overlaps the given region. - It is convenience overload which takes a cell object instead of a cell index. - - This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. - - This method has been added in version 0.24. - """ - @overload - def begin_shapes_touching(self, cell: Cell, layer: int, region: Box) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search - @param cell The cell object for the starting cell - @param layer The layer from which to get the shapes - @param region The search region - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box touches the given region. - It is convenience overload which takes a cell object instead of a cell index. - - This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. - - This method has been added in version 0.24. - """ - @overload - def begin_shapes_touching(self, cell: Cell, layer: int, region: DBox) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units - @param cell The cell object for the starting cell - @param layer The layer from which to get the shapes - @param region The search region as a \DBox object in micrometer units - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box touches the given region. - It is convenience overload which takes a cell object instead of a cell index. - - This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. - - This variant has been added in version 0.25. - """ - @overload - def begin_shapes_touching(self, cell_index: int, layer: int, region: Box) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search - @param cell_index The index of the starting cell - @param layer The layer from which to get the shapes - @param region The search region - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box touches the given region. - - This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. - - This method has been added in version 0.18. - """ - @overload - def begin_shapes_touching(self, cell_index: int, layer: int, region: DBox) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units - @param cell_index The index of the starting cell - @param layer The layer from which to get the shapes - @param region The search region as a \DBox object in micrometer units - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box touches the given region. - - This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. - - This variant has been added in version 0.25. - """ - @overload def cell(self, i: int) -> Cell: r""" @brief Gets a cell object from the cell index @@ -10264,12 +10456,6 @@ class Layout: If name is not a valid cell name, this method will return "nil". This method has been introduced in version 0.23 and replaces \cell_by_name. """ - def cell_by_name(self, name: str) -> int: - r""" - @brief Gets the cell index for a given name - Returns the cell index for the cell with the given name. If no cell with this name exists, an exception is thrown. - From version 0.23 on, a version of the \cell method is provided which returns a \Cell object for the cell with the given name or "nil" if the name is not valid. This method replaces \cell_by_name and \has_cell? - """ def cell_name(self, index: int) -> str: r""" @brief Gets the name for a cell with the given index @@ -10282,7 +10468,7 @@ class Layout: @return The number of cells (the maximum cell index) """ @overload - def cells(self, name_filter: str) -> Iterable[Cell]: + def cells(self, name_filter: str) -> List[Cell]: r""" @brief Gets the cell objects for a given name filter @@ -10291,7 +10477,7 @@ class Layout: This method has been introduced in version 0.27.3. """ - def cleanup(self, cell_indexes_to_keep: Optional[Iterable[int]] = ...) -> None: + def cleanup(self, cell_indexes_to_keep: Optional[Sequence[int]] = ...) -> None: r""" @brief Cleans up the layout This method will remove proxy objects that are no longer in use. After changing PCell parameters such proxy objects may still be present in the layout and are cached for later reuse. Usually they are cleaned up automatically, but in a scripting context it may be useful to clean up these cells explicitly. @@ -10461,7 +10647,7 @@ class Layout: This method has been introduced in version 0.20. """ - def delete_cells(self, cell_index_list: Iterable[int]) -> None: + def delete_cells(self, cell_index_list: Sequence[int]) -> None: r""" @brief Deletes multiple cells @@ -10499,11 +10685,11 @@ class Layout: r""" @brief Creates a copy of self """ - def each_cell(self) -> Iterable[Cell]: + def each_cell(self) -> Iterator[Cell]: r""" @brief Iterates the unsorted cell list """ - def each_cell_bottom_up(self) -> Iterable[int]: + def each_cell_bottom_up(self) -> Iterator[int]: r""" @brief Iterates the bottom-up sorted cell list @@ -10512,7 +10698,7 @@ class Layout: The bottom-up iterator does not deliver cells but cell indices actually. """ - def each_cell_top_down(self) -> Iterable[int]: + def each_cell_top_down(self) -> Iterator[int]: r""" @brief Iterates the top-down sorted cell list @@ -10523,14 +10709,14 @@ class Layout: indices actually. @brief begin iterator of the top-down sorted cell list """ - def each_meta_info(self) -> Iterable[LayoutMetaInfo]: + def each_meta_info(self) -> Iterator[LayoutMetaInfo]: r""" @brief Iterates over the meta information of the layout See \LayoutMetaInfo for details about layouts and meta information. This method has been introduced in version 0.25. """ - def each_top_cell(self) -> Iterable[int]: + def each_top_cell(self) -> Iterator[int]: r""" @brief Iterates the top cells A layout may have an arbitrary number of top cells. The usual case however is that there is one top cell. @@ -10769,14 +10955,14 @@ class Layout: This method has been introduced in version 0.23. """ - def layer_indexes(self) -> Iterable[int]: + def layer_indexes(self) -> List[int]: r""" @brief Gets a list of valid layer's indices This method returns an array with layer indices representing valid layers. This method has been introduced in version 0.19. """ - def layer_infos(self) -> Iterable[LayerInfo]: + def layer_infos(self) -> List[LayerInfo]: r""" @brief Gets a list of valid layer's properties The method returns an array with layer properties representing valid layers. @@ -10833,7 +11019,7 @@ class Layout: This method has been added in version 0.26.8. """ - def multi_clip(self, cell: int, boxes: Iterable[Box]) -> Iterable[int]: + def multi_clip(self, cell: int, boxes: Sequence[Box]) -> List[int]: r""" @brief Clips the given cell by the given rectangles and produce new cells with the clips, one for each rectangle. @param cell The cell index of the cell to clip @@ -10844,7 +11030,7 @@ class Layout: This method has been added in version 0.21. """ - def multi_clip_into(self, cell: int, target: Layout, boxes: Iterable[Box]) -> Iterable[int]: + def multi_clip_into(self, cell: int, target: Layout, boxes: Sequence[Box]) -> List[int]: r""" @brief Clips the given cell by the given rectangles and produce new cells with the clips, one for each rectangle. @param cell The cell index of the cell to clip @@ -10892,21 +11078,21 @@ class Layout: This method has been introduced in version 0.22. """ - def pcell_ids(self) -> Iterable[int]: + def pcell_ids(self) -> List[int]: r""" @brief Gets the IDs of the PCells registered in the layout Returns an array of PCell IDs. This method has been introduced in version 0.24. """ - def pcell_names(self) -> Iterable[str]: + def pcell_names(self) -> List[str]: r""" @brief Gets the names of the PCells registered in the layout Returns an array of PCell names. This method has been introduced in version 0.24. """ - def properties(self, properties_id: int) -> Iterable[Any]: + def properties(self, properties_id: int) -> List[Any]: r""" @brief Gets the properties set for a given properties ID @@ -10916,7 +11102,7 @@ class Layout: @param properties_id The properties ID to get the properties for @return The array of variants (see \properties_id) """ - def properties_id(self, properties: Iterable[Any]) -> int: + def properties_id(self, properties: Sequence[Any]) -> int: r""" @brief Gets the properties ID for a given properties set @@ -11080,7 +11266,7 @@ class Layout: This method has been introduced in version 0.23. """ - def top_cells(self) -> Iterable[Cell]: + def top_cells(self) -> List[Cell]: r""" @brief Returns the top cell objects @return The \Cell objects of the top cells @@ -11150,16 +11336,6 @@ class Layout: This variant has been introduced in version 0.23. """ - @overload - def write(self, filename: str, gzip: bool, options: SaveLayoutOptions) -> None: - r""" - @brief Writes the layout to a stream file - @param filename The file to which to write the layout - @param gzip Ignored - @param options The option set to use for writing. See \SaveLayoutOptions for details - - Starting with version 0.23, this variant is deprecated since the more convenient variant with two parameters automatically determines the compression mode from the file name. The gzip parameter is ignored staring with version 0.23. - """ class SaveLayoutOptions: r""" @@ -11514,6 +11690,10 @@ class SaveLayoutOptions: This method was introduced in version 0.23. """ + def __copy__(self) -> SaveLayoutOptions: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Default constructor @@ -12211,7 +12391,7 @@ class LayoutQuery: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def each(self, layout: Layout, context: Optional[tl.ExpressionContext] = ...) -> Iterable[LayoutQueryIterator]: + def each(self, layout: Layout, context: Optional[tl.ExpressionContext] = ...) -> Iterator[LayoutQueryIterator]: r""" @brief Executes the query and delivered the results iteratively. The argument to the block is a \LayoutQueryIterator object which can be asked for specific results. @@ -12229,7 +12409,7 @@ class LayoutQuery: The context argument allows supplying an expression execution context. This context can be used for example to supply variables for the execution. It has been added in version 0.26. """ - def property_names(self) -> Iterable[str]: + def property_names(self) -> List[str]: r""" @brief Gets a list of property names available. The list of properties available from the query depends on the nature of the query. This method allows detection of the properties available. Within the query, all of these properties can be obtained from the query iterator using \LayoutQueryIterator#get. @@ -12319,6 +12499,10 @@ class LayoutToNetlist: r""" @brief Compares two enums for inequality """ + def __repr__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ def __str__(self) -> str: r""" @brief Gets the symbolic string from an enum @@ -12482,7 +12666,7 @@ class LayoutToNetlist: Usually it's not required to call this method. It has been introduced in version 0.24. """ @overload - def antenna_check(self, gate: Region, metal: Region, ratio: float, diodes: Optional[Iterable[Any]] = ..., texts: Optional[Texts] = ...) -> Region: + def antenna_check(self, gate: Region, metal: Region, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: r""" @brief Runs an antenna check on the extracted clusters @@ -12524,7 +12708,7 @@ class LayoutToNetlist: The 'texts' parameter has been added in version 0.27.11. """ @overload - def antenna_check(self, gate: Region, gate_perimeter_factor: float, metal: Region, metal_perimeter_factor: float, ratio: float, diodes: Optional[Iterable[Any]] = ..., texts: Optional[Texts] = ...) -> Region: + def antenna_check(self, gate: Region, gate_perimeter_factor: float, metal: Region, metal_perimeter_factor: float, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: r""" @brief Runs an antenna check on the extracted clusters taking the perimeter into account @@ -12539,7 +12723,7 @@ class LayoutToNetlist: This variant has been introduced in version 0.26.6. """ @overload - def antenna_check(self, gate: Region, gate_area_factor: float, gate_perimeter_factor: float, metal: Region, metal_area_factor: float, metal_perimeter_factor: float, ratio: float, diodes: Optional[Iterable[Any]] = ..., texts: Optional[Texts] = ...) -> Region: + def antenna_check(self, gate: Region, gate_area_factor: float, gate_perimeter_factor: float, metal: Region, metal_area_factor: float, metal_perimeter_factor: float, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: r""" @brief Runs an antenna check on the extracted clusters taking the perimeter into account and providing an area factor @@ -12627,7 +12811,7 @@ class LayoutToNetlist: @param cell_name_prefix Chooses recursive mode if non-null @param device_cell_name_prefix See above """ - def build_nets(self, nets: Iterable[Net], cmap: CellMapping, target: Layout, lmap: Dict[int, Region], net_cell_name_prefix: Optional[Any] = ..., netname_prop: Optional[Any] = ..., hier_mode: Optional[LayoutToNetlist.BuildNetHierarchyMode] = ..., circuit_cell_name_prefix: Optional[Any] = ..., device_cell_name_prefix: Optional[Any] = ...) -> None: + def build_nets(self, nets: Sequence[Net], cmap: CellMapping, target: Layout, lmap: Dict[int, Region], net_cell_name_prefix: Optional[Any] = ..., netname_prop: Optional[Any] = ..., hier_mode: Optional[LayoutToNetlist.BuildNetHierarchyMode] = ..., circuit_cell_name_prefix: Optional[Any] = ..., device_cell_name_prefix: Optional[Any] = ...) -> None: r""" @brief Like \build_all_nets, but with the ability to select some nets. """ @@ -12641,7 +12825,7 @@ class LayoutToNetlist: CAUTION: this function may create new cells in 'layout'. Use \const_cell_mapping_into if you want to use the target layout's hierarchy and not modify it. """ @overload - def cell_mapping_into(self, layout: Layout, cell: Cell, nets: Iterable[Net], with_device_cells: Optional[bool] = ...) -> CellMapping: + def cell_mapping_into(self, layout: Layout, cell: Cell, nets: Sequence[Net], with_device_cells: Optional[bool] = ...) -> CellMapping: r""" @brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. This version will only create cells which are required to represent the nets from the 'nets' argument. @@ -12831,7 +13015,7 @@ class LayoutToNetlist: This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist. """ @overload - def join_nets(self, net_names: Iterable[str]) -> None: + def join_nets(self, net_names: Sequence[str]) -> None: r""" @brief Specifies another name list for explicit joining of nets for the top level cell. Use this method to join nets from the set of net names. All these nets will be connected together forming a single net. @@ -12842,7 +13026,7 @@ class LayoutToNetlist: Explicit net joining has been introduced in version 0.27. """ @overload - def join_nets(self, cell_pattern: str, net_names: Iterable[str]) -> None: + def join_nets(self, cell_pattern: str, net_names: Sequence[str]) -> None: r""" @brief Specifies another name list for explicit joining of nets for the cells from the given cell pattern. This method allows applying explicit net joining for specific cells, not only for the top cell. @@ -12875,7 +13059,7 @@ class LayoutToNetlist: r""" @brief Gets the name of the given layer """ - def layer_names(self) -> Iterable[str]: + def layer_names(self) -> List[str]: r""" @brief Returns a list of names of the layer kept inside the LayoutToNetlist object. """ @@ -12934,7 +13118,7 @@ class LayoutToNetlist: @brief gets the netlist extracted (0 if no extraction happened yet) """ @overload - def probe_net(self, of_layer: Region, point: DPoint, sc_path_out: Optional[Iterable[SubCircuit]] = ..., initial_circuit: Optional[Circuit] = ...) -> Net: + def probe_net(self, of_layer: Region, point: DPoint, sc_path_out: Optional[Sequence[SubCircuit]] = ..., initial_circuit: Optional[Circuit] = ...) -> Net: r""" @brief Finds the net by probing a specific location on the given layer @@ -12959,7 +13143,7 @@ class LayoutToNetlist: The \sc_path_out and \initial_circuit parameters have been added in version 0.27. """ @overload - def probe_net(self, of_layer: Region, point: Point, sc_path_out: Optional[Iterable[SubCircuit]] = ..., initial_circuit: Optional[Circuit] = ...) -> Net: + def probe_net(self, of_layer: Region, point: Point, sc_path_out: Optional[Sequence[SubCircuit]] = ..., initial_circuit: Optional[Circuit] = ...) -> Net: r""" @brief Finds the net by probing a specific location on the given layer See the description of the other \probe_net variant. @@ -12973,6 +13157,12 @@ class LayoutToNetlist: @brief Reads the extracted netlist from the file. This method employs the native format of KLayout. """ + def read_l2n(self, path: str) -> None: + r""" + Note: This is an alias of 'read'. + @brief Reads the extracted netlist from the file. + This method employs the native format of KLayout. + """ def register(self, l: ShapeCollection, n: str) -> None: r""" @brief Names the given layer @@ -13011,6 +13201,12 @@ class LayoutToNetlist: @brief Writes the extracted netlist to a file. This method employs the native format of KLayout. """ + def write_l2n(self, path: str, short_format: Optional[bool] = ...) -> None: + r""" + Note: This is an alias of 'write'. + @brief Writes the extracted netlist to a file. + This method employs the native format of KLayout. + """ class LayoutVsSchematic(LayoutToNetlist): r""" @@ -13158,27 +13354,27 @@ class Library: @brief Returns the libraries' description text @brief Sets the libraries' description text """ - library_ids: ClassVar[Iterable[int]] + technology: None r""" - @brief Returns a list of valid library IDs. - See \library_names for the reasoning behind this method. - This method has been introduced in version 0.27. - """ - library_names: ClassVar[Iterable[str]] - r""" - @brief Returns a list of the names of all libraries registered in the system. - - NOTE: starting with version 0.27, the name of a library does not need to be unique if libraries are associated with specific technologies. This method will only return the names and it's not possible not unambiguously derive the library object. It is recommended to use \library_ids and \library_by_id to obtain the library unambiguously. - """ - technology: str - r""" - @brief Returns name of the technology the library is associated with - If this attribute is a non-empty string, this library is only offered for selection if the current layout uses this technology. - - This attribute has been introduced in version 0.25. In version 0.27 this attribute is deprecated as a library can now be associated with multiple technologies.@brief sets the name of the technology the library is associated with + WARNING: This variable can only be set, not retrieved. + @brief sets the name of the technology the library is associated with See \technology for details. This attribute has been introduced in version 0.25. In version 0.27, a library can be associated with multiple technologies and this method will revert the selection to a single one. Passing an empty string is equivalent to \clear_technologies. """ + @classmethod + def library_ids(cls) -> List[int]: + r""" + @brief Returns a list of valid library IDs. + See \library_names for the reasoning behind this method. + This method has been introduced in version 0.27. + """ + @classmethod + def library_names(cls) -> List[str]: + r""" + @brief Returns a list of the names of all libraries registered in the system. + + NOTE: starting with version 0.27, the name of a library does not need to be unique if libraries are associated with specific technologies. This method will only return the names and it's not possible not unambiguously derive the library object. It is recommended to use \library_ids and \library_by_id to obtain the library unambiguously. + """ def __init__(self) -> None: r""" @brief Creates a new, empty library @@ -13308,7 +13504,7 @@ class Library: The technology specific behaviour has been introduced in version 0.27. """ - def technologies(self) -> Iterable[str]: + def technologies(self) -> List[str]: r""" @brief Gets the list of technologies this library is associated with. This method has been introduced in version 0.27 @@ -13363,16 +13559,16 @@ class PCellDeclaration_Native: def can_create_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> bool: r""" """ - def coerce_parameters(self, arg0: Layout, arg1: Iterable[Any]) -> Iterable[Any]: + def coerce_parameters(self, arg0: Layout, arg1: Sequence[Any]) -> List[Any]: r""" """ - def display_text(self, arg0: Iterable[Any]) -> str: + def display_text(self, arg0: Sequence[Any]) -> str: r""" """ - def get_layers(self, arg0: Iterable[Any]) -> Iterable[LayerInfo]: + def get_layers(self, arg0: Sequence[Any]) -> List[LayerInfo]: r""" """ - def get_parameters(self) -> Iterable[PCellParameterDeclaration]: + def get_parameters(self) -> List[PCellParameterDeclaration]: r""" """ def id(self) -> int: @@ -13389,10 +13585,10 @@ class PCellDeclaration_Native: r""" @brief Gets the name of the PCell """ - def parameters_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> Iterable[Any]: + def parameters_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> List[Any]: r""" """ - def produce(self, arg0: Layout, arg1: Iterable[int], arg2: Iterable[Any], arg3: Cell) -> None: + def produce(self, arg0: Layout, arg1: Sequence[int], arg2: Sequence[Any], arg3: Cell) -> None: r""" """ def transformation_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> Trans: @@ -13427,6 +13623,10 @@ class PCellDeclaration(PCellDeclaration_Native): This class has been introduced in version 0.22. """ + def __copy__(self) -> PCellDeclaration: + r""" + @brief Creates a copy of self + """ def _create(self) -> None: r""" @brief Ensures the C++ object is created @@ -13482,7 +13682,7 @@ class PCellDeclaration(PCellDeclaration_Native): @param layer The layer index (in layout) of the shape KLayout offers a way to convert a shape into a PCell. To test whether the PCell can be created from a shape, it will call this method. If this method returns true, KLayout will use \parameters_from_shape and \transformation_from_shape to derive the parameters and instance transformation for the new PCell instance that will replace the shape. """ - def coerce_parameters(self, layout: Layout, input: Iterable[Any]) -> Iterable[Any]: + def coerce_parameters(self, layout: Layout, input: Sequence[Any]) -> List[Any]: r""" @brief Modifies the parameters to match the requirements @param layout The layout object in which the PCell will be produced @@ -13498,12 +13698,12 @@ class PCellDeclaration(PCellDeclaration_Native): It can raise an exception to indicate that something is not correct. """ @overload - def display_text(self, arg0: Iterable[Any]) -> str: + def display_text(self, arg0: Sequence[Any]) -> str: r""" @hide """ @overload - def display_text(self, parameters: Iterable[Any]) -> str: + def display_text(self, parameters: Sequence[Any]) -> str: r""" @brief Returns the display text for this PCell given a certain parameter set Reimplement this method to create a distinct display text for a PCell variant with @@ -13513,7 +13713,7 @@ class PCellDeclaration(PCellDeclaration_Native): r""" @brief Creates a copy of self """ - def get_layers(self, parameters: Iterable[Any]) -> Iterable[LayerInfo]: + def get_layers(self, parameters: Sequence[Any]) -> List[LayerInfo]: r""" @brief Returns a list of layer declarations Reimplement this method to return a list of layers this PCell wants to create. @@ -13523,17 +13723,17 @@ class PCellDeclaration(PCellDeclaration_Native): This method receives the PCell parameters which allows it to deduce layers from the parameters. """ - def get_parameters(self) -> Iterable[PCellParameterDeclaration]: + def get_parameters(self) -> List[PCellParameterDeclaration]: r""" @hide """ @overload - def parameters_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> Iterable[Any]: + def parameters_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> List[Any]: r""" @hide """ @overload - def parameters_from_shape(self, layout: Layout, shape: Shape, layer: int) -> Iterable[Any]: + def parameters_from_shape(self, layout: Layout, shape: Shape, layer: int) -> List[Any]: r""" @brief Gets the parameters for the PCell which can replace the given shape @param layout The layout the shape lives in @@ -13542,12 +13742,12 @@ class PCellDeclaration(PCellDeclaration_Native): KLayout offers a way to convert a shape into a PCell. If \can_create_from_shape returns true, it will use this method to derive the parameters for the PCell instance that will replace the shape. See also \transformation_from_shape and \can_create_from_shape. """ @overload - def produce(self, arg0: Layout, arg1: Iterable[int], arg2: Iterable[Any], arg3: Cell) -> None: + def produce(self, arg0: Layout, arg1: Sequence[int], arg2: Sequence[Any], arg3: Cell) -> None: r""" @hide """ @overload - def produce(self, layout: Layout, layer_ids: Iterable[int], parameters: Iterable[Any], cell: Cell) -> None: + def produce(self, layout: Layout, layer_ids: Sequence[int], parameters: Sequence[Any], cell: Cell) -> None: r""" @brief The production callback @param layout The layout object where the cell resides @@ -13662,6 +13862,10 @@ class PCellParameterDeclaration: @brief Sets the unit string The unit string is shown right to the edit fields for numeric parameters. """ + def __copy__(self) -> PCellParameterDeclaration: + r""" + @brief Creates a copy of self + """ @overload def __init__(self, name: str, type: int, description: str) -> None: r""" @@ -13737,11 +13941,11 @@ class PCellParameterDeclaration: r""" @brief Assigns another object to self """ - def choice_descriptions(self) -> Iterable[str]: + def choice_descriptions(self) -> List[str]: r""" @brief Returns a list of choice descriptions """ - def choice_values(self) -> Iterable[Any]: + def choice_values(self) -> List[Any]: r""" @brief Returns a list of choice values """ @@ -13921,6 +14125,10 @@ class Matrix2d: @param m The other matrix. @return The (element-wise) sum of self+m """ + def __copy__(self) -> Matrix2d: + r""" + @brief Creates a copy of self + """ @overload def __init__(self) -> None: r""" @@ -13973,6 +14181,14 @@ class Matrix2d: @return The matrix product self*m """ @overload + def __mul__(self, p: DPoint) -> DPoint: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload def __mul__(self, p: DPolygon) -> DPolygon: r""" @brief Transforms a polygon with this matrix. @@ -13993,6 +14209,63 @@ class Matrix2d: @param v The vector to transform. @return The transformed vector """ + def __repr__(self) -> str: + r""" + @brief Convert the matrix to a string. + @return The string representing this matrix + """ + @overload + def __rmul__(self, box: DBox) -> DBox: + r""" + @brief Transforms a box with this matrix. + @param box The box to transform. + @return The transformed box + + Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. + """ + @overload + def __rmul__(self, e: DEdge) -> DEdge: + r""" + @brief Transforms an edge with this matrix. + @param e The edge to transform. + @return The transformed edge + """ + @overload + def __rmul__(self, m: Matrix2d) -> Matrix2d: + r""" + @brief Product of two matrices. + @param m The other matrix. + @return The matrix product self*m + """ + @overload + def __rmul__(self, p: DPoint) -> DPoint: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload + def __rmul__(self, p: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon with this matrix. + @param p The polygon to transform. + @return The transformed polygon + """ + @overload + def __rmul__(self, p: DSimplePolygon) -> DSimplePolygon: + r""" + @brief Transforms a simple polygon with this matrix. + @param p The simple polygon to transform. + @return The transformed simple polygon + """ + @overload + def __rmul__(self, v: DVector) -> DVector: + r""" + @brief Transforms a vector with this matrix. + @param v The vector to transform. + @return The transformed vector + """ def __str__(self) -> str: r""" @brief Convert the matrix to a string. @@ -14163,6 +14436,10 @@ class IMatrix2d: @param m The other matrix. @return The (element-wise) sum of self+m """ + def __copy__(self) -> IMatrix2d: + r""" + @brief Creates a copy of self + """ @overload def __init__(self) -> None: r""" @@ -14215,6 +14492,14 @@ class IMatrix2d: @return The matrix product self*m """ @overload + def __mul__(self, p: Point) -> Point: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload def __mul__(self, p: Polygon) -> Polygon: r""" @brief Transforms a polygon with this matrix. @@ -14235,6 +14520,63 @@ class IMatrix2d: @param v The vector to transform. @return The transformed vector """ + def __repr__(self) -> str: + r""" + @brief Convert the matrix to a string. + @return The string representing this matrix + """ + @overload + def __rmul__(self, box: Box) -> Box: + r""" + @brief Transforms a box with this matrix. + @param box The box to transform. + @return The transformed box + + Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. + """ + @overload + def __rmul__(self, e: Edge) -> Edge: + r""" + @brief Transforms an edge with this matrix. + @param e The edge to transform. + @return The transformed edge + """ + @overload + def __rmul__(self, m: IMatrix2d) -> IMatrix2d: + r""" + @brief Product of two matrices. + @param m The other matrix. + @return The matrix product self*m + """ + @overload + def __rmul__(self, p: Point) -> Point: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload + def __rmul__(self, p: Polygon) -> Polygon: + r""" + @brief Transforms a polygon with this matrix. + @param p The polygon to transform. + @return The transformed polygon + """ + @overload + def __rmul__(self, p: SimplePolygon) -> SimplePolygon: + r""" + @brief Transforms a simple polygon with this matrix. + @param p The simple polygon to transform. + @return The transformed simple polygon + """ + @overload + def __rmul__(self, v: Vector) -> Vector: + r""" + @brief Transforms a vector with this matrix. + @param v The vector to transform. + @return The transformed vector + """ def __str__(self) -> str: r""" @brief Convert the matrix to a string. @@ -14475,6 +14817,10 @@ class Matrix3d: @param m The other matrix. @return The (element-wise) sum of self+m """ + def __copy__(self) -> Matrix3d: + r""" + @brief Creates a copy of self + """ @overload def __init__(self) -> None: r""" @@ -14530,6 +14876,14 @@ class Matrix3d: @return The matrix product self*m """ @overload + def __mul__(self, p: DPoint) -> DPoint: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload def __mul__(self, p: DPolygon) -> DPolygon: r""" @brief Transforms a polygon with this matrix. @@ -14550,6 +14904,63 @@ class Matrix3d: @param v The vector to transform. @return The transformed vector """ + def __repr__(self) -> str: + r""" + @brief Convert the matrix to a string. + @return The string representing this matrix + """ + @overload + def __rmul__(self, box: DBox) -> DBox: + r""" + @brief Transforms a box with this matrix. + @param box The box to transform. + @return The transformed box + + Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. + """ + @overload + def __rmul__(self, e: DEdge) -> DEdge: + r""" + @brief Transforms an edge with this matrix. + @param e The edge to transform. + @return The transformed edge + """ + @overload + def __rmul__(self, m: Matrix3d) -> Matrix3d: + r""" + @brief Product of two matrices. + @param m The other matrix. + @return The matrix product self*m + """ + @overload + def __rmul__(self, p: DPoint) -> DPoint: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload + def __rmul__(self, p: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon with this matrix. + @param p The polygon to transform. + @return The transformed polygon + """ + @overload + def __rmul__(self, p: DSimplePolygon) -> DSimplePolygon: + r""" + @brief Transforms a simple polygon with this matrix. + @param p The simple polygon to transform. + @return The transformed simple polygon + """ + @overload + def __rmul__(self, v: DVector) -> DVector: + r""" + @brief Transforms a vector with this matrix. + @param v The vector to transform. + @return The transformed vector + """ def __str__(self) -> str: r""" @brief Convert the matrix to a string. @@ -14592,7 +15003,7 @@ class Matrix3d: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def adjust(self, landmarks_before: Iterable[DPoint], landmarks_after: Iterable[DPoint], flags: int, fixed_point: int) -> None: + def adjust(self, landmarks_before: Sequence[DPoint], landmarks_after: Sequence[DPoint], flags: int, fixed_point: int) -> None: r""" @brief Adjust a 3d matrix to match the given set of landmarks @@ -14770,6 +15181,10 @@ class IMatrix3d: @param m The other matrix. @return The (element-wise) sum of self+m """ + def __copy__(self) -> IMatrix3d: + r""" + @brief Creates a copy of self + """ @overload def __init__(self) -> None: r""" @@ -14825,6 +15240,14 @@ class IMatrix3d: @return The matrix product self*m """ @overload + def __mul__(self, p: Point) -> Point: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload def __mul__(self, p: Polygon) -> Polygon: r""" @brief Transforms a polygon with this matrix. @@ -14845,6 +15268,63 @@ class IMatrix3d: @param v The vector to transform. @return The transformed vector """ + def __repr__(self) -> str: + r""" + @brief Convert the matrix to a string. + @return The string representing this matrix + """ + @overload + def __rmul__(self, box: Box) -> Box: + r""" + @brief Transforms a box with this matrix. + @param box The box to transform. + @return The transformed box + + Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. + """ + @overload + def __rmul__(self, e: Edge) -> Edge: + r""" + @brief Transforms an edge with this matrix. + @param e The edge to transform. + @return The transformed edge + """ + @overload + def __rmul__(self, m: IMatrix3d) -> IMatrix3d: + r""" + @brief Product of two matrices. + @param m The other matrix. + @return The matrix product self*m + """ + @overload + def __rmul__(self, p: Point) -> Point: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload + def __rmul__(self, p: Polygon) -> Polygon: + r""" + @brief Transforms a polygon with this matrix. + @param p The polygon to transform. + @return The transformed polygon + """ + @overload + def __rmul__(self, p: SimplePolygon) -> SimplePolygon: + r""" + @brief Transforms a simple polygon with this matrix. + @param p The simple polygon to transform. + @return The transformed simple polygon + """ + @overload + def __rmul__(self, v: Vector) -> Vector: + r""" + @brief Transforms a vector with this matrix. + @param v The vector to transform. + @return The transformed vector + """ def __str__(self) -> str: r""" @brief Convert the matrix to a string. @@ -14979,6 +15459,10 @@ class NetlistObject: This class has been introduced in version 0.26.2 """ + def __copy__(self) -> NetlistObject: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -15032,7 +15516,7 @@ class NetlistObject: r""" @brief Gets the property value for the given key or nil if there is no value with this key. """ - def property_keys(self) -> Iterable[Any]: + def property_keys(self) -> List[Any]: r""" @brief Gets the keys for the properties stored in this object. """ @@ -15129,6 +15613,10 @@ class DeviceReconnectedTerminal: See the class description for details.@brief The setter for the abstract's connected terminal. See the class description for details. """ + def __copy__(self) -> DeviceReconnectedTerminal: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -15198,6 +15686,10 @@ class DeviceAbstractRef: See the class description for details.@brief The setter for the relative transformation of the instance. See the class description for details. """ + def __copy__(self) -> DeviceAbstractRef: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -15377,12 +15869,12 @@ class Device(NetlistObject): @brief Disconnects the given terminal from any net. This version accepts a terminal name. If the name is not a valid terminal name, an exception is raised. """ - def each_combined_abstract(self) -> Iterable[DeviceAbstractRef]: + def each_combined_abstract(self) -> Iterator[DeviceAbstractRef]: r""" @brief Iterates over the combined device specifications. This feature applies to combined devices. This iterator will deliver all device abstracts present in addition to the default device abstract. """ - def each_reconnected_terminal_for(self, terminal_id: int) -> Iterable[DeviceReconnectedTerminal]: + def each_reconnected_terminal_for(self, terminal_id: int) -> Iterator[DeviceReconnectedTerminal]: r""" @brief Iterates over the reconnected terminal specifications for a given outer terminal. This feature applies to combined devices. This iterator will deliver all device-to-abstract terminal reroutings. @@ -15455,6 +15947,10 @@ class DeviceAbstract: @brief Sets the name of the device abstract. Device names are used to name a device abstract inside a netlist file. Device names should be unique within a netlist. """ + def __copy__(self) -> DeviceAbstract: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -15653,6 +16149,10 @@ class NetTerminalRef: This class has been added in version 0.26. """ + def __copy__(self) -> NetTerminalRef: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -15731,6 +16231,10 @@ class NetPinRef: This class has been added in version 0.26. """ + def __copy__(self) -> NetPinRef: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -15800,6 +16304,10 @@ class NetSubcircuitPinRef: This class has been added in version 0.26. """ + def __copy__(self) -> NetSubcircuitPinRef: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -15890,6 +16398,20 @@ class Net(NetlistObject): See \name= for details about the name.@brief Sets the name of the net. The name of the net is used for naming the net in schematic files for example. The name of the net has to be unique. """ + def __repr__(self) -> str: + r""" + Note: This is an alias of 'qname'. + @brief Gets the qualified name. + The qualified name is like the expanded name, but the circuit's name is preceded + (i.e. 'CIRCUIT:NET') if available. + """ + def __str__(self) -> str: + r""" + Note: This is an alias of 'qname'. + @brief Gets the qualified name. + The qualified name is like the expanded name, but the circuit's name is preceded + (i.e. 'CIRCUIT:NET') if available. + """ def _assign(self, other: NetlistObject) -> None: r""" @brief Assigns another object to self @@ -15943,17 +16465,17 @@ class Net(NetlistObject): r""" @brief Clears the net. """ - def each_pin(self) -> Iterable[NetPinRef]: + def each_pin(self) -> Iterator[NetPinRef]: r""" @brief Iterates over all outgoing pins the net connects. Pin connections are described by \NetPinRef objects. Pin connections are connections to outgoing pins of the circuit the net lives in. """ - def each_subcircuit_pin(self) -> Iterable[NetSubcircuitPinRef]: + def each_subcircuit_pin(self) -> Iterator[NetSubcircuitPinRef]: r""" @brief Iterates over all subcircuit pins the net connects. Subcircuit pin connections are described by \NetSubcircuitPinRef objects. These are connections to specific pins of subcircuits. """ - def each_terminal(self) -> Iterable[NetTerminalRef]: + def each_terminal(self) -> Iterator[NetTerminalRef]: r""" @brief Iterates over all terminals the net connects. Terminals connect devices. Terminal connections are described by \NetTerminalRef objects. @@ -15999,6 +16521,13 @@ class Net(NetlistObject): r""" @brief Returns the number of terminals connected by this net. """ + def to_s(self) -> str: + r""" + Note: This is an alias of 'qname'. + @brief Gets the qualified name. + The qualified name is like the expanded name, but the circuit's name is preceded + (i.e. 'CIRCUIT:NET') if available. + """ class DeviceTerminalDefinition: r""" @@ -16015,6 +16544,10 @@ class DeviceTerminalDefinition: r""" @brief Gets the name of the terminal.@brief Sets the name of the terminal. """ + def __copy__(self) -> DeviceTerminalDefinition: + r""" + @brief Creates a copy of self + """ def __init__(self, name: str, description: Optional[str] = ...) -> None: r""" @brief Creates a new terminal definition. @@ -16097,6 +16630,10 @@ class DeviceParameterDefinition: r""" @brief Gets the name of the parameter.@brief Sets the name of the parameter. """ + def __copy__(self) -> DeviceParameterDefinition: + r""" + @brief Creates a copy of self + """ def __init__(self, name: str, description: Optional[str] = ..., default_value: Optional[float] = ..., is_primary: Optional[bool] = ..., si_scaling: Optional[float] = ...) -> None: r""" @brief Creates a new parameter definition. @@ -16194,6 +16731,10 @@ class EqualDeviceParameters: @brief Combines two parameters for comparison. The '+' operator will join the parameter comparers and produce one that checks the combined parameters. """ + def __copy__(self) -> EqualDeviceParameters: + r""" + @brief Creates a copy of self + """ def __iadd__(self, other: EqualDeviceParameters) -> EqualDeviceParameters: r""" @brief Combines two parameters for comparison (in-place). @@ -16328,6 +16869,10 @@ class GenericDeviceCombiner: This class has been added in version 0.27.3. """ + def __copy__(self) -> GenericDeviceCombiner: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -16454,6 +16999,10 @@ class DeviceClass: This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. """ + def __copy__(self) -> DeviceClass: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -16597,7 +17146,7 @@ class DeviceClass: This method has been introduced in version 0.27.3. """ - def parameter_definitions(self) -> Iterable[DeviceParameterDefinition]: + def parameter_definitions(self) -> List[DeviceParameterDefinition]: r""" @brief Gets the list of parameter definitions of the device. See the \DeviceParameterDefinition class description for details. @@ -16612,7 +17161,7 @@ class DeviceClass: @brief Gets the terminal definition object for a given ID. Terminal definition IDs are used in some places to reference a specific terminal of a device. This method obtains the corresponding definition object. """ - def terminal_definitions(self) -> Iterable[DeviceTerminalDefinition]: + def terminal_definitions(self) -> List[DeviceTerminalDefinition]: r""" @brief Gets the list of terminal definitions of the device. See the \DeviceTerminalDefinition class description for details. @@ -16782,33 +17331,33 @@ class Circuit(NetlistObject): r""" @brief Disconnects the given pin from any net. """ - def each_child(self) -> Iterable[Circuit]: + def each_child(self) -> Iterator[Circuit]: r""" @brief Iterates over the child circuits of this circuit Child circuits are the ones that are referenced from this circuit via subcircuits. """ - def each_device(self) -> Iterable[Device]: + def each_device(self) -> Iterator[Device]: r""" @brief Iterates over the devices of the circuit """ - def each_net(self) -> Iterable[Net]: + def each_net(self) -> Iterator[Net]: r""" @brief Iterates over the nets of the circuit """ - def each_parent(self) -> Iterable[Circuit]: + def each_parent(self) -> Iterator[Circuit]: r""" @brief Iterates over the parent circuits of this circuit Child circuits are the ones that are referencing this circuit via subcircuits. """ - def each_pin(self) -> Iterable[Pin]: + def each_pin(self) -> Iterator[Pin]: r""" @brief Iterates over the pins of the circuit """ - def each_ref(self) -> Iterable[SubCircuit]: + def each_ref(self) -> Iterator[SubCircuit]: r""" @brief Iterates over the subcircuit objects referencing this circuit """ - def each_subcircuit(self) -> Iterable[SubCircuit]: + def each_subcircuit(self) -> Iterator[SubCircuit]: r""" @brief Iterates over the subcircuits of the circuit """ @@ -16857,7 +17406,7 @@ class Circuit(NetlistObject): r""" @brief Gets the netlist object the circuit lives in """ - def nets_by_name(self, name_pattern: str) -> Iterable[Net]: + def nets_by_name(self, name_pattern: str) -> List[Net]: r""" @brief Gets the net objects for a given name filter. The name filter is a glob pattern. This method will return all \Net objects matching the glob pattern. @@ -16941,10 +17490,19 @@ class Netlist: @brief Sets a value indicating whether the netlist names are case sensitive This method has been added in version 0.27.3. """ + def __copy__(self) -> Netlist: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class """ + def __repr__(self) -> str: + r""" + @brief Converts the netlist to a string representation. + This method is intended for test purposes mainly. + """ def __str__(self) -> str: r""" @brief Converts the netlist to a string representation. @@ -17021,7 +17579,7 @@ class Netlist: @brief Gets the circuit object for a given name. If the name is not a valid circuit name, nil is returned. """ - def circuits_by_name(self, name_pattern: str) -> Iterable[Circuit]: + def circuits_by_name(self, name_pattern: str) -> List[Circuit]: r""" @brief Gets the circuit objects for a given name filter. The name filter is a glob pattern. This method will return all \Circuit objects matching the glob pattern. @@ -17043,21 +17601,21 @@ class Netlist: r""" @brief Creates a copy of self """ - def each_circuit(self) -> Iterable[Circuit]: + def each_circuit(self) -> Iterator[Circuit]: r""" @brief Iterates over the circuits of the netlist """ - def each_circuit_bottom_up(self) -> Iterable[Circuit]: + def each_circuit_bottom_up(self) -> Iterator[Circuit]: r""" @brief Iterates over the circuits bottom-up Iterating bottom-up means the parent circuits come after the child circuits. This is the basically the reverse order as delivered by \each_circuit_top_down. """ - def each_circuit_top_down(self) -> Iterable[Circuit]: + def each_circuit_top_down(self) -> Iterator[Circuit]: r""" @brief Iterates over the circuits top-down Iterating top-down means the parent circuits come before the child circuits. The first \top_circuit_count circuits are top circuits - i.e. those which are not referenced by other circuits. """ - def each_device_class(self) -> Iterable[DeviceClass]: + def each_device_class(self) -> Iterator[DeviceClass]: r""" @brief Iterates over the device classes of the netlist """ @@ -17078,7 +17636,7 @@ class Netlist: @brief Flattens circuits matching a certain pattern This method will substitute all instances (subcircuits) of all circuits with names matching the given name pattern. The name pattern is a glob expression. For example, 'flatten_circuit("np*")' will flatten all circuits with names starting with 'np'. """ - def flatten_circuits(self, arg0: Iterable[Circuit]) -> None: + def flatten_circuits(self, arg0: Sequence[Circuit]) -> None: r""" @brief Flattens all given circuits of the netlist This method is equivalent to calling \flatten_circuit for all given circuits, but more efficient. @@ -17163,6 +17721,10 @@ class NetlistSpiceWriterDelegate: This class has been introduced in version 0.26. """ + def __copy__(self) -> NetlistSpiceWriterDelegate: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -17374,6 +17936,10 @@ class NetlistSpiceWriter(NetlistWriter): @brief Sets a value indicating whether to embed comments for position etc. (true) or not (false). The default is to embed comments. """ + def __copy__(self) -> NetlistSpiceWriter: + r""" + @brief Creates a copy of self + """ @overload def __init__(self) -> None: r""" @@ -17491,11 +18057,15 @@ class ParseElementComponentsData: @brief Gets the (named) numerical parameters @brief Sets the (named) numerical parameters """ - strings: Iterable[str] + strings: List[str] r""" @brief Gets the string parameters @brief Sets the string parameters """ + def __copy__(self) -> ParseElementComponentsData: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -17558,7 +18128,7 @@ class ParseElementData: @brief Gets the model name @brief Sets the model name """ - net_names: Iterable[str] + net_names: List[str] r""" @brief Gets the net names @brief Sets the net names @@ -17573,6 +18143,10 @@ class ParseElementData: @brief Gets the value @brief Sets the value """ + def __copy__(self) -> ParseElementData: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -17632,6 +18206,10 @@ class NetlistSpiceReaderDelegate: This class has been introduced in version 0.26. """ + def __copy__(self) -> NetlistSpiceReaderDelegate: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -17696,12 +18274,12 @@ class NetlistSpiceReaderDelegate: @brief Creates a copy of self """ @overload - def element(self, arg0: Circuit, arg1: str, arg2: str, arg3: str, arg4: float, arg5: Iterable[Net], arg6: Dict[str, float]) -> bool: + def element(self, arg0: Circuit, arg1: str, arg2: str, arg3: str, arg4: float, arg5: Sequence[Net], arg6: Dict[str, float]) -> bool: r""" @hide """ @overload - def element(self, circuit: Circuit, element: str, name: str, model: str, value: float, nets: Iterable[Net], parameters: Dict[str, float]) -> bool: + def element(self, circuit: Circuit, element: str, name: str, model: str, value: float, nets: Sequence[Net], parameters: Dict[str, float]) -> bool: r""" @brief Makes a device from an element line @param circuit The circuit that is currently read. @@ -18253,7 +18831,7 @@ class NetlistComparer: This method will perform the actual netlist compare using the given logger. It will return true if both netlists are identical. If the comparer has been configured with \same_nets or similar methods, the objects given there must be located inside 'circuit_a' and 'circuit_b' respectively. """ @overload - def equivalent_pins(self, circuit_b: Circuit, pin_ids: Iterable[int]) -> None: + def equivalent_pins(self, circuit_b: Circuit, pin_ids: Sequence[int]) -> None: r""" @brief Marks several pins of the given circuit as equivalent (i.e. they can be swapped). Only circuits from the second input can be given swappable pins. This will imply the same swappable pins on the equivalent circuit of the first input. This version is a generic variant of the two-pin version of this method. @@ -18318,12 +18896,12 @@ class NetlistComparer: This variant has been added in version 0.27.3. """ - def unmatched_circuits_a(self, a: Netlist, b: Netlist) -> Iterable[Circuit]: + def unmatched_circuits_a(self, a: Netlist, b: Netlist) -> List[Circuit]: r""" @brief Returns a list of circuits in A for which there is not corresponding circuit in B This list can be used to flatten these circuits so they do not participate in the compare process. """ - def unmatched_circuits_b(self, a: Netlist, b: Netlist) -> Iterable[Circuit]: + def unmatched_circuits_b(self, a: Netlist, b: Netlist) -> List[Circuit]: r""" @brief Returns a list of circuits in B for which there is not corresponding circuit in A This list can be used to flatten these circuits so they do not participate in the compare process. @@ -18565,6 +19143,10 @@ class NetlistCrossReference(NetlistCompareLogger): r""" @brief Compares two enums for inequality """ + def __repr__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ def __str__(self) -> str: r""" @brief Gets the symbolic string from an enum @@ -18657,42 +19239,42 @@ class NetlistCrossReference(NetlistCompareLogger): r""" @hide """ - def each_circuit_pair(self) -> Iterable[NetlistCrossReference.CircuitPairData]: + def each_circuit_pair(self) -> Iterator[NetlistCrossReference.CircuitPairData]: r""" @brief Delivers the circuit pairs and their status. See the class description for details. """ - def each_device_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterable[NetlistCrossReference.DevicePairData]: + def each_device_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.DevicePairData]: r""" @brief Delivers the device pairs and their status for the given circuit pair. See the class description for details. """ - def each_net_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterable[NetlistCrossReference.NetPairData]: + def each_net_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.NetPairData]: r""" @brief Delivers the net pairs and their status for the given circuit pair. See the class description for details. """ - def each_net_pin_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterable[NetlistCrossReference.NetPinRefPair]: + def each_net_pin_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetPinRefPair]: r""" @brief Delivers the pin pairs for the given net pair. For the net pair, lists the pin pairs identified on this net. """ - def each_net_subcircuit_pin_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterable[NetlistCrossReference.NetSubcircuitPinRefPair]: + def each_net_subcircuit_pin_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetSubcircuitPinRefPair]: r""" @brief Delivers the subcircuit pin pairs for the given net pair. For the net pair, lists the subcircuit pin pairs identified on this net. """ - def each_net_terminal_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterable[NetlistCrossReference.NetTerminalRefPair]: + def each_net_terminal_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetTerminalRefPair]: r""" @brief Delivers the device terminal pairs for the given net pair. For the net pair, lists the device terminal pairs identified on this net. """ - def each_pin_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterable[NetlistCrossReference.PinPairData]: + def each_pin_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.PinPairData]: r""" @brief Delivers the pin pairs and their status for the given circuit pair. See the class description for details. """ - def each_subcircuit_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterable[NetlistCrossReference.SubCircuitPairData]: + def each_subcircuit_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.SubCircuitPairData]: r""" @brief Delivers the subcircuit pairs and their status for the given circuit pair. See the class description for details. @@ -19498,6 +20080,10 @@ class DeviceClassFactory: This class has been introduced in version 0.27.3. """ + def __copy__(self) -> DeviceClassFactory: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -19593,6 +20179,10 @@ class NetlistDeviceExtractorError: @brief Gets the message text. @brief Sets the message text. """ + def __copy__(self) -> NetlistDeviceExtractorError: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -19652,6 +20242,10 @@ class NetlistDeviceExtractorLayerDefinition: This class has been introduced in version 0.26. """ + def __copy__(self) -> NetlistDeviceExtractorLayerDefinition: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -19780,11 +20374,11 @@ class DeviceExtractorBase: This method has been added in version 0.27.3. """ - def each_error(self) -> Iterable[NetlistDeviceExtractorError]: + def each_error(self) -> Iterator[NetlistDeviceExtractorError]: r""" @brief Iterates over all errors collected in the device extractor. """ - def each_layer_definition(self) -> Iterable[NetlistDeviceExtractorLayerDefinition]: + def each_layer_definition(self) -> Iterator[NetlistDeviceExtractorLayerDefinition]: r""" @brief Iterates over all layer definitions. """ @@ -19944,7 +20538,7 @@ class GenericDeviceExtractor(DeviceExtractorBase): r""" @brief Issues an error with the given category name and description, message and database-unit polygon geometry """ - def extract_devices(self, layer_geometry: Iterable[Region]) -> None: + def extract_devices(self, layer_geometry: Sequence[Region]) -> None: r""" @brief Extracts the devices from the given shape cluster. @@ -19957,7 +20551,7 @@ class GenericDeviceExtractor(DeviceExtractorBase): terminals by which the nets extracted in the network extraction step connect to the new devices. """ - def get_connectivity(self, layout: Layout, layers: Iterable[int]) -> Connectivity: + def get_connectivity(self, layout: Layout, layers: Sequence[int]) -> Connectivity: r""" @brief Gets the connectivity object used to extract the device geometry. This method shall raise an error, if the input layer are not properly defined (e.g. @@ -20737,11 +21331,22 @@ class Path: This method has been added in version 0.23. """ + def __copy__(self) -> Path: + r""" + @brief Creates a copy of self + """ def __eq__(self, p: object) -> bool: r""" @brief Equality test @param p The object to compare against """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -20755,7 +21360,7 @@ class Path: This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpath'. """ @overload - def __init__(self, pts: Iterable[Point], width: int) -> None: + def __init__(self, pts: Sequence[Point], width: int) -> None: r""" @brief Constructor given the points of the path's spine and the width @@ -20764,7 +21369,7 @@ class Path: @param width The width of the path """ @overload - def __init__(self, pts: Iterable[Point], width: int, bgn_ext: int, end_ext: int) -> None: + def __init__(self, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int) -> None: r""" @brief Constructor given the points of the path's spine, the width and the extensions @@ -20775,7 +21380,7 @@ class Path: @param end_ext The end extension of the path """ @overload - def __init__(self, pts: Iterable[Point], width: int, bgn_ext: int, end_ext: int, round: bool) -> None: + def __init__(self, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int, round: bool) -> None: r""" @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag @@ -20804,6 +21409,17 @@ class Path: @brief Inequality test @param p The object to compare against """ + def __repr__(self) -> str: + r""" + @brief Convert to a string + """ + def __rmul__(self, f: float) -> Path: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ def __str__(self) -> str: r""" @brief Convert to a string @@ -20863,7 +21479,7 @@ class Path: r""" @brief Creates a copy of self """ - def each_point(self) -> Iterable[Point]: + def each_point(self) -> Iterator[Point]: r""" @brief Get the points that make up the path's spine """ @@ -21064,11 +21680,22 @@ class DPath: This method has been added in version 0.23. """ + def __copy__(self) -> DPath: + r""" + @brief Creates a copy of self + """ def __eq__(self, p: object) -> bool: r""" @brief Equality test @param p The object to compare against """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -21082,7 +21709,7 @@ class DPath: This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipath'. """ @overload - def __init__(self, pts: Iterable[DPoint], width: float) -> None: + def __init__(self, pts: Sequence[DPoint], width: float) -> None: r""" @brief Constructor given the points of the path's spine and the width @@ -21091,7 +21718,7 @@ class DPath: @param width The width of the path """ @overload - def __init__(self, pts: Iterable[DPoint], width: float, bgn_ext: float, end_ext: float) -> None: + def __init__(self, pts: Sequence[DPoint], width: float, bgn_ext: float, end_ext: float) -> None: r""" @brief Constructor given the points of the path's spine, the width and the extensions @@ -21102,7 +21729,7 @@ class DPath: @param end_ext The end extension of the path """ @overload - def __init__(self, pts: Iterable[DPoint], width: float, bgn_ext: float, end_ext: float, round: bool) -> None: + def __init__(self, pts: Sequence[DPoint], width: float, bgn_ext: float, end_ext: float, round: bool) -> None: r""" @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag @@ -21131,6 +21758,17 @@ class DPath: @brief Inequality test @param p The object to compare against """ + def __repr__(self) -> str: + r""" + @brief Convert to a string + """ + def __rmul__(self, f: float) -> DPath: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ def __str__(self) -> str: r""" @brief Convert to a string @@ -21190,7 +21828,7 @@ class DPath: r""" @brief Creates a copy of self """ - def each_point(self) -> Iterable[DPoint]: + def each_point(self) -> Iterator[DPoint]: r""" @brief Get the points that make up the path's spine """ @@ -21380,10 +22018,21 @@ class DPoint: Starting with version 0.25, this method expects a vector argument. """ + def __copy__(self) -> DPoint: + r""" + @brief Creates a copy of self + """ def __eq__(self, p: object) -> bool: r""" @brief Equality test operator + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given point. This method enables points as hash keys. + + This method has been introduced in version 0.25. """ def __imul__(self, f: float) -> DPoint: r""" @@ -21453,10 +22102,22 @@ class DPoint: This method has been added in version 0.23. """ + def __repr__(self) -> str: + r""" + @brief String conversion + """ + def __rmul__(self, f: float) -> DPoint: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ def __str__(self) -> str: r""" @brief String conversion """ + @overload def __sub__(self, p: DPoint) -> DVector: r""" @brief Subtract one point from another @@ -21466,6 +22127,16 @@ class DPoint: Starting with version 0.25, this method renders a vector. """ + @overload + def __sub__(self, v: DVector) -> DPoint: + r""" + @brief Subtract one vector from a point + + + Subtract vector v from from self by subtracting the coordinates. This renders a point. + + This method has been added in version 0.27. + """ def __truediv__(self, d: float) -> DPoint: r""" @brief Division by some divisor @@ -21607,10 +22278,21 @@ class Point: Starting with version 0.25, this method expects a vector argument. """ + def __copy__(self) -> Point: + r""" + @brief Creates a copy of self + """ def __eq__(self, p: object) -> bool: r""" @brief Equality test operator + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given point. This method enables points as hash keys. + + This method has been introduced in version 0.25. """ def __imul__(self, f: float) -> Point: r""" @@ -21680,10 +22362,22 @@ class Point: This method has been added in version 0.23. """ + def __repr__(self) -> str: + r""" + @brief String conversion + """ + def __rmul__(self, f: float) -> Point: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ def __str__(self) -> str: r""" @brief String conversion """ + @overload def __sub__(self, p: Point) -> Vector: r""" @brief Subtract one point from another @@ -21693,6 +22387,16 @@ class Point: Starting with version 0.25, this method renders a vector. """ + @overload + def __sub__(self, v: Vector) -> Point: + r""" + @brief Subtract one vector from a point + + + Subtract vector v from from self by subtracting the coordinates. This renders a point. + + This method has been added in version 0.27. + """ def __truediv__(self, d: float) -> Point: r""" @brief Division by some divisor @@ -21845,11 +22549,22 @@ class SimplePolygon: This method has been added in version 0.23. """ + def __copy__(self) -> SimplePolygon: + r""" + @brief Creates a copy of self + """ def __eq__(self, p: object) -> bool: r""" @brief Returns a value indicating whether self is equal to p @param p The object to compare against """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -21870,7 +22585,7 @@ class SimplePolygon: This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoly'. """ @overload - def __init__(self, pts: Iterable[Point], raw: Optional[bool] = ...) -> None: + def __init__(self, pts: Sequence[Point], raw: Optional[bool] = ...) -> None: r""" @brief Constructor given the points of the simple polygon @@ -21902,6 +22617,16 @@ class SimplePolygon: @brief Returns a value indicating whether self is not equal to p @param p The object to compare against """ + def __repr__(self) -> str: + r""" + @brief Returns a string representing the polygon + """ + def __rmul__(self, f: float) -> SimplePolygon: + r""" + @brief Scales the polygon by some factor + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ def __str__(self) -> str: r""" @brief Returns a string representing the polygon @@ -21978,15 +22703,15 @@ class SimplePolygon: r""" @brief Creates a copy of self """ - def each_edge(self) -> Iterable[Edge]: + def each_edge(self) -> Iterator[Edge]: r""" @brief Iterates over the edges that make up the simple polygon """ - def each_point(self) -> Iterable[Point]: + def each_point(self) -> Iterator[Point]: r""" @brief Iterates over the points that make up the simple polygon """ - def extract_rad(self) -> Iterable[Any]: + def extract_rad(self) -> List[Any]: r""" @brief Extracts the corner radii from a rounded polygon @@ -22060,7 +22785,7 @@ class SimplePolygon: This method was introduced in version 0.22. """ @overload - def minkowski_sum(self, c: Iterable[Point], resolve_holes: bool) -> Polygon: + def minkowski_sum(self, c: Sequence[Point], resolve_holes: bool) -> Polygon: r""" @brief Computes the Minkowski sum of a polygon and a contour of points (a trace) @@ -22176,7 +22901,7 @@ class SimplePolygon: This method was introduced in version 0.22 for integer coordinates and in 0.25 for all coordinate types. """ - def set_points(self, pts: Iterable[Point], raw: Optional[bool] = ...) -> None: + def set_points(self, pts: Sequence[Point], raw: Optional[bool] = ...) -> None: r""" @brief Sets the points of the simple polygon @@ -22187,7 +22912,7 @@ class SimplePolygon: This method has been added in version 0.24. """ - def split(self) -> Iterable[SimplePolygon]: + def split(self) -> List[SimplePolygon]: r""" @brief Splits the polygon into two or more parts This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. @@ -22350,11 +23075,22 @@ class DSimplePolygon: This method has been added in version 0.23. """ + def __copy__(self) -> DSimplePolygon: + r""" + @brief Creates a copy of self + """ def __eq__(self, p: object) -> bool: r""" @brief Returns a value indicating whether self is equal to p @param p The object to compare against """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -22374,7 +23110,7 @@ class DSimplePolygon: This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipoly'. """ @overload - def __init__(self, pts: Iterable[DPoint], raw: Optional[bool] = ...) -> None: + def __init__(self, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> None: r""" @brief Constructor given the points of the simple polygon @@ -22406,6 +23142,16 @@ class DSimplePolygon: @brief Returns a value indicating whether self is not equal to p @param p The object to compare against """ + def __repr__(self) -> str: + r""" + @brief Returns a string representing the polygon + """ + def __rmul__(self, f: float) -> DSimplePolygon: + r""" + @brief Scales the polygon by some factor + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ def __str__(self) -> str: r""" @brief Returns a string representing the polygon @@ -22482,15 +23228,15 @@ class DSimplePolygon: r""" @brief Creates a copy of self """ - def each_edge(self) -> Iterable[DEdge]: + def each_edge(self) -> Iterator[DEdge]: r""" @brief Iterates over the edges that make up the simple polygon """ - def each_point(self) -> Iterable[DPoint]: + def each_point(self) -> Iterator[DPoint]: r""" @brief Iterates over the points that make up the simple polygon """ - def extract_rad(self) -> Iterable[Any]: + def extract_rad(self) -> List[Any]: r""" @brief Extracts the corner radii from a rounded polygon @@ -22632,7 +23378,7 @@ class DSimplePolygon: This method was introduced in version 0.22 for integer coordinates and in 0.25 for all coordinate types. """ - def set_points(self, pts: Iterable[DPoint], raw: Optional[bool] = ...) -> None: + def set_points(self, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> None: r""" @brief Sets the points of the simple polygon @@ -22643,7 +23389,7 @@ class DSimplePolygon: This method has been added in version 0.24. """ - def split(self) -> Iterable[DSimplePolygon]: + def split(self) -> List[DSimplePolygon]: r""" @brief Splits the polygon into two or more parts This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. @@ -22869,11 +23615,22 @@ class Polygon: This method has been added in version 0.23. """ + def __copy__(self) -> Polygon: + r""" + @brief Creates a copy of self + """ def __eq__(self, p: object) -> bool: r""" @brief Returns a value indicating whether the polygons are equal @param p The object to compare against """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -22901,7 +23658,7 @@ class Polygon: This method was introduced in version 0.22. """ @overload - def __init__(self, pts: Iterable[Point], raw: Optional[bool] = ...) -> None: + def __init__(self, pts: Sequence[Point], raw: Optional[bool] = ...) -> None: r""" @brief Creates a polygon from a point array for the hull @@ -22927,6 +23684,16 @@ class Polygon: @brief Returns a value indicating whether the polygons are not equal @param p The object to compare against """ + def __repr__(self) -> str: + r""" + @brief Returns a string representing the polygon + """ + def __rmul__(self, f: float) -> Polygon: + r""" + @brief Scales the polygon by some factor + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ def __str__(self) -> str: r""" @brief Returns a string representing the polygon @@ -22994,7 +23761,7 @@ class Polygon: This method was introduced in version 0.23. """ @overload - def assign_hole(self, n: int, p: Iterable[Point], raw: Optional[bool] = ...) -> None: + def assign_hole(self, n: int, p: Sequence[Point], raw: Optional[bool] = ...) -> None: r""" @brief Sets the points of the given hole of the polygon @param n The index of the hole to which the points should be assigned @@ -23005,7 +23772,7 @@ class Polygon: This method was introduced in version 0.18. The 'raw' argument was added in version 0.24. """ - def assign_hull(self, p: Iterable[Point], raw: Optional[bool] = ...) -> None: + def assign_hull(self, p: Sequence[Point], raw: Optional[bool] = ...) -> None: r""" @brief Sets the points of the hull of polygon @param p An array of points to assign to the polygon's hull @@ -23035,7 +23802,7 @@ class Polygon: This method was introduced in version 0.18. """ - def decompose_convex(self, preferred_orientation: Optional[int] = ...) -> Iterable[SimplePolygon]: + def decompose_convex(self, preferred_orientation: Optional[int] = ...) -> List[SimplePolygon]: r""" @brief Decomposes the polygon into convex pieces @@ -23047,7 +23814,7 @@ class Polygon: This method was introduced in version 0.25. """ - def decompose_trapezoids(self, mode: Optional[int] = ...) -> Iterable[SimplePolygon]: + def decompose_trapezoids(self, mode: Optional[int] = ...) -> List[SimplePolygon]: r""" @brief Decomposes the polygon into trapezoids @@ -23063,14 +23830,14 @@ class Polygon: @brief Creates a copy of self """ @overload - def each_edge(self) -> Iterable[Edge]: + def each_edge(self) -> Iterator[Edge]: r""" @brief Iterates over the edges that make up the polygon This iterator will deliver all edges, including those of the holes. Hole edges are oriented counterclockwise while hull edges are oriented clockwise. """ @overload - def each_edge(self, contour: int) -> Iterable[Edge]: + def each_edge(self, contour: int) -> Iterator[Edge]: r""" @brief Iterates over the edges of one contour of the polygon @@ -23081,16 +23848,16 @@ class Polygon: This method was introduced in version 0.24. """ - def each_point_hole(self, n: int) -> Iterable[Point]: + def each_point_hole(self, n: int) -> Iterator[Point]: r""" @brief Iterates over the points that make up the nth hole The hole number must be less than the number of holes (see \holes) """ - def each_point_hull(self) -> Iterable[Point]: + def each_point_hull(self) -> Iterator[Point]: r""" @brief Iterates over the points that make up the hull """ - def extract_rad(self) -> Iterable[Any]: + def extract_rad(self) -> List[Any]: r""" @brief Extracts the corner radii from a rounded polygon @@ -23133,7 +23900,7 @@ class Polygon: This method was introduced in version 0.23. """ @overload - def insert_hole(self, p: Iterable[Point], raw: Optional[bool] = ...) -> None: + def insert_hole(self, p: Sequence[Point], raw: Optional[bool] = ...) -> None: r""" @brief Inserts a hole with the given points @param p An array of points to insert as a new hole @@ -23192,18 +23959,6 @@ class Polygon: This method was introduced in version 0.22. """ @overload - def minkowski_sum(self, b: Iterable[Point], resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of the polygon and a contour of points (a trace) - - @param b The contour (a series of points forming the trace). - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and the contour. - - This method was introduced in version 0.22. - """ - @overload def minkowski_sum(self, b: Polygon, resolve_holes: bool) -> Polygon: r""" @brief Computes the Minkowski sum of the polygon and a polygon @@ -23216,6 +23971,18 @@ class Polygon: This method was introduced in version 0.22. """ @overload + def minkowski_sum(self, b: Sequence[Point], resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of the polygon and a contour of points (a trace) + + @param b The contour (a series of points forming the trace). + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and the contour. + + This method was introduced in version 0.22. + """ + @overload def minkowski_sum(self, e: Edge, resolve_holes: bool) -> Polygon: r""" @brief Computes the Minkowski sum of the polygon and an edge @@ -23454,7 +24221,7 @@ class Polygon: This method was introduced in version 0.23. The 'keep_hv' optional parameter was added in version 0.27. """ - def split(self) -> Iterable[Polygon]: + def split(self) -> List[Polygon]: r""" @brief Splits the polygon into two or more parts This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. @@ -23557,20 +24324,6 @@ class Polygon: With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. """ @overload - def transformed(self, t: ICplxTrans) -> Polygon: - r""" - @brief Transforms the polygon with a complex transformation - - Transforms the polygon with the given complex transformation. - Does not modify the polygon but returns the transformed polygon. - - @param t The transformation to apply. - - @return The transformed polygon (in this case an integer coordinate polygon). - - This method was introduced in version 0.18. - """ - @overload def transformed(self, t: Trans) -> Polygon: r""" @brief Transforms the polygon @@ -23649,11 +24402,22 @@ class DPolygon: This method has been added in version 0.23. """ + def __copy__(self) -> DPolygon: + r""" + @brief Creates a copy of self + """ def __eq__(self, p: object) -> bool: r""" @brief Returns a value indicating whether the polygons are equal @param p The object to compare against """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -23681,7 +24445,7 @@ class DPolygon: This method was introduced in version 0.22. """ @overload - def __init__(self, pts: Iterable[DPoint], raw: Optional[bool] = ...) -> None: + def __init__(self, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> None: r""" @brief Creates a polygon from a point array for the hull @@ -23707,6 +24471,16 @@ class DPolygon: @brief Returns a value indicating whether the polygons are not equal @param p The object to compare against """ + def __repr__(self) -> str: + r""" + @brief Returns a string representing the polygon + """ + def __rmul__(self, f: float) -> DPolygon: + r""" + @brief Scales the polygon by some factor + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ def __str__(self) -> str: r""" @brief Returns a string representing the polygon @@ -23774,7 +24548,7 @@ class DPolygon: This method was introduced in version 0.23. """ @overload - def assign_hole(self, n: int, p: Iterable[DPoint], raw: Optional[bool] = ...) -> None: + def assign_hole(self, n: int, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: r""" @brief Sets the points of the given hole of the polygon @param n The index of the hole to which the points should be assigned @@ -23785,7 +24559,7 @@ class DPolygon: This method was introduced in version 0.18. The 'raw' argument was added in version 0.24. """ - def assign_hull(self, p: Iterable[DPoint], raw: Optional[bool] = ...) -> None: + def assign_hull(self, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: r""" @brief Sets the points of the hull of polygon @param p An array of points to assign to the polygon's hull @@ -23820,14 +24594,14 @@ class DPolygon: @brief Creates a copy of self """ @overload - def each_edge(self) -> Iterable[DEdge]: + def each_edge(self) -> Iterator[DEdge]: r""" @brief Iterates over the edges that make up the polygon This iterator will deliver all edges, including those of the holes. Hole edges are oriented counterclockwise while hull edges are oriented clockwise. """ @overload - def each_edge(self, contour: int) -> Iterable[DEdge]: + def each_edge(self, contour: int) -> Iterator[DEdge]: r""" @brief Iterates over the edges of one contour of the polygon @@ -23838,16 +24612,16 @@ class DPolygon: This method was introduced in version 0.24. """ - def each_point_hole(self, n: int) -> Iterable[DPoint]: + def each_point_hole(self, n: int) -> Iterator[DPoint]: r""" @brief Iterates over the points that make up the nth hole The hole number must be less than the number of holes (see \holes) """ - def each_point_hull(self) -> Iterable[DPoint]: + def each_point_hull(self) -> Iterator[DPoint]: r""" @brief Iterates over the points that make up the hull """ - def extract_rad(self) -> Iterable[Any]: + def extract_rad(self) -> List[Any]: r""" @brief Extracts the corner radii from a rounded polygon @@ -23890,7 +24664,7 @@ class DPolygon: This method was introduced in version 0.23. """ @overload - def insert_hole(self, p: Iterable[DPoint], raw: Optional[bool] = ...) -> None: + def insert_hole(self, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: r""" @brief Inserts a hole with the given points @param p An array of points to insert as a new hole @@ -24123,7 +24897,7 @@ class DPolygon: This method has been introduced in version 0.23. """ - def split(self) -> Iterable[DPolygon]: + def split(self) -> List[DPolygon]: r""" @brief Splits the polygon into two or more parts This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. @@ -24288,6 +25062,10 @@ class LayerMap: The LayerMap class has been introduced in version 0.18. Target layer have been introduced in version 0.20. 1:n mapping and unmapping has been introduced in version 0.27. """ + def __copy__(self) -> LayerMap: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -24354,13 +25132,7 @@ class LayerMap: @param layer The physical layer specified with an \LayerInfo object. @return True, if the layer is mapped. """ - def logical(self, layer: LayerInfo) -> int: - r""" - @brief Returns the logical layer (the layer index in the layout object) for a given physical layer.n@param layer The physical layer specified with an \LayerInfo object. - @return The logical layer index or -1 if the layer is not mapped. - This method is deprecated with version 0.27 as in this version, layers can be mapped to multiple targets which this method can't capture. Use \logicals instead. - """ - def logicals(self, layer: LayerInfo) -> Iterable[int]: + def logicals(self, layer: LayerInfo) -> List[int]: r""" @brief Returns the logical layers for a given physical layer.n@param layer The physical layer specified with an \LayerInfo object. @return This list of logical layers this physical layer as mapped to or empty if there is no mapping. @@ -24594,6 +25366,10 @@ class LoadLayoutOptions: r""" @brief Compares two enums for inequality """ + def __repr__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ def __str__(self) -> str: r""" @brief Gets the symbolic string from an enum @@ -24975,7 +25751,7 @@ class LoadLayoutOptions: This method has been added in version 0.26.2. """ - mag_library_paths: Iterable[str] + mag_library_paths: List[str] r""" @brief Gets the locations where to look up libraries (in this order) See \mag_library_paths= method for a description of this attribute. @@ -25027,6 +25803,10 @@ class LoadLayoutOptions: @param enabled True, if text objects should be read. Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. """ + def __copy__(self) -> LoadLayoutOptions: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -25268,7 +26048,7 @@ class RecursiveInstanceIterator: See \region for a description of this attribute. Setting a simple region will reset the complex region to a rectangle and reset the iterator to the beginning of the sequence. """ - targets: Iterable[int] + targets: List[int] r""" @brief Gets the list of target cells See \targets= for a description of the target cell concept. This method returns a list of cell indexes of the selected target cells.@brief Specifies the target cells. @@ -25278,6 +26058,10 @@ class RecursiveInstanceIterator: This method will also reset the iterator. """ + def __copy__(self) -> RecursiveInstanceIterator: + r""" + @brief Creates a copy of self + """ def __eq__(self, other: object) -> bool: r""" @brief Comparison of iterators - equality @@ -25458,7 +26242,7 @@ class RecursiveInstanceIterator: @brief Increments the iterator This moves the iterator to the next instance inside the search scope. """ - def path(self) -> Iterable[InstElement]: + def path(self) -> List[InstElement]: r""" @brief Gets the instantiation path of the instance addressed currently @@ -25485,7 +26269,7 @@ class RecursiveInstanceIterator: This method will also reset the iterator. """ @overload - def select_cells(self, cells: Iterable[int]) -> None: + def select_cells(self, cells: Sequence[int]) -> None: r""" @brief Unselects the given cells. @@ -25526,7 +26310,7 @@ class RecursiveInstanceIterator: This method will also reset the iterator. """ @overload - def unselect_cells(self, cells: Iterable[int]) -> None: + def unselect_cells(self, cells: Sequence[int]) -> None: r""" @brief Unselects the given cells. @@ -25696,6 +26480,10 @@ class RecursiveShapeIterator: The flags must be specified before the shapes are being retrieved. Settings the shapes flags will reset the iterator. """ + def __copy__(self) -> RecursiveShapeIterator: + r""" + @brief Creates a copy of self + """ def __eq__(self, other: object) -> bool: r""" @brief Comparison of iterators - equality @@ -25715,7 +26503,7 @@ class RecursiveShapeIterator: This constructor has been introduced in version 0.23. """ @overload - def __init__(self, layout: Layout, cell: Cell, layers: Iterable[int]) -> None: + def __init__(self, layout: Layout, cell: Cell, layers: Sequence[int]) -> None: r""" @brief Creates a recursive, multi-layer shape iterator. @param layout The layout which shall be iterated @@ -25761,7 +26549,7 @@ class RecursiveShapeIterator: This constructor has been introduced in version 0.25. The 'overlapping' parameter has been made optional in version 0.27. """ @overload - def __init__(self, layout: Layout, cell: Cell, layers: Iterable[int], box: Box, overlapping: Optional[bool] = ...) -> None: + def __init__(self, layout: Layout, cell: Cell, layers: Sequence[int], box: Box, overlapping: Optional[bool] = ...) -> None: r""" @brief Creates a recursive, multi-layer shape iterator with a region. @param layout The layout which shall be iterated @@ -25778,7 +26566,7 @@ class RecursiveShapeIterator: This constructor has been introduced in version 0.23. The 'overlapping' parameter has been made optional in version 0.27. """ @overload - def __init__(self, layout: Layout, cell: Cell, layers: Iterable[int], region: Region, overlapping: Optional[bool] = ...) -> None: + def __init__(self, layout: Layout, cell: Cell, layers: Sequence[int], region: Region, overlapping: Optional[bool] = ...) -> None: r""" @brief Creates a recursive, multi-layer shape iterator with a region. @param layout The layout which shall be iterated @@ -25924,7 +26712,7 @@ class RecursiveShapeIterator: @brief Increments the iterator This moves the iterator to the next shape inside the search scope. """ - def path(self) -> Iterable[InstElement]: + def path(self) -> List[InstElement]: r""" @brief Gets the instantiation path of the shape addressed currently @@ -25959,7 +26747,7 @@ class RecursiveShapeIterator: This method has been introduced in version 0.23. """ @overload - def select_cells(self, cells: Iterable[int]) -> None: + def select_cells(self, cells: Sequence[int]) -> None: r""" @brief Unselects the given cells. @@ -26018,7 +26806,7 @@ class RecursiveShapeIterator: This method has been introduced in version 0.23. """ @overload - def unselect_cells(self, cells: Iterable[int]) -> None: + def unselect_cells(self, cells: Sequence[int]) -> None: r""" @brief Unselects the given cells. @@ -26132,6 +26920,10 @@ class Region(ShapeCollection): r""" @brief Compares two enums for inequality """ + def __repr__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ def __str__(self) -> str: r""" @brief Gets the symbolic string from an enum @@ -26204,6 +26996,10 @@ class Region(ShapeCollection): r""" @brief Compares two enums for inequality """ + def __repr__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ def __str__(self) -> str: r""" @brief Gets the symbolic string from an enum @@ -26260,6 +27056,10 @@ class Region(ShapeCollection): r""" @brief Compares two enums for inequality """ + def __repr__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ def __str__(self) -> str: r""" @brief Gets the symbolic string from an enum @@ -26410,6 +27210,10 @@ class Region(ShapeCollection): This method will compute the boolean AND (intersection) between two regions. The result is often but not necessarily always merged. """ + def __copy__(self) -> Region: + r""" + @brief Creates a copy of self + """ def __getitem__(self, n: int) -> Polygon: r""" @brief Returns the nth polygon of the region @@ -26443,7 +27247,7 @@ class Region(ShapeCollection): This constructor creates an empty region. """ @overload - def __init__(self, array: Iterable[Polygon]) -> None: + def __init__(self, array: Sequence[Polygon]) -> None: r""" @brief Constructor from a polygon array @@ -26611,6 +27415,12 @@ class Region(ShapeCollection): This method will compute the boolean NOT (intersection) between two regions. The result is often but not necessarily always merged. """ + def __iter__(self) -> Iterator[Polygon]: + r""" + @brief Returns each polygon of the region + + This returns the raw polygons (not merged polygons if merged semantics is enabled). + """ def __ixor__(self, other: Region) -> Region: r""" @brief Performs the boolean XOR between self and the other region @@ -26627,17 +27437,15 @@ class Region(ShapeCollection): The boolean OR is implemented by merging the polygons of both regions. To simply join the regions without merging, the + operator is more efficient. """ - @overload - def __str__(self) -> str: + def __repr__(self) -> str: r""" @brief Converts the region to a string The length of the output is limited to 20 polygons to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. """ - @overload - def __str__(self, max_count: int) -> str: + def __str__(self) -> str: r""" @brief Converts the region to a string - This version allows specification of the maximum number of polygons contained in the string. + The length of the output is limited to 20 polygons to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. """ def __sub__(self, other: Region) -> Region: r""" @@ -26649,7 +27457,7 @@ class Region(ShapeCollection): """ def __xor__(self, other: Region) -> Region: r""" - @brief Returns the boolean NOT between self and the other region + @brief Returns the boolean XOR between self and the other region @return The result of the boolean XOR operation @@ -26692,7 +27500,7 @@ class Region(ShapeCollection): Usually it's not required to call this method. It has been introduced in version 0.24. """ - def andnot(self, other: Region) -> Iterable[Region]: + def andnot(self, other: Region) -> List[Region]: r""" @brief Returns the boolean AND and NOT between self and the other region @@ -26849,13 +27657,13 @@ class Region(ShapeCollection): r""" @brief Creates a copy of self """ - def each(self) -> Iterable[Polygon]: + def each(self) -> Iterator[Polygon]: r""" @brief Returns each polygon of the region This returns the raw polygons (not merged polygons if merged semantics is enabled). """ - def each_merged(self) -> Iterable[Polygon]: + def each_merged(self) -> Iterator[Polygon]: r""" @brief Returns each merged polygon of the region @@ -26877,6 +27685,43 @@ class Region(ShapeCollection): The label is a text which is put in front of the progress bar. Using a progress bar will imply a performance penalty of a few percent typically. """ + def enclosed_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + r""" + Note: This is an alias of 'inside_check'. + @brief Performs an inside check with options + @param d The minimum distance for which the polygons are checked + @param other The other region against which to check + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper limit of the projected length of one edge onto another + @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes + @param rect_filter Specifies an error filter for rectangular input shapes + @param negative Negative output from the first input + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. + + "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. + Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. + + "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. + + If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the distance is larger or equal to the limit. This is a way to flag the parts of the first input where the distance to the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge. + + Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + + The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. + The 'enclosed_check' alias was introduced in version 0.27.5. + """ def enclosing_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: r""" @brief Performs an enclosing check with options @@ -27027,7 +27872,7 @@ class Region(ShapeCollection): If merge semantics is not enabled, the hull may also enclose holes if the polygons are taken from a hole-less representation (i.e. GDS2 file). Use explicit merge (\merge method) in order to merge the polygons and detect holes. """ @overload - def insert(self, array: Iterable[Polygon]) -> None: + def insert(self, array: Sequence[Polygon]) -> None: r""" @brief Inserts all polygons from the array into this region """ @@ -27346,7 +28191,7 @@ class Region(ShapeCollection): The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) """ @overload - def minkowski_sum(self, b: Iterable[Point]) -> Region: + def minkowski_sum(self, b: Sequence[Point]) -> Region: r""" @brief Compute the Minkowski sum of the region and a contour of points (a trace) @@ -28086,7 +28931,7 @@ class Region(ShapeCollection): The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. """ - def split_covering(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Iterable[Region]: + def split_covering(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: r""" @brief Returns the polygons of this region which are completely covering polygons from the other region and the ones which are not at the same time @@ -28097,7 +28942,7 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ - def split_inside(self, other: Region) -> Iterable[Region]: + def split_inside(self, other: Region) -> List[Region]: r""" @brief Returns the polygons of this region which are completely inside polygons from the other region and the ones which are not at the same time @@ -28109,7 +28954,7 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ @overload - def split_interacting(self, other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Iterable[Region]: + def split_interacting(self, other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: r""" @brief Returns the polygons of this region which are interacting with edges from the other edge collection and the ones which are not at the same time @@ -28121,7 +28966,7 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ @overload - def split_interacting(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Iterable[Region]: + def split_interacting(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: r""" @brief Returns the polygons of this region which are interacting with polygons from the other region and the ones which are not at the same time @@ -28133,7 +28978,7 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ @overload - def split_interacting(self, other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Iterable[Region]: + def split_interacting(self, other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: r""" @brief Returns the polygons of this region which are interacting with texts from the other text collection and the ones which are not at the same time @@ -28144,7 +28989,7 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ - def split_outside(self, other: Region) -> Iterable[Region]: + def split_outside(self, other: Region) -> List[Region]: r""" @brief Returns the polygons of this region which are completely outside polygons from the other region and the ones which are not at the same time @@ -28155,7 +29000,7 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ - def split_overlapping(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Iterable[Region]: + def split_overlapping(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: r""" @brief Returns the polygons of this region which are overlapping with polygons from the other region and the ones which are not at the same time @@ -28699,6 +29544,17 @@ class Shape: This method has been introduced in version 0.23. """ + box_dcenter: None + r""" + WARNING: This variable can only be set, not retrieved. + Note: This is an alias of 'box_center'. + @brief Sets the center of the box with the point being given in micrometer units + + Applies to boxes only. Changes the center of the box and throws an exception if the shape is not a box. + Translation from micrometer units to database units is done internally. + + This method has been introduced in version 0.25. + """ box_dheight: float r""" @brief Returns the height of the box in micrometer units @@ -28711,6 +29567,28 @@ class Shape: Applies to boxes only. Changes the height of the box to the value given in micrometer units and throws an exception if the shape is not a box. Translation to database units happens internally. + This method has been introduced in version 0.25. + """ + box_dp1: None + r""" + WARNING: This variable can only be set, not retrieved. + Note: This is an alias of 'box_p1'. + @brief Sets the lower left corner of the box with the point being given in micrometer units + + Applies to boxes only. Changes the lower left point of the box and throws an exception if the shape is not a box. + Translation from micrometer units to database units is done internally. + + This method has been introduced in version 0.25. + """ + box_dp2: None + r""" + WARNING: This variable can only be set, not retrieved. + Note: This is an alias of 'box_p2'. + @brief Sets the upper right corner of the box with the point being given in micrometer units + + Applies to boxes only. Changes the upper right point of the box and throws an exception if the shape is not a box. + Translation from micrometer units to database units is done internally. + This method has been introduced in version 0.25. """ box_dwidth: float @@ -28791,6 +29669,69 @@ class Shape: This method has been introduced in version 0.23. """ + dbox: None + r""" + WARNING: This variable can only be set, not retrieved. + Note: This is an alias of 'box'. + @brief Replaces the shape by the given box (in micrometer units) + This method replaces the shape by the given box, like \box= with a \Box argument does. This version translates the box from micrometer units to database units internally. + + This method has been introduced in version 0.25. + """ + dedge: None + r""" + WARNING: This variable can only be set, not retrieved. + Note: This is an alias of 'edge'. + @brief Replaces the shape by the given edge (in micrometer units) + This method replaces the shape by the given edge, like \edge= with a \Edge argument does. This version translates the edge from micrometer units to database units internally. + + This method has been introduced in version 0.25. + """ + dedge_pair: None + r""" + WARNING: This variable can only be set, not retrieved. + Note: This is an alias of 'edge_pair'. + @brief Replaces the shape by the given edge pair (in micrometer units) + This method replaces the shape by the given edge pair, like \edge_pair= with a \EdgePair argument does. This version translates the edge pair from micrometer units to database units internally. + + This method has been introduced in version 0.26. + """ + dpath: None + r""" + WARNING: This variable can only be set, not retrieved. + Note: This is an alias of 'path'. + @brief Replaces the shape by the given path (in micrometer units) + This method replaces the shape by the given path, like \path= with a \Path argument does. This version translates the path from micrometer units to database units internally. + + This method has been introduced in version 0.25. + """ + dpolygon: None + r""" + WARNING: This variable can only be set, not retrieved. + Note: This is an alias of 'polygon'. + @brief Replaces the shape by the given polygon (in micrometer units) + This method replaces the shape by the given polygon, like \polygon= with a \Polygon argument does. This version translates the polygon from micrometer units to database units internally. + + This method has been introduced in version 0.25. + """ + dsimple_polygon: None + r""" + WARNING: This variable can only be set, not retrieved. + Note: This is an alias of 'simple_polygon'. + @brief Replaces the shape by the given simple polygon (in micrometer units) + This method replaces the shape by the given text, like \simple_polygon= with a \SimplePolygon argument does. This version translates the polygon from micrometer units to database units internally. + + This method has been introduced in version 0.25. + """ + dtext: None + r""" + WARNING: This variable can only be set, not retrieved. + Note: This is an alias of 'text'. + @brief Replaces the shape by the given text (in micrometer units) + This method replaces the shape by the given text, like \text= with a \Text argument does. This version translates the text from micrometer units to database units internally. + + This method has been introduced in version 0.25. + """ edge: Any r""" @brief Returns the edge object @@ -28963,6 +29904,15 @@ class Shape: This method has been introduced in version 0.22. """ + text_dpos: None + r""" + WARNING: This variable can only be set, not retrieved. + Note: This is an alias of 'text_pos'. + @brief Sets the text's position in micrometer units + Applies to texts only. Will throw an exception if the object is not a text. + + This method has been added in version 0.25. + """ text_dsize: float r""" @brief Gets the text size in micrometer units @@ -28973,6 +29923,15 @@ class Shape: Applies to texts only. Will throw an exception if the object is not a text. + This method has been introduced in version 0.25. + """ + text_dtrans: None + r""" + WARNING: This variable can only be set, not retrieved. + Note: This is an alias of 'text_trans'. + @brief Sets the text transformation in micrometer units + Applies to texts only. Will throw an exception if the object is not a text. + This method has been introduced in version 0.25. """ text_font: int @@ -29065,6 +30024,10 @@ class Shape: This method has been introduced in version 0.23. """ + def __copy__(self) -> Shape: + r""" + @brief Creates a copy of self + """ def __eq__(self, other: object) -> bool: r""" @brief Equality operator @@ -29080,6 +30043,12 @@ class Shape: r""" @brief Inequality operator """ + def __repr__(self) -> str: + r""" + @brief Create a string showing the contents of the reference + + This method has been introduced with version 0.16. + """ def __str__(self) -> str: r""" @brief Create a string showing the contents of the reference @@ -29154,7 +30123,7 @@ class Shape: r""" @brief Returns the bounding box of the shape """ - def box_dcenter(self) -> DPoint: + def box_dcenter_(self) -> DPoint: r""" @brief Returns the center of the box as a \DPoint object in micrometer units @@ -29163,7 +30132,7 @@ class Shape: This method has been introduced in version 0.25. """ - def box_dp1(self) -> DPoint: + def box_dp1_(self) -> DPoint: r""" @brief Returns the lower left point of the box as a \DPoint object in micrometer units @@ -29172,7 +30141,7 @@ class Shape: This method has been introduced in version 0.25. """ - def box_dp2(self) -> DPoint: + def box_dp2_(self) -> DPoint: r""" @brief Returns the upper right point of the box as a \DPoint object in micrometer units @@ -29191,21 +30160,21 @@ class Shape: @brief Returns the bounding box of the shape in micrometer units This method has been added in version 0.25. """ - def dbox(self) -> Any: + def dbox_(self) -> Any: r""" @brief Gets the box object in micrometer units See \box for a description of this method. This method returns the box after translation to micrometer units. This method has been added in version 0.25. """ - def dedge(self) -> Any: + def dedge_(self) -> Any: r""" @brief Returns the edge object as a \DEdge object in micrometer units See \edge for a description of this method. This method returns the edge after translation to micrometer units. This method has been added in version 0.25. """ - def dedge_pair(self) -> Any: + def dedge_pair_(self) -> Any: r""" @brief Returns the edge pair object as a \DEdgePair object in micrometer units See \edge_pair for a description of this method. This method returns the edge pair after translation to micrometer units. @@ -29228,7 +30197,7 @@ class Shape: This method has been introduced in version 0.22. """ - def dpath(self) -> Any: + def dpath_(self) -> Any: r""" @brief Returns the path object as a \DPath object in micrometer units See \path for a description of this method. This method returns the path after translation to micrometer units. @@ -29243,7 +30212,7 @@ class Shape: This method has been added in version 0.25. """ - def dpolygon(self) -> Any: + def dpolygon_(self) -> Any: r""" @brief Returns the polygon object in micrometer units @@ -29251,7 +30220,7 @@ class Shape: This method has been introduced in version 0.25. """ - def dsimple_polygon(self) -> Any: + def dsimple_polygon_(self) -> Any: r""" @brief Returns the simple polygon object in micrometer units @@ -29259,7 +30228,7 @@ class Shape: This method has been introduced in version 0.25. """ - def dtext(self) -> Any: + def dtext_(self) -> Any: r""" @brief Returns the path object as a \DText object in micrometer units See \text for a description of this method. This method returns the text after translation to micrometer units. @@ -29271,7 +30240,7 @@ class Shape: @brief Creates a copy of self """ @overload - def each_dedge(self) -> Iterable[DEdge]: + def each_dedge(self) -> Iterator[DEdge]: r""" @brief Iterates over the edges of the object and returns edges in micrometer units @@ -29280,7 +30249,7 @@ class Shape: This method has been introduced in version 0.25. """ @overload - def each_dedge(self, contour: int) -> Iterable[DEdge]: + def each_dedge(self, contour: int) -> Iterator[DEdge]: r""" @brief Iterates over the edges of a single contour of the object and returns edges in micrometer units @@ -29288,7 +30257,7 @@ class Shape: This method has been introduced in version 0.25. """ - def each_dpoint(self) -> Iterable[DPoint]: + def each_dpoint(self) -> Iterator[DPoint]: r""" @brief Iterates over all points of the object and returns points in micrometer units @@ -29296,7 +30265,7 @@ class Shape: This method has been introduced in version 0.25. """ - def each_dpoint_hole(self, hole_index: int) -> Iterable[DPoint]: + def each_dpoint_hole(self, hole_index: int) -> Iterator[DPoint]: r""" @brief Iterates over a hole contour of the object and returns points in micrometer units @@ -29304,7 +30273,7 @@ class Shape: This method has been introduced in version 0.25. """ - def each_dpoint_hull(self) -> Iterable[DPoint]: + def each_dpoint_hull(self) -> Iterator[DPoint]: r""" @brief Iterates over the hull contour of the object and returns points in micrometer units @@ -29313,7 +30282,7 @@ class Shape: This method has been introduced in version 0.25. """ @overload - def each_edge(self) -> Iterable[Edge]: + def each_edge(self) -> Iterator[Edge]: r""" @brief Iterates over the edges of the object @@ -29322,7 +30291,7 @@ class Shape: It will throw an exception if the object is not a polygon. """ @overload - def each_edge(self, contour: int) -> Iterable[Edge]: + def each_edge(self, contour: int) -> Iterator[Edge]: r""" @brief Iterates over the edges of a single contour of the object @param contour The contour number (0 for hull, 1 for first hole ...) @@ -29334,14 +30303,14 @@ class Shape: This method was introduced in version 0.24. """ - def each_point(self) -> Iterable[Point]: + def each_point(self) -> Iterator[Point]: r""" @brief Iterates over all points of the object This method applies to paths and delivers all points of the path's center line. It will throw an exception for other objects. """ - def each_point_hole(self, hole_index: int) -> Iterable[Point]: + def each_point_hole(self, hole_index: int) -> Iterator[Point]: r""" @brief Iterates over the points of a hole contour @@ -29351,7 +30320,7 @@ class Shape: @param hole The hole index (see holes () method) """ - def each_point_hull(self) -> Iterable[Point]: + def each_point_hull(self) -> Iterator[Point]: r""" @brief Iterates over the hull contour of the object @@ -29480,7 +30449,7 @@ class Shape: This method has been introduced in version 0.22. """ - def text_dpos(self) -> DVector: + def text_dpos_(self) -> DVector: r""" @brief Gets the text's position in micrometer units @@ -29488,7 +30457,7 @@ class Shape: This method has been added in version 0.25. """ - def text_dtrans(self) -> DTrans: + def text_dtrans_(self) -> DTrans: r""" @brief Gets the text transformation in micrometer units @@ -29587,6 +30556,10 @@ class ShapeProcessor: The shape processor implements the boolean and edge set operations (size, merge). Because the shape processor might allocate resources which can be reused in later operations, it is implemented as an object that can be used several times. The shape processor is similar to the \EdgeProcessor. The latter is specialized on handling polygons and edges directly. """ + def __copy__(self) -> ShapeProcessor: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -29633,7 +30606,7 @@ class ShapeProcessor: @brief Assigns another object to self """ @overload - def boolean(self, in_a: Iterable[Shape], in_b: Iterable[Shape], mode: int) -> Iterable[Edge]: + def boolean(self, in_a: Sequence[Shape], in_b: Sequence[Shape], mode: int) -> List[Edge]: r""" @brief Boolean operation on two given shape sets into an edge set @@ -29647,7 +30620,7 @@ class ShapeProcessor: @param mode The boolean operation (see \EdgeProcessor) """ @overload - def boolean(self, in_a: Iterable[Shape], trans_a: Iterable[CplxTrans], in_b: Iterable[Shape], trans_b: Iterable[CplxTrans], mode: int) -> Iterable[Edge]: + def boolean(self, in_a: Sequence[Shape], trans_a: Sequence[CplxTrans], in_b: Sequence[Shape], trans_b: Sequence[CplxTrans], mode: int) -> List[Edge]: r""" @brief Boolean operation on two given shape sets into an edge set @@ -29680,7 +30653,7 @@ class ShapeProcessor: @param min_coherence true, if minimum polygons should be created for touching corners """ @overload - def boolean_to_polygon(self, in_a: Iterable[Shape], in_b: Iterable[Shape], mode: int, resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def boolean_to_polygon(self, in_a: Sequence[Shape], in_b: Sequence[Shape], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Boolean operation on two given shape sets into a polygon set @@ -29696,7 +30669,7 @@ class ShapeProcessor: @param min_coherence true, if minimum polygons should be created for touching corners """ @overload - def boolean_to_polygon(self, in_a: Iterable[Shape], trans_a: Iterable[CplxTrans], in_b: Iterable[Shape], trans_b: Iterable[CplxTrans], mode: int, resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def boolean_to_polygon(self, in_a: Sequence[Shape], trans_a: Sequence[CplxTrans], in_b: Sequence[Shape], trans_b: Sequence[CplxTrans], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Boolean operation on two given shape sets into a polygon set @@ -29716,7 +30689,7 @@ class ShapeProcessor: @brief Creates a copy of self """ @overload - def merge(self, in_: Iterable[Shape], min_wc: int) -> Iterable[Edge]: + def merge(self, in_: Sequence[Shape], min_wc: int) -> List[Edge]: r""" @brief Merge the given shapes @@ -29729,7 +30702,7 @@ class ShapeProcessor: @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) """ @overload - def merge(self, in_: Iterable[Shape], trans: Iterable[CplxTrans], min_wc: int) -> Iterable[Edge]: + def merge(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], min_wc: int) -> List[Edge]: r""" @brief Merge the given shapes @@ -29757,7 +30730,7 @@ class ShapeProcessor: @param min_coherence true, if minimum polygons should be created for touching corners """ @overload - def merge_to_polygon(self, in_: Iterable[Shape], min_wc: int, resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def merge_to_polygon(self, in_: Sequence[Shape], min_wc: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Merge the given shapes @@ -29772,7 +30745,7 @@ class ShapeProcessor: @param min_coherence true, if minimum polygons should be created for touching corners """ @overload - def merge_to_polygon(self, in_: Iterable[Shape], trans: Iterable[CplxTrans], min_wc: int, resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def merge_to_polygon(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], min_wc: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Merge the given shapes @@ -29786,7 +30759,7 @@ class ShapeProcessor: @param min_coherence true, if minimum polygons should be created for touching corners """ @overload - def size(self, in_: Iterable[Shape], d: int, mode: int) -> Iterable[Edge]: + def size(self, in_: Sequence[Shape], d: int, mode: int) -> List[Edge]: r""" @brief Size the given shapes @@ -29800,7 +30773,7 @@ class ShapeProcessor: @param mode The sizing mode (see \EdgeProcessor) """ @overload - def size(self, in_: Iterable[Shape], dx: int, dy: int, mode: int) -> Iterable[Edge]: + def size(self, in_: Sequence[Shape], dx: int, dy: int, mode: int) -> List[Edge]: r""" @brief Size the given shapes @@ -29815,7 +30788,7 @@ class ShapeProcessor: @param mode The sizing mode (see \EdgeProcessor) """ @overload - def size(self, in_: Iterable[Shape], trans: Iterable[CplxTrans], d: int, mode: int) -> Iterable[Edge]: + def size(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], d: int, mode: int) -> List[Edge]: r""" @brief Size the given shapes @@ -29828,7 +30801,7 @@ class ShapeProcessor: @param mode The sizing mode (see \EdgeProcessor) """ @overload - def size(self, in_: Iterable[Shape], trans: Iterable[CplxTrans], dx: int, dy: int, mode: int) -> Iterable[Edge]: + def size(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], dx: int, dy: int, mode: int) -> List[Edge]: r""" @brief Size the given shapes @@ -29877,7 +30850,7 @@ class ShapeProcessor: @param min_coherence true, if minimum polygons should be created for touching corners """ @overload - def size_to_polygon(self, in_: Iterable[Shape], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def size_to_polygon(self, in_: Sequence[Shape], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Size the given shapes @@ -29893,7 +30866,7 @@ class ShapeProcessor: @param min_coherence true, if minimum polygons should be created for touching corners """ @overload - def size_to_polygon(self, in_: Iterable[Shape], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def size_to_polygon(self, in_: Sequence[Shape], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Size the given shapes @@ -29910,7 +30883,7 @@ class ShapeProcessor: @param min_coherence true, if minimum polygons should be created for touching corners """ @overload - def size_to_polygon(self, in_: Iterable[Shape], trans: Iterable[CplxTrans], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def size_to_polygon(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Size the given shapes @@ -29925,7 +30898,7 @@ class ShapeProcessor: @param min_coherence true, if minimum polygons should be created for touching corners """ @overload - def size_to_polygon(self, in_: Iterable[Shape], trans: Iterable[CplxTrans], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> Iterable[Polygon]: + def size_to_polygon(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: r""" @brief Size the given shapes @@ -29995,10 +30968,26 @@ class Shapes: r""" @brief Indicates that user objects shall be retrieved """ + def __copy__(self) -> Shapes: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class """ + def __iter__(self) -> Iterator[Shape]: + r""" + @brief Gets all shapes + + This call is equivalent to each(SAll). This convenience method has been introduced in version 0.16 + """ + def __len__(self) -> int: + r""" + @brief Gets the number of shapes in this container + This method was introduced in version 0.16 + @return The number of shapes in this container + """ def _create(self) -> None: r""" @brief Ensures the C++ object is created @@ -30054,21 +31043,21 @@ class Shapes: @brief Creates a copy of self """ @overload - def each(self) -> Iterable[Shape]: + def each(self) -> Iterator[Shape]: r""" @brief Gets all shapes This call is equivalent to each(SAll). This convenience method has been introduced in version 0.16 """ @overload - def each(self, flags: int) -> Iterable[Shape]: + def each(self, flags: int) -> Iterator[Shape]: r""" @brief Gets all shapes @param flags An "or"-ed combination of the S... constants """ @overload - def each_overlapping(self, region: Box) -> Iterable[Shape]: + def each_overlapping(self, region: Box) -> Iterator[Shape]: r""" @brief Gets all shapes that overlap the search box (region) @param region The rectangular search region @@ -30076,7 +31065,7 @@ class Shapes: This call is equivalent to each_overlapping(SAll,region). This convenience method has been introduced in version 0.16 """ @overload - def each_overlapping(self, region: DBox) -> Iterable[Shape]: + def each_overlapping(self, region: DBox) -> Iterator[Shape]: r""" @brief Gets all shapes that overlap the search box (region) where the search box is given in micrometer units @param region The rectangular search region as a \DBox object in micrometer units @@ -30085,7 +31074,7 @@ class Shapes: This method was introduced in version 0.25 """ @overload - def each_overlapping(self, flags: int, region: Box) -> Iterable[Shape]: + def each_overlapping(self, flags: int, region: Box) -> Iterator[Shape]: r""" @brief Gets all shapes that overlap the search box (region) This method was introduced in version 0.16 @@ -30094,7 +31083,7 @@ class Shapes: @param region The rectangular search region """ @overload - def each_overlapping(self, flags: int, region: DBox) -> Iterable[Shape]: + def each_overlapping(self, flags: int, region: DBox) -> Iterator[Shape]: r""" @brief Gets all shapes that overlap the search box (region) where the search box is given in micrometer units @param flags An "or"-ed combination of the S... constants @@ -30103,7 +31092,7 @@ class Shapes: This method was introduced in version 0.25 """ @overload - def each_touching(self, region: Box) -> Iterable[Shape]: + def each_touching(self, region: Box) -> Iterator[Shape]: r""" @brief Gets all shapes that touch the search box (region) @param region The rectangular search region @@ -30111,7 +31100,7 @@ class Shapes: This call is equivalent to each_touching(SAll,region). This convenience method has been introduced in version 0.16 """ @overload - def each_touching(self, region: DBox) -> Iterable[Shape]: + def each_touching(self, region: DBox) -> Iterator[Shape]: r""" @brief Gets all shapes that touch the search box (region) where the search box is given in micrometer units @param region The rectangular search region as a \DBox object in micrometer units @@ -30120,7 +31109,7 @@ class Shapes: This method was introduced in version 0.25 """ @overload - def each_touching(self, flags: int, region: Box) -> Iterable[Shape]: + def each_touching(self, flags: int, region: Box) -> Iterator[Shape]: r""" @brief Gets all shapes that touch the search box (region) This method was introduced in version 0.16 @@ -30129,7 +31118,7 @@ class Shapes: @param region The rectangular search region """ @overload - def each_touching(self, flags: int, region: DBox) -> Iterable[Shape]: + def each_touching(self, flags: int, region: DBox) -> Iterator[Shape]: r""" @brief Gets all shapes that touch the search box (region) where the search box is given in micrometer units @param flags An "or"-ed combination of the S... constants @@ -31026,12 +32015,6 @@ class Technology: @brief Gets the flag indicating whether to add other layers to the layer properties @brief Sets the flag indicating whether to add other layers to the layer properties """ - clear_technologies: ClassVar[None] - r""" - @brief Clears all technologies - - This method has been introduced in version 0.26. - """ dbu: float r""" @brief Gets the default database unit @@ -31118,16 +32101,29 @@ class Technology: See \save_layout_options for a description of this property. """ - technologies_to_xml: ClassVar[str] - r""" - @brief Returns a XML representation of all technologies registered in the system + @classmethod + def clear_technologies(cls) -> None: + r""" + @brief Clears all technologies - \technologies_from_xml can be used to restore the technology definitions. This method is provided mainly as a substitute for the pre-0.25 way of accessing technology data through the 'technology-data' configuration parameter. This method will return the equivalent string. - """ - technology_names: ClassVar[Iterable[str]] - r""" - @brief Gets a list of technology names defined in the system - """ + This method has been introduced in version 0.26. + """ + @classmethod + def technologies_to_xml(cls) -> str: + r""" + @brief Returns a XML representation of all technologies registered in the system + + \technologies_from_xml can be used to restore the technology definitions. This method is provided mainly as a substitute for the pre-0.25 way of accessing technology data through the 'technology-data' configuration parameter. This method will return the equivalent string. + """ + @classmethod + def technology_names(cls) -> List[str]: + r""" + @brief Gets a list of technology names defined in the system + """ + def __copy__(self) -> Technology: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -31187,7 +32183,7 @@ class Technology: @brief Gets the technology component with the given name The names are unique system identifiers. For all names, use \component_names. """ - def component_names(self) -> Iterable[str]: + def component_names(self) -> List[str]: r""" @brief Gets the names of all components available for \component """ @@ -31339,6 +32335,10 @@ class Text: This method has been added in version 0.23. """ + def __copy__(self) -> Text: + r""" + @brief Creates a copy of self + """ def __eq__(self, text: object) -> bool: r""" @brief Equality @@ -31346,6 +32346,13 @@ class Text: Return true, if this text object and the given text are equal """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given text object. This method enables texts as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -31398,6 +32405,10 @@ class Text: Return true, if this text object and the given text are not equal """ + def __repr__(self) -> str: + r""" + @brief Convert to a string + """ def __str__(self) -> str: r""" @brief Convert to a string @@ -31634,6 +32645,10 @@ class DText: This method has been added in version 0.23. """ + def __copy__(self) -> DText: + r""" + @brief Creates a copy of self + """ def __eq__(self, text: object) -> bool: r""" @brief Equality @@ -31641,6 +32656,13 @@ class DText: Return true, if this text object and the given text are equal """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given text object. This method enables texts as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -31694,6 +32716,10 @@ class DText: Return true, if this text object and the given text are not equal """ + def __repr__(self) -> str: + r""" + @brief Convert to a string + """ def __str__(self) -> str: r""" @brief Convert to a string @@ -31874,6 +32900,17 @@ class Texts(ShapeCollection): This operator adds the texts of the other collection to self and returns a new combined set. """ + def __and__(self, other: Region) -> Texts: + r""" + Note: This is an alias of 'interacting'. + @brief Returns the texts from this text collection which are inside or on the edge of polygons from the given region + + @return A new text collection containing the texts inside or on the edge of polygons from the region + """ + def __copy__(self) -> Texts: + r""" + @brief Creates a copy of self + """ def __getitem__(self, n: int) -> Text: r""" @brief Returns the nth text @@ -31898,7 +32935,7 @@ class Texts(ShapeCollection): This constructor creates an empty text collection. """ @overload - def __init__(self, array: Iterable[Text]) -> None: + def __init__(self, array: Sequence[Text]) -> None: r""" @brief Constructor from an text array @@ -31987,17 +33024,26 @@ class Texts(ShapeCollection): r = RBA::Texts::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) @/code """ - @overload + def __iter__(self) -> Iterator[Text]: + r""" + @brief Returns each text of the text collection + """ + def __repr__(self) -> str: + r""" + @brief Converts the text collection to a string + The length of the output is limited to 20 texts to avoid giant strings on large collections. For full output use "to_s" with a maximum count parameter. + """ def __str__(self) -> str: r""" @brief Converts the text collection to a string The length of the output is limited to 20 texts to avoid giant strings on large collections. For full output use "to_s" with a maximum count parameter. """ - @overload - def __str__(self, max_count: int) -> str: + def __sub__(self, other: Region) -> Texts: r""" - @brief Converts the text collection to a string - This version allows specification of the maximum number of texts contained in the string. + Note: This is an alias of 'not_interacting'. + @brief Returns the texts from this text collection which are not inside or on the edge of polygons from the given region + + @return A new text collection containing the texts not inside or on the edge of polygons from the region """ def _create(self) -> None: r""" @@ -32070,7 +33116,7 @@ class Texts(ShapeCollection): r""" @brief Creates a copy of self """ - def each(self) -> Iterable[Text]: + def each(self) -> Iterator[Text]: r""" @brief Returns each text of the text collection """ @@ -32324,6 +33370,10 @@ class TileOutputReceiverBase: @hide @alias TileOutputReceiver """ + def __copy__(self) -> TileOutputReceiverBase: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -33022,10 +34072,21 @@ class Trans: This method has been added in version 0.23. """ + def __copy__(self) -> Trans: + r""" + @brief Creates a copy of self + """ def __eq__(self, other: object) -> bool: r""" @brief Tests for equality """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -33108,6 +34169,73 @@ class Trans: @brief Provides a 'less' criterion for sorting This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. """ + @overload + def __mul__(self, box: Box) -> Box: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, edge: Edge) -> Edge: + r""" + Note: This is an alias of 'trans'. + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: Point) -> Point: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, path: Path) -> Path: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: Polygon) -> Polygon: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload def __mul__(self, t: Trans) -> Trans: r""" @brief Returns the concatenated transformation @@ -33117,10 +34245,144 @@ class Trans: @param t The transformation to apply before @return The modified transformation """ + @overload + def __mul__(self, text: Text) -> Text: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, v: Vector) -> Vector: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ def __ne__(self, other: object) -> bool: r""" @brief Tests for inequality """ + def __repr__(self) -> str: + r""" + @brief String conversion + """ + @overload + def __rmul__(self, box: Box) -> Box: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, edge: Edge) -> Edge: + r""" + Note: This is an alias of 'trans'. + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: Point) -> Point: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, path: Path) -> Path: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: Polygon) -> Polygon: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, t: Trans) -> Trans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __rmul__(self, text: Text) -> Text: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, v: Vector) -> Vector: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ def __str__(self) -> str: r""" @brief String conversion @@ -33417,10 +34679,21 @@ class DTrans: This method has been added in version 0.23. """ + def __copy__(self) -> DTrans: + r""" + @brief Creates a copy of self + """ def __eq__(self, other: object) -> bool: r""" @brief Tests for equality """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -33503,6 +34776,73 @@ class DTrans: @brief Provides a 'less' criterion for sorting This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. """ + @overload + def __mul__(self, box: DBox) -> DBox: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, edge: DEdge) -> DEdge: + r""" + Note: This is an alias of 'trans'. + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: DPoint) -> DPoint: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, path: DPath) -> DPath: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: DPolygon) -> DPolygon: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload def __mul__(self, t: DTrans) -> DTrans: r""" @brief Returns the concatenated transformation @@ -33512,10 +34852,144 @@ class DTrans: @param t The transformation to apply before @return The modified transformation """ + @overload + def __mul__(self, text: DText) -> DText: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, v: DVector) -> DVector: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ def __ne__(self, other: object) -> bool: r""" @brief Tests for inequality """ + def __repr__(self) -> str: + r""" + @brief String conversion + """ + @overload + def __rmul__(self, box: DBox) -> DBox: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, edge: DEdge) -> DEdge: + r""" + Note: This is an alias of 'trans'. + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: DPoint) -> DPoint: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, path: DPath) -> DPath: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: DPolygon) -> DPolygon: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, t: DTrans) -> DTrans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __rmul__(self, text: DText) -> DText: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, v: DVector) -> DVector: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ def __str__(self) -> str: r""" @brief String conversion @@ -33812,10 +35286,21 @@ class DCplxTrans: This method has been added in version 0.23. """ + def __copy__(self) -> DCplxTrans: + r""" + @brief Creates a copy of self + """ def __eq__(self, other: object) -> bool: r""" @brief Tests for equality """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -33941,6 +35426,86 @@ class DCplxTrans: This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. """ @overload + def __mul__(self, box: DBox) -> DBox: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, edge: DEdge) -> DEdge: + r""" + Note: This is an alias of 'trans'. + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: DPoint) -> DPoint: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, p: DVector) -> DVector: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __mul__(self, path: DPath) -> DPath: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: DPolygon) -> DPolygon: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload def __mul__(self, t: CplxTrans) -> CplxTrans: r""" @brief Multiplication (concatenation) of transformations @@ -33960,10 +35525,140 @@ class DCplxTrans: @param t The transformation to apply before @return The modified transformation """ + @overload + def __mul__(self, text: DText) -> DText: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ def __ne__(self, other: object) -> bool: r""" @brief Tests for inequality """ + def __repr__(self) -> str: + r""" + @brief String conversion + """ + @overload + def __rmul__(self, box: DBox) -> DBox: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, edge: DEdge) -> DEdge: + r""" + Note: This is an alias of 'trans'. + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: DPoint) -> DPoint: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, p: DVector) -> DVector: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __rmul__(self, path: DPath) -> DPath: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: DPolygon) -> DPolygon: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, t: CplxTrans) -> CplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __rmul__(self, t: DCplxTrans) -> DCplxTrans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __rmul__(self, text: DText) -> DText: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ def __str__(self) -> str: r""" @brief String conversion @@ -34316,10 +36011,21 @@ class CplxTrans: This method has been added in version 0.23. """ + def __copy__(self) -> CplxTrans: + r""" + @brief Creates a copy of self + """ def __eq__(self, other: object) -> bool: r""" @brief Tests for equality """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -34445,6 +36151,86 @@ class CplxTrans: This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. """ @overload + def __mul__(self, box: Box) -> DBox: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, edge: Edge) -> DEdge: + r""" + Note: This is an alias of 'trans'. + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: Point) -> DPoint: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, p: Vector) -> DVector: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __mul__(self, path: Path) -> DPath: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: Polygon) -> DPolygon: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload def __mul__(self, t: CplxTrans) -> CplxTrans: r""" @brief Returns the concatenated transformation @@ -34474,10 +36260,150 @@ class CplxTrans: @param t The transformation to apply before @return The modified transformation """ + @overload + def __mul__(self, text: Text) -> DText: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ def __ne__(self, other: object) -> bool: r""" @brief Tests for inequality """ + def __repr__(self) -> str: + r""" + @brief String conversion + """ + @overload + def __rmul__(self, box: Box) -> DBox: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, edge: Edge) -> DEdge: + r""" + Note: This is an alias of 'trans'. + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: Point) -> DPoint: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, p: Vector) -> DVector: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __rmul__(self, path: Path) -> DPath: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: Polygon) -> DPolygon: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, t: CplxTrans) -> CplxTrans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __rmul__(self, t: ICplxTrans) -> CplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __rmul__(self, t: VCplxTrans) -> DCplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __rmul__(self, text: Text) -> DText: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ def __str__(self) -> str: r""" @brief String conversion @@ -34831,10 +36757,21 @@ class ICplxTrans: This method has been added in version 0.23. """ + def __copy__(self) -> ICplxTrans: + r""" + @brief Creates a copy of self + """ def __eq__(self, other: object) -> bool: r""" @brief Tests for equality """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -34960,6 +36897,86 @@ class ICplxTrans: This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. """ @overload + def __mul__(self, box: Box) -> Box: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, edge: Edge) -> Edge: + r""" + Note: This is an alias of 'trans'. + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: Point) -> Point: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, p: Vector) -> Vector: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __mul__(self, path: Path) -> Path: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: Polygon) -> Polygon: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload def __mul__(self, t: ICplxTrans) -> ICplxTrans: r""" @brief Returns the concatenated transformation @@ -34979,10 +36996,140 @@ class ICplxTrans: @param t The transformation to apply before @return The modified transformation """ + @overload + def __mul__(self, text: Text) -> Text: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ def __ne__(self, other: object) -> bool: r""" @brief Tests for inequality """ + def __repr__(self) -> str: + r""" + @brief String conversion + """ + @overload + def __rmul__(self, box: Box) -> Box: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, edge: Edge) -> Edge: + r""" + Note: This is an alias of 'trans'. + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: Point) -> Point: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, p: Vector) -> Vector: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __rmul__(self, path: Path) -> Path: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: Polygon) -> Polygon: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, t: ICplxTrans) -> ICplxTrans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __rmul__(self, t: VCplxTrans) -> VCplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __rmul__(self, text: Text) -> Text: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ def __str__(self) -> str: r""" @brief String conversion @@ -35338,10 +37485,21 @@ class VCplxTrans: This method has been added in version 0.23. """ + def __copy__(self) -> VCplxTrans: + r""" + @brief Creates a copy of self + """ def __eq__(self, other: object) -> bool: r""" @brief Tests for equality """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ @overload def __init__(self) -> None: r""" @@ -35461,6 +37619,86 @@ class VCplxTrans: This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. """ @overload + def __mul__(self, box: DBox) -> Box: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, edge: DEdge) -> Edge: + r""" + Note: This is an alias of 'trans'. + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: DPoint) -> Point: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, p: DVector) -> Vector: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __mul__(self, path: DPath) -> Path: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: DPolygon) -> Polygon: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload def __mul__(self, t: CplxTrans) -> ICplxTrans: r""" @brief Multiplication (concatenation) of transformations @@ -35490,10 +37728,150 @@ class VCplxTrans: @param t The transformation to apply before @return The modified transformation """ + @overload + def __mul__(self, text: DText) -> Text: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ def __ne__(self, other: object) -> bool: r""" @brief Tests for inequality """ + def __repr__(self) -> str: + r""" + @brief String conversion + """ + @overload + def __rmul__(self, box: DBox) -> Box: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, edge: DEdge) -> Edge: + r""" + Note: This is an alias of 'trans'. + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: DPoint) -> Point: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, p: DVector) -> Vector: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __rmul__(self, path: DPath) -> Path: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: DPolygon) -> Polygon: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, t: CplxTrans) -> ICplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __rmul__(self, t: DCplxTrans) -> VCplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __rmul__(self, t: VCplxTrans) -> VCplxTrans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __rmul__(self, text: DText) -> Text: + r""" + Note: This is an alias of 'trans'. + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ def __str__(self) -> str: r""" @brief String conversion @@ -35747,6 +38125,10 @@ class Utils: This class has been introduced in version 0.27. """ + def __copy__(self) -> Utils: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -35797,21 +38179,21 @@ class Utils: @brief Creates a copy of self """ @overload - def spline_interpolation(self, control_points: Iterable[DPoint], degree: int, knots: Iterable[float], relative_accuracy: float, absolute_accuracy: float) -> Iterable[DPoint]: + def spline_interpolation(self, control_points: Sequence[DPoint], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[DPoint]: r""" @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. This is the version for non-rational splines. It lacks the weight vector. """ @overload - def spline_interpolation(self, control_points: Iterable[Point], degree: int, knots: Iterable[float], relative_accuracy: float, absolute_accuracy: float) -> Iterable[Point]: + def spline_interpolation(self, control_points: Sequence[Point], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[Point]: r""" @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. This is the version for integer-coordinate points for non-rational splines. """ @overload - def spline_interpolation(self, control_points: Iterable[DPoint], weights: Iterable[float], degree: int, knots: Iterable[float], relative_accuracy: float, absolute_accuracy: float) -> Iterable[DPoint]: + def spline_interpolation(self, control_points: Sequence[DPoint], weights: Sequence[float], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[DPoint]: r""" @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. @@ -35833,7 +38215,7 @@ class Utils: The return value is a list of points forming a path which approximates the spline curve. """ @overload - def spline_interpolation(self, control_points: Iterable[Point], weights: Iterable[float], degree: int, knots: Iterable[float], relative_accuracy: float, absolute_accuracy: float) -> Iterable[Point]: + def spline_interpolation(self, control_points: Sequence[Point], weights: Sequence[float], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[Point]: r""" @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. @@ -35882,10 +38264,21 @@ class DVector: Adds vector v to self by adding the coordinates. """ + def __copy__(self) -> DVector: + r""" + @brief Creates a copy of self + """ def __eq__(self, v: object) -> bool: r""" @brief Equality test operator + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given vector. This method enables vectors as hash keys. + + This method has been introduced in version 0.25. """ def __imul__(self, f: float) -> DVector: r""" @@ -35932,6 +38325,7 @@ class DVector: This operator is provided to establish a sorting order """ + @overload def __mul__(self, f: float) -> DVector: r""" @brief Scaling by some factor @@ -35939,6 +38333,14 @@ class DVector: Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. """ + @overload + def __mul__(self, v: DVector) -> float: + r""" + @brief Computes the scalar product between self and the given vector + + + The scalar product of a and b is defined as: vp = ax*bx+ay*by. + """ def __ne__(self, v: object) -> bool: r""" @brief Inequality test operator @@ -35951,6 +38353,26 @@ class DVector: Returns a new vector with -x,-y. """ + def __repr__(self) -> str: + r""" + @brief String conversion + """ + @overload + def __rmul__(self, f: float) -> DVector: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + @overload + def __rmul__(self, v: DVector) -> float: + r""" + @brief Computes the scalar product between self and the given vector + + + The scalar product of a and b is defined as: vp = ax*bx+ay*by. + """ def __str__(self) -> str: r""" @brief String conversion @@ -36006,6 +38428,12 @@ class DVector: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def abs(self) -> float: + r""" + Note: This is an alias of 'length'. + @brief Returns the length of the vector + 'abs' is an alias provided for compatibility with the former point type. + """ def assign(self, other: DVector) -> None: r""" @brief Assigns another object to self @@ -36040,6 +38468,12 @@ class DVector: @return 1 if the scalar product is positive, 0 if it is zero and -1 if it is negative. """ + def sq_abs(self) -> float: + r""" + Note: This is an alias of 'sq_length'. + @brief The square length of the vector + 'sq_abs' is an alias provided for compatibility with the former point type. + """ def sq_length(self) -> float: r""" @brief The square length of the vector @@ -36118,10 +38552,21 @@ class Vector: Adds vector v to self by adding the coordinates. """ + def __copy__(self) -> Vector: + r""" + @brief Creates a copy of self + """ def __eq__(self, v: object) -> bool: r""" @brief Equality test operator + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given vector. This method enables vectors as hash keys. + + This method has been introduced in version 0.25. """ def __imul__(self, f: float) -> Vector: r""" @@ -36168,6 +38613,7 @@ class Vector: This operator is provided to establish a sorting order """ + @overload def __mul__(self, f: float) -> Vector: r""" @brief Scaling by some factor @@ -36175,6 +38621,14 @@ class Vector: Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. """ + @overload + def __mul__(self, v: Vector) -> int: + r""" + @brief Computes the scalar product between self and the given vector + + + The scalar product of a and b is defined as: vp = ax*bx+ay*by. + """ def __ne__(self, v: object) -> bool: r""" @brief Inequality test operator @@ -36187,6 +38641,26 @@ class Vector: Returns a new vector with -x,-y. """ + def __repr__(self) -> str: + r""" + @brief String conversion + """ + @overload + def __rmul__(self, f: float) -> Vector: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + @overload + def __rmul__(self, v: Vector) -> int: + r""" + @brief Computes the scalar product between self and the given vector + + + The scalar product of a and b is defined as: vp = ax*bx+ay*by. + """ def __str__(self) -> str: r""" @brief String conversion @@ -36242,6 +38716,12 @@ class Vector: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def abs(self) -> float: + r""" + Note: This is an alias of 'length'. + @brief Returns the length of the vector + 'abs' is an alias provided for compatibility with the former point type. + """ def assign(self, other: Vector) -> None: r""" @brief Assigns another object to self @@ -36276,6 +38756,12 @@ class Vector: @return 1 if the scalar product is positive, 0 if it is zero and -1 if it is negative. """ + def sq_abs(self) -> float: + r""" + Note: This is an alias of 'sq_length'. + @brief The square length of the vector + 'sq_abs' is an alias provided for compatibility with the former point type. + """ def sq_length(self) -> float: r""" @brief The square length of the vector @@ -36419,7 +38905,7 @@ class LEFDEFReaderConfiguration: The setter is \layer_map=. \create_other_layers= is available to control whether layers not specified in the layer mapping table shall be created automatically.@brief Sets the layer map to be used for the LEF/DEF reader See \layer_map for details. """ - lef_files: Iterable[str] + lef_files: List[str] r""" @brief Gets the list technology LEF files to additionally import Returns a list of path names for technology LEF files to read in addition to the primary file. Relative paths are resolved relative to the file to read or relative to the technology base path. @@ -36469,7 +38955,7 @@ class LEFDEFReaderConfiguration: r""" @hide@hide """ - macro_layout_files: Iterable[str] + macro_layout_files: List[str] r""" @brief Gets the list of layout files to read for substituting macros in DEF These files play the same role than the macro layouts (see \macro_layouts), except that this property specifies a list of file names. The given files are loaded automatically to resolve macro layouts instead of LEF geometry. See \macro_resolution_mode for details when this happens. Relative paths are resolved relative to the DEF file to read or relative to the technology base path. @@ -36484,7 +38970,7 @@ class LEFDEFReaderConfiguration: This property has been added in version 0.27.1. """ - macro_layouts: Iterable[Layout] + macro_layouts: List[Layout] r""" @brief Gets the layout objects used for resolving LEF macros in the DEF reader. The DEF reader can either use LEF geometry or use a separate source of layouts for the LEF macros. The \macro_resolution_mode controls whether to use LEF geometry. If LEF geometry is not used, the DEF reader will look up macro cells from the \macro_layouts and pull cell layouts from there. @@ -36812,6 +39298,10 @@ class LEFDEFReaderConfiguration: r""" @hide@hide """ + def __copy__(self) -> LEFDEFReaderConfiguration: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -37146,6 +39636,10 @@ class NetTracerTechnology(TechnologyComponent): This class has been introduced in version 0.25. """ + def __copy__(self) -> NetTracerTechnology: + r""" + @brief Creates a copy of self + """ def _create(self) -> None: r""" @brief Ensures the C++ object is created @@ -37223,6 +39717,10 @@ class NetElement: This class has been introduced in version 0.25. """ + def __copy__(self) -> NetElement: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -37335,6 +39833,10 @@ class NetTracer: This method has been introduced in version 0.26.4. """ + def __copy__(self) -> NetTracer: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -37388,7 +39890,7 @@ class NetTracer: r""" @brief Creates a copy of self """ - def each_element(self) -> Iterable[NetElement]: + def each_element(self) -> Iterator[NetElement]: r""" @brief Iterates over the elements found during extraction The elements are available only after the extraction has been performed. diff --git a/src/pymod/distutils_src/klayout/rdbcore.pyi b/src/pymod/distutils_src/klayout/rdbcore.pyi index 60c7b4e07..9e63c2908 100644 --- a/src/pymod/distutils_src/klayout/rdbcore.pyi +++ b/src/pymod/distutils_src/klayout/rdbcore.pyi @@ -1,4 +1,4 @@ -from typing import Any, ClassVar, Dict, Iterable, Optional +from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional from typing import overload import klayout.db as db class RdbReference: @@ -19,6 +19,10 @@ class RdbReference: @return The transformation @brief Sets the transformation for this reference """ + def __copy__(self) -> RdbReference: + r""" + @brief Creates a copy of self + """ def __init__(self, trans: db.DCplxTrans, parent_cell_id: int) -> None: r""" @brief Creates a reference with a given transformation and parent cell ID @@ -136,13 +140,13 @@ class RdbCell: This method has been introduced in version 0.23. """ - def each_item(self) -> Iterable[RdbItem]: + def each_item(self) -> Iterator[RdbItem]: r""" @brief Iterates over all items inside the database which are associated with this cell This method has been introduced in version 0.23. """ - def each_reference(self) -> Iterable[RdbReference]: + def each_reference(self) -> Iterator[RdbReference]: r""" @brief Iterates over all references """ @@ -236,13 +240,13 @@ class RdbCategory: This method has been introduced in version 0.23. """ - def each_item(self) -> Iterable[RdbItem]: + def each_item(self) -> Iterator[RdbItem]: r""" @brief Iterates over all items inside the database which are associated with this category This method has been introduced in version 0.23. """ - def each_sub_category(self) -> Iterable[RdbCategory]: + def each_sub_category(self) -> Iterator[RdbCategory]: r""" @brief Iterates over all sub-categories """ @@ -368,6 +372,10 @@ class RdbItemValue: This variant has been introduced in version 0.24 """ + def __copy__(self) -> RdbItemValue: + r""" + @brief Creates a copy of self + """ @overload def __init__(self, b: db.DBox) -> None: r""" @@ -414,6 +422,12 @@ class RdbItemValue: This method has been introduced in version 0.22. """ + def __repr__(self) -> str: + r""" + @brief Converts a value to a string + The string can be used by the string constructor to create another object from it. + @return The string + """ def __str__(self) -> str: r""" @brief Converts a value to a string @@ -696,7 +710,7 @@ class RdbItem: This method has been introduced in version 0.23. """ - def each_value(self) -> Iterable[RdbItemValue]: + def each_value(self) -> Iterator[RdbItemValue]: r""" @brief Iterates over all values """ @@ -892,7 +906,7 @@ class ReportDatabase: @param iter The iterator (a \RecursiveShapeIterator object) from which to take the items """ @overload - def create_items(self, cell_id: int, category_id: int, trans: db.CplxTrans, array: Iterable[db.EdgePair]) -> None: + def create_items(self, cell_id: int, category_id: int, trans: db.CplxTrans, array: Sequence[db.EdgePair]) -> None: r""" @brief Creates new edge pair items for the given cell/category combination For each edge pair a single item will be created. The value of the item will be this edge pair. @@ -906,7 +920,7 @@ class ReportDatabase: @param edge_pairs The list of edge_pairs for which the items are created """ @overload - def create_items(self, cell_id: int, category_id: int, trans: db.CplxTrans, array: Iterable[db.Edge]) -> None: + def create_items(self, cell_id: int, category_id: int, trans: db.CplxTrans, array: Sequence[db.Edge]) -> None: r""" @brief Creates new edge items for the given cell/category combination For each edge a single item will be created. The value of the item will be this edge. @@ -920,7 +934,7 @@ class ReportDatabase: @param edges The list of edges for which the items are created """ @overload - def create_items(self, cell_id: int, category_id: int, trans: db.CplxTrans, array: Iterable[db.Polygon]) -> None: + def create_items(self, cell_id: int, category_id: int, trans: db.CplxTrans, array: Sequence[db.Polygon]) -> None: r""" @brief Creates new polygon items for the given cell/category combination For each polygon a single item will be created. The value of the item will be this polygon. @@ -995,29 +1009,29 @@ class ReportDatabase: @param shapes The shape container from which to take the items @param trans The transformation to apply """ - def each_category(self) -> Iterable[RdbCategory]: + def each_category(self) -> Iterator[RdbCategory]: r""" @brief Iterates over all top-level categories """ - def each_cell(self) -> Iterable[RdbCell]: + def each_cell(self) -> Iterator[RdbCell]: r""" @brief Iterates over all cells """ - def each_item(self) -> Iterable[RdbItem]: + def each_item(self) -> Iterator[RdbItem]: r""" @brief Iterates over all items inside the database """ - def each_item_per_category(self, category_id: int) -> Iterable[RdbItem]: + def each_item_per_category(self, category_id: int) -> Iterator[RdbItem]: r""" @brief Iterates over all items inside the database which are associated with the given category @param category_id The ID of the category for which all associated items should be retrieved """ - def each_item_per_cell(self, cell_id: int) -> Iterable[RdbItem]: + def each_item_per_cell(self, cell_id: int) -> Iterator[RdbItem]: r""" @brief Iterates over all items inside the database which are associated with the given cell @param cell_id The ID of the cell for which all associated items should be retrieved """ - def each_item_per_cell_and_category(self, cell_id: int, category_id: int) -> Iterable[RdbItem]: + def each_item_per_cell_and_category(self, cell_id: int, category_id: int) -> Iterator[RdbItem]: r""" @brief Iterates over all items inside the database which are associated with the given cell and category @param cell_id The ID of the cell for which all associated items should be retrieved @@ -1129,7 +1143,7 @@ class ReportDatabase: This method has been added in version 0.24. """ - def variants(self, name: str) -> Iterable[int]: + def variants(self, name: str) -> List[int]: r""" @brief Gets the variants for a given cell name @param name The basic name of the cell diff --git a/src/pymod/distutils_src/klayout/tlcore.pyi b/src/pymod/distutils_src/klayout/tlcore.pyi index 0a788920a..3fdb16922 100644 --- a/src/pymod/distutils_src/klayout/tlcore.pyi +++ b/src/pymod/distutils_src/klayout/tlcore.pyi @@ -1,8 +1,12 @@ -from typing import Any, ClassVar, Dict, Iterable, Optional +from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional from typing import overload class EmptyClass: r""" """ + def __copy__(self) -> EmptyClass: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -64,6 +68,10 @@ class Value: @brief Gets the actual value. @brief Set the actual value. """ + def __copy__(self) -> Value: + r""" + @brief Creates a copy of self + """ @overload def __init__(self) -> None: r""" @@ -75,6 +83,10 @@ class Value: @brief Constructs a non-nil object with the given value. This constructor has been introduced in version 0.22. """ + def __repr__(self) -> str: + r""" + @brief Convert this object to a string + """ def __str__(self) -> str: r""" @brief Convert this object to a string @@ -148,14 +160,16 @@ class Interpreter: This class was introduced in version 0.27.5. """ - python_interpreter: ClassVar[Interpreter] - r""" - @brief Gets the instance of the Python interpreter - """ - ruby_interpreter: ClassVar[Interpreter] - r""" - @brief Gets the instance of the Ruby interpreter - """ + @classmethod + def python_interpreter(cls) -> Interpreter: + r""" + @brief Gets the instance of the Python interpreter + """ + @classmethod + def ruby_interpreter(cls) -> Interpreter: + r""" + @brief Gets the instance of the Ruby interpreter + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -279,6 +293,10 @@ class ArgType: TypeVoidPtr: ClassVar[int] r""" """ + def __copy__(self) -> ArgType: + r""" + @brief Creates a copy of self + """ def __eq__(self, arg0: object) -> bool: r""" @brief Equality of two types @@ -291,6 +309,10 @@ class ArgType: r""" @brief Inequality of two types """ + def __repr__(self) -> str: + r""" + @brief Convert to a string + """ def __str__(self) -> str: r""" @brief Convert to a string @@ -413,6 +435,10 @@ class MethodOverload: r""" @hide """ + def __copy__(self) -> MethodOverload: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -539,11 +565,11 @@ class Method: r""" @brief The documentation string for this method """ - def each_argument(self) -> Iterable[ArgType]: + def each_argument(self) -> Iterator[ArgType]: r""" @brief Iterate over all arguments of this method """ - def each_overload(self) -> Iterable[MethodOverload]: + def each_overload(self) -> Iterator[MethodOverload]: r""" @brief This iterator delivers the synonyms (overloads). @@ -608,10 +634,11 @@ class Class: r""" @hide """ - each_class: ClassVar[Iterable[Class]] - r""" - @brief Iterate over all classes - """ + @classmethod + def each_class(cls) -> Iterator[Class]: + r""" + @brief Iterate over all classes + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -673,11 +700,11 @@ class Class: r""" @brief The documentation string for this class """ - def each_child_class(self) -> Iterable[Class]: + def each_child_class(self) -> Iterator[Class]: r""" @brief Iterate over all child classes defined within this class """ - def each_method(self) -> Iterable[Method]: + def each_method(self) -> Iterator[Method]: r""" @brief Iterate over all methods of this class """ @@ -801,16 +828,25 @@ class Timer: This class has been introduced in version 0.23. """ - memory_size: ClassVar[int] - r""" - @brief Gets the current memory usage of the process in Bytes + @classmethod + def memory_size(cls) -> int: + r""" + @brief Gets the current memory usage of the process in Bytes - This method has been introduced in version 0.27. - """ + This method has been introduced in version 0.27. + """ + def __copy__(self) -> Timer: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class """ + def __repr__(self) -> str: + r""" + @brief Produces a string with the currently elapsed times + """ def __str__(self) -> str: r""" @brief Produces a string with the currently elapsed times @@ -1229,6 +1265,10 @@ class ExpressionContext: This class has been introduced in version 0.26 when \Expression was separated into the execution and context part. """ + def __copy__(self) -> ExpressionContext: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -1384,6 +1424,10 @@ class GlobPattern: @brief Sets a value indicating whether trailing characters are allowed. If this predicate is false, the glob pattern needs to match the full subject string. If true, the match function will ignore trailing characters and return true if the front part of the subject string matches. """ + def __copy__(self) -> GlobPattern: + r""" + @brief Creates a copy of self + """ def __init__(self, pattern: str) -> None: r""" @brief Creates a new glob pattern match object @@ -1444,6 +1488,10 @@ class ExecutableBase: @hide @alias Executable """ + def __copy__(self) -> ExecutableBase: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class diff --git a/src/pymod/stubgen.py b/src/pymod/stubgen.py index e570b3177..7f603e742 100644 --- a/src/pymod/stubgen.py +++ b/src/pymod/stubgen.py @@ -192,7 +192,9 @@ _type_dict[ktl.ArgType.TypeVoid] = "None" _type_dict[ktl.ArgType.TypeVoidPtr] = "None" -def _translate_type(arg_type: ktl.ArgType, within_class: ktl.Class) -> str: +def _translate_type( + arg_type: ktl.ArgType, within_class: ktl.Class, is_return=False +) -> str: """Translates klayout's C-type to a type in Python. This function is equivalent to the `type_to_s` in `pyaModule.cc`. @@ -205,16 +207,19 @@ def _translate_type(arg_type: ktl.ArgType, within_class: ktl.Class) -> str: else: py_str = qualified_name(arg_type.cls()) elif arg_type.type() == ktl.ArgType.TypeMap: - inner_key = _translate_type(arg_type.inner_k(), within_class) - inner_val = _translate_type(arg_type.inner(), within_class) + inner_key = _translate_type(arg_type.inner_k(), within_class, is_return) + inner_val = _translate_type(arg_type.inner(), within_class, is_return) py_str = f"Dict[{inner_key}, {inner_val}]" elif arg_type.type() == ktl.ArgType.TypeVector: - py_str = f"Iterable[{_translate_type(arg_type.inner(), within_class)}]" + if is_return: + py_str = f"List[{_translate_type(arg_type.inner(), within_class, is_return)}]" + else: + py_str = f"Sequence[{_translate_type(arg_type.inner(), within_class, is_return)}]" else: py_str = _type_dict[arg_type.type()] if arg_type.is_iter(): - py_str = f"Iterable[{py_str}]" + py_str = f"Iterator[{py_str}]" if arg_type.has_default(): py_str = f"Optional[{py_str}] = ..." return py_str @@ -324,7 +329,7 @@ def get_c_methods(c: ktl.Class) -> List[_Method]: for ms in m.each_overload(): if ms.name() == m.primary_name(): return ms - raise ("Primary synonym not found for method " + m.name()) + raise RuntimeError("Primary synonym not found for method " + m.name()) for m in c.each_method(): if m.is_signal(): @@ -346,17 +351,35 @@ def get_c_methods(c: ktl.Class) -> List[_Method]: ) is_setter = (num_args == 1) and method_def.is_setter() is_classvar = (num_args == 0) and (m.is_static() and not m.is_constructor()) - method_list.append( - _Method( - name=method_def.name(), - is_setter=is_setter, - is_getter=is_getter or is_classvar, - is_classmethod=m.is_constructor(), - is_classvar=is_classvar, - doc=m.doc(), - m=m, + is_const = m.is_const() + + # static methods without arguments which start with a capital letter are treated as constants + # (rule from pyaModule.cc) + if is_classvar and m.name()[0].isupper(): + is_getter = True + + for method_synonym in m.each_overload(): + if method_synonym.deprecated(): + # method synonyms that start with # (pound) sign + continue + if method_synonym.name() == method_def.name(): + doc = m.doc() + else: + doc = ( + f"Note: This is an alias of '{translate_methodname(method_def.name())}'.\n" + + m.doc() + ) + method_list.append( + _Method( + name=method_synonym.name(), + is_setter=is_setter, + is_getter=is_getter, + is_classmethod=m.is_constructor() or is_classvar, + is_classvar=is_classvar, + doc=doc, + m=m, + ) ) - ) # print(f"{m.name()}: {m.is_static()=}, {m.is_constructor()=}, {m.is_const_object()=}") return method_list @@ -364,7 +387,7 @@ def get_c_methods(c: ktl.Class) -> List[_Method]: def get_py_child_classes(c: ktl.Class): for c_child in c.each_child_class(): - return c_child + yield c_child def get_py_methods( @@ -390,10 +413,13 @@ def get_py_methods( return m return None - translate_type = functools.partial(_translate_type, within_class=c) + translate_arg_type = functools.partial(_translate_type, within_class=c, is_return=False) + translate_ret_type = functools.partial(_translate_type, within_class=c, is_return=True) - def _get_arglist(m: ktl.Method, self_str) -> List[Tuple[str, ktl.ArgType]]: - args = [(self_str, None)] + def _get_arglist( + m: ktl.Method, self_str: str + ) -> List[Tuple[str, Optional[ktl.ArgType]]]: + args: List[Tuple[str, Optional[ktl.ArgType]]] = [(self_str, None)] for i, a in enumerate(m.each_argument()): argname = a.name() if is_reserved_word(argname): @@ -417,7 +443,7 @@ def get_py_methods( new_arglist: List[Tuple[str, Optional[str]]] = [] for argname, a in arg_list: if a: - new_arglist.append((argname, translate_type(a))) + new_arglist.append((argname, translate_arg_type(a))) else: new_arglist.append((argname, None)) return _format_args(new_arglist) @@ -425,7 +451,7 @@ def get_py_methods( # Extract all properties (methods that have getters and/or setters) properties: List[Stub] = list() for m in copy(_c_methods): - ret_type = translate_type(m.m.ret_type()) + ret_type = translate_ret_type(m.m.ret_type()) if m.is_getter: m_setter = find_setter(c_methods, m.name) if m_setter is not None: # full property @@ -476,10 +502,27 @@ def get_py_methods( if m.is_setter: _c_methods.remove(m) - def get_altnames(c_name: str): + def get_altnames(c_name: str, m: _Method): + args = list(m.m.each_argument()) + ret = m.m.ret_type() + num_args = len(args) names = [c_name] - if c_name == "to_s": + if c_name == "to_s" and num_args == 0: names.append("__str__") + # Only works if GSI_ALIAS_INSPECT is activated + names.append("__repr__") + elif c_name == "hash" and num_args == 0: + names.append("__hash__") + elif c_name == "inspect" and num_args == 0: + names.append("__repr__") + elif c_name == "size" and num_args == 0: + names.append("__len__") + elif c_name == "each" and num_args == 0 and ret.is_iter(): + names.append("__iter__") + elif c_name == "__mul__" and "Trans" not in c_name: + names.append("__rmul__") + elif c_name == "dup" and num_args == 0: + names.append("__copy__") return names # Extract all classmethods @@ -491,8 +534,8 @@ def get_py_methods( if translate_methodname(m.name) == "__init__": continue decorator = "@classmethod" - ret_type = translate_type(m.m.ret_type()) - for name in get_altnames(m.name): + ret_type = translate_ret_type(m.m.ret_type()) + for name in get_altnames(m.name, m): classmethods.append( MethodStub( decorator=decorator, @@ -515,9 +558,10 @@ def get_py_methods( if translated_name == "__init__": ret_type = "None" else: - ret_type = translate_type(m.m.ret_type()) + ret_type = translate_ret_type(m.m.ret_type()) arg_list = _get_arglist(m.m, "self") + # TODO: fix type errors # Exceptions: # For X.__eq__(self, a:X), treat second argument as type object instead of X if translated_name in ("__eq__", "__ne__"): @@ -525,19 +569,20 @@ def get_py_methods( # X._assign(self, other:X), mypy complains if _assign is defined at base class. # We can't specialize other in this case. elif translated_name in ("_assign", "assign"): + assert arg_list[1][1] is not None assert arg_list[1][1].type() == ktl.ArgType.TypeObject arg_list[1] = arg_list[1][0], superclass(arg_list[1][1].cls()) else: new_arg_list = [] for argname, a in arg_list: if a: - new_arg_list.append((argname, translate_type(a))) + new_arg_list.append((argname, translate_arg_type(a))) else: new_arg_list.append((argname, a)) arg_list = new_arg_list formatted_args = _format_args(arg_list) - for name in get_altnames(translated_name): + for name in get_altnames(translated_name, m): boundmethods.append( MethodStub( decorator=decorator, @@ -595,6 +640,7 @@ def get_class_stub( _cstub.child_stubs.append(stub) return _cstub + def get_classes(module: str) -> List[ktl.Class]: _classes = [] for c in ktl.Class.each_class(): @@ -603,7 +649,8 @@ def get_classes(module: str) -> List[ktl.Class]: _classes.append(c) return _classes -def get_module_stubs(module:str) -> List[ClassStub]: + +def get_module_stubs(module: str) -> List[ClassStub]: _stubs = [] _classes = get_classes(module) for c in _classes: @@ -613,7 +660,7 @@ def get_module_stubs(module:str) -> List[ClassStub]: def print_db(): - print("from typing import Any, ClassVar, Dict, Iterable, Optional") + print("from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional") print("from typing import overload") print("import klayout.rdb as rdb") print("import klayout.tl as tl") @@ -622,14 +669,15 @@ def print_db(): def print_rdb(): - print("from typing import Any, ClassVar, Dict, Iterable, Optional") + print("from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional") print("from typing import overload") print("import klayout.db as db") for stub in get_module_stubs("rdb"): print(stub.format_stub(include_docstring=True) + "\n") + def print_tl(): - print("from typing import Any, ClassVar, Dict, Iterable, Optional") + print("from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional") print("from typing import overload") for stub in get_module_stubs("tl"): print(stub.format_stub(include_docstring=True) + "\n") diff --git a/src/tl/tl/tlException.h b/src/tl/tl/tlException.h index ecde47d9b..2b8295c34 100644 --- a/src/tl/tl/tlException.h +++ b/src/tl/tl/tlException.h @@ -36,13 +36,13 @@ namespace tl /** * @brief The unspecific exception class * - * This class is the base class for all exceptions in this - * framework. It does not carry further information except - * a message string that can be created through different + * This class is the base class for all exceptions in this + * framework. It does not carry further information except + * a message string that can be created through different * constructor methods. */ -class TL_PUBLIC Exception +class TL_PUBLIC Exception { public: Exception (const std::string &msg) @@ -169,6 +169,15 @@ private: void init (const std::string &fmt, const std::vector &a); }; +/** + * @brief An exception thrown when the wrong type is provided as argument. + */ +struct TL_PUBLIC TypeError + : public Exception +{ + using Exception::Exception; +}; + /** * @brief A "neutral" exception thrown to terminate some operation * This exception is not shown. @@ -195,4 +204,3 @@ struct TL_PUBLIC InternalException } // namespace tl #endif - diff --git a/testdata/pymod/import_db.py b/testdata/pymod/import_db.py index 1a5b0a9f1..aa88e8221 100755 --- a/testdata/pymod/import_db.py +++ b/testdata/pymod/import_db.py @@ -41,6 +41,19 @@ class BasicTest(unittest.TestCase): v.read(os.path.join(os.path.dirname(__file__), "..", "gds", "t10.gds")) self.assertEqual(v.top_cell().name, "RINGO") + def test_4(self): + class RMulObject: + def __init__(self, factor): + self.factor = factor + def __rmul__(self, point): + return point * self.factor + def __radd__(self, point): + return point + db.Vector(1,1) * self.factor + + p = db.Point(1, 0) + fac2 = RMulObject(2) + self.assertEqual(p * 2, p * fac2) # p.__mul__(fac2) should return NotImplemented, which will call fac2.__rmul__(p) + self.assertEqual(db.Point(3,2), p + fac2) # run unit tests if __name__ == '__main__': suite = unittest.TestSuite() @@ -48,5 +61,3 @@ if __name__ == '__main__': if not unittest.TextTestRunner(verbosity = 1).run(suite).wasSuccessful(): sys.exit(1) - - From fbd4c84d8440c3a34051b6be4fb6473423e5c899 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Thu, 20 Oct 2022 23:26:14 +0200 Subject: [PATCH 02/15] Refactoring of pya/rba/expressions Goal is to support "*!" which is a variant of multiplication without the commutative nature. The refactoring yields a more consistent handling of Python specializations. Now this happens when the methods are collected, rather than later. This way, specific behavior for identically named synonyms can be implemented for example. This is the case for the "*" operator in Trans which is partially commutative and partially not. --- setup.py | 2 +- src/db/db/gsiDeclDbTrans.cc | 16 +- src/gsi/gsi/gsiExpression.cc | 3 + src/gsi/gsi/gsiMethods.cc | 2 +- src/gsi/unit_tests/gsiExpressionTests.cc | 9 + src/lay/lay/layGSIHelpProvider.cc | 2 + src/pya/pya/pyaModule.cc | 1399 +++++++++++----------- src/rba/rba/rba.cc | 15 +- 8 files changed, 766 insertions(+), 682 deletions(-) diff --git a/setup.py b/setup.py index d2e3e70c5..8e20b62c4 100644 --- a/setup.py +++ b/setup.py @@ -932,5 +932,5 @@ if __name__ == "__main__": include_package_data=True, ext_modules=[_tl, _gsi, _pya, _rba, _db, _lib, _rdb, _lym, _laybasic, _layview, _ant, _edt, _img] + db_plugins - + [tl, db, lib, rdb, lay]) + + [tl, db, lib, rdb, lay] ) diff --git a/src/db/db/gsiDeclDbTrans.cc b/src/db/db/gsiDeclDbTrans.cc index a6bfe92c7..e5101eaf8 100644 --- a/src/db/db/gsiDeclDbTrans.cc +++ b/src/db/db/gsiDeclDbTrans.cc @@ -304,7 +304,7 @@ struct trans_defs "\n" "This convenience method has been introduced in version 0.25." ) + - method ("*", &C::concat, arg ("t"), + method ("*!", &C::concat, arg ("t"), "@brief Returns the concatenated transformation\n" "\n" "The * operator returns self*t (\"t is applied before this transformation\").\n" @@ -829,7 +829,7 @@ struct cplx_trans_defs "\n" "This convenience method has been introduced in version 0.25." ) + - method ("*", (C (C::*) (const C &c) const) &C::concat_same, arg ("t"), + method ("*!", (C (C::*) (const C &c) const) &C::concat_same, arg ("t"), "@brief Returns the concatenated transformation\n" "\n" "The * operator returns self*t (\"t is applied before this transformation\").\n" @@ -1047,7 +1047,7 @@ Class decl_DCplxTrans ("db", "DCplxTrans", "\n" "This method has been introduced in version 0.25." ) + - method ("*", (db::CplxTrans (db::DCplxTrans::*) (const db::CplxTrans &) const) &db::DCplxTrans::concat, gsi::arg ("t"), + method ("*!", (db::CplxTrans (db::DCplxTrans::*) (const db::CplxTrans &) const) &db::DCplxTrans::concat, gsi::arg ("t"), "@brief Multiplication (concatenation) of transformations\n" "\n" "The * operator returns self*t (\"t is applied before this transformation\").\n" @@ -1126,7 +1126,7 @@ Class decl_CplxTrans ("db", "CplxTrans", "\n" "This method has been introduced in version 0.25." ) + - method ("*", (db::DCplxTrans (db::CplxTrans::*) (const db::VCplxTrans &) const) &db::CplxTrans::concat, gsi::arg ("t"), + method ("*!", (db::DCplxTrans (db::CplxTrans::*) (const db::VCplxTrans &) const) &db::CplxTrans::concat, gsi::arg ("t"), "@brief Multiplication (concatenation) of transformations\n" "\n" "The * operator returns self*t (\"t is applied before this transformation\").\n" @@ -1134,7 +1134,7 @@ Class decl_CplxTrans ("db", "CplxTrans", "@param t The transformation to apply before\n" "@return The modified transformation\n" ) + - method ("*", (db::CplxTrans (db::CplxTrans::*) (const db::ICplxTrans &) const) &db::CplxTrans::concat, gsi::arg ("t"), + method ("*!", (db::CplxTrans (db::CplxTrans::*) (const db::ICplxTrans &) const) &db::CplxTrans::concat, gsi::arg ("t"), "@brief Multiplication (concatenation) of transformations\n" "\n" "The * operator returns self*t (\"t is applied before this transformation\").\n" @@ -1216,7 +1216,7 @@ Class decl_ICplxTrans ("db", "ICplxTrans", "\n" "This method has been introduced in version 0.25." ) + - method ("*", (db::VCplxTrans (db::ICplxTrans::*) (const db::VCplxTrans &) const) &db::ICplxTrans::concat, gsi::arg ("t"), + method ("*!", (db::VCplxTrans (db::ICplxTrans::*) (const db::VCplxTrans &) const) &db::ICplxTrans::concat, gsi::arg ("t"), "@brief Multiplication (concatenation) of transformations\n" "\n" "The * operator returns self*t (\"t is applied before this transformation\").\n" @@ -1288,7 +1288,7 @@ Class decl_VCplxTrans ("db", "VCplxTrans", "\n" "This method has been introduced in version 0.25." ) + - method ("*", (db::VCplxTrans (db::VCplxTrans::*) (const db::DCplxTrans &) const) &db::VCplxTrans::concat, gsi::arg ("t"), + method ("*!", (db::VCplxTrans (db::VCplxTrans::*) (const db::DCplxTrans &) const) &db::VCplxTrans::concat, gsi::arg ("t"), "@brief Multiplication (concatenation) of transformations\n" "\n" "The * operator returns self*t (\"t is applied before this transformation\").\n" @@ -1296,7 +1296,7 @@ Class decl_VCplxTrans ("db", "VCplxTrans", "@param t The transformation to apply before\n" "@return The modified transformation\n" ) + - method ("*", (db::ICplxTrans (db::VCplxTrans::*) (const db::CplxTrans &) const) &db::VCplxTrans::concat, gsi::arg ("t"), + method ("*!", (db::ICplxTrans (db::VCplxTrans::*) (const db::CplxTrans &) const) &db::VCplxTrans::concat, gsi::arg ("t"), "@brief Multiplication (concatenation) of transformations\n" "\n" "The * operator returns self*t (\"t is applied before this transformation\").\n" diff --git a/src/gsi/gsi/gsiExpression.cc b/src/gsi/gsi/gsiExpression.cc index abda57030..1254e519e 100644 --- a/src/gsi/gsi/gsiExpression.cc +++ b/src/gsi/gsi/gsiExpression.cc @@ -199,6 +199,9 @@ private: for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { if (syn->is_setter) { add_method (syn->name + "=", *m); + } else if (syn->name == "*!") { + // non-commutative multiplication + add_method ("*", *m); } else { add_method (syn->name, *m); } diff --git a/src/gsi/gsi/gsiMethods.cc b/src/gsi/gsi/gsiMethods.cc index f49813aeb..4350565dc 100644 --- a/src/gsi/gsi/gsiMethods.cc +++ b/src/gsi/gsi/gsiMethods.cc @@ -85,7 +85,7 @@ void MethodBase::parse_name (const std::string &name) { const char *n = name.c_str (); - if (*n == '*' && n[1] && n[1] != '*' && n[1] != '=') { + if (*n == '*' && n[1] && n[1] != '*' && n[1] != '!' && n[1] != '=') { m_protected = true; ++n; } diff --git a/src/gsi/unit_tests/gsiExpressionTests.cc b/src/gsi/unit_tests/gsiExpressionTests.cc index ac47b9a3e..1fdd8fb2e 100644 --- a/src/gsi/unit_tests/gsiExpressionTests.cc +++ b/src/gsi/unit_tests/gsiExpressionTests.cc @@ -589,3 +589,12 @@ TEST(10) EXPECT_EQ (v.to_string (), std::string ("2")); } +TEST(11) +{ + tl::Eval e; + tl::Variant v; + + // mapping of *! to *: + v = e.parse ("var b = Trans.new(1)*Trans.new(Vector.new(10, 20))").execute (); + EXPECT_EQ (v.to_string (), std::string ("r90 -20,10")); +} diff --git a/src/lay/lay/layGSIHelpProvider.cc b/src/lay/lay/layGSIHelpProvider.cc index 280220dc8..670833917 100644 --- a/src/lay/lay/layGSIHelpProvider.cc +++ b/src/lay/lay/layGSIHelpProvider.cc @@ -149,6 +149,8 @@ full_name (const gsi::MethodBase::MethodSynonym &syn) return syn.name + "?"; } else if (syn.is_setter) { return syn.name + "="; + } else if (syn.name == "*!") { + return "*"; } else { return syn.name; } diff --git a/src/pya/pya/pyaModule.cc b/src/pya/pya/pyaModule.cc index ac5de2ffb..7f54cc25f 100644 --- a/src/pya/pya/pyaModule.cc +++ b/src/pya/pya/pyaModule.cc @@ -37,416 +37,6 @@ namespace pya { -// ------------------------------------------------------------------- -// The lookup table for the method overload resolution - -/** - * @brief A single entry in the method table - * This class provides an entry for one name. It provides flags - * (ctor, static, protected) for the method and a list of implementations - * (gsi::MethodBase objects) - */ -class MethodTableEntry -{ -public: - typedef std::vector::const_iterator method_iterator; - - MethodTableEntry (const std::string &name, bool st, bool prot) - : m_name (name), m_is_static (st), m_is_protected (prot) - { } - - const std::string &name () const - { - return m_name; - } - - bool is_static () const - { - return m_is_static; - } - - bool is_protected () const - { - return m_is_protected; - } - - void add (const gsi::MethodBase *m) - { - m_methods.push_back (m); - } - - void finish () - { - // remove duplicate entries in the method list - std::vector m = m_methods; - std::sort(m.begin (), m.end ()); - m_methods.assign (m.begin (), std::unique (m.begin (), m.end ())); - } - - method_iterator begin () const - { - return m_methods.begin (); - } - - method_iterator end () const - { - return m_methods.end (); - } - -private: - std::string m_name; - bool m_is_static : 1; - bool m_is_protected : 1; - std::vector m_methods; -}; - -/** - * @brief The method table for a class - * The method table will provide the methods associated with a native method, i.e. - * a certain name. It only provides the methods, not a overload resolution strategy. - */ -class MethodTable -{ -public: - /** - * @brief Constructor - * This constructor will create a method table for the given class and register - * this table under this class. - */ - MethodTable (const gsi::ClassBase *cls_decl) - : m_method_offset (0), m_property_offset (0), mp_cls_decl (cls_decl) - { - // signals are translated into the setters and getters - for (gsi::ClassBase::method_iterator m = cls_decl->begin_methods (); m != cls_decl->end_methods (); ++m) { - if ((*m)->is_signal ()) { - for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { - add_getter (syn->name, *m); - add_setter (syn->name, *m); - } - } - } - - // first add getters and setters - for (gsi::ClassBase::method_iterator m = cls_decl->begin_methods (); m != cls_decl->end_methods (); ++m) { - if (! (*m)->is_callback ()) { - for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { - if (syn->is_getter) { - add_getter (syn->name, *m); - } else if (syn->is_setter) { - add_setter (syn->name, *m); - } - } - } - } - - // then add normal methods - on name clash with properties make them a getter - for (gsi::ClassBase::method_iterator m = cls_decl->begin_methods (); m != cls_decl->end_methods (); ++m) { - if (! (*m)->is_callback () && ! (*m)->is_signal ()) { - for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { - if (! syn->is_getter && ! syn->is_setter) { - if ((*m)->end_arguments () - (*m)->begin_arguments () == 0 && find_property ((*m)->is_static (), syn->name).first) { - add_getter (syn->name, *m); - } else { - add_method (syn->name, *m); - } - } - } - } - } - - if (cls_decl->base ()) { - const MethodTable *base_mt = method_table_by_class (cls_decl->base ()); - tl_assert (base_mt); - m_method_offset = base_mt->top_mid (); - m_property_offset = base_mt->top_property_mid (); - } - } - - /** - * @brief Returns the lowest method ID within the space of this table - * Method IDs below this one are reserved for base class methods - */ - size_t bottom_mid () const - { - return m_method_offset; - } - - /** - * @brief Returns the topmost + 1 method ID. - */ - size_t top_mid () const - { - return m_method_offset + m_table.size (); - } - - /** - * @brief Returns the lowest property method ID within the space of this table - * Method IDs below this one are reserved for base class methods - */ - size_t bottom_property_mid () const - { - return m_property_offset; - } - - /** - * @brief Returns the topmost + 1 property method ID. - */ - size_t top_property_mid () const - { - return m_property_offset + m_property_table.size (); - } - - /** - * @brief Find a method with the given name and static flag - * Returns true or false in the first part (true, if found) and - * the MID in the second part. - */ - std::pair find_method (bool st, const std::string &name) const - { - std::map , size_t>::const_iterator t = m_name_map.find (std::make_pair (st, name)); - if (t != m_name_map.end ()) { - return std::make_pair (true, t->second + m_method_offset); - } else { - return std::make_pair (false, 0); - } - } - - /** - * @brief Find a property with the given name and static flag - * Returns true or false in the first part (true, if found) and - * the MID in the second part. - */ - std::pair find_property (bool st, const std::string &name) const - { - std::map , size_t>::const_iterator t = m_property_name_map.find (std::make_pair (st, name)); - if (t != m_property_name_map.end ()) { - return std::make_pair (true, t->second + m_property_offset); - } else { - return std::make_pair (false, 0); - } - } - - /** - * @brief Adds a method to the table - */ - void add_method (const std::string &name, const gsi::MethodBase *mb) - { - bool st = mb->is_static (); - - std::map, size_t>::iterator n = m_name_map.find (std::make_pair (st, name)); - if (n == m_name_map.end ()) { - - m_name_map.insert (std::make_pair (std::make_pair(st, name), m_table.size ())); - m_table.push_back (MethodTableEntry (name, mb->is_static (), mb->is_protected ())); - m_table.back ().add (mb); - - } else { - - if (m_table [n->second].is_protected () != mb->is_protected ()) { - tl::warn << "Class " << mp_cls_decl->name () << ": method '" << name << " is both a protected and non-protected"; - } - - m_table [n->second].add (mb); - - } - } - - /** - * @brief Adds a setter with the given name - */ - void add_setter (const std::string &name, const gsi::MethodBase *setter) - { - bool st = setter->is_static (); - - std::map, size_t>::iterator n = m_property_name_map.find (std::make_pair (st, name)); - if (n == m_property_name_map.end ()) { - - m_property_name_map.insert (std::make_pair (std::make_pair(st, name), m_property_table.size ())); - m_property_table.push_back (std::make_pair (MethodTableEntry (name, st, false), MethodTableEntry (name, st, false))); - m_property_table.back ().first.add (setter); - - } else { - - m_property_table [n->second].first.add (setter); - - } - } - - /** - * @brief Adds a getter with the given name - */ - void add_getter (const std::string &name, const gsi::MethodBase *getter) - { - bool st = getter->is_static (); - - std::map, size_t>::iterator n = m_property_name_map.find (std::make_pair (st, name)); - if (n == m_property_name_map.end ()) { - - m_property_name_map.insert (std::make_pair (std::make_pair(st, name), m_property_table.size ())); - m_property_table.push_back (std::make_pair (MethodTableEntry (name, st, false), MethodTableEntry (name, st, false))); - m_property_table.back ().second.add (getter); - - } else { - - m_property_table [n->second].second.add (getter); - - } - } - - /** - * @brief Returns true if the method with the given ID is static - */ - bool is_static (size_t mid) const - { - return m_table [mid - m_method_offset].is_static (); - } - - /** - * @brief Returns true if the method with the given ID is protected - */ - bool is_protected (size_t mid) const - { - return m_table [mid - m_method_offset].is_protected (); - } - - /** - * @brief Returns the name of the method with the given ID - */ - const std::string &name (size_t mid) const - { - return m_table [mid - m_method_offset].name (); - } - - /** - * @brief Returns the name of the property with the given ID - */ - const std::string &property_name (size_t mid) const - { - return m_property_table [mid - m_property_offset].first.name (); - } - - /** - * @brief Begins iteration of the overload variants for setter of property ID mid - */ - MethodTableEntry::method_iterator begin_setters (size_t mid) const - { - return m_property_table[mid - m_property_offset].first.begin (); - } - - /** - * @brief Ends iteration of the overload variants for setter of property ID mid - */ - MethodTableEntry::method_iterator end_setters (size_t mid) const - { - return m_property_table[mid - m_property_offset].first.end (); - } - - /** - * @brief Begins iteration of the overload variants for getter of property ID mid - */ - MethodTableEntry::method_iterator begin_getters (size_t mid) const - { - return m_property_table[mid - m_property_offset].second.begin (); - } - - /** - * @brief Ends iteration of the overload variants for getter of property ID mid - */ - MethodTableEntry::method_iterator end_getters (size_t mid) const - { - return m_property_table[mid - m_property_offset].second.end (); - } - - /** - * @brief Begins iteration of the overload variants for method ID mid - */ - MethodTableEntry::method_iterator begin (size_t mid) const - { - return m_table[mid - m_method_offset].begin (); - } - - /** - * @brief Ends iteration of the overload variants for method ID mid - */ - MethodTableEntry::method_iterator end (size_t mid) const - { - return m_table[mid - m_method_offset].end (); - } - - /** - * @brief Finishes construction of the table - * This method must be called after the add_method calls have been used - * to fill the table. It will remove duplicate entries and clean up memory. - */ - void finish () - { - for (std::vector::iterator m = m_table.begin (); m != m_table.end (); ++m) { - m->finish (); - } - for (std::vector >::iterator m = m_property_table.begin (); m != m_property_table.end (); ++m) { - m->first.finish (); - m->second.finish (); - } - } - - /** - * @brief Obtain a method table for a given class - */ - static MethodTable *method_table_by_class (const gsi::ClassBase *cls_decl); - -private: - size_t m_method_offset; - size_t m_property_offset; - const gsi::ClassBase *mp_cls_decl; - std::map, size_t> m_name_map; - std::map, size_t> m_property_name_map; - std::vector m_table; - std::vector > m_property_table; -}; - -struct PythonClassClientData - : public gsi::PerClassClientSpecificData -{ - PythonClassClientData (const gsi::ClassBase *_cls, PyTypeObject *_py_type, PyTypeObject *_py_type_static) - : py_type_object (_py_type), py_type_object_static (_py_type_static), method_table (_cls) - { - // .. nothing yet .. - } - - PyTypeObject *py_type_object; - PyTypeObject *py_type_object_static; - MethodTable method_table; - - static PyTypeObject *py_type (const gsi::ClassBase &cls_decl, bool as_static) - { - PythonClassClientData *cd = dynamic_cast(cls_decl.data (gsi::ClientIndex::Python)); - return cd ? (as_static ? cd->py_type_object_static : cd->py_type_object) : 0; - } - - static void initialize (const gsi::ClassBase &cls_decl, PyTypeObject *py_type, bool as_static) - { - PythonClassClientData *cd = dynamic_cast(cls_decl.data (gsi::ClientIndex::Python)); - if (cd) { - if (as_static) { - cd->py_type_object_static = py_type; - } else { - cd->py_type_object = py_type; - } - } else { - cls_decl.set_data (gsi::ClientIndex::Python, new PythonClassClientData (&cls_decl, as_static ? NULL : py_type, as_static ? py_type : NULL)); - } - } -}; - -/** - * @brief Obtains a method table for a given class - */ -MethodTable *MethodTable::method_table_by_class (const gsi::ClassBase *cls_decl) -{ - PythonClassClientData *cd = dynamic_cast(cls_decl->data (gsi::ClientIndex::Python)); - return cd ? &cd->method_table : 0; -} - // -------------------------------------------------------------------------- // Some utilities @@ -547,7 +137,7 @@ static std::string extract_python_name (const std::string &name) #else return "__truediv__"; #endif - } else if (name == "*") { + } else if (name == "*" || name == "*!") { return "__mul__"; } else if (name == "%") { return "__mod__"; @@ -625,6 +215,573 @@ static std::string extract_python_name (const std::string &name) } } +// ------------------------------------------------------------------- +// The lookup table for the method overload resolution + +/** + * @brief A single entry in the method table + * This class provides an entry for one name. It provides flags + * (ctor, static, protected) for the method and a list of implementations + * (gsi::MethodBase objects) + */ +class MethodTableEntry +{ +public: + typedef std::vector::const_iterator method_iterator; + + MethodTableEntry (const std::string &name, bool st, bool prot) + : m_name (name), m_is_static (st), m_is_protected (prot), m_is_enabled (true) + { } + + const std::string &name () const + { + return m_name; + } + + void set_name (const std::string &n) + { + m_name = n; + } + + void set_enabled (bool en) + { + m_is_enabled = en; + } + + bool is_enabled () const + { + return m_is_enabled; + } + + bool is_static () const + { + return m_is_static; + } + + bool is_protected () const + { + return m_is_protected; + } + + void add (const gsi::MethodBase *m) + { + m_methods.push_back (m); + } + + void finish () + { + // remove duplicate entries in the method list + std::vector m = m_methods; + std::sort(m.begin (), m.end ()); + m_methods.assign (m.begin (), std::unique (m.begin (), m.end ())); + } + + method_iterator begin () const + { + return m_methods.begin (); + } + + method_iterator end () const + { + return m_methods.end (); + } + +private: + std::string m_name; + bool m_is_static : 1; + bool m_is_protected : 1; + bool m_is_enabled : 1; + std::vector m_methods; +}; + +/** + * @brief The method table for a class + * The method table will provide the methods associated with a native method, i.e. + * a certain name. It only provides the methods, not a overload resolution strategy. + */ +class MethodTable +{ +public: + /** + * @brief Constructor + * This constructor will create a method table for the given class and register + * this table under this class. + */ + MethodTable (const gsi::ClassBase *cls_decl, PythonModule *module) + : m_method_offset (0), m_property_offset (0), mp_cls_decl (cls_decl), mp_module (module) + { + if (cls_decl->base ()) { + const MethodTable *base_mt = method_table_by_class (cls_decl->base ()); + tl_assert (base_mt); + m_method_offset = base_mt->top_mid (); + m_property_offset = base_mt->top_property_mid (); + } + + // signals are translated into the setters and getters + for (gsi::ClassBase::method_iterator m = cls_decl->begin_methods (); m != cls_decl->end_methods (); ++m) { + if ((*m)->is_signal ()) { + for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { + add_getter (syn->name, *m); + add_setter (syn->name, *m); + } + } + } + + // first add getters and setters + for (gsi::ClassBase::method_iterator m = cls_decl->begin_methods (); m != cls_decl->end_methods (); ++m) { + if (! (*m)->is_callback ()) { + for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { + if (syn->is_getter) { + add_getter (syn->name, *m); + } else if (syn->is_setter) { + add_setter (syn->name, *m); + } + } + } + } + + // then add normal methods - on name clash with properties make them a getter + for (gsi::ClassBase::method_iterator m = cls_decl->begin_methods (); m != cls_decl->end_methods (); ++m) { + if (! (*m)->is_callback () && ! (*m)->is_signal ()) { + for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { + if (! syn->is_getter && ! syn->is_setter) { + if ((*m)->end_arguments () - (*m)->begin_arguments () == 0 && find_property ((*m)->is_static (), syn->name).first) { + add_getter (syn->name, *m); + } else { + add_method (syn->name, *m); + } + } + } + } + } + } + + /** + * @brief Returns the lowest method ID within the space of this table + * Method IDs below this one are reserved for base class methods + */ + size_t bottom_mid () const + { + return m_method_offset; + } + + /** + * @brief Returns the topmost + 1 method ID. + */ + size_t top_mid () const + { + return m_method_offset + m_table.size (); + } + + /** + * @brief Returns the lowest property method ID within the space of this table + * Method IDs below this one are reserved for base class methods + */ + size_t bottom_property_mid () const + { + return m_property_offset; + } + + /** + * @brief Returns the topmost + 1 property method ID. + */ + size_t top_property_mid () const + { + return m_property_offset + m_property_table.size (); + } + + /** + * @brief Find a method with the given name and static flag + * Returns true or false in the first part (true, if found) and + * the MID in the second part. + */ + std::pair find_method (bool st, const std::string &name) const + { + std::map , size_t>::const_iterator t = m_name_map.find (std::make_pair (st, name)); + if (t != m_name_map.end ()) { + return std::make_pair (true, t->second + m_method_offset); + } else { + return std::make_pair (false, 0); + } + } + + /** + * @brief Find a property with the given name and static flag + * Returns true or false in the first part (true, if found) and + * the MID in the second part. + */ + std::pair find_property (bool st, const std::string &name) const + { + std::map , size_t>::const_iterator t = m_property_name_map.find (std::make_pair (st, name)); + if (t != m_property_name_map.end ()) { + return std::make_pair (true, t->second + m_property_offset); + } else { + return std::make_pair (false, 0); + } + } + + /** + * @brief Adds a method to the table + */ + void add_method (const std::string &name, const gsi::MethodBase *mb) + { + if (name == "to_s" && mb->compatible_with_num_args (0)) { + + add_method_basic (name, mb); + + // The str method is also routed via the tp_str implementation + add_method_basic ("__str__", mb); + +#if defined(GSI_ALIAS_INSPECT) + // also alias to "__repr__" unless there is an explicit "inspect" method + bool alias_inspect = true; + for (gsi::ClassBase::method_iterator m = mp_cls_decl->begin_methods (); m != mp_cls_decl->end_methods () && alias_inspect; ++m) { + if (! (*m)->is_callback () && ! (*m)->is_signal ()) { + for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms () && alias_inspect; ++syn) { + if (! syn->is_getter && ! syn->is_setter && syn->name == "inspect") { + alias_inspect = false; + } + } + } + } +#else + bool alias_inspect = false; +#endif + if (alias_inspect) { + add_method_basic ("__repr__", mb); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'str(object)' and 'repr(object)'"))); + } else { + mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'str(object)'"))); + } + + } else if (name == "hash" && mb->compatible_with_num_args (0)) { + + // The hash method is also routed via the tp_hash implementation + add_method_basic ("__hash__", mb); + + add_method_basic (name, mb); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'hash(object)'"))); + + } else if (name == "inspect" && mb->compatible_with_num_args (0)) { + + // The str method is also routed via the tp_str implementation + add_method_basic ("__repr__", mb); + + add_method_basic (name, mb); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'repr(object)'"))); + + } else if (name == "size" && mb->compatible_with_num_args (0)) { + + // The size method is also routed via the sequence methods protocol if there + // is a [] function + add_method_basic ("__len__", mb); + + add_method_basic (name, mb); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'len(object)'"))); + + } else if (name == "each" && mb->compatible_with_num_args (0) && mb->ret_type ().is_iter ()) { + + // each makes the object iterable + add_method_basic ("__iter__", mb); + + add_method_basic (name, mb); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method enables iteration of the object"))); + + } else if (name == "dup" && mb->compatible_with_num_args (0)) { + + // If the object supports the dup method, then it is a good + // idea to define the __copy__ method. + add_method_basic ("__copy__", mb); + + add_method_basic (name, mb); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method also implements '__copy__'"))); + + } else { + + std::string py_name = extract_python_name (name); + if (py_name.empty ()) { + + // drop non-standard names + if (tl::verbosity () >= 20) { + tl::warn << tl::to_string (tr ("Class ")) << mp_cls_decl->name () << ": " << tl::to_string (tr ("no Python mapping for method ")) << name; + } + + add_method_basic (name, mb, false); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method is not available for Python"))); + + } else { + + add_method_basic (py_name, mb); + + if (name == "*") { + // Supply a commutative multiplication version unless the operator is "*!" + add_method_basic ("__rmul__", mb); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method also implements '__rmul__'"))); + } + + } + + } + } + + /** + * @brief Adds a setter with the given name + */ + void add_setter (const std::string &name, const gsi::MethodBase *setter) + { + bool st = setter->is_static (); + + std::map, size_t>::iterator n = m_property_name_map.find (std::make_pair (st, name)); + if (n == m_property_name_map.end ()) { + + m_property_name_map.insert (std::make_pair (std::make_pair(st, name), m_property_table.size ())); + m_property_table.push_back (std::make_pair (MethodTableEntry (name, st, false), MethodTableEntry (name, st, false))); + m_property_table.back ().first.add (setter); + + } else { + + m_property_table [n->second].first.add (setter); + + } + } + + /** + * @brief Adds a getter with the given name + */ + void add_getter (const std::string &name, const gsi::MethodBase *getter) + { + bool st = getter->is_static (); + + std::map, size_t>::iterator n = m_property_name_map.find (std::make_pair (st, name)); + if (n == m_property_name_map.end ()) { + + m_property_name_map.insert (std::make_pair (std::make_pair(st, name), m_property_table.size ())); + m_property_table.push_back (std::make_pair (MethodTableEntry (name, st, false), MethodTableEntry (name, st, false))); + m_property_table.back ().second.add (getter); + + } else { + + m_property_table [n->second].second.add (getter); + + } + } + + /** + * @brief Returns true if the method is enabled + */ + bool is_enabled (size_t mid) const + { + return m_table [mid - m_method_offset].is_enabled (); + } + + /** + * @brief Enables or disables a method + */ + void set_enabled (size_t mid, bool en) + { + m_table [mid - m_method_offset].set_enabled (en); + } + + /** + * @brief Returns true if the method with the given ID is static + */ + bool is_static (size_t mid) const + { + return m_table [mid - m_method_offset].is_static (); + } + + /** + * @brief Returns true if the method with the given ID is protected + */ + bool is_protected (size_t mid) const + { + return m_table [mid - m_method_offset].is_protected (); + } + + /** + * @brief Renames a method + */ + void rename (size_t mid, const std::string &new_name) + { + std::string old_name = name (mid); + bool st = is_static (mid); + + m_table [mid - m_method_offset].set_name (new_name); + + auto nm = m_name_map.find (std::make_pair (st, old_name)); + if (nm != m_name_map.end ()) { + m_name_map.erase (nm); + m_name_map.insert (std::make_pair (std::make_pair (st, new_name), mid)); + } + } + + /** + * @brief Returns the name of the method with the given ID + */ + const std::string &name (size_t mid) const + { + return m_table [mid - m_method_offset].name (); + } + + /** + * @brief Returns the name of the property with the given ID + */ + const std::string &property_name (size_t mid) const + { + return m_property_table [mid - m_property_offset].first.name (); + } + + /** + * @brief Begins iteration of the overload variants for setter of property ID mid + */ + MethodTableEntry::method_iterator begin_setters (size_t mid) const + { + return m_property_table[mid - m_property_offset].first.begin (); + } + + /** + * @brief Ends iteration of the overload variants for setter of property ID mid + */ + MethodTableEntry::method_iterator end_setters (size_t mid) const + { + return m_property_table[mid - m_property_offset].first.end (); + } + + /** + * @brief Begins iteration of the overload variants for getter of property ID mid + */ + MethodTableEntry::method_iterator begin_getters (size_t mid) const + { + return m_property_table[mid - m_property_offset].second.begin (); + } + + /** + * @brief Ends iteration of the overload variants for getter of property ID mid + */ + MethodTableEntry::method_iterator end_getters (size_t mid) const + { + return m_property_table[mid - m_property_offset].second.end (); + } + + /** + * @brief Begins iteration of the overload variants for method ID mid + */ + MethodTableEntry::method_iterator begin (size_t mid) const + { + return m_table[mid - m_method_offset].begin (); + } + + /** + * @brief Ends iteration of the overload variants for method ID mid + */ + MethodTableEntry::method_iterator end (size_t mid) const + { + return m_table[mid - m_method_offset].end (); + } + + /** + * @brief Finishes construction of the table + * This method must be called after the add_method calls have been used + * to fill the table. It will remove duplicate entries and clean up memory. + */ + void finish () + { + for (std::vector::iterator m = m_table.begin (); m != m_table.end (); ++m) { + m->finish (); + } + for (std::vector >::iterator m = m_property_table.begin (); m != m_property_table.end (); ++m) { + m->first.finish (); + m->second.finish (); + } + } + + /** + * @brief Obtain a method table for a given class + */ + static MethodTable *method_table_by_class (const gsi::ClassBase *cls_decl); + +private: + size_t m_method_offset; + size_t m_property_offset; + const gsi::ClassBase *mp_cls_decl; + std::map, size_t> m_name_map; + std::map, size_t> m_property_name_map; + std::vector m_table; + std::vector > m_property_table; + PythonModule *mp_module; + + void add_method_basic (const std::string &name, const gsi::MethodBase *mb, bool enabled = true) + { + bool st = mb->is_static (); + + std::map, size_t>::iterator n = m_name_map.find (std::make_pair (st, name)); + if (n == m_name_map.end ()) { + + m_name_map.insert (std::make_pair (std::make_pair (st, name), m_table.size ())); + m_table.push_back (MethodTableEntry (name, st, mb->is_protected ())); + if (! enabled) { + m_table.back ().set_enabled (false); + } + m_table.back ().add (mb); + + } else { + + if (m_table [n->second].is_protected () != mb->is_protected ()) { + tl::warn << "Class " << mp_cls_decl->name () << ": method '" << name << " is both a protected and non-protected"; + } + + m_table [n->second].add (mb); + if (! enabled) { + m_table [n->second].set_enabled (false); + } + + } + } +}; + +struct PythonClassClientData + : public gsi::PerClassClientSpecificData +{ + PythonClassClientData (const gsi::ClassBase *_cls, PyTypeObject *_py_type, PyTypeObject *_py_type_static, PythonModule *module) + : py_type_object (_py_type), py_type_object_static (_py_type_static), method_table (_cls, module) + { + // .. nothing yet .. + } + + PyTypeObject *py_type_object; + PyTypeObject *py_type_object_static; + MethodTable method_table; + + static PyTypeObject *py_type (const gsi::ClassBase &cls_decl, bool as_static) + { + PythonClassClientData *cd = dynamic_cast(cls_decl.data (gsi::ClientIndex::Python)); + return cd ? (as_static ? cd->py_type_object_static : cd->py_type_object) : 0; + } + + static void initialize (const gsi::ClassBase &cls_decl, PyTypeObject *py_type, bool as_static, PythonModule *module) + { + PythonClassClientData *cd = dynamic_cast(cls_decl.data (gsi::ClientIndex::Python)); + if (cd) { + if (as_static) { + cd->py_type_object_static = py_type; + } else { + cd->py_type_object = py_type; + } + } else { + cls_decl.set_data (gsi::ClientIndex::Python, new PythonClassClientData (&cls_decl, as_static ? NULL : py_type, as_static ? py_type : NULL, module)); + } + } +}; + +/** + * @brief Obtains a method table for a given class + */ +MethodTable *MethodTable::method_table_by_class (const gsi::ClassBase *cls_decl) +{ + PythonClassClientData *cd = dynamic_cast(cls_decl->data (gsi::ClientIndex::Python)); + return cd ? &cd->method_table : 0; +} + // -------------------------------------------------------------------------- // Methods for PYAObjectBase Python binding @@ -2489,7 +2646,7 @@ public: type->tp_getattro = PyObject_GenericGetAttr; } - PythonClassClientData::initialize (*cls, type, as_static); + PythonClassClientData::initialize (*cls, type, as_static, mp_module); mp_module->register_class (cls); @@ -2614,325 +2771,227 @@ public: // collect the names which have been disambiguated static/non-static wise std::vector disambiguated_names; - // check, whether there is an "inspect" method - bool has_inspect = false; - for (size_t mid = mt->bottom_mid (); mid < mt->top_mid () && ! has_inspect; ++mid) { - has_inspect = (mt->name (mid) == "inspect"); - } - // produce the methods now for (size_t mid = mt->bottom_mid (); mid < mt->top_mid (); ++mid) { + if (! mt->is_enabled (mid)) { + continue; + } + std::string name = mt->name (mid); + std::string raw_name = name; - // extract a suitable Python name - name = extract_python_name (name); + // does this method hide a property? -> append "_" in that case + std::pair t = mt->find_property (mt->is_static (mid), name); + if (t.first) { + name += "_"; + } - // cannot extract a Python name - if (name.empty ()) { + // needs static/non-static disambiguation? + t = mt->find_method (! mt->is_static (mid), name); + if (t.first) { + + disambiguated_names.push_back (name); + if (mt->is_static (mid)) { + name = "_class_" + name; + } else { + name = "_inst_" + name; + } + + mp_module->add_python_doc (*cls, mt, int (mid), tl::sprintf (tl::to_string (tr ("This attribute is available as '%s' in Python")), name)); + + } else if (is_reserved_word (name)) { // drop non-standard names if (tl::verbosity () >= 20) { - tl::warn << tl::to_string (tr ("Class ")) << cls->name () << ": " << tl::to_string (tr ("no Python mapping for method ")) << mt->name (mid); + tl::warn << tl::to_string (tr ("Class ")) << cls->name () << ": " << tl::to_string (tr ("no Python mapping for method (reserved word) ")) << name; } - mp_module->add_python_doc (*cls, mt, int (mid), tl::to_string (tr ("This method is not available for Python"))); + name += "_"; - } else { + mt->rename (mid, name); + mp_module->add_python_doc (*cls, mt, int (mid), tl::sprintf (tl::to_string (tr ("This attribute is available as '%s' in Python")), name)); - std::string raw_name = name; + } - // does this method hide a property? -> append "_" in that case - std::pair t = mt->find_property (mt->is_static (mid), name); - if (t.first) { - name += "_"; + // create documentation + std::string doc; + for (MethodTableEntry::method_iterator m = mt->begin (mid); m != mt->end (mid); ++m) { + if (! doc.empty ()) { + doc = "\n\n"; } + doc += (*m)->doc (); + } - // needs static/non-static disambiguation? - t = mt->find_method (! mt->is_static (mid), name); - if (t.first) { + const gsi::MethodBase *m_first = *mt->begin (mid); - disambiguated_names.push_back (name); - if (mt->is_static (mid)) { - name = "_class_" + name; - } else { - name = "_inst_" + name; - } + tl_assert (mid < sizeof (method_adaptors) / sizeof (method_adaptors[0])); + if (! mt->is_static (mid)) { // Bound methods - } else if (is_reserved_word (name)) { - - // drop non-standard names - if (tl::verbosity () >= 20) { - tl::warn << tl::to_string (tr ("Class ")) << cls->name () << ": " << tl::to_string (tr ("no Python mapping for method (reserved word) ")) << name; - } - - name += "_"; - - } - - if (name != raw_name) { - mp_module->add_python_doc (*cls, mt, int (mid), tl::sprintf (tl::to_string (tr ("This attribute is available as '%s' in Python")), name)); - } - - // create documentation - std::string doc; - for (MethodTableEntry::method_iterator m = mt->begin (mid); m != mt->end (mid); ++m) { - if (! doc.empty ()) { - doc = "\n\n"; - } - doc += (*m)->doc (); - } - - const gsi::MethodBase *m_first = *mt->begin (mid); - - tl_assert (mid < sizeof (method_adaptors) / sizeof (method_adaptors[0])); - if (! mt->is_static (mid)) { // Bound methods - - if (! as_static) { - - std::vector alt_names; - - if (name == "to_s" && m_first->compatible_with_num_args (0)) { - - // The str method is also routed via the tp_str implementation - alt_names.push_back ("__str__"); -#if GSI_ALIAS_INSPECT - bool alias_inspect = ! has_inspect; -#else - bool alias_inspect = false; -#endif - if (alias_inspect) { - mp_module->add_python_doc (*cls, mt, int (mid), tl::to_string (tr ("This method is also available as 'str(object)' and 'repr(object)'"))); - alt_names.push_back ("__repr__"); - } else { - mp_module->add_python_doc (*cls, mt, int (mid), tl::to_string (tr ("This method is also available as 'str(object)'"))); - } - - } else if (name == "hash" && m_first->compatible_with_num_args (0)) { - - // The hash method is also routed via the tp_hash implementation - alt_names.push_back ("__hash__"); - mp_module->add_python_doc (*cls, mt, int (mid), tl::to_string (tr ("This method is also available as 'hash(object)'"))); - - } else if (name == "inspect" && m_first->compatible_with_num_args (0)) { - - // The str method is also routed via the tp_str implementation - mp_module->add_python_doc (*cls, mt, int (mid), tl::to_string (tr ("This method is also available as 'repr(object)'"))); - alt_names.push_back ("__repr__"); - - } else if (name == "size" && m_first->compatible_with_num_args (0)) { - - // The size method is also routed via the sequence methods protocol if there - // is a [] function - mp_module->add_python_doc (*cls, mt, int (mid), tl::to_string (tr ("This method is also available as 'len(object)'"))); - alt_names.push_back ("__len__"); - - } else if (name == "each" && m_first->compatible_with_num_args (0) && m_first->ret_type ().is_iter ()) { - - // each makes the object iterable - mp_module->add_python_doc (*cls, mt, int (mid), tl::to_string (tr ("This method enables iteration of the object"))); - alt_names.push_back ("__iter__"); - - } else if (name == "__mul__") { - - // Adding right multiplication - // Rationale: if pyaObj * x works, so should x * pyaObj - // But this should only apply if the multiplication is commutative - // There are a few exceptions like Trans * Trans, so we support this case only if - // the second argument is double (scaling). - gsi::ArgType double_argtype; - double_argtype.template init (); - if (m_first->arg (0) == double_argtype) { - add_python_doc (**c, mt, int (mid), tl::to_string (tr ("This method is also available as '__rmul__'"))); - alt_names.push_back ("__rmul__"); - } - - } else if (name == "dup" && m_first->compatible_with_num_args (0) ) { - - // If the object supports the dup method, then it is a good - // idea to define the __copy__ method. - add_python_doc (**c, mt, int (mid), tl::to_string (tr ("This method also implements '__copy__'"))); - alt_names.push_back ("__copy__"); - - } - - for (std::vector ::const_iterator an = alt_names.begin (); an != alt_names.end (); ++an) { - - // needs registration under an alternative name to enable special protocols - - PyMethodDef *method = mp_module->make_method_def (); - method->ml_name = mp_module->make_string (*an); - method->ml_meth = (PyCFunction) method_adaptors[mid]; - method->ml_doc = mp_module->make_string (doc); - method->ml_flags = METH_VARARGS; - - PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); - set_type_attr (type, *an, attr); - - } - - PyMethodDef *method = mp_module->make_method_def (); - method->ml_name = mp_module->make_string (name); - method->ml_meth = (PyCFunction) method_adaptors[mid]; - method->ml_doc = mp_module->make_string (doc); - method->ml_flags = METH_VARARGS; - - PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); - set_type_attr (type, name, attr); - - } - - } else if (isupper (name [0]) || m_first->is_const ()) { - - if ((mt->end (mid) - mt->begin (mid)) == 1 && m_first->begin_arguments () == m_first->end_arguments ()) { - - // static methods without arguments which start with a capital letter are treated as constants - PYAStaticAttributeDescriptorObject *desc = PYAStaticAttributeDescriptorObject::create (mp_module->make_string (name)); - desc->type = type; - desc->getter = method_adaptors[mid]; - - PythonRef attr (desc); - set_type_attr (type, name, attr); - - } else if (tl::verbosity () >= 20) { - tl::warn << "Upper case method name encountered which cannot be used as a Python constant (more than one overload or at least one argument): " << cls->name () << "." << name; - mp_module->add_python_doc (*cls, mt, int (mid), tl::to_string (tr ("This attribute is not available for Python"))); - } - - } else if (! as_static) { // Class methods - - if (m_first->ret_type ().type () == gsi::T_object && m_first->ret_type ().pass_obj () && name == "new") { - - // The constructor is also routed via the pya_object_init implementation - mp_module->add_python_doc (*cls, mt, int (mid), tl::to_string (tr ("This method is the default initializer of the object"))); - - PyMethodDef *method = mp_module->make_method_def (); - method->ml_name = "__init__"; - method->ml_meth = (PyCFunction) method_init_adaptors[mid]; - method->ml_doc = mp_module->make_string (doc); - method->ml_flags = METH_VARARGS; - - PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); - set_type_attr (type, method->ml_name, attr); - - } + if (! as_static) { PyMethodDef *method = mp_module->make_method_def (); method->ml_name = mp_module->make_string (name); method->ml_meth = (PyCFunction) method_adaptors[mid]; method->ml_doc = mp_module->make_string (doc); - method->ml_flags = METH_VARARGS | METH_CLASS; + method->ml_flags = METH_VARARGS; - PythonRef attr = PythonRef (PyDescr_NewClassMethod (type, method)); + PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); set_type_attr (type, name, attr); } + } else if (isupper (name [0]) || m_first->is_const ()) { + + if ((mt->end (mid) - mt->begin (mid)) == 1 && m_first->begin_arguments () == m_first->end_arguments ()) { + + // static methods without arguments which start with a capital letter are treated as constants + PYAStaticAttributeDescriptorObject *desc = PYAStaticAttributeDescriptorObject::create (mp_module->make_string (name)); + desc->type = type; + desc->getter = method_adaptors[mid]; + + PythonRef attr (desc); + set_type_attr (type, name, attr); + + } else if (tl::verbosity () >= 20) { + tl::warn << "Upper case method name encountered which cannot be used as a Python constant (more than one overload or at least one argument): " << cls->name () << "." << name; + mp_module->add_python_doc (*cls, mt, int (mid), tl::to_string (tr ("This attribute is not available for Python"))); + } + + } else if (! as_static) { // Class methods + + if (m_first->ret_type ().type () == gsi::T_object && m_first->ret_type ().pass_obj () && name == "new") { + + // The constructor is also routed via the pya_object_init implementation + mp_module->add_python_doc (*cls, mt, int (mid), tl::to_string (tr ("This method is the default initializer of the object"))); + + PyMethodDef *method = mp_module->make_method_def (); + method->ml_name = "__init__"; + method->ml_meth = (PyCFunction) method_init_adaptors[mid]; + method->ml_doc = mp_module->make_string (doc); + method->ml_flags = METH_VARARGS; + + PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); + set_type_attr (type, method->ml_name, attr); + + } + + PyMethodDef *method = mp_module->make_method_def (); + method->ml_name = mp_module->make_string (name); + method->ml_meth = (PyCFunction) method_adaptors[mid]; + method->ml_doc = mp_module->make_string (doc); + method->ml_flags = METH_VARARGS | METH_CLASS; + + PythonRef attr = PythonRef (PyDescr_NewClassMethod (type, method)); + set_type_attr (type, name, attr); + } - if (! as_static) { + } - // Complete the comparison operators if necessary. - // Unlike Ruby, Python does not automatically implement != from == for example. - // We assume that "==" and "<" are the minimum requirements for full comparison - // and "==" is the minimum requirement for equality. Hence: - // * If "==" is given, but no "!=", synthesize - // "a != b" by "!a == b" - // * If "==" and "<" are given, synthesize if required - // "a <= b" by "a < b || a == b" - // "a > b" by "!(a < b || a == b)" (could be b < a, but this avoids having to switch arguments) - // "a >= b" by "!a < b" + if (! as_static) { - bool has_eq = mt->find_method (false, "==").first; - bool has_ne = mt->find_method (false, "!=").first; - bool has_lt = mt->find_method (false, "<").first; - bool has_le = mt->find_method (false, "<=").first; - bool has_gt = mt->find_method (false, ">").first; - bool has_ge = mt->find_method (false, ">=").first; - bool has_cmp = mt->find_method (false, "<=>").first; + // Complete the comparison operators if necessary. + // Unlike Ruby, Python does not automatically implement != from == for example. + // We assume that "==" and "<" are the minimum requirements for full comparison + // and "==" is the minimum requirement for equality. Hence: + // * If "==" is given, but no "!=", synthesize + // "a != b" by "!a == b" + // * If "==" and "<" are given, synthesize if required + // "a <= b" by "a < b || a == b" + // "a > b" by "!(a < b || a == b)" (could be b < a, but this avoids having to switch arguments) + // "a >= b" by "!a < b" - if (! has_cmp && has_eq) { + bool has_eq = mt->find_method (false, "==").first; + bool has_ne = mt->find_method (false, "!=").first; + bool has_lt = mt->find_method (false, "<").first; + bool has_le = mt->find_method (false, "<=").first; + bool has_gt = mt->find_method (false, ">").first; + bool has_ge = mt->find_method (false, ">=").first; + bool has_cmp = mt->find_method (false, "<=>").first; - if (! has_ne) { + if (! has_cmp && has_eq) { - // Add a definition for "__ne__" - PyMethodDef *method = mp_module->make_method_def (); - method->ml_name = "__ne__"; - method->ml_meth = &object_default_ne_impl; - method->ml_flags = METH_VARARGS; + if (! has_ne) { - PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); - set_type_attr (type, method->ml_name, attr); + // Add a definition for "__ne__" + PyMethodDef *method = mp_module->make_method_def (); + method->ml_name = "__ne__"; + method->ml_meth = &object_default_ne_impl; + method->ml_flags = METH_VARARGS; - } + PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); + set_type_attr (type, method->ml_name, attr); - if (has_lt && ! has_le) { + } - // Add a definition for "__le__" - PyMethodDef *method = mp_module->make_method_def (); - method->ml_name = "__le__"; - method->ml_meth = &object_default_le_impl; - method->ml_flags = METH_VARARGS; + if (has_lt && ! has_le) { - PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); - set_type_attr (type, method->ml_name, attr); + // Add a definition for "__le__" + PyMethodDef *method = mp_module->make_method_def (); + method->ml_name = "__le__"; + method->ml_meth = &object_default_le_impl; + method->ml_flags = METH_VARARGS; - } + PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); + set_type_attr (type, method->ml_name, attr); - if (has_lt && ! has_gt) { + } - // Add a definition for "__gt__" - PyMethodDef *method = mp_module->make_method_def (); - method->ml_name = "__gt__"; - method->ml_meth = &object_default_gt_impl; - method->ml_flags = METH_VARARGS; + if (has_lt && ! has_gt) { - PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); - set_type_attr (type, method->ml_name, attr); + // Add a definition for "__gt__" + PyMethodDef *method = mp_module->make_method_def (); + method->ml_name = "__gt__"; + method->ml_meth = &object_default_gt_impl; + method->ml_flags = METH_VARARGS; - } + PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); + set_type_attr (type, method->ml_name, attr); - if (has_lt && ! has_ge) { + } - // Add a definition for "__ge__" - PyMethodDef *method = mp_module->make_method_def (); - method->ml_name = "__ge__"; - method->ml_meth = &object_default_ge_impl; - method->ml_flags = METH_VARARGS; + if (has_lt && ! has_ge) { - PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); - set_type_attr (type, method->ml_name, attr); + // Add a definition for "__ge__" + PyMethodDef *method = mp_module->make_method_def (); + method->ml_name = "__ge__"; + method->ml_meth = &object_default_ge_impl; + method->ml_flags = METH_VARARGS; - } + PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); + set_type_attr (type, method->ml_name, attr); } } - // install the static/non-static dispatcher descriptor + } - for (std::vector::const_iterator a = disambiguated_names.begin (); a != disambiguated_names.end (); ++a) { + // install the static/non-static dispatcher descriptor - PyObject *attr_inst = PyObject_GetAttrString ((PyObject *) type, ("_inst_" + *a).c_str ()); - PyObject *attr_class = PyObject_GetAttrString ((PyObject *) type, ("_class_" + *a).c_str ()); - if (attr_inst == NULL || attr_class == NULL) { + for (std::vector::const_iterator a = disambiguated_names.begin (); a != disambiguated_names.end (); ++a) { - // some error -> don't install the disambiguator - Py_XDECREF (attr_inst); - Py_XDECREF (attr_class); - PyErr_Clear (); + PyObject *attr_inst = PyObject_GetAttrString ((PyObject *) type, ("_inst_" + *a).c_str ()); + PyObject *attr_class = PyObject_GetAttrString ((PyObject *) type, ("_class_" + *a).c_str ()); + if (attr_inst == NULL || attr_class == NULL) { - tl::warn << "Unable to install a static/non-static disambiguator for " << *a << " in class " << (*c)->name (); - - } else { - - PyObject *desc = PYAAmbiguousMethodDispatcher::create (attr_inst, attr_class); - PythonRef name (c2python (*a)); - // Note: we use GenericSetAttr since that one allows us setting attributes on built-in types - PyObject_GenericSetAttr ((PyObject *) type, name.get (), desc); + // some error -> don't install the disambiguator + Py_XDECREF (attr_inst); + Py_XDECREF (attr_class); + PyErr_Clear (); + if (tl::verbosity () >= 20) { + tl::warn << "Unable to install a static/non-static disambiguator for " << *a << " in class " << cls->name (); } + } else { + + PyObject *desc = PYAAmbiguousMethodDispatcher::create (attr_inst, attr_class); + PythonRef name (c2python (*a)); + // Note: we use GenericSetAttr since that one allows us setting attributes on built-in types + PyObject_GenericSetAttr ((PyObject *) type, name.get (), desc); + } } diff --git a/src/rba/rba/rba.cc b/src/rba/rba/rba.cc index 051ddac7a..c4099cc0a 100644 --- a/src/rba/rba/rba.cc +++ b/src/rba/rba/rba.cc @@ -1556,6 +1556,17 @@ rba_add_path (const std::string &path) } } +static std::string +ruby_name (const std::string &n) +{ + if (n == "*!") { + // non-commutative multiplication + return "*"; + } else { + return n; + } +} + namespace { @@ -1672,7 +1683,7 @@ public: } else if (syn->is_setter) { mt->add_method (syn->name + "=", *m); } else { - mt->add_method (syn->name, *m); + mt->add_method (ruby_name (syn->name), *m); } } @@ -1709,7 +1720,7 @@ public: } else { - mt->add_method (syn->name, *m); + mt->add_method (ruby_name (syn->name), *m); } } From d3a36e66f214c2b8faba98a40cd0245e2c10c69b Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Thu, 20 Oct 2022 23:29:35 +0200 Subject: [PATCH 03/15] Fixed a compiler warning --- src/pya/pya/pyaModule.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pya/pya/pyaModule.cc b/src/pya/pya/pyaModule.cc index 7f54cc25f..53b770878 100644 --- a/src/pya/pya/pyaModule.cc +++ b/src/pya/pya/pyaModule.cc @@ -2779,7 +2779,6 @@ public: } std::string name = mt->name (mid); - std::string raw_name = name; // does this method hide a property? -> append "_" in that case std::pair t = mt->find_property (mt->is_static (mid), name); From 2c18bc6c468ca3a674d899718da7b72544ca6376 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 23 Oct 2022 18:31:13 +0200 Subject: [PATCH 04/15] WIP: refactoring --- {src/pymod => scripts}/stubgen.py | 0 src/gsi/gsi/gsiDeclInternal.cc | 44 +- src/pya/pya/pyaCallables.cc | 1647 ++++++++++++++++++++ src/pya/pya/pyaCallables.h | 70 + src/pya/pya/pyaInternal.cc | 793 ++++++++++ src/pya/pya/pyaInternal.h | 259 ++++ src/pya/pya/pyaModule.cc | 2306 +---------------------------- src/pya/pya/pyaObject.h | 1 - 8 files changed, 2800 insertions(+), 2320 deletions(-) rename {src/pymod => scripts}/stubgen.py (100%) create mode 100644 src/pya/pya/pyaCallables.cc create mode 100644 src/pya/pya/pyaCallables.h create mode 100644 src/pya/pya/pyaInternal.cc create mode 100644 src/pya/pya/pyaInternal.h diff --git a/src/pymod/stubgen.py b/scripts/stubgen.py similarity index 100% rename from src/pymod/stubgen.py rename to scripts/stubgen.py diff --git a/src/gsi/gsi/gsiDeclInternal.cc b/src/gsi/gsi/gsiDeclInternal.cc index 0100507ff..1c0f1a773 100644 --- a/src/gsi/gsi/gsiDeclInternal.cc +++ b/src/gsi/gsi/gsiDeclInternal.cc @@ -49,6 +49,7 @@ static int t_double () { return T_double; } static int t_float () { return T_float; } static int t_var () { return T_var; } static int t_string () { return T_string; } +static int t_byte_array () { return T_byte_array; } static int t_void_ptr () { return T_void_ptr; } static int t_object () { return T_object; } static int t_vector () { return T_vector; } @@ -77,30 +78,31 @@ static tl::Variant default_value (const ArgType *t) } Class decl_ArgType ("tl", "ArgType", - gsi::method ("TypeVoid|#t_void", &t_void) + - gsi::method ("TypeBool|#t_bool", &t_bool) + - gsi::method ("TypeChar|#t_char", &t_char) + - gsi::method ("TypeSChar|#t_schar", &t_schar) + - gsi::method ("TypeUChar|#t_uchar", &t_uchar) + - gsi::method ("TypeShort|#t_short", &t_short) + - gsi::method ("TypeUShort|#t_ushort", &t_ushort) + - gsi::method ("TypeInt|#t_int", &t_int) + - gsi::method ("TypeUInt|#t_uint", &t_uint) + - gsi::method ("TypeLong|#t_long", &t_long) + - gsi::method ("TypeULong|#t_ulong", &t_ulong) + - gsi::method ("TypeLongLong|#t_longlong", &t_longlong) + - gsi::method ("TypeULongLong|#t_ulonglong", &t_ulonglong) + + gsi::method ("TypeVoid", &t_void) + + gsi::method ("TypeBool", &t_bool) + + gsi::method ("TypeChar", &t_char) + + gsi::method ("TypeSChar", &t_schar) + + gsi::method ("TypeUChar", &t_uchar) + + gsi::method ("TypeShort", &t_short) + + gsi::method ("TypeUShort", &t_ushort) + + gsi::method ("TypeInt", &t_int) + + gsi::method ("TypeUInt", &t_uint) + + gsi::method ("TypeLong", &t_long) + + gsi::method ("TypeULong", &t_ulong) + + gsi::method ("TypeLongLong", &t_longlong) + + gsi::method ("TypeULongLong", &t_ulonglong) + #if defined(HAVE_64BIT_COORD) gsi::method ("TypeInt128|#t_int128", &t_int128) + #endif - gsi::method ("TypeDouble|#t_double", &t_double) + - gsi::method ("TypeFloat|#t_float", &t_float) + - gsi::method ("TypeVar|#t_var", &t_var) + - gsi::method ("TypeString|#t_string", &t_string) + - gsi::method ("TypeVoidPtr|#t_void_ptr", &t_void_ptr) + - gsi::method ("TypeObject|#t_object", &t_object) + - gsi::method ("TypeVector|#t_vector", &t_vector) + - gsi::method ("TypeMap|#t_map", &t_map) + + gsi::method ("TypeDouble", &t_double) + + gsi::method ("TypeFloat", &t_float) + + gsi::method ("TypeVar", &t_var) + + gsi::method ("TypeByteArray", &t_byte_array) + + gsi::method ("TypeString", &t_string) + + gsi::method ("TypeVoidPtr", &t_void_ptr) + + gsi::method ("TypeObject", &t_object) + + gsi::method ("TypeVector", &t_vector) + + gsi::method ("TypeMap", &t_map) + gsi::method_ext ("type", &type, "@brief Return the basic type (see t_.. constants)\n" ) + diff --git a/src/pya/pya/pyaCallables.cc b/src/pya/pya/pyaCallables.cc new file mode 100644 index 000000000..6df8fb380 --- /dev/null +++ b/src/pya/pya/pyaCallables.cc @@ -0,0 +1,1647 @@ +/* + + KLayout Layout Viewer + Copyright (C) 2006-2022 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#include "pyaCallables.h" +#include "pyaObject.h" +#include "pyaModule.h" +#include "pyaInternal.h" +#include "pyaHelpers.h" +#include "pyaMarshal.h" +#include "pyaConvert.h" +#include "pyaUtils.h" +#include "gsiMethods.h" + +namespace pya +{ + +// -------------------------------------------------------------------------- +// Methods for PYAObjectBase Python binding + +/** + * @brief Destructor for the base class (the implementation object) + */ +void +pya_object_deallocate (PyObject *self) +{ + // This avoids an assertion in debug builds (Python, gcmodule.c - update_refs). + // In short, the GC expects not to see objects with refcount 0 and asserts. + // However, due to triggering of signals or similar, the destructor call below + // may trigger a GC (https://github.com/KLayout/klayout/issues/1054). + // According to the comments this may be turned into a release mode assertion, so + // we better work around it. + ++self->ob_refcnt; + + PYAObjectBase *p = PYAObjectBase::from_pyobject (self); + p->~PYAObjectBase (); + Py_TYPE (self)->tp_free (self); +} + +/** + * @brief Constructor for the base class (the implementation object) + */ +int +pya_object_init (PyObject * /*self*/, PyObject *args, PyObject *kwds) +{ + // no particular initialization + static char *kwlist[] = {NULL}; + if (! PyArg_ParseTupleAndKeywords (args, kwds, "", kwlist)) { + return -1; + } else { + return 0; + } +} + +/** + * @brief Factory for a base class object + */ +PyObject * +pya_object_new (PyTypeObject *type, PyObject * /*args*/, PyObject * /*kwds*/) +{ + // create the object + PyObject *self_pyobject = type->tp_alloc (type, 0); + PYAObjectBase *self = PYAObjectBase::from_pyobject_unsafe (self_pyobject); + new (self) PYAObjectBase (PythonModule::cls_for_type (type), self_pyobject); + return self_pyobject; +} + +// -------------------------------------------------------------------------- +// Method binding guts + +/** + * @brief Gets the method name from a method id + */ +std::string +method_name_from_id (int mid, PyObject *self) +{ + const gsi::ClassBase *cls_decl = 0; + + if (! PyType_Check (self)) { + PYAObjectBase *p = PYAObjectBase::from_pyobject (self); + cls_decl = p->cls_decl (); + } else { + cls_decl = PythonModule::cls_for_type ((PyTypeObject *) self); + } + + tl_assert (cls_decl != 0); + + const MethodTable *mt = MethodTable::method_table_by_class (cls_decl); + tl_assert (mt); + + // locate the method in the base classes method table if necessary + while (mid < int (mt->bottom_mid ())) { + + tl_assert (cls_decl->base ()); + cls_decl = cls_decl->base (); + mt = MethodTable::method_table_by_class (cls_decl); + tl_assert (mt); + + } + + return cls_decl->name () + "." + mt->name (mid); +} + +/** + * @brief Gets the method name from a method id + */ +std::string +property_name_from_id (int mid, PyObject *self) +{ + const gsi::ClassBase *cls_decl = 0; + + if (! PyType_Check (self)) { + PYAObjectBase *p = PYAObjectBase::from_pyobject (self); + cls_decl = p->cls_decl (); + } else { + cls_decl = PythonModule::cls_for_type ((PyTypeObject *) self); + } + + tl_assert (cls_decl != 0); + + const MethodTable *mt = MethodTable::method_table_by_class (cls_decl); + tl_assert (mt); + + // locate the method in the base classes method table if necessary + while (mid < int (mt->bottom_property_mid ())) { + + tl_assert (cls_decl->base ()); + cls_decl = cls_decl->base (); + mt = MethodTable::method_table_by_class (cls_decl); + tl_assert (mt); + + } + + return cls_decl->name () + "." + mt->property_name (mid); +} + +static gsi::ArgType create_void_type () +{ + gsi::ArgType at; + at.init (); + return at; +} + +static gsi::ArgType s_void_type = create_void_type (); + +static PyObject * +get_return_value (PYAObjectBase *self, gsi::SerialArgs &retlist, const gsi::MethodBase *meth, tl::Heap &heap) +{ + PyObject *ret = NULL; + + if (meth->ret_type ().is_iter ()) { + + gsi::IterAdaptorAbstractBase *iter = (gsi::IterAdaptorAbstractBase *) retlist.read (heap); + ret = (PyObject *) PYAIteratorObject::create (self ? self->py_object () : 0, iter, &meth->ret_type ()); + + } else if (meth->ret_type () == s_void_type && self != 0) { + + // simple, yet magical :) + ret = self->py_object (); + Py_INCREF (ret); + + } else { + + ret = pop_arg (meth->ret_type (), retlist, self, heap).release (); + + } + + return ret; +} + +static const gsi::MethodBase * +match_method (int mid, PyObject *self, PyObject *args, bool strict) +{ + const gsi::ClassBase *cls_decl = 0; + + PYAObjectBase *p = 0; + if (! PyType_Check (self)) { + p = PYAObjectBase::from_pyobject (self); + cls_decl = p->cls_decl (); + } else { + cls_decl = PythonModule::cls_for_type ((PyTypeObject *) self); + } + + tl_assert (cls_decl != 0); + + int argc = args == NULL ? 0 : int (PyTuple_Size (args)); + + // get number of candidates by argument count + const gsi::MethodBase *meth = 0; + unsigned int candidates = 0; + + const MethodTable *mt = MethodTable::method_table_by_class (cls_decl); + tl_assert (mt); + + // locate the method in the base classes method table if necessary + while (mid < int (mt->bottom_mid ())) { + + tl_assert (cls_decl->base ()); + cls_decl = cls_decl->base (); + mt = MethodTable::method_table_by_class (cls_decl); + tl_assert (mt); + + } + + for (MethodTableEntry::method_iterator m = mt->begin (mid); m != mt->end (mid); ++m) { + + if ((*m)->is_callback()) { + + // ignore callbacks + + } else if ((*m)->compatible_with_num_args (argc)) { + + ++candidates; + meth = *m; + + } + + } + + // no candidate -> error + if (! meth) { + + if (! strict) { + return 0; + } + + std::set nargs; + for (MethodTableEntry::method_iterator m = mt->begin (mid); m != mt->end (mid); ++m) { + if (! (*m)->is_callback ()) { + nargs.insert (std::distance ((*m)->begin_arguments (), (*m)->end_arguments ())); + } + } + + std::string nargs_s; + for (std::set::const_iterator na = nargs.begin (); na != nargs.end (); ++na) { + if (na != nargs.begin ()) { + nargs_s += "/"; + } + nargs_s += tl::to_string (*na); + } + + throw tl::Exception (tl::sprintf (tl::to_string (tr ("Invalid number of arguments (got %d, expected %s)")), argc, nargs_s)); + + } + + // more than one candidate -> refine by checking the arguments + if (candidates > 1) { + + meth = 0; + candidates = 0; + int score = 0; + bool const_matching = true; + + for (MethodTableEntry::method_iterator m = mt->begin (mid); m != mt->end (mid); ++m) { + + if (! (*m)->is_callback ()) { + + // check arguments (count and type) + bool is_valid = (*m)->compatible_with_num_args (argc); + int sc = 0; + int i = 0; + for (gsi::MethodBase::argument_iterator a = (*m)->begin_arguments (); is_valid && i < argc && a != (*m)->end_arguments (); ++a, ++i) { + if (test_arg (*a, PyTuple_GetItem (args, i), false /*strict*/)) { + ++sc; + } else if (test_arg (*a, PyTuple_GetItem (args, i), true /*loose*/)) { + // non-scoring match + } else { + is_valid = false; + } + } + + if (is_valid && p) { + + // constness matching candidates have precedence + if ((*m)->is_const () != p->const_ref ()) { + if (const_matching && candidates > 0) { + is_valid = false; + } else { + const_matching = false; + } + } else if (! const_matching) { + const_matching = true; + candidates = 0; + } + + } + + if (is_valid) { + + // otherwise take the candidate with the better score + if (candidates > 0 && sc > score) { + candidates = 1; + meth = *m; + score = sc; + } else if (candidates == 0 || sc == score) { + ++candidates; + meth = *m; + score = sc; + } + + } + + } + + } + + } + + if (! meth) { + if (! strict) { + return 0; + } else { + throw tl::TypeError (tl::to_string (tr ("No overload with matching arguments"))); + } + } + + if (candidates > 1) { + if (! strict) { + return 0; + } else { + throw tl::TypeError (tl::to_string (tr ("Ambiguous overload variants - multiple method declarations match arguments"))); + } + } + + return meth; +} + +/** + * @brief Implements dup + */ +static PyObject * +object_dup (PyObject *self, PyObject *args) +{ + const gsi::ClassBase *cls_decl_self = PythonModule::cls_for_type (Py_TYPE (self)); + tl_assert (cls_decl_self != 0); + + if (! PyArg_ParseTuple (args, "")) { + return NULL; + } + + if (! cls_decl_self->can_copy ()) { + throw tl::Exception (tl::to_string (tr ("No copy constructor provided for class '%s'")), cls_decl_self->name ()); + } + + PyObject *new_object = Py_TYPE (self)->tp_alloc (Py_TYPE (self), 0); + PythonRef obj (new_object); + PYAObjectBase *new_pya_base = PYAObjectBase::from_pyobject_unsafe (new_object); + new (new_pya_base) PYAObjectBase (cls_decl_self, new_object); + new_pya_base->set (cls_decl_self->clone (PYAObjectBase::from_pyobject (self)->obj ()), true, false, false); + + return obj.release (); +} + +/** + * @brief Implements assign + */ +static PyObject * +object_assign (PyObject *self, PyObject *args) +{ + const gsi::ClassBase *cls_decl_self = PythonModule::cls_for_type (Py_TYPE (self)); + tl_assert (cls_decl_self != 0); + + PyObject *src = NULL; + if (! PyArg_ParseTuple (args, "O", &src)) { + return NULL; + } + + const gsi::ClassBase *cls_decl_src = PythonModule::cls_for_type (Py_TYPE (src)); + tl_assert (cls_decl_src != 0); + + if (cls_decl_src != cls_decl_self) { + throw tl::Exception (tl::to_string (tr ("Type is not identical on assign"))); + } + if (! cls_decl_self->can_copy ()) { + throw tl::Exception (tl::to_string (tr ("No assignment provided for class '%s'")), cls_decl_self->name ()); + } + + cls_decl_self->assign ((PYAObjectBase::from_pyobject (self))->obj (), (PYAObjectBase::from_pyobject (src))->obj ()); + + Py_INCREF (self); + return self; +} + +/** + * @brief Default implementation of "__ne__" + */ +PyObject * +object_default_ne_impl (PyObject *self, PyObject *args) +{ + PyObject *eq_method = PyObject_GetAttrString (self, "__eq__"); + tl_assert (eq_method != NULL); + + PythonRef res (PyObject_Call (eq_method, args, NULL)); + if (! res) { + return NULL; + } else { + return c2python (! python2c (res.get ())); + } +} + +/** + * @brief Default implementation of "__ge__" + */ +PyObject * +object_default_ge_impl (PyObject *self, PyObject *args) +{ + PyObject *eq_method = PyObject_GetAttrString (self, "__lt__"); + tl_assert (eq_method != NULL); + + PythonRef res (PyObject_Call (eq_method, args, NULL)); + if (! res) { + return NULL; + } else { + return c2python (! python2c (res.get ())); + } +} + +/** + * @brief Default implementation of "__le__" + */ +PyObject * +object_default_le_impl (PyObject *self, PyObject *args) +{ + PyObject *eq_method = PyObject_GetAttrString (self, "__eq__"); + tl_assert (eq_method != NULL); + + PyObject *lt_method = PyObject_GetAttrString (self, "__lt__"); + tl_assert (lt_method != NULL); + + PythonRef eq_res (PyObject_Call (eq_method, args, NULL)); + if (! eq_res) { + return NULL; + } + PythonRef lt_res (PyObject_Call (lt_method, args, NULL)); + if (! lt_res) { + return NULL; + } + return c2python (python2c (eq_res.get ()) || python2c (lt_res.get ())); +} + +/** + * @brief Default implementation of "__gt__" + */ +PyObject * +object_default_gt_impl (PyObject *self, PyObject *args) +{ + PyObject *eq_method = PyObject_GetAttrString (self, "__eq__"); + tl_assert (eq_method != NULL); + + PyObject *lt_method = PyObject_GetAttrString (self, "__lt__"); + tl_assert (lt_method != NULL); + + PythonRef eq_res (PyObject_Call (eq_method, args, NULL)); + if (! eq_res) { + return NULL; + } + PythonRef lt_res (PyObject_Call (lt_method, args, NULL)); + if (! lt_res) { + return NULL; + } + return c2python (! (python2c (eq_res.get ()) || python2c (lt_res.get ()))); +} + +/** + * @brief Implements create + */ +static PyObject * +object_create (PyObject *self, PyObject *args) +{ + if (! PyArg_ParseTuple (args, "")) { + return NULL; + } + + (PYAObjectBase::from_pyobject (self))->obj (); + Py_RETURN_NONE; +} + +/** + * @brief Implements release + */ +static PyObject * +object_release (PyObject *self, PyObject *args) +{ + if (! PyArg_ParseTuple (args, "")) { + return NULL; + } + + (PYAObjectBase::from_pyobject (self))->release (); + Py_RETURN_NONE; +} + +/** + * @brief Implements keep + */ +static PyObject * +object_keep (PyObject *self, PyObject *args) +{ + if (! PyArg_ParseTuple (args, "")) { + return NULL; + } + + (PYAObjectBase::from_pyobject (self))->keep (); + Py_RETURN_NONE; +} + +/** + * @brief Implements destroy + */ +static PyObject * +object_destroy (PyObject *self, PyObject *args) +{ + if (! PyArg_ParseTuple (args, "")) { + return NULL; + } + + (PYAObjectBase::from_pyobject (self))->destroy (); + Py_RETURN_NONE; +} + +/** + * @brief Implements destroyed + */ +static PyObject * +object_destroyed (PyObject *self, PyObject *args) +{ + if (! PyArg_ParseTuple (args, "")) { + return NULL; + } + + return c2python (PYAObjectBase::from_pyobject (self)->destroyed ()); +} + +/** + * @brief Implements is_const + */ +static PyObject * +object_is_const (PyObject *self, PyObject *args) +{ + if (! PyArg_ParseTuple (args, "")) { + return NULL; + } + + return c2python (PYAObjectBase::from_pyobject (self)->const_ref ()); +} + +static PyObject * +special_method_impl (gsi::MethodBase::special_method_type smt, PyObject *self, PyObject *args) +{ + if (smt == gsi::MethodBase::Destroy) { + return object_destroy (self, args); + } else if (smt == gsi::MethodBase::Keep) { + return object_keep (self, args); + } else if (smt == gsi::MethodBase::Release) { + return object_release (self, args); + } else if (smt == gsi::MethodBase::Create) { + return object_create (self, args); + } else if (smt == gsi::MethodBase::IsConst) { + return object_is_const (self, args); + } else if (smt == gsi::MethodBase::Destroyed) { + return object_destroyed (self, args); + } else if (smt == gsi::MethodBase::Assign) { + return object_assign (self, args); + } else if (smt == gsi::MethodBase::Dup) { + return object_dup (self, args); + } else { + Py_RETURN_NONE; + } +} + +static void +push_args (gsi::SerialArgs &arglist, const gsi::MethodBase *meth, PyObject *args, tl::Heap &heap) +{ + int i = 0; + int argc = args == NULL ? 0 : int (PyTuple_Size (args)); + + try { + + for (gsi::MethodBase::argument_iterator a = meth->begin_arguments (); i < argc && a != meth->end_arguments (); ++a, ++i) { + push_arg (*a, arglist, PyTuple_GetItem (args, i), heap); + } + + } catch (tl::Exception &ex) { + + // In case of an error upon write, pop the arguments to clean them up. + // Without this, there is a risk to keep dead objects on the stack. + for (gsi::MethodBase::argument_iterator a = meth->begin_arguments (); a != meth->end_arguments () && arglist; ++a) { + pop_arg (*a, arglist, 0, heap); + } + + std::string msg; + const gsi::ArgSpecBase *arg_spec = meth->begin_arguments () [i].spec (); + + if (arg_spec && ! arg_spec->name ().empty ()) { + msg = tl::sprintf (tl::to_string (tr ("%s for argument #%d ('%s')")), ex.basic_msg (), i + 1, arg_spec->name ()); + } else { + msg = tl::sprintf (tl::to_string (tr ("%s for argument #%d")), ex.basic_msg (), i + 1); + } + + ex.set_basic_msg (msg); + throw ex; + + } catch (...) { + + // In case of an error upon write, pop the arguments to clean them up. + // Without this, there is a risk to keep dead objects on the stack. + for (gsi::MethodBase::argument_iterator a = meth->begin_arguments (); a != meth->end_arguments () && arglist; ++a) { + pop_arg (*a, arglist, 0, heap); + } + + throw; + + } +} + +static PyObject * +method_adaptor (int mid, PyObject *self, PyObject *args) +{ + PyObject *ret = NULL; + + PYA_TRY + + const gsi::MethodBase *meth = match_method (mid, self, args, true); + + // handle special methods + if (meth->smt () != gsi::MethodBase::None) { + + ret = special_method_impl (meth->smt (), self, args); + + } else { + + PYAObjectBase *p = 0; + if (! PyType_Check (self)) { + // non-static method + p = PYAObjectBase::from_pyobject (self); + } + + tl::Heap heap; + + if (p && p->const_ref () && ! meth->is_const ()) { + throw tl::Exception (tl::to_string (tr ("Cannot call non-const method on a const reference"))); + } + + void *obj = 0; + if (p) { + // Hint: this potentially instantiates the object + obj = p->obj (); + } + + gsi::SerialArgs retlist (meth->retsize ()); + gsi::SerialArgs arglist (meth->argsize ()); + + push_args (arglist, meth, args, heap); + + meth->call (obj, arglist, retlist); + + ret = get_return_value (p, retlist, meth, heap); + + if (ret == NULL) { + Py_INCREF (Py_None); + ret = Py_None; + } + + } + + PYA_CATCH(method_name_from_id (mid, self)) + + return ret; +} + +static PyObject *property_getter_impl (int mid, PyObject *self); + +static PyObject * +property_getter_adaptor (int mid, PyObject *self, PyObject *args) +{ + PyObject *ret = NULL; + + PYA_TRY + + int argc = args == NULL ? 0 : int (PyTuple_Size (args)); + if (argc != 0) { + throw tl::Exception (tl::to_string (tr ("Property getters must not have an argument"))); + } + + ret = property_getter_impl (mid, self); + + PYA_CATCH(property_name_from_id (mid, self)) + + return ret; +} + +static PyObject *property_setter_impl (int mid, PyObject *self, PyObject *value); + +static PyObject * +property_setter_adaptor (int mid, PyObject *self, PyObject *args) +{ + PyObject *ret = NULL; + + PYA_TRY + + int argc = args == NULL ? 0 : int (PyTuple_Size (args)); + if (argc != 1) { + throw tl::Exception (tl::to_string (tr ("Property setter needs exactly one argument"))); + } + + PyObject *value = PyTuple_GetItem (args, 0); + if (value) { + ret = property_setter_impl (mid, self, value); + } + + PYA_CATCH(property_name_from_id (mid, self)) + + return ret; +} + +/** + * @brief __init__ implementation (bound to method ith id 'mid') + */ +static PyObject * +method_init_adaptor (int mid, PyObject *self, PyObject *args) +{ + PYA_TRY + + PYAObjectBase *p = PYAObjectBase::from_pyobject (self); + + // delete any object which we may have already + if (p->is_attached ()) { + p->destroy (); + } + + const gsi::MethodBase *meth = match_method (mid, self, args, PyTuple_Size (args) > 0 || ! p->cls_decl ()->can_default_create ()); + + if (meth && meth->smt () == gsi::MethodBase::None) { + + tl::Heap heap; + + gsi::SerialArgs retlist (meth->retsize ()); + gsi::SerialArgs arglist (meth->argsize ()); + + push_args (arglist, meth, args, heap); + + meth->call (0, arglist, retlist); + + void *obj = retlist.read (heap); + if (obj) { + p->set (obj, true, false, true); + } + + } else { + + // No action required - the object is default-created later once it is really required. + if (! PyArg_ParseTuple (args, "")) { + return NULL; + } + + } + + Py_RETURN_NONE; + + PYA_CATCH(method_name_from_id (mid, self)) + + return NULL; +} + + +static PyObject * +property_getter_impl (int mid, PyObject *self) +{ + const gsi::ClassBase *cls_decl; + + PYAObjectBase *p = 0; + if (! PyType_Check (self)) { + p = PYAObjectBase::from_pyobject (self); + cls_decl = p->cls_decl (); + } else { + cls_decl = PythonModule::cls_for_type ((PyTypeObject *) self); + } + + const MethodTable *mt = MethodTable::method_table_by_class (cls_decl); + tl_assert (mt); + + // locate the method in the base classes method table if necessary + while (mid < int (mt->bottom_property_mid ())) { + + tl_assert (cls_decl->base ()); + cls_decl = cls_decl->base (); + mt = MethodTable::method_table_by_class (cls_decl); + tl_assert (mt); + + } + + // fetch the (only) getter method + const gsi::MethodBase *meth = 0; + if (mt->begin_getters (mid) != mt->end_getters (mid)) { + meth = *mt->begin_getters (mid); + } else { + throw tl::Exception (tl::to_string (tr ("Internal error: cannot locate getter method"))); + } + + if (meth->is_signal ()) { + + // a signal getter is implemented as returning a proxy object for the signal which allows manipulation + // of the signal + tl_assert (p != 0); // no static signals + return PYASignal::create (self, p->signal_handler (meth)); + + } else { + + // getter must not have arguments + if (meth->argsize () > 0) { + throw tl::Exception (tl::to_string (tr ("Internal error: getters must not have arguments"))); + } + + void *obj = 0; + if (p) { + // Hint: this potentially instantiates the object + obj = p->obj (); + } + + tl::Heap heap; + + gsi::SerialArgs retlist (meth->retsize ()); + gsi::SerialArgs arglist (0); + meth->call (obj, arglist, retlist); + + PyObject *ret = get_return_value (p, retlist, meth, heap); + + if (ret == NULL) { + Py_INCREF (Py_None); + ret = Py_None; + } + + return ret; + + } +} + +PyObject * +property_getter_func (PyObject *self, void *closure) +{ + PyObject *ret = NULL; + PYA_TRY + ret = property_getter_impl (getter_from_closure (closure), self); + PYA_CATCH(property_name_from_id (getter_from_closure (closure), self)) + return ret; +} + +static PyObject * +property_setter_impl (int mid, PyObject *self, PyObject *value) +{ + const gsi::ClassBase *cls_decl; + + PYAObjectBase *p = 0; + if (! PyType_Check (self)) { + p = PYAObjectBase::from_pyobject (self); + cls_decl = p->cls_decl (); + } else { + cls_decl = PythonModule::cls_for_type ((PyTypeObject *) self); + } + + if (p && p->const_ref ()) { + throw tl::Exception (tl::to_string (tr ("Cannot call a setter on a const reference"))); + } + + const MethodTable *mt = MethodTable::method_table_by_class (cls_decl); + tl_assert (mt); + + // locate the method in the base classes method table if necessary + while (mid < int (mt->bottom_property_mid ())) { + + tl_assert (cls_decl->base ()); + cls_decl = cls_decl->base (); + mt = MethodTable::method_table_by_class (cls_decl); + tl_assert (mt); + + } + + if (mt->begin_setters (mid) == mt->end_setters (mid)) { + throw tl::Exception (tl::to_string (tr ("Internal error: cannot locate setter method"))); + } + + const gsi::MethodBase *meth = 0; + int candidates = 0; + + // Find the setter among the methods + for (MethodTableEntry::method_iterator m = mt->begin_setters (mid); m != mt->end_setters (mid); ++m) { + + if ((*m)->is_signal ()) { + + candidates = 1; + meth = *m; + break; + + } else if ((*m)->compatible_with_num_args (1)) { + + ++candidates; + meth = *m; + + } + + } + + // no candidate -> error + if (! meth) { + throw tl::Exception (tl::to_string (tr ("Internal error: no setter compatible with one argument"))); + } + + // more than one candidate -> refine by checking the arguments + if (candidates > 1) { + + // two passes where the second is with loose checking + int pass = 0; + + do { + + meth = 0; + candidates = 0; + + for (MethodTableEntry::method_iterator m = mt->begin_setters (mid); m != mt->end_setters (mid); ++m) { + + // check arguments (count and type) + bool is_valid = (*m)->compatible_with_num_args (1); + if (is_valid && ! test_arg (*(*m)->begin_arguments (), value, pass != 0 /*loose in the second pass*/)) { + is_valid = false; + } + + if (is_valid) { + ++candidates; + meth = *m; + } + + } + + ++pass; + + } while (! meth && pass < 2); + + } + + if (! meth) { + throw tl::Exception (tl::to_string (tr ("No setter overload with matching arguments"))); + } else if (candidates > 1) { + throw tl::Exception (tl::to_string (tr ("Ambiguous overload variants - multiple setter declarations match arguments"))); + } + + void *obj = 0; + if (p) { + // Hint: this potentially instantiates the object + obj = p->obj (); + } + + if (meth->is_signal ()) { + + if (!p) { + + // TODO: Static signals? + + } else if (PyObject_IsInstance (value, (PyObject *) PYASignal::cls)) { + + // assigning a signal to a signal works if it applies to the same handler - + // this simplifies the implementation of += and -=. + if (p->signal_handler (meth) != ((PYASignal *) value)->handler.get ()) { + throw tl::Exception (tl::to_string (tr ("Invalid assignment of signal to signal"))); + } + + } else if (value == Py_None) { + + // assigning None means "clear" + p->signal_handler (meth)->clear (); + + } else if (! PyCallable_Check (value)) { + throw tl::Exception (tl::to_string (tr ("A signal needs to be assigned a callable object"))); + } else { + + // assigning a callable + pya::SignalHandler *handler = p->signal_handler (meth); + handler->clear (); + handler->add (value); + + } + + Py_RETURN_NONE; + + } else { + + gsi::SerialArgs retlist (meth->retsize ()); + gsi::SerialArgs arglist (meth->argsize ()); + + tl::Heap heap; + gsi::MethodBase::argument_iterator a = meth->begin_arguments (); + push_arg (*a, arglist, value, heap); + + meth->call (obj, arglist, retlist); + + return get_return_value (p, retlist, meth, heap); + + } +} + +int +property_setter_func (PyObject *self, PyObject *value, void *closure) +{ + int res = -1; + + PYA_TRY + + PyObject *ret = property_setter_impl (setter_from_closure (closure), self, value); + + // ignore the result + if (ret != NULL) { + Py_DECREF (ret); + } + + res = 0; + + PYA_CATCH(property_name_from_id (setter_from_closure (closure), self)) + + return res; +} + +// Adaptor arrays + +template +PyObject *method_adaptor (PyObject *self, PyObject *args) +{ + return method_adaptor (N, self, args); +} + +static py_func_ptr_t method_adaptors [] = +{ + &method_adaptor<0x000>, &method_adaptor<0x001>, &method_adaptor<0x002>, &method_adaptor<0x003>, &method_adaptor<0x004>, &method_adaptor<0x005>, &method_adaptor<0x006>, &method_adaptor<0x007>, + &method_adaptor<0x008>, &method_adaptor<0x009>, &method_adaptor<0x00a>, &method_adaptor<0x00b>, &method_adaptor<0x00c>, &method_adaptor<0x00d>, &method_adaptor<0x00e>, &method_adaptor<0x00f>, + &method_adaptor<0x010>, &method_adaptor<0x011>, &method_adaptor<0x012>, &method_adaptor<0x013>, &method_adaptor<0x014>, &method_adaptor<0x015>, &method_adaptor<0x016>, &method_adaptor<0x017>, + &method_adaptor<0x018>, &method_adaptor<0x019>, &method_adaptor<0x01a>, &method_adaptor<0x01b>, &method_adaptor<0x01c>, &method_adaptor<0x01d>, &method_adaptor<0x01e>, &method_adaptor<0x01f>, + &method_adaptor<0x020>, &method_adaptor<0x021>, &method_adaptor<0x022>, &method_adaptor<0x023>, &method_adaptor<0x024>, &method_adaptor<0x025>, &method_adaptor<0x026>, &method_adaptor<0x027>, + &method_adaptor<0x028>, &method_adaptor<0x029>, &method_adaptor<0x02a>, &method_adaptor<0x02b>, &method_adaptor<0x02c>, &method_adaptor<0x02d>, &method_adaptor<0x02e>, &method_adaptor<0x02f>, + &method_adaptor<0x030>, &method_adaptor<0x031>, &method_adaptor<0x032>, &method_adaptor<0x033>, &method_adaptor<0x034>, &method_adaptor<0x035>, &method_adaptor<0x036>, &method_adaptor<0x037>, + &method_adaptor<0x038>, &method_adaptor<0x039>, &method_adaptor<0x03a>, &method_adaptor<0x03b>, &method_adaptor<0x03c>, &method_adaptor<0x03d>, &method_adaptor<0x03e>, &method_adaptor<0x03f>, + &method_adaptor<0x040>, &method_adaptor<0x041>, &method_adaptor<0x042>, &method_adaptor<0x043>, &method_adaptor<0x044>, &method_adaptor<0x045>, &method_adaptor<0x046>, &method_adaptor<0x047>, + &method_adaptor<0x048>, &method_adaptor<0x049>, &method_adaptor<0x04a>, &method_adaptor<0x04b>, &method_adaptor<0x04c>, &method_adaptor<0x04d>, &method_adaptor<0x04e>, &method_adaptor<0x04f>, + &method_adaptor<0x050>, &method_adaptor<0x051>, &method_adaptor<0x052>, &method_adaptor<0x053>, &method_adaptor<0x054>, &method_adaptor<0x055>, &method_adaptor<0x056>, &method_adaptor<0x057>, + &method_adaptor<0x058>, &method_adaptor<0x059>, &method_adaptor<0x05a>, &method_adaptor<0x05b>, &method_adaptor<0x05c>, &method_adaptor<0x05d>, &method_adaptor<0x05e>, &method_adaptor<0x05f>, + &method_adaptor<0x060>, &method_adaptor<0x061>, &method_adaptor<0x062>, &method_adaptor<0x063>, &method_adaptor<0x064>, &method_adaptor<0x065>, &method_adaptor<0x066>, &method_adaptor<0x067>, + &method_adaptor<0x068>, &method_adaptor<0x069>, &method_adaptor<0x06a>, &method_adaptor<0x06b>, &method_adaptor<0x06c>, &method_adaptor<0x06d>, &method_adaptor<0x06e>, &method_adaptor<0x06f>, + &method_adaptor<0x070>, &method_adaptor<0x071>, &method_adaptor<0x072>, &method_adaptor<0x073>, &method_adaptor<0x074>, &method_adaptor<0x075>, &method_adaptor<0x076>, &method_adaptor<0x077>, + &method_adaptor<0x078>, &method_adaptor<0x079>, &method_adaptor<0x07a>, &method_adaptor<0x07b>, &method_adaptor<0x07c>, &method_adaptor<0x07d>, &method_adaptor<0x07e>, &method_adaptor<0x07f>, + &method_adaptor<0x080>, &method_adaptor<0x081>, &method_adaptor<0x082>, &method_adaptor<0x083>, &method_adaptor<0x084>, &method_adaptor<0x085>, &method_adaptor<0x086>, &method_adaptor<0x087>, + &method_adaptor<0x088>, &method_adaptor<0x089>, &method_adaptor<0x08a>, &method_adaptor<0x08b>, &method_adaptor<0x08c>, &method_adaptor<0x08d>, &method_adaptor<0x08e>, &method_adaptor<0x08f>, + &method_adaptor<0x090>, &method_adaptor<0x091>, &method_adaptor<0x092>, &method_adaptor<0x093>, &method_adaptor<0x094>, &method_adaptor<0x095>, &method_adaptor<0x096>, &method_adaptor<0x097>, + &method_adaptor<0x098>, &method_adaptor<0x099>, &method_adaptor<0x09a>, &method_adaptor<0x09b>, &method_adaptor<0x09c>, &method_adaptor<0x09d>, &method_adaptor<0x09e>, &method_adaptor<0x09f>, + &method_adaptor<0x0a0>, &method_adaptor<0x0a1>, &method_adaptor<0x0a2>, &method_adaptor<0x0a3>, &method_adaptor<0x0a4>, &method_adaptor<0x0a5>, &method_adaptor<0x0a6>, &method_adaptor<0x0a7>, + &method_adaptor<0x0a8>, &method_adaptor<0x0a9>, &method_adaptor<0x0aa>, &method_adaptor<0x0ab>, &method_adaptor<0x0ac>, &method_adaptor<0x0ad>, &method_adaptor<0x0ae>, &method_adaptor<0x0af>, + &method_adaptor<0x0b0>, &method_adaptor<0x0b1>, &method_adaptor<0x0b2>, &method_adaptor<0x0b3>, &method_adaptor<0x0b4>, &method_adaptor<0x0b5>, &method_adaptor<0x0b6>, &method_adaptor<0x0b7>, + &method_adaptor<0x0b8>, &method_adaptor<0x0b9>, &method_adaptor<0x0ba>, &method_adaptor<0x0bb>, &method_adaptor<0x0bc>, &method_adaptor<0x0bd>, &method_adaptor<0x0be>, &method_adaptor<0x0bf>, + &method_adaptor<0x0c0>, &method_adaptor<0x0c1>, &method_adaptor<0x0c2>, &method_adaptor<0x0c3>, &method_adaptor<0x0c4>, &method_adaptor<0x0c5>, &method_adaptor<0x0c6>, &method_adaptor<0x0c7>, + &method_adaptor<0x0c8>, &method_adaptor<0x0c9>, &method_adaptor<0x0ca>, &method_adaptor<0x0cb>, &method_adaptor<0x0cc>, &method_adaptor<0x0cd>, &method_adaptor<0x0ce>, &method_adaptor<0x0cf>, + &method_adaptor<0x0d0>, &method_adaptor<0x0d1>, &method_adaptor<0x0d2>, &method_adaptor<0x0d3>, &method_adaptor<0x0d4>, &method_adaptor<0x0d5>, &method_adaptor<0x0d6>, &method_adaptor<0x0d7>, + &method_adaptor<0x0d8>, &method_adaptor<0x0d9>, &method_adaptor<0x0da>, &method_adaptor<0x0db>, &method_adaptor<0x0dc>, &method_adaptor<0x0dd>, &method_adaptor<0x0de>, &method_adaptor<0x0df>, + &method_adaptor<0x0e0>, &method_adaptor<0x0e1>, &method_adaptor<0x0e2>, &method_adaptor<0x0e3>, &method_adaptor<0x0e4>, &method_adaptor<0x0e5>, &method_adaptor<0x0e6>, &method_adaptor<0x0e7>, + &method_adaptor<0x0e8>, &method_adaptor<0x0e9>, &method_adaptor<0x0ea>, &method_adaptor<0x0eb>, &method_adaptor<0x0ec>, &method_adaptor<0x0ed>, &method_adaptor<0x0ee>, &method_adaptor<0x0ef>, + &method_adaptor<0x0f0>, &method_adaptor<0x0f1>, &method_adaptor<0x0f2>, &method_adaptor<0x0f3>, &method_adaptor<0x0f4>, &method_adaptor<0x0f5>, &method_adaptor<0x0f6>, &method_adaptor<0x0f7>, + &method_adaptor<0x0f8>, &method_adaptor<0x0f9>, &method_adaptor<0x0fa>, &method_adaptor<0x0fb>, &method_adaptor<0x0fc>, &method_adaptor<0x0fd>, &method_adaptor<0x0fe>, &method_adaptor<0x0ff>, + &method_adaptor<0x100>, &method_adaptor<0x101>, &method_adaptor<0x102>, &method_adaptor<0x103>, &method_adaptor<0x104>, &method_adaptor<0x105>, &method_adaptor<0x106>, &method_adaptor<0x107>, + &method_adaptor<0x108>, &method_adaptor<0x109>, &method_adaptor<0x10a>, &method_adaptor<0x10b>, &method_adaptor<0x10c>, &method_adaptor<0x10d>, &method_adaptor<0x10e>, &method_adaptor<0x10f>, + &method_adaptor<0x110>, &method_adaptor<0x111>, &method_adaptor<0x112>, &method_adaptor<0x113>, &method_adaptor<0x114>, &method_adaptor<0x115>, &method_adaptor<0x116>, &method_adaptor<0x117>, + &method_adaptor<0x118>, &method_adaptor<0x119>, &method_adaptor<0x11a>, &method_adaptor<0x11b>, &method_adaptor<0x11c>, &method_adaptor<0x11d>, &method_adaptor<0x11e>, &method_adaptor<0x11f>, + &method_adaptor<0x120>, &method_adaptor<0x121>, &method_adaptor<0x122>, &method_adaptor<0x123>, &method_adaptor<0x124>, &method_adaptor<0x125>, &method_adaptor<0x126>, &method_adaptor<0x127>, + &method_adaptor<0x128>, &method_adaptor<0x129>, &method_adaptor<0x12a>, &method_adaptor<0x12b>, &method_adaptor<0x12c>, &method_adaptor<0x12d>, &method_adaptor<0x12e>, &method_adaptor<0x12f>, + &method_adaptor<0x130>, &method_adaptor<0x131>, &method_adaptor<0x132>, &method_adaptor<0x133>, &method_adaptor<0x134>, &method_adaptor<0x135>, &method_adaptor<0x136>, &method_adaptor<0x137>, + &method_adaptor<0x138>, &method_adaptor<0x139>, &method_adaptor<0x13a>, &method_adaptor<0x13b>, &method_adaptor<0x13c>, &method_adaptor<0x13d>, &method_adaptor<0x13e>, &method_adaptor<0x13f>, + &method_adaptor<0x140>, &method_adaptor<0x141>, &method_adaptor<0x142>, &method_adaptor<0x143>, &method_adaptor<0x144>, &method_adaptor<0x145>, &method_adaptor<0x146>, &method_adaptor<0x147>, + &method_adaptor<0x148>, &method_adaptor<0x149>, &method_adaptor<0x14a>, &method_adaptor<0x14b>, &method_adaptor<0x14c>, &method_adaptor<0x14d>, &method_adaptor<0x14e>, &method_adaptor<0x14f>, + &method_adaptor<0x150>, &method_adaptor<0x151>, &method_adaptor<0x152>, &method_adaptor<0x153>, &method_adaptor<0x154>, &method_adaptor<0x155>, &method_adaptor<0x156>, &method_adaptor<0x157>, + &method_adaptor<0x158>, &method_adaptor<0x159>, &method_adaptor<0x15a>, &method_adaptor<0x15b>, &method_adaptor<0x15c>, &method_adaptor<0x15d>, &method_adaptor<0x15e>, &method_adaptor<0x15f>, + &method_adaptor<0x160>, &method_adaptor<0x161>, &method_adaptor<0x162>, &method_adaptor<0x163>, &method_adaptor<0x164>, &method_adaptor<0x165>, &method_adaptor<0x166>, &method_adaptor<0x167>, + &method_adaptor<0x168>, &method_adaptor<0x169>, &method_adaptor<0x16a>, &method_adaptor<0x16b>, &method_adaptor<0x16c>, &method_adaptor<0x16d>, &method_adaptor<0x16e>, &method_adaptor<0x16f>, + &method_adaptor<0x170>, &method_adaptor<0x171>, &method_adaptor<0x172>, &method_adaptor<0x173>, &method_adaptor<0x174>, &method_adaptor<0x175>, &method_adaptor<0x176>, &method_adaptor<0x177>, + &method_adaptor<0x178>, &method_adaptor<0x179>, &method_adaptor<0x17a>, &method_adaptor<0x17b>, &method_adaptor<0x17c>, &method_adaptor<0x17d>, &method_adaptor<0x17e>, &method_adaptor<0x17f>, + &method_adaptor<0x180>, &method_adaptor<0x181>, &method_adaptor<0x182>, &method_adaptor<0x183>, &method_adaptor<0x184>, &method_adaptor<0x185>, &method_adaptor<0x186>, &method_adaptor<0x187>, + &method_adaptor<0x188>, &method_adaptor<0x189>, &method_adaptor<0x18a>, &method_adaptor<0x18b>, &method_adaptor<0x18c>, &method_adaptor<0x18d>, &method_adaptor<0x18e>, &method_adaptor<0x18f>, + &method_adaptor<0x190>, &method_adaptor<0x191>, &method_adaptor<0x192>, &method_adaptor<0x193>, &method_adaptor<0x194>, &method_adaptor<0x195>, &method_adaptor<0x196>, &method_adaptor<0x197>, + &method_adaptor<0x198>, &method_adaptor<0x199>, &method_adaptor<0x19a>, &method_adaptor<0x19b>, &method_adaptor<0x19c>, &method_adaptor<0x19d>, &method_adaptor<0x19e>, &method_adaptor<0x19f>, + &method_adaptor<0x1a0>, &method_adaptor<0x1a1>, &method_adaptor<0x1a2>, &method_adaptor<0x1a3>, &method_adaptor<0x1a4>, &method_adaptor<0x1a5>, &method_adaptor<0x1a6>, &method_adaptor<0x1a7>, + &method_adaptor<0x1a8>, &method_adaptor<0x1a9>, &method_adaptor<0x1aa>, &method_adaptor<0x1ab>, &method_adaptor<0x1ac>, &method_adaptor<0x1ad>, &method_adaptor<0x1ae>, &method_adaptor<0x1af>, + &method_adaptor<0x1b0>, &method_adaptor<0x1b1>, &method_adaptor<0x1b2>, &method_adaptor<0x1b3>, &method_adaptor<0x1b4>, &method_adaptor<0x1b5>, &method_adaptor<0x1b6>, &method_adaptor<0x1b7>, + &method_adaptor<0x1b8>, &method_adaptor<0x1b9>, &method_adaptor<0x1ba>, &method_adaptor<0x1bb>, &method_adaptor<0x1bc>, &method_adaptor<0x1bd>, &method_adaptor<0x1be>, &method_adaptor<0x1bf>, + &method_adaptor<0x1c0>, &method_adaptor<0x1c1>, &method_adaptor<0x1c2>, &method_adaptor<0x1c3>, &method_adaptor<0x1c4>, &method_adaptor<0x1c5>, &method_adaptor<0x1c6>, &method_adaptor<0x1c7>, + &method_adaptor<0x1c8>, &method_adaptor<0x1c9>, &method_adaptor<0x1ca>, &method_adaptor<0x1cb>, &method_adaptor<0x1cc>, &method_adaptor<0x1cd>, &method_adaptor<0x1ce>, &method_adaptor<0x1cf>, + &method_adaptor<0x1d0>, &method_adaptor<0x1d1>, &method_adaptor<0x1d2>, &method_adaptor<0x1d3>, &method_adaptor<0x1d4>, &method_adaptor<0x1d5>, &method_adaptor<0x1d6>, &method_adaptor<0x1d7>, + &method_adaptor<0x1d8>, &method_adaptor<0x1d9>, &method_adaptor<0x1da>, &method_adaptor<0x1db>, &method_adaptor<0x1dc>, &method_adaptor<0x1dd>, &method_adaptor<0x1de>, &method_adaptor<0x1df>, + &method_adaptor<0x1e0>, &method_adaptor<0x1e1>, &method_adaptor<0x1e2>, &method_adaptor<0x1e3>, &method_adaptor<0x1e4>, &method_adaptor<0x1e5>, &method_adaptor<0x1e6>, &method_adaptor<0x1e7>, + &method_adaptor<0x1e8>, &method_adaptor<0x1e9>, &method_adaptor<0x1ea>, &method_adaptor<0x1eb>, &method_adaptor<0x1ec>, &method_adaptor<0x1ed>, &method_adaptor<0x1ee>, &method_adaptor<0x1ef>, + &method_adaptor<0x1f0>, &method_adaptor<0x1f1>, &method_adaptor<0x1f2>, &method_adaptor<0x1f3>, &method_adaptor<0x1f4>, &method_adaptor<0x1f5>, &method_adaptor<0x1f6>, &method_adaptor<0x1f7>, + &method_adaptor<0x1f8>, &method_adaptor<0x1f9>, &method_adaptor<0x1fa>, &method_adaptor<0x1fb>, &method_adaptor<0x1fc>, &method_adaptor<0x1fd>, &method_adaptor<0x1fe>, &method_adaptor<0x1ff>, + &method_adaptor<0x200>, &method_adaptor<0x201>, &method_adaptor<0x202>, &method_adaptor<0x203>, &method_adaptor<0x204>, &method_adaptor<0x205>, &method_adaptor<0x206>, &method_adaptor<0x207>, + &method_adaptor<0x208>, &method_adaptor<0x209>, &method_adaptor<0x20a>, &method_adaptor<0x20b>, &method_adaptor<0x20c>, &method_adaptor<0x20d>, &method_adaptor<0x20e>, &method_adaptor<0x20f>, + &method_adaptor<0x210>, &method_adaptor<0x211>, &method_adaptor<0x212>, &method_adaptor<0x213>, &method_adaptor<0x214>, &method_adaptor<0x215>, &method_adaptor<0x216>, &method_adaptor<0x217>, + &method_adaptor<0x218>, &method_adaptor<0x219>, &method_adaptor<0x21a>, &method_adaptor<0x21b>, &method_adaptor<0x21c>, &method_adaptor<0x21d>, &method_adaptor<0x21e>, &method_adaptor<0x21f>, + &method_adaptor<0x220>, &method_adaptor<0x221>, &method_adaptor<0x222>, &method_adaptor<0x223>, &method_adaptor<0x224>, &method_adaptor<0x225>, &method_adaptor<0x226>, &method_adaptor<0x227>, + &method_adaptor<0x228>, &method_adaptor<0x229>, &method_adaptor<0x22a>, &method_adaptor<0x22b>, &method_adaptor<0x22c>, &method_adaptor<0x22d>, &method_adaptor<0x22e>, &method_adaptor<0x22f>, + &method_adaptor<0x230>, &method_adaptor<0x231>, &method_adaptor<0x232>, &method_adaptor<0x233>, &method_adaptor<0x234>, &method_adaptor<0x235>, &method_adaptor<0x236>, &method_adaptor<0x237>, + &method_adaptor<0x238>, &method_adaptor<0x239>, &method_adaptor<0x23a>, &method_adaptor<0x23b>, &method_adaptor<0x23c>, &method_adaptor<0x23d>, &method_adaptor<0x23e>, &method_adaptor<0x23f>, + &method_adaptor<0x240>, &method_adaptor<0x241>, &method_adaptor<0x242>, &method_adaptor<0x243>, &method_adaptor<0x244>, &method_adaptor<0x245>, &method_adaptor<0x246>, &method_adaptor<0x247>, + &method_adaptor<0x248>, &method_adaptor<0x249>, &method_adaptor<0x24a>, &method_adaptor<0x24b>, &method_adaptor<0x24c>, &method_adaptor<0x24d>, &method_adaptor<0x24e>, &method_adaptor<0x24f>, + &method_adaptor<0x250>, &method_adaptor<0x251>, &method_adaptor<0x252>, &method_adaptor<0x253>, &method_adaptor<0x254>, &method_adaptor<0x255>, &method_adaptor<0x256>, &method_adaptor<0x257>, + &method_adaptor<0x258>, &method_adaptor<0x259>, &method_adaptor<0x25a>, &method_adaptor<0x25b>, &method_adaptor<0x25c>, &method_adaptor<0x25d>, &method_adaptor<0x25e>, &method_adaptor<0x25f>, + &method_adaptor<0x260>, &method_adaptor<0x261>, &method_adaptor<0x262>, &method_adaptor<0x263>, &method_adaptor<0x264>, &method_adaptor<0x265>, &method_adaptor<0x266>, &method_adaptor<0x267>, + &method_adaptor<0x268>, &method_adaptor<0x269>, &method_adaptor<0x26a>, &method_adaptor<0x26b>, &method_adaptor<0x26c>, &method_adaptor<0x26d>, &method_adaptor<0x26e>, &method_adaptor<0x26f>, + &method_adaptor<0x270>, &method_adaptor<0x271>, &method_adaptor<0x272>, &method_adaptor<0x273>, &method_adaptor<0x274>, &method_adaptor<0x275>, &method_adaptor<0x276>, &method_adaptor<0x277>, + &method_adaptor<0x278>, &method_adaptor<0x279>, &method_adaptor<0x27a>, &method_adaptor<0x27b>, &method_adaptor<0x27c>, &method_adaptor<0x27d>, &method_adaptor<0x27e>, &method_adaptor<0x27f>, + &method_adaptor<0x280>, &method_adaptor<0x281>, &method_adaptor<0x282>, &method_adaptor<0x283>, &method_adaptor<0x284>, &method_adaptor<0x285>, &method_adaptor<0x286>, &method_adaptor<0x287>, + &method_adaptor<0x288>, &method_adaptor<0x289>, &method_adaptor<0x28a>, &method_adaptor<0x28b>, &method_adaptor<0x28c>, &method_adaptor<0x28d>, &method_adaptor<0x28e>, &method_adaptor<0x28f>, + &method_adaptor<0x290>, &method_adaptor<0x291>, &method_adaptor<0x292>, &method_adaptor<0x293>, &method_adaptor<0x294>, &method_adaptor<0x295>, &method_adaptor<0x296>, &method_adaptor<0x297>, + &method_adaptor<0x298>, &method_adaptor<0x299>, &method_adaptor<0x29a>, &method_adaptor<0x29b>, &method_adaptor<0x29c>, &method_adaptor<0x29d>, &method_adaptor<0x29e>, &method_adaptor<0x29f>, + &method_adaptor<0x2a0>, &method_adaptor<0x2a1>, &method_adaptor<0x2a2>, &method_adaptor<0x2a3>, &method_adaptor<0x2a4>, &method_adaptor<0x2a5>, &method_adaptor<0x2a6>, &method_adaptor<0x2a7>, + &method_adaptor<0x2a8>, &method_adaptor<0x2a9>, &method_adaptor<0x2aa>, &method_adaptor<0x2ab>, &method_adaptor<0x2ac>, &method_adaptor<0x2ad>, &method_adaptor<0x2ae>, &method_adaptor<0x2af>, + &method_adaptor<0x2b0>, &method_adaptor<0x2b1>, &method_adaptor<0x2b2>, &method_adaptor<0x2b3>, &method_adaptor<0x2b4>, &method_adaptor<0x2b5>, &method_adaptor<0x2b6>, &method_adaptor<0x2b7>, + &method_adaptor<0x2b8>, &method_adaptor<0x2b9>, &method_adaptor<0x2ba>, &method_adaptor<0x2bb>, &method_adaptor<0x2bc>, &method_adaptor<0x2bd>, &method_adaptor<0x2be>, &method_adaptor<0x2bf>, + &method_adaptor<0x2c0>, &method_adaptor<0x2c1>, &method_adaptor<0x2c2>, &method_adaptor<0x2c3>, &method_adaptor<0x2c4>, &method_adaptor<0x2c5>, &method_adaptor<0x2c6>, &method_adaptor<0x2c7>, + &method_adaptor<0x2c8>, &method_adaptor<0x2c9>, &method_adaptor<0x2ca>, &method_adaptor<0x2cb>, &method_adaptor<0x2cc>, &method_adaptor<0x2cd>, &method_adaptor<0x2ce>, &method_adaptor<0x2cf>, + &method_adaptor<0x2d0>, &method_adaptor<0x2d1>, &method_adaptor<0x2d2>, &method_adaptor<0x2d3>, &method_adaptor<0x2d4>, &method_adaptor<0x2d5>, &method_adaptor<0x2d6>, &method_adaptor<0x2d7>, + &method_adaptor<0x2d8>, &method_adaptor<0x2d9>, &method_adaptor<0x2da>, &method_adaptor<0x2db>, &method_adaptor<0x2dc>, &method_adaptor<0x2dd>, &method_adaptor<0x2de>, &method_adaptor<0x2df>, + &method_adaptor<0x2e0>, &method_adaptor<0x2e1>, &method_adaptor<0x2e2>, &method_adaptor<0x2e3>, &method_adaptor<0x2e4>, &method_adaptor<0x2e5>, &method_adaptor<0x2e6>, &method_adaptor<0x2e7>, + &method_adaptor<0x2e8>, &method_adaptor<0x2e9>, &method_adaptor<0x2ea>, &method_adaptor<0x2eb>, &method_adaptor<0x2ec>, &method_adaptor<0x2ed>, &method_adaptor<0x2ee>, &method_adaptor<0x2ef>, + &method_adaptor<0x2f0>, &method_adaptor<0x2f1>, &method_adaptor<0x2f2>, &method_adaptor<0x2f3>, &method_adaptor<0x2f4>, &method_adaptor<0x2f5>, &method_adaptor<0x2f6>, &method_adaptor<0x2f7>, + &method_adaptor<0x2f8>, &method_adaptor<0x2f9>, &method_adaptor<0x2fa>, &method_adaptor<0x2fb>, &method_adaptor<0x2fc>, &method_adaptor<0x2fd>, &method_adaptor<0x2fe>, &method_adaptor<0x2ff>, + &method_adaptor<0x300>, &method_adaptor<0x301>, &method_adaptor<0x302>, &method_adaptor<0x303>, &method_adaptor<0x304>, &method_adaptor<0x305>, &method_adaptor<0x306>, &method_adaptor<0x307>, + &method_adaptor<0x308>, &method_adaptor<0x309>, &method_adaptor<0x30a>, &method_adaptor<0x30b>, &method_adaptor<0x30c>, &method_adaptor<0x30d>, &method_adaptor<0x30e>, &method_adaptor<0x30f>, + &method_adaptor<0x310>, &method_adaptor<0x311>, &method_adaptor<0x312>, &method_adaptor<0x313>, &method_adaptor<0x314>, &method_adaptor<0x315>, &method_adaptor<0x316>, &method_adaptor<0x317>, + &method_adaptor<0x318>, &method_adaptor<0x319>, &method_adaptor<0x31a>, &method_adaptor<0x31b>, &method_adaptor<0x31c>, &method_adaptor<0x31d>, &method_adaptor<0x31e>, &method_adaptor<0x31f>, + &method_adaptor<0x320>, &method_adaptor<0x321>, &method_adaptor<0x322>, &method_adaptor<0x323>, &method_adaptor<0x324>, &method_adaptor<0x325>, &method_adaptor<0x326>, &method_adaptor<0x327>, + &method_adaptor<0x328>, &method_adaptor<0x329>, &method_adaptor<0x32a>, &method_adaptor<0x32b>, &method_adaptor<0x32c>, &method_adaptor<0x32d>, &method_adaptor<0x32e>, &method_adaptor<0x32f>, + &method_adaptor<0x330>, &method_adaptor<0x331>, &method_adaptor<0x332>, &method_adaptor<0x333>, &method_adaptor<0x334>, &method_adaptor<0x335>, &method_adaptor<0x336>, &method_adaptor<0x337>, + &method_adaptor<0x338>, &method_adaptor<0x339>, &method_adaptor<0x33a>, &method_adaptor<0x33b>, &method_adaptor<0x33c>, &method_adaptor<0x33d>, &method_adaptor<0x33e>, &method_adaptor<0x33f>, + &method_adaptor<0x340>, &method_adaptor<0x341>, &method_adaptor<0x342>, &method_adaptor<0x343>, &method_adaptor<0x344>, &method_adaptor<0x345>, &method_adaptor<0x346>, &method_adaptor<0x347>, + &method_adaptor<0x348>, &method_adaptor<0x349>, &method_adaptor<0x34a>, &method_adaptor<0x34b>, &method_adaptor<0x34c>, &method_adaptor<0x34d>, &method_adaptor<0x34e>, &method_adaptor<0x34f>, + &method_adaptor<0x350>, &method_adaptor<0x351>, &method_adaptor<0x352>, &method_adaptor<0x353>, &method_adaptor<0x354>, &method_adaptor<0x355>, &method_adaptor<0x356>, &method_adaptor<0x357>, + &method_adaptor<0x358>, &method_adaptor<0x359>, &method_adaptor<0x35a>, &method_adaptor<0x35b>, &method_adaptor<0x35c>, &method_adaptor<0x35d>, &method_adaptor<0x35e>, &method_adaptor<0x35f>, + &method_adaptor<0x360>, &method_adaptor<0x361>, &method_adaptor<0x362>, &method_adaptor<0x363>, &method_adaptor<0x364>, &method_adaptor<0x365>, &method_adaptor<0x366>, &method_adaptor<0x367>, + &method_adaptor<0x368>, &method_adaptor<0x369>, &method_adaptor<0x36a>, &method_adaptor<0x36b>, &method_adaptor<0x36c>, &method_adaptor<0x36d>, &method_adaptor<0x36e>, &method_adaptor<0x36f>, + &method_adaptor<0x370>, &method_adaptor<0x371>, &method_adaptor<0x372>, &method_adaptor<0x373>, &method_adaptor<0x374>, &method_adaptor<0x375>, &method_adaptor<0x376>, &method_adaptor<0x377>, + &method_adaptor<0x378>, &method_adaptor<0x379>, &method_adaptor<0x37a>, &method_adaptor<0x37b>, &method_adaptor<0x37c>, &method_adaptor<0x37d>, &method_adaptor<0x37e>, &method_adaptor<0x37f>, + &method_adaptor<0x380>, &method_adaptor<0x381>, &method_adaptor<0x382>, &method_adaptor<0x383>, &method_adaptor<0x384>, &method_adaptor<0x385>, &method_adaptor<0x386>, &method_adaptor<0x387>, + &method_adaptor<0x388>, &method_adaptor<0x389>, &method_adaptor<0x38a>, &method_adaptor<0x38b>, &method_adaptor<0x38c>, &method_adaptor<0x38d>, &method_adaptor<0x38e>, &method_adaptor<0x38f>, + &method_adaptor<0x390>, &method_adaptor<0x391>, &method_adaptor<0x392>, &method_adaptor<0x393>, &method_adaptor<0x394>, &method_adaptor<0x395>, &method_adaptor<0x396>, &method_adaptor<0x397>, + &method_adaptor<0x398>, &method_adaptor<0x399>, &method_adaptor<0x39a>, &method_adaptor<0x39b>, &method_adaptor<0x39c>, &method_adaptor<0x39d>, &method_adaptor<0x39e>, &method_adaptor<0x39f>, + &method_adaptor<0x3a0>, &method_adaptor<0x3a1>, &method_adaptor<0x3a2>, &method_adaptor<0x3a3>, &method_adaptor<0x3a4>, &method_adaptor<0x3a5>, &method_adaptor<0x3a6>, &method_adaptor<0x3a7>, + &method_adaptor<0x3a8>, &method_adaptor<0x3a9>, &method_adaptor<0x3aa>, &method_adaptor<0x3ab>, &method_adaptor<0x3ac>, &method_adaptor<0x3ad>, &method_adaptor<0x3ae>, &method_adaptor<0x3af>, + &method_adaptor<0x3b0>, &method_adaptor<0x3b1>, &method_adaptor<0x3b2>, &method_adaptor<0x3b3>, &method_adaptor<0x3b4>, &method_adaptor<0x3b5>, &method_adaptor<0x3b6>, &method_adaptor<0x3b7>, + &method_adaptor<0x3b8>, &method_adaptor<0x3b9>, &method_adaptor<0x3ba>, &method_adaptor<0x3bb>, &method_adaptor<0x3bc>, &method_adaptor<0x3bd>, &method_adaptor<0x3be>, &method_adaptor<0x3bf>, + &method_adaptor<0x3c0>, &method_adaptor<0x3c1>, &method_adaptor<0x3c2>, &method_adaptor<0x3c3>, &method_adaptor<0x3c4>, &method_adaptor<0x3c5>, &method_adaptor<0x3c6>, &method_adaptor<0x3c7>, + &method_adaptor<0x3c8>, &method_adaptor<0x3c9>, &method_adaptor<0x3ca>, &method_adaptor<0x3cb>, &method_adaptor<0x3cc>, &method_adaptor<0x3cd>, &method_adaptor<0x3ce>, &method_adaptor<0x3cf>, + &method_adaptor<0x3d0>, &method_adaptor<0x3d1>, &method_adaptor<0x3d2>, &method_adaptor<0x3d3>, &method_adaptor<0x3d4>, &method_adaptor<0x3d5>, &method_adaptor<0x3d6>, &method_adaptor<0x3d7>, + &method_adaptor<0x3d8>, &method_adaptor<0x3d9>, &method_adaptor<0x3da>, &method_adaptor<0x3db>, &method_adaptor<0x3dc>, &method_adaptor<0x3dd>, &method_adaptor<0x3de>, &method_adaptor<0x3df>, + &method_adaptor<0x3e0>, &method_adaptor<0x3e1>, &method_adaptor<0x3e2>, &method_adaptor<0x3e3>, &method_adaptor<0x3e4>, &method_adaptor<0x3e5>, &method_adaptor<0x3e6>, &method_adaptor<0x3e7>, + &method_adaptor<0x3e8>, &method_adaptor<0x3e9>, &method_adaptor<0x3ea>, &method_adaptor<0x3eb>, &method_adaptor<0x3ec>, &method_adaptor<0x3ed>, &method_adaptor<0x3ee>, &method_adaptor<0x3ef>, + &method_adaptor<0x3f0>, &method_adaptor<0x3f1>, &method_adaptor<0x3f2>, &method_adaptor<0x3f3>, &method_adaptor<0x3f4>, &method_adaptor<0x3f5>, &method_adaptor<0x3f6>, &method_adaptor<0x3f7>, + &method_adaptor<0x3f8>, &method_adaptor<0x3f9>, &method_adaptor<0x3fa>, &method_adaptor<0x3fb>, &method_adaptor<0x3fc>, &method_adaptor<0x3fd>, &method_adaptor<0x3fe>, &method_adaptor<0x3ff>, + &method_adaptor<0x400>, &method_adaptor<0x401>, &method_adaptor<0x402>, &method_adaptor<0x403>, &method_adaptor<0x404>, &method_adaptor<0x405>, &method_adaptor<0x406>, &method_adaptor<0x407>, + &method_adaptor<0x408>, &method_adaptor<0x409>, &method_adaptor<0x40a>, &method_adaptor<0x40b>, &method_adaptor<0x40c>, &method_adaptor<0x40d>, &method_adaptor<0x40e>, &method_adaptor<0x40f>, + &method_adaptor<0x410>, &method_adaptor<0x411>, &method_adaptor<0x412>, &method_adaptor<0x413>, &method_adaptor<0x414>, &method_adaptor<0x415>, &method_adaptor<0x416>, &method_adaptor<0x417>, + &method_adaptor<0x418>, &method_adaptor<0x419>, &method_adaptor<0x41a>, &method_adaptor<0x41b>, &method_adaptor<0x41c>, &method_adaptor<0x41d>, &method_adaptor<0x41e>, &method_adaptor<0x41f>, + &method_adaptor<0x420>, &method_adaptor<0x421>, &method_adaptor<0x422>, &method_adaptor<0x423>, &method_adaptor<0x424>, &method_adaptor<0x425>, &method_adaptor<0x426>, &method_adaptor<0x427>, + &method_adaptor<0x428>, &method_adaptor<0x429>, &method_adaptor<0x42a>, &method_adaptor<0x42b>, &method_adaptor<0x42c>, &method_adaptor<0x42d>, &method_adaptor<0x42e>, &method_adaptor<0x42f>, + &method_adaptor<0x430>, &method_adaptor<0x431>, &method_adaptor<0x432>, &method_adaptor<0x433>, &method_adaptor<0x434>, &method_adaptor<0x435>, &method_adaptor<0x436>, &method_adaptor<0x437>, + &method_adaptor<0x438>, &method_adaptor<0x439>, &method_adaptor<0x43a>, &method_adaptor<0x43b>, &method_adaptor<0x43c>, &method_adaptor<0x43d>, &method_adaptor<0x43e>, &method_adaptor<0x43f>, + &method_adaptor<0x440>, &method_adaptor<0x441>, &method_adaptor<0x442>, &method_adaptor<0x443>, &method_adaptor<0x444>, &method_adaptor<0x445>, &method_adaptor<0x446>, &method_adaptor<0x447>, + &method_adaptor<0x448>, &method_adaptor<0x449>, &method_adaptor<0x44a>, &method_adaptor<0x44b>, &method_adaptor<0x44c>, &method_adaptor<0x44d>, &method_adaptor<0x44e>, &method_adaptor<0x44f>, + &method_adaptor<0x450>, &method_adaptor<0x451>, &method_adaptor<0x452>, &method_adaptor<0x453>, &method_adaptor<0x454>, &method_adaptor<0x455>, &method_adaptor<0x456>, &method_adaptor<0x457>, + &method_adaptor<0x458>, &method_adaptor<0x459>, &method_adaptor<0x45a>, &method_adaptor<0x45b>, &method_adaptor<0x45c>, &method_adaptor<0x45d>, &method_adaptor<0x45e>, &method_adaptor<0x45f>, + &method_adaptor<0x460>, &method_adaptor<0x461>, &method_adaptor<0x462>, &method_adaptor<0x463>, &method_adaptor<0x464>, &method_adaptor<0x465>, &method_adaptor<0x466>, &method_adaptor<0x467>, + &method_adaptor<0x468>, &method_adaptor<0x469>, &method_adaptor<0x46a>, &method_adaptor<0x46b>, &method_adaptor<0x46c>, &method_adaptor<0x46d>, &method_adaptor<0x46e>, &method_adaptor<0x46f>, + &method_adaptor<0x470>, &method_adaptor<0x471>, &method_adaptor<0x472>, &method_adaptor<0x473>, &method_adaptor<0x474>, &method_adaptor<0x475>, &method_adaptor<0x476>, &method_adaptor<0x477>, + &method_adaptor<0x478>, &method_adaptor<0x479>, &method_adaptor<0x47a>, &method_adaptor<0x47b>, &method_adaptor<0x47c>, &method_adaptor<0x47d>, &method_adaptor<0x47e>, &method_adaptor<0x47f>, + &method_adaptor<0x480>, &method_adaptor<0x481>, &method_adaptor<0x482>, &method_adaptor<0x483>, &method_adaptor<0x484>, &method_adaptor<0x485>, &method_adaptor<0x486>, &method_adaptor<0x487>, + &method_adaptor<0x488>, &method_adaptor<0x489>, &method_adaptor<0x48a>, &method_adaptor<0x48b>, &method_adaptor<0x48c>, &method_adaptor<0x48d>, &method_adaptor<0x48e>, &method_adaptor<0x48f>, + &method_adaptor<0x490>, &method_adaptor<0x491>, &method_adaptor<0x492>, &method_adaptor<0x493>, &method_adaptor<0x494>, &method_adaptor<0x495>, &method_adaptor<0x496>, &method_adaptor<0x497>, + &method_adaptor<0x498>, &method_adaptor<0x499>, &method_adaptor<0x49a>, &method_adaptor<0x49b>, &method_adaptor<0x49c>, &method_adaptor<0x49d>, &method_adaptor<0x49e>, &method_adaptor<0x49f>, + &method_adaptor<0x4a0>, &method_adaptor<0x4a1>, &method_adaptor<0x4a2>, &method_adaptor<0x4a3>, &method_adaptor<0x4a4>, &method_adaptor<0x4a5>, &method_adaptor<0x4a6>, &method_adaptor<0x4a7>, + &method_adaptor<0x4a8>, &method_adaptor<0x4a9>, &method_adaptor<0x4aa>, &method_adaptor<0x4ab>, &method_adaptor<0x4ac>, &method_adaptor<0x4ad>, &method_adaptor<0x4ae>, &method_adaptor<0x4af>, + &method_adaptor<0x4b0>, &method_adaptor<0x4b1>, &method_adaptor<0x4b2>, &method_adaptor<0x4b3>, &method_adaptor<0x4b4>, &method_adaptor<0x4b5>, &method_adaptor<0x4b6>, &method_adaptor<0x4b7>, + &method_adaptor<0x4b8>, &method_adaptor<0x4b9>, &method_adaptor<0x4ba>, &method_adaptor<0x4bb>, &method_adaptor<0x4bc>, &method_adaptor<0x4bd>, &method_adaptor<0x4be>, &method_adaptor<0x4bf>, + &method_adaptor<0x4c0>, &method_adaptor<0x4c1>, &method_adaptor<0x4c2>, &method_adaptor<0x4c3>, &method_adaptor<0x4c4>, &method_adaptor<0x4c5>, &method_adaptor<0x4c6>, &method_adaptor<0x4c7>, + &method_adaptor<0x4c8>, &method_adaptor<0x4c9>, &method_adaptor<0x4ca>, &method_adaptor<0x4cb>, &method_adaptor<0x4cc>, &method_adaptor<0x4cd>, &method_adaptor<0x4ce>, &method_adaptor<0x4cf>, + &method_adaptor<0x4d0>, &method_adaptor<0x4d1>, &method_adaptor<0x4d2>, &method_adaptor<0x4d3>, &method_adaptor<0x4d4>, &method_adaptor<0x4d5>, &method_adaptor<0x4d6>, &method_adaptor<0x4d7>, + &method_adaptor<0x4d8>, &method_adaptor<0x4d9>, &method_adaptor<0x4da>, &method_adaptor<0x4db>, &method_adaptor<0x4dc>, &method_adaptor<0x4dd>, &method_adaptor<0x4de>, &method_adaptor<0x4df>, + &method_adaptor<0x4e0>, &method_adaptor<0x4e1>, &method_adaptor<0x4e2>, &method_adaptor<0x4e3>, &method_adaptor<0x4e4>, &method_adaptor<0x4e5>, &method_adaptor<0x4e6>, &method_adaptor<0x4e7>, + &method_adaptor<0x4e8>, &method_adaptor<0x4e9>, &method_adaptor<0x4ea>, &method_adaptor<0x4eb>, &method_adaptor<0x4ec>, &method_adaptor<0x4ed>, &method_adaptor<0x4ee>, &method_adaptor<0x4ef>, + &method_adaptor<0x4f0>, &method_adaptor<0x4f1>, &method_adaptor<0x4f2>, &method_adaptor<0x4f3>, &method_adaptor<0x4f4>, &method_adaptor<0x4f5>, &method_adaptor<0x4f6>, &method_adaptor<0x4f7>, + &method_adaptor<0x4f8>, &method_adaptor<0x4f9>, &method_adaptor<0x4fa>, &method_adaptor<0x4fb>, &method_adaptor<0x4fc>, &method_adaptor<0x4fd>, &method_adaptor<0x4fe>, &method_adaptor<0x4ff>, +}; + +py_func_ptr_t get_method_adaptor (int n) +{ + tl_assert (n >= 0 && n < int (sizeof (method_adaptors) / sizeof (method_adaptors [0]))); + return method_adaptors [n]; +} + +template +PyObject *property_getter_adaptor (PyObject *self, PyObject *args) +{ + return property_getter_adaptor (N, self, args); +} + +static py_func_ptr_t property_getter_adaptors [] = +{ + &property_getter_adaptor<0x000>, &property_getter_adaptor<0x001>, &property_getter_adaptor<0x002>, &property_getter_adaptor<0x003>, &property_getter_adaptor<0x004>, &property_getter_adaptor<0x005>, &property_getter_adaptor<0x006>, &property_getter_adaptor<0x007>, + &property_getter_adaptor<0x008>, &property_getter_adaptor<0x009>, &property_getter_adaptor<0x00a>, &property_getter_adaptor<0x00b>, &property_getter_adaptor<0x00c>, &property_getter_adaptor<0x00d>, &property_getter_adaptor<0x00e>, &property_getter_adaptor<0x00f>, + &property_getter_adaptor<0x010>, &property_getter_adaptor<0x011>, &property_getter_adaptor<0x012>, &property_getter_adaptor<0x013>, &property_getter_adaptor<0x014>, &property_getter_adaptor<0x015>, &property_getter_adaptor<0x016>, &property_getter_adaptor<0x017>, + &property_getter_adaptor<0x018>, &property_getter_adaptor<0x019>, &property_getter_adaptor<0x01a>, &property_getter_adaptor<0x01b>, &property_getter_adaptor<0x01c>, &property_getter_adaptor<0x01d>, &property_getter_adaptor<0x01e>, &property_getter_adaptor<0x01f>, + &property_getter_adaptor<0x020>, &property_getter_adaptor<0x021>, &property_getter_adaptor<0x022>, &property_getter_adaptor<0x023>, &property_getter_adaptor<0x024>, &property_getter_adaptor<0x025>, &property_getter_adaptor<0x026>, &property_getter_adaptor<0x027>, + &property_getter_adaptor<0x028>, &property_getter_adaptor<0x029>, &property_getter_adaptor<0x02a>, &property_getter_adaptor<0x02b>, &property_getter_adaptor<0x02c>, &property_getter_adaptor<0x02d>, &property_getter_adaptor<0x02e>, &property_getter_adaptor<0x02f>, + &property_getter_adaptor<0x030>, &property_getter_adaptor<0x031>, &property_getter_adaptor<0x032>, &property_getter_adaptor<0x033>, &property_getter_adaptor<0x034>, &property_getter_adaptor<0x035>, &property_getter_adaptor<0x036>, &property_getter_adaptor<0x037>, + &property_getter_adaptor<0x038>, &property_getter_adaptor<0x039>, &property_getter_adaptor<0x03a>, &property_getter_adaptor<0x03b>, &property_getter_adaptor<0x03c>, &property_getter_adaptor<0x03d>, &property_getter_adaptor<0x03e>, &property_getter_adaptor<0x03f>, + &property_getter_adaptor<0x040>, &property_getter_adaptor<0x041>, &property_getter_adaptor<0x042>, &property_getter_adaptor<0x043>, &property_getter_adaptor<0x044>, &property_getter_adaptor<0x045>, &property_getter_adaptor<0x046>, &property_getter_adaptor<0x047>, + &property_getter_adaptor<0x048>, &property_getter_adaptor<0x049>, &property_getter_adaptor<0x04a>, &property_getter_adaptor<0x04b>, &property_getter_adaptor<0x04c>, &property_getter_adaptor<0x04d>, &property_getter_adaptor<0x04e>, &property_getter_adaptor<0x04f>, + &property_getter_adaptor<0x050>, &property_getter_adaptor<0x051>, &property_getter_adaptor<0x052>, &property_getter_adaptor<0x053>, &property_getter_adaptor<0x054>, &property_getter_adaptor<0x055>, &property_getter_adaptor<0x056>, &property_getter_adaptor<0x057>, + &property_getter_adaptor<0x058>, &property_getter_adaptor<0x059>, &property_getter_adaptor<0x05a>, &property_getter_adaptor<0x05b>, &property_getter_adaptor<0x05c>, &property_getter_adaptor<0x05d>, &property_getter_adaptor<0x05e>, &property_getter_adaptor<0x05f>, + &property_getter_adaptor<0x060>, &property_getter_adaptor<0x061>, &property_getter_adaptor<0x062>, &property_getter_adaptor<0x063>, &property_getter_adaptor<0x064>, &property_getter_adaptor<0x065>, &property_getter_adaptor<0x066>, &property_getter_adaptor<0x067>, + &property_getter_adaptor<0x068>, &property_getter_adaptor<0x069>, &property_getter_adaptor<0x06a>, &property_getter_adaptor<0x06b>, &property_getter_adaptor<0x06c>, &property_getter_adaptor<0x06d>, &property_getter_adaptor<0x06e>, &property_getter_adaptor<0x06f>, + &property_getter_adaptor<0x070>, &property_getter_adaptor<0x071>, &property_getter_adaptor<0x072>, &property_getter_adaptor<0x073>, &property_getter_adaptor<0x074>, &property_getter_adaptor<0x075>, &property_getter_adaptor<0x076>, &property_getter_adaptor<0x077>, + &property_getter_adaptor<0x078>, &property_getter_adaptor<0x079>, &property_getter_adaptor<0x07a>, &property_getter_adaptor<0x07b>, &property_getter_adaptor<0x07c>, &property_getter_adaptor<0x07d>, &property_getter_adaptor<0x07e>, &property_getter_adaptor<0x07f>, + &property_getter_adaptor<0x080>, &property_getter_adaptor<0x081>, &property_getter_adaptor<0x082>, &property_getter_adaptor<0x083>, &property_getter_adaptor<0x084>, &property_getter_adaptor<0x085>, &property_getter_adaptor<0x086>, &property_getter_adaptor<0x087>, + &property_getter_adaptor<0x088>, &property_getter_adaptor<0x089>, &property_getter_adaptor<0x08a>, &property_getter_adaptor<0x08b>, &property_getter_adaptor<0x08c>, &property_getter_adaptor<0x08d>, &property_getter_adaptor<0x08e>, &property_getter_adaptor<0x08f>, + &property_getter_adaptor<0x090>, &property_getter_adaptor<0x091>, &property_getter_adaptor<0x092>, &property_getter_adaptor<0x093>, &property_getter_adaptor<0x094>, &property_getter_adaptor<0x095>, &property_getter_adaptor<0x096>, &property_getter_adaptor<0x097>, + &property_getter_adaptor<0x098>, &property_getter_adaptor<0x099>, &property_getter_adaptor<0x09a>, &property_getter_adaptor<0x09b>, &property_getter_adaptor<0x09c>, &property_getter_adaptor<0x09d>, &property_getter_adaptor<0x09e>, &property_getter_adaptor<0x09f>, + &property_getter_adaptor<0x0a0>, &property_getter_adaptor<0x0a1>, &property_getter_adaptor<0x0a2>, &property_getter_adaptor<0x0a3>, &property_getter_adaptor<0x0a4>, &property_getter_adaptor<0x0a5>, &property_getter_adaptor<0x0a6>, &property_getter_adaptor<0x0a7>, + &property_getter_adaptor<0x0a8>, &property_getter_adaptor<0x0a9>, &property_getter_adaptor<0x0aa>, &property_getter_adaptor<0x0ab>, &property_getter_adaptor<0x0ac>, &property_getter_adaptor<0x0ad>, &property_getter_adaptor<0x0ae>, &property_getter_adaptor<0x0af>, + &property_getter_adaptor<0x0b0>, &property_getter_adaptor<0x0b1>, &property_getter_adaptor<0x0b2>, &property_getter_adaptor<0x0b3>, &property_getter_adaptor<0x0b4>, &property_getter_adaptor<0x0b5>, &property_getter_adaptor<0x0b6>, &property_getter_adaptor<0x0b7>, + &property_getter_adaptor<0x0b8>, &property_getter_adaptor<0x0b9>, &property_getter_adaptor<0x0ba>, &property_getter_adaptor<0x0bb>, &property_getter_adaptor<0x0bc>, &property_getter_adaptor<0x0bd>, &property_getter_adaptor<0x0be>, &property_getter_adaptor<0x0bf>, + &property_getter_adaptor<0x0c0>, &property_getter_adaptor<0x0c1>, &property_getter_adaptor<0x0c2>, &property_getter_adaptor<0x0c3>, &property_getter_adaptor<0x0c4>, &property_getter_adaptor<0x0c5>, &property_getter_adaptor<0x0c6>, &property_getter_adaptor<0x0c7>, + &property_getter_adaptor<0x0c8>, &property_getter_adaptor<0x0c9>, &property_getter_adaptor<0x0ca>, &property_getter_adaptor<0x0cb>, &property_getter_adaptor<0x0cc>, &property_getter_adaptor<0x0cd>, &property_getter_adaptor<0x0ce>, &property_getter_adaptor<0x0cf>, + &property_getter_adaptor<0x0d0>, &property_getter_adaptor<0x0d1>, &property_getter_adaptor<0x0d2>, &property_getter_adaptor<0x0d3>, &property_getter_adaptor<0x0d4>, &property_getter_adaptor<0x0d5>, &property_getter_adaptor<0x0d6>, &property_getter_adaptor<0x0d7>, + &property_getter_adaptor<0x0d8>, &property_getter_adaptor<0x0d9>, &property_getter_adaptor<0x0da>, &property_getter_adaptor<0x0db>, &property_getter_adaptor<0x0dc>, &property_getter_adaptor<0x0dd>, &property_getter_adaptor<0x0de>, &property_getter_adaptor<0x0df>, + &property_getter_adaptor<0x0e0>, &property_getter_adaptor<0x0e1>, &property_getter_adaptor<0x0e2>, &property_getter_adaptor<0x0e3>, &property_getter_adaptor<0x0e4>, &property_getter_adaptor<0x0e5>, &property_getter_adaptor<0x0e6>, &property_getter_adaptor<0x0e7>, + &property_getter_adaptor<0x0e8>, &property_getter_adaptor<0x0e9>, &property_getter_adaptor<0x0ea>, &property_getter_adaptor<0x0eb>, &property_getter_adaptor<0x0ec>, &property_getter_adaptor<0x0ed>, &property_getter_adaptor<0x0ee>, &property_getter_adaptor<0x0ef>, + &property_getter_adaptor<0x0f0>, &property_getter_adaptor<0x0f1>, &property_getter_adaptor<0x0f2>, &property_getter_adaptor<0x0f3>, &property_getter_adaptor<0x0f4>, &property_getter_adaptor<0x0f5>, &property_getter_adaptor<0x0f6>, &property_getter_adaptor<0x0f7>, + &property_getter_adaptor<0x0f8>, &property_getter_adaptor<0x0f9>, &property_getter_adaptor<0x0fa>, &property_getter_adaptor<0x0fb>, &property_getter_adaptor<0x0fc>, &property_getter_adaptor<0x0fd>, &property_getter_adaptor<0x0fe>, &property_getter_adaptor<0x0ff>, + &property_getter_adaptor<0x100>, &property_getter_adaptor<0x101>, &property_getter_adaptor<0x102>, &property_getter_adaptor<0x103>, &property_getter_adaptor<0x104>, &property_getter_adaptor<0x105>, &property_getter_adaptor<0x106>, &property_getter_adaptor<0x107>, + &property_getter_adaptor<0x108>, &property_getter_adaptor<0x109>, &property_getter_adaptor<0x10a>, &property_getter_adaptor<0x10b>, &property_getter_adaptor<0x10c>, &property_getter_adaptor<0x10d>, &property_getter_adaptor<0x10e>, &property_getter_adaptor<0x10f>, + &property_getter_adaptor<0x110>, &property_getter_adaptor<0x111>, &property_getter_adaptor<0x112>, &property_getter_adaptor<0x113>, &property_getter_adaptor<0x114>, &property_getter_adaptor<0x115>, &property_getter_adaptor<0x116>, &property_getter_adaptor<0x117>, + &property_getter_adaptor<0x118>, &property_getter_adaptor<0x119>, &property_getter_adaptor<0x11a>, &property_getter_adaptor<0x11b>, &property_getter_adaptor<0x11c>, &property_getter_adaptor<0x11d>, &property_getter_adaptor<0x11e>, &property_getter_adaptor<0x11f>, + &property_getter_adaptor<0x120>, &property_getter_adaptor<0x121>, &property_getter_adaptor<0x122>, &property_getter_adaptor<0x123>, &property_getter_adaptor<0x124>, &property_getter_adaptor<0x125>, &property_getter_adaptor<0x126>, &property_getter_adaptor<0x127>, + &property_getter_adaptor<0x128>, &property_getter_adaptor<0x129>, &property_getter_adaptor<0x12a>, &property_getter_adaptor<0x12b>, &property_getter_adaptor<0x12c>, &property_getter_adaptor<0x12d>, &property_getter_adaptor<0x12e>, &property_getter_adaptor<0x12f>, + &property_getter_adaptor<0x130>, &property_getter_adaptor<0x131>, &property_getter_adaptor<0x132>, &property_getter_adaptor<0x133>, &property_getter_adaptor<0x134>, &property_getter_adaptor<0x135>, &property_getter_adaptor<0x136>, &property_getter_adaptor<0x137>, + &property_getter_adaptor<0x138>, &property_getter_adaptor<0x139>, &property_getter_adaptor<0x13a>, &property_getter_adaptor<0x13b>, &property_getter_adaptor<0x13c>, &property_getter_adaptor<0x13d>, &property_getter_adaptor<0x13e>, &property_getter_adaptor<0x13f>, + &property_getter_adaptor<0x140>, &property_getter_adaptor<0x141>, &property_getter_adaptor<0x142>, &property_getter_adaptor<0x143>, &property_getter_adaptor<0x144>, &property_getter_adaptor<0x145>, &property_getter_adaptor<0x146>, &property_getter_adaptor<0x147>, + &property_getter_adaptor<0x148>, &property_getter_adaptor<0x149>, &property_getter_adaptor<0x14a>, &property_getter_adaptor<0x14b>, &property_getter_adaptor<0x14c>, &property_getter_adaptor<0x14d>, &property_getter_adaptor<0x14e>, &property_getter_adaptor<0x14f>, + &property_getter_adaptor<0x150>, &property_getter_adaptor<0x151>, &property_getter_adaptor<0x152>, &property_getter_adaptor<0x153>, &property_getter_adaptor<0x154>, &property_getter_adaptor<0x155>, &property_getter_adaptor<0x156>, &property_getter_adaptor<0x157>, + &property_getter_adaptor<0x158>, &property_getter_adaptor<0x159>, &property_getter_adaptor<0x15a>, &property_getter_adaptor<0x15b>, &property_getter_adaptor<0x15c>, &property_getter_adaptor<0x15d>, &property_getter_adaptor<0x15e>, &property_getter_adaptor<0x15f>, + &property_getter_adaptor<0x160>, &property_getter_adaptor<0x161>, &property_getter_adaptor<0x162>, &property_getter_adaptor<0x163>, &property_getter_adaptor<0x164>, &property_getter_adaptor<0x165>, &property_getter_adaptor<0x166>, &property_getter_adaptor<0x167>, + &property_getter_adaptor<0x168>, &property_getter_adaptor<0x169>, &property_getter_adaptor<0x16a>, &property_getter_adaptor<0x16b>, &property_getter_adaptor<0x16c>, &property_getter_adaptor<0x16d>, &property_getter_adaptor<0x16e>, &property_getter_adaptor<0x16f>, + &property_getter_adaptor<0x170>, &property_getter_adaptor<0x171>, &property_getter_adaptor<0x172>, &property_getter_adaptor<0x173>, &property_getter_adaptor<0x174>, &property_getter_adaptor<0x175>, &property_getter_adaptor<0x176>, &property_getter_adaptor<0x177>, + &property_getter_adaptor<0x178>, &property_getter_adaptor<0x179>, &property_getter_adaptor<0x17a>, &property_getter_adaptor<0x17b>, &property_getter_adaptor<0x17c>, &property_getter_adaptor<0x17d>, &property_getter_adaptor<0x17e>, &property_getter_adaptor<0x17f>, + &property_getter_adaptor<0x180>, &property_getter_adaptor<0x181>, &property_getter_adaptor<0x182>, &property_getter_adaptor<0x183>, &property_getter_adaptor<0x184>, &property_getter_adaptor<0x185>, &property_getter_adaptor<0x186>, &property_getter_adaptor<0x187>, + &property_getter_adaptor<0x188>, &property_getter_adaptor<0x189>, &property_getter_adaptor<0x18a>, &property_getter_adaptor<0x18b>, &property_getter_adaptor<0x18c>, &property_getter_adaptor<0x18d>, &property_getter_adaptor<0x18e>, &property_getter_adaptor<0x18f>, + &property_getter_adaptor<0x190>, &property_getter_adaptor<0x191>, &property_getter_adaptor<0x192>, &property_getter_adaptor<0x193>, &property_getter_adaptor<0x194>, &property_getter_adaptor<0x195>, &property_getter_adaptor<0x196>, &property_getter_adaptor<0x197>, + &property_getter_adaptor<0x198>, &property_getter_adaptor<0x199>, &property_getter_adaptor<0x19a>, &property_getter_adaptor<0x19b>, &property_getter_adaptor<0x19c>, &property_getter_adaptor<0x19d>, &property_getter_adaptor<0x19e>, &property_getter_adaptor<0x19f>, + &property_getter_adaptor<0x1a0>, &property_getter_adaptor<0x1a1>, &property_getter_adaptor<0x1a2>, &property_getter_adaptor<0x1a3>, &property_getter_adaptor<0x1a4>, &property_getter_adaptor<0x1a5>, &property_getter_adaptor<0x1a6>, &property_getter_adaptor<0x1a7>, + &property_getter_adaptor<0x1a8>, &property_getter_adaptor<0x1a9>, &property_getter_adaptor<0x1aa>, &property_getter_adaptor<0x1ab>, &property_getter_adaptor<0x1ac>, &property_getter_adaptor<0x1ad>, &property_getter_adaptor<0x1ae>, &property_getter_adaptor<0x1af>, + &property_getter_adaptor<0x1b0>, &property_getter_adaptor<0x1b1>, &property_getter_adaptor<0x1b2>, &property_getter_adaptor<0x1b3>, &property_getter_adaptor<0x1b4>, &property_getter_adaptor<0x1b5>, &property_getter_adaptor<0x1b6>, &property_getter_adaptor<0x1b7>, + &property_getter_adaptor<0x1b8>, &property_getter_adaptor<0x1b9>, &property_getter_adaptor<0x1ba>, &property_getter_adaptor<0x1bb>, &property_getter_adaptor<0x1bc>, &property_getter_adaptor<0x1bd>, &property_getter_adaptor<0x1be>, &property_getter_adaptor<0x1bf>, + &property_getter_adaptor<0x1c0>, &property_getter_adaptor<0x1c1>, &property_getter_adaptor<0x1c2>, &property_getter_adaptor<0x1c3>, &property_getter_adaptor<0x1c4>, &property_getter_adaptor<0x1c5>, &property_getter_adaptor<0x1c6>, &property_getter_adaptor<0x1c7>, + &property_getter_adaptor<0x1c8>, &property_getter_adaptor<0x1c9>, &property_getter_adaptor<0x1ca>, &property_getter_adaptor<0x1cb>, &property_getter_adaptor<0x1cc>, &property_getter_adaptor<0x1cd>, &property_getter_adaptor<0x1ce>, &property_getter_adaptor<0x1cf>, + &property_getter_adaptor<0x1d0>, &property_getter_adaptor<0x1d1>, &property_getter_adaptor<0x1d2>, &property_getter_adaptor<0x1d3>, &property_getter_adaptor<0x1d4>, &property_getter_adaptor<0x1d5>, &property_getter_adaptor<0x1d6>, &property_getter_adaptor<0x1d7>, + &property_getter_adaptor<0x1d8>, &property_getter_adaptor<0x1d9>, &property_getter_adaptor<0x1da>, &property_getter_adaptor<0x1db>, &property_getter_adaptor<0x1dc>, &property_getter_adaptor<0x1dd>, &property_getter_adaptor<0x1de>, &property_getter_adaptor<0x1df>, + &property_getter_adaptor<0x1e0>, &property_getter_adaptor<0x1e1>, &property_getter_adaptor<0x1e2>, &property_getter_adaptor<0x1e3>, &property_getter_adaptor<0x1e4>, &property_getter_adaptor<0x1e5>, &property_getter_adaptor<0x1e6>, &property_getter_adaptor<0x1e7>, + &property_getter_adaptor<0x1e8>, &property_getter_adaptor<0x1e9>, &property_getter_adaptor<0x1ea>, &property_getter_adaptor<0x1eb>, &property_getter_adaptor<0x1ec>, &property_getter_adaptor<0x1ed>, &property_getter_adaptor<0x1ee>, &property_getter_adaptor<0x1ef>, + &property_getter_adaptor<0x1f0>, &property_getter_adaptor<0x1f1>, &property_getter_adaptor<0x1f2>, &property_getter_adaptor<0x1f3>, &property_getter_adaptor<0x1f4>, &property_getter_adaptor<0x1f5>, &property_getter_adaptor<0x1f6>, &property_getter_adaptor<0x1f7>, + &property_getter_adaptor<0x1f8>, &property_getter_adaptor<0x1f9>, &property_getter_adaptor<0x1fa>, &property_getter_adaptor<0x1fb>, &property_getter_adaptor<0x1fc>, &property_getter_adaptor<0x1fd>, &property_getter_adaptor<0x1fe>, &property_getter_adaptor<0x1ff>, + &property_getter_adaptor<0x200>, &property_getter_adaptor<0x201>, &property_getter_adaptor<0x202>, &property_getter_adaptor<0x203>, &property_getter_adaptor<0x204>, &property_getter_adaptor<0x205>, &property_getter_adaptor<0x206>, &property_getter_adaptor<0x207>, + &property_getter_adaptor<0x208>, &property_getter_adaptor<0x209>, &property_getter_adaptor<0x20a>, &property_getter_adaptor<0x20b>, &property_getter_adaptor<0x20c>, &property_getter_adaptor<0x20d>, &property_getter_adaptor<0x20e>, &property_getter_adaptor<0x20f>, + &property_getter_adaptor<0x210>, &property_getter_adaptor<0x211>, &property_getter_adaptor<0x212>, &property_getter_adaptor<0x213>, &property_getter_adaptor<0x214>, &property_getter_adaptor<0x215>, &property_getter_adaptor<0x216>, &property_getter_adaptor<0x217>, + &property_getter_adaptor<0x218>, &property_getter_adaptor<0x219>, &property_getter_adaptor<0x21a>, &property_getter_adaptor<0x21b>, &property_getter_adaptor<0x21c>, &property_getter_adaptor<0x21d>, &property_getter_adaptor<0x21e>, &property_getter_adaptor<0x21f>, + &property_getter_adaptor<0x220>, &property_getter_adaptor<0x221>, &property_getter_adaptor<0x222>, &property_getter_adaptor<0x223>, &property_getter_adaptor<0x224>, &property_getter_adaptor<0x225>, &property_getter_adaptor<0x226>, &property_getter_adaptor<0x227>, + &property_getter_adaptor<0x228>, &property_getter_adaptor<0x229>, &property_getter_adaptor<0x22a>, &property_getter_adaptor<0x22b>, &property_getter_adaptor<0x22c>, &property_getter_adaptor<0x22d>, &property_getter_adaptor<0x22e>, &property_getter_adaptor<0x22f>, + &property_getter_adaptor<0x230>, &property_getter_adaptor<0x231>, &property_getter_adaptor<0x232>, &property_getter_adaptor<0x233>, &property_getter_adaptor<0x234>, &property_getter_adaptor<0x235>, &property_getter_adaptor<0x236>, &property_getter_adaptor<0x237>, + &property_getter_adaptor<0x238>, &property_getter_adaptor<0x239>, &property_getter_adaptor<0x23a>, &property_getter_adaptor<0x23b>, &property_getter_adaptor<0x23c>, &property_getter_adaptor<0x23d>, &property_getter_adaptor<0x23e>, &property_getter_adaptor<0x23f>, + &property_getter_adaptor<0x240>, &property_getter_adaptor<0x241>, &property_getter_adaptor<0x242>, &property_getter_adaptor<0x243>, &property_getter_adaptor<0x244>, &property_getter_adaptor<0x245>, &property_getter_adaptor<0x246>, &property_getter_adaptor<0x247>, + &property_getter_adaptor<0x248>, &property_getter_adaptor<0x249>, &property_getter_adaptor<0x24a>, &property_getter_adaptor<0x24b>, &property_getter_adaptor<0x24c>, &property_getter_adaptor<0x24d>, &property_getter_adaptor<0x24e>, &property_getter_adaptor<0x24f>, + &property_getter_adaptor<0x250>, &property_getter_adaptor<0x251>, &property_getter_adaptor<0x252>, &property_getter_adaptor<0x253>, &property_getter_adaptor<0x254>, &property_getter_adaptor<0x255>, &property_getter_adaptor<0x256>, &property_getter_adaptor<0x257>, + &property_getter_adaptor<0x258>, &property_getter_adaptor<0x259>, &property_getter_adaptor<0x25a>, &property_getter_adaptor<0x25b>, &property_getter_adaptor<0x25c>, &property_getter_adaptor<0x25d>, &property_getter_adaptor<0x25e>, &property_getter_adaptor<0x25f>, + &property_getter_adaptor<0x260>, &property_getter_adaptor<0x261>, &property_getter_adaptor<0x262>, &property_getter_adaptor<0x263>, &property_getter_adaptor<0x264>, &property_getter_adaptor<0x265>, &property_getter_adaptor<0x266>, &property_getter_adaptor<0x267>, + &property_getter_adaptor<0x268>, &property_getter_adaptor<0x269>, &property_getter_adaptor<0x26a>, &property_getter_adaptor<0x26b>, &property_getter_adaptor<0x26c>, &property_getter_adaptor<0x26d>, &property_getter_adaptor<0x26e>, &property_getter_adaptor<0x26f>, + &property_getter_adaptor<0x270>, &property_getter_adaptor<0x271>, &property_getter_adaptor<0x272>, &property_getter_adaptor<0x273>, &property_getter_adaptor<0x274>, &property_getter_adaptor<0x275>, &property_getter_adaptor<0x276>, &property_getter_adaptor<0x277>, + &property_getter_adaptor<0x278>, &property_getter_adaptor<0x279>, &property_getter_adaptor<0x27a>, &property_getter_adaptor<0x27b>, &property_getter_adaptor<0x27c>, &property_getter_adaptor<0x27d>, &property_getter_adaptor<0x27e>, &property_getter_adaptor<0x27f>, + &property_getter_adaptor<0x280>, &property_getter_adaptor<0x281>, &property_getter_adaptor<0x282>, &property_getter_adaptor<0x283>, &property_getter_adaptor<0x284>, &property_getter_adaptor<0x285>, &property_getter_adaptor<0x286>, &property_getter_adaptor<0x287>, + &property_getter_adaptor<0x288>, &property_getter_adaptor<0x289>, &property_getter_adaptor<0x28a>, &property_getter_adaptor<0x28b>, &property_getter_adaptor<0x28c>, &property_getter_adaptor<0x28d>, &property_getter_adaptor<0x28e>, &property_getter_adaptor<0x28f>, + &property_getter_adaptor<0x290>, &property_getter_adaptor<0x291>, &property_getter_adaptor<0x292>, &property_getter_adaptor<0x293>, &property_getter_adaptor<0x294>, &property_getter_adaptor<0x295>, &property_getter_adaptor<0x296>, &property_getter_adaptor<0x297>, + &property_getter_adaptor<0x298>, &property_getter_adaptor<0x299>, &property_getter_adaptor<0x29a>, &property_getter_adaptor<0x29b>, &property_getter_adaptor<0x29c>, &property_getter_adaptor<0x29d>, &property_getter_adaptor<0x29e>, &property_getter_adaptor<0x29f>, + &property_getter_adaptor<0x2a0>, &property_getter_adaptor<0x2a1>, &property_getter_adaptor<0x2a2>, &property_getter_adaptor<0x2a3>, &property_getter_adaptor<0x2a4>, &property_getter_adaptor<0x2a5>, &property_getter_adaptor<0x2a6>, &property_getter_adaptor<0x2a7>, + &property_getter_adaptor<0x2a8>, &property_getter_adaptor<0x2a9>, &property_getter_adaptor<0x2aa>, &property_getter_adaptor<0x2ab>, &property_getter_adaptor<0x2ac>, &property_getter_adaptor<0x2ad>, &property_getter_adaptor<0x2ae>, &property_getter_adaptor<0x2af>, + &property_getter_adaptor<0x2b0>, &property_getter_adaptor<0x2b1>, &property_getter_adaptor<0x2b2>, &property_getter_adaptor<0x2b3>, &property_getter_adaptor<0x2b4>, &property_getter_adaptor<0x2b5>, &property_getter_adaptor<0x2b6>, &property_getter_adaptor<0x2b7>, + &property_getter_adaptor<0x2b8>, &property_getter_adaptor<0x2b9>, &property_getter_adaptor<0x2ba>, &property_getter_adaptor<0x2bb>, &property_getter_adaptor<0x2bc>, &property_getter_adaptor<0x2bd>, &property_getter_adaptor<0x2be>, &property_getter_adaptor<0x2bf>, + &property_getter_adaptor<0x2c0>, &property_getter_adaptor<0x2c1>, &property_getter_adaptor<0x2c2>, &property_getter_adaptor<0x2c3>, &property_getter_adaptor<0x2c4>, &property_getter_adaptor<0x2c5>, &property_getter_adaptor<0x2c6>, &property_getter_adaptor<0x2c7>, + &property_getter_adaptor<0x2c8>, &property_getter_adaptor<0x2c9>, &property_getter_adaptor<0x2ca>, &property_getter_adaptor<0x2cb>, &property_getter_adaptor<0x2cc>, &property_getter_adaptor<0x2cd>, &property_getter_adaptor<0x2ce>, &property_getter_adaptor<0x2cf>, + &property_getter_adaptor<0x2d0>, &property_getter_adaptor<0x2d1>, &property_getter_adaptor<0x2d2>, &property_getter_adaptor<0x2d3>, &property_getter_adaptor<0x2d4>, &property_getter_adaptor<0x2d5>, &property_getter_adaptor<0x2d6>, &property_getter_adaptor<0x2d7>, + &property_getter_adaptor<0x2d8>, &property_getter_adaptor<0x2d9>, &property_getter_adaptor<0x2da>, &property_getter_adaptor<0x2db>, &property_getter_adaptor<0x2dc>, &property_getter_adaptor<0x2dd>, &property_getter_adaptor<0x2de>, &property_getter_adaptor<0x2df>, + &property_getter_adaptor<0x2e0>, &property_getter_adaptor<0x2e1>, &property_getter_adaptor<0x2e2>, &property_getter_adaptor<0x2e3>, &property_getter_adaptor<0x2e4>, &property_getter_adaptor<0x2e5>, &property_getter_adaptor<0x2e6>, &property_getter_adaptor<0x2e7>, + &property_getter_adaptor<0x2e8>, &property_getter_adaptor<0x2e9>, &property_getter_adaptor<0x2ea>, &property_getter_adaptor<0x2eb>, &property_getter_adaptor<0x2ec>, &property_getter_adaptor<0x2ed>, &property_getter_adaptor<0x2ee>, &property_getter_adaptor<0x2ef>, + &property_getter_adaptor<0x2f0>, &property_getter_adaptor<0x2f1>, &property_getter_adaptor<0x2f2>, &property_getter_adaptor<0x2f3>, &property_getter_adaptor<0x2f4>, &property_getter_adaptor<0x2f5>, &property_getter_adaptor<0x2f6>, &property_getter_adaptor<0x2f7>, + &property_getter_adaptor<0x2f8>, &property_getter_adaptor<0x2f9>, &property_getter_adaptor<0x2fa>, &property_getter_adaptor<0x2fb>, &property_getter_adaptor<0x2fc>, &property_getter_adaptor<0x2fd>, &property_getter_adaptor<0x2fe>, &property_getter_adaptor<0x2ff>, + &property_getter_adaptor<0x300>, &property_getter_adaptor<0x301>, &property_getter_adaptor<0x302>, &property_getter_adaptor<0x303>, &property_getter_adaptor<0x304>, &property_getter_adaptor<0x305>, &property_getter_adaptor<0x306>, &property_getter_adaptor<0x307>, + &property_getter_adaptor<0x308>, &property_getter_adaptor<0x309>, &property_getter_adaptor<0x30a>, &property_getter_adaptor<0x30b>, &property_getter_adaptor<0x30c>, &property_getter_adaptor<0x30d>, &property_getter_adaptor<0x30e>, &property_getter_adaptor<0x30f>, + &property_getter_adaptor<0x310>, &property_getter_adaptor<0x311>, &property_getter_adaptor<0x312>, &property_getter_adaptor<0x313>, &property_getter_adaptor<0x314>, &property_getter_adaptor<0x315>, &property_getter_adaptor<0x316>, &property_getter_adaptor<0x317>, + &property_getter_adaptor<0x318>, &property_getter_adaptor<0x319>, &property_getter_adaptor<0x31a>, &property_getter_adaptor<0x31b>, &property_getter_adaptor<0x31c>, &property_getter_adaptor<0x31d>, &property_getter_adaptor<0x31e>, &property_getter_adaptor<0x31f>, + &property_getter_adaptor<0x320>, &property_getter_adaptor<0x321>, &property_getter_adaptor<0x322>, &property_getter_adaptor<0x323>, &property_getter_adaptor<0x324>, &property_getter_adaptor<0x325>, &property_getter_adaptor<0x326>, &property_getter_adaptor<0x327>, + &property_getter_adaptor<0x328>, &property_getter_adaptor<0x329>, &property_getter_adaptor<0x32a>, &property_getter_adaptor<0x32b>, &property_getter_adaptor<0x32c>, &property_getter_adaptor<0x32d>, &property_getter_adaptor<0x32e>, &property_getter_adaptor<0x32f>, + &property_getter_adaptor<0x330>, &property_getter_adaptor<0x331>, &property_getter_adaptor<0x332>, &property_getter_adaptor<0x333>, &property_getter_adaptor<0x334>, &property_getter_adaptor<0x335>, &property_getter_adaptor<0x336>, &property_getter_adaptor<0x337>, + &property_getter_adaptor<0x338>, &property_getter_adaptor<0x339>, &property_getter_adaptor<0x33a>, &property_getter_adaptor<0x33b>, &property_getter_adaptor<0x33c>, &property_getter_adaptor<0x33d>, &property_getter_adaptor<0x33e>, &property_getter_adaptor<0x33f>, + &property_getter_adaptor<0x340>, &property_getter_adaptor<0x341>, &property_getter_adaptor<0x342>, &property_getter_adaptor<0x343>, &property_getter_adaptor<0x344>, &property_getter_adaptor<0x345>, &property_getter_adaptor<0x346>, &property_getter_adaptor<0x347>, + &property_getter_adaptor<0x348>, &property_getter_adaptor<0x349>, &property_getter_adaptor<0x34a>, &property_getter_adaptor<0x34b>, &property_getter_adaptor<0x34c>, &property_getter_adaptor<0x34d>, &property_getter_adaptor<0x34e>, &property_getter_adaptor<0x34f>, + &property_getter_adaptor<0x350>, &property_getter_adaptor<0x351>, &property_getter_adaptor<0x352>, &property_getter_adaptor<0x353>, &property_getter_adaptor<0x354>, &property_getter_adaptor<0x355>, &property_getter_adaptor<0x356>, &property_getter_adaptor<0x357>, + &property_getter_adaptor<0x358>, &property_getter_adaptor<0x359>, &property_getter_adaptor<0x35a>, &property_getter_adaptor<0x35b>, &property_getter_adaptor<0x35c>, &property_getter_adaptor<0x35d>, &property_getter_adaptor<0x35e>, &property_getter_adaptor<0x35f>, + &property_getter_adaptor<0x360>, &property_getter_adaptor<0x361>, &property_getter_adaptor<0x362>, &property_getter_adaptor<0x363>, &property_getter_adaptor<0x364>, &property_getter_adaptor<0x365>, &property_getter_adaptor<0x366>, &property_getter_adaptor<0x367>, + &property_getter_adaptor<0x368>, &property_getter_adaptor<0x369>, &property_getter_adaptor<0x36a>, &property_getter_adaptor<0x36b>, &property_getter_adaptor<0x36c>, &property_getter_adaptor<0x36d>, &property_getter_adaptor<0x36e>, &property_getter_adaptor<0x36f>, + &property_getter_adaptor<0x370>, &property_getter_adaptor<0x371>, &property_getter_adaptor<0x372>, &property_getter_adaptor<0x373>, &property_getter_adaptor<0x374>, &property_getter_adaptor<0x375>, &property_getter_adaptor<0x376>, &property_getter_adaptor<0x377>, + &property_getter_adaptor<0x378>, &property_getter_adaptor<0x379>, &property_getter_adaptor<0x37a>, &property_getter_adaptor<0x37b>, &property_getter_adaptor<0x37c>, &property_getter_adaptor<0x37d>, &property_getter_adaptor<0x37e>, &property_getter_adaptor<0x37f>, + &property_getter_adaptor<0x380>, &property_getter_adaptor<0x381>, &property_getter_adaptor<0x382>, &property_getter_adaptor<0x383>, &property_getter_adaptor<0x384>, &property_getter_adaptor<0x385>, &property_getter_adaptor<0x386>, &property_getter_adaptor<0x387>, + &property_getter_adaptor<0x388>, &property_getter_adaptor<0x389>, &property_getter_adaptor<0x38a>, &property_getter_adaptor<0x38b>, &property_getter_adaptor<0x38c>, &property_getter_adaptor<0x38d>, &property_getter_adaptor<0x38e>, &property_getter_adaptor<0x38f>, + &property_getter_adaptor<0x390>, &property_getter_adaptor<0x391>, &property_getter_adaptor<0x392>, &property_getter_adaptor<0x393>, &property_getter_adaptor<0x394>, &property_getter_adaptor<0x395>, &property_getter_adaptor<0x396>, &property_getter_adaptor<0x397>, + &property_getter_adaptor<0x398>, &property_getter_adaptor<0x399>, &property_getter_adaptor<0x39a>, &property_getter_adaptor<0x39b>, &property_getter_adaptor<0x39c>, &property_getter_adaptor<0x39d>, &property_getter_adaptor<0x39e>, &property_getter_adaptor<0x39f>, + &property_getter_adaptor<0x3a0>, &property_getter_adaptor<0x3a1>, &property_getter_adaptor<0x3a2>, &property_getter_adaptor<0x3a3>, &property_getter_adaptor<0x3a4>, &property_getter_adaptor<0x3a5>, &property_getter_adaptor<0x3a6>, &property_getter_adaptor<0x3a7>, + &property_getter_adaptor<0x3a8>, &property_getter_adaptor<0x3a9>, &property_getter_adaptor<0x3aa>, &property_getter_adaptor<0x3ab>, &property_getter_adaptor<0x3ac>, &property_getter_adaptor<0x3ad>, &property_getter_adaptor<0x3ae>, &property_getter_adaptor<0x3af>, + &property_getter_adaptor<0x3b0>, &property_getter_adaptor<0x3b1>, &property_getter_adaptor<0x3b2>, &property_getter_adaptor<0x3b3>, &property_getter_adaptor<0x3b4>, &property_getter_adaptor<0x3b5>, &property_getter_adaptor<0x3b6>, &property_getter_adaptor<0x3b7>, + &property_getter_adaptor<0x3b8>, &property_getter_adaptor<0x3b9>, &property_getter_adaptor<0x3ba>, &property_getter_adaptor<0x3bb>, &property_getter_adaptor<0x3bc>, &property_getter_adaptor<0x3bd>, &property_getter_adaptor<0x3be>, &property_getter_adaptor<0x3bf>, + &property_getter_adaptor<0x3c0>, &property_getter_adaptor<0x3c1>, &property_getter_adaptor<0x3c2>, &property_getter_adaptor<0x3c3>, &property_getter_adaptor<0x3c4>, &property_getter_adaptor<0x3c5>, &property_getter_adaptor<0x3c6>, &property_getter_adaptor<0x3c7>, + &property_getter_adaptor<0x3c8>, &property_getter_adaptor<0x3c9>, &property_getter_adaptor<0x3ca>, &property_getter_adaptor<0x3cb>, &property_getter_adaptor<0x3cc>, &property_getter_adaptor<0x3cd>, &property_getter_adaptor<0x3ce>, &property_getter_adaptor<0x3cf>, + &property_getter_adaptor<0x3d0>, &property_getter_adaptor<0x3d1>, &property_getter_adaptor<0x3d2>, &property_getter_adaptor<0x3d3>, &property_getter_adaptor<0x3d4>, &property_getter_adaptor<0x3d5>, &property_getter_adaptor<0x3d6>, &property_getter_adaptor<0x3d7>, + &property_getter_adaptor<0x3d8>, &property_getter_adaptor<0x3d9>, &property_getter_adaptor<0x3da>, &property_getter_adaptor<0x3db>, &property_getter_adaptor<0x3dc>, &property_getter_adaptor<0x3dd>, &property_getter_adaptor<0x3de>, &property_getter_adaptor<0x3df>, + &property_getter_adaptor<0x3e0>, &property_getter_adaptor<0x3e1>, &property_getter_adaptor<0x3e2>, &property_getter_adaptor<0x3e3>, &property_getter_adaptor<0x3e4>, &property_getter_adaptor<0x3e5>, &property_getter_adaptor<0x3e6>, &property_getter_adaptor<0x3e7>, + &property_getter_adaptor<0x3e8>, &property_getter_adaptor<0x3e9>, &property_getter_adaptor<0x3ea>, &property_getter_adaptor<0x3eb>, &property_getter_adaptor<0x3ec>, &property_getter_adaptor<0x3ed>, &property_getter_adaptor<0x3ee>, &property_getter_adaptor<0x3ef>, + &property_getter_adaptor<0x3f0>, &property_getter_adaptor<0x3f1>, &property_getter_adaptor<0x3f2>, &property_getter_adaptor<0x3f3>, &property_getter_adaptor<0x3f4>, &property_getter_adaptor<0x3f5>, &property_getter_adaptor<0x3f6>, &property_getter_adaptor<0x3f7>, + &property_getter_adaptor<0x3f8>, &property_getter_adaptor<0x3f9>, &property_getter_adaptor<0x3fa>, &property_getter_adaptor<0x3fb>, &property_getter_adaptor<0x3fc>, &property_getter_adaptor<0x3fd>, &property_getter_adaptor<0x3fe>, &property_getter_adaptor<0x3ff>, +}; + +py_func_ptr_t get_property_getter_adaptor (int n) +{ + tl_assert (n >= 0 && n < int (sizeof (property_getter_adaptors) / sizeof (property_getter_adaptors [0]))); + return property_getter_adaptors [n]; +} + +template +PyObject *property_setter_adaptor (PyObject *self, PyObject *args) +{ + return property_setter_adaptor (N, self, args); +} + +static py_func_ptr_t property_setter_adaptors [] = +{ + &property_setter_adaptor<0x000>, &property_setter_adaptor<0x001>, &property_setter_adaptor<0x002>, &property_setter_adaptor<0x003>, &property_setter_adaptor<0x004>, &property_setter_adaptor<0x005>, &property_setter_adaptor<0x006>, &property_setter_adaptor<0x007>, + &property_setter_adaptor<0x008>, &property_setter_adaptor<0x009>, &property_setter_adaptor<0x00a>, &property_setter_adaptor<0x00b>, &property_setter_adaptor<0x00c>, &property_setter_adaptor<0x00d>, &property_setter_adaptor<0x00e>, &property_setter_adaptor<0x00f>, + &property_setter_adaptor<0x010>, &property_setter_adaptor<0x011>, &property_setter_adaptor<0x012>, &property_setter_adaptor<0x013>, &property_setter_adaptor<0x014>, &property_setter_adaptor<0x015>, &property_setter_adaptor<0x016>, &property_setter_adaptor<0x017>, + &property_setter_adaptor<0x018>, &property_setter_adaptor<0x019>, &property_setter_adaptor<0x01a>, &property_setter_adaptor<0x01b>, &property_setter_adaptor<0x01c>, &property_setter_adaptor<0x01d>, &property_setter_adaptor<0x01e>, &property_setter_adaptor<0x01f>, + &property_setter_adaptor<0x020>, &property_setter_adaptor<0x021>, &property_setter_adaptor<0x022>, &property_setter_adaptor<0x023>, &property_setter_adaptor<0x024>, &property_setter_adaptor<0x025>, &property_setter_adaptor<0x026>, &property_setter_adaptor<0x027>, + &property_setter_adaptor<0x028>, &property_setter_adaptor<0x029>, &property_setter_adaptor<0x02a>, &property_setter_adaptor<0x02b>, &property_setter_adaptor<0x02c>, &property_setter_adaptor<0x02d>, &property_setter_adaptor<0x02e>, &property_setter_adaptor<0x02f>, + &property_setter_adaptor<0x030>, &property_setter_adaptor<0x031>, &property_setter_adaptor<0x032>, &property_setter_adaptor<0x033>, &property_setter_adaptor<0x034>, &property_setter_adaptor<0x035>, &property_setter_adaptor<0x036>, &property_setter_adaptor<0x037>, + &property_setter_adaptor<0x038>, &property_setter_adaptor<0x039>, &property_setter_adaptor<0x03a>, &property_setter_adaptor<0x03b>, &property_setter_adaptor<0x03c>, &property_setter_adaptor<0x03d>, &property_setter_adaptor<0x03e>, &property_setter_adaptor<0x03f>, + &property_setter_adaptor<0x040>, &property_setter_adaptor<0x041>, &property_setter_adaptor<0x042>, &property_setter_adaptor<0x043>, &property_setter_adaptor<0x044>, &property_setter_adaptor<0x045>, &property_setter_adaptor<0x046>, &property_setter_adaptor<0x047>, + &property_setter_adaptor<0x048>, &property_setter_adaptor<0x049>, &property_setter_adaptor<0x04a>, &property_setter_adaptor<0x04b>, &property_setter_adaptor<0x04c>, &property_setter_adaptor<0x04d>, &property_setter_adaptor<0x04e>, &property_setter_adaptor<0x04f>, + &property_setter_adaptor<0x050>, &property_setter_adaptor<0x051>, &property_setter_adaptor<0x052>, &property_setter_adaptor<0x053>, &property_setter_adaptor<0x054>, &property_setter_adaptor<0x055>, &property_setter_adaptor<0x056>, &property_setter_adaptor<0x057>, + &property_setter_adaptor<0x058>, &property_setter_adaptor<0x059>, &property_setter_adaptor<0x05a>, &property_setter_adaptor<0x05b>, &property_setter_adaptor<0x05c>, &property_setter_adaptor<0x05d>, &property_setter_adaptor<0x05e>, &property_setter_adaptor<0x05f>, + &property_setter_adaptor<0x060>, &property_setter_adaptor<0x061>, &property_setter_adaptor<0x062>, &property_setter_adaptor<0x063>, &property_setter_adaptor<0x064>, &property_setter_adaptor<0x065>, &property_setter_adaptor<0x066>, &property_setter_adaptor<0x067>, + &property_setter_adaptor<0x068>, &property_setter_adaptor<0x069>, &property_setter_adaptor<0x06a>, &property_setter_adaptor<0x06b>, &property_setter_adaptor<0x06c>, &property_setter_adaptor<0x06d>, &property_setter_adaptor<0x06e>, &property_setter_adaptor<0x06f>, + &property_setter_adaptor<0x070>, &property_setter_adaptor<0x071>, &property_setter_adaptor<0x072>, &property_setter_adaptor<0x073>, &property_setter_adaptor<0x074>, &property_setter_adaptor<0x075>, &property_setter_adaptor<0x076>, &property_setter_adaptor<0x077>, + &property_setter_adaptor<0x078>, &property_setter_adaptor<0x079>, &property_setter_adaptor<0x07a>, &property_setter_adaptor<0x07b>, &property_setter_adaptor<0x07c>, &property_setter_adaptor<0x07d>, &property_setter_adaptor<0x07e>, &property_setter_adaptor<0x07f>, + &property_setter_adaptor<0x080>, &property_setter_adaptor<0x081>, &property_setter_adaptor<0x082>, &property_setter_adaptor<0x083>, &property_setter_adaptor<0x084>, &property_setter_adaptor<0x085>, &property_setter_adaptor<0x086>, &property_setter_adaptor<0x087>, + &property_setter_adaptor<0x088>, &property_setter_adaptor<0x089>, &property_setter_adaptor<0x08a>, &property_setter_adaptor<0x08b>, &property_setter_adaptor<0x08c>, &property_setter_adaptor<0x08d>, &property_setter_adaptor<0x08e>, &property_setter_adaptor<0x08f>, + &property_setter_adaptor<0x090>, &property_setter_adaptor<0x091>, &property_setter_adaptor<0x092>, &property_setter_adaptor<0x093>, &property_setter_adaptor<0x094>, &property_setter_adaptor<0x095>, &property_setter_adaptor<0x096>, &property_setter_adaptor<0x097>, + &property_setter_adaptor<0x098>, &property_setter_adaptor<0x099>, &property_setter_adaptor<0x09a>, &property_setter_adaptor<0x09b>, &property_setter_adaptor<0x09c>, &property_setter_adaptor<0x09d>, &property_setter_adaptor<0x09e>, &property_setter_adaptor<0x09f>, + &property_setter_adaptor<0x0a0>, &property_setter_adaptor<0x0a1>, &property_setter_adaptor<0x0a2>, &property_setter_adaptor<0x0a3>, &property_setter_adaptor<0x0a4>, &property_setter_adaptor<0x0a5>, &property_setter_adaptor<0x0a6>, &property_setter_adaptor<0x0a7>, + &property_setter_adaptor<0x0a8>, &property_setter_adaptor<0x0a9>, &property_setter_adaptor<0x0aa>, &property_setter_adaptor<0x0ab>, &property_setter_adaptor<0x0ac>, &property_setter_adaptor<0x0ad>, &property_setter_adaptor<0x0ae>, &property_setter_adaptor<0x0af>, + &property_setter_adaptor<0x0b0>, &property_setter_adaptor<0x0b1>, &property_setter_adaptor<0x0b2>, &property_setter_adaptor<0x0b3>, &property_setter_adaptor<0x0b4>, &property_setter_adaptor<0x0b5>, &property_setter_adaptor<0x0b6>, &property_setter_adaptor<0x0b7>, + &property_setter_adaptor<0x0b8>, &property_setter_adaptor<0x0b9>, &property_setter_adaptor<0x0ba>, &property_setter_adaptor<0x0bb>, &property_setter_adaptor<0x0bc>, &property_setter_adaptor<0x0bd>, &property_setter_adaptor<0x0be>, &property_setter_adaptor<0x0bf>, + &property_setter_adaptor<0x0c0>, &property_setter_adaptor<0x0c1>, &property_setter_adaptor<0x0c2>, &property_setter_adaptor<0x0c3>, &property_setter_adaptor<0x0c4>, &property_setter_adaptor<0x0c5>, &property_setter_adaptor<0x0c6>, &property_setter_adaptor<0x0c7>, + &property_setter_adaptor<0x0c8>, &property_setter_adaptor<0x0c9>, &property_setter_adaptor<0x0ca>, &property_setter_adaptor<0x0cb>, &property_setter_adaptor<0x0cc>, &property_setter_adaptor<0x0cd>, &property_setter_adaptor<0x0ce>, &property_setter_adaptor<0x0cf>, + &property_setter_adaptor<0x0d0>, &property_setter_adaptor<0x0d1>, &property_setter_adaptor<0x0d2>, &property_setter_adaptor<0x0d3>, &property_setter_adaptor<0x0d4>, &property_setter_adaptor<0x0d5>, &property_setter_adaptor<0x0d6>, &property_setter_adaptor<0x0d7>, + &property_setter_adaptor<0x0d8>, &property_setter_adaptor<0x0d9>, &property_setter_adaptor<0x0da>, &property_setter_adaptor<0x0db>, &property_setter_adaptor<0x0dc>, &property_setter_adaptor<0x0dd>, &property_setter_adaptor<0x0de>, &property_setter_adaptor<0x0df>, + &property_setter_adaptor<0x0e0>, &property_setter_adaptor<0x0e1>, &property_setter_adaptor<0x0e2>, &property_setter_adaptor<0x0e3>, &property_setter_adaptor<0x0e4>, &property_setter_adaptor<0x0e5>, &property_setter_adaptor<0x0e6>, &property_setter_adaptor<0x0e7>, + &property_setter_adaptor<0x0e8>, &property_setter_adaptor<0x0e9>, &property_setter_adaptor<0x0ea>, &property_setter_adaptor<0x0eb>, &property_setter_adaptor<0x0ec>, &property_setter_adaptor<0x0ed>, &property_setter_adaptor<0x0ee>, &property_setter_adaptor<0x0ef>, + &property_setter_adaptor<0x0f0>, &property_setter_adaptor<0x0f1>, &property_setter_adaptor<0x0f2>, &property_setter_adaptor<0x0f3>, &property_setter_adaptor<0x0f4>, &property_setter_adaptor<0x0f5>, &property_setter_adaptor<0x0f6>, &property_setter_adaptor<0x0f7>, + &property_setter_adaptor<0x0f8>, &property_setter_adaptor<0x0f9>, &property_setter_adaptor<0x0fa>, &property_setter_adaptor<0x0fb>, &property_setter_adaptor<0x0fc>, &property_setter_adaptor<0x0fd>, &property_setter_adaptor<0x0fe>, &property_setter_adaptor<0x0ff>, + &property_setter_adaptor<0x100>, &property_setter_adaptor<0x101>, &property_setter_adaptor<0x102>, &property_setter_adaptor<0x103>, &property_setter_adaptor<0x104>, &property_setter_adaptor<0x105>, &property_setter_adaptor<0x106>, &property_setter_adaptor<0x107>, + &property_setter_adaptor<0x108>, &property_setter_adaptor<0x109>, &property_setter_adaptor<0x10a>, &property_setter_adaptor<0x10b>, &property_setter_adaptor<0x10c>, &property_setter_adaptor<0x10d>, &property_setter_adaptor<0x10e>, &property_setter_adaptor<0x10f>, + &property_setter_adaptor<0x110>, &property_setter_adaptor<0x111>, &property_setter_adaptor<0x112>, &property_setter_adaptor<0x113>, &property_setter_adaptor<0x114>, &property_setter_adaptor<0x115>, &property_setter_adaptor<0x116>, &property_setter_adaptor<0x117>, + &property_setter_adaptor<0x118>, &property_setter_adaptor<0x119>, &property_setter_adaptor<0x11a>, &property_setter_adaptor<0x11b>, &property_setter_adaptor<0x11c>, &property_setter_adaptor<0x11d>, &property_setter_adaptor<0x11e>, &property_setter_adaptor<0x11f>, + &property_setter_adaptor<0x120>, &property_setter_adaptor<0x121>, &property_setter_adaptor<0x122>, &property_setter_adaptor<0x123>, &property_setter_adaptor<0x124>, &property_setter_adaptor<0x125>, &property_setter_adaptor<0x126>, &property_setter_adaptor<0x127>, + &property_setter_adaptor<0x128>, &property_setter_adaptor<0x129>, &property_setter_adaptor<0x12a>, &property_setter_adaptor<0x12b>, &property_setter_adaptor<0x12c>, &property_setter_adaptor<0x12d>, &property_setter_adaptor<0x12e>, &property_setter_adaptor<0x12f>, + &property_setter_adaptor<0x130>, &property_setter_adaptor<0x131>, &property_setter_adaptor<0x132>, &property_setter_adaptor<0x133>, &property_setter_adaptor<0x134>, &property_setter_adaptor<0x135>, &property_setter_adaptor<0x136>, &property_setter_adaptor<0x137>, + &property_setter_adaptor<0x138>, &property_setter_adaptor<0x139>, &property_setter_adaptor<0x13a>, &property_setter_adaptor<0x13b>, &property_setter_adaptor<0x13c>, &property_setter_adaptor<0x13d>, &property_setter_adaptor<0x13e>, &property_setter_adaptor<0x13f>, + &property_setter_adaptor<0x140>, &property_setter_adaptor<0x141>, &property_setter_adaptor<0x142>, &property_setter_adaptor<0x143>, &property_setter_adaptor<0x144>, &property_setter_adaptor<0x145>, &property_setter_adaptor<0x146>, &property_setter_adaptor<0x147>, + &property_setter_adaptor<0x148>, &property_setter_adaptor<0x149>, &property_setter_adaptor<0x14a>, &property_setter_adaptor<0x14b>, &property_setter_adaptor<0x14c>, &property_setter_adaptor<0x14d>, &property_setter_adaptor<0x14e>, &property_setter_adaptor<0x14f>, + &property_setter_adaptor<0x150>, &property_setter_adaptor<0x151>, &property_setter_adaptor<0x152>, &property_setter_adaptor<0x153>, &property_setter_adaptor<0x154>, &property_setter_adaptor<0x155>, &property_setter_adaptor<0x156>, &property_setter_adaptor<0x157>, + &property_setter_adaptor<0x158>, &property_setter_adaptor<0x159>, &property_setter_adaptor<0x15a>, &property_setter_adaptor<0x15b>, &property_setter_adaptor<0x15c>, &property_setter_adaptor<0x15d>, &property_setter_adaptor<0x15e>, &property_setter_adaptor<0x15f>, + &property_setter_adaptor<0x160>, &property_setter_adaptor<0x161>, &property_setter_adaptor<0x162>, &property_setter_adaptor<0x163>, &property_setter_adaptor<0x164>, &property_setter_adaptor<0x165>, &property_setter_adaptor<0x166>, &property_setter_adaptor<0x167>, + &property_setter_adaptor<0x168>, &property_setter_adaptor<0x169>, &property_setter_adaptor<0x16a>, &property_setter_adaptor<0x16b>, &property_setter_adaptor<0x16c>, &property_setter_adaptor<0x16d>, &property_setter_adaptor<0x16e>, &property_setter_adaptor<0x16f>, + &property_setter_adaptor<0x170>, &property_setter_adaptor<0x171>, &property_setter_adaptor<0x172>, &property_setter_adaptor<0x173>, &property_setter_adaptor<0x174>, &property_setter_adaptor<0x175>, &property_setter_adaptor<0x176>, &property_setter_adaptor<0x177>, + &property_setter_adaptor<0x178>, &property_setter_adaptor<0x179>, &property_setter_adaptor<0x17a>, &property_setter_adaptor<0x17b>, &property_setter_adaptor<0x17c>, &property_setter_adaptor<0x17d>, &property_setter_adaptor<0x17e>, &property_setter_adaptor<0x17f>, + &property_setter_adaptor<0x180>, &property_setter_adaptor<0x181>, &property_setter_adaptor<0x182>, &property_setter_adaptor<0x183>, &property_setter_adaptor<0x184>, &property_setter_adaptor<0x185>, &property_setter_adaptor<0x186>, &property_setter_adaptor<0x187>, + &property_setter_adaptor<0x188>, &property_setter_adaptor<0x189>, &property_setter_adaptor<0x18a>, &property_setter_adaptor<0x18b>, &property_setter_adaptor<0x18c>, &property_setter_adaptor<0x18d>, &property_setter_adaptor<0x18e>, &property_setter_adaptor<0x18f>, + &property_setter_adaptor<0x190>, &property_setter_adaptor<0x191>, &property_setter_adaptor<0x192>, &property_setter_adaptor<0x193>, &property_setter_adaptor<0x194>, &property_setter_adaptor<0x195>, &property_setter_adaptor<0x196>, &property_setter_adaptor<0x197>, + &property_setter_adaptor<0x198>, &property_setter_adaptor<0x199>, &property_setter_adaptor<0x19a>, &property_setter_adaptor<0x19b>, &property_setter_adaptor<0x19c>, &property_setter_adaptor<0x19d>, &property_setter_adaptor<0x19e>, &property_setter_adaptor<0x19f>, + &property_setter_adaptor<0x1a0>, &property_setter_adaptor<0x1a1>, &property_setter_adaptor<0x1a2>, &property_setter_adaptor<0x1a3>, &property_setter_adaptor<0x1a4>, &property_setter_adaptor<0x1a5>, &property_setter_adaptor<0x1a6>, &property_setter_adaptor<0x1a7>, + &property_setter_adaptor<0x1a8>, &property_setter_adaptor<0x1a9>, &property_setter_adaptor<0x1aa>, &property_setter_adaptor<0x1ab>, &property_setter_adaptor<0x1ac>, &property_setter_adaptor<0x1ad>, &property_setter_adaptor<0x1ae>, &property_setter_adaptor<0x1af>, + &property_setter_adaptor<0x1b0>, &property_setter_adaptor<0x1b1>, &property_setter_adaptor<0x1b2>, &property_setter_adaptor<0x1b3>, &property_setter_adaptor<0x1b4>, &property_setter_adaptor<0x1b5>, &property_setter_adaptor<0x1b6>, &property_setter_adaptor<0x1b7>, + &property_setter_adaptor<0x1b8>, &property_setter_adaptor<0x1b9>, &property_setter_adaptor<0x1ba>, &property_setter_adaptor<0x1bb>, &property_setter_adaptor<0x1bc>, &property_setter_adaptor<0x1bd>, &property_setter_adaptor<0x1be>, &property_setter_adaptor<0x1bf>, + &property_setter_adaptor<0x1c0>, &property_setter_adaptor<0x1c1>, &property_setter_adaptor<0x1c2>, &property_setter_adaptor<0x1c3>, &property_setter_adaptor<0x1c4>, &property_setter_adaptor<0x1c5>, &property_setter_adaptor<0x1c6>, &property_setter_adaptor<0x1c7>, + &property_setter_adaptor<0x1c8>, &property_setter_adaptor<0x1c9>, &property_setter_adaptor<0x1ca>, &property_setter_adaptor<0x1cb>, &property_setter_adaptor<0x1cc>, &property_setter_adaptor<0x1cd>, &property_setter_adaptor<0x1ce>, &property_setter_adaptor<0x1cf>, + &property_setter_adaptor<0x1d0>, &property_setter_adaptor<0x1d1>, &property_setter_adaptor<0x1d2>, &property_setter_adaptor<0x1d3>, &property_setter_adaptor<0x1d4>, &property_setter_adaptor<0x1d5>, &property_setter_adaptor<0x1d6>, &property_setter_adaptor<0x1d7>, + &property_setter_adaptor<0x1d8>, &property_setter_adaptor<0x1d9>, &property_setter_adaptor<0x1da>, &property_setter_adaptor<0x1db>, &property_setter_adaptor<0x1dc>, &property_setter_adaptor<0x1dd>, &property_setter_adaptor<0x1de>, &property_setter_adaptor<0x1df>, + &property_setter_adaptor<0x1e0>, &property_setter_adaptor<0x1e1>, &property_setter_adaptor<0x1e2>, &property_setter_adaptor<0x1e3>, &property_setter_adaptor<0x1e4>, &property_setter_adaptor<0x1e5>, &property_setter_adaptor<0x1e6>, &property_setter_adaptor<0x1e7>, + &property_setter_adaptor<0x1e8>, &property_setter_adaptor<0x1e9>, &property_setter_adaptor<0x1ea>, &property_setter_adaptor<0x1eb>, &property_setter_adaptor<0x1ec>, &property_setter_adaptor<0x1ed>, &property_setter_adaptor<0x1ee>, &property_setter_adaptor<0x1ef>, + &property_setter_adaptor<0x1f0>, &property_setter_adaptor<0x1f1>, &property_setter_adaptor<0x1f2>, &property_setter_adaptor<0x1f3>, &property_setter_adaptor<0x1f4>, &property_setter_adaptor<0x1f5>, &property_setter_adaptor<0x1f6>, &property_setter_adaptor<0x1f7>, + &property_setter_adaptor<0x1f8>, &property_setter_adaptor<0x1f9>, &property_setter_adaptor<0x1fa>, &property_setter_adaptor<0x1fb>, &property_setter_adaptor<0x1fc>, &property_setter_adaptor<0x1fd>, &property_setter_adaptor<0x1fe>, &property_setter_adaptor<0x1ff>, + &property_setter_adaptor<0x200>, &property_setter_adaptor<0x201>, &property_setter_adaptor<0x202>, &property_setter_adaptor<0x203>, &property_setter_adaptor<0x204>, &property_setter_adaptor<0x205>, &property_setter_adaptor<0x206>, &property_setter_adaptor<0x207>, + &property_setter_adaptor<0x208>, &property_setter_adaptor<0x209>, &property_setter_adaptor<0x20a>, &property_setter_adaptor<0x20b>, &property_setter_adaptor<0x20c>, &property_setter_adaptor<0x20d>, &property_setter_adaptor<0x20e>, &property_setter_adaptor<0x20f>, + &property_setter_adaptor<0x210>, &property_setter_adaptor<0x211>, &property_setter_adaptor<0x212>, &property_setter_adaptor<0x213>, &property_setter_adaptor<0x214>, &property_setter_adaptor<0x215>, &property_setter_adaptor<0x216>, &property_setter_adaptor<0x217>, + &property_setter_adaptor<0x218>, &property_setter_adaptor<0x219>, &property_setter_adaptor<0x21a>, &property_setter_adaptor<0x21b>, &property_setter_adaptor<0x21c>, &property_setter_adaptor<0x21d>, &property_setter_adaptor<0x21e>, &property_setter_adaptor<0x21f>, + &property_setter_adaptor<0x220>, &property_setter_adaptor<0x221>, &property_setter_adaptor<0x222>, &property_setter_adaptor<0x223>, &property_setter_adaptor<0x224>, &property_setter_adaptor<0x225>, &property_setter_adaptor<0x226>, &property_setter_adaptor<0x227>, + &property_setter_adaptor<0x228>, &property_setter_adaptor<0x229>, &property_setter_adaptor<0x22a>, &property_setter_adaptor<0x22b>, &property_setter_adaptor<0x22c>, &property_setter_adaptor<0x22d>, &property_setter_adaptor<0x22e>, &property_setter_adaptor<0x22f>, + &property_setter_adaptor<0x230>, &property_setter_adaptor<0x231>, &property_setter_adaptor<0x232>, &property_setter_adaptor<0x233>, &property_setter_adaptor<0x234>, &property_setter_adaptor<0x235>, &property_setter_adaptor<0x236>, &property_setter_adaptor<0x237>, + &property_setter_adaptor<0x238>, &property_setter_adaptor<0x239>, &property_setter_adaptor<0x23a>, &property_setter_adaptor<0x23b>, &property_setter_adaptor<0x23c>, &property_setter_adaptor<0x23d>, &property_setter_adaptor<0x23e>, &property_setter_adaptor<0x23f>, + &property_setter_adaptor<0x240>, &property_setter_adaptor<0x241>, &property_setter_adaptor<0x242>, &property_setter_adaptor<0x243>, &property_setter_adaptor<0x244>, &property_setter_adaptor<0x245>, &property_setter_adaptor<0x246>, &property_setter_adaptor<0x247>, + &property_setter_adaptor<0x248>, &property_setter_adaptor<0x249>, &property_setter_adaptor<0x24a>, &property_setter_adaptor<0x24b>, &property_setter_adaptor<0x24c>, &property_setter_adaptor<0x24d>, &property_setter_adaptor<0x24e>, &property_setter_adaptor<0x24f>, + &property_setter_adaptor<0x250>, &property_setter_adaptor<0x251>, &property_setter_adaptor<0x252>, &property_setter_adaptor<0x253>, &property_setter_adaptor<0x254>, &property_setter_adaptor<0x255>, &property_setter_adaptor<0x256>, &property_setter_adaptor<0x257>, + &property_setter_adaptor<0x258>, &property_setter_adaptor<0x259>, &property_setter_adaptor<0x25a>, &property_setter_adaptor<0x25b>, &property_setter_adaptor<0x25c>, &property_setter_adaptor<0x25d>, &property_setter_adaptor<0x25e>, &property_setter_adaptor<0x25f>, + &property_setter_adaptor<0x260>, &property_setter_adaptor<0x261>, &property_setter_adaptor<0x262>, &property_setter_adaptor<0x263>, &property_setter_adaptor<0x264>, &property_setter_adaptor<0x265>, &property_setter_adaptor<0x266>, &property_setter_adaptor<0x267>, + &property_setter_adaptor<0x268>, &property_setter_adaptor<0x269>, &property_setter_adaptor<0x26a>, &property_setter_adaptor<0x26b>, &property_setter_adaptor<0x26c>, &property_setter_adaptor<0x26d>, &property_setter_adaptor<0x26e>, &property_setter_adaptor<0x26f>, + &property_setter_adaptor<0x270>, &property_setter_adaptor<0x271>, &property_setter_adaptor<0x272>, &property_setter_adaptor<0x273>, &property_setter_adaptor<0x274>, &property_setter_adaptor<0x275>, &property_setter_adaptor<0x276>, &property_setter_adaptor<0x277>, + &property_setter_adaptor<0x278>, &property_setter_adaptor<0x279>, &property_setter_adaptor<0x27a>, &property_setter_adaptor<0x27b>, &property_setter_adaptor<0x27c>, &property_setter_adaptor<0x27d>, &property_setter_adaptor<0x27e>, &property_setter_adaptor<0x27f>, + &property_setter_adaptor<0x280>, &property_setter_adaptor<0x281>, &property_setter_adaptor<0x282>, &property_setter_adaptor<0x283>, &property_setter_adaptor<0x284>, &property_setter_adaptor<0x285>, &property_setter_adaptor<0x286>, &property_setter_adaptor<0x287>, + &property_setter_adaptor<0x288>, &property_setter_adaptor<0x289>, &property_setter_adaptor<0x28a>, &property_setter_adaptor<0x28b>, &property_setter_adaptor<0x28c>, &property_setter_adaptor<0x28d>, &property_setter_adaptor<0x28e>, &property_setter_adaptor<0x28f>, + &property_setter_adaptor<0x290>, &property_setter_adaptor<0x291>, &property_setter_adaptor<0x292>, &property_setter_adaptor<0x293>, &property_setter_adaptor<0x294>, &property_setter_adaptor<0x295>, &property_setter_adaptor<0x296>, &property_setter_adaptor<0x297>, + &property_setter_adaptor<0x298>, &property_setter_adaptor<0x299>, &property_setter_adaptor<0x29a>, &property_setter_adaptor<0x29b>, &property_setter_adaptor<0x29c>, &property_setter_adaptor<0x29d>, &property_setter_adaptor<0x29e>, &property_setter_adaptor<0x29f>, + &property_setter_adaptor<0x2a0>, &property_setter_adaptor<0x2a1>, &property_setter_adaptor<0x2a2>, &property_setter_adaptor<0x2a3>, &property_setter_adaptor<0x2a4>, &property_setter_adaptor<0x2a5>, &property_setter_adaptor<0x2a6>, &property_setter_adaptor<0x2a7>, + &property_setter_adaptor<0x2a8>, &property_setter_adaptor<0x2a9>, &property_setter_adaptor<0x2aa>, &property_setter_adaptor<0x2ab>, &property_setter_adaptor<0x2ac>, &property_setter_adaptor<0x2ad>, &property_setter_adaptor<0x2ae>, &property_setter_adaptor<0x2af>, + &property_setter_adaptor<0x2b0>, &property_setter_adaptor<0x2b1>, &property_setter_adaptor<0x2b2>, &property_setter_adaptor<0x2b3>, &property_setter_adaptor<0x2b4>, &property_setter_adaptor<0x2b5>, &property_setter_adaptor<0x2b6>, &property_setter_adaptor<0x2b7>, + &property_setter_adaptor<0x2b8>, &property_setter_adaptor<0x2b9>, &property_setter_adaptor<0x2ba>, &property_setter_adaptor<0x2bb>, &property_setter_adaptor<0x2bc>, &property_setter_adaptor<0x2bd>, &property_setter_adaptor<0x2be>, &property_setter_adaptor<0x2bf>, + &property_setter_adaptor<0x2c0>, &property_setter_adaptor<0x2c1>, &property_setter_adaptor<0x2c2>, &property_setter_adaptor<0x2c3>, &property_setter_adaptor<0x2c4>, &property_setter_adaptor<0x2c5>, &property_setter_adaptor<0x2c6>, &property_setter_adaptor<0x2c7>, + &property_setter_adaptor<0x2c8>, &property_setter_adaptor<0x2c9>, &property_setter_adaptor<0x2ca>, &property_setter_adaptor<0x2cb>, &property_setter_adaptor<0x2cc>, &property_setter_adaptor<0x2cd>, &property_setter_adaptor<0x2ce>, &property_setter_adaptor<0x2cf>, + &property_setter_adaptor<0x2d0>, &property_setter_adaptor<0x2d1>, &property_setter_adaptor<0x2d2>, &property_setter_adaptor<0x2d3>, &property_setter_adaptor<0x2d4>, &property_setter_adaptor<0x2d5>, &property_setter_adaptor<0x2d6>, &property_setter_adaptor<0x2d7>, + &property_setter_adaptor<0x2d8>, &property_setter_adaptor<0x2d9>, &property_setter_adaptor<0x2da>, &property_setter_adaptor<0x2db>, &property_setter_adaptor<0x2dc>, &property_setter_adaptor<0x2dd>, &property_setter_adaptor<0x2de>, &property_setter_adaptor<0x2df>, + &property_setter_adaptor<0x2e0>, &property_setter_adaptor<0x2e1>, &property_setter_adaptor<0x2e2>, &property_setter_adaptor<0x2e3>, &property_setter_adaptor<0x2e4>, &property_setter_adaptor<0x2e5>, &property_setter_adaptor<0x2e6>, &property_setter_adaptor<0x2e7>, + &property_setter_adaptor<0x2e8>, &property_setter_adaptor<0x2e9>, &property_setter_adaptor<0x2ea>, &property_setter_adaptor<0x2eb>, &property_setter_adaptor<0x2ec>, &property_setter_adaptor<0x2ed>, &property_setter_adaptor<0x2ee>, &property_setter_adaptor<0x2ef>, + &property_setter_adaptor<0x2f0>, &property_setter_adaptor<0x2f1>, &property_setter_adaptor<0x2f2>, &property_setter_adaptor<0x2f3>, &property_setter_adaptor<0x2f4>, &property_setter_adaptor<0x2f5>, &property_setter_adaptor<0x2f6>, &property_setter_adaptor<0x2f7>, + &property_setter_adaptor<0x2f8>, &property_setter_adaptor<0x2f9>, &property_setter_adaptor<0x2fa>, &property_setter_adaptor<0x2fb>, &property_setter_adaptor<0x2fc>, &property_setter_adaptor<0x2fd>, &property_setter_adaptor<0x2fe>, &property_setter_adaptor<0x2ff>, + &property_setter_adaptor<0x300>, &property_setter_adaptor<0x301>, &property_setter_adaptor<0x302>, &property_setter_adaptor<0x303>, &property_setter_adaptor<0x304>, &property_setter_adaptor<0x305>, &property_setter_adaptor<0x306>, &property_setter_adaptor<0x307>, + &property_setter_adaptor<0x308>, &property_setter_adaptor<0x309>, &property_setter_adaptor<0x30a>, &property_setter_adaptor<0x30b>, &property_setter_adaptor<0x30c>, &property_setter_adaptor<0x30d>, &property_setter_adaptor<0x30e>, &property_setter_adaptor<0x30f>, + &property_setter_adaptor<0x310>, &property_setter_adaptor<0x311>, &property_setter_adaptor<0x312>, &property_setter_adaptor<0x313>, &property_setter_adaptor<0x314>, &property_setter_adaptor<0x315>, &property_setter_adaptor<0x316>, &property_setter_adaptor<0x317>, + &property_setter_adaptor<0x318>, &property_setter_adaptor<0x319>, &property_setter_adaptor<0x31a>, &property_setter_adaptor<0x31b>, &property_setter_adaptor<0x31c>, &property_setter_adaptor<0x31d>, &property_setter_adaptor<0x31e>, &property_setter_adaptor<0x31f>, + &property_setter_adaptor<0x320>, &property_setter_adaptor<0x321>, &property_setter_adaptor<0x322>, &property_setter_adaptor<0x323>, &property_setter_adaptor<0x324>, &property_setter_adaptor<0x325>, &property_setter_adaptor<0x326>, &property_setter_adaptor<0x327>, + &property_setter_adaptor<0x328>, &property_setter_adaptor<0x329>, &property_setter_adaptor<0x32a>, &property_setter_adaptor<0x32b>, &property_setter_adaptor<0x32c>, &property_setter_adaptor<0x32d>, &property_setter_adaptor<0x32e>, &property_setter_adaptor<0x32f>, + &property_setter_adaptor<0x330>, &property_setter_adaptor<0x331>, &property_setter_adaptor<0x332>, &property_setter_adaptor<0x333>, &property_setter_adaptor<0x334>, &property_setter_adaptor<0x335>, &property_setter_adaptor<0x336>, &property_setter_adaptor<0x337>, + &property_setter_adaptor<0x338>, &property_setter_adaptor<0x339>, &property_setter_adaptor<0x33a>, &property_setter_adaptor<0x33b>, &property_setter_adaptor<0x33c>, &property_setter_adaptor<0x33d>, &property_setter_adaptor<0x33e>, &property_setter_adaptor<0x33f>, + &property_setter_adaptor<0x340>, &property_setter_adaptor<0x341>, &property_setter_adaptor<0x342>, &property_setter_adaptor<0x343>, &property_setter_adaptor<0x344>, &property_setter_adaptor<0x345>, &property_setter_adaptor<0x346>, &property_setter_adaptor<0x347>, + &property_setter_adaptor<0x348>, &property_setter_adaptor<0x349>, &property_setter_adaptor<0x34a>, &property_setter_adaptor<0x34b>, &property_setter_adaptor<0x34c>, &property_setter_adaptor<0x34d>, &property_setter_adaptor<0x34e>, &property_setter_adaptor<0x34f>, + &property_setter_adaptor<0x350>, &property_setter_adaptor<0x351>, &property_setter_adaptor<0x352>, &property_setter_adaptor<0x353>, &property_setter_adaptor<0x354>, &property_setter_adaptor<0x355>, &property_setter_adaptor<0x356>, &property_setter_adaptor<0x357>, + &property_setter_adaptor<0x358>, &property_setter_adaptor<0x359>, &property_setter_adaptor<0x35a>, &property_setter_adaptor<0x35b>, &property_setter_adaptor<0x35c>, &property_setter_adaptor<0x35d>, &property_setter_adaptor<0x35e>, &property_setter_adaptor<0x35f>, + &property_setter_adaptor<0x360>, &property_setter_adaptor<0x361>, &property_setter_adaptor<0x362>, &property_setter_adaptor<0x363>, &property_setter_adaptor<0x364>, &property_setter_adaptor<0x365>, &property_setter_adaptor<0x366>, &property_setter_adaptor<0x367>, + &property_setter_adaptor<0x368>, &property_setter_adaptor<0x369>, &property_setter_adaptor<0x36a>, &property_setter_adaptor<0x36b>, &property_setter_adaptor<0x36c>, &property_setter_adaptor<0x36d>, &property_setter_adaptor<0x36e>, &property_setter_adaptor<0x36f>, + &property_setter_adaptor<0x370>, &property_setter_adaptor<0x371>, &property_setter_adaptor<0x372>, &property_setter_adaptor<0x373>, &property_setter_adaptor<0x374>, &property_setter_adaptor<0x375>, &property_setter_adaptor<0x376>, &property_setter_adaptor<0x377>, + &property_setter_adaptor<0x378>, &property_setter_adaptor<0x379>, &property_setter_adaptor<0x37a>, &property_setter_adaptor<0x37b>, &property_setter_adaptor<0x37c>, &property_setter_adaptor<0x37d>, &property_setter_adaptor<0x37e>, &property_setter_adaptor<0x37f>, + &property_setter_adaptor<0x380>, &property_setter_adaptor<0x381>, &property_setter_adaptor<0x382>, &property_setter_adaptor<0x383>, &property_setter_adaptor<0x384>, &property_setter_adaptor<0x385>, &property_setter_adaptor<0x386>, &property_setter_adaptor<0x387>, + &property_setter_adaptor<0x388>, &property_setter_adaptor<0x389>, &property_setter_adaptor<0x38a>, &property_setter_adaptor<0x38b>, &property_setter_adaptor<0x38c>, &property_setter_adaptor<0x38d>, &property_setter_adaptor<0x38e>, &property_setter_adaptor<0x38f>, + &property_setter_adaptor<0x390>, &property_setter_adaptor<0x391>, &property_setter_adaptor<0x392>, &property_setter_adaptor<0x393>, &property_setter_adaptor<0x394>, &property_setter_adaptor<0x395>, &property_setter_adaptor<0x396>, &property_setter_adaptor<0x397>, + &property_setter_adaptor<0x398>, &property_setter_adaptor<0x399>, &property_setter_adaptor<0x39a>, &property_setter_adaptor<0x39b>, &property_setter_adaptor<0x39c>, &property_setter_adaptor<0x39d>, &property_setter_adaptor<0x39e>, &property_setter_adaptor<0x39f>, + &property_setter_adaptor<0x3a0>, &property_setter_adaptor<0x3a1>, &property_setter_adaptor<0x3a2>, &property_setter_adaptor<0x3a3>, &property_setter_adaptor<0x3a4>, &property_setter_adaptor<0x3a5>, &property_setter_adaptor<0x3a6>, &property_setter_adaptor<0x3a7>, + &property_setter_adaptor<0x3a8>, &property_setter_adaptor<0x3a9>, &property_setter_adaptor<0x3aa>, &property_setter_adaptor<0x3ab>, &property_setter_adaptor<0x3ac>, &property_setter_adaptor<0x3ad>, &property_setter_adaptor<0x3ae>, &property_setter_adaptor<0x3af>, + &property_setter_adaptor<0x3b0>, &property_setter_adaptor<0x3b1>, &property_setter_adaptor<0x3b2>, &property_setter_adaptor<0x3b3>, &property_setter_adaptor<0x3b4>, &property_setter_adaptor<0x3b5>, &property_setter_adaptor<0x3b6>, &property_setter_adaptor<0x3b7>, + &property_setter_adaptor<0x3b8>, &property_setter_adaptor<0x3b9>, &property_setter_adaptor<0x3ba>, &property_setter_adaptor<0x3bb>, &property_setter_adaptor<0x3bc>, &property_setter_adaptor<0x3bd>, &property_setter_adaptor<0x3be>, &property_setter_adaptor<0x3bf>, + &property_setter_adaptor<0x3c0>, &property_setter_adaptor<0x3c1>, &property_setter_adaptor<0x3c2>, &property_setter_adaptor<0x3c3>, &property_setter_adaptor<0x3c4>, &property_setter_adaptor<0x3c5>, &property_setter_adaptor<0x3c6>, &property_setter_adaptor<0x3c7>, + &property_setter_adaptor<0x3c8>, &property_setter_adaptor<0x3c9>, &property_setter_adaptor<0x3ca>, &property_setter_adaptor<0x3cb>, &property_setter_adaptor<0x3cc>, &property_setter_adaptor<0x3cd>, &property_setter_adaptor<0x3ce>, &property_setter_adaptor<0x3cf>, + &property_setter_adaptor<0x3d0>, &property_setter_adaptor<0x3d1>, &property_setter_adaptor<0x3d2>, &property_setter_adaptor<0x3d3>, &property_setter_adaptor<0x3d4>, &property_setter_adaptor<0x3d5>, &property_setter_adaptor<0x3d6>, &property_setter_adaptor<0x3d7>, + &property_setter_adaptor<0x3d8>, &property_setter_adaptor<0x3d9>, &property_setter_adaptor<0x3da>, &property_setter_adaptor<0x3db>, &property_setter_adaptor<0x3dc>, &property_setter_adaptor<0x3dd>, &property_setter_adaptor<0x3de>, &property_setter_adaptor<0x3df>, + &property_setter_adaptor<0x3e0>, &property_setter_adaptor<0x3e1>, &property_setter_adaptor<0x3e2>, &property_setter_adaptor<0x3e3>, &property_setter_adaptor<0x3e4>, &property_setter_adaptor<0x3e5>, &property_setter_adaptor<0x3e6>, &property_setter_adaptor<0x3e7>, + &property_setter_adaptor<0x3e8>, &property_setter_adaptor<0x3e9>, &property_setter_adaptor<0x3ea>, &property_setter_adaptor<0x3eb>, &property_setter_adaptor<0x3ec>, &property_setter_adaptor<0x3ed>, &property_setter_adaptor<0x3ee>, &property_setter_adaptor<0x3ef>, + &property_setter_adaptor<0x3f0>, &property_setter_adaptor<0x3f1>, &property_setter_adaptor<0x3f2>, &property_setter_adaptor<0x3f3>, &property_setter_adaptor<0x3f4>, &property_setter_adaptor<0x3f5>, &property_setter_adaptor<0x3f6>, &property_setter_adaptor<0x3f7>, + &property_setter_adaptor<0x3f8>, &property_setter_adaptor<0x3f9>, &property_setter_adaptor<0x3fa>, &property_setter_adaptor<0x3fb>, &property_setter_adaptor<0x3fc>, &property_setter_adaptor<0x3fd>, &property_setter_adaptor<0x3fe>, &property_setter_adaptor<0x3ff>, +}; + +py_func_ptr_t get_property_setter_adaptor (int n) +{ + tl_assert (n >= 0 && n < int (sizeof (property_setter_adaptors) / sizeof (property_setter_adaptors [0]))); + return property_setter_adaptors [n]; +} + +template +PyObject *method_init_adaptor (PyObject *self, PyObject *args) +{ + return method_init_adaptor (N, self, args); +} + +static py_func_ptr_t method_init_adaptors [] = +{ + &method_init_adaptor<0x000>, &method_init_adaptor<0x001>, &method_init_adaptor<0x002>, &method_init_adaptor<0x003>, &method_init_adaptor<0x004>, &method_init_adaptor<0x005>, &method_init_adaptor<0x006>, &method_init_adaptor<0x007>, + &method_init_adaptor<0x008>, &method_init_adaptor<0x009>, &method_init_adaptor<0x00a>, &method_init_adaptor<0x00b>, &method_init_adaptor<0x00c>, &method_init_adaptor<0x00d>, &method_init_adaptor<0x00e>, &method_init_adaptor<0x00f>, + &method_init_adaptor<0x010>, &method_init_adaptor<0x011>, &method_init_adaptor<0x012>, &method_init_adaptor<0x013>, &method_init_adaptor<0x014>, &method_init_adaptor<0x015>, &method_init_adaptor<0x016>, &method_init_adaptor<0x017>, + &method_init_adaptor<0x018>, &method_init_adaptor<0x019>, &method_init_adaptor<0x01a>, &method_init_adaptor<0x01b>, &method_init_adaptor<0x01c>, &method_init_adaptor<0x01d>, &method_init_adaptor<0x01e>, &method_init_adaptor<0x01f>, + &method_init_adaptor<0x020>, &method_init_adaptor<0x021>, &method_init_adaptor<0x022>, &method_init_adaptor<0x023>, &method_init_adaptor<0x024>, &method_init_adaptor<0x025>, &method_init_adaptor<0x026>, &method_init_adaptor<0x027>, + &method_init_adaptor<0x028>, &method_init_adaptor<0x029>, &method_init_adaptor<0x02a>, &method_init_adaptor<0x02b>, &method_init_adaptor<0x02c>, &method_init_adaptor<0x02d>, &method_init_adaptor<0x02e>, &method_init_adaptor<0x02f>, + &method_init_adaptor<0x030>, &method_init_adaptor<0x031>, &method_init_adaptor<0x032>, &method_init_adaptor<0x033>, &method_init_adaptor<0x034>, &method_init_adaptor<0x035>, &method_init_adaptor<0x036>, &method_init_adaptor<0x037>, + &method_init_adaptor<0x038>, &method_init_adaptor<0x039>, &method_init_adaptor<0x03a>, &method_init_adaptor<0x03b>, &method_init_adaptor<0x03c>, &method_init_adaptor<0x03d>, &method_init_adaptor<0x03e>, &method_init_adaptor<0x03f>, + &method_init_adaptor<0x040>, &method_init_adaptor<0x041>, &method_init_adaptor<0x042>, &method_init_adaptor<0x043>, &method_init_adaptor<0x044>, &method_init_adaptor<0x045>, &method_init_adaptor<0x046>, &method_init_adaptor<0x047>, + &method_init_adaptor<0x048>, &method_init_adaptor<0x049>, &method_init_adaptor<0x04a>, &method_init_adaptor<0x04b>, &method_init_adaptor<0x04c>, &method_init_adaptor<0x04d>, &method_init_adaptor<0x04e>, &method_init_adaptor<0x04f>, + &method_init_adaptor<0x050>, &method_init_adaptor<0x051>, &method_init_adaptor<0x052>, &method_init_adaptor<0x053>, &method_init_adaptor<0x054>, &method_init_adaptor<0x055>, &method_init_adaptor<0x056>, &method_init_adaptor<0x057>, + &method_init_adaptor<0x058>, &method_init_adaptor<0x059>, &method_init_adaptor<0x05a>, &method_init_adaptor<0x05b>, &method_init_adaptor<0x05c>, &method_init_adaptor<0x05d>, &method_init_adaptor<0x05e>, &method_init_adaptor<0x05f>, + &method_init_adaptor<0x060>, &method_init_adaptor<0x061>, &method_init_adaptor<0x062>, &method_init_adaptor<0x063>, &method_init_adaptor<0x064>, &method_init_adaptor<0x065>, &method_init_adaptor<0x066>, &method_init_adaptor<0x067>, + &method_init_adaptor<0x068>, &method_init_adaptor<0x069>, &method_init_adaptor<0x06a>, &method_init_adaptor<0x06b>, &method_init_adaptor<0x06c>, &method_init_adaptor<0x06d>, &method_init_adaptor<0x06e>, &method_init_adaptor<0x06f>, + &method_init_adaptor<0x070>, &method_init_adaptor<0x071>, &method_init_adaptor<0x072>, &method_init_adaptor<0x073>, &method_init_adaptor<0x074>, &method_init_adaptor<0x075>, &method_init_adaptor<0x076>, &method_init_adaptor<0x077>, + &method_init_adaptor<0x078>, &method_init_adaptor<0x079>, &method_init_adaptor<0x07a>, &method_init_adaptor<0x07b>, &method_init_adaptor<0x07c>, &method_init_adaptor<0x07d>, &method_init_adaptor<0x07e>, &method_init_adaptor<0x07f>, + &method_init_adaptor<0x080>, &method_init_adaptor<0x081>, &method_init_adaptor<0x082>, &method_init_adaptor<0x083>, &method_init_adaptor<0x084>, &method_init_adaptor<0x085>, &method_init_adaptor<0x086>, &method_init_adaptor<0x087>, + &method_init_adaptor<0x088>, &method_init_adaptor<0x089>, &method_init_adaptor<0x08a>, &method_init_adaptor<0x08b>, &method_init_adaptor<0x08c>, &method_init_adaptor<0x08d>, &method_init_adaptor<0x08e>, &method_init_adaptor<0x08f>, + &method_init_adaptor<0x090>, &method_init_adaptor<0x091>, &method_init_adaptor<0x092>, &method_init_adaptor<0x093>, &method_init_adaptor<0x094>, &method_init_adaptor<0x095>, &method_init_adaptor<0x096>, &method_init_adaptor<0x097>, + &method_init_adaptor<0x098>, &method_init_adaptor<0x099>, &method_init_adaptor<0x09a>, &method_init_adaptor<0x09b>, &method_init_adaptor<0x09c>, &method_init_adaptor<0x09d>, &method_init_adaptor<0x09e>, &method_init_adaptor<0x09f>, + &method_init_adaptor<0x0a0>, &method_init_adaptor<0x0a1>, &method_init_adaptor<0x0a2>, &method_init_adaptor<0x0a3>, &method_init_adaptor<0x0a4>, &method_init_adaptor<0x0a5>, &method_init_adaptor<0x0a6>, &method_init_adaptor<0x0a7>, + &method_init_adaptor<0x0a8>, &method_init_adaptor<0x0a9>, &method_init_adaptor<0x0aa>, &method_init_adaptor<0x0ab>, &method_init_adaptor<0x0ac>, &method_init_adaptor<0x0ad>, &method_init_adaptor<0x0ae>, &method_init_adaptor<0x0af>, + &method_init_adaptor<0x0b0>, &method_init_adaptor<0x0b1>, &method_init_adaptor<0x0b2>, &method_init_adaptor<0x0b3>, &method_init_adaptor<0x0b4>, &method_init_adaptor<0x0b5>, &method_init_adaptor<0x0b6>, &method_init_adaptor<0x0b7>, + &method_init_adaptor<0x0b8>, &method_init_adaptor<0x0b9>, &method_init_adaptor<0x0ba>, &method_init_adaptor<0x0bb>, &method_init_adaptor<0x0bc>, &method_init_adaptor<0x0bd>, &method_init_adaptor<0x0be>, &method_init_adaptor<0x0bf>, + &method_init_adaptor<0x0c0>, &method_init_adaptor<0x0c1>, &method_init_adaptor<0x0c2>, &method_init_adaptor<0x0c3>, &method_init_adaptor<0x0c4>, &method_init_adaptor<0x0c5>, &method_init_adaptor<0x0c6>, &method_init_adaptor<0x0c7>, + &method_init_adaptor<0x0c8>, &method_init_adaptor<0x0c9>, &method_init_adaptor<0x0ca>, &method_init_adaptor<0x0cb>, &method_init_adaptor<0x0cc>, &method_init_adaptor<0x0cd>, &method_init_adaptor<0x0ce>, &method_init_adaptor<0x0cf>, + &method_init_adaptor<0x0d0>, &method_init_adaptor<0x0d1>, &method_init_adaptor<0x0d2>, &method_init_adaptor<0x0d3>, &method_init_adaptor<0x0d4>, &method_init_adaptor<0x0d5>, &method_init_adaptor<0x0d6>, &method_init_adaptor<0x0d7>, + &method_init_adaptor<0x0d8>, &method_init_adaptor<0x0d9>, &method_init_adaptor<0x0da>, &method_init_adaptor<0x0db>, &method_init_adaptor<0x0dc>, &method_init_adaptor<0x0dd>, &method_init_adaptor<0x0de>, &method_init_adaptor<0x0df>, + &method_init_adaptor<0x0e0>, &method_init_adaptor<0x0e1>, &method_init_adaptor<0x0e2>, &method_init_adaptor<0x0e3>, &method_init_adaptor<0x0e4>, &method_init_adaptor<0x0e5>, &method_init_adaptor<0x0e6>, &method_init_adaptor<0x0e7>, + &method_init_adaptor<0x0e8>, &method_init_adaptor<0x0e9>, &method_init_adaptor<0x0ea>, &method_init_adaptor<0x0eb>, &method_init_adaptor<0x0ec>, &method_init_adaptor<0x0ed>, &method_init_adaptor<0x0ee>, &method_init_adaptor<0x0ef>, + &method_init_adaptor<0x0f0>, &method_init_adaptor<0x0f1>, &method_init_adaptor<0x0f2>, &method_init_adaptor<0x0f3>, &method_init_adaptor<0x0f4>, &method_init_adaptor<0x0f5>, &method_init_adaptor<0x0f6>, &method_init_adaptor<0x0f7>, + &method_init_adaptor<0x0f8>, &method_init_adaptor<0x0f9>, &method_init_adaptor<0x0fa>, &method_init_adaptor<0x0fb>, &method_init_adaptor<0x0fc>, &method_init_adaptor<0x0fd>, &method_init_adaptor<0x0fe>, &method_init_adaptor<0x0ff>, + &method_init_adaptor<0x100>, &method_init_adaptor<0x101>, &method_init_adaptor<0x102>, &method_init_adaptor<0x103>, &method_init_adaptor<0x104>, &method_init_adaptor<0x105>, &method_init_adaptor<0x106>, &method_init_adaptor<0x107>, + &method_init_adaptor<0x108>, &method_init_adaptor<0x109>, &method_init_adaptor<0x10a>, &method_init_adaptor<0x10b>, &method_init_adaptor<0x10c>, &method_init_adaptor<0x10d>, &method_init_adaptor<0x10e>, &method_init_adaptor<0x10f>, + &method_init_adaptor<0x110>, &method_init_adaptor<0x111>, &method_init_adaptor<0x112>, &method_init_adaptor<0x113>, &method_init_adaptor<0x114>, &method_init_adaptor<0x115>, &method_init_adaptor<0x116>, &method_init_adaptor<0x117>, + &method_init_adaptor<0x118>, &method_init_adaptor<0x119>, &method_init_adaptor<0x11a>, &method_init_adaptor<0x11b>, &method_init_adaptor<0x11c>, &method_init_adaptor<0x11d>, &method_init_adaptor<0x11e>, &method_init_adaptor<0x11f>, + &method_init_adaptor<0x120>, &method_init_adaptor<0x121>, &method_init_adaptor<0x122>, &method_init_adaptor<0x123>, &method_init_adaptor<0x124>, &method_init_adaptor<0x125>, &method_init_adaptor<0x126>, &method_init_adaptor<0x127>, + &method_init_adaptor<0x128>, &method_init_adaptor<0x129>, &method_init_adaptor<0x12a>, &method_init_adaptor<0x12b>, &method_init_adaptor<0x12c>, &method_init_adaptor<0x12d>, &method_init_adaptor<0x12e>, &method_init_adaptor<0x12f>, + &method_init_adaptor<0x130>, &method_init_adaptor<0x131>, &method_init_adaptor<0x132>, &method_init_adaptor<0x133>, &method_init_adaptor<0x134>, &method_init_adaptor<0x135>, &method_init_adaptor<0x136>, &method_init_adaptor<0x137>, + &method_init_adaptor<0x138>, &method_init_adaptor<0x139>, &method_init_adaptor<0x13a>, &method_init_adaptor<0x13b>, &method_init_adaptor<0x13c>, &method_init_adaptor<0x13d>, &method_init_adaptor<0x13e>, &method_init_adaptor<0x13f>, + &method_init_adaptor<0x140>, &method_init_adaptor<0x141>, &method_init_adaptor<0x142>, &method_init_adaptor<0x143>, &method_init_adaptor<0x144>, &method_init_adaptor<0x145>, &method_init_adaptor<0x146>, &method_init_adaptor<0x147>, + &method_init_adaptor<0x148>, &method_init_adaptor<0x149>, &method_init_adaptor<0x14a>, &method_init_adaptor<0x14b>, &method_init_adaptor<0x14c>, &method_init_adaptor<0x14d>, &method_init_adaptor<0x14e>, &method_init_adaptor<0x14f>, + &method_init_adaptor<0x150>, &method_init_adaptor<0x151>, &method_init_adaptor<0x152>, &method_init_adaptor<0x153>, &method_init_adaptor<0x154>, &method_init_adaptor<0x155>, &method_init_adaptor<0x156>, &method_init_adaptor<0x157>, + &method_init_adaptor<0x158>, &method_init_adaptor<0x159>, &method_init_adaptor<0x15a>, &method_init_adaptor<0x15b>, &method_init_adaptor<0x15c>, &method_init_adaptor<0x15d>, &method_init_adaptor<0x15e>, &method_init_adaptor<0x15f>, + &method_init_adaptor<0x160>, &method_init_adaptor<0x161>, &method_init_adaptor<0x162>, &method_init_adaptor<0x163>, &method_init_adaptor<0x164>, &method_init_adaptor<0x165>, &method_init_adaptor<0x166>, &method_init_adaptor<0x167>, + &method_init_adaptor<0x168>, &method_init_adaptor<0x169>, &method_init_adaptor<0x16a>, &method_init_adaptor<0x16b>, &method_init_adaptor<0x16c>, &method_init_adaptor<0x16d>, &method_init_adaptor<0x16e>, &method_init_adaptor<0x16f>, + &method_init_adaptor<0x170>, &method_init_adaptor<0x171>, &method_init_adaptor<0x172>, &method_init_adaptor<0x173>, &method_init_adaptor<0x174>, &method_init_adaptor<0x175>, &method_init_adaptor<0x176>, &method_init_adaptor<0x177>, + &method_init_adaptor<0x178>, &method_init_adaptor<0x179>, &method_init_adaptor<0x17a>, &method_init_adaptor<0x17b>, &method_init_adaptor<0x17c>, &method_init_adaptor<0x17d>, &method_init_adaptor<0x17e>, &method_init_adaptor<0x17f>, + &method_init_adaptor<0x180>, &method_init_adaptor<0x181>, &method_init_adaptor<0x182>, &method_init_adaptor<0x183>, &method_init_adaptor<0x184>, &method_init_adaptor<0x185>, &method_init_adaptor<0x186>, &method_init_adaptor<0x187>, + &method_init_adaptor<0x188>, &method_init_adaptor<0x189>, &method_init_adaptor<0x18a>, &method_init_adaptor<0x18b>, &method_init_adaptor<0x18c>, &method_init_adaptor<0x18d>, &method_init_adaptor<0x18e>, &method_init_adaptor<0x18f>, + &method_init_adaptor<0x190>, &method_init_adaptor<0x191>, &method_init_adaptor<0x192>, &method_init_adaptor<0x193>, &method_init_adaptor<0x194>, &method_init_adaptor<0x195>, &method_init_adaptor<0x196>, &method_init_adaptor<0x197>, + &method_init_adaptor<0x198>, &method_init_adaptor<0x199>, &method_init_adaptor<0x19a>, &method_init_adaptor<0x19b>, &method_init_adaptor<0x19c>, &method_init_adaptor<0x19d>, &method_init_adaptor<0x19e>, &method_init_adaptor<0x19f>, + &method_init_adaptor<0x1a0>, &method_init_adaptor<0x1a1>, &method_init_adaptor<0x1a2>, &method_init_adaptor<0x1a3>, &method_init_adaptor<0x1a4>, &method_init_adaptor<0x1a5>, &method_init_adaptor<0x1a6>, &method_init_adaptor<0x1a7>, + &method_init_adaptor<0x1a8>, &method_init_adaptor<0x1a9>, &method_init_adaptor<0x1aa>, &method_init_adaptor<0x1ab>, &method_init_adaptor<0x1ac>, &method_init_adaptor<0x1ad>, &method_init_adaptor<0x1ae>, &method_init_adaptor<0x1af>, + &method_init_adaptor<0x1b0>, &method_init_adaptor<0x1b1>, &method_init_adaptor<0x1b2>, &method_init_adaptor<0x1b3>, &method_init_adaptor<0x1b4>, &method_init_adaptor<0x1b5>, &method_init_adaptor<0x1b6>, &method_init_adaptor<0x1b7>, + &method_init_adaptor<0x1b8>, &method_init_adaptor<0x1b9>, &method_init_adaptor<0x1ba>, &method_init_adaptor<0x1bb>, &method_init_adaptor<0x1bc>, &method_init_adaptor<0x1bd>, &method_init_adaptor<0x1be>, &method_init_adaptor<0x1bf>, + &method_init_adaptor<0x1c0>, &method_init_adaptor<0x1c1>, &method_init_adaptor<0x1c2>, &method_init_adaptor<0x1c3>, &method_init_adaptor<0x1c4>, &method_init_adaptor<0x1c5>, &method_init_adaptor<0x1c6>, &method_init_adaptor<0x1c7>, + &method_init_adaptor<0x1c8>, &method_init_adaptor<0x1c9>, &method_init_adaptor<0x1ca>, &method_init_adaptor<0x1cb>, &method_init_adaptor<0x1cc>, &method_init_adaptor<0x1cd>, &method_init_adaptor<0x1ce>, &method_init_adaptor<0x1cf>, + &method_init_adaptor<0x1d0>, &method_init_adaptor<0x1d1>, &method_init_adaptor<0x1d2>, &method_init_adaptor<0x1d3>, &method_init_adaptor<0x1d4>, &method_init_adaptor<0x1d5>, &method_init_adaptor<0x1d6>, &method_init_adaptor<0x1d7>, + &method_init_adaptor<0x1d8>, &method_init_adaptor<0x1d9>, &method_init_adaptor<0x1da>, &method_init_adaptor<0x1db>, &method_init_adaptor<0x1dc>, &method_init_adaptor<0x1dd>, &method_init_adaptor<0x1de>, &method_init_adaptor<0x1df>, + &method_init_adaptor<0x1e0>, &method_init_adaptor<0x1e1>, &method_init_adaptor<0x1e2>, &method_init_adaptor<0x1e3>, &method_init_adaptor<0x1e4>, &method_init_adaptor<0x1e5>, &method_init_adaptor<0x1e6>, &method_init_adaptor<0x1e7>, + &method_init_adaptor<0x1e8>, &method_init_adaptor<0x1e9>, &method_init_adaptor<0x1ea>, &method_init_adaptor<0x1eb>, &method_init_adaptor<0x1ec>, &method_init_adaptor<0x1ed>, &method_init_adaptor<0x1ee>, &method_init_adaptor<0x1ef>, + &method_init_adaptor<0x1f0>, &method_init_adaptor<0x1f1>, &method_init_adaptor<0x1f2>, &method_init_adaptor<0x1f3>, &method_init_adaptor<0x1f4>, &method_init_adaptor<0x1f5>, &method_init_adaptor<0x1f6>, &method_init_adaptor<0x1f7>, + &method_init_adaptor<0x1f8>, &method_init_adaptor<0x1f9>, &method_init_adaptor<0x1fa>, &method_init_adaptor<0x1fb>, &method_init_adaptor<0x1fc>, &method_init_adaptor<0x1fd>, &method_init_adaptor<0x1fe>, &method_init_adaptor<0x1ff>, + &method_init_adaptor<0x200>, &method_init_adaptor<0x201>, &method_init_adaptor<0x202>, &method_init_adaptor<0x203>, &method_init_adaptor<0x204>, &method_init_adaptor<0x205>, &method_init_adaptor<0x206>, &method_init_adaptor<0x207>, + &method_init_adaptor<0x208>, &method_init_adaptor<0x209>, &method_init_adaptor<0x20a>, &method_init_adaptor<0x20b>, &method_init_adaptor<0x20c>, &method_init_adaptor<0x20d>, &method_init_adaptor<0x20e>, &method_init_adaptor<0x20f>, + &method_init_adaptor<0x210>, &method_init_adaptor<0x211>, &method_init_adaptor<0x212>, &method_init_adaptor<0x213>, &method_init_adaptor<0x214>, &method_init_adaptor<0x215>, &method_init_adaptor<0x216>, &method_init_adaptor<0x217>, + &method_init_adaptor<0x218>, &method_init_adaptor<0x219>, &method_init_adaptor<0x21a>, &method_init_adaptor<0x21b>, &method_init_adaptor<0x21c>, &method_init_adaptor<0x21d>, &method_init_adaptor<0x21e>, &method_init_adaptor<0x21f>, + &method_init_adaptor<0x220>, &method_init_adaptor<0x221>, &method_init_adaptor<0x222>, &method_init_adaptor<0x223>, &method_init_adaptor<0x224>, &method_init_adaptor<0x225>, &method_init_adaptor<0x226>, &method_init_adaptor<0x227>, + &method_init_adaptor<0x228>, &method_init_adaptor<0x229>, &method_init_adaptor<0x22a>, &method_init_adaptor<0x22b>, &method_init_adaptor<0x22c>, &method_init_adaptor<0x22d>, &method_init_adaptor<0x22e>, &method_init_adaptor<0x22f>, + &method_init_adaptor<0x230>, &method_init_adaptor<0x231>, &method_init_adaptor<0x232>, &method_init_adaptor<0x233>, &method_init_adaptor<0x234>, &method_init_adaptor<0x235>, &method_init_adaptor<0x236>, &method_init_adaptor<0x237>, + &method_init_adaptor<0x238>, &method_init_adaptor<0x239>, &method_init_adaptor<0x23a>, &method_init_adaptor<0x23b>, &method_init_adaptor<0x23c>, &method_init_adaptor<0x23d>, &method_init_adaptor<0x23e>, &method_init_adaptor<0x23f>, + &method_init_adaptor<0x240>, &method_init_adaptor<0x241>, &method_init_adaptor<0x242>, &method_init_adaptor<0x243>, &method_init_adaptor<0x244>, &method_init_adaptor<0x245>, &method_init_adaptor<0x246>, &method_init_adaptor<0x247>, + &method_init_adaptor<0x248>, &method_init_adaptor<0x249>, &method_init_adaptor<0x24a>, &method_init_adaptor<0x24b>, &method_init_adaptor<0x24c>, &method_init_adaptor<0x24d>, &method_init_adaptor<0x24e>, &method_init_adaptor<0x24f>, + &method_init_adaptor<0x250>, &method_init_adaptor<0x251>, &method_init_adaptor<0x252>, &method_init_adaptor<0x253>, &method_init_adaptor<0x254>, &method_init_adaptor<0x255>, &method_init_adaptor<0x256>, &method_init_adaptor<0x257>, + &method_init_adaptor<0x258>, &method_init_adaptor<0x259>, &method_init_adaptor<0x25a>, &method_init_adaptor<0x25b>, &method_init_adaptor<0x25c>, &method_init_adaptor<0x25d>, &method_init_adaptor<0x25e>, &method_init_adaptor<0x25f>, + &method_init_adaptor<0x260>, &method_init_adaptor<0x261>, &method_init_adaptor<0x262>, &method_init_adaptor<0x263>, &method_init_adaptor<0x264>, &method_init_adaptor<0x265>, &method_init_adaptor<0x266>, &method_init_adaptor<0x267>, + &method_init_adaptor<0x268>, &method_init_adaptor<0x269>, &method_init_adaptor<0x26a>, &method_init_adaptor<0x26b>, &method_init_adaptor<0x26c>, &method_init_adaptor<0x26d>, &method_init_adaptor<0x26e>, &method_init_adaptor<0x26f>, + &method_init_adaptor<0x270>, &method_init_adaptor<0x271>, &method_init_adaptor<0x272>, &method_init_adaptor<0x273>, &method_init_adaptor<0x274>, &method_init_adaptor<0x275>, &method_init_adaptor<0x276>, &method_init_adaptor<0x277>, + &method_init_adaptor<0x278>, &method_init_adaptor<0x279>, &method_init_adaptor<0x27a>, &method_init_adaptor<0x27b>, &method_init_adaptor<0x27c>, &method_init_adaptor<0x27d>, &method_init_adaptor<0x27e>, &method_init_adaptor<0x27f>, + &method_init_adaptor<0x280>, &method_init_adaptor<0x281>, &method_init_adaptor<0x282>, &method_init_adaptor<0x283>, &method_init_adaptor<0x284>, &method_init_adaptor<0x285>, &method_init_adaptor<0x286>, &method_init_adaptor<0x287>, + &method_init_adaptor<0x288>, &method_init_adaptor<0x289>, &method_init_adaptor<0x28a>, &method_init_adaptor<0x28b>, &method_init_adaptor<0x28c>, &method_init_adaptor<0x28d>, &method_init_adaptor<0x28e>, &method_init_adaptor<0x28f>, + &method_init_adaptor<0x290>, &method_init_adaptor<0x291>, &method_init_adaptor<0x292>, &method_init_adaptor<0x293>, &method_init_adaptor<0x294>, &method_init_adaptor<0x295>, &method_init_adaptor<0x296>, &method_init_adaptor<0x297>, + &method_init_adaptor<0x298>, &method_init_adaptor<0x299>, &method_init_adaptor<0x29a>, &method_init_adaptor<0x29b>, &method_init_adaptor<0x29c>, &method_init_adaptor<0x29d>, &method_init_adaptor<0x29e>, &method_init_adaptor<0x29f>, + &method_init_adaptor<0x2a0>, &method_init_adaptor<0x2a1>, &method_init_adaptor<0x2a2>, &method_init_adaptor<0x2a3>, &method_init_adaptor<0x2a4>, &method_init_adaptor<0x2a5>, &method_init_adaptor<0x2a6>, &method_init_adaptor<0x2a7>, + &method_init_adaptor<0x2a8>, &method_init_adaptor<0x2a9>, &method_init_adaptor<0x2aa>, &method_init_adaptor<0x2ab>, &method_init_adaptor<0x2ac>, &method_init_adaptor<0x2ad>, &method_init_adaptor<0x2ae>, &method_init_adaptor<0x2af>, + &method_init_adaptor<0x2b0>, &method_init_adaptor<0x2b1>, &method_init_adaptor<0x2b2>, &method_init_adaptor<0x2b3>, &method_init_adaptor<0x2b4>, &method_init_adaptor<0x2b5>, &method_init_adaptor<0x2b6>, &method_init_adaptor<0x2b7>, + &method_init_adaptor<0x2b8>, &method_init_adaptor<0x2b9>, &method_init_adaptor<0x2ba>, &method_init_adaptor<0x2bb>, &method_init_adaptor<0x2bc>, &method_init_adaptor<0x2bd>, &method_init_adaptor<0x2be>, &method_init_adaptor<0x2bf>, + &method_init_adaptor<0x2c0>, &method_init_adaptor<0x2c1>, &method_init_adaptor<0x2c2>, &method_init_adaptor<0x2c3>, &method_init_adaptor<0x2c4>, &method_init_adaptor<0x2c5>, &method_init_adaptor<0x2c6>, &method_init_adaptor<0x2c7>, + &method_init_adaptor<0x2c8>, &method_init_adaptor<0x2c9>, &method_init_adaptor<0x2ca>, &method_init_adaptor<0x2cb>, &method_init_adaptor<0x2cc>, &method_init_adaptor<0x2cd>, &method_init_adaptor<0x2ce>, &method_init_adaptor<0x2cf>, + &method_init_adaptor<0x2d0>, &method_init_adaptor<0x2d1>, &method_init_adaptor<0x2d2>, &method_init_adaptor<0x2d3>, &method_init_adaptor<0x2d4>, &method_init_adaptor<0x2d5>, &method_init_adaptor<0x2d6>, &method_init_adaptor<0x2d7>, + &method_init_adaptor<0x2d8>, &method_init_adaptor<0x2d9>, &method_init_adaptor<0x2da>, &method_init_adaptor<0x2db>, &method_init_adaptor<0x2dc>, &method_init_adaptor<0x2dd>, &method_init_adaptor<0x2de>, &method_init_adaptor<0x2df>, + &method_init_adaptor<0x2e0>, &method_init_adaptor<0x2e1>, &method_init_adaptor<0x2e2>, &method_init_adaptor<0x2e3>, &method_init_adaptor<0x2e4>, &method_init_adaptor<0x2e5>, &method_init_adaptor<0x2e6>, &method_init_adaptor<0x2e7>, + &method_init_adaptor<0x2e8>, &method_init_adaptor<0x2e9>, &method_init_adaptor<0x2ea>, &method_init_adaptor<0x2eb>, &method_init_adaptor<0x2ec>, &method_init_adaptor<0x2ed>, &method_init_adaptor<0x2ee>, &method_init_adaptor<0x2ef>, + &method_init_adaptor<0x2f0>, &method_init_adaptor<0x2f1>, &method_init_adaptor<0x2f2>, &method_init_adaptor<0x2f3>, &method_init_adaptor<0x2f4>, &method_init_adaptor<0x2f5>, &method_init_adaptor<0x2f6>, &method_init_adaptor<0x2f7>, + &method_init_adaptor<0x2f8>, &method_init_adaptor<0x2f9>, &method_init_adaptor<0x2fa>, &method_init_adaptor<0x2fb>, &method_init_adaptor<0x2fc>, &method_init_adaptor<0x2fd>, &method_init_adaptor<0x2fe>, &method_init_adaptor<0x2ff>, + &method_init_adaptor<0x300>, &method_init_adaptor<0x301>, &method_init_adaptor<0x302>, &method_init_adaptor<0x303>, &method_init_adaptor<0x304>, &method_init_adaptor<0x305>, &method_init_adaptor<0x306>, &method_init_adaptor<0x307>, + &method_init_adaptor<0x308>, &method_init_adaptor<0x309>, &method_init_adaptor<0x30a>, &method_init_adaptor<0x30b>, &method_init_adaptor<0x30c>, &method_init_adaptor<0x30d>, &method_init_adaptor<0x30e>, &method_init_adaptor<0x30f>, + &method_init_adaptor<0x310>, &method_init_adaptor<0x311>, &method_init_adaptor<0x312>, &method_init_adaptor<0x313>, &method_init_adaptor<0x314>, &method_init_adaptor<0x315>, &method_init_adaptor<0x316>, &method_init_adaptor<0x317>, + &method_init_adaptor<0x318>, &method_init_adaptor<0x319>, &method_init_adaptor<0x31a>, &method_init_adaptor<0x31b>, &method_init_adaptor<0x31c>, &method_init_adaptor<0x31d>, &method_init_adaptor<0x31e>, &method_init_adaptor<0x31f>, + &method_init_adaptor<0x320>, &method_init_adaptor<0x321>, &method_init_adaptor<0x322>, &method_init_adaptor<0x323>, &method_init_adaptor<0x324>, &method_init_adaptor<0x325>, &method_init_adaptor<0x326>, &method_init_adaptor<0x327>, + &method_init_adaptor<0x328>, &method_init_adaptor<0x329>, &method_init_adaptor<0x32a>, &method_init_adaptor<0x32b>, &method_init_adaptor<0x32c>, &method_init_adaptor<0x32d>, &method_init_adaptor<0x32e>, &method_init_adaptor<0x32f>, + &method_init_adaptor<0x330>, &method_init_adaptor<0x331>, &method_init_adaptor<0x332>, &method_init_adaptor<0x333>, &method_init_adaptor<0x334>, &method_init_adaptor<0x335>, &method_init_adaptor<0x336>, &method_init_adaptor<0x337>, + &method_init_adaptor<0x338>, &method_init_adaptor<0x339>, &method_init_adaptor<0x33a>, &method_init_adaptor<0x33b>, &method_init_adaptor<0x33c>, &method_init_adaptor<0x33d>, &method_init_adaptor<0x33e>, &method_init_adaptor<0x33f>, + &method_init_adaptor<0x340>, &method_init_adaptor<0x341>, &method_init_adaptor<0x342>, &method_init_adaptor<0x343>, &method_init_adaptor<0x344>, &method_init_adaptor<0x345>, &method_init_adaptor<0x346>, &method_init_adaptor<0x347>, + &method_init_adaptor<0x348>, &method_init_adaptor<0x349>, &method_init_adaptor<0x34a>, &method_init_adaptor<0x34b>, &method_init_adaptor<0x34c>, &method_init_adaptor<0x34d>, &method_init_adaptor<0x34e>, &method_init_adaptor<0x34f>, + &method_init_adaptor<0x350>, &method_init_adaptor<0x351>, &method_init_adaptor<0x352>, &method_init_adaptor<0x353>, &method_init_adaptor<0x354>, &method_init_adaptor<0x355>, &method_init_adaptor<0x356>, &method_init_adaptor<0x357>, + &method_init_adaptor<0x358>, &method_init_adaptor<0x359>, &method_init_adaptor<0x35a>, &method_init_adaptor<0x35b>, &method_init_adaptor<0x35c>, &method_init_adaptor<0x35d>, &method_init_adaptor<0x35e>, &method_init_adaptor<0x35f>, + &method_init_adaptor<0x360>, &method_init_adaptor<0x361>, &method_init_adaptor<0x362>, &method_init_adaptor<0x363>, &method_init_adaptor<0x364>, &method_init_adaptor<0x365>, &method_init_adaptor<0x366>, &method_init_adaptor<0x367>, + &method_init_adaptor<0x368>, &method_init_adaptor<0x369>, &method_init_adaptor<0x36a>, &method_init_adaptor<0x36b>, &method_init_adaptor<0x36c>, &method_init_adaptor<0x36d>, &method_init_adaptor<0x36e>, &method_init_adaptor<0x36f>, + &method_init_adaptor<0x370>, &method_init_adaptor<0x371>, &method_init_adaptor<0x372>, &method_init_adaptor<0x373>, &method_init_adaptor<0x374>, &method_init_adaptor<0x375>, &method_init_adaptor<0x376>, &method_init_adaptor<0x377>, + &method_init_adaptor<0x378>, &method_init_adaptor<0x379>, &method_init_adaptor<0x37a>, &method_init_adaptor<0x37b>, &method_init_adaptor<0x37c>, &method_init_adaptor<0x37d>, &method_init_adaptor<0x37e>, &method_init_adaptor<0x37f>, + &method_init_adaptor<0x380>, &method_init_adaptor<0x381>, &method_init_adaptor<0x382>, &method_init_adaptor<0x383>, &method_init_adaptor<0x384>, &method_init_adaptor<0x385>, &method_init_adaptor<0x386>, &method_init_adaptor<0x387>, + &method_init_adaptor<0x388>, &method_init_adaptor<0x389>, &method_init_adaptor<0x38a>, &method_init_adaptor<0x38b>, &method_init_adaptor<0x38c>, &method_init_adaptor<0x38d>, &method_init_adaptor<0x38e>, &method_init_adaptor<0x38f>, + &method_init_adaptor<0x390>, &method_init_adaptor<0x391>, &method_init_adaptor<0x392>, &method_init_adaptor<0x393>, &method_init_adaptor<0x394>, &method_init_adaptor<0x395>, &method_init_adaptor<0x396>, &method_init_adaptor<0x397>, + &method_init_adaptor<0x398>, &method_init_adaptor<0x399>, &method_init_adaptor<0x39a>, &method_init_adaptor<0x39b>, &method_init_adaptor<0x39c>, &method_init_adaptor<0x39d>, &method_init_adaptor<0x39e>, &method_init_adaptor<0x39f>, + &method_init_adaptor<0x3a0>, &method_init_adaptor<0x3a1>, &method_init_adaptor<0x3a2>, &method_init_adaptor<0x3a3>, &method_init_adaptor<0x3a4>, &method_init_adaptor<0x3a5>, &method_init_adaptor<0x3a6>, &method_init_adaptor<0x3a7>, + &method_init_adaptor<0x3a8>, &method_init_adaptor<0x3a9>, &method_init_adaptor<0x3aa>, &method_init_adaptor<0x3ab>, &method_init_adaptor<0x3ac>, &method_init_adaptor<0x3ad>, &method_init_adaptor<0x3ae>, &method_init_adaptor<0x3af>, + &method_init_adaptor<0x3b0>, &method_init_adaptor<0x3b1>, &method_init_adaptor<0x3b2>, &method_init_adaptor<0x3b3>, &method_init_adaptor<0x3b4>, &method_init_adaptor<0x3b5>, &method_init_adaptor<0x3b6>, &method_init_adaptor<0x3b7>, + &method_init_adaptor<0x3b8>, &method_init_adaptor<0x3b9>, &method_init_adaptor<0x3ba>, &method_init_adaptor<0x3bb>, &method_init_adaptor<0x3bc>, &method_init_adaptor<0x3bd>, &method_init_adaptor<0x3be>, &method_init_adaptor<0x3bf>, + &method_init_adaptor<0x3c0>, &method_init_adaptor<0x3c1>, &method_init_adaptor<0x3c2>, &method_init_adaptor<0x3c3>, &method_init_adaptor<0x3c4>, &method_init_adaptor<0x3c5>, &method_init_adaptor<0x3c6>, &method_init_adaptor<0x3c7>, + &method_init_adaptor<0x3c8>, &method_init_adaptor<0x3c9>, &method_init_adaptor<0x3ca>, &method_init_adaptor<0x3cb>, &method_init_adaptor<0x3cc>, &method_init_adaptor<0x3cd>, &method_init_adaptor<0x3ce>, &method_init_adaptor<0x3cf>, + &method_init_adaptor<0x3d0>, &method_init_adaptor<0x3d1>, &method_init_adaptor<0x3d2>, &method_init_adaptor<0x3d3>, &method_init_adaptor<0x3d4>, &method_init_adaptor<0x3d5>, &method_init_adaptor<0x3d6>, &method_init_adaptor<0x3d7>, + &method_init_adaptor<0x3d8>, &method_init_adaptor<0x3d9>, &method_init_adaptor<0x3da>, &method_init_adaptor<0x3db>, &method_init_adaptor<0x3dc>, &method_init_adaptor<0x3dd>, &method_init_adaptor<0x3de>, &method_init_adaptor<0x3df>, + &method_init_adaptor<0x3e0>, &method_init_adaptor<0x3e1>, &method_init_adaptor<0x3e2>, &method_init_adaptor<0x3e3>, &method_init_adaptor<0x3e4>, &method_init_adaptor<0x3e5>, &method_init_adaptor<0x3e6>, &method_init_adaptor<0x3e7>, + &method_init_adaptor<0x3e8>, &method_init_adaptor<0x3e9>, &method_init_adaptor<0x3ea>, &method_init_adaptor<0x3eb>, &method_init_adaptor<0x3ec>, &method_init_adaptor<0x3ed>, &method_init_adaptor<0x3ee>, &method_init_adaptor<0x3ef>, + &method_init_adaptor<0x3f0>, &method_init_adaptor<0x3f1>, &method_init_adaptor<0x3f2>, &method_init_adaptor<0x3f3>, &method_init_adaptor<0x3f4>, &method_init_adaptor<0x3f5>, &method_init_adaptor<0x3f6>, &method_init_adaptor<0x3f7>, + &method_init_adaptor<0x3f8>, &method_init_adaptor<0x3f9>, &method_init_adaptor<0x3fa>, &method_init_adaptor<0x3fb>, &method_init_adaptor<0x3fc>, &method_init_adaptor<0x3fd>, &method_init_adaptor<0x3fe>, &method_init_adaptor<0x3ff>, +}; + +py_func_ptr_t get_method_init_adaptor (int n) +{ + tl_assert (n >= 0 && n < int (sizeof (method_init_adaptors) / sizeof (method_init_adaptors [0]))); + return method_init_adaptors [n]; +} + +} diff --git a/src/pya/pya/pyaCallables.h b/src/pya/pya/pyaCallables.h new file mode 100644 index 000000000..b5dd11983 --- /dev/null +++ b/src/pya/pya/pyaCallables.h @@ -0,0 +1,70 @@ +/* + + KLayout Layout Viewer + Copyright (C) 2006-2022 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#ifndef _HDR_pyaCallables +#define _HDR_pyaCallables + +#include + +#include "pyaCommon.h" + +namespace pya +{ + +void pya_object_deallocate (PyObject *self); +int pya_object_init (PyObject * /*self*/, PyObject *args, PyObject *kwds); +PyObject *pya_object_new (PyTypeObject *type, PyObject * /*args*/, PyObject * /*kwds*/); + +PyObject *object_default_ne_impl (PyObject *self, PyObject *args); +PyObject *object_default_ge_impl (PyObject *self, PyObject *args); +PyObject *object_default_le_impl (PyObject *self, PyObject *args); +PyObject *object_default_gt_impl (PyObject *self, PyObject *args); + +typedef PyObject *(*py_func_ptr_t) (PyObject *, PyObject *); + +py_func_ptr_t get_method_adaptor (int n); +py_func_ptr_t get_property_getter_adaptor (int n); +py_func_ptr_t get_property_setter_adaptor (int n); +py_func_ptr_t get_method_init_adaptor (int n); + +inline void *make_closure (int mid_getter, int mid_setter) +{ + size_t g = mid_getter < 0 ? (size_t) 0 : (size_t) mid_getter; + size_t s = mid_setter < 0 ? (size_t) 0 : (size_t) mid_setter; + return (void *) ((s << 16) | g); +} + +inline unsigned int getter_from_closure (void *closure) +{ + return (unsigned int) (size_t (closure) & 0xffff); +} + +inline unsigned int setter_from_closure (void *closure) +{ + return (unsigned int) (size_t (closure) >> 16); +} + +PyObject *property_getter_func (PyObject *self, void *closure); +int property_setter_func (PyObject *self, PyObject *value, void *closure); + +} + +#endif diff --git a/src/pya/pya/pyaInternal.cc b/src/pya/pya/pyaInternal.cc new file mode 100644 index 000000000..c1b263e5b --- /dev/null +++ b/src/pya/pya/pyaInternal.cc @@ -0,0 +1,793 @@ +/* + + KLayout Layout Viewer + Copyright (C) 2006-2022 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#include + +#include "pya.h" +#include "pyaInternal.h" +#include "pyaModule.h" +#include "pyaObject.h" + +#include "tlLog.h" + +namespace pya +{ + +// ------------------------------------------------------------------- +// MethodTableEntry implementation + +MethodTableEntry::MethodTableEntry (const std::string &name, bool st, bool prot) + : m_name (name), m_is_static (st), m_is_protected (prot), m_is_enabled (true) +{ } + +const std::string & +MethodTableEntry::name () const +{ + return m_name; +} + +void +MethodTableEntry::set_name (const std::string &n) +{ + m_name = n; +} + +void +MethodTableEntry::set_enabled (bool en) +{ + m_is_enabled = en; +} + +bool +MethodTableEntry::is_enabled () const +{ + return m_is_enabled; +} + +bool +MethodTableEntry::is_static () const +{ + return m_is_static; +} + +bool +MethodTableEntry::is_protected () const +{ + return m_is_protected; +} + +void +MethodTableEntry::add (const gsi::MethodBase *m) +{ + m_methods.push_back (m); +} + +void +MethodTableEntry::finish () +{ + // remove duplicate entries in the method list + std::vector m = m_methods; + std::sort(m.begin (), m.end ()); + m_methods.assign (m.begin (), std::unique (m.begin (), m.end ())); +} + +MethodTableEntry::method_iterator +MethodTableEntry::begin () const +{ + return m_methods.begin (); +} + +MethodTableEntry::method_iterator +MethodTableEntry::end () const +{ + return m_methods.end (); +} + +// ------------------------------------------------------------------- +// MethodTable implementation + +MethodTable::MethodTable (const gsi::ClassBase *cls_decl, PythonModule *module) + : m_method_offset (0), m_property_offset (0), mp_cls_decl (cls_decl), mp_module (module) +{ + if (cls_decl->base ()) { + const MethodTable *base_mt = method_table_by_class (cls_decl->base ()); + tl_assert (base_mt); + m_method_offset = base_mt->top_mid (); + m_property_offset = base_mt->top_property_mid (); + } + + // signals are translated into the setters and getters + for (gsi::ClassBase::method_iterator m = cls_decl->begin_methods (); m != cls_decl->end_methods (); ++m) { + if ((*m)->is_signal ()) { + for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { + add_getter (syn->name, *m); + add_setter (syn->name, *m); + } + } + } + + // first add getters and setters + for (gsi::ClassBase::method_iterator m = cls_decl->begin_methods (); m != cls_decl->end_methods (); ++m) { + if (! (*m)->is_callback ()) { + for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { + if (syn->is_getter) { + add_getter (syn->name, *m); + } else if (syn->is_setter) { + add_setter (syn->name, *m); + } + } + } + } + + // then add normal methods - on name clash with properties make them a getter + for (gsi::ClassBase::method_iterator m = cls_decl->begin_methods (); m != cls_decl->end_methods (); ++m) { + if (! (*m)->is_callback () && ! (*m)->is_signal ()) { + for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { + if (! syn->is_getter && ! syn->is_setter) { + if ((*m)->end_arguments () - (*m)->begin_arguments () == 0 && find_property ((*m)->is_static (), syn->name).first) { + add_getter (syn->name, *m); + } else { + add_method (syn->name, *m); + } + } + } + } + } +} + +size_t +MethodTable::bottom_mid () const +{ + return m_method_offset; +} + +size_t +MethodTable::top_mid () const +{ + return m_method_offset + m_table.size (); +} + +size_t +MethodTable::bottom_property_mid () const +{ + return m_property_offset; +} + +size_t +MethodTable::top_property_mid () const +{ + return m_property_offset + m_property_table.size (); +} + +std::pair +MethodTable::find_method (bool st, const std::string &name) const +{ + std::map , size_t>::const_iterator t = m_name_map.find (std::make_pair (st, name)); + if (t != m_name_map.end ()) { + return std::make_pair (true, t->second + m_method_offset); + } else { + return std::make_pair (false, 0); + } +} + +std::pair +MethodTable::find_property (bool st, const std::string &name) const +{ + std::map , size_t>::const_iterator t = m_property_name_map.find (std::make_pair (st, name)); + if (t != m_property_name_map.end ()) { + return std::make_pair (true, t->second + m_property_offset); + } else { + return std::make_pair (false, 0); + } +} + +/** + * @brief Extracts the Python name from a generic name + * + * Returns an empty string if no Python name could be generated. + */ +static std::string extract_python_name (const std::string &name) +{ + // some operator replacements + if (name == "++") { + return "inc"; + } else if (name == "--") { + return "dec"; + } else if (name == "()") { + return "call"; + } else if (name == "!") { + return "not"; + } else if (name == "==") { + return "__eq__"; + } else if (name == "!=") { + return "__ne__"; + } else if (name == "<") { + return "__lt__"; + } else if (name == "<=") { + return "__le__"; + } else if (name == ">") { + return "__gt__"; + } else if (name == ">=") { + return "__ge__"; + } else if (name == "<=>") { + return "__cmp__"; + } else if (name == "+") { + return "__add__"; + } else if (name == "+@") { + return "__pos__"; + } else if (name == "-") { + return "__sub__"; + } else if (name == "-@") { + return "__neg__"; + } else if (name == "/") { + #if PY_MAJOR_VERSION < 3 + return "__div__"; + #else + return "__truediv__"; + #endif + } else if (name == "*" || name == "*!") { + return "__mul__"; + } else if (name == "%") { + return "__mod__"; + } else if (name == "<<") { + return "__lshift__"; + } else if (name == ">>") { + return "__rshift__"; + } else if (name == "~") { + return "__invert__"; + } else if (name == "&") { + return "__and__"; + } else if (name == "|") { + return "__or__"; + } else if (name == "^") { + return "__xor__"; + } else if (name == "+=") { + return "__iadd__"; + } else if (name == "-=") { + return "__isub__"; + } else if (name == "/=") { + #if PY_MAJOR_VERSION < 3 + return "__idiv__"; + #else + return "__itruediv__"; + #endif + } else if (name == "*=") { + return "__imul__"; + } else if (name == "%=") { + return "__imod__"; + } else if (name == "<<=") { + return "__ilshift__"; + } else if (name == ">>=") { + return "__irshift__"; + } else if (name == "&=") { + return "__iand__"; + } else if (name == "|=") { + return "__ior__"; + } else if (name == "^=") { + return "__ixor__"; + } else if (name == "[]") { + return "__getitem__"; + } else if (name == "[]=") { + return "__setitem__"; + } else { + + const char *c = name.c_str (); + if (! isalnum (*c) && *c != '_') { + return std::string (); + } + + // question-mark symbol and trailing = are removed. + size_t n = 0; + for ( ; *c; ++c) { + if (*c == '=' || *c == '?') { + if (! c[1]) { + if (*c == '=') { + // Normally, this method is replaced by an attribute. + // If that fails, we prepend a "set_" to make the name unique. + return "set_" + std::string (name, 0, n); + } else { + return std::string (name, 0, n); + } + } else { + return std::string (); + } + } else if (! isalnum (*c) && *c != '_') { + return std::string (); + } else { + ++n; + } + } + + return name; + + } +} + +void +MethodTable::add_method (const std::string &name, const gsi::MethodBase *mb) +{ + if (name == "to_s" && mb->compatible_with_num_args (0)) { + + add_method_basic (name, mb); + + // The str method is also routed via the tp_str implementation + add_method_basic ("__str__", mb); + +#if defined(GSI_ALIAS_INSPECT) + // also alias to "__repr__" unless there is an explicit "inspect" method + bool alias_inspect = true; + for (gsi::ClassBase::method_iterator m = mp_cls_decl->begin_methods (); m != mp_cls_decl->end_methods () && alias_inspect; ++m) { + if (! (*m)->is_callback () && ! (*m)->is_signal ()) { + for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms () && alias_inspect; ++syn) { + if (! syn->is_getter && ! syn->is_setter && syn->name == "inspect") { + alias_inspect = false; + } + } + } + } +#else + bool alias_inspect = false; +#endif + if (alias_inspect) { + add_method_basic ("__repr__", mb); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'str(object)' and 'repr(object)'"))); + } else { + mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'str(object)'"))); + } + + } else if (name == "hash" && mb->compatible_with_num_args (0)) { + + // The hash method is also routed via the tp_hash implementation + add_method_basic ("__hash__", mb); + + add_method_basic (name, mb); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'hash(object)'"))); + + } else if (name == "inspect" && mb->compatible_with_num_args (0)) { + + // The str method is also routed via the tp_str implementation + add_method_basic ("__repr__", mb); + + add_method_basic (name, mb); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'repr(object)'"))); + + } else if (name == "size" && mb->compatible_with_num_args (0)) { + + // The size method is also routed via the sequence methods protocol if there + // is a [] function + add_method_basic ("__len__", mb); + + add_method_basic (name, mb); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'len(object)'"))); + + } else if (name == "each" && mb->compatible_with_num_args (0) && mb->ret_type ().is_iter ()) { + + // each makes the object iterable + add_method_basic ("__iter__", mb); + + add_method_basic (name, mb); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method enables iteration of the object"))); + + } else if (name == "dup" && mb->compatible_with_num_args (0)) { + + // If the object supports the dup method, then it is a good + // idea to define the __copy__ method. + add_method_basic ("__copy__", mb); + + add_method_basic (name, mb); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method also implements '__copy__'"))); + + } else { + + std::string py_name = extract_python_name (name); + if (py_name.empty ()) { + + // drop non-standard names + if (tl::verbosity () >= 20) { + tl::warn << tl::to_string (tr ("Class ")) << mp_cls_decl->name () << ": " << tl::to_string (tr ("no Python mapping for method ")) << name; + } + + add_method_basic (name, mb, false); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method is not available for Python"))); + + } else { + + add_method_basic (py_name, mb); + + if (name == "*") { + // Supply a commutative multiplication version unless the operator is "*!" + add_method_basic ("__rmul__", mb); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method also implements '__rmul__'"))); + } + + } + + } +} + +void +MethodTable::add_setter (const std::string &name, const gsi::MethodBase *setter) +{ + bool st = setter->is_static (); + + std::map, size_t>::iterator n = m_property_name_map.find (std::make_pair (st, name)); + if (n == m_property_name_map.end ()) { + + m_property_name_map.insert (std::make_pair (std::make_pair(st, name), m_property_table.size ())); + m_property_table.push_back (std::make_pair (MethodTableEntry (name, st, false), MethodTableEntry (name, st, false))); + m_property_table.back ().first.add (setter); + + } else { + + m_property_table [n->second].first.add (setter); + + } +} + +void +MethodTable::add_getter (const std::string &name, const gsi::MethodBase *getter) +{ + bool st = getter->is_static (); + + std::map, size_t>::iterator n = m_property_name_map.find (std::make_pair (st, name)); + if (n == m_property_name_map.end ()) { + + m_property_name_map.insert (std::make_pair (std::make_pair(st, name), m_property_table.size ())); + m_property_table.push_back (std::make_pair (MethodTableEntry (name, st, false), MethodTableEntry (name, st, false))); + m_property_table.back ().second.add (getter); + + } else { + + m_property_table [n->second].second.add (getter); + + } +} + +bool +MethodTable::is_enabled (size_t mid) const +{ + return m_table [mid - m_method_offset].is_enabled (); +} + +void +MethodTable::set_enabled (size_t mid, bool en) +{ + m_table [mid - m_method_offset].set_enabled (en); +} + +bool +MethodTable::is_static (size_t mid) const +{ + return m_table [mid - m_method_offset].is_static (); +} + +bool +MethodTable::is_protected (size_t mid) const +{ + return m_table [mid - m_method_offset].is_protected (); +} + +void +MethodTable::rename (size_t mid, const std::string &new_name) +{ + std::string old_name = name (mid); + bool st = is_static (mid); + + m_table [mid - m_method_offset].set_name (new_name); + + auto nm = m_name_map.find (std::make_pair (st, old_name)); + if (nm != m_name_map.end ()) { + m_name_map.erase (nm); + m_name_map.insert (std::make_pair (std::make_pair (st, new_name), mid)); + } +} + +const std::string & +MethodTable::name (size_t mid) const +{ + return m_table [mid - m_method_offset].name (); +} + +const std::string & +MethodTable::property_name (size_t mid) const +{ + return m_property_table [mid - m_property_offset].first.name (); +} + +MethodTableEntry::method_iterator +MethodTable::begin_setters (size_t mid) const +{ + return m_property_table[mid - m_property_offset].first.begin (); +} + +MethodTableEntry::method_iterator +MethodTable::end_setters (size_t mid) const +{ + return m_property_table[mid - m_property_offset].first.end (); +} + +MethodTableEntry::method_iterator +MethodTable::begin_getters (size_t mid) const +{ + return m_property_table[mid - m_property_offset].second.begin (); +} + +MethodTableEntry::method_iterator +MethodTable::end_getters (size_t mid) const +{ + return m_property_table[mid - m_property_offset].second.end (); +} + +MethodTableEntry::method_iterator +MethodTable::begin (size_t mid) const +{ + return m_table[mid - m_method_offset].begin (); +} + +MethodTableEntry::method_iterator +MethodTable::end (size_t mid) const +{ + return m_table[mid - m_method_offset].end (); +} + +void +MethodTable::finish () +{ + for (std::vector::iterator m = m_table.begin (); m != m_table.end (); ++m) { + m->finish (); + } + for (std::vector >::iterator m = m_property_table.begin (); m != m_property_table.end (); ++m) { + m->first.finish (); + m->second.finish (); + } +} + +void +MethodTable::add_method_basic (const std::string &name, const gsi::MethodBase *mb, bool enabled) +{ + bool st = mb->is_static (); + + std::map, size_t>::iterator n = m_name_map.find (std::make_pair (st, name)); + if (n == m_name_map.end ()) { + + m_name_map.insert (std::make_pair (std::make_pair (st, name), m_table.size ())); + m_table.push_back (MethodTableEntry (name, st, mb->is_protected ())); + if (! enabled) { + m_table.back ().set_enabled (false); + } + m_table.back ().add (mb); + + } else { + + if (m_table [n->second].is_protected () != mb->is_protected ()) { + tl::warn << "Class " << mp_cls_decl->name () << ": method '" << name << " is both a protected and non-protected"; + } + + m_table [n->second].add (mb); + if (! enabled) { + m_table [n->second].set_enabled (false); + } + + } +} + +MethodTable * +MethodTable::method_table_by_class (const gsi::ClassBase *cls_decl) +{ + PythonClassClientData *cd = dynamic_cast(cls_decl->data (gsi::ClientIndex::Python)); + return cd ? &cd->method_table : 0; +} + +// ------------------------------------------------------------------- +// PythonClassClientData implementation + +PythonClassClientData::PythonClassClientData (const gsi::ClassBase *_cls, PyTypeObject *_py_type, PyTypeObject *_py_type_static, PythonModule *module) + : py_type_object (_py_type), py_type_object_static (_py_type_static), method_table (_cls, module) +{ + // .. nothing yet .. +} + +PyTypeObject * +PythonClassClientData::py_type (const gsi::ClassBase &cls_decl, bool as_static) +{ + PythonClassClientData *cd = dynamic_cast(cls_decl.data (gsi::ClientIndex::Python)); + return cd ? (as_static ? cd->py_type_object_static : cd->py_type_object) : 0; +} + +void +PythonClassClientData::initialize (const gsi::ClassBase &cls_decl, PyTypeObject *py_type, bool as_static, PythonModule *module) +{ + PythonClassClientData *cd = dynamic_cast(cls_decl.data (gsi::ClientIndex::Python)); + if (cd) { + if (as_static) { + cd->py_type_object_static = py_type; + } else { + cd->py_type_object = py_type; + } + } else { + cls_decl.set_data (gsi::ClientIndex::Python, new PythonClassClientData (&cls_decl, as_static ? NULL : py_type, as_static ? py_type : NULL, module)); + } +} + +// -------------------------------------------------------------------------- +// The PythonModule implementation + +std::map PythonModule::m_python_doc; +std::vector PythonModule::m_classes; + +const std::string pymod_name ("klayout"); + +PythonModule::PythonModule () + : mp_mod_def (0) +{ + // .. nothing yet .. +} + +PythonModule::~PythonModule () +{ + PYAObjectBase::clear_callbacks_cache (); + + // the Python objects were probably deleted by Python itself as it exited - + // don't try to delete them again. + mp_module.release (); + + while (!m_methods_heap.empty ()) { + delete m_methods_heap.back (); + m_methods_heap.pop_back (); + } + + while (!m_getseters_heap.empty ()) { + delete m_getseters_heap.back (); + m_getseters_heap.pop_back (); + } + + if (mp_mod_def) { + delete[] mp_mod_def; + mp_mod_def = 0; + } +} + +PyObject * +PythonModule::module () +{ + return mp_module.get (); +} + +PyObject * +PythonModule::take_module () +{ + return mp_module.release (); +} + +void +PythonModule::init (const char *mod_name, const char *description) +{ + // create a (standalone) Python interpreter if we don't have one yet + // NOTE: Python itself will take care to remove this instance in this case. + if (! pya::PythonInterpreter::instance ()) { + new pya::PythonInterpreter (false); + } + + // do some checks before we create the module + tl_assert (mod_name != 0); + tl_assert (mp_module.get () == 0); + + m_mod_name = pymod_name + "." + mod_name; + m_mod_description = description; + + PyObject *module = 0; + +#if PY_MAJOR_VERSION < 3 + + static PyMethodDef module_methods[] = { + {NULL} // Sentinel + }; + + module = Py_InitModule3 (m_mod_name.c_str (), module_methods, m_mod_description.c_str ()); + +#else + + struct PyModuleDef mod_def = { + PyModuleDef_HEAD_INIT, + m_mod_name.c_str (), + NULL, // module documentation + -1, // size of per-interpreter state of the module, + // if the module keeps state in global variables. + NULL + }; + + tl_assert (! mp_mod_def); + + // prepare a persistent structure with the module definition + // and pass this one to PyModule_Create + mp_mod_def = new char[sizeof (PyModuleDef)]; + memcpy ((void *) mp_mod_def, (const void *) &mod_def, sizeof (PyModuleDef)); + + module = PyModule_Create ((PyModuleDef *) mp_mod_def); + +#endif + + mp_module = PythonRef (module); +} + +void +PythonModule::init (const char *mod_name, PyObject *module) +{ + // do some checks before we create the module + tl_assert (mp_module.get () == 0); + + m_mod_name = mod_name; + mp_module = PythonRef (module); +} + +PyMethodDef * +PythonModule::make_method_def () +{ + static PyMethodDef md = { }; + m_methods_heap.push_back (new PyMethodDef (md)); + return m_methods_heap.back (); +} + +PyGetSetDef * +PythonModule::make_getset_def () +{ + static PyGetSetDef gsd = { }; + m_getseters_heap.push_back (new PyGetSetDef (gsd)); + return m_getseters_heap.back (); +} + +char * +PythonModule::make_string (const std::string &s) +{ + m_string_heap.push_back (s); + return const_cast (m_string_heap.back ().c_str ()); +} + +void +PythonModule::add_python_doc (const gsi::ClassBase & /*cls*/, const MethodTable *mt, int mid, const std::string &doc) +{ + for (MethodTableEntry::method_iterator m = mt->begin (mid); m != mt->end (mid); ++m) { + std::string &doc_string = m_python_doc [*m]; + doc_string += doc; + doc_string += "\n\n"; + } +} + +void +PythonModule::add_python_doc (const gsi::MethodBase *m, const std::string &doc) +{ + m_python_doc [m] += doc; +} + +std::string +PythonModule::python_doc (const gsi::MethodBase *method) +{ + std::map::const_iterator d = m_python_doc.find (method); + if (d != m_python_doc.end ()) { + return d->second; + } else { + return std::string (); + } +} + + +} + diff --git a/src/pya/pya/pyaInternal.h b/src/pya/pya/pyaInternal.h new file mode 100644 index 000000000..f013b62da --- /dev/null +++ b/src/pya/pya/pyaInternal.h @@ -0,0 +1,259 @@ +/* + + KLayout Layout Viewer + Copyright (C) 2006-2022 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + + +#ifndef _HDR_pyaInternal +#define _HDR_pyaInternal + +#include + +#include "pyaCommon.h" +#include "pyaRefs.h" + +#include "gsiClassBase.h" + +#include +#include +#include +#include + +namespace gsi +{ + class MethodBase; +} + +namespace pya +{ + +class PythonModule; + +// ------------------------------------------------------------------- +// The lookup table for the method overload resolution + +/** + * @brief A single entry in the method table + * This class provides an entry for one name. It provides flags + * (ctor, static, protected) for the method and a list of implementations + * (gsi::MethodBase objects) + */ +class MethodTableEntry +{ +public: + typedef std::vector::const_iterator method_iterator; + + MethodTableEntry (const std::string &name, bool st, bool prot); + + const std::string &name () const; + void set_name (const std::string &n); + + void set_enabled (bool en); + bool is_enabled () const; + + bool is_static () const; + + bool is_protected () const; + + void add (const gsi::MethodBase *m); + + void finish (); + + method_iterator begin () const; + method_iterator end () const; + +private: + std::string m_name; + bool m_is_static : 1; + bool m_is_protected : 1; + bool m_is_enabled : 1; + std::vector m_methods; +}; + +/** + * @brief The method table for a class + * The method table will provide the methods associated with a native method, i.e. + * a certain name. It only provides the methods, not a overload resolution strategy. + */ +class MethodTable +{ +public: + /** + * @brief Constructor + * This constructor will create a method table for the given class and register + * this table under this class. + */ + MethodTable (const gsi::ClassBase *cls_decl, PythonModule *module); + /** + * @brief Returns the lowest method ID within the space of this table + * Method IDs below this one are reserved for base class methods + */ + size_t bottom_mid () const; + + /** + * @brief Returns the topmost + 1 method ID. + */ + size_t top_mid () const; + + /** + * @brief Returns the lowest property method ID within the space of this table + * Method IDs below this one are reserved for base class methods + */ + size_t bottom_property_mid () const; + + /** + * @brief Returns the topmost + 1 property method ID. + */ + size_t top_property_mid () const; + + /** + * @brief Find a method with the given name and static flag + * Returns true or false in the first part (true, if found) and + * the MID in the second part. + */ + std::pair find_method (bool st, const std::string &name) const; + + /** + * @brief Find a property with the given name and static flag + * Returns true or false in the first part (true, if found) and + * the MID in the second part. + */ + std::pair find_property (bool st, const std::string &name) const; + + /** + * @brief Adds a method to the table + */ + void add_method (const std::string &name, const gsi::MethodBase *mb); + + /** + * @brief Adds a setter with the given name + */ + void add_setter (const std::string &name, const gsi::MethodBase *setter); + + /** + * @brief Adds a getter with the given name + */ + void add_getter (const std::string &name, const gsi::MethodBase *getter); + + /** + * @brief Returns true if the method is enabled + */ + bool is_enabled (size_t mid) const; + + /** + * @brief Enables or disables a method + */ + void set_enabled (size_t mid, bool en); + + /** + * @brief Returns true if the method with the given ID is static + */ + bool is_static (size_t mid) const; + + /** + * @brief Returns true if the method with the given ID is protected + */ + bool is_protected (size_t mid) const; + + /** + * @brief Renames a method + */ + void rename (size_t mid, const std::string &new_name); + + /** + * @brief Returns the name of the method with the given ID + */ + const std::string &name (size_t mid) const; + + /** + * @brief Returns the name of the property with the given ID + */ + const std::string &property_name (size_t mid) const; + + /** + * @brief Begins iteration of the overload variants for setter of property ID mid + */ + MethodTableEntry::method_iterator begin_setters (size_t mid) const; + + /** + * @brief Ends iteration of the overload variants for setter of property ID mid + */ + MethodTableEntry::method_iterator end_setters (size_t mid) const; + + /** + * @brief Begins iteration of the overload variants for getter of property ID mid + */ + MethodTableEntry::method_iterator begin_getters (size_t mid) const; + + /** + * @brief Ends iteration of the overload variants for getter of property ID mid + */ + MethodTableEntry::method_iterator end_getters (size_t mid) const; + + /** + * @brief Begins iteration of the overload variants for method ID mid + */ + MethodTableEntry::method_iterator begin (size_t mid) const; + + /** + * @brief Ends iteration of the overload variants for method ID mid + */ + MethodTableEntry::method_iterator end (size_t mid) const; + + /** + * @brief Finishes construction of the table + * This method must be called after the add_method calls have been used + * to fill the table. It will remove duplicate entries and clean up memory. + */ + void finish (); + + /** + * @brief Obtain a method table for a given class + */ + static MethodTable *method_table_by_class (const gsi::ClassBase *cls_decl); + +private: + size_t m_method_offset; + size_t m_property_offset; + const gsi::ClassBase *mp_cls_decl; + std::map, size_t> m_name_map; + std::map, size_t> m_property_name_map; + std::vector m_table; + std::vector > m_property_table; + PythonModule *mp_module; + + void add_method_basic (const std::string &name, const gsi::MethodBase *mb, bool enabled = true); +}; + +struct PythonClassClientData + : public gsi::PerClassClientSpecificData +{ + PythonClassClientData (const gsi::ClassBase *_cls, PyTypeObject *_py_type, PyTypeObject *_py_type_static, PythonModule *module); + + PyTypeObject *py_type_object; + PyTypeObject *py_type_object_static; + MethodTable method_table; + + static PyTypeObject *py_type (const gsi::ClassBase &cls_decl, bool as_static); + static void initialize (const gsi::ClassBase &cls_decl, PyTypeObject *py_type, bool as_static, PythonModule *module); +}; + +} + +#endif diff --git a/src/pya/pya/pyaModule.cc b/src/pya/pya/pyaModule.cc index 53b770878..4900c6ac2 100644 --- a/src/pya/pya/pyaModule.cc +++ b/src/pya/pya/pyaModule.cc @@ -31,6 +31,8 @@ #include "pyaMarshal.h" #include "pyaSignalHandler.h" #include "pyaUtils.h" +#include "pyaInternal.h" +#include "pyaCallables.h" #include @@ -93,2297 +95,6 @@ static bool is_reserved_word (const std::string &name) name == "None"); } -/** - * @brief Extracts the Python name from a generic name - * - * Returns an empty string if no Python name could be generated. - */ -static std::string extract_python_name (const std::string &name) -{ - // some operator replacements - if (name == "++") { - return "inc"; - } else if (name == "--") { - return "dec"; - } else if (name == "()") { - return "call"; - } else if (name == "!") { - return "not"; - } else if (name == "==") { - return "__eq__"; - } else if (name == "!=") { - return "__ne__"; - } else if (name == "<") { - return "__lt__"; - } else if (name == "<=") { - return "__le__"; - } else if (name == ">") { - return "__gt__"; - } else if (name == ">=") { - return "__ge__"; - } else if (name == "<=>") { - return "__cmp__"; - } else if (name == "+") { - return "__add__"; - } else if (name == "+@") { - return "__pos__"; - } else if (name == "-") { - return "__sub__"; - } else if (name == "-@") { - return "__neg__"; - } else if (name == "/") { - #if PY_MAJOR_VERSION < 3 - return "__div__"; - #else - return "__truediv__"; - #endif - } else if (name == "*" || name == "*!") { - return "__mul__"; - } else if (name == "%") { - return "__mod__"; - } else if (name == "<<") { - return "__lshift__"; - } else if (name == ">>") { - return "__rshift__"; - } else if (name == "~") { - return "__invert__"; - } else if (name == "&") { - return "__and__"; - } else if (name == "|") { - return "__or__"; - } else if (name == "^") { - return "__xor__"; - } else if (name == "+=") { - return "__iadd__"; - } else if (name == "-=") { - return "__isub__"; - } else if (name == "/=") { - #if PY_MAJOR_VERSION < 3 - return "__idiv__"; - #else - return "__itruediv__"; - #endif - } else if (name == "*=") { - return "__imul__"; - } else if (name == "%=") { - return "__imod__"; - } else if (name == "<<=") { - return "__ilshift__"; - } else if (name == ">>=") { - return "__irshift__"; - } else if (name == "&=") { - return "__iand__"; - } else if (name == "|=") { - return "__ior__"; - } else if (name == "^=") { - return "__ixor__"; - } else if (name == "[]") { - return "__getitem__"; - } else if (name == "[]=") { - return "__setitem__"; - } else { - - const char *c = name.c_str (); - if (! isalnum (*c) && *c != '_') { - return std::string (); - } - - // question-mark symbol and trailing = are removed. - size_t n = 0; - for ( ; *c; ++c) { - if (*c == '=' || *c == '?') { - if (! c[1]) { - if (*c == '=') { - // Normally, this method is replaced by an attribute. - // If that fails, we prepend a "set_" to make the name unique. - return "set_" + std::string (name, 0, n); - } else { - return std::string (name, 0, n); - } - } else { - return std::string (); - } - } else if (! isalnum (*c) && *c != '_') { - return std::string (); - } else { - ++n; - } - } - - return name; - - } -} - -// ------------------------------------------------------------------- -// The lookup table for the method overload resolution - -/** - * @brief A single entry in the method table - * This class provides an entry for one name. It provides flags - * (ctor, static, protected) for the method and a list of implementations - * (gsi::MethodBase objects) - */ -class MethodTableEntry -{ -public: - typedef std::vector::const_iterator method_iterator; - - MethodTableEntry (const std::string &name, bool st, bool prot) - : m_name (name), m_is_static (st), m_is_protected (prot), m_is_enabled (true) - { } - - const std::string &name () const - { - return m_name; - } - - void set_name (const std::string &n) - { - m_name = n; - } - - void set_enabled (bool en) - { - m_is_enabled = en; - } - - bool is_enabled () const - { - return m_is_enabled; - } - - bool is_static () const - { - return m_is_static; - } - - bool is_protected () const - { - return m_is_protected; - } - - void add (const gsi::MethodBase *m) - { - m_methods.push_back (m); - } - - void finish () - { - // remove duplicate entries in the method list - std::vector m = m_methods; - std::sort(m.begin (), m.end ()); - m_methods.assign (m.begin (), std::unique (m.begin (), m.end ())); - } - - method_iterator begin () const - { - return m_methods.begin (); - } - - method_iterator end () const - { - return m_methods.end (); - } - -private: - std::string m_name; - bool m_is_static : 1; - bool m_is_protected : 1; - bool m_is_enabled : 1; - std::vector m_methods; -}; - -/** - * @brief The method table for a class - * The method table will provide the methods associated with a native method, i.e. - * a certain name. It only provides the methods, not a overload resolution strategy. - */ -class MethodTable -{ -public: - /** - * @brief Constructor - * This constructor will create a method table for the given class and register - * this table under this class. - */ - MethodTable (const gsi::ClassBase *cls_decl, PythonModule *module) - : m_method_offset (0), m_property_offset (0), mp_cls_decl (cls_decl), mp_module (module) - { - if (cls_decl->base ()) { - const MethodTable *base_mt = method_table_by_class (cls_decl->base ()); - tl_assert (base_mt); - m_method_offset = base_mt->top_mid (); - m_property_offset = base_mt->top_property_mid (); - } - - // signals are translated into the setters and getters - for (gsi::ClassBase::method_iterator m = cls_decl->begin_methods (); m != cls_decl->end_methods (); ++m) { - if ((*m)->is_signal ()) { - for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { - add_getter (syn->name, *m); - add_setter (syn->name, *m); - } - } - } - - // first add getters and setters - for (gsi::ClassBase::method_iterator m = cls_decl->begin_methods (); m != cls_decl->end_methods (); ++m) { - if (! (*m)->is_callback ()) { - for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { - if (syn->is_getter) { - add_getter (syn->name, *m); - } else if (syn->is_setter) { - add_setter (syn->name, *m); - } - } - } - } - - // then add normal methods - on name clash with properties make them a getter - for (gsi::ClassBase::method_iterator m = cls_decl->begin_methods (); m != cls_decl->end_methods (); ++m) { - if (! (*m)->is_callback () && ! (*m)->is_signal ()) { - for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { - if (! syn->is_getter && ! syn->is_setter) { - if ((*m)->end_arguments () - (*m)->begin_arguments () == 0 && find_property ((*m)->is_static (), syn->name).first) { - add_getter (syn->name, *m); - } else { - add_method (syn->name, *m); - } - } - } - } - } - } - - /** - * @brief Returns the lowest method ID within the space of this table - * Method IDs below this one are reserved for base class methods - */ - size_t bottom_mid () const - { - return m_method_offset; - } - - /** - * @brief Returns the topmost + 1 method ID. - */ - size_t top_mid () const - { - return m_method_offset + m_table.size (); - } - - /** - * @brief Returns the lowest property method ID within the space of this table - * Method IDs below this one are reserved for base class methods - */ - size_t bottom_property_mid () const - { - return m_property_offset; - } - - /** - * @brief Returns the topmost + 1 property method ID. - */ - size_t top_property_mid () const - { - return m_property_offset + m_property_table.size (); - } - - /** - * @brief Find a method with the given name and static flag - * Returns true or false in the first part (true, if found) and - * the MID in the second part. - */ - std::pair find_method (bool st, const std::string &name) const - { - std::map , size_t>::const_iterator t = m_name_map.find (std::make_pair (st, name)); - if (t != m_name_map.end ()) { - return std::make_pair (true, t->second + m_method_offset); - } else { - return std::make_pair (false, 0); - } - } - - /** - * @brief Find a property with the given name and static flag - * Returns true or false in the first part (true, if found) and - * the MID in the second part. - */ - std::pair find_property (bool st, const std::string &name) const - { - std::map , size_t>::const_iterator t = m_property_name_map.find (std::make_pair (st, name)); - if (t != m_property_name_map.end ()) { - return std::make_pair (true, t->second + m_property_offset); - } else { - return std::make_pair (false, 0); - } - } - - /** - * @brief Adds a method to the table - */ - void add_method (const std::string &name, const gsi::MethodBase *mb) - { - if (name == "to_s" && mb->compatible_with_num_args (0)) { - - add_method_basic (name, mb); - - // The str method is also routed via the tp_str implementation - add_method_basic ("__str__", mb); - -#if defined(GSI_ALIAS_INSPECT) - // also alias to "__repr__" unless there is an explicit "inspect" method - bool alias_inspect = true; - for (gsi::ClassBase::method_iterator m = mp_cls_decl->begin_methods (); m != mp_cls_decl->end_methods () && alias_inspect; ++m) { - if (! (*m)->is_callback () && ! (*m)->is_signal ()) { - for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms () && alias_inspect; ++syn) { - if (! syn->is_getter && ! syn->is_setter && syn->name == "inspect") { - alias_inspect = false; - } - } - } - } -#else - bool alias_inspect = false; -#endif - if (alias_inspect) { - add_method_basic ("__repr__", mb); - mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'str(object)' and 'repr(object)'"))); - } else { - mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'str(object)'"))); - } - - } else if (name == "hash" && mb->compatible_with_num_args (0)) { - - // The hash method is also routed via the tp_hash implementation - add_method_basic ("__hash__", mb); - - add_method_basic (name, mb); - mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'hash(object)'"))); - - } else if (name == "inspect" && mb->compatible_with_num_args (0)) { - - // The str method is also routed via the tp_str implementation - add_method_basic ("__repr__", mb); - - add_method_basic (name, mb); - mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'repr(object)'"))); - - } else if (name == "size" && mb->compatible_with_num_args (0)) { - - // The size method is also routed via the sequence methods protocol if there - // is a [] function - add_method_basic ("__len__", mb); - - add_method_basic (name, mb); - mp_module->add_python_doc (mb, tl::to_string (tr ("This method is also available as 'len(object)'"))); - - } else if (name == "each" && mb->compatible_with_num_args (0) && mb->ret_type ().is_iter ()) { - - // each makes the object iterable - add_method_basic ("__iter__", mb); - - add_method_basic (name, mb); - mp_module->add_python_doc (mb, tl::to_string (tr ("This method enables iteration of the object"))); - - } else if (name == "dup" && mb->compatible_with_num_args (0)) { - - // If the object supports the dup method, then it is a good - // idea to define the __copy__ method. - add_method_basic ("__copy__", mb); - - add_method_basic (name, mb); - mp_module->add_python_doc (mb, tl::to_string (tr ("This method also implements '__copy__'"))); - - } else { - - std::string py_name = extract_python_name (name); - if (py_name.empty ()) { - - // drop non-standard names - if (tl::verbosity () >= 20) { - tl::warn << tl::to_string (tr ("Class ")) << mp_cls_decl->name () << ": " << tl::to_string (tr ("no Python mapping for method ")) << name; - } - - add_method_basic (name, mb, false); - mp_module->add_python_doc (mb, tl::to_string (tr ("This method is not available for Python"))); - - } else { - - add_method_basic (py_name, mb); - - if (name == "*") { - // Supply a commutative multiplication version unless the operator is "*!" - add_method_basic ("__rmul__", mb); - mp_module->add_python_doc (mb, tl::to_string (tr ("This method also implements '__rmul__'"))); - } - - } - - } - } - - /** - * @brief Adds a setter with the given name - */ - void add_setter (const std::string &name, const gsi::MethodBase *setter) - { - bool st = setter->is_static (); - - std::map, size_t>::iterator n = m_property_name_map.find (std::make_pair (st, name)); - if (n == m_property_name_map.end ()) { - - m_property_name_map.insert (std::make_pair (std::make_pair(st, name), m_property_table.size ())); - m_property_table.push_back (std::make_pair (MethodTableEntry (name, st, false), MethodTableEntry (name, st, false))); - m_property_table.back ().first.add (setter); - - } else { - - m_property_table [n->second].first.add (setter); - - } - } - - /** - * @brief Adds a getter with the given name - */ - void add_getter (const std::string &name, const gsi::MethodBase *getter) - { - bool st = getter->is_static (); - - std::map, size_t>::iterator n = m_property_name_map.find (std::make_pair (st, name)); - if (n == m_property_name_map.end ()) { - - m_property_name_map.insert (std::make_pair (std::make_pair(st, name), m_property_table.size ())); - m_property_table.push_back (std::make_pair (MethodTableEntry (name, st, false), MethodTableEntry (name, st, false))); - m_property_table.back ().second.add (getter); - - } else { - - m_property_table [n->second].second.add (getter); - - } - } - - /** - * @brief Returns true if the method is enabled - */ - bool is_enabled (size_t mid) const - { - return m_table [mid - m_method_offset].is_enabled (); - } - - /** - * @brief Enables or disables a method - */ - void set_enabled (size_t mid, bool en) - { - m_table [mid - m_method_offset].set_enabled (en); - } - - /** - * @brief Returns true if the method with the given ID is static - */ - bool is_static (size_t mid) const - { - return m_table [mid - m_method_offset].is_static (); - } - - /** - * @brief Returns true if the method with the given ID is protected - */ - bool is_protected (size_t mid) const - { - return m_table [mid - m_method_offset].is_protected (); - } - - /** - * @brief Renames a method - */ - void rename (size_t mid, const std::string &new_name) - { - std::string old_name = name (mid); - bool st = is_static (mid); - - m_table [mid - m_method_offset].set_name (new_name); - - auto nm = m_name_map.find (std::make_pair (st, old_name)); - if (nm != m_name_map.end ()) { - m_name_map.erase (nm); - m_name_map.insert (std::make_pair (std::make_pair (st, new_name), mid)); - } - } - - /** - * @brief Returns the name of the method with the given ID - */ - const std::string &name (size_t mid) const - { - return m_table [mid - m_method_offset].name (); - } - - /** - * @brief Returns the name of the property with the given ID - */ - const std::string &property_name (size_t mid) const - { - return m_property_table [mid - m_property_offset].first.name (); - } - - /** - * @brief Begins iteration of the overload variants for setter of property ID mid - */ - MethodTableEntry::method_iterator begin_setters (size_t mid) const - { - return m_property_table[mid - m_property_offset].first.begin (); - } - - /** - * @brief Ends iteration of the overload variants for setter of property ID mid - */ - MethodTableEntry::method_iterator end_setters (size_t mid) const - { - return m_property_table[mid - m_property_offset].first.end (); - } - - /** - * @brief Begins iteration of the overload variants for getter of property ID mid - */ - MethodTableEntry::method_iterator begin_getters (size_t mid) const - { - return m_property_table[mid - m_property_offset].second.begin (); - } - - /** - * @brief Ends iteration of the overload variants for getter of property ID mid - */ - MethodTableEntry::method_iterator end_getters (size_t mid) const - { - return m_property_table[mid - m_property_offset].second.end (); - } - - /** - * @brief Begins iteration of the overload variants for method ID mid - */ - MethodTableEntry::method_iterator begin (size_t mid) const - { - return m_table[mid - m_method_offset].begin (); - } - - /** - * @brief Ends iteration of the overload variants for method ID mid - */ - MethodTableEntry::method_iterator end (size_t mid) const - { - return m_table[mid - m_method_offset].end (); - } - - /** - * @brief Finishes construction of the table - * This method must be called after the add_method calls have been used - * to fill the table. It will remove duplicate entries and clean up memory. - */ - void finish () - { - for (std::vector::iterator m = m_table.begin (); m != m_table.end (); ++m) { - m->finish (); - } - for (std::vector >::iterator m = m_property_table.begin (); m != m_property_table.end (); ++m) { - m->first.finish (); - m->second.finish (); - } - } - - /** - * @brief Obtain a method table for a given class - */ - static MethodTable *method_table_by_class (const gsi::ClassBase *cls_decl); - -private: - size_t m_method_offset; - size_t m_property_offset; - const gsi::ClassBase *mp_cls_decl; - std::map, size_t> m_name_map; - std::map, size_t> m_property_name_map; - std::vector m_table; - std::vector > m_property_table; - PythonModule *mp_module; - - void add_method_basic (const std::string &name, const gsi::MethodBase *mb, bool enabled = true) - { - bool st = mb->is_static (); - - std::map, size_t>::iterator n = m_name_map.find (std::make_pair (st, name)); - if (n == m_name_map.end ()) { - - m_name_map.insert (std::make_pair (std::make_pair (st, name), m_table.size ())); - m_table.push_back (MethodTableEntry (name, st, mb->is_protected ())); - if (! enabled) { - m_table.back ().set_enabled (false); - } - m_table.back ().add (mb); - - } else { - - if (m_table [n->second].is_protected () != mb->is_protected ()) { - tl::warn << "Class " << mp_cls_decl->name () << ": method '" << name << " is both a protected and non-protected"; - } - - m_table [n->second].add (mb); - if (! enabled) { - m_table [n->second].set_enabled (false); - } - - } - } -}; - -struct PythonClassClientData - : public gsi::PerClassClientSpecificData -{ - PythonClassClientData (const gsi::ClassBase *_cls, PyTypeObject *_py_type, PyTypeObject *_py_type_static, PythonModule *module) - : py_type_object (_py_type), py_type_object_static (_py_type_static), method_table (_cls, module) - { - // .. nothing yet .. - } - - PyTypeObject *py_type_object; - PyTypeObject *py_type_object_static; - MethodTable method_table; - - static PyTypeObject *py_type (const gsi::ClassBase &cls_decl, bool as_static) - { - PythonClassClientData *cd = dynamic_cast(cls_decl.data (gsi::ClientIndex::Python)); - return cd ? (as_static ? cd->py_type_object_static : cd->py_type_object) : 0; - } - - static void initialize (const gsi::ClassBase &cls_decl, PyTypeObject *py_type, bool as_static, PythonModule *module) - { - PythonClassClientData *cd = dynamic_cast(cls_decl.data (gsi::ClientIndex::Python)); - if (cd) { - if (as_static) { - cd->py_type_object_static = py_type; - } else { - cd->py_type_object = py_type; - } - } else { - cls_decl.set_data (gsi::ClientIndex::Python, new PythonClassClientData (&cls_decl, as_static ? NULL : py_type, as_static ? py_type : NULL, module)); - } - } -}; - -/** - * @brief Obtains a method table for a given class - */ -MethodTable *MethodTable::method_table_by_class (const gsi::ClassBase *cls_decl) -{ - PythonClassClientData *cd = dynamic_cast(cls_decl->data (gsi::ClientIndex::Python)); - return cd ? &cd->method_table : 0; -} - -// -------------------------------------------------------------------------- -// Methods for PYAObjectBase Python binding - -/** - * @brief Destructor for the base class (the implementation object) - */ -static void -pya_object_deallocate (PyObject *self) -{ - // This avoids an assertion in debug builds (Python, gcmodule.c - update_refs). - // In short, the GC expects not to see objects with refcount 0 and asserts. - // However, due to triggering of signals or similar, the destructor call below - // may trigger a GC (https://github.com/KLayout/klayout/issues/1054). - // According to the comments this may be turned into a release mode assertion, so - // we better work around it. - ++self->ob_refcnt; - - PYAObjectBase *p = PYAObjectBase::from_pyobject (self); - p->~PYAObjectBase (); - Py_TYPE (self)->tp_free (self); -} - -/** - * @brief Constructor for the base class (the implementation object) - */ -static int -pya_object_init (PyObject * /*self*/, PyObject *args, PyObject *kwds) -{ - // no particular initialization - static char *kwlist[] = {NULL}; - if (! PyArg_ParseTupleAndKeywords (args, kwds, "", kwlist)) { - return -1; - } else { - return 0; - } -} - -/** - * @brief Factory for a base class object - */ -static PyObject * -pya_object_new (PyTypeObject *type, PyObject * /*args*/, PyObject * /*kwds*/) -{ - // create the object - PyObject *self_pyobject = type->tp_alloc (type, 0); - PYAObjectBase *self = PYAObjectBase::from_pyobject_unsafe (self_pyobject); - new (self) PYAObjectBase (PythonModule::cls_for_type (type), self_pyobject); - return self_pyobject; -} - -// -------------------------------------------------------------------------- -// Method binding guts - -/** - * @brief Gets the method name from a method id - */ -std::string -method_name_from_id (int mid, PyObject *self) -{ - const gsi::ClassBase *cls_decl = 0; - - if (! PyType_Check (self)) { - PYAObjectBase *p = PYAObjectBase::from_pyobject (self); - cls_decl = p->cls_decl (); - } else { - cls_decl = PythonModule::cls_for_type ((PyTypeObject *) self); - } - - tl_assert (cls_decl != 0); - - const MethodTable *mt = MethodTable::method_table_by_class (cls_decl); - tl_assert (mt); - - // locate the method in the base classes method table if necessary - while (mid < int (mt->bottom_mid ())) { - - tl_assert (cls_decl->base ()); - cls_decl = cls_decl->base (); - mt = MethodTable::method_table_by_class (cls_decl); - tl_assert (mt); - - } - - return cls_decl->name () + "." + mt->name (mid); -} - -/** - * @brief Gets the method name from a method id - */ -std::string -property_name_from_id (int mid, PyObject *self) -{ - const gsi::ClassBase *cls_decl = 0; - - if (! PyType_Check (self)) { - PYAObjectBase *p = PYAObjectBase::from_pyobject (self); - cls_decl = p->cls_decl (); - } else { - cls_decl = PythonModule::cls_for_type ((PyTypeObject *) self); - } - - tl_assert (cls_decl != 0); - - const MethodTable *mt = MethodTable::method_table_by_class (cls_decl); - tl_assert (mt); - - // locate the method in the base classes method table if necessary - while (mid < int (mt->bottom_property_mid ())) { - - tl_assert (cls_decl->base ()); - cls_decl = cls_decl->base (); - mt = MethodTable::method_table_by_class (cls_decl); - tl_assert (mt); - - } - - return cls_decl->name () + "." + mt->property_name (mid); -} - -static gsi::ArgType create_void_type () -{ - gsi::ArgType at; - at.init (); - return at; -} - -static gsi::ArgType s_void_type = create_void_type (); - -static PyObject * -get_return_value (PYAObjectBase *self, gsi::SerialArgs &retlist, const gsi::MethodBase *meth, tl::Heap &heap) -{ - PyObject *ret = NULL; - - if (meth->ret_type ().is_iter ()) { - - gsi::IterAdaptorAbstractBase *iter = (gsi::IterAdaptorAbstractBase *) retlist.read (heap); - ret = (PyObject *) PYAIteratorObject::create (self ? self->py_object () : 0, iter, &meth->ret_type ()); - - } else if (meth->ret_type () == s_void_type && self != 0) { - - // simple, yet magical :) - ret = self->py_object (); - Py_INCREF (ret); - - } else { - - ret = pop_arg (meth->ret_type (), retlist, self, heap).release (); - - } - - return ret; -} - -static const gsi::MethodBase * -match_method (int mid, PyObject *self, PyObject *args, bool strict) -{ - const gsi::ClassBase *cls_decl = 0; - - PYAObjectBase *p = 0; - if (! PyType_Check (self)) { - p = PYAObjectBase::from_pyobject (self); - cls_decl = p->cls_decl (); - } else { - cls_decl = PythonModule::cls_for_type ((PyTypeObject *) self); - } - - tl_assert (cls_decl != 0); - - int argc = args == NULL ? 0 : int (PyTuple_Size (args)); - - // get number of candidates by argument count - const gsi::MethodBase *meth = 0; - unsigned int candidates = 0; - - const MethodTable *mt = MethodTable::method_table_by_class (cls_decl); - tl_assert (mt); - - // locate the method in the base classes method table if necessary - while (mid < int (mt->bottom_mid ())) { - - tl_assert (cls_decl->base ()); - cls_decl = cls_decl->base (); - mt = MethodTable::method_table_by_class (cls_decl); - tl_assert (mt); - - } - - for (MethodTableEntry::method_iterator m = mt->begin (mid); m != mt->end (mid); ++m) { - - if ((*m)->is_callback()) { - - // ignore callbacks - - } else if ((*m)->compatible_with_num_args (argc)) { - - ++candidates; - meth = *m; - - } - - } - - // no candidate -> error - if (! meth) { - - if (! strict) { - return 0; - } - - std::set nargs; - for (MethodTableEntry::method_iterator m = mt->begin (mid); m != mt->end (mid); ++m) { - if (! (*m)->is_callback ()) { - nargs.insert (std::distance ((*m)->begin_arguments (), (*m)->end_arguments ())); - } - } - - std::string nargs_s; - for (std::set::const_iterator na = nargs.begin (); na != nargs.end (); ++na) { - if (na != nargs.begin ()) { - nargs_s += "/"; - } - nargs_s += tl::to_string (*na); - } - - throw tl::Exception (tl::sprintf (tl::to_string (tr ("Invalid number of arguments (got %d, expected %s)")), argc, nargs_s)); - - } - - // more than one candidate -> refine by checking the arguments - if (candidates > 1) { - - meth = 0; - candidates = 0; - int score = 0; - bool const_matching = true; - - for (MethodTableEntry::method_iterator m = mt->begin (mid); m != mt->end (mid); ++m) { - - if (! (*m)->is_callback ()) { - - // check arguments (count and type) - bool is_valid = (*m)->compatible_with_num_args (argc); - int sc = 0; - int i = 0; - for (gsi::MethodBase::argument_iterator a = (*m)->begin_arguments (); is_valid && i < argc && a != (*m)->end_arguments (); ++a, ++i) { - if (test_arg (*a, PyTuple_GetItem (args, i), false /*strict*/)) { - ++sc; - } else if (test_arg (*a, PyTuple_GetItem (args, i), true /*loose*/)) { - // non-scoring match - } else { - is_valid = false; - } - } - - if (is_valid && p) { - - // constness matching candidates have precedence - if ((*m)->is_const () != p->const_ref ()) { - if (const_matching && candidates > 0) { - is_valid = false; - } else { - const_matching = false; - } - } else if (! const_matching) { - const_matching = true; - candidates = 0; - } - - } - - if (is_valid) { - - // otherwise take the candidate with the better score - if (candidates > 0 && sc > score) { - candidates = 1; - meth = *m; - score = sc; - } else if (candidates == 0 || sc == score) { - ++candidates; - meth = *m; - score = sc; - } - - } - - } - - } - - } - - if (! meth) { - if (! strict) { - return 0; - } else { - throw tl::TypeError (tl::to_string (tr ("No overload with matching arguments"))); - } - } - - if (candidates > 1) { - if (! strict) { - return 0; - } else { - throw tl::TypeError (tl::to_string (tr ("Ambiguous overload variants - multiple method declarations match arguments"))); - } - } - - return meth; -} - -/** - * @brief Implements dup - */ -static PyObject * -object_dup (PyObject *self, PyObject *args) -{ - const gsi::ClassBase *cls_decl_self = PythonModule::cls_for_type (Py_TYPE (self)); - tl_assert (cls_decl_self != 0); - - if (! PyArg_ParseTuple (args, "")) { - return NULL; - } - - if (! cls_decl_self->can_copy ()) { - throw tl::Exception (tl::to_string (tr ("No copy constructor provided for class '%s'")), cls_decl_self->name ()); - } - - PyObject *new_object = Py_TYPE (self)->tp_alloc (Py_TYPE (self), 0); - PythonRef obj (new_object); - PYAObjectBase *new_pya_base = PYAObjectBase::from_pyobject_unsafe (new_object); - new (new_pya_base) PYAObjectBase (cls_decl_self, new_object); - new_pya_base->set (cls_decl_self->clone (PYAObjectBase::from_pyobject (self)->obj ()), true, false, false); - - return obj.release (); -} - -/** - * @brief Implements assign - */ -static PyObject * -object_assign (PyObject *self, PyObject *args) -{ - const gsi::ClassBase *cls_decl_self = PythonModule::cls_for_type (Py_TYPE (self)); - tl_assert (cls_decl_self != 0); - - PyObject *src = NULL; - if (! PyArg_ParseTuple (args, "O", &src)) { - return NULL; - } - - const gsi::ClassBase *cls_decl_src = PythonModule::cls_for_type (Py_TYPE (src)); - tl_assert (cls_decl_src != 0); - - if (cls_decl_src != cls_decl_self) { - throw tl::Exception (tl::to_string (tr ("Type is not identical on assign"))); - } - if (! cls_decl_self->can_copy ()) { - throw tl::Exception (tl::to_string (tr ("No assignment provided for class '%s'")), cls_decl_self->name ()); - } - - cls_decl_self->assign ((PYAObjectBase::from_pyobject (self))->obj (), (PYAObjectBase::from_pyobject (src))->obj ()); - - Py_INCREF (self); - return self; -} - -/** - * @brief Default implementation of "__ne__" - */ -static PyObject * -object_default_ne_impl (PyObject *self, PyObject *args) -{ - PyObject *eq_method = PyObject_GetAttrString (self, "__eq__"); - tl_assert (eq_method != NULL); - - PythonRef res (PyObject_Call (eq_method, args, NULL)); - if (! res) { - return NULL; - } else { - return c2python (! python2c (res.get ())); - } -} - -/** - * @brief Default implementation of "__ge__" - */ -static PyObject * -object_default_ge_impl (PyObject *self, PyObject *args) -{ - PyObject *eq_method = PyObject_GetAttrString (self, "__lt__"); - tl_assert (eq_method != NULL); - - PythonRef res (PyObject_Call (eq_method, args, NULL)); - if (! res) { - return NULL; - } else { - return c2python (! python2c (res.get ())); - } -} - -/** - * @brief Default implementation of "__le__" - */ -static PyObject * -object_default_le_impl (PyObject *self, PyObject *args) -{ - PyObject *eq_method = PyObject_GetAttrString (self, "__eq__"); - tl_assert (eq_method != NULL); - - PyObject *lt_method = PyObject_GetAttrString (self, "__lt__"); - tl_assert (lt_method != NULL); - - PythonRef eq_res (PyObject_Call (eq_method, args, NULL)); - if (! eq_res) { - return NULL; - } - PythonRef lt_res (PyObject_Call (lt_method, args, NULL)); - if (! lt_res) { - return NULL; - } - return c2python (python2c (eq_res.get ()) || python2c (lt_res.get ())); -} - -/** - * @brief Default implementation of "__gt__" - */ -static PyObject * -object_default_gt_impl (PyObject *self, PyObject *args) -{ - PyObject *eq_method = PyObject_GetAttrString (self, "__eq__"); - tl_assert (eq_method != NULL); - - PyObject *lt_method = PyObject_GetAttrString (self, "__lt__"); - tl_assert (lt_method != NULL); - - PythonRef eq_res (PyObject_Call (eq_method, args, NULL)); - if (! eq_res) { - return NULL; - } - PythonRef lt_res (PyObject_Call (lt_method, args, NULL)); - if (! lt_res) { - return NULL; - } - return c2python (! (python2c (eq_res.get ()) || python2c (lt_res.get ()))); -} - -/** - * @brief Implements create - */ -static PyObject * -object_create (PyObject *self, PyObject *args) -{ - if (! PyArg_ParseTuple (args, "")) { - return NULL; - } - - (PYAObjectBase::from_pyobject (self))->obj (); - Py_RETURN_NONE; -} - -/** - * @brief Implements release - */ -static PyObject * -object_release (PyObject *self, PyObject *args) -{ - if (! PyArg_ParseTuple (args, "")) { - return NULL; - } - - (PYAObjectBase::from_pyobject (self))->release (); - Py_RETURN_NONE; -} - -/** - * @brief Implements keep - */ -static PyObject * -object_keep (PyObject *self, PyObject *args) -{ - if (! PyArg_ParseTuple (args, "")) { - return NULL; - } - - (PYAObjectBase::from_pyobject (self))->keep (); - Py_RETURN_NONE; -} - -/** - * @brief Implements destroy - */ -static PyObject * -object_destroy (PyObject *self, PyObject *args) -{ - if (! PyArg_ParseTuple (args, "")) { - return NULL; - } - - (PYAObjectBase::from_pyobject (self))->destroy (); - Py_RETURN_NONE; -} - -/** - * @brief Implements destroyed - */ -static PyObject * -object_destroyed (PyObject *self, PyObject *args) -{ - if (! PyArg_ParseTuple (args, "")) { - return NULL; - } - - return c2python (PYAObjectBase::from_pyobject (self)->destroyed ()); -} - -/** - * @brief Implements is_const - */ -static PyObject * -object_is_const (PyObject *self, PyObject *args) -{ - if (! PyArg_ParseTuple (args, "")) { - return NULL; - } - - return c2python (PYAObjectBase::from_pyobject (self)->const_ref ()); -} - -static PyObject * -special_method_impl (gsi::MethodBase::special_method_type smt, PyObject *self, PyObject *args) -{ - if (smt == gsi::MethodBase::Destroy) { - return object_destroy (self, args); - } else if (smt == gsi::MethodBase::Keep) { - return object_keep (self, args); - } else if (smt == gsi::MethodBase::Release) { - return object_release (self, args); - } else if (smt == gsi::MethodBase::Create) { - return object_create (self, args); - } else if (smt == gsi::MethodBase::IsConst) { - return object_is_const (self, args); - } else if (smt == gsi::MethodBase::Destroyed) { - return object_destroyed (self, args); - } else if (smt == gsi::MethodBase::Assign) { - return object_assign (self, args); - } else if (smt == gsi::MethodBase::Dup) { - return object_dup (self, args); - } else { - Py_RETURN_NONE; - } -} - -static void -push_args (gsi::SerialArgs &arglist, const gsi::MethodBase *meth, PyObject *args, tl::Heap &heap) -{ - int i = 0; - int argc = args == NULL ? 0 : int (PyTuple_Size (args)); - - try { - - for (gsi::MethodBase::argument_iterator a = meth->begin_arguments (); i < argc && a != meth->end_arguments (); ++a, ++i) { - push_arg (*a, arglist, PyTuple_GetItem (args, i), heap); - } - - } catch (tl::Exception &ex) { - - // In case of an error upon write, pop the arguments to clean them up. - // Without this, there is a risk to keep dead objects on the stack. - for (gsi::MethodBase::argument_iterator a = meth->begin_arguments (); a != meth->end_arguments () && arglist; ++a) { - pop_arg (*a, arglist, 0, heap); - } - - std::string msg; - const gsi::ArgSpecBase *arg_spec = meth->begin_arguments () [i].spec (); - - if (arg_spec && ! arg_spec->name ().empty ()) { - msg = tl::sprintf (tl::to_string (tr ("%s for argument #%d ('%s')")), ex.basic_msg (), i + 1, arg_spec->name ()); - } else { - msg = tl::sprintf (tl::to_string (tr ("%s for argument #%d")), ex.basic_msg (), i + 1); - } - - ex.set_basic_msg (msg); - throw ex; - - } catch (...) { - - // In case of an error upon write, pop the arguments to clean them up. - // Without this, there is a risk to keep dead objects on the stack. - for (gsi::MethodBase::argument_iterator a = meth->begin_arguments (); a != meth->end_arguments () && arglist; ++a) { - pop_arg (*a, arglist, 0, heap); - } - - throw; - - } -} - -static PyObject * -method_adaptor (int mid, PyObject *self, PyObject *args) -{ - PyObject *ret = NULL; - - PYA_TRY - - const gsi::MethodBase *meth = match_method (mid, self, args, true); - - // handle special methods - if (meth->smt () != gsi::MethodBase::None) { - - ret = special_method_impl (meth->smt (), self, args); - - } else { - - PYAObjectBase *p = 0; - if (! PyType_Check (self)) { - // non-static method - p = PYAObjectBase::from_pyobject (self); - } - - tl::Heap heap; - - if (p && p->const_ref () && ! meth->is_const ()) { - throw tl::Exception (tl::to_string (tr ("Cannot call non-const method on a const reference"))); - } - - void *obj = 0; - if (p) { - // Hint: this potentially instantiates the object - obj = p->obj (); - } - - gsi::SerialArgs retlist (meth->retsize ()); - gsi::SerialArgs arglist (meth->argsize ()); - - push_args (arglist, meth, args, heap); - - meth->call (obj, arglist, retlist); - - ret = get_return_value (p, retlist, meth, heap); - - if (ret == NULL) { - Py_INCREF (Py_None); - ret = Py_None; - } - - } - - PYA_CATCH(method_name_from_id (mid, self)) - - return ret; -} - -template -PyObject *method_adaptor (PyObject *self, PyObject *args) -{ - return method_adaptor (N, self, args); -} - -PyObject *(*(method_adaptors [])) (PyObject *self, PyObject *args) = -{ - &method_adaptor<0x000>, &method_adaptor<0x001>, &method_adaptor<0x002>, &method_adaptor<0x003>, &method_adaptor<0x004>, &method_adaptor<0x005>, &method_adaptor<0x006>, &method_adaptor<0x007>, - &method_adaptor<0x008>, &method_adaptor<0x009>, &method_adaptor<0x00a>, &method_adaptor<0x00b>, &method_adaptor<0x00c>, &method_adaptor<0x00d>, &method_adaptor<0x00e>, &method_adaptor<0x00f>, - &method_adaptor<0x010>, &method_adaptor<0x011>, &method_adaptor<0x012>, &method_adaptor<0x013>, &method_adaptor<0x014>, &method_adaptor<0x015>, &method_adaptor<0x016>, &method_adaptor<0x017>, - &method_adaptor<0x018>, &method_adaptor<0x019>, &method_adaptor<0x01a>, &method_adaptor<0x01b>, &method_adaptor<0x01c>, &method_adaptor<0x01d>, &method_adaptor<0x01e>, &method_adaptor<0x01f>, - &method_adaptor<0x020>, &method_adaptor<0x021>, &method_adaptor<0x022>, &method_adaptor<0x023>, &method_adaptor<0x024>, &method_adaptor<0x025>, &method_adaptor<0x026>, &method_adaptor<0x027>, - &method_adaptor<0x028>, &method_adaptor<0x029>, &method_adaptor<0x02a>, &method_adaptor<0x02b>, &method_adaptor<0x02c>, &method_adaptor<0x02d>, &method_adaptor<0x02e>, &method_adaptor<0x02f>, - &method_adaptor<0x030>, &method_adaptor<0x031>, &method_adaptor<0x032>, &method_adaptor<0x033>, &method_adaptor<0x034>, &method_adaptor<0x035>, &method_adaptor<0x036>, &method_adaptor<0x037>, - &method_adaptor<0x038>, &method_adaptor<0x039>, &method_adaptor<0x03a>, &method_adaptor<0x03b>, &method_adaptor<0x03c>, &method_adaptor<0x03d>, &method_adaptor<0x03e>, &method_adaptor<0x03f>, - &method_adaptor<0x040>, &method_adaptor<0x041>, &method_adaptor<0x042>, &method_adaptor<0x043>, &method_adaptor<0x044>, &method_adaptor<0x045>, &method_adaptor<0x046>, &method_adaptor<0x047>, - &method_adaptor<0x048>, &method_adaptor<0x049>, &method_adaptor<0x04a>, &method_adaptor<0x04b>, &method_adaptor<0x04c>, &method_adaptor<0x04d>, &method_adaptor<0x04e>, &method_adaptor<0x04f>, - &method_adaptor<0x050>, &method_adaptor<0x051>, &method_adaptor<0x052>, &method_adaptor<0x053>, &method_adaptor<0x054>, &method_adaptor<0x055>, &method_adaptor<0x056>, &method_adaptor<0x057>, - &method_adaptor<0x058>, &method_adaptor<0x059>, &method_adaptor<0x05a>, &method_adaptor<0x05b>, &method_adaptor<0x05c>, &method_adaptor<0x05d>, &method_adaptor<0x05e>, &method_adaptor<0x05f>, - &method_adaptor<0x060>, &method_adaptor<0x061>, &method_adaptor<0x062>, &method_adaptor<0x063>, &method_adaptor<0x064>, &method_adaptor<0x065>, &method_adaptor<0x066>, &method_adaptor<0x067>, - &method_adaptor<0x068>, &method_adaptor<0x069>, &method_adaptor<0x06a>, &method_adaptor<0x06b>, &method_adaptor<0x06c>, &method_adaptor<0x06d>, &method_adaptor<0x06e>, &method_adaptor<0x06f>, - &method_adaptor<0x070>, &method_adaptor<0x071>, &method_adaptor<0x072>, &method_adaptor<0x073>, &method_adaptor<0x074>, &method_adaptor<0x075>, &method_adaptor<0x076>, &method_adaptor<0x077>, - &method_adaptor<0x078>, &method_adaptor<0x079>, &method_adaptor<0x07a>, &method_adaptor<0x07b>, &method_adaptor<0x07c>, &method_adaptor<0x07d>, &method_adaptor<0x07e>, &method_adaptor<0x07f>, - &method_adaptor<0x080>, &method_adaptor<0x081>, &method_adaptor<0x082>, &method_adaptor<0x083>, &method_adaptor<0x084>, &method_adaptor<0x085>, &method_adaptor<0x086>, &method_adaptor<0x087>, - &method_adaptor<0x088>, &method_adaptor<0x089>, &method_adaptor<0x08a>, &method_adaptor<0x08b>, &method_adaptor<0x08c>, &method_adaptor<0x08d>, &method_adaptor<0x08e>, &method_adaptor<0x08f>, - &method_adaptor<0x090>, &method_adaptor<0x091>, &method_adaptor<0x092>, &method_adaptor<0x093>, &method_adaptor<0x094>, &method_adaptor<0x095>, &method_adaptor<0x096>, &method_adaptor<0x097>, - &method_adaptor<0x098>, &method_adaptor<0x099>, &method_adaptor<0x09a>, &method_adaptor<0x09b>, &method_adaptor<0x09c>, &method_adaptor<0x09d>, &method_adaptor<0x09e>, &method_adaptor<0x09f>, - &method_adaptor<0x0a0>, &method_adaptor<0x0a1>, &method_adaptor<0x0a2>, &method_adaptor<0x0a3>, &method_adaptor<0x0a4>, &method_adaptor<0x0a5>, &method_adaptor<0x0a6>, &method_adaptor<0x0a7>, - &method_adaptor<0x0a8>, &method_adaptor<0x0a9>, &method_adaptor<0x0aa>, &method_adaptor<0x0ab>, &method_adaptor<0x0ac>, &method_adaptor<0x0ad>, &method_adaptor<0x0ae>, &method_adaptor<0x0af>, - &method_adaptor<0x0b0>, &method_adaptor<0x0b1>, &method_adaptor<0x0b2>, &method_adaptor<0x0b3>, &method_adaptor<0x0b4>, &method_adaptor<0x0b5>, &method_adaptor<0x0b6>, &method_adaptor<0x0b7>, - &method_adaptor<0x0b8>, &method_adaptor<0x0b9>, &method_adaptor<0x0ba>, &method_adaptor<0x0bb>, &method_adaptor<0x0bc>, &method_adaptor<0x0bd>, &method_adaptor<0x0be>, &method_adaptor<0x0bf>, - &method_adaptor<0x0c0>, &method_adaptor<0x0c1>, &method_adaptor<0x0c2>, &method_adaptor<0x0c3>, &method_adaptor<0x0c4>, &method_adaptor<0x0c5>, &method_adaptor<0x0c6>, &method_adaptor<0x0c7>, - &method_adaptor<0x0c8>, &method_adaptor<0x0c9>, &method_adaptor<0x0ca>, &method_adaptor<0x0cb>, &method_adaptor<0x0cc>, &method_adaptor<0x0cd>, &method_adaptor<0x0ce>, &method_adaptor<0x0cf>, - &method_adaptor<0x0d0>, &method_adaptor<0x0d1>, &method_adaptor<0x0d2>, &method_adaptor<0x0d3>, &method_adaptor<0x0d4>, &method_adaptor<0x0d5>, &method_adaptor<0x0d6>, &method_adaptor<0x0d7>, - &method_adaptor<0x0d8>, &method_adaptor<0x0d9>, &method_adaptor<0x0da>, &method_adaptor<0x0db>, &method_adaptor<0x0dc>, &method_adaptor<0x0dd>, &method_adaptor<0x0de>, &method_adaptor<0x0df>, - &method_adaptor<0x0e0>, &method_adaptor<0x0e1>, &method_adaptor<0x0e2>, &method_adaptor<0x0e3>, &method_adaptor<0x0e4>, &method_adaptor<0x0e5>, &method_adaptor<0x0e6>, &method_adaptor<0x0e7>, - &method_adaptor<0x0e8>, &method_adaptor<0x0e9>, &method_adaptor<0x0ea>, &method_adaptor<0x0eb>, &method_adaptor<0x0ec>, &method_adaptor<0x0ed>, &method_adaptor<0x0ee>, &method_adaptor<0x0ef>, - &method_adaptor<0x0f0>, &method_adaptor<0x0f1>, &method_adaptor<0x0f2>, &method_adaptor<0x0f3>, &method_adaptor<0x0f4>, &method_adaptor<0x0f5>, &method_adaptor<0x0f6>, &method_adaptor<0x0f7>, - &method_adaptor<0x0f8>, &method_adaptor<0x0f9>, &method_adaptor<0x0fa>, &method_adaptor<0x0fb>, &method_adaptor<0x0fc>, &method_adaptor<0x0fd>, &method_adaptor<0x0fe>, &method_adaptor<0x0ff>, - &method_adaptor<0x100>, &method_adaptor<0x101>, &method_adaptor<0x102>, &method_adaptor<0x103>, &method_adaptor<0x104>, &method_adaptor<0x105>, &method_adaptor<0x106>, &method_adaptor<0x107>, - &method_adaptor<0x108>, &method_adaptor<0x109>, &method_adaptor<0x10a>, &method_adaptor<0x10b>, &method_adaptor<0x10c>, &method_adaptor<0x10d>, &method_adaptor<0x10e>, &method_adaptor<0x10f>, - &method_adaptor<0x110>, &method_adaptor<0x111>, &method_adaptor<0x112>, &method_adaptor<0x113>, &method_adaptor<0x114>, &method_adaptor<0x115>, &method_adaptor<0x116>, &method_adaptor<0x117>, - &method_adaptor<0x118>, &method_adaptor<0x119>, &method_adaptor<0x11a>, &method_adaptor<0x11b>, &method_adaptor<0x11c>, &method_adaptor<0x11d>, &method_adaptor<0x11e>, &method_adaptor<0x11f>, - &method_adaptor<0x120>, &method_adaptor<0x121>, &method_adaptor<0x122>, &method_adaptor<0x123>, &method_adaptor<0x124>, &method_adaptor<0x125>, &method_adaptor<0x126>, &method_adaptor<0x127>, - &method_adaptor<0x128>, &method_adaptor<0x129>, &method_adaptor<0x12a>, &method_adaptor<0x12b>, &method_adaptor<0x12c>, &method_adaptor<0x12d>, &method_adaptor<0x12e>, &method_adaptor<0x12f>, - &method_adaptor<0x130>, &method_adaptor<0x131>, &method_adaptor<0x132>, &method_adaptor<0x133>, &method_adaptor<0x134>, &method_adaptor<0x135>, &method_adaptor<0x136>, &method_adaptor<0x137>, - &method_adaptor<0x138>, &method_adaptor<0x139>, &method_adaptor<0x13a>, &method_adaptor<0x13b>, &method_adaptor<0x13c>, &method_adaptor<0x13d>, &method_adaptor<0x13e>, &method_adaptor<0x13f>, - &method_adaptor<0x140>, &method_adaptor<0x141>, &method_adaptor<0x142>, &method_adaptor<0x143>, &method_adaptor<0x144>, &method_adaptor<0x145>, &method_adaptor<0x146>, &method_adaptor<0x147>, - &method_adaptor<0x148>, &method_adaptor<0x149>, &method_adaptor<0x14a>, &method_adaptor<0x14b>, &method_adaptor<0x14c>, &method_adaptor<0x14d>, &method_adaptor<0x14e>, &method_adaptor<0x14f>, - &method_adaptor<0x150>, &method_adaptor<0x151>, &method_adaptor<0x152>, &method_adaptor<0x153>, &method_adaptor<0x154>, &method_adaptor<0x155>, &method_adaptor<0x156>, &method_adaptor<0x157>, - &method_adaptor<0x158>, &method_adaptor<0x159>, &method_adaptor<0x15a>, &method_adaptor<0x15b>, &method_adaptor<0x15c>, &method_adaptor<0x15d>, &method_adaptor<0x15e>, &method_adaptor<0x15f>, - &method_adaptor<0x160>, &method_adaptor<0x161>, &method_adaptor<0x162>, &method_adaptor<0x163>, &method_adaptor<0x164>, &method_adaptor<0x165>, &method_adaptor<0x166>, &method_adaptor<0x167>, - &method_adaptor<0x168>, &method_adaptor<0x169>, &method_adaptor<0x16a>, &method_adaptor<0x16b>, &method_adaptor<0x16c>, &method_adaptor<0x16d>, &method_adaptor<0x16e>, &method_adaptor<0x16f>, - &method_adaptor<0x170>, &method_adaptor<0x171>, &method_adaptor<0x172>, &method_adaptor<0x173>, &method_adaptor<0x174>, &method_adaptor<0x175>, &method_adaptor<0x176>, &method_adaptor<0x177>, - &method_adaptor<0x178>, &method_adaptor<0x179>, &method_adaptor<0x17a>, &method_adaptor<0x17b>, &method_adaptor<0x17c>, &method_adaptor<0x17d>, &method_adaptor<0x17e>, &method_adaptor<0x17f>, - &method_adaptor<0x180>, &method_adaptor<0x181>, &method_adaptor<0x182>, &method_adaptor<0x183>, &method_adaptor<0x184>, &method_adaptor<0x185>, &method_adaptor<0x186>, &method_adaptor<0x187>, - &method_adaptor<0x188>, &method_adaptor<0x189>, &method_adaptor<0x18a>, &method_adaptor<0x18b>, &method_adaptor<0x18c>, &method_adaptor<0x18d>, &method_adaptor<0x18e>, &method_adaptor<0x18f>, - &method_adaptor<0x190>, &method_adaptor<0x191>, &method_adaptor<0x192>, &method_adaptor<0x193>, &method_adaptor<0x194>, &method_adaptor<0x195>, &method_adaptor<0x196>, &method_adaptor<0x197>, - &method_adaptor<0x198>, &method_adaptor<0x199>, &method_adaptor<0x19a>, &method_adaptor<0x19b>, &method_adaptor<0x19c>, &method_adaptor<0x19d>, &method_adaptor<0x19e>, &method_adaptor<0x19f>, - &method_adaptor<0x1a0>, &method_adaptor<0x1a1>, &method_adaptor<0x1a2>, &method_adaptor<0x1a3>, &method_adaptor<0x1a4>, &method_adaptor<0x1a5>, &method_adaptor<0x1a6>, &method_adaptor<0x1a7>, - &method_adaptor<0x1a8>, &method_adaptor<0x1a9>, &method_adaptor<0x1aa>, &method_adaptor<0x1ab>, &method_adaptor<0x1ac>, &method_adaptor<0x1ad>, &method_adaptor<0x1ae>, &method_adaptor<0x1af>, - &method_adaptor<0x1b0>, &method_adaptor<0x1b1>, &method_adaptor<0x1b2>, &method_adaptor<0x1b3>, &method_adaptor<0x1b4>, &method_adaptor<0x1b5>, &method_adaptor<0x1b6>, &method_adaptor<0x1b7>, - &method_adaptor<0x1b8>, &method_adaptor<0x1b9>, &method_adaptor<0x1ba>, &method_adaptor<0x1bb>, &method_adaptor<0x1bc>, &method_adaptor<0x1bd>, &method_adaptor<0x1be>, &method_adaptor<0x1bf>, - &method_adaptor<0x1c0>, &method_adaptor<0x1c1>, &method_adaptor<0x1c2>, &method_adaptor<0x1c3>, &method_adaptor<0x1c4>, &method_adaptor<0x1c5>, &method_adaptor<0x1c6>, &method_adaptor<0x1c7>, - &method_adaptor<0x1c8>, &method_adaptor<0x1c9>, &method_adaptor<0x1ca>, &method_adaptor<0x1cb>, &method_adaptor<0x1cc>, &method_adaptor<0x1cd>, &method_adaptor<0x1ce>, &method_adaptor<0x1cf>, - &method_adaptor<0x1d0>, &method_adaptor<0x1d1>, &method_adaptor<0x1d2>, &method_adaptor<0x1d3>, &method_adaptor<0x1d4>, &method_adaptor<0x1d5>, &method_adaptor<0x1d6>, &method_adaptor<0x1d7>, - &method_adaptor<0x1d8>, &method_adaptor<0x1d9>, &method_adaptor<0x1da>, &method_adaptor<0x1db>, &method_adaptor<0x1dc>, &method_adaptor<0x1dd>, &method_adaptor<0x1de>, &method_adaptor<0x1df>, - &method_adaptor<0x1e0>, &method_adaptor<0x1e1>, &method_adaptor<0x1e2>, &method_adaptor<0x1e3>, &method_adaptor<0x1e4>, &method_adaptor<0x1e5>, &method_adaptor<0x1e6>, &method_adaptor<0x1e7>, - &method_adaptor<0x1e8>, &method_adaptor<0x1e9>, &method_adaptor<0x1ea>, &method_adaptor<0x1eb>, &method_adaptor<0x1ec>, &method_adaptor<0x1ed>, &method_adaptor<0x1ee>, &method_adaptor<0x1ef>, - &method_adaptor<0x1f0>, &method_adaptor<0x1f1>, &method_adaptor<0x1f2>, &method_adaptor<0x1f3>, &method_adaptor<0x1f4>, &method_adaptor<0x1f5>, &method_adaptor<0x1f6>, &method_adaptor<0x1f7>, - &method_adaptor<0x1f8>, &method_adaptor<0x1f9>, &method_adaptor<0x1fa>, &method_adaptor<0x1fb>, &method_adaptor<0x1fc>, &method_adaptor<0x1fd>, &method_adaptor<0x1fe>, &method_adaptor<0x1ff>, - &method_adaptor<0x200>, &method_adaptor<0x201>, &method_adaptor<0x202>, &method_adaptor<0x203>, &method_adaptor<0x204>, &method_adaptor<0x205>, &method_adaptor<0x206>, &method_adaptor<0x207>, - &method_adaptor<0x208>, &method_adaptor<0x209>, &method_adaptor<0x20a>, &method_adaptor<0x20b>, &method_adaptor<0x20c>, &method_adaptor<0x20d>, &method_adaptor<0x20e>, &method_adaptor<0x20f>, - &method_adaptor<0x210>, &method_adaptor<0x211>, &method_adaptor<0x212>, &method_adaptor<0x213>, &method_adaptor<0x214>, &method_adaptor<0x215>, &method_adaptor<0x216>, &method_adaptor<0x217>, - &method_adaptor<0x218>, &method_adaptor<0x219>, &method_adaptor<0x21a>, &method_adaptor<0x21b>, &method_adaptor<0x21c>, &method_adaptor<0x21d>, &method_adaptor<0x21e>, &method_adaptor<0x21f>, - &method_adaptor<0x220>, &method_adaptor<0x221>, &method_adaptor<0x222>, &method_adaptor<0x223>, &method_adaptor<0x224>, &method_adaptor<0x225>, &method_adaptor<0x226>, &method_adaptor<0x227>, - &method_adaptor<0x228>, &method_adaptor<0x229>, &method_adaptor<0x22a>, &method_adaptor<0x22b>, &method_adaptor<0x22c>, &method_adaptor<0x22d>, &method_adaptor<0x22e>, &method_adaptor<0x22f>, - &method_adaptor<0x230>, &method_adaptor<0x231>, &method_adaptor<0x232>, &method_adaptor<0x233>, &method_adaptor<0x234>, &method_adaptor<0x235>, &method_adaptor<0x236>, &method_adaptor<0x237>, - &method_adaptor<0x238>, &method_adaptor<0x239>, &method_adaptor<0x23a>, &method_adaptor<0x23b>, &method_adaptor<0x23c>, &method_adaptor<0x23d>, &method_adaptor<0x23e>, &method_adaptor<0x23f>, - &method_adaptor<0x240>, &method_adaptor<0x241>, &method_adaptor<0x242>, &method_adaptor<0x243>, &method_adaptor<0x244>, &method_adaptor<0x245>, &method_adaptor<0x246>, &method_adaptor<0x247>, - &method_adaptor<0x248>, &method_adaptor<0x249>, &method_adaptor<0x24a>, &method_adaptor<0x24b>, &method_adaptor<0x24c>, &method_adaptor<0x24d>, &method_adaptor<0x24e>, &method_adaptor<0x24f>, - &method_adaptor<0x250>, &method_adaptor<0x251>, &method_adaptor<0x252>, &method_adaptor<0x253>, &method_adaptor<0x254>, &method_adaptor<0x255>, &method_adaptor<0x256>, &method_adaptor<0x257>, - &method_adaptor<0x258>, &method_adaptor<0x259>, &method_adaptor<0x25a>, &method_adaptor<0x25b>, &method_adaptor<0x25c>, &method_adaptor<0x25d>, &method_adaptor<0x25e>, &method_adaptor<0x25f>, - &method_adaptor<0x260>, &method_adaptor<0x261>, &method_adaptor<0x262>, &method_adaptor<0x263>, &method_adaptor<0x264>, &method_adaptor<0x265>, &method_adaptor<0x266>, &method_adaptor<0x267>, - &method_adaptor<0x268>, &method_adaptor<0x269>, &method_adaptor<0x26a>, &method_adaptor<0x26b>, &method_adaptor<0x26c>, &method_adaptor<0x26d>, &method_adaptor<0x26e>, &method_adaptor<0x26f>, - &method_adaptor<0x270>, &method_adaptor<0x271>, &method_adaptor<0x272>, &method_adaptor<0x273>, &method_adaptor<0x274>, &method_adaptor<0x275>, &method_adaptor<0x276>, &method_adaptor<0x277>, - &method_adaptor<0x278>, &method_adaptor<0x279>, &method_adaptor<0x27a>, &method_adaptor<0x27b>, &method_adaptor<0x27c>, &method_adaptor<0x27d>, &method_adaptor<0x27e>, &method_adaptor<0x27f>, - &method_adaptor<0x280>, &method_adaptor<0x281>, &method_adaptor<0x282>, &method_adaptor<0x283>, &method_adaptor<0x284>, &method_adaptor<0x285>, &method_adaptor<0x286>, &method_adaptor<0x287>, - &method_adaptor<0x288>, &method_adaptor<0x289>, &method_adaptor<0x28a>, &method_adaptor<0x28b>, &method_adaptor<0x28c>, &method_adaptor<0x28d>, &method_adaptor<0x28e>, &method_adaptor<0x28f>, - &method_adaptor<0x290>, &method_adaptor<0x291>, &method_adaptor<0x292>, &method_adaptor<0x293>, &method_adaptor<0x294>, &method_adaptor<0x295>, &method_adaptor<0x296>, &method_adaptor<0x297>, - &method_adaptor<0x298>, &method_adaptor<0x299>, &method_adaptor<0x29a>, &method_adaptor<0x29b>, &method_adaptor<0x29c>, &method_adaptor<0x29d>, &method_adaptor<0x29e>, &method_adaptor<0x29f>, - &method_adaptor<0x2a0>, &method_adaptor<0x2a1>, &method_adaptor<0x2a2>, &method_adaptor<0x2a3>, &method_adaptor<0x2a4>, &method_adaptor<0x2a5>, &method_adaptor<0x2a6>, &method_adaptor<0x2a7>, - &method_adaptor<0x2a8>, &method_adaptor<0x2a9>, &method_adaptor<0x2aa>, &method_adaptor<0x2ab>, &method_adaptor<0x2ac>, &method_adaptor<0x2ad>, &method_adaptor<0x2ae>, &method_adaptor<0x2af>, - &method_adaptor<0x2b0>, &method_adaptor<0x2b1>, &method_adaptor<0x2b2>, &method_adaptor<0x2b3>, &method_adaptor<0x2b4>, &method_adaptor<0x2b5>, &method_adaptor<0x2b6>, &method_adaptor<0x2b7>, - &method_adaptor<0x2b8>, &method_adaptor<0x2b9>, &method_adaptor<0x2ba>, &method_adaptor<0x2bb>, &method_adaptor<0x2bc>, &method_adaptor<0x2bd>, &method_adaptor<0x2be>, &method_adaptor<0x2bf>, - &method_adaptor<0x2c0>, &method_adaptor<0x2c1>, &method_adaptor<0x2c2>, &method_adaptor<0x2c3>, &method_adaptor<0x2c4>, &method_adaptor<0x2c5>, &method_adaptor<0x2c6>, &method_adaptor<0x2c7>, - &method_adaptor<0x2c8>, &method_adaptor<0x2c9>, &method_adaptor<0x2ca>, &method_adaptor<0x2cb>, &method_adaptor<0x2cc>, &method_adaptor<0x2cd>, &method_adaptor<0x2ce>, &method_adaptor<0x2cf>, - &method_adaptor<0x2d0>, &method_adaptor<0x2d1>, &method_adaptor<0x2d2>, &method_adaptor<0x2d3>, &method_adaptor<0x2d4>, &method_adaptor<0x2d5>, &method_adaptor<0x2d6>, &method_adaptor<0x2d7>, - &method_adaptor<0x2d8>, &method_adaptor<0x2d9>, &method_adaptor<0x2da>, &method_adaptor<0x2db>, &method_adaptor<0x2dc>, &method_adaptor<0x2dd>, &method_adaptor<0x2de>, &method_adaptor<0x2df>, - &method_adaptor<0x2e0>, &method_adaptor<0x2e1>, &method_adaptor<0x2e2>, &method_adaptor<0x2e3>, &method_adaptor<0x2e4>, &method_adaptor<0x2e5>, &method_adaptor<0x2e6>, &method_adaptor<0x2e7>, - &method_adaptor<0x2e8>, &method_adaptor<0x2e9>, &method_adaptor<0x2ea>, &method_adaptor<0x2eb>, &method_adaptor<0x2ec>, &method_adaptor<0x2ed>, &method_adaptor<0x2ee>, &method_adaptor<0x2ef>, - &method_adaptor<0x2f0>, &method_adaptor<0x2f1>, &method_adaptor<0x2f2>, &method_adaptor<0x2f3>, &method_adaptor<0x2f4>, &method_adaptor<0x2f5>, &method_adaptor<0x2f6>, &method_adaptor<0x2f7>, - &method_adaptor<0x2f8>, &method_adaptor<0x2f9>, &method_adaptor<0x2fa>, &method_adaptor<0x2fb>, &method_adaptor<0x2fc>, &method_adaptor<0x2fd>, &method_adaptor<0x2fe>, &method_adaptor<0x2ff>, - &method_adaptor<0x300>, &method_adaptor<0x301>, &method_adaptor<0x302>, &method_adaptor<0x303>, &method_adaptor<0x304>, &method_adaptor<0x305>, &method_adaptor<0x306>, &method_adaptor<0x307>, - &method_adaptor<0x308>, &method_adaptor<0x309>, &method_adaptor<0x30a>, &method_adaptor<0x30b>, &method_adaptor<0x30c>, &method_adaptor<0x30d>, &method_adaptor<0x30e>, &method_adaptor<0x30f>, - &method_adaptor<0x310>, &method_adaptor<0x311>, &method_adaptor<0x312>, &method_adaptor<0x313>, &method_adaptor<0x314>, &method_adaptor<0x315>, &method_adaptor<0x316>, &method_adaptor<0x317>, - &method_adaptor<0x318>, &method_adaptor<0x319>, &method_adaptor<0x31a>, &method_adaptor<0x31b>, &method_adaptor<0x31c>, &method_adaptor<0x31d>, &method_adaptor<0x31e>, &method_adaptor<0x31f>, - &method_adaptor<0x320>, &method_adaptor<0x321>, &method_adaptor<0x322>, &method_adaptor<0x323>, &method_adaptor<0x324>, &method_adaptor<0x325>, &method_adaptor<0x326>, &method_adaptor<0x327>, - &method_adaptor<0x328>, &method_adaptor<0x329>, &method_adaptor<0x32a>, &method_adaptor<0x32b>, &method_adaptor<0x32c>, &method_adaptor<0x32d>, &method_adaptor<0x32e>, &method_adaptor<0x32f>, - &method_adaptor<0x330>, &method_adaptor<0x331>, &method_adaptor<0x332>, &method_adaptor<0x333>, &method_adaptor<0x334>, &method_adaptor<0x335>, &method_adaptor<0x336>, &method_adaptor<0x337>, - &method_adaptor<0x338>, &method_adaptor<0x339>, &method_adaptor<0x33a>, &method_adaptor<0x33b>, &method_adaptor<0x33c>, &method_adaptor<0x33d>, &method_adaptor<0x33e>, &method_adaptor<0x33f>, - &method_adaptor<0x340>, &method_adaptor<0x341>, &method_adaptor<0x342>, &method_adaptor<0x343>, &method_adaptor<0x344>, &method_adaptor<0x345>, &method_adaptor<0x346>, &method_adaptor<0x347>, - &method_adaptor<0x348>, &method_adaptor<0x349>, &method_adaptor<0x34a>, &method_adaptor<0x34b>, &method_adaptor<0x34c>, &method_adaptor<0x34d>, &method_adaptor<0x34e>, &method_adaptor<0x34f>, - &method_adaptor<0x350>, &method_adaptor<0x351>, &method_adaptor<0x352>, &method_adaptor<0x353>, &method_adaptor<0x354>, &method_adaptor<0x355>, &method_adaptor<0x356>, &method_adaptor<0x357>, - &method_adaptor<0x358>, &method_adaptor<0x359>, &method_adaptor<0x35a>, &method_adaptor<0x35b>, &method_adaptor<0x35c>, &method_adaptor<0x35d>, &method_adaptor<0x35e>, &method_adaptor<0x35f>, - &method_adaptor<0x360>, &method_adaptor<0x361>, &method_adaptor<0x362>, &method_adaptor<0x363>, &method_adaptor<0x364>, &method_adaptor<0x365>, &method_adaptor<0x366>, &method_adaptor<0x367>, - &method_adaptor<0x368>, &method_adaptor<0x369>, &method_adaptor<0x36a>, &method_adaptor<0x36b>, &method_adaptor<0x36c>, &method_adaptor<0x36d>, &method_adaptor<0x36e>, &method_adaptor<0x36f>, - &method_adaptor<0x370>, &method_adaptor<0x371>, &method_adaptor<0x372>, &method_adaptor<0x373>, &method_adaptor<0x374>, &method_adaptor<0x375>, &method_adaptor<0x376>, &method_adaptor<0x377>, - &method_adaptor<0x378>, &method_adaptor<0x379>, &method_adaptor<0x37a>, &method_adaptor<0x37b>, &method_adaptor<0x37c>, &method_adaptor<0x37d>, &method_adaptor<0x37e>, &method_adaptor<0x37f>, - &method_adaptor<0x380>, &method_adaptor<0x381>, &method_adaptor<0x382>, &method_adaptor<0x383>, &method_adaptor<0x384>, &method_adaptor<0x385>, &method_adaptor<0x386>, &method_adaptor<0x387>, - &method_adaptor<0x388>, &method_adaptor<0x389>, &method_adaptor<0x38a>, &method_adaptor<0x38b>, &method_adaptor<0x38c>, &method_adaptor<0x38d>, &method_adaptor<0x38e>, &method_adaptor<0x38f>, - &method_adaptor<0x390>, &method_adaptor<0x391>, &method_adaptor<0x392>, &method_adaptor<0x393>, &method_adaptor<0x394>, &method_adaptor<0x395>, &method_adaptor<0x396>, &method_adaptor<0x397>, - &method_adaptor<0x398>, &method_adaptor<0x399>, &method_adaptor<0x39a>, &method_adaptor<0x39b>, &method_adaptor<0x39c>, &method_adaptor<0x39d>, &method_adaptor<0x39e>, &method_adaptor<0x39f>, - &method_adaptor<0x3a0>, &method_adaptor<0x3a1>, &method_adaptor<0x3a2>, &method_adaptor<0x3a3>, &method_adaptor<0x3a4>, &method_adaptor<0x3a5>, &method_adaptor<0x3a6>, &method_adaptor<0x3a7>, - &method_adaptor<0x3a8>, &method_adaptor<0x3a9>, &method_adaptor<0x3aa>, &method_adaptor<0x3ab>, &method_adaptor<0x3ac>, &method_adaptor<0x3ad>, &method_adaptor<0x3ae>, &method_adaptor<0x3af>, - &method_adaptor<0x3b0>, &method_adaptor<0x3b1>, &method_adaptor<0x3b2>, &method_adaptor<0x3b3>, &method_adaptor<0x3b4>, &method_adaptor<0x3b5>, &method_adaptor<0x3b6>, &method_adaptor<0x3b7>, - &method_adaptor<0x3b8>, &method_adaptor<0x3b9>, &method_adaptor<0x3ba>, &method_adaptor<0x3bb>, &method_adaptor<0x3bc>, &method_adaptor<0x3bd>, &method_adaptor<0x3be>, &method_adaptor<0x3bf>, - &method_adaptor<0x3c0>, &method_adaptor<0x3c1>, &method_adaptor<0x3c2>, &method_adaptor<0x3c3>, &method_adaptor<0x3c4>, &method_adaptor<0x3c5>, &method_adaptor<0x3c6>, &method_adaptor<0x3c7>, - &method_adaptor<0x3c8>, &method_adaptor<0x3c9>, &method_adaptor<0x3ca>, &method_adaptor<0x3cb>, &method_adaptor<0x3cc>, &method_adaptor<0x3cd>, &method_adaptor<0x3ce>, &method_adaptor<0x3cf>, - &method_adaptor<0x3d0>, &method_adaptor<0x3d1>, &method_adaptor<0x3d2>, &method_adaptor<0x3d3>, &method_adaptor<0x3d4>, &method_adaptor<0x3d5>, &method_adaptor<0x3d6>, &method_adaptor<0x3d7>, - &method_adaptor<0x3d8>, &method_adaptor<0x3d9>, &method_adaptor<0x3da>, &method_adaptor<0x3db>, &method_adaptor<0x3dc>, &method_adaptor<0x3dd>, &method_adaptor<0x3de>, &method_adaptor<0x3df>, - &method_adaptor<0x3e0>, &method_adaptor<0x3e1>, &method_adaptor<0x3e2>, &method_adaptor<0x3e3>, &method_adaptor<0x3e4>, &method_adaptor<0x3e5>, &method_adaptor<0x3e6>, &method_adaptor<0x3e7>, - &method_adaptor<0x3e8>, &method_adaptor<0x3e9>, &method_adaptor<0x3ea>, &method_adaptor<0x3eb>, &method_adaptor<0x3ec>, &method_adaptor<0x3ed>, &method_adaptor<0x3ee>, &method_adaptor<0x3ef>, - &method_adaptor<0x3f0>, &method_adaptor<0x3f1>, &method_adaptor<0x3f2>, &method_adaptor<0x3f3>, &method_adaptor<0x3f4>, &method_adaptor<0x3f5>, &method_adaptor<0x3f6>, &method_adaptor<0x3f7>, - &method_adaptor<0x3f8>, &method_adaptor<0x3f9>, &method_adaptor<0x3fa>, &method_adaptor<0x3fb>, &method_adaptor<0x3fc>, &method_adaptor<0x3fd>, &method_adaptor<0x3fe>, &method_adaptor<0x3ff>, - &method_adaptor<0x400>, &method_adaptor<0x401>, &method_adaptor<0x402>, &method_adaptor<0x403>, &method_adaptor<0x404>, &method_adaptor<0x405>, &method_adaptor<0x406>, &method_adaptor<0x407>, - &method_adaptor<0x408>, &method_adaptor<0x409>, &method_adaptor<0x40a>, &method_adaptor<0x40b>, &method_adaptor<0x40c>, &method_adaptor<0x40d>, &method_adaptor<0x40e>, &method_adaptor<0x40f>, - &method_adaptor<0x410>, &method_adaptor<0x411>, &method_adaptor<0x412>, &method_adaptor<0x413>, &method_adaptor<0x414>, &method_adaptor<0x415>, &method_adaptor<0x416>, &method_adaptor<0x417>, - &method_adaptor<0x418>, &method_adaptor<0x419>, &method_adaptor<0x41a>, &method_adaptor<0x41b>, &method_adaptor<0x41c>, &method_adaptor<0x41d>, &method_adaptor<0x41e>, &method_adaptor<0x41f>, - &method_adaptor<0x420>, &method_adaptor<0x421>, &method_adaptor<0x422>, &method_adaptor<0x423>, &method_adaptor<0x424>, &method_adaptor<0x425>, &method_adaptor<0x426>, &method_adaptor<0x427>, - &method_adaptor<0x428>, &method_adaptor<0x429>, &method_adaptor<0x42a>, &method_adaptor<0x42b>, &method_adaptor<0x42c>, &method_adaptor<0x42d>, &method_adaptor<0x42e>, &method_adaptor<0x42f>, - &method_adaptor<0x430>, &method_adaptor<0x431>, &method_adaptor<0x432>, &method_adaptor<0x433>, &method_adaptor<0x434>, &method_adaptor<0x435>, &method_adaptor<0x436>, &method_adaptor<0x437>, - &method_adaptor<0x438>, &method_adaptor<0x439>, &method_adaptor<0x43a>, &method_adaptor<0x43b>, &method_adaptor<0x43c>, &method_adaptor<0x43d>, &method_adaptor<0x43e>, &method_adaptor<0x43f>, - &method_adaptor<0x440>, &method_adaptor<0x441>, &method_adaptor<0x442>, &method_adaptor<0x443>, &method_adaptor<0x444>, &method_adaptor<0x445>, &method_adaptor<0x446>, &method_adaptor<0x447>, - &method_adaptor<0x448>, &method_adaptor<0x449>, &method_adaptor<0x44a>, &method_adaptor<0x44b>, &method_adaptor<0x44c>, &method_adaptor<0x44d>, &method_adaptor<0x44e>, &method_adaptor<0x44f>, - &method_adaptor<0x450>, &method_adaptor<0x451>, &method_adaptor<0x452>, &method_adaptor<0x453>, &method_adaptor<0x454>, &method_adaptor<0x455>, &method_adaptor<0x456>, &method_adaptor<0x457>, - &method_adaptor<0x458>, &method_adaptor<0x459>, &method_adaptor<0x45a>, &method_adaptor<0x45b>, &method_adaptor<0x45c>, &method_adaptor<0x45d>, &method_adaptor<0x45e>, &method_adaptor<0x45f>, - &method_adaptor<0x460>, &method_adaptor<0x461>, &method_adaptor<0x462>, &method_adaptor<0x463>, &method_adaptor<0x464>, &method_adaptor<0x465>, &method_adaptor<0x466>, &method_adaptor<0x467>, - &method_adaptor<0x468>, &method_adaptor<0x469>, &method_adaptor<0x46a>, &method_adaptor<0x46b>, &method_adaptor<0x46c>, &method_adaptor<0x46d>, &method_adaptor<0x46e>, &method_adaptor<0x46f>, - &method_adaptor<0x470>, &method_adaptor<0x471>, &method_adaptor<0x472>, &method_adaptor<0x473>, &method_adaptor<0x474>, &method_adaptor<0x475>, &method_adaptor<0x476>, &method_adaptor<0x477>, - &method_adaptor<0x478>, &method_adaptor<0x479>, &method_adaptor<0x47a>, &method_adaptor<0x47b>, &method_adaptor<0x47c>, &method_adaptor<0x47d>, &method_adaptor<0x47e>, &method_adaptor<0x47f>, - &method_adaptor<0x480>, &method_adaptor<0x481>, &method_adaptor<0x482>, &method_adaptor<0x483>, &method_adaptor<0x484>, &method_adaptor<0x485>, &method_adaptor<0x486>, &method_adaptor<0x487>, - &method_adaptor<0x488>, &method_adaptor<0x489>, &method_adaptor<0x48a>, &method_adaptor<0x48b>, &method_adaptor<0x48c>, &method_adaptor<0x48d>, &method_adaptor<0x48e>, &method_adaptor<0x48f>, - &method_adaptor<0x490>, &method_adaptor<0x491>, &method_adaptor<0x492>, &method_adaptor<0x493>, &method_adaptor<0x494>, &method_adaptor<0x495>, &method_adaptor<0x496>, &method_adaptor<0x497>, - &method_adaptor<0x498>, &method_adaptor<0x499>, &method_adaptor<0x49a>, &method_adaptor<0x49b>, &method_adaptor<0x49c>, &method_adaptor<0x49d>, &method_adaptor<0x49e>, &method_adaptor<0x49f>, - &method_adaptor<0x4a0>, &method_adaptor<0x4a1>, &method_adaptor<0x4a2>, &method_adaptor<0x4a3>, &method_adaptor<0x4a4>, &method_adaptor<0x4a5>, &method_adaptor<0x4a6>, &method_adaptor<0x4a7>, - &method_adaptor<0x4a8>, &method_adaptor<0x4a9>, &method_adaptor<0x4aa>, &method_adaptor<0x4ab>, &method_adaptor<0x4ac>, &method_adaptor<0x4ad>, &method_adaptor<0x4ae>, &method_adaptor<0x4af>, - &method_adaptor<0x4b0>, &method_adaptor<0x4b1>, &method_adaptor<0x4b2>, &method_adaptor<0x4b3>, &method_adaptor<0x4b4>, &method_adaptor<0x4b5>, &method_adaptor<0x4b6>, &method_adaptor<0x4b7>, - &method_adaptor<0x4b8>, &method_adaptor<0x4b9>, &method_adaptor<0x4ba>, &method_adaptor<0x4bb>, &method_adaptor<0x4bc>, &method_adaptor<0x4bd>, &method_adaptor<0x4be>, &method_adaptor<0x4bf>, - &method_adaptor<0x4c0>, &method_adaptor<0x4c1>, &method_adaptor<0x4c2>, &method_adaptor<0x4c3>, &method_adaptor<0x4c4>, &method_adaptor<0x4c5>, &method_adaptor<0x4c6>, &method_adaptor<0x4c7>, - &method_adaptor<0x4c8>, &method_adaptor<0x4c9>, &method_adaptor<0x4ca>, &method_adaptor<0x4cb>, &method_adaptor<0x4cc>, &method_adaptor<0x4cd>, &method_adaptor<0x4ce>, &method_adaptor<0x4cf>, - &method_adaptor<0x4d0>, &method_adaptor<0x4d1>, &method_adaptor<0x4d2>, &method_adaptor<0x4d3>, &method_adaptor<0x4d4>, &method_adaptor<0x4d5>, &method_adaptor<0x4d6>, &method_adaptor<0x4d7>, - &method_adaptor<0x4d8>, &method_adaptor<0x4d9>, &method_adaptor<0x4da>, &method_adaptor<0x4db>, &method_adaptor<0x4dc>, &method_adaptor<0x4dd>, &method_adaptor<0x4de>, &method_adaptor<0x4df>, - &method_adaptor<0x4e0>, &method_adaptor<0x4e1>, &method_adaptor<0x4e2>, &method_adaptor<0x4e3>, &method_adaptor<0x4e4>, &method_adaptor<0x4e5>, &method_adaptor<0x4e6>, &method_adaptor<0x4e7>, - &method_adaptor<0x4e8>, &method_adaptor<0x4e9>, &method_adaptor<0x4ea>, &method_adaptor<0x4eb>, &method_adaptor<0x4ec>, &method_adaptor<0x4ed>, &method_adaptor<0x4ee>, &method_adaptor<0x4ef>, - &method_adaptor<0x4f0>, &method_adaptor<0x4f1>, &method_adaptor<0x4f2>, &method_adaptor<0x4f3>, &method_adaptor<0x4f4>, &method_adaptor<0x4f5>, &method_adaptor<0x4f6>, &method_adaptor<0x4f7>, - &method_adaptor<0x4f8>, &method_adaptor<0x4f9>, &method_adaptor<0x4fa>, &method_adaptor<0x4fb>, &method_adaptor<0x4fc>, &method_adaptor<0x4fd>, &method_adaptor<0x4fe>, &method_adaptor<0x4ff>, -}; - -static PyObject *property_getter_impl (int mid, PyObject *self); - -static PyObject * -property_getter_adaptor (int mid, PyObject *self, PyObject *args) -{ - PyObject *ret = NULL; - - PYA_TRY - - int argc = args == NULL ? 0 : int (PyTuple_Size (args)); - if (argc != 0) { - throw tl::Exception (tl::to_string (tr ("Property getters must not have an argument"))); - } - - ret = property_getter_impl (mid, self); - - PYA_CATCH(property_name_from_id (mid, self)) - - return ret; -} - -template -PyObject *property_getter_adaptor (PyObject *self, PyObject *args) -{ - return property_getter_adaptor (N, self, args); -} - -PyObject *(*(property_getter_adaptors [])) (PyObject *self, PyObject *args) = -{ - &property_getter_adaptor<0x000>, &property_getter_adaptor<0x001>, &property_getter_adaptor<0x002>, &property_getter_adaptor<0x003>, &property_getter_adaptor<0x004>, &property_getter_adaptor<0x005>, &property_getter_adaptor<0x006>, &property_getter_adaptor<0x007>, - &property_getter_adaptor<0x008>, &property_getter_adaptor<0x009>, &property_getter_adaptor<0x00a>, &property_getter_adaptor<0x00b>, &property_getter_adaptor<0x00c>, &property_getter_adaptor<0x00d>, &property_getter_adaptor<0x00e>, &property_getter_adaptor<0x00f>, - &property_getter_adaptor<0x010>, &property_getter_adaptor<0x011>, &property_getter_adaptor<0x012>, &property_getter_adaptor<0x013>, &property_getter_adaptor<0x014>, &property_getter_adaptor<0x015>, &property_getter_adaptor<0x016>, &property_getter_adaptor<0x017>, - &property_getter_adaptor<0x018>, &property_getter_adaptor<0x019>, &property_getter_adaptor<0x01a>, &property_getter_adaptor<0x01b>, &property_getter_adaptor<0x01c>, &property_getter_adaptor<0x01d>, &property_getter_adaptor<0x01e>, &property_getter_adaptor<0x01f>, - &property_getter_adaptor<0x020>, &property_getter_adaptor<0x021>, &property_getter_adaptor<0x022>, &property_getter_adaptor<0x023>, &property_getter_adaptor<0x024>, &property_getter_adaptor<0x025>, &property_getter_adaptor<0x026>, &property_getter_adaptor<0x027>, - &property_getter_adaptor<0x028>, &property_getter_adaptor<0x029>, &property_getter_adaptor<0x02a>, &property_getter_adaptor<0x02b>, &property_getter_adaptor<0x02c>, &property_getter_adaptor<0x02d>, &property_getter_adaptor<0x02e>, &property_getter_adaptor<0x02f>, - &property_getter_adaptor<0x030>, &property_getter_adaptor<0x031>, &property_getter_adaptor<0x032>, &property_getter_adaptor<0x033>, &property_getter_adaptor<0x034>, &property_getter_adaptor<0x035>, &property_getter_adaptor<0x036>, &property_getter_adaptor<0x037>, - &property_getter_adaptor<0x038>, &property_getter_adaptor<0x039>, &property_getter_adaptor<0x03a>, &property_getter_adaptor<0x03b>, &property_getter_adaptor<0x03c>, &property_getter_adaptor<0x03d>, &property_getter_adaptor<0x03e>, &property_getter_adaptor<0x03f>, - &property_getter_adaptor<0x040>, &property_getter_adaptor<0x041>, &property_getter_adaptor<0x042>, &property_getter_adaptor<0x043>, &property_getter_adaptor<0x044>, &property_getter_adaptor<0x045>, &property_getter_adaptor<0x046>, &property_getter_adaptor<0x047>, - &property_getter_adaptor<0x048>, &property_getter_adaptor<0x049>, &property_getter_adaptor<0x04a>, &property_getter_adaptor<0x04b>, &property_getter_adaptor<0x04c>, &property_getter_adaptor<0x04d>, &property_getter_adaptor<0x04e>, &property_getter_adaptor<0x04f>, - &property_getter_adaptor<0x050>, &property_getter_adaptor<0x051>, &property_getter_adaptor<0x052>, &property_getter_adaptor<0x053>, &property_getter_adaptor<0x054>, &property_getter_adaptor<0x055>, &property_getter_adaptor<0x056>, &property_getter_adaptor<0x057>, - &property_getter_adaptor<0x058>, &property_getter_adaptor<0x059>, &property_getter_adaptor<0x05a>, &property_getter_adaptor<0x05b>, &property_getter_adaptor<0x05c>, &property_getter_adaptor<0x05d>, &property_getter_adaptor<0x05e>, &property_getter_adaptor<0x05f>, - &property_getter_adaptor<0x060>, &property_getter_adaptor<0x061>, &property_getter_adaptor<0x062>, &property_getter_adaptor<0x063>, &property_getter_adaptor<0x064>, &property_getter_adaptor<0x065>, &property_getter_adaptor<0x066>, &property_getter_adaptor<0x067>, - &property_getter_adaptor<0x068>, &property_getter_adaptor<0x069>, &property_getter_adaptor<0x06a>, &property_getter_adaptor<0x06b>, &property_getter_adaptor<0x06c>, &property_getter_adaptor<0x06d>, &property_getter_adaptor<0x06e>, &property_getter_adaptor<0x06f>, - &property_getter_adaptor<0x070>, &property_getter_adaptor<0x071>, &property_getter_adaptor<0x072>, &property_getter_adaptor<0x073>, &property_getter_adaptor<0x074>, &property_getter_adaptor<0x075>, &property_getter_adaptor<0x076>, &property_getter_adaptor<0x077>, - &property_getter_adaptor<0x078>, &property_getter_adaptor<0x079>, &property_getter_adaptor<0x07a>, &property_getter_adaptor<0x07b>, &property_getter_adaptor<0x07c>, &property_getter_adaptor<0x07d>, &property_getter_adaptor<0x07e>, &property_getter_adaptor<0x07f>, - &property_getter_adaptor<0x080>, &property_getter_adaptor<0x081>, &property_getter_adaptor<0x082>, &property_getter_adaptor<0x083>, &property_getter_adaptor<0x084>, &property_getter_adaptor<0x085>, &property_getter_adaptor<0x086>, &property_getter_adaptor<0x087>, - &property_getter_adaptor<0x088>, &property_getter_adaptor<0x089>, &property_getter_adaptor<0x08a>, &property_getter_adaptor<0x08b>, &property_getter_adaptor<0x08c>, &property_getter_adaptor<0x08d>, &property_getter_adaptor<0x08e>, &property_getter_adaptor<0x08f>, - &property_getter_adaptor<0x090>, &property_getter_adaptor<0x091>, &property_getter_adaptor<0x092>, &property_getter_adaptor<0x093>, &property_getter_adaptor<0x094>, &property_getter_adaptor<0x095>, &property_getter_adaptor<0x096>, &property_getter_adaptor<0x097>, - &property_getter_adaptor<0x098>, &property_getter_adaptor<0x099>, &property_getter_adaptor<0x09a>, &property_getter_adaptor<0x09b>, &property_getter_adaptor<0x09c>, &property_getter_adaptor<0x09d>, &property_getter_adaptor<0x09e>, &property_getter_adaptor<0x09f>, - &property_getter_adaptor<0x0a0>, &property_getter_adaptor<0x0a1>, &property_getter_adaptor<0x0a2>, &property_getter_adaptor<0x0a3>, &property_getter_adaptor<0x0a4>, &property_getter_adaptor<0x0a5>, &property_getter_adaptor<0x0a6>, &property_getter_adaptor<0x0a7>, - &property_getter_adaptor<0x0a8>, &property_getter_adaptor<0x0a9>, &property_getter_adaptor<0x0aa>, &property_getter_adaptor<0x0ab>, &property_getter_adaptor<0x0ac>, &property_getter_adaptor<0x0ad>, &property_getter_adaptor<0x0ae>, &property_getter_adaptor<0x0af>, - &property_getter_adaptor<0x0b0>, &property_getter_adaptor<0x0b1>, &property_getter_adaptor<0x0b2>, &property_getter_adaptor<0x0b3>, &property_getter_adaptor<0x0b4>, &property_getter_adaptor<0x0b5>, &property_getter_adaptor<0x0b6>, &property_getter_adaptor<0x0b7>, - &property_getter_adaptor<0x0b8>, &property_getter_adaptor<0x0b9>, &property_getter_adaptor<0x0ba>, &property_getter_adaptor<0x0bb>, &property_getter_adaptor<0x0bc>, &property_getter_adaptor<0x0bd>, &property_getter_adaptor<0x0be>, &property_getter_adaptor<0x0bf>, - &property_getter_adaptor<0x0c0>, &property_getter_adaptor<0x0c1>, &property_getter_adaptor<0x0c2>, &property_getter_adaptor<0x0c3>, &property_getter_adaptor<0x0c4>, &property_getter_adaptor<0x0c5>, &property_getter_adaptor<0x0c6>, &property_getter_adaptor<0x0c7>, - &property_getter_adaptor<0x0c8>, &property_getter_adaptor<0x0c9>, &property_getter_adaptor<0x0ca>, &property_getter_adaptor<0x0cb>, &property_getter_adaptor<0x0cc>, &property_getter_adaptor<0x0cd>, &property_getter_adaptor<0x0ce>, &property_getter_adaptor<0x0cf>, - &property_getter_adaptor<0x0d0>, &property_getter_adaptor<0x0d1>, &property_getter_adaptor<0x0d2>, &property_getter_adaptor<0x0d3>, &property_getter_adaptor<0x0d4>, &property_getter_adaptor<0x0d5>, &property_getter_adaptor<0x0d6>, &property_getter_adaptor<0x0d7>, - &property_getter_adaptor<0x0d8>, &property_getter_adaptor<0x0d9>, &property_getter_adaptor<0x0da>, &property_getter_adaptor<0x0db>, &property_getter_adaptor<0x0dc>, &property_getter_adaptor<0x0dd>, &property_getter_adaptor<0x0de>, &property_getter_adaptor<0x0df>, - &property_getter_adaptor<0x0e0>, &property_getter_adaptor<0x0e1>, &property_getter_adaptor<0x0e2>, &property_getter_adaptor<0x0e3>, &property_getter_adaptor<0x0e4>, &property_getter_adaptor<0x0e5>, &property_getter_adaptor<0x0e6>, &property_getter_adaptor<0x0e7>, - &property_getter_adaptor<0x0e8>, &property_getter_adaptor<0x0e9>, &property_getter_adaptor<0x0ea>, &property_getter_adaptor<0x0eb>, &property_getter_adaptor<0x0ec>, &property_getter_adaptor<0x0ed>, &property_getter_adaptor<0x0ee>, &property_getter_adaptor<0x0ef>, - &property_getter_adaptor<0x0f0>, &property_getter_adaptor<0x0f1>, &property_getter_adaptor<0x0f2>, &property_getter_adaptor<0x0f3>, &property_getter_adaptor<0x0f4>, &property_getter_adaptor<0x0f5>, &property_getter_adaptor<0x0f6>, &property_getter_adaptor<0x0f7>, - &property_getter_adaptor<0x0f8>, &property_getter_adaptor<0x0f9>, &property_getter_adaptor<0x0fa>, &property_getter_adaptor<0x0fb>, &property_getter_adaptor<0x0fc>, &property_getter_adaptor<0x0fd>, &property_getter_adaptor<0x0fe>, &property_getter_adaptor<0x0ff>, - &property_getter_adaptor<0x100>, &property_getter_adaptor<0x101>, &property_getter_adaptor<0x102>, &property_getter_adaptor<0x103>, &property_getter_adaptor<0x104>, &property_getter_adaptor<0x105>, &property_getter_adaptor<0x106>, &property_getter_adaptor<0x107>, - &property_getter_adaptor<0x108>, &property_getter_adaptor<0x109>, &property_getter_adaptor<0x10a>, &property_getter_adaptor<0x10b>, &property_getter_adaptor<0x10c>, &property_getter_adaptor<0x10d>, &property_getter_adaptor<0x10e>, &property_getter_adaptor<0x10f>, - &property_getter_adaptor<0x110>, &property_getter_adaptor<0x111>, &property_getter_adaptor<0x112>, &property_getter_adaptor<0x113>, &property_getter_adaptor<0x114>, &property_getter_adaptor<0x115>, &property_getter_adaptor<0x116>, &property_getter_adaptor<0x117>, - &property_getter_adaptor<0x118>, &property_getter_adaptor<0x119>, &property_getter_adaptor<0x11a>, &property_getter_adaptor<0x11b>, &property_getter_adaptor<0x11c>, &property_getter_adaptor<0x11d>, &property_getter_adaptor<0x11e>, &property_getter_adaptor<0x11f>, - &property_getter_adaptor<0x120>, &property_getter_adaptor<0x121>, &property_getter_adaptor<0x122>, &property_getter_adaptor<0x123>, &property_getter_adaptor<0x124>, &property_getter_adaptor<0x125>, &property_getter_adaptor<0x126>, &property_getter_adaptor<0x127>, - &property_getter_adaptor<0x128>, &property_getter_adaptor<0x129>, &property_getter_adaptor<0x12a>, &property_getter_adaptor<0x12b>, &property_getter_adaptor<0x12c>, &property_getter_adaptor<0x12d>, &property_getter_adaptor<0x12e>, &property_getter_adaptor<0x12f>, - &property_getter_adaptor<0x130>, &property_getter_adaptor<0x131>, &property_getter_adaptor<0x132>, &property_getter_adaptor<0x133>, &property_getter_adaptor<0x134>, &property_getter_adaptor<0x135>, &property_getter_adaptor<0x136>, &property_getter_adaptor<0x137>, - &property_getter_adaptor<0x138>, &property_getter_adaptor<0x139>, &property_getter_adaptor<0x13a>, &property_getter_adaptor<0x13b>, &property_getter_adaptor<0x13c>, &property_getter_adaptor<0x13d>, &property_getter_adaptor<0x13e>, &property_getter_adaptor<0x13f>, - &property_getter_adaptor<0x140>, &property_getter_adaptor<0x141>, &property_getter_adaptor<0x142>, &property_getter_adaptor<0x143>, &property_getter_adaptor<0x144>, &property_getter_adaptor<0x145>, &property_getter_adaptor<0x146>, &property_getter_adaptor<0x147>, - &property_getter_adaptor<0x148>, &property_getter_adaptor<0x149>, &property_getter_adaptor<0x14a>, &property_getter_adaptor<0x14b>, &property_getter_adaptor<0x14c>, &property_getter_adaptor<0x14d>, &property_getter_adaptor<0x14e>, &property_getter_adaptor<0x14f>, - &property_getter_adaptor<0x150>, &property_getter_adaptor<0x151>, &property_getter_adaptor<0x152>, &property_getter_adaptor<0x153>, &property_getter_adaptor<0x154>, &property_getter_adaptor<0x155>, &property_getter_adaptor<0x156>, &property_getter_adaptor<0x157>, - &property_getter_adaptor<0x158>, &property_getter_adaptor<0x159>, &property_getter_adaptor<0x15a>, &property_getter_adaptor<0x15b>, &property_getter_adaptor<0x15c>, &property_getter_adaptor<0x15d>, &property_getter_adaptor<0x15e>, &property_getter_adaptor<0x15f>, - &property_getter_adaptor<0x160>, &property_getter_adaptor<0x161>, &property_getter_adaptor<0x162>, &property_getter_adaptor<0x163>, &property_getter_adaptor<0x164>, &property_getter_adaptor<0x165>, &property_getter_adaptor<0x166>, &property_getter_adaptor<0x167>, - &property_getter_adaptor<0x168>, &property_getter_adaptor<0x169>, &property_getter_adaptor<0x16a>, &property_getter_adaptor<0x16b>, &property_getter_adaptor<0x16c>, &property_getter_adaptor<0x16d>, &property_getter_adaptor<0x16e>, &property_getter_adaptor<0x16f>, - &property_getter_adaptor<0x170>, &property_getter_adaptor<0x171>, &property_getter_adaptor<0x172>, &property_getter_adaptor<0x173>, &property_getter_adaptor<0x174>, &property_getter_adaptor<0x175>, &property_getter_adaptor<0x176>, &property_getter_adaptor<0x177>, - &property_getter_adaptor<0x178>, &property_getter_adaptor<0x179>, &property_getter_adaptor<0x17a>, &property_getter_adaptor<0x17b>, &property_getter_adaptor<0x17c>, &property_getter_adaptor<0x17d>, &property_getter_adaptor<0x17e>, &property_getter_adaptor<0x17f>, - &property_getter_adaptor<0x180>, &property_getter_adaptor<0x181>, &property_getter_adaptor<0x182>, &property_getter_adaptor<0x183>, &property_getter_adaptor<0x184>, &property_getter_adaptor<0x185>, &property_getter_adaptor<0x186>, &property_getter_adaptor<0x187>, - &property_getter_adaptor<0x188>, &property_getter_adaptor<0x189>, &property_getter_adaptor<0x18a>, &property_getter_adaptor<0x18b>, &property_getter_adaptor<0x18c>, &property_getter_adaptor<0x18d>, &property_getter_adaptor<0x18e>, &property_getter_adaptor<0x18f>, - &property_getter_adaptor<0x190>, &property_getter_adaptor<0x191>, &property_getter_adaptor<0x192>, &property_getter_adaptor<0x193>, &property_getter_adaptor<0x194>, &property_getter_adaptor<0x195>, &property_getter_adaptor<0x196>, &property_getter_adaptor<0x197>, - &property_getter_adaptor<0x198>, &property_getter_adaptor<0x199>, &property_getter_adaptor<0x19a>, &property_getter_adaptor<0x19b>, &property_getter_adaptor<0x19c>, &property_getter_adaptor<0x19d>, &property_getter_adaptor<0x19e>, &property_getter_adaptor<0x19f>, - &property_getter_adaptor<0x1a0>, &property_getter_adaptor<0x1a1>, &property_getter_adaptor<0x1a2>, &property_getter_adaptor<0x1a3>, &property_getter_adaptor<0x1a4>, &property_getter_adaptor<0x1a5>, &property_getter_adaptor<0x1a6>, &property_getter_adaptor<0x1a7>, - &property_getter_adaptor<0x1a8>, &property_getter_adaptor<0x1a9>, &property_getter_adaptor<0x1aa>, &property_getter_adaptor<0x1ab>, &property_getter_adaptor<0x1ac>, &property_getter_adaptor<0x1ad>, &property_getter_adaptor<0x1ae>, &property_getter_adaptor<0x1af>, - &property_getter_adaptor<0x1b0>, &property_getter_adaptor<0x1b1>, &property_getter_adaptor<0x1b2>, &property_getter_adaptor<0x1b3>, &property_getter_adaptor<0x1b4>, &property_getter_adaptor<0x1b5>, &property_getter_adaptor<0x1b6>, &property_getter_adaptor<0x1b7>, - &property_getter_adaptor<0x1b8>, &property_getter_adaptor<0x1b9>, &property_getter_adaptor<0x1ba>, &property_getter_adaptor<0x1bb>, &property_getter_adaptor<0x1bc>, &property_getter_adaptor<0x1bd>, &property_getter_adaptor<0x1be>, &property_getter_adaptor<0x1bf>, - &property_getter_adaptor<0x1c0>, &property_getter_adaptor<0x1c1>, &property_getter_adaptor<0x1c2>, &property_getter_adaptor<0x1c3>, &property_getter_adaptor<0x1c4>, &property_getter_adaptor<0x1c5>, &property_getter_adaptor<0x1c6>, &property_getter_adaptor<0x1c7>, - &property_getter_adaptor<0x1c8>, &property_getter_adaptor<0x1c9>, &property_getter_adaptor<0x1ca>, &property_getter_adaptor<0x1cb>, &property_getter_adaptor<0x1cc>, &property_getter_adaptor<0x1cd>, &property_getter_adaptor<0x1ce>, &property_getter_adaptor<0x1cf>, - &property_getter_adaptor<0x1d0>, &property_getter_adaptor<0x1d1>, &property_getter_adaptor<0x1d2>, &property_getter_adaptor<0x1d3>, &property_getter_adaptor<0x1d4>, &property_getter_adaptor<0x1d5>, &property_getter_adaptor<0x1d6>, &property_getter_adaptor<0x1d7>, - &property_getter_adaptor<0x1d8>, &property_getter_adaptor<0x1d9>, &property_getter_adaptor<0x1da>, &property_getter_adaptor<0x1db>, &property_getter_adaptor<0x1dc>, &property_getter_adaptor<0x1dd>, &property_getter_adaptor<0x1de>, &property_getter_adaptor<0x1df>, - &property_getter_adaptor<0x1e0>, &property_getter_adaptor<0x1e1>, &property_getter_adaptor<0x1e2>, &property_getter_adaptor<0x1e3>, &property_getter_adaptor<0x1e4>, &property_getter_adaptor<0x1e5>, &property_getter_adaptor<0x1e6>, &property_getter_adaptor<0x1e7>, - &property_getter_adaptor<0x1e8>, &property_getter_adaptor<0x1e9>, &property_getter_adaptor<0x1ea>, &property_getter_adaptor<0x1eb>, &property_getter_adaptor<0x1ec>, &property_getter_adaptor<0x1ed>, &property_getter_adaptor<0x1ee>, &property_getter_adaptor<0x1ef>, - &property_getter_adaptor<0x1f0>, &property_getter_adaptor<0x1f1>, &property_getter_adaptor<0x1f2>, &property_getter_adaptor<0x1f3>, &property_getter_adaptor<0x1f4>, &property_getter_adaptor<0x1f5>, &property_getter_adaptor<0x1f6>, &property_getter_adaptor<0x1f7>, - &property_getter_adaptor<0x1f8>, &property_getter_adaptor<0x1f9>, &property_getter_adaptor<0x1fa>, &property_getter_adaptor<0x1fb>, &property_getter_adaptor<0x1fc>, &property_getter_adaptor<0x1fd>, &property_getter_adaptor<0x1fe>, &property_getter_adaptor<0x1ff>, - &property_getter_adaptor<0x200>, &property_getter_adaptor<0x201>, &property_getter_adaptor<0x202>, &property_getter_adaptor<0x203>, &property_getter_adaptor<0x204>, &property_getter_adaptor<0x205>, &property_getter_adaptor<0x206>, &property_getter_adaptor<0x207>, - &property_getter_adaptor<0x208>, &property_getter_adaptor<0x209>, &property_getter_adaptor<0x20a>, &property_getter_adaptor<0x20b>, &property_getter_adaptor<0x20c>, &property_getter_adaptor<0x20d>, &property_getter_adaptor<0x20e>, &property_getter_adaptor<0x20f>, - &property_getter_adaptor<0x210>, &property_getter_adaptor<0x211>, &property_getter_adaptor<0x212>, &property_getter_adaptor<0x213>, &property_getter_adaptor<0x214>, &property_getter_adaptor<0x215>, &property_getter_adaptor<0x216>, &property_getter_adaptor<0x217>, - &property_getter_adaptor<0x218>, &property_getter_adaptor<0x219>, &property_getter_adaptor<0x21a>, &property_getter_adaptor<0x21b>, &property_getter_adaptor<0x21c>, &property_getter_adaptor<0x21d>, &property_getter_adaptor<0x21e>, &property_getter_adaptor<0x21f>, - &property_getter_adaptor<0x220>, &property_getter_adaptor<0x221>, &property_getter_adaptor<0x222>, &property_getter_adaptor<0x223>, &property_getter_adaptor<0x224>, &property_getter_adaptor<0x225>, &property_getter_adaptor<0x226>, &property_getter_adaptor<0x227>, - &property_getter_adaptor<0x228>, &property_getter_adaptor<0x229>, &property_getter_adaptor<0x22a>, &property_getter_adaptor<0x22b>, &property_getter_adaptor<0x22c>, &property_getter_adaptor<0x22d>, &property_getter_adaptor<0x22e>, &property_getter_adaptor<0x22f>, - &property_getter_adaptor<0x230>, &property_getter_adaptor<0x231>, &property_getter_adaptor<0x232>, &property_getter_adaptor<0x233>, &property_getter_adaptor<0x234>, &property_getter_adaptor<0x235>, &property_getter_adaptor<0x236>, &property_getter_adaptor<0x237>, - &property_getter_adaptor<0x238>, &property_getter_adaptor<0x239>, &property_getter_adaptor<0x23a>, &property_getter_adaptor<0x23b>, &property_getter_adaptor<0x23c>, &property_getter_adaptor<0x23d>, &property_getter_adaptor<0x23e>, &property_getter_adaptor<0x23f>, - &property_getter_adaptor<0x240>, &property_getter_adaptor<0x241>, &property_getter_adaptor<0x242>, &property_getter_adaptor<0x243>, &property_getter_adaptor<0x244>, &property_getter_adaptor<0x245>, &property_getter_adaptor<0x246>, &property_getter_adaptor<0x247>, - &property_getter_adaptor<0x248>, &property_getter_adaptor<0x249>, &property_getter_adaptor<0x24a>, &property_getter_adaptor<0x24b>, &property_getter_adaptor<0x24c>, &property_getter_adaptor<0x24d>, &property_getter_adaptor<0x24e>, &property_getter_adaptor<0x24f>, - &property_getter_adaptor<0x250>, &property_getter_adaptor<0x251>, &property_getter_adaptor<0x252>, &property_getter_adaptor<0x253>, &property_getter_adaptor<0x254>, &property_getter_adaptor<0x255>, &property_getter_adaptor<0x256>, &property_getter_adaptor<0x257>, - &property_getter_adaptor<0x258>, &property_getter_adaptor<0x259>, &property_getter_adaptor<0x25a>, &property_getter_adaptor<0x25b>, &property_getter_adaptor<0x25c>, &property_getter_adaptor<0x25d>, &property_getter_adaptor<0x25e>, &property_getter_adaptor<0x25f>, - &property_getter_adaptor<0x260>, &property_getter_adaptor<0x261>, &property_getter_adaptor<0x262>, &property_getter_adaptor<0x263>, &property_getter_adaptor<0x264>, &property_getter_adaptor<0x265>, &property_getter_adaptor<0x266>, &property_getter_adaptor<0x267>, - &property_getter_adaptor<0x268>, &property_getter_adaptor<0x269>, &property_getter_adaptor<0x26a>, &property_getter_adaptor<0x26b>, &property_getter_adaptor<0x26c>, &property_getter_adaptor<0x26d>, &property_getter_adaptor<0x26e>, &property_getter_adaptor<0x26f>, - &property_getter_adaptor<0x270>, &property_getter_adaptor<0x271>, &property_getter_adaptor<0x272>, &property_getter_adaptor<0x273>, &property_getter_adaptor<0x274>, &property_getter_adaptor<0x275>, &property_getter_adaptor<0x276>, &property_getter_adaptor<0x277>, - &property_getter_adaptor<0x278>, &property_getter_adaptor<0x279>, &property_getter_adaptor<0x27a>, &property_getter_adaptor<0x27b>, &property_getter_adaptor<0x27c>, &property_getter_adaptor<0x27d>, &property_getter_adaptor<0x27e>, &property_getter_adaptor<0x27f>, - &property_getter_adaptor<0x280>, &property_getter_adaptor<0x281>, &property_getter_adaptor<0x282>, &property_getter_adaptor<0x283>, &property_getter_adaptor<0x284>, &property_getter_adaptor<0x285>, &property_getter_adaptor<0x286>, &property_getter_adaptor<0x287>, - &property_getter_adaptor<0x288>, &property_getter_adaptor<0x289>, &property_getter_adaptor<0x28a>, &property_getter_adaptor<0x28b>, &property_getter_adaptor<0x28c>, &property_getter_adaptor<0x28d>, &property_getter_adaptor<0x28e>, &property_getter_adaptor<0x28f>, - &property_getter_adaptor<0x290>, &property_getter_adaptor<0x291>, &property_getter_adaptor<0x292>, &property_getter_adaptor<0x293>, &property_getter_adaptor<0x294>, &property_getter_adaptor<0x295>, &property_getter_adaptor<0x296>, &property_getter_adaptor<0x297>, - &property_getter_adaptor<0x298>, &property_getter_adaptor<0x299>, &property_getter_adaptor<0x29a>, &property_getter_adaptor<0x29b>, &property_getter_adaptor<0x29c>, &property_getter_adaptor<0x29d>, &property_getter_adaptor<0x29e>, &property_getter_adaptor<0x29f>, - &property_getter_adaptor<0x2a0>, &property_getter_adaptor<0x2a1>, &property_getter_adaptor<0x2a2>, &property_getter_adaptor<0x2a3>, &property_getter_adaptor<0x2a4>, &property_getter_adaptor<0x2a5>, &property_getter_adaptor<0x2a6>, &property_getter_adaptor<0x2a7>, - &property_getter_adaptor<0x2a8>, &property_getter_adaptor<0x2a9>, &property_getter_adaptor<0x2aa>, &property_getter_adaptor<0x2ab>, &property_getter_adaptor<0x2ac>, &property_getter_adaptor<0x2ad>, &property_getter_adaptor<0x2ae>, &property_getter_adaptor<0x2af>, - &property_getter_adaptor<0x2b0>, &property_getter_adaptor<0x2b1>, &property_getter_adaptor<0x2b2>, &property_getter_adaptor<0x2b3>, &property_getter_adaptor<0x2b4>, &property_getter_adaptor<0x2b5>, &property_getter_adaptor<0x2b6>, &property_getter_adaptor<0x2b7>, - &property_getter_adaptor<0x2b8>, &property_getter_adaptor<0x2b9>, &property_getter_adaptor<0x2ba>, &property_getter_adaptor<0x2bb>, &property_getter_adaptor<0x2bc>, &property_getter_adaptor<0x2bd>, &property_getter_adaptor<0x2be>, &property_getter_adaptor<0x2bf>, - &property_getter_adaptor<0x2c0>, &property_getter_adaptor<0x2c1>, &property_getter_adaptor<0x2c2>, &property_getter_adaptor<0x2c3>, &property_getter_adaptor<0x2c4>, &property_getter_adaptor<0x2c5>, &property_getter_adaptor<0x2c6>, &property_getter_adaptor<0x2c7>, - &property_getter_adaptor<0x2c8>, &property_getter_adaptor<0x2c9>, &property_getter_adaptor<0x2ca>, &property_getter_adaptor<0x2cb>, &property_getter_adaptor<0x2cc>, &property_getter_adaptor<0x2cd>, &property_getter_adaptor<0x2ce>, &property_getter_adaptor<0x2cf>, - &property_getter_adaptor<0x2d0>, &property_getter_adaptor<0x2d1>, &property_getter_adaptor<0x2d2>, &property_getter_adaptor<0x2d3>, &property_getter_adaptor<0x2d4>, &property_getter_adaptor<0x2d5>, &property_getter_adaptor<0x2d6>, &property_getter_adaptor<0x2d7>, - &property_getter_adaptor<0x2d8>, &property_getter_adaptor<0x2d9>, &property_getter_adaptor<0x2da>, &property_getter_adaptor<0x2db>, &property_getter_adaptor<0x2dc>, &property_getter_adaptor<0x2dd>, &property_getter_adaptor<0x2de>, &property_getter_adaptor<0x2df>, - &property_getter_adaptor<0x2e0>, &property_getter_adaptor<0x2e1>, &property_getter_adaptor<0x2e2>, &property_getter_adaptor<0x2e3>, &property_getter_adaptor<0x2e4>, &property_getter_adaptor<0x2e5>, &property_getter_adaptor<0x2e6>, &property_getter_adaptor<0x2e7>, - &property_getter_adaptor<0x2e8>, &property_getter_adaptor<0x2e9>, &property_getter_adaptor<0x2ea>, &property_getter_adaptor<0x2eb>, &property_getter_adaptor<0x2ec>, &property_getter_adaptor<0x2ed>, &property_getter_adaptor<0x2ee>, &property_getter_adaptor<0x2ef>, - &property_getter_adaptor<0x2f0>, &property_getter_adaptor<0x2f1>, &property_getter_adaptor<0x2f2>, &property_getter_adaptor<0x2f3>, &property_getter_adaptor<0x2f4>, &property_getter_adaptor<0x2f5>, &property_getter_adaptor<0x2f6>, &property_getter_adaptor<0x2f7>, - &property_getter_adaptor<0x2f8>, &property_getter_adaptor<0x2f9>, &property_getter_adaptor<0x2fa>, &property_getter_adaptor<0x2fb>, &property_getter_adaptor<0x2fc>, &property_getter_adaptor<0x2fd>, &property_getter_adaptor<0x2fe>, &property_getter_adaptor<0x2ff>, - &property_getter_adaptor<0x300>, &property_getter_adaptor<0x301>, &property_getter_adaptor<0x302>, &property_getter_adaptor<0x303>, &property_getter_adaptor<0x304>, &property_getter_adaptor<0x305>, &property_getter_adaptor<0x306>, &property_getter_adaptor<0x307>, - &property_getter_adaptor<0x308>, &property_getter_adaptor<0x309>, &property_getter_adaptor<0x30a>, &property_getter_adaptor<0x30b>, &property_getter_adaptor<0x30c>, &property_getter_adaptor<0x30d>, &property_getter_adaptor<0x30e>, &property_getter_adaptor<0x30f>, - &property_getter_adaptor<0x310>, &property_getter_adaptor<0x311>, &property_getter_adaptor<0x312>, &property_getter_adaptor<0x313>, &property_getter_adaptor<0x314>, &property_getter_adaptor<0x315>, &property_getter_adaptor<0x316>, &property_getter_adaptor<0x317>, - &property_getter_adaptor<0x318>, &property_getter_adaptor<0x319>, &property_getter_adaptor<0x31a>, &property_getter_adaptor<0x31b>, &property_getter_adaptor<0x31c>, &property_getter_adaptor<0x31d>, &property_getter_adaptor<0x31e>, &property_getter_adaptor<0x31f>, - &property_getter_adaptor<0x320>, &property_getter_adaptor<0x321>, &property_getter_adaptor<0x322>, &property_getter_adaptor<0x323>, &property_getter_adaptor<0x324>, &property_getter_adaptor<0x325>, &property_getter_adaptor<0x326>, &property_getter_adaptor<0x327>, - &property_getter_adaptor<0x328>, &property_getter_adaptor<0x329>, &property_getter_adaptor<0x32a>, &property_getter_adaptor<0x32b>, &property_getter_adaptor<0x32c>, &property_getter_adaptor<0x32d>, &property_getter_adaptor<0x32e>, &property_getter_adaptor<0x32f>, - &property_getter_adaptor<0x330>, &property_getter_adaptor<0x331>, &property_getter_adaptor<0x332>, &property_getter_adaptor<0x333>, &property_getter_adaptor<0x334>, &property_getter_adaptor<0x335>, &property_getter_adaptor<0x336>, &property_getter_adaptor<0x337>, - &property_getter_adaptor<0x338>, &property_getter_adaptor<0x339>, &property_getter_adaptor<0x33a>, &property_getter_adaptor<0x33b>, &property_getter_adaptor<0x33c>, &property_getter_adaptor<0x33d>, &property_getter_adaptor<0x33e>, &property_getter_adaptor<0x33f>, - &property_getter_adaptor<0x340>, &property_getter_adaptor<0x341>, &property_getter_adaptor<0x342>, &property_getter_adaptor<0x343>, &property_getter_adaptor<0x344>, &property_getter_adaptor<0x345>, &property_getter_adaptor<0x346>, &property_getter_adaptor<0x347>, - &property_getter_adaptor<0x348>, &property_getter_adaptor<0x349>, &property_getter_adaptor<0x34a>, &property_getter_adaptor<0x34b>, &property_getter_adaptor<0x34c>, &property_getter_adaptor<0x34d>, &property_getter_adaptor<0x34e>, &property_getter_adaptor<0x34f>, - &property_getter_adaptor<0x350>, &property_getter_adaptor<0x351>, &property_getter_adaptor<0x352>, &property_getter_adaptor<0x353>, &property_getter_adaptor<0x354>, &property_getter_adaptor<0x355>, &property_getter_adaptor<0x356>, &property_getter_adaptor<0x357>, - &property_getter_adaptor<0x358>, &property_getter_adaptor<0x359>, &property_getter_adaptor<0x35a>, &property_getter_adaptor<0x35b>, &property_getter_adaptor<0x35c>, &property_getter_adaptor<0x35d>, &property_getter_adaptor<0x35e>, &property_getter_adaptor<0x35f>, - &property_getter_adaptor<0x360>, &property_getter_adaptor<0x361>, &property_getter_adaptor<0x362>, &property_getter_adaptor<0x363>, &property_getter_adaptor<0x364>, &property_getter_adaptor<0x365>, &property_getter_adaptor<0x366>, &property_getter_adaptor<0x367>, - &property_getter_adaptor<0x368>, &property_getter_adaptor<0x369>, &property_getter_adaptor<0x36a>, &property_getter_adaptor<0x36b>, &property_getter_adaptor<0x36c>, &property_getter_adaptor<0x36d>, &property_getter_adaptor<0x36e>, &property_getter_adaptor<0x36f>, - &property_getter_adaptor<0x370>, &property_getter_adaptor<0x371>, &property_getter_adaptor<0x372>, &property_getter_adaptor<0x373>, &property_getter_adaptor<0x374>, &property_getter_adaptor<0x375>, &property_getter_adaptor<0x376>, &property_getter_adaptor<0x377>, - &property_getter_adaptor<0x378>, &property_getter_adaptor<0x379>, &property_getter_adaptor<0x37a>, &property_getter_adaptor<0x37b>, &property_getter_adaptor<0x37c>, &property_getter_adaptor<0x37d>, &property_getter_adaptor<0x37e>, &property_getter_adaptor<0x37f>, - &property_getter_adaptor<0x380>, &property_getter_adaptor<0x381>, &property_getter_adaptor<0x382>, &property_getter_adaptor<0x383>, &property_getter_adaptor<0x384>, &property_getter_adaptor<0x385>, &property_getter_adaptor<0x386>, &property_getter_adaptor<0x387>, - &property_getter_adaptor<0x388>, &property_getter_adaptor<0x389>, &property_getter_adaptor<0x38a>, &property_getter_adaptor<0x38b>, &property_getter_adaptor<0x38c>, &property_getter_adaptor<0x38d>, &property_getter_adaptor<0x38e>, &property_getter_adaptor<0x38f>, - &property_getter_adaptor<0x390>, &property_getter_adaptor<0x391>, &property_getter_adaptor<0x392>, &property_getter_adaptor<0x393>, &property_getter_adaptor<0x394>, &property_getter_adaptor<0x395>, &property_getter_adaptor<0x396>, &property_getter_adaptor<0x397>, - &property_getter_adaptor<0x398>, &property_getter_adaptor<0x399>, &property_getter_adaptor<0x39a>, &property_getter_adaptor<0x39b>, &property_getter_adaptor<0x39c>, &property_getter_adaptor<0x39d>, &property_getter_adaptor<0x39e>, &property_getter_adaptor<0x39f>, - &property_getter_adaptor<0x3a0>, &property_getter_adaptor<0x3a1>, &property_getter_adaptor<0x3a2>, &property_getter_adaptor<0x3a3>, &property_getter_adaptor<0x3a4>, &property_getter_adaptor<0x3a5>, &property_getter_adaptor<0x3a6>, &property_getter_adaptor<0x3a7>, - &property_getter_adaptor<0x3a8>, &property_getter_adaptor<0x3a9>, &property_getter_adaptor<0x3aa>, &property_getter_adaptor<0x3ab>, &property_getter_adaptor<0x3ac>, &property_getter_adaptor<0x3ad>, &property_getter_adaptor<0x3ae>, &property_getter_adaptor<0x3af>, - &property_getter_adaptor<0x3b0>, &property_getter_adaptor<0x3b1>, &property_getter_adaptor<0x3b2>, &property_getter_adaptor<0x3b3>, &property_getter_adaptor<0x3b4>, &property_getter_adaptor<0x3b5>, &property_getter_adaptor<0x3b6>, &property_getter_adaptor<0x3b7>, - &property_getter_adaptor<0x3b8>, &property_getter_adaptor<0x3b9>, &property_getter_adaptor<0x3ba>, &property_getter_adaptor<0x3bb>, &property_getter_adaptor<0x3bc>, &property_getter_adaptor<0x3bd>, &property_getter_adaptor<0x3be>, &property_getter_adaptor<0x3bf>, - &property_getter_adaptor<0x3c0>, &property_getter_adaptor<0x3c1>, &property_getter_adaptor<0x3c2>, &property_getter_adaptor<0x3c3>, &property_getter_adaptor<0x3c4>, &property_getter_adaptor<0x3c5>, &property_getter_adaptor<0x3c6>, &property_getter_adaptor<0x3c7>, - &property_getter_adaptor<0x3c8>, &property_getter_adaptor<0x3c9>, &property_getter_adaptor<0x3ca>, &property_getter_adaptor<0x3cb>, &property_getter_adaptor<0x3cc>, &property_getter_adaptor<0x3cd>, &property_getter_adaptor<0x3ce>, &property_getter_adaptor<0x3cf>, - &property_getter_adaptor<0x3d0>, &property_getter_adaptor<0x3d1>, &property_getter_adaptor<0x3d2>, &property_getter_adaptor<0x3d3>, &property_getter_adaptor<0x3d4>, &property_getter_adaptor<0x3d5>, &property_getter_adaptor<0x3d6>, &property_getter_adaptor<0x3d7>, - &property_getter_adaptor<0x3d8>, &property_getter_adaptor<0x3d9>, &property_getter_adaptor<0x3da>, &property_getter_adaptor<0x3db>, &property_getter_adaptor<0x3dc>, &property_getter_adaptor<0x3dd>, &property_getter_adaptor<0x3de>, &property_getter_adaptor<0x3df>, - &property_getter_adaptor<0x3e0>, &property_getter_adaptor<0x3e1>, &property_getter_adaptor<0x3e2>, &property_getter_adaptor<0x3e3>, &property_getter_adaptor<0x3e4>, &property_getter_adaptor<0x3e5>, &property_getter_adaptor<0x3e6>, &property_getter_adaptor<0x3e7>, - &property_getter_adaptor<0x3e8>, &property_getter_adaptor<0x3e9>, &property_getter_adaptor<0x3ea>, &property_getter_adaptor<0x3eb>, &property_getter_adaptor<0x3ec>, &property_getter_adaptor<0x3ed>, &property_getter_adaptor<0x3ee>, &property_getter_adaptor<0x3ef>, - &property_getter_adaptor<0x3f0>, &property_getter_adaptor<0x3f1>, &property_getter_adaptor<0x3f2>, &property_getter_adaptor<0x3f3>, &property_getter_adaptor<0x3f4>, &property_getter_adaptor<0x3f5>, &property_getter_adaptor<0x3f6>, &property_getter_adaptor<0x3f7>, - &property_getter_adaptor<0x3f8>, &property_getter_adaptor<0x3f9>, &property_getter_adaptor<0x3fa>, &property_getter_adaptor<0x3fb>, &property_getter_adaptor<0x3fc>, &property_getter_adaptor<0x3fd>, &property_getter_adaptor<0x3fe>, &property_getter_adaptor<0x3ff>, -}; - -static PyObject *property_setter_impl (int mid, PyObject *self, PyObject *value); - -static PyObject * -property_setter_adaptor (int mid, PyObject *self, PyObject *args) -{ - PyObject *ret = NULL; - - PYA_TRY - - int argc = args == NULL ? 0 : int (PyTuple_Size (args)); - if (argc != 1) { - throw tl::Exception (tl::to_string (tr ("Property setter needs exactly one argument"))); - } - - PyObject *value = PyTuple_GetItem (args, 0); - if (value) { - ret = property_setter_impl (mid, self, value); - } - - PYA_CATCH(property_name_from_id (mid, self)) - - return ret; -} - -template -PyObject *property_setter_adaptor (PyObject *self, PyObject *args) -{ - return property_setter_adaptor (N, self, args); -} - -PyObject *(*(property_setter_adaptors [])) (PyObject *self, PyObject *args) = -{ - &property_setter_adaptor<0x000>, &property_setter_adaptor<0x001>, &property_setter_adaptor<0x002>, &property_setter_adaptor<0x003>, &property_setter_adaptor<0x004>, &property_setter_adaptor<0x005>, &property_setter_adaptor<0x006>, &property_setter_adaptor<0x007>, - &property_setter_adaptor<0x008>, &property_setter_adaptor<0x009>, &property_setter_adaptor<0x00a>, &property_setter_adaptor<0x00b>, &property_setter_adaptor<0x00c>, &property_setter_adaptor<0x00d>, &property_setter_adaptor<0x00e>, &property_setter_adaptor<0x00f>, - &property_setter_adaptor<0x010>, &property_setter_adaptor<0x011>, &property_setter_adaptor<0x012>, &property_setter_adaptor<0x013>, &property_setter_adaptor<0x014>, &property_setter_adaptor<0x015>, &property_setter_adaptor<0x016>, &property_setter_adaptor<0x017>, - &property_setter_adaptor<0x018>, &property_setter_adaptor<0x019>, &property_setter_adaptor<0x01a>, &property_setter_adaptor<0x01b>, &property_setter_adaptor<0x01c>, &property_setter_adaptor<0x01d>, &property_setter_adaptor<0x01e>, &property_setter_adaptor<0x01f>, - &property_setter_adaptor<0x020>, &property_setter_adaptor<0x021>, &property_setter_adaptor<0x022>, &property_setter_adaptor<0x023>, &property_setter_adaptor<0x024>, &property_setter_adaptor<0x025>, &property_setter_adaptor<0x026>, &property_setter_adaptor<0x027>, - &property_setter_adaptor<0x028>, &property_setter_adaptor<0x029>, &property_setter_adaptor<0x02a>, &property_setter_adaptor<0x02b>, &property_setter_adaptor<0x02c>, &property_setter_adaptor<0x02d>, &property_setter_adaptor<0x02e>, &property_setter_adaptor<0x02f>, - &property_setter_adaptor<0x030>, &property_setter_adaptor<0x031>, &property_setter_adaptor<0x032>, &property_setter_adaptor<0x033>, &property_setter_adaptor<0x034>, &property_setter_adaptor<0x035>, &property_setter_adaptor<0x036>, &property_setter_adaptor<0x037>, - &property_setter_adaptor<0x038>, &property_setter_adaptor<0x039>, &property_setter_adaptor<0x03a>, &property_setter_adaptor<0x03b>, &property_setter_adaptor<0x03c>, &property_setter_adaptor<0x03d>, &property_setter_adaptor<0x03e>, &property_setter_adaptor<0x03f>, - &property_setter_adaptor<0x040>, &property_setter_adaptor<0x041>, &property_setter_adaptor<0x042>, &property_setter_adaptor<0x043>, &property_setter_adaptor<0x044>, &property_setter_adaptor<0x045>, &property_setter_adaptor<0x046>, &property_setter_adaptor<0x047>, - &property_setter_adaptor<0x048>, &property_setter_adaptor<0x049>, &property_setter_adaptor<0x04a>, &property_setter_adaptor<0x04b>, &property_setter_adaptor<0x04c>, &property_setter_adaptor<0x04d>, &property_setter_adaptor<0x04e>, &property_setter_adaptor<0x04f>, - &property_setter_adaptor<0x050>, &property_setter_adaptor<0x051>, &property_setter_adaptor<0x052>, &property_setter_adaptor<0x053>, &property_setter_adaptor<0x054>, &property_setter_adaptor<0x055>, &property_setter_adaptor<0x056>, &property_setter_adaptor<0x057>, - &property_setter_adaptor<0x058>, &property_setter_adaptor<0x059>, &property_setter_adaptor<0x05a>, &property_setter_adaptor<0x05b>, &property_setter_adaptor<0x05c>, &property_setter_adaptor<0x05d>, &property_setter_adaptor<0x05e>, &property_setter_adaptor<0x05f>, - &property_setter_adaptor<0x060>, &property_setter_adaptor<0x061>, &property_setter_adaptor<0x062>, &property_setter_adaptor<0x063>, &property_setter_adaptor<0x064>, &property_setter_adaptor<0x065>, &property_setter_adaptor<0x066>, &property_setter_adaptor<0x067>, - &property_setter_adaptor<0x068>, &property_setter_adaptor<0x069>, &property_setter_adaptor<0x06a>, &property_setter_adaptor<0x06b>, &property_setter_adaptor<0x06c>, &property_setter_adaptor<0x06d>, &property_setter_adaptor<0x06e>, &property_setter_adaptor<0x06f>, - &property_setter_adaptor<0x070>, &property_setter_adaptor<0x071>, &property_setter_adaptor<0x072>, &property_setter_adaptor<0x073>, &property_setter_adaptor<0x074>, &property_setter_adaptor<0x075>, &property_setter_adaptor<0x076>, &property_setter_adaptor<0x077>, - &property_setter_adaptor<0x078>, &property_setter_adaptor<0x079>, &property_setter_adaptor<0x07a>, &property_setter_adaptor<0x07b>, &property_setter_adaptor<0x07c>, &property_setter_adaptor<0x07d>, &property_setter_adaptor<0x07e>, &property_setter_adaptor<0x07f>, - &property_setter_adaptor<0x080>, &property_setter_adaptor<0x081>, &property_setter_adaptor<0x082>, &property_setter_adaptor<0x083>, &property_setter_adaptor<0x084>, &property_setter_adaptor<0x085>, &property_setter_adaptor<0x086>, &property_setter_adaptor<0x087>, - &property_setter_adaptor<0x088>, &property_setter_adaptor<0x089>, &property_setter_adaptor<0x08a>, &property_setter_adaptor<0x08b>, &property_setter_adaptor<0x08c>, &property_setter_adaptor<0x08d>, &property_setter_adaptor<0x08e>, &property_setter_adaptor<0x08f>, - &property_setter_adaptor<0x090>, &property_setter_adaptor<0x091>, &property_setter_adaptor<0x092>, &property_setter_adaptor<0x093>, &property_setter_adaptor<0x094>, &property_setter_adaptor<0x095>, &property_setter_adaptor<0x096>, &property_setter_adaptor<0x097>, - &property_setter_adaptor<0x098>, &property_setter_adaptor<0x099>, &property_setter_adaptor<0x09a>, &property_setter_adaptor<0x09b>, &property_setter_adaptor<0x09c>, &property_setter_adaptor<0x09d>, &property_setter_adaptor<0x09e>, &property_setter_adaptor<0x09f>, - &property_setter_adaptor<0x0a0>, &property_setter_adaptor<0x0a1>, &property_setter_adaptor<0x0a2>, &property_setter_adaptor<0x0a3>, &property_setter_adaptor<0x0a4>, &property_setter_adaptor<0x0a5>, &property_setter_adaptor<0x0a6>, &property_setter_adaptor<0x0a7>, - &property_setter_adaptor<0x0a8>, &property_setter_adaptor<0x0a9>, &property_setter_adaptor<0x0aa>, &property_setter_adaptor<0x0ab>, &property_setter_adaptor<0x0ac>, &property_setter_adaptor<0x0ad>, &property_setter_adaptor<0x0ae>, &property_setter_adaptor<0x0af>, - &property_setter_adaptor<0x0b0>, &property_setter_adaptor<0x0b1>, &property_setter_adaptor<0x0b2>, &property_setter_adaptor<0x0b3>, &property_setter_adaptor<0x0b4>, &property_setter_adaptor<0x0b5>, &property_setter_adaptor<0x0b6>, &property_setter_adaptor<0x0b7>, - &property_setter_adaptor<0x0b8>, &property_setter_adaptor<0x0b9>, &property_setter_adaptor<0x0ba>, &property_setter_adaptor<0x0bb>, &property_setter_adaptor<0x0bc>, &property_setter_adaptor<0x0bd>, &property_setter_adaptor<0x0be>, &property_setter_adaptor<0x0bf>, - &property_setter_adaptor<0x0c0>, &property_setter_adaptor<0x0c1>, &property_setter_adaptor<0x0c2>, &property_setter_adaptor<0x0c3>, &property_setter_adaptor<0x0c4>, &property_setter_adaptor<0x0c5>, &property_setter_adaptor<0x0c6>, &property_setter_adaptor<0x0c7>, - &property_setter_adaptor<0x0c8>, &property_setter_adaptor<0x0c9>, &property_setter_adaptor<0x0ca>, &property_setter_adaptor<0x0cb>, &property_setter_adaptor<0x0cc>, &property_setter_adaptor<0x0cd>, &property_setter_adaptor<0x0ce>, &property_setter_adaptor<0x0cf>, - &property_setter_adaptor<0x0d0>, &property_setter_adaptor<0x0d1>, &property_setter_adaptor<0x0d2>, &property_setter_adaptor<0x0d3>, &property_setter_adaptor<0x0d4>, &property_setter_adaptor<0x0d5>, &property_setter_adaptor<0x0d6>, &property_setter_adaptor<0x0d7>, - &property_setter_adaptor<0x0d8>, &property_setter_adaptor<0x0d9>, &property_setter_adaptor<0x0da>, &property_setter_adaptor<0x0db>, &property_setter_adaptor<0x0dc>, &property_setter_adaptor<0x0dd>, &property_setter_adaptor<0x0de>, &property_setter_adaptor<0x0df>, - &property_setter_adaptor<0x0e0>, &property_setter_adaptor<0x0e1>, &property_setter_adaptor<0x0e2>, &property_setter_adaptor<0x0e3>, &property_setter_adaptor<0x0e4>, &property_setter_adaptor<0x0e5>, &property_setter_adaptor<0x0e6>, &property_setter_adaptor<0x0e7>, - &property_setter_adaptor<0x0e8>, &property_setter_adaptor<0x0e9>, &property_setter_adaptor<0x0ea>, &property_setter_adaptor<0x0eb>, &property_setter_adaptor<0x0ec>, &property_setter_adaptor<0x0ed>, &property_setter_adaptor<0x0ee>, &property_setter_adaptor<0x0ef>, - &property_setter_adaptor<0x0f0>, &property_setter_adaptor<0x0f1>, &property_setter_adaptor<0x0f2>, &property_setter_adaptor<0x0f3>, &property_setter_adaptor<0x0f4>, &property_setter_adaptor<0x0f5>, &property_setter_adaptor<0x0f6>, &property_setter_adaptor<0x0f7>, - &property_setter_adaptor<0x0f8>, &property_setter_adaptor<0x0f9>, &property_setter_adaptor<0x0fa>, &property_setter_adaptor<0x0fb>, &property_setter_adaptor<0x0fc>, &property_setter_adaptor<0x0fd>, &property_setter_adaptor<0x0fe>, &property_setter_adaptor<0x0ff>, - &property_setter_adaptor<0x100>, &property_setter_adaptor<0x101>, &property_setter_adaptor<0x102>, &property_setter_adaptor<0x103>, &property_setter_adaptor<0x104>, &property_setter_adaptor<0x105>, &property_setter_adaptor<0x106>, &property_setter_adaptor<0x107>, - &property_setter_adaptor<0x108>, &property_setter_adaptor<0x109>, &property_setter_adaptor<0x10a>, &property_setter_adaptor<0x10b>, &property_setter_adaptor<0x10c>, &property_setter_adaptor<0x10d>, &property_setter_adaptor<0x10e>, &property_setter_adaptor<0x10f>, - &property_setter_adaptor<0x110>, &property_setter_adaptor<0x111>, &property_setter_adaptor<0x112>, &property_setter_adaptor<0x113>, &property_setter_adaptor<0x114>, &property_setter_adaptor<0x115>, &property_setter_adaptor<0x116>, &property_setter_adaptor<0x117>, - &property_setter_adaptor<0x118>, &property_setter_adaptor<0x119>, &property_setter_adaptor<0x11a>, &property_setter_adaptor<0x11b>, &property_setter_adaptor<0x11c>, &property_setter_adaptor<0x11d>, &property_setter_adaptor<0x11e>, &property_setter_adaptor<0x11f>, - &property_setter_adaptor<0x120>, &property_setter_adaptor<0x121>, &property_setter_adaptor<0x122>, &property_setter_adaptor<0x123>, &property_setter_adaptor<0x124>, &property_setter_adaptor<0x125>, &property_setter_adaptor<0x126>, &property_setter_adaptor<0x127>, - &property_setter_adaptor<0x128>, &property_setter_adaptor<0x129>, &property_setter_adaptor<0x12a>, &property_setter_adaptor<0x12b>, &property_setter_adaptor<0x12c>, &property_setter_adaptor<0x12d>, &property_setter_adaptor<0x12e>, &property_setter_adaptor<0x12f>, - &property_setter_adaptor<0x130>, &property_setter_adaptor<0x131>, &property_setter_adaptor<0x132>, &property_setter_adaptor<0x133>, &property_setter_adaptor<0x134>, &property_setter_adaptor<0x135>, &property_setter_adaptor<0x136>, &property_setter_adaptor<0x137>, - &property_setter_adaptor<0x138>, &property_setter_adaptor<0x139>, &property_setter_adaptor<0x13a>, &property_setter_adaptor<0x13b>, &property_setter_adaptor<0x13c>, &property_setter_adaptor<0x13d>, &property_setter_adaptor<0x13e>, &property_setter_adaptor<0x13f>, - &property_setter_adaptor<0x140>, &property_setter_adaptor<0x141>, &property_setter_adaptor<0x142>, &property_setter_adaptor<0x143>, &property_setter_adaptor<0x144>, &property_setter_adaptor<0x145>, &property_setter_adaptor<0x146>, &property_setter_adaptor<0x147>, - &property_setter_adaptor<0x148>, &property_setter_adaptor<0x149>, &property_setter_adaptor<0x14a>, &property_setter_adaptor<0x14b>, &property_setter_adaptor<0x14c>, &property_setter_adaptor<0x14d>, &property_setter_adaptor<0x14e>, &property_setter_adaptor<0x14f>, - &property_setter_adaptor<0x150>, &property_setter_adaptor<0x151>, &property_setter_adaptor<0x152>, &property_setter_adaptor<0x153>, &property_setter_adaptor<0x154>, &property_setter_adaptor<0x155>, &property_setter_adaptor<0x156>, &property_setter_adaptor<0x157>, - &property_setter_adaptor<0x158>, &property_setter_adaptor<0x159>, &property_setter_adaptor<0x15a>, &property_setter_adaptor<0x15b>, &property_setter_adaptor<0x15c>, &property_setter_adaptor<0x15d>, &property_setter_adaptor<0x15e>, &property_setter_adaptor<0x15f>, - &property_setter_adaptor<0x160>, &property_setter_adaptor<0x161>, &property_setter_adaptor<0x162>, &property_setter_adaptor<0x163>, &property_setter_adaptor<0x164>, &property_setter_adaptor<0x165>, &property_setter_adaptor<0x166>, &property_setter_adaptor<0x167>, - &property_setter_adaptor<0x168>, &property_setter_adaptor<0x169>, &property_setter_adaptor<0x16a>, &property_setter_adaptor<0x16b>, &property_setter_adaptor<0x16c>, &property_setter_adaptor<0x16d>, &property_setter_adaptor<0x16e>, &property_setter_adaptor<0x16f>, - &property_setter_adaptor<0x170>, &property_setter_adaptor<0x171>, &property_setter_adaptor<0x172>, &property_setter_adaptor<0x173>, &property_setter_adaptor<0x174>, &property_setter_adaptor<0x175>, &property_setter_adaptor<0x176>, &property_setter_adaptor<0x177>, - &property_setter_adaptor<0x178>, &property_setter_adaptor<0x179>, &property_setter_adaptor<0x17a>, &property_setter_adaptor<0x17b>, &property_setter_adaptor<0x17c>, &property_setter_adaptor<0x17d>, &property_setter_adaptor<0x17e>, &property_setter_adaptor<0x17f>, - &property_setter_adaptor<0x180>, &property_setter_adaptor<0x181>, &property_setter_adaptor<0x182>, &property_setter_adaptor<0x183>, &property_setter_adaptor<0x184>, &property_setter_adaptor<0x185>, &property_setter_adaptor<0x186>, &property_setter_adaptor<0x187>, - &property_setter_adaptor<0x188>, &property_setter_adaptor<0x189>, &property_setter_adaptor<0x18a>, &property_setter_adaptor<0x18b>, &property_setter_adaptor<0x18c>, &property_setter_adaptor<0x18d>, &property_setter_adaptor<0x18e>, &property_setter_adaptor<0x18f>, - &property_setter_adaptor<0x190>, &property_setter_adaptor<0x191>, &property_setter_adaptor<0x192>, &property_setter_adaptor<0x193>, &property_setter_adaptor<0x194>, &property_setter_adaptor<0x195>, &property_setter_adaptor<0x196>, &property_setter_adaptor<0x197>, - &property_setter_adaptor<0x198>, &property_setter_adaptor<0x199>, &property_setter_adaptor<0x19a>, &property_setter_adaptor<0x19b>, &property_setter_adaptor<0x19c>, &property_setter_adaptor<0x19d>, &property_setter_adaptor<0x19e>, &property_setter_adaptor<0x19f>, - &property_setter_adaptor<0x1a0>, &property_setter_adaptor<0x1a1>, &property_setter_adaptor<0x1a2>, &property_setter_adaptor<0x1a3>, &property_setter_adaptor<0x1a4>, &property_setter_adaptor<0x1a5>, &property_setter_adaptor<0x1a6>, &property_setter_adaptor<0x1a7>, - &property_setter_adaptor<0x1a8>, &property_setter_adaptor<0x1a9>, &property_setter_adaptor<0x1aa>, &property_setter_adaptor<0x1ab>, &property_setter_adaptor<0x1ac>, &property_setter_adaptor<0x1ad>, &property_setter_adaptor<0x1ae>, &property_setter_adaptor<0x1af>, - &property_setter_adaptor<0x1b0>, &property_setter_adaptor<0x1b1>, &property_setter_adaptor<0x1b2>, &property_setter_adaptor<0x1b3>, &property_setter_adaptor<0x1b4>, &property_setter_adaptor<0x1b5>, &property_setter_adaptor<0x1b6>, &property_setter_adaptor<0x1b7>, - &property_setter_adaptor<0x1b8>, &property_setter_adaptor<0x1b9>, &property_setter_adaptor<0x1ba>, &property_setter_adaptor<0x1bb>, &property_setter_adaptor<0x1bc>, &property_setter_adaptor<0x1bd>, &property_setter_adaptor<0x1be>, &property_setter_adaptor<0x1bf>, - &property_setter_adaptor<0x1c0>, &property_setter_adaptor<0x1c1>, &property_setter_adaptor<0x1c2>, &property_setter_adaptor<0x1c3>, &property_setter_adaptor<0x1c4>, &property_setter_adaptor<0x1c5>, &property_setter_adaptor<0x1c6>, &property_setter_adaptor<0x1c7>, - &property_setter_adaptor<0x1c8>, &property_setter_adaptor<0x1c9>, &property_setter_adaptor<0x1ca>, &property_setter_adaptor<0x1cb>, &property_setter_adaptor<0x1cc>, &property_setter_adaptor<0x1cd>, &property_setter_adaptor<0x1ce>, &property_setter_adaptor<0x1cf>, - &property_setter_adaptor<0x1d0>, &property_setter_adaptor<0x1d1>, &property_setter_adaptor<0x1d2>, &property_setter_adaptor<0x1d3>, &property_setter_adaptor<0x1d4>, &property_setter_adaptor<0x1d5>, &property_setter_adaptor<0x1d6>, &property_setter_adaptor<0x1d7>, - &property_setter_adaptor<0x1d8>, &property_setter_adaptor<0x1d9>, &property_setter_adaptor<0x1da>, &property_setter_adaptor<0x1db>, &property_setter_adaptor<0x1dc>, &property_setter_adaptor<0x1dd>, &property_setter_adaptor<0x1de>, &property_setter_adaptor<0x1df>, - &property_setter_adaptor<0x1e0>, &property_setter_adaptor<0x1e1>, &property_setter_adaptor<0x1e2>, &property_setter_adaptor<0x1e3>, &property_setter_adaptor<0x1e4>, &property_setter_adaptor<0x1e5>, &property_setter_adaptor<0x1e6>, &property_setter_adaptor<0x1e7>, - &property_setter_adaptor<0x1e8>, &property_setter_adaptor<0x1e9>, &property_setter_adaptor<0x1ea>, &property_setter_adaptor<0x1eb>, &property_setter_adaptor<0x1ec>, &property_setter_adaptor<0x1ed>, &property_setter_adaptor<0x1ee>, &property_setter_adaptor<0x1ef>, - &property_setter_adaptor<0x1f0>, &property_setter_adaptor<0x1f1>, &property_setter_adaptor<0x1f2>, &property_setter_adaptor<0x1f3>, &property_setter_adaptor<0x1f4>, &property_setter_adaptor<0x1f5>, &property_setter_adaptor<0x1f6>, &property_setter_adaptor<0x1f7>, - &property_setter_adaptor<0x1f8>, &property_setter_adaptor<0x1f9>, &property_setter_adaptor<0x1fa>, &property_setter_adaptor<0x1fb>, &property_setter_adaptor<0x1fc>, &property_setter_adaptor<0x1fd>, &property_setter_adaptor<0x1fe>, &property_setter_adaptor<0x1ff>, - &property_setter_adaptor<0x200>, &property_setter_adaptor<0x201>, &property_setter_adaptor<0x202>, &property_setter_adaptor<0x203>, &property_setter_adaptor<0x204>, &property_setter_adaptor<0x205>, &property_setter_adaptor<0x206>, &property_setter_adaptor<0x207>, - &property_setter_adaptor<0x208>, &property_setter_adaptor<0x209>, &property_setter_adaptor<0x20a>, &property_setter_adaptor<0x20b>, &property_setter_adaptor<0x20c>, &property_setter_adaptor<0x20d>, &property_setter_adaptor<0x20e>, &property_setter_adaptor<0x20f>, - &property_setter_adaptor<0x210>, &property_setter_adaptor<0x211>, &property_setter_adaptor<0x212>, &property_setter_adaptor<0x213>, &property_setter_adaptor<0x214>, &property_setter_adaptor<0x215>, &property_setter_adaptor<0x216>, &property_setter_adaptor<0x217>, - &property_setter_adaptor<0x218>, &property_setter_adaptor<0x219>, &property_setter_adaptor<0x21a>, &property_setter_adaptor<0x21b>, &property_setter_adaptor<0x21c>, &property_setter_adaptor<0x21d>, &property_setter_adaptor<0x21e>, &property_setter_adaptor<0x21f>, - &property_setter_adaptor<0x220>, &property_setter_adaptor<0x221>, &property_setter_adaptor<0x222>, &property_setter_adaptor<0x223>, &property_setter_adaptor<0x224>, &property_setter_adaptor<0x225>, &property_setter_adaptor<0x226>, &property_setter_adaptor<0x227>, - &property_setter_adaptor<0x228>, &property_setter_adaptor<0x229>, &property_setter_adaptor<0x22a>, &property_setter_adaptor<0x22b>, &property_setter_adaptor<0x22c>, &property_setter_adaptor<0x22d>, &property_setter_adaptor<0x22e>, &property_setter_adaptor<0x22f>, - &property_setter_adaptor<0x230>, &property_setter_adaptor<0x231>, &property_setter_adaptor<0x232>, &property_setter_adaptor<0x233>, &property_setter_adaptor<0x234>, &property_setter_adaptor<0x235>, &property_setter_adaptor<0x236>, &property_setter_adaptor<0x237>, - &property_setter_adaptor<0x238>, &property_setter_adaptor<0x239>, &property_setter_adaptor<0x23a>, &property_setter_adaptor<0x23b>, &property_setter_adaptor<0x23c>, &property_setter_adaptor<0x23d>, &property_setter_adaptor<0x23e>, &property_setter_adaptor<0x23f>, - &property_setter_adaptor<0x240>, &property_setter_adaptor<0x241>, &property_setter_adaptor<0x242>, &property_setter_adaptor<0x243>, &property_setter_adaptor<0x244>, &property_setter_adaptor<0x245>, &property_setter_adaptor<0x246>, &property_setter_adaptor<0x247>, - &property_setter_adaptor<0x248>, &property_setter_adaptor<0x249>, &property_setter_adaptor<0x24a>, &property_setter_adaptor<0x24b>, &property_setter_adaptor<0x24c>, &property_setter_adaptor<0x24d>, &property_setter_adaptor<0x24e>, &property_setter_adaptor<0x24f>, - &property_setter_adaptor<0x250>, &property_setter_adaptor<0x251>, &property_setter_adaptor<0x252>, &property_setter_adaptor<0x253>, &property_setter_adaptor<0x254>, &property_setter_adaptor<0x255>, &property_setter_adaptor<0x256>, &property_setter_adaptor<0x257>, - &property_setter_adaptor<0x258>, &property_setter_adaptor<0x259>, &property_setter_adaptor<0x25a>, &property_setter_adaptor<0x25b>, &property_setter_adaptor<0x25c>, &property_setter_adaptor<0x25d>, &property_setter_adaptor<0x25e>, &property_setter_adaptor<0x25f>, - &property_setter_adaptor<0x260>, &property_setter_adaptor<0x261>, &property_setter_adaptor<0x262>, &property_setter_adaptor<0x263>, &property_setter_adaptor<0x264>, &property_setter_adaptor<0x265>, &property_setter_adaptor<0x266>, &property_setter_adaptor<0x267>, - &property_setter_adaptor<0x268>, &property_setter_adaptor<0x269>, &property_setter_adaptor<0x26a>, &property_setter_adaptor<0x26b>, &property_setter_adaptor<0x26c>, &property_setter_adaptor<0x26d>, &property_setter_adaptor<0x26e>, &property_setter_adaptor<0x26f>, - &property_setter_adaptor<0x270>, &property_setter_adaptor<0x271>, &property_setter_adaptor<0x272>, &property_setter_adaptor<0x273>, &property_setter_adaptor<0x274>, &property_setter_adaptor<0x275>, &property_setter_adaptor<0x276>, &property_setter_adaptor<0x277>, - &property_setter_adaptor<0x278>, &property_setter_adaptor<0x279>, &property_setter_adaptor<0x27a>, &property_setter_adaptor<0x27b>, &property_setter_adaptor<0x27c>, &property_setter_adaptor<0x27d>, &property_setter_adaptor<0x27e>, &property_setter_adaptor<0x27f>, - &property_setter_adaptor<0x280>, &property_setter_adaptor<0x281>, &property_setter_adaptor<0x282>, &property_setter_adaptor<0x283>, &property_setter_adaptor<0x284>, &property_setter_adaptor<0x285>, &property_setter_adaptor<0x286>, &property_setter_adaptor<0x287>, - &property_setter_adaptor<0x288>, &property_setter_adaptor<0x289>, &property_setter_adaptor<0x28a>, &property_setter_adaptor<0x28b>, &property_setter_adaptor<0x28c>, &property_setter_adaptor<0x28d>, &property_setter_adaptor<0x28e>, &property_setter_adaptor<0x28f>, - &property_setter_adaptor<0x290>, &property_setter_adaptor<0x291>, &property_setter_adaptor<0x292>, &property_setter_adaptor<0x293>, &property_setter_adaptor<0x294>, &property_setter_adaptor<0x295>, &property_setter_adaptor<0x296>, &property_setter_adaptor<0x297>, - &property_setter_adaptor<0x298>, &property_setter_adaptor<0x299>, &property_setter_adaptor<0x29a>, &property_setter_adaptor<0x29b>, &property_setter_adaptor<0x29c>, &property_setter_adaptor<0x29d>, &property_setter_adaptor<0x29e>, &property_setter_adaptor<0x29f>, - &property_setter_adaptor<0x2a0>, &property_setter_adaptor<0x2a1>, &property_setter_adaptor<0x2a2>, &property_setter_adaptor<0x2a3>, &property_setter_adaptor<0x2a4>, &property_setter_adaptor<0x2a5>, &property_setter_adaptor<0x2a6>, &property_setter_adaptor<0x2a7>, - &property_setter_adaptor<0x2a8>, &property_setter_adaptor<0x2a9>, &property_setter_adaptor<0x2aa>, &property_setter_adaptor<0x2ab>, &property_setter_adaptor<0x2ac>, &property_setter_adaptor<0x2ad>, &property_setter_adaptor<0x2ae>, &property_setter_adaptor<0x2af>, - &property_setter_adaptor<0x2b0>, &property_setter_adaptor<0x2b1>, &property_setter_adaptor<0x2b2>, &property_setter_adaptor<0x2b3>, &property_setter_adaptor<0x2b4>, &property_setter_adaptor<0x2b5>, &property_setter_adaptor<0x2b6>, &property_setter_adaptor<0x2b7>, - &property_setter_adaptor<0x2b8>, &property_setter_adaptor<0x2b9>, &property_setter_adaptor<0x2ba>, &property_setter_adaptor<0x2bb>, &property_setter_adaptor<0x2bc>, &property_setter_adaptor<0x2bd>, &property_setter_adaptor<0x2be>, &property_setter_adaptor<0x2bf>, - &property_setter_adaptor<0x2c0>, &property_setter_adaptor<0x2c1>, &property_setter_adaptor<0x2c2>, &property_setter_adaptor<0x2c3>, &property_setter_adaptor<0x2c4>, &property_setter_adaptor<0x2c5>, &property_setter_adaptor<0x2c6>, &property_setter_adaptor<0x2c7>, - &property_setter_adaptor<0x2c8>, &property_setter_adaptor<0x2c9>, &property_setter_adaptor<0x2ca>, &property_setter_adaptor<0x2cb>, &property_setter_adaptor<0x2cc>, &property_setter_adaptor<0x2cd>, &property_setter_adaptor<0x2ce>, &property_setter_adaptor<0x2cf>, - &property_setter_adaptor<0x2d0>, &property_setter_adaptor<0x2d1>, &property_setter_adaptor<0x2d2>, &property_setter_adaptor<0x2d3>, &property_setter_adaptor<0x2d4>, &property_setter_adaptor<0x2d5>, &property_setter_adaptor<0x2d6>, &property_setter_adaptor<0x2d7>, - &property_setter_adaptor<0x2d8>, &property_setter_adaptor<0x2d9>, &property_setter_adaptor<0x2da>, &property_setter_adaptor<0x2db>, &property_setter_adaptor<0x2dc>, &property_setter_adaptor<0x2dd>, &property_setter_adaptor<0x2de>, &property_setter_adaptor<0x2df>, - &property_setter_adaptor<0x2e0>, &property_setter_adaptor<0x2e1>, &property_setter_adaptor<0x2e2>, &property_setter_adaptor<0x2e3>, &property_setter_adaptor<0x2e4>, &property_setter_adaptor<0x2e5>, &property_setter_adaptor<0x2e6>, &property_setter_adaptor<0x2e7>, - &property_setter_adaptor<0x2e8>, &property_setter_adaptor<0x2e9>, &property_setter_adaptor<0x2ea>, &property_setter_adaptor<0x2eb>, &property_setter_adaptor<0x2ec>, &property_setter_adaptor<0x2ed>, &property_setter_adaptor<0x2ee>, &property_setter_adaptor<0x2ef>, - &property_setter_adaptor<0x2f0>, &property_setter_adaptor<0x2f1>, &property_setter_adaptor<0x2f2>, &property_setter_adaptor<0x2f3>, &property_setter_adaptor<0x2f4>, &property_setter_adaptor<0x2f5>, &property_setter_adaptor<0x2f6>, &property_setter_adaptor<0x2f7>, - &property_setter_adaptor<0x2f8>, &property_setter_adaptor<0x2f9>, &property_setter_adaptor<0x2fa>, &property_setter_adaptor<0x2fb>, &property_setter_adaptor<0x2fc>, &property_setter_adaptor<0x2fd>, &property_setter_adaptor<0x2fe>, &property_setter_adaptor<0x2ff>, - &property_setter_adaptor<0x300>, &property_setter_adaptor<0x301>, &property_setter_adaptor<0x302>, &property_setter_adaptor<0x303>, &property_setter_adaptor<0x304>, &property_setter_adaptor<0x305>, &property_setter_adaptor<0x306>, &property_setter_adaptor<0x307>, - &property_setter_adaptor<0x308>, &property_setter_adaptor<0x309>, &property_setter_adaptor<0x30a>, &property_setter_adaptor<0x30b>, &property_setter_adaptor<0x30c>, &property_setter_adaptor<0x30d>, &property_setter_adaptor<0x30e>, &property_setter_adaptor<0x30f>, - &property_setter_adaptor<0x310>, &property_setter_adaptor<0x311>, &property_setter_adaptor<0x312>, &property_setter_adaptor<0x313>, &property_setter_adaptor<0x314>, &property_setter_adaptor<0x315>, &property_setter_adaptor<0x316>, &property_setter_adaptor<0x317>, - &property_setter_adaptor<0x318>, &property_setter_adaptor<0x319>, &property_setter_adaptor<0x31a>, &property_setter_adaptor<0x31b>, &property_setter_adaptor<0x31c>, &property_setter_adaptor<0x31d>, &property_setter_adaptor<0x31e>, &property_setter_adaptor<0x31f>, - &property_setter_adaptor<0x320>, &property_setter_adaptor<0x321>, &property_setter_adaptor<0x322>, &property_setter_adaptor<0x323>, &property_setter_adaptor<0x324>, &property_setter_adaptor<0x325>, &property_setter_adaptor<0x326>, &property_setter_adaptor<0x327>, - &property_setter_adaptor<0x328>, &property_setter_adaptor<0x329>, &property_setter_adaptor<0x32a>, &property_setter_adaptor<0x32b>, &property_setter_adaptor<0x32c>, &property_setter_adaptor<0x32d>, &property_setter_adaptor<0x32e>, &property_setter_adaptor<0x32f>, - &property_setter_adaptor<0x330>, &property_setter_adaptor<0x331>, &property_setter_adaptor<0x332>, &property_setter_adaptor<0x333>, &property_setter_adaptor<0x334>, &property_setter_adaptor<0x335>, &property_setter_adaptor<0x336>, &property_setter_adaptor<0x337>, - &property_setter_adaptor<0x338>, &property_setter_adaptor<0x339>, &property_setter_adaptor<0x33a>, &property_setter_adaptor<0x33b>, &property_setter_adaptor<0x33c>, &property_setter_adaptor<0x33d>, &property_setter_adaptor<0x33e>, &property_setter_adaptor<0x33f>, - &property_setter_adaptor<0x340>, &property_setter_adaptor<0x341>, &property_setter_adaptor<0x342>, &property_setter_adaptor<0x343>, &property_setter_adaptor<0x344>, &property_setter_adaptor<0x345>, &property_setter_adaptor<0x346>, &property_setter_adaptor<0x347>, - &property_setter_adaptor<0x348>, &property_setter_adaptor<0x349>, &property_setter_adaptor<0x34a>, &property_setter_adaptor<0x34b>, &property_setter_adaptor<0x34c>, &property_setter_adaptor<0x34d>, &property_setter_adaptor<0x34e>, &property_setter_adaptor<0x34f>, - &property_setter_adaptor<0x350>, &property_setter_adaptor<0x351>, &property_setter_adaptor<0x352>, &property_setter_adaptor<0x353>, &property_setter_adaptor<0x354>, &property_setter_adaptor<0x355>, &property_setter_adaptor<0x356>, &property_setter_adaptor<0x357>, - &property_setter_adaptor<0x358>, &property_setter_adaptor<0x359>, &property_setter_adaptor<0x35a>, &property_setter_adaptor<0x35b>, &property_setter_adaptor<0x35c>, &property_setter_adaptor<0x35d>, &property_setter_adaptor<0x35e>, &property_setter_adaptor<0x35f>, - &property_setter_adaptor<0x360>, &property_setter_adaptor<0x361>, &property_setter_adaptor<0x362>, &property_setter_adaptor<0x363>, &property_setter_adaptor<0x364>, &property_setter_adaptor<0x365>, &property_setter_adaptor<0x366>, &property_setter_adaptor<0x367>, - &property_setter_adaptor<0x368>, &property_setter_adaptor<0x369>, &property_setter_adaptor<0x36a>, &property_setter_adaptor<0x36b>, &property_setter_adaptor<0x36c>, &property_setter_adaptor<0x36d>, &property_setter_adaptor<0x36e>, &property_setter_adaptor<0x36f>, - &property_setter_adaptor<0x370>, &property_setter_adaptor<0x371>, &property_setter_adaptor<0x372>, &property_setter_adaptor<0x373>, &property_setter_adaptor<0x374>, &property_setter_adaptor<0x375>, &property_setter_adaptor<0x376>, &property_setter_adaptor<0x377>, - &property_setter_adaptor<0x378>, &property_setter_adaptor<0x379>, &property_setter_adaptor<0x37a>, &property_setter_adaptor<0x37b>, &property_setter_adaptor<0x37c>, &property_setter_adaptor<0x37d>, &property_setter_adaptor<0x37e>, &property_setter_adaptor<0x37f>, - &property_setter_adaptor<0x380>, &property_setter_adaptor<0x381>, &property_setter_adaptor<0x382>, &property_setter_adaptor<0x383>, &property_setter_adaptor<0x384>, &property_setter_adaptor<0x385>, &property_setter_adaptor<0x386>, &property_setter_adaptor<0x387>, - &property_setter_adaptor<0x388>, &property_setter_adaptor<0x389>, &property_setter_adaptor<0x38a>, &property_setter_adaptor<0x38b>, &property_setter_adaptor<0x38c>, &property_setter_adaptor<0x38d>, &property_setter_adaptor<0x38e>, &property_setter_adaptor<0x38f>, - &property_setter_adaptor<0x390>, &property_setter_adaptor<0x391>, &property_setter_adaptor<0x392>, &property_setter_adaptor<0x393>, &property_setter_adaptor<0x394>, &property_setter_adaptor<0x395>, &property_setter_adaptor<0x396>, &property_setter_adaptor<0x397>, - &property_setter_adaptor<0x398>, &property_setter_adaptor<0x399>, &property_setter_adaptor<0x39a>, &property_setter_adaptor<0x39b>, &property_setter_adaptor<0x39c>, &property_setter_adaptor<0x39d>, &property_setter_adaptor<0x39e>, &property_setter_adaptor<0x39f>, - &property_setter_adaptor<0x3a0>, &property_setter_adaptor<0x3a1>, &property_setter_adaptor<0x3a2>, &property_setter_adaptor<0x3a3>, &property_setter_adaptor<0x3a4>, &property_setter_adaptor<0x3a5>, &property_setter_adaptor<0x3a6>, &property_setter_adaptor<0x3a7>, - &property_setter_adaptor<0x3a8>, &property_setter_adaptor<0x3a9>, &property_setter_adaptor<0x3aa>, &property_setter_adaptor<0x3ab>, &property_setter_adaptor<0x3ac>, &property_setter_adaptor<0x3ad>, &property_setter_adaptor<0x3ae>, &property_setter_adaptor<0x3af>, - &property_setter_adaptor<0x3b0>, &property_setter_adaptor<0x3b1>, &property_setter_adaptor<0x3b2>, &property_setter_adaptor<0x3b3>, &property_setter_adaptor<0x3b4>, &property_setter_adaptor<0x3b5>, &property_setter_adaptor<0x3b6>, &property_setter_adaptor<0x3b7>, - &property_setter_adaptor<0x3b8>, &property_setter_adaptor<0x3b9>, &property_setter_adaptor<0x3ba>, &property_setter_adaptor<0x3bb>, &property_setter_adaptor<0x3bc>, &property_setter_adaptor<0x3bd>, &property_setter_adaptor<0x3be>, &property_setter_adaptor<0x3bf>, - &property_setter_adaptor<0x3c0>, &property_setter_adaptor<0x3c1>, &property_setter_adaptor<0x3c2>, &property_setter_adaptor<0x3c3>, &property_setter_adaptor<0x3c4>, &property_setter_adaptor<0x3c5>, &property_setter_adaptor<0x3c6>, &property_setter_adaptor<0x3c7>, - &property_setter_adaptor<0x3c8>, &property_setter_adaptor<0x3c9>, &property_setter_adaptor<0x3ca>, &property_setter_adaptor<0x3cb>, &property_setter_adaptor<0x3cc>, &property_setter_adaptor<0x3cd>, &property_setter_adaptor<0x3ce>, &property_setter_adaptor<0x3cf>, - &property_setter_adaptor<0x3d0>, &property_setter_adaptor<0x3d1>, &property_setter_adaptor<0x3d2>, &property_setter_adaptor<0x3d3>, &property_setter_adaptor<0x3d4>, &property_setter_adaptor<0x3d5>, &property_setter_adaptor<0x3d6>, &property_setter_adaptor<0x3d7>, - &property_setter_adaptor<0x3d8>, &property_setter_adaptor<0x3d9>, &property_setter_adaptor<0x3da>, &property_setter_adaptor<0x3db>, &property_setter_adaptor<0x3dc>, &property_setter_adaptor<0x3dd>, &property_setter_adaptor<0x3de>, &property_setter_adaptor<0x3df>, - &property_setter_adaptor<0x3e0>, &property_setter_adaptor<0x3e1>, &property_setter_adaptor<0x3e2>, &property_setter_adaptor<0x3e3>, &property_setter_adaptor<0x3e4>, &property_setter_adaptor<0x3e5>, &property_setter_adaptor<0x3e6>, &property_setter_adaptor<0x3e7>, - &property_setter_adaptor<0x3e8>, &property_setter_adaptor<0x3e9>, &property_setter_adaptor<0x3ea>, &property_setter_adaptor<0x3eb>, &property_setter_adaptor<0x3ec>, &property_setter_adaptor<0x3ed>, &property_setter_adaptor<0x3ee>, &property_setter_adaptor<0x3ef>, - &property_setter_adaptor<0x3f0>, &property_setter_adaptor<0x3f1>, &property_setter_adaptor<0x3f2>, &property_setter_adaptor<0x3f3>, &property_setter_adaptor<0x3f4>, &property_setter_adaptor<0x3f5>, &property_setter_adaptor<0x3f6>, &property_setter_adaptor<0x3f7>, - &property_setter_adaptor<0x3f8>, &property_setter_adaptor<0x3f9>, &property_setter_adaptor<0x3fa>, &property_setter_adaptor<0x3fb>, &property_setter_adaptor<0x3fc>, &property_setter_adaptor<0x3fd>, &property_setter_adaptor<0x3fe>, &property_setter_adaptor<0x3ff>, -}; - -/** - * @brief __init__ implementation (bound to method ith id 'mid') - */ -static PyObject * -method_init_adaptor (int mid, PyObject *self, PyObject *args) -{ - PYA_TRY - - PYAObjectBase *p = PYAObjectBase::from_pyobject (self); - - // delete any object which we may have already - if (p->is_attached ()) { - p->destroy (); - } - - const gsi::MethodBase *meth = match_method (mid, self, args, PyTuple_Size (args) > 0 || ! p->cls_decl ()->can_default_create ()); - - if (meth && meth->smt () == gsi::MethodBase::None) { - - tl::Heap heap; - - gsi::SerialArgs retlist (meth->retsize ()); - gsi::SerialArgs arglist (meth->argsize ()); - - push_args (arglist, meth, args, heap); - - meth->call (0, arglist, retlist); - - void *obj = retlist.read (heap); - if (obj) { - p->set (obj, true, false, true); - } - - } else { - - // No action required - the object is default-created later once it is really required. - if (! PyArg_ParseTuple (args, "")) { - return NULL; - } - - } - - Py_RETURN_NONE; - - PYA_CATCH(method_name_from_id (mid, self)) - - return NULL; -} - -template -PyObject *method_init_adaptor (PyObject *self, PyObject *args) -{ - return method_init_adaptor (N, self, args); -} - -PyObject *(*(method_init_adaptors [])) (PyObject *self, PyObject *args) = -{ - &method_init_adaptor<0x000>, &method_init_adaptor<0x001>, &method_init_adaptor<0x002>, &method_init_adaptor<0x003>, &method_init_adaptor<0x004>, &method_init_adaptor<0x005>, &method_init_adaptor<0x006>, &method_init_adaptor<0x007>, - &method_init_adaptor<0x008>, &method_init_adaptor<0x009>, &method_init_adaptor<0x00a>, &method_init_adaptor<0x00b>, &method_init_adaptor<0x00c>, &method_init_adaptor<0x00d>, &method_init_adaptor<0x00e>, &method_init_adaptor<0x00f>, - &method_init_adaptor<0x010>, &method_init_adaptor<0x011>, &method_init_adaptor<0x012>, &method_init_adaptor<0x013>, &method_init_adaptor<0x014>, &method_init_adaptor<0x015>, &method_init_adaptor<0x016>, &method_init_adaptor<0x017>, - &method_init_adaptor<0x018>, &method_init_adaptor<0x019>, &method_init_adaptor<0x01a>, &method_init_adaptor<0x01b>, &method_init_adaptor<0x01c>, &method_init_adaptor<0x01d>, &method_init_adaptor<0x01e>, &method_init_adaptor<0x01f>, - &method_init_adaptor<0x020>, &method_init_adaptor<0x021>, &method_init_adaptor<0x022>, &method_init_adaptor<0x023>, &method_init_adaptor<0x024>, &method_init_adaptor<0x025>, &method_init_adaptor<0x026>, &method_init_adaptor<0x027>, - &method_init_adaptor<0x028>, &method_init_adaptor<0x029>, &method_init_adaptor<0x02a>, &method_init_adaptor<0x02b>, &method_init_adaptor<0x02c>, &method_init_adaptor<0x02d>, &method_init_adaptor<0x02e>, &method_init_adaptor<0x02f>, - &method_init_adaptor<0x030>, &method_init_adaptor<0x031>, &method_init_adaptor<0x032>, &method_init_adaptor<0x033>, &method_init_adaptor<0x034>, &method_init_adaptor<0x035>, &method_init_adaptor<0x036>, &method_init_adaptor<0x037>, - &method_init_adaptor<0x038>, &method_init_adaptor<0x039>, &method_init_adaptor<0x03a>, &method_init_adaptor<0x03b>, &method_init_adaptor<0x03c>, &method_init_adaptor<0x03d>, &method_init_adaptor<0x03e>, &method_init_adaptor<0x03f>, - &method_init_adaptor<0x040>, &method_init_adaptor<0x041>, &method_init_adaptor<0x042>, &method_init_adaptor<0x043>, &method_init_adaptor<0x044>, &method_init_adaptor<0x045>, &method_init_adaptor<0x046>, &method_init_adaptor<0x047>, - &method_init_adaptor<0x048>, &method_init_adaptor<0x049>, &method_init_adaptor<0x04a>, &method_init_adaptor<0x04b>, &method_init_adaptor<0x04c>, &method_init_adaptor<0x04d>, &method_init_adaptor<0x04e>, &method_init_adaptor<0x04f>, - &method_init_adaptor<0x050>, &method_init_adaptor<0x051>, &method_init_adaptor<0x052>, &method_init_adaptor<0x053>, &method_init_adaptor<0x054>, &method_init_adaptor<0x055>, &method_init_adaptor<0x056>, &method_init_adaptor<0x057>, - &method_init_adaptor<0x058>, &method_init_adaptor<0x059>, &method_init_adaptor<0x05a>, &method_init_adaptor<0x05b>, &method_init_adaptor<0x05c>, &method_init_adaptor<0x05d>, &method_init_adaptor<0x05e>, &method_init_adaptor<0x05f>, - &method_init_adaptor<0x060>, &method_init_adaptor<0x061>, &method_init_adaptor<0x062>, &method_init_adaptor<0x063>, &method_init_adaptor<0x064>, &method_init_adaptor<0x065>, &method_init_adaptor<0x066>, &method_init_adaptor<0x067>, - &method_init_adaptor<0x068>, &method_init_adaptor<0x069>, &method_init_adaptor<0x06a>, &method_init_adaptor<0x06b>, &method_init_adaptor<0x06c>, &method_init_adaptor<0x06d>, &method_init_adaptor<0x06e>, &method_init_adaptor<0x06f>, - &method_init_adaptor<0x070>, &method_init_adaptor<0x071>, &method_init_adaptor<0x072>, &method_init_adaptor<0x073>, &method_init_adaptor<0x074>, &method_init_adaptor<0x075>, &method_init_adaptor<0x076>, &method_init_adaptor<0x077>, - &method_init_adaptor<0x078>, &method_init_adaptor<0x079>, &method_init_adaptor<0x07a>, &method_init_adaptor<0x07b>, &method_init_adaptor<0x07c>, &method_init_adaptor<0x07d>, &method_init_adaptor<0x07e>, &method_init_adaptor<0x07f>, - &method_init_adaptor<0x080>, &method_init_adaptor<0x081>, &method_init_adaptor<0x082>, &method_init_adaptor<0x083>, &method_init_adaptor<0x084>, &method_init_adaptor<0x085>, &method_init_adaptor<0x086>, &method_init_adaptor<0x087>, - &method_init_adaptor<0x088>, &method_init_adaptor<0x089>, &method_init_adaptor<0x08a>, &method_init_adaptor<0x08b>, &method_init_adaptor<0x08c>, &method_init_adaptor<0x08d>, &method_init_adaptor<0x08e>, &method_init_adaptor<0x08f>, - &method_init_adaptor<0x090>, &method_init_adaptor<0x091>, &method_init_adaptor<0x092>, &method_init_adaptor<0x093>, &method_init_adaptor<0x094>, &method_init_adaptor<0x095>, &method_init_adaptor<0x096>, &method_init_adaptor<0x097>, - &method_init_adaptor<0x098>, &method_init_adaptor<0x099>, &method_init_adaptor<0x09a>, &method_init_adaptor<0x09b>, &method_init_adaptor<0x09c>, &method_init_adaptor<0x09d>, &method_init_adaptor<0x09e>, &method_init_adaptor<0x09f>, - &method_init_adaptor<0x0a0>, &method_init_adaptor<0x0a1>, &method_init_adaptor<0x0a2>, &method_init_adaptor<0x0a3>, &method_init_adaptor<0x0a4>, &method_init_adaptor<0x0a5>, &method_init_adaptor<0x0a6>, &method_init_adaptor<0x0a7>, - &method_init_adaptor<0x0a8>, &method_init_adaptor<0x0a9>, &method_init_adaptor<0x0aa>, &method_init_adaptor<0x0ab>, &method_init_adaptor<0x0ac>, &method_init_adaptor<0x0ad>, &method_init_adaptor<0x0ae>, &method_init_adaptor<0x0af>, - &method_init_adaptor<0x0b0>, &method_init_adaptor<0x0b1>, &method_init_adaptor<0x0b2>, &method_init_adaptor<0x0b3>, &method_init_adaptor<0x0b4>, &method_init_adaptor<0x0b5>, &method_init_adaptor<0x0b6>, &method_init_adaptor<0x0b7>, - &method_init_adaptor<0x0b8>, &method_init_adaptor<0x0b9>, &method_init_adaptor<0x0ba>, &method_init_adaptor<0x0bb>, &method_init_adaptor<0x0bc>, &method_init_adaptor<0x0bd>, &method_init_adaptor<0x0be>, &method_init_adaptor<0x0bf>, - &method_init_adaptor<0x0c0>, &method_init_adaptor<0x0c1>, &method_init_adaptor<0x0c2>, &method_init_adaptor<0x0c3>, &method_init_adaptor<0x0c4>, &method_init_adaptor<0x0c5>, &method_init_adaptor<0x0c6>, &method_init_adaptor<0x0c7>, - &method_init_adaptor<0x0c8>, &method_init_adaptor<0x0c9>, &method_init_adaptor<0x0ca>, &method_init_adaptor<0x0cb>, &method_init_adaptor<0x0cc>, &method_init_adaptor<0x0cd>, &method_init_adaptor<0x0ce>, &method_init_adaptor<0x0cf>, - &method_init_adaptor<0x0d0>, &method_init_adaptor<0x0d1>, &method_init_adaptor<0x0d2>, &method_init_adaptor<0x0d3>, &method_init_adaptor<0x0d4>, &method_init_adaptor<0x0d5>, &method_init_adaptor<0x0d6>, &method_init_adaptor<0x0d7>, - &method_init_adaptor<0x0d8>, &method_init_adaptor<0x0d9>, &method_init_adaptor<0x0da>, &method_init_adaptor<0x0db>, &method_init_adaptor<0x0dc>, &method_init_adaptor<0x0dd>, &method_init_adaptor<0x0de>, &method_init_adaptor<0x0df>, - &method_init_adaptor<0x0e0>, &method_init_adaptor<0x0e1>, &method_init_adaptor<0x0e2>, &method_init_adaptor<0x0e3>, &method_init_adaptor<0x0e4>, &method_init_adaptor<0x0e5>, &method_init_adaptor<0x0e6>, &method_init_adaptor<0x0e7>, - &method_init_adaptor<0x0e8>, &method_init_adaptor<0x0e9>, &method_init_adaptor<0x0ea>, &method_init_adaptor<0x0eb>, &method_init_adaptor<0x0ec>, &method_init_adaptor<0x0ed>, &method_init_adaptor<0x0ee>, &method_init_adaptor<0x0ef>, - &method_init_adaptor<0x0f0>, &method_init_adaptor<0x0f1>, &method_init_adaptor<0x0f2>, &method_init_adaptor<0x0f3>, &method_init_adaptor<0x0f4>, &method_init_adaptor<0x0f5>, &method_init_adaptor<0x0f6>, &method_init_adaptor<0x0f7>, - &method_init_adaptor<0x0f8>, &method_init_adaptor<0x0f9>, &method_init_adaptor<0x0fa>, &method_init_adaptor<0x0fb>, &method_init_adaptor<0x0fc>, &method_init_adaptor<0x0fd>, &method_init_adaptor<0x0fe>, &method_init_adaptor<0x0ff>, - &method_init_adaptor<0x100>, &method_init_adaptor<0x101>, &method_init_adaptor<0x102>, &method_init_adaptor<0x103>, &method_init_adaptor<0x104>, &method_init_adaptor<0x105>, &method_init_adaptor<0x106>, &method_init_adaptor<0x107>, - &method_init_adaptor<0x108>, &method_init_adaptor<0x109>, &method_init_adaptor<0x10a>, &method_init_adaptor<0x10b>, &method_init_adaptor<0x10c>, &method_init_adaptor<0x10d>, &method_init_adaptor<0x10e>, &method_init_adaptor<0x10f>, - &method_init_adaptor<0x110>, &method_init_adaptor<0x111>, &method_init_adaptor<0x112>, &method_init_adaptor<0x113>, &method_init_adaptor<0x114>, &method_init_adaptor<0x115>, &method_init_adaptor<0x116>, &method_init_adaptor<0x117>, - &method_init_adaptor<0x118>, &method_init_adaptor<0x119>, &method_init_adaptor<0x11a>, &method_init_adaptor<0x11b>, &method_init_adaptor<0x11c>, &method_init_adaptor<0x11d>, &method_init_adaptor<0x11e>, &method_init_adaptor<0x11f>, - &method_init_adaptor<0x120>, &method_init_adaptor<0x121>, &method_init_adaptor<0x122>, &method_init_adaptor<0x123>, &method_init_adaptor<0x124>, &method_init_adaptor<0x125>, &method_init_adaptor<0x126>, &method_init_adaptor<0x127>, - &method_init_adaptor<0x128>, &method_init_adaptor<0x129>, &method_init_adaptor<0x12a>, &method_init_adaptor<0x12b>, &method_init_adaptor<0x12c>, &method_init_adaptor<0x12d>, &method_init_adaptor<0x12e>, &method_init_adaptor<0x12f>, - &method_init_adaptor<0x130>, &method_init_adaptor<0x131>, &method_init_adaptor<0x132>, &method_init_adaptor<0x133>, &method_init_adaptor<0x134>, &method_init_adaptor<0x135>, &method_init_adaptor<0x136>, &method_init_adaptor<0x137>, - &method_init_adaptor<0x138>, &method_init_adaptor<0x139>, &method_init_adaptor<0x13a>, &method_init_adaptor<0x13b>, &method_init_adaptor<0x13c>, &method_init_adaptor<0x13d>, &method_init_adaptor<0x13e>, &method_init_adaptor<0x13f>, - &method_init_adaptor<0x140>, &method_init_adaptor<0x141>, &method_init_adaptor<0x142>, &method_init_adaptor<0x143>, &method_init_adaptor<0x144>, &method_init_adaptor<0x145>, &method_init_adaptor<0x146>, &method_init_adaptor<0x147>, - &method_init_adaptor<0x148>, &method_init_adaptor<0x149>, &method_init_adaptor<0x14a>, &method_init_adaptor<0x14b>, &method_init_adaptor<0x14c>, &method_init_adaptor<0x14d>, &method_init_adaptor<0x14e>, &method_init_adaptor<0x14f>, - &method_init_adaptor<0x150>, &method_init_adaptor<0x151>, &method_init_adaptor<0x152>, &method_init_adaptor<0x153>, &method_init_adaptor<0x154>, &method_init_adaptor<0x155>, &method_init_adaptor<0x156>, &method_init_adaptor<0x157>, - &method_init_adaptor<0x158>, &method_init_adaptor<0x159>, &method_init_adaptor<0x15a>, &method_init_adaptor<0x15b>, &method_init_adaptor<0x15c>, &method_init_adaptor<0x15d>, &method_init_adaptor<0x15e>, &method_init_adaptor<0x15f>, - &method_init_adaptor<0x160>, &method_init_adaptor<0x161>, &method_init_adaptor<0x162>, &method_init_adaptor<0x163>, &method_init_adaptor<0x164>, &method_init_adaptor<0x165>, &method_init_adaptor<0x166>, &method_init_adaptor<0x167>, - &method_init_adaptor<0x168>, &method_init_adaptor<0x169>, &method_init_adaptor<0x16a>, &method_init_adaptor<0x16b>, &method_init_adaptor<0x16c>, &method_init_adaptor<0x16d>, &method_init_adaptor<0x16e>, &method_init_adaptor<0x16f>, - &method_init_adaptor<0x170>, &method_init_adaptor<0x171>, &method_init_adaptor<0x172>, &method_init_adaptor<0x173>, &method_init_adaptor<0x174>, &method_init_adaptor<0x175>, &method_init_adaptor<0x176>, &method_init_adaptor<0x177>, - &method_init_adaptor<0x178>, &method_init_adaptor<0x179>, &method_init_adaptor<0x17a>, &method_init_adaptor<0x17b>, &method_init_adaptor<0x17c>, &method_init_adaptor<0x17d>, &method_init_adaptor<0x17e>, &method_init_adaptor<0x17f>, - &method_init_adaptor<0x180>, &method_init_adaptor<0x181>, &method_init_adaptor<0x182>, &method_init_adaptor<0x183>, &method_init_adaptor<0x184>, &method_init_adaptor<0x185>, &method_init_adaptor<0x186>, &method_init_adaptor<0x187>, - &method_init_adaptor<0x188>, &method_init_adaptor<0x189>, &method_init_adaptor<0x18a>, &method_init_adaptor<0x18b>, &method_init_adaptor<0x18c>, &method_init_adaptor<0x18d>, &method_init_adaptor<0x18e>, &method_init_adaptor<0x18f>, - &method_init_adaptor<0x190>, &method_init_adaptor<0x191>, &method_init_adaptor<0x192>, &method_init_adaptor<0x193>, &method_init_adaptor<0x194>, &method_init_adaptor<0x195>, &method_init_adaptor<0x196>, &method_init_adaptor<0x197>, - &method_init_adaptor<0x198>, &method_init_adaptor<0x199>, &method_init_adaptor<0x19a>, &method_init_adaptor<0x19b>, &method_init_adaptor<0x19c>, &method_init_adaptor<0x19d>, &method_init_adaptor<0x19e>, &method_init_adaptor<0x19f>, - &method_init_adaptor<0x1a0>, &method_init_adaptor<0x1a1>, &method_init_adaptor<0x1a2>, &method_init_adaptor<0x1a3>, &method_init_adaptor<0x1a4>, &method_init_adaptor<0x1a5>, &method_init_adaptor<0x1a6>, &method_init_adaptor<0x1a7>, - &method_init_adaptor<0x1a8>, &method_init_adaptor<0x1a9>, &method_init_adaptor<0x1aa>, &method_init_adaptor<0x1ab>, &method_init_adaptor<0x1ac>, &method_init_adaptor<0x1ad>, &method_init_adaptor<0x1ae>, &method_init_adaptor<0x1af>, - &method_init_adaptor<0x1b0>, &method_init_adaptor<0x1b1>, &method_init_adaptor<0x1b2>, &method_init_adaptor<0x1b3>, &method_init_adaptor<0x1b4>, &method_init_adaptor<0x1b5>, &method_init_adaptor<0x1b6>, &method_init_adaptor<0x1b7>, - &method_init_adaptor<0x1b8>, &method_init_adaptor<0x1b9>, &method_init_adaptor<0x1ba>, &method_init_adaptor<0x1bb>, &method_init_adaptor<0x1bc>, &method_init_adaptor<0x1bd>, &method_init_adaptor<0x1be>, &method_init_adaptor<0x1bf>, - &method_init_adaptor<0x1c0>, &method_init_adaptor<0x1c1>, &method_init_adaptor<0x1c2>, &method_init_adaptor<0x1c3>, &method_init_adaptor<0x1c4>, &method_init_adaptor<0x1c5>, &method_init_adaptor<0x1c6>, &method_init_adaptor<0x1c7>, - &method_init_adaptor<0x1c8>, &method_init_adaptor<0x1c9>, &method_init_adaptor<0x1ca>, &method_init_adaptor<0x1cb>, &method_init_adaptor<0x1cc>, &method_init_adaptor<0x1cd>, &method_init_adaptor<0x1ce>, &method_init_adaptor<0x1cf>, - &method_init_adaptor<0x1d0>, &method_init_adaptor<0x1d1>, &method_init_adaptor<0x1d2>, &method_init_adaptor<0x1d3>, &method_init_adaptor<0x1d4>, &method_init_adaptor<0x1d5>, &method_init_adaptor<0x1d6>, &method_init_adaptor<0x1d7>, - &method_init_adaptor<0x1d8>, &method_init_adaptor<0x1d9>, &method_init_adaptor<0x1da>, &method_init_adaptor<0x1db>, &method_init_adaptor<0x1dc>, &method_init_adaptor<0x1dd>, &method_init_adaptor<0x1de>, &method_init_adaptor<0x1df>, - &method_init_adaptor<0x1e0>, &method_init_adaptor<0x1e1>, &method_init_adaptor<0x1e2>, &method_init_adaptor<0x1e3>, &method_init_adaptor<0x1e4>, &method_init_adaptor<0x1e5>, &method_init_adaptor<0x1e6>, &method_init_adaptor<0x1e7>, - &method_init_adaptor<0x1e8>, &method_init_adaptor<0x1e9>, &method_init_adaptor<0x1ea>, &method_init_adaptor<0x1eb>, &method_init_adaptor<0x1ec>, &method_init_adaptor<0x1ed>, &method_init_adaptor<0x1ee>, &method_init_adaptor<0x1ef>, - &method_init_adaptor<0x1f0>, &method_init_adaptor<0x1f1>, &method_init_adaptor<0x1f2>, &method_init_adaptor<0x1f3>, &method_init_adaptor<0x1f4>, &method_init_adaptor<0x1f5>, &method_init_adaptor<0x1f6>, &method_init_adaptor<0x1f7>, - &method_init_adaptor<0x1f8>, &method_init_adaptor<0x1f9>, &method_init_adaptor<0x1fa>, &method_init_adaptor<0x1fb>, &method_init_adaptor<0x1fc>, &method_init_adaptor<0x1fd>, &method_init_adaptor<0x1fe>, &method_init_adaptor<0x1ff>, - &method_init_adaptor<0x200>, &method_init_adaptor<0x201>, &method_init_adaptor<0x202>, &method_init_adaptor<0x203>, &method_init_adaptor<0x204>, &method_init_adaptor<0x205>, &method_init_adaptor<0x206>, &method_init_adaptor<0x207>, - &method_init_adaptor<0x208>, &method_init_adaptor<0x209>, &method_init_adaptor<0x20a>, &method_init_adaptor<0x20b>, &method_init_adaptor<0x20c>, &method_init_adaptor<0x20d>, &method_init_adaptor<0x20e>, &method_init_adaptor<0x20f>, - &method_init_adaptor<0x210>, &method_init_adaptor<0x211>, &method_init_adaptor<0x212>, &method_init_adaptor<0x213>, &method_init_adaptor<0x214>, &method_init_adaptor<0x215>, &method_init_adaptor<0x216>, &method_init_adaptor<0x217>, - &method_init_adaptor<0x218>, &method_init_adaptor<0x219>, &method_init_adaptor<0x21a>, &method_init_adaptor<0x21b>, &method_init_adaptor<0x21c>, &method_init_adaptor<0x21d>, &method_init_adaptor<0x21e>, &method_init_adaptor<0x21f>, - &method_init_adaptor<0x220>, &method_init_adaptor<0x221>, &method_init_adaptor<0x222>, &method_init_adaptor<0x223>, &method_init_adaptor<0x224>, &method_init_adaptor<0x225>, &method_init_adaptor<0x226>, &method_init_adaptor<0x227>, - &method_init_adaptor<0x228>, &method_init_adaptor<0x229>, &method_init_adaptor<0x22a>, &method_init_adaptor<0x22b>, &method_init_adaptor<0x22c>, &method_init_adaptor<0x22d>, &method_init_adaptor<0x22e>, &method_init_adaptor<0x22f>, - &method_init_adaptor<0x230>, &method_init_adaptor<0x231>, &method_init_adaptor<0x232>, &method_init_adaptor<0x233>, &method_init_adaptor<0x234>, &method_init_adaptor<0x235>, &method_init_adaptor<0x236>, &method_init_adaptor<0x237>, - &method_init_adaptor<0x238>, &method_init_adaptor<0x239>, &method_init_adaptor<0x23a>, &method_init_adaptor<0x23b>, &method_init_adaptor<0x23c>, &method_init_adaptor<0x23d>, &method_init_adaptor<0x23e>, &method_init_adaptor<0x23f>, - &method_init_adaptor<0x240>, &method_init_adaptor<0x241>, &method_init_adaptor<0x242>, &method_init_adaptor<0x243>, &method_init_adaptor<0x244>, &method_init_adaptor<0x245>, &method_init_adaptor<0x246>, &method_init_adaptor<0x247>, - &method_init_adaptor<0x248>, &method_init_adaptor<0x249>, &method_init_adaptor<0x24a>, &method_init_adaptor<0x24b>, &method_init_adaptor<0x24c>, &method_init_adaptor<0x24d>, &method_init_adaptor<0x24e>, &method_init_adaptor<0x24f>, - &method_init_adaptor<0x250>, &method_init_adaptor<0x251>, &method_init_adaptor<0x252>, &method_init_adaptor<0x253>, &method_init_adaptor<0x254>, &method_init_adaptor<0x255>, &method_init_adaptor<0x256>, &method_init_adaptor<0x257>, - &method_init_adaptor<0x258>, &method_init_adaptor<0x259>, &method_init_adaptor<0x25a>, &method_init_adaptor<0x25b>, &method_init_adaptor<0x25c>, &method_init_adaptor<0x25d>, &method_init_adaptor<0x25e>, &method_init_adaptor<0x25f>, - &method_init_adaptor<0x260>, &method_init_adaptor<0x261>, &method_init_adaptor<0x262>, &method_init_adaptor<0x263>, &method_init_adaptor<0x264>, &method_init_adaptor<0x265>, &method_init_adaptor<0x266>, &method_init_adaptor<0x267>, - &method_init_adaptor<0x268>, &method_init_adaptor<0x269>, &method_init_adaptor<0x26a>, &method_init_adaptor<0x26b>, &method_init_adaptor<0x26c>, &method_init_adaptor<0x26d>, &method_init_adaptor<0x26e>, &method_init_adaptor<0x26f>, - &method_init_adaptor<0x270>, &method_init_adaptor<0x271>, &method_init_adaptor<0x272>, &method_init_adaptor<0x273>, &method_init_adaptor<0x274>, &method_init_adaptor<0x275>, &method_init_adaptor<0x276>, &method_init_adaptor<0x277>, - &method_init_adaptor<0x278>, &method_init_adaptor<0x279>, &method_init_adaptor<0x27a>, &method_init_adaptor<0x27b>, &method_init_adaptor<0x27c>, &method_init_adaptor<0x27d>, &method_init_adaptor<0x27e>, &method_init_adaptor<0x27f>, - &method_init_adaptor<0x280>, &method_init_adaptor<0x281>, &method_init_adaptor<0x282>, &method_init_adaptor<0x283>, &method_init_adaptor<0x284>, &method_init_adaptor<0x285>, &method_init_adaptor<0x286>, &method_init_adaptor<0x287>, - &method_init_adaptor<0x288>, &method_init_adaptor<0x289>, &method_init_adaptor<0x28a>, &method_init_adaptor<0x28b>, &method_init_adaptor<0x28c>, &method_init_adaptor<0x28d>, &method_init_adaptor<0x28e>, &method_init_adaptor<0x28f>, - &method_init_adaptor<0x290>, &method_init_adaptor<0x291>, &method_init_adaptor<0x292>, &method_init_adaptor<0x293>, &method_init_adaptor<0x294>, &method_init_adaptor<0x295>, &method_init_adaptor<0x296>, &method_init_adaptor<0x297>, - &method_init_adaptor<0x298>, &method_init_adaptor<0x299>, &method_init_adaptor<0x29a>, &method_init_adaptor<0x29b>, &method_init_adaptor<0x29c>, &method_init_adaptor<0x29d>, &method_init_adaptor<0x29e>, &method_init_adaptor<0x29f>, - &method_init_adaptor<0x2a0>, &method_init_adaptor<0x2a1>, &method_init_adaptor<0x2a2>, &method_init_adaptor<0x2a3>, &method_init_adaptor<0x2a4>, &method_init_adaptor<0x2a5>, &method_init_adaptor<0x2a6>, &method_init_adaptor<0x2a7>, - &method_init_adaptor<0x2a8>, &method_init_adaptor<0x2a9>, &method_init_adaptor<0x2aa>, &method_init_adaptor<0x2ab>, &method_init_adaptor<0x2ac>, &method_init_adaptor<0x2ad>, &method_init_adaptor<0x2ae>, &method_init_adaptor<0x2af>, - &method_init_adaptor<0x2b0>, &method_init_adaptor<0x2b1>, &method_init_adaptor<0x2b2>, &method_init_adaptor<0x2b3>, &method_init_adaptor<0x2b4>, &method_init_adaptor<0x2b5>, &method_init_adaptor<0x2b6>, &method_init_adaptor<0x2b7>, - &method_init_adaptor<0x2b8>, &method_init_adaptor<0x2b9>, &method_init_adaptor<0x2ba>, &method_init_adaptor<0x2bb>, &method_init_adaptor<0x2bc>, &method_init_adaptor<0x2bd>, &method_init_adaptor<0x2be>, &method_init_adaptor<0x2bf>, - &method_init_adaptor<0x2c0>, &method_init_adaptor<0x2c1>, &method_init_adaptor<0x2c2>, &method_init_adaptor<0x2c3>, &method_init_adaptor<0x2c4>, &method_init_adaptor<0x2c5>, &method_init_adaptor<0x2c6>, &method_init_adaptor<0x2c7>, - &method_init_adaptor<0x2c8>, &method_init_adaptor<0x2c9>, &method_init_adaptor<0x2ca>, &method_init_adaptor<0x2cb>, &method_init_adaptor<0x2cc>, &method_init_adaptor<0x2cd>, &method_init_adaptor<0x2ce>, &method_init_adaptor<0x2cf>, - &method_init_adaptor<0x2d0>, &method_init_adaptor<0x2d1>, &method_init_adaptor<0x2d2>, &method_init_adaptor<0x2d3>, &method_init_adaptor<0x2d4>, &method_init_adaptor<0x2d5>, &method_init_adaptor<0x2d6>, &method_init_adaptor<0x2d7>, - &method_init_adaptor<0x2d8>, &method_init_adaptor<0x2d9>, &method_init_adaptor<0x2da>, &method_init_adaptor<0x2db>, &method_init_adaptor<0x2dc>, &method_init_adaptor<0x2dd>, &method_init_adaptor<0x2de>, &method_init_adaptor<0x2df>, - &method_init_adaptor<0x2e0>, &method_init_adaptor<0x2e1>, &method_init_adaptor<0x2e2>, &method_init_adaptor<0x2e3>, &method_init_adaptor<0x2e4>, &method_init_adaptor<0x2e5>, &method_init_adaptor<0x2e6>, &method_init_adaptor<0x2e7>, - &method_init_adaptor<0x2e8>, &method_init_adaptor<0x2e9>, &method_init_adaptor<0x2ea>, &method_init_adaptor<0x2eb>, &method_init_adaptor<0x2ec>, &method_init_adaptor<0x2ed>, &method_init_adaptor<0x2ee>, &method_init_adaptor<0x2ef>, - &method_init_adaptor<0x2f0>, &method_init_adaptor<0x2f1>, &method_init_adaptor<0x2f2>, &method_init_adaptor<0x2f3>, &method_init_adaptor<0x2f4>, &method_init_adaptor<0x2f5>, &method_init_adaptor<0x2f6>, &method_init_adaptor<0x2f7>, - &method_init_adaptor<0x2f8>, &method_init_adaptor<0x2f9>, &method_init_adaptor<0x2fa>, &method_init_adaptor<0x2fb>, &method_init_adaptor<0x2fc>, &method_init_adaptor<0x2fd>, &method_init_adaptor<0x2fe>, &method_init_adaptor<0x2ff>, - &method_init_adaptor<0x300>, &method_init_adaptor<0x301>, &method_init_adaptor<0x302>, &method_init_adaptor<0x303>, &method_init_adaptor<0x304>, &method_init_adaptor<0x305>, &method_init_adaptor<0x306>, &method_init_adaptor<0x307>, - &method_init_adaptor<0x308>, &method_init_adaptor<0x309>, &method_init_adaptor<0x30a>, &method_init_adaptor<0x30b>, &method_init_adaptor<0x30c>, &method_init_adaptor<0x30d>, &method_init_adaptor<0x30e>, &method_init_adaptor<0x30f>, - &method_init_adaptor<0x310>, &method_init_adaptor<0x311>, &method_init_adaptor<0x312>, &method_init_adaptor<0x313>, &method_init_adaptor<0x314>, &method_init_adaptor<0x315>, &method_init_adaptor<0x316>, &method_init_adaptor<0x317>, - &method_init_adaptor<0x318>, &method_init_adaptor<0x319>, &method_init_adaptor<0x31a>, &method_init_adaptor<0x31b>, &method_init_adaptor<0x31c>, &method_init_adaptor<0x31d>, &method_init_adaptor<0x31e>, &method_init_adaptor<0x31f>, - &method_init_adaptor<0x320>, &method_init_adaptor<0x321>, &method_init_adaptor<0x322>, &method_init_adaptor<0x323>, &method_init_adaptor<0x324>, &method_init_adaptor<0x325>, &method_init_adaptor<0x326>, &method_init_adaptor<0x327>, - &method_init_adaptor<0x328>, &method_init_adaptor<0x329>, &method_init_adaptor<0x32a>, &method_init_adaptor<0x32b>, &method_init_adaptor<0x32c>, &method_init_adaptor<0x32d>, &method_init_adaptor<0x32e>, &method_init_adaptor<0x32f>, - &method_init_adaptor<0x330>, &method_init_adaptor<0x331>, &method_init_adaptor<0x332>, &method_init_adaptor<0x333>, &method_init_adaptor<0x334>, &method_init_adaptor<0x335>, &method_init_adaptor<0x336>, &method_init_adaptor<0x337>, - &method_init_adaptor<0x338>, &method_init_adaptor<0x339>, &method_init_adaptor<0x33a>, &method_init_adaptor<0x33b>, &method_init_adaptor<0x33c>, &method_init_adaptor<0x33d>, &method_init_adaptor<0x33e>, &method_init_adaptor<0x33f>, - &method_init_adaptor<0x340>, &method_init_adaptor<0x341>, &method_init_adaptor<0x342>, &method_init_adaptor<0x343>, &method_init_adaptor<0x344>, &method_init_adaptor<0x345>, &method_init_adaptor<0x346>, &method_init_adaptor<0x347>, - &method_init_adaptor<0x348>, &method_init_adaptor<0x349>, &method_init_adaptor<0x34a>, &method_init_adaptor<0x34b>, &method_init_adaptor<0x34c>, &method_init_adaptor<0x34d>, &method_init_adaptor<0x34e>, &method_init_adaptor<0x34f>, - &method_init_adaptor<0x350>, &method_init_adaptor<0x351>, &method_init_adaptor<0x352>, &method_init_adaptor<0x353>, &method_init_adaptor<0x354>, &method_init_adaptor<0x355>, &method_init_adaptor<0x356>, &method_init_adaptor<0x357>, - &method_init_adaptor<0x358>, &method_init_adaptor<0x359>, &method_init_adaptor<0x35a>, &method_init_adaptor<0x35b>, &method_init_adaptor<0x35c>, &method_init_adaptor<0x35d>, &method_init_adaptor<0x35e>, &method_init_adaptor<0x35f>, - &method_init_adaptor<0x360>, &method_init_adaptor<0x361>, &method_init_adaptor<0x362>, &method_init_adaptor<0x363>, &method_init_adaptor<0x364>, &method_init_adaptor<0x365>, &method_init_adaptor<0x366>, &method_init_adaptor<0x367>, - &method_init_adaptor<0x368>, &method_init_adaptor<0x369>, &method_init_adaptor<0x36a>, &method_init_adaptor<0x36b>, &method_init_adaptor<0x36c>, &method_init_adaptor<0x36d>, &method_init_adaptor<0x36e>, &method_init_adaptor<0x36f>, - &method_init_adaptor<0x370>, &method_init_adaptor<0x371>, &method_init_adaptor<0x372>, &method_init_adaptor<0x373>, &method_init_adaptor<0x374>, &method_init_adaptor<0x375>, &method_init_adaptor<0x376>, &method_init_adaptor<0x377>, - &method_init_adaptor<0x378>, &method_init_adaptor<0x379>, &method_init_adaptor<0x37a>, &method_init_adaptor<0x37b>, &method_init_adaptor<0x37c>, &method_init_adaptor<0x37d>, &method_init_adaptor<0x37e>, &method_init_adaptor<0x37f>, - &method_init_adaptor<0x380>, &method_init_adaptor<0x381>, &method_init_adaptor<0x382>, &method_init_adaptor<0x383>, &method_init_adaptor<0x384>, &method_init_adaptor<0x385>, &method_init_adaptor<0x386>, &method_init_adaptor<0x387>, - &method_init_adaptor<0x388>, &method_init_adaptor<0x389>, &method_init_adaptor<0x38a>, &method_init_adaptor<0x38b>, &method_init_adaptor<0x38c>, &method_init_adaptor<0x38d>, &method_init_adaptor<0x38e>, &method_init_adaptor<0x38f>, - &method_init_adaptor<0x390>, &method_init_adaptor<0x391>, &method_init_adaptor<0x392>, &method_init_adaptor<0x393>, &method_init_adaptor<0x394>, &method_init_adaptor<0x395>, &method_init_adaptor<0x396>, &method_init_adaptor<0x397>, - &method_init_adaptor<0x398>, &method_init_adaptor<0x399>, &method_init_adaptor<0x39a>, &method_init_adaptor<0x39b>, &method_init_adaptor<0x39c>, &method_init_adaptor<0x39d>, &method_init_adaptor<0x39e>, &method_init_adaptor<0x39f>, - &method_init_adaptor<0x3a0>, &method_init_adaptor<0x3a1>, &method_init_adaptor<0x3a2>, &method_init_adaptor<0x3a3>, &method_init_adaptor<0x3a4>, &method_init_adaptor<0x3a5>, &method_init_adaptor<0x3a6>, &method_init_adaptor<0x3a7>, - &method_init_adaptor<0x3a8>, &method_init_adaptor<0x3a9>, &method_init_adaptor<0x3aa>, &method_init_adaptor<0x3ab>, &method_init_adaptor<0x3ac>, &method_init_adaptor<0x3ad>, &method_init_adaptor<0x3ae>, &method_init_adaptor<0x3af>, - &method_init_adaptor<0x3b0>, &method_init_adaptor<0x3b1>, &method_init_adaptor<0x3b2>, &method_init_adaptor<0x3b3>, &method_init_adaptor<0x3b4>, &method_init_adaptor<0x3b5>, &method_init_adaptor<0x3b6>, &method_init_adaptor<0x3b7>, - &method_init_adaptor<0x3b8>, &method_init_adaptor<0x3b9>, &method_init_adaptor<0x3ba>, &method_init_adaptor<0x3bb>, &method_init_adaptor<0x3bc>, &method_init_adaptor<0x3bd>, &method_init_adaptor<0x3be>, &method_init_adaptor<0x3bf>, - &method_init_adaptor<0x3c0>, &method_init_adaptor<0x3c1>, &method_init_adaptor<0x3c2>, &method_init_adaptor<0x3c3>, &method_init_adaptor<0x3c4>, &method_init_adaptor<0x3c5>, &method_init_adaptor<0x3c6>, &method_init_adaptor<0x3c7>, - &method_init_adaptor<0x3c8>, &method_init_adaptor<0x3c9>, &method_init_adaptor<0x3ca>, &method_init_adaptor<0x3cb>, &method_init_adaptor<0x3cc>, &method_init_adaptor<0x3cd>, &method_init_adaptor<0x3ce>, &method_init_adaptor<0x3cf>, - &method_init_adaptor<0x3d0>, &method_init_adaptor<0x3d1>, &method_init_adaptor<0x3d2>, &method_init_adaptor<0x3d3>, &method_init_adaptor<0x3d4>, &method_init_adaptor<0x3d5>, &method_init_adaptor<0x3d6>, &method_init_adaptor<0x3d7>, - &method_init_adaptor<0x3d8>, &method_init_adaptor<0x3d9>, &method_init_adaptor<0x3da>, &method_init_adaptor<0x3db>, &method_init_adaptor<0x3dc>, &method_init_adaptor<0x3dd>, &method_init_adaptor<0x3de>, &method_init_adaptor<0x3df>, - &method_init_adaptor<0x3e0>, &method_init_adaptor<0x3e1>, &method_init_adaptor<0x3e2>, &method_init_adaptor<0x3e3>, &method_init_adaptor<0x3e4>, &method_init_adaptor<0x3e5>, &method_init_adaptor<0x3e6>, &method_init_adaptor<0x3e7>, - &method_init_adaptor<0x3e8>, &method_init_adaptor<0x3e9>, &method_init_adaptor<0x3ea>, &method_init_adaptor<0x3eb>, &method_init_adaptor<0x3ec>, &method_init_adaptor<0x3ed>, &method_init_adaptor<0x3ee>, &method_init_adaptor<0x3ef>, - &method_init_adaptor<0x3f0>, &method_init_adaptor<0x3f1>, &method_init_adaptor<0x3f2>, &method_init_adaptor<0x3f3>, &method_init_adaptor<0x3f4>, &method_init_adaptor<0x3f5>, &method_init_adaptor<0x3f6>, &method_init_adaptor<0x3f7>, - &method_init_adaptor<0x3f8>, &method_init_adaptor<0x3f9>, &method_init_adaptor<0x3fa>, &method_init_adaptor<0x3fb>, &method_init_adaptor<0x3fc>, &method_init_adaptor<0x3fd>, &method_init_adaptor<0x3fe>, &method_init_adaptor<0x3ff>, -}; - - -inline void *make_closure (int mid_getter, int mid_setter) -{ - size_t g = mid_getter < 0 ? (size_t) 0 : (size_t) mid_getter; - size_t s = mid_setter < 0 ? (size_t) 0 : (size_t) mid_setter; - return (void *) ((s << 16) | g); -} - -inline unsigned int getter_from_closure (void *closure) -{ - return (unsigned int) (size_t (closure) & 0xffff); -} - -inline unsigned int setter_from_closure (void *closure) -{ - return (unsigned int) (size_t (closure) >> 16); -} - -static PyObject * -property_getter_impl (int mid, PyObject *self) -{ - const gsi::ClassBase *cls_decl; - - PYAObjectBase *p = 0; - if (! PyType_Check (self)) { - p = PYAObjectBase::from_pyobject (self); - cls_decl = p->cls_decl (); - } else { - cls_decl = PythonModule::cls_for_type ((PyTypeObject *) self); - } - - const MethodTable *mt = MethodTable::method_table_by_class (cls_decl); - tl_assert (mt); - - // locate the method in the base classes method table if necessary - while (mid < int (mt->bottom_property_mid ())) { - - tl_assert (cls_decl->base ()); - cls_decl = cls_decl->base (); - mt = MethodTable::method_table_by_class (cls_decl); - tl_assert (mt); - - } - - // fetch the (only) getter method - const gsi::MethodBase *meth = 0; - if (mt->begin_getters (mid) != mt->end_getters (mid)) { - meth = *mt->begin_getters (mid); - } else { - throw tl::Exception (tl::to_string (tr ("Internal error: cannot locate getter method"))); - } - - if (meth->is_signal ()) { - - // a signal getter is implemented as returning a proxy object for the signal which allows manipulation - // of the signal - tl_assert (p != 0); // no static signals - return PYASignal::create (self, p->signal_handler (meth)); - - } else { - - // getter must not have arguments - if (meth->argsize () > 0) { - throw tl::Exception (tl::to_string (tr ("Internal error: getters must not have arguments"))); - } - - void *obj = 0; - if (p) { - // Hint: this potentially instantiates the object - obj = p->obj (); - } - - tl::Heap heap; - - gsi::SerialArgs retlist (meth->retsize ()); - gsi::SerialArgs arglist (0); - meth->call (obj, arglist, retlist); - - PyObject *ret = get_return_value (p, retlist, meth, heap); - - if (ret == NULL) { - Py_INCREF (Py_None); - ret = Py_None; - } - - return ret; - - } -} - -static PyObject * -property_getter_func (PyObject *self, void *closure) -{ - PyObject *ret = NULL; - PYA_TRY - ret = property_getter_impl (getter_from_closure (closure), self); - PYA_CATCH(property_name_from_id (getter_from_closure (closure), self)) - return ret; -} - -static PyObject * -property_setter_impl (int mid, PyObject *self, PyObject *value) -{ - const gsi::ClassBase *cls_decl; - - PYAObjectBase *p = 0; - if (! PyType_Check (self)) { - p = PYAObjectBase::from_pyobject (self); - cls_decl = p->cls_decl (); - } else { - cls_decl = PythonModule::cls_for_type ((PyTypeObject *) self); - } - - if (p && p->const_ref ()) { - throw tl::Exception (tl::to_string (tr ("Cannot call a setter on a const reference"))); - } - - const MethodTable *mt = MethodTable::method_table_by_class (cls_decl); - tl_assert (mt); - - // locate the method in the base classes method table if necessary - while (mid < int (mt->bottom_property_mid ())) { - - tl_assert (cls_decl->base ()); - cls_decl = cls_decl->base (); - mt = MethodTable::method_table_by_class (cls_decl); - tl_assert (mt); - - } - - if (mt->begin_setters (mid) == mt->end_setters (mid)) { - throw tl::Exception (tl::to_string (tr ("Internal error: cannot locate setter method"))); - } - - const gsi::MethodBase *meth = 0; - int candidates = 0; - - // Find the setter among the methods - for (MethodTableEntry::method_iterator m = mt->begin_setters (mid); m != mt->end_setters (mid); ++m) { - - if ((*m)->is_signal ()) { - - candidates = 1; - meth = *m; - break; - - } else if ((*m)->compatible_with_num_args (1)) { - - ++candidates; - meth = *m; - - } - - } - - // no candidate -> error - if (! meth) { - throw tl::Exception (tl::to_string (tr ("Internal error: no setter compatible with one argument"))); - } - - // more than one candidate -> refine by checking the arguments - if (candidates > 1) { - - // two passes where the second is with loose checking - int pass = 0; - - do { - - meth = 0; - candidates = 0; - - for (MethodTableEntry::method_iterator m = mt->begin_setters (mid); m != mt->end_setters (mid); ++m) { - - // check arguments (count and type) - bool is_valid = (*m)->compatible_with_num_args (1); - if (is_valid && ! test_arg (*(*m)->begin_arguments (), value, pass != 0 /*loose in the second pass*/)) { - is_valid = false; - } - - if (is_valid) { - ++candidates; - meth = *m; - } - - } - - ++pass; - - } while (! meth && pass < 2); - - } - - if (! meth) { - throw tl::Exception (tl::to_string (tr ("No setter overload with matching arguments"))); - } else if (candidates > 1) { - throw tl::Exception (tl::to_string (tr ("Ambiguous overload variants - multiple setter declarations match arguments"))); - } - - void *obj = 0; - if (p) { - // Hint: this potentially instantiates the object - obj = p->obj (); - } - - if (meth->is_signal ()) { - - if (!p) { - - // TODO: Static signals? - - } else if (PyObject_IsInstance (value, (PyObject *) PYASignal::cls)) { - - // assigning a signal to a signal works if it applies to the same handler - - // this simplifies the implementation of += and -=. - if (p->signal_handler (meth) != ((PYASignal *) value)->handler.get ()) { - throw tl::Exception (tl::to_string (tr ("Invalid assignment of signal to signal"))); - } - - } else if (value == Py_None) { - - // assigning None means "clear" - p->signal_handler (meth)->clear (); - - } else if (! PyCallable_Check (value)) { - throw tl::Exception (tl::to_string (tr ("A signal needs to be assigned a callable object"))); - } else { - - // assigning a callable - pya::SignalHandler *handler = p->signal_handler (meth); - handler->clear (); - handler->add (value); - - } - - Py_RETURN_NONE; - - } else { - - gsi::SerialArgs retlist (meth->retsize ()); - gsi::SerialArgs arglist (meth->argsize ()); - - tl::Heap heap; - gsi::MethodBase::argument_iterator a = meth->begin_arguments (); - push_arg (*a, arglist, value, heap); - - meth->call (obj, arglist, retlist); - - return get_return_value (p, retlist, meth, heap); - - } -} - -static int -property_setter_func (PyObject *self, PyObject *value, void *closure) -{ - int res = -1; - - PYA_TRY - - PyObject *ret = property_setter_impl (setter_from_closure (closure), self, value); - - // ignore the result - if (ret != NULL) { - Py_DECREF (ret); - } - - res = 0; - - PYA_CATCH(property_name_from_id (setter_from_closure (closure), self)) - - return res; -} // -------------------------------------------------------------------------- // The PythonModule implementation @@ -2756,8 +467,8 @@ public: PYAStaticAttributeDescriptorObject *desc = PYAStaticAttributeDescriptorObject::create (mp_module->make_string (name)); desc->type = type; - desc->getter = begin_getters != end_getters ? property_getter_adaptors[getter_mid] : NULL; - desc->setter = begin_setters != end_setters ? property_setter_adaptors[setter_mid] : NULL; + desc->getter = begin_getters != end_getters ? get_property_getter_adaptor (getter_mid) : NULL; + desc->setter = begin_setters != end_setters ? get_property_setter_adaptor (setter_mid) : NULL; attr = PythonRef (desc); } @@ -2824,14 +535,13 @@ public: const gsi::MethodBase *m_first = *mt->begin (mid); - tl_assert (mid < sizeof (method_adaptors) / sizeof (method_adaptors[0])); if (! mt->is_static (mid)) { // Bound methods if (! as_static) { PyMethodDef *method = mp_module->make_method_def (); method->ml_name = mp_module->make_string (name); - method->ml_meth = (PyCFunction) method_adaptors[mid]; + method->ml_meth = (PyCFunction) get_method_adaptor (mid); method->ml_doc = mp_module->make_string (doc); method->ml_flags = METH_VARARGS; @@ -2847,7 +557,7 @@ public: // static methods without arguments which start with a capital letter are treated as constants PYAStaticAttributeDescriptorObject *desc = PYAStaticAttributeDescriptorObject::create (mp_module->make_string (name)); desc->type = type; - desc->getter = method_adaptors[mid]; + desc->getter = get_method_adaptor (mid); PythonRef attr (desc); set_type_attr (type, name, attr); @@ -2866,7 +576,7 @@ public: PyMethodDef *method = mp_module->make_method_def (); method->ml_name = "__init__"; - method->ml_meth = (PyCFunction) method_init_adaptors[mid]; + method->ml_meth = (PyCFunction) get_method_init_adaptor (mid); method->ml_doc = mp_module->make_string (doc); method->ml_flags = METH_VARARGS; @@ -2877,7 +587,7 @@ public: PyMethodDef *method = mp_module->make_method_def (); method->ml_name = mp_module->make_string (name); - method->ml_meth = (PyCFunction) method_adaptors[mid]; + method->ml_meth = (PyCFunction) get_method_adaptor (mid); method->ml_doc = mp_module->make_string (doc); method->ml_flags = METH_VARARGS | METH_CLASS; diff --git a/src/pya/pya/pyaObject.h b/src/pya/pya/pyaObject.h index a7510b8dc..f186a328d 100644 --- a/src/pya/pya/pyaObject.h +++ b/src/pya/pya/pyaObject.h @@ -45,7 +45,6 @@ namespace gsi namespace pya { -class PYAObjectBase; class Callee; class StatusChangedListener; From be6e05da55caa9f9bf3f5ca3b31f6162794fafe6 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 23 Oct 2022 19:00:41 +0200 Subject: [PATCH 05/15] WIP: refactoring, added special GSI methods for Python binding --- src/pya/pya/gsiDeclPya.cc | 80 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/pya/pya/gsiDeclPya.cc diff --git a/src/pya/pya/gsiDeclPya.cc b/src/pya/pya/gsiDeclPya.cc new file mode 100644 index 000000000..6a82b36a2 --- /dev/null +++ b/src/pya/pya/gsiDeclPya.cc @@ -0,0 +1,80 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2022 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#include + +#include "gsiDecl.h" +#include "pyaInternal.h" + +namespace gsi +{ + +gsi::Class decl_PythonFunction ("tl", "PythonFunction", + gsi::method ("methods", &pya::MethodTableEntry::methods, "@brief Gets the list of methods bound to this Python function") + + gsi::method ("name", &pya::MethodTableEntry::name, "@brief Gets the name of this Python function") + + gsi::method ("is_static", &pya::MethodTableEntry::is_static, "@brief Gets the value indicating whether this Python function is 'static' (class function)") + + gsi::method ("is_protected", &pya::MethodTableEntry::is_protected, "@brief Gets a value indicating whether this function is protected"), + "@hide" +); + +static std::vector get_python_methods (const gsi::ClassBase *cls, bool st) +{ + const pya::MethodTable *mt = pya::MethodTable::method_table_by_class (cls); + + std::vector methods; + + if (mt != 0) { + for (auto m = mt->method_table ().begin (); m != mt->method_table ().end (); ++m) { + if (m->is_enabled () && m->is_static () == st) { + methods.push_back (m.operator-> ()); + } + } + } + + return methods; +} + +static std::vector > get_python_properties (const gsi::ClassBase *cls, bool st) +{ + const pya::MethodTable *mt = pya::MethodTable::method_table_by_class (cls); + + std::vector > methods; + + if (mt != 0) { + for (auto m = mt->property_table ().begin (); m != mt->property_table ().end (); ++m) { + if (m->first.is_enabled () && m->first.is_static () == st) { + methods.push_back (std::make_pair (&m->first, &m->second)); + } + } + } + + return methods; +} + +static +gsi::ClassExt class_base_ext ( + gsi::method_ext ("python_methods", &get_python_methods, gsi::arg ("static"), "@brief Gets the Python methods (static or non-static)") + + gsi::method_ext ("python_properties", &get_python_properties, gsi::arg ("static"), "@brief Gets the Python properties (static or non-static) as a list of getter/setter pairs\nNote that if a getter or setter is not available the list of Python functions for this part is empty."), + "@hide" +); + +} From daad80d5d5efde1a4bdf863c1cd35a137b714ae9 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 23 Oct 2022 22:08:06 +0200 Subject: [PATCH 06/15] Synthesize getters from is_... predicates, added getter for RecursiveShapeIterator#shape_flags --- src/db/db/gsiDeclDbRecursiveShapeIterator.cc | 7 + src/pya/pya/gsiDeclPya.cc | 23 ++ src/pya/pya/pya.pro | 7 +- src/pya/pya/pyaInternal.cc | 241 ++++++------------- src/pya/pya/pyaInternal.h | 40 ++- src/pya/pya/pyaModule.cc | 22 +- 6 files changed, 153 insertions(+), 187 deletions(-) diff --git a/src/db/db/gsiDeclDbRecursiveShapeIterator.cc b/src/db/db/gsiDeclDbRecursiveShapeIterator.cc index c70423544..791e112c2 100644 --- a/src/db/db/gsiDeclDbRecursiveShapeIterator.cc +++ b/src/db/db/gsiDeclDbRecursiveShapeIterator.cc @@ -523,6 +523,13 @@ Class decl_RecursiveShapeIterator ("db", "RecursiveS "The flags must be specified before the shapes are being retrieved.\n" "Settings the shapes flags will reset the iterator.\n" ) + + gsi::method ("shape_flags", (unsigned int (db::RecursiveShapeIterator::*)() const) &db::RecursiveShapeIterator::shape_flags, + "@brief Gets the shape selection flags\n" + "\n" + "See \\shape_flags= for a description of that property.\n" + "\n" + "This getter has been introduced in version 0.28.\n" + ) + gsi::method ("trans|#itrans", &db::RecursiveShapeIterator::trans, "@brief Gets the current transformation by which the shapes must be transformed into the initial cell\n" "\n" diff --git a/src/pya/pya/gsiDeclPya.cc b/src/pya/pya/gsiDeclPya.cc index 6a82b36a2..798ee8269 100644 --- a/src/pya/pya/gsiDeclPya.cc +++ b/src/pya/pya/gsiDeclPya.cc @@ -24,10 +24,27 @@ #include "gsiDecl.h" #include "pyaInternal.h" +#include "pya.h" namespace gsi { +static const pya::MethodTableEntry *getter (std::pair *p) +{ + return p->second; +} + +static const pya::MethodTableEntry *setter (std::pair *p) +{ + return p->first; +} + +gsi::Class > decl_PythonGetterSetterPair ("tl", "PythonGetterSetterPair", + gsi::method_ext ("getter", &getter, "@brief Gets the getter function") + + gsi::method_ext ("setter", &setter, "@brief Gets the setter function"), + "@hide" +); + gsi::Class decl_PythonFunction ("tl", "PythonFunction", gsi::method ("methods", &pya::MethodTableEntry::methods, "@brief Gets the list of methods bound to this Python function") + gsi::method ("name", &pya::MethodTableEntry::name, "@brief Gets the name of this Python function") + @@ -77,4 +94,10 @@ gsi::ClassExt class_base_ext ( "@hide" ); +static +gsi::ClassExt method_base_ext ( + gsi::method_ext ("python_methods", &pya::PythonInterpreter::python_doc, "@brief Gets the Python specific documentation"), + "@hide" +); + } diff --git a/src/pya/pya/pya.pro b/src/pya/pya/pya.pro index 9e514c318..84176f306 100644 --- a/src/pya/pya/pya.pro +++ b/src/pya/pya/pya.pro @@ -11,13 +11,16 @@ SOURCES = \ pyaConvert.cc \ pyaHelpers.cc \ pyaInspector.cc \ + pyaInternal.cc \ + pyaCallables.cc \ pyaMarshal.cc \ pyaObject.cc \ pyaRefs.cc \ pyaUtils.cc \ pyaModule.cc \ pyaSignalHandler.cc \ - pyaStatusChangedListener.cc + pyaStatusChangedListener.cc \ + gsiDeclPya.cc HEADERS += \ pya.h \ @@ -25,6 +28,8 @@ HEADERS += \ pyaConvert.h \ pyaHelpers.h \ pyaInspector.h \ + pyaInternal.h \ + pyaCallables.h \ pyaMarshal.h \ pyaObject.h \ pyaRefs.h \ diff --git a/src/pya/pya/pyaInternal.cc b/src/pya/pya/pyaInternal.cc index c1b263e5b..eb7c1d61a 100644 --- a/src/pya/pya/pyaInternal.cc +++ b/src/pya/pya/pyaInternal.cc @@ -35,7 +35,7 @@ namespace pya // MethodTableEntry implementation MethodTableEntry::MethodTableEntry (const std::string &name, bool st, bool prot) - : m_name (name), m_is_static (st), m_is_protected (prot), m_is_enabled (true) + : m_name (name), m_is_static (st), m_is_protected (prot), m_is_enabled (true), m_is_init (false) { } const std::string & @@ -62,6 +62,18 @@ MethodTableEntry::is_enabled () const return m_is_enabled; } +void +MethodTableEntry::set_init (bool f) +{ + m_is_init = f; +} + +bool +MethodTableEntry::is_init () const +{ + return m_is_init; +} + bool MethodTableEntry::is_static () const { @@ -139,16 +151,28 @@ MethodTable::MethodTable (const gsi::ClassBase *cls_decl, PythonModule *module) // then add normal methods - on name clash with properties make them a getter for (gsi::ClassBase::method_iterator m = cls_decl->begin_methods (); m != cls_decl->end_methods (); ++m) { + if (! (*m)->is_callback () && ! (*m)->is_signal ()) { + + bool st = (*m)->is_static (); + for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { if (! syn->is_getter && ! syn->is_setter) { - if ((*m)->end_arguments () - (*m)->begin_arguments () == 0 && find_property ((*m)->is_static (), syn->name).first) { + if ((*m)->end_arguments () - (*m)->begin_arguments () == 0 && is_property_setter (st, syn->name) && ! is_property_getter (st, syn->name)) { add_getter (syn->name, *m); } else { + if (syn->is_predicate && std::string (syn->name, 0, 3) == "is_") { + std::string n = std::string (syn->name, 3, std::string::npos); + if (is_property_setter (st, n) && ! is_property_getter (st, n)) { + // synthesize a getter from is_...? predicates (e.g. is_empty? -> empty getter) + add_getter (n, *m); + } + } add_method (syn->name, *m); } } } + } } } @@ -199,6 +223,26 @@ MethodTable::find_property (bool st, const std::string &name) const } } +bool +MethodTable::is_property_setter (bool st, const std::string &name) +{ + std::pair p = find_property (st, name); + if (! p.first) { + return false; + } + return (begin_setters (p.second) != end_setters (p.second)); +} + +bool +MethodTable::is_property_getter (bool st, const std::string &name) +{ + std::pair p = find_property (st, name); + if (! p.first) { + return false; + } + return (begin_getters (p.second) != end_getters (p.second)); +} + /** * @brief Extracts the Python name from a generic name * @@ -324,7 +368,14 @@ static std::string extract_python_name (const std::string &name) void MethodTable::add_method (const std::string &name, const gsi::MethodBase *mb) { - if (name == "to_s" && mb->compatible_with_num_args (0)) { + if (name == "new" && mb->ret_type ().type () == gsi::T_object && mb->ret_type ().pass_obj ()) { + + add_method_basic (name, mb); + + add_method_basic ("__init__", mb, true /*enabled*/, true /*constructor*/); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method is the default initializer of the object"))); + + } else if (name == "to_s" && mb->compatible_with_num_args (0)) { add_method_basic (name, mb); @@ -473,6 +524,18 @@ MethodTable::set_enabled (size_t mid, bool en) m_table [mid - m_method_offset].set_enabled (en); } +bool +MethodTable::is_init(size_t mid) const +{ + return m_table [mid - m_method_offset].is_init (); +} + +void +MethodTable::set_init (size_t mid, bool f) +{ + m_table [mid - m_method_offset].set_init (f); +} + bool MethodTable::is_static (size_t mid) const { @@ -561,9 +624,9 @@ MethodTable::finish () } void -MethodTable::add_method_basic (const std::string &name, const gsi::MethodBase *mb, bool enabled) +MethodTable::add_method_basic (const std::string &name, const gsi::MethodBase *mb, bool enabled, bool init) { - bool st = mb->is_static (); + bool st = mb->is_static () && ! init; std::map, size_t>::iterator n = m_name_map.find (std::make_pair (st, name)); if (n == m_name_map.end ()) { @@ -573,6 +636,9 @@ MethodTable::add_method_basic (const std::string &name, const gsi::MethodBase *m if (! enabled) { m_table.back ().set_enabled (false); } + if (init) { + m_table.back ().set_init (true); + } m_table.back ().add (mb); } else { @@ -585,6 +651,9 @@ MethodTable::add_method_basic (const std::string &name, const gsi::MethodBase *m if (! enabled) { m_table [n->second].set_enabled (false); } + if (init) { + tl_assert (m_table [n->second].is_init ()); + } } } @@ -627,167 +696,5 @@ PythonClassClientData::initialize (const gsi::ClassBase &cls_decl, PyTypeObject } } -// -------------------------------------------------------------------------- -// The PythonModule implementation - -std::map PythonModule::m_python_doc; -std::vector PythonModule::m_classes; - -const std::string pymod_name ("klayout"); - -PythonModule::PythonModule () - : mp_mod_def (0) -{ - // .. nothing yet .. -} - -PythonModule::~PythonModule () -{ - PYAObjectBase::clear_callbacks_cache (); - - // the Python objects were probably deleted by Python itself as it exited - - // don't try to delete them again. - mp_module.release (); - - while (!m_methods_heap.empty ()) { - delete m_methods_heap.back (); - m_methods_heap.pop_back (); - } - - while (!m_getseters_heap.empty ()) { - delete m_getseters_heap.back (); - m_getseters_heap.pop_back (); - } - - if (mp_mod_def) { - delete[] mp_mod_def; - mp_mod_def = 0; - } -} - -PyObject * -PythonModule::module () -{ - return mp_module.get (); -} - -PyObject * -PythonModule::take_module () -{ - return mp_module.release (); -} - -void -PythonModule::init (const char *mod_name, const char *description) -{ - // create a (standalone) Python interpreter if we don't have one yet - // NOTE: Python itself will take care to remove this instance in this case. - if (! pya::PythonInterpreter::instance ()) { - new pya::PythonInterpreter (false); - } - - // do some checks before we create the module - tl_assert (mod_name != 0); - tl_assert (mp_module.get () == 0); - - m_mod_name = pymod_name + "." + mod_name; - m_mod_description = description; - - PyObject *module = 0; - -#if PY_MAJOR_VERSION < 3 - - static PyMethodDef module_methods[] = { - {NULL} // Sentinel - }; - - module = Py_InitModule3 (m_mod_name.c_str (), module_methods, m_mod_description.c_str ()); - -#else - - struct PyModuleDef mod_def = { - PyModuleDef_HEAD_INIT, - m_mod_name.c_str (), - NULL, // module documentation - -1, // size of per-interpreter state of the module, - // if the module keeps state in global variables. - NULL - }; - - tl_assert (! mp_mod_def); - - // prepare a persistent structure with the module definition - // and pass this one to PyModule_Create - mp_mod_def = new char[sizeof (PyModuleDef)]; - memcpy ((void *) mp_mod_def, (const void *) &mod_def, sizeof (PyModuleDef)); - - module = PyModule_Create ((PyModuleDef *) mp_mod_def); - -#endif - - mp_module = PythonRef (module); -} - -void -PythonModule::init (const char *mod_name, PyObject *module) -{ - // do some checks before we create the module - tl_assert (mp_module.get () == 0); - - m_mod_name = mod_name; - mp_module = PythonRef (module); -} - -PyMethodDef * -PythonModule::make_method_def () -{ - static PyMethodDef md = { }; - m_methods_heap.push_back (new PyMethodDef (md)); - return m_methods_heap.back (); -} - -PyGetSetDef * -PythonModule::make_getset_def () -{ - static PyGetSetDef gsd = { }; - m_getseters_heap.push_back (new PyGetSetDef (gsd)); - return m_getseters_heap.back (); -} - -char * -PythonModule::make_string (const std::string &s) -{ - m_string_heap.push_back (s); - return const_cast (m_string_heap.back ().c_str ()); -} - -void -PythonModule::add_python_doc (const gsi::ClassBase & /*cls*/, const MethodTable *mt, int mid, const std::string &doc) -{ - for (MethodTableEntry::method_iterator m = mt->begin (mid); m != mt->end (mid); ++m) { - std::string &doc_string = m_python_doc [*m]; - doc_string += doc; - doc_string += "\n\n"; - } -} - -void -PythonModule::add_python_doc (const gsi::MethodBase *m, const std::string &doc) -{ - m_python_doc [m] += doc; -} - -std::string -PythonModule::python_doc (const gsi::MethodBase *method) -{ - std::map::const_iterator d = m_python_doc.find (method); - if (d != m_python_doc.end ()) { - return d->second; - } else { - return std::string (); - } -} - - } diff --git a/src/pya/pya/pyaInternal.h b/src/pya/pya/pyaInternal.h index f013b62da..2b8d0d128 100644 --- a/src/pya/pya/pyaInternal.h +++ b/src/pya/pya/pyaInternal.h @@ -67,8 +67,10 @@ public: void set_enabled (bool en); bool is_enabled () const; - bool is_static () const; + void set_init(bool f); + bool is_init () const; + bool is_static () const; bool is_protected () const; void add (const gsi::MethodBase *m); @@ -78,11 +80,17 @@ public: method_iterator begin () const; method_iterator end () const; + const std::vector &methods () const + { + return m_methods; + } + private: std::string m_name; bool m_is_static : 1; bool m_is_protected : 1; bool m_is_enabled : 1; + bool m_is_init : 1; std::vector m_methods; }; @@ -161,6 +169,16 @@ public: */ void set_enabled (size_t mid, bool en); + /** + * @brief Returns true if the method is an initializer + */ + bool is_init (size_t mid) const; + + /** + * @brief Sets initializer + */ + void set_init (size_t mid, bool f); + /** * @brief Returns true if the method with the given ID is static */ @@ -228,6 +246,22 @@ public: */ static MethodTable *method_table_by_class (const gsi::ClassBase *cls_decl); + /** + * @brief Gets the method table + */ + const std::vector &method_table () const + { + return m_table; + } + + /** + * @brief Gets the property table + */ + const std::vector > &property_table () const + { + return m_property_table; + } + private: size_t m_method_offset; size_t m_property_offset; @@ -238,7 +272,9 @@ private: std::vector > m_property_table; PythonModule *mp_module; - void add_method_basic (const std::string &name, const gsi::MethodBase *mb, bool enabled = true); + void add_method_basic (const std::string &name, const gsi::MethodBase *mb, bool enabled = true, bool init = false); + bool is_property_setter (bool st, const std::string &name); + bool is_property_getter (bool st, const std::string &name); }; struct PythonClassClientData diff --git a/src/pya/pya/pyaModule.cc b/src/pya/pya/pyaModule.cc index 4900c6ac2..f98f31359 100644 --- a/src/pya/pya/pyaModule.cc +++ b/src/pya/pya/pyaModule.cc @@ -541,7 +541,11 @@ public: PyMethodDef *method = mp_module->make_method_def (); method->ml_name = mp_module->make_string (name); - method->ml_meth = (PyCFunction) get_method_adaptor (mid); + if (mt->is_init (mid)) { + method->ml_meth = (PyCFunction) get_method_init_adaptor (mid); + } else { + method->ml_meth = (PyCFunction) get_method_adaptor (mid); + } method->ml_doc = mp_module->make_string (doc); method->ml_flags = METH_VARARGS; @@ -569,22 +573,6 @@ public: } else if (! as_static) { // Class methods - if (m_first->ret_type ().type () == gsi::T_object && m_first->ret_type ().pass_obj () && name == "new") { - - // The constructor is also routed via the pya_object_init implementation - mp_module->add_python_doc (*cls, mt, int (mid), tl::to_string (tr ("This method is the default initializer of the object"))); - - PyMethodDef *method = mp_module->make_method_def (); - method->ml_name = "__init__"; - method->ml_meth = (PyCFunction) get_method_init_adaptor (mid); - method->ml_doc = mp_module->make_string (doc); - method->ml_flags = METH_VARARGS; - - PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); - set_type_attr (type, method->ml_name, attr); - - } - PyMethodDef *method = mp_module->make_method_def (); method->ml_name = mp_module->make_string (name); method->ml_meth = (PyCFunction) get_method_adaptor (mid); From eb31f67aeb1c73af59b5158dcc9e9377d0cf60ab Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 23 Oct 2022 23:18:09 +0200 Subject: [PATCH 07/15] Include .pyi in deployment, scrips enhanced for more compatibility with stubtest --- scripts/make_drc_lvs_doc.sh | 6 + scripts/make_stubs.sh | 57 ++++ scripts/stubgen.py | 523 +++++++++--------------------------- src/pya/pya/pyaInternal.cc | 12 + src/pya/pya/pyaInternal.h | 5 + src/pya/pya/pyaModule.cc | 13 + src/pymod/db/db.pro | 1 + src/pymod/lay/lay.pro | 1 + src/pymod/lib/lib.pro | 1 + src/pymod/pymod.pri | 12 + src/pymod/rdb/rdb.pro | 1 + src/pymod/tl/tl.pro | 1 + 12 files changed, 230 insertions(+), 403 deletions(-) create mode 100755 scripts/make_stubs.sh diff --git a/scripts/make_drc_lvs_doc.sh b/scripts/make_drc_lvs_doc.sh index 5394d476e..6d4f502c9 100755 --- a/scripts/make_drc_lvs_doc.sh +++ b/scripts/make_drc_lvs_doc.sh @@ -1,5 +1,11 @@ #!/bin/bash -e +# Generates LVS and DRC documentation +# +# Run this script from a valid build below the repository root, e.g. +# /build-debug. It needs to have a "klayout" binary in +# current directory. + inst=$(realpath $(dirname $0)) scripts=${inst}/drc_lvs_doc ld=$(realpath .) diff --git a/scripts/make_stubs.sh b/scripts/make_stubs.sh new file mode 100755 index 000000000..1df806a28 --- /dev/null +++ b/scripts/make_stubs.sh @@ -0,0 +1,57 @@ +#!/bin/bash -e + +# Generates LVS and DRC documentation +# +# Run this script from a valid build below the repository root, e.g. +# /build-debug. It needs to have a "pymod" installation in +# current directory. + +inst=$(realpath $(dirname $0)) +scripts=${inst}/drc_lvs_doc +ld=$(realpath .) + +pymod="$ld/pymod" + +export LD_LIBRARY_PATH=$ld +export PYTHONPATH=$pymod + +pymod_src=$ld/../src/pymod +if ! [ -e $pymod_src ]; then + echo "*** ERROR: missing pymod sources ($pymod_src) - did you run the script from the build folder below the source tree?" + exit 1 +fi + +if ! [ -e $pymod ]; then + echo "*** ERROR: missing pymod folder ($pymod) - did you run the script from the build folder?" + exit 1 +fi + +python= +for try_python in python python3; do + if $try_python -c "import klayout.tl" >/dev/null 2>&1; then + python=$try_python + fi +done + +if [ "$python" = "" ]; then + echo "*** ERROR: no functional python or pymod installation found." + exit 1 +fi + +echo "Generating stubs for tl .." +$python $inst/stubgen.py tl >$pymod_src/distutils_src/klayout/tlcore.pyi + +echo "Generating stubs for db .." +$python $inst/stubgen.py db tl >$pymod_src/distutils_src/klayout/dbcore.pyi + +echo "Generating stubs for rdb .." +$python $inst/stubgen.py rdb tl,db >$pymod_src/distutils_src/klayout/rdbcore.pyi + +echo "Generating stubs for lay .." +$python $inst/stubgen.py lay tl,db,rdb >$pymod_src/distutils_src/klayout/laycore.pyi + +echo "Generating stubs for lib .." +$python $inst/stubgen.py lib tl,db >$pymod_src/distutils_src/klayout/libcore.pyi + +echo "Done." + diff --git a/scripts/stubgen.py b/scripts/stubgen.py index 7f603e742..fea989d1b 100644 --- a/scripts/stubgen.py +++ b/scripts/stubgen.py @@ -70,103 +70,6 @@ def is_reserved_word(name: str) -> bool: return name in wordlist -def translate_methodname(name: str) -> str: - """ - Should be the same as pyaModule.cc:extract_python_name function - * The name string encodes some additional information, specifically: - * "*..." The method is protected - * "x|y" Aliases (synonyms) - * "x|#y" y is deprecated - * "x=" x is a setter - * ":x" x is a getter - * "x?" x is a predicate - * Backslashes can be used to escape the special characters, like "*" and "|". - """ - if name == "new": - new_name = "__init__" - elif name == "++": - new_name = "inc" - elif name == "--": - new_name = "dec" - elif name == "()": - new_name = "call" - elif name == "!": - new_name = "not" - elif name == "==": - new_name = "__eq__" - elif name == "!=": - new_name = "__ne__" - elif name == "<": - new_name = "__lt__" - elif name == "<=": - new_name = "__le__" - elif name == ">": - new_name = "__gt__" - elif name == ">=": - new_name = "__ge__" - elif name == "<=>": - new_name = "__cmp__" - elif name == "+": - new_name = "__add__" - elif name == "+@": - new_name = "__pos__" - elif name == "-": - new_name = "__sub__" - elif name == "-@": - new_name = "__neg__" - elif name == "/": - new_name = "__truediv__" - elif name == "*": - new_name = "__mul__" - elif name == "%": - new_name = "__mod__" - elif name == "<<": - new_name = "__lshift__" - elif name == ">>": - new_name = "__rshift__" - elif name == "~": - new_name = "__invert__" - elif name == "&": - new_name = "__and__" - elif name == "|": - new_name = "__or__" - elif name == "^": - new_name = "__xor__" - elif name == "+=": - new_name = "__iadd__" - elif name == "-=": - new_name = "__isub__" - elif name == "/=": - new_name = "__itruediv__" - elif name == "*=": - new_name = "__imul__" - elif name == "%=": - new_name = "__imod__" - elif name == "<<=": - new_name = "__ilshift__" - elif name == ">>=": - new_name = "__irshift__" - elif name == "&=": - new_name = "__iand__" - elif name == "|=": - new_name = "__ior__" - elif name == "^=": - new_name = "__ixor__" - elif name == "[]": - new_name = "__getitem__" - elif name == "[]=": - new_name = "__setitem__" - else: - # Ignore other conversions for now. - if name.startswith("*"): - print(name) - new_name = name - if is_reserved_word(new_name): - new_name = new_name + "_" - - return new_name - - _type_dict = dict() _type_dict[ktl.ArgType.TypeBool] = "bool" @@ -181,6 +84,7 @@ _type_dict[ktl.ArgType.TypeLongLong] = "int" _type_dict[ktl.ArgType.TypeSChar] = "str" _type_dict[ktl.ArgType.TypeShort] = "int" _type_dict[ktl.ArgType.TypeString] = "str" +_type_dict[ktl.ArgType.TypeByteArray] = "bytes" _type_dict[ktl.ArgType.TypeUChar] = "str" _type_dict[ktl.ArgType.TypeUInt] = "int" _type_dict[ktl.ArgType.TypeULong] = "int" @@ -225,17 +129,6 @@ def _translate_type( return py_str -@dataclass -class _Method: - name: str - is_setter: bool - is_getter: bool - is_classvar: bool - is_classmethod: bool - doc: str - m: ktl.Method - - @dataclass class Stub: signature: str @@ -317,74 +210,6 @@ class ClassStub(Stub): indent_docstring: bool = True -def get_c_methods(c: ktl.Class) -> List[_Method]: - """ - Iterates over all methods defined in the C API, sorting - properties, class methods and bound methods. - """ - method_list: List[_Method] = list() - setters = set() - - def primary_synonym(m: ktl.Method) -> ktl.MethodOverload: - for ms in m.each_overload(): - if ms.name() == m.primary_name(): - return ms - raise RuntimeError("Primary synonym not found for method " + m.name()) - - for m in c.each_method(): - if m.is_signal(): - # ignore signals as they do not have arguments and are neither setters nor getters. - continue - - method_def = primary_synonym(m) - if method_def.is_setter(): - setters.add(method_def.name()) - - for m in c.each_method(): - num_args = len([True for a in m.each_argument()]) - method_def = primary_synonym(m) - - # extended definition of "getter" for Python - is_getter = (num_args == 0) and ( - method_def.is_getter() - or (not method_def.is_setter() and method_def.name() in setters) - ) - is_setter = (num_args == 1) and method_def.is_setter() - is_classvar = (num_args == 0) and (m.is_static() and not m.is_constructor()) - is_const = m.is_const() - - # static methods without arguments which start with a capital letter are treated as constants - # (rule from pyaModule.cc) - if is_classvar and m.name()[0].isupper(): - is_getter = True - - for method_synonym in m.each_overload(): - if method_synonym.deprecated(): - # method synonyms that start with # (pound) sign - continue - if method_synonym.name() == method_def.name(): - doc = m.doc() - else: - doc = ( - f"Note: This is an alias of '{translate_methodname(method_def.name())}'.\n" - + m.doc() - ) - method_list.append( - _Method( - name=method_synonym.name(), - is_setter=is_setter, - is_getter=is_getter, - is_classmethod=m.is_constructor() or is_classvar, - is_classvar=is_classvar, - doc=doc, - m=m, - ) - ) - - # print(f"{m.name()}: {m.is_static()=}, {m.is_constructor()=}, {m.is_const_object()=}") - return method_list - - def get_py_child_classes(c: ktl.Class): for c_child in c.each_child_class(): yield c_child @@ -393,25 +218,6 @@ def get_py_child_classes(c: ktl.Class): def get_py_methods( c: ktl.Class, ) -> List[Stub]: - c_methods = get_c_methods(c) - - # extract properties - _c_methods = copy(c_methods) - - # Helper functions - def find_setter(c_methods: List[_Method], name: str): - """Finds a setter method in c_methods list with a given name.f""" - for m in c_methods: - if m.name == name and m.is_setter: - return m - return None - - def find_getter(c_methods: List[_Method], name: str): - """Finds a getter method in c_methods list with a given name.f""" - for m in c_methods: - if m.name == name and m.is_getter: - return m - return None translate_arg_type = functools.partial(_translate_type, within_class=c, is_return=False) translate_ret_type = functools.partial(_translate_type, within_class=c, is_return=True) @@ -448,164 +254,145 @@ def get_py_methods( new_arglist.append((argname, None)) return _format_args(new_arglist) - # Extract all properties (methods that have getters and/or setters) + # Collect all properties here properties: List[Stub] = list() - for m in copy(_c_methods): - ret_type = translate_ret_type(m.m.ret_type()) - if m.is_getter: - m_setter = find_setter(c_methods, m.name) - if m_setter is not None: # full property - doc = m.doc + m_setter.doc - properties.append( - PropertyStub( - decorator="", - signature=f"{translate_methodname(m.name)}: {ret_type}", - name=f"{translate_methodname(m.name)}", - docstring=doc, - ) - ) - # _c_methods.remove(m_setter) - elif m.is_classvar: - properties.append( - PropertyStub( - decorator="", - signature=f"{translate_methodname(m.name)}: ClassVar[{ret_type}]", - name=f"{translate_methodname(m.name)}", - docstring=m.doc, - ) - ) - else: # only getter - properties.append( - MethodStub( - decorator="@property", - signature=f"def {translate_methodname(m.name)}(self) -> {ret_type}", - name=f"{translate_methodname(m.name)}", - docstring=m.doc, - ) - ) - _c_methods.remove(m) - elif m.is_setter and not find_getter( - c_methods, m.name - ): # include setter-only properties as full properties - doc = "WARNING: This variable can only be set, not retrieved.\n" + m.doc + + # Extract all instance properties + for f in c.python_properties(False): + name = f.getter().name() + getter = None + if len(f.getter().methods()) > 0: + getter = f.getter().methods()[0] + setter = None + if len(f.setter().methods()) > 0: + setter = f.setter().methods()[0] + if getter and setter: + # Full property + ret_type = translate_ret_type(getter.ret_type()) + doc = "Getter:\n" + getter.doc() + "\nSetter:\n" + setter.doc() properties.append( PropertyStub( decorator="", - signature=f"{translate_methodname(m.name)}: {ret_type}", - name=f"{translate_methodname(m.name)}", + signature=f"{name}: {ret_type}", + name=name, + docstring=doc, + ) + ) + elif getter: + # Only getter + ret_type = translate_ret_type(getter.ret_type()) + doc = getter.doc() + properties.append( + MethodStub( + decorator="@property", + signature=f"def {name}(self) -> {ret_type}", + name=name, + docstring=doc, + ) + ) + elif setter: + # Only setter + doc = "WARNING: This variable can only be set, not retrieved.\n" + setter.doc() + properties.append( + MethodStub( + decorator="@property", + signature=f"def {name}(self) -> None", + name=name, docstring=doc, ) ) - _c_methods.remove(m) - for m in copy(_c_methods): - if m.is_setter: - _c_methods.remove(m) - - def get_altnames(c_name: str, m: _Method): - args = list(m.m.each_argument()) - ret = m.m.ret_type() - num_args = len(args) - names = [c_name] - if c_name == "to_s" and num_args == 0: - names.append("__str__") - # Only works if GSI_ALIAS_INSPECT is activated - names.append("__repr__") - elif c_name == "hash" and num_args == 0: - names.append("__hash__") - elif c_name == "inspect" and num_args == 0: - names.append("__repr__") - elif c_name == "size" and num_args == 0: - names.append("__len__") - elif c_name == "each" and num_args == 0 and ret.is_iter(): - names.append("__iter__") - elif c_name == "__mul__" and "Trans" not in c_name: - names.append("__rmul__") - elif c_name == "dup" and num_args == 0: - names.append("__copy__") - return names + # Extract all class properties (TODO: setters not supported currently) + for f in c.python_properties(True): + name = f.getter().name() + if len(f.getter().methods()) > 0: + getter = f.getter().methods()[0] + ret_type = translate_ret_type(getter.ret_type()) + doc = getter.doc() + properties.append( + MethodStub( + decorator="@property", + signature=f"def {name}(self) -> ClassVar[{ret_type}]", + name=name, + docstring=doc, + ) + ) # Extract all classmethods classmethods: List[Stub] = list() - for m in copy(_c_methods): - if m.is_classmethod: - # Exception: if it is an __init__ constructor, ignore. - # Will be treated by the bound method logic below. - if translate_methodname(m.name) == "__init__": - continue - decorator = "@classmethod" - ret_type = translate_ret_type(m.m.ret_type()) - for name in get_altnames(m.name, m): - classmethods.append( - MethodStub( - decorator=decorator, - signature=f"def {translate_methodname(name)}({format_args(m.m, 'cls')}) -> {ret_type}", - name=f"{translate_methodname(name)}", - docstring=m.doc, - ) + + for f in c.python_methods(True): + + name = f.name() + + decorator = "" + if len(f.methods()) > 1: + decorator = "@overload\n" + decorator += "@classmethod" + + for m in f.methods(): + ret_type = translate_ret_type(m.ret_type()) + classmethods.append( + MethodStub( + decorator=decorator, + signature=f"def {name}({format_args(m, 'cls')}) -> {ret_type}", + name=name, + docstring=m.doc(), ) - _c_methods.remove(m) + ) # Extract bound methods boundmethods: List[Stub] = list() - for m in copy(_c_methods): + + for f in c.python_methods(False): + + name = f.name() + decorator = "" + if len(f.methods()) > 1: + decorator = "@overload\n" - translated_name = translate_methodname(m.name) - if translated_name in [s.name for s in properties]: - translated_name += "_" + for m in f.methods(): - if translated_name == "__init__": - ret_type = "None" - else: - ret_type = translate_ret_type(m.m.ret_type()) + if name == "__init__": + ret_type = "None" + else: + ret_type = translate_ret_type(m.ret_type()) - arg_list = _get_arglist(m.m, "self") - # TODO: fix type errors - # Exceptions: - # For X.__eq__(self, a:X), treat second argument as type object instead of X - if translated_name in ("__eq__", "__ne__"): - arg_list[1] = arg_list[1][0], "object" - # X._assign(self, other:X), mypy complains if _assign is defined at base class. - # We can't specialize other in this case. - elif translated_name in ("_assign", "assign"): - assert arg_list[1][1] is not None - assert arg_list[1][1].type() == ktl.ArgType.TypeObject - arg_list[1] = arg_list[1][0], superclass(arg_list[1][1].cls()) - else: - new_arg_list = [] - for argname, a in arg_list: - if a: - new_arg_list.append((argname, translate_arg_type(a))) - else: - new_arg_list.append((argname, a)) - arg_list = new_arg_list - formatted_args = _format_args(arg_list) + arg_list = _get_arglist(m, "self") + # TODO: fix type errors + # Exceptions: + # For X.__eq__(self, a:X), treat second argument as type object instead of X + if name in ("__eq__", "__ne__"): + arg_list[1] = arg_list[1][0], "object" + # X._assign(self, other:X), mypy complains if _assign is defined at base class. + # We can't specialize other in this case. + elif name in ("_assign", "assign"): + assert arg_list[1][1] is not None + assert arg_list[1][1].type() == ktl.ArgType.TypeObject + arg_list[1] = arg_list[1][0], superclass(arg_list[1][1].cls()) + else: + new_arg_list = [] + for argname, a in arg_list: + if a: + new_arg_list.append((argname, translate_arg_type(a))) + else: + new_arg_list.append((argname, a)) + arg_list = new_arg_list + formatted_args = _format_args(arg_list) - for name in get_altnames(translated_name, m): boundmethods.append( MethodStub( decorator=decorator, signature=f"def {name}({formatted_args}) -> {ret_type}", - name=f"{name}", - docstring=m.doc, + name=name, + docstring=m.doc(), ) ) - _c_methods.remove(m) - def add_overload_decorator(stublist: List[Stub]): - stubnames = [stub.name for stub in stublist] - for stub in stublist: - has_duplicate = stubnames.count(stub.name) > 1 - if has_duplicate: - stub.decorator = "@overload\n" + stub.decorator - return stublist - - boundmethods = sorted(set(boundmethods)) # sometimes duplicate methods are defined. - add_overload_decorator(boundmethods) - properties = sorted(set(properties)) + boundmethods = sorted(boundmethods) + properties = sorted(properties) classmethods = sorted(classmethods) - add_overload_decorator(classmethods) return_list: List[Stub] = properties + classmethods + boundmethods @@ -659,90 +446,20 @@ def get_module_stubs(module: str) -> List[ClassStub]: return _stubs -def print_db(): +def print_mod(module, dependencies): print("from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional") print("from typing import overload") - print("import klayout.rdb as rdb") - print("import klayout.tl as tl") - for stub in get_module_stubs("db"): + for dep in dependencies: + print(f"import klayout.{dep} as {dep}") + for stub in get_module_stubs(module): print(stub.format_stub(include_docstring=True) + "\n") -def print_rdb(): - print("from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional") - print("from typing import overload") - print("import klayout.db as db") - for stub in get_module_stubs("rdb"): - print(stub.format_stub(include_docstring=True) + "\n") - - -def print_tl(): - print("from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional") - print("from typing import overload") - for stub in get_module_stubs("tl"): - print(stub.format_stub(include_docstring=True) + "\n") - - -def test_v1(): - db_classes = get_classes("db") - for c in db_classes: - if c.name() != "Region": - continue - print( - get_class_stub(c, ignore=db_classes, module="db").format_stub( - include_docstring=False - ) - ) - - -def test_v2(): - db_classes = get_classes("db") - for c in db_classes: - if c.name() != "DPoint": - continue - print( - get_class_stub(c, ignore=db_classes, module="db").format_stub( - include_docstring=True - ) - ) - - -def test_v3(): - db_classes = get_classes("db") - for c in db_classes: - if c.name() != "Instance": - continue - print( - get_class_stub(c, ignore=db_classes, module="db").format_stub( - include_docstring=False - ) - ) - - -def test_v4(): - db_classes = get_classes("db") - for c in db_classes: - if c.name() != "Region": - continue - for cclass in get_py_child_classes(c): - print( - get_class_stub(cclass, ignore=db_classes, module="db").format_stub( - include_docstring=False - ) - ) - - if __name__ == "__main__": if len(argv) < 2: - print("Specity module in argument: 'db', 'rdb', 'tl'") + print("Specity module in argument") exit(1) - if argv[1] == "db": - print_db() - elif argv[1] == "rdb": - print_rdb() - elif argv[1] == "tl": - print_tl() + if len(argv) == 2: + print_mod(argv[1], []) else: - # print_rdb() - # test_v4() - print("Wrong arguments") + print_mod(argv[1], argv[2].split(",")) diff --git a/src/pya/pya/pyaInternal.cc b/src/pya/pya/pyaInternal.cc index eb7c1d61a..cb348a764 100644 --- a/src/pya/pya/pyaInternal.cc +++ b/src/pya/pya/pyaInternal.cc @@ -548,6 +548,18 @@ MethodTable::is_protected (size_t mid) const return m_table [mid - m_method_offset].is_protected (); } +void +MethodTable::alias (size_t mid, const std::string &new_name) +{ + bool st = is_static (mid); + auto nm = m_name_map.find (std::make_pair (st, new_name)); + tl_assert (nm == m_name_map.end ()); + + m_table.push_back (m_table [mid - m_method_offset]); + m_table.back ().set_name (new_name); + m_name_map.insert (std::make_pair (std::make_pair (st, new_name), m_table.size () - 1 - m_method_offset)); +} + void MethodTable::rename (size_t mid, const std::string &new_name) { diff --git a/src/pya/pya/pyaInternal.h b/src/pya/pya/pyaInternal.h index 2b8d0d128..b4055391b 100644 --- a/src/pya/pya/pyaInternal.h +++ b/src/pya/pya/pyaInternal.h @@ -189,6 +189,11 @@ public: */ bool is_protected (size_t mid) const; + /** + * @brief Creates an alias for the given method + */ + void alias (size_t mid, const std::string &new_name); + /** * @brief Renames a method */ diff --git a/src/pya/pya/pyaModule.cc b/src/pya/pya/pyaModule.cc index f98f31359..862646160 100644 --- a/src/pya/pya/pyaModule.cc +++ b/src/pya/pya/pyaModule.cc @@ -667,8 +667,21 @@ public: // install the static/non-static dispatcher descriptor + std::sort (disambiguated_names.begin (), disambiguated_names.end ()); + disambiguated_names.erase (std::unique (disambiguated_names.begin (), disambiguated_names.end ()), disambiguated_names.end ()); + for (std::vector::const_iterator a = disambiguated_names.begin (); a != disambiguated_names.end (); ++a) { + std::pair pa; + pa = mt->find_method (true, *a); + if (pa.first) { + mt->alias (pa.second, "_class_" + *a); + } + pa = mt->find_method (false, *a); + if (pa.first) { + mt->alias (pa.second, "_inst_" + *a); + } + PyObject *attr_inst = PyObject_GetAttrString ((PyObject *) type, ("_inst_" + *a).c_str ()); PyObject *attr_class = PyObject_GetAttrString ((PyObject *) type, ("_class_" + *a).c_str ()); if (attr_inst == NULL || attr_class == NULL) { diff --git a/src/pymod/db/db.pro b/src/pymod/db/db.pro index e40682d5c..62633b43d 100644 --- a/src/pymod/db/db.pro +++ b/src/pymod/db/db.pro @@ -1,6 +1,7 @@ TARGET = dbcore REALMODULE = db +PYI = dbcore.pyi include($$PWD/../pymod.pri) diff --git a/src/pymod/lay/lay.pro b/src/pymod/lay/lay.pro index d62c2c847..2c21525ff 100644 --- a/src/pymod/lay/lay.pro +++ b/src/pymod/lay/lay.pro @@ -1,6 +1,7 @@ TARGET = laycore REALMODULE = lay +PYI = laycore.pyi include($$PWD/../pymod.pri) diff --git a/src/pymod/lib/lib.pro b/src/pymod/lib/lib.pro index f78877a69..107bd8fb3 100644 --- a/src/pymod/lib/lib.pro +++ b/src/pymod/lib/lib.pro @@ -1,6 +1,7 @@ TARGET = libcore REALMODULE = lib +PYI = libcore.pyi include($$PWD/../pymod.pri) diff --git a/src/pymod/pymod.pri b/src/pymod/pymod.pri index 544d594ff..b4ea54c5a 100644 --- a/src/pymod/pymod.pri +++ b/src/pymod/pymod.pri @@ -49,6 +49,18 @@ msvc { } INSTALLS = lib_target +!equals(PYI, "") { + + msvc { + QMAKE_POST_LINK += && $(COPY) $$shell_path($$PWD/distutils_src/klayout/$$PYI) $$shell_path($$DESTDIR_PYMOD) + } else { + QMAKE_POST_LINK += && $(MKDIR) $$DESTDIR_PYMOD/$$REALMODULE && $(COPY) $$PWD/distutils_src/klayout/$$PYI $$DESTDIR_PYMOD + } + + POST_TARGETDEPS += $$PWD/distutils_src/klayout/$$PYI + +} + !equals(REALMODULE, "") { msvc { diff --git a/src/pymod/rdb/rdb.pro b/src/pymod/rdb/rdb.pro index f54b94059..c2517fd02 100644 --- a/src/pymod/rdb/rdb.pro +++ b/src/pymod/rdb/rdb.pro @@ -1,6 +1,7 @@ TARGET = rdbcore REALMODULE = rdb +PYI = rdbcore.pyi include($$PWD/../pymod.pri) diff --git a/src/pymod/tl/tl.pro b/src/pymod/tl/tl.pro index 58219f4a0..d6a4a3558 100644 --- a/src/pymod/tl/tl.pro +++ b/src/pymod/tl/tl.pro @@ -1,6 +1,7 @@ TARGET = tlcore REALMODULE = tl +PYI = tlcore.pyi include($$PWD/../pymod.pri) From 9011af54acb213216a84e1f5bb71a0bef2705dbb Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 23 Oct 2022 23:47:26 +0200 Subject: [PATCH 08/15] Class properties --- scripts/stubgen.py | 6 +- src/pya/pya/pyaInternal.cc | 8 +- src/pya/pya/pyaModule.cc | 215 +++++++++++++++++-------------------- 3 files changed, 106 insertions(+), 123 deletions(-) diff --git a/scripts/stubgen.py b/scripts/stubgen.py index fea989d1b..98943562d 100644 --- a/scripts/stubgen.py +++ b/scripts/stubgen.py @@ -310,9 +310,9 @@ def get_py_methods( ret_type = translate_ret_type(getter.ret_type()) doc = getter.doc() properties.append( - MethodStub( - decorator="@property", - signature=f"def {name}(self) -> ClassVar[{ret_type}]", + PropertyStub( + decorator="", + signature=f"{name}: ClassVar[{ret_type}]", name=name, docstring=doc, ) diff --git a/src/pya/pya/pyaInternal.cc b/src/pya/pya/pyaInternal.cc index cb348a764..88f973550 100644 --- a/src/pya/pya/pyaInternal.cc +++ b/src/pya/pya/pyaInternal.cc @@ -28,6 +28,8 @@ #include "tlLog.h" +#include + namespace pya { @@ -155,10 +157,14 @@ MethodTable::MethodTable (const gsi::ClassBase *cls_decl, PythonModule *module) if (! (*m)->is_callback () && ! (*m)->is_signal ()) { bool st = (*m)->is_static (); + bool no_args = ((*m)->end_arguments () == (*m)->begin_arguments ()); for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { if (! syn->is_getter && ! syn->is_setter) { - if ((*m)->end_arguments () - (*m)->begin_arguments () == 0 && is_property_setter (st, syn->name) && ! is_property_getter (st, syn->name)) { + if (no_args && is_property_setter (st, syn->name) && ! is_property_getter (st, syn->name)) { + add_getter (syn->name, *m); + } else if (st && no_args && (isupper (syn->name [0]) || (*m)->is_const ())) { + // static methods without arguments which start with a capital letter are treated as constants add_getter (syn->name, *m); } else { if (syn->is_predicate && std::string (syn->name, 0, 3) == "is_") { diff --git a/src/pya/pya/pyaModule.cc b/src/pya/pya/pyaModule.cc index 862646160..611ae3a63 100644 --- a/src/pya/pya/pyaModule.cc +++ b/src/pya/pya/pyaModule.cc @@ -386,23 +386,23 @@ public: // produce the properties - if (! as_static) { + for (size_t mid = mt->bottom_property_mid (); mid < mt->top_property_mid (); ++mid) { - for (size_t mid = mt->bottom_property_mid (); mid < mt->top_property_mid (); ++mid) { + MethodTableEntry::method_iterator begin_setters = mt->begin_setters (mid); + MethodTableEntry::method_iterator end_setters = mt->end_setters (mid); + MethodTableEntry::method_iterator begin_getters = mt->begin_getters (mid); + MethodTableEntry::method_iterator end_getters = mt->end_getters (mid); + int setter_mid = begin_setters != end_setters ? int (mid) : -1; + int getter_mid = begin_getters != end_getters ? int (mid) : -1; - MethodTableEntry::method_iterator begin_setters = mt->begin_setters (mid); - MethodTableEntry::method_iterator end_setters = mt->end_setters (mid); - MethodTableEntry::method_iterator begin_getters = mt->begin_getters (mid); - MethodTableEntry::method_iterator end_getters = mt->end_getters (mid); - int setter_mid = begin_setters != end_setters ? int (mid) : -1; - int getter_mid = begin_getters != end_getters ? int (mid) : -1; + bool is_static = false; + if (begin_setters != end_setters) { + is_static = (*begin_setters)->is_static (); + } else if (begin_getters != end_getters) { + is_static = (*begin_getters)->is_static (); + } - bool is_static = false; - if (begin_setters != end_setters) { - is_static = (*begin_setters)->is_static (); - } else if (begin_getters != end_getters) { - is_static = (*begin_getters)->is_static (); - } + if (! as_static || is_static) { const std::string &name = mt->property_name (mid); @@ -479,65 +479,63 @@ public: } - // collect the names which have been disambiguated static/non-static wise - std::vector disambiguated_names; + if (! as_static) { - // produce the methods now - for (size_t mid = mt->bottom_mid (); mid < mt->top_mid (); ++mid) { + // collect the names which have been disambiguated static/non-static wise + std::vector disambiguated_names; - if (! mt->is_enabled (mid)) { - continue; - } + // produce the methods now + for (size_t mid = mt->bottom_mid (); mid < mt->top_mid (); ++mid) { - std::string name = mt->name (mid); - - // does this method hide a property? -> append "_" in that case - std::pair t = mt->find_property (mt->is_static (mid), name); - if (t.first) { - name += "_"; - } - - // needs static/non-static disambiguation? - t = mt->find_method (! mt->is_static (mid), name); - if (t.first) { - - disambiguated_names.push_back (name); - if (mt->is_static (mid)) { - name = "_class_" + name; - } else { - name = "_inst_" + name; + if (! mt->is_enabled (mid)) { + continue; } - mp_module->add_python_doc (*cls, mt, int (mid), tl::sprintf (tl::to_string (tr ("This attribute is available as '%s' in Python")), name)); + std::string name = mt->name (mid); - } else if (is_reserved_word (name)) { - - // drop non-standard names - if (tl::verbosity () >= 20) { - tl::warn << tl::to_string (tr ("Class ")) << cls->name () << ": " << tl::to_string (tr ("no Python mapping for method (reserved word) ")) << name; + // does this method hide a property? -> append "_" in that case + std::pair t = mt->find_property (mt->is_static (mid), name); + if (t.first) { + name += "_"; } - name += "_"; + // needs static/non-static disambiguation? + t = mt->find_method (! mt->is_static (mid), name); + if (t.first) { - mt->rename (mid, name); - mp_module->add_python_doc (*cls, mt, int (mid), tl::sprintf (tl::to_string (tr ("This attribute is available as '%s' in Python")), name)); + disambiguated_names.push_back (name); + if (mt->is_static (mid)) { + name = "_class_" + name; + } else { + name = "_inst_" + name; + } - } + mp_module->add_python_doc (*cls, mt, int (mid), tl::sprintf (tl::to_string (tr ("This attribute is available as '%s' in Python")), name)); + + } else if (is_reserved_word (name)) { + + // drop non-standard names + if (tl::verbosity () >= 20) { + tl::warn << tl::to_string (tr ("Class ")) << cls->name () << ": " << tl::to_string (tr ("no Python mapping for method (reserved word) ")) << name; + } + + name += "_"; + + mt->rename (mid, name); + mp_module->add_python_doc (*cls, mt, int (mid), tl::sprintf (tl::to_string (tr ("This attribute is available as '%s' in Python")), name)); - // create documentation - std::string doc; - for (MethodTableEntry::method_iterator m = mt->begin (mid); m != mt->end (mid); ++m) { - if (! doc.empty ()) { - doc = "\n\n"; } - doc += (*m)->doc (); - } - const gsi::MethodBase *m_first = *mt->begin (mid); + // create documentation + std::string doc; + for (MethodTableEntry::method_iterator m = mt->begin (mid); m != mt->end (mid); ++m) { + if (! doc.empty ()) { + doc = "\n\n"; + } + doc += (*m)->doc (); + } - if (! mt->is_static (mid)) { // Bound methods - - if (! as_static) { + if (! mt->is_static (mid)) { // Bound methods PyMethodDef *method = mp_module->make_method_def (); method->ml_name = mp_module->make_string (name); @@ -552,42 +550,21 @@ public: PythonRef attr = PythonRef (PyDescr_NewMethod (type, method)); set_type_attr (type, name, attr); - } + } else { // Class methods - } else if (isupper (name [0]) || m_first->is_const ()) { + PyMethodDef *method = mp_module->make_method_def (); + method->ml_name = mp_module->make_string (name); + method->ml_meth = (PyCFunction) get_method_adaptor (mid); + method->ml_doc = mp_module->make_string (doc); + method->ml_flags = METH_VARARGS | METH_CLASS; - if ((mt->end (mid) - mt->begin (mid)) == 1 && m_first->begin_arguments () == m_first->end_arguments ()) { - - // static methods without arguments which start with a capital letter are treated as constants - PYAStaticAttributeDescriptorObject *desc = PYAStaticAttributeDescriptorObject::create (mp_module->make_string (name)); - desc->type = type; - desc->getter = get_method_adaptor (mid); - - PythonRef attr (desc); + PythonRef attr = PythonRef (PyDescr_NewClassMethod (type, method)); set_type_attr (type, name, attr); - } else if (tl::verbosity () >= 20) { - tl::warn << "Upper case method name encountered which cannot be used as a Python constant (more than one overload or at least one argument): " << cls->name () << "." << name; - mp_module->add_python_doc (*cls, mt, int (mid), tl::to_string (tr ("This attribute is not available for Python"))); } - } else if (! as_static) { // Class methods - - PyMethodDef *method = mp_module->make_method_def (); - method->ml_name = mp_module->make_string (name); - method->ml_meth = (PyCFunction) get_method_adaptor (mid); - method->ml_doc = mp_module->make_string (doc); - method->ml_flags = METH_VARARGS | METH_CLASS; - - PythonRef attr = PythonRef (PyDescr_NewClassMethod (type, method)); - set_type_attr (type, name, attr); - } - } - - if (! as_static) { - // Complete the comparison operators if necessary. // Unlike Ruby, Python does not automatically implement != from == for example. // We assume that "==" and "<" are the minimum requirements for full comparison @@ -663,44 +640,44 @@ public: } - } + // install the static/non-static dispatcher descriptor - // install the static/non-static dispatcher descriptor + std::sort (disambiguated_names.begin (), disambiguated_names.end ()); + disambiguated_names.erase (std::unique (disambiguated_names.begin (), disambiguated_names.end ()), disambiguated_names.end ()); - std::sort (disambiguated_names.begin (), disambiguated_names.end ()); - disambiguated_names.erase (std::unique (disambiguated_names.begin (), disambiguated_names.end ()), disambiguated_names.end ()); + for (std::vector::const_iterator a = disambiguated_names.begin (); a != disambiguated_names.end (); ++a) { - for (std::vector::const_iterator a = disambiguated_names.begin (); a != disambiguated_names.end (); ++a) { - - std::pair pa; - pa = mt->find_method (true, *a); - if (pa.first) { - mt->alias (pa.second, "_class_" + *a); - } - pa = mt->find_method (false, *a); - if (pa.first) { - mt->alias (pa.second, "_inst_" + *a); - } - - PyObject *attr_inst = PyObject_GetAttrString ((PyObject *) type, ("_inst_" + *a).c_str ()); - PyObject *attr_class = PyObject_GetAttrString ((PyObject *) type, ("_class_" + *a).c_str ()); - if (attr_inst == NULL || attr_class == NULL) { - - // some error -> don't install the disambiguator - Py_XDECREF (attr_inst); - Py_XDECREF (attr_class); - PyErr_Clear (); - - if (tl::verbosity () >= 20) { - tl::warn << "Unable to install a static/non-static disambiguator for " << *a << " in class " << cls->name (); + std::pair pa; + pa = mt->find_method (true, *a); + if (pa.first) { + mt->alias (pa.second, "_class_" + *a); + } + pa = mt->find_method (false, *a); + if (pa.first) { + mt->alias (pa.second, "_inst_" + *a); } - } else { + PyObject *attr_inst = PyObject_GetAttrString ((PyObject *) type, ("_inst_" + *a).c_str ()); + PyObject *attr_class = PyObject_GetAttrString ((PyObject *) type, ("_class_" + *a).c_str ()); + if (attr_inst == NULL || attr_class == NULL) { - PyObject *desc = PYAAmbiguousMethodDispatcher::create (attr_inst, attr_class); - PythonRef name (c2python (*a)); - // Note: we use GenericSetAttr since that one allows us setting attributes on built-in types - PyObject_GenericSetAttr ((PyObject *) type, name.get (), desc); + // some error -> don't install the disambiguator + Py_XDECREF (attr_inst); + Py_XDECREF (attr_class); + PyErr_Clear (); + + if (tl::verbosity () >= 20) { + tl::warn << "Unable to install a static/non-static disambiguator for " << *a << " in class " << cls->name (); + } + + } else { + + PyObject *desc = PYAAmbiguousMethodDispatcher::create (attr_inst, attr_class); + PythonRef name (c2python (*a)); + // Note: we use GenericSetAttr since that one allows us setting attributes on built-in types + PyObject_GenericSetAttr ((PyObject *) type, name.get (), desc); + + } } From a39d22c438d7fd1995ce9795186118da47b1a332 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 24 Oct 2022 19:44:28 +0200 Subject: [PATCH 09/15] Fixed problems with reserved words --- src/pya/pya/pyaInternal.cc | 83 +- src/pya/pya/pyaInternal.h | 2 + src/pya/pya/pyaModule.cc | 55 - src/pymod/distutils_src/klayout/dbcore.pyi | 49993 +++++++++++------- src/pymod/distutils_src/klayout/laycore.pyi | 12905 +++++ src/pymod/distutils_src/klayout/libcore.pyi | 4 + src/pymod/distutils_src/klayout/rdbcore.pyi | 307 +- src/pymod/distutils_src/klayout/tlcore.pyi | 946 +- 8 files changed, 44363 insertions(+), 19932 deletions(-) create mode 100644 src/pymod/distutils_src/klayout/laycore.pyi create mode 100644 src/pymod/distutils_src/klayout/libcore.pyi diff --git a/src/pya/pya/pyaInternal.cc b/src/pya/pya/pyaInternal.cc index 88f973550..a4d2e3934 100644 --- a/src/pya/pya/pyaInternal.cc +++ b/src/pya/pya/pyaInternal.cc @@ -249,6 +249,45 @@ MethodTable::is_property_getter (bool st, const std::string &name) return (begin_getters (p.second) != end_getters (p.second)); } +/** + * @brief Returns true, if the name is a reserved keyword + */ +static bool is_reserved_word (const std::string &name) +{ + return (name == "and" || + name == "del" || + name == "from" || + name == "not" || + name == "while" || + name == "as" || + name == "elif" || + name == "global" || + name == "or" || + name == "with" || + name == "assert" || + name == "else" || + name == "if" || + name == "pass" || + name == "yield" || + name == "break" || + name == "except" || + name == "import" || + name == "print" || + name == "class" || + name == "exec" || + name == "in" || + name == "raise" || + name == "continue" || + name == "finally" || + name == "is" || + name == "return" || + name == "def" || + name == "for" || + name == "lambda" || + name == "try" || + name == "None"); +} + /** * @brief Extracts the Python name from a generic name * @@ -374,7 +413,19 @@ static std::string extract_python_name (const std::string &name) void MethodTable::add_method (const std::string &name, const gsi::MethodBase *mb) { - if (name == "new" && mb->ret_type ().type () == gsi::T_object && mb->ret_type ().pass_obj ()) { + if (is_reserved_word (name)) { + + // drop non-standard names + if (tl::verbosity () >= 20) { + tl::warn << tl::to_string (tr ("Class ")) << mp_cls_decl->name () << ": " << tl::to_string (tr ("no Python mapping for method (reserved word) ")) << name; + } + + std::string new_name = name + "_"; + + add_method_basic (new_name, mb); + mp_module->add_python_doc (mb, tl::sprintf (tl::to_string (tr ("This attribute is available as '%s' in Python")), new_name)); + + } else if (name == "new" && mb->ret_type ().type () == gsi::T_object && mb->ret_type ().pass_obj ()) { add_method_basic (name, mb); @@ -482,6 +533,21 @@ MethodTable::add_method (const std::string &name, const gsi::MethodBase *mb) void MethodTable::add_setter (const std::string &name, const gsi::MethodBase *setter) +{ + if (is_reserved_word (name)) { + + std::string new_name = name + "_"; + + add_setter_basic (new_name, setter); + mp_module->add_python_doc (setter, tl::sprintf (tl::to_string (tr ("This attribute setter is available as '%s' in Python")), new_name)); + + } else { + add_setter_basic (name, setter); + } +} + +void +MethodTable::add_setter_basic (const std::string &name, const gsi::MethodBase *setter) { bool st = setter->is_static (); @@ -501,6 +567,21 @@ MethodTable::add_setter (const std::string &name, const gsi::MethodBase *setter) void MethodTable::add_getter (const std::string &name, const gsi::MethodBase *getter) +{ + if (is_reserved_word (name)) { + + std::string new_name = name + "_"; + + add_getter_basic (new_name, getter); + mp_module->add_python_doc (getter, tl::sprintf (tl::to_string (tr ("This attribute getter is available as '%s' in Python")), new_name)); + + } else { + add_getter_basic (name, getter); + } +} + +void +MethodTable::add_getter_basic (const std::string &name, const gsi::MethodBase *getter) { bool st = getter->is_static (); diff --git a/src/pya/pya/pyaInternal.h b/src/pya/pya/pyaInternal.h index b4055391b..0cbd071ae 100644 --- a/src/pya/pya/pyaInternal.h +++ b/src/pya/pya/pyaInternal.h @@ -278,6 +278,8 @@ private: PythonModule *mp_module; void add_method_basic (const std::string &name, const gsi::MethodBase *mb, bool enabled = true, bool init = false); + void add_setter_basic (const std::string &name, const gsi::MethodBase *setter); + void add_getter_basic (const std::string &name, const gsi::MethodBase *getter); bool is_property_setter (bool st, const std::string &name); bool is_property_getter (bool st, const std::string &name); }; diff --git a/src/pya/pya/pyaModule.cc b/src/pya/pya/pyaModule.cc index 611ae3a63..d88ebd126 100644 --- a/src/pya/pya/pyaModule.cc +++ b/src/pya/pya/pyaModule.cc @@ -53,49 +53,6 @@ set_type_attr (PyTypeObject *type, const std::string &name, PythonRef &attr) } } -// -------------------------------------------------------------------------- -// Name conversion helpers - -/** - * @brief Returns true, if the name is a reserved keyword - */ -static bool is_reserved_word (const std::string &name) -{ - return (name == "and" || - name == "del" || - name == "from" || - name == "not" || - name == "while" || - name == "as" || - name == "elif" || - name == "global" || - name == "or" || - name == "with" || - name == "assert" || - name == "else" || - name == "if" || - name == "pass" || - name == "yield" || - name == "break" || - name == "except" || - name == "import" || - name == "print" || - name == "class" || - name == "exec" || - name == "in" || - name == "raise" || - name == "continue" || - name == "finally" || - name == "is" || - name == "return" || - name == "def" || - name == "for" || - name == "lambda" || - name == "try" || - name == "None"); -} - - // -------------------------------------------------------------------------- // The PythonModule implementation @@ -512,18 +469,6 @@ public: mp_module->add_python_doc (*cls, mt, int (mid), tl::sprintf (tl::to_string (tr ("This attribute is available as '%s' in Python")), name)); - } else if (is_reserved_word (name)) { - - // drop non-standard names - if (tl::verbosity () >= 20) { - tl::warn << tl::to_string (tr ("Class ")) << cls->name () << ": " << tl::to_string (tr ("no Python mapping for method (reserved word) ")) << name; - } - - name += "_"; - - mt->rename (mid, name); - mp_module->add_python_doc (*cls, mt, int (mid), tl::sprintf (tl::to_string (tr ("This attribute is available as '%s' in Python")), name)); - } // create documentation diff --git a/src/pymod/distutils_src/klayout/dbcore.pyi b/src/pymod/distutils_src/klayout/dbcore.pyi index 40b890ac0..e3039a029 100644 --- a/src/pymod/distutils_src/klayout/dbcore.pyi +++ b/src/pymod/distutils_src/klayout/dbcore.pyi @@ -1,6 +1,5 @@ from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional from typing import overload -import klayout.rdb as rdb import klayout.tl as tl class Box: r""" @@ -24,35 +23,60 @@ class Box: """ bottom: int r""" + Getter: @brief Gets the bottom coordinate of the box + + Setter: @brief Sets the bottom coordinate of the box """ left: int r""" + Getter: @brief Gets the left coordinate of the box + + Setter: @brief Sets the left coordinate of the box """ p1: Point r""" + Getter: @brief Gets the lower left point of the box + + Setter: @brief Sets the lower left point of the box """ p2: Point r""" + Getter: @brief Gets the upper right point of the box + + Setter: @brief Sets the upper right point of the box """ right: int r""" + Getter: @brief Gets the right coordinate of the box + + Setter: @brief Sets the right coordinate of the box """ top: int r""" + Getter: @brief Gets the top coordinate of the box + + Setter: @brief Sets the top coordinate of the box """ @classmethod + def from_dbox(cls, dbox: DBox) -> Box: + r""" + @brief Creates an integer coordinate box from a floating-point coordinate box + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dbox'. + """ + @classmethod def from_s(cls, s: str) -> Box: r""" @brief Creates a box object from a string @@ -61,6 +85,56 @@ class Box: This method has been added in version 0.23. """ @overload + @classmethod + def new(cls) -> Box: + r""" + @brief Creates an empty (invalid) box + + Empty boxes don't modify a box when joined with it. The intersection between an empty and any other box is also an empty box. The width, height, p1 and p2 attributes of an empty box are undefined. Use \empty? to get a value indicating whether the box is empty. + """ + @overload + @classmethod + def new(cls, dbox: DBox) -> Box: + r""" + @brief Creates an integer coordinate box from a floating-point coordinate box + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dbox'. + """ + @overload + @classmethod + def new(cls, lower_left: Point, upper_right: Point) -> Box: + r""" + @brief Creates a box from two points + + + Two points are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. + """ + @overload + @classmethod + def new(cls, left: int, bottom: int, right: int, top: int) -> Box: + r""" + @brief Creates a box with four coordinates + + + Four coordinates are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. + """ + @classmethod + def world(cls) -> Box: + r""" + @brief Gets the 'world' box + The world box is the biggest box that can be represented. So it is basically 'all'. The world box behaves neutral on intersections for example. In other operations such as displacement or transformations, the world box may render unexpected results because of coordinate overflow. + + The world box can be used + @ul + @li for comparison ('==', '!=', '<') @/li + @li in union and intersection ('+' and '&') @/li + @li in relations (\contains?, \overlaps?, \touches?) @/li + @li as 'all' argument in region queries @/li + @/ul + + This method has been introduced in version 0.28. + """ + @overload def __add__(self, box: Box) -> Box: r""" @brief Joins two boxes @@ -190,12 +264,6 @@ class Box: @brief Returns true if this box is not equal to the other box Returns true, if this box and the given box are not equal """ - def __repr__(self) -> str: - r""" - @brief Returns a string representing this box - - This string can be turned into a box again by using \from_s - """ @overload def __rmul__(self, box: Box) -> Box: r""" @@ -226,11 +294,14 @@ class Box: @return The scaled box """ - def __str__(self) -> str: + def __str__(self, dbu: Optional[float] = ...) -> str: r""" @brief Returns a string representing this box This string can be turned into a box again by using \from_s + . If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. """ def _create(self) -> None: r""" @@ -314,6 +385,23 @@ class Box: @return true if the point is inside the box. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> Box: r""" @brief Creates a copy of self @@ -402,6 +490,12 @@ class Box: Returns true, if this box is inside the given box, i.e. the box intersection renders this box """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_point(self) -> bool: r""" @brief Returns true, if the box is a single point @@ -478,11 +572,14 @@ class Box: This method has been introduced in version 0.25. """ - def to_s(self) -> str: + def to_s(self, dbu: Optional[float] = ...) -> str: r""" @brief Returns a string representing this box This string can be turned into a box again by using \from_s + . If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. """ def touches(self, box: Box) -> bool: r""" @@ -547,35 +644,60 @@ class DBox: """ bottom: float r""" + Getter: @brief Gets the bottom coordinate of the box + + Setter: @brief Sets the bottom coordinate of the box """ left: float r""" + Getter: @brief Gets the left coordinate of the box + + Setter: @brief Sets the left coordinate of the box """ p1: DPoint r""" + Getter: @brief Gets the lower left point of the box + + Setter: @brief Sets the lower left point of the box """ p2: DPoint r""" + Getter: @brief Gets the upper right point of the box + + Setter: @brief Sets the upper right point of the box """ right: float r""" + Getter: @brief Gets the right coordinate of the box + + Setter: @brief Sets the right coordinate of the box """ top: float r""" + Getter: @brief Gets the top coordinate of the box + + Setter: @brief Sets the top coordinate of the box """ @classmethod + def from_ibox(cls, box: Box) -> DBox: + r""" + @brief Creates a floating-point coordinate box from an integer coordinate box + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ibox'. + """ + @classmethod def from_s(cls, s: str) -> DBox: r""" @brief Creates a box object from a string @@ -584,6 +706,56 @@ class DBox: This method has been added in version 0.23. """ @overload + @classmethod + def new(cls) -> DBox: + r""" + @brief Creates an empty (invalid) box + + Empty boxes don't modify a box when joined with it. The intersection between an empty and any other box is also an empty box. The width, height, p1 and p2 attributes of an empty box are undefined. Use \empty? to get a value indicating whether the box is empty. + """ + @overload + @classmethod + def new(cls, box: Box) -> DBox: + r""" + @brief Creates a floating-point coordinate box from an integer coordinate box + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ibox'. + """ + @overload + @classmethod + def new(cls, lower_left: DPoint, upper_right: DPoint) -> DBox: + r""" + @brief Creates a box from two points + + + Two points are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. + """ + @overload + @classmethod + def new(cls, left: float, bottom: float, right: float, top: float) -> DBox: + r""" + @brief Creates a box with four coordinates + + + Four coordinates are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. + """ + @classmethod + def world(cls) -> DBox: + r""" + @brief Gets the 'world' box + The world box is the biggest box that can be represented. So it is basically 'all'. The world box behaves neutral on intersections for example. In other operations such as displacement or transformations, the world box may render unexpected results because of coordinate overflow. + + The world box can be used + @ul + @li for comparison ('==', '!=', '<') @/li + @li in union and intersection ('+' and '&') @/li + @li in relations (\contains?, \overlaps?, \touches?) @/li + @li as 'all' argument in region queries @/li + @/ul + + This method has been introduced in version 0.28. + """ + @overload def __add__(self, box: DBox) -> DBox: r""" @brief Joins two boxes @@ -713,12 +885,6 @@ class DBox: @brief Returns true if this box is not equal to the other box Returns true, if this box and the given box are not equal """ - def __repr__(self) -> str: - r""" - @brief Returns a string representing this box - - This string can be turned into a box again by using \from_s - """ @overload def __rmul__(self, box: DBox) -> DBox: r""" @@ -749,11 +915,14 @@ class DBox: @return The scaled box """ - def __str__(self) -> str: + def __str__(self, dbu: Optional[float] = ...) -> str: r""" @brief Returns a string representing this box This string can be turned into a box again by using \from_s + . If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. """ def _create(self) -> None: r""" @@ -837,6 +1006,23 @@ class DBox: @return true if the point is inside the box. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> DBox: r""" @brief Creates a copy of self @@ -925,6 +1111,12 @@ class DBox: Returns true, if this box is inside the given box, i.e. the box intersection renders this box """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_point(self) -> bool: r""" @brief Returns true, if the box is a single point @@ -1001,11 +1193,14 @@ class DBox: This method has been introduced in version 0.25. """ - def to_s(self) -> str: + def to_s(self, dbu: Optional[float] = ...) -> str: r""" @brief Returns a string representing this box This string can be turned into a box again by using \from_s + . If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. """ def touches(self, box: DBox) -> bool: r""" @@ -1066,9 +1261,20 @@ class Cell: See @The Database API@ for more details about the database objects like the Cell class. """ - ghost_cell: None + ghost_cell: bool r""" - WARNING: This variable can only be set, not retrieved. + Getter: + @brief Returns a value indicating whether the cell is a "ghost cell" + + The ghost cell flag is used by the GDS reader for example to indicate that + the cell is not located inside the file. Upon writing the reader can determine + whether to write the cell or not. + To satisfy the references inside the layout, a dummy cell is created in this case + which has the "ghost cell" flag set to true. + + This method has been introduced in version 0.20. + + Setter: @brief Sets the "ghost cell" flag See \is_ghost_cell? for a description of this property. @@ -1077,9 +1283,14 @@ class Cell: """ name: str r""" + Getter: @brief Gets the cell's name + This may be an internal name for proxy cells. See \basic_name for the formal name (PCell name or library cell name). + This method has been introduced in version 0.22. + + Setter: @brief Renames the cell Renaming a cell may cause name clashes, i.e. the name may be identical to the name of another cell. This does not have any immediate effect, but the cell needs to be renamed, for example when writing the layout to a GDS file. @@ -1088,13 +1299,21 @@ class Cell: """ prop_id: int r""" + Getter: @brief Gets the properties ID associated with the cell - This method has been introduced in version 0.23.@brief Sets the properties ID associated with the cell + This method has been introduced in version 0.23. + Setter: + @brief Sets the properties ID associated with the cell This method is provided, if a properties ID has been derived already. Usually it's more convenient to use \delete_property, \set_property or \property. This method has been introduced in version 0.23. """ + @classmethod + def new(cls) -> Cell: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> Cell: r""" @brief Creates a copy of the cell @@ -1155,13 +1374,25 @@ class Cell: This method has been introduced in version 0.22. """ + @overload def bbox(self) -> Box: r""" @brief Gets the bounding box of the cell @return The bounding box of the cell - The bounding box is computed over all layers. To compute the bounding box over single layers, use \bbox_per_layer. + The bounding box is computed over all layers. To compute the bounding box over single layers, use \bbox with a layer index argument. + """ + @overload + def bbox(self, layer_index: int) -> Box: + r""" + @brief Gets the per-layer bounding box of the cell + + @return The bounding box of the cell considering only the given layer + + The bounding box is the box enclosing all shapes on the given layer. + + 'bbox' is the preferred synonym since version 0.28. """ def bbox_per_layer(self, layer_index: int) -> Box: r""" @@ -1170,6 +1401,8 @@ class Cell: @return The bounding box of the cell considering only the given layer The bounding box is the box enclosing all shapes on the given layer. + + 'bbox' is the preferred synonym since version 0.28. """ def begin_instances_rec(self) -> RecursiveInstanceIterator: r""" @@ -1495,16 +1728,33 @@ class Cell: This method has been added in version 0.23. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + @overload def dbbox(self) -> DBox: r""" @brief Gets the bounding box of the cell in micrometer units @return The bounding box of the cell - The bounding box is computed over all layers. To compute the bounding box over single layers, use \dbbox_per_layer. + The bounding box is computed over all layers. To compute the bounding box over single layers, use \dbbox with a layer index argument. This method has been introduced in version 0.25. """ + @overload + def dbbox(self, layer_index: int) -> DBox: + r""" + @brief Gets the per-layer bounding box of the cell in micrometer units + + @return The bounding box of the cell considering only the given layer + + The bounding box is the box enclosing all shapes on the given layer. + + This method has been introduced in version 0.25. 'dbbox' is the preferred synonym since version 0.28. + """ def dbbox_per_layer(self, layer_index: int) -> DBox: r""" @brief Gets the per-layer bounding box of the cell in micrometer units @@ -1513,7 +1763,7 @@ class Cell: The bounding box is the box enclosing all shapes on the given layer. - This method has been introduced in version 0.25. + This method has been introduced in version 0.25. 'dbbox' is the preferred synonym since version 0.28. """ def delete(self) -> None: r""" @@ -1538,6 +1788,18 @@ class Cell: This method has been introduced in version 0.23. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def display_title(self) -> str: r""" @brief Returns a nice looking name for display purposes @@ -1903,6 +2165,12 @@ class Cell: This variant has been introduced in version 0.25. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_empty(self) -> bool: r""" @brief Returns a value indicating whether the cell is empty @@ -1987,10 +2255,18 @@ class Cell: This method has been introduced in version 0.16. If the instance represented by the given reference has been deleted, this method returns false. If however, another instance has been inserted already that occupies the original instances position, this method will return true again. """ + @overload def layout(self) -> Layout: r""" @brief Returns a reference to the layout where the cell resides + this method has been introduced in version 0.22. + """ + @overload + def layout(self) -> Layout: + r""" + @brief Returns a reference to the layout where the cell resides (const references) + this method has been introduced in version 0.22. """ def library(self) -> Library: @@ -2301,6 +2577,41 @@ class Cell: This method has been introduced in version 0.25. """ + @overload + def read(self, file_name: str) -> List[int]: + r""" + @brief Reads a layout file into this cell + This version uses the default options for reading the file. + + This method has been introduced in version 0.28. + """ + @overload + def read(self, file_name: str, options: LoadLayoutOptions) -> List[int]: + r""" + @brief Reads a layout file into this cell + + @param file_name The path of the file to read + @param options The reader options to use + @return The indexes of the cells created during the reading (new child cells) + + The format of the file will be determined from the file name. The layout will be read into the cell, potentially creating new layers and a subhierarchy of cells below this cell. + + This feature is equivalent to the following code: + + @code + def Cell.read(file_name, options) + layout = RBA::Layout::new + layout.read(file_name, options) + cm = RBA::CellMapping::new + cm.for_single_cell_full(self, layout.top_cell) + self.move_tree_shapes(layout.top_cell) + end + @/code + + See \move_tree_shapes and \CellMapping for more details and how to implement more elaborate schemes. + + This method has been introduced in version 0.28. + """ def refresh(self) -> None: r""" @brief Refreshes a proxy cell @@ -2364,6 +2675,7 @@ class Cell: This method may change the properties ID. Note: GDS only supports integer keys. OASIS supports numeric and string keys. This method has been introduced in version 0.23. """ + @overload def shapes(self, layer_index: int) -> Shapes: r""" @brief Returns the shapes list of the given layer @@ -2375,6 +2687,19 @@ class Cell: @return A reference to the shapes list """ + @overload + def shapes(self, layer_index: int) -> Shapes: + r""" + @brief Returns the shapes list of the given layer (const version) + + This method gives access to the shapes list on a certain layer. This is the const version - only const (reading) methods can be called on the returned object. + + @param index The layer index of the shapes list to retrieve + + @return A reference to the shapes list + + This variant has been introduced in version 0.26.4. + """ def swap(self, layer_index1: int, layer_index2: int) -> None: r""" @brief Swaps the layers given @@ -2560,9 +2885,12 @@ class Instance: """ a: Vector r""" + Getter: @brief Returns the displacement vector for the 'a' axis - Starting with version 0.25 the displacement is of vector type.@brief Sets the displacement vector for the 'a' axis + Starting with version 0.25 the displacement is of vector type. + Setter: + @brief Sets the displacement vector for the 'a' axis If the instance was not an array instance before it is made one. @@ -2570,9 +2898,12 @@ class Instance: """ b: Vector r""" + Getter: @brief Returns the displacement vector for the 'b' axis - Starting with version 0.25 the displacement is of vector type.@brief Sets the displacement vector for the 'b' axis + Starting with version 0.25 the displacement is of vector type. + Setter: + @brief Sets the displacement vector for the 'b' axis If the instance was not an array instance before it is made one. @@ -2580,11 +2911,14 @@ class Instance: """ cell: Cell r""" + Getter: @brief Gets the \Cell object of the cell this instance refers to Please note that before version 0.23 this method returned the cell the instance is contained in. For consistency, this method has been renamed \parent_cell. - This method has been introduced in version 0.23.@brief Sets the \Cell object this instance refers to + This method has been introduced in version 0.23. + Setter: + @brief Sets the \Cell object this instance refers to Setting the cell object to nil is equivalent to deleting the instance. @@ -2592,32 +2926,44 @@ class Instance: """ cell_index: int r""" + Getter: @brief Get the index of the cell this instance refers to + + Setter: @brief Sets the index of the cell this instance refers to This method has been introduced in version 0.23. """ cell_inst: CellInstArray r""" - @brief Gets the basic \CellInstArray object associated with this instance reference.@brief Changes the \CellInstArray object to the given one. + Getter: + @brief Gets the basic \CellInstArray object associated with this instance reference. + Setter: + @brief Changes the \CellInstArray object to the given one. This method replaces the instance by the given CellInstArray object. This method has been introduced in version 0.22 """ cplx_trans: ICplxTrans r""" + Getter: @brief Gets the complex transformation of the instance or the first instance in the array - This method is always valid compared to \trans, since simple transformations can be expressed as complex transformations as well.@brief Sets the complex transformation of the instance or the first instance in the array + This method is always valid compared to \trans, since simple transformations can be expressed as complex transformations as well. + Setter: + @brief Sets the complex transformation of the instance or the first instance in the array This method has been introduced in version 0.23. """ da: DVector r""" + Getter: @brief Returns the displacement vector for the 'a' axis in micrometer units Like \a, this method returns the displacement, but it will be translated to database units internally. - This method has been introduced in version 0.25.@brief Sets the displacement vector for the 'a' axis in micrometer units + This method has been introduced in version 0.25. + Setter: + @brief Sets the displacement vector for the 'a' axis in micrometer units Like \a= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally. @@ -2625,11 +2971,14 @@ class Instance: """ db: DVector r""" + Getter: @brief Returns the displacement vector for the 'b' axis in micrometer units Like \b, this method returns the displacement, but it will be translated to database units internally. - This method has been introduced in version 0.25.@brief Sets the displacement vector for the 'b' axis in micrometer units + This method has been introduced in version 0.25. + Setter: + @brief Sets the displacement vector for the 'b' axis in micrometer units Like \b= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally. @@ -2637,19 +2986,25 @@ class Instance: """ dcell_inst: DCellInstArray r""" + Getter: @brief Returns the micrometer unit version of the basic cell instance array object. - This method has been introduced in version 0.25@brief Returns the basic cell instance array object by giving a micrometer unit object. + This method has been introduced in version 0.25 + Setter: + @brief Returns the basic cell instance array object by giving a micrometer unit object. This method replaces the instance by the given CellInstArray object and it internally transformed into database units. This method has been introduced in version 0.25 """ dcplx_trans: DCplxTrans r""" + Getter: @brief Gets the complex transformation of the instance or the first instance in the array (in micrometer units) This method returns the same transformation as \cplx_trans, but the displacement of this transformation is given in micrometer units. It is internally translated from database units into micrometers. This method has been introduced in version 0.25. + + Setter: @brief Sets the complex transformation of the instance or the first instance in the array (in micrometer units) This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units. @@ -2657,10 +3012,13 @@ class Instance: """ dtrans: DTrans r""" + Getter: @brief Gets the transformation of the instance or the first instance in the array (in micrometer units) This method returns the same transformation as \cplx_trans, but the displacement of this transformation is given in micrometer units. It is internally translated from database units into micrometers. This method has been introduced in version 0.25. + + Setter: @brief Sets the transformation of the instance or the first instance in the array (in micrometer units) This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units. @@ -2668,7 +3026,10 @@ class Instance: """ na: int r""" + Getter: @brief Returns the number of instances in the 'a' axis + + Setter: @brief Sets the number of instances in the 'a' axis If the instance was not an array instance before it is made one. @@ -2677,7 +3038,10 @@ class Instance: """ nb: int r""" + Getter: @brief Returns the number of instances in the 'b' axis + + Setter: @brief Sets the number of instances in the 'b' axis If the instance was not an array instance before it is made one. @@ -2686,11 +3050,14 @@ class Instance: """ parent_cell: Cell r""" + Getter: @brief Gets the cell this instance is contained in Returns nil if the instance does not live inside a cell. This method was named "cell" previously which lead to confusion with \cell_index. It was renamed to "parent_cell" in version 0.23. + + Setter: @brief Moves the instance to a different cell Both the current and the target cell must live in the same layout. @@ -2699,7 +3066,10 @@ class Instance: """ prop_id: int r""" + Getter: @brief Gets the properties ID associated with the instance + + Setter: @brief Sets the properties ID associated with the instance This method is provided, if a properties ID has been derived already. Usually it's more convenient to use \delete_property, \set_property or \property. @@ -2707,11 +3077,19 @@ class Instance: """ trans: Trans r""" + Getter: @brief Gets the transformation of the instance or the first instance in the array - The transformation returned is only valid if the array does not represent a complex transformation array@brief Sets the transformation of the instance or the first instance in the array + The transformation returned is only valid if the array does not represent a complex transformation array + Setter: + @brief Sets the transformation of the instance or the first instance in the array This method has been introduced in version 0.23. """ + @classmethod + def new(cls) -> Instance: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> Instance: r""" @brief Creates a copy of self @@ -2746,12 +3124,6 @@ class Instance: @brief Tests for inequality of two Instance objects Warning: this operator returns true if both objects refer to the same instance, not just identical ones. """ - def __repr__(self) -> str: - r""" - @brief Creates a string showing the contents of the reference - - This method has been introduced with version 0.16. - """ def __setitem__(self, key: Any, value: Any) -> None: r""" @brief Sets the user property with the given key or, if available, the PCell parameter with the name given by the key @@ -2805,18 +3177,35 @@ class Instance: r""" @brief Assigns another object to self """ + @overload def bbox(self) -> Box: r""" @brief Gets the bounding box of the instance The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array). This method has been introduced in version 0.23. """ + @overload + def bbox(self, layer_index: int) -> Box: + r""" + @brief Gets the bounding box of the instance for a given layer + @param layer_index The index of the layer the bounding box will be computed for. + The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array) for the given layer. If the layer is empty in this cell and all it's children', an empty bounding box will be returned. + This method has been introduced in version 0.25. 'bbox' is the preferred synonym for it since version 0.28. + """ def bbox_per_layer(self, layer_index: int) -> Box: r""" @brief Gets the bounding box of the instance for a given layer @param layer_index The index of the layer the bounding box will be computed for. The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array) for the given layer. If the layer is empty in this cell and all it's children', an empty bounding box will be returned. - This method has been introduced in version 0.25. + This method has been introduced in version 0.25. 'bbox' is the preferred synonym for it since version 0.28. + """ + def cell(self) -> Cell: + r""" + @brief Gets the \Cell object of the cell this instance refers to + + This is the const version of the \cell method. It will return a const \Cell object and itself can be called on a const \Instance object. + + This variant has been introduced in version 0.25. """ def change_pcell_parameter(self, name: str, value: Any) -> None: r""" @@ -2854,6 +3243,12 @@ class Instance: This method has been introduced in version 0.24. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + @overload def dbbox(self) -> DBox: r""" @brief Gets the bounding box of the instance in micron units @@ -2861,13 +3256,22 @@ class Instance: This method has been introduced in version 0.25. """ + @overload + def dbbox(self, layer_index: int) -> DBox: + r""" + @brief Gets the bounding box of the instance in micron units + @param layer_index The index of the layer the bounding box will be computed for. + Gets the bounding box (see \bbox) of the instance, but will compute the micrometer unit box by multiplying \bbox with the database unit. + + This method has been introduced in version 0.25. 'dbbox' is the preferred synonym for it since version 0.28. + """ def dbbox_per_layer(self, layer_index: int) -> DBox: r""" @brief Gets the bounding box of the instance in micron units @param layer_index The index of the layer the bounding box will be computed for. - Gets the bounding box (see \bbox_per_layer) of the instance, but will compute the micrometer unit box by multiplying \bbox_per_layer with the database unit. + Gets the bounding box (see \bbox) of the instance, but will compute the micrometer unit box by multiplying \bbox with the database unit. - This method has been introduced in version 0.25. + This method has been introduced in version 0.25. 'dbbox' is the preferred synonym for it since version 0.28. """ def delete(self) -> None: r""" @@ -2885,6 +3289,18 @@ class Instance: This method has been introduced in version 0.22. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> Instance: r""" @brief Creates a copy of self @@ -2929,6 +3345,12 @@ class Instance: Returns true if the array represents complex instances (that is, with magnification and arbitrary rotation angles). """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_null(self) -> bool: r""" @brief Checks, if the instance is a valid one @@ -2950,12 +3372,28 @@ class Instance: This method has been introduced in version 0.23 and is a shortcut for "inst.cell.is_valid?(inst)". """ + @overload def layout(self) -> Layout: r""" @brief Gets the layout this instance is contained in This method has been introduced in version 0.22. """ + @overload + def layout(self) -> Layout: + r""" + @brief Gets the layout this instance is contained in + + This const version of the method has been introduced in version 0.25. + """ + def parent_cell(self) -> Cell: + r""" + @brief Gets the cell this instance is contained in + + Returns nil if the instance does not live inside a cell. + + This const version of the \parent_cell method has been introduced in version 0.25. + """ def pcell_declaration(self) -> PCellDeclaration_Native: r""" @brief Returns the PCell declaration object @@ -3105,6 +3543,11 @@ class ParentInstArray: See @The Database API@ for more details about the database objects. """ + @classmethod + def new(cls) -> ParentInstArray: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> ParentInstArray: r""" @brief Creates a copy of self @@ -3160,6 +3603,23 @@ class ParentInstArray: Starting with version 0.15, this method returns an \Instance object rather than a \CellInstArray reference. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> ParentInstArray: r""" @brief Creates a copy of self @@ -3168,6 +3628,12 @@ class ParentInstArray: r""" @brief Compute the inverse instance by which the parent is seen from the child """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def parent_cell_index(self) -> int: r""" @brief Gets the index of the parent cell @@ -3186,9 +3652,12 @@ class CellInstArray: """ a: Vector r""" + Getter: @brief Gets the displacement vector for the 'a' axis Starting with version 0.25 the displacement is of vector type. + + Setter: @brief Sets the displacement vector for the 'a' axis If the instance was not regular before this property is set, it will be initialized to a regular instance. @@ -3197,30 +3666,51 @@ class CellInstArray: """ b: Vector r""" + Getter: @brief Gets the displacement vector for the 'b' axis Starting with version 0.25 the displacement is of vector type. + + Setter: @brief Sets the displacement vector for the 'b' axis If the instance was not regular before this property is set, it will be initialized to a regular instance. This method was introduced in version 0.22. Starting with version 0.25 the displacement is of vector type. """ + @property + def cell(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the cell this instance refers to + This is a convenience method and equivalent to 'cell_index = cell.cell_index()'. There is no getter for the cell pointer because the \CellInstArray object only knows about cell indexes. + + This convenience method has been introduced in version 0.28. + """ cell_index: int r""" + Getter: @brief Gets the cell index of the cell instantiated + Use \Layout#cell to get the \Cell object from the cell index. + Setter: @brief Sets the index of the cell this instance refers to """ cplx_trans: ICplxTrans r""" + Getter: @brief Gets the complex transformation of the first instance in the array - This method is always applicable, compared to \trans, since simple transformations can be expressed as complex transformations as well.@brief Sets the complex transformation of the instance or the first instance in the array + This method is always applicable, compared to \trans, since simple transformations can be expressed as complex transformations as well. + Setter: + @brief Sets the complex transformation of the instance or the first instance in the array This method was introduced in version 0.22. """ na: int r""" + Getter: @brief Gets the number of instances in the 'a' axis + + Setter: @brief Sets the number of instances in the 'a' axis If the instance was not regular before this property is set to a value larger than zero, it will be initialized to a regular instance. @@ -3230,7 +3720,10 @@ class CellInstArray: """ nb: int r""" + Getter: @brief Gets the number of instances in the 'b' axis + + Setter: @brief Sets the number of instances in the 'b' axis If the instance was not regular before this property is set to a value larger than zero, it will be initialized to a regular instance. @@ -3240,11 +3733,159 @@ class CellInstArray: """ trans: Trans r""" + Getter: @brief Gets the transformation of the first instance in the array - The transformation returned is only valid if the array does not represent a complex transformation array@brief Sets the transformation of the instance or the first instance in the array + The transformation returned is only valid if the array does not represent a complex transformation array + Setter: + @brief Sets the transformation of the instance or the first instance in the array This method was introduced in version 0.22. """ + @overload + @classmethod + def new(cls) -> CellInstArray: + r""" + @brief Creates en empty cell instance with size 0 + """ + @overload + @classmethod + def new(cls, cell: Cell, disp: Vector) -> CellInstArray: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param disp The displacement + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell: Cell, trans: ICplxTrans) -> CellInstArray: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell: Cell, trans: Trans) -> CellInstArray: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param trans The transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell_index: int, disp: Vector) -> CellInstArray: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param disp The displacement + This convenience initializer has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell_index: int, trans: ICplxTrans) -> CellInstArray: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell_index The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + """ + @overload + @classmethod + def new(cls, cell_index: int, trans: Trans) -> CellInstArray: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param trans The transformation by which to instantiate the cell + """ + @overload + @classmethod + def new(cls, cell: Cell, disp: Vector, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param disp The basic displacement of the first instance + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell: Cell, trans: ICplxTrans, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell: Cell, trans: Trans, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param trans The transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell_index: int, disp: Vector, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param disp The basic displacement of the first instance + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience initializer has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell_index: int, trans: ICplxTrans, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell_index The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + Starting with version 0.25 the displacements are of vector type. + """ + @overload + @classmethod + def new(cls, cell_index: int, trans: Trans, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param trans The transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + Starting with version 0.25 the displacements are of vector type. + """ def __copy__(self) -> CellInstArray: r""" @brief Creates a copy of self @@ -3266,6 +3907,41 @@ class CellInstArray: @brief Creates en empty cell instance with size 0 """ @overload + def __init__(self, cell: Cell, disp: Vector) -> None: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param disp The displacement + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell: Cell, trans: ICplxTrans) -> None: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell: Cell, trans: Trans) -> None: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param trans The transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell_index: int, disp: Vector) -> None: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param disp The displacement + This convenience initializer has been introduced in version 0.28. + """ + @overload def __init__(self, cell_index: int, trans: ICplxTrans) -> None: r""" @brief Creates a single cell instance with a complex transformation @@ -3280,6 +3956,58 @@ class CellInstArray: @param trans The transformation by which to instantiate the cell """ @overload + def __init__(self, cell: Cell, disp: Vector, a: Vector, b: Vector, na: int, nb: int) -> None: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param disp The basic displacement of the first instance + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell: Cell, trans: ICplxTrans, a: Vector, b: Vector, na: int, nb: int) -> None: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell: Cell, trans: Trans, a: Vector, b: Vector, na: int, nb: int) -> None: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param trans The transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell_index: int, disp: Vector, a: Vector, b: Vector, na: int, nb: int) -> None: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param disp The basic displacement of the first instance + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience initializer has been introduced in version 0.28. + """ + @overload def __init__(self, cell_index: int, trans: ICplxTrans, a: Vector, b: Vector, na: int, nb: int) -> None: r""" @brief Creates a single cell instance with a complex transformation @@ -3319,12 +4047,6 @@ class CellInstArray: r""" @brief Compares two arrays for inequality """ - def __repr__(self) -> str: - r""" - @brief Converts the array to a string - - This method was introduced in version 0.22. - """ def __str__(self) -> str: r""" @brief Converts the array to a string @@ -3372,15 +4094,43 @@ class CellInstArray: r""" @brief Assigns another object to self """ + @overload def bbox(self, layout: Layout) -> Box: r""" @brief Gets the bounding box of the array The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index. """ + @overload + def bbox(self, layout: Layout, layer_index: int) -> Box: + r""" + @brief Gets the bounding box of the array with respect to one layer + The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index. + + 'bbox' is the preferred synonym since version 0.28. + """ def bbox_per_layer(self, layout: Layout, layer_index: int) -> Box: r""" @brief Gets the bounding box of the array with respect to one layer The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index. + + 'bbox' is the preferred synonym since version 0.28. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ def dup(self) -> CellInstArray: r""" @@ -3424,6 +4174,12 @@ class CellInstArray: Returns true if the array represents complex instances (that is, with magnification and arbitrary rotation angles). """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_regular_array(self) -> bool: r""" @brief Gets a value indicating whether this instance is a regular array @@ -3477,31 +4233,55 @@ class DCellInstArray: """ a: DVector r""" + Getter: @brief Gets the displacement vector for the 'a' axis + + Setter: @brief Sets the displacement vector for the 'a' axis If the instance was not regular before this property is set, it will be initialized to a regular instance. """ b: DVector r""" + Getter: @brief Gets the displacement vector for the 'b' axis + + Setter: @brief Sets the displacement vector for the 'b' axis If the instance was not regular before this property is set, it will be initialized to a regular instance. """ + @property + def cell(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the cell this instance refers to + This is a convenience method and equivalent to 'cell_index = cell.cell_index()'. There is no getter for the cell pointer because the \CellInstArray object only knows about cell indexes. + + This convenience method has been introduced in version 0.28. + """ cell_index: int r""" + Getter: @brief Gets the cell index of the cell instantiated + Use \Layout#cell to get the \Cell object from the cell index. + Setter: @brief Sets the index of the cell this instance refers to """ cplx_trans: DCplxTrans r""" + Getter: @brief Gets the complex transformation of the first instance in the array - This method is always applicable, compared to \trans, since simple transformations can be expressed as complex transformations as well.@brief Sets the complex transformation of the instance or the first instance in the array + This method is always applicable, compared to \trans, since simple transformations can be expressed as complex transformations as well. + Setter: + @brief Sets the complex transformation of the instance or the first instance in the array """ na: int r""" + Getter: @brief Gets the number of instances in the 'a' axis + + Setter: @brief Sets the number of instances in the 'a' axis If the instance was not regular before this property is set to a value larger than zero, it will be initialized to a regular instance. @@ -3509,7 +4289,10 @@ class DCellInstArray: """ nb: int r""" + Getter: @brief Gets the number of instances in the 'b' axis + + Setter: @brief Sets the number of instances in the 'b' axis If the instance was not regular before this property is set to a value larger than zero, it will be initialized to a regular instance. @@ -3517,9 +4300,153 @@ class DCellInstArray: """ trans: DTrans r""" + Getter: @brief Gets the transformation of the first instance in the array - The transformation returned is only valid if the array does not represent a complex transformation array@brief Sets the transformation of the instance or the first instance in the array + The transformation returned is only valid if the array does not represent a complex transformation array + Setter: + @brief Sets the transformation of the instance or the first instance in the array """ + @overload + @classmethod + def new(cls) -> DCellInstArray: + r""" + @brief Creates en empty cell instance with size 0 + """ + @overload + @classmethod + def new(cls, cell: Cell, disp: DVector) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param disp The displacement + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell: Cell, trans: DCplxTrans) -> DCellInstArray: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell: Cell, trans: DTrans) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param trans The transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell_index: int, disp: DVector) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param disp The displacement + This convenience initializer has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell_index: int, trans: DCplxTrans) -> DCellInstArray: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell_index The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + """ + @overload + @classmethod + def new(cls, cell_index: int, trans: DTrans) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param trans The transformation by which to instantiate the cell + """ + @overload + @classmethod + def new(cls, cell: Cell, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param disp The basic displacement of the first instance + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell: Cell, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell: Cell, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param trans The transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell_index: int, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param disp The basic displacement of the first instance + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience initializer has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell_index: int, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell_index The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + """ + @overload + @classmethod + def new(cls, cell_index: int, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param trans The transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + """ def __copy__(self) -> DCellInstArray: r""" @brief Creates a copy of self @@ -3541,6 +4468,41 @@ class DCellInstArray: @brief Creates en empty cell instance with size 0 """ @overload + def __init__(self, cell: Cell, disp: DVector) -> None: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param disp The displacement + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell: Cell, trans: DCplxTrans) -> None: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell: Cell, trans: DTrans) -> None: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param trans The transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell_index: int, disp: DVector) -> None: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param disp The displacement + This convenience initializer has been introduced in version 0.28. + """ + @overload def __init__(self, cell_index: int, trans: DCplxTrans) -> None: r""" @brief Creates a single cell instance with a complex transformation @@ -3555,6 +4517,58 @@ class DCellInstArray: @param trans The transformation by which to instantiate the cell """ @overload + def __init__(self, cell: Cell, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> None: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param disp The basic displacement of the first instance + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell: Cell, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> None: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell: Cell, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> None: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param trans The transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell_index: int, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> None: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param disp The basic displacement of the first instance + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience initializer has been introduced in version 0.28. + """ + @overload def __init__(self, cell_index: int, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> None: r""" @brief Creates a single cell instance with a complex transformation @@ -3590,10 +4604,6 @@ class DCellInstArray: r""" @brief Compares two arrays for inequality """ - def __repr__(self) -> str: - r""" - @brief Converts the array to a string - """ def __str__(self) -> str: r""" @brief Converts the array to a string @@ -3639,15 +4649,43 @@ class DCellInstArray: r""" @brief Assigns another object to self """ + @overload def bbox(self, layout: Layout) -> DBox: r""" @brief Gets the bounding box of the array The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index. """ + @overload + def bbox(self, layout: Layout, layer_index: int) -> DBox: + r""" + @brief Gets the bounding box of the array with respect to one layer + The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index. + + 'bbox' is the preferred synonym since version 0.28. + """ def bbox_per_layer(self, layout: Layout, layer_index: int) -> DBox: r""" @brief Gets the bounding box of the array with respect to one layer The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index. + + 'bbox' is the preferred synonym since version 0.28. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ def dup(self) -> DCellInstArray: r""" @@ -3687,6 +4725,12 @@ class DCellInstArray: Returns true if the array represents complex instances (that is, with magnification and arbitrary rotation angles). """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_regular_array(self) -> bool: r""" @brief Gets a value indicating whether this instance is a regular array @@ -3727,14 +4771,19 @@ class CellMapping: A cell mapping is an association of cells in two layouts forming pairs of cells, i.e. one cell corresponds to another cell in the other layout. The CellMapping object describes the mapping of cells of a source layout B to a target layout A. The cell mapping object is basically a table associating a cell in layout B with a cell in layout A. + The cell mapping is of particular interest for providing the cell mapping recipe in \Cell#copy_tree_shapes or \Cell#move_tree_shapes. + The mapping object is used to create and hold that table. There are three basic modes in which a table can be generated: @ul - @li Top-level identity @/li - @li Geometrical identity @/li - @li Name identity @/li + @li Top-level identity (\for_single_cell and \for_single_cell_full) @/li + @li Top-level identify for multiple cells (\for_multi_cells_full and \for_multi_cells_full) @/li + @li Geometrical identity (\from_geometry and \from_geometry_full)@/li + @li Name identity (\from_names and \from_names_full) @/li @/ul + 'full' refers to the way cells are treated which are not mentioned. In the 'full' versions, cells for which no mapping is established explicitly - specifically all child cells in top-level identity modes - are created in the target layout and instantiated according to their source layout hierarchy. Then, these new cells become targets of the respective source cells. In the plain version (without 'full' cells), no additional cells are created. For the case of \Layout#copy_tree_shapes cells not explicitly mapped are flattened. Hence for example, \for_single_cell will flatten all children of the source cell during \Layout#copy_tree_shapes or \Layout#move_tree_shapes. + Top-level identity means that only one cell (the top cell) is regarded identical. All child cells are not considered identical. In full mode (see below), this will create a new, identical cell tree below the top cell in layout A. Geometrical identity is defined by the exact identity of the set of expanded instances in each starting cell. Therefore, when a cell is mapped to another cell, shapes can be transferred from one cell to another while effectively rendering the same flat geometry (in the context of the given starting cells). Location identity is basically the safest way to map cells from one hierarchy into another, because it preserves the flat shape geometry. However in some cases the algorithm may find multiple mapping candidates. In that case it will make a guess about what mapping to choose. @@ -3743,9 +4792,41 @@ class CellMapping: A cell might not be mapped to another cell which basically means that there is no corresponding cell. In this case, flattening to the next mapped cell is an option to transfer geometries despite the missing mapping. You can enforce a mapping by using the mapping generator methods in 'full' mode, i.e. \from_names_full or \from_geometry_full. These versions will create new cells and their corresponding instances in the target layout if no suitable target cell is found. - CellMapping objects play a role mainly in the hierarchical copy or move operations of \Layout. However, use is not restricted to these applications. + This is a simple example for a cell mapping preserving the hierarchy of the source cell and creating a hierarchy copy in the top cell of the target layout ('hierarchical merge'): - Here is one example for using \CellMapping. It extracts cells 'A', 'B' and 'C' from one layout and copies them to another. It will also copy all shapes and all child cells. Child cells which are shared between the three initial cells will be shared in the target layout too. + @code + cell_names = [ "A", "B", "C" ] + + source = RBA::Layout::new + source.read("input.gds") + + target = RBA::Layout::new + target_top = target.create_cell("IMPORTED") + + cm = RBA::CellMapping::new + # Copies the source layout hierarchy into the target top cell: + cm.for_single_cell_full(target_top, source.top_cell) + target.copy_tree_shapes(source, cm) + @/code + + Without 'full', the effect is move-with-flattening (note we're using 'move' in this example): + + @code + cell_names = [ "A", "B", "C" ] + + source = RBA::Layout::new + source.read("input.gds") + + target = RBA::Layout::new + target_top = target.create_cell("IMPORTED") + + cm = RBA::CellMapping::new + # Flattens the source layout hierarchy into the target top cell: + cm.for_single_cell(target_top, source.top_cell) + target.move_tree_shapes(source, cm) + @/code + + This is another example for using \CellMapping in multiple top cell identity mode. It extracts cells 'A', 'B' and 'C' from one layout and copies them to another. It will also copy all shapes and all child cells. Child cells which are shared between the three initial cells will be shared in the target layout too. @code cell_names = [ "A", "B", "C" ] @@ -3755,22 +4836,27 @@ class CellMapping: target = RBA::Layout::new - source_cells = cell_names.collect { |n| source.cell_by_name(n).cell_index } - target_cells = cell_names.collect { |n| target.create_cell(n).cell_index } + source_cells = cell_names.collect { |n| source.cell_by_name(n) } + target_cells = cell_names.collect { |n| target.create_cell(n) } cm = RBA::CellMapping::new - cm.for_multi_cells_full(source, source_cells, target, target_cells) + cm.for_multi_cells_full(target_cells, source_cells) target.copy_tree_shapes(source, cm) @/code """ DropCell: ClassVar[int] r""" - @brief A constant indicating the reques to drop a cell + @brief A constant indicating the request to drop a cell If used as a pseudo-target for the cell mapping, this index indicates that the cell shall be dropped rather than created on the target side or skipped by flattening. Instead, all shapes of this cell are discarded and it's children are not translated unless explicitly requested or if required are children for other cells. This constant has been introduced in version 0.25. """ + @classmethod + def new(cls) -> CellMapping: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> CellMapping: r""" @brief Creates a copy of self @@ -3836,10 +4922,39 @@ class CellMapping: This method has been introduced in version 0.23. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> CellMapping: r""" @brief Creates a copy of self """ + @overload + def for_multi_cells(self, cell_a: Sequence[Cell], cell_b: Sequence[Cell]) -> None: + r""" + @brief Initializes the cell mapping for top-level identity + + @param cell_a A list of target cells. + @param cell_b A list of source cells. + @return A list of indexes of cells created. + + This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28. + """ + @overload def for_multi_cells(self, layout_a: Layout, cell_indexes_a: Sequence[int], layout_b: Layout, cell_indexes_b: Sequence[int]) -> None: r""" @brief Initializes the cell mapping for top-level identity @@ -3855,9 +4970,21 @@ class CellMapping: This method has been introduced in version 0.27. """ + @overload + def for_multi_cells_full(self, cell_a: Sequence[Cell], cell_b: Sequence[Cell]) -> List[int]: + r""" + @brief Initializes the cell mapping for top-level identity in full mapping mode + + @param cell_a A list of target cells. + @param cell_b A list of source cells. + @return A list of indexes of cells created. + + This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28. + """ + @overload def for_multi_cells_full(self, layout_a: Layout, cell_indexes_a: Sequence[int], layout_b: Layout, cell_indexes_b: Sequence[int]) -> List[int]: r""" - @brief Initializes the cell mapping for top-level identity + @brief Initializes the cell mapping for top-level identity in full mapping mode @param layout_a The target layout. @param cell_indexes_a A list of cell indexes for the target cells. @@ -3868,6 +4995,18 @@ class CellMapping: This method has been introduced in version 0.27. """ + @overload + def for_single_cell(self, cell_a: Cell, cell_b: Cell) -> None: + r""" + @brief Initializes the cell mapping for top-level identity + + @param cell_a The target cell. + @param cell_b The source cell. + @return A list of indexes of cells created. + + This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28. + """ + @overload def for_single_cell(self, layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> None: r""" @brief Initializes the cell mapping for top-level identity @@ -3883,9 +5022,21 @@ class CellMapping: This method has been introduced in version 0.23. """ + @overload + def for_single_cell_full(self, cell_a: Cell, cell_b: Cell) -> List[int]: + r""" + @brief Initializes the cell mapping for top-level identity in full mapping mode + + @param cell_a The target cell. + @param cell_b The source cell. + @return A list of indexes of cells created. + + This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28. + """ + @overload def for_single_cell_full(self, layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> List[int]: r""" - @brief Initializes the cell mapping for top-level identity + @brief Initializes the cell mapping for top-level identity in full mapping mode @param layout_a The target layout. @param cell_index_a The index of the target cell. @@ -3896,6 +5047,18 @@ class CellMapping: This method has been introduced in version 0.23. """ + @overload + def from_geometry(self, cell_a: Cell, cell_b: Cell) -> None: + r""" + @brief Initializes the cell mapping using the geometrical identity + + @param cell_a The target cell. + @param cell_b The source cell. + @return A list of indexes of cells created. + + This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28. + """ + @overload def from_geometry(self, layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> None: r""" @brief Initializes the cell mapping using the geometrical identity @@ -3910,6 +5073,18 @@ class CellMapping: This method has been introduced in version 0.23. """ + @overload + def from_geometry_full(self, cell_a: Cell, cell_b: Cell) -> List[int]: + r""" + @brief Initializes the cell mapping using the geometrical identity in full mapping mode + + @param cell_a The target cell. + @param cell_b The source cell. + @return A list of indexes of cells created. + + This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28. + """ + @overload def from_geometry_full(self, layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> List[int]: r""" @brief Initializes the cell mapping using the geometrical identity in full mapping mode @@ -3927,6 +5102,18 @@ class CellMapping: This method has been introduced in version 0.23. """ + @overload + def from_names(self, cell_a: Cell, cell_b: Cell) -> None: + r""" + @brief Initializes the cell mapping using the name identity + + @param cell_a The target cell. + @param cell_b The source cell. + @return A list of indexes of cells created. + + This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28. + """ + @overload def from_names(self, layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> None: r""" @brief Initializes the cell mapping using the name identity @@ -3941,6 +5128,18 @@ class CellMapping: This method has been introduced in version 0.23. """ + @overload + def from_names_full(self, cell_a: Cell, cell_b: Cell) -> List[int]: + r""" + @brief Initializes the cell mapping using the name identity in full mapping mode + + @param cell_a The target cell. + @param cell_b The source cell. + @return A list of indexes of cells created. + + This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28. + """ + @overload def from_names_full(self, layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> List[int]: r""" @brief Initializes the cell mapping using the name identity in full mapping mode @@ -3962,12 +5161,17 @@ class CellMapping: r""" @brief Returns as value indicating whether a cell of layout_b has a mapping to a layout_a cell. - @param cell_index_b The index of the cell in layout_b whose mapping is requested. @return true, if the cell has a mapping Note that if the cell is supposed to be dropped (see \DropCell), the respective source cell will also be regarded "mapped", so has_mapping? will return true in this case. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def map(self, cell_index_b: int, cell_index_a: int) -> None: r""" @brief Explicitly specifies a mapping. @@ -4018,6 +5222,24 @@ class CompoundRegionOperationNode: r""" @brief Indicates a logical '||' (or). """ + @overload + @classmethod + def new(cls, i: int) -> CompoundRegionOperationNode.LogicalOp: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> CompoundRegionOperationNode.LogicalOp: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload def __eq__(self, other: object) -> bool: r""" @brief Compares two enums @@ -4032,17 +5254,29 @@ class CompoundRegionOperationNode: r""" @brief Creates an enum from a string value """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload def __lt__(self, other: CompoundRegionOperationNode.LogicalOp) -> bool: r""" @brief Returns true if the first enum is less (in the enum symbol order) than the second """ + @overload def __ne__(self, other: object) -> bool: r""" @brief Compares two enums for inequality """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ def __repr__(self) -> str: r""" - @brief Gets the symbolic string from an enum + @brief Converts an enum to a visual string """ def __str__(self) -> str: r""" @@ -4082,6 +5316,24 @@ class CompoundRegionOperationNode: r""" @brief Indicates a geometrical '^' (xor). """ + @overload + @classmethod + def new(cls, i: int) -> CompoundRegionOperationNode.GeometricalOp: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> CompoundRegionOperationNode.GeometricalOp: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload def __eq__(self, other: object) -> bool: r""" @brief Compares two enums @@ -4096,17 +5348,29 @@ class CompoundRegionOperationNode: r""" @brief Creates an enum from a string value """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload def __lt__(self, other: CompoundRegionOperationNode.GeometricalOp) -> bool: r""" @brief Returns true if the first enum is less (in the enum symbol order) than the second """ + @overload def __ne__(self, other: object) -> bool: r""" @brief Compares two enums for inequality """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ def __repr__(self) -> str: r""" - @brief Gets the symbolic string from an enum + @brief Converts an enum to a visual string """ def __str__(self) -> str: r""" @@ -4142,11 +5406,29 @@ class CompoundRegionOperationNode: r""" @brief Indicates polygon result type. """ + @overload + @classmethod + def new(cls, i: int) -> CompoundRegionOperationNode.ResultType: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> CompoundRegionOperationNode.ResultType: + r""" + @brief Creates an enum from a string value + """ + @overload def __eq__(self, other: object) -> bool: r""" @brief Compares two enums """ @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload def __init__(self, i: int) -> None: r""" @brief Creates an enum from an integer value @@ -4156,17 +5438,29 @@ class CompoundRegionOperationNode: r""" @brief Creates an enum from a string value """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload def __lt__(self, other: CompoundRegionOperationNode.ResultType) -> bool: r""" @brief Returns true if the first enum is less (in the enum symbol order) than the second """ + @overload def __ne__(self, other: object) -> bool: r""" @brief Compares two enums for inequality """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ def __repr__(self) -> str: r""" - @brief Gets the symbolic string from an enum + @brief Converts an enum to a visual string """ def __str__(self) -> str: r""" @@ -4210,6 +5504,24 @@ class CompoundRegionOperationNode: r""" @brief Measures the width of the bounding box """ + @overload + @classmethod + def new(cls, i: int) -> CompoundRegionOperationNode.ParameterType: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> CompoundRegionOperationNode.ParameterType: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload def __eq__(self, other: object) -> bool: r""" @brief Compares two enums @@ -4224,17 +5536,29 @@ class CompoundRegionOperationNode: r""" @brief Creates an enum from a string value """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload def __lt__(self, other: CompoundRegionOperationNode.ParameterType) -> bool: r""" @brief Returns true if the first enum is less (in the enum symbol order) than the second """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload def __ne__(self, other: object) -> bool: r""" @brief Compares two enums for inequality """ def __repr__(self) -> str: r""" - @brief Gets the symbolic string from an enum + @brief Converts an enum to a visual string """ def __str__(self) -> str: r""" @@ -4270,6 +5594,24 @@ class CompoundRegionOperationNode: r""" @brief Measures the relative height (height / width) """ + @overload + @classmethod + def new(cls, i: int) -> CompoundRegionOperationNode.RatioParameterType: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> CompoundRegionOperationNode.RatioParameterType: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload def __eq__(self, other: object) -> bool: r""" @brief Compares two enums @@ -4284,17 +5626,29 @@ class CompoundRegionOperationNode: r""" @brief Creates an enum from a string value """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload def __lt__(self, other: CompoundRegionOperationNode.RatioParameterType) -> bool: r""" @brief Returns true if the first enum is less (in the enum symbol order) than the second """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload def __ne__(self, other: object) -> bool: r""" @brief Compares two enums for inequality """ def __repr__(self) -> str: r""" - @brief Gets the symbolic string from an enum + @brief Converts an enum to a visual string """ def __str__(self) -> str: r""" @@ -4314,13 +5668,24 @@ class CompoundRegionOperationNode: """ description: str r""" - @brief Gets the description for this node@brief Sets the description for this node + Getter: + @brief Gets the description for this node + Setter: + @brief Sets the description for this node """ distance: int r""" - @brief Gets the distance value for this node@brief Sets the distance value for this nodeUsually it's not required to provide a distance because the nodes compute a distance based on their operation. If necessary you can supply a distance. The processor will use this distance or the computed one, whichever is larger. + Getter: + @brief Gets the distance value for this node + Setter: + @brief Sets the distance value for this nodeUsually it's not required to provide a distance because the nodes compute a distance based on their operation. If necessary you can supply a distance. The processor will use this distance or the computed one, whichever is larger. """ @classmethod + def new(cls) -> CompoundRegionOperationNode: + r""" + @brief Creates a new object of this class + """ + @classmethod def new_area_filter(cls, input: CompoundRegionOperationNode, inverse: Optional[bool] = ..., amin: Optional[int] = ..., amax: Optional[int] = ...) -> CompoundRegionOperationNode: r""" @brief Creates a node filtering the input by area. @@ -4538,6 +5903,30 @@ class CompoundRegionOperationNode: r""" @brief Creates a node providing a Minkowski sum with a point sequence forming a contour. """ + @overload + @classmethod + def new_minkowsky_sum(cls, input: CompoundRegionOperationNode, e: Edge) -> CompoundRegionOperationNode: + r""" + @brief Creates a node providing a Minkowski sum with an edge. + """ + @overload + @classmethod + def new_minkowsky_sum(cls, input: CompoundRegionOperationNode, p: Box) -> CompoundRegionOperationNode: + r""" + @brief Creates a node providing a Minkowski sum with a box. + """ + @overload + @classmethod + def new_minkowsky_sum(cls, input: CompoundRegionOperationNode, p: Polygon) -> CompoundRegionOperationNode: + r""" + @brief Creates a node providing a Minkowski sum with a polygon. + """ + @overload + @classmethod + def new_minkowsky_sum(cls, input: CompoundRegionOperationNode, p: Sequence[Point]) -> CompoundRegionOperationNode: + r""" + @brief Creates a node providing a Minkowski sum with a point sequence forming a contour. + """ @classmethod def new_notch_check(cls, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: r""" @@ -4708,6 +6097,29 @@ class CompoundRegionOperationNode: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def result_type(self) -> CompoundRegionOperationNode.ResultType: r""" @brief Gets the result type of this node @@ -4731,10 +6143,28 @@ class TrapezoidDecompositionMode: r""" @brief Indicates vertical trapezoid decomposition. """ + @overload + @classmethod + def new(cls, i: int) -> TrapezoidDecompositionMode: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> TrapezoidDecompositionMode: + r""" + @brief Creates an enum from a string value + """ def __copy__(self) -> TrapezoidDecompositionMode: r""" @brief Creates a copy of self """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload def __eq__(self, other: object) -> bool: r""" @brief Compares two enums @@ -4749,17 +6179,29 @@ class TrapezoidDecompositionMode: r""" @brief Creates an enum from a string value """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload def __lt__(self, other: TrapezoidDecompositionMode) -> bool: r""" @brief Returns true if the first enum is less (in the enum symbol order) than the second """ + @overload def __ne__(self, other: object) -> bool: r""" @brief Compares two enums for inequality """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ def __repr__(self) -> str: r""" - @brief Gets the symbolic string from an enum + @brief Converts an enum to a visual string """ def __str__(self) -> str: r""" @@ -4806,6 +6248,23 @@ class TrapezoidDecompositionMode: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> TrapezoidDecompositionMode: r""" @brief Creates a copy of self @@ -4814,6 +6273,12 @@ class TrapezoidDecompositionMode: r""" @brief Converts an enum to a visual string """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def to_i(self) -> int: r""" @brief Gets the integer value from the enum @@ -4849,10 +6314,28 @@ class PreferredOrientation: r""" @brief Indicates vertical trapezoid decomposition. """ + @overload + @classmethod + def new(cls, i: int) -> PreferredOrientation: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> PreferredOrientation: + r""" + @brief Creates an enum from a string value + """ def __copy__(self) -> PreferredOrientation: r""" @brief Creates a copy of self """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload def __eq__(self, other: object) -> bool: r""" @brief Compares two enums @@ -4867,17 +6350,29 @@ class PreferredOrientation: r""" @brief Creates an enum from a string value """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload def __lt__(self, other: PreferredOrientation) -> bool: r""" @brief Returns true if the first enum is less (in the enum symbol order) than the second """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload def __ne__(self, other: object) -> bool: r""" @brief Compares two enums for inequality """ def __repr__(self) -> str: r""" - @brief Gets the symbolic string from an enum + @brief Converts an enum to a visual string """ def __str__(self) -> str: r""" @@ -4924,6 +6419,23 @@ class PreferredOrientation: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> PreferredOrientation: r""" @brief Creates a copy of self @@ -4932,6 +6444,12 @@ class PreferredOrientation: r""" @brief Converts an enum to a visual string """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def to_i(self) -> int: r""" @brief Gets the integer value from the enum @@ -4941,215 +6459,6 @@ class PreferredOrientation: @brief Gets the symbolic string from an enum """ -class DeepShapeStore: - r""" - @brief An opaque layout heap for the deep region processor - - This class is used for keeping intermediate, hierarchical data for the deep region processor. It is used in conjunction with the region constructor to create a deep (hierarchical) region. - @code - layout = ... # a layout - layer = ... # a layer - cell = ... # a cell (initial cell for the deep region) - dss = RBA::DeepShapeStore::new - region = RBA::Region::new(cell.begin(layer), dss) - @/code - - The DeepShapeStore object also supplies some configuration options for the operations acting on the deep regions. See for example \threads=. - - This class has been introduced in version 0.26. - """ - max_area_ratio: float - r""" - @brief Gets the max. area ratio. - @brief Sets the max. area ratio for bounding box vs. polygon area - - This parameter is used to simplify complex polygons. It is used by - create_polygon_layer with the default parameters. It's also used by - boolean operations when they deliver their output. - """ - max_vertex_count: int - r""" - @brief Gets the maximum vertex count. - @brief Sets the maximum vertex count default value - - This parameter is used to simplify complex polygons. It is used by - create_polygon_layer with the default parameters. It's also used by - boolean operations when they deliver their output. - """ - reject_odd_polygons: bool - r""" - @brief Gets a flag indicating whether to reject odd polygons. - This attribute has been introduced in version 0.27.@brief Sets a flag indicating whether to reject odd polygons - - Some kind of 'odd' (e.g. non-orientable) polygons may spoil the functionality because they cannot be handled properly. By using this flag, the shape store we reject these kind of polygons. The default is 'accept' (without warning). - - This attribute has been introduced in version 0.27. - """ - text_enlargement: int - r""" - @brief Gets the text enlargement value. - @brief Sets the text enlargement value - - If set to a non-negative value, text objects are converted to boxes with the - given enlargement (width = 2 * enlargement). The box centers are identical - to the original location of the text. - If this value is negative (the default), texts are ignored. - """ - text_property_name: Any - r""" - @brief Gets the text property name. - @brief Sets the text property name. - - If set to a non-null variant, text strings are attached to the generated boxes - as properties with this particular name. This option has an effect only if the - text_enlargement property is not negative. - By default, the name is empty. - """ - threads: int - r""" - @brief Gets the number of threads. - @brief Sets the number of threads to allocate for the hierarchical processor - """ - @classmethod - def instance_count(cls) -> int: - r""" - @hide - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def add_breakout_cell(self, layout_index: int, cell_index: Sequence[int]) -> None: - r""" - @brief Adds a cell indexe to the breakout cell list for the given layout inside the store - See \clear_breakout_cells for an explanation of breakout cells. - - This method has been added in version 0.26.1 - """ - @overload - def add_breakout_cells(self, pattern: str) -> None: - r""" - @brief Adds cells (given by a cell name pattern) to the breakout cell list to all layouts inside the store - See \clear_breakout_cells for an explanation of breakout cells. - - This method has been added in version 0.26.1 - """ - @overload - def add_breakout_cells(self, layout_index: int, cells: Sequence[int]) -> None: - r""" - @brief Adds cell indexes to the breakout cell list for the given layout inside the store - See \clear_breakout_cells for an explanation of breakout cells. - - This method has been added in version 0.26.1 - """ - @overload - def add_breakout_cells(self, layout_index: int, pattern: str) -> None: - r""" - @brief Adds cells (given by a cell name pattern) to the breakout cell list for the given layout inside the store - See \clear_breakout_cells for an explanation of breakout cells. - - This method has been added in version 0.26.1 - """ - @overload - def clear_breakout_cells(self) -> None: - r""" - @brief Clears the breakout cells - See the other variant of \clear_breakout_cells for details. - - This method has been added in version 0.26.1 - """ - @overload - def clear_breakout_cells(self, layout_index: int) -> None: - r""" - @brief Clears the breakout cells - Breakout cells are a feature by which hierarchy handling can be disabled for specific cells. If cells are specified as breakout cells, they don't interact with neighbor or parent cells, hence are virtually isolated. Breakout cells are useful to shortcut hierarchy evaluation for cells which are otherwise difficult to handle. An example are memory array cells with overlaps to their neighbors: a precise handling of such cells would generate variants and the boundary of the array. Although precise, this behavior leads to partial flattening and propagation of shapes. In consequence, this will also result in wrong device detection in LVS applications. In such cases, these array cells can be declared 'breakout cells' which makes them isolated entities and variant generation does not happen. - - See also \set_breakout_cells and \add_breakout_cells. - - This method has been added in version 0.26.1 - """ - def is_singular(self) -> bool: - r""" - @brief Gets a value indicating whether there is a single layout variant - - Specifically for network extraction, singular DSS objects are required. Multiple layouts may be present if different sources of layouts have been used. Such DSS objects are not usable for network extraction. - """ - def pop_state(self) -> None: - r""" - @brief Restores the store's state on the state state - This will restore the state pushed by \push_state. - - This method has been added in version 0.26.1 - """ - def push_state(self) -> None: - r""" - @brief Pushes the store's state on the state state - This will save the stores state (\threads, \max_vertex_count, \max_area_ratio, breakout cells ...) on the state stack. \pop_state can be used to restore the state. - - This method has been added in version 0.26.1 - """ - @overload - def set_breakout_cells(self, pattern: str) -> None: - r""" - @brief Sets the breakout cell list (as cell name pattern) for the all layouts inside the store - See \clear_breakout_cells for an explanation of breakout cells. - - This method has been added in version 0.26.1 - """ - @overload - def set_breakout_cells(self, layout_index: int, cells: Sequence[int]) -> None: - r""" - @brief Sets the breakout cell list (as cell indexes) for the given layout inside the store - See \clear_breakout_cells for an explanation of breakout cells. - - This method has been added in version 0.26.1 - """ - @overload - def set_breakout_cells(self, layout_index: int, pattern: str) -> None: - r""" - @brief Sets the breakout cell list (as cell name pattern) for the given layout inside the store - See \clear_breakout_cells for an explanation of breakout cells. - - This method has been added in version 0.26.1 - """ - class Edge: r""" @brief An edge class @@ -5161,41 +6470,66 @@ class Edge: """ p1: Point r""" + Getter: @brief The first point. + + Setter: @brief Sets the first point. This method has been added in version 0.23. """ p2: Point r""" + Getter: @brief The second point. + + Setter: @brief Sets the second point. This method has been added in version 0.23. """ x1: int r""" + Getter: @brief Shortcut for p1.x + + Setter: @brief Sets p1.x This method has been added in version 0.23. """ x2: int r""" + Getter: @brief Shortcut for p2.x + + Setter: @brief Sets p2.x This method has been added in version 0.23. """ y1: int r""" + Getter: @brief Shortcut for p1.y + + Setter: @brief Sets p1.y This method has been added in version 0.23. """ y2: int r""" + Getter: @brief Shortcut for p2.y + + Setter: @brief Sets p2.y This method has been added in version 0.23. """ @classmethod + def from_dedge(cls, dedge: DEdge) -> Edge: + r""" + @brief Creates an integer coordinate edge from a floating-point coordinate edge + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge'. + """ + @classmethod def from_s(cls, s: str) -> Edge: r""" @brief Creates an object from a string @@ -5203,6 +6537,50 @@ class Edge: This method has been added in version 0.23. """ + @overload + @classmethod + def new(cls) -> Edge: + r""" + @brief Default constructor: creates a degenerated edge 0,0 to 0,0 + """ + @overload + @classmethod + def new(cls, dedge: DEdge) -> Edge: + r""" + @brief Creates an integer coordinate edge from a floating-point coordinate edge + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge'. + """ + @overload + @classmethod + def new(cls, p1: Point, p2: Point) -> Edge: + r""" + @brief Constructor with two points + + Two points are given to create a new edge. + """ + @overload + @classmethod + def new(cls, x1: int, y1: int, x2: int, y2: int) -> Edge: + r""" + @brief Constructor with two coordinates given as single values + + Two points are given to create a new edge. + """ + @classmethod + def new_pp(cls, p1: Point, p2: Point) -> Edge: + r""" + @brief Constructor with two points + + Two points are given to create a new edge. + """ + @classmethod + def new_xyxy(cls, x1: int, y1: int, x2: int, y2: int) -> Edge: + r""" + @brief Constructor with two coordinates given as single values + + Two points are given to create a new edge. + """ def __copy__(self) -> Edge: r""" @brief Creates a copy of self @@ -5268,10 +6646,6 @@ class Edge: @brief Inequality test @param e The object to compare against """ - def __repr__(self) -> str: - r""" - @brief Returns a string representing the edge - """ def __rmul__(self, scale_factor: float) -> Edge: r""" @brief Scale edge @@ -5284,9 +6658,12 @@ class Edge: @return The scaled edge """ - def __str__(self) -> str: + def __str__(self, dbu: Optional[float] = ...) -> str: r""" @brief Returns a string representing the edge + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. """ def _create(self) -> None: r""" @@ -5387,6 +6764,11 @@ class Edge: @return True if the point is on the edge but not equal p1 or p2. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def crossed_by(self, e: Edge) -> bool: r""" @brief Check, if an edge is cut by a line (given by an edge) @@ -5426,6 +6808,18 @@ class Edge: This method is equivalent to p2 - p1. This method has been introduced in version 0.26.2. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def distance(self, p: Point) -> int: r""" @brief Distance between the edge and a point. @@ -5560,6 +6954,12 @@ class Edge: This method has been introduced in version 0.19. From version 0.26.2, this method will return nil in case of non-intersection. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_degenerate(self) -> bool: r""" @brief Test for degenerated edge @@ -5707,9 +7107,12 @@ class Edge: This method has been introduced in version 0.25. """ - def to_s(self) -> str: + def to_s(self, dbu: Optional[float] = ...) -> str: r""" @brief Returns a string representing the edge + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. """ @overload def transformed(self, t: CplxTrans) -> DEdge: @@ -5747,6 +7150,17 @@ class Edge: @param t The transformation to apply. + @return The transformed edge. + """ + def transformed_cplx(self, t: CplxTrans) -> DEdge: + r""" + @brief Transform the edge. + + Transforms the edge with the given complex transformation. + Does not modify the edge but returns the transformed edge. + + @param t The transformation to apply. + @return The transformed edge. """ @@ -5762,41 +7176,66 @@ class DEdge: """ p1: DPoint r""" + Getter: @brief The first point. + + Setter: @brief Sets the first point. This method has been added in version 0.23. """ p2: DPoint r""" + Getter: @brief The second point. + + Setter: @brief Sets the second point. This method has been added in version 0.23. """ x1: float r""" + Getter: @brief Shortcut for p1.x + + Setter: @brief Sets p1.x This method has been added in version 0.23. """ x2: float r""" + Getter: @brief Shortcut for p2.x + + Setter: @brief Sets p2.x This method has been added in version 0.23. """ y1: float r""" + Getter: @brief Shortcut for p1.y + + Setter: @brief Sets p1.y This method has been added in version 0.23. """ y2: float r""" + Getter: @brief Shortcut for p2.y + + Setter: @brief Sets p2.y This method has been added in version 0.23. """ @classmethod + def from_iedge(cls, edge: Edge) -> DEdge: + r""" + @brief Creates a floating-point coordinate edge from an integer coordinate edge + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_iedge'. + """ + @classmethod def from_s(cls, s: str) -> DEdge: r""" @brief Creates an object from a string @@ -5804,6 +7243,50 @@ class DEdge: This method has been added in version 0.23. """ + @overload + @classmethod + def new(cls) -> DEdge: + r""" + @brief Default constructor: creates a degenerated edge 0,0 to 0,0 + """ + @overload + @classmethod + def new(cls, edge: Edge) -> DEdge: + r""" + @brief Creates a floating-point coordinate edge from an integer coordinate edge + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_iedge'. + """ + @overload + @classmethod + def new(cls, p1: DPoint, p2: DPoint) -> DEdge: + r""" + @brief Constructor with two points + + Two points are given to create a new edge. + """ + @overload + @classmethod + def new(cls, x1: float, y1: float, x2: float, y2: float) -> DEdge: + r""" + @brief Constructor with two coordinates given as single values + + Two points are given to create a new edge. + """ + @classmethod + def new_pp(cls, p1: DPoint, p2: DPoint) -> DEdge: + r""" + @brief Constructor with two points + + Two points are given to create a new edge. + """ + @classmethod + def new_xyxy(cls, x1: float, y1: float, x2: float, y2: float) -> DEdge: + r""" + @brief Constructor with two coordinates given as single values + + Two points are given to create a new edge. + """ def __copy__(self) -> DEdge: r""" @brief Creates a copy of self @@ -5869,10 +7352,6 @@ class DEdge: @brief Inequality test @param e The object to compare against """ - def __repr__(self) -> str: - r""" - @brief Returns a string representing the edge - """ def __rmul__(self, scale_factor: float) -> DEdge: r""" @brief Scale edge @@ -5885,9 +7364,12 @@ class DEdge: @return The scaled edge """ - def __str__(self) -> str: + def __str__(self, dbu: Optional[float] = ...) -> str: r""" @brief Returns a string representing the edge + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. """ def _create(self) -> None: r""" @@ -5988,6 +7470,11 @@ class DEdge: @return True if the point is on the edge but not equal p1 or p2. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def crossed_by(self, e: DEdge) -> bool: r""" @brief Check, if an edge is cut by a line (given by an edge) @@ -6027,6 +7514,18 @@ class DEdge: This method is equivalent to p2 - p1. This method has been introduced in version 0.26.2. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def distance(self, p: DPoint) -> float: r""" @brief Distance between the edge and a point. @@ -6161,6 +7660,12 @@ class DEdge: This method has been introduced in version 0.19. From version 0.26.2, this method will return nil in case of non-intersection. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_degenerate(self) -> bool: r""" @brief Test for degenerated edge @@ -6308,9 +7813,12 @@ class DEdge: This method has been introduced in version 0.25. """ - def to_s(self) -> str: + def to_s(self, dbu: Optional[float] = ...) -> str: r""" @brief Returns a string representing the edge + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. """ @overload def transformed(self, t: DCplxTrans) -> DEdge: @@ -6346,6 +7854,17 @@ class DEdge: This method has been introduced in version 0.25. """ + def transformed_cplx(self, t: DCplxTrans) -> DEdge: + r""" + @brief Transform the edge. + + Transforms the edge with the given complex transformation. + Does not modify the edge but returns the transformed edge. + + @param t The transformation to apply. + + @return The transformed edge. + """ class EdgePair: r""" @@ -6358,20 +7877,29 @@ class EdgePair: """ first: Edge r""" + Getter: @brief Gets the first edge + + Setter: @brief Sets the first edge """ second: Edge r""" + Getter: @brief Gets the second edge + + Setter: @brief Sets the second edge """ symmetric: bool r""" + Getter: @brief Returns a value indicating whether the edge pair is symmetric For symmetric edge pairs, the edges are commutable. Specifically, a symmetric edge pair with (e1,e2) is identical to (e2,e1). Symmetric edge pairs are generated by some checks for which there is no directed error marker (width, space, notch, isolated). Symmetric edge pairs have been introduced in version 0.27. + + Setter: @brief Sets a value indicating whether the edge pair is symmetric See \symmetric? for a description of this attribute. @@ -6385,6 +7913,31 @@ class EdgePair: This method has been added in version 0.23. """ + @overload + @classmethod + def new(cls) -> EdgePair: + r""" + @brief Default constructor + + This constructor creates an default edge pair. + """ + @overload + @classmethod + def new(cls, dedge_pair: DEdgePair) -> EdgePair: + r""" + @brief Creates an integer coordinate edge pair from a floating-point coordinate edge pair + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge_pair'. + """ + @overload + @classmethod + def new(cls, first: Edge, second: Edge, symmetric: Optional[bool] = ...) -> EdgePair: + r""" + @brief Constructor from two edges + + This constructor creates an edge pair from the two edges given. + See \symmetric? for a description of this attribute. + """ def __copy__(self) -> EdgePair: r""" @brief Creates a copy of self @@ -6439,13 +7992,12 @@ class EdgePair: This method has been introduced in version 0.25. """ - def __repr__(self) -> str: - r""" - @brief Returns a string representing the edge pair - """ - def __str__(self) -> str: + def __str__(self, dbu: Optional[float] = ...) -> str: r""" @brief Returns a string representing the edge pair + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. """ def _create(self) -> None: r""" @@ -6492,6 +8044,23 @@ class EdgePair: r""" @brief Gets the bounding box of the edge pair """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> EdgePair: r""" @brief Creates a copy of self @@ -6510,6 +8079,12 @@ class EdgePair: This method has been introduced in version 0.25. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def lesser(self) -> Edge: r""" @brief Gets the 'lesser' edge for symmetric edge pairs @@ -6551,9 +8126,12 @@ class EdgePair: This method has been introduced in version 0.25. """ - def to_s(self) -> str: + def to_s(self, dbu: Optional[float] = ...) -> str: r""" @brief Returns a string representing the edge pair + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. """ @overload def transformed(self, t: CplxTrans) -> DEdgePair: @@ -6603,20 +8181,29 @@ class DEdgePair: """ first: DEdge r""" + Getter: @brief Gets the first edge + + Setter: @brief Sets the first edge """ second: DEdge r""" + Getter: @brief Gets the second edge + + Setter: @brief Sets the second edge """ symmetric: bool r""" + Getter: @brief Returns a value indicating whether the edge pair is symmetric For symmetric edge pairs, the edges are commutable. Specifically, a symmetric edge pair with (e1,e2) is identical to (e2,e1). Symmetric edge pairs are generated by some checks for which there is no directed error marker (width, space, notch, isolated). Symmetric edge pairs have been introduced in version 0.27. + + Setter: @brief Sets a value indicating whether the edge pair is symmetric See \symmetric? for a description of this attribute. @@ -6630,6 +8217,31 @@ class DEdgePair: This method has been added in version 0.23. """ + @overload + @classmethod + def new(cls) -> DEdgePair: + r""" + @brief Default constructor + + This constructor creates an default edge pair. + """ + @overload + @classmethod + def new(cls, edge_pair: EdgePair) -> DEdgePair: + r""" + @brief Creates a floating-point coordinate edge pair from an integer coordinate edge + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_iedge_pair'. + """ + @overload + @classmethod + def new(cls, first: DEdge, second: DEdge, symmetric: Optional[bool] = ...) -> DEdgePair: + r""" + @brief Constructor from two edges + + This constructor creates an edge pair from the two edges given. + See \symmetric? for a description of this attribute. + """ def __copy__(self) -> DEdgePair: r""" @brief Creates a copy of self @@ -6684,13 +8296,12 @@ class DEdgePair: This method has been introduced in version 0.25. """ - def __repr__(self) -> str: - r""" - @brief Returns a string representing the edge pair - """ - def __str__(self) -> str: + def __str__(self, dbu: Optional[float] = ...) -> str: r""" @brief Returns a string representing the edge pair + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. """ def _create(self) -> None: r""" @@ -6737,6 +8348,23 @@ class DEdgePair: r""" @brief Gets the bounding box of the edge pair """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> DEdgePair: r""" @brief Creates a copy of self @@ -6755,6 +8383,12 @@ class DEdgePair: This method has been introduced in version 0.25. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def lesser(self) -> DEdge: r""" @brief Gets the 'lesser' edge for symmetric edge pairs @@ -6796,9 +8430,12 @@ class DEdgePair: This method has been introduced in version 0.25. """ - def to_s(self) -> str: + def to_s(self, dbu: Optional[float] = ...) -> str: r""" @brief Returns a string representing the edge pair + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. """ @overload def transformed(self, t: DCplxTrans) -> DEdgePair: @@ -6844,6 +8481,129 @@ class EdgePairs(ShapeCollection): This class has been introduced in version 0.23. """ + @overload + @classmethod + def new(cls) -> EdgePairs: + r""" + @brief Default constructor + + This constructor creates an empty edge pair collection. + """ + @overload + @classmethod + def new(cls, array: Sequence[EdgePair]) -> EdgePairs: + r""" + @brief Constructor from an edge pair array + + This constructor creates an edge pair collection from an array of \EdgePair objects. + + This constructor has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, edge_pair: EdgePair) -> EdgePairs: + r""" + @brief Constructor from a single edge pair object + + This constructor creates an edge pair collection with a single edge pair. + + This constructor has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator) -> EdgePairs: + r""" + @brief Constructor from a hierarchical shape set + + This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. + Only edge pairs are taken from the shape set and other shapes are ignored. + This method allows feeding the edge pair collection from a hierarchy of cells. + Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer)) + @/code + + This constructor has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shapes: Shapes) -> EdgePairs: + r""" + @brief Shapes constructor + + This constructor creates an edge pair collection from a \Shapes collection. + + This constructor has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore) -> EdgePairs: + r""" + @brief Creates a hierarchical edge pair collection from an original layer + + This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. + This version will create a hierarchical edge pair collection which supports hierarchical operations. + Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. + + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer)) + @/code + + This constructor has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> EdgePairs: + r""" + @brief Constructor from a hierarchical shape set with a transformation + + This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. + Only edge pairs are taken from the shape set and other shapes are ignored. + The given transformation is applied to each edge pair taken. + This method allows feeding the edge pair collection from a hierarchy of cells. + The transformation is useful to scale to a specific database unit for example. + Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + + This constructor has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans) -> EdgePairs: + r""" + @brief Creates a hierarchical edge pair collection from an original layer with a transformation + + This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. + This version will create a hierarchical edge pair collection which supports hierarchical operations. + The transformation is useful to scale to a specific database unit for example. + Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. + + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + + This constructor has been introduced in version 0.26. + """ def __add__(self, other: EdgePairs) -> EdgePairs: r""" @brief Returns the combined edge pair collection of self and the other one @@ -6995,10 +8755,13 @@ class EdgePairs(ShapeCollection): r""" @brief Returns each edge pair of the edge pair collection """ - def __repr__(self) -> str: + def __len__(self) -> int: r""" - @brief Converts the edge pair collection to a string - The length of the output is limited to 20 edge pairs to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. + @brief Returns the (flat) number of edge pairs in the edge pair collection + + The count is computed 'as if flat', i.e. edge pairs inside a cell are multiplied by the number of times a cell is instantiated. + + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. """ def __str__(self) -> str: r""" @@ -7063,12 +8826,29 @@ class EdgePairs(ShapeCollection): Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def data_id(self) -> int: r""" @brief Returns the data ID (a unique identifier for the underlying data storage) This method has been added in version 0.26. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def disable_progress(self) -> None: r""" @brief Disable progress reporting @@ -7176,6 +8956,12 @@ class EdgePairs(ShapeCollection): This method has been introduced in version 0.26. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_deep(self) -> bool: r""" @brief Returns true if the edge pair collection is a deep (hierarchical) one @@ -7257,6 +9043,14 @@ class EdgePairs(ShapeCollection): @brief Returns the second one of all edges @return An edge collection containing the second edges """ + def size(self) -> int: + r""" + @brief Returns the (flat) number of edge pairs in the edge pair collection + + The count is computed 'as if flat', i.e. edge pairs inside a cell are multiplied by the number of times a cell is instantiated. + + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. + """ def swap(self, other: EdgePairs) -> None: r""" @brief Swap the contents of this collection with the contents of another collection @@ -7324,6 +9118,17 @@ class EdgePairs(ShapeCollection): @param t The transformation to apply. + @return The transformed edge pair collection. + """ + def transform_icplx(self, t: ICplxTrans) -> EdgePairs: + r""" + @brief Transform the edge pair collection with a complex transformation (modifies self) + + Transforms the edge pair collection with the given transformation. + This version modifies the edge pair collection and returns a reference to self. + + @param t The transformation to apply. + @return The transformed edge pair collection. """ @overload @@ -7376,6 +9181,17 @@ class EdgePairs(ShapeCollection): @param t The transformation to apply. + @return The transformed edge pairs. + """ + def transformed_icplx(self, t: ICplxTrans) -> EdgePairs: + r""" + @brief Transform the edge pair collection with a complex transformation + + Transforms the edge pairs with the given complex transformation. + Does not modify the edge pair collection but returns the transformed edge pairs. + + @param t The transformation to apply. + @return The transformed edge pairs. """ @overload @@ -7560,6 +9376,36 @@ class EdgeProcessor: r""" @brief boolean method's mode value for XOR operation """ + @classmethod + def mode_and(cls) -> int: + r""" + @brief boolean method's mode value for AND operation + """ + @classmethod + def mode_anotb(cls) -> int: + r""" + @brief boolean method's mode value for A NOT B operation + """ + @classmethod + def mode_bnota(cls) -> int: + r""" + @brief boolean method's mode value for B NOT A operation + """ + @classmethod + def mode_or(cls) -> int: + r""" + @brief boolean method's mode value for OR operation + """ + @classmethod + def mode_xor(cls) -> int: + r""" + @brief boolean method's mode value for XOR operation + """ + @classmethod + def new(cls) -> EdgeProcessor: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> EdgeProcessor: r""" @brief Creates a copy of self @@ -7609,6 +9455,44 @@ class EdgeProcessor: r""" @brief Assigns another object to self """ + @overload + def boolean(self, a: Sequence[Edge], b: Sequence[Edge], mode: int) -> List[Edge]: + r""" + @brief Boolean operation for a set of given edges, creating edges + + This method computes the result for the given boolean operation on two sets of edges. + The input edges must form closed contours where holes and hulls must be oriented differently. + The input edges are processed with a simple non-zero wrap count rule as a whole. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param a The input edges (first operand) + @param b The input edges (second operand) + @param mode The boolean mode (one of the Mode.. values) + @return The output edges + """ + @overload + def boolean(self, a: Sequence[Polygon], b: Sequence[Polygon], mode: int) -> List[Edge]: + r""" + @brief Boolean operation for a set of given polygons, creating edges + + This method computes the result for the given boolean operation on two sets of polygons. + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a Boolean operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param a The input polygons (first operand) + @param b The input polygons (second operand) + @param mode The boolean mode + @return The output edges + """ def boolean_e2e(self, a: Sequence[Edge], b: Sequence[Edge], mode: int) -> List[Edge]: r""" @brief Boolean operation for a set of given edges, creating edges @@ -7683,6 +9567,63 @@ class EdgeProcessor: @param min_coherence true, if touching corners should be resolved into less connected contours @return The output polygons """ + @overload + def boolean_to_polygon(self, a: Sequence[Edge], b: Sequence[Edge], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Boolean operation for a set of given edges, creating polygons + + This method computes the result for the given boolean operation on two sets of edges. + The input edges must form closed contours where holes and hulls must be oriented differently. + The input edges are processed with a simple non-zero wrap count rule as a whole. + + This method produces polygons on output and allows fine-tuning of the parameters for that purpose. + + Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param a The input polygons (first operand) + @param b The input polygons (second operand) + @param mode The boolean mode (one of the Mode.. values) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def boolean_to_polygon(self, a: Sequence[Polygon], b: Sequence[Polygon], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Boolean operation for a set of given polygons, creating polygons + + This method computes the result for the given boolean operation on two sets of polygons. + This method produces polygons on output and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a Boolean operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param a The input polygons (first operand) + @param b The input polygons (second operand) + @param mode The boolean mode (one of the Mode.. values) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def disable_progress(self) -> None: r""" @brief Disable progress reporting @@ -7703,6 +9644,31 @@ class EdgeProcessor: This method has been introduced in version 0.23. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def merge(self, in_: Sequence[Polygon], min_wc: int) -> List[Edge]: + r""" + @brief Merge the given polygons + + In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. + Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the + hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps + of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping + polygons do not contribute to higher wrap count areas. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + Prior to version 0.21 this method was called 'merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) + @return The output edges + """ def merge_p2e(self, in_: Sequence[Polygon], min_wc: int) -> List[Edge]: r""" @brief Merge the given polygons @@ -7742,6 +9708,112 @@ class EdgeProcessor: @param min_coherence true, if touching corners should be resolved into less connected contours @return The output polygons """ + def merge_to_polygon(self, in_: Sequence[Polygon], min_wc: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Merge the given polygons + + In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. + Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the + hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps + of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping + polygons do not contribute to higher wrap count areas. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + Prior to version 0.21 this method was called 'merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def simple_merge(self, in_: Sequence[Edge]) -> List[Edge]: + r""" + @brief Merge the given edges in a simple "non-zero wrapcount" fashion + + The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. + Overlapping contours are merged when the orientation is the same. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'simple_merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input edges + @return The output edges + """ + @overload + def simple_merge(self, in_: Sequence[Polygon]) -> List[Edge]: + r""" + @brief Merge the given polygons in a simple "non-zero wrapcount" fashion + + The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they + have different orientation (since a polygon is oriented by construction that is not easy to achieve). + The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before + merging them. "simple_merge" is somewhat faster and consumes less memory. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'simple_merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @return The output edges + """ + @overload + def simple_merge(self, in_: Sequence[Edge], mode: int) -> List[Edge]: + r""" + @brief Merge the given polygons and specify the merge mode + + The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. + Overlapping contours are merged when the orientation is the same. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + This method has been added in version 0.22. + + The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). + + @param mode See description + @param in The input edges + @return The output edges + """ + @overload + def simple_merge(self, in_: Sequence[Polygon], mode: int) -> List[Edge]: + r""" + @brief Merge the given polygons and specify the merge mode + + The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they + have different orientation (since a polygon is oriented by construction that is not easy to achieve). + The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before + merging them. "simple_merge" is somewhat faster and consumes less memory. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + This method has been added in version 0.22. + + The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). + + @param mode See description + @param in The input polygons + @return The output edges + """ @overload def simple_merge_e2e(self, in_: Sequence[Edge]) -> List[Edge]: r""" @@ -7919,6 +9991,134 @@ class EdgeProcessor: @return The output polygons """ @overload + def simple_merge_to_polygon(self, in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Merge the given edges in a simple "non-zero wrapcount" fashion into polygons + + The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. + Overlapping contours are merged when the orientation is the same. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'simple_merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input edges + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def simple_merge_to_polygon(self, in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Merge the given polygons in a simple "non-zero wrapcount" fashion into polygons + + The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they + have different orientation (since a polygon is oriented by construction that is not easy to achieve). + The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before + merging them. "simple_merge" is somewhat faster and consumes less memory. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'simple_merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def simple_merge_to_polygon(self, in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]: + r""" + @brief Merge the given polygons and specify the merge mode + + The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. + Overlapping contours are merged when the orientation is the same. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + This method has been added in version 0.22. + + The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). + + @param mode See description + @param in The input edges + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def simple_merge_to_polygon(self, in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]: + r""" + @brief Merge the given polygons and specify the merge mode + + The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they + have different orientation (since a polygon is oriented by construction that is not easy to achieve). + The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before + merging them. "simple_merge" is somewhat faster and consumes less memory. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + This method has been added in version 0.22. + + The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). + + @param mode See description + @param in The input polygons + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def size(self, in_: Sequence[Polygon], d: int, mode: int) -> List[Edge]: + r""" + @brief Size the given polygons (isotropic) + + This method is equivalent to calling the anisotropic version with identical dx and dy. + + Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param d The sizing value in x direction + @param mode The sizing mode + @return The output edges + """ + @overload + def size(self, in_: Sequence[Polygon], dx: int, dy: int, mode: int) -> List[Edge]: + r""" + @brief Size the given polygons + + This method sizes a set of polygons. Before the sizing is applied, the polygons are merged. After that, sizing is applied + on the individual result polygons of the merge step. The result may contain overlapping contours, but no self-overlaps. + + dx and dy describe the sizing. A positive value indicates oversize (outwards) while a negative one describes undersize (inwards). + The sizing applied can be chosen differently in x and y direction. In this case, the sign must be identical for both + dx and dy. + + The 'mode' parameter describes the corner fill strategy. Mode 0 connects all corner segments directly. Mode 1 is the 'octagon' strategy in which square corners are interpolated with a partial octagon. Mode 2 is the standard mode in which corners are filled by expanding edges unless these edges form a sharp bend with an angle of more than 90 degree. In that case, the corners are cut off. In Mode 3, no cutoff occurs up to a bending angle of 135 degree. Mode 4 and 5 are even more aggressive and allow very sharp bends without cutoff. This strategy may produce long spikes on sharply bending corners. + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param dx The sizing value in x direction + @param dy The sizing value in y direction + @param mode The sizing mode (standard is 2) + @return The output edges + """ + @overload def size_p2e(self, in_: Sequence[Polygon], d: int, mode: int) -> List[Edge]: r""" @brief Size the given polygons (isotropic) @@ -7990,6 +10190,48 @@ class EdgeProcessor: Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + @param in The input polygons + @param dx The sizing value in x direction + @param dy The sizing value in y direction + @param mode The sizing mode (standard is 2) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def size_to_polygon(self, in_: Sequence[Polygon], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Size the given polygons into polygons (isotropic) + + This method is equivalent to calling the anisotropic version with identical dx and dy. + + Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param d The sizing value in x direction + @param mode The sizing mode + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def size_to_polygon(self, in_: Sequence[Polygon], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Size the given polygons into polygons + + This method sizes a set of polygons. Before the sizing is applied, the polygons are merged. After that, sizing is applied + on the individual result polygons of the merge step. The result may contain overlapping polygons, but no self-overlapping ones. + Polygon overlap occurs if the polygons are close enough, so a positive sizing makes polygons overlap. + + dx and dy describe the sizing. A positive value indicates oversize (outwards) while a negative one describes undersize (inwards). + The sizing applied can be chosen differently in x and y direction. In this case, the sign must be identical for both + dx and dy. + + The 'mode' parameter describes the corner fill strategy. Mode 0 connects all corner segments directly. Mode 1 is the 'octagon' strategy in which square corners are interpolated with a partial octagon. Mode 2 is the standard mode in which corners are filled by expanding edges unless these edges form a sharp bend with an angle of more than 90 degree. In that case, the corners are cut off. In Mode 3, no cutoff occurs up to a bending angle of 135 degree. Mode 4 and 5 are even more aggressive and allow very sharp bends without cutoff. This strategy may produce long spikes on sharply bending corners. + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + @param in The input polygons @param dx The sizing value in x direction @param dy The sizing value in y direction @@ -8047,12 +10289,221 @@ class Edges(ShapeCollection): """ merged_semantics: bool r""" + Getter: @brief Gets a flag indicating whether merged semantics is enabled See \merged_semantics= for a description of this attribute. + + Setter: @brief Enable or disable merged semantics If merged semantics is enabled (the default), colinear, connected or overlapping edges will be considered as single edges. """ + @overload + @classmethod + def new(cls) -> Edges: + r""" + @brief Default constructor + + This constructor creates an empty edge collection. + """ + @overload + @classmethod + def new(cls, array: Sequence[Edge]) -> Edges: + r""" + @brief Constructor from an edge array + + This constructor creates an edge collection from an array of edges. + """ + @overload + @classmethod + def new(cls, array: Sequence[Polygon]) -> Edges: + r""" + @brief Constructor from a polygon array + + This constructor creates an edge collection from an array of polygons. + The edges form the contours of the polygons. + """ + @overload + @classmethod + def new(cls, box: Box) -> Edges: + r""" + @brief Box constructor + + This constructor creates an edge collection from a box. + The edges form the contour of the box. + """ + @overload + @classmethod + def new(cls, edge: Edge) -> Edges: + r""" + @brief Constructor from a single edge + + This constructor creates an edge collection with a single edge. + """ + @overload + @classmethod + def new(cls, path: Path) -> Edges: + r""" + @brief Path constructor + + This constructor creates an edge collection from a path. + The edges form the contour of the path. + """ + @overload + @classmethod + def new(cls, polygon: Polygon) -> Edges: + r""" + @brief Polygon constructor + + This constructor creates an edge collection from a polygon. + The edges form the contour of the polygon. + """ + @overload + @classmethod + def new(cls, polygon: SimplePolygon) -> Edges: + r""" + @brief Simple polygon constructor + + This constructor creates an edge collection from a simple polygon. + The edges form the contour of the polygon. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, as_edges: Optional[bool] = ...) -> Edges: + r""" + @brief Constructor of a flat edge collection from a hierarchical shape set + + This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. + It feeds the shapes from a hierarchy of cells into a flat edge set. + + Text objects are not inserted, because they cannot be converted to edges. + Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::Edges::new(layout.begin_shapes(cell, layer), false) + @/code + """ + @overload + @classmethod + def new(cls, shapes: Shapes, as_edges: Optional[bool] = ...) -> Edges: + r""" + @brief Constructor of a flat edge collection from a \Shapes container + + If 'as_edges' is true, the shapes from the container will be converted to edges (i.e. polygon contours to edges). Otherwise, only edges will be taken from the container. + + This method has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, as_edges: Optional[bool] = ...) -> Edges: + r""" + @brief Constructor of a hierarchical edge collection + + This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. + It feeds the shapes from a hierarchy of cells into the hierarchical edge set. + The edges remain within their original hierarchy unless other operations require the edges to be moved in the hierarchy. + + Text objects are not inserted, because they cannot be converted to edges. + Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. + + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::Edges::new(layout.begin_shapes(cell, layer), dss, false) + @/code + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ...) -> Edges: + r""" + @brief Constructor from a text set + + @param shape_iterator The iterator from which to derive the texts + @param expr The selection string + @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. + + This special constructor will create dot-like edges from the text objects delivered by the shape iterator. Each text object will give a degenerated edge (a dot) that represents the text origin. + Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: + + @code + dots = RBA::Edges::new(iter, "*") # all texts + dots = RBA::Edges::new(iter, "A*") # all texts starting with an 'A' + dots = RBA::Edges::new(iter, "A*", false) # all texts exactly matching 'A*' + @/code + + This method has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans, as_edges: Optional[bool] = ...) -> Edges: + r""" + @brief Constructor of a flat edge collection from a hierarchical shape set with a transformation + + This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. + It feeds the shapes from a hierarchy of cells into a flat edge set. + The transformation is useful to scale to a specific database unit for example. + + Text objects are not inserted, because they cannot be converted to edges. + Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Edges::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, expr: str, as_pattern: Optional[bool] = ...) -> Edges: + r""" + @brief Constructor from a text set + + @param shape_iterator The iterator from which to derive the texts + @param dss The \DeepShapeStore object that acts as a heap for hierarchical operations. + @param expr The selection string + @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. + + This special constructor will create a deep edge set from the text objects delivered by the shape iterator. Each text object will give a degenerated edge (a dot) that represents the text origin. + Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: + + @code + region = RBA::Region::new(iter, dss, "*") # all texts + region = RBA::Region::new(iter, dss, "A*") # all texts starting with an 'A' + region = RBA::Region::new(iter, dss, "A*", false) # all texts exactly matching 'A*' + @/code + + This method has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans, as_edges: Optional[bool] = ...) -> Edges: + r""" + @brief Constructor of a hierarchical edge collection with a transformation + + This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. + It feeds the shapes from a hierarchy of cells into the hierarchical edge set. + The edges remain within their original hierarchy unless other operations require the edges to be moved in the hierarchy. + The transformation is useful to scale to a specific database unit for example. + + Text objects are not inserted, because they cannot be converted to edges. + Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. + + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Edges::new(layout.begin_shapes(cell, layer), dss, RBA::ICplxTrans::new(layout.dbu / dbu), false) + @/code + """ def __add__(self, other: Edges) -> Edges: r""" @brief Returns the combined edge set of self and the other one @@ -8363,6 +10814,15 @@ class Edges(ShapeCollection): The boolean XOR operation will return all parts of the edges in this and the other collection except the parts where both are coincident. The result will be a merged edge collection. """ + def __len__(self) -> int: + r""" + @brief Returns the (flat) number of edges in the edge collection + + This returns the number of raw edges (not merged edges if merged semantics is enabled). + The count is computed 'as if flat', i.e. edges inside a cell are multiplied by the number of times a cell is instantiated. + + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. + """ def __or__(self, other: Edges) -> Edges: r""" @brief Returns the boolean OR between self and the other edge set @@ -8371,11 +10831,6 @@ class Edges(ShapeCollection): The boolean OR is implemented by merging the edges of both edge sets. To simply join the edge collections without merging, the + operator is more efficient. """ - def __repr__(self) -> str: - r""" - @brief Converts the edge collection to a string - The length of the output is limited to 20 edges to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. - """ def __str__(self) -> str: r""" @brief Converts the edge collection to a string @@ -8450,6 +10905,28 @@ class Edges(ShapeCollection): Usually it's not required to call this method. It has been introduced in version 0.24. """ + @overload + def andnot(self, other: Edges) -> List[Edges]: + r""" + @brief Returns the boolean AND and NOT between self and the other edge set + + @return A two-element array of edge collections with the first one being the AND result and the second one being the NOT result + + This method will compute the boolean AND and NOT between two edge sets simultaneously. Because this requires a single sweep only, using this method is faster than doing AND and NOT separately. + + This method has been added in version 0.28. + """ + @overload + def andnot(self, other: Region) -> List[Edges]: + r""" + @brief Returns the boolean AND and NOT between self and the region + + @return A two-element array of edge collections with the first one being the AND result and the second one being the NOT result + + This method will compute the boolean AND and NOT simultaneously. Because this requires a single sweep only, using this method is faster than doing AND and NOT separately. + + This method has been added in version 0.28. + """ def assign(self, other: ShapeCollection) -> None: r""" @brief Assigns another object to self @@ -8488,12 +10965,29 @@ class Edges(ShapeCollection): Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def data_id(self) -> int: r""" @brief Returns the data ID (a unique identifier for the underlying data storage) This method has been added in version 0.26. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def disable_progress(self) -> None: r""" @brief Disable progress reporting @@ -8524,7 +11018,6 @@ class Edges(ShapeCollection): """ def enclosed_check(self, other: Edges, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: r""" - Note: This is an alias of 'inside_check'. @brief Performs an inside check with options @param d The minimum distance for which the edges are checked @param other The other edge collection against which to check @@ -8662,6 +11155,11 @@ class Edges(ShapeCollection): This method has been introduced in version 0.27. """ + def in_(self, other: Edges) -> Edges: + r""" + @brief Returns all edges which are members of the other edge collection + This method returns all edges in self which can be found in the other edge collection as well with exactly the same geometry. + """ @overload def insert(self, box: Box) -> None: r""" @@ -8772,6 +11270,24 @@ class Edges(ShapeCollection): This method has been introduced in version 0.26. """ + @overload + def inside(self, other: Edges) -> Edges: + r""" + @brief Returns the edges of this edge collection which are inside (completely covered by) edges from the other edge collection + + @return A new edge collection containing the edges overlapping or touching edges from the other edge collection + + This method has been introduced in version 0.28. + """ + @overload + def inside(self, other: Region) -> Edges: + r""" + @brief Returns the edges from this edge collection which are inside (completely covered by) polygons from the region + + @return A new edge collection containing the edges overlapping or touching polygons from the region + + This method has been introduced in version 0.28. + """ def inside_check(self, other: Edges, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: r""" @brief Performs an inside check with options @@ -8795,6 +11311,16 @@ class Edges(ShapeCollection): The 'enclosed_check' alias was introduced in version 0.27.5. """ + def inside_outside_part(self, other: Region) -> List[Edges]: + r""" + @brief Returns the partial edges inside and outside the given region + + @return A two-element array of edge collections with the first one being the \inside_part result and the second one being the \outside_part result + + This method will compute the results simultaneously. Because this requires a single sweep only, using this method is faster than doing \inside_part and \outside_part separately. + + This method has been added in version 0.28. + """ def inside_part(self, other: Region) -> Edges: r""" @brief Returns the parts of the edges of this edge collection which are inside the polygons of the region @@ -8814,8 +11340,6 @@ class Edges(ShapeCollection): @brief Returns the edges of this edge collection which overlap or touch edges from the other edge collection @return A new edge collection containing the edges overlapping or touching edges from the other edge collection - - This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used. """ @overload def interacting(self, other: Region) -> Edges: @@ -8823,8 +11347,6 @@ class Edges(ShapeCollection): @brief Returns the edges from this edge collection which overlap or touch polygons from the region @return A new edge collection containing the edges overlapping or touching polygons from the region - - This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used. """ def intersections(self, other: Edges) -> Edges: r""" @@ -8833,6 +11355,12 @@ class Edges(ShapeCollection): This method has been introduced in version 0.26.2 """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_deep(self) -> bool: r""" @brief Returns true if the edge collection is a deep (hierarchical) one @@ -8943,14 +11471,35 @@ class Edges(ShapeCollection): @return The moved edge collection. """ + def not_in(self, other: Edges) -> Edges: + r""" + @brief Returns all edges which are not members of the other edge collection + This method returns all edges in self which can not be found in the other edge collection with exactly the same geometry. + """ + @overload + def not_inside(self, other: Edges) -> Edges: + r""" + @brief Returns the edges of this edge collection which are not inside (completely covered by) edges from the other edge collection + + @return A new edge collection containing the edges not overlapping or touching edges from the other edge collection + + This method has been introduced in version 0.28. + """ + @overload + def not_inside(self, other: Region) -> Edges: + r""" + @brief Returns the edges from this edge collection which are not inside (completely covered by) polygons from the region + + @return A new edge collection containing the edges not overlapping or touching polygons from the region + + This method has been introduced in version 0.28. + """ @overload def not_interacting(self, other: Edges) -> Edges: r""" @brief Returns the edges of this edge collection which do not overlap or touch edges from the other edge collection @return A new edge collection containing the edges not overlapping or touching edges from the other edge collection - - This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used. """ @overload def not_interacting(self, other: Region) -> Edges: @@ -8958,14 +11507,48 @@ class Edges(ShapeCollection): @brief Returns the edges from this edge collection which do not overlap or touch polygons from the region @return A new edge collection containing the edges not overlapping or touching polygons from the region - - This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used. """ def not_members_of(self, other: Edges) -> Edges: r""" @brief Returns all edges which are not members of the other edge collection This method returns all edges in self which can not be found in the other edge collection with exactly the same geometry. """ + @overload + def not_outside(self, other: Edges) -> Edges: + r""" + @brief Returns the edges of this edge collection which are not outside (completely covered by) edges from the other edge collection + + @return A new edge collection containing the edges not overlapping or touching edges from the other edge collection + + This method has been introduced in version 0.28. + """ + @overload + def not_outside(self, other: Region) -> Edges: + r""" + @brief Returns the edges from this edge collection which are not outside (completely covered by) polygons from the region + + @return A new edge collection containing the edges not overlapping or touching polygons from the region + + This method has been introduced in version 0.28. + """ + @overload + def outside(self, other: Edges) -> Edges: + r""" + @brief Returns the edges of this edge collection which are outside (completely covered by) edges from the other edge collection + + @return A new edge collection containing the edges overlapping or touching edges from the other edge collection + + This method has been introduced in version 0.28. + """ + @overload + def outside(self, other: Region) -> Edges: + r""" + @brief Returns the edges from this edge collection which are outside (completely covered by) polygons from the region + + @return A new edge collection containing the edges overlapping or touching polygons from the region + + This method has been introduced in version 0.28. + """ def outside_part(self, other: Region) -> Edges: r""" @brief Returns the parts of the edges of this edge collection which are outside the polygons of the region @@ -9024,6 +11607,24 @@ class Edges(ShapeCollection): This method has been introduced in version 0.26.1 """ + @overload + def select_inside(self, other: Edges) -> Edges: + r""" + @brief Selects the edges from this edge collection which are inside (completely covered by) edges from the other edge collection + + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. + """ + @overload + def select_inside(self, other: Region) -> Edges: + r""" + @brief Selects the edges from this edge collection which are inside (completely covered by) polygons from the region + + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. + """ def select_inside_part(self, other: Region) -> Edges: r""" @brief Selects the parts of the edges from this edge collection which are inside the polygons of the given region @@ -9043,8 +11644,6 @@ class Edges(ShapeCollection): @brief Selects the edges from this edge collection which overlap or touch edges from the other edge collection @return The edge collection after the edges have been selected (self) - - This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used. """ @overload def select_interacting(self, other: Region) -> Edges: @@ -9052,8 +11651,24 @@ class Edges(ShapeCollection): @brief Selects the edges from this edge collection which overlap or touch polygons from the region @return The edge collection after the edges have been selected (self) + """ + @overload + def select_not_inside(self, other: Edges) -> Edges: + r""" + @brief Selects the edges from this edge collection which are not inside (completely covered by) edges from the other edge collection - This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used. + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. + """ + @overload + def select_not_inside(self, other: Region) -> Edges: + r""" + @brief Selects the edges from this edge collection which are not inside (completely covered by) polygons from the region + + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. """ @overload def select_not_interacting(self, other: Edges) -> Edges: @@ -9061,8 +11676,6 @@ class Edges(ShapeCollection): @brief Selects the edges from this edge collection which do not overlap or touch edges from the other edge collection @return The edge collection after the edges have been selected (self) - - This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used. """ @overload def select_not_interacting(self, other: Region) -> Edges: @@ -9070,8 +11683,42 @@ class Edges(ShapeCollection): @brief Selects the edges from this edge collection which do not overlap or touch polygons from the region @return The edge collection after the edges have been selected (self) + """ + @overload + def select_not_outside(self, other: Edges) -> Edges: + r""" + @brief Selects the edges from this edge collection which are not outside (completely covered by) edges from the other edge collection - This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used. + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. + """ + @overload + def select_not_outside(self, other: Region) -> Edges: + r""" + @brief Selects the edges from this edge collection which are not outside (completely covered by) polygons from the region + + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. + """ + @overload + def select_outside(self, other: Edges) -> Edges: + r""" + @brief Selects the edges from this edge collection which are outside (completely covered by) edges from the other edge collection + + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. + """ + @overload + def select_outside(self, other: Region) -> Edges: + r""" + @brief Selects the edges from this edge collection which are outside (completely covered by) polygons from the region + + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. """ def select_outside_part(self, other: Region) -> Edges: r""" @@ -9107,6 +11754,15 @@ class Edges(ShapeCollection): "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. """ + def size(self) -> int: + r""" + @brief Returns the (flat) number of edges in the edge collection + + This returns the number of raw edges (not merged edges if merged semantics is enabled). + The count is computed 'as if flat', i.e. edges inside a cell are multiplied by the number of times a cell is instantiated. + + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. + """ def space_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: r""" @brief Performs a space check with options @@ -9127,6 +11783,60 @@ class Edges(ShapeCollection): "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. """ + @overload + def split_inside(self, other: Edges) -> List[Edges]: + r""" + @brief Selects the edges from this edge collection which are and are not inside (completely covered by) edges from the other collection + + @return A two-element list of edge collections (first: inside, second: non-inside) + + This method provides a faster way to compute both inside and non-inside edges compared to using separate methods. It has been introduced in version 0.28. + """ + @overload + def split_inside(self, other: Region) -> List[Edges]: + r""" + @brief Selects the edges from this edge collection which are and are not inside (completely covered by) polygons from the other region + + @return A two-element list of edge collections (first: inside, second: non-inside) + + This method provides a faster way to compute both inside and non-inside edges compared to using separate methods. It has been introduced in version 0.28. + """ + @overload + def split_interacting(self, other: Edges) -> List[Edges]: + r""" + @brief Selects the edges from this edge collection which do and do not interact with edges from the other collection + + @return A two-element list of edge collections (first: interacting, second: non-interacting) + + This method provides a faster way to compute both interacting and non-interacting edges compared to using separate methods. It has been introduced in version 0.28. + """ + @overload + def split_interacting(self, other: Region) -> List[Edges]: + r""" + @brief Selects the edges from this edge collection which do and do not interact with polygons from the other region + + @return A two-element list of edge collections (first: interacting, second: non-interacting) + + This method provides a faster way to compute both interacting and non-interacting edges compared to using separate methods. It has been introduced in version 0.28. + """ + @overload + def split_outside(self, other: Edges) -> List[Edges]: + r""" + @brief Selects the edges from this edge collection which are and are not outside (completely covered by) edges from the other collection + + @return A two-element list of edge collections (first: outside, second: non-outside) + + This method provides a faster way to compute both outside and non-outside edges compared to using separate methods. It has been introduced in version 0.28. + """ + @overload + def split_outside(self, other: Region) -> List[Edges]: + r""" + @brief Selects the edges from this edge collection which are and are not outside (completely covered by) polygons from the other region + + @return A two-element list of edge collections (first: outside, second: non-outside) + + This method provides a faster way to compute both outside and non-outside edges compared to using separate methods. It has been introduced in version 0.28. + """ def start_segments(self, length: int, fraction: float) -> Edges: r""" @brief Returns edges representing a part of the edge after the start point @@ -9210,6 +11920,17 @@ class Edges(ShapeCollection): @param t The transformation to apply. + @return The transformed edge collection. + """ + def transform_icplx(self, t: ICplxTrans) -> Edges: + r""" + @brief Transform the edge collection with a complex transformation (modifies self) + + Transforms the edge collection with the given transformation. + This version modifies the edge collection and returns a reference to self. + + @param t The transformation to apply. + @return The transformed edge collection. """ @overload @@ -9262,6 +11983,17 @@ class Edges(ShapeCollection): @param t The transformation to apply. + @return The transformed edge collection. + """ + def transformed_icplx(self, t: ICplxTrans) -> Edges: + r""" + @brief Transform the edge collection with a complex transformation + + Transforms the edge collection with the given complex transformation. + Does not modify the edge collection but returns the transformed edge collection. + + @param t The transformation to apply. + @return The transformed edge collection. """ def width_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: @@ -9321,325 +12053,44 @@ class Edges(ShapeCollection): If you don't want to specify a lower or upper limit, pass nil to that parameter. """ -class TextGenerator: - r""" - @brief A text generator class - - A text generator is basically a way to produce human-readable text for labelling layouts. It's similar to the Basic.TEXT PCell, but more convenient to use in a scripting context. - - Generators can be constructed from font files (or resources) or one of the registered generators can be used. - - To create a generator from a font file proceed this way: - @code - gen = RBA::TextGenerator::new - gen.load_from_file("myfont.gds") - region = gen.text("A TEXT", 0.001) - @/code - - This code produces a RBA::Region with a database unit of 0.001 micron. This region can be fed into a \Shapes container to place it into a cell for example. - - By convention the font files must have two to three layers: - - @ul - @li 1/0 for the actual data @/li - @li 2/0 for the borders @/li - @li 3/0 for an optional additional background @/li - @/ul - - Currently, all glyphs must be bottom-left aligned at 0, 0. The - border must be drawn in at least one glyph cell. The border is taken - as the overall bbox of all borders. - - The glyph cells must be named with a single character or "nnn" where "d" is the - ASCII code of the character (i.e. "032" for space). Allowed ASCII codes are 32 through 127. - If a lower-case "a" character is defined, lower-case letters are supported. - Otherwise, lowercase letters are mapped to uppercase letters. - - Undefined characters are left blank in the output. - - A comment cell can be defined ("COMMENT") which must hold one text in layer 1 - stating the comment, and additional descriptions such as line width: - - @ul - @li "line_width=": Specifies the intended line width in micron units @/li - @li "design_grid=": Specifies the intended design grid in micron units @/li - @li any other text: The description string @/li - @/ul - - Generators can be picked form a list of predefined generator. See \generators, \default_generator and \generator_by_name for picking a generator from the list. - - This class has been introduced in version 0.25. - """ - @classmethod - def default_generator(cls) -> TextGenerator: - r""" - @brief Gets the default text generator (a standard font) - This method delivers the default generator or nil if no such generator is installed. - """ - @classmethod - def font_paths(cls) -> List[str]: - r""" - @brief Gets the paths where to look for font files - See \set_font_paths for a description of this function. - - This method has been introduced in version 0.27.4. - """ - @classmethod - def generators(cls) -> List[TextGenerator]: - r""" - @brief Gets the generators registered in the system - This method delivers a list of generator objects that can be used to create texts. - """ - def __copy__(self) -> TextGenerator: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: TextGenerator) -> None: - r""" - @brief Assigns another object to self - """ - def background(self) -> Box: - r""" - @brief Gets the background rectangle of each glyph in the generator's database units - The background rectangle is the one that is used as background for inverted rendering. A version that delivers this value in micrometer units is \dbackground. - """ - def dbackground(self) -> DBox: - r""" - @brief Gets the background rectangle in micron units - The background rectangle is the one that is used as background for inverted rendering. - """ - def dbu(self) -> float: - r""" - @brief Gets the basic database unit the design of the glyphs was made - This database unit the basic resolution of the glyphs. - """ - def ddesign_grid(self) -> float: - r""" - @brief Gets the design grid of the glyphs in micron units - The design grid is the basic grid used when designing the glyphs. In most cases this grid is bigger than the database unit. - """ - def description(self) -> str: - r""" - @brief Gets the description text of the generator - The generator's description text is a human-readable text that is used to identify the generator (aka 'font') in user interfaces. - """ - def design_grid(self) -> int: - r""" - @brief Gets the design grid of the glyphs in the generator's database units - The design grid is the basic grid used when designing the glyphs. In most cases this grid is bigger than the database unit. A version that delivers this value in micrometer units is \ddesign_grid. - """ - def dheight(self) -> float: - r""" - @brief Gets the design height of the glyphs in micron units - The height is the height of the rectangle occupied by each character. - """ - def dline_width(self) -> float: - r""" - @brief Gets the line width of the glyphs in micron units - The line width is the intended (not necessarily precisely) line width of typical character lines (such as the bar of an 'I'). - """ - def dup(self) -> TextGenerator: - r""" - @brief Creates a copy of self - """ - def dwidth(self) -> float: - r""" - @brief Gets the design width of the glyphs in micron units - The width is the width of the rectangle occupied by each character. - """ - def generator_by_name(self, name: str) -> TextGenerator: - r""" - @brief Gets the text generator for a given name - This method delivers the generator with the given name or nil if no such generator is registered. - """ - def glyph(self, char: str) -> Region: - r""" - @brief Gets the glyph of the given character as a region - The region represents the glyph's outline and is delivered in the generator's database units .A more elaborate way to getting the text's outline is \text. - """ - def height(self) -> int: - r""" - @brief Gets the design height of the glyphs in the generator's database units - The height is the height of the rectangle occupied by each character. A version that delivers this value in micrometer units is \dheight. - """ - def line_width(self) -> int: - r""" - @brief Gets the line width of the glyphs in the generator's database units - The line width is the intended (not necessarily precisely) line width of typical character lines (such as the bar of an 'I'). A version that delivers this value in micrometer units is \dline_width. - """ - def load_from_file(self, path: str) -> None: - r""" - @brief Loads the given file into the generator - See the description of the class how the layout data is read. - """ - def name(self) -> str: - r""" - @brief Gets the name of the generator - The generator's name is the basic key by which the generator is identified. - """ - def set_font_paths(self, arg0: Sequence[str]) -> None: - r""" - @brief Sets the paths where to look for font files - This function sets the paths where to look for font files. After setting such a path, each font found will render a specific generator. The generator can be found under the font file's name. As the text generator is also the basis for the Basic.TEXT PCell, using this function also allows configuring custom fonts for this library cell. - - This method has been introduced in version 0.27.4. - """ - def text(self, text: str, target_dbu: float, mag: Optional[float] = ..., inv: Optional[bool] = ..., bias: Optional[float] = ..., char_spacing: Optional[float] = ..., line_spacing: Optional[float] = ...) -> Region: - r""" - @brief Gets the rendered text as a region - @param text The text string - @param target_dbu The database unit for which to produce the text - @param mag The magnification (1.0 for original size) - @param inv inverted rendering: if true, the glyphs are rendered inverse with the background box as the outer bounding box - @param bias An additional bias to be applied (happens before inversion, can be negative) - @param char_spacing Additional space between characters (in micron units) - @param line_spacing Additional space between lines (in micron units) - Various options can be specified to control the appearance of the text. See the description of the parameters. It's important to specify the target database unit in \target_dbu to indicate what database unit shall be used to create the output for. - """ - def width(self) -> int: - r""" - @brief Gets the design height of the glyphs in the generator's database units - The width is the width of the rectangle occupied by each character. A version that delivers this value in micrometer units is \dwidth. - """ - -class Connectivity: - r""" - @brief This class specifies connections between different layers. - Connections are build using \connect. There are basically two flavours of connections: intra-layer and inter-layer. - - Intra-layer connections make nets begin propagated along different shapes on the same net. Without the intra-layer connections, nets are not propagated over shape boundaries. As this is usually intended, intra-layer connections should always be specified for each layer. - - Inter-layer connections connect shapes on different layers. Shapes which touch across layers will be connected if their layers are specified as being connected through inter-layer \connect. - - All layers are specified in terms of layer indexes. Layer indexes are layout layer indexes (see \Layout class). - - The connectivity object also manages the global nets. Global nets are substrate for example and they are propagated automatically from subcircuits to circuits. Global nets are defined by name and are managed through IDs. To get the name for a given ID, use \global_net_name. - This class has been introduced in version 0.26. - """ - def __copy__(self) -> Connectivity: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: Connectivity) -> None: - r""" - @brief Assigns another object to self - """ - @overload - def connect(self, layer: int) -> None: - r""" - @brief Specifies intra-layer connectivity. - """ - @overload - def connect(self, layer_a: int, layer_b: int) -> None: - r""" - @brief Specifies inter-layer connectivity. - """ - def connect_global(self, layer: int, global_net_name: str) -> int: - r""" - @brief Connects the given layer to the global net given by name. - Returns the ID of the global net. - """ - def dup(self) -> Connectivity: - r""" - @brief Creates a copy of self - """ - def global_net_id(self, global_net_name: str) -> int: - r""" - @brief Gets the ID for a given global net name. - """ - def global_net_name(self, global_net_id: int) -> str: - r""" - @brief Gets the name for a given global net ID. - """ - class InstElement: r""" @brief An element in an instantiation path This objects are used to reference a single instance in a instantiation path. The object is composed of a \CellInstArray object (accessible through the \cell_inst accessor) that describes the basic instance, which may be an array. The particular instance within the array can be further retrieved using the \array_member_trans, \specific_trans or \specific_cplx_trans methods. """ + @overload + @classmethod + def new(cls) -> InstElement: + r""" + @brief Default constructor + """ + @overload + @classmethod + def new(cls, inst: Instance) -> InstElement: + r""" + @brief Create an instance element from a single instance alone + Starting with version 0.15, this method takes an \Instance object (an instance reference) as the argument. + """ + @overload + @classmethod + def new(cls, inst: Instance, a_index: int, b_index: int) -> InstElement: + r""" + @brief Create an instance element from an array instance pointing into a certain array member + Starting with version 0.15, this method takes an \Instance object (an instance reference) as the first argument. + """ + @classmethod + def new_i(cls, inst: Instance) -> InstElement: + r""" + @brief Create an instance element from a single instance alone + Starting with version 0.15, this method takes an \Instance object (an instance reference) as the argument. + """ + @classmethod + def new_iab(cls, inst: Instance, a_index: int, b_index: int) -> InstElement: + r""" + @brief Create an instance element from an array instance pointing into a certain array member + Starting with version 0.15, this method takes an \Instance object (an instance reference) as the first argument. + """ def __copy__(self) -> InstElement: r""" @brief Creates a copy of self @@ -9730,6 +12181,23 @@ class InstElement: This method is equivalent to "self.inst.cell_inst" and provided for convenience. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> InstElement: r""" @brief Creates a copy of self @@ -9756,6 +12224,12 @@ class InstElement: This method has been added in version 0.24. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def prop_id(self) -> int: r""" @brief Accessor to the property attached to this instance. @@ -9806,6 +12280,11 @@ class LayerMapping: This class has been introduced in version 0.23. """ + @classmethod + def new(cls) -> LayerMapping: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> LayerMapping: r""" @brief Creates a copy of self @@ -9880,6 +12359,18 @@ class LayerMapping: The layer mapping is created by looking up each layer of layout_b in layout_a. All layers with matching specifications (\LayerInfo) are mapped. Layouts without a layer/datatype/name specification will not be mapped. Layers with a valid specification which are not found in layout_a are created there. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> LayerMapping: r""" @brief Creates a copy of self @@ -9892,6 +12383,12 @@ class LayerMapping: @param layer_index_b The index of the layer in layout_b whose mapping is requested. @return true, if the layer has a mapping """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def layer_mapping(self, layer_index_b: int) -> int: r""" @brief Determine layer mapping of a layout_b layer to the corresponding layout_a layer. @@ -9932,20 +12429,85 @@ class LayerInfo: """ datatype: int r""" + Getter: @brief Gets the datatype + + Setter: @brief Set the datatype """ layer: int r""" + Getter: @brief Gets the layer number + + Setter: @brief Sets the layer number """ name: str r""" + Getter: @brief Gets the layer name + + Setter: @brief Set the layer name The name is set on OASIS input for example, if the layer has a name. """ + @classmethod + def from_string(cls, s: str, as_target: Optional[bool] = ...) -> LayerInfo: + r""" + @brief Create a layer info object from a string + @param The string + @return The LayerInfo object + + If 'as_target' is true, relative specifications such as '*+1' for layer or datatype are permitted. + + This method will take strings as produced by \to_s and create a \LayerInfo object from them. The format is either "layer", "layer/datatype", "name" or "name (layer/datatype)". + + This method was added in version 0.23. + The 'as_target' argument has been added in version 0.26.5. + """ + @overload + @classmethod + def new(cls) -> LayerInfo: + r""" + @brief The default constructor. + Creates a default \LayerInfo object. + + This method was added in version 0.18. + """ + @overload + @classmethod + def new(cls, name: str) -> LayerInfo: + r""" + @brief The constructor for a named layer. + Creates a \LayerInfo object representing a named layer. + @param name The name + + This method was added in version 0.18. + """ + @overload + @classmethod + def new(cls, layer: int, datatype: int) -> LayerInfo: + r""" + @brief The constructor for a layer/datatype pair. + Creates a \LayerInfo object representing a layer and datatype. + @param layer The layer number + @param datatype The datatype number + + This method was added in version 0.18. + """ + @overload + @classmethod + def new(cls, layer: int, datatype: int, name: str) -> LayerInfo: + r""" + @brief The constructor for a named layer with layer and datatype. + Creates a \LayerInfo object representing a named layer with layer and datatype. + @param layer The layer number + @param datatype The datatype number + @param name The name + + This method was added in version 0.18. + """ def __copy__(self) -> LayerInfo: r""" @brief Creates a copy of self @@ -10009,6 +12571,16 @@ class LayerInfo: This method was added in version 0.18. """ + def __str__(self, as_target: Optional[bool] = ...) -> str: + r""" + @brief Convert the layer info object to a string + @return The string + + If 'as_target' is true, wildcard and relative specifications are formatted such such. + + This method was added in version 0.18. + The 'as_target' argument has been added in version 0.26.5. + """ def _create(self) -> None: r""" @brief Ensures the C++ object is created @@ -10057,23 +12629,27 @@ class LayerInfo: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> LayerInfo: r""" @brief Creates a copy of self """ - def from_string(self, s: str, as_target: Optional[bool] = ...) -> LayerInfo: - r""" - @brief Create a layer info object from a string - @param The string - @return The LayerInfo object - - If 'as_target' is true, relative specifications such as '*+1' for layer or datatype are permitted. - - This method will take strings as produced by \to_s and create a \LayerInfo object from them. The format is either "layer", "layer/datatype", "name" or "name (layer/datatype)". - - This method was added in version 0.23. - The 'as_target' argument has been added in version 0.26.5. - """ def hash(self) -> int: r""" @brief Computes a hash value @@ -10081,6 +12657,12 @@ class LayerInfo: This method has been introduced in version 0.25. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_equivalent(self, b: LayerInfo) -> bool: r""" @brief Equivalence of two layer info objects @@ -10121,19 +12703,36 @@ class LayoutMetaInfo: """ description: str r""" + Getter: @brief Gets the description of the layout meta info object + + Setter: @brief Sets the description of the layout meta info object """ name: str r""" + Getter: @brief Gets the name of the layout meta info object + + Setter: @brief Sets the name of the layout meta info object """ value: str r""" + Getter: @brief Gets the value of the layout meta info object + + Setter: @brief Sets the value of the layout meta info object """ + @classmethod + def new(cls, name: str, value: str, description: Optional[str] = ...) -> LayoutMetaInfo: + r""" + @brief Creates a layout meta info object + @param name The name + @param value The value + @param description An optional description text + """ def __copy__(self) -> LayoutMetaInfo: r""" @brief Creates a copy of self @@ -10186,10 +12785,33 @@ class LayoutMetaInfo: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> LayoutMetaInfo: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class Layout: r""" @@ -10222,33 +12844,80 @@ class Layout: """ dbu: float r""" + Getter: @brief Gets the database unit The database unit is the value of one units distance in micrometers. For numerical reasons and to be compliant with the GDS2 format, the database objects use integer coordinates. The basic unit of these coordinates is the database unit. You can convert coordinates to micrometers by multiplying the integer value with the database unit. Typical values for the database unit are 0.001 micrometer (one nanometer). + + Setter: @brief Sets the database unit See \dbu for a description of the database unit. """ prop_id: int r""" + Getter: @brief Gets the properties ID associated with the layout - This method has been introduced in version 0.24.@brief Sets the properties ID associated with the layout + This method has been introduced in version 0.24. + Setter: + @brief Sets the properties ID associated with the layout This method is provided, if a properties ID has been derived already. Usually it's more convenient to use \delete_property, \set_property or \property. This method has been introduced in version 0.24. """ technology_name: str r""" + Getter: @brief Gets the name of the technology this layout is associated with - This method has been introduced in version 0.27. Before that, the technology has been kept in the 'technology' meta data element.@brief Sets the name of the technology this layout is associated with + This method has been introduced in version 0.27. Before that, the technology has been kept in the 'technology' meta data element. + Setter: + @brief Sets the name of the technology this layout is associated with Changing the technology name will re-assess all library references because libraries can be technology specified. Cell layouts may be substituted during this re-assessment. This method has been introduced in version 0.27. """ + @overload + @classmethod + def new(cls) -> Layout: + r""" + @brief Creates a layout object + + Starting with version 0.25, layouts created with the default constructor are always editable. Before that version, they inherited the editable flag from the application. + """ + @overload + @classmethod + def new(cls, editable: bool) -> Layout: + r""" + @brief Creates a layout object + + This constructor specifies whether the layout is editable. In editable mode, some optimizations are disabled and the layout can be manipulated through a variety of methods. + + This method was introduced in version 0.22. + """ + @overload + @classmethod + def new(cls, manager: Manager) -> Layout: + r""" + @brief Creates a layout object attached to a manager + + This constructor specifies a manager object which is used to store undo information for example. + + Starting with version 0.25, layouts created with the default constructor are always editable. Before that version, they inherited the editable flag from the application. + """ + @overload + @classmethod + def new(cls, editable: bool, manager: Manager) -> Layout: + r""" + @brief Creates a layout object attached to a manager + + This constructor specifies a manager object which is used to store undo information for example. It also allows one to specify whether the layout is editable. In editable mode, some optimizations are disabled and the layout can be manipulated through a variety of methods. + + This method was introduced in version 0.22. + """ def __copy__(self) -> Layout: r""" @brief Creates a copy of self @@ -10324,6 +12993,13 @@ class Layout: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def add_cell(self, name: str) -> int: + r""" + @brief Adds a cell with the given name + @return The index of the newly created cell. + + From version 0.23 on this method is deprecated because another method exists which is more convenient because is returns a \Cell object (\create_cell). + """ def add_lib_cell(self, library: Library, lib_cell_index: int) -> int: r""" @brief Imports a cell from the library @@ -10421,6 +13097,7 @@ class Layout: r""" @brief Assigns another object to self """ + @overload def begin_shapes(self, cell: Cell, layer: int) -> RecursiveShapeIterator: r""" @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer @@ -10436,6 +13113,152 @@ class Layout: This method has been added in version 0.24. """ @overload + def begin_shapes(self, cell_index: int, layer: int) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer + @param cell_index The index of the initial (top) cell + @param layer The layer from which to get the shapes + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + + This method is deprecated. Use \Cell#begin_shapes_rec instead. + + This method has been added in version 0.18. + """ + @overload + def begin_shapes_overlapping(self, cell: Cell, layer: int, region: DBox) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units + @param cell The cell object for the starting cell + @param layer The layer from which to get the shapes + @param region The search region as a \DBox object in micrometer units + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box overlaps the given region. + It is convenience overload which takes a cell object instead of a cell index. + + This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. + + This variant has been added in version 0.25. + """ + @overload + def begin_shapes_overlapping(self, cell_index: int, layer: int, region: Box) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search + @param cell_index The index of the starting cell + @param layer The layer from which to get the shapes + @param region The search region + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box overlaps the given region. + + This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. + + This method has been added in version 0.18. + """ + @overload + def begin_shapes_overlapping(self, cell_index: int, layer: int, region: DBox) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units + @param cell_index The index of the starting cell + @param layer The layer from which to get the shapes + @param region The search region as a \DBox object in micrometer units + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box overlaps the given region. + + This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. + + This variant has been added in version 0.25. + """ + @overload + def begin_shapes_overlapping(self, cell_index: Cell, layer: int, region: Box) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search + @param cell The cell object for the starting cell + @param layer The layer from which to get the shapes + @param region The search region + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box overlaps the given region. + It is convenience overload which takes a cell object instead of a cell index. + + This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. + + This method has been added in version 0.24. + """ + @overload + def begin_shapes_touching(self, cell: Cell, layer: int, region: Box) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search + @param cell The cell object for the starting cell + @param layer The layer from which to get the shapes + @param region The search region + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box touches the given region. + It is convenience overload which takes a cell object instead of a cell index. + + This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. + + This method has been added in version 0.24. + """ + @overload + def begin_shapes_touching(self, cell: Cell, layer: int, region: DBox) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units + @param cell The cell object for the starting cell + @param layer The layer from which to get the shapes + @param region The search region as a \DBox object in micrometer units + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box touches the given region. + It is convenience overload which takes a cell object instead of a cell index. + + This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. + + This variant has been added in version 0.25. + """ + @overload + def begin_shapes_touching(self, cell_index: int, layer: int, region: Box) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search + @param cell_index The index of the starting cell + @param layer The layer from which to get the shapes + @param region The search region + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box touches the given region. + + This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. + + This method has been added in version 0.18. + """ + @overload + def begin_shapes_touching(self, cell_index: int, layer: int, region: DBox) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units + @param cell_index The index of the starting cell + @param layer The layer from which to get the shapes + @param region The search region as a \DBox object in micrometer units + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box touches the given region. + + This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. + + This variant has been added in version 0.25. + """ + @overload def cell(self, i: int) -> Cell: r""" @brief Gets a cell object from the cell index @@ -10456,6 +13279,12 @@ class Layout: If name is not a valid cell name, this method will return "nil". This method has been introduced in version 0.23 and replaces \cell_by_name. """ + def cell_by_name(self, name: str) -> int: + r""" + @brief Gets the cell index for a given name + Returns the cell index for the cell with the given name. If no cell with this name exists, an exception is thrown. + From version 0.23 on, a version of the \cell method is provided which returns a \Cell object for the cell with the given name or "nil" if the name is not valid. This method replaces \cell_by_name and \has_cell? + """ def cell_name(self, index: int) -> str: r""" @brief Gets the name for a cell with the given index @@ -10502,6 +13331,7 @@ class Layout: @param layer_index The index of the layer to delete. """ + @overload def clip(self, cell: int, box: Box) -> int: r""" @brief Clips the given cell by the given rectangle and produce a new cell with the clip @@ -10512,6 +13342,37 @@ class Layout: This method will cut a rectangular region given by the box from the given cell. The clip will be stored in a new cell whose index is returned. The clip will be performed hierarchically. The resulting cell will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. This method has been added in version 0.21. """ + @overload + def clip(self, cell: int, box: DBox) -> int: + r""" + @brief Clips the given cell by the given rectangle and produce a new cell with the clip + @param cell The cell index of the cell to clip + @param box The clip box in micrometer units + @return The index of the new cell + + This variant which takes a micrometer-unit box has been added in version 0.28. + """ + @overload + def clip(self, cell: Cell, box: Box) -> Cell: + r""" + @brief Clips the given cell by the given rectangle and produce a new cell with the clip + @param cell The cell reference of the cell to clip + @param box The clip box in database units + @return The reference to the new cell + + This variant which takes cell references instead of cell indexes has been added in version 0.28. + """ + @overload + def clip(self, cell: Cell, box: DBox) -> Cell: + r""" + @brief Clips the given cell by the given rectangle and produce a new cell with the clip + @param cell The cell reference of the cell to clip + @param box The clip box in micrometer units + @return The reference to the new cell + + This variant which takes a micrometer-unit box and cell references has been added in version 0.28. + """ + @overload def clip_into(self, cell: int, target: Layout, box: Box) -> int: r""" @brief Clips the given cell by the given rectangle and produce a new cell with the clip @@ -10525,6 +13386,39 @@ class Layout: Please note that it is important that the database unit of the target layout is identical to the database unit of the source layout to achieve the desired results.This method also assumes that the target layout holds the same layers than the source layout. It will copy shapes to the same layers than they have been on the original layout. This method has been added in version 0.21. """ + @overload + def clip_into(self, cell: int, target: Layout, box: DBox) -> int: + r""" + @brief Clips the given cell by the given rectangle and produce a new cell with the clip + @param cell The cell index of the cell to clip + @param box The clip box in micrometer units + @param target The target layout + @return The index of the new cell in the target layout + + This variant which takes a micrometer-unit box has been added in version 0.28. + """ + @overload + def clip_into(self, cell: Cell, target: Layout, box: Box) -> Cell: + r""" + @brief Clips the given cell by the given rectangle and produce a new cell with the clip + @param cell The reference to the cell to clip + @param box The clip box in database units + @param target The target layout + @return The reference to the new cell in the target layout + + This variant which takes cell references instead of cell indexes has been added in version 0.28. + """ + @overload + def clip_into(self, cell: Cell, target: Layout, box: DBox) -> Cell: + r""" + @brief Clips the given cell by the given rectangle and produce a new cell with the clip + @param cell The reference to the cell to clip + @param box The clip box in micrometer units + @param target The target layout + @return The reference to the new cell in the target layout + + This variant which takes a micrometer-unit box and cell references has been added in version 0.28. + """ def convert_cell_to_static(self, cell_index: int) -> int: r""" @brief Converts a PCell or library cell to a usual (static) cell @@ -10568,6 +13462,11 @@ class Layout: This method has been added in version 0.26.8. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ @overload def create_cell(self, name: str) -> Cell: r""" @@ -10585,39 +13484,47 @@ class Layout: @brief Creates a cell with the given name @param name The name of the library cell and the name of the cell to create @param lib_name The name of the library where to take the cell from - @return The \Cell object of the newly created cell. + @return The \Cell object of the newly created cell or an existing cell if the library cell has already been used in this layout. + + Library cells are imported by creating a 'library proxy'. This is a cell which represents the library cell in the framework of the current layout. The library proxy is linked to the library and will be updated if the library cell is changed. + + This method will look up the cell by the given name in the specified library and create a new library proxy for this cell. + If the same library cell has already been used, the original library proxy is returned. Hence, strictly speaking this method does not always create a new cell but may return a reference to an existing cell. - This method will look up the cell by the given name in the specified library and create a new library proxy to this cell. If the library name is not valid, nil is returned. This method has been introduce in version 0.24. """ @overload - def create_cell(self, name: str, params: Dict[str, Any]) -> Cell: + def create_cell(self, pcell_name: str, params: Dict[str, Any]) -> Cell: r""" - @brief Creates a cell as a PCell variant with the given name - @param name The name of the PCell and the name of the cell to create + @brief Creates a cell as a PCell variant for the PCell with the given name + @param pcell_name The name of the PCell and also the name of the cell to create @param params The PCell parameters (key/value dictionary) - @return The \Cell object of the newly created cell. + @return The \Cell object of the newly created cell or an existing cell if the PCell has already been used with these parameters. - This method will look up the PCell by the given name and create a new PCell variant with the given parameters. The parameters are specified as a key/value dictionary with the names being the ones from the PCell declaration. + PCells are instantiated by creating a PCell variant. A PCell variant is linked to the PCell and represents this PCell with a particular parameter set. + + This method will look up the PCell by the PCell name and create a new PCell variant for the given parameters. If the PCell has already been instantiated with the same parameters, the original variant will be returned. Hence this method is not strictly creating a cell - only if the required variant has not been created yet. + + The parameters are specified as a key/value dictionary with the names being the ones from the PCell declaration. If no PCell with the given name exists, nil is returned. This method has been introduce in version 0.24. """ @overload - def create_cell(self, name: str, lib_name: str, params: Dict[str, Any]) -> Cell: + def create_cell(self, pcell_name: str, lib_name: str, params: Dict[str, Any]) -> Cell: r""" - @brief Creates a cell with the given name - @param name The name of the PCell and the name of the cell to create + @brief Creates a cell for a PCell with the given PCell name from the given library + @param pcell_name The name of the PCell and also the name of the cell to create @param lib_name The name of the library where to take the PCell from @param params The PCell parameters (key/value dictionary) - @return The \Cell object of the newly created cell. + @return The \Cell object of the newly created cell or an existing cell if this PCell has already been used with the given parameters - This method will look up the PCell by the given name in the specified library and create a new PCell variant with the given parameters. The parameters are specified as a key/value dictionary with the names being the ones from the PCell declaration. + This method will look up the PCell by the PCell name in the specified library and create a new PCell variant for the given parameters plus the library proxy. The parameters must be specified as a key/value dictionary with the names being the ones from the PCell declaration. - If no PCell with the given name exists or the library name is not valid, nil is returned. + If no PCell with the given name exists or the library name is not valid, nil is returned. Note that this function - despite the name - may not always create a new cell, but return an existing cell if the PCell from the library has already been used with the given parameters. This method has been introduce in version 0.24. """ @@ -10677,6 +13584,18 @@ class Layout: This method has been introduced in version 0.24. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dump_mem_statistics(self, detailed: Optional[bool] = ...) -> None: r""" @hide @@ -10872,6 +13791,12 @@ class Layout: See \insert_special_layer for a description of special layers. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_editable(self) -> bool: r""" @brief Returns a value indicating whether the layout is editable. @@ -10960,6 +13885,13 @@ class Layout: @brief Gets a list of valid layer's indices This method returns an array with layer indices representing valid layers. + This method has been introduced in version 0.19. + """ + def layer_indices(self) -> List[int]: + r""" + @brief Gets a list of valid layer's indices + This method returns an array with layer indices representing valid layers. + This method has been introduced in version 0.19. """ def layer_infos(self) -> List[LayerInfo]: @@ -11019,9 +13951,10 @@ class Layout: This method has been added in version 0.26.8. """ + @overload def multi_clip(self, cell: int, boxes: Sequence[Box]) -> List[int]: r""" - @brief Clips the given cell by the given rectangles and produce new cells with the clips, one for each rectangle. + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. @param cell The cell index of the cell to clip @param boxes The clip boxes in database units @return The indexes of the new cells @@ -11030,9 +13963,40 @@ class Layout: This method has been added in version 0.21. """ + @overload + def multi_clip(self, cell: int, boxes: Sequence[DBox]) -> List[int]: + r""" + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. + @param cell The cell index of the cell to clip + @param boxes The clip boxes in micrometer units + @return The indexes of the new cells + + This variant which takes micrometer-unit boxes has been added in version 0.28. + """ + @overload + def multi_clip(self, cell: Cell, boxes: Sequence[Box]) -> List[Cell]: + r""" + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. + @param cell The reference to the cell to clip + @param boxes The clip boxes in database units + @return The references to the new cells + + This variant which takes cell references has been added in version 0.28. + """ + @overload + def multi_clip(self, cell: Cell, boxes: Sequence[DBox]) -> List[Cell]: + r""" + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. + @param cell The reference to the cell to clip + @param boxes The clip boxes in micrometer units + @return The references to the new cells + + This variant which takes cell references and micrometer-unit boxes has been added in version 0.28. + """ + @overload def multi_clip_into(self, cell: int, target: Layout, boxes: Sequence[Box]) -> List[int]: r""" - @brief Clips the given cell by the given rectangles and produce new cells with the clips, one for each rectangle. + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. @param cell The cell index of the cell to clip @param boxes The clip boxes in database units @param target The target layout @@ -11045,6 +14009,39 @@ class Layout: This method has been added in version 0.21. """ @overload + def multi_clip_into(self, cell: int, target: Layout, boxes: Sequence[DBox]) -> List[int]: + r""" + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. + @param cell The cell index of the cell to clip + @param boxes The clip boxes in database units + @param target The target layout + @return The indexes of the new cells + + This variant which takes micrometer-unit boxes has been added in version 0.28. + """ + @overload + def multi_clip_into(self, cell: Cell, target: Layout, boxes: Sequence[Box]) -> List[Cell]: + r""" + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. + @param cell The reference the cell to clip + @param boxes The clip boxes in database units + @param target The target layout + @return The references to the new cells + + This variant which takes cell references boxes has been added in version 0.28. + """ + @overload + def multi_clip_into(self, cell: Cell, target: Layout, boxes: Sequence[DBox]) -> List[Cell]: + r""" + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. + @param cell The reference the cell to clip + @param boxes The clip boxes in micrometer units + @param target The target layout + @return The references to the new cells + + This variant which takes cell references and micrometer-unit boxes has been added in version 0.28. + """ + @overload def pcell_declaration(self, name: str) -> PCellDeclaration_Native: r""" @brief Gets a reference to the PCell declaration for the PCell with the given name @@ -11185,7 +14182,9 @@ class Layout: """ def rename_cell(self, index: int, name: str) -> None: r""" - @brief name + @brief Renames the cell with given index + The cell with the given index is renamed to the given name. NOTE: it is not ensured that the name is unique. This method allows assigning identical names to different cells which usually breaks things. + Consider using \unique_cell_name to generate truely unique names. """ @overload def scale_and_snap(self, cell: Cell, grid: int, mult: int, div: int) -> None: @@ -11313,6 +14312,17 @@ class Layout: is ongoing or the layout is brought into invalid state by "start_changes". """ + def unique_cell_name(self, name: str) -> str: + r""" + @brief Creates a new unique cell name from the given name + @return A unique name derived from the argument + + If a cell with the given name exists, a suffix will be added to make the name unique. Otherwise, the argument will be returned unchanged. + + The returned name can be used to rename cells without risk of creating name clashes. + + This method has been introduced in version 0.28. + """ def update(self) -> None: r""" @brief Updates the internals of the layout @@ -11336,6 +14346,16 @@ class Layout: This variant has been introduced in version 0.23. """ + @overload + def write(self, filename: str, gzip: bool, options: SaveLayoutOptions) -> None: + r""" + @brief Writes the layout to a stream file + @param filename The file to which to write the layout + @param gzip Ignored + @param options The option set to use for writing. See \SaveLayoutOptions for details + + Starting with version 0.23, this variant is deprecated since the more convenient variant with two parameters automatically determines the compression mode from the file name. The gzip parameter is ignored staring with version 0.23. + """ class SaveLayoutOptions: r""" @@ -11356,22 +14376,28 @@ class SaveLayoutOptions: """ cif_blank_separator: bool r""" + Getter: @brief Gets a flag indicating whether blanks shall be used as x/y separator characters See \cif_blank_separator= method for a description of that property. This property has been added in version 0.23.10. The predicate version (cif_blank_separator?) has been added in version 0.25.1. + + Setter: @brief Sets a flag indicating whether blanks shall be used as x/y separator characters If this property is set to true, the x and y coordinates are separated with blank characters rather than comma characters. This property has been added in version 0.23.10. """ cif_dummy_calls: bool r""" + Getter: @brief Gets a flag indicating whether dummy calls shall be written See \cif_dummy_calls= method for a description of that property. This property has been added in version 0.23.10. The predicate version (cif_blank_separator?) has been added in version 0.25.1. + + Setter: @brief Sets a flag indicating whether dummy calls shall be written If this property is set to true, dummy calls will be written in the top level entity of the CIF file calling every top cell. This option is useful for enhanced compatibility with other tools. @@ -11380,9 +14406,12 @@ class SaveLayoutOptions: """ dbu: float r""" + Getter: @brief Get the explicit database unit if one is set See \dbu= for a description of that attribute. + + Setter: @brief Set the database unit to be used in the stream file By default, the database unit of the layout is used. This method allows one to explicitly use a different @@ -11390,10 +14419,13 @@ class SaveLayoutOptions: """ dxf_polygon_mode: int r""" + Getter: @brief Specifies how to write polygons. See \dxf_polygon_mode= for a description of this property. This property has been added in version 0.21.3. + + Setter: @brief Specifies how to write polygons. The mode is 0 (write POLYLINE entities), 1 (write LWPOLYLINE entities), 2 (decompose into SOLID entities), 3 (write HATCH entities), or 4 (write LINE entities). @@ -11401,18 +14433,24 @@ class SaveLayoutOptions: """ format: str r""" + Getter: @brief Gets the format name See \format= for a description of that method. + + Setter: @brief Select a format The format string can be either "GDS2", "OASIS", "CIF" or "DXF". Other formats may be available if a suitable plugin is installed. """ gds2_libname: str r""" + Getter: @brief Get the library name See \gds2_libname= method for a description of the library name. This property has been added in version 0.18. + + Setter: @brief Set the library name The library name is the string written into the LIBNAME records of the GDS file. @@ -11422,9 +14460,12 @@ class SaveLayoutOptions: """ gds2_max_cellname_length: int r""" + Getter: @brief Get the maximum length of cell names See \gds2_max_cellname_length= method for a description of the maximum cell name length. This property has been added in version 0.18. + + Setter: @brief Maximum length of cell names This property describes the maximum number of characters for cell names. @@ -11434,9 +14475,12 @@ class SaveLayoutOptions: """ gds2_max_vertex_count: int r""" + Getter: @brief Gets the maximum number of vertices for polygons to write See \gds2_max_vertex_count= method for a description of the maximum vertex count. This property has been added in version 0.18. + + Setter: @brief Sets the maximum number of vertices for polygons to write This property describes the maximum number of point for polygons in GDS2 files. Polygons with more points will be split. @@ -11448,9 +14492,12 @@ class SaveLayoutOptions: """ gds2_multi_xy_records: bool r""" + Getter: @brief Gets the property enabling multiple XY records for BOUNDARY elements See \gds2_multi_xy_records= method for a description of this property. This property has been added in version 0.18. + + Setter: @brief Uses multiple XY records in BOUNDARY elements for unlimited large polygons Setting this property to true allows producing polygons with an unlimited number of points @@ -11460,9 +14507,12 @@ class SaveLayoutOptions: """ gds2_no_zero_length_paths: bool r""" + Getter: @brief Gets a value indicating whether zero-length paths are eliminated This property has been added in version 0.23. + + Setter: @brief Eliminates zero-length paths if true If this property is set to true, paths with zero length will be converted to BOUNDARY objects. @@ -11472,9 +14522,12 @@ class SaveLayoutOptions: """ gds2_resolve_skew_arrays: bool r""" + Getter: @brief Gets a value indicating whether to resolve skew arrays into single instances See \gds2_resolve_skew_arrays= method for a description of this property. This property has been added in version 0.27.1. + + Setter: @brief Resolves skew arrays into single instances Setting this property to true will make skew (non-orthogonal) arrays being resolved into single instances. @@ -11484,9 +14537,12 @@ class SaveLayoutOptions: """ gds2_user_units: float r""" + Getter: @brief Get the user units See \gds2_user_units= method for a description of the user units. This property has been added in version 0.18. + + Setter: @brief Set the users units to write into the GDS file The user units of a GDS file are rarely used and usually are set to 1 (micron). @@ -11497,9 +14553,12 @@ class SaveLayoutOptions: """ gds2_write_cell_properties: bool r""" + Getter: @brief Gets a value indicating whether cell properties are written This property has been added in version 0.23. + + Setter: @brief Enables writing of cell properties if set to true If this property is set to true, cell properties will be written as PROPATTR/PROPVALUE records immediately following the BGNSTR records. This is a non-standard extension and is therefore disabled by default. @@ -11509,9 +14568,12 @@ class SaveLayoutOptions: """ gds2_write_file_properties: bool r""" + Getter: @brief Gets a value indicating whether layout properties are written This property has been added in version 0.24. + + Setter: @brief Enables writing of file properties if set to true If this property is set to true, layout properties will be written as PROPATTR/PROPVALUE records immediately following the BGNLIB records. This is a non-standard extension and is therefore disabled by default. @@ -11521,9 +14583,12 @@ class SaveLayoutOptions: """ gds2_write_timestamps: bool r""" + Getter: @brief Gets a value indicating whether the current time is written into the GDS2 timestamp fields This property has been added in version 0.21.16. + + Setter: @brief Writes the current time into the GDS2 timestamps if set to true If this property is set to false, the time fields will all be zero. This somewhat simplifies compare and diff applications. @@ -11533,11 +14598,14 @@ class SaveLayoutOptions: """ keep_instances: bool r""" + Getter: @brief Gets a flag indicating whether instances will be kept even if the target cell is dropped See \keep_instances= for details about this flag. This method was introduced in version 0.23. + + Setter: @brief Enables or disables instances for dropped cells If this flag is set to true, instances for cells will be written, even if the cell is dropped. That may happen, if cells are selected with \select_this_cell or \add_this_cell or \no_empty_cells is used. Even if cells called by such cells are not selected, instances will be written for that cell if "keep_instances" is true. That feature is supported by the GDS format currently and results in "ghost cells" which have instances but no cell definition. @@ -11548,9 +14616,12 @@ class SaveLayoutOptions: """ mag_lambda: float r""" + Getter: @brief Gets the lambda value See \mag_lambda= method for a description of this attribute. This property has been added in version 0.26.2. + + Setter: @brief Specifies the lambda value to used for writing The lambda value is the basic unit of the layout. @@ -11560,9 +14631,12 @@ class SaveLayoutOptions: """ mag_tech: str r""" + Getter: @brief Gets the technology string used for writing See \mag_tech= method for a description of this attribute. This property has been added in version 0.26.2. + + Setter: @brief Specifies the technology string used for writing If this string is empty, the writer will try to obtain the technology from the "technology" metadata attribute of the layout. @@ -11571,10 +14645,13 @@ class SaveLayoutOptions: """ mag_write_timestamp: bool r""" + Getter: @brief Gets a value indicating whether to write a timestamp See \write_timestamp= method for a description of this attribute. This property has been added in version 0.26.2. + + Setter: @brief Specifies whether to write a timestamp If this attribute is set to false, the timestamp written is 0. This is not permitted in the strict sense, but simplifies comparison of Magic files. @@ -11583,7 +14660,10 @@ class SaveLayoutOptions: """ no_empty_cells: bool r""" + Getter: @brief Returns a flag indicating whether empty cells are not written. + + Setter: @brief Don't write empty cells if this flag is set By default, all cells are written (no_empty_cells is false). @@ -11591,39 +14671,54 @@ class SaveLayoutOptions: """ oasis_compression_level: int r""" + Getter: @brief Get the OASIS compression level - See \oasis_compression_level= method for a description of the OASIS compression level.@brief Set the OASIS compression level + See \oasis_compression_level= method for a description of the OASIS compression level. + Setter: + @brief Set the OASIS compression level The OASIS compression level is an integer number between 0 and 10. 0 basically is no compression, 1 produces shape arrays in a simple fashion. 2 and higher compression levels will use a more elaborate algorithm to find shape arrays which uses 2nd and further neighbor distances. The higher the level, the higher the memory requirements and run times. """ oasis_permissive: bool r""" + Getter: @brief Gets the OASIS permissive mode See \oasis_permissive= method for a description of this predicate. - This method has been introduced in version 0.25.1.@brief Sets OASIS permissive mode + This method has been introduced in version 0.25.1. + Setter: + @brief Sets OASIS permissive mode If this flag is true, certain shapes which cannot be written to OASIS are reported as warnings, not as errors. For example, paths with odd width (are rounded) or polygons with less than three points (are skipped). This method has been introduced in version 0.25.1. """ oasis_recompress: bool r""" + Getter: @brief Gets the OASIS recompression mode See \oasis_recompress= method for a description of this predicate. - This method has been introduced in version 0.23.@brief Sets OASIS recompression mode + This method has been introduced in version 0.23. + Setter: + @brief Sets OASIS recompression mode If this flag is true, shape arrays already existing will be resolved and compression is applied to the individual shapes again. If this flag is false (the default), shape arrays already existing will be written as such. This method has been introduced in version 0.23. """ oasis_strict_mode: bool r""" + Getter: @brief Gets a value indicating whether to write strict-mode OASIS files + + Setter: @brief Sets a value indicating whether to write strict-mode OASIS files Setting this property clears all format specific options for other formats such as GDS. """ oasis_substitution_char: str r""" + Getter: @brief Gets the substitution character See \oasis_substitution_char for details. This attribute has been introduced in version 0.23. + + Setter: @brief Sets the substitution character for a-strings and n-strings The substitution character is used in place of invalid characters. The value of this attribute is a string which is either empty or a single character. If the string is empty, no substitution is made at the risk of producing invalid OASIS files. @@ -11631,15 +14726,21 @@ class SaveLayoutOptions: """ oasis_write_cblocks: bool r""" + Getter: @brief Gets a value indicating whether to write compressed CBLOCKS per cell + + Setter: @brief Sets a value indicating whether to write compressed CBLOCKS per cell Setting this property clears all format specific options for other formats such as GDS. """ oasis_write_cell_bounding_boxes: bool r""" + Getter: @brief Gets a value indicating whether cell bounding boxes are written See \oasis_write_cell_bounding_boxes= method for a description of this flag. - This method has been introduced in version 0.24.3.@brief Sets a value indicating whether cell bounding boxes are written + This method has been introduced in version 0.24.3. + Setter: + @brief Sets a value indicating whether cell bounding boxes are written If this value is set to true, cell bounding boxes are written (S_BOUNDING_BOX). The S_BOUNDING_BOX properties will be attached to the CELLNAME records. Setting this value to true will also enable writing of other standard properties like S_TOP_CELL (see \oasis_write_std_properties=). @@ -11649,9 +14750,12 @@ class SaveLayoutOptions: """ oasis_write_std_properties: bool r""" + Getter: @brief Gets a value indicating whether standard properties will be written See \oasis_write_std_properties= method for a description of this flag. - This method has been introduced in version 0.24.@brief Sets a value indicating whether standard properties will be written + This method has been introduced in version 0.24. + Setter: + @brief Sets a value indicating whether standard properties will be written If this value is false, no standard properties are written. If true, S_TOP_CELL and some other global standard properties are written. In addition, \oasis_write_cell_bounding_boxes= can be used to write cell bounding boxes using S_BOUNDING_BOX. By default, this flag is true and standard properties are written. @@ -11662,11 +14766,17 @@ class SaveLayoutOptions: """ oasis_write_std_properties_ext: int r""" - @hide@hide + Getter: + @hide + Setter: + @hide """ scale_factor: float r""" + Getter: @brief Gets the scaling factor currently set + + Setter: @brief Set the scaling factor for the saving Using a scaling factor will scale all objects accordingly. This scale factor adds to a potential scaling implied by using an explicit database unit. @@ -11677,11 +14787,14 @@ class SaveLayoutOptions: """ write_context_info: bool r""" + Getter: @brief Gets a flag indicating whether context information will be stored See \write_context_info= for details about this flag. This method was introduced in version 0.23. + + Setter: @brief Enables or disables context information If this flag is set to false, no context information for PCell or library cell instances is written. Those cells will be converted to plain cells and KLayout will not be able to restore the identity of those cells. Use this option to enforce compatibility with other tools that don't understand the context information of KLayout. @@ -11690,6 +14803,15 @@ class SaveLayoutOptions: This method was introduced in version 0.23. """ + @classmethod + def new(cls) -> SaveLayoutOptions: + r""" + @brief Default constructor + + This will initialize the scale factor to 1.0, the database unit is set to + "same as original" and all layers are selected as well as all cells. + The default format is GDS2. + """ def __copy__(self) -> SaveLayoutOptions: r""" @brief Creates a copy of self @@ -11778,6 +14900,22 @@ class SaveLayoutOptions: r""" @brief Assigns another object to self """ + def cif_blank_separator(self) -> bool: + r""" + @brief Gets a flag indicating whether blanks shall be used as x/y separator characters + See \cif_blank_separator= method for a description of that property. + This property has been added in version 0.23.10. + + The predicate version (cif_blank_separator?) has been added in version 0.25.1. + """ + def cif_dummy_calls(self) -> bool: + r""" + @brief Gets a flag indicating whether dummy calls shall be written + See \cif_dummy_calls= method for a description of that property. + This property has been added in version 0.23.10. + + The predicate version (cif_blank_separator?) has been added in version 0.25.1. + """ def clear_cells(self) -> None: r""" @brief Clears all cells to be saved @@ -11787,6 +14925,11 @@ class SaveLayoutOptions: This method has been added in version 0.22. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def deselect_all_layers(self) -> None: r""" @brief Unselect all layers: no layer will be saved @@ -11794,10 +14937,46 @@ class SaveLayoutOptions: This method will clear all layers selected with \add_layer so far and clear the 'select all layers' flag. Using this method is the only way to save a layout without any layers. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> SaveLayoutOptions: r""" @brief Creates a copy of self """ + def gds2_no_zero_length_paths(self) -> bool: + r""" + @brief Gets a value indicating whether zero-length paths are eliminated + + This property has been added in version 0.23. + """ + def gds2_write_cell_properties(self) -> bool: + r""" + @brief Gets a value indicating whether cell properties are written + + This property has been added in version 0.23. + """ + def gds2_write_file_properties(self) -> bool: + r""" + @brief Gets a value indicating whether layout properties are written + + This property has been added in version 0.24. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def select_all_cells(self) -> None: r""" @brief Select all cells to save @@ -11841,381 +15020,6 @@ class SaveLayoutOptions: This method has been introduced in version 0.22. Beginning with version 0.23, this method always returns true, since the only consumer for the return value, Layout#write, now ignores that parameter and automatically determines the compression mode from the file name. """ -class LayoutDiff: - r""" - @brief The layout compare tool - - The layout compare tool is a facility to quickly compare layouts and derive events that give details about the differences. The events are basically emitted following a certain order: - - @ul - @li General configuration events (database units, layers ...) @/li - @li \on_begin_cell @/li - @li \on_begin_inst_differences (if the instances differ) @/li - @li details about instance differences (if \Verbose flag is given) @/li - @li \on_end_inst_differences (if the instances differ) @/li - @li \on_begin_layer @/li - @li \on_begin_polygon_differences (if the polygons differ) @/li - @li details about polygon differences (if \Verbose flag is given) @/li - @li \on_end_polygon_differences (if the polygons differ) @/li - @li other shape difference events (paths, boxes, ...) @/li - @li \on_end_layer @/li - @li repeated layer event groups @/li - @li \on_end_cell @/li - @li repeated cell event groups @/li - @/ul - - To use the diff facility, create a \LayoutDiff object and call the \compare_layout or \compare_cell method: - - @code - lya = ... # layout A - lyb = ... # layout B - - diff = RBA::LayoutDiff::new - diff.on_polygon_in_a_only do |poly| - puts "Polygon in A: #{diff.cell_a.name}@#{diff.layer_info_a.to_s}: #{poly.to_s}" - end - diff.on_polygon_in_b_only do |poly| - puts "Polygon in A: #{diff.cell_b.name}@#{diff.layer_info_b.to_s}: #{poly.to_s}" - end - diff.compare(lya, lyb, RBA::LayoutDiff::Verbose + RBA::LayoutDiff::NoLayerNames) - @/code - """ - BoxesAsPolygons: ClassVar[int] - r""" - @brief Compare boxes to polygons - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - DontSummarizeMissingLayers: ClassVar[int] - r""" - @brief Don't summarize missing layers - If this mode is present, missing layers are treated as empty ones and every shape on the other layer will be reported as difference. - - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - FlattenArrayInsts: ClassVar[int] - r""" - @brief Compare array instances instance by instance - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - NoLayerNames: ClassVar[int] - r""" - @brief Do not compare layer names - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - NoProperties: ClassVar[int] - r""" - @brief Ignore properties - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - NoTextDetails: ClassVar[int] - r""" - @brief Ignore text details (font, size, presentation) - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - NoTextOrientation: ClassVar[int] - r""" - @brief Ignore text orientation - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - PathsAsPolygons: ClassVar[int] - r""" - @brief Compare paths to polygons - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - Silent: ClassVar[int] - r""" - @brief Silent compare - just report whether the layouts are identical - Silent mode will not issue any signals, but instead the return value of the \LayoutDiff#compare method will indicate whether the layouts are identical. In silent mode, the compare method will return immediately once a difference has been encountered so that mode may be much faster than the full compare. - - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - SmartCellMapping: ClassVar[int] - r""" - @brief Derive smart cell mapping instead of name mapping (available only if top cells are specified) - Smart cell mapping is only effective currently when cells are compared (with \LayoutDiff#compare with cells instead of layout objects). - - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - Verbose: ClassVar[int] - r""" - @brief Enables verbose mode (gives details about the differences) - - See the event descriptions for details about the differences in verbose and non-verbose mode. - - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def cell_a(self) -> Cell: - r""" - @brief Gets the current cell for the first layout - This attribute is the current cell and is set after \on_begin_cell and reset after \on_end_cell. - """ - def cell_b(self) -> Cell: - r""" - @brief Gets the current cell for the second layout - This attribute is the current cell and is set after \on_begin_cell and reset after \on_end_cell. - """ - @overload - def compare(self, a: Cell, b: Cell, flags: Optional[int] = ..., tolerance: Optional[int] = ...) -> bool: - r""" - @brief Compares two cells - - Compares layer definitions, cells, instances and shapes and properties of two layout hierarchies starting from the given cells. - Cells are identified by name. Only layers with valid layer and datatype are compared. - Several flags can be specified as a bitwise or combination of the constants. - - @param a The first top cell - @param b The second top cell - @param flags Flags to use for the comparison - @param tolerance A coordinate tolerance to apply (0: exact match, 1: one DBU tolerance is allowed ...) - - @return True, if the cells are identical - """ - @overload - def compare(self, a: Layout, b: Layout, flags: Optional[int] = ..., tolerance: Optional[int] = ...) -> bool: - r""" - @brief Compares two layouts - - Compares layer definitions, cells, instances and shapes and properties. - Cells are identified by name. Only layers with valid layer and datatype are compared. - Several flags can be specified as a bitwise or combination of the constants. - - @param a The first input layout - @param b The second input layout - @param flags Flags to use for the comparison - @param tolerance A coordinate tolerance to apply (0: exact match, 1: one DBU tolerance is allowed ...) - - @return True, if the layouts are identical - """ - def layer_index_a(self) -> int: - r""" - @brief Gets the current layer for the first layout - This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. - """ - def layer_index_b(self) -> int: - r""" - @brief Gets the current layer for the second layout - This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. - """ - def layer_info_a(self) -> LayerInfo: - r""" - @brief Gets the current layer properties for the first layout - This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. - """ - def layer_info_b(self) -> LayerInfo: - r""" - @brief Gets the current layer properties for the second layout - This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. - """ - def layout_a(self) -> Layout: - r""" - @brief Gets the first layout the difference detector runs on - """ - def layout_b(self) -> Layout: - r""" - @brief Gets the second layout the difference detector runs on - """ - def on_bbox_differs(self, ba: Box, bb: Box) -> None: - r""" - @brief This signal indicates a difference in the bounding boxes of two cells - This signal is only emitted in non-verbose mode (without \Verbose flag) as a summarizing cell property. In verbose mode detailed events will be issued indicating the differences. - """ - def on_begin_box_differences(self) -> None: - r""" - @brief This signal indicates differences in the boxes on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for boxes that are different between the two layouts. - """ - def on_begin_cell(self, ca: Cell, cb: Cell) -> None: - r""" - @brief This signal initiates the sequence of events for a cell pair - All cell specific events happen between \begin_cell_event and \end_cell_event signals. - """ - def on_begin_edge_differences(self) -> None: - r""" - @brief This signal indicates differences in the edges on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edges that are different between the two layouts. - """ - def on_begin_inst_differences(self) -> None: - r""" - @brief This signal indicates differences in the cell instances - In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\instance_in_a_only_event and \instance_in_b_only_event). - """ - def on_begin_layer(self, layer: LayerInfo, layer_index_a: int, layer_index_b: int) -> None: - r""" - @brief This signal indicates differences on the given layer - In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\polygon_in_a_only_event, \polygon_in_b_only_event and similar). - """ - def on_begin_path_differences(self) -> None: - r""" - @brief This signal indicates differences in the paths on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for paths that are different between the two layouts. - """ - def on_begin_polygon_differences(self) -> None: - r""" - @brief This signal indicates differences in the polygons on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for polygons that are different between the two layouts. - """ - def on_begin_text_differences(self) -> None: - r""" - @brief This signal indicates differences in the texts on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for texts that are different between the two layouts. - """ - def on_box_in_a_only(self, anotb: Box, prop_id: int) -> None: - r""" - @brief This signal indicates a box that is present in the first layout only - """ - def on_box_in_b_only(self, bnota: Box, prop_id: int) -> None: - r""" - @brief This signal indicates a box that is present in the second layout only - """ - def on_cell_in_a_only(self, c: Cell) -> None: - r""" - @brief This signal indicates that the given cell is only present in the first layout - """ - def on_cell_in_b_only(self, c: Cell) -> None: - r""" - @brief This signal indicates that the given cell is only present in the second layout - """ - def on_cell_name_differs(self, ca: Cell, cb: Cell) -> None: - r""" - @brief This signal indicates a difference in the cell names - This signal is emitted in 'smart cell mapping' mode (see \SmartCellMapping) if two cells are considered identical, but have different names. - """ - def on_dbu_differs(self, dbu_a: float, dbu_b: float) -> None: - r""" - @brief This signal indicates a difference in the database units of the layouts - """ - def on_edge_in_a_only(self, anotb: Edge, prop_id: int) -> None: - r""" - @brief This signal indicates an edge that is present in the first layout only - """ - def on_edge_in_b_only(self, bnota: Edge, prop_id: int) -> None: - r""" - @brief This signal indicates an edge that is present in the second layout only - """ - def on_end_box_differences(self) -> None: - r""" - @brief This signal indicates the end of sequence of box differences - """ - def on_end_cell(self) -> None: - r""" - @brief This signal indicates the end of a sequence of signals for a specific cell - """ - def on_end_edge_differences(self) -> None: - r""" - @brief This signal indicates the end of sequence of edge differences - """ - def on_end_inst_differences(self) -> None: - r""" - @brief This signal finishes a sequence of detailed instance difference events - """ - def on_end_layer(self) -> None: - r""" - @brief This signal indicates the end of a sequence of signals for a specific layer - """ - def on_end_path_differences(self) -> None: - r""" - @brief This signal indicates the end of sequence of path differences - """ - def on_end_polygon_differences(self) -> None: - r""" - @brief This signal indicates the end of sequence of polygon differences - """ - def on_end_text_differences(self) -> None: - r""" - @brief This signal indicates the end of sequence of text differences - """ - def on_instance_in_a_only(self, anotb: CellInstArray, prop_id: int) -> None: - r""" - @brief This signal indicates an instance that is present only in the first layout - This event is only emitted in verbose mode (\Verbose flag). - """ - def on_instance_in_b_only(self, bnota: CellInstArray, prop_id: int) -> None: - r""" - @brief This signal indicates an instance that is present only in the second layout - This event is only emitted in verbose mode (\Verbose flag). - """ - def on_layer_in_a_only(self, a: LayerInfo) -> None: - r""" - @brief This signal indicates a layer that is present only in the first layout - """ - def on_layer_in_b_only(self, b: LayerInfo) -> None: - r""" - @brief This signal indicates a layer that is present only in the second layout - """ - def on_layer_name_differs(self, a: LayerInfo, b: LayerInfo) -> None: - r""" - @brief This signal indicates a difference in the layer names - """ - def on_path_in_a_only(self, anotb: Path, prop_id: int) -> None: - r""" - @brief This signal indicates a path that is present in the first layout only - """ - def on_path_in_b_only(self, bnota: Path, prop_id: int) -> None: - r""" - @brief This signal indicates a path that is present in the second layout only - """ - def on_per_layer_bbox_differs(self, ba: Box, bb: Box) -> None: - r""" - @brief This signal indicates differences in the per-layer bounding boxes of the current cell - """ - def on_polygon_in_a_only(self, anotb: Polygon, prop_id: int) -> None: - r""" - @brief This signal indicates a polygon that is present in the first layout only - """ - def on_polygon_in_b_only(self, bnota: Polygon, prop_id: int) -> None: - r""" - @brief This signal indicates a polygon that is present in the second layout only - """ - def on_text_in_a_only(self, anotb: Text, prop_id: int) -> None: - r""" - @brief This signal indicates a text that is present in the first layout only - """ - def on_text_in_b_only(self, bnota: Text, prop_id: int) -> None: - r""" - @brief This signal indicates a text that is present in the second layout only - """ - class LayoutQueryIterator: r""" @brief Provides the results of the query @@ -12224,6 +15028,11 @@ class LayoutQueryIterator: The LayoutQueryIterator class has been introduced in version 0.25. """ + @classmethod + def new(cls) -> LayoutQueryIterator: + r""" + @brief Creates a new object of this class + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -12273,10 +15082,31 @@ class LayoutQueryIterator: r""" @brief A shortcut for 'get("cell_index")' """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def data(self) -> Any: r""" @brief A shortcut for 'get("data")' """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dtrans(self) -> Any: + r""" + @brief A shortcut for 'get("dtrans")' + """ def get(self, name: str) -> Any: r""" @brief Gets the query property with the given name @@ -12297,6 +15127,12 @@ class LayoutQueryIterator: r""" @brief A shortcut for 'get("inst")' """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def layer_index(self) -> Any: r""" @brief A shortcut for 'get("layer_index")' @@ -12313,6 +15149,10 @@ class LayoutQueryIterator: r""" @brief A shortcut for 'get("parent_cell_index")' """ + def path_dtrans(self) -> Any: + r""" + @brief A shortcut for 'get("path_dtrans")' + """ def path_trans(self) -> Any: r""" @brief A shortcut for 'get("path_trans")' @@ -12350,6 +15190,11 @@ class LayoutQuery: The LayoutQuery class has been introduced in version 0.25. """ + @classmethod + def new(cls, query: str) -> LayoutQuery: + r""" + @brief Creates a new query object from the given query string + """ def __init__(self, query: str) -> None: r""" @brief Creates a new query object from the given query string @@ -12391,6 +15236,23 @@ class LayoutQuery: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def each(self, layout: Layout, context: Optional[tl.ExpressionContext] = ...) -> Iterator[LayoutQueryIterator]: r""" @brief Executes the query and delivered the results iteratively. @@ -12409,932 +15271,18 @@ class LayoutQuery: The context argument allows supplying an expression execution context. This context can be used for example to supply variables for the execution. It has been added in version 0.26. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def property_names(self) -> List[str]: r""" @brief Gets a list of property names available. The list of properties available from the query depends on the nature of the query. This method allows detection of the properties available. Within the query, all of these properties can be obtained from the query iterator using \LayoutQueryIterator#get. """ -class LayoutToNetlist: - r""" - @brief A generic framework for extracting netlists from layouts - - This class wraps various concepts from db::NetlistExtractor and db::NetlistDeviceExtractor - and more. It is supposed to provide a framework for extracting a netlist from a layout. - - The use model of this class consists of five steps which need to be executed in this order. - - @ul - @li Configuration: in this step, the LayoutToNetlist object is created and - if required, configured. Methods to be used in this step are \threads=, - \area_ratio= or \max_vertex_count=. The constructor for the LayoutToNetlist - object receives a \RecursiveShapeIterator object which basically supplies the - hierarchy and the layout taken as input. - @/li - @li Preparation - In this step, the device recognition and extraction layers are drawn from - the framework. Derived can now be computed using boolean operations. - Methods to use in this step are \make_layer and it's variants. - Layer preparation is not necessarily required to happen before all - other steps. Layers can be computed shortly before they are required. - @/li - @li Following the preparation, the devices can be extracted using \extract_devices. - This method needs to be called for each device extractor required. Each time, - a device extractor needs to be given plus a map of device layers. The device - layers are device extractor specific. Either original or derived layers - may be specified here. Layer preparation may happen between calls to \extract_devices. - @/li - @li Once the devices are derived, the netlist connectivity can be defined and the - netlist extracted. The connectivity is defined with \connect and it's - flavours. The actual netlist extraction happens with \extract_netlist. - @/li - @li After netlist extraction, the information is ready to be retrieved. - The produced netlist is available with \netlist. The Shapes of a - specific net are available with \shapes_of_net. \probe_net allows - finding a net by probing a specific location. - @/li - @/ul - - You can also use the extractor with an existing \DeepShapeStore object or even flat data. In this case, preparation means importing existing regions with the \register method. - If you want to use the \LayoutToNetlist object with flat data, use the 'LayoutToNetlist(topcell, dbu)' constructor. If you want to use it with hierarchical data and an existing DeepShapeStore object, use the 'LayoutToNetlist(dss)' constructor. - - This class has been introduced in version 0.26. - """ - class BuildNetHierarchyMode: - r""" - @brief This class represents the LayoutToNetlist::BuildNetHierarchyMode enum - This enum is used for \LayoutToNetlist#build_all_nets and \LayoutToNetlist#build_net. - """ - BNH_Disconnected: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] - r""" - @brief This constant tells \build_net and \build_all_nets to produce local nets without connections to subcircuits (used for the "hier_mode" parameter). - """ - BNH_Flatten: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] - r""" - @brief This constant tells \build_net and \build_all_nets to flatten the nets (used for the "hier_mode" parameter). - """ - BNH_SubcircuitCells: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] - r""" - @brief This constant tells \build_net and \build_all_nets to produce a hierarchy of subcircuit cells per net (used for the "hier_mode" parameter). - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - def __lt__(self, other: LayoutToNetlist.BuildNetHierarchyMode) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - BNH_Disconnected: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] - r""" - @brief This constant tells \build_net and \build_all_nets to produce local nets without connections to subcircuits (used for the "hier_mode" parameter). - """ - BNH_Flatten: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] - r""" - @brief This constant tells \build_net and \build_all_nets to flatten the nets (used for the "hier_mode" parameter). - """ - BNH_SubcircuitCells: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] - r""" - @brief This constant tells \build_net and \build_all_nets to produce a hierarchy of subcircuit cells per net (used for the "hier_mode" parameter). - """ - area_ratio: float - r""" - @brief Gets the area_ratio parameter for the hierarchical network processor - See \area_ratio= for details about this attribute.@brief Sets the area_ratio parameter for the hierarchical network processor - This parameter controls splitting of large polygons in order to reduce the - error made by the bounding box approximation. - """ - description: str - r""" - @brief Gets the description of the database - @brief Sets the description of the database - """ - device_scaling: float - r""" - @brief Gets the device scaling factor - See \device_scaling= for details about this attribute.@brief Sets the device scaling factor - This factor will scale the physical properties of the extracted devices - accordingly. The scale factor applies an isotropic shrink (<1) or expansion (>1). - """ - generator: str - r""" - @brief Gets the generator string. - The generator is the script that created this database. - @brief Sets the generator string. - """ - include_floating_subcircuits: bool - r""" - @brief Gets a flag indicating whether to include floating subcircuits in the netlist. - See \include_floating_subcircuits= for details. - - This attribute has been introduced in version 0.27. - @brief Sets a flag indicating whether to include floating subcircuits in the netlist. - - With 'include_floating_subcircuits' set to true, subcircuits with no connection to their parent circuit are still included in the circuit as floating subcircuits. Specifically on flattening this means that these subcircuits are properly propagated to their parent instead of appearing as additional top circuits. - - This attribute has been introduced in version 0.27 and replaces the arguments of \extract_netlist. - """ - max_vertex_count: int - r""" - See \max_vertex_count= for details about this attribute.@brief Sets the max_vertex_count parameter for the hierarchical network processor - This parameter controls splitting of large polygons in order to enhance performance - for very big polygons. - """ - name: str - r""" - @brief Gets the name of the database - @brief Sets the name of the database - """ - original_file: str - r""" - @brief Gets the original file name of the database - The original filename is the layout file from which the netlist DB was created.@brief Sets the original file name of the database - """ - threads: int - r""" - @brief Gets the number of threads to use for operations which support multiple threads - @brief Sets the number of threads to use for operations which support multiple threads - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a new and empty extractor object - The main objective for this constructor is to create an object suitable for reading an annotated netlist. - """ - @overload - def __init__(self, dss: DeepShapeStore) -> None: - r""" - @brief Creates a new extractor object reusing an existing \DeepShapeStore object - This constructor can be used if there is a DSS object already from which the shapes can be taken. This version can only be used with \register to add layers (regions) inside the 'dss' object. - - The make_... methods will not create new layers as there is no particular place defined where to create the layers. - - The extractor will not take ownership of the dss object unless you call \keep_dss. - """ - @overload - def __init__(self, iter: RecursiveShapeIterator) -> None: - r""" - @brief Creates a new extractor connected to an original layout - This constructor will attach the extractor to an original layout through the shape iterator. - """ - @overload - def __init__(self, dss: DeepShapeStore, layout_index: int) -> None: - r""" - @brief Creates a new extractor object reusing an existing \DeepShapeStore object - This constructor can be used if there is a DSS object already from which the shapes can be taken. NOTE: in this case, the make_... functions will create new layers inside this DSS. To register existing layers (regions) use \register. - """ - @overload - def __init__(self, topcell_name: str, dbu: float) -> None: - r""" - @brief Creates a new extractor object with a flat DSS - @param topcell_name The name of the top cell of the internal flat layout - @param dbu The database unit to use for the internal flat layout - - This constructor will create an extractor for flat extraction. Layers registered with \register will be flattened. New layers created with make_... will be flat layers. - - The database unit is mandatory because the physical parameter extraction for devices requires this unit for translation of layout to physical dimensions. - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - @overload - def antenna_check(self, gate: Region, metal: Region, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: - r""" - @brief Runs an antenna check on the extracted clusters - - The antenna check will traverse all clusters and run an antenna check - for all root clusters. The antenna ratio is defined by the total - area of all "metal" shapes divided by the total area of all "gate" shapes - on the cluster. Of all clusters where the antenna ratio is larger than - the limit ratio all metal shapes are copied to the output region as - error markers. - - The simple call is: - - @code - l2n = ... # a LayoutToNetlist object - l2n.extract_netlist - # check for antenna ratio 10.0 of metal vs. poly: - errors = l2n.antenna(poly, metal, 10.0) - @/code - - You can include diodes which rectify the antenna effect. Provide recognition layers for theses diodes and include them in the connections. Then specify the diode layers in the antenna call: - - @code - ... - # include diode_layer1: - errors = l2n.antenna(poly, metal, 10.0, [ diode_layer1 ]) - # include diode_layer1 and diode_layer2:errors = l2n.antenna(poly, metal, 10.0, [ diode_layer1, diode_layer2 ]) - @/code - - Diodes can be configured to partially reduce the antenna effect depending on their area. This will make the diode_layer1 increase the ratio by 50.0 per square micrometer area of the diode: - - @code - ... - # diode_layer1 increases the ratio by 50 per square micrometer area: - errors = l2n.antenna(poly, metal, 10.0 [ [ diode_layer, 50.0 ] ]) - @/code - - If 'texts' is non-nil, this text collection will receive labels explaining the error in terms of area values and relevant ratio. - - The 'texts' parameter has been added in version 0.27.11. - """ - @overload - def antenna_check(self, gate: Region, gate_perimeter_factor: float, metal: Region, metal_perimeter_factor: float, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: - r""" - @brief Runs an antenna check on the extracted clusters taking the perimeter into account - - This version of the \antenna_check method allows taking the perimeter of gate or metal into account. The effective area is computed using: - - @code - Aeff = A + P * t - @/code - - Here Aeff is the area used in the check, A is the polygon area, P the perimeter and t the perimeter factor. This formula applies to gate polygon area/perimeter with 'gate_perimeter_factor' for t and metal polygon area/perimeter with 'metal_perimeter_factor'. The perimeter_factor has the dimension of micrometers and can be thought of as the width of the material. Essentially the side walls of the material are taking into account for the surface area as well. - - This variant has been introduced in version 0.26.6. - """ - @overload - def antenna_check(self, gate: Region, gate_area_factor: float, gate_perimeter_factor: float, metal: Region, metal_area_factor: float, metal_perimeter_factor: float, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: - r""" - @brief Runs an antenna check on the extracted clusters taking the perimeter into account and providing an area factor - - This (most generic) version of the \antenna_check method allows taking the perimeter of gate or metal into account and also provides a scaling factor for the area part. - The effective area is computed using: - - @code - Aeff = A * f + P * t - @/code - - Here f is the area factor and t the perimeter factor. A is the polygon area and P the polygon perimeter. A use case for this variant is to set the area factor to zero. This way, only perimeter contributions are considered. - - This variant has been introduced in version 0.26.6. - """ - def build_all_nets(self, cmap: CellMapping, target: Layout, lmap: Dict[int, Region], net_cell_name_prefix: Optional[Any] = ..., netname_prop: Optional[Any] = ..., hier_mode: Optional[LayoutToNetlist.BuildNetHierarchyMode] = ..., circuit_cell_name_prefix: Optional[Any] = ..., device_cell_name_prefix: Optional[Any] = ...) -> None: - r""" - @brief Builds a full hierarchical representation of the nets - - This method copies all nets into cells corresponding to the circuits. It uses the 'cmap' - object to determine the target cell (create it with "cell_mapping_into" or "const_cell_mapping_into"). - If no mapping is provided for a specific circuit cell, the nets are copied into the next mapped parent as many times as the circuit cell appears there (circuit flattening). - - The method has three net annotation modes: - @ul - @li No annotation (net_cell_name_prefix == nil and netname_prop == nil): the shapes will be put - into the target cell simply. @/li - @li Net name property (net_cell_name_prefix == nil and netname_prop != nil): the shapes will be - annotated with a property named with netname_prop and containing the net name string. @/li - @li Individual subcells per net (net_cell_name_prefix != 0): for each net, a subcell is created - and the net shapes will be put there (name of the subcell = net_cell_name_prefix + net name). - (this mode can be combined with netname_prop too). @/li - @/ul - - In addition, net hierarchy is covered in three ways: - @ul - @li No connection indicated (hier_mode == \BNH_Disconnected: the net shapes are simply put into their - respective circuits. The connections are not indicated. @/li - @li Subnet hierarchy (hier_mode == \BNH_SubcircuitCells): for each root net, a full hierarchy is built - to accommodate the subnets (see build_net in recursive mode). @/li - @li Flat (hier_mode == \BNH_Flatten): each net is flattened and put into the circuit it - belongs to. @/li - @/ul - - If a device cell name prefix is given, cells will be produced for each device abstract - using a name like device_cell_name_prefix + device name. Otherwise the device shapes are - treated as part of the net. - - @param cmap The mapping of internal layout to target layout for the circuit mapping - @param target The target layout - @param lmap Target layer indexes (keys) and net regions (values) - @param hier_mode See description of this method - @param netname_prop An (optional) property name to which to attach the net name - @param circuit_cell_name_prefix See method description - @param net_cell_name_prefix See method description - @param device_cell_name_prefix See above - """ - def build_net(self, net: Net, target: Layout, target_cell: Cell, lmap: Dict[int, Region], netname_prop: Optional[Any] = ..., hier_mode: Optional[LayoutToNetlist.BuildNetHierarchyMode] = ..., circuit_cell_name_prefix: Optional[Any] = ..., device_cell_name_prefix: Optional[Any] = ...) -> None: - r""" - @brief Builds a net representation in the given layout and cell - - This method puts the shapes of a net into the given target cell using a variety of options - to represent the net name and the hierarchy of the net. - - If the netname_prop name is not nil, a property with the given name is created and assigned - the net name. - - Net hierarchy is covered in three ways: - @ul - @li No connection indicated (hier_mode == \BNH_Disconnected: the net shapes are simply put into their - respective circuits. The connections are not indicated. @/li - @li Subnet hierarchy (hier_mode == \BNH_SubcircuitCells): for each root net, a full hierarchy is built - to accommodate the subnets (see build_net in recursive mode). @/li - @li Flat (hier_mode == \BNH_Flatten): each net is flattened and put into the circuit it - belongs to. @/li - @/ul - If a device cell name prefix is given, cells will be produced for each device abstract - using a name like device_cell_name_prefix + device name. Otherwise the device shapes are - treated as part of the net. - - @param target The target layout - @param target_cell The target cell - @param lmap Target layer indexes (keys) and net regions (values) - @param hier_mode See description of this method - @param netname_prop An (optional) property name to which to attach the net name - @param cell_name_prefix Chooses recursive mode if non-null - @param device_cell_name_prefix See above - """ - def build_nets(self, nets: Sequence[Net], cmap: CellMapping, target: Layout, lmap: Dict[int, Region], net_cell_name_prefix: Optional[Any] = ..., netname_prop: Optional[Any] = ..., hier_mode: Optional[LayoutToNetlist.BuildNetHierarchyMode] = ..., circuit_cell_name_prefix: Optional[Any] = ..., device_cell_name_prefix: Optional[Any] = ...) -> None: - r""" - @brief Like \build_all_nets, but with the ability to select some nets. - """ - @overload - def cell_mapping_into(self, layout: Layout, cell: Cell, with_device_cells: Optional[bool] = ...) -> CellMapping: - r""" - @brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. - If 'with_device_cells' is true, cells will be produced for devices. These are cells not corresponding to circuits, so they are disabled normally. - Use this option, if you want to access device terminal shapes per device. - - CAUTION: this function may create new cells in 'layout'. Use \const_cell_mapping_into if you want to use the target layout's hierarchy and not modify it. - """ - @overload - def cell_mapping_into(self, layout: Layout, cell: Cell, nets: Sequence[Net], with_device_cells: Optional[bool] = ...) -> CellMapping: - r""" - @brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. - This version will only create cells which are required to represent the nets from the 'nets' argument. - - If 'with_device_cells' is true, cells will be produced for devices. These are cells not corresponding to circuits, so they are disabled normally. - Use this option, if you want to access device terminal shapes per device. - - CAUTION: this function may create new cells in 'layout'. Use \const_cell_mapping_into if you want to use the target layout's hierarchy and not modify it. - """ - def clear_join_net_names(self) -> None: - r""" - @brief Clears all implicit net joining expressions. - See \extract_netlist for more details about this feature. - - This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist. - """ - def clear_join_nets(self) -> None: - r""" - @brief Clears all explicit net joining expressions. - See \extract_netlist for more details about this feature. - - Explicit net joining has been introduced in version 0.27. - """ - @overload - def connect(self, l: Region) -> None: - r""" - @brief Defines an intra-layer connection for the given layer. - The layer is either an original layer created with \make_includelayer and it's variants or - a derived layer. Certain limitations apply. It's safe to use - boolean operations for deriving layers. Other operations are applicable as long as they are - capable of delivering hierarchical layers. - """ - @overload - def connect(self, a: Region, b: Region) -> None: - r""" - @brief Defines an inter-layer connection for the given layers. - The conditions mentioned with intra-layer \connect apply for this method too. - """ - @overload - def connect(self, a: Region, b: Texts) -> None: - r""" - @brief Defines an inter-layer connection for the given layers. - The conditions mentioned with intra-layer \connect apply for this method too. - As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons. - - This variant has been introduced in version 0.27. - """ - @overload - def connect(self, a: Texts, b: Region) -> None: - r""" - @brief Defines an inter-layer connection for the given layers. - The conditions mentioned with intra-layer \connect apply for this method too. - As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons. - - This variant has been introduced in version 0.27. - """ - @overload - def connect_global(self, l: Region, global_net_name: str) -> int: - r""" - @brief Defines a connection of the given layer with a global net. - This method returns the ID of the global net. Use \global_net_name to get the name back from the ID. - """ - @overload - def connect_global(self, l: Texts, global_net_name: str) -> int: - r""" - @brief Defines a connection of the given text layer with a global net. - This method returns the ID of the global net. Use \global_net_name to get the name back from the ID. - This variant has been introduced in version 0.27. - """ - def const_cell_mapping_into(self, layout: Layout, cell: Cell) -> CellMapping: - r""" - @brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. - This version will not create new cells in the target layout. - If the required cells do not exist there yet, flatting will happen. - """ - def dss(self) -> DeepShapeStore: - r""" - @brief Gets a reference to the internal DSS object. - """ - def dump_joined_net_names(self) -> str: - r""" - @hide - """ - def dump_joined_net_names_per_cell(self) -> str: - r""" - @hide - """ - def dump_joined_nets(self) -> str: - r""" - @hide - """ - def dump_joined_nets_per_cell(self) -> str: - r""" - @hide - """ - def extract_devices(self, extractor: DeviceExtractorBase, layers: Dict[str, ShapeCollection]) -> None: - r""" - @brief Extracts devices - See the class description for more details. - This method will run device extraction for the given extractor. The layer map is specific - for the extractor and uses the region objects derived with \make_layer and it's variants. - - In addition, derived regions can be passed too. Certain limitations apply. It's safe to use - boolean operations for deriving layers. Other operations are applicable as long as they are - capable of delivering hierarchical layers. - - If errors occur, the device extractor will contain theses errors. - """ - def extract_netlist(self) -> None: - r""" - @brief Runs the netlist extraction - - See the class description for more details. - - This method has been made parameter-less in version 0.27. Use \include_floating_subcircuits= and \join_net_names as substitutes for the arguments of previous versions. - """ - def filename(self) -> str: - r""" - @brief Gets the file name of the database - The filename is the name under which the database is stored or empty if it is not associated with a file. - """ - def global_net_name(self, global_net_id: int) -> str: - r""" - @brief Gets the global net name for the given global net ID. - """ - def internal_layout(self) -> Layout: - r""" - @brief Gets the internal layout - Usually it should not be required to obtain the internal layout. If you need to do so, make sure not to modify the layout as - the functionality of the netlist extractor depends on it. - """ - def internal_top_cell(self) -> Cell: - r""" - @brief Gets the internal top cell - Usually it should not be required to obtain the internal cell. If you need to do so, make sure not to modify the cell as - the functionality of the netlist extractor depends on it. - """ - def is_extracted(self) -> bool: - r""" - @brief Gets a value indicating whether the netlist has been extracted - - This method has been introduced in version 0.27.1. - """ - @overload - def is_persisted(self, layer: Region) -> bool: - r""" - @brief Returns true, if the given layer is a persisted region. - Persisted layers are kept inside the LayoutToNetlist object and are not released if their object is destroyed. Named layers are persisted, unnamed layers are not. Only persisted, named layers can be put into \connect. - """ - @overload - def is_persisted(self, layer: Texts) -> bool: - r""" - @brief Returns true, if the given layer is a persisted texts collection. - Persisted layers are kept inside the LayoutToNetlist object and are not released if their object is destroyed. Named layers are persisted, unnamed layers are not. Only persisted, named layers can be put into \connect. - - The variant for Texts collections has been added in version 0.27. - """ - @overload - def join_net_names(self, pattern: str) -> None: - r""" - @brief Specifies another pattern for implicit joining of nets for the top level cell. - Use this method to register a pattern for net labels considered in implicit net joining. Implicit net joining allows connecting multiple parts of the same nets (e.g. supply rails) without need for a physical connection. The pattern specifies labels to look for. When parts are labelled with a name matching the expression, the parts carrying the same name are joined. - - This method adds a new pattern. Use \clear_join_net_names to clear the registered pattern. - - Each pattern is a glob expression. Valid glob expressions are: - @ul - @li "" no implicit connections.@/li - @li "*" to make all labels candidates for implicit connections.@/li - @li "VDD" to make all 'VDD'' nets candidates for implicit connections.@/li - @li "VDD" to make all 'VDD'+suffix nets candidates for implicit connections.@/li - @li "{VDD,VSS}" to all VDD and VSS nets candidates for implicit connections.@/li - @/ul - - Label matching is case sensitive. - - This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist. - """ - @overload - def join_net_names(self, cell_pattern: str, pattern: str) -> None: - r""" - @brief Specifies another pattern for implicit joining of nets for the cells from the given cell pattern. - This method allows applying implicit net joining for specific cells, not only for the top cell. - - This method adds a new pattern. Use \clear_join_net_names to clear the registered pattern. - - This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist. - """ - @overload - def join_nets(self, net_names: Sequence[str]) -> None: - r""" - @brief Specifies another name list for explicit joining of nets for the top level cell. - Use this method to join nets from the set of net names. All these nets will be connected together forming a single net. - Explicit joining will imply implicit joining for the involved nets - partial nets involved will be connected too (intra-net joining). - - This method adds a new name list. Use \clear_join_nets to clear the registered pattern. - - Explicit net joining has been introduced in version 0.27. - """ - @overload - def join_nets(self, cell_pattern: str, net_names: Sequence[str]) -> None: - r""" - @brief Specifies another name list for explicit joining of nets for the cells from the given cell pattern. - This method allows applying explicit net joining for specific cells, not only for the top cell. - - This method adds a new name list. Use \clear_join_nets to clear the registered pattern. - - Explicit net joining has been introduced in version 0.27. - """ - def keep_dss(self) -> None: - r""" - @brief Resumes ownership over the DSS object if created with an external one. - """ - def layer_by_index(self, index: int) -> Region: - r""" - @brief Gets a layer object for the given index. - Only named layers can be retrieved with this method. The returned object is a copy which represents the named layer. - """ - def layer_by_name(self, name: str) -> Region: - r""" - @brief Gets a layer object for the given name. - The returned object is a copy which represents the named layer. - """ - @overload - def layer_name(self, l: int) -> str: - r""" - @brief Gets the name of the given layer (by index) - """ - @overload - def layer_name(self, l: ShapeCollection) -> str: - r""" - @brief Gets the name of the given layer - """ - def layer_names(self) -> List[str]: - r""" - @brief Returns a list of names of the layer kept inside the LayoutToNetlist object. - """ - @overload - def layer_of(self, l: Region) -> int: - r""" - @brief Gets the internal layer for a given extraction layer - This method is required to derive the internal layer index - for example for - investigating the cluster tree. - """ - @overload - def layer_of(self, l: Texts) -> int: - r""" - @brief Gets the internal layer for a given text collection - This method is required to derive the internal layer index - for example for - investigating the cluster tree. - - The variant for Texts collections has been added in version 0.27. - """ - @overload - def make_layer(self, name: Optional[str] = ...) -> Region: - r""" - @brief Creates a new, empty hierarchical region - - The name is optional. If given, the layer will already be named accordingly (see \register). - """ - @overload - def make_layer(self, layer_index: int, name: Optional[str] = ...) -> Region: - r""" - @brief Creates a new hierarchical region representing an original layer - 'layer_index' is the layer index of the desired layer in the original layout. - This variant produces polygons and takes texts for net name annotation. - A variant not taking texts is \make_polygon_layer. A Variant only taking - texts is \make_text_layer. - - The name is optional. If given, the layer will already be named accordingly (see \register). - """ - def make_polygon_layer(self, layer_index: int, name: Optional[str] = ...) -> Region: - r""" - @brief Creates a new region representing an original layer taking polygons and texts - See \make_layer for details. - - The name is optional. If given, the layer will already be named accordingly (see \register). - """ - def make_text_layer(self, layer_index: int, name: Optional[str] = ...) -> Texts: - r""" - @brief Creates a new region representing an original layer taking texts only - See \make_layer for details. - - The name is optional. If given, the layer will already be named accordingly (see \register). - - Starting with version 0.27, this method returns a \Texts object. - """ - def netlist(self) -> Netlist: - r""" - @brief gets the netlist extracted (0 if no extraction happened yet) - """ - @overload - def probe_net(self, of_layer: Region, point: DPoint, sc_path_out: Optional[Sequence[SubCircuit]] = ..., initial_circuit: Optional[Circuit] = ...) -> Net: - r""" - @brief Finds the net by probing a specific location on the given layer - - This method will find a net looking at the given layer at the specific position. - It will traverse the hierarchy below if no shape in the requested layer is found - in the specified location. The function will report the topmost net from far above the - hierarchy of circuits as possible. - - If \initial_circuit is given, the probing will start from this circuit and from the cell this circuit represents. By default, the probing will start from the top circuit. - - If no net is found at all, 0 is returned. - - It is recommended to use \probe_net on the netlist right after extraction. - Optimization functions such as \Netlist#purge will remove parts of the net which means - shape to net probing may no longer work for these nets. - - If non-null and an array, 'sc_path_out' will receive a list of \SubCircuits objects which lead to the net from the top circuit of the database. - - This variant accepts a micrometer-unit location. The location is given in the - coordinate space of the initial cell. - - The \sc_path_out and \initial_circuit parameters have been added in version 0.27. - """ - @overload - def probe_net(self, of_layer: Region, point: Point, sc_path_out: Optional[Sequence[SubCircuit]] = ..., initial_circuit: Optional[Circuit] = ...) -> Net: - r""" - @brief Finds the net by probing a specific location on the given layer - See the description of the other \probe_net variant. - This variant accepts a database-unit location. The location is given in the - coordinate space of the initial cell. - - The \sc_path_out and \initial_circuit parameters have been added in version 0.27. - """ - def read(self, path: str) -> None: - r""" - @brief Reads the extracted netlist from the file. - This method employs the native format of KLayout. - """ - def read_l2n(self, path: str) -> None: - r""" - Note: This is an alias of 'read'. - @brief Reads the extracted netlist from the file. - This method employs the native format of KLayout. - """ - def register(self, l: ShapeCollection, n: str) -> None: - r""" - @brief Names the given layer - 'l' must be a hierarchical \Region or \Texts object derived with \make_layer, \make_text_layer or \make_polygon_layer or a region derived from those by boolean operations or other hierarchical operations. - - Naming a layer allows the system to indicate the layer in various contexts, i.e. when writing the data to a file. Named layers are also persisted inside the LayoutToNetlist object. They are not discarded when the Region object is destroyed. - - If required, the system will assign a name automatically. - This method has been generalized in version 0.27. - """ - def reset_extracted(self) -> None: - r""" - @brief Resets the extracted netlist and enables re-extraction - This method is implicitly called when using \connect or \connect_global after a netlist has been extracted. - This enables incremental connect with re-extraction. - - This method has been introduced in version 0.27.1. - """ - @overload - def shapes_of_net(self, net: Net, of_layer: Region, recursive: bool) -> Region: - r""" - @brief Returns all shapes of a specific net and layer. - If 'recursive'' is true, the returned region will contain the shapes of - all subcircuits too. - """ - @overload - def shapes_of_net(self, net: Net, of_layer: Region, recursive: bool, to: Shapes, propid: Optional[int] = ...) -> None: - r""" - @brief Sends all shapes of a specific net and layer to the given Shapes container. - If 'recursive'' is true, the returned region will contain the shapes of - all subcircuits too. - "prop_id" is an optional properties ID. If given, this property set will be attached to the shapes. - """ - def write(self, path: str, short_format: Optional[bool] = ...) -> None: - r""" - @brief Writes the extracted netlist to a file. - This method employs the native format of KLayout. - """ - def write_l2n(self, path: str, short_format: Optional[bool] = ...) -> None: - r""" - Note: This is an alias of 'write'. - @brief Writes the extracted netlist to a file. - This method employs the native format of KLayout. - """ - -class LayoutVsSchematic(LayoutToNetlist): - r""" - @brief A generic framework for doing LVS (layout vs. schematic) - - This class extends the concept of the netlist extraction from a layout to LVS verification. It does so by adding these concepts to the \LayoutToNetlist class: - - @ul - @li A reference netlist. This will be the netlist against which the layout-derived netlist is compared against. See \reference and \reference=. - @/li - @li A compare step. During the compare the layout-derived netlist and the reference netlists are compared. The compare results are captured in the cross-reference object. See \compare and \NetlistComparer for the comparer object. - @/li - @li A cross-reference. This object (of class \NetlistCrossReference) will keep the relations between the objects of the two netlists. It also lists the differences between the netlists. See \xref about how to access this object.@/li - @/ul - - The LVS object can be persisted to and from a file in a specific format, so it is sometimes referred to as the "LVS database". - - LVS objects can be attached to layout views with \LayoutView#add_lvsdb so they become available in the netlist database browser. - - This class has been introduced in version 0.26. - """ - reference: Netlist - r""" - @brief Gets the reference netlist. - @brief Sets the reference netlist. - This will set the reference netlist used inside \compare as the second netlist to compare against the layout-extracted netlist. - - The LVS object will take ownership over the netlist - i.e. if it goes out of scope, the reference netlist is deleted. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a new LVS object - The main objective for this constructor is to create an object suitable for reading and writing LVS database files. - """ - @overload - def __init__(self, dss: DeepShapeStore) -> None: - r""" - @brief Creates a new LVS object with the extractor object reusing an existing \DeepShapeStore object - See the corresponding constructor of the \LayoutToNetlist object for more details. - """ - @overload - def __init__(self, iter: RecursiveShapeIterator) -> None: - r""" - @brief Creates a new LVS object with the extractor connected to an original layout - This constructor will attach the extractor of the LVS object to an original layout through the shape iterator. - """ - @overload - def __init__(self, dss: DeepShapeStore, layout_index: int) -> None: - r""" - @brief Creates a new LVS object with the extractor object reusing an existing \DeepShapeStore object - See the corresponding constructor of the \LayoutToNetlist object for more details. - """ - @overload - def __init__(self, topcell_name: str, dbu: float) -> None: - r""" - @brief Creates a new LVS object with the extractor object taking a flat DSS - See the corresponding constructor of the \LayoutToNetlist object for more details. - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def compare(self, comparer: NetlistComparer) -> bool: - r""" - @brief Compare the layout-extracted netlist against the reference netlist using the given netlist comparer. - """ - def read(self, path: str) -> None: - r""" - @brief Reads the LVS object from the file. - This method employs the native format of KLayout. - """ - def read_l2n(self, path: str) -> None: - r""" - @brief Reads the \LayoutToNetlist part of the object from a file. - This method employs the native format of KLayout. - """ - def write(self, path: str, short_format: Optional[bool] = ...) -> None: - r""" - @brief Writes the LVS object to a file. - This method employs the native format of KLayout. - """ - def write_l2n(self, path: str, short_format: Optional[bool] = ...) -> None: - r""" - @brief Writes the \LayoutToNetlist part of the object to a file. - This method employs the native format of KLayout. - """ - def xref(self) -> NetlistCrossReference: - r""" - @brief Gets the cross-reference object - The cross-reference object is created while comparing the layout-extracted netlist against the reference netlist - i.e. during \compare. Before \compare is called, this object is nil. - It holds the results of the comparison - a cross-reference between the nets and other objects in the match case and a listing of non-matching nets and other objects for the non-matching cases. - See \NetlistCrossReference for more details. - """ - class Library: r""" @brief A Library @@ -13351,17 +15299,44 @@ class Library: """ description: str r""" + Getter: @brief Returns the libraries' description text + + Setter: @brief Sets the libraries' description text """ - technology: None + technology: str r""" - WARNING: This variable can only be set, not retrieved. + Getter: + @brief Returns name of the technology the library is associated with + If this attribute is a non-empty string, this library is only offered for selection if the current layout uses this technology. + + This attribute has been introduced in version 0.25. In version 0.27 this attribute is deprecated as a library can now be associated with multiple technologies. + Setter: @brief sets the name of the technology the library is associated with See \technology for details. This attribute has been introduced in version 0.25. In version 0.27, a library can be associated with multiple technologies and this method will revert the selection to a single one. Passing an empty string is equivalent to \clear_technologies. """ @classmethod + def library_by_id(cls, id: int) -> Library: + r""" + @brief Gets the library object for the given ID + If the ID is not valid, nil is returned. + + This method has been introduced in version 0.27. + """ + @classmethod + def library_by_name(cls, name: str, for_technology: Optional[str] = ...) -> Library: + r""" + @brief Gets a library by name + Returns the library object for the given name. If the name is not a valid + library name, nil is returned. + + Different libraries can be registered under the same names for different technologies. When a technology name is given in 'for_technologies', the first library matching this technology is returned. If no technology is given, the first library is returned. + + The technology selector has been introduced in version 0.27. + """ + @classmethod def library_ids(cls) -> List[int]: r""" @brief Returns a list of valid library IDs. @@ -13375,6 +15350,15 @@ class Library: NOTE: starting with version 0.27, the name of a library does not need to be unique if libraries are associated with specific technologies. This method will only return the names and it's not possible not unambiguously derive the library object. It is recommended to use \library_ids and \library_by_id to obtain the library unambiguously. """ + @classmethod + def new(cls) -> Library: + r""" + @brief Creates a new, empty library + """ + def __copy__(self) -> Library: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new, empty library @@ -13423,6 +15407,10 @@ class Library: This method has been introduced in version 0.27 """ + def assign(self, other: Library) -> None: + r""" + @brief Assigns another object to self + """ def clear_technologies(self) -> None: r""" @brief Clears the list of technologies the library is associated with. @@ -13430,6 +15418,11 @@ class Library: This method has been introduced in version 0.27 """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def delete(self) -> None: r""" @brief Deletes the library @@ -13438,6 +15431,22 @@ class Library: This method has been introduced in version 0.25. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> Library: + r""" + @brief Creates a copy of self + """ def for_technologies(self) -> bool: r""" @brief Returns a value indicating whether the library is associated with any technology. @@ -13450,6 +15459,12 @@ class Library: @brief Returns the library's ID The ID is set when the library is registered and cannot be changed """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_for_technology(self, tech: str) -> bool: r""" @brief Returns a value indicating whether the library is associated with the given technology. @@ -13463,23 +15478,6 @@ class Library: r""" @brief The layout object where the cells reside that this library defines (const version) """ - def library_by_id(self, id: int) -> Library: - r""" - @brief Gets the library object for the given ID - If the ID is not valid, nil is returned. - - This method has been introduced in version 0.27. - """ - def library_by_name(self, name: str, for_technology: Optional[str] = ...) -> Library: - r""" - @brief Gets a library by name - Returns the library object for the given name. If the name is not a valid - library name, nil is returned. - - Different libraries can be registered under the same names for different technologies. When a technology name is given in 'for_technologies', the first library matching this technology is returned. If no technology is given, the first library is returned. - - The technology selector has been introduced in version 0.27. - """ def name(self) -> str: r""" @brief Returns the libraries' name @@ -13515,6 +15513,15 @@ class PCellDeclaration_Native: @hide @alias PCellDeclaration """ + @classmethod + def new(cls) -> PCellDeclaration_Native: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> PCellDeclaration_Native: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -13556,15 +15563,40 @@ class PCellDeclaration_Native: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def assign(self, other: PCellDeclaration_Native) -> None: + r""" + @brief Assigns another object to self + """ def can_create_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> bool: r""" """ def coerce_parameters(self, arg0: Layout, arg1: Sequence[Any]) -> List[Any]: r""" """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def display_text(self, arg0: Sequence[Any]) -> str: r""" """ + def dup(self) -> PCellDeclaration_Native: + r""" + @brief Creates a copy of self + """ def get_layers(self, arg0: Sequence[Any]) -> List[LayerInfo]: r""" """ @@ -13576,6 +15608,12 @@ class PCellDeclaration_Native: @brief Gets the integer ID of the PCell declaration This ID is used to identify the PCell in the context of a Layout object for example """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def layout(self) -> Layout: r""" @brief Gets the Layout object the PCell is registered in or nil if it is not registered yet. @@ -13623,9 +15661,9 @@ class PCellDeclaration(PCellDeclaration_Native): This class has been introduced in version 0.22. """ - def __copy__(self) -> PCellDeclaration: + def _assign(self, other: PCellDeclaration_Native) -> None: r""" - @brief Creates a copy of self + @brief Assigns another object to self """ def _create(self) -> None: r""" @@ -13644,6 +15682,10 @@ class PCellDeclaration(PCellDeclaration_Native): This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ + def _dup(self) -> PCellDeclaration: + r""" + @brief Creates a copy of self + """ def _is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference @@ -13664,114 +15706,30 @@ class PCellDeclaration(PCellDeclaration_Native): Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: PCellDeclaration_Native) -> None: - r""" - @brief Assigns another object to self - """ - @overload def can_create_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> bool: r""" @hide """ - @overload - def can_create_from_shape(self, layout: Layout, shape: Shape, layer: int) -> bool: - r""" - @brief Returns true, if the PCell can be created from the given shape - @param layout The layout the shape lives in - @param shape The shape from which a PCell shall be created - @param layer The layer index (in layout) of the shape - KLayout offers a way to convert a shape into a PCell. To test whether the PCell can be created from a shape, it will call this method. If this method returns true, KLayout will use \parameters_from_shape and \transformation_from_shape to derive the parameters and instance transformation for the new PCell instance that will replace the shape. - """ - def coerce_parameters(self, layout: Layout, input: Sequence[Any]) -> List[Any]: - r""" - @brief Modifies the parameters to match the requirements - @param layout The layout object in which the PCell will be produced - @param input The parameters before the modification - @return The modified parameters or an empty array, indicating that no modification was done - This method can be reimplemented to change the parameter set according to some - constraints for example. The reimplementation may modify the parameters in a way - that they are usable for the \produce method. - - The method receives a reference to the layout so it is able to verify - the parameters against layout properties. - - It can raise an exception to indicate that something is not correct. - """ - @overload def display_text(self, arg0: Sequence[Any]) -> str: r""" @hide """ - @overload - def display_text(self, parameters: Sequence[Any]) -> str: - r""" - @brief Returns the display text for this PCell given a certain parameter set - Reimplement this method to create a distinct display text for a PCell variant with - the given parameter set. If this method is not implemented, a default text is created. - """ - def dup(self) -> PCellDeclaration: - r""" - @brief Creates a copy of self - """ - def get_layers(self, parameters: Sequence[Any]) -> List[LayerInfo]: - r""" - @brief Returns a list of layer declarations - Reimplement this method to return a list of layers this PCell wants to create. - The layer declarations are returned as a list of LayerInfo objects which are - used as match expressions to look up the layer in the actual layout. - - This method receives the PCell parameters which allows it to deduce layers - from the parameters. - """ def get_parameters(self) -> List[PCellParameterDeclaration]: r""" @hide """ - @overload def parameters_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> List[Any]: r""" @hide """ - @overload - def parameters_from_shape(self, layout: Layout, shape: Shape, layer: int) -> List[Any]: - r""" - @brief Gets the parameters for the PCell which can replace the given shape - @param layout The layout the shape lives in - @param shape The shape from which a PCell shall be created - @param layer The layer index (in layout) of the shape - KLayout offers a way to convert a shape into a PCell. If \can_create_from_shape returns true, it will use this method to derive the parameters for the PCell instance that will replace the shape. See also \transformation_from_shape and \can_create_from_shape. - """ - @overload def produce(self, arg0: Layout, arg1: Sequence[int], arg2: Sequence[Any], arg3: Cell) -> None: r""" @hide """ - @overload - def produce(self, layout: Layout, layer_ids: Sequence[int], parameters: Sequence[Any], cell: Cell) -> None: - r""" - @brief The production callback - @param layout The layout object where the cell resides - @param layer_ids A list of layer ID's which correspond to the layers declared with get_layers - @param parameters A list of parameter values which correspond to the parameters declared with get_parameters - @param cell The cell where the layout will be created - Reimplement this method to provide the code that implements the PCell. - The code is supposed to create the layout in the target cell using the provided - parameters and the layers passed in the layer_ids list. - """ - @overload def transformation_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> Trans: r""" @hide """ - @overload - def transformation_from_shape(self, layout: Layout, shape: Shape, layer: int) -> Trans: - r""" - @brief Gets the instance transformation for the PCell which can replace the given shape - @param layout The layout the shape lives in - @param shape The shape from which a PCell shall be created - @param layer The layer index (in layout) of the shape - KLayout offers a way to convert a shape into a PCell. If \can_create_from_shape returns true, it will use this method to derive the transformation for the PCell instance that will replace the shape. See also \parameters_from_shape and \can_create_from_shape. - """ def wants_lazy_evaluation(self) -> bool: r""" @hide @@ -13822,46 +15780,97 @@ class PCellParameterDeclaration: """ default: Any r""" + Getter: @brief Gets the default value + + Setter: @brief Sets the default value If a default value is defined, it will be used to initialize the parameter value when a PCell is created. """ description: str r""" + Getter: @brief Gets the description text + + Setter: @brief Sets the description """ hidden: bool r""" + Getter: @brief Returns true, if the parameter is a hidden parameter that should not be shown in the user interface By making a parameter hidden, it is possible to create internal parameters which cannot be edited. + + Setter: @brief Makes the parameter hidden if this attribute is set to true """ name: str r""" + Getter: @brief Gets the name + + Setter: @brief Sets the name """ readonly: bool r""" + Getter: @brief Returns true, if the parameter is a read-only parameter By making a parameter read-only, it is shown but cannot be edited. + + Setter: @brief Makes the parameter read-only if this attribute is set to true """ type: int r""" + Getter: @brief Gets the type - The type is one of the T... constants.@brief Sets the type + The type is one of the T... constants. + Setter: + @brief Sets the type """ unit: str r""" + Getter: @brief Gets the unit string + + Setter: @brief Sets the unit string The unit string is shown right to the edit fields for numeric parameters. """ + @overload + @classmethod + def new(cls, name: str, type: int, description: str) -> PCellParameterDeclaration: + r""" + @brief Create a new parameter declaration with the given name and type + @param name The parameter name + @param type One of the Type... constants describing the type of the parameter + @param description The description text + """ + @overload + @classmethod + def new(cls, name: str, type: int, description: str, default: Any) -> PCellParameterDeclaration: + r""" + @brief Create a new parameter declaration with the given name, type and default value + @param name The parameter name + @param type One of the Type... constants describing the type of the parameter + @param description The description text + @param default The default (initial) value + """ + @overload + @classmethod + def new(cls, name: str, type: int, description: str, default: Any, unit: str) -> PCellParameterDeclaration: + r""" + @brief Create a new parameter declaration with the given name, type, default value and unit string + @param name The parameter name + @param type One of the Type... constants describing the type of the parameter + @param description The description text + @param default The default (initial) value + @param unit The unit string + """ def __copy__(self) -> PCellParameterDeclaration: r""" @brief Creates a copy of self @@ -13953,10 +15962,33 @@ class PCellParameterDeclaration: r""" @brief Clears the list of choices """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> PCellParameterDeclaration: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class Manager: r""" @@ -13970,6 +16002,15 @@ class Manager: This class has been introduced in version 0.19. """ + @classmethod + def new(cls) -> Manager: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> Manager: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -14011,10 +16052,35 @@ class Manager: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def assign(self, other: Manager) -> None: + r""" + @brief Assigns another object to self + """ def commit(self) -> None: r""" @brief Close a transaction. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> Manager: + r""" + @brief Creates a copy of self + """ def has_redo(self) -> bool: r""" @brief Determine if a transaction is available for 'redo' @@ -14027,6 +16093,12 @@ class Manager: @return True, if a transaction is available. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def redo(self) -> None: r""" @brief Redo the next available transaction @@ -14094,6 +16166,39 @@ class Matrix2d: """ @overload @classmethod + def new(cls) -> Matrix2d: + r""" + @brief Create a new Matrix2d representing a unit transformation + """ + @overload + @classmethod + def new(cls, m: float) -> Matrix2d: + r""" + @brief Create a new Matrix2d representing an isotropic magnification + @param m The magnification + """ + @overload + @classmethod + def new(cls, t: DCplxTrans) -> Matrix2d: + r""" + @brief Create a new Matrix2d from the given complex transformation@param t The transformation from which to create the matrix (not taking into account the displacement) + """ + @overload + @classmethod + def new(cls, mx: float, my: float) -> Matrix2d: + r""" + @brief Create a new Matrix2d representing an anisotropic magnification + @param mx The magnification in x direction + @param my The magnification in y direction + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m21: float, m22: float) -> Matrix2d: + r""" + @brief Create a new Matrix2d from the four coefficients + """ + @overload + @classmethod def newc(cls, mag: float, rotation: float, mirror: bool) -> Matrix2d: r""" @brief Create a new Matrix2d representing an isotropic magnification, rotation and mirroring @@ -14183,7 +16288,6 @@ class Matrix2d: @overload def __mul__(self, p: DPoint) -> DPoint: r""" - Note: This is an alias of 'trans'. @brief Transforms a point with this matrix. @param p The point to transform. @return The transformed point @@ -14209,11 +16313,6 @@ class Matrix2d: @param v The vector to transform. @return The transformed vector """ - def __repr__(self) -> str: - r""" - @brief Convert the matrix to a string. - @return The string representing this matrix - """ @overload def __rmul__(self, box: DBox) -> DBox: r""" @@ -14240,7 +16339,6 @@ class Matrix2d: @overload def __rmul__(self, p: DPoint) -> DPoint: r""" - Note: This is an alias of 'trans'. @brief Transforms a point with this matrix. @param p The point to transform. @return The transformed point @@ -14324,6 +16422,23 @@ class Matrix2d: @return The complex transformation. This method is successful only if the matrix does not contain shear components and the magnification must be isotropic. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> Matrix2d: r""" @brief Creates a copy of self @@ -14333,6 +16448,12 @@ class Matrix2d: @brief The inverse of this matrix. @return The inverse of this matrix """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_mirror(self) -> bool: r""" @brief Returns the mirror flag of this matrix. @@ -14405,6 +16526,39 @@ class IMatrix2d: """ @overload @classmethod + def new(cls) -> IMatrix2d: + r""" + @brief Create a new Matrix2d representing a unit transformation + """ + @overload + @classmethod + def new(cls, m: float) -> IMatrix2d: + r""" + @brief Create a new Matrix2d representing an isotropic magnification + @param m The magnification + """ + @overload + @classmethod + def new(cls, t: DCplxTrans) -> IMatrix2d: + r""" + @brief Create a new Matrix2d from the given complex transformation@param t The transformation from which to create the matrix (not taking into account the displacement) + """ + @overload + @classmethod + def new(cls, mx: float, my: float) -> IMatrix2d: + r""" + @brief Create a new Matrix2d representing an anisotropic magnification + @param mx The magnification in x direction + @param my The magnification in y direction + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m21: float, m22: float) -> IMatrix2d: + r""" + @brief Create a new Matrix2d from the four coefficients + """ + @overload + @classmethod def newc(cls, mag: float, rotation: float, mirror: bool) -> IMatrix2d: r""" @brief Create a new Matrix2d representing an isotropic magnification, rotation and mirroring @@ -14494,7 +16648,6 @@ class IMatrix2d: @overload def __mul__(self, p: Point) -> Point: r""" - Note: This is an alias of 'trans'. @brief Transforms a point with this matrix. @param p The point to transform. @return The transformed point @@ -14520,11 +16673,6 @@ class IMatrix2d: @param v The vector to transform. @return The transformed vector """ - def __repr__(self) -> str: - r""" - @brief Convert the matrix to a string. - @return The string representing this matrix - """ @overload def __rmul__(self, box: Box) -> Box: r""" @@ -14551,7 +16699,6 @@ class IMatrix2d: @overload def __rmul__(self, p: Point) -> Point: r""" - Note: This is an alias of 'trans'. @brief Transforms a point with this matrix. @param p The point to transform. @return The transformed point @@ -14635,6 +16782,23 @@ class IMatrix2d: @return The complex transformation. This method is successful only if the matrix does not contain shear components and the magnification must be isotropic. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> IMatrix2d: r""" @brief Creates a copy of self @@ -14644,6 +16808,12 @@ class IMatrix2d: @brief The inverse of this matrix. @return The inverse of this matrix """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_mirror(self) -> bool: r""" @brief Returns the mirror flag of this matrix. @@ -14748,6 +16918,43 @@ class Matrix3d: """ @overload @classmethod + def new(cls) -> Matrix3d: + r""" + @brief Create a new Matrix3d representing a unit transformation + """ + @overload + @classmethod + def new(cls, m: float) -> Matrix3d: + r""" + @brief Create a new Matrix3d representing a magnification + @param m The magnification + """ + @overload + @classmethod + def new(cls, t: DCplxTrans) -> Matrix3d: + r""" + @brief Create a new Matrix3d from the given complex transformation@param t The transformation from which to create the matrix + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m21: float, m22: float) -> Matrix3d: + r""" + @brief Create a new Matrix3d from the four coefficients of a Matrix2d + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> Matrix3d: + r""" + @brief Create a new Matrix3d from the four coefficients of a Matrix2d plus a displacement + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float) -> Matrix3d: + r""" + @brief Create a new Matrix3d from the nine matrix coefficients + """ + @overload + @classmethod def newc(cls, mag: float, rotation: float, mirrx: bool) -> Matrix3d: r""" @brief Create a new Matrix3d representing a isotropic magnification, rotation and mirroring @@ -14878,7 +17085,6 @@ class Matrix3d: @overload def __mul__(self, p: DPoint) -> DPoint: r""" - Note: This is an alias of 'trans'. @brief Transforms a point with this matrix. @param p The point to transform. @return The transformed point @@ -14904,11 +17110,6 @@ class Matrix3d: @param v The vector to transform. @return The transformed vector """ - def __repr__(self) -> str: - r""" - @brief Convert the matrix to a string. - @return The string representing this matrix - """ @overload def __rmul__(self, box: DBox) -> DBox: r""" @@ -14935,7 +17136,6 @@ class Matrix3d: @overload def __rmul__(self, p: DPoint) -> DPoint: r""" - Note: This is an alias of 'trans'. @brief Transforms a point with this matrix. @param p The point to transform. @return The transformed point @@ -15033,6 +17233,23 @@ class Matrix3d: @return The complex transformation. This method is successful only if the matrix does not contain shear or perspective distortion components and the magnification must be isotropic. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def disp(self) -> DVector: r""" @brief Returns the displacement vector of this transformation. @@ -15049,6 +17266,12 @@ class Matrix3d: @brief The inverse of this matrix. @return The inverse of this matrix """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_mirror(self) -> bool: r""" @brief Returns the mirror flag of this matrix. @@ -15112,6 +17335,43 @@ class IMatrix3d: """ @overload @classmethod + def new(cls) -> IMatrix3d: + r""" + @brief Create a new Matrix3d representing a unit transformation + """ + @overload + @classmethod + def new(cls, m: float) -> IMatrix3d: + r""" + @brief Create a new Matrix3d representing a magnification + @param m The magnification + """ + @overload + @classmethod + def new(cls, t: ICplxTrans) -> IMatrix3d: + r""" + @brief Create a new Matrix3d from the given complex transformation@param t The transformation from which to create the matrix + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m21: float, m22: float) -> IMatrix3d: + r""" + @brief Create a new Matrix3d from the four coefficients of a Matrix2d + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> IMatrix3d: + r""" + @brief Create a new Matrix3d from the four coefficients of a Matrix2d plus a displacement + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float) -> IMatrix3d: + r""" + @brief Create a new Matrix3d from the nine matrix coefficients + """ + @overload + @classmethod def newc(cls, mag: float, rotation: float, mirrx: bool) -> IMatrix3d: r""" @brief Create a new Matrix3d representing a isotropic magnification, rotation and mirroring @@ -15242,7 +17502,6 @@ class IMatrix3d: @overload def __mul__(self, p: Point) -> Point: r""" - Note: This is an alias of 'trans'. @brief Transforms a point with this matrix. @param p The point to transform. @return The transformed point @@ -15268,11 +17527,6 @@ class IMatrix3d: @param v The vector to transform. @return The transformed vector """ - def __repr__(self) -> str: - r""" - @brief Convert the matrix to a string. - @return The string representing this matrix - """ @overload def __rmul__(self, box: Box) -> Box: r""" @@ -15299,7 +17553,6 @@ class IMatrix3d: @overload def __rmul__(self, p: Point) -> Point: r""" - Note: This is an alias of 'trans'. @brief Transforms a point with this matrix. @param p The point to transform. @return The transformed point @@ -15383,6 +17636,23 @@ class IMatrix3d: @return The complex transformation. This method is successful only if the matrix does not contain shear or perspective distortion components and the magnification must be isotropic. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def disp(self) -> Vector: r""" @brief Returns the displacement vector of this transformation. @@ -15399,6 +17669,12 @@ class IMatrix3d: @brief The inverse of this matrix. @return The inverse of this matrix """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_mirror(self) -> bool: r""" @brief Returns the mirror flag of this matrix. @@ -15452,6 +17728,22083 @@ class IMatrix3d: The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles at different observer distances. Hence, the observer distance must be specified at which the tilt angle is computed. If the magnitude of the tilt angle is not important, z can be set to 1. """ +class Path: + r""" + @brief A path class + + A path consists of an sequence of line segments forming the 'spine' of the path and a width. In addition, the starting point can be drawn back by a certain extent (the 'begin extension') and the end point can be pulled forward somewhat (by the 'end extension'). + + A path may have round ends for special purposes. In particular, a round-ended path with a single point can represent a circle. Round-ended paths should have being and end extensions equal to half the width. Non-round-ended paths with a single point are allowed but the definition of the resulting shape in not well defined and may differ in other tools. + + See @The Database API@ for more details about the database objects. + """ + bgn_ext: int + r""" + Getter: + @brief Get the begin extension + + Setter: + @brief Set the begin extension + """ + end_ext: int + r""" + Getter: + @brief Get the end extension + + Setter: + @brief Set the end extension + """ + points: int + r""" + Getter: + @brief Get the number of points + Setter: + @brief Set the points of the path + @param p An array of points to assign to the path's spine + """ + round: bool + r""" + Getter: + @brief Returns true, if the path has round ends + + Setter: + @brief Set the 'round ends' flag + A path with round ends show half circles at the ends, instead of square or rectangular ends. Paths with this flag set should use a begin and end extension of half the width (see \bgn_ext and \end_ext). The interpretation of such paths in other tools may differ otherwise. + """ + width: int + r""" + Getter: + @brief Get the width + + Setter: + @brief Set the width + """ + @classmethod + def from_dpath(cls, dpath: DPath) -> Path: + r""" + @brief Creates an integer coordinate path from a floating-point coordinate path + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpath'. + """ + @classmethod + def from_s(cls, s: str) -> Path: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> Path: + r""" + @brief Default constructor: creates an empty (invalid) path with width 0 + """ + @overload + @classmethod + def new(cls, dpath: DPath) -> Path: + r""" + @brief Creates an integer coordinate path from a floating-point coordinate path + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpath'. + """ + @overload + @classmethod + def new(cls, pts: Sequence[Point], width: int) -> Path: + r""" + @brief Constructor given the points of the path's spine and the width + + + @param pts The points forming the spine of the path + @param width The width of the path + """ + @overload + @classmethod + def new(cls, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int) -> Path: + r""" + @brief Constructor given the points of the path's spine, the width and the extensions + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + """ + @overload + @classmethod + def new(cls, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int, round: bool) -> Path: + r""" + @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + @param round If this flag is true, the path will get rounded ends + """ + @classmethod + def new_pw(cls, pts: Sequence[Point], width: int) -> Path: + r""" + @brief Constructor given the points of the path's spine and the width + + + @param pts The points forming the spine of the path + @param width The width of the path + """ + @classmethod + def new_pwx(cls, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int) -> Path: + r""" + @brief Constructor given the points of the path's spine, the width and the extensions + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + """ + @classmethod + def new_pwxr(cls, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int, round: bool) -> Path: + r""" + @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + @param round If this flag is true, the path will get rounded ends + """ + def __copy__(self) -> Path: + r""" + @brief Creates a copy of self + """ + def __eq__(self, p: object) -> bool: + r""" + @brief Equality test + @param p The object to compare against + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor: creates an empty (invalid) path with width 0 + """ + @overload + def __init__(self, dpath: DPath) -> None: + r""" + @brief Creates an integer coordinate path from a floating-point coordinate path + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpath'. + """ + @overload + def __init__(self, pts: Sequence[Point], width: int) -> None: + r""" + @brief Constructor given the points of the path's spine and the width + + + @param pts The points forming the spine of the path + @param width The width of the path + """ + @overload + def __init__(self, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int) -> None: + r""" + @brief Constructor given the points of the path's spine, the width and the extensions + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + """ + @overload + def __init__(self, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int, round: bool) -> None: + r""" + @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + @param round If this flag is true, the path will get rounded ends + """ + def __lt__(self, p: Path) -> bool: + r""" + @brief Less operator + @param p The object to compare against + This operator is provided to establish some, not necessarily a certain sorting order + """ + def __mul__(self, f: float) -> Path: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __ne__(self, p: object) -> bool: + r""" + @brief Inequality test + @param p The object to compare against + """ + def __rmul__(self, f: float) -> Path: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __str__(self) -> str: + r""" + @brief Convert to a string + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def area(self) -> int: + r""" + @brief Returns the approximate area of the path + This method returns the approximate value of the area. It is computed from the length times the width. end extensions are taken into account correctly, but not effects of the corner interpolation. + This method was added in version 0.22. + """ + def assign(self, other: Path) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> Box: + r""" + @brief Returns the bounding box of the path + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> Path: + r""" + @brief Creates a copy of self + """ + def each_point(self) -> Iterator[Point]: + r""" + @brief Get the points that make up the path's spine + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_round(self) -> bool: + r""" + @brief Returns true, if the path has round ends + """ + def length(self) -> int: + r""" + @brief Returns the length of the path + the length of the path is determined by summing the lengths of the segments and adding begin and end extensions. For round-ended paths the length of the paths between the tips of the ends. + + This method was added in version 0.23. + """ + @overload + def move(self, p: Vector) -> Path: + r""" + @brief Moves the path. + + Moves the path by the given offset and returns the + moved path. The path is overwritten. + + @param p The distance to move the path. + + @return The moved path. + """ + @overload + def move(self, dx: int, dy: int) -> Path: + r""" + @brief Moves the path. + + Moves the path by the given offset and returns the + moved path. The path is overwritten. + + @param dx The x distance to move the path. + @param dy The y distance to move the path. + + @return The moved path. + + This version has been added in version 0.23. + """ + @overload + def moved(self, p: Vector) -> Path: + r""" + @brief Returns the moved path (does not change self) + + Moves the path by the given offset and returns the + moved path. The path is not modified. + + @param p The distance to move the path. + + @return The moved path. + """ + @overload + def moved(self, dx: int, dy: int) -> Path: + r""" + @brief Returns the moved path (does not change self) + + Moves the path by the given offset and returns the + moved path. The path is not modified. + + @param dx The x distance to move the path. + @param dy The y distance to move the path. + + @return The moved path. + + This version has been added in version 0.23. + """ + def num_points(self) -> int: + r""" + @brief Get the number of points + """ + def perimeter(self) -> int: + r""" + @brief Returns the approximate perimeter of the path + This method returns the approximate value of the perimeter. It is computed from the length and the width. end extensions are taken into account correctly, but not effects of the corner interpolation. + This method was added in version 0.24.4. + """ + def polygon(self) -> Polygon: + r""" + @brief Convert the path to a polygon + The returned polygon is not guaranteed to be non-self overlapping. This may happen if the path overlaps itself or contains very short segments. + """ + def round_corners(self, radius: float, npoints: int) -> Path: + r""" + @brief Creates a new path whose corners are interpolated with circular bends + + @param radius The radius of the bends + @param npoints The number of points (per full circle) used for interpolating the bends + + This method has been introduced in version 0.25. + """ + def simple_polygon(self) -> SimplePolygon: + r""" + @brief Convert the path to a simple polygon + The returned polygon is not guaranteed to be non-selfoverlapping. This may happen if the path overlaps itself or contains very short segments. + """ + def to_dtype(self, dbu: Optional[float] = ...) -> DPath: + r""" + @brief Converts the path to a floating-point coordinate path + + The database unit can be specified to translate the integer-coordinate path into a floating-point coordinate path in micron units. The database unit is basically a scaling factor. + + This method has been introduced in version 0.25. + """ + def to_s(self) -> str: + r""" + @brief Convert to a string + """ + @overload + def transformed(self, t: CplxTrans) -> DPath: + r""" + @brief Transform the path. + + Transforms the path with the given complex transformation. + Does not modify the path but returns the transformed path. + + @param t The transformation to apply. + + @return The transformed path. + """ + @overload + def transformed(self, t: ICplxTrans) -> Path: + r""" + @brief Transform the path. + + Transforms the path with the given complex transformation. + Does not modify the path but returns the transformed path. + + @param t The transformation to apply. + + @return The transformed path (in this case an integer coordinate path). + + This method has been introduced in version 0.18. + """ + @overload + def transformed(self, t: Trans) -> Path: + r""" + @brief Transform the path. + + Transforms the path with the given transformation. + Does not modify the path but returns the transformed path. + + @param t The transformation to apply. + + @return The transformed path. + """ + def transformed_cplx(self, t: CplxTrans) -> DPath: + r""" + @brief Transform the path. + + Transforms the path with the given complex transformation. + Does not modify the path but returns the transformed path. + + @param t The transformation to apply. + + @return The transformed path. + """ + +class DPath: + r""" + @brief A path class + + A path consists of an sequence of line segments forming the 'spine' of the path and a width. In addition, the starting point can be drawn back by a certain extent (the 'begin extension') and the end point can be pulled forward somewhat (by the 'end extension'). + + A path may have round ends for special purposes. In particular, a round-ended path with a single point can represent a circle. Round-ended paths should have being and end extensions equal to half the width. Non-round-ended paths with a single point are allowed but the definition of the resulting shape in not well defined and may differ in other tools. + + See @The Database API@ for more details about the database objects. + """ + bgn_ext: float + r""" + Getter: + @brief Get the begin extension + + Setter: + @brief Set the begin extension + """ + end_ext: float + r""" + Getter: + @brief Get the end extension + + Setter: + @brief Set the end extension + """ + points: int + r""" + Getter: + @brief Get the number of points + Setter: + @brief Set the points of the path + @param p An array of points to assign to the path's spine + """ + round: bool + r""" + Getter: + @brief Returns true, if the path has round ends + + Setter: + @brief Set the 'round ends' flag + A path with round ends show half circles at the ends, instead of square or rectangular ends. Paths with this flag set should use a begin and end extension of half the width (see \bgn_ext and \end_ext). The interpretation of such paths in other tools may differ otherwise. + """ + width: float + r""" + Getter: + @brief Get the width + + Setter: + @brief Set the width + """ + @classmethod + def from_ipath(cls, path: Path) -> DPath: + r""" + @brief Creates a floating-point coordinate path from an integer coordinate path + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipath'. + """ + @classmethod + def from_s(cls, s: str) -> DPath: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> DPath: + r""" + @brief Default constructor: creates an empty (invalid) path with width 0 + """ + @overload + @classmethod + def new(cls, path: Path) -> DPath: + r""" + @brief Creates a floating-point coordinate path from an integer coordinate path + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipath'. + """ + @overload + @classmethod + def new(cls, pts: Sequence[DPoint], width: float) -> DPath: + r""" + @brief Constructor given the points of the path's spine and the width + + + @param pts The points forming the spine of the path + @param width The width of the path + """ + @overload + @classmethod + def new(cls, pts: Sequence[DPoint], width: float, bgn_ext: float, end_ext: float) -> DPath: + r""" + @brief Constructor given the points of the path's spine, the width and the extensions + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + """ + @overload + @classmethod + def new(cls, pts: Sequence[DPoint], width: float, bgn_ext: float, end_ext: float, round: bool) -> DPath: + r""" + @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + @param round If this flag is true, the path will get rounded ends + """ + @classmethod + def new_pw(cls, pts: Sequence[DPoint], width: float) -> DPath: + r""" + @brief Constructor given the points of the path's spine and the width + + + @param pts The points forming the spine of the path + @param width The width of the path + """ + @classmethod + def new_pwx(cls, pts: Sequence[DPoint], width: float, bgn_ext: float, end_ext: float) -> DPath: + r""" + @brief Constructor given the points of the path's spine, the width and the extensions + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + """ + @classmethod + def new_pwxr(cls, pts: Sequence[DPoint], width: float, bgn_ext: float, end_ext: float, round: bool) -> DPath: + r""" + @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + @param round If this flag is true, the path will get rounded ends + """ + def __copy__(self) -> DPath: + r""" + @brief Creates a copy of self + """ + def __eq__(self, p: object) -> bool: + r""" + @brief Equality test + @param p The object to compare against + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor: creates an empty (invalid) path with width 0 + """ + @overload + def __init__(self, path: Path) -> None: + r""" + @brief Creates a floating-point coordinate path from an integer coordinate path + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipath'. + """ + @overload + def __init__(self, pts: Sequence[DPoint], width: float) -> None: + r""" + @brief Constructor given the points of the path's spine and the width + + + @param pts The points forming the spine of the path + @param width The width of the path + """ + @overload + def __init__(self, pts: Sequence[DPoint], width: float, bgn_ext: float, end_ext: float) -> None: + r""" + @brief Constructor given the points of the path's spine, the width and the extensions + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + """ + @overload + def __init__(self, pts: Sequence[DPoint], width: float, bgn_ext: float, end_ext: float, round: bool) -> None: + r""" + @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + @param round If this flag is true, the path will get rounded ends + """ + def __lt__(self, p: DPath) -> bool: + r""" + @brief Less operator + @param p The object to compare against + This operator is provided to establish some, not necessarily a certain sorting order + """ + def __mul__(self, f: float) -> DPath: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __ne__(self, p: object) -> bool: + r""" + @brief Inequality test + @param p The object to compare against + """ + def __rmul__(self, f: float) -> DPath: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __str__(self) -> str: + r""" + @brief Convert to a string + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def area(self) -> float: + r""" + @brief Returns the approximate area of the path + This method returns the approximate value of the area. It is computed from the length times the width. end extensions are taken into account correctly, but not effects of the corner interpolation. + This method was added in version 0.22. + """ + def assign(self, other: DPath) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> DBox: + r""" + @brief Returns the bounding box of the path + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> DPath: + r""" + @brief Creates a copy of self + """ + def each_point(self) -> Iterator[DPoint]: + r""" + @brief Get the points that make up the path's spine + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_round(self) -> bool: + r""" + @brief Returns true, if the path has round ends + """ + def length(self) -> float: + r""" + @brief Returns the length of the path + the length of the path is determined by summing the lengths of the segments and adding begin and end extensions. For round-ended paths the length of the paths between the tips of the ends. + + This method was added in version 0.23. + """ + @overload + def move(self, p: DVector) -> DPath: + r""" + @brief Moves the path. + + Moves the path by the given offset and returns the + moved path. The path is overwritten. + + @param p The distance to move the path. + + @return The moved path. + """ + @overload + def move(self, dx: float, dy: float) -> DPath: + r""" + @brief Moves the path. + + Moves the path by the given offset and returns the + moved path. The path is overwritten. + + @param dx The x distance to move the path. + @param dy The y distance to move the path. + + @return The moved path. + + This version has been added in version 0.23. + """ + @overload + def moved(self, p: DVector) -> DPath: + r""" + @brief Returns the moved path (does not change self) + + Moves the path by the given offset and returns the + moved path. The path is not modified. + + @param p The distance to move the path. + + @return The moved path. + """ + @overload + def moved(self, dx: float, dy: float) -> DPath: + r""" + @brief Returns the moved path (does not change self) + + Moves the path by the given offset and returns the + moved path. The path is not modified. + + @param dx The x distance to move the path. + @param dy The y distance to move the path. + + @return The moved path. + + This version has been added in version 0.23. + """ + def num_points(self) -> int: + r""" + @brief Get the number of points + """ + def perimeter(self) -> float: + r""" + @brief Returns the approximate perimeter of the path + This method returns the approximate value of the perimeter. It is computed from the length and the width. end extensions are taken into account correctly, but not effects of the corner interpolation. + This method was added in version 0.24.4. + """ + def polygon(self) -> DPolygon: + r""" + @brief Convert the path to a polygon + The returned polygon is not guaranteed to be non-self overlapping. This may happen if the path overlaps itself or contains very short segments. + """ + def round_corners(self, radius: float, npoints: int, accuracy: float) -> DPath: + r""" + @brief Creates a new path whose corners are interpolated with circular bends + + @param radius The radius of the bends + @param npoints The number of points (per full circle) used for interpolating the bends + @param accuracy The numerical accuracy of the computation + + The accuracy parameter controls the numerical resolution of the approximation process and should be in the order of half the database unit. This accuracy is used for suppressing redundant points and simplification of the resulting path. + + This method has been introduced in version 0.25. + """ + def simple_polygon(self) -> DSimplePolygon: + r""" + @brief Convert the path to a simple polygon + The returned polygon is not guaranteed to be non-selfoverlapping. This may happen if the path overlaps itself or contains very short segments. + """ + def to_itype(self, dbu: Optional[float] = ...) -> Path: + r""" + @brief Converts the path to an integer coordinate path + + The database unit can be specified to translate the floating-point coordinate path in micron units to an integer-coordinate path in database units. The path's' coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self) -> str: + r""" + @brief Convert to a string + """ + @overload + def transformed(self, t: DCplxTrans) -> DPath: + r""" + @brief Transform the path. + + Transforms the path with the given complex transformation. + Does not modify the path but returns the transformed path. + + @param t The transformation to apply. + + @return The transformed path. + """ + @overload + def transformed(self, t: DTrans) -> DPath: + r""" + @brief Transform the path. + + Transforms the path with the given transformation. + Does not modify the path but returns the transformed path. + + @param t The transformation to apply. + + @return The transformed path. + """ + @overload + def transformed(self, t: VCplxTrans) -> Path: + r""" + @brief Transforms the polygon with the given complex transformation + + + @param t The magnifying transformation to apply + @return The transformed path (in this case an integer coordinate path) + + This method has been introduced in version 0.25. + """ + def transformed_cplx(self, t: DCplxTrans) -> DPath: + r""" + @brief Transform the path. + + Transforms the path with the given complex transformation. + Does not modify the path but returns the transformed path. + + @param t The transformation to apply. + + @return The transformed path. + """ + +class DPoint: + r""" + @brief A point class with double (floating-point) coordinates + Points represent a coordinate in the two-dimensional coordinate space of layout. They are not geometrical objects by itself. But they are frequently used in the database API for various purposes. Other than the integer variant (\Point), points with floating-point coordinates can represent fractions of a database unit. + + See @The Database API@ for more details about the database objects. + """ + x: float + r""" + Getter: + @brief Accessor to the x coordinate + + Setter: + @brief Write accessor to the x coordinate + """ + y: float + r""" + Getter: + @brief Accessor to the y coordinate + + Setter: + @brief Write accessor to the y coordinate + """ + @classmethod + def from_ipoint(cls, point: Point) -> DPoint: + r""" + @brief Creates a floating-point coordinate point from an integer coordinate point + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipoint'. + """ + @classmethod + def from_s(cls, s: str) -> DPoint: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> DPoint: + r""" + @brief Default constructor: creates a point at 0,0 + """ + @overload + @classmethod + def new(cls, point: Point) -> DPoint: + r""" + @brief Creates a floating-point coordinate point from an integer coordinate point + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipoint'. + """ + @overload + @classmethod + def new(cls, v: DVector) -> DPoint: + r""" + @brief Default constructor: creates a point at from an vector + This constructor is equivalent to computing point(0,0)+v. + This method has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, x: float, y: float) -> DPoint: + r""" + @brief Constructor for a point from two coordinate values + + """ + def __add__(self, v: DVector) -> DPoint: + r""" + @brief Adds a vector to a point + + + Adds vector v to self by adding the coordinates. + + Starting with version 0.25, this method expects a vector argument. + """ + def __copy__(self) -> DPoint: + r""" + @brief Creates a copy of self + """ + def __eq__(self, p: object) -> bool: + r""" + @brief Equality test operator + + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given point. This method enables points as hash keys. + + This method has been introduced in version 0.25. + """ + def __imul__(self, f: float) -> DPoint: + r""" + @brief Scaling by some factor + + + Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor: creates a point at 0,0 + """ + @overload + def __init__(self, point: Point) -> None: + r""" + @brief Creates a floating-point coordinate point from an integer coordinate point + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipoint'. + """ + @overload + def __init__(self, v: DVector) -> None: + r""" + @brief Default constructor: creates a point at from an vector + This constructor is equivalent to computing point(0,0)+v. + This method has been introduced in version 0.25. + """ + @overload + def __init__(self, x: float, y: float) -> None: + r""" + @brief Constructor for a point from two coordinate values + + """ + def __itruediv__(self, d: float) -> DPoint: + r""" + @brief Division by some divisor + + + Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded. + """ + def __lt__(self, p: DPoint) -> bool: + r""" + @brief "less" comparison operator + + + This operator is provided to establish a sorting + order + """ + def __mul__(self, f: float) -> DPoint: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __ne__(self, p: object) -> bool: + r""" + @brief Inequality test operator + + """ + def __neg__(self) -> DPoint: + r""" + @brief Compute the negative of a point + + + Returns a new point with -x, -y. + + This method has been added in version 0.23. + """ + def __rmul__(self, f: float) -> DPoint: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __str__(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion. + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + @overload + def __sub__(self, p: DPoint) -> DVector: + r""" + @brief Subtract one point from another + + + Subtract point p from self by subtracting the coordinates. This renders a vector. + + Starting with version 0.25, this method renders a vector. + """ + @overload + def __sub__(self, v: DVector) -> DPoint: + r""" + @brief Subtract one vector from a point + + + Subtract vector v from from self by subtracting the coordinates. This renders a point. + + This method has been added in version 0.27. + """ + def __truediv__(self, d: float) -> DPoint: + r""" + @brief Division by some divisor + + + Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def abs(self) -> float: + r""" + @brief The absolute value of the point (Euclidian distance to 0,0) + + The returned value is 'sqrt(x*x+y*y)'. + + This method has been introduced in version 0.23. + """ + def assign(self, other: DPoint) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def distance(self, d: DPoint) -> float: + r""" + @brief The Euclidian distance to another point + + + @param d The other point to compute the distance to. + """ + def dup(self) -> DPoint: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given point. This method enables points as hash keys. + + This method has been introduced in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def sq_abs(self) -> float: + r""" + @brief The square of the absolute value of the point (Euclidian distance to 0,0) + + The returned value is 'x*x+y*y'. + + This method has been introduced in version 0.23. + """ + def sq_distance(self, d: DPoint) -> float: + r""" + @brief The square Euclidian distance to another point + + + @param d The other point to compute the distance to. + """ + def to_itype(self, dbu: Optional[float] = ...) -> Point: + r""" + @brief Converts the point to an integer coordinate point + + The database unit can be specified to translate the floating-point coordinate point in micron units to an integer-coordinate point in database units. The point's' coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion. + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def to_v(self) -> DVector: + r""" + @brief Turns the point into a vector + This method returns a vector representing the distance from (0,0) to the point.This method has been introduced in version 0.25. + """ + +class Point: + r""" + @brief An integer point class + Points represent a coordinate in the two-dimensional coordinate space of layout. They are not geometrical objects by itself. But they are frequently used in the database API for various purposes. + + See @The Database API@ for more details about the database objects. + """ + x: int + r""" + Getter: + @brief Accessor to the x coordinate + + Setter: + @brief Write accessor to the x coordinate + """ + y: int + r""" + Getter: + @brief Accessor to the y coordinate + + Setter: + @brief Write accessor to the y coordinate + """ + @classmethod + def from_dpoint(cls, dpoint: DPoint) -> Point: + r""" + @brief Creates an integer coordinate point from a floating-point coordinate point + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoint'. + """ + @classmethod + def from_s(cls, s: str) -> Point: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> Point: + r""" + @brief Default constructor: creates a point at 0,0 + """ + @overload + @classmethod + def new(cls, dpoint: DPoint) -> Point: + r""" + @brief Creates an integer coordinate point from a floating-point coordinate point + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoint'. + """ + @overload + @classmethod + def new(cls, v: Vector) -> Point: + r""" + @brief Default constructor: creates a point at from an vector + This constructor is equivalent to computing point(0,0)+v. + This method has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, x: int, y: int) -> Point: + r""" + @brief Constructor for a point from two coordinate values + + """ + def __add__(self, v: Vector) -> Point: + r""" + @brief Adds a vector to a point + + + Adds vector v to self by adding the coordinates. + + Starting with version 0.25, this method expects a vector argument. + """ + def __copy__(self) -> Point: + r""" + @brief Creates a copy of self + """ + def __eq__(self, p: object) -> bool: + r""" + @brief Equality test operator + + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given point. This method enables points as hash keys. + + This method has been introduced in version 0.25. + """ + def __imul__(self, f: float) -> Point: + r""" + @brief Scaling by some factor + + + Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor: creates a point at 0,0 + """ + @overload + def __init__(self, dpoint: DPoint) -> None: + r""" + @brief Creates an integer coordinate point from a floating-point coordinate point + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoint'. + """ + @overload + def __init__(self, v: Vector) -> None: + r""" + @brief Default constructor: creates a point at from an vector + This constructor is equivalent to computing point(0,0)+v. + This method has been introduced in version 0.25. + """ + @overload + def __init__(self, x: int, y: int) -> None: + r""" + @brief Constructor for a point from two coordinate values + + """ + def __itruediv__(self, d: float) -> Point: + r""" + @brief Division by some divisor + + + Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded. + """ + def __lt__(self, p: Point) -> bool: + r""" + @brief "less" comparison operator + + + This operator is provided to establish a sorting + order + """ + def __mul__(self, f: float) -> Point: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __ne__(self, p: object) -> bool: + r""" + @brief Inequality test operator + + """ + def __neg__(self) -> Point: + r""" + @brief Compute the negative of a point + + + Returns a new point with -x, -y. + + This method has been added in version 0.23. + """ + def __rmul__(self, f: float) -> Point: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __str__(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion. + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + @overload + def __sub__(self, p: Point) -> Vector: + r""" + @brief Subtract one point from another + + + Subtract point p from self by subtracting the coordinates. This renders a vector. + + Starting with version 0.25, this method renders a vector. + """ + @overload + def __sub__(self, v: Vector) -> Point: + r""" + @brief Subtract one vector from a point + + + Subtract vector v from from self by subtracting the coordinates. This renders a point. + + This method has been added in version 0.27. + """ + def __truediv__(self, d: float) -> Point: + r""" + @brief Division by some divisor + + + Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def abs(self) -> float: + r""" + @brief The absolute value of the point (Euclidian distance to 0,0) + + The returned value is 'sqrt(x*x+y*y)'. + + This method has been introduced in version 0.23. + """ + def assign(self, other: Point) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def distance(self, d: Point) -> float: + r""" + @brief The Euclidian distance to another point + + + @param d The other point to compute the distance to. + """ + def dup(self) -> Point: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given point. This method enables points as hash keys. + + This method has been introduced in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def sq_abs(self) -> float: + r""" + @brief The square of the absolute value of the point (Euclidian distance to 0,0) + + The returned value is 'x*x+y*y'. + + This method has been introduced in version 0.23. + """ + def sq_distance(self, d: Point) -> float: + r""" + @brief The square Euclidian distance to another point + + + @param d The other point to compute the distance to. + """ + def to_dtype(self, dbu: Optional[float] = ...) -> DPoint: + r""" + @brief Converts the point to a floating-point coordinate point + + The database unit can be specified to translate the integer-coordinate point into a floating-point coordinate point in micron units. The database unit is basically a scaling factor. + + This method has been introduced in version 0.25. + """ + def to_s(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion. + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def to_v(self) -> Vector: + r""" + @brief Turns the point into a vector + This method returns a vector representing the distance from (0,0) to the point.This method has been introduced in version 0.25. + """ + +class SimplePolygon: + r""" + @brief A simple polygon class + + A simple polygon consists of an outer hull only. To support polygons with holes, use \Polygon. + The hull contour consists of several points. The point + list is normalized such that the leftmost, lowest point is + the first one. The orientation is normalized such that + the orientation of the hull contour is clockwise. + + It is in no way checked that the contours are not overlapping + This must be ensured by the user of the object + when filling the contours. + + The \SimplePolygon class stores coordinates in integer format. A class that stores floating-point coordinates is \DSimplePolygon. + + See @The Database API@ for more details about the database objects. + """ + @property + def points(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the points of the simple polygon + + @param pts An array of points to assign to the simple polygon + + See the constructor description for details about raw mode. + """ + @classmethod + def ellipse(cls, box: Box, n: int) -> SimplePolygon: + r""" + @brief Creates a simple polygon approximating an ellipse + + @param box The bounding box of the ellipse + @param n The number of points that will be used to approximate the ellipse + + This method has been introduced in version 0.23. + """ + @classmethod + def from_dpoly(cls, dpolygon: DSimplePolygon) -> SimplePolygon: + r""" + @brief Creates an integer coordinate polygon from a floating-point coordinate polygon + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoly'. + """ + @classmethod + def from_s(cls, s: str) -> SimplePolygon: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> SimplePolygon: + r""" + @brief Default constructor: creates an empty (invalid) polygon + """ + @overload + @classmethod + def new(cls, box: Box) -> SimplePolygon: + r""" + @brief Constructor converting a box to a polygon + + @param box The box to convert to a polygon + """ + @overload + @classmethod + def new(cls, dpolygon: DSimplePolygon) -> SimplePolygon: + r""" + @brief Creates an integer coordinate polygon from a floating-point coordinate polygon + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoly'. + """ + @overload + @classmethod + def new(cls, pts: Sequence[Point], raw: Optional[bool] = ...) -> SimplePolygon: + r""" + @brief Constructor given the points of the simple polygon + + @param pts The points forming the simple polygon + @param raw If true, the points are taken as they are (see below) + + If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. + + Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. + + The 'raw' argument has been added in version 0.24. + """ + def __copy__(self) -> SimplePolygon: + r""" + @brief Creates a copy of self + """ + def __eq__(self, p: object) -> bool: + r""" + @brief Returns a value indicating whether self is equal to p + @param p The object to compare against + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor: creates an empty (invalid) polygon + """ + @overload + def __init__(self, box: Box) -> None: + r""" + @brief Constructor converting a box to a polygon + + @param box The box to convert to a polygon + """ + @overload + def __init__(self, dpolygon: DSimplePolygon) -> None: + r""" + @brief Creates an integer coordinate polygon from a floating-point coordinate polygon + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoly'. + """ + @overload + def __init__(self, pts: Sequence[Point], raw: Optional[bool] = ...) -> None: + r""" + @brief Constructor given the points of the simple polygon + + @param pts The points forming the simple polygon + @param raw If true, the points are taken as they are (see below) + + If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. + + Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. + + The 'raw' argument has been added in version 0.24. + """ + def __lt__(self, p: SimplePolygon) -> bool: + r""" + @brief Returns a value indicating whether self is less than p + @param p The object to compare against + This operator is provided to establish some, not necessarily a certain sorting order + + This method has been introduced in version 0.25. + """ + def __mul__(self, f: float) -> SimplePolygon: + r""" + @brief Scales the polygon by some factor + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __ne__(self, p: object) -> bool: + r""" + @brief Returns a value indicating whether self is not equal to p + @param p The object to compare against + """ + def __rmul__(self, f: float) -> SimplePolygon: + r""" + @brief Scales the polygon by some factor + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __str__(self) -> str: + r""" + @brief Returns a string representing the polygon + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def area(self) -> int: + r""" + @brief Gets the area of the polygon + The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise. + """ + def area2(self) -> int: + r""" + @brief Gets the double area of the polygon + This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types. + + This method has been introduced in version 0.26.1 + """ + def assign(self, other: SimplePolygon) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> Box: + r""" + @brief Returns the bounding box of the simple polygon + """ + def compress(self, remove_reflected: bool) -> None: + r""" + @brief Compressed the simple polygon. + + This method removes redundant points from the polygon, such as points being on a line formed by two other points. + If remove_reflected is true, points are also removed if the two adjacent edges form a spike. + + @param remove_reflected See description of the functionality. + + This method was introduced in version 0.18. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> SimplePolygon: + r""" + @brief Creates a copy of self + """ + def each_edge(self) -> Iterator[Edge]: + r""" + @brief Iterates over the edges that make up the simple polygon + """ + def each_point(self) -> Iterator[Point]: + r""" + @brief Iterates over the points that make up the simple polygon + """ + def extract_rad(self) -> List[Any]: + r""" + @brief Extracts the corner radii from a rounded polygon + + Attempts to extract the radii of rounded corner polygon. This is essentially the inverse of the \round_corners method. If this method succeeds, if will return an array of four elements: @ul + @li The polygon with the rounded corners replaced by edgy ones @/li + @li The radius of the inner corners @/li + @li The radius of the outer corners @/li + @li The number of points per full circle @/li + @/ul + + This method is based on some assumptions and may fail. In this case, an empty array is returned. + + If successful, the following code will more or less render the original polygon and parameters + + @code + p = ... # some polygon + p.round_corners(ri, ro, n) + (p2, ri2, ro2, n2) = p.extract_rad + # -> p2 == p, ro2 == ro, ri2 == ri, n2 == n (within some limits) + @/code + + This method was introduced in version 0.25. + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + def inside(self, p: Point) -> bool: + r""" + @brief Gets a value indicating whether the given point is inside the polygon + If the given point is inside or on the edge the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise. + """ + def is_box(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is a simple box. + + A polygon is a box if it is identical to it's bounding box. + + @return True if the polygon is a box. + + This method was introduced in version 0.23. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_empty(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is empty + """ + def is_halfmanhattan(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is half-manhattan + Half-manhattan polygons have edges which are multiples of 45 degree. These polygons can be clipped at a rectangle without potential grid snapping. + + This predicate was introduced in version 0.27. + """ + def is_rectilinear(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is rectilinear + """ + @overload + def minkowski_sum(self, b: Box, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and a box + + @param b The box. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and b. + + This method was introduced in version 0.22. + """ + @overload + def minkowski_sum(self, c: Sequence[Point], resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and a contour of points (a trace) + + @param c The contour (a series of points forming the trace). + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and c. + + This method was introduced in version 0.22. + """ + @overload + def minkowski_sum(self, e: Edge, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and an edge + + @param e The edge. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and e. + + This method was introduced in version 0.22. + """ + @overload + def minkowski_sum(self, p: SimplePolygon, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and a polygon + + @param p The other polygon. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and p. + + This method was introduced in version 0.22. + """ + @overload + def minkowsky_sum(self, b: Box, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and a box + + @param b The box. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and b. + + This method was introduced in version 0.22. + """ + @overload + def minkowsky_sum(self, c: Sequence[Point], resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and a contour of points (a trace) + + @param c The contour (a series of points forming the trace). + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and c. + + This method was introduced in version 0.22. + """ + @overload + def minkowsky_sum(self, e: Edge, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and an edge + + @param e The edge. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and e. + + This method was introduced in version 0.22. + """ + @overload + def minkowsky_sum(self, p: SimplePolygon, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and a polygon + + @param p The other polygon. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and p. + + This method was introduced in version 0.22. + """ + @overload + def move(self, p: Vector) -> SimplePolygon: + r""" + @brief Moves the simple polygon. + + Moves the simple polygon by the given offset and returns the + moved simple polygon. The polygon is overwritten. + + @param p The distance to move the simple polygon. + + @return The moved simple polygon. + """ + @overload + def move(self, x: int, y: int) -> SimplePolygon: + r""" + @brief Moves the polygon. + + Moves the polygon by the given offset and returns the + moved polygon. The polygon is overwritten. + + @param x The x distance to move the polygon. + @param y The y distance to move the polygon. + + @return The moved polygon (self). + """ + @overload + def moved(self, p: Vector) -> SimplePolygon: + r""" + @brief Returns the moved simple polygon + + Moves the simple polygon by the given offset and returns the + moved simple polygon. The polygon is not modified. + + @param p The distance to move the simple polygon. + + @return The moved simple polygon. + """ + @overload + def moved(self, x: int, y: int) -> SimplePolygon: + r""" + @brief Returns the moved polygon (does not modify self) + + Moves the polygon by the given offset and returns the + moved polygon. The polygon is not modified. + + @param x The x distance to move the polygon. + @param y The y distance to move the polygon. + + @return The moved polygon. + + This method has been introduced in version 0.23. + """ + def num_points(self) -> int: + r""" + @brief Gets the number of points + """ + def perimeter(self) -> int: + r""" + @brief Gets the perimeter of the polygon + The perimeter is sum of the lengths of all edges making up the polygon. + """ + def point(self, p: int) -> Point: + r""" + @brief Gets a specific point of the contour@param p The index of the point to get + If the index of the point is not a valid index, a default value is returned. + This method was introduced in version 0.18. + """ + def round_corners(self, rinner: float, router: float, n: int) -> SimplePolygon: + r""" + @brief Rounds the corners of the polygon + + Replaces the corners of the polygon with circle segments. + + @param rinner The circle radius of inner corners (in database units). + @param router The circle radius of outer corners (in database units). + @param n The number of points per full circle. + + @return The new polygon. + + This method was introduced in version 0.22 for integer coordinates and in 0.25 for all coordinate types. + """ + def set_points(self, pts: Sequence[Point], raw: Optional[bool] = ...) -> None: + r""" + @brief Sets the points of the simple polygon + + @param pts An array of points to assign to the simple polygon + @param raw If true, the points are taken as they are + + See the constructor description for details about raw mode. + + This method has been added in version 0.24. + """ + def split(self) -> List[SimplePolygon]: + r""" + @brief Splits the polygon into two or more parts + This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. + + The intended use for this method is a iteratively split polygons until the satisfy some maximum number of points limit. + + This method has been introduced in version 0.25.3. + """ + def to_dtype(self, dbu: Optional[float] = ...) -> DSimplePolygon: + r""" + @brief Converts the polygon to a floating-point coordinate polygon + + The database unit can be specified to translate the integer-coordinate polygon into a floating-point coordinate polygon in micron units. The database unit is basically a scaling factor. + + This method has been introduced in version 0.25. + """ + def to_s(self) -> str: + r""" + @brief Returns a string representing the polygon + """ + @overload + def touches(self, box: Box) -> bool: + r""" + @brief Returns true, if the polygon touches the given box. + The box and the polygon touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, edge: Edge) -> bool: + r""" + @brief Returns true, if the polygon touches the given edge. + The edge and the polygon touch if they overlap or the edge shares at least one point with the polygon's contour. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, polygon: Polygon) -> bool: + r""" + @brief Returns true, if the polygon touches the other polygon. + The polygons touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, simple_polygon: SimplePolygon) -> bool: + r""" + @brief Returns true, if the polygon touches the other polygon. + The polygons touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def transform(self, t: ICplxTrans) -> SimplePolygon: + r""" + @brief Transforms the simple polygon with a complex transformation (in-place) + + Transforms the simple polygon with the given complex transformation. + Modifies self and returns self. An out-of-place version which does not modify self is \transformed. + + @param t The transformation to apply. + + This method has been introduced in version 0.24. + """ + @overload + def transform(self, t: Trans) -> SimplePolygon: + r""" + @brief Transforms the simple polygon (in-place) + + Transforms the simple polygon with the given transformation. + Modifies self and returns self. An out-of-place version which does not modify self is \transformed. + + @param t The transformation to apply. + + This method has been introduced in version 0.24. + """ + @overload + def transformed(self, t: CplxTrans) -> DSimplePolygon: + r""" + @brief Transforms the simple polygon. + + Transforms the simple polygon with the given complex transformation. + Does not modify the simple polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed simple polygon. + + With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. + """ + @overload + def transformed(self, t: ICplxTrans) -> SimplePolygon: + r""" + @brief Transforms the simple polygon. + + Transforms the simple polygon with the given complex transformation. + Does not modify the simple polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed simple polygon (in this case an integer coordinate object). + + This method has been introduced in version 0.18. + """ + @overload + def transformed(self, t: Trans) -> SimplePolygon: + r""" + @brief Transforms the simple polygon. + + Transforms the simple polygon with the given transformation. + Does not modify the simple polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed simple polygon. + """ + def transformed_cplx(self, t: CplxTrans) -> DSimplePolygon: + r""" + @brief Transforms the simple polygon. + + Transforms the simple polygon with the given complex transformation. + Does not modify the simple polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed simple polygon. + + With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. + """ + +class DSimplePolygon: + r""" + @brief A simple polygon class + + A simple polygon consists of an outer hull only. To support polygons with holes, use \DPolygon. + The contour consists of several points. The point + list is normalized such that the leftmost, lowest point is + the first one. The orientation is normalized such that + the orientation of the hull contour is clockwise. + + It is in no way checked that the contours are not over- + lapping. This must be ensured by the user of the object + when filling the contours. + + The \DSimplePolygon class stores coordinates in floating-point format which gives a higher precision for some operations. A class that stores integer coordinates is \SimplePolygon. + + See @The Database API@ for more details about the database objects. + """ + @property + def points(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the points of the simple polygon + + @param pts An array of points to assign to the simple polygon + + See the constructor description for details about raw mode. + """ + @classmethod + def ellipse(cls, box: DBox, n: int) -> DSimplePolygon: + r""" + @brief Creates a simple polygon approximating an ellipse + + @param box The bounding box of the ellipse + @param n The number of points that will be used to approximate the ellipse + + This method has been introduced in version 0.23. + """ + @classmethod + def from_ipoly(cls, polygon: SimplePolygon) -> DSimplePolygon: + r""" + @brief Creates a floating-point coordinate polygon from an integer coordinate polygon + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipoly'. + """ + @classmethod + def from_s(cls, s: str) -> DSimplePolygon: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> DSimplePolygon: + r""" + @brief Default constructor: creates an empty (invalid) polygon + """ + @overload + @classmethod + def new(cls, box: DBox) -> DSimplePolygon: + r""" + @brief Constructor converting a box to a polygon + + @param box The box to convert to a polygon + """ + @overload + @classmethod + def new(cls, polygon: SimplePolygon) -> DSimplePolygon: + r""" + @brief Creates a floating-point coordinate polygon from an integer coordinate polygon + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipoly'. + """ + @overload + @classmethod + def new(cls, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> DSimplePolygon: + r""" + @brief Constructor given the points of the simple polygon + + @param pts The points forming the simple polygon + @param raw If true, the points are taken as they are (see below) + + If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. + + Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. + + The 'raw' argument has been added in version 0.24. + """ + def __copy__(self) -> DSimplePolygon: + r""" + @brief Creates a copy of self + """ + def __eq__(self, p: object) -> bool: + r""" + @brief Returns a value indicating whether self is equal to p + @param p The object to compare against + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor: creates an empty (invalid) polygon + """ + @overload + def __init__(self, box: DBox) -> None: + r""" + @brief Constructor converting a box to a polygon + + @param box The box to convert to a polygon + """ + @overload + def __init__(self, polygon: SimplePolygon) -> None: + r""" + @brief Creates a floating-point coordinate polygon from an integer coordinate polygon + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipoly'. + """ + @overload + def __init__(self, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> None: + r""" + @brief Constructor given the points of the simple polygon + + @param pts The points forming the simple polygon + @param raw If true, the points are taken as they are (see below) + + If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. + + Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. + + The 'raw' argument has been added in version 0.24. + """ + def __lt__(self, p: DSimplePolygon) -> bool: + r""" + @brief Returns a value indicating whether self is less than p + @param p The object to compare against + This operator is provided to establish some, not necessarily a certain sorting order + + This method has been introduced in version 0.25. + """ + def __mul__(self, f: float) -> DSimplePolygon: + r""" + @brief Scales the polygon by some factor + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __ne__(self, p: object) -> bool: + r""" + @brief Returns a value indicating whether self is not equal to p + @param p The object to compare against + """ + def __rmul__(self, f: float) -> DSimplePolygon: + r""" + @brief Scales the polygon by some factor + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __str__(self) -> str: + r""" + @brief Returns a string representing the polygon + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def area(self) -> float: + r""" + @brief Gets the area of the polygon + The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise. + """ + def area2(self) -> float: + r""" + @brief Gets the double area of the polygon + This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types. + + This method has been introduced in version 0.26.1 + """ + def assign(self, other: DSimplePolygon) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> DBox: + r""" + @brief Returns the bounding box of the simple polygon + """ + def compress(self, remove_reflected: bool) -> None: + r""" + @brief Compressed the simple polygon. + + This method removes redundant points from the polygon, such as points being on a line formed by two other points. + If remove_reflected is true, points are also removed if the two adjacent edges form a spike. + + @param remove_reflected See description of the functionality. + + This method was introduced in version 0.18. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> DSimplePolygon: + r""" + @brief Creates a copy of self + """ + def each_edge(self) -> Iterator[DEdge]: + r""" + @brief Iterates over the edges that make up the simple polygon + """ + def each_point(self) -> Iterator[DPoint]: + r""" + @brief Iterates over the points that make up the simple polygon + """ + def extract_rad(self) -> List[Any]: + r""" + @brief Extracts the corner radii from a rounded polygon + + Attempts to extract the radii of rounded corner polygon. This is essentially the inverse of the \round_corners method. If this method succeeds, if will return an array of four elements: @ul + @li The polygon with the rounded corners replaced by edgy ones @/li + @li The radius of the inner corners @/li + @li The radius of the outer corners @/li + @li The number of points per full circle @/li + @/ul + + This method is based on some assumptions and may fail. In this case, an empty array is returned. + + If successful, the following code will more or less render the original polygon and parameters + + @code + p = ... # some polygon + p.round_corners(ri, ro, n) + (p2, ri2, ro2, n2) = p.extract_rad + # -> p2 == p, ro2 == ro, ri2 == ri, n2 == n (within some limits) + @/code + + This method was introduced in version 0.25. + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + def inside(self, p: DPoint) -> bool: + r""" + @brief Gets a value indicating whether the given point is inside the polygon + If the given point is inside or on the edge the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise. + """ + def is_box(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is a simple box. + + A polygon is a box if it is identical to it's bounding box. + + @return True if the polygon is a box. + + This method was introduced in version 0.23. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_empty(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is empty + """ + def is_halfmanhattan(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is half-manhattan + Half-manhattan polygons have edges which are multiples of 45 degree. These polygons can be clipped at a rectangle without potential grid snapping. + + This predicate was introduced in version 0.27. + """ + def is_rectilinear(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is rectilinear + """ + @overload + def move(self, p: DVector) -> DSimplePolygon: + r""" + @brief Moves the simple polygon. + + Moves the simple polygon by the given offset and returns the + moved simple polygon. The polygon is overwritten. + + @param p The distance to move the simple polygon. + + @return The moved simple polygon. + """ + @overload + def move(self, x: float, y: float) -> DSimplePolygon: + r""" + @brief Moves the polygon. + + Moves the polygon by the given offset and returns the + moved polygon. The polygon is overwritten. + + @param x The x distance to move the polygon. + @param y The y distance to move the polygon. + + @return The moved polygon (self). + """ + @overload + def moved(self, p: DVector) -> DSimplePolygon: + r""" + @brief Returns the moved simple polygon + + Moves the simple polygon by the given offset and returns the + moved simple polygon. The polygon is not modified. + + @param p The distance to move the simple polygon. + + @return The moved simple polygon. + """ + @overload + def moved(self, x: float, y: float) -> DSimplePolygon: + r""" + @brief Returns the moved polygon (does not modify self) + + Moves the polygon by the given offset and returns the + moved polygon. The polygon is not modified. + + @param x The x distance to move the polygon. + @param y The y distance to move the polygon. + + @return The moved polygon. + + This method has been introduced in version 0.23. + """ + def num_points(self) -> int: + r""" + @brief Gets the number of points + """ + def perimeter(self) -> float: + r""" + @brief Gets the perimeter of the polygon + The perimeter is sum of the lengths of all edges making up the polygon. + """ + def point(self, p: int) -> DPoint: + r""" + @brief Gets a specific point of the contour@param p The index of the point to get + If the index of the point is not a valid index, a default value is returned. + This method was introduced in version 0.18. + """ + def round_corners(self, rinner: float, router: float, n: int) -> DSimplePolygon: + r""" + @brief Rounds the corners of the polygon + + Replaces the corners of the polygon with circle segments. + + @param rinner The circle radius of inner corners (in database units). + @param router The circle radius of outer corners (in database units). + @param n The number of points per full circle. + + @return The new polygon. + + This method was introduced in version 0.22 for integer coordinates and in 0.25 for all coordinate types. + """ + def set_points(self, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> None: + r""" + @brief Sets the points of the simple polygon + + @param pts An array of points to assign to the simple polygon + @param raw If true, the points are taken as they are + + See the constructor description for details about raw mode. + + This method has been added in version 0.24. + """ + def split(self) -> List[DSimplePolygon]: + r""" + @brief Splits the polygon into two or more parts + This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. + + The intended use for this method is a iteratively split polygons until the satisfy some maximum number of points limit. + + This method has been introduced in version 0.25.3. + """ + def to_itype(self, dbu: Optional[float] = ...) -> SimplePolygon: + r""" + @brief Converts the polygon to an integer coordinate polygon + The database unit can be specified to translate the floating-point coordinate polygon in micron units to an integer-coordinate polygon in database units. The polygon's' coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self) -> str: + r""" + @brief Returns a string representing the polygon + """ + @overload + def touches(self, box: DBox) -> bool: + r""" + @brief Returns true, if the polygon touches the given box. + The box and the polygon touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, edge: DEdge) -> bool: + r""" + @brief Returns true, if the polygon touches the given edge. + The edge and the polygon touch if they overlap or the edge shares at least one point with the polygon's contour. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, polygon: DPolygon) -> bool: + r""" + @brief Returns true, if the polygon touches the other polygon. + The polygons touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, simple_polygon: DSimplePolygon) -> bool: + r""" + @brief Returns true, if the polygon touches the other polygon. + The polygons touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def transform(self, t: DCplxTrans) -> DSimplePolygon: + r""" + @brief Transforms the simple polygon with a complex transformation (in-place) + + Transforms the simple polygon with the given complex transformation. + Modifies self and returns self. An out-of-place version which does not modify self is \transformed. + + @param t The transformation to apply. + + This method has been introduced in version 0.24. + """ + @overload + def transform(self, t: DTrans) -> DSimplePolygon: + r""" + @brief Transforms the simple polygon (in-place) + + Transforms the simple polygon with the given transformation. + Modifies self and returns self. An out-of-place version which does not modify self is \transformed. + + @param t The transformation to apply. + + This method has been introduced in version 0.24. + """ + @overload + def transformed(self, t: DCplxTrans) -> DSimplePolygon: + r""" + @brief Transforms the simple polygon. + + Transforms the simple polygon with the given complex transformation. + Does not modify the simple polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed simple polygon. + + With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. + """ + @overload + def transformed(self, t: DTrans) -> DSimplePolygon: + r""" + @brief Transforms the simple polygon. + + Transforms the simple polygon with the given transformation. + Does not modify the simple polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed simple polygon. + """ + @overload + def transformed(self, t: VCplxTrans) -> SimplePolygon: + r""" + @brief Transforms the polygon with the given complex transformation + + @param t The magnifying transformation to apply + @return The transformed polygon (in this case an integer coordinate polygon) + + This method has been introduced in version 0.25. + """ + def transformed_cplx(self, t: DCplxTrans) -> DSimplePolygon: + r""" + @brief Transforms the simple polygon. + + Transforms the simple polygon with the given complex transformation. + Does not modify the simple polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed simple polygon. + + With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. + """ + +class Polygon: + r""" + @brief A polygon class + + A polygon consists of an outer hull and zero to many + holes. Each contour consists of several points. The point + list is normalized such that the leftmost, lowest point is + the first one. The orientation is normalized such that + the orientation of the hull contour is clockwise, while + the orientation of the holes is counterclockwise. + + It is in no way checked that the contours are not overlapping. + This must be ensured by the user of the object + when filling the contours. + + A polygon can be asked for the number of holes using the \holes method. \each_point_hull delivers the points of the hull contour. \each_point_hole delivers the points of a specific hole. \each_edge delivers the edges (point-to-point connections) of both hull and holes. \bbox delivers the bounding box, \area the area and \perimeter the perimeter of the polygon. + + Here's an example of how to create a polygon: + + @code + hull = [ RBA::Point::new(0, 0), RBA::Point::new(6000, 0), + RBA::Point::new(6000, 3000), RBA::Point::new(0, 3000) ] + hole1 = [ RBA::Point::new(1000, 1000), RBA::Point::new(2000, 1000), + RBA::Point::new(2000, 2000), RBA::Point::new(1000, 2000) ] + hole2 = [ RBA::Point::new(3000, 1000), RBA::Point::new(4000, 1000), + RBA::Point::new(4000, 2000), RBA::Point::new(3000, 2000) ] + poly = RBA::Polygon::new(hull) + poly.insert_hole(hole1) + poly.insert_hole(hole2) + + # ask the polygon for some properties + poly.holes # -> 2 + poly.area # -> 16000000 + poly.perimeter # -> 26000 + poly.bbox # -> (0,0;6000,3000) + @/code + + The \Polygon class stores coordinates in integer format. A class that stores floating-point coordinates is \DPolygon. + + See @The Database API@ for more details about the database objects. + """ + PO_any: ClassVar[int] + r""" + @brief A value for the preferred orientation parameter of \decompose_convex + This value indicates that there is not cut preference + This constant has been introduced in version 0.25. + """ + PO_horizontal: ClassVar[int] + r""" + @brief A value for the preferred orientation parameter of \decompose_convex + This value indicates that there only horizontal cuts are allowed + This constant has been introduced in version 0.25. + """ + PO_htrapezoids: ClassVar[int] + r""" + @brief A value for the preferred orientation parameter of \decompose_convex + This value indicates that cuts shall favor decomposition into horizontal trapezoids + This constant has been introduced in version 0.25. + """ + PO_vertical: ClassVar[int] + r""" + @brief A value for the preferred orientation parameter of \decompose_convex + This value indicates that there only vertical cuts are allowed + This constant has been introduced in version 0.25. + """ + PO_vtrapezoids: ClassVar[int] + r""" + @brief A value for the preferred orientation parameter of \decompose_convex + This value indicates that cuts shall favor decomposition into vertical trapezoids + This constant has been introduced in version 0.25. + """ + TD_htrapezoids: ClassVar[int] + r""" + @brief A value for the mode parameter of \decompose_trapezoids + This value indicates simple decomposition mode. This mode produces horizontal trapezoids and tries to minimize the number of trapezoids. + This constant has been introduced in version 0.25. + """ + TD_simple: ClassVar[int] + r""" + @brief A value for the mode parameter of \decompose_trapezoids + This value indicates simple decomposition mode. This mode is fast but does not make any attempts to produce less trapezoids. + This constant has been introduced in version 0.25. + """ + TD_vtrapezoids: ClassVar[int] + r""" + @brief A value for the mode parameter of \decompose_trapezoids + This value indicates simple decomposition mode. This mode produces vertical trapezoids and tries to minimize the number of trapezoids. + """ + @property + def hull(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the points of the hull of polygon + @param p An array of points to assign to the polygon's hull + The 'assign_hull' variant is provided in analogy to 'assign_hole'. + """ + @classmethod + def ellipse(cls, box: Box, n: int) -> Polygon: + r""" + @brief Creates a simple polygon approximating an ellipse + + @param box The bounding box of the ellipse + @param n The number of points that will be used to approximate the ellipse + + This method has been introduced in version 0.23. + """ + @classmethod + def from_dpoly(cls, dpolygon: DPolygon) -> Polygon: + r""" + @brief Creates an integer coordinate polygon from a floating-point coordinate polygon + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpolygon'. + """ + @classmethod + def from_s(cls, s: str) -> Polygon: + r""" + @brief Creates a polygon from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> Polygon: + r""" + @brief Creates an empty (invalid) polygon + """ + @overload + @classmethod + def new(cls, box: Box) -> Polygon: + r""" + @brief Creates a polygon from a box + + @param box The box to convert to a polygon + """ + @overload + @classmethod + def new(cls, dpolygon: DPolygon) -> Polygon: + r""" + @brief Creates an integer coordinate polygon from a floating-point coordinate polygon + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpolygon'. + """ + @overload + @classmethod + def new(cls, sp: SimplePolygon) -> Polygon: + r""" + @brief Creates a polygon from a simple polygon + @param sp The simple polygon that is converted into the polygon + This method was introduced in version 0.22. + """ + @overload + @classmethod + def new(cls, pts: Sequence[Point], raw: Optional[bool] = ...) -> Polygon: + r""" + @brief Creates a polygon from a point array for the hull + + @param pts The points forming the polygon hull + @param raw If true, the point list won't be modified (see \assign_hull) + + The 'raw' argument was added in version 0.24. + """ + def __copy__(self) -> Polygon: + r""" + @brief Creates a copy of self + """ + def __eq__(self, p: object) -> bool: + r""" + @brief Returns a value indicating whether the polygons are equal + @param p The object to compare against + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates an empty (invalid) polygon + """ + @overload + def __init__(self, box: Box) -> None: + r""" + @brief Creates a polygon from a box + + @param box The box to convert to a polygon + """ + @overload + def __init__(self, dpolygon: DPolygon) -> None: + r""" + @brief Creates an integer coordinate polygon from a floating-point coordinate polygon + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpolygon'. + """ + @overload + def __init__(self, sp: SimplePolygon) -> None: + r""" + @brief Creates a polygon from a simple polygon + @param sp The simple polygon that is converted into the polygon + This method was introduced in version 0.22. + """ + @overload + def __init__(self, pts: Sequence[Point], raw: Optional[bool] = ...) -> None: + r""" + @brief Creates a polygon from a point array for the hull + + @param pts The points forming the polygon hull + @param raw If true, the point list won't be modified (see \assign_hull) + + The 'raw' argument was added in version 0.24. + """ + def __lt__(self, p: Polygon) -> bool: + r""" + @brief Returns a value indicating whether self is less than p + @param p The object to compare against + This operator is provided to establish some, not necessarily a certain sorting order + """ + def __mul__(self, f: float) -> Polygon: + r""" + @brief Scales the polygon by some factor + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __ne__(self, p: object) -> bool: + r""" + @brief Returns a value indicating whether the polygons are not equal + @param p The object to compare against + """ + def __rmul__(self, f: float) -> Polygon: + r""" + @brief Scales the polygon by some factor + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __str__(self) -> str: + r""" + @brief Returns a string representing the polygon + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def area(self) -> int: + r""" + @brief Gets the area of the polygon + The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise.Orientation is ensured automatically in most cases. + """ + def area2(self) -> int: + r""" + @brief Gets the double area of the polygon + This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types. + + This method has been introduced in version 0.26.1 + """ + def assign(self, other: Polygon) -> None: + r""" + @brief Assigns another object to self + """ + @overload + def assign_hole(self, n: int, b: Box) -> None: + r""" + @brief Sets the box as the given hole of the polygon + @param n The index of the hole to which the points should be assigned + @param b The box to assign to the polygon's hole + If the hole index is not valid, this method does nothing. + This method was introduced in version 0.23. + """ + @overload + def assign_hole(self, n: int, p: Sequence[Point], raw: Optional[bool] = ...) -> None: + r""" + @brief Sets the points of the given hole of the polygon + @param n The index of the hole to which the points should be assigned + @param p An array of points to assign to the polygon's hole + @param raw If true, the points won't be compressed (see \assign_hull) + If the hole index is not valid, this method does nothing. + + This method was introduced in version 0.18. + The 'raw' argument was added in version 0.24. + """ + def assign_hull(self, p: Sequence[Point], raw: Optional[bool] = ...) -> None: + r""" + @brief Sets the points of the hull of polygon + @param p An array of points to assign to the polygon's hull + @param raw If true, the points won't be compressed + + If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. + + Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. + + The 'assign_hull' variant is provided in analogy to 'assign_hole'. + + The 'raw' argument was added in version 0.24. + """ + def bbox(self) -> Box: + r""" + @brief Returns the bounding box of the polygon + The bounding box is the box enclosing all points of the polygon. + """ + def compress(self, remove_reflected: bool) -> None: + r""" + @brief Compresses the polygon. + + This method removes redundant points from the polygon, such as points being on a line formed by two other points. + If remove_reflected is true, points are also removed if the two adjacent edges form a spike. + + @param remove_reflected See description of the functionality. + + This method was introduced in version 0.18. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def decompose_convex(self, preferred_orientation: Optional[int] = ...) -> List[SimplePolygon]: + r""" + @brief Decomposes the polygon into convex pieces + + This method returns a decomposition of the polygon that contains convex pieces only. + If the polygon was convex already, the list returned has a single element which is the + original polygon. + + @param preferred_orientation One of the PO_... constants + + This method was introduced in version 0.25. + """ + def decompose_trapezoids(self, mode: Optional[int] = ...) -> List[SimplePolygon]: + r""" + @brief Decomposes the polygon into trapezoids + + This method returns a decomposition of the polygon into trapezoid pieces. + It supports different modes for various applications. See the TD_... constants for details. + + @param mode One of the TD_... constants + + This method was introduced in version 0.25. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> Polygon: + r""" + @brief Creates a copy of self + """ + @overload + def each_edge(self) -> Iterator[Edge]: + r""" + @brief Iterates over the edges that make up the polygon + + This iterator will deliver all edges, including those of the holes. Hole edges are oriented counterclockwise while hull edges are oriented clockwise. + """ + @overload + def each_edge(self, contour: int) -> Iterator[Edge]: + r""" + @brief Iterates over the edges of one contour of the polygon + + @param contour The contour number (0 for hull, 1 for first hole ...) + + This iterator will deliver all edges of the contour specified by the contour parameter. The hull has contour number 0, the first hole has contour 1 etc. + Hole edges are oriented counterclockwise while hull edges are oriented clockwise. + + This method was introduced in version 0.24. + """ + def each_point_hole(self, n: int) -> Iterator[Point]: + r""" + @brief Iterates over the points that make up the nth hole + The hole number must be less than the number of holes (see \holes) + """ + def each_point_hull(self) -> Iterator[Point]: + r""" + @brief Iterates over the points that make up the hull + """ + def extract_rad(self) -> List[Any]: + r""" + @brief Extracts the corner radii from a rounded polygon + + Attempts to extract the radii of rounded corner polygon. This is essentially the inverse of the \round_corners method. If this method succeeds, if will return an array of four elements: @ul + @li The polygon with the rounded corners replaced by edgy ones @/li + @li The radius of the inner corners @/li + @li The radius of the outer corners @/li + @li The number of points per full circle @/li + @/ul + + This method is based on some assumptions and may fail. In this case, an empty array is returned. + + If successful, the following code will more or less render the original polygon and parameters + + @code + p = ... # some polygon + p.round_corners(ri, ro, n) + (p2, ri2, ro2, n2) = p.extract_rad + # -> p2 == p, ro2 == ro, ri2 == ri, n2 == n (within some limits) + @/code + + This method was introduced in version 0.25. + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + def holes(self) -> int: + r""" + @brief Returns the number of holes + """ + @overload + def insert_hole(self, b: Box) -> None: + r""" + @brief Inserts a hole from the given box + @param b The box to insert as a new hole + This method was introduced in version 0.23. + """ + @overload + def insert_hole(self, p: Sequence[Point], raw: Optional[bool] = ...) -> None: + r""" + @brief Inserts a hole with the given points + @param p An array of points to insert as a new hole + @param raw If true, the points won't be compressed (see \assign_hull) + + The 'raw' argument was added in version 0.24. + """ + def inside(self, p: Point) -> bool: + r""" + @brief Tests, if the given point is inside the polygon + If the given point is inside or on the edge of the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise. + """ + def is_box(self) -> bool: + r""" + @brief Returns true, if the polygon is a simple box. + + A polygon is a box if it is identical to it's bounding box. + + @return True if the polygon is a box. + + This method was introduced in version 0.23. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_convex(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is convex + + This method will return true, if the polygon is convex. + + This method was introduced in version 0.25. + """ + def is_empty(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is empty + """ + def is_halfmanhattan(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is half-manhattan + Half-manhattan polygons have edges which are multiples of 45 degree. These polygons can be clipped at a rectangle without potential grid snapping. + + This predicate was introduced in version 0.27. + """ + def is_rectilinear(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is rectilinear + """ + @overload + def minkowski_sum(self, b: Box, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of the polygon and a box + + @param b The box. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and the box. + + This method was introduced in version 0.22. + """ + @overload + def minkowski_sum(self, b: Polygon, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of the polygon and a polygon + + @param p The first argument. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and p. + + This method was introduced in version 0.22. + """ + @overload + def minkowski_sum(self, b: Sequence[Point], resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of the polygon and a contour of points (a trace) + + @param b The contour (a series of points forming the trace). + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and the contour. + + This method was introduced in version 0.22. + """ + @overload + def minkowski_sum(self, e: Edge, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of the polygon and an edge + + @param e The edge. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum with the edge e. + + The Minkowski sum of a polygon and an edge basically results in the area covered when "dragging" the polygon along the line given by the edge. The effect is similar to drawing the line with a pencil that has the shape of the given polygon. + + This method was introduced in version 0.22. + """ + @overload + def minkowsky_sum(self, b: Box, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of the polygon and a box + + @param b The box. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and the box. + + This method was introduced in version 0.22. + """ + @overload + def minkowsky_sum(self, b: Polygon, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of the polygon and a polygon + + @param p The first argument. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and p. + + This method was introduced in version 0.22. + """ + @overload + def minkowsky_sum(self, b: Sequence[Point], resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of the polygon and a contour of points (a trace) + + @param b The contour (a series of points forming the trace). + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and the contour. + + This method was introduced in version 0.22. + """ + @overload + def minkowsky_sum(self, e: Edge, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of the polygon and an edge + + @param e The edge. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum with the edge e. + + The Minkowski sum of a polygon and an edge basically results in the area covered when "dragging" the polygon along the line given by the edge. The effect is similar to drawing the line with a pencil that has the shape of the given polygon. + + This method was introduced in version 0.22. + """ + @overload + def move(self, p: Vector) -> Polygon: + r""" + @brief Moves the polygon. + + Moves the polygon by the given offset and returns the + moved polygon. The polygon is overwritten. + + @param p The distance to move the polygon. + + @return The moved polygon (self). + + This method has been introduced in version 0.23. + """ + @overload + def move(self, x: int, y: int) -> Polygon: + r""" + @brief Moves the polygon. + + Moves the polygon by the given offset and returns the + moved polygon. The polygon is overwritten. + + @param x The x distance to move the polygon. + @param y The y distance to move the polygon. + + @return The moved polygon (self). + """ + @overload + def moved(self, p: Vector) -> Polygon: + r""" + @brief Returns the moved polygon (does not modify self) + + Moves the polygon by the given offset and returns the + moved polygon. The polygon is not modified. + + @param p The distance to move the polygon. + + @return The moved polygon. + + This method has been introduced in version 0.23. + """ + @overload + def moved(self, x: int, y: int) -> Polygon: + r""" + @brief Returns the moved polygon (does not modify self) + + Moves the polygon by the given offset and returns the + moved polygon. The polygon is not modified. + + @param x The x distance to move the polygon. + @param y The y distance to move the polygon. + + @return The moved polygon. + + This method has been introduced in version 0.23. + """ + def num_points(self) -> int: + r""" + @brief Gets the total number of points (hull plus holes) + This method was introduced in version 0.18. + """ + def num_points_hole(self, n: int) -> int: + r""" + @brief Gets the number of points of the given hole + The argument gives the index of the hole of which the number of points are requested. The index must be less than the number of holes (see \holes). + """ + def num_points_hull(self) -> int: + r""" + @brief Gets the number of points of the hull + """ + def perimeter(self) -> int: + r""" + @brief Gets the perimeter of the polygon + The perimeter is sum of the lengths of all edges making up the polygon. + + This method has been introduce in version 0.23. + """ + def point_hole(self, n: int, p: int) -> Point: + r""" + @brief Gets a specific point of a hole + @param n The index of the hole to which the points should be assigned + @param p The index of the point to get + If the index of the point or of the hole is not valid, a default value is returned. + This method was introduced in version 0.18. + """ + def point_hull(self, p: int) -> Point: + r""" + @brief Gets a specific point of the hull + @param p The index of the point to get + If the index of the point is not a valid index, a default value is returned. + This method was introduced in version 0.18. + """ + def resolve_holes(self) -> None: + r""" + @brief Resolve holes by inserting cut lines and joining the holes with the hull + + This method modifies the polygon. The out-of-place version is \resolved_holes. + This method was introduced in version 0.22. + """ + def resolved_holes(self) -> Polygon: + r""" + @brief Returns a polygon without holes + + @return The new polygon without holes. + + This method does not modify the polygon but return a new polygon. + This method was introduced in version 0.22. + """ + def round_corners(self, rinner: float, router: float, n: int) -> Polygon: + r""" + @brief Rounds the corners of the polygon + + Replaces the corners of the polygon with circle segments. + + @param rinner The circle radius of inner corners (in database units). + @param router The circle radius of outer corners (in database units). + @param n The number of points per full circle. + + @return The new polygon. + + This method was introduced in version 0.20 for integer coordinates and in 0.25 for all coordinate types. + """ + @overload + def size(self, d: int, mode: Optional[int] = ...) -> None: + r""" + @brief Sizes the polygon (biasing) + + Shifts the contour outwards (d>0) or inwards (d<0). + This method is equivalent to + @code + size(d, d, mode) + @/code + + See \size for a detailed description. + + This method has been introduced in version 0.23. + """ + @overload + def size(self, dv: Vector, mode: Optional[int] = ...) -> None: + r""" + @brief Sizes the polygon (biasing) + + This method is equivalent to + @code + size(dv.x, dv.y, mode) + @/code + + See \size for a detailed description. + + This version has been introduced in version 0.28. + """ + @overload + def size(self, dx: int, dy: int, mode: int) -> None: + r""" + @brief Sizes the polygon (biasing) + + Shifts the contour outwards (dx,dy>0) or inwards (dx,dy<0). + dx is the sizing in x-direction and dy is the sizing in y-direction. The sign of dx and dy should be identical. + The sizing operation create invalid (self-overlapping, reverse oriented) contours. + + The mode defines at which bending angle cutoff occurs + (0:>0, 1:>45, 2:>90, 3:>135, 4:>approx. 168, other:>approx. 179) + + In order to obtain a proper polygon in the general case, the + sized polygon must be merged in 'greater than zero' wrap count mode. This is necessary since in the general case, + sizing can be complicated operation which lets a single polygon fall apart into disjoint pieces for example. + This can be achieved using the \EdgeProcessor class for example: + + @code + poly = ... # a RBA::Polygon + poly.size(-50, 2) + ep = RBA::EdgeProcessor::new + # result is an array of RBA::Polygon objects + result = ep.simple_merge_p2p([ poly ], false, false, 1) + @/code + """ + @overload + def sized(self, d: int, mode: Optional[int] = ...) -> Polygon: + r""" + @brief Sizes the polygon (biasing) without modifying self + + Shifts the contour outwards (d>0) or inwards (d<0). + This method is equivalent to + @code + sized(d, d, mode) + @/code + + See \size and \sized for a detailed description. + """ + @overload + def sized(self, dv: Vector, mode: Optional[int] = ...) -> Polygon: + r""" + @brief Sizes the polygon (biasing) without modifying self + + This method is equivalent to + @code + sized(dv.x, dv.y, mode) + @/code + + See \size and \sized for a detailed description. + + This version has been introduced in version 0.28. + """ + @overload + def sized(self, dx: int, dy: int, mode: int) -> Polygon: + r""" + @brief Sizes the polygon (biasing) without modifying self + + This method applies sizing to the polygon but does not modify self. Instead a sized copy is returned. + See \size for a description of the operation. + + This method has been introduced in version 0.23. + """ + def smooth(self, d: int, keep_hv: Optional[bool] = ...) -> Polygon: + r""" + @brief Smooths a polygon + + Remove vertices that deviate by more than the distance d from the average contour. + The value d is basically the roughness which is removed. + + @param d The smoothing "roughness". + @param keep_hv If true, horizontal and vertical edges will be preserved always. + + @return The smoothed polygon. + + This method was introduced in version 0.23. The 'keep_hv' optional parameter was added in version 0.27. + """ + def split(self) -> List[Polygon]: + r""" + @brief Splits the polygon into two or more parts + This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. + + The intended use for this method is a iteratively split polygons until the satisfy some maximum number of points limit. + + This method has been introduced in version 0.25.3. + """ + def to_dtype(self, dbu: Optional[float] = ...) -> DPolygon: + r""" + @brief Converts the polygon to a floating-point coordinate polygon + + The database unit can be specified to translate the integer-coordinate polygon into a floating-point coordinate polygon in micron units. The database unit is basically a scaling factor. + + This method has been introduced in version 0.25. + """ + def to_s(self) -> str: + r""" + @brief Returns a string representing the polygon + """ + def to_simple_polygon(self) -> SimplePolygon: + r""" + @brief Converts a polygon to a simple polygon + + @return The simple polygon. + + If the polygon contains holes, these will be resolved. + This operation requires a well-formed polygon. Reflecting edges, self-intersections and coincident points will be removed. + + This method was introduced in version 0.22. + """ + @overload + def touches(self, box: Box) -> bool: + r""" + @brief Returns true, if the polygon touches the given box. + The box and the polygon touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, edge: Edge) -> bool: + r""" + @brief Returns true, if the polygon touches the given edge. + The edge and the polygon touch if they overlap or the edge shares at least one point with the polygon's contour. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, polygon: Polygon) -> bool: + r""" + @brief Returns true, if the polygon touches the other polygon. + The polygons touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, simple_polygon: SimplePolygon) -> bool: + r""" + @brief Returns true, if the polygon touches the other polygon. + The polygons touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def transform(self, t: ICplxTrans) -> Polygon: + r""" + @brief Transforms the polygon with a complex transformation (in-place) + + Transforms the polygon with the given complex transformation. + This version modifies self and will return self as the modified polygon. An out-of-place version which does not modify self is \transformed. + + @param t The transformation to apply. + + This method was introduced in version 0.24. + """ + @overload + def transform(self, t: Trans) -> Polygon: + r""" + @brief Transforms the polygon (in-place) + + Transforms the polygon with the given transformation. + Modifies self and returns self. An out-of-place version which does not modify self is \transformed. + + @param t The transformation to apply. + + This method has been introduced in version 0.24. + """ + @overload + def transformed(self, t: CplxTrans) -> DPolygon: + r""" + @brief Transforms the polygon with a complex transformation + + Transforms the polygon with the given complex transformation. + Does not modify the polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed polygon. + + With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. + """ + @overload + def transformed(self, t: ICplxTrans) -> Polygon: + r""" + @brief Transforms the polygon with a complex transformation + + Transforms the polygon with the given complex transformation. + Does not modify the polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed polygon (in this case an integer coordinate polygon). + + This method was introduced in version 0.18. + """ + @overload + def transformed(self, t: Trans) -> Polygon: + r""" + @brief Transforms the polygon + + Transforms the polygon with the given transformation. + Does not modify the polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed polygon. + """ + def transformed_cplx(self, t: CplxTrans) -> DPolygon: + r""" + @brief Transforms the polygon with a complex transformation + + Transforms the polygon with the given complex transformation. + Does not modify the polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed polygon. + + With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. + """ + +class DPolygon: + r""" + @brief A polygon class + + A polygon consists of an outer hull and zero to many + holes. Each contour consists of several points. The point + list is normalized such that the leftmost, lowest point is + the first one. The orientation is normalized such that + the orientation of the hull contour is clockwise, while + the orientation of the holes is counterclockwise. + + It is in no way checked that the contours are not overlapping. + This must be ensured by the user of the object + when filling the contours. + + A polygon can be asked for the number of holes using the \holes method. \each_point_hull delivers the points of the hull contour. \each_point_hole delivers the points of a specific hole. \each_edge delivers the edges (point-to-point connections) of both hull and holes. \bbox delivers the bounding box, \area the area and \perimeter the perimeter of the polygon. + + Here's an example of how to create a polygon: + + @code + hull = [ RBA::DPoint::new(0, 0), RBA::DPoint::new(6000, 0), + RBA::DPoint::new(6000, 3000), RBA::DPoint::new(0, 3000) ] + hole1 = [ RBA::DPoint::new(1000, 1000), RBA::DPoint::new(2000, 1000), + RBA::DPoint::new(2000, 2000), RBA::DPoint::new(1000, 2000) ] + hole2 = [ RBA::DPoint::new(3000, 1000), RBA::DPoint::new(4000, 1000), + RBA::DPoint::new(4000, 2000), RBA::DPoint::new(3000, 2000) ] + poly = RBA::DPolygon::new(hull) + poly.insert_hole(hole1) + poly.insert_hole(hole2) + + # ask the polygon for some properties + poly.holes # -> 2 + poly.area # -> 16000000.0 + poly.perimeter # -> 26000.0 + poly.bbox # -> (0,0;6000,3000) + @/code + + The \DPolygon class stores coordinates in floating-point format which gives a higher precision for some operations. A class that stores integer coordinates is \Polygon. + + See @The Database API@ for more details about the database objects. + """ + @property + def hull(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the points of the hull of polygon + @param p An array of points to assign to the polygon's hull + The 'assign_hull' variant is provided in analogy to 'assign_hole'. + """ + @classmethod + def ellipse(cls, box: DBox, n: int) -> DPolygon: + r""" + @brief Creates a simple polygon approximating an ellipse + + @param box The bounding box of the ellipse + @param n The number of points that will be used to approximate the ellipse + + This method has been introduced in version 0.23. + """ + @classmethod + def from_ipoly(cls, polygon: Polygon) -> DPolygon: + r""" + @brief Creates a floating-point coordinate polygon from an integer coordinate polygon + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipolygon'. + """ + @classmethod + def from_s(cls, s: str) -> DPolygon: + r""" + @brief Creates a polygon from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> DPolygon: + r""" + @brief Creates an empty (invalid) polygon + """ + @overload + @classmethod + def new(cls, box: DBox) -> DPolygon: + r""" + @brief Creates a polygon from a box + + @param box The box to convert to a polygon + """ + @overload + @classmethod + def new(cls, polygon: Polygon) -> DPolygon: + r""" + @brief Creates a floating-point coordinate polygon from an integer coordinate polygon + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipolygon'. + """ + @overload + @classmethod + def new(cls, sp: DSimplePolygon) -> DPolygon: + r""" + @brief Creates a polygon from a simple polygon + @param sp The simple polygon that is converted into the polygon + This method was introduced in version 0.22. + """ + @overload + @classmethod + def new(cls, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> DPolygon: + r""" + @brief Creates a polygon from a point array for the hull + + @param pts The points forming the polygon hull + @param raw If true, the point list won't be modified (see \assign_hull) + + The 'raw' argument was added in version 0.24. + """ + def __copy__(self) -> DPolygon: + r""" + @brief Creates a copy of self + """ + def __eq__(self, p: object) -> bool: + r""" + @brief Returns a value indicating whether the polygons are equal + @param p The object to compare against + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates an empty (invalid) polygon + """ + @overload + def __init__(self, box: DBox) -> None: + r""" + @brief Creates a polygon from a box + + @param box The box to convert to a polygon + """ + @overload + def __init__(self, polygon: Polygon) -> None: + r""" + @brief Creates a floating-point coordinate polygon from an integer coordinate polygon + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipolygon'. + """ + @overload + def __init__(self, sp: DSimplePolygon) -> None: + r""" + @brief Creates a polygon from a simple polygon + @param sp The simple polygon that is converted into the polygon + This method was introduced in version 0.22. + """ + @overload + def __init__(self, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> None: + r""" + @brief Creates a polygon from a point array for the hull + + @param pts The points forming the polygon hull + @param raw If true, the point list won't be modified (see \assign_hull) + + The 'raw' argument was added in version 0.24. + """ + def __lt__(self, p: DPolygon) -> bool: + r""" + @brief Returns a value indicating whether self is less than p + @param p The object to compare against + This operator is provided to establish some, not necessarily a certain sorting order + """ + def __mul__(self, f: float) -> DPolygon: + r""" + @brief Scales the polygon by some factor + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __ne__(self, p: object) -> bool: + r""" + @brief Returns a value indicating whether the polygons are not equal + @param p The object to compare against + """ + def __rmul__(self, f: float) -> DPolygon: + r""" + @brief Scales the polygon by some factor + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __str__(self) -> str: + r""" + @brief Returns a string representing the polygon + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def area(self) -> float: + r""" + @brief Gets the area of the polygon + The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise.Orientation is ensured automatically in most cases. + """ + def area2(self) -> float: + r""" + @brief Gets the double area of the polygon + This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types. + + This method has been introduced in version 0.26.1 + """ + def assign(self, other: DPolygon) -> None: + r""" + @brief Assigns another object to self + """ + @overload + def assign_hole(self, n: int, b: DBox) -> None: + r""" + @brief Sets the box as the given hole of the polygon + @param n The index of the hole to which the points should be assigned + @param b The box to assign to the polygon's hole + If the hole index is not valid, this method does nothing. + This method was introduced in version 0.23. + """ + @overload + def assign_hole(self, n: int, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: + r""" + @brief Sets the points of the given hole of the polygon + @param n The index of the hole to which the points should be assigned + @param p An array of points to assign to the polygon's hole + @param raw If true, the points won't be compressed (see \assign_hull) + If the hole index is not valid, this method does nothing. + + This method was introduced in version 0.18. + The 'raw' argument was added in version 0.24. + """ + def assign_hull(self, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: + r""" + @brief Sets the points of the hull of polygon + @param p An array of points to assign to the polygon's hull + @param raw If true, the points won't be compressed + + If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. + + Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. + + The 'assign_hull' variant is provided in analogy to 'assign_hole'. + + The 'raw' argument was added in version 0.24. + """ + def bbox(self) -> DBox: + r""" + @brief Returns the bounding box of the polygon + The bounding box is the box enclosing all points of the polygon. + """ + def compress(self, remove_reflected: bool) -> None: + r""" + @brief Compresses the polygon. + + This method removes redundant points from the polygon, such as points being on a line formed by two other points. + If remove_reflected is true, points are also removed if the two adjacent edges form a spike. + + @param remove_reflected See description of the functionality. + + This method was introduced in version 0.18. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> DPolygon: + r""" + @brief Creates a copy of self + """ + @overload + def each_edge(self) -> Iterator[DEdge]: + r""" + @brief Iterates over the edges that make up the polygon + + This iterator will deliver all edges, including those of the holes. Hole edges are oriented counterclockwise while hull edges are oriented clockwise. + """ + @overload + def each_edge(self, contour: int) -> Iterator[DEdge]: + r""" + @brief Iterates over the edges of one contour of the polygon + + @param contour The contour number (0 for hull, 1 for first hole ...) + + This iterator will deliver all edges of the contour specified by the contour parameter. The hull has contour number 0, the first hole has contour 1 etc. + Hole edges are oriented counterclockwise while hull edges are oriented clockwise. + + This method was introduced in version 0.24. + """ + def each_point_hole(self, n: int) -> Iterator[DPoint]: + r""" + @brief Iterates over the points that make up the nth hole + The hole number must be less than the number of holes (see \holes) + """ + def each_point_hull(self) -> Iterator[DPoint]: + r""" + @brief Iterates over the points that make up the hull + """ + def extract_rad(self) -> List[Any]: + r""" + @brief Extracts the corner radii from a rounded polygon + + Attempts to extract the radii of rounded corner polygon. This is essentially the inverse of the \round_corners method. If this method succeeds, if will return an array of four elements: @ul + @li The polygon with the rounded corners replaced by edgy ones @/li + @li The radius of the inner corners @/li + @li The radius of the outer corners @/li + @li The number of points per full circle @/li + @/ul + + This method is based on some assumptions and may fail. In this case, an empty array is returned. + + If successful, the following code will more or less render the original polygon and parameters + + @code + p = ... # some polygon + p.round_corners(ri, ro, n) + (p2, ri2, ro2, n2) = p.extract_rad + # -> p2 == p, ro2 == ro, ri2 == ri, n2 == n (within some limits) + @/code + + This method was introduced in version 0.25. + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + def holes(self) -> int: + r""" + @brief Returns the number of holes + """ + @overload + def insert_hole(self, b: DBox) -> None: + r""" + @brief Inserts a hole from the given box + @param b The box to insert as a new hole + This method was introduced in version 0.23. + """ + @overload + def insert_hole(self, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: + r""" + @brief Inserts a hole with the given points + @param p An array of points to insert as a new hole + @param raw If true, the points won't be compressed (see \assign_hull) + + The 'raw' argument was added in version 0.24. + """ + def inside(self, p: DPoint) -> bool: + r""" + @brief Tests, if the given point is inside the polygon + If the given point is inside or on the edge of the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise. + """ + def is_box(self) -> bool: + r""" + @brief Returns true, if the polygon is a simple box. + + A polygon is a box if it is identical to it's bounding box. + + @return True if the polygon is a box. + + This method was introduced in version 0.23. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_empty(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is empty + """ + def is_halfmanhattan(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is half-manhattan + Half-manhattan polygons have edges which are multiples of 45 degree. These polygons can be clipped at a rectangle without potential grid snapping. + + This predicate was introduced in version 0.27. + """ + def is_rectilinear(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is rectilinear + """ + @overload + def move(self, p: DVector) -> DPolygon: + r""" + @brief Moves the polygon. + + Moves the polygon by the given offset and returns the + moved polygon. The polygon is overwritten. + + @param p The distance to move the polygon. + + @return The moved polygon (self). + + This method has been introduced in version 0.23. + """ + @overload + def move(self, x: float, y: float) -> DPolygon: + r""" + @brief Moves the polygon. + + Moves the polygon by the given offset and returns the + moved polygon. The polygon is overwritten. + + @param x The x distance to move the polygon. + @param y The y distance to move the polygon. + + @return The moved polygon (self). + """ + @overload + def moved(self, p: DVector) -> DPolygon: + r""" + @brief Returns the moved polygon (does not modify self) + + Moves the polygon by the given offset and returns the + moved polygon. The polygon is not modified. + + @param p The distance to move the polygon. + + @return The moved polygon. + + This method has been introduced in version 0.23. + """ + @overload + def moved(self, x: float, y: float) -> DPolygon: + r""" + @brief Returns the moved polygon (does not modify self) + + Moves the polygon by the given offset and returns the + moved polygon. The polygon is not modified. + + @param x The x distance to move the polygon. + @param y The y distance to move the polygon. + + @return The moved polygon. + + This method has been introduced in version 0.23. + """ + def num_points(self) -> int: + r""" + @brief Gets the total number of points (hull plus holes) + This method was introduced in version 0.18. + """ + def num_points_hole(self, n: int) -> int: + r""" + @brief Gets the number of points of the given hole + The argument gives the index of the hole of which the number of points are requested. The index must be less than the number of holes (see \holes). + """ + def num_points_hull(self) -> int: + r""" + @brief Gets the number of points of the hull + """ + def perimeter(self) -> float: + r""" + @brief Gets the perimeter of the polygon + The perimeter is sum of the lengths of all edges making up the polygon. + + This method has been introduce in version 0.23. + """ + def point_hole(self, n: int, p: int) -> DPoint: + r""" + @brief Gets a specific point of a hole + @param n The index of the hole to which the points should be assigned + @param p The index of the point to get + If the index of the point or of the hole is not valid, a default value is returned. + This method was introduced in version 0.18. + """ + def point_hull(self, p: int) -> DPoint: + r""" + @brief Gets a specific point of the hull + @param p The index of the point to get + If the index of the point is not a valid index, a default value is returned. + This method was introduced in version 0.18. + """ + def round_corners(self, rinner: float, router: float, n: int) -> DPolygon: + r""" + @brief Rounds the corners of the polygon + + Replaces the corners of the polygon with circle segments. + + @param rinner The circle radius of inner corners (in database units). + @param router The circle radius of outer corners (in database units). + @param n The number of points per full circle. + + @return The new polygon. + + This method was introduced in version 0.20 for integer coordinates and in 0.25 for all coordinate types. + """ + @overload + def size(self, d: float, mode: Optional[int] = ...) -> None: + r""" + @brief Sizes the polygon (biasing) + + Shifts the contour outwards (d>0) or inwards (d<0). + This method is equivalent to + @code + size(d, d, mode) + @/code + + See \size for a detailed description. + + This method has been introduced in version 0.23. + """ + @overload + def size(self, dv: Vector, mode: Optional[int] = ...) -> None: + r""" + @brief Sizes the polygon (biasing) + + This method is equivalent to + @code + size(dv.x, dv.y, mode) + @/code + + See \size for a detailed description. + + This version has been introduced in version 0.28. + """ + @overload + def size(self, dx: float, dy: float, mode: int) -> None: + r""" + @brief Sizes the polygon (biasing) + + Shifts the contour outwards (dx,dy>0) or inwards (dx,dy<0). + dx is the sizing in x-direction and dy is the sizing in y-direction. The sign of dx and dy should be identical. + The sizing operation create invalid (self-overlapping, reverse oriented) contours. + + The mode defines at which bending angle cutoff occurs + (0:>0, 1:>45, 2:>90, 3:>135, 4:>approx. 168, other:>approx. 179) + + In order to obtain a proper polygon in the general case, the + sized polygon must be merged in 'greater than zero' wrap count mode. This is necessary since in the general case, + sizing can be complicated operation which lets a single polygon fall apart into disjoint pieces for example. + This can be achieved using the \EdgeProcessor class for example: + + @code + poly = ... # a RBA::Polygon + poly.size(-50, 2) + ep = RBA::EdgeProcessor::new + # result is an array of RBA::Polygon objects + result = ep.simple_merge_p2p([ poly ], false, false, 1) + @/code + """ + @overload + def sized(self, d: float, mode: Optional[int] = ...) -> DPolygon: + r""" + @brief Sizes the polygon (biasing) without modifying self + + Shifts the contour outwards (d>0) or inwards (d<0). + This method is equivalent to + @code + sized(d, d, mode) + @/code + + See \size and \sized for a detailed description. + """ + @overload + def sized(self, dv: Vector, mode: Optional[int] = ...) -> DPolygon: + r""" + @brief Sizes the polygon (biasing) without modifying self + + This method is equivalent to + @code + sized(dv.x, dv.y, mode) + @/code + + See \size and \sized for a detailed description. + + This version has been introduced in version 0.28. + """ + @overload + def sized(self, dx: float, dy: float, mode: int) -> DPolygon: + r""" + @brief Sizes the polygon (biasing) without modifying self + + This method applies sizing to the polygon but does not modify self. Instead a sized copy is returned. + See \size for a description of the operation. + + This method has been introduced in version 0.23. + """ + def split(self) -> List[DPolygon]: + r""" + @brief Splits the polygon into two or more parts + This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. + + The intended use for this method is a iteratively split polygons until the satisfy some maximum number of points limit. + + This method has been introduced in version 0.25.3. + """ + def to_itype(self, dbu: Optional[float] = ...) -> Polygon: + r""" + @brief Converts the polygon to an integer coordinate polygon + + The database unit can be specified to translate the floating-point coordinate polygon in micron units to an integer-coordinate polygon in database units. The polygons coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self) -> str: + r""" + @brief Returns a string representing the polygon + """ + @overload + def touches(self, box: DBox) -> bool: + r""" + @brief Returns true, if the polygon touches the given box. + The box and the polygon touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, edge: DEdge) -> bool: + r""" + @brief Returns true, if the polygon touches the given edge. + The edge and the polygon touch if they overlap or the edge shares at least one point with the polygon's contour. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, polygon: DPolygon) -> bool: + r""" + @brief Returns true, if the polygon touches the other polygon. + The polygons touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, simple_polygon: DSimplePolygon) -> bool: + r""" + @brief Returns true, if the polygon touches the other polygon. + The polygons touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def transform(self, t: DCplxTrans) -> DPolygon: + r""" + @brief Transforms the polygon with a complex transformation (in-place) + + Transforms the polygon with the given complex transformation. + Modifies self and returns self. An out-of-place version which does not modify self is \transformed. + + @param t The transformation to apply. + + This method has been introduced in version 0.24. + """ + @overload + def transform(self, t: DTrans) -> DPolygon: + r""" + @brief Transforms the polygon (in-place) + + Transforms the polygon with the given transformation. + Modifies self and returns self. An out-of-place version which does not modify self is \transformed. + + @param t The transformation to apply. + + This method has been introduced in version 0.24. + """ + @overload + def transformed(self, t: DCplxTrans) -> DPolygon: + r""" + @brief Transforms the polygon with a complex transformation + + Transforms the polygon with the given complex transformation. + Does not modify the polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed polygon. + + With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. + """ + @overload + def transformed(self, t: DTrans) -> DPolygon: + r""" + @brief Transforms the polygon + + Transforms the polygon with the given transformation. + Does not modify the polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed polygon. + """ + @overload + def transformed(self, t: VCplxTrans) -> Polygon: + r""" + @brief Transforms the polygon with the given complex transformation + + + @param t The magnifying transformation to apply + @return The transformed polygon (in this case an integer coordinate polygon) + + This method has been introduced in version 0.25. + """ + def transformed_cplx(self, t: DCplxTrans) -> DPolygon: + r""" + @brief Transforms the polygon with a complex transformation + + Transforms the polygon with the given complex transformation. + Does not modify the polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed polygon. + + With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. + """ + +class LayerMap: + r""" + @brief An object representing an arbitrary mapping of physical layers to logical layers + + "Physical" layers are stream layers or other separated layers in a CAD file. "Logical" layers are the layers present in a \Layout object. Logical layers are represented by an integer index while physical layers are given by a layer and datatype number or name. A logical layer is created automatically in the layout on reading if it does not exist yet. + + The mapping describes an association of a set of physical layers to a set of logical ones, where multiple + physical layers can be mapped to a single logical one, which effectively merges the layers. + + For each logical layer, a target layer can be specified. A target layer is the layer/datatype/name combination + as which the logical layer appears in the layout. By using a target layer different from the source layer + renaming a layer can be achieved while loading a layout. Another use case for that feature is to assign + layer names to GDS layer/datatype combinations which are numerical only. + + LayerMap objects are used in two ways: as input for the reader (inside a \LoadLayoutOptions class) and + as output from the reader (i.e. Layout::read method). For layer map objects used as input, the layer indexes + (logical layers) can be consecutive numbers. They do not need to correspond with real layer indexes from + a layout object. When used as output, the layer map's logical layers correspond to the layer indexes inside + the layout that the layer map was used upon. + + This is a sample how to use the LayerMap object. It maps all datatypes of layers 1, 2 and 3 to datatype 0 and + assigns the names 'ONE', 'TWO' and 'THREE' to these layout layers: + + @codelm = RBA::LayerMap::new + lm.map("1/0-255 : ONE (1/0)") + lm.map("2/0-255 : TWO (2/0)") + lm.map("3/0-255 : THREE (3/0)") + + # read the layout using the layer map + lo = RBA::LoadLayoutOptions::new + lo.layer_map.assign(lm) + ly = RBA::Layout::new + ly.read("input.gds", lo) + @/code + + 1:n mapping is supported: a physical layer can be mapped to multiple logical layers using 'mmap' instead of 'map'. When using this variant, mapping acts additive. + The following example will map layer 1, datatypes 0 to 255 to logical layer 0, and layer 1, datatype 17 to logical layers 0 plus 1: + @codelm = RBA::LayerMap::new + lm.map("1/0-255", 0) # (can be 'mmap' too) + lm.mmap("1/17", 1) + @/code + + 'unmapping' allows removing a mapping. This allows creating 'holes' in mapping ranges. The following example maps layer 1, datatypes 0 to 16 and 18 to 255 to logical layer 0: + @codelm = RBA::LayerMap::new + lm.map("1/0-255", 0) + lm.unmap("1/17") + @/code + + The LayerMap class has been introduced in version 0.18. Target layer have been introduced in version 0.20. 1:n mapping and unmapping has been introduced in version 0.27. + """ + @classmethod + def from_string(cls, arg0: str) -> LayerMap: + r""" + @brief Creates a layer map from the given string + The format of the string is that used in layer mapping files: one mapping entry per line, comments are allowed using '#' or '//'. The format of each line is that used in the 'map(string, index)' method. + + This method has been introduced in version 0.23. + """ + @classmethod + def new(cls) -> LayerMap: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> LayerMap: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: LayerMap) -> None: + r""" + @brief Assigns another object to self + """ + def clear(self) -> None: + r""" + @brief Clears the map + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> LayerMap: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_mapped(self, layer: LayerInfo) -> bool: + r""" + @brief Check, if a given physical layer is mapped + @param layer The physical layer specified with an \LayerInfo object. + @return True, if the layer is mapped. + """ + def logical(self, layer: LayerInfo) -> int: + r""" + @brief Returns the logical layer (the layer index in the layout object) for a given physical layer.n@param layer The physical layer specified with an \LayerInfo object. + @return The logical layer index or -1 if the layer is not mapped. + This method is deprecated with version 0.27 as in this version, layers can be mapped to multiple targets which this method can't capture. Use \logicals instead. + """ + def logicals(self, layer: LayerInfo) -> List[int]: + r""" + @brief Returns the logical layers for a given physical layer.n@param layer The physical layer specified with an \LayerInfo object. + @return This list of logical layers this physical layer as mapped to or empty if there is no mapping. + This method has been introduced in version 0.27. + """ + @overload + def map(self, map_expr: str, log_layer: Optional[int] = ...) -> None: + r""" + @brief Maps a physical layer given by a string to a logical one + @param map_expr The string describing the physical layer to map. + @param log_layer The logical layer to which the physical layers are mapped. + + The string expression is constructed using the syntax: + "list[/list][;..]" for layer/datatype pairs. "list" is a + sequence of numbers, separated by comma values or a range + separated by a hyphen. Examples are: "1/2", "1-5/0", "1,2,5/0", + "1/5;5/6". + + layer/datatype wildcards can be specified with "*". When "*" is used + for the upper limit, it is equivalent to "all layer above". When used + alone, it is equivalent to "all layers". Examples: "1 / *", "* / 10-*" + + Named layers are specified simply by specifying the name, if + necessary in single or double quotes (if the name begins with a digit or + contains non-word characters). layer/datatype and name descriptions can + be mixed, i.e. "AA;1/5" (meaning: name "AA" or layer 1/datatype 5). + + A target layer can be specified with the ":" notation, where + target is a valid string for a LayerProperties() object. + + A target can include relative layer/datatype specifications and wildcards. + For example, "1-10/0: *+1/0" will add 1 to the original layer number. + "1-10/0-50: * / *" will use the original layers. + + If the logical layer is negative or omitted, the method will select the next available one. + + Target mapping has been added in version 0.20. The logical layer is optional since version 0.28. + """ + @overload + def map(self, phys_layer: LayerInfo, log_layer: int) -> None: + r""" + @brief Maps a physical layer to a logical one + @param phys_layer The physical layer (a \LayerInfo object). + @param log_layer The logical layer to which the physical layer is mapped. + + In general, there may be more than one physical layer mapped + to one logical layer. This method will add the given physical layer to the mapping for the logical layer. + """ + @overload + def map(self, phys_layer: LayerInfo, log_layer: int, target_layer: LayerInfo) -> None: + r""" + @brief Maps a physical layer to a logical one with a target layer + @param phys_layer The physical layer (a \LayerInfo object). + @param log_layer The logical layer to which the physical layer is mapped. + @param target_layer The properties of the layer that will be created unless it already exists. + + In general, there may be more than one physical layer mapped + to one logical layer. This method will add the given physical layer to the mapping for the logical layer. + + This method has been added in version 0.20. + """ + @overload + def map(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int) -> None: + r""" + @brief Maps a physical layer interval to a logical one + @param pl_start The first physical layer (a \LayerInfo object). + @param pl_stop The last physical layer (a \LayerInfo object). + @param log_layer The logical layer to which the physical layers are mapped. + + This method maps an interval of layers l1..l2 and datatypes d1..d2 to the mapping for the given logical layer. l1 and d1 are given by the pl_start argument, while l2 and d2 are given by the pl_stop argument. + """ + @overload + def map(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int, layer_properties: LayerInfo) -> None: + r""" + @brief Maps a physical layer interval to a logical one with a target layer + @param pl_start The first physical layer (a \LayerInfo object). + @param pl_stop The last physical layer (a \LayerInfo object). + @param log_layer The logical layer to which the physical layers are mapped. + @param target_layer The properties of the layer that will be created unless it already exists. + + This method maps an interval of layers l1..l2 and datatypes d1..d2 to the mapping for the given logical layer. l1 and d1 are given by the pl_start argument, while l2 and d2 are given by the pl_stop argument. + This method has been added in version 0.20. + """ + def mapping(self, log_layer: int) -> LayerInfo: + r""" + @brief Returns the mapped physical (or target if one is specified) layer for a given logical layer + @param log_layer The logical layer for which the mapping is requested. + @return A \LayerInfo object which is the physical layer mapped to the logical layer. + In general, there may be more than one physical layer mapped + to one logical layer. This method will return a single one of + them. It will return the one with the lowest layer and datatype. + """ + def mapping_str(self, log_layer: int) -> str: + r""" + @brief Returns the mapping string for a given logical layer + @param log_layer The logical layer for which the mapping is requested. + @return A string describing the mapping. + The mapping string is compatible with the string that the "map" method accepts. + """ + @overload + def mmap(self, map_expr: str, log_layer: Optional[int] = ...) -> None: + r""" + @brief Maps a physical layer given by an expression to a logical one and adds to existing mappings + + This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. + For backward compatibility, 'map' still substitutes mapping. + + If the logical layer is negative or omitted, the method will select the next available one. + + Multi-mapping has been added in version 0.27. The logical layer is optional since version 0.28. + """ + @overload + def mmap(self, phys_layer: LayerInfo, log_layer: int) -> None: + r""" + @brief Maps a physical layer to a logical one and adds to existing mappings + + This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. + For backward compatibility, 'map' still substitutes mapping. + + Multi-mapping has been added in version 0.27. + """ + @overload + def mmap(self, phys_layer: LayerInfo, log_layer: int, target_layer: LayerInfo) -> None: + r""" + @brief Maps a physical layer to a logical one, adds to existing mappings and specifies a target layer + + This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. + For backward compatibility, 'map' still substitutes mapping. + + Multi-mapping has been added in version 0.27. + """ + @overload + def mmap(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int) -> None: + r""" + @brief Maps a physical layer from the given interval to a logical one and adds to existing mappings + + This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. + For backward compatibility, 'map' still substitutes mapping. + + Multi-mapping has been added in version 0.27. + """ + @overload + def mmap(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int, layer_properties: LayerInfo) -> None: + r""" + @brief Maps a physical layer from the given interval to a logical one, adds to existing mappings and specifies a target layer + + This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. + For backward compatibility, 'map' still substitutes mapping. + + Multi-mapping has been added in version 0.27. + """ + def to_string(self) -> str: + r""" + @brief Converts a layer mapping object to a string + This method is the inverse of the \from_string method. + + This method has been introduced in version 0.23. + """ + @overload + def unmap(self, expr: str) -> None: + r""" + @brief Unmaps the layers from the given expression + This method has been introduced in version 0.27. + """ + @overload + def unmap(self, phys_layer: LayerInfo) -> None: + r""" + @brief Unmaps the given layer + Unmapping will remove the specific layer from the mapping. This method allows generating 'mapping holes' by first mapping a range and then unmapping parts of it. + + This method has been introduced in version 0.27. + """ + @overload + def unmap(self, pl_start: LayerInfo, pl_stop: LayerInfo) -> None: + r""" + @brief Unmaps the layers from the given interval + This method has been introduced in version 0.27. + """ + +class LoadLayoutOptions: + r""" + @brief Layout reader options + + This object describes various layer reader options used for loading layouts. + + This class has been introduced in version 0.18. + """ + class CellConflictResolution: + r""" + @brief This enum specifies how cell conflicts are handled if a layout read into another layout and a cell name conflict arises. + Until version 0.26.8 and before, the mode was always 'AddToCell'. On reading, a cell was 'reopened' when encountering a cell name which already existed. This mode is still the default. The other modes are made available to support other ways of merging layouts. + + Proxy cells are never modified in the existing layout. Proxy cells are always local to their layout file. So if the existing cell is a proxy cell, the new cell will be renamed. + + If the new or existing cell is a ghost cell, both cells are merged always. + + This enum was introduced in version 0.27. + """ + AddToCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief Add content to existing cell + This is the mode use in before version 0.27. Content of new cells is simply added to existing cells with the same name. + """ + OverwriteCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief The old cell is overwritten entirely (including child cells which are not used otherwise) + """ + RenameCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief The new cell will be renamed to become unique + """ + SkipNewCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief The new cell is skipped entirely (including child cells which are not used otherwise) + """ + @overload + @classmethod + def new(cls, i: int) -> LoadLayoutOptions.CellConflictResolution: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> LoadLayoutOptions.CellConflictResolution: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __lt__(self, other: LoadLayoutOptions.CellConflictResolution) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + AddToCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief Add content to existing cell + This is the mode use in before version 0.27. Content of new cells is simply added to existing cells with the same name. + """ + OverwriteCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief The old cell is overwritten entirely (including child cells which are not used otherwise) + """ + RenameCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief The new cell will be renamed to become unique + """ + SkipNewCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief The new cell is skipped entirely (including child cells which are not used otherwise) + """ + cell_conflict_resolution: LoadLayoutOptions.CellConflictResolution + r""" + Getter: + @brief Gets the cell conflict resolution mode + + Multiple layout files can be collected into a single Layout object by reading file after file into the Layout object. Cells with same names are considered a conflict. This mode indicates how such conflicts are resolved. See \LoadLayoutOptions::CellConflictResolution for the values allowed. The default mode is \LoadLayoutOptions::CellConflictResolution#AddToCell. + + This option has been introduced in version 0.27. + Setter: + @brief Sets the cell conflict resolution mode + + See \cell_conflict_resolution for details about this option. + + This option has been introduced in version 0.27. + """ + cif_create_other_layers: bool + r""" + Getter: + @brief Gets a value indicating whether other layers shall be created + @return True, if other layers will be created. + This attribute acts together with a layer map (see \cif_layer_map=). Layers not listed in this map are created as well when \cif_create_other_layers? is true. Otherwise they are ignored. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + Setter: + @brief Specifies whether other layers shall be created + @param create True, if other layers will be created. + See \cif_create_other_layers? for a description of this attribute. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + cif_dbu: float + r""" + Getter: + @brief Specifies the database unit which the reader uses and produces + See \cif_dbu= method for a description of this property. + This property has been added in version 0.21. + + Setter: + @brief Specifies the database unit which the reader uses and produces + + This property has been added in version 0.21. + """ + cif_keep_layer_names: bool + r""" + Getter: + @brief Gets a value indicating whether layer names are kept + @return True, if layer names are kept. + + When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15. + + This method has been added in version 0.25.3. + Setter: + @brief Gets a value indicating whether layer names are kept + @param keep True, if layer names are to be kept. + + See \cif_keep_layer_names? for a description of this property. + + This method has been added in version 0.25.3. + """ + cif_layer_map: LayerMap + r""" + Getter: + @brief Gets the layer map + @return A reference to the layer map + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + + Python note: this method has been turned into a property in version 0.26. + Setter: + @brief Sets the layer map + This sets a layer mapping for the reader. Unlike \cif_set_layer_map, the 'create_other_layers' flag is not changed. + @param map The layer map to set. + + This convenience method has been added in version 0.26. + """ + cif_wire_mode: int + r""" + Getter: + @brief Specifies how to read 'W' objects + See \cif_wire_mode= method for a description of this mode. + This property has been added in version 0.21 and was renamed to cif_wire_mode in 0.25. + + Setter: + @brief How to read 'W' objects + + This property specifies how to read 'W' (wire) objects. + Allowed values are 0 (as square ended paths), 1 (as flush ended paths), 2 (as round paths) + + This property has been added in version 0.21. + """ + create_other_layers: bool + r""" + Getter: + @brief Gets a value indicating whether other layers shall be created + @return True, if other layers should be created. + This attribute acts together with a layer map (see \layer_map=). Layers not listed in this map are created as well when \create_other_layers? is true. Otherwise they are ignored. + + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + Setter: + @brief Specifies whether other layers shall be created + @param create True, if other layers should be created. + See \create_other_layers? for a description of this attribute. + + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + """ + dxf_circle_accuracy: float + r""" + Getter: + @brief Gets the accuracy of the circle approximation + + This property has been added in version 0.24.9. + + Setter: + @brief Specifies the accuracy of the circle approximation + + In addition to the number of points per circle, the circle accuracy can be specified. If set to a value larger than the database unit, the number of points per circle will be chosen such that the deviation from the ideal circle becomes less than this value. + + The actual number of points will not become bigger than the points specified through \dxf_circle_points=. The accuracy value is given in the DXF file units (see \dxf_unit) which is usually micrometers. + + \dxf_circle_points and \dxf_circle_accuracy also apply to other "round" structures such as arcs, ellipses and splines in the same sense than for circles. + + + This property has been added in version 0.24.9. + """ + dxf_circle_points: int + r""" + Getter: + @brief Gets the number of points used per full circle for arc interpolation + + This property has been added in version 0.21.6. + + Setter: + @brief Specifies the number of points used per full circle for arc interpolation + See also \dxf_circle_accuracy for how to specify the number of points based on an approximation accuracy. + + \dxf_circle_points and \dxf_circle_accuracy also apply to other "round" structures such as arcs, ellipses and splines in the same sense than for circles. + + + This property has been added in version 0.21.6. + """ + dxf_contour_accuracy: float + r""" + Getter: + @brief Gets the accuracy for contour closing + + + This property has been added in version 0.25.3. + + Setter: + @brief Specifies the accuracy for contour closing + + When polylines need to be connected or closed, this + value is used to indicate the accuracy. This is the value (in DXF units) + by which points may be separated and still be considered + connected. The default is 0.0 which implies exact + (within one DBU) closing. + + This value is effective in polyline mode 3 and 4. + + + This property has been added in version 0.25.3. + """ + dxf_create_other_layers: bool + r""" + Getter: + @brief Gets a value indicating whether other layers shall be created + @return True, if other layers will be created. + This attribute acts together with a layer map (see \dxf_layer_map=). Layers not listed in this map are created as well when \dxf_create_other_layers? is true. Otherwise they are ignored. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + Setter: + @brief Specifies whether other layers shall be created + @param create True, if other layers will be created. + See \dxf_create_other_layers? for a description of this attribute. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + dxf_dbu: float + r""" + Getter: + @brief Specifies the database unit which the reader uses and produces + + This property has been added in version 0.21. + + Setter: + @brief Specifies the database unit which the reader uses and produces + + This property has been added in version 0.21. + """ + dxf_keep_layer_names: bool + r""" + Getter: + @brief Gets a value indicating whether layer names are kept + @return True, if layer names are kept. + + When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15. + + This method has been added in version 0.25.3. + Setter: + @brief Gets a value indicating whether layer names are kept + @param keep True, if layer names are to be kept. + + See \cif_keep_layer_names? for a description of this property. + + This method has been added in version 0.25.3. + """ + dxf_keep_other_cells: bool + r""" + Getter: + @brief If this option is true, all cells are kept, not only the top cell and it's children + + This property has been added in version 0.21.15. + + Setter: + @brief If this option is set to true, all cells are kept, not only the top cell and it's children + + This property has been added in version 0.21.15. + """ + dxf_layer_map: LayerMap + r""" + Getter: + @brief Gets the layer map + @return A reference to the layer map + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + Python note: this method has been turned into a property in version 0.26. + Setter: + @brief Sets the layer map + This sets a layer mapping for the reader. Unlike \dxf_set_layer_map, the 'create_other_layers' flag is not changed. + @param map The layer map to set. + + This convenience method has been added in version 0.26. + """ + dxf_polyline_mode: int + r""" + Getter: + @brief Specifies whether closed POLYLINE and LWPOLYLINE entities with width 0 are converted to polygons. + See \dxf_polyline_mode= for a description of this property. + + This property has been added in version 0.21.3. + + Setter: + @brief Specifies how to treat POLYLINE/LWPOLYLINE entities. + The mode is 0 (automatic), 1 (keep lines), 2 (create polygons from closed polylines with width = 0), 3 (merge all lines with width = 0 into polygons), 4 (as 3 plus auto-close open contours). + + This property has been added in version 0.21.3. + """ + dxf_render_texts_as_polygons: bool + r""" + Getter: + @brief If this option is true, text objects are rendered as polygons + + This property has been added in version 0.21.15. + + Setter: + @brief If this option is set to true, text objects are rendered as polygons + + This property has been added in version 0.21.15. + """ + dxf_text_scaling: float + r""" + Getter: + @brief Gets the text scaling factor (see \dxf_text_scaling=) + + This property has been added in version 0.21.20. + + Setter: + @brief Specifies the text scaling in percent of the default scaling + + The default value 100, meaning that the letter pitch is roughly 92 percent of the specified text height. Decrease this value to get smaller fonts and increase it to get larger fonts. + + This property has been added in version 0.21.20. + """ + dxf_unit: float + r""" + Getter: + @brief Specifies the unit in which the DXF file is drawn + + This property has been added in version 0.21.3. + + Setter: + @brief Specifies the unit in which the DXF file is drawn. + + This property has been added in version 0.21.3. + """ + gds2_allow_big_records: bool + r""" + Getter: + @brief Gets a value specifying whether to allow big records with a length of 32768 to 65535 bytes. + See \gds2_allow_big_records= method for a description of this property. + This property has been added in version 0.18. + + Setter: + @brief Allows big records with more than 32767 bytes + + Setting this property to true allows larger records by treating the record length as unsigned short, which for example allows larger polygons (~8000 points rather than ~4000 points) without using multiple XY records. + For strict compatibility with the standard, this property should be set to false. The default is true. + + This property has been added in version 0.18. + """ + gds2_allow_multi_xy_records: bool + r""" + Getter: + @brief Gets a value specifying whether to allow big polygons with multiple XY records. + See \gds2_allow_multi_xy_records= method for a description of this property. + This property has been added in version 0.18. + + Setter: + @brief Allows the use of multiple XY records in BOUNDARY elements for unlimited large polygons + + Setting this property to true allows big polygons that span over multiple XY records. + For strict compatibility with the standard, this property should be set to false. The default is true. + + This property has been added in version 0.18. + """ + gds2_box_mode: int + r""" + Getter: + @brief Gets a value specifying how to treat BOX records + See \gds2_box_mode= method for a description of this mode. + This property has been added in version 0.18. + + Setter: + @brief Sets a value specifying how to treat BOX records + This property specifies how BOX records are treated. + Allowed values are 0 (ignore), 1 (treat as rectangles), 2 (treat as boundaries) or 3 (treat as errors). The default is 1. + + This property has been added in version 0.18. + """ + layer_map: LayerMap + r""" + Getter: + @brief Gets the layer map + @return A reference to the layer map + + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + Python note: this method has been turned into a property in version 0.26. + Setter: + @brief Sets the layer map, but does not affect the "create_other_layers" flag. + Use \create_other_layers? to enable or disable other layers not listed in the layer map. + @param map The layer map to set. + This convenience method has been introduced with version 0.26. + """ + lefdef_config: LEFDEFReaderConfiguration + r""" + Getter: + @brief Gets a copy of the LEF/DEF reader configuration + The LEF/DEF reader configuration is wrapped in a separate object of class \LEFDEFReaderConfiguration. See there for details. + This method will return a copy of the reader configuration. To modify the configuration, modify the copy and set the modified configuration with \lefdef_config=. + + + This method has been added in version 0.25. + + Setter: + @brief Sets the LEF/DEF reader configuration + + + This method has been added in version 0.25. + """ + mag_create_other_layers: bool + r""" + Getter: + @brief Gets a value indicating whether other layers shall be created + @return True, if other layers will be created. + This attribute acts together with a layer map (see \mag_layer_map=). Layers not listed in this map are created as well when \mag_create_other_layers? is true. Otherwise they are ignored. + + This method has been added in version 0.26.2. + Setter: + @brief Specifies whether other layers shall be created + @param create True, if other layers will be created. + See \mag_create_other_layers? for a description of this attribute. + + This method has been added in version 0.26.2. + """ + mag_dbu: float + r""" + Getter: + @brief Specifies the database unit which the reader uses and produces + See \mag_dbu= method for a description of this property. + + This property has been added in version 0.26.2. + + Setter: + @brief Specifies the database unit which the reader uses and produces + The database unit is the final resolution of the produced layout. This physical resolution is usually defined by the layout system - GDS for example typically uses 1nm (mag_dbu=0.001). + All geometry in the MAG file will first be scaled to \mag_lambda and is then brought to the database unit. + + This property has been added in version 0.26.2. + """ + mag_keep_layer_names: bool + r""" + Getter: + @brief Gets a value indicating whether layer names are kept + @return True, if layer names are kept. + + When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15. + + This method has been added in version 0.26.2. + Setter: + @brief Gets a value indicating whether layer names are kept + @param keep True, if layer names are to be kept. + + See \mag_keep_layer_names? for a description of this property. + + This method has been added in version 0.26.2. + """ + mag_lambda: float + r""" + Getter: + @brief Gets the lambda value + See \mag_lambda= method for a description of this attribute. + + This property has been added in version 0.26.2. + + Setter: + @brief Specifies the lambda value to used for reading + + The lambda value is the basic unit of the layout. Magic draws layout as multiples of this basic unit. The layout read by the MAG reader will use the database unit specified by \mag_dbu, but the physical layout coordinates will be multiples of \mag_lambda. + + This property has been added in version 0.26.2. + """ + mag_layer_map: LayerMap + r""" + Getter: + @brief Gets the layer map + @return A reference to the layer map + + This method has been added in version 0.26.2. + Setter: + @brief Sets the layer map + This sets a layer mapping for the reader. Unlike \mag_set_layer_map, the 'create_other_layers' flag is not changed. + @param map The layer map to set. + + This method has been added in version 0.26.2. + """ + mag_library_paths: List[str] + r""" + Getter: + @brief Gets the locations where to look up libraries (in this order) + See \mag_library_paths= method for a description of this attribute. + + This property has been added in version 0.26.2. + + Setter: + @brief Specifies the locations where to look up libraries (in this order) + + The reader will look up library reference in these paths when it can't find them locally. + Relative paths in this collection are resolved relative to the initial file's path. + Expression interpolation is supported in the path strings. + + This property has been added in version 0.26.2. + """ + mag_merge: bool + r""" + Getter: + @brief Gets a value indicating whether boxes are merged into polygons + @return True, if boxes are merged. + + When set to true, the boxes and triangles of the Magic layout files are merged into polygons where possible. + + This method has been added in version 0.26.2. + Setter: + @brief Sets a value indicating whether boxes are merged into polygons + @param merge True, if boxes and triangles will be merged into polygons. + + See \mag_merge? for a description of this property. + + This method has been added in version 0.26.2. + """ + mebes_boundary_datatype: int + r""" + Getter: + @brief Gets the datatype number of the boundary layer to produce + See \mebes_produce_boundary= for a description of this attribute. + + This property has been added in version 0.23.10. + + Setter: + @brief Sets the datatype number of the boundary layer to produce + See \mebes_produce_boundary= for a description of this attribute. + + This property has been added in version 0.23.10. + """ + mebes_boundary_layer: int + r""" + Getter: + @brief Gets the layer number of the boundary layer to produce + See \mebes_produce_boundary= for a description of this attribute. + + This property has been added in version 0.23.10. + + Setter: + @brief Sets the layer number of the boundary layer to produce + See \mebes_produce_boundary= for a description of this attribute. + + This property has been added in version 0.23.10. + """ + mebes_boundary_name: str + r""" + Getter: + @brief Gets the name of the boundary layer to produce + See \mebes_produce_boundary= for a description of this attribute. + + This property has been added in version 0.23.10. + + Setter: + @brief Sets the name of the boundary layer to produce + See \mebes_produce_boundary= for a description of this attribute. + + This property has been added in version 0.23.10. + """ + mebes_create_other_layers: bool + r""" + Getter: + @brief Gets a value indicating whether other layers shall be created + @return True, if other layers will be created. + This attribute acts together with a layer map (see \mebes_layer_map=). Layers not listed in this map are created as well when \mebes_create_other_layers? is true. Otherwise they are ignored. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + Setter: + @brief Specifies whether other layers shall be created + @param create True, if other layers will be created. + See \mebes_create_other_layers? for a description of this attribute. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + mebes_data_datatype: int + r""" + Getter: + @brief Gets the datatype number of the data layer to produce + + This property has been added in version 0.23.10. + + Setter: + @brief Sets the datatype number of the data layer to produce + + This property has been added in version 0.23.10. + """ + mebes_data_layer: int + r""" + Getter: + @brief Gets the layer number of the data layer to produce + + This property has been added in version 0.23.10. + + Setter: + @brief Sets the layer number of the data layer to produce + + This property has been added in version 0.23.10. + """ + mebes_data_name: str + r""" + Getter: + @brief Gets the name of the data layer to produce + + This property has been added in version 0.23.10. + + Setter: + @brief Sets the name of the data layer to produce + + This property has been added in version 0.23.10. + """ + mebes_invert: bool + r""" + Getter: + @brief Gets a value indicating whether to invert the MEBES pattern + If this property is set to true, the pattern will be inverted. + + This property has been added in version 0.22. + + Setter: + @brief Specify whether to invert the MEBES pattern + If this property is set to true, the pattern will be inverted. + + This property has been added in version 0.22. + """ + mebes_layer_map: LayerMap + r""" + Getter: + @brief Gets the layer map + @return The layer map. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + Setter: + @brief Sets the layer map + This sets a layer mapping for the reader. Unlike \mebes_set_layer_map, the 'create_other_layers' flag is not changed. + @param map The layer map to set. + + This convenience method has been added in version 0.26.2. + """ + mebes_num_shapes_per_cell: int + r""" + Getter: + @brief Gets the number of stripes collected per cell + See \mebes_num_stripes_per_cell= for details about this property. + + This property has been added in version 0.24.5. + + Setter: + @brief Specify the number of stripes collected per cell + See \mebes_num_stripes_per_cell= for details about this property. + + This property has been added in version 0.24.5. + """ + mebes_num_stripes_per_cell: int + r""" + Getter: + @brief Gets the number of stripes collected per cell + See \mebes_num_stripes_per_cell= for details about this property. + + This property has been added in version 0.23.10. + + Setter: + @brief Specify the number of stripes collected per cell + This property specifies how many stripes will be collected into one cell. + A smaller value means less but bigger cells. The default value is 64. + New cells will be formed whenever more than this number of stripes has been read + or a new segment is started and the number of shapes given by \mebes_num_shapes_per_cell + is exceeded. + + This property has been added in version 0.23.10. + """ + mebes_produce_boundary: bool + r""" + Getter: + @brief Gets a value indicating whether a boundary layer will be produced + See \mebes_produce_boundary= for details about this property. + + This property has been added in version 0.23.10. + + Setter: + @brief Specify whether to produce a boundary layer + If this property is set to true, the pattern boundary will be written to the layer and datatype specified with \mebes_boundary_name, \mebes_boundary_layer and \mebes_boundary_datatype. + By default, the boundary layer is produced. + + This property has been added in version 0.23.10. + """ + mebes_subresolution: bool + r""" + Getter: + @brief Gets a value indicating whether to invert the MEBES pattern + See \subresolution= for details about this property. + + This property has been added in version 0.23.10. + + Setter: + @brief Specify whether subresolution trapezoids are supported + If this property is set to true, subresolution trapezoid vertices are supported. + In order to implement support, the reader will create magnified instances with a magnification of 1/16. + By default this property is enabled. + + This property has been added in version 0.23.10. + """ + mebes_top_cell_index: int + r""" + Getter: + @brief Gets the cell index for the top cell to use + See \mebes_top_cell_index= for a description of this property. + + This property has been added in version 0.23.10. + + Setter: + @brief Specify the cell index for the top cell to use + If this property is set to a valid cell index, the MEBES reader will put the subcells and shapes into this cell. + + This property has been added in version 0.23.10. + """ + oasis_expect_strict_mode: int + r""" + Getter: + @hide + Setter: + @hide + """ + oasis_read_all_properties: int + r""" + Getter: + @hide + Setter: + @hide + """ + properties_enabled: bool + r""" + Getter: + @brief Gets a value indicating whether properties shall be read + @return True, if properties should be read. + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + Setter: + @brief Specifies whether properties should be read + @param enabled True, if properties should be read. + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + """ + text_enabled: bool + r""" + Getter: + @brief Gets a value indicating whether text objects shall be read + @return True, if text objects should be read. + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + Setter: + @brief Specifies whether text objects shall be read + @param enabled True, if text objects should be read. + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + """ + warn_level: int + r""" + Getter: + @brief Sets the warning level. + See \warn_level= for details about this attribute. + + This attribute has been added in version 0.28. + Setter: + @brief Sets the warning level. + The warning level is a reader-specific setting which enables or disables warnings + on specific levels. Level 0 is always "warnings off". The default level is 1 + which means "reasonable warnings emitted". + + This attribute has been added in version 0.28. + """ + @classmethod + def new(cls) -> LoadLayoutOptions: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> LoadLayoutOptions: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: LoadLayoutOptions) -> None: + r""" + @brief Assigns another object to self + """ + def cif_select_all_layers(self) -> None: + r""" + @brief Selects all layers and disables the layer map + + This disables any layer map and enables reading of all layers. + New layers will be created when required. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + def cif_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: + r""" + @brief Sets the layer map + This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. + @param map The layer map to set. + @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> LoadLayoutOptions: + r""" + @brief Creates a copy of self + """ + def dxf_keep_other_cells(self) -> bool: + r""" + @brief If this option is true, all cells are kept, not only the top cell and it's children + + This property has been added in version 0.21.15. + """ + def dxf_render_texts_as_polygons(self) -> bool: + r""" + @brief If this option is true, text objects are rendered as polygons + + This property has been added in version 0.21.15. + """ + def dxf_select_all_layers(self) -> None: + r""" + @brief Selects all layers and disables the layer map + + This disables any layer map and enables reading of all layers. + New layers will be created when required. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + def dxf_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: + r""" + @brief Sets the layer map + This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. + @param map The layer map to set. + @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + def gds2_allow_big_records(self) -> bool: + r""" + @brief Gets a value specifying whether to allow big records with a length of 32768 to 65535 bytes. + See \gds2_allow_big_records= method for a description of this property. + This property has been added in version 0.18. + """ + def gds2_allow_multi_xy_records(self) -> bool: + r""" + @brief Gets a value specifying whether to allow big polygons with multiple XY records. + See \gds2_allow_multi_xy_records= method for a description of this property. + This property has been added in version 0.18. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_properties_enabled(self) -> bool: + r""" + @brief Gets a value indicating whether properties shall be read + @return True, if properties should be read. + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + """ + def is_text_enabled(self) -> bool: + r""" + @brief Gets a value indicating whether text objects shall be read + @return True, if text objects should be read. + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + """ + def mag_select_all_layers(self) -> None: + r""" + @brief Selects all layers and disables the layer map + + This disables any layer map and enables reading of all layers. + New layers will be created when required. + + This method has been added in version 0.26.2. + """ + def mag_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: + r""" + @brief Sets the layer map + This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. + @param map The layer map to set. + @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. + + This method has been added in version 0.26.2. + """ + def mebes_select_all_layers(self) -> None: + r""" + @brief Selects all layers and disables the layer map + + This disables any layer map and enables reading of all layers. + New layers will be created when required. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + def mebes_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: + r""" + @brief Sets the layer map + This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers. + @param map The layer map to set. + @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + def select_all_layers(self) -> None: + r""" + @brief Selects all layers and disables the layer map + + This disables any layer map and enables reading of all layers. + New layers will be created when required. + + Starting with version 0.25 this method only applies to GDS2 and OASIS format. Other formats provide their own configuration. + """ + def set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: + r""" + @brief Sets the layer map + This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to add a layer name. + @param map The layer map to set.@param create_other_layers The flag telling whether other layer should be created as well. Set to false if just the layers in the mapping table should be read. + + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + """ + +class RecursiveInstanceIterator: + r""" + @brief An iterator delivering instances recursively + + The iterator can be obtained from a cell and optionally a region. + It simplifies retrieval of instances while considering + subcells as well. + Some options can be specified in addition, i.e. the hierarchy level to which to look into. + The search can be confined to instances of certain cells (see \targets=) or to certain regions. Subtrees can be selected for traversal or excluded from it (see \select_cells). + + This is some sample code: + + @code + # prints the effective instances of cell "A" as seen from the initial cell "cell" + iter = cell.begin_instances_rec + iter.targets = "A" + while !iter.at_end? + puts "Instance of #{iter.inst_cell.name} in #{cell.name}: " + (iter.dtrans * iter.inst_dtrans).to_s + iter.next + end + + # or shorter: + cell.begin_instances_rec.each do |iter| + puts "Instance of #{iter.inst_cell.name} in #{cell.name}: " + (iter.dtrans * iter.inst_dtrans).to_s + end + @/code + + Here, a target cell is specified which confines the search to instances of this particular cell. + 'iter.dtrans' gives us the accumulated transformation of all parents up to the top cell. 'iter.inst_dtrans' gives us the transformation from the current instance. 'iter.inst_cell' finally gives us the target cell of the current instance (which is always 'A' in our case). + + \Cell offers three methods to get these iterators: begin_instances_rec, begin_instances_rec_touching and begin_instances_rec_overlapping. + \Cell#begin_instances_rec will deliver a standard recursive instance iterator which starts from the given cell and iterates over all child cells. \Cell#begin_instances_rec_touching creates a RecursiveInstanceIterator which delivers the instances whose bounding boxed touch the given search box. \Cell#begin_instances_rec_overlapping gives an iterator which delivers all instances whose bounding box overlaps the search box. + + A RecursiveInstanceIterator object can also be created directly, like this: + + @code + iter = RBA::RecursiveInstanceIterator::new(layout, cell [, options ]) + @/code + + "layout" is the layout object, "cell" the \Cell object of the initial cell. + + The recursive instance iterator can be confined to a maximum hierarchy depth. By using \max_depth=, the iterator will restrict the search depth to the given depth in the cell tree. + In the same way, the iterator can be configured to start from a certain hierarchy depth using \min_depth=. The hierarchy depth always applies to the parent of the instances iterated. + + In addition, the recursive instance iterator supports selection and exclusion of subtrees. For that purpose it keeps flags per cell telling it for which cells to turn instance delivery on and off. The \select_cells method sets the "start delivery" flag while \unselect_cells sets the "stop delivery" flag. In effect, using \unselect_cells will exclude that cell plus the subtree from delivery. Parts of that subtree can be turned on again using \select_cells. For the cells selected that way, the instances of these cells and their child cells are delivered, even if their parent was unselected. + + To get instances from a specific cell, i.e. "MACRO" plus its child cells, unselect the top cell first and the select the desired cell again: + + @code + # deliver all instances inside "MACRO" and the sub-hierarchy: + iter = RBA::RecursiveInstanceIterator::new(layout, cell) + iter.unselect_cells(cell.cell_index) + iter.select_cells("MACRO") + ... + @/code + + The \unselect_all_cells and \select_all_cells methods turn on the "stop" and "start" flag for all cells respectively. If you use \unselect_all_cells and use \select_cells for a specific cell, the iterator will deliver only the instances of the selected cell, not its children. Those are still unselected by \unselect_all_cells: + + @code + # deliver all instance inside "MACRO" but not of child cells: + iter = RBA::RecursiveInstanceIterator::new(layout, cell) + iter.unselect_all_cells + iter.select_cells("MACRO") + ... + @/code + + Cell selection is done using cell indexes or glob pattern. Glob pattern are equivalent to the usual file name wildcards used on various command line shells. For example "A*" matches all cells starting with an "A". The curly brace notation and character classes are supported as well. For example "C{125,512}" matches "C125" and "C512" and "[ABC]*" matches all cells starting with an "A", a "B" or "C". "[^ABC]*" matches all cells not starting with one of that letters. + + To confine instance iteration to instances of certain cells, use the \targets feature: + + @code + # deliver all instance of "INV1": + iter = RBA::RecursiveInstanceIterator::new(layout, cell) + iter.targets = "INV1" + ... + @/code + + Targets can be specified either as lists of cell indexes or through a glob pattern. + + Instances are always delivered depth-first with child instances before their parents. A default recursive instance iterator will first deliver leaf cells, followed by the parent of these cells. + + When a search region is used, instances whose bounding box touch or overlap (depending on 'overlapping' flag) will be reported. The instance bounding box taken as reference is computed using all layers of the layout. + + The iterator will deliver the individual elements of instance arrays, confined to the search region if one is given. Consequently the return value (\current_inst_element) is an \InstElement object which is basically a combination of an \Instance object and information about the current array element. + \inst_cell, \inst_trans and \inst_dtrans are methods provided for convenience to access the current array member's transformation and the target cell of the current instance. + + The RecursiveInstanceIterator class has been introduced in version 0.27. + """ + max_depth: int + r""" + Getter: + @brief Gets the maximum hierarchy depth + + See \max_depth= for a description of that attribute. + + Setter: + @brief Specifies the maximum hierarchy depth to look into + + A depth of 0 instructs the iterator to deliver only instances from the initial cell. + A higher depth instructs the iterator to look deeper. + The depth must be specified before the instances are being retrieved. + """ + min_depth: int + r""" + Getter: + @brief Gets the minimum hierarchy depth + + See \min_depth= for a description of that attribute. + + Setter: + @brief Specifies the minimum hierarchy depth to look into + + A depth of 0 instructs the iterator to deliver instances from the top level. + 1 instructs to deliver instances from the first child level. + The minimum depth must be specified before the instances are being retrieved. + """ + overlapping: bool + r""" + Getter: + @brief Gets a flag indicating whether overlapping instances are selected when a region is used + + Setter: + @brief Sets a flag indicating whether overlapping instances are selected when a region is used + + If this flag is false, instances touching the search region are returned. + """ + region: Box + r""" + Getter: + @brief Gets the basic region that this iterator is using + The basic region is the overall box the region iterator iterates over. There may be an additional complex region that confines the region iterator. See \complex_region for this attribute. + + Setter: + @brief Sets the rectangular region that this iterator is iterating over + See \region for a description of this attribute. + Setting a simple region will reset the complex region to a rectangle and reset the iterator to the beginning of the sequence. + """ + targets: List[int] + r""" + Getter: + @brief Gets the list of target cells + See \targets= for a description of the target cell concept. This method returns a list of cell indexes of the selected target cells. + Setter: + @brief Specifies the target cells. + + If target cells are specified, only instances of these cells are delivered. This version takes a list of cell indexes for the targets. By default, no target cell list is present and the instances of all cells are delivered by the iterator. See \all_targets_enabled? and \enable_all_targets for a description of this mode. Once a target list is specified, the iteration is confined to the cells from this list. + The cells are given as a list of cell indexes. + + This method will also reset the iterator. + """ + @overload + @classmethod + def new(cls, layout: Layout, cell: Cell) -> RecursiveInstanceIterator: + r""" + @brief Creates a recursive instance iterator. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layer The layer (index) from which the shapes are taken + + This constructor creates a new recursive instance iterator which delivers the instances of the given cell plus its children. + """ + @overload + @classmethod + def new(cls, layout: Layout, cell: Cell, box: Box, overlapping: Optional[bool] = ...) -> RecursiveInstanceIterator: + r""" + @brief Creates a recursive instance iterator with a search region. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param box The search region + @param overlapping If set to true, instances overlapping the search region are reported, otherwise touching is sufficient + + This constructor creates a new recursive instance iterator which delivers the instances of the given cell plus its children. + + The search is confined to the region given by the "box" parameter. If "overlapping" is true, instances whose bounding box is overlapping the search region are reported. If "overlapping" is false, instances whose bounding box touches the search region are reported. The bounding box of instances is measured taking all layers of the target cell into account. + """ + @overload + @classmethod + def new(cls, layout: Layout, cell: Cell, region: Region, overlapping: bool) -> RecursiveInstanceIterator: + r""" + @brief Creates a recursive instance iterator with a search region. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param region The search region + @param overlapping If set to true, instances overlapping the search region are reported, otherwise touching is sufficient + + This constructor creates a new recursive instance iterator which delivers the instances of the given cell plus its children. + + The search is confined to the region given by the "region" parameter. The region needs to be a rectilinear region. + If "overlapping" is true, instances whose bounding box is overlapping the search region are reported. If "overlapping" is false, instances whose bounding box touches the search region are reported. The bounding box of instances is measured taking all layers of the target cell into account. + """ + def __copy__(self) -> RecursiveInstanceIterator: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Comparison of iterators - equality + + Two iterators are equal if they point to the same instance. + """ + @overload + def __init__(self, layout: Layout, cell: Cell) -> None: + r""" + @brief Creates a recursive instance iterator. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layer The layer (index) from which the shapes are taken + + This constructor creates a new recursive instance iterator which delivers the instances of the given cell plus its children. + """ + @overload + def __init__(self, layout: Layout, cell: Cell, box: Box, overlapping: Optional[bool] = ...) -> None: + r""" + @brief Creates a recursive instance iterator with a search region. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param box The search region + @param overlapping If set to true, instances overlapping the search region are reported, otherwise touching is sufficient + + This constructor creates a new recursive instance iterator which delivers the instances of the given cell plus its children. + + The search is confined to the region given by the "box" parameter. If "overlapping" is true, instances whose bounding box is overlapping the search region are reported. If "overlapping" is false, instances whose bounding box touches the search region are reported. The bounding box of instances is measured taking all layers of the target cell into account. + """ + @overload + def __init__(self, layout: Layout, cell: Cell, region: Region, overlapping: bool) -> None: + r""" + @brief Creates a recursive instance iterator with a search region. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param region The search region + @param overlapping If set to true, instances overlapping the search region are reported, otherwise touching is sufficient + + This constructor creates a new recursive instance iterator which delivers the instances of the given cell plus its children. + + The search is confined to the region given by the "region" parameter. The region needs to be a rectilinear region. + If "overlapping" is true, instances whose bounding box is overlapping the search region are reported. If "overlapping" is false, instances whose bounding box touches the search region are reported. The bounding box of instances is measured taking all layers of the target cell into account. + """ + def __iter__(self) -> Iterator[RecursiveInstanceIterator]: + r""" + @brief Native iteration + This method enables native iteration, e.g. + + @code + iter = ... # RecursiveInstanceIterator + iter.each do |i| + ... i is the iterator itself + end + @/code + + This is slightly more convenient than the 'at_end' .. 'next' loop. + + This feature has been introduced in version 0.28. + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Comparison of iterators - inequality + + Two iterators are not equal if they do not point to the same instance. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def all_targets_enabled(self) -> bool: + r""" + @brief Gets a value indicating whether instances of all cells are reported + See \targets= for a description of the target cell concept. + """ + def assign(self, other: RecursiveInstanceIterator) -> None: + r""" + @brief Assigns another object to self + """ + def at_end(self) -> bool: + r""" + @brief End of iterator predicate + + Returns true, if the iterator is at the end of the sequence + """ + def cell(self) -> Cell: + r""" + @brief Gets the cell the current instance sits in + """ + def cell_index(self) -> int: + r""" + @brief Gets the index of the cell the current instance sits in + This is equivalent to 'cell.cell_index'. + """ + def complex_region(self) -> Region: + r""" + @brief Gets the complex region that this iterator is using + The complex region is the effective region (a \Region object) that the iterator is selecting from the layout. This region can be a single box or a complex region. + """ + @overload + def confine_region(self, box_region: Box) -> None: + r""" + @brief Confines the region that this iterator is iterating over + This method is similar to setting the region (see \region=), but will confine any region (complex or simple) already set. Essentially it does a logical AND operation between the existing and given region. Hence this method can only reduce a region, not extend it. + """ + @overload + def confine_region(self, complex_region: Region) -> None: + r""" + @brief Confines the region that this iterator is iterating over + This method is similar to setting the region (see \region=), but will confine any region (complex or simple) already set. Essentially it does a logical AND operation between the existing and given region. Hence this method can only reduce a region, not extend it. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def current_inst_element(self) -> InstElement: + r""" + @brief Gets the current instance + + This is the instance/array element the iterator currently refers to. + This is a \InstElement object representing the current instance and the array element the iterator currently points at. + + See \inst_trans, \inst_dtrans and \inst_cell for convenience methods to access the details of the current element. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dtrans(self) -> DCplxTrans: + r""" + @brief Gets the accumulated transformation of the current instance parent cell to the top cell + + This transformation represents how the current instance is seen in the top cell. + This version returns the micron-unit transformation. + """ + def dup(self) -> RecursiveInstanceIterator: + r""" + @brief Creates a copy of self + """ + def each(self) -> Iterator[RecursiveInstanceIterator]: + r""" + @brief Native iteration + This method enables native iteration, e.g. + + @code + iter = ... # RecursiveInstanceIterator + iter.each do |i| + ... i is the iterator itself + end + @/code + + This is slightly more convenient than the 'at_end' .. 'next' loop. + + This feature has been introduced in version 0.28. + """ + def enable_all_targets(self) -> None: + r""" + @brief Enables 'all targets' mode in which instances of all cells are reported + See \targets= for a description of the target cell concept. + """ + def inst_cell(self) -> Cell: + r""" + @brief Gets the target cell of the current instance + This is the cell the current instance refers to. It is one of the \targets if a target list is given. + """ + def inst_dtrans(self) -> DCplxTrans: + r""" + @brief Gets the micron-unit transformation of the current instance + This is the transformation of the current instance inside its parent. + 'dtrans * inst_dtrans' gives the full micron-unit transformation how the current cell is seen in the top cell. + See also \inst_trans and \inst_cell. + """ + def inst_trans(self) -> ICplxTrans: + r""" + @brief Gets the integer-unit transformation of the current instance + This is the transformation of the current instance inside its parent. + 'trans * inst_trans' gives the full transformation how the current cell is seen in the top cell. + See also \inst_dtrans and \inst_cell. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def layout(self) -> Layout: + r""" + @brief Gets the layout this iterator is connected to + """ + def next(self) -> None: + r""" + @brief Increments the iterator + This moves the iterator to the next instance inside the search scope. + """ + def path(self) -> List[InstElement]: + r""" + @brief Gets the instantiation path of the instance addressed currently + + This attribute is a sequence of \InstElement objects describing the cell instance path from the initial cell to the current instance. The path is empty if the current instance is in the top cell. + """ + def reset(self) -> None: + r""" + @brief Resets the iterator to the initial state + """ + def reset_selection(self) -> None: + r""" + @brief Resets the selection to the default state + + In the initial state, the top cell and its children are selected. Child cells can be switched on and off together with their sub-hierarchy using \select_cells and \unselect_cells. + + This method will also reset the iterator. + """ + def select_all_cells(self) -> None: + r""" + @brief Selects all cells. + + This method will set the "selected" mark on all cells. The effect is that subsequent calls of \unselect_cells will unselect only the specified cells, not their children, because they are still unselected. + + This method will also reset the iterator. + """ + @overload + def select_cells(self, cells: Sequence[int]) -> None: + r""" + @brief Unselects the given cells. + + This method will sets the "selected" mark on the given cells. That means that these cells or their child cells are visited, unless they are marked as "unselected" again with the \unselect_cells method. + + The cells are given as a list of cell indexes. + + This method will also reset the iterator. + """ + @overload + def select_cells(self, cells: str) -> None: + r""" + @brief Unselects the given cells. + + This method will sets the "selected" mark on the given cells. That means that these cells or their child cells are visited, unless they are marked as "unselected" again with the \unselect_cells method. + + The cells are given as a glob pattern. + A glob pattern follows the syntax of file names on the shell (i.e. "A*" are all cells starting with a letter "A"). + + This method will also reset the iterator. + """ + def top_cell(self) -> Cell: + r""" + @brief Gets the top cell this iterator is connected to + """ + def trans(self) -> ICplxTrans: + r""" + @brief Gets the accumulated transformation of the current instance parent cell to the top cell + + This transformation represents how the current instance is seen in the top cell. + """ + def unselect_all_cells(self) -> None: + r""" + @brief Unselects all cells. + + This method will set the "unselected" mark on all cells. The effect is that subsequent calls of \select_cells will select only the specified cells, not their children, because they are still unselected. + + This method will also reset the iterator. + """ + @overload + def unselect_cells(self, cells: Sequence[int]) -> None: + r""" + @brief Unselects the given cells. + + This method will sets the "unselected" mark on the given cells. That means that these cells or their child cells will not be visited, unless they are marked as "selected" again with the \select_cells method. + + The cells are given as a list of cell indexes. + + This method will also reset the iterator. + """ + @overload + def unselect_cells(self, cells: str) -> None: + r""" + @brief Unselects the given cells. + + This method will sets the "unselected" mark on the given cells. That means that these cells or their child cells will not be visited, unless they are marked as "selected" again with the \select_cells method. + + The cells are given as a glob pattern. + A glob pattern follows the syntax of file names on the shell (i.e. "A*" are all cells starting with a letter "A"). + + This method will also reset the iterator. + """ + +class RecursiveShapeIterator: + r""" + @brief An iterator delivering shapes recursively + + The iterator can be obtained from a cell, a layer and optionally a region. + It simplifies retrieval of shapes from a geometrical region while considering + subcells as well. + Some options can be specified in addition, i.e. the level to which to look into or + shape classes and shape properties. The shapes are retrieved by using the \shape method, + \next moves to the next shape and \at_end tells, if the iterator has move shapes to deliver. + + This is some sample code: + + @code + # print the polygon-like objects as seen from the initial cell "cell" + iter = cell.begin_shapes_rec(layer) + while !iter.at_end? + if iter.shape.renders_polygon? + polygon = iter.shape.polygon.transformed(iter.itrans) + puts "In cell #{iter.cell.name}: " + polygon.to_s + end + iter.next + end + + # or shorter: + cell.begin_shapes_rec(layer).each do |iter| + if iter.shape.renders_polygon? + polygon = iter.shape.polygon.transformed(iter.itrans) + puts "In cell #{iter.cell.name}: " + polygon.to_s + end + end + @/code + + \Cell offers three methods to get these iterators: begin_shapes_rec, begin_shapes_rec_touching and begin_shapes_rec_overlapping. + \Cell#begin_shapes_rec will deliver a standard recursive shape iterator which starts from the given cell and iterates over all child cells. \Cell#begin_shapes_rec_touching delivers a RecursiveShapeIterator which delivers the shapes whose bounding boxed touch the given search box. \Cell#begin_shapes_rec_overlapping delivers all shapes whose bounding box overlaps the search box. + + A RecursiveShapeIterator object can also be created explicitly. This allows some more options, i.e. using multiple layers. A multi-layer recursive shape iterator can be created like this: + + @code + iter = RBA::RecursiveShapeIterator::new(layout, cell, [ layer_index1, layer_index2 .. ]) + @/code + + "layout" is the layout object, "cell" the RBA::Cell object of the initial cell. layer_index1 etc. are the layer indexes of the layers to get the shapes from. While iterating, \RecursiveShapeIterator#layer delivers the layer index of the current shape. + + The recursive shape iterator can be confined to a maximum hierarchy depth. By using \max_depth=, the iterator will restrict the search depth to the given depth in the cell tree. + + In addition, the recursive shape iterator supports selection and exclusion of subtrees. For that purpose it keeps flags per cell telling it for which cells to turn shape delivery on and off. The \select_cells method sets the "start delivery" flag while \unselect_cells sets the "stop delivery" flag. In effect, using \unselect_cells will exclude that cell plus the subtree from delivery. Parts of that subtree can be turned on again using \select_cells. For the cells selected that way, the shapes of these cells and their child cells are delivered, even if their parent was unselected. + + To get shapes from a specific cell, i.e. "MACRO" plus its child cells, unselect the top cell first and the select the desired cell again: + + @code + # deliver all shapes inside "MACRO" and the sub-hierarchy: + iter = RBA::RecursiveShapeIterator::new(layout, cell, layer) + iter.unselect_cells(cell.cell_index) + iter.select_cells("MACRO") + @/code + + Note that if "MACRO" uses library cells for example which are used otherwise as well, the iterator will only deliver the shapes for those instances belonging to "MACRO" (directly or indirectly), not those for other instances of these library cells. + + The \unselect_all_cells and \select_all_cells methods turn on the "stop" and "start" flag for all cells respectively. If you use \unselect_all_cells and use \select_cells for a specific cell, the iterator will deliver only the shapes of the selected cell, not its children. Those are still unselected by \unselect_all_cells: + + @code + # deliver all shapes of "MACRO" but not of child cells: + iter = RBA::RecursiveShapeIterator::new(layout, cell, layer) + iter.unselect_all_cells + iter.select_cells("MACRO") + @/code + + Cell selection is done using cell indexes or glob pattern. Glob pattern are equivalent to the usual file name wildcards used on various command line shells. For example "A*" matches all cells starting with an "A". The curly brace notation and character classes are supported as well. For example "C{125,512}" matches "C125" and "C512" and "[ABC]*" matches all cells starting with an "A", a "B" or "C". "[^ABC]*" matches all cells not starting with one of that letters. + + The RecursiveShapeIterator class has been introduced in version 0.18 and has been extended substantially in 0.23. + """ + global_dtrans: DCplxTrans + r""" + Getter: + @brief Gets the global transformation to apply to all shapes delivered (in micrometer units) + See also \global_dtrans=. + + This method has been introduced in version 0.27. + + Setter: + @brief Sets the global transformation to apply to all shapes delivered (transformation in micrometer units) + The global transformation will be applied to all shapes delivered by biasing the "trans" attribute. + The search regions apply to the coordinate space after global transformation. + + This method has been introduced in version 0.27. + """ + global_trans: ICplxTrans + r""" + Getter: + @brief Gets the global transformation to apply to all shapes delivered + See also \global_trans=. + + This method has been introduced in version 0.27. + + Setter: + @brief Sets the global transformation to apply to all shapes delivered + The global transformation will be applied to all shapes delivered by biasing the "trans" attribute. + The search regions apply to the coordinate space after global transformation. + + This method has been introduced in version 0.27. + """ + max_depth: int + r""" + Getter: + @brief Gets the maximum hierarchy depth + + See \max_depth= for a description of that attribute. + + This method has been introduced in version 0.23. + + Setter: + @brief Specifies the maximum hierarchy depth to look into + + A depth of 0 instructs the iterator to deliver only shapes from the initial cell. + The depth must be specified before the shapes are being retrieved. + Setting the depth resets the iterator. + """ + min_depth: int + r""" + Getter: + @brief Gets the minimum hierarchy depth + + See \min_depth= for a description of that attribute. + + This method has been introduced in version 0.27. + + Setter: + @brief Specifies the minimum hierarchy depth to look into + + A depth of 0 instructs the iterator to deliver shapes from the top level. + 1 instructs to deliver shapes from the first child level. + The minimum depth must be specified before the shapes are being retrieved. + + This method has been introduced in version 0.27. + """ + overlapping: bool + r""" + Getter: + @brief Gets a flag indicating whether overlapping shapes are selected when a region is used + + This method has been introduced in version 0.23. + + Setter: + @brief Sets a flag indicating whether overlapping shapes are selected when a region is used + + If this flag is false, shapes touching the search region are returned. + + This method has been introduced in version 0.23. + """ + region: Box + r""" + Getter: + @brief Gets the basic region that this iterator is using + The basic region is the overall box the region iterator iterates over. There may be an additional complex region that confines the region iterator. See \complex_region for this attribute. + + This method has been introduced in version 0.23. + + Setter: + @brief Sets the rectangular region that this iterator is iterating over + See \region for a description of this attribute. + Setting a simple region will reset the complex region to a rectangle and reset the iterator to the beginning of the sequence. + This method has been introduced in version 0.23. + """ + shape_flags: int + r""" + Getter: + @brief Gets the shape selection flags + + See \shape_flags= for a description of that property. + + This getter has been introduced in version 0.28. + + Setter: + @brief Specifies the shape selection flags + + The flags are the same then being defined in \Shapes (the default is RBA::Shapes::SAll). + The flags must be specified before the shapes are being retrieved. + Settings the shapes flags will reset the iterator. + """ + @overload + @classmethod + def new(cls, layout: Layout, cell: Cell, layer: int) -> RecursiveShapeIterator: + r""" + @brief Creates a recursive, single-layer shape iterator. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layer The layer (index) from which the shapes are taken + + This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layer given by the layer index in the "layer" parameter. + + This constructor has been introduced in version 0.23. + """ + @overload + @classmethod + def new(cls, layout: Layout, cell: Cell, layers: Sequence[int]) -> RecursiveShapeIterator: + r""" + @brief Creates a recursive, multi-layer shape iterator. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layers The layer indexes from which the shapes are taken + + This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. + While iterating use the \layer method to retrieve the layer of the current shape. + + This constructor has been introduced in version 0.23. + """ + @overload + @classmethod + def new(cls, layout: Layout, cell: Cell, layer: int, box: Box, overlapping: Optional[bool] = ...) -> RecursiveShapeIterator: + r""" + @brief Creates a recursive, single-layer shape iterator with a region. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layer The layer (index) from which the shapes are taken + @param box The search region + @param overlapping If set to true, shapes overlapping the search region are reported, otherwise touching is sufficient + + This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layer given by the layer index in the "layer" parameter. + + The search is confined to the region given by the "box" parameter. If "overlapping" is true, shapes whose bounding box is overlapping the search region are reported. If "overlapping" is false, shapes whose bounding box touches the search region are reported. + + This constructor has been introduced in version 0.23. The 'overlapping' parameter has been made optional in version 0.27. + """ + @overload + @classmethod + def new(cls, layout: Layout, cell: Cell, layer: int, region: Region, overlapping: Optional[bool] = ...) -> RecursiveShapeIterator: + r""" + @brief Creates a recursive, single-layer shape iterator with a region. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layer The layer (index) from which the shapes are taken + @param region The search region + @param overlapping If set to true, shapes overlapping the search region are reported, otherwise touching is sufficient + + This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layer given by the layer index in the "layer" parameter. + + The search is confined to the region given by the "region" parameter. The region needs to be a rectilinear region. + If "overlapping" is true, shapes whose bounding box is overlapping the search region are reported. If "overlapping" is false, shapes whose bounding box touches the search region are reported. + + This constructor has been introduced in version 0.25. The 'overlapping' parameter has been made optional in version 0.27. + """ + @overload + @classmethod + def new(cls, layout: Layout, cell: Cell, layers: Sequence[int], box: Box, overlapping: Optional[bool] = ...) -> RecursiveShapeIterator: + r""" + @brief Creates a recursive, multi-layer shape iterator with a region. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layers The layer indexes from which the shapes are taken + @param box The search region + @param overlapping If set to true, shapes overlapping the search region are reported, otherwise touching is sufficient + + This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. + While iterating use the \layer method to retrieve the layer of the current shape. + + The search is confined to the region given by the "box" parameter. If "overlapping" is true, shapes whose bounding box is overlapping the search region are reported. If "overlapping" is false, shapes whose bounding box touches the search region are reported. + + This constructor has been introduced in version 0.23. The 'overlapping' parameter has been made optional in version 0.27. + """ + @overload + @classmethod + def new(cls, layout: Layout, cell: Cell, layers: Sequence[int], region: Region, overlapping: Optional[bool] = ...) -> RecursiveShapeIterator: + r""" + @brief Creates a recursive, multi-layer shape iterator with a region. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layers The layer indexes from which the shapes are taken + @param region The search region + @param overlapping If set to true, shapes overlapping the search region are reported, otherwise touching is sufficient + + This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. + While iterating use the \layer method to retrieve the layer of the current shape. + + The search is confined to the region given by the "region" parameter. The region needs to be a rectilinear region. + If "overlapping" is true, shapes whose bounding box is overlapping the search region are reported. If "overlapping" is false, shapes whose bounding box touches the search region are reported. + + This constructor has been introduced in version 0.23. The 'overlapping' parameter has been made optional in version 0.27. + """ + def __copy__(self) -> RecursiveShapeIterator: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Comparison of iterators - equality + + Two iterators are equal if they point to the same shape. + """ + @overload + def __init__(self, layout: Layout, cell: Cell, layer: int) -> None: + r""" + @brief Creates a recursive, single-layer shape iterator. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layer The layer (index) from which the shapes are taken + + This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layer given by the layer index in the "layer" parameter. + + This constructor has been introduced in version 0.23. + """ + @overload + def __init__(self, layout: Layout, cell: Cell, layers: Sequence[int]) -> None: + r""" + @brief Creates a recursive, multi-layer shape iterator. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layers The layer indexes from which the shapes are taken + + This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. + While iterating use the \layer method to retrieve the layer of the current shape. + + This constructor has been introduced in version 0.23. + """ + @overload + def __init__(self, layout: Layout, cell: Cell, layer: int, box: Box, overlapping: Optional[bool] = ...) -> None: + r""" + @brief Creates a recursive, single-layer shape iterator with a region. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layer The layer (index) from which the shapes are taken + @param box The search region + @param overlapping If set to true, shapes overlapping the search region are reported, otherwise touching is sufficient + + This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layer given by the layer index in the "layer" parameter. + + The search is confined to the region given by the "box" parameter. If "overlapping" is true, shapes whose bounding box is overlapping the search region are reported. If "overlapping" is false, shapes whose bounding box touches the search region are reported. + + This constructor has been introduced in version 0.23. The 'overlapping' parameter has been made optional in version 0.27. + """ + @overload + def __init__(self, layout: Layout, cell: Cell, layer: int, region: Region, overlapping: Optional[bool] = ...) -> None: + r""" + @brief Creates a recursive, single-layer shape iterator with a region. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layer The layer (index) from which the shapes are taken + @param region The search region + @param overlapping If set to true, shapes overlapping the search region are reported, otherwise touching is sufficient + + This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layer given by the layer index in the "layer" parameter. + + The search is confined to the region given by the "region" parameter. The region needs to be a rectilinear region. + If "overlapping" is true, shapes whose bounding box is overlapping the search region are reported. If "overlapping" is false, shapes whose bounding box touches the search region are reported. + + This constructor has been introduced in version 0.25. The 'overlapping' parameter has been made optional in version 0.27. + """ + @overload + def __init__(self, layout: Layout, cell: Cell, layers: Sequence[int], box: Box, overlapping: Optional[bool] = ...) -> None: + r""" + @brief Creates a recursive, multi-layer shape iterator with a region. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layers The layer indexes from which the shapes are taken + @param box The search region + @param overlapping If set to true, shapes overlapping the search region are reported, otherwise touching is sufficient + + This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. + While iterating use the \layer method to retrieve the layer of the current shape. + + The search is confined to the region given by the "box" parameter. If "overlapping" is true, shapes whose bounding box is overlapping the search region are reported. If "overlapping" is false, shapes whose bounding box touches the search region are reported. + + This constructor has been introduced in version 0.23. The 'overlapping' parameter has been made optional in version 0.27. + """ + @overload + def __init__(self, layout: Layout, cell: Cell, layers: Sequence[int], region: Region, overlapping: Optional[bool] = ...) -> None: + r""" + @brief Creates a recursive, multi-layer shape iterator with a region. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layers The layer indexes from which the shapes are taken + @param region The search region + @param overlapping If set to true, shapes overlapping the search region are reported, otherwise touching is sufficient + + This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. + While iterating use the \layer method to retrieve the layer of the current shape. + + The search is confined to the region given by the "region" parameter. The region needs to be a rectilinear region. + If "overlapping" is true, shapes whose bounding box is overlapping the search region are reported. If "overlapping" is false, shapes whose bounding box touches the search region are reported. + + This constructor has been introduced in version 0.23. The 'overlapping' parameter has been made optional in version 0.27. + """ + def __iter__(self) -> Iterator[RecursiveShapeIterator]: + r""" + @brief Native iteration + This method enables native iteration, e.g. + + @code + iter = ... # RecursiveShapeIterator + iter.each do |i| + ... i is the iterator itself + end + @/code + + This is slightly more convenient than the 'at_end' .. 'next' loop. + + This feature has been introduced in version 0.28. + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Comparison of iterators - inequality + + Two iterators are not equal if they do not point to the same shape. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def always_apply_dtrans(self) -> DCplxTrans: + r""" + @brief Gets the global transformation if at top level, unity otherwise (micrometer-unit version) + As the global transformation is only applicable on top level, use this method to transform shapes and instances into their local (cell-level) version while considering the global transformation properly. + + This method has been introduced in version 0.27. + """ + def always_apply_trans(self) -> ICplxTrans: + r""" + @brief Gets the global transformation if at top level, unity otherwise + As the global transformation is only applicable on top level, use this method to transform shapes and instances into their local (cell-level) version while considering the global transformation properly. + + This method has been introduced in version 0.27. + """ + def assign(self, other: RecursiveShapeIterator) -> None: + r""" + @brief Assigns another object to self + """ + def at_end(self) -> bool: + r""" + @brief End of iterator predicate + + Returns true, if the iterator is at the end of the sequence + """ + def cell(self) -> Cell: + r""" + @brief Gets the current cell's object + + This method has been introduced in version 0.23. + """ + def cell_index(self) -> int: + r""" + @brief Gets the current cell's index + """ + def complex_region(self) -> Region: + r""" + @brief Gets the complex region that this iterator is using + The complex region is the effective region (a \Region object) that the iterator is selecting from the layout layers. This region can be a single box or a complex region. + + This method has been introduced in version 0.25. + """ + @overload + def confine_region(self, box_region: Box) -> None: + r""" + @brief Confines the region that this iterator is iterating over + This method is similar to setting the region (see \region=), but will confine any region (complex or simple) already set. Essentially it does a logical AND operation between the existing and given region. Hence this method can only reduce a region, not extend it. + + This method has been introduced in version 0.25. + """ + @overload + def confine_region(self, complex_region: Region) -> None: + r""" + @brief Confines the region that this iterator is iterating over + This method is similar to setting the region (see \region=), but will confine any region (complex or simple) already set. Essentially it does a logical AND operation between the existing and given region. Hence this method can only reduce a region, not extend it. + + This method has been introduced in version 0.25. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dtrans(self) -> DCplxTrans: + r""" + @brief Gets the transformation into the initial cell applicable for floating point types + + This transformation corresponds to the one delivered by \trans, but is applicable for the floating-point shape types in micron unit space. + + This method has been introduced in version 0.25.3. + """ + def dup(self) -> RecursiveShapeIterator: + r""" + @brief Creates a copy of self + """ + def each(self) -> Iterator[RecursiveShapeIterator]: + r""" + @brief Native iteration + This method enables native iteration, e.g. + + @code + iter = ... # RecursiveShapeIterator + iter.each do |i| + ... i is the iterator itself + end + @/code + + This is slightly more convenient than the 'at_end' .. 'next' loop. + + This feature has been introduced in version 0.28. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def itrans(self) -> ICplxTrans: + r""" + @brief Gets the current transformation by which the shapes must be transformed into the initial cell + + The shapes delivered are not transformed. Instead, this transformation must be applied to + get the shape in the coordinate system of the top cell. + + Starting with version 0.25, this transformation is a int-to-int transformation the 'itrans' method which was providing this transformation before is deprecated. + """ + def layer(self) -> int: + r""" + @brief Returns the layer index where the current shape is coming from. + + This method has been introduced in version 0.23. + """ + def layout(self) -> Layout: + r""" + @brief Gets the layout this iterator is connected to + + This method has been introduced in version 0.23. + """ + def next(self) -> None: + r""" + @brief Increments the iterator + This moves the iterator to the next shape inside the search scope. + """ + def path(self) -> List[InstElement]: + r""" + @brief Gets the instantiation path of the shape addressed currently + + This attribute is a sequence of \InstElement objects describing the cell instance path from the initial cell to the current cell containing the current shape. + + This method has been introduced in version 0.25. + """ + def reset(self) -> None: + r""" + @brief Resets the iterator to the initial state + + This method has been introduced in version 0.23. + """ + def reset_selection(self) -> None: + r""" + @brief Resets the selection to the default state + + In the initial state, the top cell and its children are selected. Child cells can be switched on and off together with their sub-hierarchy using \select_cells and \unselect_cells. + + This method will also reset the iterator. + + This method has been introduced in version 0.23. + """ + def select_all_cells(self) -> None: + r""" + @brief Selects all cells. + + This method will set the "selected" mark on all cells. The effect is that subsequent calls of \unselect_cells will unselect only the specified cells, not their children, because they are still unselected. + + This method will also reset the iterator. + + This method has been introduced in version 0.23. + """ + @overload + def select_cells(self, cells: Sequence[int]) -> None: + r""" + @brief Unselects the given cells. + + This method will sets the "selected" mark on the given cells. That means that these cells or their child cells are visited, unless they are marked as "unselected" again with the \unselect_cells method. + + The cells are given as a list of cell indexes. + + This method will also reset the iterator. + + This method has been introduced in version 0.23. + """ + @overload + def select_cells(self, cells: str) -> None: + r""" + @brief Unselects the given cells. + + This method will sets the "selected" mark on the given cells. That means that these cells or their child cells are visited, unless they are marked as "unselected" again with the \unselect_cells method. + + The cells are given as a glob pattern. + A glob pattern follows the syntax of file names on the shell (i.e. "A*" are all cells starting with a letter "A"). + + This method will also reset the iterator. + + This method has been introduced in version 0.23. + """ + def shape(self) -> Shape: + r""" + @brief Gets the current shape + + Returns the shape currently referred to by the recursive iterator. + This shape is not transformed yet and is located in the current cell. + """ + def top_cell(self) -> Cell: + r""" + @brief Gets the top cell this iterator is connected to + + This method has been introduced in version 0.23. + """ + def trans(self) -> ICplxTrans: + r""" + @brief Gets the current transformation by which the shapes must be transformed into the initial cell + + The shapes delivered are not transformed. Instead, this transformation must be applied to + get the shape in the coordinate system of the top cell. + + Starting with version 0.25, this transformation is a int-to-int transformation the 'itrans' method which was providing this transformation before is deprecated. + """ + def unselect_all_cells(self) -> None: + r""" + @brief Unselects all cells. + + This method will set the "unselected" mark on all cells. The effect is that subsequent calls of \select_cells will select only the specified cells, not their children, because they are still unselected. + + This method will also reset the iterator. + + This method has been introduced in version 0.23. + """ + @overload + def unselect_cells(self, cells: Sequence[int]) -> None: + r""" + @brief Unselects the given cells. + + This method will sets the "unselected" mark on the given cells. That means that these cells or their child cells will not be visited, unless they are marked as "selected" again with the \select_cells method. + + The cells are given as a list of cell indexes. + + This method will also reset the iterator. + + This method has been introduced in version 0.23. + """ + @overload + def unselect_cells(self, cells: str) -> None: + r""" + @brief Unselects the given cells. + + This method will sets the "unselected" mark on the given cells. That means that these cells or their child cells will not be visited, unless they are marked as "selected" again with the \select_cells method. + + The cells are given as a glob pattern. + A glob pattern follows the syntax of file names on the shell (i.e. "A*" are all cells starting with a letter "A"). + + This method will also reset the iterator. + + This method has been introduced in version 0.23. + """ + +class Region(ShapeCollection): + r""" + @brief A region (a potentially complex area consisting of multiple polygons) + + + This class was introduced to simplify operations on polygon sets like boolean or sizing operations. Regions consist of many polygons and thus are a generalization of single polygons which describes a single coherence set of points. Regions support a variety of operations and have several states. + + The region's state can be empty (does not contain anything) or box-like, i.e. the region consists of a single box. In that case, some operations can be simplified. Regions can have merged state. In merged state, regions consist of merged (non-touching, non-self overlapping) polygons. Each polygon describes one coherent area in merged state. + + The preferred representation of polygons inside the region are polygons with holes. + + Regions are always expressed in database units. If you want to use regions from different database unit domains, scale the regions accordingly, i.e. by using the \transformed method. + + + Regions provide convenient operators for the boolean operations. Hence it is often no longer required to work with the \EdgeProcessor class. For example: + + @code + r1 = RBA::Region::new(RBA::Box::new(0, 0, 100, 100)) + r2 = RBA::Region::new(RBA::Box::new(20, 20, 80, 80)) + # compute the XOR: + r1_xor_r2 = r1 ^ r2 + @/code + + Regions can be used in two different flavors: in raw mode or merged semantics. With merged semantics (the default), connected polygons are considered to belong together and are effectively merged. + Overlapping areas are counted once in that mode. Internal edges (i.e. arising from cut lines) are not considered. + In raw mode (without merged semantics), each polygon is considered as it is. Overlaps between polygons + may exists and merging has to be done explicitly using the \merge method. The semantics can be + selected using \merged_semantics=. + + + This class has been introduced in version 0.23. + """ + class Metrics: + r""" + @brief This class represents the metrics type for \Region#width and related checks. + + This enum has been introduced in version 0.27. + """ + Euclidian: ClassVar[Region.Metrics] + r""" + @brief Specifies Euclidian metrics for the check functions + This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies Euclidian metrics, i.e. the distance between two points is measured by: + + @code + d = sqrt(dx^2 + dy^2) + @/code + + All points within a circle with radius d around one point are considered to have a smaller distance than d. + """ + Projection: ClassVar[Region.Metrics] + r""" + @brief Specifies projected distance metrics for the check functions + This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies projected metrics, i.e. the distance is defined as the minimum distance measured perpendicular to one edge. That implies that the distance is defined only where two edges have a non-vanishing projection onto each other. + """ + Square: ClassVar[Region.Metrics] + r""" + @brief Specifies square metrics for the check functions + This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies square metrics, i.e. the distance between two points is measured by: + + @code + d = max(abs(dx), abs(dy)) + @/code + + All points within a square with length 2*d around one point are considered to have a smaller distance than d in this metrics. + """ + @overload + @classmethod + def new(cls, i: int) -> Region.Metrics: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> Region.Metrics: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __lt__(self, other: Region.Metrics) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + class RectFilter: + r""" + @brief This class represents the error filter mode on rectangles for \Region#separation and related checks. + + This enum has been introduced in version 0.27. + """ + FourSidesAllowed: ClassVar[Region.RectFilter] + r""" + @brief Allow errors when on all sides + """ + NoRectFilter: ClassVar[Region.RectFilter] + r""" + @brief Specifies no filtering + """ + OneSideAllowed: ClassVar[Region.RectFilter] + r""" + @brief Allow errors on one side + """ + ThreeSidesAllowed: ClassVar[Region.RectFilter] + r""" + @brief Allow errors when on three sides + """ + TwoConnectedSidesAllowed: ClassVar[Region.RectFilter] + r""" + @brief Allow errors on two sides ("L" configuration) + """ + TwoOppositeSidesAllowed: ClassVar[Region.RectFilter] + r""" + @brief Allow errors on two opposite sides + """ + TwoSidesAllowed: ClassVar[Region.RectFilter] + r""" + @brief Allow errors on two sides (not specified which) + """ + @overload + @classmethod + def new(cls, i: int) -> Region.RectFilter: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> Region.RectFilter: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __lt__(self, other: Region.RectFilter) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + class OppositeFilter: + r""" + @brief This class represents the opposite error filter mode for \Region#separation and related checks. + + This enum has been introduced in version 0.27. + """ + NoOppositeFilter: ClassVar[Region.OppositeFilter] + r""" + @brief No opposite filtering + """ + NotOpposite: ClassVar[Region.OppositeFilter] + r""" + @brief Only errors NOT appearing on opposite sides of a figure will be reported + """ + OnlyOpposite: ClassVar[Region.OppositeFilter] + r""" + @brief Only errors appearing on opposite sides of a figure will be reported + """ + @overload + @classmethod + def new(cls, i: int) -> Region.OppositeFilter: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> Region.OppositeFilter: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __lt__(self, other: Region.OppositeFilter) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + Euclidian: ClassVar[Region.Metrics] + r""" + @brief Specifies Euclidian metrics for the check functions + This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies Euclidian metrics, i.e. the distance between two points is measured by: + + @code + d = sqrt(dx^2 + dy^2) + @/code + + All points within a circle with radius d around one point are considered to have a smaller distance than d. + """ + FourSidesAllowed: ClassVar[Region.RectFilter] + r""" + @brief Allow errors when on all sides + """ + NoOppositeFilter: ClassVar[Region.OppositeFilter] + r""" + @brief No opposite filtering + """ + NoRectFilter: ClassVar[Region.RectFilter] + r""" + @brief Specifies no filtering + """ + NotOpposite: ClassVar[Region.OppositeFilter] + r""" + @brief Only errors NOT appearing on opposite sides of a figure will be reported + """ + OneSideAllowed: ClassVar[Region.RectFilter] + r""" + @brief Allow errors on one side + """ + OnlyOpposite: ClassVar[Region.OppositeFilter] + r""" + @brief Only errors appearing on opposite sides of a figure will be reported + """ + Projection: ClassVar[Region.Metrics] + r""" + @brief Specifies projected distance metrics for the check functions + This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies projected metrics, i.e. the distance is defined as the minimum distance measured perpendicular to one edge. That implies that the distance is defined only where two edges have a non-vanishing projection onto each other. + """ + Square: ClassVar[Region.Metrics] + r""" + @brief Specifies square metrics for the check functions + This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies square metrics, i.e. the distance between two points is measured by: + + @code + d = max(abs(dx), abs(dy)) + @/code + + All points within a square with length 2*d around one point are considered to have a smaller distance than d in this metrics. + """ + ThreeSidesAllowed: ClassVar[Region.RectFilter] + r""" + @brief Allow errors when on three sides + """ + TwoConnectedSidesAllowed: ClassVar[Region.RectFilter] + r""" + @brief Allow errors on two sides ("L" configuration) + """ + TwoOppositeSidesAllowed: ClassVar[Region.RectFilter] + r""" + @brief Allow errors on two opposite sides + """ + TwoSidesAllowed: ClassVar[Region.RectFilter] + r""" + @brief Allow errors on two sides (not specified which) + """ + base_verbosity: int + r""" + Getter: + @brief Gets the minimum verbosity for timing reports + See \base_verbosity= for details. + + This method has been introduced in version 0.26. + + Setter: + @brief Sets the minimum verbosity for timing reports + Timing reports will be given only if the verbosity is larger than this value. Detailed reports will be given when the verbosity is more than this value plus 10. + In binary operations, the base verbosity of the first argument is considered. + + This method has been introduced in version 0.26. + """ + merged_semantics: bool + r""" + Getter: + @brief Gets a flag indicating whether merged semantics is enabled + See \merged_semantics= for a description of this attribute. + + Setter: + @brief Enables or disables merged semantics + If merged semantics is enabled (the default), coherent polygons will be considered + as single regions and artificial edges such as cut-lines will not be considered. + Merged semantics thus is equivalent to considering coherent areas rather than + single polygons + """ + min_coherence: bool + r""" + Getter: + @brief Gets a flag indicating whether minimum coherence is selected + See \min_coherence= for a description of this attribute. + + Setter: + @brief Enable or disable minimum coherence + If minimum coherence is set, the merge operations (explicit merge with \merge or + implicit merge through merged_semantics) are performed using minimum coherence mode. + The coherence mode determines how kissing-corner situations are resolved. If + minimum coherence is selected, they are resolved such that multiple polygons are + created which touch at a corner). + + The default setting is maximum coherence (min_coherence = false). + """ + strict_handling: bool + r""" + Getter: + @brief Gets a flag indicating whether merged semantics is enabled + See \strict_handling= for a description of this attribute. + + This method has been introduced in version 0.23.2. + Setter: + @brief Enables or disables strict handling + + Strict handling means to leave away some optimizations. Specifically the + output of boolean operations will be merged even if one input is empty. + Without strict handling, the operation will be optimized and output + won't be merged. + + Strict handling is disabled by default and optimization is in place. + + This method has been introduced in version 0.23.2. + """ + @overload + @classmethod + def new(cls) -> Region: + r""" + @brief Default constructor + + This constructor creates an empty region. + """ + @overload + @classmethod + def new(cls, array: Sequence[Polygon]) -> Region: + r""" + @brief Constructor from a polygon array + + This constructor creates a region from an array of polygons. + """ + @overload + @classmethod + def new(cls, box: Box) -> Region: + r""" + @brief Box constructor + + This constructor creates a region from a box. + """ + @overload + @classmethod + def new(cls, path: Path) -> Region: + r""" + @brief Path constructor + + This constructor creates a region from a path. + """ + @overload + @classmethod + def new(cls, polygon: Polygon) -> Region: + r""" + @brief Polygon constructor + + This constructor creates a region from a polygon. + """ + @overload + @classmethod + def new(cls, polygon: SimplePolygon) -> Region: + r""" + @brief Simple polygon constructor + + This constructor creates a region from a simple polygon. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator) -> Region: + r""" + @brief Constructor from a hierarchical shape set + + This constructor creates a region from the shapes delivered by the given recursive shape iterator. + Text objects and edges are not inserted, because they cannot be converted to polygons. + This method allows feeding the shapes from a hierarchy of cells into the region. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::Region::new(layout.begin_shapes(cell, layer)) + @/code + """ + @overload + @classmethod + def new(cls, shapes: Shapes) -> Region: + r""" + @brief Shapes constructor + + This constructor creates a region from a \Shapes collection. + + This constructor has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> Region: + r""" + @brief Constructor from a hierarchical shape set with a transformation + + This constructor creates a region from the shapes delivered by the given recursive shape iterator. + Text objects and edges are not inserted, because they cannot be converted to polygons. + On the delivered shapes it applies the given transformation. + This method allows feeding the shapes from a hierarchy of cells into the region. + The transformation is useful to scale to a specific database unit for example. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Region::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, deep_shape_store: DeepShapeStore, area_ratio: Optional[float] = ..., max_vertex_count: Optional[int] = ...) -> Region: + r""" + @brief Constructor for a deep region from a hierarchical shape set + + This constructor creates a hierarchical region. Use a \DeepShapeStore object to supply the hierarchical heap. See \DeepShapeStore for more details. + + 'area_ratio' and 'max_vertex' supply two optimization parameters which control how big polygons are split to reduce the region's polygon complexity. + + @param shape_iterator The recursive shape iterator which delivers the hierarchy to take + @param deep_shape_store The hierarchical heap (see there) + @param area_ratio The maximum ratio of bounding box to polygon area before polygons are split + + This method has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region: + r""" + @brief Constructor from a text set + + @param shape_iterator The iterator from which to derive the texts + @param expr The selection string + @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. + @param enl The per-side enlargement of the box to mark the text (1 gives a 2x2 DBU box) + This special constructor will create a region from the text objects delivered by the shape iterator. Each text object will give a small (non-empty) box that represents the text origin. + Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: + + @code + region = RBA::Region::new(iter, "*") # all texts + region = RBA::Region::new(iter, "A*") # all texts starting with an 'A' + region = RBA::Region::new(iter, "A*", false) # all texts exactly matching 'A*' + @/code + + This method has been introduced in version 0.25. The enlargement parameter has been added in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, deep_shape_store: DeepShapeStore, trans: ICplxTrans, area_ratio: Optional[float] = ..., max_vertex_count: Optional[int] = ...) -> Region: + r""" + @brief Constructor for a deep region from a hierarchical shape set + + This constructor creates a hierarchical region. Use a \DeepShapeStore object to supply the hierarchical heap. See \DeepShapeStore for more details. + + 'area_ratio' and 'max_vertex' supply two optimization parameters which control how big polygons are split to reduce the region's polygon complexity. + + The transformation is useful to scale to a specific database unit for example. + + @param shape_iterator The recursive shape iterator which delivers the hierarchy to take + @param deep_shape_store The hierarchical heap (see there) + @param area_ratio The maximum ratio of bounding box to polygon area before polygons are split + @param trans The transformation to apply when storing the layout data + + This method has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, expr: str, as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region: + r""" + @brief Constructor from a text set + + @param shape_iterator The iterator from which to derive the texts + @param dss The \DeepShapeStore object that acts as a heap for hierarchical operations. + @param expr The selection string + @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. + @param enl The per-side enlargement of the box to mark the text (1 gives a 2x2 DBU box) + This special constructor will create a deep region from the text objects delivered by the shape iterator. Each text object will give a small (non-empty) box that represents the text origin. + Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: + + @code + region = RBA::Region::new(iter, dss, "*") # all texts + region = RBA::Region::new(iter, dss, "A*") # all texts starting with an 'A' + region = RBA::Region::new(iter, dss, "A*", false) # all texts exactly matching 'A*' + @/code + + This variant has been introduced in version 0.26. + """ + def __add__(self, other: Region) -> Region: + r""" + @brief Returns the combined region of self and the other region + + @return The resulting region + + This operator adds the polygons of the other region to self and returns a new combined region. This usually creates unmerged regions and polygons may overlap. Use \merge if you want to ensure the result region is merged. + """ + def __and__(self, other: Region) -> Region: + r""" + @brief Returns the boolean AND between self and the other region + + @return The result of the boolean AND operation + + This method will compute the boolean AND (intersection) between two regions. The result is often but not necessarily always merged. + """ + def __copy__(self) -> Region: + r""" + @brief Creates a copy of self + """ + def __getitem__(self, n: int) -> Polygon: + r""" + @brief Returns the nth polygon of the region + + This method returns nil if the index is out of range. It is available for flat regions only - i.e. those for which \has_valid_polygons? is true. Use \flatten to explicitly flatten a region. + This method returns the raw polygon (not merged polygons, even if merged semantics is enabled). + + The \each iterator is the more general approach to access the polygons. + """ + def __iadd__(self, other: Region) -> Region: + r""" + @brief Adds the polygons of the other region to self + + @return The region after modification (self) + + This operator adds the polygons of the other region to self. This usually creates unmerged regions and polygons may overlap. Use \merge if you want to ensure the result region is merged. + """ + def __iand__(self, other: Region) -> Region: + r""" + @brief Performs the boolean AND between self and the other region + + @return The region after modification (self) + + This method will compute the boolean AND (intersection) between two regions. The result is often but not necessarily always merged. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor + + This constructor creates an empty region. + """ + @overload + def __init__(self, array: Sequence[Polygon]) -> None: + r""" + @brief Constructor from a polygon array + + This constructor creates a region from an array of polygons. + """ + @overload + def __init__(self, box: Box) -> None: + r""" + @brief Box constructor + + This constructor creates a region from a box. + """ + @overload + def __init__(self, path: Path) -> None: + r""" + @brief Path constructor + + This constructor creates a region from a path. + """ + @overload + def __init__(self, polygon: Polygon) -> None: + r""" + @brief Polygon constructor + + This constructor creates a region from a polygon. + """ + @overload + def __init__(self, polygon: SimplePolygon) -> None: + r""" + @brief Simple polygon constructor + + This constructor creates a region from a simple polygon. + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator) -> None: + r""" + @brief Constructor from a hierarchical shape set + + This constructor creates a region from the shapes delivered by the given recursive shape iterator. + Text objects and edges are not inserted, because they cannot be converted to polygons. + This method allows feeding the shapes from a hierarchy of cells into the region. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::Region::new(layout.begin_shapes(cell, layer)) + @/code + """ + @overload + def __init__(self, shapes: Shapes) -> None: + r""" + @brief Shapes constructor + + This constructor creates a region from a \Shapes collection. + + This constructor has been introduced in version 0.25. + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None: + r""" + @brief Constructor from a hierarchical shape set with a transformation + + This constructor creates a region from the shapes delivered by the given recursive shape iterator. + Text objects and edges are not inserted, because they cannot be converted to polygons. + On the delivered shapes it applies the given transformation. + This method allows feeding the shapes from a hierarchy of cells into the region. + The transformation is useful to scale to a specific database unit for example. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Region::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, deep_shape_store: DeepShapeStore, area_ratio: Optional[float] = ..., max_vertex_count: Optional[int] = ...) -> None: + r""" + @brief Constructor for a deep region from a hierarchical shape set + + This constructor creates a hierarchical region. Use a \DeepShapeStore object to supply the hierarchical heap. See \DeepShapeStore for more details. + + 'area_ratio' and 'max_vertex' supply two optimization parameters which control how big polygons are split to reduce the region's polygon complexity. + + @param shape_iterator The recursive shape iterator which delivers the hierarchy to take + @param deep_shape_store The hierarchical heap (see there) + @param area_ratio The maximum ratio of bounding box to polygon area before polygons are split + + This method has been introduced in version 0.26. + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> None: + r""" + @brief Constructor from a text set + + @param shape_iterator The iterator from which to derive the texts + @param expr The selection string + @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. + @param enl The per-side enlargement of the box to mark the text (1 gives a 2x2 DBU box) + This special constructor will create a region from the text objects delivered by the shape iterator. Each text object will give a small (non-empty) box that represents the text origin. + Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: + + @code + region = RBA::Region::new(iter, "*") # all texts + region = RBA::Region::new(iter, "A*") # all texts starting with an 'A' + region = RBA::Region::new(iter, "A*", false) # all texts exactly matching 'A*' + @/code + + This method has been introduced in version 0.25. The enlargement parameter has been added in version 0.26. + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, deep_shape_store: DeepShapeStore, trans: ICplxTrans, area_ratio: Optional[float] = ..., max_vertex_count: Optional[int] = ...) -> None: + r""" + @brief Constructor for a deep region from a hierarchical shape set + + This constructor creates a hierarchical region. Use a \DeepShapeStore object to supply the hierarchical heap. See \DeepShapeStore for more details. + + 'area_ratio' and 'max_vertex' supply two optimization parameters which control how big polygons are split to reduce the region's polygon complexity. + + The transformation is useful to scale to a specific database unit for example. + + @param shape_iterator The recursive shape iterator which delivers the hierarchy to take + @param deep_shape_store The hierarchical heap (see there) + @param area_ratio The maximum ratio of bounding box to polygon area before polygons are split + @param trans The transformation to apply when storing the layout data + + This method has been introduced in version 0.26. + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, expr: str, as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> None: + r""" + @brief Constructor from a text set + + @param shape_iterator The iterator from which to derive the texts + @param dss The \DeepShapeStore object that acts as a heap for hierarchical operations. + @param expr The selection string + @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. + @param enl The per-side enlargement of the box to mark the text (1 gives a 2x2 DBU box) + This special constructor will create a deep region from the text objects delivered by the shape iterator. Each text object will give a small (non-empty) box that represents the text origin. + Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: + + @code + region = RBA::Region::new(iter, dss, "*") # all texts + region = RBA::Region::new(iter, dss, "A*") # all texts starting with an 'A' + region = RBA::Region::new(iter, dss, "A*", false) # all texts exactly matching 'A*' + @/code + + This variant has been introduced in version 0.26. + """ + def __ior__(self, other: Region) -> Region: + r""" + @brief Performs the boolean OR between self and the other region + + @return The region after modification (self) + + The boolean OR is implemented by merging the polygons of both regions. To simply join the regions without merging, the + operator is more efficient. + """ + def __isub__(self, other: Region) -> Region: + r""" + @brief Performs the boolean NOT between self and the other region + + @return The region after modification (self) + + This method will compute the boolean NOT (intersection) between two regions. The result is often but not necessarily always merged. + """ + def __iter__(self) -> Iterator[Polygon]: + r""" + @brief Returns each polygon of the region + + This returns the raw polygons (not merged polygons if merged semantics is enabled). + """ + def __ixor__(self, other: Region) -> Region: + r""" + @brief Performs the boolean XOR between self and the other region + + @return The region after modification (self) + + This method will compute the boolean XOR (intersection) between two regions. The result is often but not necessarily always merged. + """ + def __len__(self) -> int: + r""" + @brief Returns the (flat) number of polygons in the region + + This returns the number of raw polygons (not merged polygons if merged semantics is enabled). + The count is computed 'as if flat', i.e. polygons inside a cell are multiplied by the number of times a cell is instantiated. + + The 'count' alias has been provided in version 0.26 to avoid ambiguity with the 'size' method which applies a geometrical bias. + """ + def __or__(self, other: Region) -> Region: + r""" + @brief Returns the boolean OR between self and the other region + + @return The resulting region + + The boolean OR is implemented by merging the polygons of both regions. To simply join the regions without merging, the + operator is more efficient. + """ + def __str__(self) -> str: + r""" + @brief Converts the region to a string + The length of the output is limited to 20 polygons to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. + """ + def __sub__(self, other: Region) -> Region: + r""" + @brief Returns the boolean NOT between self and the other region + + @return The result of the boolean NOT operation + + This method will compute the boolean NOT (intersection) between two regions. The result is often but not necessarily always merged. + """ + def __xor__(self, other: Region) -> Region: + r""" + @brief Returns the boolean XOR between self and the other region + + @return The result of the boolean XOR operation + + This method will compute the boolean XOR (intersection) between two regions. The result is often but not necessarily always merged. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def andnot(self, other: Region) -> List[Region]: + r""" + @brief Returns the boolean AND and NOT between self and the other region + + @return A two-element array of regions with the first one being the AND result and the second one being the NOT result + + This method will compute the boolean AND and NOT between two regions simultaneously. Because this requires a single sweep only, using this method is faster than doing AND and NOT separately. + + This method has been added in version 0.27. + """ + @overload + def area(self) -> int: + r""" + @brief The area of the region + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + If merged semantics is not enabled, overlapping areas are counted twice. + """ + @overload + def area(self, rect: Box) -> int: + r""" + @brief The area of the region (restricted to a rectangle) + This version will compute the area of the shapes, restricting the computation to the given rectangle. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + If merged semantics is not enabled, overlapping areas are counted twice. + """ + def assign(self, other: ShapeCollection) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> Box: + r""" + @brief Return the bounding box of the region + The bounding box is the box enclosing all points of all polygons. + """ + def break_(self, max_vertex_count: int, max_area_ratio: Optional[float] = ...) -> None: + r""" + @brief Breaks the polygons of the region into smaller ones + + There are two criteria for splitting a polygon: a polygon is split into parts with less then 'max_vertex_count' points and an bounding box-to-polygon area ratio less than 'max_area_ratio'. The area ratio is supposed to render polygons whose bounding box is a better approximation. This applies for example to 'L' shape polygons. + + Using a value of 0 for either limit means that the respective limit isn't checked. Breaking happens by cutting the polygons into parts at 'good' locations. The algorithm does not have a specific goal to minimize the number of parts for example. The only goal is to achieve parts within the given limits. + + This method has been introduced in version 0.26. + """ + def clear(self) -> None: + r""" + @brief Clears the region + """ + def complex_op(self, node: CompoundRegionOperationNode) -> Any: + r""" + @brief Executes a complex operation (see \CompoundRegionOperationNode for details) + + This method has been introduced in version 0.27. + """ + def corners(self, angle_min: Optional[float] = ..., angle_max: Optional[float] = ..., dim: Optional[int] = ..., include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> Region: + r""" + @brief This method will select all corners whose attached edges satisfy the angle condition. + + The angle values specify a range of angles: all corners whose attached edges form an angle between angle_min and angle_max will be reported boxes with 2*dim x 2*dim dimension. The default dimension is 2x2 DBU. + + If 'include_angle_min' is true, the angle condition is >= min. angle, otherwise it is > min. angle. Same for 'include_angle_,ax' and the max. angle. + + The angle is measured between the incoming and the outcoming edge in mathematical sense: a positive value is a turn left while a negative value is a turn right. Since polygon contours are oriented clockwise, positive angles will report concave corners while negative ones report convex ones. + + A similar function that reports corners as point-like edges is \corners_dots. + + This method has been introduced in version 0.25. 'include_min_angle' and 'include_max_angle' have been added in version 0.27. + """ + def corners_dots(self, angle_start: Optional[float] = ..., angle_end: Optional[float] = ..., include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> Edges: + r""" + @brief This method will select all corners whose attached edges satisfy the angle condition. + + This method is similar to \corners, but delivers an \Edges collection with dot-like edges for each corner. + + This method has been introduced in version 0.25. 'include_min_angle' and 'include_max_angle' have been added in version 0.27. + """ + def corners_edge_pairs(self, angle_start: Optional[float] = ..., angle_end: Optional[float] = ..., include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs: + r""" + @brief This method will select all corners whose attached edges satisfy the angle condition. + + This method is similar to \corners, but delivers an \EdgePairs collection with an edge pairs for each corner. + The first edge is the incoming edge of the corner, the second one the outgoing edge. + + This method has been introduced in version 0.27.1. + """ + def count(self) -> int: + r""" + @brief Returns the (flat) number of polygons in the region + + This returns the number of raw polygons (not merged polygons if merged semantics is enabled). + The count is computed 'as if flat', i.e. polygons inside a cell are multiplied by the number of times a cell is instantiated. + + The 'count' alias has been provided in version 0.26 to avoid ambiguity with the 'size' method which applies a geometrical bias. + """ + def covering(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Returns the polygons of this region which are completely covering polygons from the other region + + @return A new region containing the polygons which are covering polygons from the other region + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This attribute is sometimes called 'enclosing' instead of 'covering', but this term is reserved for the respective DRC function. + + This method has been introduced in version 0.27. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def data_id(self) -> int: + r""" + @brief Returns the data ID (a unique identifier for the underlying data storage) + + This method has been added in version 0.26. + """ + def decompose_convex(self, preferred_orientation: Optional[int] = ...) -> Shapes: + r""" + @brief Decomposes the region into convex pieces. + + This method will return a \Shapes container that holds a decomposition of the region into convex, simple polygons. + See \Polygon#decompose_convex for details. If you want \Region output, you should use \decompose_convex_to_region. + + This method has been introduced in version 0.25. + """ + def decompose_convex_to_region(self, preferred_orientation: Optional[int] = ...) -> Region: + r""" + @brief Decomposes the region into convex pieces into a region. + + This method is identical to \decompose_convex, but delivers a \Region object. + + This method has been introduced in version 0.25. + """ + def decompose_trapezoids(self, mode: Optional[int] = ...) -> Shapes: + r""" + @brief Decomposes the region into trapezoids. + + This method will return a \Shapes container that holds a decomposition of the region into trapezoids. + See \Polygon#decompose_trapezoids for details. If you want \Region output, you should use \decompose_trapezoids_to_region. + + This method has been introduced in version 0.25. + """ + def decompose_trapezoids_to_region(self, mode: Optional[int] = ...) -> Region: + r""" + @brief Decomposes the region into trapezoids. + + This method is identical to \decompose_trapezoids, but delivers a \Region object. + + This method has been introduced in version 0.25. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def disable_progress(self) -> None: + r""" + @brief Disable progress reporting + Calling this method will disable progress reporting. See \enable_progress. + """ + def dup(self) -> Region: + r""" + @brief Creates a copy of self + """ + def each(self) -> Iterator[Polygon]: + r""" + @brief Returns each polygon of the region + + This returns the raw polygons (not merged polygons if merged semantics is enabled). + """ + def each_merged(self) -> Iterator[Polygon]: + r""" + @brief Returns each merged polygon of the region + + This returns the raw polygons if merged semantics is disabled or the merged ones if merged semantics is enabled. + """ + def edges(self) -> Edges: + r""" + @brief Returns an edge collection representing all edges of the polygons in this region + This method will decompose the polygons into the individual edges. Edges making up the hulls of the polygons are oriented clockwise while edges making up the holes are oriented counterclockwise. + + The edge collection returned can be manipulated in various ways. See \Edges for a description of the possibilities of the edge collection. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + def enable_progress(self, label: str) -> None: + r""" + @brief Enable progress reporting + After calling this method, the region will report the progress through a progress bar while expensive operations are running. + The label is a text which is put in front of the progress bar. + Using a progress bar will imply a performance penalty of a few percent typically. + """ + def enclosed_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + r""" + @brief Performs an inside check with options + @param d The minimum distance for which the polygons are checked + @param other The other region against which to check + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper limit of the projected length of one edge onto another + @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes + @param rect_filter Specifies an error filter for rectangular input shapes + @param negative Negative output from the first input + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. + + "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. + Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. + + "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. + + If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the distance is larger or equal to the limit. This is a way to flag the parts of the first input where the distance to the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge. + + Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + + The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. + The 'enclosed_check' alias was introduced in version 0.27.5. + """ + def enclosing_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + r""" + @brief Performs an enclosing check with options + @param d The minimum enclosing distance for which the polygons are checked + @param other The other region against which to check + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper limit of the projected length of one edge onto another + @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes + @param rect_filter Specifies an error filter for rectangular input shapes + @param negative Negative output from the first input + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. + + "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. + Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. + + "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. + + If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the enclosure is larger or equal to the limit. This is a way to flag the parts of the first input where the enclosure vs. the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge. + + Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + + The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. + """ + def extent_refs(self, arg0: float, arg1: float, arg2: float, arg3: float, arg4: int, arg5: int) -> Region: + r""" + @hide + This method is provided for DRC implementation. + """ + def extent_refs_edges(self, arg0: float, arg1: float, arg2: float, arg3: float) -> Edges: + r""" + @hide + This method is provided for DRC implementation. + """ + @overload + def extents(self) -> Region: + r""" + @brief Returns a region with the bounding boxes of the polygons + This method will return a region consisting of the bounding boxes of the polygons. + The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def extents(self, d: int) -> Region: + r""" + @brief Returns a region with the enlarged bounding boxes of the polygons + This method will return a region consisting of the bounding boxes of the polygons enlarged by the given distance d. + The enlargement is specified per edge, i.e the width and height will be increased by 2*d. + The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def extents(self, dx: int, dy: int) -> Region: + r""" + @brief Returns a region with the enlarged bounding boxes of the polygons + This method will return a region consisting of the bounding boxes of the polygons enlarged by the given distance dx in x direction and dy in y direction. + The enlargement is specified per edge, i.e the width will be increased by 2*dx. + The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def fill(self, in_cell: Cell, fill_cell_index: int, fc_box: Box, origin: Optional[Point] = ..., remaining_parts: Optional[Region] = ..., fill_margin: Optional[Vector] = ..., remaining_polygons: Optional[Region] = ..., glue_box: Optional[Box] = ...) -> None: + r""" + @brief A mapping of \Cell#fill_region to the Region class + + This method is equivalent to \Cell#fill_region, but is based on Region (with the cell being the first parameter). + + This method has been introduced in version 0.27. + """ + @overload + def fill(self, in_cell: Cell, fill_cell_index: int, fc_origin: Box, row_step: Vector, column_step: Vector, origin: Optional[Point] = ..., remaining_parts: Optional[Region] = ..., fill_margin: Optional[Vector] = ..., remaining_polygons: Optional[Region] = ..., glue_box: Optional[Box] = ...) -> None: + r""" + @brief A mapping of \Cell#fill_region to the Region class + + This method is equivalent to \Cell#fill_region, but is based on Region (with the cell being the first parameter). + + This method has been introduced in version 0.27. + """ + def fill_multi(self, in_cell: Cell, fill_cell_index: int, fc_origin: Box, row_step: Vector, column_step: Vector, fill_margin: Optional[Vector] = ..., remaining_polygons: Optional[Region] = ..., glue_box: Optional[Box] = ...) -> None: + r""" + @brief A mapping of \Cell#fill_region to the Region class + + This method is equivalent to \Cell#fill_region, but is based on Region (with the cell being the first parameter). + + This method has been introduced in version 0.27. + """ + def flatten(self) -> Region: + r""" + @brief Explicitly flattens a region + + If the region is already flat (i.e. \has_valid_polygons? returns true), this method will not change it. + + Returns 'self', so this method can be used in a dot concatenation. + + This method has been introduced in version 0.26. + """ + def grid_check(self, gx: int, gy: int) -> EdgePairs: + r""" + @brief Returns a marker for all vertices not being on the given grid + This method will return an edge pair object for every vertex whose x coordinate is not a multiple of gx or whose y coordinate is not a multiple of gy. The edge pair objects contain two edges consisting of the same single point - the original vertex. + + If gx or gy is 0 or less, the grid is not checked in that direction. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + def has_valid_polygons(self) -> bool: + r""" + @brief Returns true if the region is flat and individual polygons can be accessed randomly + + This method has been introduced in version 0.26. + """ + def hier_count(self) -> int: + r""" + @brief Returns the (hierarchical) number of polygons in the region + + This returns the number of raw polygons (not merged polygons if merged semantics is enabled). + The count is computed 'hierarchical', i.e. polygons inside a cell are counted once even if the cell is instantiated multiple times. + + This method has been introduced in version 0.27. + """ + def holes(self) -> Region: + r""" + @brief Returns the holes of the region + This method returns all holes as filled polygons. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + If merge semantics is not enabled, the holes may not be detected if the polygons are taken from a hole-less representation (i.e. GDS2 file). Use explicit merge (\merge method) in order to merge the polygons and detect holes. + """ + def hulls(self) -> Region: + r""" + @brief Returns the hulls of the region + This method returns all hulls as polygons. The holes will be removed (filled). + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + If merge semantics is not enabled, the hull may also enclose holes if the polygons are taken from a hole-less representation (i.e. GDS2 file). Use explicit merge (\merge method) in order to merge the polygons and detect holes. + """ + def in_(self, other: Region) -> Region: + r""" + @brief Returns all polygons which are members of the other region + This method returns all polygons in self which can be found in the other region as well with exactly the same geometry. + """ + @overload + def insert(self, array: Sequence[Polygon]) -> None: + r""" + @brief Inserts all polygons from the array into this region + """ + @overload + def insert(self, box: Box) -> None: + r""" + @brief Inserts a box + + Inserts a box into the region. + """ + @overload + def insert(self, path: Path) -> None: + r""" + @brief Inserts a path + + Inserts a path into the region. + """ + @overload + def insert(self, polygon: Polygon) -> None: + r""" + @brief Inserts a polygon + + Inserts a polygon into the region. + """ + @overload + def insert(self, polygon: SimplePolygon) -> None: + r""" + @brief Inserts a simple polygon + + Inserts a simple polygon into the region. + """ + @overload + def insert(self, region: Region) -> None: + r""" + @brief Inserts all polygons from the other region into this region + This method has been introduced in version 0.25. + """ + @overload + def insert(self, shape_iterator: RecursiveShapeIterator) -> None: + r""" + @brief Inserts all shapes delivered by the recursive shape iterator into this region + + This method will insert all shapes delivered by the shape iterator and insert them into the region. + Text objects and edges are not inserted, because they cannot be converted to polygons. + """ + @overload + def insert(self, shapes: Shapes) -> None: + r""" + @brief Inserts all polygons from the shape collection into this region + This method takes each "polygon-like" shape from the shape collection and inserts this shape into the region. Paths and boxes are converted to polygons during this process. Edges and text objects are ignored. + + This method has been introduced in version 0.25. + """ + @overload + def insert(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None: + r""" + @brief Inserts all shapes delivered by the recursive shape iterator into this region with a transformation + + This method will insert all shapes delivered by the shape iterator and insert them into the region. + Text objects and edges are not inserted, because they cannot be converted to polygons. + This variant will apply the given transformation to the shapes. This is useful to scale the shapes to a specific database unit for example. + """ + @overload + def insert(self, shapes: Shapes, trans: ICplxTrans) -> None: + r""" + @brief Inserts all polygons from the shape collection into this region with complex transformation + This method takes each "polygon-like" shape from the shape collection and inserts this shape into the region after applying the given complex transformation. Paths and boxes are converted to polygons during this process. Edges and text objects are ignored. + + This method has been introduced in version 0.25. + """ + @overload + def insert(self, shapes: Shapes, trans: Trans) -> None: + r""" + @brief Inserts all polygons from the shape collection into this region with transformation + This method takes each "polygon-like" shape from the shape collection and inserts this shape into the region after applying the given transformation. Paths and boxes are converted to polygons during this process. Edges and text objects are ignored. + + This method has been introduced in version 0.25. + """ + def insert_into(self, layout: Layout, cell_index: int, layer: int) -> None: + r""" + @brief Inserts this region into the given layout, below the given cell and into the given layer. + If the region is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused. + + This method has been introduced in version 0.26. + """ + def inside(self, other: Region) -> Region: + r""" + @brief Returns the polygons of this region which are completely inside polygons from the other region + + @return A new region containing the polygons which are inside polygons from the other region + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + def inside_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + r""" + @brief Performs an inside check with options + @param d The minimum distance for which the polygons are checked + @param other The other region against which to check + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper limit of the projected length of one edge onto another + @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes + @param rect_filter Specifies an error filter for rectangular input shapes + @param negative Negative output from the first input + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. + + "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. + Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. + + "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. + + If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the distance is larger or equal to the limit. This is a way to flag the parts of the first input where the distance to the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge. + + Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + + The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. + The 'enclosed_check' alias was introduced in version 0.27.5. + """ + @overload + def interacting(self, other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Returns the polygons of this region which overlap or touch edges from the edge collection + + 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with edges of the edge collection to make the polygon selected. A polygon is selected by this method if the number of edges interacting with the polygon is between min_count and max_count (including max_count). + + @return A new region containing the polygons overlapping or touching edges from the edge collection + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.25. + The min_count and max_count arguments have been added in version 0.27. + """ + @overload + def interacting(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Returns the polygons of this region which overlap or touch polygons from the other region + + 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with (different) polygons of the other region to make the polygon selected. A polygon is selected by this method if the number of polygons interacting with a polygon of this region is between min_count and max_count (including max_count). + + @return A new region containing the polygons overlapping or touching polygons from the other region + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + The min_count and max_count arguments have been added in version 0.27. + """ + @overload + def interacting(self, other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Returns the polygons of this region which overlap or touch texts + + 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with texts of the text collection to make the polygon selected. A polygon is selected by this method if the number of texts interacting with the polygon is between min_count and max_count (including max_count). + + @return A new region containing the polygons overlapping or touching texts + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27 + """ + def is_box(self) -> bool: + r""" + @brief Returns true, if the region is a simple box + + @return True if the region is a box. + + This method does not apply implicit merging if merge semantics is enabled. + If the region is not merged, this method may return false even + if the merged region would be a box. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_deep(self) -> bool: + r""" + @brief Returns true if the region is a deep (hierarchical) one + + This method has been added in version 0.26. + """ + def is_empty(self) -> bool: + r""" + @brief Returns true if the region is empty + """ + def is_merged(self) -> bool: + r""" + @brief Returns true if the region is merged + If the region is merged, polygons will not touch or overlap. You can ensure merged state by calling \merge. + """ + def isolated_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + r""" + @brief Performs a space check between edges of different polygons with options + @param d The minimum space for which the polygons are checked + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper limit of the projected length of one edge onto another + @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes + @param rect_filter Specifies an error filter for rectangular input shapes + @param negative If true, edges not violation the condition will be output as pseudo-edge pairs + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. + + "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. + Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. + + "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. + + Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + + The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. + """ + def members_of(self, other: Region) -> Region: + r""" + @brief Returns all polygons which are members of the other region + This method returns all polygons in self which can be found in the other region as well with exactly the same geometry. + """ + @overload + def merge(self) -> Region: + r""" + @brief Merge the region + + @return The region after is has been merged (self). + + Merging removes overlaps and joins touching polygons. + If the region is already merged, this method does nothing + """ + @overload + def merge(self, min_wc: int) -> Region: + r""" + @brief Merge the region with options + + @param min_wc Overlap selection + @return The region after is has been merged (self). + + Merging removes overlaps and joins touching polygons. + This version provides one additional option: "min_wc" controls whether output is only produced if multiple polygons overlap. The value specifies the number of polygons that need to overlap. A value of 2 means that output is only produced if two or more polygons overlap. + + This method is equivalent to "merge(false, min_wc). + """ + @overload + def merge(self, min_coherence: bool, min_wc: int) -> Region: + r""" + @brief Merge the region with options + + @param min_coherence A flag indicating whether the resulting polygons shall have minimum coherence + @param min_wc Overlap selection + @return The region after is has been merged (self). + + Merging removes overlaps and joins touching polygons. + This version provides two additional options: if "min_coherence" is set to true, "kissing corners" are resolved by producing separate polygons. "min_wc" controls whether output is only produced if multiple polygons overlap. The value specifies the number of polygons that need to overlap. A value of 2 means that output is only produced if two or more polygons overlap. + """ + @overload + def merged(self) -> Region: + r""" + @brief Returns the merged region + + @return The region after is has been merged. + + Merging removes overlaps and joins touching polygons. + If the region is already merged, this method does nothing. + In contrast to \merge, this method does not modify the region but returns a merged copy. + """ + @overload + def merged(self, min_wc: int) -> Region: + r""" + @brief Returns the merged region (with options) + + @return The region after is has been merged. + + This version provides one additional options: "min_wc" controls whether output is only produced if multiple polygons overlap. The value specifies the number of polygons that need to overlap. A value of 2 means that output is only produced if two or more polygons overlap. + + This method is equivalent to "merged(false, min_wc)". + + In contrast to \merge, this method does not modify the region but returns a merged copy. + """ + @overload + def merged(self, min_coherence: bool, min_wc: int) -> Region: + r""" + @brief Returns the merged region (with options) + + @param min_coherence A flag indicating whether the resulting polygons shall have minimum coherence + @param min_wc Overlap selection + @return The region after is has been merged (self). + + Merging removes overlaps and joins touching polygons. + This version provides two additional options: if "min_coherence" is set to true, "kissing corners" are resolved by producing separate polygons. "min_wc" controls whether output is only produced if multiple polygons overlap. The value specifies the number of polygons that need to overlap. A value of 2 means that output is only produced if two or more polygons overlap. + + In contrast to \merge, this method does not modify the region but returns a merged copy. + """ + @overload + def minkowski_sum(self, b: Box) -> Region: + r""" + @brief Compute the Minkowski sum of the region and a box + + @param b The box. + + @return The new polygons representing the Minkowski sum of self and the box. + + The result is equivalent to the region-with-polygon Minkowski sum with the box used as the second polygon. + + The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + """ + @overload + def minkowski_sum(self, b: Sequence[Point]) -> Region: + r""" + @brief Compute the Minkowski sum of the region and a contour of points (a trace) + + @param b The contour (a series of points forming the trace). + + @return The new polygons representing the Minkowski sum of self and the contour. + + The Minkowski sum of a region and a contour basically results in the area covered when "dragging" the region along the contour. The effect is similar to drawing the contour with a pencil that has the shape of the given region. + + The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + """ + @overload + def minkowski_sum(self, e: Edge) -> Region: + r""" + @brief Compute the Minkowski sum of the region and an edge + + @param e The edge. + + @return The new polygons representing the Minkowski sum with the edge e. + + The Minkowski sum of a region and an edge basically results in the area covered when "dragging" the region along the line given by the edge. The effect is similar to drawing the line with a pencil that has the shape of the given region. + + The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + """ + @overload + def minkowski_sum(self, p: Polygon) -> Region: + r""" + @brief Compute the Minkowski sum of the region and a polygon + + @param p The first argument. + + @return The new polygons representing the Minkowski sum of self and p. + + The Minkowski sum of a region and a polygon is basically the result of "painting" the region with a pen that has the shape of the second polygon. + + The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + """ + @overload + def minkowsky_sum(self, b: Box) -> Region: + r""" + @brief Compute the Minkowski sum of the region and a box + + @param b The box. + + @return The new polygons representing the Minkowski sum of self and the box. + + The result is equivalent to the region-with-polygon Minkowski sum with the box used as the second polygon. + + The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + """ + @overload + def minkowsky_sum(self, b: Sequence[Point]) -> Region: + r""" + @brief Compute the Minkowski sum of the region and a contour of points (a trace) + + @param b The contour (a series of points forming the trace). + + @return The new polygons representing the Minkowski sum of self and the contour. + + The Minkowski sum of a region and a contour basically results in the area covered when "dragging" the region along the contour. The effect is similar to drawing the contour with a pencil that has the shape of the given region. + + The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + """ + @overload + def minkowsky_sum(self, e: Edge) -> Region: + r""" + @brief Compute the Minkowski sum of the region and an edge + + @param e The edge. + + @return The new polygons representing the Minkowski sum with the edge e. + + The Minkowski sum of a region and an edge basically results in the area covered when "dragging" the region along the line given by the edge. The effect is similar to drawing the line with a pencil that has the shape of the given region. + + The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + """ + @overload + def minkowsky_sum(self, p: Polygon) -> Region: + r""" + @brief Compute the Minkowski sum of the region and a polygon + + @param p The first argument. + + @return The new polygons representing the Minkowski sum of self and p. + + The Minkowski sum of a region and a polygon is basically the result of "painting" the region with a pen that has the shape of the second polygon. + + The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + """ + @overload + def move(self, v: Vector) -> Region: + r""" + @brief Moves the region + + Moves the polygon by the given offset and returns the + moved region. The region is overwritten. + + @param v The distance to move the region. + + Starting with version 0.25 this method accepts a vector argument. + + @return The moved region (self). + """ + @overload + def move(self, x: int, y: int) -> Region: + r""" + @brief Moves the region + + Moves the region by the given offset and returns the + moved region. The region is overwritten. + + @param x The x distance to move the region. + @param y The y distance to move the region. + + @return The moved region (self). + """ + @overload + def moved(self, v: Vector) -> Region: + r""" + @brief Returns the moved region (does not modify self) + + Moves the region by the given offset and returns the + moved region. The region is not modified. + + Starting with version 0.25 this method accepts a vector argument. + + @param p The distance to move the region. + + @return The moved region. + """ + @overload + def moved(self, x: int, y: int) -> Region: + r""" + @brief Returns the moved region (does not modify self) + + Moves the region by the given offset and returns the + moved region. The region is not modified. + + @param x The x distance to move the region. + @param y The y distance to move the region. + + @return The moved region. + """ + def non_rectangles(self) -> Region: + r""" + @brief Returns all polygons which are not rectangles + This method returns all polygons in self which are not rectangles.Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + def non_rectilinear(self) -> Region: + r""" + @brief Returns all polygons which are not rectilinear + This method returns all polygons in self which are not rectilinear.Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + def non_squares(self) -> Region: + r""" + @brief Returns all polygons which are not squares + This method returns all polygons in self which are not squares.Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27. + """ + def not_covering(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Returns the polygons of this region which are not completely covering polygons from the other region + + @return A new region containing the polygons which are not covering polygons from the other region + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This attribute is sometimes called 'enclosing' instead of 'covering', but this term is reserved for the respective DRC function. + + This method has been introduced in version 0.27. + """ + def not_in(self, other: Region) -> Region: + r""" + @brief Returns all polygons which are not members of the other region + This method returns all polygons in self which can not be found in the other region with exactly the same geometry. + """ + def not_inside(self, other: Region) -> Region: + r""" + @brief Returns the polygons of this region which are not completely inside polygons from the other region + + @return A new region containing the polygons which are not inside polygons from the other region + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def not_interacting(self, other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Returns the polygons of this region which do not overlap or touch edges from the edge collection + + 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with edges of the edge collection to make the polygon not selected. A polygon is not selected by this method if the number of edges interacting with the polygon is between min_count and max_count (including max_count). + + @return A new region containing the polygons not overlapping or touching edges from the edge collection + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.25 + The min_count and max_count arguments have been added in version 0.27. + """ + @overload + def not_interacting(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Returns the polygons of this region which do not overlap or touch polygons from the other region + + 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with (different) polygons of the other region to make the polygon not selected. A polygon is not selected by this method if the number of polygons interacting with a polygon of this region is between min_count and max_count (including max_count). + + @return A new region containing the polygons not overlapping or touching polygons from the other region + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + The min_count and max_count arguments have been added in version 0.27. + """ + @overload + def not_interacting(self, other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Returns the polygons of this region which do not overlap or touch texts + + 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with texts of the text collection to make the polygon not selected. A polygon is not selected by this method if the number of texts interacting with the polygon is between min_count and max_count (including max_count). + + @return A new region containing the polygons not overlapping or touching texts + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27 + """ + def not_members_of(self, other: Region) -> Region: + r""" + @brief Returns all polygons which are not members of the other region + This method returns all polygons in self which can not be found in the other region with exactly the same geometry. + """ + def not_outside(self, other: Region) -> Region: + r""" + @brief Returns the polygons of this region which are not completely outside polygons from the other region + + @return A new region containing the polygons which are not outside polygons from the other region + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + def not_overlapping(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Returns the polygons of this region which do not overlap polygons from the other region + + @return A new region containing the polygons not overlapping polygons from the other region + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + The count options have been introduced in version 0.27. + """ + def notch_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., negative: Optional[bool] = ...) -> EdgePairs: + r""" + @brief Performs a space check between edges of the same polygon with options + @param d The minimum space for which the polygons are checked + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper limit of the projected length of one edge onto another + @param shielded Enables shielding + @param negative If true, edges not violation the condition will be output as pseudo-edge pairs + + This version is similar to the simple version with one parameter. In addition, it allows to specify many more options. + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the space check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. + + "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. + Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. + + Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + + The 'shielded' and 'negative' options have been introduced in version 0.27. + """ + def outside(self, other: Region) -> Region: + r""" + @brief Returns the polygons of this region which are completely outside polygons from the other region + + @return A new region containing the polygons which are outside polygons from the other region + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + def overlap_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + r""" + @brief Performs an overlap check with options + @param d The minimum overlap for which the polygons are checked + @param other The other region against which to check + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper limit of the projected length of one edge onto another + @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes + @param rect_filter Specifies an error filter for rectangular input shapes + @param negative Negative output from the first input + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. + + "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. + Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. + + "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. + + If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the overlap is larger or equal to the limit. This is a way to flag the parts of the first input where the overlap vs. the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge. + + Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + + The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. + """ + def overlapping(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Returns the polygons of this region which overlap polygons from the other region + + @return A new region containing the polygons overlapping polygons from the other region + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + The count options have been introduced in version 0.27. + """ + @overload + def perimeter(self) -> int: + r""" + @brief The total perimeter of the polygons + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + If merged semantics is not enabled, internal edges are counted as well. + """ + @overload + def perimeter(self, rect: Box) -> int: + r""" + @brief The total perimeter of the polygons (restricted to a rectangle) + This version will compute the perimeter of the polygons, restricting the computation to the given rectangle. + Edges along the border are handled in a special way: they are counted when they are oriented with their inside side toward the rectangle (in other words: outside edges must coincide with the rectangle's border in order to be counted). + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + If merged semantics is not enabled, internal edges are counted as well. + """ + def pull_inside(self, other: Region) -> Region: + r""" + @brief Returns all polygons of "other" which are inside polygons of this region + The "pull_..." methods are similar to "select_..." but work the opposite way: they select shapes from the argument region rather than self. In a deep (hierarchical) context the output region will be hierarchically aligned with self, so the "pull_..." methods provide a way for re-hierarchization. + + @return The region after the polygons have been selected (from other) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.26.1 + """ + @overload + def pull_interacting(self, other: Edges) -> Edges: + r""" + @brief Returns all edges of "other" which are interacting with polygons of this region + See \pull_inside for a description of the "pull_..." methods. + + @return The edge collection after the edges have been selected (from other) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.26.1 + """ + @overload + def pull_interacting(self, other: Region) -> Region: + r""" + @brief Returns all polygons of "other" which are interacting with (overlapping, touching) polygons of this region + See \pull_inside for a description of the "pull_..." methods. + + @return The region after the polygons have been selected (from other) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.26.1 + """ + @overload + def pull_interacting(self, other: Texts) -> Texts: + r""" + @brief Returns all texts of "other" which are interacting with polygons of this region + See \pull_inside for a description of the "pull_..." methods. + + @return The text collection after the texts have been selected (from other) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27 + """ + def pull_overlapping(self, other: Region) -> Region: + r""" + @brief Returns all polygons of "other" which are overlapping polygons of this region + See \pull_inside for a description of the "pull_..." methods. + + @return The region after the polygons have been selected (from other) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.26.1 + """ + def rectangles(self) -> Region: + r""" + @brief Returns all polygons which are rectangles + This method returns all polygons in self which are rectangles.Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + def rectilinear(self) -> Region: + r""" + @brief Returns all polygons which are rectilinear + This method returns all polygons in self which are rectilinear.Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + def round_corners(self, r_inner: float, r_outer: float, n: int) -> None: + r""" + @brief Corner rounding + @param r_inner Inner corner radius (in database units) + @param r_outer Outer corner radius (in database units) + @param n The number of points per circle + + This method rounds the corners of the polygons in the region. Inner corners will be rounded with a radius of r_inner and outer corners with a radius of r_outer. The circles will be approximated by segments using n segments per full circle. + + This method modifies the region. \rounded_corners is a method that does the same but returns a new region without modifying self. Merged semantics applies for this method. + """ + def rounded_corners(self, r_inner: float, r_outer: float, n: int) -> Region: + r""" + @brief Corner rounding + @param r_inner Inner corner radius (in database units) + @param r_outer Outer corner radius (in database units) + @param n The number of points per circle + + See \round_corners for a description of this method. This version returns a new region instead of modifying self (out-of-place). + """ + def scale_and_snap(self, gx: int, mx: int, dx: int, gy: int, my: int, dy: int) -> None: + r""" + @brief Scales and snaps the region to the given grid + This method will first scale the region by a rational factor of mx/dx horizontally and my/dy vertically and then snap the region to the given grid - each x or y coordinate is brought on the gx or gy grid by rounding to the nearest value which is a multiple of gx or gy. + + If gx or gy is 0, the result is brought on a grid of 1. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.26.1. + """ + def scaled_and_snapped(self, gx: int, mx: int, dx: int, gy: int, my: int, dy: int) -> Region: + r""" + @brief Returns the scaled and snapped region + This method will scale and snap the region to the given grid and return the scaled and snapped region (see \scale_and_snap). The original region is not modified. + + This method has been introduced in version 0.26.1. + """ + def select_covering(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Selects the polygons of this region which are completely covering polygons from the other region + + @return The region after the polygons have been selected (self) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This attribute is sometimes called 'enclosing' instead of 'covering', but this term is reserved for the respective DRC function. + + This method has been introduced in version 0.27. + """ + def select_inside(self, other: Region) -> Region: + r""" + @brief Selects the polygons of this region which are completely inside polygons from the other region + + @return The region after the polygons have been selected (self) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def select_interacting(self, other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Selects the polygons from this region which overlap or touch edges from the edge collection + + 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with edges of the edge collection to make the polygon selected. A polygon is selected by this method if the number of edges interacting with the polygon is between min_count and max_count (including max_count). + + @return The region after the polygons have been selected (self) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.25 + The min_count and max_count arguments have been added in version 0.27. + """ + @overload + def select_interacting(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Selects the polygons from this region which overlap or touch polygons from the other region + + 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with (different) polygons of the other region to make the polygon selected. A polygon is selected by this method if the number of polygons interacting with a polygon of this region is between min_count and max_count (including max_count). + + @return The region after the polygons have been selected (self) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + The min_count and max_count arguments have been added in version 0.27. + """ + @overload + def select_interacting(self, other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Selects the polygons of this region which overlap or touch texts + + @return The region after the polygons have been selected (self) + + 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with texts of the text collection to make the polygon selected. A polygon is selected by this method if the number of texts interacting with the polygon is between min_count and max_count (including max_count). + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27 + """ + def select_not_covering(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Selects the polygons of this region which are not completely covering polygons from the other region + + @return The region after the polygons have been selected (self) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This attribute is sometimes called 'enclosing' instead of 'covering', but this term is reserved for the respective DRC function. + + This method has been introduced in version 0.27. + """ + def select_not_inside(self, other: Region) -> Region: + r""" + @brief Selects the polygons of this region which are not completely inside polygons from the other region + + @return The region after the polygons have been selected (self) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def select_not_interacting(self, other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Selects the polygons from this region which do not overlap or touch edges from the edge collection + + 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with edges of the edge collection to make the polygon not selected. A polygon is not selected by this method if the number of edges interacting with the polygon is between min_count and max_count (including max_count). + + @return The region after the polygons have been selected (self) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.25 + The min_count and max_count arguments have been added in version 0.27. + """ + @overload + def select_not_interacting(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Selects the polygons from this region which do not overlap or touch polygons from the other region + + 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with (different) polygons of the other region to make the polygon not selected. A polygon is not selected by this method if the number of polygons interacting with a polygon of this region is between min_count and max_count (including max_count). + + @return The region after the polygons have been selected (self) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + The min_count and max_count arguments have been added in version 0.27. + """ + @overload + def select_not_interacting(self, other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Selects the polygons of this region which do not overlap or touch texts + + 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with texts of the text collection to make the polygon not selected. A polygon is not selected by this method if the number of texts interacting with the polygon is between min_count and max_count (including max_count). + + @return The region after the polygons have been selected (self) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27 + """ + def select_not_outside(self, other: Region) -> Region: + r""" + @brief Selects the polygons of this region which are not completely outside polygons from the other region + + @return The region after the polygons have been selected (self) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + def select_not_overlapping(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Selects the polygons from this region which do not overlap polygons from the other region + + @return The region after the polygons have been selected (self) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + The count options have been introduced in version 0.27. + """ + def select_outside(self, other: Region) -> Region: + r""" + @brief Selects the polygons of this region which are completely outside polygons from the other region + + @return The region after the polygons have been selected (self) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + def select_overlapping(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: + r""" + @brief Selects the polygons from this region which overlap polygons from the other region + + @return The region after the polygons have been selected (self) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + The count options have been introduced in version 0.27. + """ + def separation_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + r""" + @brief Performs a separation check with options + @param d The minimum separation for which the polygons are checked + @param other The other region against which to check + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper limit of the projected length of one edge onto another + @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes + @param rect_filter Specifies an error filter for rectangular input shapes + @param negative Negative output from the first input + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. + + "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. + Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. + + "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. + + If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the separation is larger or equal to the limit. This is a way to flag the parts of the first input where the distance to the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge. + + Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + + The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. + """ + @overload + def size(self) -> int: + r""" + @brief Returns the (flat) number of polygons in the region + + This returns the number of raw polygons (not merged polygons if merged semantics is enabled). + The count is computed 'as if flat', i.e. polygons inside a cell are multiplied by the number of times a cell is instantiated. + + The 'count' alias has been provided in version 0.26 to avoid ambiguity with the 'size' method which applies a geometrical bias. + """ + @overload + def size(self, d: int, mode: Optional[int] = ...) -> Region: + r""" + @brief Isotropic sizing (biasing) + + @return The region after the sizing has applied (self) + + This method is equivalent to "size(d, d, mode)". + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def size(self, dv: Vector, mode: Optional[int] = ...) -> Region: + r""" + @brief Anisotropic sizing (biasing) + + @return The region after the sizing has applied (self) + + This method is equivalent to "size(dv.x, dv.y, mode)". + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This variant has been introduced in version 0.28. + """ + @overload + def size(self, dx: int, dy: int, mode: int) -> Region: + r""" + @brief Anisotropic sizing (biasing) + + @return The region after the sizing has applied (self) + + Shifts the contour outwards (dx,dy>0) or inwards (dx,dy<0). + dx is the sizing in x-direction and dy is the sizing in y-direction. The sign of dx and dy should be identical. + + This method applies a sizing to the region. Before the sizing is done, the + region is merged if this is not the case already. + + The mode defines at which bending angle cutoff occurs + (0:>0, 1:>45, 2:>90, 3:>135, 4:>approx. 168, other:>approx. 179) + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + The result is a set of polygons which may be overlapping, but are not self- + intersecting. Polygons may overlap afterwards because they grew big enough to overlap their neighbors. + In that case, \merge can be used to detect this overlaps by setting the "min_wc" parameter to value 1: + + @code + r = RBA::Region::new + r.insert(RBA::Box::new(0, 0, 50, 50)) + r.insert(RBA::Box::new(100, 0, 150, 50)) + r.size(50, 2) + r.merge(false, 1) + # r now is (50,-50;50,100;100,100;100,-50) + @/code + """ + @overload + def sized(self, d: int, mode: Optional[int] = ...) -> Region: + r""" + @brief Returns the isotropically sized region + + @return The sized region + + This method is equivalent to "sized(d, d, mode)". + This method returns the sized region (see \size), but does not modify self. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def sized(self, dv: Vector, mode: Optional[int] = ...) -> Region: + r""" + @brief Returns the (an)isotropically sized region + + @return The sized region + + This method is equivalent to "sized(dv.x, dv.y, mode)". + This method returns the sized region (see \size), but does not modify self. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This variant has been introduced in version 0.28. + """ + @overload + def sized(self, dx: int, dy: int, mode: int) -> Region: + r""" + @brief Returns the anisotropically sized region + + @return The sized region + + This method returns the sized region (see \size), but does not modify self. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + def smooth(self, d: int, keep_hv: Optional[bool] = ...) -> None: + r""" + @brief Smoothing + @param d The smoothing tolerance (in database units) + @param keep_hv If true, horizontal and vertical edges are maintained + + This method will simplify the merged polygons of the region by removing vertexes if the resulting polygon stays equivalent with the original polygon. Equivalence is measured in terms of a deviation which is guaranteed to not become larger than \d. + This method modifies the region. \smoothed is a method that does the same but returns a new region without modifying self. Merged semantics applies for this method. + """ + def smoothed(self, d: int, keep_hv: Optional[bool] = ...) -> Region: + r""" + @brief Smoothing + @param d The smoothing tolerance (in database units) + @param keep_hv If true, horizontal and vertical edges are maintained + + See \smooth for a description of this method. This version returns a new region instead of modifying self (out-of-place). It has been introduced in version 0.25. + """ + def snap(self, gx: int, gy: int) -> None: + r""" + @brief Snaps the region to the given grid + This method will snap the region to the given grid - each x or y coordinate is brought on the gx or gy grid by rounding to the nearest value which is a multiple of gx or gy. + + If gx or gy is 0, no snapping happens in that direction. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + def snapped(self, gx: int, gy: int) -> Region: + r""" + @brief Returns the snapped region + This method will snap the region to the given grid and return the snapped region (see \snap). The original region is not modified. + """ + def space_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + r""" + @brief Performs a space check with options + @param d The minimum space for which the polygons are checked + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper limit of the projected length of one edge onto another + @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes + @param rect_filter Specifies an error filter for rectangular input shapes + @param negative If true, edges not violation the condition will be output as pseudo-edge pairs + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. + + "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. + Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. + + "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. + + Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + + The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. + """ + def split_covering(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: + r""" + @brief Returns the polygons of this region which are completely covering polygons from the other region and the ones which are not at the same time + + @return Two new regions: the first containing the result of \covering, the second the result of \not_covering + + This method is equivalent to calling \covering and \not_covering, but is faster when both results are required. + Merged semantics applies for this method (see \merged_semantics= for a description of this concept). + + This method has been introduced in version 0.27. + """ + def split_inside(self, other: Region) -> List[Region]: + r""" + @brief Returns the polygons of this region which are completely inside polygons from the other region and the ones which are not at the same time + + @return Two new regions: the first containing the result of \inside, the second the result of \not_inside + + This method is equivalent to calling \inside and \not_inside, but is faster when both results are required. + Merged semantics applies for this method (see \merged_semantics= for a description of this concept). + + This method has been introduced in version 0.27. + """ + @overload + def split_interacting(self, other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: + r""" + @brief Returns the polygons of this region which are interacting with edges from the other edge collection and the ones which are not at the same time + + @return Two new regions: the first containing the result of \interacting, the second the result of \not_interacting + + This method is equivalent to calling \interacting and \not_interacting, but is faster when both results are required. + Merged semantics applies for this method (see \merged_semantics= for a description of this concept). + + This method has been introduced in version 0.27. + """ + @overload + def split_interacting(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: + r""" + @brief Returns the polygons of this region which are interacting with polygons from the other region and the ones which are not at the same time + + @return Two new regions: the first containing the result of \interacting, the second the result of \not_interacting + + This method is equivalent to calling \interacting and \not_interacting, but is faster when both results are required. + Merged semantics applies for this method (see \merged_semantics= for a description of this concept). + + This method has been introduced in version 0.27. + """ + @overload + def split_interacting(self, other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: + r""" + @brief Returns the polygons of this region which are interacting with texts from the other text collection and the ones which are not at the same time + + @return Two new regions: the first containing the result of \interacting, the second the result of \not_interacting + + This method is equivalent to calling \interacting and \not_interacting, but is faster when both results are required. + Merged semantics applies for this method (see \merged_semantics= for a description of this concept). + + This method has been introduced in version 0.27. + """ + def split_outside(self, other: Region) -> List[Region]: + r""" + @brief Returns the polygons of this region which are completely outside polygons from the other region and the ones which are not at the same time + + @return Two new regions: the first containing the result of \outside, the second the result of \not_outside + + This method is equivalent to calling \outside and \not_outside, but is faster when both results are required. + Merged semantics applies for this method (see \merged_semantics= for a description of this concept). + + This method has been introduced in version 0.27. + """ + def split_overlapping(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: + r""" + @brief Returns the polygons of this region which are overlapping with polygons from the other region and the ones which are not at the same time + + @return Two new regions: the first containing the result of \overlapping, the second the result of \not_overlapping + + This method is equivalent to calling \overlapping and \not_overlapping, but is faster when both results are required. + Merged semantics applies for this method (see \merged_semantics= for a description of this concept). + + This method has been introduced in version 0.27. + """ + def squares(self) -> Region: + r""" + @brief Returns all polygons which are squares + This method returns all polygons in self which are squares.Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27. + """ + def strange_polygon_check(self) -> Region: + r""" + @brief Returns a region containing those parts of polygons which are "strange" + Strange parts of polygons are self-overlapping parts or non-orientable parts (i.e. in the "8" configuration). + + Merged semantics does not apply for this method (see \merged_semantics= for a description of this concept) + """ + def swap(self, other: Region) -> None: + r""" + @brief Swap the contents of this region with the contents of another region + This method is useful to avoid excessive memory allocation in some cases. For managed memory languages such as Ruby, those cases will be rare. + """ + @overload + def texts(self, expr: Optional[str] = ..., as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region: + r""" + @hide + This method is provided for DRC implementation only. + """ + @overload + def texts(self, dss: DeepShapeStore, expr: Optional[str] = ..., as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region: + r""" + @hide + This method is provided for DRC implementation only. + """ + @overload + def texts_dots(self, expr: Optional[str] = ..., as_pattern: Optional[bool] = ...) -> Edges: + r""" + @hide + This method is provided for DRC implementation only. + """ + @overload + def texts_dots(self, dss: DeepShapeStore, expr: Optional[str] = ..., as_pattern: Optional[bool] = ...) -> Edges: + r""" + @hide + This method is provided for DRC implementation only. + """ + @overload + def to_s(self) -> str: + r""" + @brief Converts the region to a string + The length of the output is limited to 20 polygons to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. + """ + @overload + def to_s(self, max_count: int) -> str: + r""" + @brief Converts the region to a string + This version allows specification of the maximum number of polygons contained in the string. + """ + @overload + def transform(self, t: ICplxTrans) -> Region: + r""" + @brief Transform the region with a complex transformation (modifies self) + + Transforms the region with the given transformation. + This version modifies the region and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed region. + """ + @overload + def transform(self, t: IMatrix2d) -> Region: + r""" + @brief Transform the region (modifies self) + + Transforms the region with the given 2d matrix transformation. + This version modifies the region and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed region. + + This variant was introduced in version 0.27. + """ + @overload + def transform(self, t: IMatrix3d) -> Region: + r""" + @brief Transform the region (modifies self) + + Transforms the region with the given 3d matrix transformation. + This version modifies the region and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed region. + + This variant was introduced in version 0.27. + """ + @overload + def transform(self, t: Trans) -> Region: + r""" + @brief Transform the region (modifies self) + + Transforms the region with the given transformation. + This version modifies the region and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed region. + """ + def transform_icplx(self, t: ICplxTrans) -> Region: + r""" + @brief Transform the region with a complex transformation (modifies self) + + Transforms the region with the given transformation. + This version modifies the region and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed region. + """ + @overload + def transformed(self, t: ICplxTrans) -> Region: + r""" + @brief Transforms the region with a complex transformation + + Transforms the region with the given complex transformation. + Does not modify the region but returns the transformed region. + + @param t The transformation to apply. + + @return The transformed region. + """ + @overload + def transformed(self, t: IMatrix2d) -> Region: + r""" + @brief Transforms the region + + Transforms the region with the given 2d matrix transformation. + Does not modify the region but returns the transformed region. + + @param t The transformation to apply. + + @return The transformed region. + + This variant was introduced in version 0.27. + """ + @overload + def transformed(self, t: IMatrix3d) -> Region: + r""" + @brief Transforms the region + + Transforms the region with the given 3d matrix transformation. + Does not modify the region but returns the transformed region. + + @param t The transformation to apply. + + @return The transformed region. + + This variant was introduced in version 0.27. + """ + @overload + def transformed(self, t: Trans) -> Region: + r""" + @brief Transforms the region + + Transforms the region with the given transformation. + Does not modify the region but returns the transformed region. + + @param t The transformation to apply. + + @return The transformed region. + """ + def transformed_icplx(self, t: ICplxTrans) -> Region: + r""" + @brief Transforms the region with a complex transformation + + Transforms the region with the given complex transformation. + Does not modify the region but returns the transformed region. + + @param t The transformation to apply. + + @return The transformed region. + """ + def width_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., negative: Optional[bool] = ...) -> EdgePairs: + r""" + @brief Performs a width check with options + @param d The minimum width for which the polygons are checked + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper limit of the projected length of one edge onto another + @param shielded Enables shielding + @param negative If true, edges not violation the condition will be output as pseudo-edge pairs + + This version is similar to the simple version with one parameter. In addition, it allows to specify many more options. + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. + + "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. + Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. + + Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) + + The 'shielded' and 'negative' options have been introduced in version 0.27. + """ + @overload + def with_angle(self, angle: float, inverse: bool) -> EdgePairs: + r""" + @brief Returns markers on every corner with the given angle (or not with the given angle) + If the inverse flag is false, this method returns an error marker (an \EdgePair object) for every corner whose connected edges form an angle with the given value (in degree). If the inverse flag is true, the method returns markers for every corner whose angle is not the given value. + + The edge pair objects returned will contain both edges forming the angle. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def with_angle(self, amin: float, amax: float, inverse: bool) -> EdgePairs: + r""" + @brief Returns markers on every corner with an angle of more than amin and less than amax (or the opposite) + If the inverse flag is false, this method returns an error marker (an \EdgePair object) for every corner whose connected edges form an angle whose value is more or equal to amin (in degree) or less (but not equal to) amax. If the inverse flag is true, the method returns markers for every corner whose angle is not matching that criterion. + + The edge pair objects returned will contain both edges forming the angle. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def with_area(self, area: int, inverse: bool) -> Region: + r""" + @brief Filter the polygons by area + Filters the polygons of the region by area. If "inverse" is false, only polygons which have the given area are returned. If "inverse" is true, polygons not having the given area are returned. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def with_area(self, min_area: Any, max_area: Any, inverse: bool) -> Region: + r""" + @brief Filter the polygons by area + Filters the polygons of the region by area. If "inverse" is false, only polygons which have an area larger or equal to "min_area" and less than "max_area" are returned. If "inverse" is true, polygons having an area less than "min_area" or larger or equal than "max_area" are returned. + + If you don't want to specify a lower or upper limit, pass nil to that parameter. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def with_area_ratio(self, ratio: float, inverse: bool) -> Region: + r""" + @brief Filters the polygons by the bounding box area to polygon area ratio + The area ratio is defined by the ratio of bounding box area to polygon area. It's a measure how much the bounding box is approximating the polygon. 'Thin polygons' have a large area ratio, boxes has an area ratio of 1. + The area ratio is always larger or equal to 1. + With 'inverse' set to false, this version filters polygons which have an area ratio equal to the given value. With 'inverse' set to true, all other polygons will be returned. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27. + """ + @overload + def with_area_ratio(self, min_ratio: Any, max_ratio: Any, inverse: bool, min_included: Optional[bool] = ..., max_included: Optional[bool] = ...) -> Region: + r""" + @brief Filters the polygons by the aspect ratio of their bounding boxes + The area ratio is defined by the ratio of bounding box area to polygon area. It's a measure how much the bounding box is approximating the polygon. 'Thin polygons' have a large area ratio, boxes has an area ratio of 1. + The area ratio is always larger or equal to 1. + With 'inverse' set to false, this version filters polygons which have an area ratio between 'min_ratio' and 'max_ratio'. With 'min_included' set to true, the 'min_ratio' value is included in the range, otherwise it's excluded. Same for 'max_included' and 'max_ratio'. With 'inverse' set to true, all other polygons will be returned. + + If you don't want to specify a lower or upper limit, pass nil to that parameter. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27. + """ + @overload + def with_bbox_aspect_ratio(self, ratio: float, inverse: bool) -> Region: + r""" + @brief Filters the polygons by the aspect ratio of their bounding boxes + Filters the polygons of the region by the aspect ratio of their bounding boxes. The aspect ratio is the ratio of larger to smaller dimension of the bounding box. A square has an aspect ratio of 1. + + With 'inverse' set to false, this version filters polygons which have a bounding box aspect ratio equal to the given value. With 'inverse' set to true, all other polygons will be returned. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27. + """ + @overload + def with_bbox_aspect_ratio(self, min_ratio: Any, max_ratio: Any, inverse: bool, min_included: Optional[bool] = ..., max_included: Optional[bool] = ...) -> Region: + r""" + @brief Filters the polygons by the aspect ratio of their bounding boxes + Filters the polygons of the region by the aspect ratio of their bounding boxes. The aspect ratio is the ratio of larger to smaller dimension of the bounding box. A square has an aspect ratio of 1. + + With 'inverse' set to false, this version filters polygons which have a bounding box aspect ratio between 'min_ratio' and 'max_ratio'. With 'min_included' set to true, the 'min_ratio' value is included in the range, otherwise it's excluded. Same for 'max_included' and 'max_ratio'. With 'inverse' set to true, all other polygons will be returned. + + If you don't want to specify a lower or upper limit, pass nil to that parameter. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27. + """ + @overload + def with_bbox_height(self, height: int, inverse: bool) -> Region: + r""" + @brief Filter the polygons by bounding box height + Filters the polygons of the region by the height of their bounding box. If "inverse" is false, only polygons whose bounding box has the given height are returned. If "inverse" is true, polygons whose bounding box does not have the given height are returned. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def with_bbox_height(self, min_height: Any, max_height: Any, inverse: bool) -> Region: + r""" + @brief Filter the polygons by bounding box height + Filters the polygons of the region by the height of their bounding box. If "inverse" is false, only polygons whose bounding box has a height larger or equal to "min_height" and less than "max_height" are returned. If "inverse" is true, all polygons not matching this criterion are returned. + If you don't want to specify a lower or upper limit, pass nil to that parameter. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def with_bbox_max(self, dim: int, inverse: bool) -> Region: + r""" + @brief Filter the polygons by bounding box width or height, whichever is larger + Filters the polygons of the region by the maximum dimension of their bounding box. If "inverse" is false, only polygons whose bounding box's larger dimension is equal to the given value are returned. If "inverse" is true, all polygons not matching this criterion are returned. + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def with_bbox_max(self, min_dim: Any, max_dim: Any, inverse: bool) -> Region: + r""" + @brief Filter the polygons by bounding box width or height, whichever is larger + Filters the polygons of the region by the minimum dimension of their bounding box. If "inverse" is false, only polygons whose bounding box's larger dimension is larger or equal to "min_dim" and less than "max_dim" are returned. If "inverse" is true, all polygons not matching this criterion are returned. + If you don't want to specify a lower or upper limit, pass nil to that parameter. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def with_bbox_min(self, dim: int, inverse: bool) -> Region: + r""" + @brief Filter the polygons by bounding box width or height, whichever is smaller + Filters the polygons inside the region by the minimum dimension of their bounding box. If "inverse" is false, only polygons whose bounding box's smaller dimension is equal to the given value are returned. If "inverse" is true, all polygons not matching this criterion are returned. + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def with_bbox_min(self, min_dim: Any, max_dim: Any, inverse: bool) -> Region: + r""" + @brief Filter the polygons by bounding box width or height, whichever is smaller + Filters the polygons of the region by the minimum dimension of their bounding box. If "inverse" is false, only polygons whose bounding box's smaller dimension is larger or equal to "min_dim" and less than "max_dim" are returned. If "inverse" is true, all polygons not matching this criterion are returned. + If you don't want to specify a lower or upper limit, pass nil to that parameter. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def with_bbox_width(self, width: int, inverse: bool) -> Region: + r""" + @brief Filter the polygons by bounding box width + Filters the polygons of the region by the width of their bounding box. If "inverse" is false, only polygons whose bounding box has the given width are returned. If "inverse" is true, polygons whose bounding box does not have the given width are returned. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def with_bbox_width(self, min_width: Any, max_width: Any, inverse: bool) -> Region: + r""" + @brief Filter the polygons by bounding box width + Filters the polygons of the region by the width of their bounding box. If "inverse" is false, only polygons whose bounding box has a width larger or equal to "min_width" and less than "max_width" are returned. If "inverse" is true, all polygons not matching this criterion are returned. + If you don't want to specify a lower or upper limit, pass nil to that parameter. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def with_holes(self, nholes: int, inverse: bool) -> Region: + r""" + @brief Filters the polygons by their number of holes + Filters the polygons of the region by number of holes. If "inverse" is false, only polygons which have the given number of holes are returned. If "inverse" is true, polygons not having the given of holes are returned. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27. + """ + @overload + def with_holes(self, min_bholes: Any, max_nholes: Any, inverse: bool) -> Region: + r""" + @brief Filter the polygons by their number of holes + Filters the polygons of the region by number of holes. If "inverse" is false, only polygons which have a hole count larger or equal to "min_nholes" and less than "max_nholes" are returned. If "inverse" is true, polygons having a hole count less than "min_nholes" or larger or equal than "max_nholes" are returned. + + If you don't want to specify a lower or upper limit, pass nil to that parameter. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27. + """ + @overload + def with_perimeter(self, perimeter: int, inverse: bool) -> Region: + r""" + @brief Filter the polygons by perimeter + Filters the polygons of the region by perimeter. If "inverse" is false, only polygons which have the given perimeter are returned. If "inverse" is true, polygons not having the given perimeter are returned. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def with_perimeter(self, min_perimeter: Any, max_perimeter: Any, inverse: bool) -> Region: + r""" + @brief Filter the polygons by perimeter + Filters the polygons of the region by perimeter. If "inverse" is false, only polygons which have a perimeter larger or equal to "min_perimeter" and less than "max_perimeter" are returned. If "inverse" is true, polygons having a perimeter less than "min_perimeter" or larger or equal than "max_perimeter" are returned. + + If you don't want to specify a lower or upper limit, pass nil to that parameter. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload + def with_relative_height(self, ratio: float, inverse: bool) -> Region: + r""" + @brief Filters the polygons by the ratio of height to width + This method filters the polygons of the region by the ratio of height vs. width of their bounding boxes. 'Tall' polygons have a large value while 'flat' polygons have a small value. A square has a relative height of 1. + + An alternative method is 'with_area_ratio' which can be more efficient because it's isotropic. + + With 'inverse' set to false, this version filters polygons which have a relative height equal to the given value. With 'inverse' set to true, all other polygons will be returned. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27. + """ + @overload + def with_relative_height(self, min_ratio: Any, max_ratio: Any, inverse: bool, min_included: Optional[bool] = ..., max_included: Optional[bool] = ...) -> Region: + r""" + @brief Filters the polygons by the bounding box height to width ratio + This method filters the polygons of the region by the ratio of height vs. width of their bounding boxes. 'Tall' polygons have a large value while 'flat' polygons have a small value. A square has a relative height of 1. + + An alternative method is 'with_area_ratio' which can be more efficient because it's isotropic. + + With 'inverse' set to false, this version filters polygons which have a relative height between 'min_ratio' and 'max_ratio'. With 'min_included' set to true, the 'min_ratio' value is included in the range, otherwise it's excluded. Same for 'max_included' and 'max_ratio'. With 'inverse' set to true, all other polygons will be returned. + + If you don't want to specify a lower or upper limit, pass nil to that parameter. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27. + """ + +class Shape: + r""" + @brief An object representing a shape in the layout database + + The shape proxy is basically a pointer to a shape of different kinds. + No copy of the shape is created: if the shape proxy is copied the copy still + points to the original shape. If the original shape is modified or deleted, + the shape proxy will also point to a modified or invalid shape. + The proxy can be "null" which indicates an invalid reference. + + Shape objects are used together with the \Shapes container object which + stores the actual shape objects and uses Shape references as pointers inside the + actual data storage. Shape references are used in various places, i.e. when removing or + transforming objects inside a \Shapes container. + """ + TBox: ClassVar[int] + r""" + """ + TBoxArray: ClassVar[int] + r""" + """ + TBoxArrayMember: ClassVar[int] + r""" + """ + TEdge: ClassVar[int] + r""" + """ + TEdgePair: ClassVar[int] + r""" + """ + TNull: ClassVar[int] + r""" + """ + TPath: ClassVar[int] + r""" + """ + TPathPtrArray: ClassVar[int] + r""" + """ + TPathPtrArrayMember: ClassVar[int] + r""" + """ + TPathRef: ClassVar[int] + r""" + """ + TPolygon: ClassVar[int] + r""" + """ + TPolygonPtrArray: ClassVar[int] + r""" + """ + TPolygonPtrArrayMember: ClassVar[int] + r""" + """ + TPolygonRef: ClassVar[int] + r""" + """ + TShortBox: ClassVar[int] + r""" + """ + TShortBoxArray: ClassVar[int] + r""" + """ + TShortBoxArrayMember: ClassVar[int] + r""" + """ + TSimplePolygon: ClassVar[int] + r""" + """ + TSimplePolygonPtrArray: ClassVar[int] + r""" + """ + TSimplePolygonPtrArrayMember: ClassVar[int] + r""" + """ + TSimplePolygonRef: ClassVar[int] + r""" + """ + TText: ClassVar[int] + r""" + """ + TTextPtrArray: ClassVar[int] + r""" + """ + TTextPtrArrayMember: ClassVar[int] + r""" + """ + TTextRef: ClassVar[int] + r""" + """ + TUserObject: ClassVar[int] + r""" + """ + box: bool + r""" + Getter: + @brief Returns true if the shape is a box + + Setter: + @brief Replaces the shape by the given box (in micrometer units) + This method replaces the shape by the given box, like \box= with a \Box argument does. This version translates the box from micrometer units to database units internally. + + This method has been introduced in version 0.25. + """ + box_center: Point + r""" + Getter: + @brief Returns the center of the box + + Applies to boxes only. Returns the center of the box and throws an exception if the shape is not a box. + + This method has been introduced in version 0.23. + + Setter: + @brief Sets the center of the box + + Applies to boxes only. Changes the center of the box and throws an exception if the shape is not a box. + + This method has been introduced in version 0.23. + """ + box_dcenter: DPoint + r""" + Getter: + @brief Returns the center of the box as a \DPoint object in micrometer units + + Applies to boxes only. Returns the center of the box and throws an exception if the shape is not a box. + Conversion from database units to micrometers is done internally. + + This method has been introduced in version 0.25. + + Setter: + @brief Sets the center of the box with the point being given in micrometer units + + Applies to boxes only. Changes the center of the box and throws an exception if the shape is not a box. + Translation from micrometer units to database units is done internally. + + This method has been introduced in version 0.25. + """ + box_dheight: float + r""" + Getter: + @brief Returns the height of the box in micrometer units + + Applies to boxes only. Returns the height of the box in micrometers and throws an exception if the shape is not a box. + + This method has been introduced in version 0.25. + + Setter: + @brief Sets the height of the box + + Applies to boxes only. Changes the height of the box to the value given in micrometer units and throws an exception if the shape is not a box. + Translation to database units happens internally. + + This method has been introduced in version 0.25. + """ + box_dp1: DPoint + r""" + Getter: + @brief Returns the lower left point of the box as a \DPoint object in micrometer units + + Applies to boxes only. Returns the lower left point of the box and throws an exception if the shape is not a box. + Conversion from database units to micrometers is done internally. + + This method has been introduced in version 0.25. + + Setter: + @brief Sets the lower left corner of the box with the point being given in micrometer units + + Applies to boxes only. Changes the lower left point of the box and throws an exception if the shape is not a box. + Translation from micrometer units to database units is done internally. + + This method has been introduced in version 0.25. + """ + box_dp2: DPoint + r""" + Getter: + @brief Returns the upper right point of the box as a \DPoint object in micrometer units + + Applies to boxes only. Returns the upper right point of the box and throws an exception if the shape is not a box. + Conversion from database units to micrometers is done internally. + + This method has been introduced in version 0.25. + + Setter: + @brief Sets the upper right corner of the box with the point being given in micrometer units + + Applies to boxes only. Changes the upper right point of the box and throws an exception if the shape is not a box. + Translation from micrometer units to database units is done internally. + + This method has been introduced in version 0.25. + """ + box_dwidth: float + r""" + Getter: + @brief Returns the width of the box in micrometer units + + Applies to boxes only. Returns the width of the box in micrometers and throws an exception if the shape is not a box. + + This method has been introduced in version 0.25. + + Setter: + @brief Sets the width of the box in micrometer units + + Applies to boxes only. Changes the width of the box to the value given in micrometer units and throws an exception if the shape is not a box. + Translation to database units happens internally. + + This method has been introduced in version 0.25. + """ + box_height: int + r""" + Getter: + @brief Returns the height of the box + + Applies to boxes only. Returns the height of the box and throws an exception if the shape is not a box. + + This method has been introduced in version 0.23. + + Setter: + @brief Sets the height of the box + + Applies to boxes only. Changes the height of the box and throws an exception if the shape is not a box. + + This method has been introduced in version 0.23. + """ + box_p1: Point + r""" + Getter: + @brief Returns the lower left point of the box + + Applies to boxes only. Returns the lower left point of the box and throws an exception if the shape is not a box. + + This method has been introduced in version 0.23. + + Setter: + @brief Sets the lower left corner of the box with the point being given in micrometer units + + Applies to boxes only. Changes the lower left point of the box and throws an exception if the shape is not a box. + Translation from micrometer units to database units is done internally. + + This method has been introduced in version 0.25. + """ + box_p2: Point + r""" + Getter: + @brief Returns the upper right point of the box + + Applies to boxes only. Returns the upper right point of the box and throws an exception if the shape is not a box. + + This method has been introduced in version 0.23. + + Setter: + @brief Sets the upper right corner of the box with the point being given in micrometer units + + Applies to boxes only. Changes the upper right point of the box and throws an exception if the shape is not a box. + Translation from micrometer units to database units is done internally. + + This method has been introduced in version 0.25. + """ + box_width: int + r""" + Getter: + @brief Returns the width of the box + + Applies to boxes only. Returns the width of the box and throws an exception if the shape is not a box. + + This method has been introduced in version 0.23. + + Setter: + @brief Sets the width of the box + + Applies to boxes only. Changes the width of the box and throws an exception if the shape is not a box. + + This method has been introduced in version 0.23. + """ + cell: Cell + r""" + Getter: + @brief Gets a reference to the cell the shape belongs to + + This reference can be nil, if the Shape object is not living inside a cell + + This method has been introduced in version 0.22. + Setter: + @brief Moves the shape to a different cell + + Both the current and the target cell must reside in the same layout. + + This method has been introduced in version 0.23. + """ + dbox: Any + r""" + Getter: + @brief Gets the box object in micrometer units + See \box for a description of this method. This method returns the box after translation to micrometer units. + + This method has been added in version 0.25. + + Setter: + @brief Replaces the shape by the given box (in micrometer units) + This method replaces the shape by the given box, like \box= with a \Box argument does. This version translates the box from micrometer units to database units internally. + + This method has been introduced in version 0.25. + """ + dedge: Any + r""" + Getter: + @brief Returns the edge object as a \DEdge object in micrometer units + See \edge for a description of this method. This method returns the edge after translation to micrometer units. + + This method has been added in version 0.25. + + Setter: + @brief Replaces the shape by the given edge (in micrometer units) + This method replaces the shape by the given edge, like \edge= with a \Edge argument does. This version translates the edge from micrometer units to database units internally. + + This method has been introduced in version 0.25. + """ + dedge_pair: Any + r""" + Getter: + @brief Returns the edge pair object as a \DEdgePair object in micrometer units + See \edge_pair for a description of this method. This method returns the edge pair after translation to micrometer units. + + This method has been added in version 0.26. + + Setter: + @brief Replaces the shape by the given edge pair (in micrometer units) + This method replaces the shape by the given edge pair, like \edge_pair= with a \EdgePair argument does. This version translates the edge pair from micrometer units to database units internally. + + This method has been introduced in version 0.26. + """ + dpath: Any + r""" + Getter: + @brief Returns the path object as a \DPath object in micrometer units + See \path for a description of this method. This method returns the path after translation to micrometer units. + + This method has been added in version 0.25. + + Setter: + @brief Replaces the shape by the given path (in micrometer units) + This method replaces the shape by the given path, like \path= with a \Path argument does. This version translates the path from micrometer units to database units internally. + + This method has been introduced in version 0.25. + """ + dpolygon: Any + r""" + Getter: + @brief Returns the polygon object in micrometer units + + Returns the polygon object that this shape refers to or converts the object to a polygon. The method returns the same object than \polygon, but translates it to micrometer units internally. + + This method has been introduced in version 0.25. + + Setter: + @brief Replaces the shape by the given polygon (in micrometer units) + This method replaces the shape by the given polygon, like \polygon= with a \Polygon argument does. This version translates the polygon from micrometer units to database units internally. + + This method has been introduced in version 0.25. + """ + dsimple_polygon: Any + r""" + Getter: + @brief Returns the simple polygon object in micrometer units + + Returns the simple polygon object that this shape refers to or converts the object to a simple polygon. The method returns the same object than \simple_polygon, but translates it to micrometer units internally. + + This method has been introduced in version 0.25. + + Setter: + @brief Replaces the shape by the given simple polygon (in micrometer units) + This method replaces the shape by the given text, like \simple_polygon= with a \SimplePolygon argument does. This version translates the polygon from micrometer units to database units internally. + + This method has been introduced in version 0.25. + """ + dtext: Any + r""" + Getter: + @brief Returns the path object as a \DText object in micrometer units + See \text for a description of this method. This method returns the text after translation to micrometer units. + + This method has been added in version 0.25. + + Setter: + @brief Replaces the shape by the given text (in micrometer units) + This method replaces the shape by the given text, like \text= with a \Text argument does. This version translates the text from micrometer units to database units internally. + + This method has been introduced in version 0.25. + """ + edge: bool + r""" + Getter: + @brief Returns true, if the object is an edge + + Setter: + @brief Replaces the shape by the given edge (in micrometer units) + This method replaces the shape by the given edge, like \edge= with a \Edge argument does. This version translates the edge from micrometer units to database units internally. + + This method has been introduced in version 0.25. + """ + edge_pair: bool + r""" + Getter: + @brief Returns true, if the object is an edge pair + + This method has been introduced in version 0.26. + Setter: + @brief Replaces the shape by the given edge pair (in micrometer units) + This method replaces the shape by the given edge pair, like \edge_pair= with a \EdgePair argument does. This version translates the edge pair from micrometer units to database units internally. + + This method has been introduced in version 0.26. + """ + layer: int + r""" + Getter: + @brief Returns the layer index of the layer the shape is on + Throws an exception if the shape does not reside inside a cell. + + This method has been added in version 0.23. + + Setter: + @brief Moves the shape to a layer given by the layer index object + + This method has been added in version 0.23. + """ + layer_info: LayerInfo + r""" + Getter: + @brief Returns the \LayerInfo object of the layer the shape is on + If the shape does not reside inside a cell, an empty layer is returned. + + This method has been added in version 0.23. + + Setter: + @brief Moves the shape to a layer given by a \LayerInfo object + If no layer with the given properties exists, an exception is thrown. + + This method has been added in version 0.23. + """ + path: bool + r""" + Getter: + @brief Returns true, if the shape is a path + + Setter: + @brief Replaces the shape by the given path object + This method replaces the shape by the given path object. This method can only be called for editable layouts. It does not change the user properties of the shape. + Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. + + This method has been introduced in version 0.22. + """ + path_bgnext: int + r""" + Getter: + @brief Gets the path's starting vertex extension + + Applies to paths only. Will throw an exception if the object is not a path. + + Setter: + @brief Sets the path's starting vertex extension + Applies to paths only. Will throw an exception if the object is not a path. + + This method has been introduced in version 0.23. + """ + path_dbgnext: float + r""" + Getter: + @brief Gets the path's starting vertex extension in micrometer units + + Applies to paths only. Will throw an exception if the object is not a path. + + This method has been introduced in version 0.25. + Setter: + @brief Sets the path's starting vertex extension in micrometer units + Applies to paths only. Will throw an exception if the object is not a path. + + This method has been introduced in version 0.25. + """ + path_dendext: float + r""" + Getter: + @brief Gets the path's end vertex extension in micrometer units + + Applies to paths only. Will throw an exception if the object is not a path. + + This method has been introduced in version 0.25. + Setter: + @brief Sets the path's end vertex extension in micrometer units + Applies to paths only. Will throw an exception if the object is not a path. + + This method has been introduced in version 0.25. + """ + path_dwidth: float + r""" + Getter: + @brief Gets the path width in micrometer units + + Applies to paths only. Will throw an exception if the object is not a path. + + This method has been introduced in version 0.25. + Setter: + @brief Sets the path width in micrometer units + Applies to paths only. Will throw an exception if the object is not a path. + Conversion to database units is done internally. + + This method has been introduced in version 0.25. + """ + path_endext: int + r""" + Getter: + @brief Obtain the path's end vertex extension + + Applies to paths only. Will throw an exception if the object is not a path. + + Setter: + @brief Sets the path's end vertex extension + Applies to paths only. Will throw an exception if the object is not a path. + + This method has been introduced in version 0.23. + """ + path_width: int + r""" + Getter: + @brief Gets the path width + + Applies to paths only. Will throw an exception if the object is not a path. + + Setter: + @brief Sets the path width + Applies to paths only. Will throw an exception if the object is not a path. + + This method has been introduced in version 0.23. + """ + polygon: bool + r""" + Getter: + @brief Returns true, if the shape is a polygon + + This method returns true only if the object is a polygon or a simple polygon. Other objects can convert to polygons, for example paths, so it may be possible to use the \polygon method also if is_polygon? does not return true. + Setter: + @brief Replaces the shape by the given polygon object + This method replaces the shape by the given polygon object. This method can only be called for editable layouts. It does not change the user properties of the shape. + Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. + + This method has been introduced in version 0.22. + """ + prop_id: int + r""" + Getter: + @brief Gets the properties ID associated with the shape + + The \Layout object can be used to retrieve the actual properties associated with the ID. + Setter: + @brief Sets the properties ID of this shape + + The \Layout object can be used to retrieve an ID for a given set of properties. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. + + This method has been introduced in version 0.22. + """ + round_path: bool + r""" + Getter: + @brief Returns true, if the path has round ends + + Applies to paths only. Will throw an exception if the object is not a path. + + Setter: + @brief The path will be a round-ended path if this property is set to true + + Applies to paths only. Will throw an exception if the object is not a path. + Please note that the extensions will apply as well. To get a path with circular ends, set the begin and end extensions to half the path's width. + + This method has been introduced in version 0.23. + """ + simple_polygon: bool + r""" + Getter: + @brief Returns true, if the shape is a simple polygon + + This method returns true only if the object is a simple polygon. The simple polygon identity is contained in the polygon identity, so usually it is sufficient to use \is_polygon? and \polygon instead of specifically handle simply polygons. This method is provided only for specific optimisation purposes. + Setter: + @brief Replaces the shape by the given simple polygon object + This method replaces the shape by the given simple polygon object. This method can only be called for editable layouts. It does not change the user properties of the shape. + Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. + + This method has been introduced in version 0.22. + """ + text: bool + r""" + Getter: + @brief Returns true, if the object is a text + + Setter: + @brief Replaces the shape by the given text object + This method replaces the shape by the given text object. This method can only be called for editable layouts. It does not change the user properties of the shape. + Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. + + This method has been introduced in version 0.22. + """ + text_dpos: DVector + r""" + Getter: + @brief Gets the text's position in micrometer units + + Applies to texts only. Will throw an exception if the object is not a text. + + This method has been added in version 0.25. + + Setter: + @brief Sets the text's position in micrometer units + Applies to texts only. Will throw an exception if the object is not a text. + + This method has been added in version 0.25. + """ + text_dsize: float + r""" + Getter: + @brief Gets the text size in micrometer units + + Applies to texts only. Will throw an exception if the object is not a text. + + This method has been introduced in version 0.25. + Setter: + @brief Sets the text size in micrometer units + + Applies to texts only. Will throw an exception if the object is not a text. + + This method has been introduced in version 0.25. + """ + text_dtrans: DTrans + r""" + Getter: + @brief Gets the text transformation in micrometer units + + Applies to texts only. Will throw an exception if the object is not a text. + + This method has been added in version 0.25. + + Setter: + @brief Sets the text transformation in micrometer units + Applies to texts only. Will throw an exception if the object is not a text. + + This method has been introduced in version 0.25. + """ + text_font: int + r""" + Getter: + @brief Gets the text's font + + Applies to texts only. Will throw an exception if the object is not a text. + + Setter: + @brief Sets the text's font + + Applies to texts only. Will throw an exception if the object is not a text. + + This method has been introduced in version 0.23. + """ + text_halign: int + r""" + Getter: + @brief Gets the text's horizontal alignment + + Applies to texts only. Will throw an exception if the object is not a text. + The return value is 0 for left alignment, 1 for center alignment and 2 to right alignment. + + This method has been introduced in version 0.22. + + Setter: + @brief Sets the text's horizontal alignment + + Applies to texts only. Will throw an exception if the object is not a text. + See \text_halign for a description of that property. + + This method has been introduced in version 0.23. + """ + text_pos: Vector + r""" + Getter: + @brief Gets the text's position + + Applies to texts only. Will throw an exception if the object is not a text. + + Setter: + @brief Sets the text's position + Applies to texts only. Will throw an exception if the object is not a text. + """ + text_rot: int + r""" + Getter: + @brief Gets the text's orientation code (see \Trans) + + Applies to texts only. Will throw an exception if the object is not a text. + + Setter: + @brief Sets the text's orientation code (see \Trans) + + Applies to texts only. Will throw an exception if the object is not a text. + """ + text_size: int + r""" + Getter: + @brief Gets the text size + + Applies to texts only. Will throw an exception if the object is not a text. + + Setter: + @brief Sets the text size + + Applies to texts only. Will throw an exception if the object is not a text. + + This method has been introduced in version 0.23. + """ + text_string: str + r""" + Getter: + @brief Obtain the text string + + Applies to texts only. Will throw an exception if the object is not a text. + + Setter: + @brief Sets the text string + + Applies to texts only. Will throw an exception if the object is not a text. + + This method has been introduced in version 0.23. + """ + text_trans: Trans + r""" + Getter: + @brief Gets the text transformation + + Applies to texts only. Will throw an exception if the object is not a text. + + Setter: + @brief Sets the text transformation + Applies to texts only. Will throw an exception if the object is not a text. + + This method has been introduced in version 0.23. + """ + text_valign: int + r""" + Getter: + @brief Gets the text's vertical alignment + + Applies to texts only. Will throw an exception if the object is not a text. + The return value is 0 for top alignment, 1 for center alignment and 2 to bottom alignment. + + This method has been introduced in version 0.22. + + Setter: + @brief Sets the text's vertical alignment + + Applies to texts only. Will throw an exception if the object is not a text. + See \text_valign for a description of that property. + + This method has been introduced in version 0.23. + """ + @classmethod + def new(cls) -> Shape: + r""" + @brief Creates a new object of this class + """ + @classmethod + def t_box(cls) -> int: + r""" + """ + @classmethod + def t_box_array(cls) -> int: + r""" + """ + @classmethod + def t_box_array_member(cls) -> int: + r""" + """ + @classmethod + def t_edge(cls) -> int: + r""" + """ + @classmethod + def t_edge_pair(cls) -> int: + r""" + """ + @classmethod + def t_null(cls) -> int: + r""" + """ + @classmethod + def t_path(cls) -> int: + r""" + """ + @classmethod + def t_path_ptr_array(cls) -> int: + r""" + """ + @classmethod + def t_path_ptr_array_member(cls) -> int: + r""" + """ + @classmethod + def t_path_ref(cls) -> int: + r""" + """ + @classmethod + def t_polygon(cls) -> int: + r""" + """ + @classmethod + def t_polygon_ptr_array(cls) -> int: + r""" + """ + @classmethod + def t_polygon_ptr_array_member(cls) -> int: + r""" + """ + @classmethod + def t_polygon_ref(cls) -> int: + r""" + """ + @classmethod + def t_short_box(cls) -> int: + r""" + """ + @classmethod + def t_short_box_array(cls) -> int: + r""" + """ + @classmethod + def t_short_box_array_member(cls) -> int: + r""" + """ + @classmethod + def t_simple_polygon(cls) -> int: + r""" + """ + @classmethod + def t_simple_polygon_ptr_array(cls) -> int: + r""" + """ + @classmethod + def t_simple_polygon_ptr_array_member(cls) -> int: + r""" + """ + @classmethod + def t_simple_polygon_ref(cls) -> int: + r""" + """ + @classmethod + def t_text(cls) -> int: + r""" + """ + @classmethod + def t_text_ptr_array(cls) -> int: + r""" + """ + @classmethod + def t_text_ptr_array_member(cls) -> int: + r""" + """ + @classmethod + def t_text_ref(cls) -> int: + r""" + """ + @classmethod + def t_user_object(cls) -> int: + r""" + """ + def __copy__(self) -> Shape: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Equality operator + + Equality of shapes is not specified by the identity of the objects but by the + identity of the pointers - both shapes must refer to the same object. + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Inequality operator + """ + def __str__(self) -> str: + r""" + @brief Create a string showing the contents of the reference + + This method has been introduced with version 0.16. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def area(self) -> int: + r""" + @brief Returns the area of the shape + This method has been added in version 0.22. + """ + def array_dtrans(self) -> DTrans: + r""" + @brief Gets the array instance member transformation in micrometer units + + This attribute is valid only if \is_array_member? is true. + The transformation returned describes the relative transformation of the + array member addressed. The displacement is given in micrometer units. + + This method has been added in version 0.25. + """ + def array_trans(self) -> Trans: + r""" + @brief Gets the array instance member transformation + + This attribute is valid only if \is_array_member? is true. + The transformation returned describes the relative transformation of the + array member addressed. + """ + def assign(self, other: Shape) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> Box: + r""" + @brief Returns the bounding box of the shape + """ + def box(self) -> Any: + r""" + @brief Gets the box object + + Starting with version 0.23, this method returns nil, if the shape does not represent a box. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def darea(self) -> float: + r""" + @brief Returns the area of the shape in square micrometer units + This method has been added in version 0.25. + """ + def dbbox(self) -> DBox: + r""" + @brief Returns the bounding box of the shape in micrometer units + This method has been added in version 0.25. + """ + def delete(self) -> None: + r""" + @brief Deletes the shape + + After the shape is deleted, the shape object is emptied and points to nothing. + + This method has been introduced in version 0.23. + """ + def delete_property(self, key: Any) -> None: + r""" + @brief Deletes the user property with the given key + This method is a convenience method that deletes the property with the given key. It does nothing if no property with that key exists. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. + This method may change the properties ID. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. + + This method has been introduced in version 0.22. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dperimeter(self) -> float: + r""" + @brief Returns the perimeter of the shape in micrometer units + + This method will return an approximation of the perimeter for paths. + + This method has been added in version 0.25. + """ + def dup(self) -> Shape: + r""" + @brief Creates a copy of self + """ + @overload + def each_dedge(self) -> Iterator[DEdge]: + r""" + @brief Iterates over the edges of the object and returns edges in micrometer units + + This method iterates over all edges of polygons and simple polygons like \each_edge, but will deliver edges in micrometer units. Multiplication by the database unit is done internally. + + This method has been introduced in version 0.25. + """ + @overload + def each_dedge(self, contour: int) -> Iterator[DEdge]: + r""" + @brief Iterates over the edges of a single contour of the object and returns edges in micrometer units + + This method iterates over all edges of polygons and simple polygons like \each_edge, but will deliver edges in micrometer units. Multiplication by the database unit is done internally. + + This method has been introduced in version 0.25. + """ + def each_dpoint(self) -> Iterator[DPoint]: + r""" + @brief Iterates over all points of the object and returns points in micrometer units + + This method iterates over all points of the object like \each_point, but it returns \DPoint objects that are given in micrometer units already. Multiplication with the database unit happens internally. + + This method has been introduced in version 0.25. + """ + def each_dpoint_hole(self, hole_index: int) -> Iterator[DPoint]: + r""" + @brief Iterates over a hole contour of the object and returns points in micrometer units + + This method iterates over all points of the object's contour' like \each_point_hole, but it returns \DPoint objects that are given in micrometer units already. Multiplication with the database unit happens internally. + + This method has been introduced in version 0.25. + """ + def each_dpoint_hull(self) -> Iterator[DPoint]: + r""" + @brief Iterates over the hull contour of the object and returns points in micrometer units + + This method iterates over all points of the object's contour' like \each_point_hull, but it returns \DPoint objects that are given in micrometer units already. Multiplication with the database unit happens internally. + + This method has been introduced in version 0.25. + """ + @overload + def each_edge(self) -> Iterator[Edge]: + r""" + @brief Iterates over the edges of the object + + This method applies to polygons and simple polygons and delivers all edges that form the polygon's contours. Hole edges are oriented counterclockwise while hull edges are oriented clockwise. + + It will throw an exception if the object is not a polygon. + """ + @overload + def each_edge(self, contour: int) -> Iterator[Edge]: + r""" + @brief Iterates over the edges of a single contour of the object + @param contour The contour number (0 for hull, 1 for first hole ...) + + This method applies to polygons and simple polygons and delivers all edges that form the given contour of the polygon. The hull has contour number 0, the first hole has contour 1 etc. + Hole edges are oriented counterclockwise while hull edges are oriented clockwise. + + It will throw an exception if the object is not a polygon. + + This method was introduced in version 0.24. + """ + def each_point(self) -> Iterator[Point]: + r""" + @brief Iterates over all points of the object + + This method applies to paths and delivers all points of the path's center line. + It will throw an exception for other objects. + """ + def each_point_hole(self, hole_index: int) -> Iterator[Point]: + r""" + @brief Iterates over the points of a hole contour + + This method applies to polygons and delivers all points of the respective hole contour. + It will throw an exception for other objects. + Simple polygons deliver an empty sequence. + + @param hole The hole index (see holes () method) + """ + def each_point_hull(self) -> Iterator[Point]: + r""" + @brief Iterates over the hull contour of the object + + This method applies to polygons and delivers all points of the polygon hull contour. + It will throw an exception for other objects. + """ + def edge(self) -> Any: + r""" + @brief Returns the edge object + + Starting with version 0.23, this method returns nil, if the shape does not represent an edge. + """ + def edge_pair(self) -> Any: + r""" + @brief Returns the edge pair object + + This method has been introduced in version 0.26. + """ + def has_prop_id(self) -> bool: + r""" + @brief Returns true, if the shape has properties, i.e. has a properties ID + """ + def holes(self) -> int: + r""" + @brief Returns the number of holes + + This method applies to polygons and will throw an exception for other objects.. + Simple polygons deliver a value of zero. + """ + def is_array_member(self) -> bool: + r""" + @brief Returns true, if the shape is a member of a shape array + """ + def is_box(self) -> bool: + r""" + @brief Returns true if the shape is a box + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_edge(self) -> bool: + r""" + @brief Returns true, if the object is an edge + """ + def is_edge_pair(self) -> bool: + r""" + @brief Returns true, if the object is an edge pair + + This method has been introduced in version 0.26. + """ + def is_null(self) -> bool: + r""" + @brief Returns true, if the shape reference is a null reference (not referring to a shape) + """ + def is_path(self) -> bool: + r""" + @brief Returns true, if the shape is a path + """ + def is_polygon(self) -> bool: + r""" + @brief Returns true, if the shape is a polygon + + This method returns true only if the object is a polygon or a simple polygon. Other objects can convert to polygons, for example paths, so it may be possible to use the \polygon method also if is_polygon? does not return true. + """ + def is_simple_polygon(self) -> bool: + r""" + @brief Returns true, if the shape is a simple polygon + + This method returns true only if the object is a simple polygon. The simple polygon identity is contained in the polygon identity, so usually it is sufficient to use \is_polygon? and \polygon instead of specifically handle simply polygons. This method is provided only for specific optimisation purposes. + """ + def is_text(self) -> bool: + r""" + @brief Returns true, if the object is a text + """ + def is_user_object(self) -> bool: + r""" + @brief Returns true if the shape is a user defined object + """ + def is_valid(self) -> bool: + r""" + @brief Returns true, if the shape is valid + + After the shape is deleted, the shape object is no longer valid and this method returns false. + + This method has been introduced in version 0.23. + """ + def layout(self) -> Layout: + r""" + @brief Gets a reference to the Layout the shape belongs to + + This reference can be nil, if the Shape object is not living inside a layout. + + This method has been introduced in version 0.22. + """ + def path(self) -> Any: + r""" + @brief Returns the path object + + Starting with version 0.23, this method returns nil, if the shape does not represent a path. + """ + def path_dlength(self) -> float: + r""" + @brief Returns the length of the path in micrometer units + + Applies to paths only. Will throw an exception if the object is not a path. + This method returns the length of the spine plus extensions if present. + The value returned is given in micrometer units. + + This method has been added in version 0.25. + """ + def path_length(self) -> int: + r""" + @brief Returns the length of the path + + Applies to paths only. Will throw an exception if the object is not a path. + This method returns the length of the spine plus extensions if present. + + This method has been added in version 0.23. + """ + def perimeter(self) -> int: + r""" + @brief Returns the perimeter of the shape + + This method will return an approximation of the perimeter for paths. + + This method has been added in version 0.23. + """ + def polygon(self) -> Any: + r""" + @brief Returns the polygon object + + Returns the polygon object that this shape refers to or converts the object to a polygon. Paths, boxes and simple polygons are converted to polygons. For paths this operation renders the path's hull contour. + + Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a polygon. + """ + def property(self, key: Any) -> Any: + r""" + @brief Gets the user property with the given key + This method is a convenience method that gets the property with the given key. If no property with that key does not exist, it will return nil. Using that method is more convenient than using the layout object and the properties ID to retrieve the property value. + This method has been introduced in version 0.22. + """ + def set_property(self, key: Any, value: Any) -> None: + r""" + @brief Sets the user property with the given key to the given value + This method is a convenience method that sets the property with the given key to the given value. If no property with that key exists, it will create one. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. + This method may change the properties ID. Note: GDS only supports integer keys. OASIS supports numeric and string keys. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. + + This method has been introduced in version 0.22. + """ + def shapes(self) -> Shapes: + r""" + @brief Gets a reference to the Shapes container the shape lives in + + This reference can be nil, if the Shape object is not referring to an actual shape. + + This method has been introduced in version 0.22. + """ + def simple_polygon(self) -> Any: + r""" + @brief Returns the simple polygon object + + Returns the simple polygon object that this shape refers to or converts the object to a simple polygon. Paths, boxes and polygons are converted to simple polygons. Polygons with holes will have their holes removed but introducing cut lines that connect the hole contours with the outer contour. + Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a simple polygon. + """ + def text(self) -> Any: + r""" + @brief Returns the text object + + Starting with version 0.23, this method returns nil, if the shape does not represent a text. + """ + def to_s(self) -> str: + r""" + @brief Create a string showing the contents of the reference + + This method has been introduced with version 0.16. + """ + @overload + def transform(self, trans: DCplxTrans) -> None: + r""" + @brief Transforms the shape with the given complex transformation, given in micrometer units + This method has been introduced in version 0.25. + """ + @overload + def transform(self, trans: DTrans) -> None: + r""" + @brief Transforms the shape with the given transformation, given in micrometer units + This method has been introduced in version 0.25. + """ + @overload + def transform(self, trans: ICplxTrans) -> None: + r""" + @brief Transforms the shape with the given complex transformation + This method has been introduced in version 0.23. + """ + @overload + def transform(self, trans: Trans) -> None: + r""" + @brief Transforms the shape with the given transformation + This method has been introduced in version 0.23. + """ + def type(self) -> int: + r""" + @brief Return the type of the shape + + The returned values are the t_... constants available through the corresponding class members. + """ + +class ShapeProcessor: + r""" + @brief The shape processor (boolean, sizing, merge on shapes) + + The shape processor implements the boolean and edge set operations (size, merge). Because the shape processor might allocate resources which can be reused in later operations, it is implemented as an object that can be used several times. The shape processor is similar to the \EdgeProcessor. The latter is specialized on handling polygons and edges directly. + """ + @classmethod + def new(cls) -> ShapeProcessor: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> ShapeProcessor: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: ShapeProcessor) -> None: + r""" + @brief Assigns another object to self + """ + @overload + def boolean(self, in_a: Sequence[Shape], in_b: Sequence[Shape], mode: int) -> List[Edge]: + r""" + @brief Boolean operation on two given shape sets into an edge set + + See the \EdgeProcessor for a description of the boolean operations. This implementation takes shapes + rather than polygons for input and produces an edge set. + + This version does not feature a transformation for each shape (unity is assumed). + + @param in_a The set of shapes to use for input A + @param in_b The set of shapes to use for input A + @param mode The boolean operation (see \EdgeProcessor) + """ + @overload + def boolean(self, in_a: Sequence[Shape], trans_a: Sequence[CplxTrans], in_b: Sequence[Shape], trans_b: Sequence[CplxTrans], mode: int) -> List[Edge]: + r""" + @brief Boolean operation on two given shape sets into an edge set + + See the \EdgeProcessor for a description of the boolean operations. This implementation takes shapes + rather than polygons for input and produces an edge set. + + @param in_a The set of shapes to use for input A + @param trans_a A set of transformations to apply before the shapes are used + @param in_b The set of shapes to use for input A + @param trans_b A set of transformations to apply before the shapes are used + @param mode The boolean operation (see \EdgeProcessor) + """ + @overload + def boolean(self, layout_a: Layout, cell_a: Cell, layer_a: int, layout_b: Layout, cell_b: Cell, layer_b: int, out: Shapes, mode: int, hierarchical: bool, resolve_holes: bool, min_coherence: bool) -> None: + r""" + @brief Boolean operation on shapes from layouts + + See the \EdgeProcessor for a description of the boolean operations. This implementation takes shapes + from layout cells (optionally all in hierarchy) and produces new shapes in a shapes container. + @param layout_a The layout from which to take the shapes for input A + @param cell_a The cell (in 'layout') from which to take the shapes for input A + @param layer_a The cell (in 'layout') from which to take the shapes for input A + @param layout_b The layout from which to take the shapes for input B + @param cell_b The cell (in 'layout') from which to take the shapes for input B + @param layer_b The cell (in 'layout') from which to take the shapes for input B + @param out The shapes container where to put the shapes into (is cleared before) + @param mode The boolean operation (see \EdgeProcessor) + @param hierarchical Collect shapes from sub cells as well + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if minimum polygons should be created for touching corners + """ + @overload + def boolean_to_polygon(self, in_a: Sequence[Shape], in_b: Sequence[Shape], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Boolean operation on two given shape sets into a polygon set + + See the \EdgeProcessor for a description of the boolean operations. This implementation takes shapes + rather than polygons for input and produces a polygon set. + + This version does not feature a transformation for each shape (unity is assumed). + + @param in_a The set of shapes to use for input A + @param in_b The set of shapes to use for input A + @param mode The boolean operation (see \EdgeProcessor) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if minimum polygons should be created for touching corners + """ + @overload + def boolean_to_polygon(self, in_a: Sequence[Shape], trans_a: Sequence[CplxTrans], in_b: Sequence[Shape], trans_b: Sequence[CplxTrans], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Boolean operation on two given shape sets into a polygon set + + See the \EdgeProcessor for a description of the boolean operations. This implementation takes shapes + rather than polygons for input and produces a polygon set. + + @param in_a The set of shapes to use for input A + @param trans_a A set of transformations to apply before the shapes are used + @param in_b The set of shapes to use for input A + @param trans_b A set of transformations to apply before the shapes are used + @param mode The boolean operation (see \EdgeProcessor) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if minimum polygons should be created for touching corners + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> ShapeProcessor: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + @overload + def merge(self, in_: Sequence[Shape], min_wc: int) -> List[Edge]: + r""" + @brief Merge the given shapes + + See the \EdgeProcessor for a description of the merge method. This implementation takes shapes + rather than polygons for input and produces an edge set. + + This version does not feature a transformation for each shape (unity is assumed). + + @param in The set of shapes to merge + @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) + """ + @overload + def merge(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], min_wc: int) -> List[Edge]: + r""" + @brief Merge the given shapes + + See the \EdgeProcessor for a description of the merge method. This implementation takes shapes + rather than polygons for input and produces an edge set. + + @param in The set of shapes to merge + @param trans A corresponding set of transformations to apply on the shapes + @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) + """ + @overload + def merge(self, layout: Layout, cell: Cell, layer: int, out: Shapes, hierarchical: bool, min_wc: int, resolve_holes: bool, min_coherence: bool) -> None: + r""" + @brief Merge the given shapes from a layout into a shapes container + + See the \EdgeProcessor for a description of the merge method. This implementation takes shapes + from a layout cell (optionally all in hierarchy) and produces new shapes in a shapes container. + @param layout The layout from which to take the shapes + @param cell The cell (in 'layout') from which to take the shapes + @param layer The cell (in 'layout') from which to take the shapes + @param out The shapes container where to put the shapes into (is cleared before) + @param hierarchical Collect shapes from sub cells as well + @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if minimum polygons should be created for touching corners + """ + @overload + def merge_to_polygon(self, in_: Sequence[Shape], min_wc: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Merge the given shapes + + See the \EdgeProcessor for a description of the merge method. This implementation takes shapes + rather than polygons for input and produces a polygon set. + + This version does not feature a transformation for each shape (unity is assumed). + + @param in The set of shapes to merge + @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if minimum polygons should be created for touching corners + """ + @overload + def merge_to_polygon(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], min_wc: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Merge the given shapes + + See the \EdgeProcessor for a description of the merge method. This implementation takes shapes + rather than polygons for input and produces a polygon set. + + @param in The set of shapes to merge + @param trans A corresponding set of transformations to apply on the shapes + @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if minimum polygons should be created for touching corners + """ + @overload + def size(self, in_: Sequence[Shape], d: int, mode: int) -> List[Edge]: + r""" + @brief Size the given shapes + + See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes + rather than polygons for input and produces an edge set. This is isotropic version that does not allow + to specify different values in x and y direction. + This version does not feature a transformation for each shape (unity is assumed). + + @param in The set of shapes to size + @param d The sizing value + @param mode The sizing mode (see \EdgeProcessor) + """ + @overload + def size(self, in_: Sequence[Shape], dx: int, dy: int, mode: int) -> List[Edge]: + r""" + @brief Size the given shapes + + See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes + rather than polygons for input and produces an edge set. + + This version does not feature a transformation for each shape (unity is assumed). + + @param in The set of shapes to size + @param dx The sizing value in x-direction + @param dy The sizing value in y-direction + @param mode The sizing mode (see \EdgeProcessor) + """ + @overload + def size(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], d: int, mode: int) -> List[Edge]: + r""" + @brief Size the given shapes + + See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes + rather than polygons for input and produces an edge set. This is isotropic version that does not allow + to specify different values in x and y direction. + @param in The set of shapes to size + @param trans A corresponding set of transformations to apply on the shapes + @param d The sizing value + @param mode The sizing mode (see \EdgeProcessor) + """ + @overload + def size(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], dx: int, dy: int, mode: int) -> List[Edge]: + r""" + @brief Size the given shapes + + See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes + rather than polygons for input and produces an edge set. + + @param in The set of shapes to size + @param trans A corresponding set of transformations to apply on the shapes + @param dx The sizing value in x-direction + @param dy The sizing value in y-direction + @param mode The sizing mode (see \EdgeProcessor) + """ + @overload + def size(self, layout: Layout, cell: Cell, layer: int, out: Shapes, d: int, mode: int, hierarchical: bool, resolve_holes: bool, min_coherence: bool) -> None: + r""" + @brief Sizing operation on shapes from layouts + + See the \EdgeProcessor for a description of the sizing operation. This implementation takes shapes + from a layout cell (optionally all in hierarchy) and produces new shapes in a shapes container. This is the isotropic version which does not allow specification of different sizing values in x and y-direction. + @param layout The layout from which to take the shapes + @param cell The cell (in 'layout') from which to take the shapes + @param layer The cell (in 'layout') from which to take the shapes + @param out The shapes container where to put the shapes into (is cleared before) + @param d The sizing value (see \EdgeProcessor) + @param mode The sizing mode (see \EdgeProcessor) + @param hierarchical Collect shapes from sub cells as well + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if minimum polygons should be created for touching corners + """ + @overload + def size(self, layout: Layout, cell: Cell, layer: int, out: Shapes, dx: int, dy: int, mode: int, hierarchical: bool, resolve_holes: bool, min_coherence: bool) -> None: + r""" + @brief Sizing operation on shapes from layouts + + See the \EdgeProcessor for a description of the sizing operation. This implementation takes shapes + from a layout cell (optionally all in hierarchy) and produces new shapes in a shapes container. + @param layout The layout from which to take the shapes + @param cell The cell (in 'layout') from which to take the shapes + @param layer The cell (in 'layout') from which to take the shapes + @param out The shapes container where to put the shapes into (is cleared before) + @param dx The sizing value in x-direction (see \EdgeProcessor) + @param dy The sizing value in y-direction (see \EdgeProcessor) + @param mode The sizing mode (see \EdgeProcessor) + @param hierarchical Collect shapes from sub cells as well + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if minimum polygons should be created for touching corners + """ + @overload + def size_to_polygon(self, in_: Sequence[Shape], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Size the given shapes + + See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes + rather than polygons for input and produces a polygon set. This is isotropic version that does not allow + to specify different values in x and y direction. + This version does not feature a transformation for each shape (unity is assumed). + + @param in The set of shapes to size + @param d The sizing value + @param mode The sizing mode (see \EdgeProcessor) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if minimum polygons should be created for touching corners + """ + @overload + def size_to_polygon(self, in_: Sequence[Shape], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Size the given shapes + + See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes + rather than polygons for input and produces a polygon set. + + This version does not feature a transformation for each shape (unity is assumed). + + @param in The set of shapes to size + @param dx The sizing value in x-direction + @param dy The sizing value in y-direction + @param mode The sizing mode (see \EdgeProcessor) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if minimum polygons should be created for touching corners + """ + @overload + def size_to_polygon(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Size the given shapes + + See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes + rather than polygons for input and produces a polygon set. This is isotropic version that does not allow + to specify different values in x and y direction. + @param in The set of shapes to size + @param trans A corresponding set of transformations to apply on the shapes + @param d The sizing value + @param mode The sizing mode (see \EdgeProcessor) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if minimum polygons should be created for touching corners + """ + @overload + def size_to_polygon(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Size the given shapes + + See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes + rather than polygons for input and produces a polygon set. + + @param in The set of shapes to size + @param trans A corresponding set of transformations to apply on the shapes + @param dx The sizing value in x-direction + @param dy The sizing value in y-direction + @param mode The sizing mode (see \EdgeProcessor) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if minimum polygons should be created for touching corners + """ + +class Shapes: + r""" + @brief A collection of shapes + + A shapes collection is a collection of geometrical objects, such as polygons, boxes, paths, edges, edge pairs or text objects. + + Shapes objects are the basic containers for geometrical objects of a cell. Inside a cell, there is one Shapes object per layer. + """ + SAll: ClassVar[int] + r""" + @brief Indicates that all shapes shall be retrieved + """ + SAllWithProperties: ClassVar[int] + r""" + @brief Indicates that all shapes with properties shall be retrieved + """ + SBoxes: ClassVar[int] + r""" + @brief Indicates that boxes shall be retrieved + """ + SEdgePairs: ClassVar[int] + r""" + @brief Indicates that edge pairs shall be retrieved + """ + SEdges: ClassVar[int] + r""" + @brief Indicates that edges shall be retrieved + """ + SPaths: ClassVar[int] + r""" + @brief Indicates that paths shall be retrieved + """ + SPolygons: ClassVar[int] + r""" + @brief Indicates that polygons shall be retrieved + """ + SProperties: ClassVar[int] + r""" + @brief Indicates that only shapes with properties shall be retrieved + """ + SRegions: ClassVar[int] + r""" + @brief Indicates that objects which can be polygonized shall be retrieved (paths, boxes, polygons etc.) + + This constant has been added in version 0.27. + """ + STexts: ClassVar[int] + r""" + @brief Indicates that texts be retrieved + """ + SUserObjects: ClassVar[int] + r""" + @brief Indicates that user objects shall be retrieved + """ + @classmethod + def new(cls) -> Shapes: + r""" + @brief Creates a new object of this class + """ + @classmethod + def s_all(cls) -> int: + r""" + @brief Indicates that all shapes shall be retrieved + """ + @classmethod + def s_all_with_properties(cls) -> int: + r""" + @brief Indicates that all shapes with properties shall be retrieved + """ + @classmethod + def s_boxes(cls) -> int: + r""" + @brief Indicates that boxes shall be retrieved + """ + @classmethod + def s_edge_pairs(cls) -> int: + r""" + @brief Indicates that edge pairs shall be retrieved + """ + @classmethod + def s_edges(cls) -> int: + r""" + @brief Indicates that edges shall be retrieved + """ + @classmethod + def s_paths(cls) -> int: + r""" + @brief Indicates that paths shall be retrieved + """ + @classmethod + def s_polygons(cls) -> int: + r""" + @brief Indicates that polygons shall be retrieved + """ + @classmethod + def s_properties(cls) -> int: + r""" + @brief Indicates that only shapes with properties shall be retrieved + """ + @classmethod + def s_regions(cls) -> int: + r""" + @brief Indicates that objects which can be polygonized shall be retrieved (paths, boxes, polygons etc.) + + This constant has been added in version 0.27. + """ + @classmethod + def s_texts(cls) -> int: + r""" + @brief Indicates that texts be retrieved + """ + @classmethod + def s_user_objects(cls) -> int: + r""" + @brief Indicates that user objects shall be retrieved + """ + def __copy__(self) -> Shapes: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def __iter__(self) -> Iterator[Shape]: + r""" + @brief Gets all shapes + + This call is equivalent to each(SAll). This convenience method has been introduced in version 0.16 + """ + def __len__(self) -> int: + r""" + @brief Gets the number of shapes in this container + This method was introduced in version 0.16 + @return The number of shapes in this container + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: Shapes) -> None: + r""" + @brief Assigns another object to self + """ + def cell(self) -> Cell: + r""" + @brief Gets the cell the shape container belongs to + This method returns nil if the shape container does not belong to a cell. + + This method has been added in version 0.28. + """ + def clear(self) -> None: + r""" + @brief Clears the shape container + This method has been introduced in version 0.16. It can only be used in editable mode. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dump_mem_statistics(self, detailed: Optional[bool] = ...) -> None: + r""" + @hide + """ + def dup(self) -> Shapes: + r""" + @brief Creates a copy of self + """ + @overload + def each(self) -> Iterator[Shape]: + r""" + @brief Gets all shapes + + This call is equivalent to each(SAll). This convenience method has been introduced in version 0.16 + """ + @overload + def each(self, flags: int) -> Iterator[Shape]: + r""" + @brief Gets all shapes + + @param flags An "or"-ed combination of the S... constants + """ + @overload + def each_overlapping(self, region: Box) -> Iterator[Shape]: + r""" + @brief Gets all shapes that overlap the search box (region) + @param region The rectangular search region + + This call is equivalent to each_overlapping(SAll,region). This convenience method has been introduced in version 0.16 + """ + @overload + def each_overlapping(self, region: DBox) -> Iterator[Shape]: + r""" + @brief Gets all shapes that overlap the search box (region) where the search box is given in micrometer units + @param region The rectangular search region as a \DBox object in micrometer units + This call is equivalent to each_touching(SAll,region). + + This method was introduced in version 0.25 + """ + @overload + def each_overlapping(self, flags: int, region: Box) -> Iterator[Shape]: + r""" + @brief Gets all shapes that overlap the search box (region) + This method was introduced in version 0.16 + + @param flags An "or"-ed combination of the S... constants + @param region The rectangular search region + """ + @overload + def each_overlapping(self, flags: int, region: DBox) -> Iterator[Shape]: + r""" + @brief Gets all shapes that overlap the search box (region) where the search box is given in micrometer units + @param flags An "or"-ed combination of the S... constants + @param region The rectangular search region as a \DBox object in micrometer units + + This method was introduced in version 0.25 + """ + @overload + def each_touching(self, region: Box) -> Iterator[Shape]: + r""" + @brief Gets all shapes that touch the search box (region) + @param region The rectangular search region + + This call is equivalent to each_touching(SAll,region). This convenience method has been introduced in version 0.16 + """ + @overload + def each_touching(self, region: DBox) -> Iterator[Shape]: + r""" + @brief Gets all shapes that touch the search box (region) where the search box is given in micrometer units + @param region The rectangular search region as a \DBox object in micrometer units + This call is equivalent to each_touching(SAll,region). + + This method was introduced in version 0.25 + """ + @overload + def each_touching(self, flags: int, region: Box) -> Iterator[Shape]: + r""" + @brief Gets all shapes that touch the search box (region) + This method was introduced in version 0.16 + + @param flags An "or"-ed combination of the S... constants + @param region The rectangular search region + """ + @overload + def each_touching(self, flags: int, region: DBox) -> Iterator[Shape]: + r""" + @brief Gets all shapes that touch the search box (region) where the search box is given in micrometer units + @param flags An "or"-ed combination of the S... constants + @param region The rectangular search region as a \DBox object in micrometer units + + This method was introduced in version 0.25 + """ + def erase(self, shape: Shape) -> None: + r""" + @brief Erases the shape pointed to by the given \Shape object + This method has been introduced in version 0.16. It can only be used in editable mode. + Erasing a shape will invalidate the shape reference. Access to this reference may then render invalid results. + + @param shape The shape which to destroy + """ + def find(self, shape: Shape) -> Shape: + r""" + @brief Finds a shape inside this collected + This method has been introduced in version 0.21. + This method tries to find the given shape in this collection. The original shape may be located in another collection. If the shape is found, this method returns a reference to the shape in this collection, otherwise a null reference is returned. + """ + @overload + def insert(self, box: Box) -> Shape: + r""" + @brief Inserts a box into the shapes list + @return A reference to the new shape (a \Shape object) + + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload + def insert(self, box: DBox) -> Shape: + r""" + @brief Inserts a micrometer-unit box into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Box argument, except that it will internally translate the box from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def insert(self, edge: DEdge) -> Shape: + r""" + @brief Inserts a micrometer-unit edge into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Edge argument, except that it will internally translate the edge from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def insert(self, edge: Edge) -> Shape: + r""" + @brief Inserts an edge into the shapes list + + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload + def insert(self, edge_pair: DEdgePair) -> Shape: + r""" + @brief Inserts a micrometer-unit edge pair into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \EdgePair argument, except that it will internally translate the edge pair from micrometer to database units. + + This variant has been introduced in version 0.26. + """ + @overload + def insert(self, edge_pair: EdgePair) -> Shape: + r""" + @brief Inserts an edge pair into the shapes list + + This method has been introduced in version 0.26. + """ + @overload + def insert(self, edge_pairs: EdgePairs) -> None: + r""" + @brief Inserts the edges from the edge pair collection into this shape container + @param edges The edge pairs to insert + + This method inserts all edge pairs from the edge pair collection into this shape container. + + This method has been introduced in version 0.26. + """ + @overload + def insert(self, edges: Edges) -> None: + r""" + @brief Inserts the edges from the edge collection into this shape container + @param edges The edges to insert + + This method inserts all edges from the edge collection into this shape container. + + This method has been introduced in version 0.23. + """ + @overload + def insert(self, iter: RecursiveShapeIterator) -> None: + r""" + @brief Inserts the shapes taken from a recursive shape iterator + @param iter The iterator from which to take the shapes from + + This method iterates over all shapes from the iterator and inserts them into the container. + + This method has been introduced in version 0.25.3. + """ + @overload + def insert(self, path: DPath) -> Shape: + r""" + @brief Inserts a micrometer-unit path into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Path argument, except that it will internally translate the path from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def insert(self, path: Path) -> Shape: + r""" + @brief Inserts a path into the shapes list + @return A reference to the new shape (a \Shape object) + + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload + def insert(self, polygon: DPolygon) -> Shape: + r""" + @brief Inserts a micrometer-unit polygon into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Polygon argument, except that it will internally translate the polygon from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def insert(self, polygon: Polygon) -> Shape: + r""" + @brief Inserts a polygon into the shapes list + @return A reference to the new shape (a \Shape object) + + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload + def insert(self, region: Region) -> None: + r""" + @brief Inserts the polygons from the region into this shape container + @param region The region to insert + + This method inserts all polygons from the region into this shape container. + + This method has been introduced in version 0.23. + """ + @overload + def insert(self, shape: Shape) -> Shape: + r""" + @brief Inserts a shape from a shape reference into the shapes list + @return A reference (a \Shape object) to the newly created shape + This method has been introduced in version 0.16. + """ + @overload + def insert(self, shapes: Shapes) -> None: + r""" + @brief Inserts the shapes taken from another shape container + @param shapes The other container from which to take the shapes from + + This method takes all shapes from the given container and inserts them into this one. + + This method has been introduced in version 0.25.3. + """ + @overload + def insert(self, simple_polygon: DSimplePolygon) -> Shape: + r""" + @brief Inserts a micrometer-unit simple polygon into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \SimplePolygon argument, except that it will internally translate the polygon from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def insert(self, simple_polygon: SimplePolygon) -> Shape: + r""" + @brief Inserts a simple polygon into the shapes list + @return A reference to the new shape (a \Shape object) + + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload + def insert(self, text: DText) -> Shape: + r""" + @brief Inserts a micrometer-unit text into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Text argument, except that it will internally translate the text from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def insert(self, text: Text) -> Shape: + r""" + @brief Inserts a text into the shapes list + @return A reference to the new shape (a \Shape object) + + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload + def insert(self, texts: Texts) -> None: + r""" + @brief Inserts the texts from the text collection into this shape container + @param texts The texts to insert + + This method inserts all texts from the text collection into this shape container. + + This method has been introduced in version 0.27. + """ + @overload + def insert(self, box: Box, property_id: int) -> Shape: + r""" + @brief Inserts a box with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload + def insert(self, box: DBox, property_id: int) -> Shape: + r""" + @brief Inserts a micrometer-unit box with properties into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Box argument and a property ID, except that it will internally translate the box from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def insert(self, edge: DEdge, property_id: int) -> Shape: + r""" + @brief Inserts a micrometer-unit edge with properties into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Edge argument and a property ID, except that it will internally translate the edge from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def insert(self, edge: Edge, property_id: int) -> Shape: + r""" + @brief Inserts an edge with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape. + """ + @overload + def insert(self, edge_pair: DEdgePair, property_id: int) -> Shape: + r""" + @brief Inserts a micrometer-unit edge pair with properties into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \EdgePair argument and a property ID, except that it will internally translate the edge pair from micrometer to database units. + + This variant has been introduced in version 0.26. + """ + @overload + def insert(self, edge_pair: EdgePair, property_id: int) -> Shape: + r""" + @brief Inserts an edge pair with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + This method has been introduced in version 0.26. + """ + @overload + def insert(self, edge_pairs: EdgePairs, trans: DCplxTrans) -> None: + r""" + @brief Inserts the edge pairs from the edge pair collection into this shape container with a transformation (given in micrometer units) + @param edges The edge pairs to insert + @param trans The transformation to apply (displacement in micrometer units) + + This method inserts all edge pairs from the edge pair collection into this shape container. + Before an edge pair is inserted, the given transformation is applied. + + This method has been introduced in version 0.26. + """ + @overload + def insert(self, edge_pairs: EdgePairs, trans: ICplxTrans) -> None: + r""" + @brief Inserts the edge pairs from the edge pair collection into this shape container with a transformation + @param edges The edge pairs to insert + @param trans The transformation to apply + + This method inserts all edge pairs from the edge pair collection into this shape container. + Before an edge pair is inserted, the given transformation is applied. + + This method has been introduced in version 0.26. + """ + @overload + def insert(self, edges: Edges, trans: DCplxTrans) -> None: + r""" + @brief Inserts the edges from the edge collection into this shape container with a transformation (given in micrometer units) + @param edges The edges to insert + @param trans The transformation to apply (displacement in micrometer units) + + This method inserts all edges from the edge collection into this shape container. + Before an edge is inserted, the given transformation is applied. + + This method has been introduced in version 0.25. + """ + @overload + def insert(self, edges: Edges, trans: ICplxTrans) -> None: + r""" + @brief Inserts the edges from the edge collection into this shape container with a transformation + @param edges The edges to insert + @param trans The transformation to apply + + This method inserts all edges from the edge collection into this shape container. + Before an edge is inserted, the given transformation is applied. + + This method has been introduced in version 0.23. + """ + @overload + def insert(self, iter: RecursiveShapeIterator, trans: ICplxTrans) -> None: + r""" + @brief Inserts the shapes taken from a recursive shape iterator with a transformation + @param iter The iterator from which to take the shapes from + @param trans The transformation to apply + + This method iterates over all shapes from the iterator and inserts them into the container. + The given transformation is applied before the shapes are inserted. + + This method has been introduced in version 0.25.3. + """ + @overload + def insert(self, path: DPath, property_id: int) -> Shape: + r""" + @brief Inserts a micrometer-unit path with properties into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Path argument and a property ID, except that it will internally translate the path from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def insert(self, path: Path, property_id: int) -> Shape: + r""" + @brief Inserts a path with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload + def insert(self, polygon: DPolygon, property_id: int) -> Shape: + r""" + @brief Inserts a micrometer-unit polygon with properties into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Polygon argument and a property ID, except that it will internally translate the polygon from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def insert(self, polygon: Polygon, property_id: int) -> Shape: + r""" + @brief Inserts a polygon with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload + def insert(self, region: Region, trans: DCplxTrans) -> None: + r""" + @brief Inserts the polygons from the region into this shape container with a transformation (given in micrometer units) + @param region The region to insert + @param trans The transformation to apply (displacement in micrometer units) + + This method inserts all polygons from the region into this shape container. + Before a polygon is inserted, the given transformation is applied. + + This method has been introduced in version 0.25. + """ + @overload + def insert(self, region: Region, trans: ICplxTrans) -> None: + r""" + @brief Inserts the polygons from the region into this shape container with a transformation + @param region The region to insert + @param trans The transformation to apply + + This method inserts all polygons from the region into this shape container. + Before a polygon is inserted, the given transformation is applied. + + This method has been introduced in version 0.23. + """ + @overload + def insert(self, shape: Shape, trans: DCplxTrans) -> Shape: + r""" + @brief Inserts a shape from a shape reference into the shapes list with a complex integer transformation (given in micrometer units) + @param shape The shape to insert + @param trans The transformation to apply before the shape is inserted (displacement in micrometer units) + @return A reference (a \Shape object) to the newly created shape + This method has been introduced in version 0.25. + """ + @overload + def insert(self, shape: Shape, trans: DTrans) -> Shape: + r""" + @brief Inserts a shape from a shape reference into the shapes list with a transformation (given in micrometer units) + @param shape The shape to insert + @param trans The transformation to apply before the shape is inserted (displacement in micrometers) + @return A reference (a \Shape object) to the newly created shape + This method has been introduced in version 0.25. + """ + @overload + def insert(self, shape: Shape, trans: ICplxTrans) -> Shape: + r""" + @brief Inserts a shape from a shape reference into the shapes list with a complex integer transformation + @param shape The shape to insert + @param trans The transformation to apply before the shape is inserted + @return A reference (a \Shape object) to the newly created shape + This method has been introduced in version 0.22. + """ + @overload + def insert(self, shape: Shape, trans: Trans) -> Shape: + r""" + @brief Inserts a shape from a shape reference into the shapes list with a transformation + @param shape The shape to insert + @param trans The transformation to apply before the shape is inserted + @return A reference (a \Shape object) to the newly created shape + This method has been introduced in version 0.22. + """ + @overload + def insert(self, shapes: Shapes, flags: int) -> None: + r""" + @brief Inserts the shapes taken from another shape container + @param shapes The other container from which to take the shapes from + @param flags The filter flags for taking the shapes from the input container (see S... constants) + + This method takes all selected shapes from the given container and inserts them into this one. + + This method has been introduced in version 0.25.3. + """ + @overload + def insert(self, shapes: Shapes, trans: ICplxTrans) -> None: + r""" + @brief Inserts the shapes taken from another shape container with a transformation + @param shapes The other container from which to take the shapes from + @param trans The transformation to apply + + This method takes all shapes from the given container and inserts them into this one after applying the given transformation. + + This method has been introduced in version 0.25.3. + """ + @overload + def insert(self, simple_polygon: DSimplePolygon, property_id: int) -> Shape: + r""" + @brief Inserts a micrometer-unit simple polygon with properties into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \SimplePolygon argument and a property ID, except that it will internally translate the simple polygon from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def insert(self, simple_polygon: SimplePolygon, property_id: int) -> Shape: + r""" + @brief Inserts a simple polygon with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload + def insert(self, text: DText, property_id: int) -> Shape: + r""" + @brief Inserts a micrometer-unit text with properties into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Text argument and a property ID, except that it will internally translate the text from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def insert(self, text: Text, property_id: int) -> Shape: + r""" + @brief Inserts a text with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload + def insert(self, texts: Texts, trans: DCplxTrans) -> None: + r""" + @brief Inserts the texts from the text collection into this shape container with a transformation (given in micrometer units) + @param edges The text to insert + @param trans The transformation to apply (displacement in micrometer units) + + This method inserts all texts from the text collection into this shape container. + Before an text is inserted, the given transformation is applied. + + This method has been introduced in version 0.27. + """ + @overload + def insert(self, texts: Texts, trans: ICplxTrans) -> None: + r""" + @brief Inserts the texts from the text collection into this shape container with a transformation + @param edges The texts to insert + @param trans The transformation to apply + + This method inserts all texts from the text collection into this shape container. + Before an text is inserted, the given transformation is applied. + + This method has been introduced in version 0.27. + """ + @overload + def insert(self, shapes: Shapes, flags: int, trans: ICplxTrans) -> None: + r""" + @brief Inserts the shapes taken from another shape container with a transformation + @param shapes The other container from which to take the shapes from + @param flags The filter flags for taking the shapes from the input container (see S... constants) + @param trans The transformation to apply + + This method takes all selected shapes from the given container and inserts them into this one after applying the given transformation. + + This method has been introduced in version 0.25.3. + """ + @overload + def insert_as_edges(self, edge_pairs: EdgePairs) -> None: + r""" + @brief Inserts the edge pairs from the edge pair collection as individual edges into this shape container + @param edge_pairs The edge pairs to insert + + This method inserts all edge pairs from the edge pair collection into this shape container. + Each edge from the edge pair is inserted individually into the shape container. + + This method has been introduced in version 0.23. + """ + @overload + def insert_as_edges(self, edge_pairs: EdgePairs, trans: DCplxTrans) -> None: + r""" + @brief Inserts the edge pairs from the edge pair collection as individual into this shape container with a transformation (given in micrometer units) + @param edges The edge pairs to insert + @param trans The transformation to apply (displacement in micrometer units) + + This method inserts all edge pairs from the edge pair collection into this shape container. + Each edge from the edge pair is inserted individually into the shape container. + Before each edge is inserted into the shape collection, the given transformation is applied. + + This method has been introduced in version 0.25. + """ + @overload + def insert_as_edges(self, edge_pairs: EdgePairs, trans: ICplxTrans) -> None: + r""" + @brief Inserts the edge pairs from the edge pair collection as individual into this shape container with a transformation + @param edges The edge pairs to insert + @param trans The transformation to apply + + This method inserts all edge pairs from the edge pair collection into this shape container. + Each edge from the edge pair is inserted individually into the shape container. + Before each edge is inserted into the shape collection, the given transformation is applied. + + This method has been introduced in version 0.23. + """ + @overload + def insert_as_polygons(self, edge_pairs: EdgePairs, e: int) -> None: + r""" + @brief Inserts the edge pairs from the edge pair collection as polygons into this shape container + @param edge_pairs The edge pairs to insert + @param e The extension to apply when converting the edges to polygons (in database units) + + This method inserts all edge pairs from the edge pair collection into this shape container. + The edge pairs are converted to polygons covering the area between the edges. + The extension parameter specifies a sizing which is applied when converting the edge pairs to polygons. This way, degenerated edge pairs (i.e. two point-like edges) do not vanish. + + This method has been introduced in version 0.23. + """ + @overload + def insert_as_polygons(self, edge_pairs: EdgePairs, e: float) -> None: + r""" + @brief Inserts the edge pairs from the edge pair collection as polygons into this shape container + @param edge_pairs The edge pairs to insert + @param e The extension to apply when converting the edges to polygons (in micrometer units) + + This method is identical to the version with a integer-type \e parameter, but for this version the \e parameter is given in micrometer units. + + This method has been introduced in version 0.25. + """ + @overload + def insert_as_polygons(self, edge_pairs: EdgePairs, e: DCplxTrans, trans: float) -> None: + r""" + @brief Inserts the edge pairs from the edge pair collection as polygons into this shape container with a transformation + @param edges The edge pairs to insert + @param e The extension to apply when converting the edges to polygons (in micrometer units) + @param trans The transformation to apply (displacement in micrometer units) + + This method is identical to the version with a integer-type \e and \trans parameter, but for this version the \e parameter is given in micrometer units and the \trans parameter is a micrometer-unit transformation. + + This method has been introduced in version 0.25. + """ + @overload + def insert_as_polygons(self, edge_pairs: EdgePairs, e: ICplxTrans, trans: int) -> None: + r""" + @brief Inserts the edge pairs from the edge pair collection as polygons into this shape container with a transformation + @param edges The edge pairs to insert + @param e The extension to apply when converting the edges to polygons (in database units) + @param trans The transformation to apply + + This method inserts all edge pairs from the edge pair collection into this shape container. + The edge pairs are converted to polygons covering the area between the edges. + The extension parameter specifies a sizing which is applied when converting the edge pairs to polygons. This way, degenerated edge pairs (i.e. two point-like edges) do not vanish. + Before a polygon is inserted into the shape collection, the given transformation is applied. + + This method has been introduced in version 0.23. + """ + def insert_box(self, box: Box) -> Shape: + r""" + @brief Inserts a box into the shapes list + @return A reference to the new shape (a \Shape object) + + Starting with version 0.16, this method returns a reference to the newly created shape + """ + def insert_box_with_properties(self, box: Box, property_id: int) -> Shape: + r""" + @brief Inserts a box with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape + """ + def insert_edge(self, edge: Edge) -> Shape: + r""" + @brief Inserts an edge into the shapes list + + Starting with version 0.16, this method returns a reference to the newly created shape + """ + def insert_edge_with_properties(self, edge: Edge, property_id: int) -> Shape: + r""" + @brief Inserts an edge with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape. + """ + def insert_path(self, path: Path) -> Shape: + r""" + @brief Inserts a path into the shapes list + @return A reference to the new shape (a \Shape object) + + Starting with version 0.16, this method returns a reference to the newly created shape + """ + def insert_path_with_properties(self, path: Path, property_id: int) -> Shape: + r""" + @brief Inserts a path with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape + """ + def insert_polygon(self, polygon: Polygon) -> Shape: + r""" + @brief Inserts a polygon into the shapes list + @return A reference to the new shape (a \Shape object) + + Starting with version 0.16, this method returns a reference to the newly created shape + """ + def insert_polygon_with_properties(self, polygon: Polygon, property_id: int) -> Shape: + r""" + @brief Inserts a polygon with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape + """ + def insert_simple_polygon(self, simple_polygon: SimplePolygon) -> Shape: + r""" + @brief Inserts a simple polygon into the shapes list + @return A reference to the new shape (a \Shape object) + + Starting with version 0.16, this method returns a reference to the newly created shape + """ + def insert_simple_polygon_with_properties(self, simple_polygon: SimplePolygon, property_id: int) -> Shape: + r""" + @brief Inserts a simple polygon with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape + """ + def insert_text(self, text: Text) -> Shape: + r""" + @brief Inserts a text into the shapes list + @return A reference to the new shape (a \Shape object) + + Starting with version 0.16, this method returns a reference to the newly created shape + """ + def insert_text_with_properties(self, text: Text, property_id: int) -> Shape: + r""" + @brief Inserts a text with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_empty(self) -> bool: + r""" + @brief Returns a value indicating whether the shapes container is empty + This method has been introduced in version 0.20. + """ + def is_valid(self, shape: Shape) -> bool: + r""" + @brief Tests if the given \Shape object is still pointing to a valid object + This method has been introduced in version 0.16. + If the shape represented by the given reference has been deleted, this method returns false. If however, another shape has been inserted already that occupies the original shape's position, this method will return true again. + """ + def layout(self) -> Layout: + r""" + @brief Gets the layout object the shape container belongs to + This method returns nil if the shape container does not belong to a layout. + + This method has been added in version 0.28. + """ + @overload + def replace(self, shape: Shape, box: Box) -> Shape: + r""" + @brief Replaces the given shape with a box + @return A reference to the new shape (a \Shape object) + + This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the \replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. + This method is permitted in editable mode only. + """ + @overload + def replace(self, shape: Shape, box: DBox) -> Shape: + r""" + @brief Replaces the given shape with a box given in micrometer units + @return A reference to the new shape (a \Shape object) + + This method behaves like the \replace version with a \Box argument, except that it will internally translate the box from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def replace(self, shape: Shape, edge: DEdge) -> Shape: + r""" + @brief Replaces the given shape with an edge given in micrometer units + @return A reference to the new shape (a \Shape object) + + This method behaves like the \replace version with an \Edge argument, except that it will internally translate the edge from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def replace(self, shape: Shape, edge: Edge) -> Shape: + r""" + @brief Replaces the given shape with an edge object + + This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the \replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. + This method is permitted in editable mode only. + """ + @overload + def replace(self, shape: Shape, edge_pair: DEdgePair) -> Shape: + r""" + @brief Replaces the given shape with an edge pair given in micrometer units + @return A reference to the new shape (a \Shape object) + + This method behaves like the \replace version with an \EdgePair argument, except that it will internally translate the edge pair from micrometer to database units. + + This variant has been introduced in version 0.26. + """ + @overload + def replace(self, shape: Shape, edge_pair: EdgePair) -> Shape: + r""" + @brief Replaces the given shape with an edge pair object + + It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the \replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. + This method is permitted in editable mode only. + + This method has been introduced in version 0.26. + """ + @overload + def replace(self, shape: Shape, path: DPath) -> Shape: + r""" + @brief Replaces the given shape with a path given in micrometer units + @return A reference to the new shape (a \Shape object) + + This method behaves like the \replace version with a \Path argument, except that it will internally translate the path from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def replace(self, shape: Shape, path: Path) -> Shape: + r""" + @brief Replaces the given shape with a path + @return A reference to the new shape (a \Shape object) + + This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the \replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. + This method is permitted in editable mode only. + """ + @overload + def replace(self, shape: Shape, polygon: DPolygon) -> Shape: + r""" + @brief Replaces the given shape with a polygon given in micrometer units + @return A reference to the new shape (a \Shape object) + + This method behaves like the \replace version with a \Polygon argument, except that it will internally translate the polygon from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def replace(self, shape: Shape, polygon: Polygon) -> Shape: + r""" + @brief Replaces the given shape with a polygon + @return A reference to the new shape (a \Shape object) + + This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the \replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. + This method is permitted in editable mode only. + """ + @overload + def replace(self, shape: Shape, simple_polygon: DSimplePolygon) -> Shape: + r""" + @brief Replaces the given shape with a simple polygon given in micrometer units + @return A reference to the new shape (a \Shape object) + + This method behaves like the \replace version with a \SimplePolygon argument, except that it will internally translate the simple polygon from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def replace(self, shape: Shape, simple_polygon: SimplePolygon) -> Shape: + r""" + @brief Replaces the given shape with a simple polygon + @return A reference to the new shape (a \Shape object) + + This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the \replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. + This method is permitted in editable mode only. + """ + @overload + def replace(self, shape: Shape, text: DText) -> Shape: + r""" + @brief Replaces the given shape with a text given in micrometer units + @return A reference to the new shape (a \Shape object) + + This method behaves like the \replace version with a \Text argument, except that it will internally translate the text from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload + def replace(self, shape: Shape, text: Text) -> Shape: + r""" + @brief Replaces the given shape with a text object + @return A reference to the new shape (a \Shape object) + + This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the \replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. + This method is permitted in editable mode only. + """ + def replace_prop_id(self, shape: Shape, property_id: int) -> Shape: + r""" + @brief Replaces (or install) the properties of a shape + @return A \Shape object representing the new shape + This method has been introduced in version 0.16. It can only be used in editable mode. + Changes the properties Id of the given shape or install a properties Id on that shape if it does not have one yet. + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + This method will potentially invalidate the shape reference passed to it. Use the reference returned for future references. + """ + def size(self) -> int: + r""" + @brief Gets the number of shapes in this container + This method was introduced in version 0.16 + @return The number of shapes in this container + """ + @overload + def transform(self, trans: DCplxTrans) -> None: + r""" + @brief Transforms all shapes with the given transformation (given in micrometer units) + This method will invalidate all references to shapes inside this collection. + The displacement of the transformation is given in micrometer units. + + It has been introduced in version 0.25. + """ + @overload + def transform(self, trans: DTrans) -> None: + r""" + @brief Transforms all shapes with the given transformation (given in micrometer units) + This method will invalidate all references to shapes inside this collection. + The displacement of the transformation is given in micrometer units. + + It has been introduced in version 0.25. + """ + @overload + def transform(self, trans: ICplxTrans) -> None: + r""" + @brief Transforms all shapes with the given complex integer transformation + This method will invalidate all references to shapes inside this collection. + + It has been introduced in version 0.23. + """ + @overload + def transform(self, trans: Trans) -> None: + r""" + @brief Transforms all shapes with the given transformation + This method will invalidate all references to shapes inside this collection. + + It has been introduced in version 0.23. + """ + @overload + def transform(self, shape: Shape, trans: DCplxTrans) -> Shape: + r""" + @brief Transforms the shape given by the reference with the given complex transformation, where the transformation is given in micrometer units + @param trans The transformation to apply (displacement in micrometer units) + @return A reference (a \Shape object) to the new shape + The original shape may be deleted and re-inserted by this method. Therefore, a new reference is returned. + It is permitted in editable mode only. + This method has been introduced in version 0.25. + """ + @overload + def transform(self, shape: Shape, trans: DTrans) -> Shape: + r""" + @brief Transforms the shape given by the reference with the given transformation, where the transformation is given in micrometer units + @param trans The transformation to apply (displacement in micrometer units) + @return A reference (a \Shape object) to the new shape + The original shape may be deleted and re-inserted by this method. Therefore, a new reference is returned. + It is permitted in editable mode only. + This method has been introduced in version 0.25. + """ + @overload + def transform(self, shape: Shape, trans: ICplxTrans) -> Shape: + r""" + @brief Transforms the shape given by the reference with the given complex integer space transformation + @return A reference (a \Shape object) to the new shape + This method has been introduced in version 0.22. + The original shape may be deleted and re-inserted by this method. Therefore, a new reference is returned. + It is permitted in editable mode only. + """ + @overload + def transform(self, shape: Shape, trans: Trans) -> Shape: + r""" + @brief Transforms the shape given by the reference with the given transformation + @return A reference (a \Shape object) to the new shape + The original shape may be deleted and re-inserted by this method. Therefore, a new reference is returned. + It is permitted in editable mode only. + + This method has been introduced in version 0.16. + """ + +class TechnologyComponent: + r""" + @brief A part of a technology definition + Technology components extend technology definitions (class \Technology) by specialized subfeature definitions. For example, the net tracer supplies it's technology-dependent specification through a technology component called \NetTracerTechnology. + + Components are managed within technologies and can be accessed from a technology using \Technology#component. + + This class has been introduced in version 0.25. + """ + @classmethod + def new(cls) -> TechnologyComponent: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def description(self) -> str: + r""" + @brief Gets the human-readable description string of the technology component + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def name(self) -> str: + r""" + @brief Gets the formal name of the technology component + This is the name by which the component can be obtained from a technology using \Technology#component. + """ + +class Technology: + r""" + @brief Represents a technology + + This class represents one technology from a set of technologies. The set of technologies available in the system can be obtained with \technology_names. Individual technology definitions are returned with \technology_by_name. Use \create_technology to register new technologies and \remove_technology to delete technologies. + + The Technology class has been introduced in version 0.25. + """ + add_other_layers: bool + r""" + Getter: + @brief Gets the flag indicating whether to add other layers to the layer properties + + Setter: + @brief Sets the flag indicating whether to add other layers to the layer properties + """ + dbu: float + r""" + Getter: + @brief Gets the default database unit + + The default database unit is the one used when creating a layout for example. + Setter: + @brief Sets the default database unit + """ + default_base_path: str + r""" + Getter: + @brief Gets the default base path + + See \base_path for details about the default base path. + + Setter: + @hide + """ + description: str + r""" + Getter: + @brief Gets the description + + The technology description is shown to the user in technology selection dialogs and for display purposes. + Setter: + @brief Sets the description + """ + explicit_base_path: str + r""" + Getter: + @brief Gets the explicit base path + + See \base_path for details about the explicit base path. + + Setter: + @brief Sets the explicit base path + + See \base_path for details about the explicit base path. + """ + group: str + r""" + Getter: + @brief Gets the technology group + + The technology group is used to group certain technologies together in the technology selection menu. Technologies with the same group are put under a submenu with that group title. + + The 'group' attribute has been introduced in version 0.26.2. + + Setter: + @brief Sets the technology group + See \group for details about this attribute. + + The 'group' attribute has been introduced in version 0.26.2. + """ + layer_properties_file: str + r""" + Getter: + @brief Gets the path of the layer properties file + + If empty, no layer properties file is associated with the technology. If non-empty, this path will be corrected by the base path (see \correct_path) and this layer properties file will be loaded for layouts with this technology. + Setter: + @brief Sets the path of the layer properties file + + See \layer_properties_file for details about this property. + """ + load_layout_options: LoadLayoutOptions + r""" + Getter: + @brief Gets the layout reader options + + This method returns the layout reader options that are used when reading layouts with this technology. + + Change the reader options by modifying the object and using the setter to change it: + + @code + opt = tech.load_layout_options + opt.dxf_dbu = 2.5 + tech.load_layout_options = opt + @/code + + Setter: + @brief Sets the layout reader options + + See \load_layout_options for a description of this property. + """ + name: str + r""" + Getter: + @brief Gets the name of the technology + Setter: + @brief Sets the name of the technology + """ + save_layout_options: SaveLayoutOptions + r""" + Getter: + @brief Gets the layout writer options + + This method returns the layout writer options that are used when writing layouts with this technology. + + Change the reader options by modifying the object and using the setter to change it: + + @code + opt = tech.save_layout_options + opt.dbu = 0.01 + tech.save_layout_options = opt + @/code + + Setter: + @brief Sets the layout writer options + + See \save_layout_options for a description of this property. + """ + @classmethod + def clear_technologies(cls) -> None: + r""" + @brief Clears all technologies + + This method has been introduced in version 0.26. + """ + @classmethod + def create_technology(cls, name: str) -> Technology: + r""" + @brief Creates a new (empty) technology with the given name + + This method returns a reference to the new technology. + """ + @classmethod + def has_technology(cls, name: str) -> bool: + r""" + @brief Returns a value indicating whether there is a technology with this name + """ + @classmethod + def new(cls) -> Technology: + r""" + @brief Creates a new object of this class + """ + @classmethod + def remove_technology(cls, name: str) -> None: + r""" + @brief Removes the technology with the given name + """ + @classmethod + def technologies_from_xml(cls, xml: str) -> None: + r""" + @brief Loads the technologies from a XML representation + + See \technologies_to_xml for details. This method is the corresponding setter. + """ + @classmethod + def technologies_to_xml(cls) -> str: + r""" + @brief Returns a XML representation of all technologies registered in the system + + \technologies_from_xml can be used to restore the technology definitions. This method is provided mainly as a substitute for the pre-0.25 way of accessing technology data through the 'technology-data' configuration parameter. This method will return the equivalent string. + """ + @classmethod + def technology_by_name(cls, name: str) -> Technology: + r""" + @brief Gets the technology object for a given name + """ + @classmethod + def technology_from_xml(cls, xml: str) -> Technology: + r""" + @brief Loads the technology from a XML representation + + See \technology_to_xml for details. + """ + @classmethod + def technology_names(cls) -> List[str]: + r""" + @brief Gets a list of technology names defined in the system + """ + def __copy__(self) -> Technology: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: Technology) -> None: + r""" + @brief Assigns another object to self + """ + def base_path(self) -> str: + r""" + @brief Gets the base path of the technology + + The base path is the effective path where files are read from if their file path is a relative one. If the explicit path is set (see \explicit_base_path=), it is + used. If not, the default path is used. The default path is the one from which + a technology file was imported. The explicit one is the one that is specified + explicitly with \explicit_base_path=. + """ + def component(self, name: str) -> TechnologyComponent: + r""" + @brief Gets the technology component with the given name + The names are unique system identifiers. For all names, use \component_names. + """ + def component_names(self) -> List[str]: + r""" + @brief Gets the names of all components available for \component + """ + def correct_path(self, path: str) -> str: + r""" + @brief Makes a file path relative to the base path if one is specified + + This method turns an absolute path into one relative to the base path. Only files below the base path will be made relative. Files above or beside won't be made relative. + + See \base_path for details about the default base path. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> Technology: + r""" + @brief Creates a copy of self + """ + def eff_layer_properties_file(self) -> str: + r""" + @brief Gets the effective path of the layer properties file + """ + def eff_path(self, path: str) -> str: + r""" + @brief Makes a file path relative to the base path if one is specified + + This method will return the actual path for a file from the file's path. If the input path is a relative one, it will be made absolute by using the base path. + + See \base_path for details about the default base path. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def load(self, file: str) -> None: + r""" + @brief Loads the technology definition from a file + """ + def save(self, file: str) -> None: + r""" + @brief Saves the technology definition to a file + """ + def to_xml(self) -> str: + r""" + @brief Returns a XML representation of this technolog + + \technology_from_xml can be used to restore the technology definition. + """ + +class Text: + r""" + @brief A text object + + A text object has a point (location), a text, a text transformation, + a text size and a font id. Text size and font id are provided to be + be able to render the text correctly. + Text objects are used as labels (i.e. for pins) or to indicate a particular position. + + The \Text class uses integer coordinates. A class that operates with floating-point coordinates is \DText. + + See @The Database API@ for more details about the database objects. + """ + HAlignCenter: ClassVar[HAlign] + r""" + @brief Centered horizontal alignment + """ + HAlignLeft: ClassVar[HAlign] + r""" + @brief Left horizontal alignment + """ + HAlignRight: ClassVar[HAlign] + r""" + @brief Right horizontal alignment + """ + NoHAlign: ClassVar[HAlign] + r""" + @brief Undefined horizontal alignment + """ + NoVAlign: ClassVar[VAlign] + r""" + @brief Undefined vertical alignment + """ + VAlignBottom: ClassVar[VAlign] + r""" + @brief Bottom vertical alignment + """ + VAlignCenter: ClassVar[VAlign] + r""" + @brief Centered vertical alignment + """ + VAlignTop: ClassVar[VAlign] + r""" + @brief Top vertical alignment + """ + font: int + r""" + Getter: + @brief Gets the font number + See \font= for a description of this property. + Setter: + @brief Sets the font number + The font number does not play a role for KLayout. This property is provided for compatibility with other systems which allow using different fonts for the text objects. + """ + halign: HAlign + r""" + Getter: + @brief Gets the horizontal alignment + + See \halign= for a description of this property. + + Setter: + @brief Sets the horizontal alignment + + This property specifies how the text is aligned relative to the anchor point. + This property has been introduced in version 0.22 and extended to enums in 0.28. + """ + size: int + r""" + Getter: + @brief Gets the text height + + Setter: + @brief Sets the text height of this object + """ + string: str + r""" + Getter: + @brief Get the text string + + Setter: + @brief Assign a text string to this object + """ + trans: Trans + r""" + Getter: + @brief Gets the transformation + + Setter: + @brief Assign a transformation (text position and orientation) to this object + """ + valign: VAlign + r""" + Getter: + @brief Gets the vertical alignment + + See \valign= for a description of this property. + + Setter: + @brief Sets the vertical alignment + + This property specifies how the text is aligned relative to the anchor point. + This property has been introduced in version 0.22 and extended to enums in 0.28. + """ + x: int + r""" + Getter: + @brief Gets the x location of the text + + This method has been introduced in version 0.23. + + Setter: + @brief Sets the x location of the text + + This method has been introduced in version 0.23. + """ + y: int + r""" + Getter: + @brief Gets the y location of the text + + This method has been introduced in version 0.23. + + Setter: + @brief Sets the y location of the text + + This method has been introduced in version 0.23. + """ + @classmethod + def from_s(cls, s: str) -> Text: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> Text: + r""" + @brief Default constructor + + Creates a text with unit transformation and empty text. + """ + @overload + @classmethod + def new(cls, dtext: DText) -> Text: + r""" + @brief Creates an integer coordinate text from a floating-point coordinate text + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtext'. + """ + @overload + @classmethod + def new(cls, string: str, trans: Trans) -> Text: + r""" + @brief Constructor with string and transformation + + + A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. + """ + @overload + @classmethod + def new(cls, string: str, x: int, y: int) -> Text: + r""" + @brief Constructor with string and location + + + A string and a location is provided to this constructor. The location is specifies as a pair of x and y coordinates. + + This method has been introduced in version 0.23. + """ + @overload + @classmethod + def new(cls, string: str, trans: Trans, height: int, font: int) -> Text: + r""" + @brief Constructor with string, transformation, text height and font + + + A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified. + """ + def __copy__(self) -> Text: + r""" + @brief Creates a copy of self + """ + def __eq__(self, text: object) -> bool: + r""" + @brief Equality + + + Return true, if this text object and the given text are equal + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given text object. This method enables texts as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor + + Creates a text with unit transformation and empty text. + """ + @overload + def __init__(self, dtext: DText) -> None: + r""" + @brief Creates an integer coordinate text from a floating-point coordinate text + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtext'. + """ + @overload + def __init__(self, string: str, trans: Trans) -> None: + r""" + @brief Constructor with string and transformation + + + A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. + """ + @overload + def __init__(self, string: str, x: int, y: int) -> None: + r""" + @brief Constructor with string and location + + + A string and a location is provided to this constructor. The location is specifies as a pair of x and y coordinates. + + This method has been introduced in version 0.23. + """ + @overload + def __init__(self, string: str, trans: Trans, height: int, font: int) -> None: + r""" + @brief Constructor with string, transformation, text height and font + + + A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified. + """ + def __lt__(self, t: Text) -> bool: + r""" + @brief Less operator + @param t The object to compare against + This operator is provided to establish some, not necessarily a certain sorting order + """ + def __ne__(self, text: object) -> bool: + r""" + @brief Inequality + + + Return true, if this text object and the given text are not equal + """ + def __str__(self, dbu: Optional[float] = ...) -> str: + r""" + @brief Converts the object to a string. + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: Text) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> Box: + r""" + @brief Gets the bounding box of the text + The bounding box of the text is a single point - the location of the text. Both points of the box are identical. + + This method has been added in version 0.28. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> Text: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given text object. This method enables texts as hash keys. + + This method has been introduced in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + @overload + def move(self, distance: Vector) -> Text: + r""" + @brief Moves the text by a certain distance (modifies self) + + + Moves the text by a given offset and returns the moved + text. Does not check for coordinate overflows. + + @param p The offset to move the text. + + @return A reference to this text object + """ + @overload + def move(self, dx: int, dy: int) -> Text: + r""" + @brief Moves the text by a certain distance (modifies self) + + + Moves the text by a given distance in x and y direction and returns the moved + text. Does not check for coordinate overflows. + + @param dx The x distance to move the text. + @param dy The y distance to move the text. + + @return A reference to this text object + + This method was introduced in version 0.23. + """ + @overload + def moved(self, distance: Vector) -> Text: + r""" + @brief Returns the text moved by a certain distance (does not modify self) + + + Moves the text by a given offset and returns the moved + text. Does not modify *this. Does not check for coordinate + overflows. + + @param p The offset to move the text. + + @return The moved text. + """ + @overload + def moved(self, dx: int, dy: int) -> Text: + r""" + @brief Returns the text moved by a certain distance (does not modify self) + + + Moves the text by a given offset and returns the moved + text. Does not modify *this. Does not check for coordinate + overflows. + + @param dx The x distance to move the text. + @param dy The y distance to move the text. + + @return The moved text. + + This method was introduced in version 0.23. + """ + def position(self) -> Point: + r""" + @brief Gets the position of the text + + This convenience method has been added in version 0.28. + """ + def to_dtype(self, dbu: Optional[float] = ...) -> DText: + r""" + @brief Converts the text to a floating-point coordinate text + The database unit can be specified to translate the integer-coordinate text into a floating-point coordinate text in micron units. The database unit is basically a scaling factor. + + This method has been introduced in version 0.25. + """ + def to_s(self, dbu: Optional[float] = ...) -> str: + r""" + @brief Converts the object to a string. + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + @overload + def transformed(self, t: CplxTrans) -> DText: + r""" + @brief Transforms the text with the given complex transformation + + + @param t The magnifying transformation to apply + @return The transformed text (a DText now) + """ + @overload + def transformed(self, t: ICplxTrans) -> Text: + r""" + @brief Transform the text with the given complex transformation + + + @param t The magnifying transformation to apply + @return The transformed text (in this case an integer coordinate object now) + + This method has been introduced in version 0.18. + """ + @overload + def transformed(self, t: Trans) -> Text: + r""" + @brief Transforms the text with the given simple transformation + + + @param t The transformation to apply + @return The transformed text + """ + +class DText: + r""" + @brief A text object + + A text object has a point (location), a text, a text transformation, + a text size and a font id. Text size and font id are provided to be + be able to render the text correctly. + Text objects are used as labels (i.e. for pins) or to indicate a particular position. + + The \DText class uses floating-point coordinates. A class that operates with integer coordinates is \Text. + + See @The Database API@ for more details about the database objects. + """ + HAlignCenter: ClassVar[HAlign] + r""" + @brief Centered horizontal alignment + """ + HAlignLeft: ClassVar[HAlign] + r""" + @brief Left horizontal alignment + """ + HAlignRight: ClassVar[HAlign] + r""" + @brief Right horizontal alignment + """ + NoHAlign: ClassVar[HAlign] + r""" + @brief Undefined horizontal alignment + """ + NoVAlign: ClassVar[VAlign] + r""" + @brief Undefined vertical alignment + """ + VAlignBottom: ClassVar[VAlign] + r""" + @brief Bottom vertical alignment + """ + VAlignCenter: ClassVar[VAlign] + r""" + @brief Centered vertical alignment + """ + VAlignTop: ClassVar[VAlign] + r""" + @brief Top vertical alignment + """ + font: int + r""" + Getter: + @brief Gets the font number + See \font= for a description of this property. + Setter: + @brief Sets the font number + The font number does not play a role for KLayout. This property is provided for compatibility with other systems which allow using different fonts for the text objects. + """ + halign: HAlign + r""" + Getter: + @brief Gets the horizontal alignment + + See \halign= for a description of this property. + + Setter: + @brief Sets the horizontal alignment + + This property specifies how the text is aligned relative to the anchor point. + This property has been introduced in version 0.22 and extended to enums in 0.28. + """ + size: float + r""" + Getter: + @brief Gets the text height + + Setter: + @brief Sets the text height of this object + """ + string: str + r""" + Getter: + @brief Get the text string + + Setter: + @brief Assign a text string to this object + """ + trans: DTrans + r""" + Getter: + @brief Gets the transformation + + Setter: + @brief Assign a transformation (text position and orientation) to this object + """ + valign: VAlign + r""" + Getter: + @brief Gets the vertical alignment + + See \valign= for a description of this property. + + Setter: + @brief Sets the vertical alignment + + This property specifies how the text is aligned relative to the anchor point. + This property has been introduced in version 0.22 and extended to enums in 0.28. + """ + x: float + r""" + Getter: + @brief Gets the x location of the text + + This method has been introduced in version 0.23. + + Setter: + @brief Sets the x location of the text + + This method has been introduced in version 0.23. + """ + y: float + r""" + Getter: + @brief Gets the y location of the text + + This method has been introduced in version 0.23. + + Setter: + @brief Sets the y location of the text + + This method has been introduced in version 0.23. + """ + @classmethod + def from_s(cls, s: str) -> DText: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> DText: + r""" + @brief Default constructor + + Creates a text with unit transformation and empty text. + """ + @overload + @classmethod + def new(cls, Text: Text) -> DText: + r""" + @brief Creates a floating-point coordinate text from an integer coordinate text + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itext'. + """ + @overload + @classmethod + def new(cls, string: str, trans: DTrans) -> DText: + r""" + @brief Constructor with string and transformation + + + A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. + """ + @overload + @classmethod + def new(cls, string: str, x: float, y: float) -> DText: + r""" + @brief Constructor with string and location + + + A string and a location is provided to this constructor. The location is specifies as a pair of x and y coordinates. + + This method has been introduced in version 0.23. + """ + @overload + @classmethod + def new(cls, string: str, trans: DTrans, height: float, font: int) -> DText: + r""" + @brief Constructor with string, transformation, text height and font + + + A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified. + """ + def __copy__(self) -> DText: + r""" + @brief Creates a copy of self + """ + def __eq__(self, text: object) -> bool: + r""" + @brief Equality + + + Return true, if this text object and the given text are equal + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given text object. This method enables texts as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor + + Creates a text with unit transformation and empty text. + """ + @overload + def __init__(self, Text: Text) -> None: + r""" + @brief Creates a floating-point coordinate text from an integer coordinate text + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itext'. + """ + @overload + def __init__(self, string: str, trans: DTrans) -> None: + r""" + @brief Constructor with string and transformation + + + A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. + """ + @overload + def __init__(self, string: str, x: float, y: float) -> None: + r""" + @brief Constructor with string and location + + + A string and a location is provided to this constructor. The location is specifies as a pair of x and y coordinates. + + This method has been introduced in version 0.23. + """ + @overload + def __init__(self, string: str, trans: DTrans, height: float, font: int) -> None: + r""" + @brief Constructor with string, transformation, text height and font + + + A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified. + """ + def __lt__(self, t: DText) -> bool: + r""" + @brief Less operator + @param t The object to compare against + This operator is provided to establish some, not necessarily a certain sorting order + """ + def __ne__(self, text: object) -> bool: + r""" + @brief Inequality + + + Return true, if this text object and the given text are not equal + """ + def __str__(self, dbu: Optional[float] = ...) -> str: + r""" + @brief Converts the object to a string. + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DText) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> DBox: + r""" + @brief Gets the bounding box of the text + The bounding box of the text is a single point - the location of the text. Both points of the box are identical. + + This method has been added in version 0.28. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> DText: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given text object. This method enables texts as hash keys. + + This method has been introduced in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + @overload + def move(self, distance: DVector) -> DText: + r""" + @brief Moves the text by a certain distance (modifies self) + + + Moves the text by a given offset and returns the moved + text. Does not check for coordinate overflows. + + @param p The offset to move the text. + + @return A reference to this text object + """ + @overload + def move(self, dx: float, dy: float) -> DText: + r""" + @brief Moves the text by a certain distance (modifies self) + + + Moves the text by a given distance in x and y direction and returns the moved + text. Does not check for coordinate overflows. + + @param dx The x distance to move the text. + @param dy The y distance to move the text. + + @return A reference to this text object + + This method was introduced in version 0.23. + """ + @overload + def moved(self, distance: DVector) -> DText: + r""" + @brief Returns the text moved by a certain distance (does not modify self) + + + Moves the text by a given offset and returns the moved + text. Does not modify *this. Does not check for coordinate + overflows. + + @param p The offset to move the text. + + @return The moved text. + """ + @overload + def moved(self, dx: float, dy: float) -> DText: + r""" + @brief Returns the text moved by a certain distance (does not modify self) + + + Moves the text by a given offset and returns the moved + text. Does not modify *this. Does not check for coordinate + overflows. + + @param dx The x distance to move the text. + @param dy The y distance to move the text. + + @return The moved text. + + This method was introduced in version 0.23. + """ + def position(self) -> DPoint: + r""" + @brief Gets the position of the text + + This convenience method has been added in version 0.28. + """ + def to_itype(self, dbu: Optional[float] = ...) -> Text: + r""" + @brief Converts the text to an integer coordinate text + + The database unit can be specified to translate the floating-point coordinate Text in micron units to an integer-coordinate text in database units. The text's coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self, dbu: Optional[float] = ...) -> str: + r""" + @brief Converts the object to a string. + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + @overload + def transformed(self, t: DCplxTrans) -> DText: + r""" + @brief Transforms the text with the given complex transformation + + + @param t The magnifying transformation to apply + @return The transformed text (a DText now) + """ + @overload + def transformed(self, t: DTrans) -> DText: + r""" + @brief Transforms the text with the given simple transformation + + + @param t The transformation to apply + @return The transformed text + """ + @overload + def transformed(self, t: VCplxTrans) -> Text: + r""" + @brief Transforms the text with the given complex transformation + + + @param t The magnifying transformation to apply + @return The transformed text (in this case an integer coordinate text) + + This method has been introduced in version 0.25. + """ + +class HAlign: + r""" + @brief This class represents the horizontal alignment modes. + This enum has been introduced in version 0.28. + """ + HAlignCenter: ClassVar[HAlign] + r""" + @brief Centered horizontal alignment + """ + HAlignLeft: ClassVar[HAlign] + r""" + @brief Left horizontal alignment + """ + HAlignRight: ClassVar[HAlign] + r""" + @brief Right horizontal alignment + """ + NoHAlign: ClassVar[HAlign] + r""" + @brief Undefined horizontal alignment + """ + @overload + @classmethod + def new(cls, i: int) -> HAlign: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> HAlign: + r""" + @brief Creates an enum from a string value + """ + def __copy__(self) -> HAlign: + r""" + @brief Creates a copy of self + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __lt__(self, other: HAlign) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: HAlign) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> HAlign: + r""" + @brief Creates a copy of self + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + +class VAlign: + r""" + @brief This class represents the vertical alignment modes. + This enum has been introduced in version 0.28. + """ + NoVAlign: ClassVar[VAlign] + r""" + @brief Undefined vertical alignment + """ + VAlignBottom: ClassVar[VAlign] + r""" + @brief Bottom vertical alignment + """ + VAlignCenter: ClassVar[VAlign] + r""" + @brief Centered vertical alignment + """ + VAlignTop: ClassVar[VAlign] + r""" + @brief Top vertical alignment + """ + @overload + @classmethod + def new(cls, i: int) -> VAlign: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> VAlign: + r""" + @brief Creates an enum from a string value + """ + def __copy__(self) -> VAlign: + r""" + @brief Creates a copy of self + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __lt__(self, other: VAlign) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: VAlign) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> VAlign: + r""" + @brief Creates a copy of self + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + +class TileOutputReceiverBase: + r""" + @hide + @alias TileOutputReceiver + """ + @classmethod + def new(cls) -> TileOutputReceiverBase: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> TileOutputReceiverBase: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: TileOutputReceiverBase) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> TileOutputReceiverBase: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def processor(self) -> TilingProcessor: + r""" + @brief Gets the processor the receiver is attached to + + This attribute is set before begin and can be nil if the receiver is not attached to a processor. + + This method has been introduced in version 0.25. + """ + +class TileOutputReceiver(TileOutputReceiverBase): + r""" + @brief A receiver abstraction for the tiling processor. + + The tiling processor (\TilingProcessor) is a framework for executing sequences of operations on tiles of a layout or multiple layouts. The \TileOutputReceiver class is used to specify an output channel for the tiling processor. See \TilingProcessor#output for more details. + + This class has been introduced in version 0.23. + """ + def _assign(self, other: TileOutputReceiverBase) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _dup(self) -> TileOutputReceiver: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class TilingProcessor: + r""" + @brief A processor for layout which distributes tasks over tiles + + The tiling processor executes one or several scripts on one or multiple layouts providing a tiling scheme. In that scheme, the processor divides the original layout into rectangular tiles and executes the scripts on each tile separately. The tiling processor allows one to specify multiple, independent scripts which are run separately on each tile. It can make use of multi-core CPU's by supporting multiple threads running the tasks in parallel (with respect to tiles and scripts). + + Tiling a optional - if no tiles are specified, the tiling processing basically operates flat and parallelization extends to the scripts only. + + Tiles can be overlapping to gather input from neighboring tiles into the current tile. In order to provide that feature, a border can be specified which gives the amount by which the search region is extended beyond the border of the tile. To specify the border, use the \TilingProcessor#tile_border method. + + The basis of the tiling processor are \Region objects and expressions. Expressions are a built-in simple language to form simple scripts. Expressions allow access to the objects and methods built into KLayout. Each script can consist of multiple operations. Scripts are specified using \TilingProcessor#queue. + + Input is provided to the script through variables holding a \Region object each. From outside the tiling processor, input is specified with the \TilingProcessor#input method. This method is given a name and a \RecursiveShapeIterator object which delivers the data for the input. On the script side, a \Region object is provided through a variable named like the first argument of the "input" method. + + Inside the script the following functions are provided: + + @ul + @li"_dbu" delivers the database unit used for the computations @/li + @li"_tile" delivers a region containing a mask for the tile (a rectangle) or nil if no tiling is used @/li + @li"_output" is used to deliver output (see below) @/li + @/ul + + Output can be obtained from the tiling processor by registering a receiver with a channel. A channel is basically a name. Inside the script, the name describes a variable which can be used as the first argument of the "_output" function to identify the channel. A channel is registers using the \TilingProcessor#output method. Beside the name, a receiver must be specified. A receiver is either another layout (a cell of that), a report database or a custom receiver implemented through the \TileOutputReceiver class. + + The "_output" function expects two or three parameters: one channel id (the variable that was defined by the name given in the output method call) and an object to output (a \Region, \Edges, \EdgePairs or a geometrical primitive such as \Polygon or \Box). In addition, a boolean argument can be given indicating whether clipping at the tile shall be applied. If clipping is requested (the default), the shapes will be clipped at the tile's box. + + The tiling can be specified either through a tile size, a tile number or both. If a tile size is specified with the \TilingProcessor#tile_size method, the tiling processor will compute the number of tiles required. If the tile count is given (through \TilingProcessor#tiles), the tile size will be computed. If both are given, the tiling array is fixed and the array is centered around the original layout's center. If the tiling origin is given as well, the tiling processor will use the given array without any modifications. + + Once the tiling processor has been set up, the operation can be launched using \TilingProcessor#execute. + + This is some sample code. It performs two XOR operations between two layouts and delivers the results to a report database: + + @code + ly1 = ... # first layout + ly2 = ... # second layout + + rdb = RBA::ReportDatabase::new("xor") + output_cell = rdb.create_cell(ly1.top_cell.name) + output_cat1 = rbd.create_category("XOR 1-10") + output_cat2 = rbd.create_category("XOR 2-11") + + tp = RBA::TilingProcessor::new + tp.input("a1", ly1, ly1.top_cell.cell_index, RBA::LayerInfo::new(1, 0)) + tp.input("a2", ly1, ly1.top_cell.cell_index, RBA::LayerInfo::new(2, 0)) + tp.input("b1", ly2, ly2.top_cell.cell_index, RBA::LayerInfo::new(11, 0)) + tp.input("b2", ly2, ly2.top_cell.cell_index, RBA::LayerInfo::new(12, 0)) + tp.output("o1", rdb, output_cell, output_cat1) + tp.output("o2", rdb, output_cell, output_cat2) + tp.queue("_output(o1, a1 ^ b1)") + tp.queue("_output(o2, a2 ^ b2)") + tp.tile_size(50.0, 50.0) + tp.execute("Job description") + @/code + + This class has been introduced in version 0.23. + """ + dbu: float + r""" + Getter: + @brief Gets the database unit under which the computations will be done + + Setter: + @brief Sets the database unit under which the computations will be done + + All data used within the scripts will be brought to that database unit. If none is given it will be the database unit of the first layout given or 1nm if no layout is specified. + """ + @property + def frame(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the layout frame + + The layout frame is the box (in micron units) taken into account for computing + the tiles if the tile counts are not given. If the layout frame is not set or + set to an empty box, the processor will try to derive the frame from the given + inputs. + + This method has been introduced in version 0.25. + """ + scale_to_dbu: bool + r""" + Getter: + @brief Gets a valid indicating whether automatic scaling to database unit is enabled + + This method has been introduced in version 0.23.2. + Setter: + @brief Enables or disabled automatic scaling to database unit + + If automatic scaling to database unit is enabled, the input is automatically scaled to the database unit set inside the tile processor. This is the default. + + This method has been introduced in version 0.23.2. + """ + threads: int + r""" + Getter: + @brief Gets the number of threads to use + + Setter: + @brief Specifies the number of threads to use + """ + @classmethod + def new(cls) -> TilingProcessor: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> TilingProcessor: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: TilingProcessor) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> TilingProcessor: + r""" + @brief Creates a copy of self + """ + def execute(self, desc: str) -> None: + r""" + @brief Runs the job + + This method will initiate execution of the queued scripts, once for every tile. The desc is a text shown in the progress bar for example. + """ + @overload + def input(self, name: str, edge_pairs: EdgePairs) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from an \EdgePairs object. Edge pair collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. + + The name specifies the variable under which the input can be used in the scripts. + This variant has been introduced in version 0.27. + """ + @overload + def input(self, name: str, edges: Edges) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from an \Edges object. Edge collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. + + The name specifies the variable under which the input can be used in the scripts. + """ + @overload + def input(self, name: str, iter: RecursiveShapeIterator) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from a recursive shape iterator, hence from a hierarchy of shapes from a layout. + + The name specifies the variable under which the input can be used in the scripts. + """ + @overload + def input(self, name: str, region: Region) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from a \Region object. Regions don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. + + The name specifies the variable under which the input can be used in the scripts. + """ + @overload + def input(self, name: str, texts: Texts) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from an \Texts object. Text collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. + + The name specifies the variable under which the input can be used in the scripts. + This variant has been introduced in version 0.27. + """ + @overload + def input(self, name: str, edge_pairs: EdgePairs, trans: ICplxTrans) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from an \EdgePairs object. Edge pair collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. + + The name specifies the variable under which the input can be used in the scripts. + This variant has been introduced in version 0.27. + """ + @overload + def input(self, name: str, edges: Edges, trans: ICplxTrans) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from an \Edges object. Edge collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. + + The name specifies the variable under which the input can be used in the scripts. + This variant allows one to specify an additional transformation too. It has been introduced in version 0.23.2. + + """ + @overload + def input(self, name: str, iter: RecursiveShapeIterator, trans: ICplxTrans) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from a recursive shape iterator, hence from a hierarchy of shapes from a layout. + In addition, a transformation can be specified which will be applied to the shapes before they are used. + + The name specifies the variable under which the input can be used in the scripts. + """ + @overload + def input(self, name: str, region: Region, trans: ICplxTrans) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from a \Region object. Regions don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. + + The name specifies the variable under which the input can be used in the scripts. + This variant allows one to specify an additional transformation too. It has been introduced in version 0.23.2. + """ + @overload + def input(self, name: str, texts: Texts, trans: ICplxTrans) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from an \Texts object. Text collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. + + The name specifies the variable under which the input can be used in the scripts. + This variant has been introduced in version 0.27. + """ + @overload + def input(self, name: str, layout: Layout, cell_index: int, layer: int) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. + "layer" is the layer index of the input layer. + + The name specifies the variable under which the input can be used in the scripts. + """ + @overload + def input(self, name: str, layout: Layout, cell_index: int, lp: LayerInfo) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. + "lp" is a \LayerInfo object specifying the input layer. + + The name specifies the variable under which the input can be used in the scripts. + """ + @overload + def input(self, name: str, layout: Layout, cell_index: int, layer: int, trans: ICplxTrans) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. + "layer" is the layer index of the input layer. + In addition, a transformation can be specified which will be applied to the shapes before they are used. + + The name specifies the variable under which the input can be used in the scripts. + """ + @overload + def input(self, name: str, layout: Layout, cell_index: int, lp: LayerInfo, trans: ICplxTrans) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. + "lp" is a \LayerInfo object specifying the input layer. + In addition, a transformation can be specified which will be applied to the shapes before they are used. + + The name specifies the variable under which the input can be used in the scripts. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + @overload + def output(self, name: str, edge_pairs: EdgePairs) -> None: + r""" + @brief Specifies output to an \EdgePairs object + This method will establish an output channel to an \EdgePairs object. The output sent to that channel will be put into the specified edge pair collection. + Only \EdgePair objects are accepted. Other objects are discarded. + + The name is the name which must be used in the _output function of the scripts in order to address that channel. + + @param name The name of the channel + @param edge_pairs The \EdgePairs object to which the data is sent + """ + @overload + def output(self, name: str, edges: Edges) -> None: + r""" + @brief Specifies output to an \Edges object + This method will establish an output channel to an \Edges object. The output sent to that channel will be put into the specified edge collection. + 'Solid' objects such as polygons will be converted to edges by resolving their hulls into edges. Edge pairs are resolved into single edges. + + The name is the name which must be used in the _output function of the scripts in order to address that channel. + + @param name The name of the channel + @param edges The \Edges object to which the data is sent + """ + @overload + def output(self, name: str, rec: TileOutputReceiverBase) -> None: + r""" + @brief Specifies output for the tiling processor + This method will establish an output channel for the processor. For that it registers an output receiver which will receive data from the scripts. The scripts call the _output function to deliver data. + "name" will be name of the variable which must be passed to the first argument of the _output function in order to address this channel. + + Please note that the tiling processor will destroy the receiver object when it is freed itself. Hence if you need to address the receiver object later, make sure that the processor is still alive, i.e. by assigning the object to a variable. + + The following code uses the output receiver. It takes the shapes of a layer from a layout, computes the area of each tile and outputs the area to the custom receiver: + + @code + layout = ... # the layout + cell = ... # the top cell's index + layout = ... # the input layer + + class MyReceiver < RBA::TileOutputReceiver + def put(ix, iy, tile, obj, dbu, clip) + puts "got area for tile #{ix+1},#{iy+1}: #{obj.to_s}" + end + end + + tp = RBA::TilingProcessor::new + + # register the custom receiver + tp.output("my_receiver", MyReceiver::new) + tp.input("the_input", layout.begin_shapes(cell, layer)) + tp.tile_size(100, 100) # 100x100 um tile size + # The script clips the input at the tile and computes the (merged) area: + tp.queue("_output(my_receiver, (the_input & _tile).area)") + tp.execute("Job description") + @/code + """ + @overload + def output(self, name: str, region: Region) -> None: + r""" + @brief Specifies output to a \Region object + This method will establish an output channel to a \Region object. The output sent to that channel will be put into the specified region. + + The name is the name which must be used in the _output function of the scripts in order to address that channel. + Edges sent to this channel are discarded. Edge pairs are converted to polygons. + + @param name The name of the channel + @param region The \Region object to which the data is sent + """ + @overload + def output(self, name: str, sum: float) -> None: + r""" + @brief Specifies output to single value + This method will establish an output channel which sums up float data delivered by calling the _output function. + In order to specify the target for the data, a \Value object must be provided for the "sum" parameter. + + The name is the name which must be used in the _output function of the scripts in order to address that channel. + """ + @overload + def output(self, name: str, texts: Texts) -> None: + r""" + @brief Specifies output to an \Texts object + This method will establish an output channel to an \Texts object. The output sent to that channel will be put into the specified edge pair collection. + Only \Text objects are accepted. Other objects are discarded. + + The name is the name which must be used in the _output function of the scripts in order to address that channel. + + @param name The name of the channel + @param texts The \Texts object to which the data is sent + + This variant has been introduced in version 0.27. + """ + @overload + def output(self, name: str, layout: Layout, cell: int, layer_index: int) -> None: + r""" + @brief Specifies output to a layout layer + This method will establish an output channel to a layer in a layout. The output sent to that channel will be put into the specified layer and cell. In this version, the layer is specified through a layer index, hence it must be created before. + + The name is the name which must be used in the _output function of the scripts in order to address that channel. + + @param name The name of the channel + @param layout The layout to which the data is sent + @param cell The index of the cell to which the data is sent + @param layer_index The layer index where the output will be sent to + """ + @overload + def output(self, name: str, layout: Layout, cell: int, lp: LayerInfo) -> None: + r""" + @brief Specifies output to a layout layer + This method will establish an output channel to a layer in a layout. The output sent to that channel will be put into the specified layer and cell. In this version, the layer is specified through a \LayerInfo object, i.e. layer and datatype number. If no such layer exists, it will be created. + + The name is the name which must be used in the _output function of the scripts in order to address that channel. + + @param name The name of the channel + @param layout The layout to which the data is sent + @param cell The index of the cell to which the data is sent + @param lp The layer specification where the output will be sent to + """ + def queue(self, script: str) -> None: + r""" + @brief Queues a script for parallel execution + + With this method, scripts are registered that are executed in parallel on each tile. + The scripts have "Expressions" syntax and can make use of several predefined variables and functions. + See the \TilingProcessor class description for details. + """ + def tile_border(self, bx: float, by: float) -> None: + r""" + @brief Sets the tile border + + Specifies the tile border. The border is a margin that is considered when fetching shapes. By specifying a border you can fetch shapes into the tile's data which are outside the tile but still must be considered in the computations (i.e. because they might grow into the tile). + + The tile border is given in micron. + """ + def tile_origin(self, xo: float, yo: float) -> None: + r""" + @brief Sets the tile origin + + Specifies the origin (lower left corner) of the tile field. If no origin is specified, the tiles are centered to the layout's bounding box. Giving the origin together with the tile count and dimensions gives full control over the tile array. + + The tile origin is given in micron. + """ + def tile_size(self, w: float, h: float) -> None: + r""" + @brief Sets the tile size + + Specifies the size of the tiles to be used. If no tile size is specified, tiling won't be used and all computations will be done on the whole layout. + + The tile size is given in micron. + """ + def tiles(self, nw: int, nh: int) -> None: + r""" + @brief Sets the tile count + + Specifies the number of tiles to be used. If no tile number is specified, the number of tiles required is computed from the layout's dimensions and the tile size. If a number is given, but no tile size, the tile size will be computed from the layout's dimensions. + """ + def var(self, name: str, value: Any) -> None: + r""" + @brief Defines a variable for the tiling processor script + + The name specifies the variable under which the value can be used in the scripts. + """ + +class Trans: + r""" + @brief A simple transformation + + Simple transformations only provide rotations about angles which a multiples of 90 degree. + Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). + These can be combined with a displacement which is applied after the rotation/mirror. + This version acts on integer coordinates. A version for floating-point coordinates is \DTrans. + + Here are some examples for using the Trans class: + + @code + t = RBA::Trans::new(0, 100) # displacement by 100 DBU in y direction + # the inverse: -> "r0 0,-100" + t.inverted.to_s + # concatenation: -> "r90 -100,0" + (RBA::Trans::R90 * t).to_s + # apply to a point: -> "0,100" + RBA::Trans::R90.trans(RBA::Point::new(100, 0)) + @/code + + See @The Database API@ for more details about the database objects. + """ + M0: ClassVar[Trans] + r""" + @brief A constant giving "mirrored at the x-axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M135: ClassVar[Trans] + r""" + @brief A constant giving "mirrored at the 135 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M45: ClassVar[Trans] + r""" + @brief A constant giving "mirrored at the 45 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M90: ClassVar[Trans] + r""" + @brief A constant giving "mirrored at the y (90 degree) axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R0: ClassVar[Trans] + r""" + @brief A constant giving "unrotated" (unit) transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R180: ClassVar[Trans] + r""" + @brief A constant giving "rotated by 180 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R270: ClassVar[Trans] + r""" + @brief A constant giving "rotated by 270 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R90: ClassVar[Trans] + r""" + @brief A constant giving "rotated by 90 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + angle: int + r""" + Getter: + @brief Gets the angle in units of 90 degree + + This value delivers the rotation component. In addition, a mirroring at the x axis may be applied before if the \is_mirror? property is true. + Setter: + @brief Sets the angle in units of 90 degree + @param a The new angle + + This method was introduced in version 0.20. + """ + disp: Vector + r""" + Getter: + @brief Gets to the displacement vector + + Staring with version 0.25 the displacement type is a vector. + Setter: + @brief Sets the displacement + @param u The new displacement + + This method was introduced in version 0.20. + Staring with version 0.25 the displacement type is a vector. + """ + mirror: bool + r""" + Getter: + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + Setter: + @brief Sets the mirror flag + "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag + + This method was introduced in version 0.20. + """ + rot: int + r""" + Getter: + @brief Gets the angle/mirror code + + The angle/mirror code is one of the constants R0, R90, R180, R270, M0, M45, M90 and M135. rx is the rotation by an angle of x counter clockwise. mx is the mirroring at the axis given by the angle x (to the x-axis). + Setter: + @brief Sets the angle/mirror code + @param r The new angle/rotation code (see \rot property) + + This method was introduced in version 0.20. + """ + @classmethod + def from_dtrans(cls, dtrans: DTrans) -> Trans: + r""" + @brief Creates an integer coordinate transformation from a floating-point coordinate transformation + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @classmethod + def from_s(cls, s: str) -> Trans: + r""" + @brief Creates a transformation from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> Trans: + r""" + @brief Creates a unit transformation + """ + @overload + @classmethod + def new(cls, dtrans: DTrans) -> Trans: + r""" + @brief Creates an integer coordinate transformation from a floating-point coordinate transformation + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @overload + @classmethod + def new(cls, u: Vector) -> Trans: + r""" + @brief Creates a transformation using a displacement only + + @param u The displacement + """ + @overload + @classmethod + def new(cls, c: Trans, u: Optional[Vector] = ...) -> Trans: + r""" + @brief Creates a transformation from another transformation plus a displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + @classmethod + def new(cls, x: int, y: int) -> Trans: + r""" + @brief Creates a transformation using a displacement given as two coordinates + + @param x The horizontal displacement + @param y The vertical displacement + """ + @overload + @classmethod + def new(cls, c: Trans, x: int, y: int) -> Trans: + r""" + @brief Creates a transformation from another transformation plus a displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + @classmethod + def new(cls, rot: int, mirr: Optional[bool] = ..., u: Optional[Vector] = ...) -> Trans: + r""" + @brief Creates a transformation using angle and mirror flag + + The sequence of operations is: mirroring at x axis, + rotation, application of displacement. + + @param rot The rotation in units of 90 degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + @classmethod + def new(cls, rot: int, mirr: bool, x: int, y: int) -> Trans: + r""" + @brief Creates a transformation using angle and mirror flag and two coordinate values for displacement + + The sequence of operations is: mirroring at x axis, + rotation, application of displacement. + + @param rot The rotation in units of 90 degree + @param mirrx True, if mirrored at x axis + @param x The horizontal displacement + @param y The vertical displacement + """ + def __copy__(self) -> Trans: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Tests for equality + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a unit transformation + """ + @overload + def __init__(self, dtrans: DTrans) -> None: + r""" + @brief Creates an integer coordinate transformation from a floating-point coordinate transformation + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @overload + def __init__(self, u: Vector) -> None: + r""" + @brief Creates a transformation using a displacement only + + @param u The displacement + """ + @overload + def __init__(self, c: Trans, u: Optional[Vector] = ...) -> None: + r""" + @brief Creates a transformation from another transformation plus a displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + def __init__(self, x: int, y: int) -> None: + r""" + @brief Creates a transformation using a displacement given as two coordinates + + @param x The horizontal displacement + @param y The vertical displacement + """ + @overload + def __init__(self, c: Trans, x: int, y: int) -> None: + r""" + @brief Creates a transformation from another transformation plus a displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + def __init__(self, rot: int, mirr: Optional[bool] = ..., u: Optional[Vector] = ...) -> None: + r""" + @brief Creates a transformation using angle and mirror flag + + The sequence of operations is: mirroring at x axis, + rotation, application of displacement. + + @param rot The rotation in units of 90 degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + def __init__(self, rot: int, mirr: bool, x: int, y: int) -> None: + r""" + @brief Creates a transformation using angle and mirror flag and two coordinate values for displacement + + The sequence of operations is: mirroring at x axis, + rotation, application of displacement. + + @param rot The rotation in units of 90 degree + @param mirrx True, if mirrored at x axis + @param x The horizontal displacement + @param y The vertical displacement + """ + def __lt__(self, other: Trans) -> bool: + r""" + @brief Provides a 'less' criterion for sorting + This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. + """ + @overload + def __mul__(self, box: Box) -> Box: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, d: int) -> int: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __mul__(self, edge: Edge) -> Edge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: Point) -> Point: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, path: Path) -> Path: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: Polygon) -> Polygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, t: Trans) -> Trans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, text: Text) -> Text: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, v: Vector) -> Vector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Tests for inequality + """ + @overload + def __rmul__(self, box: Box) -> Box: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, d: int) -> int: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __rmul__(self, edge: Edge) -> Edge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: Point) -> Point: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, path: Path) -> Path: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: Polygon) -> Polygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, text: Text) -> Text: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, v: Vector) -> Vector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + def __str__(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: Trans) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def ctrans(self, d: int) -> int: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> Trans: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + def invert(self) -> Trans: + r""" + @brief Inverts the transformation (in place) + + Inverts the transformation and replaces this object by the + inverted one. + + @return The inverted transformation + """ + def inverted(self) -> Trans: + r""" + @brief Returns the inverted transformation + Returns the inverted transformation + + @return The inverted transformation + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_mirror(self) -> bool: + r""" + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + """ + def to_dtype(self, dbu: Optional[float] = ...) -> DTrans: + r""" + @brief Converts the transformation to a floating-point coordinate transformation + + The database unit can be specified to translate the integer-coordinate transformation into a floating-point coordinate transformation in micron units. The database unit is basically a scaling factor. + + This method has been introduced in version 0.25. + """ + def to_s(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + @overload + def trans(self, box: Box) -> Box: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, edge: Edge) -> Edge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, p: Point) -> Point: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def trans(self, path: Path) -> Path: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, polygon: Polygon) -> Polygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, text: Text) -> Text: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, v: Vector) -> Vector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + +class DTrans: + r""" + @brief A simple transformation + + Simple transformations only provide rotations about angles which a multiples of 90 degree. + Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). + These can be combined with a displacement which is applied after the rotation/mirror. + This version acts on floating-point coordinates. A version for integer coordinates is \Trans. + + Here are some examples for using the DTrans class: + + @code + t = RBA::DTrans::new(0, 100) # displacement by 100 DBU in y direction + # the inverse: -> "r0 0,-100" + t.inverted.to_s + # concatenation: -> "r90 -100,0" + (RBA::DTrans::new(RBA::DTrans::R90) * t).to_s + # apply to a point: -> "0,100" + RBA::DTrans::new(RBA::DTrans::R90).trans(RBA::DPoint::new(100, 0)) + @/code + + See @The Database API@ for more details about the database objects. + """ + M0: ClassVar[DTrans] + r""" + @brief A constant giving "mirrored at the x-axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M135: ClassVar[DTrans] + r""" + @brief A constant giving "mirrored at the 135 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M45: ClassVar[DTrans] + r""" + @brief A constant giving "mirrored at the 45 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M90: ClassVar[DTrans] + r""" + @brief A constant giving "mirrored at the y (90 degree) axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R0: ClassVar[DTrans] + r""" + @brief A constant giving "unrotated" (unit) transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R180: ClassVar[DTrans] + r""" + @brief A constant giving "rotated by 180 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R270: ClassVar[DTrans] + r""" + @brief A constant giving "rotated by 270 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R90: ClassVar[DTrans] + r""" + @brief A constant giving "rotated by 90 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + angle: int + r""" + Getter: + @brief Gets the angle in units of 90 degree + + This value delivers the rotation component. In addition, a mirroring at the x axis may be applied before if the \is_mirror? property is true. + Setter: + @brief Sets the angle in units of 90 degree + @param a The new angle + + This method was introduced in version 0.20. + """ + disp: DVector + r""" + Getter: + @brief Gets to the displacement vector + + Staring with version 0.25 the displacement type is a vector. + Setter: + @brief Sets the displacement + @param u The new displacement + + This method was introduced in version 0.20. + Staring with version 0.25 the displacement type is a vector. + """ + mirror: bool + r""" + Getter: + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + Setter: + @brief Sets the mirror flag + "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag + + This method was introduced in version 0.20. + """ + rot: int + r""" + Getter: + @brief Gets the angle/mirror code + + The angle/mirror code is one of the constants R0, R90, R180, R270, M0, M45, M90 and M135. rx is the rotation by an angle of x counter clockwise. mx is the mirroring at the axis given by the angle x (to the x-axis). + Setter: + @brief Sets the angle/mirror code + @param r The new angle/rotation code (see \rot property) + + This method was introduced in version 0.20. + """ + @classmethod + def from_itrans(cls, trans: Trans) -> DTrans: + r""" + @brief Creates a floating-point coordinate transformation from an integer coordinate transformation + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. + """ + @classmethod + def from_s(cls, s: str) -> DTrans: + r""" + @brief Creates a transformation from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> DTrans: + r""" + @brief Creates a unit transformation + """ + @overload + @classmethod + def new(cls, trans: Trans) -> DTrans: + r""" + @brief Creates a floating-point coordinate transformation from an integer coordinate transformation + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. + """ + @overload + @classmethod + def new(cls, u: DVector) -> DTrans: + r""" + @brief Creates a transformation using a displacement only + + @param u The displacement + """ + @overload + @classmethod + def new(cls, c: DTrans, u: Optional[DVector] = ...) -> DTrans: + r""" + @brief Creates a transformation from another transformation plus a displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + @classmethod + def new(cls, x: float, y: float) -> DTrans: + r""" + @brief Creates a transformation using a displacement given as two coordinates + + @param x The horizontal displacement + @param y The vertical displacement + """ + @overload + @classmethod + def new(cls, c: DTrans, x: float, y: float) -> DTrans: + r""" + @brief Creates a transformation from another transformation plus a displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + @classmethod + def new(cls, rot: int, mirr: Optional[bool] = ..., u: Optional[DVector] = ...) -> DTrans: + r""" + @brief Creates a transformation using angle and mirror flag + + The sequence of operations is: mirroring at x axis, + rotation, application of displacement. + + @param rot The rotation in units of 90 degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + @classmethod + def new(cls, rot: int, mirr: bool, x: float, y: float) -> DTrans: + r""" + @brief Creates a transformation using angle and mirror flag and two coordinate values for displacement + + The sequence of operations is: mirroring at x axis, + rotation, application of displacement. + + @param rot The rotation in units of 90 degree + @param mirrx True, if mirrored at x axis + @param x The horizontal displacement + @param y The vertical displacement + """ + def __copy__(self) -> DTrans: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Tests for equality + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a unit transformation + """ + @overload + def __init__(self, trans: Trans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from an integer coordinate transformation + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. + """ + @overload + def __init__(self, u: DVector) -> None: + r""" + @brief Creates a transformation using a displacement only + + @param u The displacement + """ + @overload + def __init__(self, c: DTrans, u: Optional[DVector] = ...) -> None: + r""" + @brief Creates a transformation from another transformation plus a displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + def __init__(self, x: float, y: float) -> None: + r""" + @brief Creates a transformation using a displacement given as two coordinates + + @param x The horizontal displacement + @param y The vertical displacement + """ + @overload + def __init__(self, c: DTrans, x: float, y: float) -> None: + r""" + @brief Creates a transformation from another transformation plus a displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + def __init__(self, rot: int, mirr: Optional[bool] = ..., u: Optional[DVector] = ...) -> None: + r""" + @brief Creates a transformation using angle and mirror flag + + The sequence of operations is: mirroring at x axis, + rotation, application of displacement. + + @param rot The rotation in units of 90 degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + def __init__(self, rot: int, mirr: bool, x: float, y: float) -> None: + r""" + @brief Creates a transformation using angle and mirror flag and two coordinate values for displacement + + The sequence of operations is: mirroring at x axis, + rotation, application of displacement. + + @param rot The rotation in units of 90 degree + @param mirrx True, if mirrored at x axis + @param x The horizontal displacement + @param y The vertical displacement + """ + def __lt__(self, other: DTrans) -> bool: + r""" + @brief Provides a 'less' criterion for sorting + This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. + """ + @overload + def __mul__(self, box: DBox) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, d: float) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __mul__(self, edge: DEdge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, path: DPath) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, t: DTrans) -> DTrans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, text: DText) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, v: DVector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Tests for inequality + """ + @overload + def __rmul__(self, box: DBox) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, d: float) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __rmul__(self, edge: DEdge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, path: DPath) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, text: DText) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, v: DVector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + def __str__(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DTrans) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def ctrans(self, d: float) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> DTrans: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + def invert(self) -> DTrans: + r""" + @brief Inverts the transformation (in place) + + Inverts the transformation and replaces this object by the + inverted one. + + @return The inverted transformation + """ + def inverted(self) -> DTrans: + r""" + @brief Returns the inverted transformation + Returns the inverted transformation + + @return The inverted transformation + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_mirror(self) -> bool: + r""" + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + """ + def to_itype(self, dbu: Optional[float] = ...) -> Trans: + r""" + @brief Converts the transformation to an integer coordinate transformation + + The database unit can be specified to translate the floating-point coordinate transformation in micron units to an integer-coordinate transformation in database units. The transformation's' coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + @overload + def trans(self, box: DBox) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, edge: DEdge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def trans(self, path: DPath) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, polygon: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, text: DText) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, v: DVector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + +class DCplxTrans: + r""" + @brief A complex transformation + + A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary + angle and a displacement. This is also the order, the operations are applied. + + A complex transformation provides a superset of the simple transformation. + In many applications, a complex transformation computes floating-point coordinates to minimize rounding effects. + This version can transform floating-point coordinate objects. + + Complex transformations are extensions of the simple transformation classes (\DTrans in that case) and behave similar. + + Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code: + + @code + # Create a transformation that applies a magnification of 1.5, a rotation by 90 degree + # and displacement of 10 in x and 20 units in y direction: + t = RBA::CplxTrans::new(1.5, 90, false, 10.0, 20.0) + t.to_s # r90 *1.5 10,20 + # compute the inverse: + t.inverted.to_s # r270 *0.666666667 -13,7 + # Combine with another displacement (applied after that): + (RBA::CplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 + # Transform a point: + t.trans(RBA::Point::new(100, 200)).to_s # -290,170 + @/code + + See @The Database API@ for more details about the database objects. + """ + M0: ClassVar[DCplxTrans] + r""" + @brief A constant giving "mirrored at the x-axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M135: ClassVar[DCplxTrans] + r""" + @brief A constant giving "mirrored at the 135 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M45: ClassVar[DCplxTrans] + r""" + @brief A constant giving "mirrored at the 45 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M90: ClassVar[DCplxTrans] + r""" + @brief A constant giving "mirrored at the y (90 degree) axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R0: ClassVar[DCplxTrans] + r""" + @brief A constant giving "unrotated" (unit) transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R180: ClassVar[DCplxTrans] + r""" + @brief A constant giving "rotated by 180 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R270: ClassVar[DCplxTrans] + r""" + @brief A constant giving "rotated by 270 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R90: ClassVar[DCplxTrans] + r""" + @brief A constant giving "rotated by 90 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + angle: float + r""" + Getter: + @brief Gets the angle + + Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree. + + @return The rotation angle this transformation provides in degree units (0..360 deg). + + Setter: + @brief Sets the angle + @param a The new angle + See \angle for a description of that attribute. + """ + disp: DVector + r""" + Getter: + @brief Gets the displacement + + Setter: + @brief Sets the displacement + @param u The new displacement + """ + mag: float + r""" + Getter: + @brief Gets the magnification + + Setter: + @brief Sets the magnification + @param m The new magnification + """ + mirror: bool + r""" + Getter: + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + Setter: + @brief Sets the mirror flag + "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag + """ + @classmethod + def from_itrans(cls, trans: CplxTrans) -> DCplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. + """ + @classmethod + def from_s(cls, s: str) -> DCplxTrans: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> DCplxTrans: + r""" + @brief Creates a unit transformation + """ + @overload + @classmethod + def new(cls, m: float) -> DCplxTrans: + r""" + @brief Creates a transformation from a magnification + + Creates a magnifying transformation without displacement and rotation given the magnification m. + """ + @overload + @classmethod + def new(cls, t: DTrans) -> DCplxTrans: + r""" + @brief Creates a transformation from a simple transformation alone + + Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + """ + @overload + @classmethod + def new(cls, trans: CplxTrans) -> DCplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. + """ + @overload + @classmethod + def new(cls, trans: ICplxTrans) -> DCplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, trans: VCplxTrans) -> DCplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, u: DVector) -> DCplxTrans: + r""" + @brief Creates a transformation from a displacement + + Creates a transformation with a displacement only. + + This method has been added in version 0.25. + """ + @overload + @classmethod + def new(cls, t: DTrans, m: float) -> DCplxTrans: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + @classmethod + def new(cls, x: float, y: float) -> DCplxTrans: + r""" + @brief Creates a transformation from a x and y displacement + + This constructor will create a transformation with the specified displacement + but no rotation. + + @param x The x displacement + @param y The y displacement + """ + @overload + @classmethod + def new(cls, c: DCplxTrans, m: Optional[float] = ..., u: Optional[DVector] = ...) -> DCplxTrans: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + @classmethod + def new(cls, c: DCplxTrans, m: float, x: float, y: float) -> DCplxTrans: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + @classmethod + def new(cls, mag: float, rot: float, mirrx: bool, u: DVector) -> DCplxTrans: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + @classmethod + def new(cls, mag: float, rot: float, mirrx: bool, x: float, y: float) -> DCplxTrans: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + def __copy__(self) -> DCplxTrans: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Tests for equality + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a unit transformation + """ + @overload + def __init__(self, m: float) -> None: + r""" + @brief Creates a transformation from a magnification + + Creates a magnifying transformation without displacement and rotation given the magnification m. + """ + @overload + def __init__(self, t: DTrans) -> None: + r""" + @brief Creates a transformation from a simple transformation alone + + Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + """ + @overload + def __init__(self, trans: CplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. + """ + @overload + def __init__(self, trans: ICplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + def __init__(self, trans: VCplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + def __init__(self, u: DVector) -> None: + r""" + @brief Creates a transformation from a displacement + + Creates a transformation with a displacement only. + + This method has been added in version 0.25. + """ + @overload + def __init__(self, t: DTrans, m: float) -> None: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + def __init__(self, x: float, y: float) -> None: + r""" + @brief Creates a transformation from a x and y displacement + + This constructor will create a transformation with the specified displacement + but no rotation. + + @param x The x displacement + @param y The y displacement + """ + @overload + def __init__(self, c: DCplxTrans, m: Optional[float] = ..., u: Optional[DVector] = ...) -> None: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + def __init__(self, c: DCplxTrans, m: float, x: float, y: float) -> None: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, u: DVector) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, x: float, y: float) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + def __lt__(self, other: DCplxTrans) -> bool: + r""" + @brief Provides a 'less' criterion for sorting + This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. + """ + @overload + def __mul__(self, box: DBox) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, d: float) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __mul__(self, edge: DEdge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, p: DVector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __mul__(self, path: DPath) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, t: CplxTrans) -> CplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, t: DCplxTrans) -> DCplxTrans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, text: DText) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Tests for inequality + """ + @overload + def __rmul__(self, box: DBox) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, d: float) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __rmul__(self, edge: DEdge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, p: DVector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __rmul__(self, path: DPath) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, text: DText) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + def __str__(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If 'lazy' is true, some parts are omitted when not required. + If a DBU is given, the output units will be micrometers. + + The lazy and DBU arguments have been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DCplxTrans) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def ctrans(self, d: float) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> DCplxTrans: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + def invert(self) -> DCplxTrans: + r""" + @brief Inverts the transformation (in place) + + Inverts the transformation and replaces this transformation by it's + inverted one. + + @return The inverted transformation + """ + def inverted(self) -> DCplxTrans: + r""" + @brief Returns the inverted transformation + + Returns the inverted transformation. This method does not modify the transformation. + + @return The inverted transformation + """ + def is_complex(self) -> bool: + r""" + @brief Returns true if the transformation is a complex one + + If this predicate is false, the transformation can safely be converted to a simple transformation. + Otherwise, this conversion will be lossy. + The predicate value is equivalent to 'is_mag || !is_ortho'. + + This method has been introduced in version 0.27.5. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_mag(self) -> bool: + r""" + @brief Tests, if the transformation is a magnifying one + + This is the recommended test for checking if the transformation represents + a magnification. + """ + def is_mirror(self) -> bool: + r""" + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + """ + def is_ortho(self) -> bool: + r""" + @brief Tests, if the transformation is an orthogonal transformation + + If the rotation is by a multiple of 90 degree, this method will return true. + """ + def is_unity(self) -> bool: + r""" + @brief Tests, whether this is a unit transformation + """ + def rot(self) -> int: + r""" + @brief Returns the respective simple transformation equivalent rotation code if possible + + If this transformation is orthogonal (is_ortho () == true), then this method + will return the corresponding fixpoint transformation, not taking into account + magnification and displacement. If the transformation is not orthogonal, the result + reflects the quadrant the rotation goes into. + """ + def s_trans(self) -> DTrans: + r""" + @brief Extracts the simple transformation part + + The simple transformation part does not reflect magnification or arbitrary angles. + Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. + """ + def to_itrans(self, dbu: Optional[float] = ...) -> ICplxTrans: + r""" + @brief Converts the transformation to another transformation with integer input and output coordinates + + The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If 'lazy' is true, some parts are omitted when not required. + If a DBU is given, the output units will be micrometers. + + The lazy and DBU arguments have been added in version 0.27.6. + """ + def to_trans(self) -> CplxTrans: + r""" + @brief Converts the transformation to another transformation with integer input coordinates + + This method has been introduced in version 0.25. + """ + def to_vtrans(self, dbu: Optional[float] = ...) -> VCplxTrans: + r""" + @brief Converts the transformation to another transformation with integer output coordinates + + The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + @overload + def trans(self, box: DBox) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, edge: DEdge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def trans(self, p: DVector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def trans(self, path: DPath) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, polygon: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, text: DText) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + +class CplxTrans: + r""" + @brief A complex transformation + + A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary + angle and a displacement. This is also the order, the operations are applied. + This version can transform integer-coordinate objects into floating-point coordinate objects. This is the generic and exact case, for example for non-integer magnifications. + + Complex transformations are extensions of the simple transformation classes (\Trans or \DTrans in that case) and behave similar. + + Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code: + + @code + # Create a transformation that applies a magnification of 1.5, a rotation by 90 degree + # and displacement of 10 in x and 20 units in y direction: + t = RBA::DCplxTrans::new(1.5, 90, false, 10.0, 20.0) + t.to_s # r90 *1.5 10,20 + # compute the inverse: + t.inverted.to_s # r270 *0.666666667 -13,7 + # Combine with another displacement (applied after that): + (RBA::DCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 + # Transform a point: + t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 + @/code + + The inverse type of the CplxTrans type is VCplxTrans which will transform floating-point to integer coordinate objects. Transformations of CplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator CplxTrans * ICplxTrans is allowed (output types of ICplxTrans and input of CplxTrans are identical) while CplxTrans * DCplxTrans is not. + See @The Database API@ for more details about the database objects. + """ + M0: ClassVar[CplxTrans] + r""" + @brief A constant giving "mirrored at the x-axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M135: ClassVar[CplxTrans] + r""" + @brief A constant giving "mirrored at the 135 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M45: ClassVar[CplxTrans] + r""" + @brief A constant giving "mirrored at the 45 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M90: ClassVar[CplxTrans] + r""" + @brief A constant giving "mirrored at the y (90 degree) axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R0: ClassVar[CplxTrans] + r""" + @brief A constant giving "unrotated" (unit) transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R180: ClassVar[CplxTrans] + r""" + @brief A constant giving "rotated by 180 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R270: ClassVar[CplxTrans] + r""" + @brief A constant giving "rotated by 270 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R90: ClassVar[CplxTrans] + r""" + @brief A constant giving "rotated by 90 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + angle: float + r""" + Getter: + @brief Gets the angle + + Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree. + + @return The rotation angle this transformation provides in degree units (0..360 deg). + + Setter: + @brief Sets the angle + @param a The new angle + See \angle for a description of that attribute. + """ + disp: DVector + r""" + Getter: + @brief Gets the displacement + + Setter: + @brief Sets the displacement + @param u The new displacement + """ + mag: float + r""" + Getter: + @brief Gets the magnification + + Setter: + @brief Sets the magnification + @param m The new magnification + """ + mirror: bool + r""" + Getter: + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + Setter: + @brief Sets the mirror flag + "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag + """ + @classmethod + def from_dtrans(cls, trans: DCplxTrans) -> CplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @classmethod + def from_s(cls, s: str) -> CplxTrans: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> CplxTrans: + r""" + @brief Creates a unit transformation + """ + @overload + @classmethod + def new(cls, m: float) -> CplxTrans: + r""" + @brief Creates a transformation from a magnification + + Creates a magnifying transformation without displacement and rotation given the magnification m. + """ + @overload + @classmethod + def new(cls, t: Trans) -> CplxTrans: + r""" + @brief Creates a transformation from a simple transformation alone + + Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + """ + @overload + @classmethod + def new(cls, trans: DCplxTrans) -> CplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @overload + @classmethod + def new(cls, trans: ICplxTrans) -> CplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, trans: VCplxTrans) -> CplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, u: DVector) -> CplxTrans: + r""" + @brief Creates a transformation from a displacement + + Creates a transformation with a displacement only. + + This method has been added in version 0.25. + """ + @overload + @classmethod + def new(cls, t: Trans, m: float) -> CplxTrans: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + @classmethod + def new(cls, x: float, y: float) -> CplxTrans: + r""" + @brief Creates a transformation from a x and y displacement + + This constructor will create a transformation with the specified displacement + but no rotation. + + @param x The x displacement + @param y The y displacement + """ + @overload + @classmethod + def new(cls, c: CplxTrans, m: Optional[float] = ..., u: Optional[DVector] = ...) -> CplxTrans: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + @classmethod + def new(cls, c: CplxTrans, m: float, x: int, y: int) -> CplxTrans: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + @classmethod + def new(cls, mag: float, rot: float, mirrx: bool, u: DVector) -> CplxTrans: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + @classmethod + def new(cls, mag: float, rot: float, mirrx: bool, x: float, y: float) -> CplxTrans: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + def __copy__(self) -> CplxTrans: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Tests for equality + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a unit transformation + """ + @overload + def __init__(self, m: float) -> None: + r""" + @brief Creates a transformation from a magnification + + Creates a magnifying transformation without displacement and rotation given the magnification m. + """ + @overload + def __init__(self, t: Trans) -> None: + r""" + @brief Creates a transformation from a simple transformation alone + + Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + """ + @overload + def __init__(self, trans: DCplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @overload + def __init__(self, trans: ICplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + def __init__(self, trans: VCplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + def __init__(self, u: DVector) -> None: + r""" + @brief Creates a transformation from a displacement + + Creates a transformation with a displacement only. + + This method has been added in version 0.25. + """ + @overload + def __init__(self, t: Trans, m: float) -> None: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + def __init__(self, x: float, y: float) -> None: + r""" + @brief Creates a transformation from a x and y displacement + + This constructor will create a transformation with the specified displacement + but no rotation. + + @param x The x displacement + @param y The y displacement + """ + @overload + def __init__(self, c: CplxTrans, m: Optional[float] = ..., u: Optional[DVector] = ...) -> None: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + def __init__(self, c: CplxTrans, m: float, x: int, y: int) -> None: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, u: DVector) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, x: float, y: float) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + def __lt__(self, other: CplxTrans) -> bool: + r""" + @brief Provides a 'less' criterion for sorting + This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. + """ + @overload + def __mul__(self, box: Box) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, d: int) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __mul__(self, edge: Edge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: Point) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, p: Vector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __mul__(self, path: Path) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: Polygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, t: CplxTrans) -> CplxTrans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, t: ICplxTrans) -> CplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, t: VCplxTrans) -> DCplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, text: Text) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Tests for inequality + """ + @overload + def __rmul__(self, box: Box) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, d: int) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __rmul__(self, edge: Edge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: Point) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, p: Vector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __rmul__(self, path: Path) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: Polygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, text: Text) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + def __str__(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If 'lazy' is true, some parts are omitted when not required. + If a DBU is given, the output units will be micrometers. + + The lazy and DBU arguments have been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: CplxTrans) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def ctrans(self, d: int) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> CplxTrans: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + def invert(self) -> CplxTrans: + r""" + @brief Inverts the transformation (in place) + + Inverts the transformation and replaces this transformation by it's + inverted one. + + @return The inverted transformation + """ + def inverted(self) -> VCplxTrans: + r""" + @brief Returns the inverted transformation + + Returns the inverted transformation. This method does not modify the transformation. + + @return The inverted transformation + """ + def is_complex(self) -> bool: + r""" + @brief Returns true if the transformation is a complex one + + If this predicate is false, the transformation can safely be converted to a simple transformation. + Otherwise, this conversion will be lossy. + The predicate value is equivalent to 'is_mag || !is_ortho'. + + This method has been introduced in version 0.27.5. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_mag(self) -> bool: + r""" + @brief Tests, if the transformation is a magnifying one + + This is the recommended test for checking if the transformation represents + a magnification. + """ + def is_mirror(self) -> bool: + r""" + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + """ + def is_ortho(self) -> bool: + r""" + @brief Tests, if the transformation is an orthogonal transformation + + If the rotation is by a multiple of 90 degree, this method will return true. + """ + def is_unity(self) -> bool: + r""" + @brief Tests, whether this is a unit transformation + """ + def rot(self) -> int: + r""" + @brief Returns the respective simple transformation equivalent rotation code if possible + + If this transformation is orthogonal (is_ortho () == true), then this method + will return the corresponding fixpoint transformation, not taking into account + magnification and displacement. If the transformation is not orthogonal, the result + reflects the quadrant the rotation goes into. + """ + def s_trans(self) -> Trans: + r""" + @brief Extracts the simple transformation part + + The simple transformation part does not reflect magnification or arbitrary angles. + Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. + """ + def to_itrans(self, dbu: Optional[float] = ...) -> ICplxTrans: + r""" + @brief Converts the transformation to another transformation with integer input and output coordinates + + The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If 'lazy' is true, some parts are omitted when not required. + If a DBU is given, the output units will be micrometers. + + The lazy and DBU arguments have been added in version 0.27.6. + """ + def to_trans(self) -> DCplxTrans: + r""" + @brief Converts the transformation to another transformation with floating-point input coordinates + + This method has been introduced in version 0.25. + """ + def to_vtrans(self, dbu: Optional[float] = ...) -> VCplxTrans: + r""" + @brief Converts the transformation to another transformation with integer output and floating-point input coordinates + + The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + @overload + def trans(self, box: Box) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, edge: Edge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, p: Point) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def trans(self, p: Vector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def trans(self, path: Path) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, polygon: Polygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, text: Text) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + +class ICplxTrans: + r""" + @brief A complex transformation + + A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary + angle and a displacement. This is also the order, the operations are applied. + This version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact. + + Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar. + + Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code: + + @code + # Create a transformation that applies a magnification of 1.5, a rotation by 90 degree + # and displacement of 10 in x and 20 units in y direction: + t = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0) + t.to_s # r90 *1.5 10,20 + # compute the inverse: + t.inverted.to_s # r270 *0.666666667 -13,7 + # Combine with another displacement (applied after that): + (RBA::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 + # Transform a point: + t.trans(RBA::Point::new(100, 200)).to_s # -290,170 + @/code + + This class has been introduced in version 0.18. + + See @The Database API@ for more details about the database objects. + """ + M0: ClassVar[ICplxTrans] + r""" + @brief A constant giving "mirrored at the x-axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M135: ClassVar[ICplxTrans] + r""" + @brief A constant giving "mirrored at the 135 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M45: ClassVar[ICplxTrans] + r""" + @brief A constant giving "mirrored at the 45 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M90: ClassVar[ICplxTrans] + r""" + @brief A constant giving "mirrored at the y (90 degree) axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R0: ClassVar[ICplxTrans] + r""" + @brief A constant giving "unrotated" (unit) transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R180: ClassVar[ICplxTrans] + r""" + @brief A constant giving "rotated by 180 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R270: ClassVar[ICplxTrans] + r""" + @brief A constant giving "rotated by 270 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R90: ClassVar[ICplxTrans] + r""" + @brief A constant giving "rotated by 90 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + angle: float + r""" + Getter: + @brief Gets the angle + + Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree. + + @return The rotation angle this transformation provides in degree units (0..360 deg). + + Setter: + @brief Sets the angle + @param a The new angle + See \angle for a description of that attribute. + """ + disp: Vector + r""" + Getter: + @brief Gets the displacement + + Setter: + @brief Sets the displacement + @param u The new displacement + """ + mag: float + r""" + Getter: + @brief Gets the magnification + + Setter: + @brief Sets the magnification + @param m The new magnification + """ + mirror: bool + r""" + Getter: + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + Setter: + @brief Sets the mirror flag + "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag + """ + @classmethod + def from_dtrans(cls, trans: DCplxTrans) -> ICplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @classmethod + def from_s(cls, s: str) -> ICplxTrans: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @classmethod + def from_trans(cls, trans: CplxTrans) -> ICplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_trans'. + """ + @overload + @classmethod + def new(cls) -> ICplxTrans: + r""" + @brief Creates a unit transformation + """ + @overload + @classmethod + def new(cls, m: float) -> ICplxTrans: + r""" + @brief Creates a transformation from a magnification + + Creates a magnifying transformation without displacement and rotation given the magnification m. + """ + @overload + @classmethod + def new(cls, t: Trans) -> ICplxTrans: + r""" + @brief Creates a transformation from a simple transformation alone + + Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + """ + @overload + @classmethod + def new(cls, trans: CplxTrans) -> ICplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_trans'. + """ + @overload + @classmethod + def new(cls, trans: DCplxTrans) -> ICplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @overload + @classmethod + def new(cls, trans: VCplxTrans) -> ICplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, u: Vector) -> ICplxTrans: + r""" + @brief Creates a transformation from a displacement + + Creates a transformation with a displacement only. + + This method has been added in version 0.25. + """ + @overload + @classmethod + def new(cls, t: Trans, m: float) -> ICplxTrans: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + @classmethod + def new(cls, x: int, y: int) -> ICplxTrans: + r""" + @brief Creates a transformation from a x and y displacement + + This constructor will create a transformation with the specified displacement + but no rotation. + + @param x The x displacement + @param y The y displacement + """ + @overload + @classmethod + def new(cls, c: ICplxTrans, m: Optional[float] = ..., u: Optional[Vector] = ...) -> ICplxTrans: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + @classmethod + def new(cls, c: ICplxTrans, m: float, x: int, y: int) -> ICplxTrans: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + @classmethod + def new(cls, mag: float, rot: float, mirrx: bool, u: Vector) -> ICplxTrans: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + @classmethod + def new(cls, mag: float, rot: float, mirrx: bool, x: int, y: int) -> ICplxTrans: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + def __copy__(self) -> ICplxTrans: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Tests for equality + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a unit transformation + """ + @overload + def __init__(self, m: float) -> None: + r""" + @brief Creates a transformation from a magnification + + Creates a magnifying transformation without displacement and rotation given the magnification m. + """ + @overload + def __init__(self, t: Trans) -> None: + r""" + @brief Creates a transformation from a simple transformation alone + + Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + """ + @overload + def __init__(self, trans: CplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_trans'. + """ + @overload + def __init__(self, trans: DCplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @overload + def __init__(self, trans: VCplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + def __init__(self, u: Vector) -> None: + r""" + @brief Creates a transformation from a displacement + + Creates a transformation with a displacement only. + + This method has been added in version 0.25. + """ + @overload + def __init__(self, t: Trans, m: float) -> None: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + def __init__(self, x: int, y: int) -> None: + r""" + @brief Creates a transformation from a x and y displacement + + This constructor will create a transformation with the specified displacement + but no rotation. + + @param x The x displacement + @param y The y displacement + """ + @overload + def __init__(self, c: ICplxTrans, m: Optional[float] = ..., u: Optional[Vector] = ...) -> None: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + def __init__(self, c: ICplxTrans, m: float, x: int, y: int) -> None: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, u: Vector) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, x: int, y: int) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + def __lt__(self, other: ICplxTrans) -> bool: + r""" + @brief Provides a 'less' criterion for sorting + This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. + """ + @overload + def __mul__(self, box: Box) -> Box: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, d: int) -> int: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __mul__(self, edge: Edge) -> Edge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: Point) -> Point: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, p: Vector) -> Vector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __mul__(self, path: Path) -> Path: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: Polygon) -> Polygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, t: ICplxTrans) -> ICplxTrans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, t: VCplxTrans) -> VCplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, text: Text) -> Text: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Tests for inequality + """ + @overload + def __rmul__(self, box: Box) -> Box: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, d: int) -> int: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __rmul__(self, edge: Edge) -> Edge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: Point) -> Point: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, p: Vector) -> Vector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __rmul__(self, path: Path) -> Path: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: Polygon) -> Polygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, text: Text) -> Text: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + def __str__(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If 'lazy' is true, some parts are omitted when not required. + If a DBU is given, the output units will be micrometers. + + The lazy and DBU arguments have been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: ICplxTrans) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def ctrans(self, d: int) -> int: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> ICplxTrans: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + def invert(self) -> ICplxTrans: + r""" + @brief Inverts the transformation (in place) + + Inverts the transformation and replaces this transformation by it's + inverted one. + + @return The inverted transformation + """ + def inverted(self) -> ICplxTrans: + r""" + @brief Returns the inverted transformation + + Returns the inverted transformation. This method does not modify the transformation. + + @return The inverted transformation + """ + def is_complex(self) -> bool: + r""" + @brief Returns true if the transformation is a complex one + + If this predicate is false, the transformation can safely be converted to a simple transformation. + Otherwise, this conversion will be lossy. + The predicate value is equivalent to 'is_mag || !is_ortho'. + + This method has been introduced in version 0.27.5. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_mag(self) -> bool: + r""" + @brief Tests, if the transformation is a magnifying one + + This is the recommended test for checking if the transformation represents + a magnification. + """ + def is_mirror(self) -> bool: + r""" + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + """ + def is_ortho(self) -> bool: + r""" + @brief Tests, if the transformation is an orthogonal transformation + + If the rotation is by a multiple of 90 degree, this method will return true. + """ + def is_unity(self) -> bool: + r""" + @brief Tests, whether this is a unit transformation + """ + def rot(self) -> int: + r""" + @brief Returns the respective simple transformation equivalent rotation code if possible + + If this transformation is orthogonal (is_ortho () == true), then this method + will return the corresponding fixpoint transformation, not taking into account + magnification and displacement. If the transformation is not orthogonal, the result + reflects the quadrant the rotation goes into. + """ + def s_trans(self) -> Trans: + r""" + @brief Extracts the simple transformation part + + The simple transformation part does not reflect magnification or arbitrary angles. + Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. + """ + def to_itrans(self, dbu: Optional[float] = ...) -> DCplxTrans: + r""" + @brief Converts the transformation to another transformation with floating-point input and output coordinates + + The database unit can be specified to translate the integer coordinate displacement in database units to a floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If 'lazy' is true, some parts are omitted when not required. + If a DBU is given, the output units will be micrometers. + + The lazy and DBU arguments have been added in version 0.27.6. + """ + def to_trans(self) -> VCplxTrans: + r""" + @brief Converts the transformation to another transformation with floating-point input coordinates + + This method has been introduced in version 0.25. + """ + def to_vtrans(self, dbu: Optional[float] = ...) -> CplxTrans: + r""" + @brief Converts the transformation to another transformation with floating-point output coordinates + + The database unit can be specified to translate the integer coordinate displacement in database units to a floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit. + + This method has been introduced in version 0.25. + """ + @overload + def trans(self, box: Box) -> Box: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, edge: Edge) -> Edge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, p: Point) -> Point: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def trans(self, p: Vector) -> Vector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def trans(self, path: Path) -> Path: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, polygon: Polygon) -> Polygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, text: Text) -> Text: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + +class VCplxTrans: + r""" + @brief A complex transformation + + A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary + angle and a displacement. This is also the order, the operations are applied. + This version can transform floating point coordinate objects into integer coordinate objects, which may involve rounding and can be inexact. + + Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar. + + Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code: + + @code + # Create a transformation that applies a magnification of 1.5, a rotation by 90 degree + # and displacement of 10 in x and 20 units in y direction: + t = RBA::VCplxTrans::new(1.5, 90, false, 10, 20) + t.to_s # r90 *1.5 10,20 + # compute the inverse: + t.inverted.to_s # r270 *0.666666667 -13,7 + # Combine with another displacement (applied after that): + (RBA::VCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 + # Transform a point: + t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 + @/code + + The VCplxTrans type is the inverse transformation of the CplxTrans transformation and vice versa.Transformations of VCplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator VCplxTrans * CplxTrans is allowed (output types of CplxTrans and input of VCplxTrans are identical) while VCplxTrans * ICplxTrans is not. + + This class has been introduced in version 0.25. + + See @The Database API@ for more details about the database objects. + """ + M0: ClassVar[VCplxTrans] + r""" + @brief A constant giving "mirrored at the x-axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M135: ClassVar[VCplxTrans] + r""" + @brief A constant giving "mirrored at the 135 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M45: ClassVar[VCplxTrans] + r""" + @brief A constant giving "mirrored at the 45 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M90: ClassVar[VCplxTrans] + r""" + @brief A constant giving "mirrored at the y (90 degree) axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R0: ClassVar[VCplxTrans] + r""" + @brief A constant giving "unrotated" (unit) transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R180: ClassVar[VCplxTrans] + r""" + @brief A constant giving "rotated by 180 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R270: ClassVar[VCplxTrans] + r""" + @brief A constant giving "rotated by 270 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R90: ClassVar[VCplxTrans] + r""" + @brief A constant giving "rotated by 90 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + angle: float + r""" + Getter: + @brief Gets the angle + + Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree. + + @return The rotation angle this transformation provides in degree units (0..360 deg). + + Setter: + @brief Sets the angle + @param a The new angle + See \angle for a description of that attribute. + """ + disp: Vector + r""" + Getter: + @brief Gets the displacement + + Setter: + @brief Sets the displacement + @param u The new displacement + """ + mag: float + r""" + Getter: + @brief Gets the magnification + + Setter: + @brief Sets the magnification + @param m The new magnification + """ + mirror: bool + r""" + Getter: + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + Setter: + @brief Sets the mirror flag + "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag + """ + @classmethod + def from_s(cls, s: str) -> VCplxTrans: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> VCplxTrans: + r""" + @brief Creates a unit transformation + """ + @overload + @classmethod + def new(cls, m: float) -> VCplxTrans: + r""" + @brief Creates a transformation from a magnification + + Creates a magnifying transformation without displacement and rotation given the magnification m. + """ + @overload + @classmethod + def new(cls, t: DTrans) -> VCplxTrans: + r""" + @brief Creates a transformation from a simple transformation alone + + Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + """ + @overload + @classmethod + def new(cls, trans: CplxTrans) -> VCplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + """ + @overload + @classmethod + def new(cls, trans: DCplxTrans) -> VCplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + """ + @overload + @classmethod + def new(cls, trans: ICplxTrans) -> VCplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + """ + @overload + @classmethod + def new(cls, u: Vector) -> VCplxTrans: + r""" + @brief Creates a transformation from a displacement + + Creates a transformation with a displacement only. + + This method has been added in version 0.25. + """ + @overload + @classmethod + def new(cls, t: DTrans, m: float) -> VCplxTrans: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + @classmethod + def new(cls, x: int, y: int) -> VCplxTrans: + r""" + @brief Creates a transformation from a x and y displacement + + This constructor will create a transformation with the specified displacement + but no rotation. + + @param x The x displacement + @param y The y displacement + """ + @overload + @classmethod + def new(cls, c: VCplxTrans, m: Optional[float] = ..., u: Optional[Vector] = ...) -> VCplxTrans: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + @classmethod + def new(cls, c: VCplxTrans, m: float, x: float, y: float) -> VCplxTrans: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + @classmethod + def new(cls, mag: float, rot: float, mirrx: bool, u: Vector) -> VCplxTrans: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + @classmethod + def new(cls, mag: float, rot: float, mirrx: bool, x: int, y: int) -> VCplxTrans: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + def __copy__(self) -> VCplxTrans: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Tests for equality + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a unit transformation + """ + @overload + def __init__(self, m: float) -> None: + r""" + @brief Creates a transformation from a magnification + + Creates a magnifying transformation without displacement and rotation given the magnification m. + """ + @overload + def __init__(self, t: DTrans) -> None: + r""" + @brief Creates a transformation from a simple transformation alone + + Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + """ + @overload + def __init__(self, trans: CplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + """ + @overload + def __init__(self, trans: DCplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + """ + @overload + def __init__(self, trans: ICplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + """ + @overload + def __init__(self, u: Vector) -> None: + r""" + @brief Creates a transformation from a displacement + + Creates a transformation with a displacement only. + + This method has been added in version 0.25. + """ + @overload + def __init__(self, t: DTrans, m: float) -> None: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + def __init__(self, x: int, y: int) -> None: + r""" + @brief Creates a transformation from a x and y displacement + + This constructor will create a transformation with the specified displacement + but no rotation. + + @param x The x displacement + @param y The y displacement + """ + @overload + def __init__(self, c: VCplxTrans, m: Optional[float] = ..., u: Optional[Vector] = ...) -> None: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + def __init__(self, c: VCplxTrans, m: float, x: float, y: float) -> None: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, u: Vector) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, x: int, y: int) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + def __lt__(self, other: VCplxTrans) -> bool: + r""" + @brief Provides a 'less' criterion for sorting + This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. + """ + @overload + def __mul__(self, box: DBox) -> Box: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, d: float) -> int: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __mul__(self, edge: DEdge) -> Edge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: DPoint) -> Point: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, p: DVector) -> Vector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __mul__(self, path: DPath) -> Path: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: DPolygon) -> Polygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, t: CplxTrans) -> ICplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, t: DCplxTrans) -> VCplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, t: VCplxTrans) -> VCplxTrans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, text: DText) -> Text: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Tests for inequality + """ + @overload + def __rmul__(self, box: DBox) -> Box: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, d: float) -> int: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __rmul__(self, edge: DEdge) -> Edge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: DPoint) -> Point: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, p: DVector) -> Vector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __rmul__(self, path: DPath) -> Path: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: DPolygon) -> Polygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, text: DText) -> Text: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + def __str__(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If 'lazy' is true, some parts are omitted when not required. + If a DBU is given, the output units will be micrometers. + + The lazy and DBU arguments have been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: VCplxTrans) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def ctrans(self, d: float) -> int: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> VCplxTrans: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + def invert(self) -> VCplxTrans: + r""" + @brief Inverts the transformation (in place) + + Inverts the transformation and replaces this transformation by it's + inverted one. + + @return The inverted transformation + """ + def inverted(self) -> CplxTrans: + r""" + @brief Returns the inverted transformation + + Returns the inverted transformation. This method does not modify the transformation. + + @return The inverted transformation + """ + def is_complex(self) -> bool: + r""" + @brief Returns true if the transformation is a complex one + + If this predicate is false, the transformation can safely be converted to a simple transformation. + Otherwise, this conversion will be lossy. + The predicate value is equivalent to 'is_mag || !is_ortho'. + + This method has been introduced in version 0.27.5. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_mag(self) -> bool: + r""" + @brief Tests, if the transformation is a magnifying one + + This is the recommended test for checking if the transformation represents + a magnification. + """ + def is_mirror(self) -> bool: + r""" + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + """ + def is_ortho(self) -> bool: + r""" + @brief Tests, if the transformation is an orthogonal transformation + + If the rotation is by a multiple of 90 degree, this method will return true. + """ + def is_unity(self) -> bool: + r""" + @brief Tests, whether this is a unit transformation + """ + def rot(self) -> int: + r""" + @brief Returns the respective simple transformation equivalent rotation code if possible + + If this transformation is orthogonal (is_ortho () == true), then this method + will return the corresponding fixpoint transformation, not taking into account + magnification and displacement. If the transformation is not orthogonal, the result + reflects the quadrant the rotation goes into. + """ + def s_trans(self) -> DTrans: + r""" + @brief Extracts the simple transformation part + + The simple transformation part does not reflect magnification or arbitrary angles. + Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. + """ + def to_itrans(self, dbu: Optional[float] = ...) -> DCplxTrans: + r""" + @brief Converts the transformation to another transformation with floating-point output coordinates + + The database unit can be specified to translate the integer coordinate displacement in database units to a floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If 'lazy' is true, some parts are omitted when not required. + If a DBU is given, the output units will be micrometers. + + The lazy and DBU arguments have been added in version 0.27.6. + """ + def to_trans(self) -> ICplxTrans: + r""" + @brief Converts the transformation to another transformation with integer input coordinates + + This method has been introduced in version 0.25. + """ + def to_vtrans(self, dbu: Optional[float] = ...) -> CplxTrans: + r""" + @brief Converts the transformation to another transformation with integer input and floating-point output coordinates + + The database unit can be specified to translate the integer coordinate displacement in database units to an floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit. + + This method has been introduced in version 0.25. + """ + @overload + def trans(self, box: DBox) -> Box: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, edge: DEdge) -> Edge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, p: DPoint) -> Point: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def trans(self, p: DVector) -> Vector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def trans(self, path: DPath) -> Path: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, polygon: DPolygon) -> Polygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, text: DText) -> Text: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + +class Utils: + r""" + @brief This namespace provides a collection of utility functions + + This class has been introduced in version 0.27. + """ + @classmethod + def new(cls) -> Utils: + r""" + @brief Creates a new object of this class + """ + @overload + @classmethod + def spline_interpolation(cls, control_points: Sequence[DPoint], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[DPoint]: + r""" + @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. + + This is the version for non-rational splines. It lacks the weight vector. + """ + @overload + @classmethod + def spline_interpolation(cls, control_points: Sequence[Point], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[Point]: + r""" + @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. + + This is the version for integer-coordinate points for non-rational splines. + """ + @overload + @classmethod + def spline_interpolation(cls, control_points: Sequence[DPoint], weights: Sequence[float], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[DPoint]: + r""" + @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. + + The knot vector needs to be padded and it's size must fulfill the condition: + + @code + knots.size == control_points.size + degree + 1 + @/code + + The accuracy parameters allow tuning the resolution of the curve to target a specific approximation quality. + "relative_accuracy" gives the accuracy relative to the local curvature radius, "absolute" accuracy gives the + absolute accuracy. "accuracy" is the allowed deviation of polygon approximation from the ideal curve. + The computed curve should meet at least one of the accuracy criteria. Setting both limits to a very small + value will result in long run times and a large number of points returned. + + This function supports both rational splines (NURBS) and non-rational splines. The latter use weights of + 1.0 for each point. + + The return value is a list of points forming a path which approximates the spline curve. + """ + @overload + @classmethod + def spline_interpolation(cls, control_points: Sequence[Point], weights: Sequence[float], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[Point]: + r""" + @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. + + This is the version for integer-coordinate points. + """ + def __copy__(self) -> Utils: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: Utils) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> Utils: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + +class DVector: + r""" + @brief A vector class with double (floating-point) coordinates + A vector is a distance in cartesian, 2 dimensional space. A vector is given by two coordinates (x and y) and represents the distance between two points. Being the distance, transformations act differently on vectors: the displacement is not applied. + Vectors are not geometrical objects by itself. But they are frequently used in the database API for various purposes. Other than the integer variant (\Vector), points with floating-point coordinates can represent fractions of a database unit or vectors in physical (micron) units. + + This class has been introduced in version 0.25. + + See @The Database API@ for more details about the database objects. + """ + x: float + r""" + Getter: + @brief Accessor to the x coordinate + + Setter: + @brief Write accessor to the x coordinate + """ + y: float + r""" + Getter: + @brief Accessor to the y coordinate + + Setter: + @brief Write accessor to the y coordinate + """ + @classmethod + def from_s(cls, s: str) -> DVector: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + """ + @overload + @classmethod + def new(cls) -> DVector: + r""" + @brief Default constructor: creates a null vector with coordinates (0,0) + """ + @overload + @classmethod + def new(cls, p: DPoint) -> DVector: + r""" + @brief Default constructor: creates a vector from a point + This constructor is equivalent to computing p-point(0,0). + This method has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, vector: Vector) -> DVector: + r""" + @brief Creates a floating-point coordinate vector from an integer coordinate vector + """ + @overload + @classmethod + def new(cls, x: float, y: float) -> DVector: + r""" + @brief Constructor for a vector from two coordinate values + + """ + @overload + def __add__(self, p: DPoint) -> DPoint: + r""" + @brief Adds a vector and a point + + + Returns the point p shifted by the vector. + """ + @overload + def __add__(self, v: DVector) -> DVector: + r""" + @brief Adds two vectors + + + Adds vector v to self by adding the coordinates. + """ + def __copy__(self) -> DVector: + r""" + @brief Creates a copy of self + """ + def __eq__(self, v: object) -> bool: + r""" + @brief Equality test operator + + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given vector. This method enables vectors as hash keys. + + This method has been introduced in version 0.25. + """ + def __imul__(self, f: float) -> DVector: + r""" + @brief Scaling by some factor + + + Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor: creates a null vector with coordinates (0,0) + """ + @overload + def __init__(self, p: DPoint) -> None: + r""" + @brief Default constructor: creates a vector from a point + This constructor is equivalent to computing p-point(0,0). + This method has been introduced in version 0.25. + """ + @overload + def __init__(self, vector: Vector) -> None: + r""" + @brief Creates a floating-point coordinate vector from an integer coordinate vector + """ + @overload + def __init__(self, x: float, y: float) -> None: + r""" + @brief Constructor for a vector from two coordinate values + + """ + def __itruediv__(self, d: float) -> DVector: + r""" + @brief Division by some divisor + + + Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded. + """ + def __lt__(self, v: DVector) -> bool: + r""" + @brief "less" comparison operator + + + This operator is provided to establish a sorting + order + """ + @overload + def __mul__(self, f: float) -> DVector: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + @overload + def __mul__(self, v: DVector) -> float: + r""" + @brief Computes the scalar product between self and the given vector + + + The scalar product of a and b is defined as: vp = ax*bx+ay*by. + """ + def __ne__(self, v: object) -> bool: + r""" + @brief Inequality test operator + + """ + def __neg__(self) -> DVector: + r""" + @brief Compute the negative of a vector + + + Returns a new vector with -x,-y. + """ + @overload + def __rmul__(self, f: float) -> DVector: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + @overload + def __rmul__(self, v: DVector) -> float: + r""" + @brief Computes the scalar product between self and the given vector + + + The scalar product of a and b is defined as: vp = ax*bx+ay*by. + """ + def __str__(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def __sub__(self, v: DVector) -> DVector: + r""" + @brief Subtract two vectors + + + Subtract vector v from self by subtracting the coordinates. + """ + def __truediv__(self, d: float) -> DVector: + r""" + @brief Division by some divisor + + + Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def abs(self) -> float: + r""" + @brief Returns the length of the vector + 'abs' is an alias provided for compatibility with the former point type. + """ + def assign(self, other: DVector) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> DVector: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given vector. This method enables vectors as hash keys. + + This method has been introduced in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def length(self) -> float: + r""" + @brief Returns the length of the vector + 'abs' is an alias provided for compatibility with the former point type. + """ + def sprod(self, v: DVector) -> float: + r""" + @brief Computes the scalar product between self and the given vector + + + The scalar product of a and b is defined as: vp = ax*bx+ay*by. + """ + def sprod_sign(self, v: DVector) -> int: + r""" + @brief Computes the scalar product between self and the given vector and returns a value indicating the sign of the product + + + @return 1 if the scalar product is positive, 0 if it is zero and -1 if it is negative. + """ + def sq_abs(self) -> float: + r""" + @brief The square length of the vector + 'sq_abs' is an alias provided for compatibility with the former point type. + """ + def sq_length(self) -> float: + r""" + @brief The square length of the vector + 'sq_abs' is an alias provided for compatibility with the former point type. + """ + def to_itype(self, dbu: Optional[float] = ...) -> Vector: + r""" + @brief Converts the point to an integer coordinate point + + The database unit can be specified to translate the floating-point coordinate vector in micron units to an integer-coordinate vector in database units. The vector's' coordinates will be divided by the database unit. + """ + def to_p(self) -> DPoint: + r""" + @brief Turns the vector into a point + This method returns the point resulting from adding the vector to (0,0). + This method has been introduced in version 0.25. + """ + def to_s(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def vprod(self, v: DVector) -> float: + r""" + @brief Computes the vector product between self and the given vector + + + The vector product of a and b is defined as: vp = ax*by-ay*bx. + """ + def vprod_sign(self, v: DVector) -> int: + r""" + @brief Computes the vector product between self and the given vector and returns a value indicating the sign of the product + + + @return 1 if the vector product is positive, 0 if it is zero and -1 if it is negative. + """ + +class Vector: + r""" + @brief A integer vector class + A vector is a distance in cartesian, 2 dimensional space. A vector is given by two coordinates (x and y) and represents the distance between two points. Being the distance, transformations act differently on vectors: the displacement is not applied. + Vectors are not geometrical objects by itself. But they are frequently used in the database API for various purposes. + + This class has been introduced in version 0.25. + + See @The Database API@ for more details about the database objects. + """ + x: int + r""" + Getter: + @brief Accessor to the x coordinate + + Setter: + @brief Write accessor to the x coordinate + """ + y: int + r""" + Getter: + @brief Accessor to the y coordinate + + Setter: + @brief Write accessor to the y coordinate + """ + @classmethod + def from_s(cls, s: str) -> Vector: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + """ + @overload + @classmethod + def new(cls) -> Vector: + r""" + @brief Default constructor: creates a null vector with coordinates (0,0) + """ + @overload + @classmethod + def new(cls, dvector: DVector) -> Vector: + r""" + @brief Creates an integer coordinate vector from a floating-point coordinate vector + """ + @overload + @classmethod + def new(cls, p: Point) -> Vector: + r""" + @brief Default constructor: creates a vector from a point + This constructor is equivalent to computing p-point(0,0). + This method has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, x: int, y: int) -> Vector: + r""" + @brief Constructor for a vector from two coordinate values + + """ + @overload + def __add__(self, p: Point) -> Point: + r""" + @brief Adds a vector and a point + + + Returns the point p shifted by the vector. + """ + @overload + def __add__(self, v: Vector) -> Vector: + r""" + @brief Adds two vectors + + + Adds vector v to self by adding the coordinates. + """ + def __copy__(self) -> Vector: + r""" + @brief Creates a copy of self + """ + def __eq__(self, v: object) -> bool: + r""" + @brief Equality test operator + + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given vector. This method enables vectors as hash keys. + + This method has been introduced in version 0.25. + """ + def __imul__(self, f: float) -> Vector: + r""" + @brief Scaling by some factor + + + Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor: creates a null vector with coordinates (0,0) + """ + @overload + def __init__(self, dvector: DVector) -> None: + r""" + @brief Creates an integer coordinate vector from a floating-point coordinate vector + """ + @overload + def __init__(self, p: Point) -> None: + r""" + @brief Default constructor: creates a vector from a point + This constructor is equivalent to computing p-point(0,0). + This method has been introduced in version 0.25. + """ + @overload + def __init__(self, x: int, y: int) -> None: + r""" + @brief Constructor for a vector from two coordinate values + + """ + def __itruediv__(self, d: float) -> Vector: + r""" + @brief Division by some divisor + + + Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded. + """ + def __lt__(self, v: Vector) -> bool: + r""" + @brief "less" comparison operator + + + This operator is provided to establish a sorting + order + """ + @overload + def __mul__(self, f: float) -> Vector: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + @overload + def __mul__(self, v: Vector) -> int: + r""" + @brief Computes the scalar product between self and the given vector + + + The scalar product of a and b is defined as: vp = ax*bx+ay*by. + """ + def __ne__(self, v: object) -> bool: + r""" + @brief Inequality test operator + + """ + def __neg__(self) -> Vector: + r""" + @brief Compute the negative of a vector + + + Returns a new vector with -x,-y. + """ + @overload + def __rmul__(self, f: float) -> Vector: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + @overload + def __rmul__(self, v: Vector) -> int: + r""" + @brief Computes the scalar product between self and the given vector + + + The scalar product of a and b is defined as: vp = ax*bx+ay*by. + """ + def __str__(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def __sub__(self, v: Vector) -> Vector: + r""" + @brief Subtract two vectors + + + Subtract vector v from self by subtracting the coordinates. + """ + def __truediv__(self, d: float) -> Vector: + r""" + @brief Division by some divisor + + + Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def abs(self) -> float: + r""" + @brief Returns the length of the vector + 'abs' is an alias provided for compatibility with the former point type. + """ + def assign(self, other: Vector) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> Vector: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given vector. This method enables vectors as hash keys. + + This method has been introduced in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def length(self) -> float: + r""" + @brief Returns the length of the vector + 'abs' is an alias provided for compatibility with the former point type. + """ + def sprod(self, v: Vector) -> int: + r""" + @brief Computes the scalar product between self and the given vector + + + The scalar product of a and b is defined as: vp = ax*bx+ay*by. + """ + def sprod_sign(self, v: Vector) -> int: + r""" + @brief Computes the scalar product between self and the given vector and returns a value indicating the sign of the product + + + @return 1 if the scalar product is positive, 0 if it is zero and -1 if it is negative. + """ + def sq_abs(self) -> float: + r""" + @brief The square length of the vector + 'sq_abs' is an alias provided for compatibility with the former point type. + """ + def sq_length(self) -> float: + r""" + @brief The square length of the vector + 'sq_abs' is an alias provided for compatibility with the former point type. + """ + def to_dtype(self, dbu: Optional[float] = ...) -> DVector: + r""" + @brief Converts the vector to a floating-point coordinate vector + The database unit can be specified to translate the integer-coordinate vector into a floating-point coordinate vector in micron units. The database unit is basically a scaling factor. + """ + def to_p(self) -> Point: + r""" + @brief Turns the vector into a point + This method returns the point resulting from adding the vector to (0,0). + This method has been introduced in version 0.25. + """ + def to_s(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def vprod(self, v: Vector) -> int: + r""" + @brief Computes the vector product between self and the given vector + + + The vector product of a and b is defined as: vp = ax*by-ay*bx. + """ + def vprod_sign(self, v: Vector) -> int: + r""" + @brief Computes the vector product between self and the given vector and returns a value indicating the sign of the product + + + @return 1 if the vector product is positive, 0 if it is zero and -1 if it is negative. + """ + +class LayoutDiff: + r""" + @brief The layout compare tool + + The layout compare tool is a facility to quickly compare layouts and derive events that give details about the differences. The events are basically emitted following a certain order: + + @ul + @li General configuration events (database units, layers ...) @/li + @li \on_begin_cell @/li + @li \on_begin_inst_differences (if the instances differ) @/li + @li details about instance differences (if \Verbose flag is given) @/li + @li \on_end_inst_differences (if the instances differ) @/li + @li \on_begin_layer @/li + @li \on_begin_polygon_differences (if the polygons differ) @/li + @li details about polygon differences (if \Verbose flag is given) @/li + @li \on_end_polygon_differences (if the polygons differ) @/li + @li other shape difference events (paths, boxes, ...) @/li + @li \on_end_layer @/li + @li repeated layer event groups @/li + @li \on_end_cell @/li + @li repeated cell event groups @/li + @/ul + + To use the diff facility, create a \LayoutDiff object and call the \compare_layout or \compare_cell method: + + @code + lya = ... # layout A + lyb = ... # layout B + + diff = RBA::LayoutDiff::new + diff.on_polygon_in_a_only do |poly| + puts "Polygon in A: #{diff.cell_a.name}@#{diff.layer_info_a.to_s}: #{poly.to_s}" + end + diff.on_polygon_in_b_only do |poly| + puts "Polygon in A: #{diff.cell_b.name}@#{diff.layer_info_b.to_s}: #{poly.to_s}" + end + diff.compare(lya, lyb, RBA::LayoutDiff::Verbose + RBA::LayoutDiff::NoLayerNames) + @/code + """ + BoxesAsPolygons: ClassVar[int] + r""" + @brief Compare boxes to polygons + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + DontSummarizeMissingLayers: ClassVar[int] + r""" + @brief Don't summarize missing layers + If this mode is present, missing layers are treated as empty ones and every shape on the other layer will be reported as difference. + + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + FlattenArrayInsts: ClassVar[int] + r""" + @brief Compare array instances instance by instance + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + NoLayerNames: ClassVar[int] + r""" + @brief Do not compare layer names + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + NoProperties: ClassVar[int] + r""" + @brief Ignore properties + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + NoTextDetails: ClassVar[int] + r""" + @brief Ignore text details (font, size, presentation) + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + NoTextOrientation: ClassVar[int] + r""" + @brief Ignore text orientation + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + PathsAsPolygons: ClassVar[int] + r""" + @brief Compare paths to polygons + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + Silent: ClassVar[int] + r""" + @brief Silent compare - just report whether the layouts are identical + Silent mode will not issue any signals, but instead the return value of the \LayoutDiff#compare method will indicate whether the layouts are identical. In silent mode, the compare method will return immediately once a difference has been encountered so that mode may be much faster than the full compare. + + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + SmartCellMapping: ClassVar[int] + r""" + @brief Derive smart cell mapping instead of name mapping (available only if top cells are specified) + Smart cell mapping is only effective currently when cells are compared (with \LayoutDiff#compare with cells instead of layout objects). + + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + Verbose: ClassVar[int] + r""" + @brief Enables verbose mode (gives details about the differences) + + See the event descriptions for details about the differences in verbose and non-verbose mode. + + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + on_bbox_differs: None + r""" + Getter: + @brief This signal indicates a difference in the bounding boxes of two cells + This signal is only emitted in non-verbose mode (without \Verbose flag) as a summarizing cell property. In verbose mode detailed events will be issued indicating the differences. + + Setter: + @brief This signal indicates a difference in the bounding boxes of two cells + This signal is only emitted in non-verbose mode (without \Verbose flag) as a summarizing cell property. In verbose mode detailed events will be issued indicating the differences. + """ + on_begin_box_differences: None + r""" + Getter: + @brief This signal indicates differences in the boxes on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for boxes that are different between the two layouts. + Setter: + @brief This signal indicates differences in the boxes on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for boxes that are different between the two layouts. + """ + on_begin_cell: None + r""" + Getter: + @brief This signal initiates the sequence of events for a cell pair + All cell specific events happen between \begin_cell_event and \end_cell_event signals. + Setter: + @brief This signal initiates the sequence of events for a cell pair + All cell specific events happen between \begin_cell_event and \end_cell_event signals. + """ + on_begin_edge_differences: None + r""" + Getter: + @brief This signal indicates differences in the edges on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edges that are different between the two layouts. + Setter: + @brief This signal indicates differences in the edges on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edges that are different between the two layouts. + """ + on_begin_inst_differences: None + r""" + Getter: + @brief This signal indicates differences in the cell instances + In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\instance_in_a_only_event and \instance_in_b_only_event). + Setter: + @brief This signal indicates differences in the cell instances + In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\instance_in_a_only_event and \instance_in_b_only_event). + """ + on_begin_layer: None + r""" + Getter: + @brief This signal indicates differences on the given layer + In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\polygon_in_a_only_event, \polygon_in_b_only_event and similar). + Setter: + @brief This signal indicates differences on the given layer + In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\polygon_in_a_only_event, \polygon_in_b_only_event and similar). + """ + on_begin_path_differences: None + r""" + Getter: + @brief This signal indicates differences in the paths on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for paths that are different between the two layouts. + Setter: + @brief This signal indicates differences in the paths on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for paths that are different between the two layouts. + """ + on_begin_polygon_differences: None + r""" + Getter: + @brief This signal indicates differences in the polygons on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for polygons that are different between the two layouts. + Setter: + @brief This signal indicates differences in the polygons on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for polygons that are different between the two layouts. + """ + on_begin_text_differences: None + r""" + Getter: + @brief This signal indicates differences in the texts on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for texts that are different between the two layouts. + Setter: + @brief This signal indicates differences in the texts on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for texts that are different between the two layouts. + """ + on_box_in_a_only: None + r""" + Getter: + @brief This signal indicates a box that is present in the first layout only + Setter: + @brief This signal indicates a box that is present in the first layout only + """ + on_box_in_b_only: None + r""" + Getter: + @brief This signal indicates a box that is present in the second layout only + Setter: + @brief This signal indicates a box that is present in the second layout only + """ + on_cell_in_a_only: None + r""" + Getter: + @brief This signal indicates that the given cell is only present in the first layout + + Setter: + @brief This signal indicates that the given cell is only present in the first layout + """ + on_cell_in_b_only: None + r""" + Getter: + @brief This signal indicates that the given cell is only present in the second layout + + Setter: + @brief This signal indicates that the given cell is only present in the second layout + """ + on_cell_name_differs: None + r""" + Getter: + @brief This signal indicates a difference in the cell names + This signal is emitted in 'smart cell mapping' mode (see \SmartCellMapping) if two cells are considered identical, but have different names. + Setter: + @brief This signal indicates a difference in the cell names + This signal is emitted in 'smart cell mapping' mode (see \SmartCellMapping) if two cells are considered identical, but have different names. + """ + on_dbu_differs: None + r""" + Getter: + @brief This signal indicates a difference in the database units of the layouts + + Setter: + @brief This signal indicates a difference in the database units of the layouts + """ + on_edge_in_a_only: None + r""" + Getter: + @brief This signal indicates an edge that is present in the first layout only + Setter: + @brief This signal indicates an edge that is present in the first layout only + """ + on_edge_in_b_only: None + r""" + Getter: + @brief This signal indicates an edge that is present in the second layout only + Setter: + @brief This signal indicates an edge that is present in the second layout only + """ + on_end_box_differences: None + r""" + Getter: + @brief This signal indicates the end of sequence of box differences + + Setter: + @brief This signal indicates the end of sequence of box differences + """ + on_end_cell: None + r""" + Getter: + @brief This signal indicates the end of a sequence of signals for a specific cell + + Setter: + @brief This signal indicates the end of a sequence of signals for a specific cell + """ + on_end_edge_differences: None + r""" + Getter: + @brief This signal indicates the end of sequence of edge differences + + Setter: + @brief This signal indicates the end of sequence of edge differences + """ + on_end_inst_differences: None + r""" + Getter: + @brief This signal finishes a sequence of detailed instance difference events + + Setter: + @brief This signal finishes a sequence of detailed instance difference events + """ + on_end_layer: None + r""" + Getter: + @brief This signal indicates the end of a sequence of signals for a specific layer + + Setter: + @brief This signal indicates the end of a sequence of signals for a specific layer + """ + on_end_path_differences: None + r""" + Getter: + @brief This signal indicates the end of sequence of path differences + + Setter: + @brief This signal indicates the end of sequence of path differences + """ + on_end_polygon_differences: None + r""" + Getter: + @brief This signal indicates the end of sequence of polygon differences + + Setter: + @brief This signal indicates the end of sequence of polygon differences + """ + on_end_text_differences: None + r""" + Getter: + @brief This signal indicates the end of sequence of text differences + + Setter: + @brief This signal indicates the end of sequence of text differences + """ + on_instance_in_a_only: None + r""" + Getter: + @brief This signal indicates an instance that is present only in the first layout + This event is only emitted in verbose mode (\Verbose flag). + Setter: + @brief This signal indicates an instance that is present only in the first layout + This event is only emitted in verbose mode (\Verbose flag). + """ + on_instance_in_b_only: None + r""" + Getter: + @brief This signal indicates an instance that is present only in the second layout + This event is only emitted in verbose mode (\Verbose flag). + Setter: + @brief This signal indicates an instance that is present only in the second layout + This event is only emitted in verbose mode (\Verbose flag). + """ + on_layer_in_a_only: None + r""" + Getter: + @brief This signal indicates a layer that is present only in the first layout + + Setter: + @brief This signal indicates a layer that is present only in the first layout + """ + on_layer_in_b_only: None + r""" + Getter: + @brief This signal indicates a layer that is present only in the second layout + + Setter: + @brief This signal indicates a layer that is present only in the second layout + """ + on_layer_name_differs: None + r""" + Getter: + @brief This signal indicates a difference in the layer names + + Setter: + @brief This signal indicates a difference in the layer names + """ + on_path_in_a_only: None + r""" + Getter: + @brief This signal indicates a path that is present in the first layout only + Setter: + @brief This signal indicates a path that is present in the first layout only + """ + on_path_in_b_only: None + r""" + Getter: + @brief This signal indicates a path that is present in the second layout only + Setter: + @brief This signal indicates a path that is present in the second layout only + """ + on_per_layer_bbox_differs: None + r""" + Getter: + @brief This signal indicates differences in the per-layer bounding boxes of the current cell + + Setter: + @brief This signal indicates differences in the per-layer bounding boxes of the current cell + """ + on_polygon_in_a_only: None + r""" + Getter: + @brief This signal indicates a polygon that is present in the first layout only + + Setter: + @brief This signal indicates a polygon that is present in the first layout only + """ + on_polygon_in_b_only: None + r""" + Getter: + @brief This signal indicates a polygon that is present in the second layout only + + Setter: + @brief This signal indicates a polygon that is present in the second layout only + """ + on_text_in_a_only: None + r""" + Getter: + @brief This signal indicates a text that is present in the first layout only + Setter: + @brief This signal indicates a text that is present in the first layout only + """ + on_text_in_b_only: None + r""" + Getter: + @brief This signal indicates a text that is present in the second layout only + Setter: + @brief This signal indicates a text that is present in the second layout only + """ + @classmethod + def new(cls) -> LayoutDiff: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> LayoutDiff: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: LayoutDiff) -> None: + r""" + @brief Assigns another object to self + """ + def cell_a(self) -> Cell: + r""" + @brief Gets the current cell for the first layout + This attribute is the current cell and is set after \on_begin_cell and reset after \on_end_cell. + """ + def cell_b(self) -> Cell: + r""" + @brief Gets the current cell for the second layout + This attribute is the current cell and is set after \on_begin_cell and reset after \on_end_cell. + """ + @overload + def compare(self, a: Cell, b: Cell, flags: Optional[int] = ..., tolerance: Optional[int] = ...) -> bool: + r""" + @brief Compares two cells + + Compares layer definitions, cells, instances and shapes and properties of two layout hierarchies starting from the given cells. + Cells are identified by name. Only layers with valid layer and datatype are compared. + Several flags can be specified as a bitwise or combination of the constants. + + @param a The first top cell + @param b The second top cell + @param flags Flags to use for the comparison + @param tolerance A coordinate tolerance to apply (0: exact match, 1: one DBU tolerance is allowed ...) + + @return True, if the cells are identical + """ + @overload + def compare(self, a: Layout, b: Layout, flags: Optional[int] = ..., tolerance: Optional[int] = ...) -> bool: + r""" + @brief Compares two layouts + + Compares layer definitions, cells, instances and shapes and properties. + Cells are identified by name. Only layers with valid layer and datatype are compared. + Several flags can be specified as a bitwise or combination of the constants. + + @param a The first input layout + @param b The second input layout + @param flags Flags to use for the comparison + @param tolerance A coordinate tolerance to apply (0: exact match, 1: one DBU tolerance is allowed ...) + + @return True, if the layouts are identical + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> LayoutDiff: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def layer_index_a(self) -> int: + r""" + @brief Gets the current layer for the first layout + This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. + """ + def layer_index_b(self) -> int: + r""" + @brief Gets the current layer for the second layout + This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. + """ + def layer_info_a(self) -> LayerInfo: + r""" + @brief Gets the current layer properties for the first layout + This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. + """ + def layer_info_b(self) -> LayerInfo: + r""" + @brief Gets the current layer properties for the second layout + This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. + """ + def layout_a(self) -> Layout: + r""" + @brief Gets the first layout the difference detector runs on + """ + def layout_b(self) -> Layout: + r""" + @brief Gets the second layout the difference detector runs on + """ + +class TextGenerator: + r""" + @brief A text generator class + + A text generator is basically a way to produce human-readable text for labelling layouts. It's similar to the Basic.TEXT PCell, but more convenient to use in a scripting context. + + Generators can be constructed from font files (or resources) or one of the registered generators can be used. + + To create a generator from a font file proceed this way: + @code + gen = RBA::TextGenerator::new + gen.load_from_file("myfont.gds") + region = gen.text("A TEXT", 0.001) + @/code + + This code produces a RBA::Region with a database unit of 0.001 micron. This region can be fed into a \Shapes container to place it into a cell for example. + + By convention the font files must have two to three layers: + + @ul + @li 1/0 for the actual data @/li + @li 2/0 for the borders @/li + @li 3/0 for an optional additional background @/li + @/ul + + Currently, all glyphs must be bottom-left aligned at 0, 0. The + border must be drawn in at least one glyph cell. The border is taken + as the overall bbox of all borders. + + The glyph cells must be named with a single character or "nnn" where "d" is the + ASCII code of the character (i.e. "032" for space). Allowed ASCII codes are 32 through 127. + If a lower-case "a" character is defined, lower-case letters are supported. + Otherwise, lowercase letters are mapped to uppercase letters. + + Undefined characters are left blank in the output. + + A comment cell can be defined ("COMMENT") which must hold one text in layer 1 + stating the comment, and additional descriptions such as line width: + + @ul + @li "line_width=": Specifies the intended line width in micron units @/li + @li "design_grid=": Specifies the intended design grid in micron units @/li + @li any other text: The description string @/li + @/ul + + Generators can be picked form a list of predefined generator. See \generators, \default_generator and \generator_by_name for picking a generator from the list. + + This class has been introduced in version 0.25. + """ + @classmethod + def default_generator(cls) -> TextGenerator: + r""" + @brief Gets the default text generator (a standard font) + This method delivers the default generator or nil if no such generator is installed. + """ + @classmethod + def font_paths(cls) -> List[str]: + r""" + @brief Gets the paths where to look for font files + See \set_font_paths for a description of this function. + + This method has been introduced in version 0.27.4. + """ + @classmethod + def generator_by_name(cls, name: str) -> TextGenerator: + r""" + @brief Gets the text generator for a given name + This method delivers the generator with the given name or nil if no such generator is registered. + """ + @classmethod + def generators(cls) -> List[TextGenerator]: + r""" + @brief Gets the generators registered in the system + This method delivers a list of generator objects that can be used to create texts. + """ + @classmethod + def new(cls) -> TextGenerator: + r""" + @brief Creates a new object of this class + """ + @classmethod + def set_font_paths(cls, arg0: Sequence[str]) -> None: + r""" + @brief Sets the paths where to look for font files + This function sets the paths where to look for font files. After setting such a path, each font found will render a specific generator. The generator can be found under the font file's name. As the text generator is also the basis for the Basic.TEXT PCell, using this function also allows configuring custom fonts for this library cell. + + This method has been introduced in version 0.27.4. + """ + def __copy__(self) -> TextGenerator: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: TextGenerator) -> None: + r""" + @brief Assigns another object to self + """ + def background(self) -> Box: + r""" + @brief Gets the background rectangle of each glyph in the generator's database units + The background rectangle is the one that is used as background for inverted rendering. A version that delivers this value in micrometer units is \dbackground. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def dbackground(self) -> DBox: + r""" + @brief Gets the background rectangle in micron units + The background rectangle is the one that is used as background for inverted rendering. + """ + def dbu(self) -> float: + r""" + @brief Gets the basic database unit the design of the glyphs was made + This database unit the basic resolution of the glyphs. + """ + def ddesign_grid(self) -> float: + r""" + @brief Gets the design grid of the glyphs in micron units + The design grid is the basic grid used when designing the glyphs. In most cases this grid is bigger than the database unit. + """ + def description(self) -> str: + r""" + @brief Gets the description text of the generator + The generator's description text is a human-readable text that is used to identify the generator (aka 'font') in user interfaces. + """ + def design_grid(self) -> int: + r""" + @brief Gets the design grid of the glyphs in the generator's database units + The design grid is the basic grid used when designing the glyphs. In most cases this grid is bigger than the database unit. A version that delivers this value in micrometer units is \ddesign_grid. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dheight(self) -> float: + r""" + @brief Gets the design height of the glyphs in micron units + The height is the height of the rectangle occupied by each character. + """ + def dline_width(self) -> float: + r""" + @brief Gets the line width of the glyphs in micron units + The line width is the intended (not necessarily precisely) line width of typical character lines (such as the bar of an 'I'). + """ + def dup(self) -> TextGenerator: + r""" + @brief Creates a copy of self + """ + def dwidth(self) -> float: + r""" + @brief Gets the design width of the glyphs in micron units + The width is the width of the rectangle occupied by each character. + """ + def glyph(self, char: str) -> Region: + r""" + @brief Gets the glyph of the given character as a region + The region represents the glyph's outline and is delivered in the generator's database units .A more elaborate way to getting the text's outline is \text. + """ + def height(self) -> int: + r""" + @brief Gets the design height of the glyphs in the generator's database units + The height is the height of the rectangle occupied by each character. A version that delivers this value in micrometer units is \dheight. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def line_width(self) -> int: + r""" + @brief Gets the line width of the glyphs in the generator's database units + The line width is the intended (not necessarily precisely) line width of typical character lines (such as the bar of an 'I'). A version that delivers this value in micrometer units is \dline_width. + """ + def load_from_file(self, path: str) -> None: + r""" + @brief Loads the given file into the generator + See the description of the class how the layout data is read. + """ + def load_from_resource(self, resource_path: str) -> None: + r""" + @brief Loads the given resource data (as layout data) into the generator + The resource path has to start with a colon, i.e. ':/my/resource.gds'. See the description of the class how the layout data is read. + """ + def name(self) -> str: + r""" + @brief Gets the name of the generator + The generator's name is the basic key by which the generator is identified. + """ + def text(self, text: str, target_dbu: float, mag: Optional[float] = ..., inv: Optional[bool] = ..., bias: Optional[float] = ..., char_spacing: Optional[float] = ..., line_spacing: Optional[float] = ...) -> Region: + r""" + @brief Gets the rendered text as a region + @param text The text string + @param target_dbu The database unit for which to produce the text + @param mag The magnification (1.0 for original size) + @param inv inverted rendering: if true, the glyphs are rendered inverse with the background box as the outer bounding box + @param bias An additional bias to be applied (happens before inversion, can be negative) + @param char_spacing Additional space between characters (in micron units) + @param line_spacing Additional space between lines (in micron units) + Various options can be specified to control the appearance of the text. See the description of the parameters. It's important to specify the target database unit in \target_dbu to indicate what database unit shall be used to create the output for. + """ + def width(self) -> int: + r""" + @brief Gets the design height of the glyphs in the generator's database units + The width is the width of the rectangle occupied by each character. A version that delivers this value in micrometer units is \dwidth. + """ + class NetlistObject: r""" @brief The base class for some netlist objects. @@ -15459,6 +39812,11 @@ class NetlistObject: This class has been introduced in version 0.26.2 """ + @classmethod + def new(cls) -> NetlistObject: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> NetlistObject: r""" @brief Creates a copy of self @@ -15508,10 +39866,33 @@ class NetlistObject: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> NetlistObject: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def property(self, key: Any) -> Any: r""" @brief Gets the property value for the given key or nil if there is no value with this key. @@ -15603,16 +39984,27 @@ class DeviceReconnectedTerminal: """ device_index: int r""" + Getter: @brief The device abstract index getter. - See the class description for details.@brief The device abstract index setter. + See the class description for details. + Setter: + @brief The device abstract index setter. See the class description for details. """ other_terminal_id: int r""" + Getter: @brief The getter for the abstract's connected terminal. - See the class description for details.@brief The setter for the abstract's connected terminal. + See the class description for details. + Setter: + @brief The setter for the abstract's connected terminal. See the class description for details. """ + @classmethod + def new(cls) -> DeviceReconnectedTerminal: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> DeviceReconnectedTerminal: r""" @brief Creates a copy of self @@ -15662,10 +40054,33 @@ class DeviceReconnectedTerminal: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> DeviceReconnectedTerminal: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class DeviceAbstractRef: r""" @@ -15676,16 +40091,27 @@ class DeviceAbstractRef: """ device_abstract: DeviceAbstract r""" + Getter: @brief The getter for the device abstract reference. - See the class description for details.@brief The setter for the device abstract reference. + See the class description for details. + Setter: + @brief The setter for the device abstract reference. See the class description for details. """ trans: DCplxTrans r""" + Getter: @brief The getter for the relative transformation of the instance. - See the class description for details.@brief The setter for the relative transformation of the instance. + See the class description for details. + Setter: + @brief The setter for the relative transformation of the instance. See the class description for details. """ + @classmethod + def new(cls) -> DeviceAbstractRef: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> DeviceAbstractRef: r""" @brief Creates a copy of self @@ -15735,10 +40161,33 @@ class DeviceAbstractRef: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> DeviceAbstractRef: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class Device(NetlistObject): r""" @@ -15755,21 +40204,30 @@ class Device(NetlistObject): """ device_abstract: DeviceAbstract r""" + Getter: @brief Gets the device abstract for this device instance. See \DeviceAbstract for more details. + + Setter: @hide Provided for test purposes mainly. Be careful with pointers! """ name: str r""" + Getter: @brief Gets the name of the device. + + Setter: @brief Sets the name of the device. Device names are used to name a device inside a netlist file. Device names should be unique within a circuit. """ trans: DCplxTrans r""" + Getter: @brief Gets the location of the device. - See \trans= for details about this method.@brief Sets the location of the device. + See \trans= for details about this method. + Setter: + @brief Sets the location of the device. The device location is essentially describing the position of the device. The position is typically the center of some recognition shape. In this case the transformation is a plain displacement to the center of this shape. """ def _assign(self, other: NetlistObject) -> None: @@ -15827,10 +40285,18 @@ class Device(NetlistObject): @hide Provided for test purposes mainly. """ + @overload def circuit(self) -> Circuit: r""" @brief Gets the circuit the device lives in. """ + @overload + def circuit(self) -> Circuit: + r""" + @brief Gets the circuit the device lives in (non-const version). + + This constness variant has been introduced in version 0.26.8 + """ def clear_combined_abstracts(self) -> None: r""" @hide @@ -15904,6 +40370,14 @@ class Device(NetlistObject): If the terminal is not connected, nil is returned for the net. """ @overload + def net_for_terminal(self, terminal_id: int) -> Net: + r""" + @brief Gets the net connected to the specified terminal (non-const version). + If the terminal is not connected, nil is returned for the net. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def net_for_terminal(self, terminal_name: str) -> Net: r""" @brief Gets the net connected to the specified terminal. @@ -15912,6 +40386,14 @@ class Device(NetlistObject): This convenience method has been introduced in version 0.27.3. """ @overload + def net_for_terminal(self, terminal_name: str) -> Net: + r""" + @brief Gets the net connected to the specified terminal (non-const version). + If the terminal is not connected, nil is returned for the net. + + This convenience method has been introduced in version 0.27.3. + """ + @overload def parameter(self, param_id: int) -> float: r""" @brief Gets the parameter value for the given parameter ID. @@ -15943,10 +40425,18 @@ class DeviceAbstract: """ name: str r""" + Getter: @brief Gets the name of the device abstract. + + Setter: @brief Sets the name of the device abstract. Device names are used to name a device abstract inside a netlist file. Device names should be unique within a netlist. """ + @classmethod + def new(cls) -> DeviceAbstract: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> DeviceAbstract: r""" @brief Creates a copy of self @@ -16006,6 +40496,23 @@ class DeviceAbstract: @brief Gets the cluster ID for the given terminal. The cluster ID links the terminal to geometrical shapes within the clusters of the cell (see \cell_index) """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def device_class(self) -> DeviceClass: r""" @brief Gets the device class of the device. @@ -16014,10 +40521,24 @@ class DeviceAbstract: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + @overload def netlist(self) -> Netlist: r""" @brief Gets the netlist the device abstract lives in. """ + @overload + def netlist(self) -> Netlist: + r""" + @brief Gets the netlist the device abstract lives in (non-const version). + + This constness variant has been introduced in version 0.26.8 + """ class SubCircuit(NetlistObject): r""" @@ -16032,17 +40553,23 @@ class SubCircuit(NetlistObject): """ name: str r""" + Getter: @brief Gets the name of the subcircuit. + + Setter: @brief Sets the name of the subcircuit. SubCircuit names are used to name a subcircuits inside a netlist file. SubCircuit names should be unique within a circuit. """ trans: DCplxTrans r""" + Getter: @brief Gets the physical transformation for the subcircuit. This property applies to subcircuits derived from a layout. It specifies the placement of the respective cell. - This property has been introduced in version 0.27.@brief Sets the physical transformation for the subcircuit. + This property has been introduced in version 0.27. + Setter: + @brief Sets the physical transformation for the subcircuit. See \trans for details about this property. @@ -16093,16 +40620,34 @@ class SubCircuit(NetlistObject): Usually it's not required to call this method. It has been introduced in version 0.24. """ + @overload + def circuit(self) -> Circuit: + r""" + @brief Gets the circuit the subcircuit lives in (non-const version). + This is NOT the circuit which is referenced. For getting the circuit that the subcircuit references, use \circuit_ref. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def circuit(self) -> Circuit: r""" @brief Gets the circuit the subcircuit lives in. This is NOT the circuit which is referenced. For getting the circuit that the subcircuit references, use \circuit_ref. """ + @overload def circuit_ref(self) -> Circuit: r""" @brief Gets the circuit referenced by the subcircuit. """ @overload + def circuit_ref(self) -> Circuit: + r""" + @brief Gets the circuit referenced by the subcircuit (non-const version). + + + This constness variant has been introduced in version 0.26.8 + """ + @overload def connect_pin(self, pin: Pin, net: Net) -> None: r""" @brief Connects the given pin to the specified net. @@ -16136,6 +40681,15 @@ class SubCircuit(NetlistObject): It can be used to retrieve the subcircuit from the circuit using \Circuit#subcircuit_by_id. When assigned, the subcircuit ID is not 0. """ + @overload + def net_for_pin(self, pin_id: int) -> Net: + r""" + @brief Gets the net connected to the specified pin of the subcircuit (non-const version). + If the pin is not connected, nil is returned for the net. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def net_for_pin(self, pin_id: int) -> Net: r""" @brief Gets the net connected to the specified pin of the subcircuit. @@ -16149,6 +40703,11 @@ class NetTerminalRef: This class has been added in version 0.26. """ + @classmethod + def new(cls) -> NetTerminalRef: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> NetTerminalRef: r""" @brief Creates a copy of self @@ -16198,6 +40757,32 @@ class NetTerminalRef: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + @overload + def device(self) -> Device: + r""" + @brief Gets the device reference (non-const version). + Gets the device object that this connection is made to. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def device(self) -> Device: r""" @brief Gets the device reference. @@ -16211,6 +40796,20 @@ class NetTerminalRef: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + @overload + def net(self) -> Net: + r""" + @brief Gets the net this terminal reference is attached to (non-const version). + + This constness variant has been introduced in version 0.26.8 + """ + @overload def net(self) -> Net: r""" @brief Gets the net this terminal reference is attached to. @@ -16231,6 +40830,11 @@ class NetPinRef: This class has been added in version 0.26. """ + @classmethod + def new(cls) -> NetPinRef: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> NetPinRef: r""" @brief Creates a copy of self @@ -16280,14 +40884,45 @@ class NetPinRef: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> NetPinRef: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + @overload def net(self) -> Net: r""" @brief Gets the net this pin reference is attached to. """ + @overload + def net(self) -> Net: + r""" + @brief Gets the net this pin reference is attached to (non-const version). + + This constness variant has been introduced in version 0.26.8 + """ def pin(self) -> Pin: r""" @brief Gets the \Pin object of the pin the connection is made to. @@ -16304,6 +40939,11 @@ class NetSubcircuitPinRef: This class has been added in version 0.26. """ + @classmethod + def new(cls) -> NetSubcircuitPinRef: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> NetSubcircuitPinRef: r""" @brief Creates a copy of self @@ -16353,14 +40993,45 @@ class NetSubcircuitPinRef: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> NetSubcircuitPinRef: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + @overload def net(self) -> Net: r""" @brief Gets the net this pin reference is attached to. """ + @overload + def net(self) -> Net: + r""" + @brief Gets the net this pin reference is attached to (non-const version). + + This constness variant has been introduced in version 0.26.8 + """ def pin(self) -> Pin: r""" @brief Gets the \Pin object of the pin the connection is made to. @@ -16369,11 +41040,20 @@ class NetSubcircuitPinRef: r""" @brief Gets the ID of the pin the connection is made to. """ + @overload def subcircuit(self) -> SubCircuit: r""" @brief Gets the subcircuit reference. This attribute indicates the subcircuit the net attaches to. The subcircuit lives in the same circuit than the net. """ + @overload + def subcircuit(self) -> SubCircuit: + r""" + @brief Gets the subcircuit reference (non-const version). + This attribute indicates the subcircuit the net attaches to. The subcircuit lives in the same circuit than the net. + + This constness variant has been introduced in version 0.26.8 + """ class Net(NetlistObject): r""" @@ -16388,26 +41068,24 @@ class Net(NetlistObject): """ cluster_id: int r""" + Getter: @brief Gets the cluster ID of the net. - See \cluster_id= for details about the cluster ID.@brief Sets the cluster ID of the net. + See \cluster_id= for details about the cluster ID. + Setter: + @brief Sets the cluster ID of the net. The cluster ID connects the net with a layout cluster. It is set when the net is extracted from a layout. """ name: str r""" + Getter: @brief Gets the name of the net. - See \name= for details about the name.@brief Sets the name of the net. + See \name= for details about the name. + Setter: + @brief Sets the name of the net. The name of the net is used for naming the net in schematic files for example. The name of the net has to be unique. """ - def __repr__(self) -> str: - r""" - Note: This is an alias of 'qname'. - @brief Gets the qualified name. - The qualified name is like the expanded name, but the circuit's name is preceded - (i.e. 'CIRCUIT:NET') if available. - """ def __str__(self) -> str: r""" - Note: This is an alias of 'qname'. @brief Gets the qualified name. The qualified name is like the expanded name, but the circuit's name is preceded (i.e. 'CIRCUIT:NET') if available. @@ -16465,21 +41143,48 @@ class Net(NetlistObject): r""" @brief Clears the net. """ + @overload def each_pin(self) -> Iterator[NetPinRef]: r""" @brief Iterates over all outgoing pins the net connects. Pin connections are described by \NetPinRef objects. Pin connections are connections to outgoing pins of the circuit the net lives in. """ + @overload + def each_pin(self) -> Iterator[NetPinRef]: + r""" + @brief Iterates over all outgoing pins the net connects (non-const version). + Pin connections are described by \NetPinRef objects. Pin connections are connections to outgoing pins of the circuit the net lives in. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def each_subcircuit_pin(self) -> Iterator[NetSubcircuitPinRef]: r""" @brief Iterates over all subcircuit pins the net connects. Subcircuit pin connections are described by \NetSubcircuitPinRef objects. These are connections to specific pins of subcircuits. """ + @overload + def each_subcircuit_pin(self) -> Iterator[NetSubcircuitPinRef]: + r""" + @brief Iterates over all subcircuit pins the net connects (non-const version). + Subcircuit pin connections are described by \NetSubcircuitPinRef objects. These are connections to specific pins of subcircuits. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def each_terminal(self) -> Iterator[NetTerminalRef]: r""" @brief Iterates over all terminals the net connects. Terminals connect devices. Terminal connections are described by \NetTerminalRef objects. """ + @overload + def each_terminal(self) -> Iterator[NetTerminalRef]: + r""" + @brief Iterates over all terminals the net connects (non-const version). + Terminals connect devices. Terminal connections are described by \NetTerminalRef objects. + + This constness variant has been introduced in version 0.26.8 + """ def expanded_name(self) -> str: r""" @brief Gets the expanded name of the net. @@ -16523,7 +41228,6 @@ class Net(NetlistObject): """ def to_s(self) -> str: r""" - Note: This is an alias of 'qname'. @brief Gets the qualified name. The qualified name is like the expanded name, but the circuit's name is preceded (i.e. 'CIRCUIT:NET') if available. @@ -16538,12 +41242,23 @@ class DeviceTerminalDefinition: """ description: str r""" - @brief Gets the description of the terminal.@brief Sets the description of the terminal. + Getter: + @brief Gets the description of the terminal. + Setter: + @brief Sets the description of the terminal. """ name: str r""" - @brief Gets the name of the terminal.@brief Sets the name of the terminal. + Getter: + @brief Gets the name of the terminal. + Setter: + @brief Sets the name of the terminal. """ + @classmethod + def new(cls, name: str, description: Optional[str] = ...) -> DeviceTerminalDefinition: + r""" + @brief Creates a new terminal definition. + """ def __copy__(self) -> DeviceTerminalDefinition: r""" @brief Creates a copy of self @@ -16593,6 +41308,23 @@ class DeviceTerminalDefinition: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> DeviceTerminalDefinition: r""" @brief Creates a copy of self @@ -16602,6 +41334,12 @@ class DeviceTerminalDefinition: @brief Gets the ID of the terminal. The ID of the terminal is used in some places to refer to a specific terminal (e.g. in the \NetTerminalRef object). """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class DeviceParameterDefinition: r""" @@ -16612,24 +41350,46 @@ class DeviceParameterDefinition: """ default_value: float r""" - @brief Gets the default value of the parameter.@brief Sets the default value of the parameter. + Getter: + @brief Gets the default value of the parameter. + Setter: + @brief Sets the default value of the parameter. The default value is used to initialize parameters of \Device objects. """ description: str r""" - @brief Gets the description of the parameter.@brief Sets the description of the parameter. + Getter: + @brief Gets the description of the parameter. + Setter: + @brief Sets the description of the parameter. """ is_primary: bool r""" + Getter: @brief Gets a value indicating whether the parameter is a primary parameter - See \is_primary= for details about this predicate.@brief Sets a value indicating whether the parameter is a primary parameter + See \is_primary= for details about this predicate. + Setter: + @brief Sets a value indicating whether the parameter is a primary parameter If this flag is set to true (the default), the parameter is considered a primary parameter. Only primary parameters are compared by default. """ name: str r""" - @brief Gets the name of the parameter.@brief Sets the name of the parameter. + Getter: + @brief Gets the name of the parameter. + Setter: + @brief Sets the name of the parameter. """ + @classmethod + def new(cls, name: str, description: Optional[str] = ..., default_value: Optional[float] = ..., is_primary: Optional[bool] = ..., si_scaling: Optional[float] = ...) -> DeviceParameterDefinition: + r""" + @brief Creates a new parameter definition. + @param name The name of the parameter + @param description The human-readable description + @param default_value The initial value + @param is_primary True, if the parameter is a primary parameter (see \is_primary=) + @param si_scaling The scaling factor to SI units + """ def __copy__(self) -> DeviceParameterDefinition: r""" @brief Creates a copy of self @@ -16684,6 +41444,23 @@ class DeviceParameterDefinition: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> DeviceParameterDefinition: r""" @brief Creates a copy of self @@ -16693,6 +41470,12 @@ class DeviceParameterDefinition: @brief Gets the ID of the parameter. The ID of the parameter is used in some places to refer to a specific parameter (e.g. in the \NetParameterRef object). """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def si_scaling(self) -> float: r""" @brief Gets the scaling factor to SI units. @@ -16726,6 +41509,16 @@ class EqualDeviceParameters: This constructor has been introduced in version 0.27.4. """ + @classmethod + def new(cls, param_id: int, absolute: Optional[float] = ..., relative: Optional[float] = ...) -> EqualDeviceParameters: + r""" + @brief Creates a device parameter comparer for a single parameter. + 'absolute' is the absolute deviation allowed for the parameter values. 'relative' is the relative deviation allowed for the parameter values (a value between 0 and 1). + + A value of 0 for both absolute and relative deviation means the parameters have to match exactly. + + If 'absolute' and 'relative' are both given, their deviations will add to the allowed difference between two parameter values. The relative deviation will be applied to the mean value of both parameter values. For example, when comparing parameter values of 40 and 60, a relative deviation of 0.35 means an absolute deviation of 17.5 (= 0.35 * average of 40 and 60) which does not make both values match. + """ def __add__(self, other: EqualDeviceParameters) -> EqualDeviceParameters: r""" @brief Combines two parameters for comparison. @@ -16790,10 +41583,33 @@ class EqualDeviceParameters: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> EqualDeviceParameters: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def to_string(self) -> str: r""" @hide @@ -16854,10 +41670,6 @@ class GenericDeviceParameterCompare(EqualDeviceParameters): Usually it's not required to call this method. It has been introduced in version 0.24. """ - def less(self, device_a: Device, device_b: Device) -> bool: - r""" - @brief Compares the parameters of two devices for a begin less than b. Returns true, if the parameters of device a are considered less than those of device b.The 'less' implementation needs to ensure strict weak ordering. Specifically, less(a,b) == false and less(b,a) implies that a is equal to b and less(a,b) == true implies that less(b,a) is false and vice versa. If not, an internal error will be encountered on netlist compare. - """ class GenericDeviceCombiner: r""" @@ -16869,6 +41681,11 @@ class GenericDeviceCombiner: This class has been added in version 0.27.3. """ + @classmethod + def new(cls) -> GenericDeviceCombiner: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> GenericDeviceCombiner: r""" @brief Creates a copy of self @@ -16918,15 +41735,33 @@ class GenericDeviceCombiner: r""" @brief Assigns another object to self """ - def combine_devices(self, device_a: Device, device_b: Device) -> bool: + def create(self) -> None: r""" - @brief Combines two devices if possible. - This method needs to test, whether the two devices can be combined. Both devices are guaranteed to share the same device class. If they cannot be combined, this method shall do nothing and return false. If they can be combined, this method shall reconnect the nets of the first device and entirely disconnect the nets of the second device. The second device will be deleted afterwards. + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ def dup(self) -> GenericDeviceCombiner: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class DeviceClass: r""" @@ -16939,9 +41774,12 @@ class DeviceClass: """ combiner: GenericDeviceCombiner r""" + Getter: @brief Gets a device combiner or nil if none is registered. This method has been added in version 0.27.3. + + Setter: @brief Specifies a device combiner (parallel or serial device combination). You can assign nil for the combiner to remove it. @@ -16952,14 +41790,20 @@ class DeviceClass: """ description: str r""" - @brief Gets the description text of the device class.@brief Sets the description of the device class. + Getter: + @brief Gets the description text of the device class. + Setter: + @brief Sets the description of the device class. """ equal_parameters: EqualDeviceParameters r""" + Getter: @brief Gets the device parameter comparer for netlist verification or nil if no comparer is registered. See \equal_parameters= for the setter. This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. + + Setter: @brief Specifies a device parameter comparer for netlist verification. By default, all devices are compared with all parameters. If you want to select only certain parameters for comparison or use a fuzzy compare criterion, use an \EqualDeviceParameters object and assign it to the device class of one netlist. You can also chain multiple \EqualDeviceParameters objects with the '+' operator for specifying multiple parameters in the equality check. @@ -16971,34 +41815,47 @@ class DeviceClass: """ name: str r""" - @brief Gets the name of the device class.@brief Sets the name of the device class. + Getter: + @brief Gets the name of the device class. + Setter: + @brief Sets the name of the device class. """ strict: bool r""" + Getter: @brief Gets a value indicating whether this class performs strict terminal mapping - See \strict= for details about this attribute.@brief Sets a value indicating whether this class performs strict terminal mapping + See \strict= for details about this attribute. + Setter: + @brief Sets a value indicating whether this class performs strict terminal mapping Classes with this flag set never allow terminal swapping, even if the device symmetry supports that. If two classes are involved in a netlist compare, terminal swapping will be disabled if one of the classes is in strict mode. By default, device classes are not strict and terminal swapping is allowed as far as the device symmetry supports that. """ - supports_parallel_combination: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Specifies whether the device supports parallel device combination. - Parallel device combination means that all terminals of two combination candidates are connected to the same nets. If the device does not support this combination mode, this predicate can be set to false. This will make the device extractor skip the combination test in parallel mode and improve performance somewhat. + @property + def supports_parallel_combination(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Specifies whether the device supports parallel device combination. + Parallel device combination means that all terminals of two combination candidates are connected to the same nets. If the device does not support this combination mode, this predicate can be set to false. This will make the device extractor skip the combination test in parallel mode and improve performance somewhat. - This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. - """ - supports_serial_combination: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Specifies whether the device supports serial device combination. - Serial device combination means that the devices are connected by internal nodes. If the device does not support this combination mode, this predicate can be set to false. This will make the device extractor skip the combination test in serial mode and improve performance somewhat. + This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. + """ + @property + def supports_serial_combination(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Specifies whether the device supports serial device combination. + Serial device combination means that the devices are connected by internal nodes. If the device does not support this combination mode, this predicate can be set to false. This will make the device extractor skip the combination test in serial mode and improve performance somewhat. - This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. - """ + This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. + """ + @classmethod + def new(cls) -> DeviceClass: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> DeviceClass: r""" @brief Creates a copy of self @@ -17083,6 +41940,23 @@ class DeviceClass: This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> DeviceClass: r""" @brief Creates a copy of self @@ -17127,6 +42001,12 @@ class DeviceClass: @brief Gets the unique ID of the device class The ID is a unique integer that identifies the device class. Use the ID to check for object identity - i.e. to determine whether two devices share the same device class. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def netlist(self) -> Netlist: r""" @brief Gets the netlist the device class lives in. @@ -17190,25 +42070,37 @@ class Circuit(NetlistObject): """ boundary: DPolygon r""" - @brief Gets the boundary of the circuit@brief Sets the boundary of the circuit + Getter: + @brief Gets the boundary of the circuit + Setter: + @brief Sets the boundary of the circuit """ cell_index: int r""" + Getter: @brief Gets the cell index of the circuit See \cell_index= for details. + + Setter: @brief Sets the cell index The cell index relates a circuit with a cell from a layout. It's intended to hold a cell index number if the netlist was extracted from a layout. """ dont_purge: bool r""" + Getter: @brief Gets a value indicating whether the circuit can be purged on \Netlist#purge. + + Setter: @brief Sets a value indicating whether the circuit can be purged on \Netlist#purge. If this attribute is set to true, \Netlist#purge will never delete this circuit. This flag therefore marks this circuit as 'precious'. """ name: str r""" - @brief Gets the name of the circuit@brief Sets the name of the circuit + Getter: + @brief Gets the name of the circuit + Setter: + @brief Sets the name of the circuit """ def _assign(self, other: NetlistObject) -> None: r""" @@ -17311,17 +42203,35 @@ class Circuit(NetlistObject): For more details see the \SubCircuit class. """ + @overload def device_by_id(self, id: int) -> Device: r""" @brief Gets the device object for a given ID. If the ID is not a valid device ID, nil is returned. """ + @overload + def device_by_id(self, id: int) -> Device: + r""" + @brief Gets the device object for a given ID (const version). + If the ID is not a valid device ID, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def device_by_name(self, name: str) -> Device: r""" @brief Gets the device object for a given name. If the ID is not a valid device name, nil is returned. """ @overload + def device_by_name(self, name: str) -> Device: + r""" + @brief Gets the device object for a given name (const version). + If the ID is not a valid device name, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def disconnect_pin(self, pin: Pin) -> None: r""" @brief Disconnects the given pin from any net. @@ -17331,36 +42241,95 @@ class Circuit(NetlistObject): r""" @brief Disconnects the given pin from any net. """ + @overload def each_child(self) -> Iterator[Circuit]: r""" @brief Iterates over the child circuits of this circuit Child circuits are the ones that are referenced from this circuit via subcircuits. """ + @overload + def each_child(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the child circuits of this circuit (const version) + Child circuits are the ones that are referenced from this circuit via subcircuits. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def each_device(self) -> Iterator[Device]: r""" @brief Iterates over the devices of the circuit """ + @overload + def each_device(self) -> Iterator[Device]: + r""" + @brief Iterates over the devices of the circuit (const version) + + This constness variant has been introduced in version 0.26.8 + """ + @overload def each_net(self) -> Iterator[Net]: r""" @brief Iterates over the nets of the circuit """ + @overload + def each_net(self) -> Iterator[Net]: + r""" + @brief Iterates over the nets of the circuit (const version) + + This constness variant has been introduced in version 0.26.8 + """ + @overload def each_parent(self) -> Iterator[Circuit]: r""" @brief Iterates over the parent circuits of this circuit Child circuits are the ones that are referencing this circuit via subcircuits. """ + @overload + def each_parent(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the parent circuits of this circuit (const version) + Child circuits are the ones that are referencing this circuit via subcircuits. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def each_pin(self) -> Iterator[Pin]: r""" @brief Iterates over the pins of the circuit """ + @overload + def each_pin(self) -> Iterator[Pin]: + r""" + @brief Iterates over the pins of the circuit (const version) + + This constness variant has been introduced in version 0.26.8 + """ + @overload def each_ref(self) -> Iterator[SubCircuit]: r""" @brief Iterates over the subcircuit objects referencing this circuit """ + @overload + def each_ref(self) -> Iterator[SubCircuit]: + r""" + @brief Iterates over the subcircuit objects referencing this circuit (const version) + + + This constness variant has been introduced in version 0.26.8 + """ + @overload def each_subcircuit(self) -> Iterator[SubCircuit]: r""" @brief Iterates over the subcircuits of the circuit """ + @overload + def each_subcircuit(self) -> Iterator[SubCircuit]: + r""" + @brief Iterates over the subcircuits of the circuit (const version) + + This constness variant has been introduced in version 0.26.8 + """ def flatten_subcircuit(self, subcircuit: SubCircuit) -> None: r""" @brief Flattens a subcircuit @@ -17383,12 +42352,21 @@ class Circuit(NetlistObject): @brief Gets the net object corresponding to a specific cluster ID If the ID is not a valid pin cluster ID, nil is returned. """ + @overload def net_by_name(self, name: str) -> Net: r""" @brief Gets the net object for a given name. If the ID is not a valid net name, nil is returned. """ @overload + def net_by_name(self, name: str) -> Net: + r""" + @brief Gets the net object for a given name (const version). + If the ID is not a valid net name, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def net_for_pin(self, pin: Pin) -> Net: r""" @brief Gets the net object attached to a specific pin. @@ -17396,16 +42374,43 @@ class Circuit(NetlistObject): This method returns nil if the pin is not connected or the pin object is nil. """ @overload + def net_for_pin(self, pin: Pin) -> Net: + r""" + @brief Gets the net object attached to a specific pin (const version). + This is the net object inside the circuit which attaches to the given outward-bound pin. + This method returns nil if the pin is not connected or the pin object is nil. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def net_for_pin(self, pin_id: int) -> Net: r""" @brief Gets the net object attached to a specific pin. This is the net object inside the circuit which attaches to the given outward-bound pin. This method returns nil if the pin is not connected or the pin ID is invalid. """ + @overload + def net_for_pin(self, pin_id: int) -> Net: + r""" + @brief Gets the net object attached to a specific pin (const version). + This is the net object inside the circuit which attaches to the given outward-bound pin. + This method returns nil if the pin is not connected or the pin ID is invalid. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def netlist(self) -> Netlist: r""" @brief Gets the netlist object the circuit lives in """ + @overload + def netlist(self) -> Netlist: + r""" + @brief Gets the netlist object the circuit lives in (const version) + + This constness variant has been introduced in version 0.26.8 + """ + @overload def nets_by_name(self, name_pattern: str) -> List[Net]: r""" @brief Gets the net objects for a given name filter. @@ -17413,16 +42418,43 @@ class Circuit(NetlistObject): This method has been introduced in version 0.27.3. """ + @overload + def nets_by_name(self, name_pattern: str) -> List[Net]: + r""" + @brief Gets the net objects for a given name filter (const version). + The name filter is a glob pattern. This method will return all \Net objects matching the glob pattern. + + + This constness variant has been introduced in version 0.27.3 + """ + @overload def pin_by_id(self, id: int) -> Pin: r""" @brief Gets the \Pin object corresponding to a specific ID If the ID is not a valid pin ID, nil is returned. """ + @overload + def pin_by_id(self, id: int) -> Pin: + r""" + @brief Gets the \Pin object corresponding to a specific ID (const version) + If the ID is not a valid pin ID, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def pin_by_name(self, name: str) -> Pin: r""" @brief Gets the \Pin object corresponding to a specific name If the ID is not a valid pin name, nil is returned. """ + @overload + def pin_by_name(self, name: str) -> Pin: + r""" + @brief Gets the \Pin object corresponding to a specific name (const version) + If the ID is not a valid pin name, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ def pin_count(self) -> int: r""" @brief Gets the number of pins in the circuit @@ -17463,16 +42495,34 @@ class Circuit(NetlistObject): This method has been introduced in version 0.26.8. """ + @overload def subcircuit_by_id(self, id: int) -> SubCircuit: r""" @brief Gets the subcircuit object for a given ID. If the ID is not a valid subcircuit ID, nil is returned. """ + @overload + def subcircuit_by_id(self, id: int) -> SubCircuit: + r""" + @brief Gets the subcircuit object for a given ID (const version). + If the ID is not a valid subcircuit ID, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def subcircuit_by_name(self, name: str) -> SubCircuit: r""" @brief Gets the subcircuit object for a given name. If the ID is not a valid subcircuit name, nil is returned. """ + @overload + def subcircuit_by_name(self, name: str) -> SubCircuit: + r""" + @brief Gets the subcircuit object for a given name (const version). + If the ID is not a valid subcircuit name, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ class Netlist: r""" @@ -17484,12 +42534,21 @@ class Netlist: The netlist class has been introduced with version 0.26. """ - case_sensitive: None + case_sensitive: bool r""" - WARNING: This variable can only be set, not retrieved. + Getter: + @brief Returns a value indicating whether the netlist names are case sensitive + This method has been added in version 0.27.3. + + Setter: @brief Sets a value indicating whether the netlist names are case sensitive This method has been added in version 0.27.3. """ + @classmethod + def new(cls) -> Netlist: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> Netlist: r""" @brief Creates a copy of self @@ -17498,11 +42557,6 @@ class Netlist: r""" @brief Creates a new object of this class """ - def __repr__(self) -> str: - r""" - @brief Converts the netlist to a string representation. - This method is intended for test purposes mainly. - """ def __str__(self) -> str: r""" @brief Converts the netlist to a string representation. @@ -17569,16 +42623,35 @@ class Netlist: For more details see \Circuit#blank which is the corresponding method on the actual object. """ + @overload + def circuit_by_cell_index(self, cell_index: int) -> Circuit: + r""" + @brief Gets the circuit object for a given cell index (const version). + If the cell index is not valid or no circuit is registered with this index, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def circuit_by_cell_index(self, cell_index: int) -> Circuit: r""" @brief Gets the circuit object for a given cell index. If the cell index is not valid or no circuit is registered with this index, nil is returned. """ + @overload def circuit_by_name(self, name: str) -> Circuit: r""" @brief Gets the circuit object for a given name. If the name is not a valid circuit name, nil is returned. """ + @overload + def circuit_by_name(self, name: str) -> Circuit: + r""" + @brief Gets the circuit object for a given name (const version). + If the name is not a valid circuit name, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def circuits_by_name(self, name_pattern: str) -> List[Circuit]: r""" @brief Gets the circuit objects for a given name filter. @@ -17586,12 +42659,47 @@ class Netlist: This method has been introduced in version 0.26.4. """ + @overload + def circuits_by_name(self, name_pattern: str) -> List[Circuit]: + r""" + @brief Gets the circuit objects for a given name filter (const version). + The name filter is a glob pattern. This method will return all \Circuit objects matching the glob pattern. + + + This constness variant has been introduced in version 0.26.8 + """ def combine_devices(self) -> None: r""" @brief Combines devices where possible This method will combine devices that can be combined according to their device classes 'combine_devices' method. For example, serial or parallel resistors can be combined into a single resistor. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + @overload + def device_class_by_name(self, name: str) -> DeviceClass: + r""" + @brief Gets the device class for a given name (const version). + If the name is not a valid device class name, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def device_class_by_name(self, name: str) -> DeviceClass: r""" @brief Gets the device class for a given name. @@ -17601,24 +42709,58 @@ class Netlist: r""" @brief Creates a copy of self """ + @overload + def each_circuit(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the circuits of the netlist (const version) + + This constness variant has been introduced in version 0.26.8 + """ + @overload def each_circuit(self) -> Iterator[Circuit]: r""" @brief Iterates over the circuits of the netlist """ + @overload def each_circuit_bottom_up(self) -> Iterator[Circuit]: r""" @brief Iterates over the circuits bottom-up Iterating bottom-up means the parent circuits come after the child circuits. This is the basically the reverse order as delivered by \each_circuit_top_down. """ + @overload + def each_circuit_bottom_up(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the circuits bottom-up (const version) + Iterating bottom-up means the parent circuits come after the child circuits. This is the basically the reverse order as delivered by \each_circuit_top_down. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def each_circuit_top_down(self) -> Iterator[Circuit]: r""" @brief Iterates over the circuits top-down Iterating top-down means the parent circuits come before the child circuits. The first \top_circuit_count circuits are top circuits - i.e. those which are not referenced by other circuits. """ + @overload + def each_circuit_top_down(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the circuits top-down (const version) + Iterating top-down means the parent circuits come before the child circuits. The first \top_circuit_count circuits are top circuits - i.e. those which are not referenced by other circuits. + + This constness variant has been introduced in version 0.26.8 + """ + @overload def each_device_class(self) -> Iterator[DeviceClass]: r""" @brief Iterates over the device classes of the netlist """ + @overload + def each_device_class(self) -> Iterator[DeviceClass]: + r""" + @brief Iterates over the device classes of the netlist (const version) + + This constness variant has been introduced in version 0.26.8 + """ def flatten(self) -> None: r""" @brief Flattens all circuits of the netlist @@ -17653,6 +42795,12 @@ class Netlist: @brief Returns a value indicating whether the netlist names are case sensitive This method has been added in version 0.27.3. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def make_top_level_pins(self) -> None: r""" @brief Creates pins for top-level circuits. @@ -17721,6 +42869,11 @@ class NetlistSpiceWriterDelegate: This class has been introduced in version 0.26. """ + @classmethod + def new(cls) -> NetlistSpiceWriterDelegate: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> NetlistSpiceWriterDelegate: r""" @brief Creates a copy of self @@ -17770,6 +42923,23 @@ class NetlistSpiceWriterDelegate: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> NetlistSpiceWriterDelegate: r""" @brief Creates a copy of self @@ -17786,6 +42956,12 @@ class NetlistSpiceWriterDelegate: r""" @brief Formats the given name in a SPICE-compatible way """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def net_to_string(self, net: Net) -> str: r""" @brief Gets the node ID for the given net @@ -17795,17 +42971,10 @@ class NetlistSpiceWriterDelegate: r""" @hide """ - @overload def write_device_intro(self, arg0: DeviceClass) -> None: r""" @hide """ - @overload - def write_device_intro(self, device_class: DeviceClass) -> None: - r""" - @brief Inserts a text for the given device class - Reimplement this method to insert your own text at the beginning of the file for the given device class - """ def write_header(self) -> None: r""" @hide @@ -17818,6 +42987,11 @@ class NetlistWriter: This class has been introduced in version 0.26. """ + @classmethod + def new(cls) -> NetlistWriter: + r""" + @brief Creates a new object of this class + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -17859,6 +43033,29 @@ class NetlistWriter: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class NetlistSpiceWriter(NetlistWriter): r""" @@ -17926,16 +43123,34 @@ class NetlistSpiceWriter(NetlistWriter): """ use_net_names: bool r""" + Getter: @brief Gets a value indicating whether to use net names (true) or net numbers (false). + + Setter: @brief Sets a value indicating whether to use net names (true) or net numbers (false). The default is to use net numbers. """ with_comments: bool r""" + Getter: @brief Gets a value indicating whether to embed comments for position etc. (true) or not (false). + + Setter: @brief Sets a value indicating whether to embed comments for position etc. (true) or not (false). The default is to embed comments. """ + @overload + @classmethod + def new(cls) -> NetlistSpiceWriter: + r""" + @brief Creates a new writer without delegate. + """ + @overload + @classmethod + def new(cls, arg0: NetlistSpiceWriterDelegate) -> NetlistSpiceWriter: + r""" + @brief Creates a new writer with a delegate. + """ def __copy__(self) -> NetlistSpiceWriter: r""" @brief Creates a copy of self @@ -18003,6 +43218,11 @@ class NetlistReader: This class has been introduced in version 0.26. """ + @classmethod + def new(cls) -> NetlistReader: + r""" + @brief Creates a new object of this class + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -18044,6 +43264,29 @@ class NetlistReader: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class ParseElementComponentsData: r""" @@ -18054,14 +43297,25 @@ class ParseElementComponentsData: """ parameters: Dict[str, float] r""" + Getter: @brief Gets the (named) numerical parameters + + Setter: @brief Sets the (named) numerical parameters """ strings: List[str] r""" + Getter: @brief Gets the string parameters + + Setter: @brief Sets the string parameters """ + @classmethod + def new(cls) -> ParseElementComponentsData: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> ParseElementComponentsData: r""" @brief Creates a copy of self @@ -18111,10 +43365,33 @@ class ParseElementComponentsData: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> ParseElementComponentsData: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class ParseElementData: r""" @@ -18125,24 +43402,41 @@ class ParseElementData: """ model_name: str r""" + Getter: @brief Gets the model name + + Setter: @brief Sets the model name """ net_names: List[str] r""" + Getter: @brief Gets the net names + + Setter: @brief Sets the net names """ parameters: Dict[str, float] r""" + Getter: @brief Gets the (named) numerical parameters + + Setter: @brief Sets the (named) numerical parameters """ value: float r""" + Getter: @brief Gets the value + + Setter: @brief Sets the value """ + @classmethod + def new(cls) -> ParseElementData: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> ParseElementData: r""" @brief Creates a copy of self @@ -18192,10 +43486,33 @@ class ParseElementData: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> ParseElementData: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class NetlistSpiceReaderDelegate: r""" @@ -18206,6 +43523,11 @@ class NetlistSpiceReaderDelegate: This class has been introduced in version 0.26. """ + @classmethod + def new(cls) -> NetlistSpiceReaderDelegate: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> NetlistSpiceReaderDelegate: r""" @brief Creates a copy of self @@ -18255,80 +43577,54 @@ class NetlistSpiceReaderDelegate: r""" @brief Assigns another object to self """ - @overload def control_statement(self, arg0: str) -> bool: r""" @hide """ - @overload - def control_statement(self, line: str) -> bool: + def create(self) -> None: r""" - @brief Receives control statements not understood by the standard reader - When the reader encounters a control statement not understood by the parser, it will pass the line to the delegate using this method. - The delegate can decide if it wants to read this statement. It should return true in this case. - - This method has been introduced in version 0.27.1 + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ def dup(self) -> NetlistSpiceReaderDelegate: r""" @brief Creates a copy of self """ - @overload def element(self, arg0: Circuit, arg1: str, arg2: str, arg3: str, arg4: float, arg5: Sequence[Net], arg6: Dict[str, float]) -> bool: r""" @hide """ - @overload - def element(self, circuit: Circuit, element: str, name: str, model: str, value: float, nets: Sequence[Net], parameters: Dict[str, float]) -> bool: - r""" - @brief Makes a device from an element line - @param circuit The circuit that is currently read. - @param element The upper-case element code ("M", "R", ...). - @param name The element's name. - @param model The upper-case model name (may be empty). - @param value The default value (e.g. resistance for resistors) and may be zero. - @param nets The nets given in the element line. - @param parameters The parameters of the element statement (parameter names are upper case). - - The default implementation will create corresponding devices for - some known elements using the Spice writer's parameter conventions. - - The method must return true, if the element was was understood and false otherwise. - """ def error(self, msg: str) -> None: r""" @brief Issues an error with the given message. Use this method to generate an error. """ - @overload def finish(self, arg0: Netlist) -> None: r""" @hide """ - @overload - def finish(self, netlist: Netlist) -> None: + def is_const_object(self) -> bool: r""" - @brief This method is called when the reader is done reading a netlist successfully + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. """ - @overload def parse_element(self, arg0: str, arg1: str) -> ParseElementData: r""" @hide """ - @overload - def parse_element(self, s: str, element: str) -> ParseElementData: - r""" - @brief Parses an element card - @param s The specification part of the element line (the part after element code and name). - @param element The upper-case element code ("M", "R", ...). - @return A \ParseElementData object with the parts of the element. - - This method receives a string with the element specification and the element code. It is supposed to parse the element line and return a model name, a value, a list of net names and a parameter value dictionary. - - 'parse_element' is called on every element card. The results of this call go into the \element method to actually create the device. This method can be reimplemented to support other flavors of SPICE. - - This method has been introduced in version 0.27.1 - """ def parse_element_components(self, s: str) -> ParseElementComponentsData: r""" @brief Parses a string into string and parameter components. @@ -18337,31 +43633,14 @@ class NetlistSpiceReaderDelegate: This method has been introduced in version 0.27.1 """ - @overload def start(self, arg0: Netlist) -> None: r""" @hide """ - @overload - def start(self, netlist: Netlist) -> None: - r""" - @brief This method is called when the reader starts reading a netlist - """ - @overload def translate_net_name(self, arg0: str) -> str: r""" @hide """ - @overload - def translate_net_name(self, net_name: str) -> str: - r""" - @brief Translates a net name from the raw net name to the true net name - The default implementation will replace backslash sequences by the corresponding character. - 'translate_net_name' is called before a net name is turned into a net object. - The method can be reimplemented to supply a different translation scheme for net names. For example, to translate special characters. - - This method has been introduced in version 0.27.1 - """ def value_from_string(self, s: str) -> Any: r""" @brief Translates a string into a value @@ -18369,17 +43648,10 @@ class NetlistSpiceReaderDelegate: This method has been introduced in version 0.27.1 """ - @overload def wants_subcircuit(self, arg0: str) -> bool: r""" @hide """ - @overload - def wants_subcircuit(self, circuit_name: str) -> bool: - r""" - @brief Returns true, if the delegate wants subcircuit elements with this name - The name is always upper case. - """ class NetlistSpiceReader(NetlistReader): r""" @@ -18387,7 +43659,7 @@ class NetlistSpiceReader(NetlistReader): Use the SPICE reader like this: @code - writer = RBA::NetlistSpiceReader::new + reader = RBA::NetlistSpiceReader::new netlist = RBA::Netlist::new netlist.read(path, reader) @/code @@ -18465,6 +43737,18 @@ class NetlistSpiceReader(NetlistReader): This class has been introduced in version 0.26. It has been extended in version 0.27.1. """ @overload + @classmethod + def new(cls) -> NetlistSpiceReader: + r""" + @brief Creates a new reader. + """ + @overload + @classmethod + def new(cls, delegate: NetlistSpiceReaderDelegate) -> NetlistSpiceReader: + r""" + @brief Creates a new reader with a delegate. + """ + @overload def __init__(self) -> None: r""" @brief Creates a new reader. @@ -18512,817 +43796,6 @@ class NetlistSpiceReader(NetlistReader): Usually it's not required to call this method. It has been introduced in version 0.24. """ -class NetlistCompareLogger: - r""" - @brief A base class for netlist comparer event receivers - See \GenericNetlistCompareLogger for custom implementations of such receivers. - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class GenericNetlistCompareLogger(NetlistCompareLogger): - r""" - @brief An event receiver for the netlist compare feature. - The \NetlistComparer class will send compare events to a logger derived from this class. Use this class to implement your own logger class. You can override on of it's methods to receive certain kind of events. - This class has been introduced in version 0.26. - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def begin_circuit(self, a: Circuit, b: Circuit) -> None: - r""" - @brief This function is called when a new circuit is compared. - This compare procedure will run the netlist compare circuit vs. circuit in a bottom-up fashion. - Before each circuit is compared, this method is called once with the circuits that are about to be compared. - After the circuit has been compared, \end_circuit will be called. - - In some cases, the compare algorithm will decide that circuits can't be compared. This happens if for some or all subcircuits the pin assignment can't be derived. In this case, \circuit_skipped will be called once instead of \begin_circuit and \end_circuit. - """ - def begin_netlist(self, a: Netlist, b: Netlist) -> None: - r""" - @brief This function is called at the beginning of the compare process. - This method is called once when the compare run begins. - """ - def circuit_mismatch(self, a: Circuit, b: Circuit, msg: str) -> None: - r""" - @brief This function is called when circuits can't be compared. - This method is called when a circuit can't be mapped to a partner in the other netlist. In this case, this method is called with the one circuit and nil for the other circuit. - - This method is called instead of \begin_circuit and \end_circuit. - """ - def circuit_skipped(self, a: Circuit, b: Circuit, msg: str) -> None: - r""" - @brief This function is called when circuits can't be compared. - If there is a known circuit pair, but the circuits can be compared - for example because subcircuits can't be identified - this method will be called with both circuits. - - This method is called instead of \begin_circuit and \end_circuit. - """ - def device_class_mismatch(self, a: DeviceClass, b: DeviceClass, msg: str) -> None: - r""" - @brief This function is called when device classes can't be compared. - This method is called when a device class can't be mapped to a partner in the other netlist. In this case, this method is called with the one device class and nil for the other class. - """ - def device_mismatch(self, a: Device, b: Device, msg: str) -> None: - r""" - @brief This function is called when two devices can't be paired. - This will report the device considered in a or b. The other argument is nil. See \match_devices for details. - """ - def end_circuit(self, a: Circuit, b: Circuit, matching: bool, msg: str) -> None: - r""" - @brief This function is called at the end of the compare process. - The 'matching' argument indicates whether the circuits have been identified as identical. - See \begin_circuit for details. - """ - def end_netlist(self, a: Netlist, b: Netlist) -> None: - r""" - @brief This function is called at the end of the compare process. - This method is called once when the compare run ended. - """ - def match_ambiguous_nets(self, a: Net, b: Net, msg: str) -> None: - r""" - @brief This function is called when two nets are identified, but this choice is ambiguous. - This choice is a last-resort fallback to allow continuation of the compare procedure. It is likely that this compare will fail later. Looking for ambiguous nets allows deduction of the origin of this faulty decision. See \match_nets for more details. - """ - def match_devices(self, a: Device, b: Device) -> None: - r""" - @brief This function is called when two devices are identified. - If two devices are identified as a corresponding pair, this method will be called with both devices. - If the devices can be paired, but the device parameters don't match, \match_devices_with_different_parameters will be called instead. - If the devices can be paired, but the device classes don't match, \match_devices_with_different_device_classes will be called instead. - If devices can't be matched, \device_mismatch will be called with the one device considered and the other device being nil. - """ - def match_devices_with_different_device_classes(self, a: Device, b: Device) -> None: - r""" - @brief This function is called when two devices are identified but have different device classes. - See \match_devices for details. - """ - def match_devices_with_different_parameters(self, a: Device, b: Device) -> None: - r""" - @brief This function is called when two devices are identified but have different parameters. - See \match_devices for details. - """ - def match_nets(self, a: Net, b: Net) -> None: - r""" - @brief This function is called when two nets are identified. - If two nets are identified as a corresponding pair, this method will be called with both nets. - If the nets can be paired, but this match is ambiguous, \match_ambiguous_nets will be called instead. - If nets can't be matched to a partner, \net_mismatch will be called. - """ - def match_pins(self, a: Pin, b: Pin) -> None: - r""" - @brief This function is called when two pins are identified. - If two pins are identified as a corresponding pair, this method will be called with both pins. - If pins can't be matched, \pin_mismatch will be called with the one pin considered and the other pin being nil. - """ - def match_subcircuits(self, a: SubCircuit, b: SubCircuit) -> None: - r""" - @brief This function is called when two subcircuits are identified. - If two subcircuits are identified as a corresponding pair, this method will be called with both subcircuits. - If subcircuits can't be matched, \subcircuit_mismatch will be called with the one subcircuit considered and the other subcircuit being nil. - """ - def net_mismatch(self, a: Net, b: Net, msg: str) -> None: - r""" - @brief This function is called when a net can't be paired. - This method will be called, if a net cannot be identified as identical with another net. The corresponding argument will identify the net and source netlist. The other argument will be nil. - - In some cases, a mismatch is reported with two nets given. This means, - nets are known not to match. Still the compare algorithm will proceed as - if these nets were equivalent to derive further matches. - """ - def pin_mismatch(self, a: Pin, b: Pin, msg: str) -> None: - r""" - @brief This function is called when two pins can't be paired. - This will report the pin considered in a or b. The other argument is nil. See \match_pins for details. - """ - def subcircuit_mismatch(self, a: SubCircuit, b: SubCircuit, msg: str) -> None: - r""" - @brief This function is called when two subcircuits can't be paired. - This will report the subcircuit considered in a or b. The other argument is nil. See \match_subcircuits for details. - """ - -class NetlistComparer: - r""" - @brief Compares two netlists - This class performs a comparison of two netlists. - It can be used with an event receiver (logger) to track the errors and net mismatches. Event receivers are derived from class \GenericNetlistCompareLogger. - The netlist comparer can be configured in different ways. Specific hints can be given for nets, device classes or circuits to improve efficiency and reliability of the graph equivalence deduction algorithm. For example, objects can be marked as equivalent using \same_nets, \same_circuits etc. The compare algorithm will then use these hints to derive further equivalences. This way, ambiguities can be resolved. - - Another configuration option relates to swappable pins of subcircuits. If pins are marked this way, the compare algorithm may swap them to achieve net matching. Swappable pins belong to an 'equivalence group' and can be defined with \equivalent_pins. - - This class has been introduced in version 0.26. - """ - dont_consider_net_names: bool - r""" - @brief Gets a value indicating whether net names shall not be considered - See \dont_consider_net_names= for details.@brief Sets a value indicating whether net names shall not be considered - If this value is set to true, net names will not be considered when resolving ambiguities. - Not considering net names usually is more expensive. The default is 'false' indicating that - net names will be considered for ambiguity resolution. - - This property has been introduced in version 0.26.7. - """ - max_branch_complexity: int - r""" - @brief Gets the maximum branch complexity - See \max_branch_complexity= for details.@brief Sets the maximum branch complexity - This value limits the maximum branch complexity of the backtracking algorithm. - The complexity is the accumulated number of branch options with ambiguous - net matches. Backtracking will stop when the maximum number of options - has been exceeded. - - By default, from version 0.27 on the complexity is unlimited and can be reduced in cases where runtimes need to be limited at the cost less elaborate matching evaluation. - - As the computational complexity is the square of the branch count, - this value should be adjusted carefully. - """ - max_depth: int - r""" - @brief Gets the maximum search depth - See \max_depth= for details.@brief Sets the maximum search depth - This value limits the search depth of the backtracking algorithm to the - given number of jumps. - - By default, from version 0.27 on the depth is unlimited and can be reduced in cases where runtimes need to be limited at the cost less elaborate matching evaluation. - """ - max_resistance: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Excludes all resistor devices with a resistance values higher than the given threshold. - To reset this constraint, set this attribute to zero. - """ - min_capacitance: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Excludes all capacitor devices with a capacitance values less than the given threshold. - To reset this constraint, set this attribute to zero. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a new comparer object. - See the class description for more details. - """ - @overload - def __init__(self, logger: GenericNetlistCompareLogger) -> None: - r""" - @brief Creates a new comparer object. - The logger is a delegate or event receiver which the comparer will send compare events to. See the class description for more details. - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - @overload - def compare(self, netlist_a: Netlist, netlist_b: Netlist) -> bool: - r""" - @brief Compares two netlists. - This method will perform the actual netlist compare. It will return true if both netlists are identical. If the comparer has been configured with \same_nets or similar methods, the objects given there must be located inside 'circuit_a' and 'circuit_b' respectively. - """ - @overload - def compare(self, netlist_a: Netlist, netlist_b: Netlist, logger: NetlistCompareLogger) -> bool: - r""" - @brief Compares two netlists. - This method will perform the actual netlist compare using the given logger. It will return true if both netlists are identical. If the comparer has been configured with \same_nets or similar methods, the objects given there must be located inside 'circuit_a' and 'circuit_b' respectively. - """ - @overload - def equivalent_pins(self, circuit_b: Circuit, pin_ids: Sequence[int]) -> None: - r""" - @brief Marks several pins of the given circuit as equivalent (i.e. they can be swapped). - Only circuits from the second input can be given swappable pins. This will imply the same swappable pins on the equivalent circuit of the first input. This version is a generic variant of the two-pin version of this method. - """ - @overload - def equivalent_pins(self, circuit_b: Circuit, pin_id1: int, pin_id2: int) -> None: - r""" - @brief Marks two pins of the given circuit as equivalent (i.e. they can be swapped). - Only circuits from the second input can be given swappable pins. This will imply the same swappable pins on the equivalent circuit of the first input. To mark multiple pins as swappable, use the version that takes a list of pins. - """ - def join_symmetric_nets(self, circuit: Circuit) -> None: - r""" - @brief Joins symmetric nodes in the given circuit. - - Nodes are symmetrical if swapping them would not modify the circuit. - Hence they will carry the same potential and can be connected (joined). - This will simplify the circuit and can be applied before device combination - to render a schematic-equivalent netlist in some cases (split gate option). - - This algorithm will apply the comparer's settings to the symmetry - condition (device filtering, device compare tolerances, device class - equivalence etc.). - - This method has been introduced in version 0.26.4. - """ - def same_circuits(self, circuit_a: Circuit, circuit_b: Circuit) -> None: - r""" - @brief Marks two circuits as identical. - This method makes a circuit circuit_a in netlist a identical to the corresponding - circuit circuit_b in netlist b (see \compare). By default circuits with the same name are identical. - """ - def same_device_classes(self, dev_cls_a: DeviceClass, dev_cls_b: DeviceClass) -> None: - r""" - @brief Marks two device classes as identical. - This makes a device class dev_cls_a in netlist a identical to the corresponding - device class dev_cls_b in netlist b (see \compare). - By default device classes with the same name are identical. - """ - @overload - def same_nets(self, net_a: Net, net_b: Net, must_match: Optional[bool] = ...) -> None: - r""" - @brief Marks two nets as identical. - This makes a net net_a in netlist a identical to the corresponding - net net_b in netlist b (see \compare). - Otherwise, the algorithm will try to identify nets according to their topology. This method can be used to supply hints to the compare algorithm. It will use these hints to derive further identities. - - If 'must_match' is true, the nets are required to match. If they don't, an error is reported. - - The 'must_match' optional argument has been added in version 0.27.3. - """ - @overload - def same_nets(self, circuit_a: Circuit, circuit_b: Circuit, net_a: Net, net_b: Net, must_match: Optional[bool] = ...) -> None: - r""" - @brief Marks two nets as identical. - This makes a net net_a in netlist a identical to the corresponding - net net_b in netlist b (see \compare). - Otherwise, the algorithm will try to identify nets according to their topology. This method can be used to supply hints to the compare algorithm. It will use these hints to derive further identities. - - If 'must_match' is true, the nets are required to match. If they don't, an error is reported. - - This variant allows specifying nil for the nets indicating the nets are mismatched by definition. with 'must_match' this will render a net mismatch error. - - This variant has been added in version 0.27.3. - """ - def unmatched_circuits_a(self, a: Netlist, b: Netlist) -> List[Circuit]: - r""" - @brief Returns a list of circuits in A for which there is not corresponding circuit in B - This list can be used to flatten these circuits so they do not participate in the compare process. - """ - def unmatched_circuits_b(self, a: Netlist, b: Netlist) -> List[Circuit]: - r""" - @brief Returns a list of circuits in B for which there is not corresponding circuit in A - This list can be used to flatten these circuits so they do not participate in the compare process. - """ - -class NetlistCrossReference(NetlistCompareLogger): - r""" - @brief Represents the identity mapping between the objects of two netlists. - - The NetlistCrossReference object is a container for the results of a netlist comparison. It implemented the \NetlistCompareLogger interface, hence can be used as output for a netlist compare operation (\NetlistComparer#compare). It's purpose is to store the results of the compare. It is used in this sense inside the \LayoutVsSchematic framework. - - The basic idea of the cross reference object is pairing: the netlist comparer will try to identify matching items and store them as pairs inside the cross reference object. If no match is found, a single-sided pair is generated: one item is nil in this case. - Beside the items, a status is kept which gives more details about success or failure of the match operation. - - Item pairing happens on different levels, reflecting the hierarchy of the netlists. On the top level there are circuits. Inside circuits nets, devices, subcircuits and pins are paired. Nets further contribute their connected items through terminals (for devices), pins (outgoing) and subcircuit pins. - - This class has been introduced in version 0.26. - """ - class NetPairData: - r""" - @brief A net match entry. - This object is used to describe the relationship of two nets in a netlist match. - - Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. - This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. - """ - def first(self) -> Net: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> Net: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - def status(self) -> NetlistCrossReference.Status: - r""" - @brief Gets the status of the relation. - This enum described the match status of the relation pair. - """ - class DevicePairData: - r""" - @brief A device match entry. - This object is used to describe the relationship of two devices in a netlist match. - - Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. - This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. - """ - def first(self) -> Device: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> Device: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - def status(self) -> NetlistCrossReference.Status: - r""" - @brief Gets the status of the relation. - This enum described the match status of the relation pair. - """ - class PinPairData: - r""" - @brief A pin match entry. - This object is used to describe the relationship of two circuit pins in a netlist match. - - Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. - This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. - """ - def first(self) -> Pin: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> Pin: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - def status(self) -> NetlistCrossReference.Status: - r""" - @brief Gets the status of the relation. - This enum described the match status of the relation pair. - """ - class SubCircuitPairData: - r""" - @brief A subcircuit match entry. - This object is used to describe the relationship of two subcircuits in a netlist match. - - Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. - This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. - """ - def first(self) -> SubCircuit: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> SubCircuit: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - def status(self) -> NetlistCrossReference.Status: - r""" - @brief Gets the status of the relation. - This enum described the match status of the relation pair. - """ - class CircuitPairData: - r""" - @brief A circuit match entry. - This object is used to describe the relationship of two circuits in a netlist match. - - Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. - This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. - """ - def first(self) -> Circuit: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> Circuit: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - def status(self) -> NetlistCrossReference.Status: - r""" - @brief Gets the status of the relation. - This enum described the match status of the relation pair. - """ - class NetTerminalRefPair: - r""" - @brief A match entry for a net terminal pair. - This object is used to describe the matching terminal pairs or non-matching terminals on a net. - - Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found. - """ - def first(self) -> NetTerminalRef: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> NetTerminalRef: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - class NetPinRefPair: - r""" - @brief A match entry for a net pin pair. - This object is used to describe the matching pin pairs or non-matching pins on a net. - - Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found. - """ - def first(self) -> NetPinRef: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> NetPinRef: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - class NetSubcircuitPinRefPair: - r""" - @brief A match entry for a net subcircuit pin pair. - This object is used to describe the matching subcircuit pin pairs or non-matching subcircuit pins on a net. - - Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found. - """ - def first(self) -> NetSubcircuitPinRef: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> NetSubcircuitPinRef: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - class Status: - r""" - @brief This class represents the NetlistCrossReference::Status enum - """ - Match: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::Match - An exact match exists if this code is present. - """ - MatchWithWarning: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::MatchWithWarning - If this code is present, a match was found but a warning is issued. For nets, this means that the choice is ambiguous and one, unspecific candidate has been chosen. For devices, this means a device match was established, but parameters or the device class are not matching exactly. - """ - Mismatch: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::Mismatch - This code means there is a match candidate, but exact identity could not be confirmed. - """ - NoMatch: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::NoMatch - If this code is present, no match could be found. - There is also 'Mismatch' which means there is a candidate, but exact identity could not be confirmed. - """ - None_: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::None - No specific status is implied if this code is present. - """ - Skipped: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::Skipped - On circuits this code means that a match has not been attempted because subcircuits of this circuits were not matched. As circuit matching happens bottom-up, all subcircuits must match at least with respect to their pins to allow any parent circuit to be matched. - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - def __lt__(self, other: NetlistCrossReference.Status) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - Match: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::Match - An exact match exists if this code is present. - """ - MatchWithWarning: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::MatchWithWarning - If this code is present, a match was found but a warning is issued. For nets, this means that the choice is ambiguous and one, unspecific candidate has been chosen. For devices, this means a device match was established, but parameters or the device class are not matching exactly. - """ - Mismatch: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::Mismatch - This code means there is a match candidate, but exact identity could not be confirmed. - """ - NoMatch: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::NoMatch - If this code is present, no match could be found. - There is also 'Mismatch' which means there is a candidate, but exact identity could not be confirmed. - """ - None_: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::None - No specific status is implied if this code is present. - """ - Skipped: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::Skipped - On circuits this code means that a match has not been attempted because subcircuits of this circuits were not matched. As circuit matching happens bottom-up, all subcircuits must match at least with respect to their pins to allow any parent circuit to be matched. - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def circuit_count(self) -> int: - r""" - @brief Gets the number of circuit pairs in the cross-reference object. - """ - def clear(self) -> None: - r""" - @hide - """ - def each_circuit_pair(self) -> Iterator[NetlistCrossReference.CircuitPairData]: - r""" - @brief Delivers the circuit pairs and their status. - See the class description for details. - """ - def each_device_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.DevicePairData]: - r""" - @brief Delivers the device pairs and their status for the given circuit pair. - See the class description for details. - """ - def each_net_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.NetPairData]: - r""" - @brief Delivers the net pairs and their status for the given circuit pair. - See the class description for details. - """ - def each_net_pin_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetPinRefPair]: - r""" - @brief Delivers the pin pairs for the given net pair. - For the net pair, lists the pin pairs identified on this net. - """ - def each_net_subcircuit_pin_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetSubcircuitPinRefPair]: - r""" - @brief Delivers the subcircuit pin pairs for the given net pair. - For the net pair, lists the subcircuit pin pairs identified on this net. - """ - def each_net_terminal_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetTerminalRefPair]: - r""" - @brief Delivers the device terminal pairs for the given net pair. - For the net pair, lists the device terminal pairs identified on this net. - """ - def each_pin_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.PinPairData]: - r""" - @brief Delivers the pin pairs and their status for the given circuit pair. - See the class description for details. - """ - def each_subcircuit_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.SubCircuitPairData]: - r""" - @brief Delivers the subcircuit pairs and their status for the given circuit pair. - See the class description for details. - """ - def netlist_a(self) -> Netlist: - r""" - @brief Gets the first netlist which participated in the compare. - This member may be nil, if the respective netlist is no longer valid. In this case, the netlist cross-reference object cannot be used. - """ - def netlist_b(self) -> Netlist: - r""" - @brief Gets the second netlist which participated in the compare. - This member may be nil, if the respective netlist is no longer valid.In this case, the netlist cross-reference object cannot be used. - """ - def other_circuit_for(self, circuit: Circuit) -> Circuit: - r""" - @brief Gets the matching other circuit for a given primary circuit. - The return value will be nil if no match is found. Otherwise it is the 'b' circuit for circuits from the 'a' netlist and vice versa. - - This method has been introduced in version 0.27. - """ - def other_device_for(self, device: Device) -> Device: - r""" - @brief Gets the matching other device for a given primary device. - The return value will be nil if no match is found. Otherwise it is the 'b' device for devices from the 'a' netlist and vice versa. - - This method has been introduced in version 0.27. - """ - def other_net_for(self, net: Net) -> Net: - r""" - @brief Gets the matching other net for a given primary net. - The return value will be nil if no match is found. Otherwise it is the 'b' net for nets from the 'a' netlist and vice versa. - """ - def other_pin_for(self, pin: Pin) -> Pin: - r""" - @brief Gets the matching other pin for a given primary pin. - The return value will be nil if no match is found. Otherwise it is the 'b' pin for pins from the 'a' netlist and vice versa. - - This method has been introduced in version 0.27. - """ - def other_subcircuit_for(self, subcircuit: SubCircuit) -> SubCircuit: - r""" - @brief Gets the matching other subcircuit for a given primary subcircuit. - The return value will be nil if no match is found. Otherwise it is the 'b' subcircuit for subcircuits from the 'a' netlist and vice versa. - - This method has been introduced in version 0.27. - """ - class DeviceClassResistor(DeviceClass): r""" @brief A device class for a resistor. @@ -20080,6 +44553,11 @@ class DeviceClassFactory: This class has been introduced in version 0.27.3. """ + @classmethod + def new(cls) -> DeviceClassFactory: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> DeviceClassFactory: r""" @brief Creates a copy of self @@ -20129,15 +44607,33 @@ class DeviceClassFactory: r""" @brief Assigns another object to self """ - def create_class(self) -> DeviceClass: + def create(self) -> None: r""" - @brief Creates the DeviceClass object - Reimplement this method to create the desired device class. + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ def dup(self) -> DeviceClassFactory: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class NetlistDeviceExtractorError: r""" @@ -20152,33 +44648,53 @@ class NetlistDeviceExtractorError: """ category_description: str r""" + Getter: @brief Gets the category description. - See \category_name= for details about categories.@brief Sets the category description. + See \category_name= for details about categories. + Setter: + @brief Sets the category description. See \category_name= for details about categories. """ category_name: str r""" + Getter: @brief Gets the category name. - See \category_name= for more details.@brief Sets the category name. + See \category_name= for more details. + Setter: + @brief Sets the category name. The category name is optional. If given, it specifies a formal category name. Errors with the same category name are shown in that category. If in addition a category description is specified (see \category_description), this description will be displayed as the title of. """ cell_name: str r""" + Getter: @brief Gets the cell name. - See \cell_name= for details about this attribute.@brief Sets the cell name. + See \cell_name= for details about this attribute. + Setter: + @brief Sets the cell name. The cell name is the name of the layout cell which was treated. This is also the name of the circuit the device should have appeared in (it may be dropped because of this error). If netlist hierarchy manipulation happens however, the circuit may not exist any longer or may be renamed. """ geometry: DPolygon r""" + Getter: @brief Gets the geometry. - See \geometry= for more details.@brief Sets the geometry. + See \geometry= for more details. + Setter: + @brief Sets the geometry. The geometry is optional. If given, a marker will be shown when selecting this error. """ message: str r""" + Getter: @brief Gets the message text. + + Setter: @brief Sets the message text. """ + @classmethod + def new(cls) -> NetlistDeviceExtractorError: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> NetlistDeviceExtractorError: r""" @brief Creates a copy of self @@ -20228,10 +44744,33 @@ class NetlistDeviceExtractorError: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> NetlistDeviceExtractorError: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class NetlistDeviceExtractorLayerDefinition: r""" @@ -20242,6 +44781,11 @@ class NetlistDeviceExtractorLayerDefinition: This class has been introduced in version 0.26. """ + @classmethod + def new(cls) -> NetlistDeviceExtractorLayerDefinition: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> NetlistDeviceExtractorLayerDefinition: r""" @brief Creates a copy of self @@ -20291,10 +44835,27 @@ class NetlistDeviceExtractorLayerDefinition: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def description(self) -> str: r""" @brief Gets the description of the layer. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> NetlistDeviceExtractorLayerDefinition: r""" @brief Creates a copy of self @@ -20308,6 +44869,12 @@ class NetlistDeviceExtractorLayerDefinition: r""" @brief Gets the index of the layer. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def name(self) -> str: r""" @brief Gets the name of the layer. @@ -20324,8 +44891,16 @@ class DeviceExtractorBase: """ name: str r""" - @brief Gets the name of the device extractor and the device class.@brief Sets the name of the device extractor and the device class. + Getter: + @brief Gets the name of the device extractor and the device class. + Setter: + @brief Sets the name of the device extractor and the device class. """ + @classmethod + def new(cls) -> DeviceExtractorBase: + r""" + @brief Creates a new object of this class + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -20367,6 +44942,23 @@ class DeviceExtractorBase: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def device_class(self) -> DeviceClass: r""" @brief Gets the device class used during extraction @@ -20382,6 +44974,12 @@ class DeviceExtractorBase: r""" @brief Iterates over all layer definitions. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def test_initialize(self, netlist: Netlist) -> None: r""" @hide @@ -20538,29 +45136,6 @@ class GenericDeviceExtractor(DeviceExtractorBase): r""" @brief Issues an error with the given category name and description, message and database-unit polygon geometry """ - def extract_devices(self, layer_geometry: Sequence[Region]) -> None: - r""" - @brief Extracts the devices from the given shape cluster. - - The shape cluster is a set of geometries belonging together in terms of the - connectivity defined by "get_connectivity". The cluster might cover multiple devices, - so the implementation needs to consider this case. The geometries are already merged. - - The implementation of this method shall use "create_device" to create new - devices based on the geometry found. It shall use "define_terminal" to define - terminals by which the nets extracted in the network extraction step connect - to the new devices. - """ - def get_connectivity(self, layout: Layout, layers: Sequence[int]) -> Connectivity: - r""" - @brief Gets the connectivity object used to extract the device geometry. - This method shall raise an error, if the input layer are not properly defined (e.g. - too few etc.) - - This is not a connectivity definition in the electrical sense, but defines the cluster of shapes which generates a specific device. In this case, 'connectivity' means 'definition of shapes that need to touch to form the device'. - - The 'layers' argument specifies the actual layer layouts for the logical device layers (see \define_layer). The list of layers corresponds to the number of layers defined. Use the layer indexes from this list to build the connectivity with \Connectivity#connect. Note, that in order to capture a connected cluster of shapes on the same layer you'll need to include a self-connection like 'connectivity.connect(layers[0], layers[0])'. - """ def register_device_class(self, device_class: DeviceClass) -> None: r""" @brief Registers a device class. @@ -20576,16 +45151,6 @@ class GenericDeviceExtractor(DeviceExtractorBase): Use this unit to compute device properties. It is the database unit multiplied with the device scaling factor. """ - def setup(self) -> None: - r""" - @brief Sets up the extractor. - This method is supposed to set up the device extractor. This involves three basic steps: - defining the name, the device class and setting up the device layers. - - Use \name= to give the extractor and it's device class a name. - Use \register_device_class to register the device class you need. - Defined the layers by calling \define_layer once or several times. - """ class DeviceExtractorMOS3Transistor(DeviceExtractorBase): r""" @@ -20630,6 +45195,14 @@ class DeviceExtractorMOS3Transistor(DeviceExtractorBase): This class has been introduced in version 0.26. """ + @classmethod + def new(cls, name: str, strict: Optional[bool] = ..., factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorMOS3Transistor: + r""" + @brief Creates a new device extractor with the given name. + If \strict is true, the MOS device extraction will happen in strict mode. That is, source and drain are not interchangeable. + + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ def __init__(self, name: str, strict: Optional[bool] = ..., factory: Optional[DeviceClassFactory] = ...) -> None: r""" @brief Creates a new device extractor with the given name. @@ -20706,6 +45279,12 @@ class DeviceExtractorMOS4Transistor(DeviceExtractorBase): This class has been introduced in version 0.26. """ + @classmethod + def new(cls, name: str, strict: Optional[bool] = ..., factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorMOS4Transistor: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ def __init__(self, name: str, strict: Optional[bool] = ..., factory: Optional[DeviceClassFactory] = ...) -> None: r""" @brief Creates a new device extractor with the given name @@ -20785,6 +45364,12 @@ class DeviceExtractorResistor(DeviceExtractorBase): This class has been introduced in version 0.26. """ + @classmethod + def new(cls, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorResistor: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ def __init__(self, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> None: r""" @brief Creates a new device extractor with the given name @@ -20864,6 +45449,12 @@ class DeviceExtractorResistorWithBulk(DeviceExtractorBase): This class has been introduced in version 0.26. """ + @classmethod + def new(cls, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorResistorWithBulk: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ def __init__(self, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> None: r""" @brief Creates a new device extractor with the given name @@ -20941,6 +45532,12 @@ class DeviceExtractorCapacitor(DeviceExtractorBase): This class has been introduced in version 0.26. """ + @classmethod + def new(cls, name: str, area_cap: float, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorCapacitor: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ def __init__(self, name: str, area_cap: float, factory: Optional[DeviceClassFactory] = ...) -> None: r""" @brief Creates a new device extractor with the given name @@ -21019,6 +45616,12 @@ class DeviceExtractorCapacitorWithBulk(DeviceExtractorBase): This class has been introduced in version 0.26. """ + @classmethod + def new(cls, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorCapacitorWithBulk: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ def __init__(self, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> None: r""" @brief Creates a new device extractor with the given name @@ -21099,6 +45702,12 @@ class DeviceExtractorBJT3Transistor(DeviceExtractorBase): This class has been introduced in version 0.26. """ + @classmethod + def new(cls, name: str, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorBJT3Transistor: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ def __init__(self, name: str, factory: Optional[DeviceClassFactory] = ...) -> None: r""" @brief Creates a new device extractor with the given name @@ -21163,6 +45772,12 @@ class DeviceExtractorBJT4Transistor(DeviceExtractorBJT3Transistor): This class has been introduced in version 0.26. """ + @classmethod + def new(cls, name: str, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorBJT4Transistor: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ def __init__(self, name: str, factory: Optional[DeviceClassFactory] = ...) -> None: r""" @brief Creates a new device extractor with the given name @@ -21243,6 +45858,12 @@ class DeviceExtractorDiode(DeviceExtractorBase): This class has been introduced in version 0.26. """ + @classmethod + def new(cls, name: str, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorDiode: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ def __init__(self, name: str, factory: Optional[DeviceClassFactory] = ...) -> None: r""" @brief Creates a new device extractor with the given name @@ -21286,3783 +45907,26 @@ class DeviceExtractorDiode(DeviceExtractorBase): Usually it's not required to call this method. It has been introduced in version 0.24. """ -class Path: +class Connectivity: r""" - @brief A path class + @brief This class specifies connections between different layers. + Connections are build using \connect. There are basically two flavours of connections: intra-layer and inter-layer. - A path consists of an sequence of line segments forming the 'spine' of the path and a width. In addition, the starting point can be drawn back by a certain extent (the 'begin extension') and the end point can be pulled forward somewhat (by the 'end extension'). + Intra-layer connections make nets begin propagated along different shapes on the same net. Without the intra-layer connections, nets are not propagated over shape boundaries. As this is usually intended, intra-layer connections should always be specified for each layer. - A path may have round ends for special purposes. In particular, a round-ended path with a single point can represent a circle. Round-ended paths should have being and end extensions equal to half the width. Non-round-ended paths with a single point are allowed but the definition of the resulting shape in not well defined and may differ in other tools. + Inter-layer connections connect shapes on different layers. Shapes which touch across layers will be connected if their layers are specified as being connected through inter-layer \connect. - See @The Database API@ for more details about the database objects. - """ - bgn_ext: int - r""" - @brief Get the begin extension - @brief Set the begin extension - """ - end_ext: int - r""" - @brief Get the end extension - @brief Set the end extension - """ - points: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Set the points of the path - @param p An array of points to assign to the path's spine - """ - round: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Set the 'round ends' flag - A path with round ends show half circles at the ends, instead of square or rectangular ends. Paths with this flag set should use a begin and end extension of half the width (see \bgn_ext and \end_ext). The interpretation of such paths in other tools may differ otherwise. - """ - width: int - r""" - @brief Get the width - @brief Set the width + All layers are specified in terms of layer indexes. Layer indexes are layout layer indexes (see \Layout class). + + The connectivity object also manages the global nets. Global nets are substrate for example and they are propagated automatically from subcircuits to circuits. Global nets are defined by name and are managed through IDs. To get the name for a given ID, use \global_net_name. + This class has been introduced in version 0.26. """ @classmethod - def from_s(cls, s: str) -> Path: + def new(cls) -> Connectivity: r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. + @brief Creates a new object of this class """ - def __copy__(self) -> Path: - r""" - @brief Creates a copy of self - """ - def __eq__(self, p: object) -> bool: - r""" - @brief Equality test - @param p The object to compare against - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor: creates an empty (invalid) path with width 0 - """ - @overload - def __init__(self, dpath: DPath) -> None: - r""" - @brief Creates an integer coordinate path from a floating-point coordinate path - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpath'. - """ - @overload - def __init__(self, pts: Sequence[Point], width: int) -> None: - r""" - @brief Constructor given the points of the path's spine and the width - - - @param pts The points forming the spine of the path - @param width The width of the path - """ - @overload - def __init__(self, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int) -> None: - r""" - @brief Constructor given the points of the path's spine, the width and the extensions - - - @param pts The points forming the spine of the path - @param width The width of the path - @param bgn_ext The begin extension of the path - @param end_ext The end extension of the path - """ - @overload - def __init__(self, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int, round: bool) -> None: - r""" - @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag - - - @param pts The points forming the spine of the path - @param width The width of the path - @param bgn_ext The begin extension of the path - @param end_ext The end extension of the path - @param round If this flag is true, the path will get rounded ends - """ - def __lt__(self, p: Path) -> bool: - r""" - @brief Less operator - @param p The object to compare against - This operator is provided to establish some, not necessarily a certain sorting order - """ - def __mul__(self, f: float) -> Path: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __ne__(self, p: object) -> bool: - r""" - @brief Inequality test - @param p The object to compare against - """ - def __repr__(self) -> str: - r""" - @brief Convert to a string - """ - def __rmul__(self, f: float) -> Path: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __str__(self) -> str: - r""" - @brief Convert to a string - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def area(self) -> int: - r""" - @brief Returns the approximate area of the path - This method returns the approximate value of the area. It is computed from the length times the width. end extensions are taken into account correctly, but not effects of the corner interpolation. - This method was added in version 0.22. - """ - def assign(self, other: Path) -> None: - r""" - @brief Assigns another object to self - """ - def bbox(self) -> Box: - r""" - @brief Returns the bounding box of the path - """ - def dup(self) -> Path: - r""" - @brief Creates a copy of self - """ - def each_point(self) -> Iterator[Point]: - r""" - @brief Get the points that make up the path's spine - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - def is_round(self) -> bool: - r""" - @brief Returns true, if the path has round ends - """ - def length(self) -> int: - r""" - @brief Returns the length of the path - the length of the path is determined by summing the lengths of the segments and adding begin and end extensions. For round-ended paths the length of the paths between the tips of the ends. - - This method was added in version 0.23. - """ - @overload - def move(self, p: Vector) -> Path: - r""" - @brief Moves the path. - - Moves the path by the given offset and returns the - moved path. The path is overwritten. - - @param p The distance to move the path. - - @return The moved path. - """ - @overload - def move(self, dx: int, dy: int) -> Path: - r""" - @brief Moves the path. - - Moves the path by the given offset and returns the - moved path. The path is overwritten. - - @param dx The x distance to move the path. - @param dy The y distance to move the path. - - @return The moved path. - - This version has been added in version 0.23. - """ - @overload - def moved(self, p: Vector) -> Path: - r""" - @brief Returns the moved path (does not change self) - - Moves the path by the given offset and returns the - moved path. The path is not modified. - - @param p The distance to move the path. - - @return The moved path. - """ - @overload - def moved(self, dx: int, dy: int) -> Path: - r""" - @brief Returns the moved path (does not change self) - - Moves the path by the given offset and returns the - moved path. The path is not modified. - - @param dx The x distance to move the path. - @param dy The y distance to move the path. - - @return The moved path. - - This version has been added in version 0.23. - """ - def num_points(self) -> int: - r""" - @brief Get the number of points - """ - def perimeter(self) -> int: - r""" - @brief Returns the approximate perimeter of the path - This method returns the approximate value of the perimeter. It is computed from the length and the width. end extensions are taken into account correctly, but not effects of the corner interpolation. - This method was added in version 0.24.4. - """ - def polygon(self) -> Polygon: - r""" - @brief Convert the path to a polygon - The returned polygon is not guaranteed to be non-self overlapping. This may happen if the path overlaps itself or contains very short segments. - """ - def round_corners(self, radius: float, npoints: int) -> Path: - r""" - @brief Creates a new path whose corners are interpolated with circular bends - - @param radius The radius of the bends - @param npoints The number of points (per full circle) used for interpolating the bends - - This method has been introduced in version 0.25. - """ - def simple_polygon(self) -> SimplePolygon: - r""" - @brief Convert the path to a simple polygon - The returned polygon is not guaranteed to be non-selfoverlapping. This may happen if the path overlaps itself or contains very short segments. - """ - def to_dtype(self, dbu: Optional[float] = ...) -> DPath: - r""" - @brief Converts the path to a floating-point coordinate path - - The database unit can be specified to translate the integer-coordinate path into a floating-point coordinate path in micron units. The database unit is basically a scaling factor. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief Convert to a string - """ - @overload - def transformed(self, t: CplxTrans) -> DPath: - r""" - @brief Transform the path. - - Transforms the path with the given complex transformation. - Does not modify the path but returns the transformed path. - - @param t The transformation to apply. - - @return The transformed path. - """ - @overload - def transformed(self, t: ICplxTrans) -> Path: - r""" - @brief Transform the path. - - Transforms the path with the given complex transformation. - Does not modify the path but returns the transformed path. - - @param t The transformation to apply. - - @return The transformed path (in this case an integer coordinate path). - - This method has been introduced in version 0.18. - """ - @overload - def transformed(self, t: Trans) -> Path: - r""" - @brief Transform the path. - - Transforms the path with the given transformation. - Does not modify the path but returns the transformed path. - - @param t The transformation to apply. - - @return The transformed path. - """ - -class DPath: - r""" - @brief A path class - - A path consists of an sequence of line segments forming the 'spine' of the path and a width. In addition, the starting point can be drawn back by a certain extent (the 'begin extension') and the end point can be pulled forward somewhat (by the 'end extension'). - - A path may have round ends for special purposes. In particular, a round-ended path with a single point can represent a circle. Round-ended paths should have being and end extensions equal to half the width. Non-round-ended paths with a single point are allowed but the definition of the resulting shape in not well defined and may differ in other tools. - - See @The Database API@ for more details about the database objects. - """ - bgn_ext: float - r""" - @brief Get the begin extension - @brief Set the begin extension - """ - end_ext: float - r""" - @brief Get the end extension - @brief Set the end extension - """ - points: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Set the points of the path - @param p An array of points to assign to the path's spine - """ - round: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Set the 'round ends' flag - A path with round ends show half circles at the ends, instead of square or rectangular ends. Paths with this flag set should use a begin and end extension of half the width (see \bgn_ext and \end_ext). The interpretation of such paths in other tools may differ otherwise. - """ - width: float - r""" - @brief Get the width - @brief Set the width - """ - @classmethod - def from_s(cls, s: str) -> DPath: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - def __copy__(self) -> DPath: - r""" - @brief Creates a copy of self - """ - def __eq__(self, p: object) -> bool: - r""" - @brief Equality test - @param p The object to compare against - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor: creates an empty (invalid) path with width 0 - """ - @overload - def __init__(self, path: Path) -> None: - r""" - @brief Creates a floating-point coordinate path from an integer coordinate path - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipath'. - """ - @overload - def __init__(self, pts: Sequence[DPoint], width: float) -> None: - r""" - @brief Constructor given the points of the path's spine and the width - - - @param pts The points forming the spine of the path - @param width The width of the path - """ - @overload - def __init__(self, pts: Sequence[DPoint], width: float, bgn_ext: float, end_ext: float) -> None: - r""" - @brief Constructor given the points of the path's spine, the width and the extensions - - - @param pts The points forming the spine of the path - @param width The width of the path - @param bgn_ext The begin extension of the path - @param end_ext The end extension of the path - """ - @overload - def __init__(self, pts: Sequence[DPoint], width: float, bgn_ext: float, end_ext: float, round: bool) -> None: - r""" - @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag - - - @param pts The points forming the spine of the path - @param width The width of the path - @param bgn_ext The begin extension of the path - @param end_ext The end extension of the path - @param round If this flag is true, the path will get rounded ends - """ - def __lt__(self, p: DPath) -> bool: - r""" - @brief Less operator - @param p The object to compare against - This operator is provided to establish some, not necessarily a certain sorting order - """ - def __mul__(self, f: float) -> DPath: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __ne__(self, p: object) -> bool: - r""" - @brief Inequality test - @param p The object to compare against - """ - def __repr__(self) -> str: - r""" - @brief Convert to a string - """ - def __rmul__(self, f: float) -> DPath: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __str__(self) -> str: - r""" - @brief Convert to a string - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def area(self) -> float: - r""" - @brief Returns the approximate area of the path - This method returns the approximate value of the area. It is computed from the length times the width. end extensions are taken into account correctly, but not effects of the corner interpolation. - This method was added in version 0.22. - """ - def assign(self, other: DPath) -> None: - r""" - @brief Assigns another object to self - """ - def bbox(self) -> DBox: - r""" - @brief Returns the bounding box of the path - """ - def dup(self) -> DPath: - r""" - @brief Creates a copy of self - """ - def each_point(self) -> Iterator[DPoint]: - r""" - @brief Get the points that make up the path's spine - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - def is_round(self) -> bool: - r""" - @brief Returns true, if the path has round ends - """ - def length(self) -> float: - r""" - @brief Returns the length of the path - the length of the path is determined by summing the lengths of the segments and adding begin and end extensions. For round-ended paths the length of the paths between the tips of the ends. - - This method was added in version 0.23. - """ - @overload - def move(self, p: DVector) -> DPath: - r""" - @brief Moves the path. - - Moves the path by the given offset and returns the - moved path. The path is overwritten. - - @param p The distance to move the path. - - @return The moved path. - """ - @overload - def move(self, dx: float, dy: float) -> DPath: - r""" - @brief Moves the path. - - Moves the path by the given offset and returns the - moved path. The path is overwritten. - - @param dx The x distance to move the path. - @param dy The y distance to move the path. - - @return The moved path. - - This version has been added in version 0.23. - """ - @overload - def moved(self, p: DVector) -> DPath: - r""" - @brief Returns the moved path (does not change self) - - Moves the path by the given offset and returns the - moved path. The path is not modified. - - @param p The distance to move the path. - - @return The moved path. - """ - @overload - def moved(self, dx: float, dy: float) -> DPath: - r""" - @brief Returns the moved path (does not change self) - - Moves the path by the given offset and returns the - moved path. The path is not modified. - - @param dx The x distance to move the path. - @param dy The y distance to move the path. - - @return The moved path. - - This version has been added in version 0.23. - """ - def num_points(self) -> int: - r""" - @brief Get the number of points - """ - def perimeter(self) -> float: - r""" - @brief Returns the approximate perimeter of the path - This method returns the approximate value of the perimeter. It is computed from the length and the width. end extensions are taken into account correctly, but not effects of the corner interpolation. - This method was added in version 0.24.4. - """ - def polygon(self) -> DPolygon: - r""" - @brief Convert the path to a polygon - The returned polygon is not guaranteed to be non-self overlapping. This may happen if the path overlaps itself or contains very short segments. - """ - def round_corners(self, radius: float, npoints: int, accuracy: float) -> DPath: - r""" - @brief Creates a new path whose corners are interpolated with circular bends - - @param radius The radius of the bends - @param npoints The number of points (per full circle) used for interpolating the bends - @param accuracy The numerical accuracy of the computation - - The accuracy parameter controls the numerical resolution of the approximation process and should be in the order of half the database unit. This accuracy is used for suppressing redundant points and simplification of the resulting path. - - This method has been introduced in version 0.25. - """ - def simple_polygon(self) -> DSimplePolygon: - r""" - @brief Convert the path to a simple polygon - The returned polygon is not guaranteed to be non-selfoverlapping. This may happen if the path overlaps itself or contains very short segments. - """ - def to_itype(self, dbu: Optional[float] = ...) -> Path: - r""" - @brief Converts the path to an integer coordinate path - - The database unit can be specified to translate the floating-point coordinate path in micron units to an integer-coordinate path in database units. The path's' coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief Convert to a string - """ - @overload - def transformed(self, t: DCplxTrans) -> DPath: - r""" - @brief Transform the path. - - Transforms the path with the given complex transformation. - Does not modify the path but returns the transformed path. - - @param t The transformation to apply. - - @return The transformed path. - """ - @overload - def transformed(self, t: DTrans) -> DPath: - r""" - @brief Transform the path. - - Transforms the path with the given transformation. - Does not modify the path but returns the transformed path. - - @param t The transformation to apply. - - @return The transformed path. - """ - @overload - def transformed(self, t: VCplxTrans) -> Path: - r""" - @brief Transforms the polygon with the given complex transformation - - - @param t The magnifying transformation to apply - @return The transformed path (in this case an integer coordinate path) - - This method has been introduced in version 0.25. - """ - -class DPoint: - r""" - @brief A point class with double (floating-point) coordinates - Points represent a coordinate in the two-dimensional coordinate space of layout. They are not geometrical objects by itself. But they are frequently used in the database API for various purposes. Other than the integer variant (\Point), points with floating-point coordinates can represent fractions of a database unit. - - See @The Database API@ for more details about the database objects. - """ - x: float - r""" - @brief Accessor to the x coordinate - @brief Write accessor to the x coordinate - """ - y: float - r""" - @brief Accessor to the y coordinate - @brief Write accessor to the y coordinate - """ - @classmethod - def from_s(cls, s: str) -> DPoint: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - def __add__(self, v: DVector) -> DPoint: - r""" - @brief Adds a vector to a point - - - Adds vector v to self by adding the coordinates. - - Starting with version 0.25, this method expects a vector argument. - """ - def __copy__(self) -> DPoint: - r""" - @brief Creates a copy of self - """ - def __eq__(self, p: object) -> bool: - r""" - @brief Equality test operator - - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given point. This method enables points as hash keys. - - This method has been introduced in version 0.25. - """ - def __imul__(self, f: float) -> DPoint: - r""" - @brief Scaling by some factor - - - Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor: creates a point at 0,0 - """ - @overload - def __init__(self, point: Point) -> None: - r""" - @brief Creates a floating-point coordinate point from an integer coordinate point - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipoint'. - """ - @overload - def __init__(self, v: DVector) -> None: - r""" - @brief Default constructor: creates a point at from an vector - This constructor is equivalent to computing point(0,0)+v. - This method has been introduced in version 0.25. - """ - @overload - def __init__(self, x: float, y: float) -> None: - r""" - @brief Constructor for a point from two coordinate values - - """ - def __itruediv__(self, d: float) -> DPoint: - r""" - @brief Division by some divisor - - - Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded. - """ - def __lt__(self, p: DPoint) -> bool: - r""" - @brief "less" comparison operator - - - This operator is provided to establish a sorting - order - """ - def __mul__(self, f: float) -> DPoint: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __ne__(self, p: object) -> bool: - r""" - @brief Inequality test operator - - """ - def __neg__(self) -> DPoint: - r""" - @brief Compute the negative of a point - - - Returns a new point with -x, -y. - - This method has been added in version 0.23. - """ - def __repr__(self) -> str: - r""" - @brief String conversion - """ - def __rmul__(self, f: float) -> DPoint: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __str__(self) -> str: - r""" - @brief String conversion - """ - @overload - def __sub__(self, p: DPoint) -> DVector: - r""" - @brief Subtract one point from another - - - Subtract point p from self by subtracting the coordinates. This renders a vector. - - Starting with version 0.25, this method renders a vector. - """ - @overload - def __sub__(self, v: DVector) -> DPoint: - r""" - @brief Subtract one vector from a point - - - Subtract vector v from from self by subtracting the coordinates. This renders a point. - - This method has been added in version 0.27. - """ - def __truediv__(self, d: float) -> DPoint: - r""" - @brief Division by some divisor - - - Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded. - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def abs(self) -> float: - r""" - @brief The absolute value of the point (Euclidian distance to 0,0) - - The returned value is 'sqrt(x*x+y*y)'. - - This method has been introduced in version 0.23. - """ - def assign(self, other: DPoint) -> None: - r""" - @brief Assigns another object to self - """ - def distance(self, d: DPoint) -> float: - r""" - @brief The Euclidian distance to another point - - - @param d The other point to compute the distance to. - """ - def dup(self) -> DPoint: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given point. This method enables points as hash keys. - - This method has been introduced in version 0.25. - """ - def sq_abs(self) -> float: - r""" - @brief The square of the absolute value of the point (Euclidian distance to 0,0) - - The returned value is 'x*x+y*y'. - - This method has been introduced in version 0.23. - """ - def sq_distance(self, d: DPoint) -> float: - r""" - @brief The square Euclidian distance to another point - - - @param d The other point to compute the distance to. - """ - def to_itype(self, dbu: Optional[float] = ...) -> Point: - r""" - @brief Converts the point to an integer coordinate point - - The database unit can be specified to translate the floating-point coordinate point in micron units to an integer-coordinate point in database units. The point's' coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief String conversion - """ - def to_v(self) -> DVector: - r""" - @brief Turns the point into a vector - This method returns a vector representing the distance from (0,0) to the point.This method has been introduced in version 0.25. - """ - -class Point: - r""" - @brief An integer point class - Points represent a coordinate in the two-dimensional coordinate space of layout. They are not geometrical objects by itself. But they are frequently used in the database API for various purposes. - - See @The Database API@ for more details about the database objects. - """ - x: int - r""" - @brief Accessor to the x coordinate - @brief Write accessor to the x coordinate - """ - y: int - r""" - @brief Accessor to the y coordinate - @brief Write accessor to the y coordinate - """ - @classmethod - def from_s(cls, s: str) -> Point: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - def __add__(self, v: Vector) -> Point: - r""" - @brief Adds a vector to a point - - - Adds vector v to self by adding the coordinates. - - Starting with version 0.25, this method expects a vector argument. - """ - def __copy__(self) -> Point: - r""" - @brief Creates a copy of self - """ - def __eq__(self, p: object) -> bool: - r""" - @brief Equality test operator - - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given point. This method enables points as hash keys. - - This method has been introduced in version 0.25. - """ - def __imul__(self, f: float) -> Point: - r""" - @brief Scaling by some factor - - - Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor: creates a point at 0,0 - """ - @overload - def __init__(self, dpoint: DPoint) -> None: - r""" - @brief Creates an integer coordinate point from a floating-point coordinate point - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoint'. - """ - @overload - def __init__(self, v: Vector) -> None: - r""" - @brief Default constructor: creates a point at from an vector - This constructor is equivalent to computing point(0,0)+v. - This method has been introduced in version 0.25. - """ - @overload - def __init__(self, x: int, y: int) -> None: - r""" - @brief Constructor for a point from two coordinate values - - """ - def __itruediv__(self, d: float) -> Point: - r""" - @brief Division by some divisor - - - Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded. - """ - def __lt__(self, p: Point) -> bool: - r""" - @brief "less" comparison operator - - - This operator is provided to establish a sorting - order - """ - def __mul__(self, f: float) -> Point: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __ne__(self, p: object) -> bool: - r""" - @brief Inequality test operator - - """ - def __neg__(self) -> Point: - r""" - @brief Compute the negative of a point - - - Returns a new point with -x, -y. - - This method has been added in version 0.23. - """ - def __repr__(self) -> str: - r""" - @brief String conversion - """ - def __rmul__(self, f: float) -> Point: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __str__(self) -> str: - r""" - @brief String conversion - """ - @overload - def __sub__(self, p: Point) -> Vector: - r""" - @brief Subtract one point from another - - - Subtract point p from self by subtracting the coordinates. This renders a vector. - - Starting with version 0.25, this method renders a vector. - """ - @overload - def __sub__(self, v: Vector) -> Point: - r""" - @brief Subtract one vector from a point - - - Subtract vector v from from self by subtracting the coordinates. This renders a point. - - This method has been added in version 0.27. - """ - def __truediv__(self, d: float) -> Point: - r""" - @brief Division by some divisor - - - Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded. - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def abs(self) -> float: - r""" - @brief The absolute value of the point (Euclidian distance to 0,0) - - The returned value is 'sqrt(x*x+y*y)'. - - This method has been introduced in version 0.23. - """ - def assign(self, other: Point) -> None: - r""" - @brief Assigns another object to self - """ - def distance(self, d: Point) -> float: - r""" - @brief The Euclidian distance to another point - - - @param d The other point to compute the distance to. - """ - def dup(self) -> Point: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given point. This method enables points as hash keys. - - This method has been introduced in version 0.25. - """ - def sq_abs(self) -> float: - r""" - @brief The square of the absolute value of the point (Euclidian distance to 0,0) - - The returned value is 'x*x+y*y'. - - This method has been introduced in version 0.23. - """ - def sq_distance(self, d: Point) -> float: - r""" - @brief The square Euclidian distance to another point - - - @param d The other point to compute the distance to. - """ - def to_dtype(self, dbu: Optional[float] = ...) -> DPoint: - r""" - @brief Converts the point to a floating-point coordinate point - - The database unit can be specified to translate the integer-coordinate point into a floating-point coordinate point in micron units. The database unit is basically a scaling factor. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief String conversion - """ - def to_v(self) -> Vector: - r""" - @brief Turns the point into a vector - This method returns a vector representing the distance from (0,0) to the point.This method has been introduced in version 0.25. - """ - -class SimplePolygon: - r""" - @brief A simple polygon class - - A simple polygon consists of an outer hull only. To support polygons with holes, use \Polygon. - The hull contour consists of several points. The point - list is normalized such that the leftmost, lowest point is - the first one. The orientation is normalized such that - the orientation of the hull contour is clockwise. - - It is in no way checked that the contours are not overlapping - This must be ensured by the user of the object - when filling the contours. - - The \SimplePolygon class stores coordinates in integer format. A class that stores floating-point coordinates is \DSimplePolygon. - - See @The Database API@ for more details about the database objects. - """ - points: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the points of the simple polygon - - @param pts An array of points to assign to the simple polygon - - See the constructor description for details about raw mode. - """ - @classmethod - def ellipse(cls, box: Box, n: int) -> SimplePolygon: - r""" - @brief Creates a simple polygon approximating an ellipse - - @param box The bounding box of the ellipse - @param n The number of points that will be used to approximate the ellipse - - This method has been introduced in version 0.23. - """ - @classmethod - def from_s(cls, s: str) -> SimplePolygon: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - def __copy__(self) -> SimplePolygon: - r""" - @brief Creates a copy of self - """ - def __eq__(self, p: object) -> bool: - r""" - @brief Returns a value indicating whether self is equal to p - @param p The object to compare against - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor: creates an empty (invalid) polygon - """ - @overload - def __init__(self, box: Box) -> None: - r""" - @brief Constructor converting a box to a polygon - - @param box The box to convert to a polygon - """ - @overload - def __init__(self, dpolygon: DSimplePolygon) -> None: - r""" - @brief Creates an integer coordinate polygon from a floating-point coordinate polygon - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoly'. - """ - @overload - def __init__(self, pts: Sequence[Point], raw: Optional[bool] = ...) -> None: - r""" - @brief Constructor given the points of the simple polygon - - @param pts The points forming the simple polygon - @param raw If true, the points are taken as they are (see below) - - If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. - - Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. - - The 'raw' argument has been added in version 0.24. - """ - def __lt__(self, p: SimplePolygon) -> bool: - r""" - @brief Returns a value indicating whether self is less than p - @param p The object to compare against - This operator is provided to establish some, not necessarily a certain sorting order - - This method has been introduced in version 0.25. - """ - def __mul__(self, f: float) -> SimplePolygon: - r""" - @brief Scales the polygon by some factor - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __ne__(self, p: object) -> bool: - r""" - @brief Returns a value indicating whether self is not equal to p - @param p The object to compare against - """ - def __repr__(self) -> str: - r""" - @brief Returns a string representing the polygon - """ - def __rmul__(self, f: float) -> SimplePolygon: - r""" - @brief Scales the polygon by some factor - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __str__(self) -> str: - r""" - @brief Returns a string representing the polygon - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def area(self) -> int: - r""" - @brief Gets the area of the polygon - The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise. - """ - def area2(self) -> int: - r""" - @brief Gets the double area of the polygon - This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types. - - This method has been introduced in version 0.26.1 - """ - def assign(self, other: SimplePolygon) -> None: - r""" - @brief Assigns another object to self - """ - def bbox(self) -> Box: - r""" - @brief Returns the bounding box of the simple polygon - """ - def compress(self, remove_reflected: bool) -> None: - r""" - @brief Compressed the simple polygon. - - This method removes redundant points from the polygon, such as points being on a line formed by two other points. - If remove_reflected is true, points are also removed if the two adjacent edges form a spike. - - @param remove_reflected See description of the functionality. - - This method was introduced in version 0.18. - """ - def dup(self) -> SimplePolygon: - r""" - @brief Creates a copy of self - """ - def each_edge(self) -> Iterator[Edge]: - r""" - @brief Iterates over the edges that make up the simple polygon - """ - def each_point(self) -> Iterator[Point]: - r""" - @brief Iterates over the points that make up the simple polygon - """ - def extract_rad(self) -> List[Any]: - r""" - @brief Extracts the corner radii from a rounded polygon - - Attempts to extract the radii of rounded corner polygon. This is essentially the inverse of the \round_corners method. If this method succeeds, if will return an array of four elements: @ul - @li The polygon with the rounded corners replaced by edgy ones @/li - @li The radius of the inner corners @/li - @li The radius of the outer corners @/li - @li The number of points per full circle @/li - @/ul - - This method is based on some assumptions and may fail. In this case, an empty array is returned. - - If successful, the following code will more or less render the original polygon and parameters - - @code - p = ... # some polygon - p.round_corners(ri, ro, n) - (p2, ri2, ro2, n2) = p.extract_rad - # -> p2 == p, ro2 == ro, ri2 == ri, n2 == n (within some limits) - @/code - - This method was introduced in version 0.25. - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - def inside(self, p: Point) -> bool: - r""" - @brief Gets a value indicating whether the given point is inside the polygon - If the given point is inside or on the edge the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise. - """ - def is_box(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is a simple box. - - A polygon is a box if it is identical to it's bounding box. - - @return True if the polygon is a box. - - This method was introduced in version 0.23. - """ - def is_empty(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is empty - """ - def is_halfmanhattan(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is half-manhattan - Half-manhattan polygons have edges which are multiples of 45 degree. These polygons can be clipped at a rectangle without potential grid snapping. - - This predicate was introduced in version 0.27. - """ - def is_rectilinear(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is rectilinear - """ - @overload - def minkowski_sum(self, b: Box, resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of a polygon and a box - - @param b The box. - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and b. - - This method was introduced in version 0.22. - """ - @overload - def minkowski_sum(self, c: Sequence[Point], resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of a polygon and a contour of points (a trace) - - @param c The contour (a series of points forming the trace). - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and c. - - This method was introduced in version 0.22. - """ - @overload - def minkowski_sum(self, e: Edge, resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of a polygon and an edge - - @param e The edge. - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and e. - - This method was introduced in version 0.22. - """ - @overload - def minkowski_sum(self, p: SimplePolygon, resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of a polygon and a polygon - - @param p The other polygon. - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and p. - - This method was introduced in version 0.22. - """ - @overload - def move(self, p: Vector) -> SimplePolygon: - r""" - @brief Moves the simple polygon. - - Moves the simple polygon by the given offset and returns the - moved simple polygon. The polygon is overwritten. - - @param p The distance to move the simple polygon. - - @return The moved simple polygon. - """ - @overload - def move(self, x: int, y: int) -> SimplePolygon: - r""" - @brief Moves the polygon. - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is overwritten. - - @param x The x distance to move the polygon. - @param y The y distance to move the polygon. - - @return The moved polygon (self). - """ - @overload - def moved(self, p: Vector) -> SimplePolygon: - r""" - @brief Returns the moved simple polygon - - Moves the simple polygon by the given offset and returns the - moved simple polygon. The polygon is not modified. - - @param p The distance to move the simple polygon. - - @return The moved simple polygon. - """ - @overload - def moved(self, x: int, y: int) -> SimplePolygon: - r""" - @brief Returns the moved polygon (does not modify self) - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is not modified. - - @param x The x distance to move the polygon. - @param y The y distance to move the polygon. - - @return The moved polygon. - - This method has been introduced in version 0.23. - """ - def num_points(self) -> int: - r""" - @brief Gets the number of points - """ - def perimeter(self) -> int: - r""" - @brief Gets the perimeter of the polygon - The perimeter is sum of the lengths of all edges making up the polygon. - """ - def point(self, p: int) -> Point: - r""" - @brief Gets a specific point of the contour@param p The index of the point to get - If the index of the point is not a valid index, a default value is returned. - This method was introduced in version 0.18. - """ - def round_corners(self, rinner: float, router: float, n: int) -> SimplePolygon: - r""" - @brief Rounds the corners of the polygon - - Replaces the corners of the polygon with circle segments. - - @param rinner The circle radius of inner corners (in database units). - @param router The circle radius of outer corners (in database units). - @param n The number of points per full circle. - - @return The new polygon. - - This method was introduced in version 0.22 for integer coordinates and in 0.25 for all coordinate types. - """ - def set_points(self, pts: Sequence[Point], raw: Optional[bool] = ...) -> None: - r""" - @brief Sets the points of the simple polygon - - @param pts An array of points to assign to the simple polygon - @param raw If true, the points are taken as they are - - See the constructor description for details about raw mode. - - This method has been added in version 0.24. - """ - def split(self) -> List[SimplePolygon]: - r""" - @brief Splits the polygon into two or more parts - This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. - - The intended use for this method is a iteratively split polygons until the satisfy some maximum number of points limit. - - This method has been introduced in version 0.25.3. - """ - def to_dtype(self, dbu: Optional[float] = ...) -> DSimplePolygon: - r""" - @brief Converts the polygon to a floating-point coordinate polygon - - The database unit can be specified to translate the integer-coordinate polygon into a floating-point coordinate polygon in micron units. The database unit is basically a scaling factor. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief Returns a string representing the polygon - """ - @overload - def touches(self, box: Box) -> bool: - r""" - @brief Returns true, if the polygon touches the given box. - The box and the polygon touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, edge: Edge) -> bool: - r""" - @brief Returns true, if the polygon touches the given edge. - The edge and the polygon touch if they overlap or the edge shares at least one point with the polygon's contour. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, polygon: Polygon) -> bool: - r""" - @brief Returns true, if the polygon touches the other polygon. - The polygons touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, simple_polygon: SimplePolygon) -> bool: - r""" - @brief Returns true, if the polygon touches the other polygon. - The polygons touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def transform(self, t: ICplxTrans) -> SimplePolygon: - r""" - @brief Transforms the simple polygon with a complex transformation (in-place) - - Transforms the simple polygon with the given complex transformation. - Modifies self and returns self. An out-of-place version which does not modify self is \transformed. - - @param t The transformation to apply. - - This method has been introduced in version 0.24. - """ - @overload - def transform(self, t: Trans) -> SimplePolygon: - r""" - @brief Transforms the simple polygon (in-place) - - Transforms the simple polygon with the given transformation. - Modifies self and returns self. An out-of-place version which does not modify self is \transformed. - - @param t The transformation to apply. - - This method has been introduced in version 0.24. - """ - @overload - def transformed(self, t: CplxTrans) -> DSimplePolygon: - r""" - @brief Transforms the simple polygon. - - Transforms the simple polygon with the given complex transformation. - Does not modify the simple polygon but returns the transformed polygon. - - @param t The transformation to apply. - - @return The transformed simple polygon. - - With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. - """ - @overload - def transformed(self, t: ICplxTrans) -> SimplePolygon: - r""" - @brief Transforms the simple polygon. - - Transforms the simple polygon with the given complex transformation. - Does not modify the simple polygon but returns the transformed polygon. - - @param t The transformation to apply. - - @return The transformed simple polygon (in this case an integer coordinate object). - - This method has been introduced in version 0.18. - """ - @overload - def transformed(self, t: Trans) -> SimplePolygon: - r""" - @brief Transforms the simple polygon. - - Transforms the simple polygon with the given transformation. - Does not modify the simple polygon but returns the transformed polygon. - - @param t The transformation to apply. - - @return The transformed simple polygon. - """ - -class DSimplePolygon: - r""" - @brief A simple polygon class - - A simple polygon consists of an outer hull only. To support polygons with holes, use \DPolygon. - The contour consists of several points. The point - list is normalized such that the leftmost, lowest point is - the first one. The orientation is normalized such that - the orientation of the hull contour is clockwise. - - It is in no way checked that the contours are not over- - lapping. This must be ensured by the user of the object - when filling the contours. - - The \DSimplePolygon class stores coordinates in floating-point format which gives a higher precision for some operations. A class that stores integer coordinates is \SimplePolygon. - - See @The Database API@ for more details about the database objects. - """ - points: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the points of the simple polygon - - @param pts An array of points to assign to the simple polygon - - See the constructor description for details about raw mode. - """ - @classmethod - def ellipse(cls, box: DBox, n: int) -> DSimplePolygon: - r""" - @brief Creates a simple polygon approximating an ellipse - - @param box The bounding box of the ellipse - @param n The number of points that will be used to approximate the ellipse - - This method has been introduced in version 0.23. - """ - @classmethod - def from_s(cls, s: str) -> DSimplePolygon: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - def __copy__(self) -> DSimplePolygon: - r""" - @brief Creates a copy of self - """ - def __eq__(self, p: object) -> bool: - r""" - @brief Returns a value indicating whether self is equal to p - @param p The object to compare against - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor: creates an empty (invalid) polygon - """ - @overload - def __init__(self, box: DBox) -> None: - r""" - @brief Constructor converting a box to a polygon - - @param box The box to convert to a polygon - """ - @overload - def __init__(self, polygon: SimplePolygon) -> None: - r""" - @brief Creates a floating-point coordinate polygon from an integer coordinate polygon - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipoly'. - """ - @overload - def __init__(self, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> None: - r""" - @brief Constructor given the points of the simple polygon - - @param pts The points forming the simple polygon - @param raw If true, the points are taken as they are (see below) - - If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. - - Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. - - The 'raw' argument has been added in version 0.24. - """ - def __lt__(self, p: DSimplePolygon) -> bool: - r""" - @brief Returns a value indicating whether self is less than p - @param p The object to compare against - This operator is provided to establish some, not necessarily a certain sorting order - - This method has been introduced in version 0.25. - """ - def __mul__(self, f: float) -> DSimplePolygon: - r""" - @brief Scales the polygon by some factor - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __ne__(self, p: object) -> bool: - r""" - @brief Returns a value indicating whether self is not equal to p - @param p The object to compare against - """ - def __repr__(self) -> str: - r""" - @brief Returns a string representing the polygon - """ - def __rmul__(self, f: float) -> DSimplePolygon: - r""" - @brief Scales the polygon by some factor - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __str__(self) -> str: - r""" - @brief Returns a string representing the polygon - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def area(self) -> float: - r""" - @brief Gets the area of the polygon - The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise. - """ - def area2(self) -> float: - r""" - @brief Gets the double area of the polygon - This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types. - - This method has been introduced in version 0.26.1 - """ - def assign(self, other: DSimplePolygon) -> None: - r""" - @brief Assigns another object to self - """ - def bbox(self) -> DBox: - r""" - @brief Returns the bounding box of the simple polygon - """ - def compress(self, remove_reflected: bool) -> None: - r""" - @brief Compressed the simple polygon. - - This method removes redundant points from the polygon, such as points being on a line formed by two other points. - If remove_reflected is true, points are also removed if the two adjacent edges form a spike. - - @param remove_reflected See description of the functionality. - - This method was introduced in version 0.18. - """ - def dup(self) -> DSimplePolygon: - r""" - @brief Creates a copy of self - """ - def each_edge(self) -> Iterator[DEdge]: - r""" - @brief Iterates over the edges that make up the simple polygon - """ - def each_point(self) -> Iterator[DPoint]: - r""" - @brief Iterates over the points that make up the simple polygon - """ - def extract_rad(self) -> List[Any]: - r""" - @brief Extracts the corner radii from a rounded polygon - - Attempts to extract the radii of rounded corner polygon. This is essentially the inverse of the \round_corners method. If this method succeeds, if will return an array of four elements: @ul - @li The polygon with the rounded corners replaced by edgy ones @/li - @li The radius of the inner corners @/li - @li The radius of the outer corners @/li - @li The number of points per full circle @/li - @/ul - - This method is based on some assumptions and may fail. In this case, an empty array is returned. - - If successful, the following code will more or less render the original polygon and parameters - - @code - p = ... # some polygon - p.round_corners(ri, ro, n) - (p2, ri2, ro2, n2) = p.extract_rad - # -> p2 == p, ro2 == ro, ri2 == ri, n2 == n (within some limits) - @/code - - This method was introduced in version 0.25. - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - def inside(self, p: DPoint) -> bool: - r""" - @brief Gets a value indicating whether the given point is inside the polygon - If the given point is inside or on the edge the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise. - """ - def is_box(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is a simple box. - - A polygon is a box if it is identical to it's bounding box. - - @return True if the polygon is a box. - - This method was introduced in version 0.23. - """ - def is_empty(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is empty - """ - def is_halfmanhattan(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is half-manhattan - Half-manhattan polygons have edges which are multiples of 45 degree. These polygons can be clipped at a rectangle without potential grid snapping. - - This predicate was introduced in version 0.27. - """ - def is_rectilinear(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is rectilinear - """ - @overload - def move(self, p: DVector) -> DSimplePolygon: - r""" - @brief Moves the simple polygon. - - Moves the simple polygon by the given offset and returns the - moved simple polygon. The polygon is overwritten. - - @param p The distance to move the simple polygon. - - @return The moved simple polygon. - """ - @overload - def move(self, x: float, y: float) -> DSimplePolygon: - r""" - @brief Moves the polygon. - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is overwritten. - - @param x The x distance to move the polygon. - @param y The y distance to move the polygon. - - @return The moved polygon (self). - """ - @overload - def moved(self, p: DVector) -> DSimplePolygon: - r""" - @brief Returns the moved simple polygon - - Moves the simple polygon by the given offset and returns the - moved simple polygon. The polygon is not modified. - - @param p The distance to move the simple polygon. - - @return The moved simple polygon. - """ - @overload - def moved(self, x: float, y: float) -> DSimplePolygon: - r""" - @brief Returns the moved polygon (does not modify self) - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is not modified. - - @param x The x distance to move the polygon. - @param y The y distance to move the polygon. - - @return The moved polygon. - - This method has been introduced in version 0.23. - """ - def num_points(self) -> int: - r""" - @brief Gets the number of points - """ - def perimeter(self) -> float: - r""" - @brief Gets the perimeter of the polygon - The perimeter is sum of the lengths of all edges making up the polygon. - """ - def point(self, p: int) -> DPoint: - r""" - @brief Gets a specific point of the contour@param p The index of the point to get - If the index of the point is not a valid index, a default value is returned. - This method was introduced in version 0.18. - """ - def round_corners(self, rinner: float, router: float, n: int) -> DSimplePolygon: - r""" - @brief Rounds the corners of the polygon - - Replaces the corners of the polygon with circle segments. - - @param rinner The circle radius of inner corners (in database units). - @param router The circle radius of outer corners (in database units). - @param n The number of points per full circle. - - @return The new polygon. - - This method was introduced in version 0.22 for integer coordinates and in 0.25 for all coordinate types. - """ - def set_points(self, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> None: - r""" - @brief Sets the points of the simple polygon - - @param pts An array of points to assign to the simple polygon - @param raw If true, the points are taken as they are - - See the constructor description for details about raw mode. - - This method has been added in version 0.24. - """ - def split(self) -> List[DSimplePolygon]: - r""" - @brief Splits the polygon into two or more parts - This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. - - The intended use for this method is a iteratively split polygons until the satisfy some maximum number of points limit. - - This method has been introduced in version 0.25.3. - """ - def to_itype(self, dbu: Optional[float] = ...) -> SimplePolygon: - r""" - @brief Converts the polygon to an integer coordinate polygon - The database unit can be specified to translate the floating-point coordinate polygon in micron units to an integer-coordinate polygon in database units. The polygon's' coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief Returns a string representing the polygon - """ - @overload - def touches(self, box: DBox) -> bool: - r""" - @brief Returns true, if the polygon touches the given box. - The box and the polygon touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, edge: DEdge) -> bool: - r""" - @brief Returns true, if the polygon touches the given edge. - The edge and the polygon touch if they overlap or the edge shares at least one point with the polygon's contour. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, polygon: DPolygon) -> bool: - r""" - @brief Returns true, if the polygon touches the other polygon. - The polygons touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, simple_polygon: DSimplePolygon) -> bool: - r""" - @brief Returns true, if the polygon touches the other polygon. - The polygons touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def transform(self, t: DCplxTrans) -> DSimplePolygon: - r""" - @brief Transforms the simple polygon with a complex transformation (in-place) - - Transforms the simple polygon with the given complex transformation. - Modifies self and returns self. An out-of-place version which does not modify self is \transformed. - - @param t The transformation to apply. - - This method has been introduced in version 0.24. - """ - @overload - def transform(self, t: DTrans) -> DSimplePolygon: - r""" - @brief Transforms the simple polygon (in-place) - - Transforms the simple polygon with the given transformation. - Modifies self and returns self. An out-of-place version which does not modify self is \transformed. - - @param t The transformation to apply. - - This method has been introduced in version 0.24. - """ - @overload - def transformed(self, t: DCplxTrans) -> DSimplePolygon: - r""" - @brief Transforms the simple polygon. - - Transforms the simple polygon with the given complex transformation. - Does not modify the simple polygon but returns the transformed polygon. - - @param t The transformation to apply. - - @return The transformed simple polygon. - - With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. - """ - @overload - def transformed(self, t: DTrans) -> DSimplePolygon: - r""" - @brief Transforms the simple polygon. - - Transforms the simple polygon with the given transformation. - Does not modify the simple polygon but returns the transformed polygon. - - @param t The transformation to apply. - - @return The transformed simple polygon. - """ - @overload - def transformed(self, t: VCplxTrans) -> SimplePolygon: - r""" - @brief Transforms the polygon with the given complex transformation - - @param t The magnifying transformation to apply - @return The transformed polygon (in this case an integer coordinate polygon) - - This method has been introduced in version 0.25. - """ - -class Polygon: - r""" - @brief A polygon class - - A polygon consists of an outer hull and zero to many - holes. Each contour consists of several points. The point - list is normalized such that the leftmost, lowest point is - the first one. The orientation is normalized such that - the orientation of the hull contour is clockwise, while - the orientation of the holes is counterclockwise. - - It is in no way checked that the contours are not overlapping. - This must be ensured by the user of the object - when filling the contours. - - A polygon can be asked for the number of holes using the \holes method. \each_point_hull delivers the points of the hull contour. \each_point_hole delivers the points of a specific hole. \each_edge delivers the edges (point-to-point connections) of both hull and holes. \bbox delivers the bounding box, \area the area and \perimeter the perimeter of the polygon. - - Here's an example of how to create a polygon: - - @code - hull = [ RBA::Point::new(0, 0), RBA::Point::new(6000, 0), - RBA::Point::new(6000, 3000), RBA::Point::new(0, 3000) ] - hole1 = [ RBA::Point::new(1000, 1000), RBA::Point::new(2000, 1000), - RBA::Point::new(2000, 2000), RBA::Point::new(1000, 2000) ] - hole2 = [ RBA::Point::new(3000, 1000), RBA::Point::new(4000, 1000), - RBA::Point::new(4000, 2000), RBA::Point::new(3000, 2000) ] - poly = RBA::Polygon::new(hull) - poly.insert_hole(hole1) - poly.insert_hole(hole2) - - # ask the polygon for some properties - poly.holes # -> 2 - poly.area # -> 16000000 - poly.perimeter # -> 26000 - poly.bbox # -> (0,0;6000,3000) - @/code - - The \Polygon class stores coordinates in integer format. A class that stores floating-point coordinates is \DPolygon. - - See @The Database API@ for more details about the database objects. - """ - PO_any: ClassVar[int] - r""" - @brief A value for the preferred orientation parameter of \decompose_convex - This value indicates that there is not cut preference - This constant has been introduced in version 0.25. - """ - PO_horizontal: ClassVar[int] - r""" - @brief A value for the preferred orientation parameter of \decompose_convex - This value indicates that there only horizontal cuts are allowed - This constant has been introduced in version 0.25. - """ - PO_htrapezoids: ClassVar[int] - r""" - @brief A value for the preferred orientation parameter of \decompose_convex - This value indicates that cuts shall favor decomposition into horizontal trapezoids - This constant has been introduced in version 0.25. - """ - PO_vertical: ClassVar[int] - r""" - @brief A value for the preferred orientation parameter of \decompose_convex - This value indicates that there only vertical cuts are allowed - This constant has been introduced in version 0.25. - """ - PO_vtrapezoids: ClassVar[int] - r""" - @brief A value for the preferred orientation parameter of \decompose_convex - This value indicates that cuts shall favor decomposition into vertical trapezoids - This constant has been introduced in version 0.25. - """ - TD_htrapezoids: ClassVar[int] - r""" - @brief A value for the mode parameter of \decompose_trapezoids - This value indicates simple decomposition mode. This mode produces horizontal trapezoids and tries to minimize the number of trapezoids. - This constant has been introduced in version 0.25. - """ - TD_simple: ClassVar[int] - r""" - @brief A value for the mode parameter of \decompose_trapezoids - This value indicates simple decomposition mode. This mode is fast but does not make any attempts to produce less trapezoids. - This constant has been introduced in version 0.25. - """ - TD_vtrapezoids: ClassVar[int] - r""" - @brief A value for the mode parameter of \decompose_trapezoids - This value indicates simple decomposition mode. This mode produces vertical trapezoids and tries to minimize the number of trapezoids. - """ - hull: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the points of the hull of polygon - @param p An array of points to assign to the polygon's hull - The 'assign_hull' variant is provided in analogy to 'assign_hole'. - """ - @classmethod - def ellipse(cls, box: Box, n: int) -> Polygon: - r""" - @brief Creates a simple polygon approximating an ellipse - - @param box The bounding box of the ellipse - @param n The number of points that will be used to approximate the ellipse - - This method has been introduced in version 0.23. - """ - @classmethod - def from_s(cls, s: str) -> Polygon: - r""" - @brief Creates a polygon from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - def __copy__(self) -> Polygon: - r""" - @brief Creates a copy of self - """ - def __eq__(self, p: object) -> bool: - r""" - @brief Returns a value indicating whether the polygons are equal - @param p The object to compare against - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates an empty (invalid) polygon - """ - @overload - def __init__(self, box: Box) -> None: - r""" - @brief Creates a polygon from a box - - @param box The box to convert to a polygon - """ - @overload - def __init__(self, dpolygon: DPolygon) -> None: - r""" - @brief Creates an integer coordinate polygon from a floating-point coordinate polygon - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpolygon'. - """ - @overload - def __init__(self, sp: SimplePolygon) -> None: - r""" - @brief Creates a polygon from a simple polygon - @param sp The simple polygon that is converted into the polygon - This method was introduced in version 0.22. - """ - @overload - def __init__(self, pts: Sequence[Point], raw: Optional[bool] = ...) -> None: - r""" - @brief Creates a polygon from a point array for the hull - - @param pts The points forming the polygon hull - @param raw If true, the point list won't be modified (see \assign_hull) - - The 'raw' argument was added in version 0.24. - """ - def __lt__(self, p: Polygon) -> bool: - r""" - @brief Returns a value indicating whether self is less than p - @param p The object to compare against - This operator is provided to establish some, not necessarily a certain sorting order - """ - def __mul__(self, f: float) -> Polygon: - r""" - @brief Scales the polygon by some factor - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __ne__(self, p: object) -> bool: - r""" - @brief Returns a value indicating whether the polygons are not equal - @param p The object to compare against - """ - def __repr__(self) -> str: - r""" - @brief Returns a string representing the polygon - """ - def __rmul__(self, f: float) -> Polygon: - r""" - @brief Scales the polygon by some factor - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __str__(self) -> str: - r""" - @brief Returns a string representing the polygon - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def area(self) -> int: - r""" - @brief Gets the area of the polygon - The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise.Orientation is ensured automatically in most cases. - """ - def area2(self) -> int: - r""" - @brief Gets the double area of the polygon - This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types. - - This method has been introduced in version 0.26.1 - """ - def assign(self, other: Polygon) -> None: - r""" - @brief Assigns another object to self - """ - @overload - def assign_hole(self, n: int, b: Box) -> None: - r""" - @brief Sets the box as the given hole of the polygon - @param n The index of the hole to which the points should be assigned - @param b The box to assign to the polygon's hole - If the hole index is not valid, this method does nothing. - This method was introduced in version 0.23. - """ - @overload - def assign_hole(self, n: int, p: Sequence[Point], raw: Optional[bool] = ...) -> None: - r""" - @brief Sets the points of the given hole of the polygon - @param n The index of the hole to which the points should be assigned - @param p An array of points to assign to the polygon's hole - @param raw If true, the points won't be compressed (see \assign_hull) - If the hole index is not valid, this method does nothing. - - This method was introduced in version 0.18. - The 'raw' argument was added in version 0.24. - """ - def assign_hull(self, p: Sequence[Point], raw: Optional[bool] = ...) -> None: - r""" - @brief Sets the points of the hull of polygon - @param p An array of points to assign to the polygon's hull - @param raw If true, the points won't be compressed - - If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. - - Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. - - The 'assign_hull' variant is provided in analogy to 'assign_hole'. - - The 'raw' argument was added in version 0.24. - """ - def bbox(self) -> Box: - r""" - @brief Returns the bounding box of the polygon - The bounding box is the box enclosing all points of the polygon. - """ - def compress(self, remove_reflected: bool) -> None: - r""" - @brief Compresses the polygon. - - This method removes redundant points from the polygon, such as points being on a line formed by two other points. - If remove_reflected is true, points are also removed if the two adjacent edges form a spike. - - @param remove_reflected See description of the functionality. - - This method was introduced in version 0.18. - """ - def decompose_convex(self, preferred_orientation: Optional[int] = ...) -> List[SimplePolygon]: - r""" - @brief Decomposes the polygon into convex pieces - - This method returns a decomposition of the polygon that contains convex pieces only. - If the polygon was convex already, the list returned has a single element which is the - original polygon. - - @param preferred_orientation One of the PO_... constants - - This method was introduced in version 0.25. - """ - def decompose_trapezoids(self, mode: Optional[int] = ...) -> List[SimplePolygon]: - r""" - @brief Decomposes the polygon into trapezoids - - This method returns a decomposition of the polygon into trapezoid pieces. - It supports different modes for various applications. See the TD_... constants for details. - - @param mode One of the TD_... constants - - This method was introduced in version 0.25. - """ - def dup(self) -> Polygon: - r""" - @brief Creates a copy of self - """ - @overload - def each_edge(self) -> Iterator[Edge]: - r""" - @brief Iterates over the edges that make up the polygon - - This iterator will deliver all edges, including those of the holes. Hole edges are oriented counterclockwise while hull edges are oriented clockwise. - """ - @overload - def each_edge(self, contour: int) -> Iterator[Edge]: - r""" - @brief Iterates over the edges of one contour of the polygon - - @param contour The contour number (0 for hull, 1 for first hole ...) - - This iterator will deliver all edges of the contour specified by the contour parameter. The hull has contour number 0, the first hole has contour 1 etc. - Hole edges are oriented counterclockwise while hull edges are oriented clockwise. - - This method was introduced in version 0.24. - """ - def each_point_hole(self, n: int) -> Iterator[Point]: - r""" - @brief Iterates over the points that make up the nth hole - The hole number must be less than the number of holes (see \holes) - """ - def each_point_hull(self) -> Iterator[Point]: - r""" - @brief Iterates over the points that make up the hull - """ - def extract_rad(self) -> List[Any]: - r""" - @brief Extracts the corner radii from a rounded polygon - - Attempts to extract the radii of rounded corner polygon. This is essentially the inverse of the \round_corners method. If this method succeeds, if will return an array of four elements: @ul - @li The polygon with the rounded corners replaced by edgy ones @/li - @li The radius of the inner corners @/li - @li The radius of the outer corners @/li - @li The number of points per full circle @/li - @/ul - - This method is based on some assumptions and may fail. In this case, an empty array is returned. - - If successful, the following code will more or less render the original polygon and parameters - - @code - p = ... # some polygon - p.round_corners(ri, ro, n) - (p2, ri2, ro2, n2) = p.extract_rad - # -> p2 == p, ro2 == ro, ri2 == ri, n2 == n (within some limits) - @/code - - This method was introduced in version 0.25. - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - def holes(self) -> int: - r""" - @brief Returns the number of holes - """ - @overload - def insert_hole(self, b: Box) -> None: - r""" - @brief Inserts a hole from the given box - @param b The box to insert as a new hole - This method was introduced in version 0.23. - """ - @overload - def insert_hole(self, p: Sequence[Point], raw: Optional[bool] = ...) -> None: - r""" - @brief Inserts a hole with the given points - @param p An array of points to insert as a new hole - @param raw If true, the points won't be compressed (see \assign_hull) - - The 'raw' argument was added in version 0.24. - """ - def inside(self, p: Point) -> bool: - r""" - @brief Tests, if the given point is inside the polygon - If the given point is inside or on the edge of the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise. - """ - def is_box(self) -> bool: - r""" - @brief Returns true, if the polygon is a simple box. - - A polygon is a box if it is identical to it's bounding box. - - @return True if the polygon is a box. - - This method was introduced in version 0.23. - """ - def is_convex(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is convex - - This method will return true, if the polygon is convex. - - This method was introduced in version 0.25. - """ - def is_empty(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is empty - """ - def is_halfmanhattan(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is half-manhattan - Half-manhattan polygons have edges which are multiples of 45 degree. These polygons can be clipped at a rectangle without potential grid snapping. - - This predicate was introduced in version 0.27. - """ - def is_rectilinear(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is rectilinear - """ - @overload - def minkowski_sum(self, b: Box, resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of the polygon and a box - - @param b The box. - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and the box. - - This method was introduced in version 0.22. - """ - @overload - def minkowski_sum(self, b: Polygon, resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of the polygon and a polygon - - @param p The first argument. - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and p. - - This method was introduced in version 0.22. - """ - @overload - def minkowski_sum(self, b: Sequence[Point], resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of the polygon and a contour of points (a trace) - - @param b The contour (a series of points forming the trace). - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and the contour. - - This method was introduced in version 0.22. - """ - @overload - def minkowski_sum(self, e: Edge, resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of the polygon and an edge - - @param e The edge. - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum with the edge e. - - The Minkowski sum of a polygon and an edge basically results in the area covered when "dragging" the polygon along the line given by the edge. The effect is similar to drawing the line with a pencil that has the shape of the given polygon. - - This method was introduced in version 0.22. - """ - @overload - def move(self, p: Vector) -> Polygon: - r""" - @brief Moves the polygon. - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is overwritten. - - @param p The distance to move the polygon. - - @return The moved polygon (self). - - This method has been introduced in version 0.23. - """ - @overload - def move(self, x: int, y: int) -> Polygon: - r""" - @brief Moves the polygon. - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is overwritten. - - @param x The x distance to move the polygon. - @param y The y distance to move the polygon. - - @return The moved polygon (self). - """ - @overload - def moved(self, p: Vector) -> Polygon: - r""" - @brief Returns the moved polygon (does not modify self) - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is not modified. - - @param p The distance to move the polygon. - - @return The moved polygon. - - This method has been introduced in version 0.23. - """ - @overload - def moved(self, x: int, y: int) -> Polygon: - r""" - @brief Returns the moved polygon (does not modify self) - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is not modified. - - @param x The x distance to move the polygon. - @param y The y distance to move the polygon. - - @return The moved polygon. - - This method has been introduced in version 0.23. - """ - def num_points(self) -> int: - r""" - @brief Gets the total number of points (hull plus holes) - This method was introduced in version 0.18. - """ - def num_points_hole(self, n: int) -> int: - r""" - @brief Gets the number of points of the given hole - The argument gives the index of the hole of which the number of points are requested. The index must be less than the number of holes (see \holes). - """ - def num_points_hull(self) -> int: - r""" - @brief Gets the number of points of the hull - """ - def perimeter(self) -> int: - r""" - @brief Gets the perimeter of the polygon - The perimeter is sum of the lengths of all edges making up the polygon. - - This method has been introduce in version 0.23. - """ - def point_hole(self, n: int, p: int) -> Point: - r""" - @brief Gets a specific point of a hole - @param n The index of the hole to which the points should be assigned - @param p The index of the point to get - If the index of the point or of the hole is not valid, a default value is returned. - This method was introduced in version 0.18. - """ - def point_hull(self, p: int) -> Point: - r""" - @brief Gets a specific point of the hull - @param p The index of the point to get - If the index of the point is not a valid index, a default value is returned. - This method was introduced in version 0.18. - """ - def resolve_holes(self) -> None: - r""" - @brief Resolve holes by inserting cut lines and joining the holes with the hull - - This method modifies the polygon. The out-of-place version is \resolved_holes. - This method was introduced in version 0.22. - """ - def resolved_holes(self) -> Polygon: - r""" - @brief Returns a polygon without holes - - @return The new polygon without holes. - - This method does not modify the polygon but return a new polygon. - This method was introduced in version 0.22. - """ - def round_corners(self, rinner: float, router: float, n: int) -> Polygon: - r""" - @brief Rounds the corners of the polygon - - Replaces the corners of the polygon with circle segments. - - @param rinner The circle radius of inner corners (in database units). - @param router The circle radius of outer corners (in database units). - @param n The number of points per full circle. - - @return The new polygon. - - This method was introduced in version 0.20 for integer coordinates and in 0.25 for all coordinate types. - """ - @overload - def size(self, d: int) -> None: - r""" - @brief Sizes the polygon (biasing) - - Shifts the contour outwards (d>0) or inwards (d<0). - This method is equivalent to - @code - size(d, d, 2) - @/code - - See \size for a detailed description. - """ - @overload - def size(self, d: int, mode: int) -> None: - r""" - @brief Sizes the polygon (biasing) - - Shifts the contour outwards (d>0) or inwards (d<0). - This method is equivalent to - @code - size(d, d, mode) - @/code - - See \size for a detailed description. - - This method has been introduced in version 0.23. - """ - @overload - def size(self, dx: int, dy: int, mode: int) -> None: - r""" - @brief Sizes the polygon (biasing) - - Shifts the contour outwards (dx,dy>0) or inwards (dx,dy<0). - dx is the sizing in x-direction and dy is the sizing in y-direction. The sign of dx and dy should be identical. - The sizing operation create invalid (self-overlapping, reverse oriented) contours. - - The mode defines at which bending angle cutoff occurs - (0:>0, 1:>45, 2:>90, 3:>135, 4:>approx. 168, other:>approx. 179) - - In order to obtain a proper polygon in the general case, the - sized polygon must be merged in 'greater than zero' wrap count mode. This is necessary since in the general case, - sizing can be complicated operation which lets a single polygon fall apart into disjoint pieces for example. - This can be achieved using the \EdgeProcessor class for example: - - @code - poly = ... # a RBA::Polygon - poly.size(-50, 2) - ep = RBA::EdgeProcessor::new - # result is an array of RBA::Polygon objects - result = ep.simple_merge_p2p([ poly ], false, false, 1) - @/code - """ - @overload - def sized(self, d: int) -> Polygon: - r""" - @brief Sizes the polygon (biasing) - - @brief Sizing (biasing) without modifying self - This method is equivalent to - @code - sized(d, d, 2) - @/code - - See \size and \sized for a detailed description. - """ - @overload - def sized(self, d: int, mode: int) -> Polygon: - r""" - @brief Sizes the polygon (biasing) without modifying self - - Shifts the contour outwards (d>0) or inwards (d<0). - This method is equivalent to - @code - sized(d, d, mode) - @/code - - See \size and \sized for a detailed description. - """ - @overload - def sized(self, dx: int, dy: int, mode: int) -> Polygon: - r""" - @brief Sizes the polygon (biasing) without modifying self - - This method applies sizing to the polygon but does not modify self. Instead a sized copy is returned. - See \size for a description of the operation. - - This method has been introduced in version 0.23. - """ - def smooth(self, d: int, keep_hv: Optional[bool] = ...) -> Polygon: - r""" - @brief Smooths a polygon - - Remove vertices that deviate by more than the distance d from the average contour. - The value d is basically the roughness which is removed. - - @param d The smoothing "roughness". - @param keep_hv If true, horizontal and vertical edges will be preserved always. - - @return The smoothed polygon. - - This method was introduced in version 0.23. The 'keep_hv' optional parameter was added in version 0.27. - """ - def split(self) -> List[Polygon]: - r""" - @brief Splits the polygon into two or more parts - This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. - - The intended use for this method is a iteratively split polygons until the satisfy some maximum number of points limit. - - This method has been introduced in version 0.25.3. - """ - def to_dtype(self, dbu: Optional[float] = ...) -> DPolygon: - r""" - @brief Converts the polygon to a floating-point coordinate polygon - - The database unit can be specified to translate the integer-coordinate polygon into a floating-point coordinate polygon in micron units. The database unit is basically a scaling factor. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief Returns a string representing the polygon - """ - def to_simple_polygon(self) -> SimplePolygon: - r""" - @brief Converts a polygon to a simple polygon - - @return The simple polygon. - - If the polygon contains holes, these will be resolved. - This operation requires a well-formed polygon. Reflecting edges, self-intersections and coincident points will be removed. - - This method was introduced in version 0.22. - """ - @overload - def touches(self, box: Box) -> bool: - r""" - @brief Returns true, if the polygon touches the given box. - The box and the polygon touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, edge: Edge) -> bool: - r""" - @brief Returns true, if the polygon touches the given edge. - The edge and the polygon touch if they overlap or the edge shares at least one point with the polygon's contour. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, polygon: Polygon) -> bool: - r""" - @brief Returns true, if the polygon touches the other polygon. - The polygons touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, simple_polygon: SimplePolygon) -> bool: - r""" - @brief Returns true, if the polygon touches the other polygon. - The polygons touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def transform(self, t: ICplxTrans) -> Polygon: - r""" - @brief Transforms the polygon with a complex transformation (in-place) - - Transforms the polygon with the given complex transformation. - This version modifies self and will return self as the modified polygon. An out-of-place version which does not modify self is \transformed. - - @param t The transformation to apply. - - This method was introduced in version 0.24. - """ - @overload - def transform(self, t: Trans) -> Polygon: - r""" - @brief Transforms the polygon (in-place) - - Transforms the polygon with the given transformation. - Modifies self and returns self. An out-of-place version which does not modify self is \transformed. - - @param t The transformation to apply. - - This method has been introduced in version 0.24. - """ - @overload - def transformed(self, t: CplxTrans) -> DPolygon: - r""" - @brief Transforms the polygon with a complex transformation - - Transforms the polygon with the given complex transformation. - Does not modify the polygon but returns the transformed polygon. - - @param t The transformation to apply. - - @return The transformed polygon. - - With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. - """ - @overload - def transformed(self, t: Trans) -> Polygon: - r""" - @brief Transforms the polygon - - Transforms the polygon with the given transformation. - Does not modify the polygon but returns the transformed polygon. - - @param t The transformation to apply. - - @return The transformed polygon. - """ - -class DPolygon: - r""" - @brief A polygon class - - A polygon consists of an outer hull and zero to many - holes. Each contour consists of several points. The point - list is normalized such that the leftmost, lowest point is - the first one. The orientation is normalized such that - the orientation of the hull contour is clockwise, while - the orientation of the holes is counterclockwise. - - It is in no way checked that the contours are not overlapping. - This must be ensured by the user of the object - when filling the contours. - - A polygon can be asked for the number of holes using the \holes method. \each_point_hull delivers the points of the hull contour. \each_point_hole delivers the points of a specific hole. \each_edge delivers the edges (point-to-point connections) of both hull and holes. \bbox delivers the bounding box, \area the area and \perimeter the perimeter of the polygon. - - Here's an example of how to create a polygon: - - @code - hull = [ RBA::DPoint::new(0, 0), RBA::DPoint::new(6000, 0), - RBA::DPoint::new(6000, 3000), RBA::DPoint::new(0, 3000) ] - hole1 = [ RBA::DPoint::new(1000, 1000), RBA::DPoint::new(2000, 1000), - RBA::DPoint::new(2000, 2000), RBA::DPoint::new(1000, 2000) ] - hole2 = [ RBA::DPoint::new(3000, 1000), RBA::DPoint::new(4000, 1000), - RBA::DPoint::new(4000, 2000), RBA::DPoint::new(3000, 2000) ] - poly = RBA::DPolygon::new(hull) - poly.insert_hole(hole1) - poly.insert_hole(hole2) - - # ask the polygon for some properties - poly.holes # -> 2 - poly.area # -> 16000000.0 - poly.perimeter # -> 26000.0 - poly.bbox # -> (0,0;6000,3000) - @/code - - The \DPolygon class stores coordinates in floating-point format which gives a higher precision for some operations. A class that stores integer coordinates is \Polygon. - - See @The Database API@ for more details about the database objects. - """ - hull: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the points of the hull of polygon - @param p An array of points to assign to the polygon's hull - The 'assign_hull' variant is provided in analogy to 'assign_hole'. - """ - @classmethod - def ellipse(cls, box: DBox, n: int) -> DPolygon: - r""" - @brief Creates a simple polygon approximating an ellipse - - @param box The bounding box of the ellipse - @param n The number of points that will be used to approximate the ellipse - - This method has been introduced in version 0.23. - """ - @classmethod - def from_s(cls, s: str) -> DPolygon: - r""" - @brief Creates a polygon from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - def __copy__(self) -> DPolygon: - r""" - @brief Creates a copy of self - """ - def __eq__(self, p: object) -> bool: - r""" - @brief Returns a value indicating whether the polygons are equal - @param p The object to compare against - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates an empty (invalid) polygon - """ - @overload - def __init__(self, box: DBox) -> None: - r""" - @brief Creates a polygon from a box - - @param box The box to convert to a polygon - """ - @overload - def __init__(self, polygon: Polygon) -> None: - r""" - @brief Creates a floating-point coordinate polygon from an integer coordinate polygon - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipolygon'. - """ - @overload - def __init__(self, sp: DSimplePolygon) -> None: - r""" - @brief Creates a polygon from a simple polygon - @param sp The simple polygon that is converted into the polygon - This method was introduced in version 0.22. - """ - @overload - def __init__(self, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> None: - r""" - @brief Creates a polygon from a point array for the hull - - @param pts The points forming the polygon hull - @param raw If true, the point list won't be modified (see \assign_hull) - - The 'raw' argument was added in version 0.24. - """ - def __lt__(self, p: DPolygon) -> bool: - r""" - @brief Returns a value indicating whether self is less than p - @param p The object to compare against - This operator is provided to establish some, not necessarily a certain sorting order - """ - def __mul__(self, f: float) -> DPolygon: - r""" - @brief Scales the polygon by some factor - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __ne__(self, p: object) -> bool: - r""" - @brief Returns a value indicating whether the polygons are not equal - @param p The object to compare against - """ - def __repr__(self) -> str: - r""" - @brief Returns a string representing the polygon - """ - def __rmul__(self, f: float) -> DPolygon: - r""" - @brief Scales the polygon by some factor - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __str__(self) -> str: - r""" - @brief Returns a string representing the polygon - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def area(self) -> float: - r""" - @brief Gets the area of the polygon - The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise.Orientation is ensured automatically in most cases. - """ - def area2(self) -> float: - r""" - @brief Gets the double area of the polygon - This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types. - - This method has been introduced in version 0.26.1 - """ - def assign(self, other: DPolygon) -> None: - r""" - @brief Assigns another object to self - """ - @overload - def assign_hole(self, n: int, b: DBox) -> None: - r""" - @brief Sets the box as the given hole of the polygon - @param n The index of the hole to which the points should be assigned - @param b The box to assign to the polygon's hole - If the hole index is not valid, this method does nothing. - This method was introduced in version 0.23. - """ - @overload - def assign_hole(self, n: int, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: - r""" - @brief Sets the points of the given hole of the polygon - @param n The index of the hole to which the points should be assigned - @param p An array of points to assign to the polygon's hole - @param raw If true, the points won't be compressed (see \assign_hull) - If the hole index is not valid, this method does nothing. - - This method was introduced in version 0.18. - The 'raw' argument was added in version 0.24. - """ - def assign_hull(self, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: - r""" - @brief Sets the points of the hull of polygon - @param p An array of points to assign to the polygon's hull - @param raw If true, the points won't be compressed - - If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. - - Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. - - The 'assign_hull' variant is provided in analogy to 'assign_hole'. - - The 'raw' argument was added in version 0.24. - """ - def bbox(self) -> DBox: - r""" - @brief Returns the bounding box of the polygon - The bounding box is the box enclosing all points of the polygon. - """ - def compress(self, remove_reflected: bool) -> None: - r""" - @brief Compresses the polygon. - - This method removes redundant points from the polygon, such as points being on a line formed by two other points. - If remove_reflected is true, points are also removed if the two adjacent edges form a spike. - - @param remove_reflected See description of the functionality. - - This method was introduced in version 0.18. - """ - def dup(self) -> DPolygon: - r""" - @brief Creates a copy of self - """ - @overload - def each_edge(self) -> Iterator[DEdge]: - r""" - @brief Iterates over the edges that make up the polygon - - This iterator will deliver all edges, including those of the holes. Hole edges are oriented counterclockwise while hull edges are oriented clockwise. - """ - @overload - def each_edge(self, contour: int) -> Iterator[DEdge]: - r""" - @brief Iterates over the edges of one contour of the polygon - - @param contour The contour number (0 for hull, 1 for first hole ...) - - This iterator will deliver all edges of the contour specified by the contour parameter. The hull has contour number 0, the first hole has contour 1 etc. - Hole edges are oriented counterclockwise while hull edges are oriented clockwise. - - This method was introduced in version 0.24. - """ - def each_point_hole(self, n: int) -> Iterator[DPoint]: - r""" - @brief Iterates over the points that make up the nth hole - The hole number must be less than the number of holes (see \holes) - """ - def each_point_hull(self) -> Iterator[DPoint]: - r""" - @brief Iterates over the points that make up the hull - """ - def extract_rad(self) -> List[Any]: - r""" - @brief Extracts the corner radii from a rounded polygon - - Attempts to extract the radii of rounded corner polygon. This is essentially the inverse of the \round_corners method. If this method succeeds, if will return an array of four elements: @ul - @li The polygon with the rounded corners replaced by edgy ones @/li - @li The radius of the inner corners @/li - @li The radius of the outer corners @/li - @li The number of points per full circle @/li - @/ul - - This method is based on some assumptions and may fail. In this case, an empty array is returned. - - If successful, the following code will more or less render the original polygon and parameters - - @code - p = ... # some polygon - p.round_corners(ri, ro, n) - (p2, ri2, ro2, n2) = p.extract_rad - # -> p2 == p, ro2 == ro, ri2 == ri, n2 == n (within some limits) - @/code - - This method was introduced in version 0.25. - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - def holes(self) -> int: - r""" - @brief Returns the number of holes - """ - @overload - def insert_hole(self, b: DBox) -> None: - r""" - @brief Inserts a hole from the given box - @param b The box to insert as a new hole - This method was introduced in version 0.23. - """ - @overload - def insert_hole(self, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: - r""" - @brief Inserts a hole with the given points - @param p An array of points to insert as a new hole - @param raw If true, the points won't be compressed (see \assign_hull) - - The 'raw' argument was added in version 0.24. - """ - def inside(self, p: DPoint) -> bool: - r""" - @brief Tests, if the given point is inside the polygon - If the given point is inside or on the edge of the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise. - """ - def is_box(self) -> bool: - r""" - @brief Returns true, if the polygon is a simple box. - - A polygon is a box if it is identical to it's bounding box. - - @return True if the polygon is a box. - - This method was introduced in version 0.23. - """ - def is_empty(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is empty - """ - def is_halfmanhattan(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is half-manhattan - Half-manhattan polygons have edges which are multiples of 45 degree. These polygons can be clipped at a rectangle without potential grid snapping. - - This predicate was introduced in version 0.27. - """ - def is_rectilinear(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is rectilinear - """ - @overload - def move(self, p: DVector) -> DPolygon: - r""" - @brief Moves the polygon. - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is overwritten. - - @param p The distance to move the polygon. - - @return The moved polygon (self). - - This method has been introduced in version 0.23. - """ - @overload - def move(self, x: float, y: float) -> DPolygon: - r""" - @brief Moves the polygon. - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is overwritten. - - @param x The x distance to move the polygon. - @param y The y distance to move the polygon. - - @return The moved polygon (self). - """ - @overload - def moved(self, p: DVector) -> DPolygon: - r""" - @brief Returns the moved polygon (does not modify self) - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is not modified. - - @param p The distance to move the polygon. - - @return The moved polygon. - - This method has been introduced in version 0.23. - """ - @overload - def moved(self, x: float, y: float) -> DPolygon: - r""" - @brief Returns the moved polygon (does not modify self) - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is not modified. - - @param x The x distance to move the polygon. - @param y The y distance to move the polygon. - - @return The moved polygon. - - This method has been introduced in version 0.23. - """ - def num_points(self) -> int: - r""" - @brief Gets the total number of points (hull plus holes) - This method was introduced in version 0.18. - """ - def num_points_hole(self, n: int) -> int: - r""" - @brief Gets the number of points of the given hole - The argument gives the index of the hole of which the number of points are requested. The index must be less than the number of holes (see \holes). - """ - def num_points_hull(self) -> int: - r""" - @brief Gets the number of points of the hull - """ - def perimeter(self) -> float: - r""" - @brief Gets the perimeter of the polygon - The perimeter is sum of the lengths of all edges making up the polygon. - - This method has been introduce in version 0.23. - """ - def point_hole(self, n: int, p: int) -> DPoint: - r""" - @brief Gets a specific point of a hole - @param n The index of the hole to which the points should be assigned - @param p The index of the point to get - If the index of the point or of the hole is not valid, a default value is returned. - This method was introduced in version 0.18. - """ - def point_hull(self, p: int) -> DPoint: - r""" - @brief Gets a specific point of the hull - @param p The index of the point to get - If the index of the point is not a valid index, a default value is returned. - This method was introduced in version 0.18. - """ - def round_corners(self, rinner: float, router: float, n: int) -> DPolygon: - r""" - @brief Rounds the corners of the polygon - - Replaces the corners of the polygon with circle segments. - - @param rinner The circle radius of inner corners (in database units). - @param router The circle radius of outer corners (in database units). - @param n The number of points per full circle. - - @return The new polygon. - - This method was introduced in version 0.20 for integer coordinates and in 0.25 for all coordinate types. - """ - @overload - def size(self, d: float) -> None: - r""" - @brief Sizes the polygon (biasing) - - Shifts the contour outwards (d>0) or inwards (d<0). - This method is equivalent to - @code - size(d, d, 2) - @/code - - See \size for a detailed description. - """ - @overload - def size(self, d: float, mode: int) -> None: - r""" - @brief Sizes the polygon (biasing) - - Shifts the contour outwards (d>0) or inwards (d<0). - This method is equivalent to - @code - size(d, d, mode) - @/code - - See \size for a detailed description. - - This method has been introduced in version 0.23. - """ - @overload - def size(self, dx: float, dy: float, mode: int) -> None: - r""" - @brief Sizes the polygon (biasing) - - Shifts the contour outwards (dx,dy>0) or inwards (dx,dy<0). - dx is the sizing in x-direction and dy is the sizing in y-direction. The sign of dx and dy should be identical. - The sizing operation create invalid (self-overlapping, reverse oriented) contours. - - The mode defines at which bending angle cutoff occurs - (0:>0, 1:>45, 2:>90, 3:>135, 4:>approx. 168, other:>approx. 179) - - In order to obtain a proper polygon in the general case, the - sized polygon must be merged in 'greater than zero' wrap count mode. This is necessary since in the general case, - sizing can be complicated operation which lets a single polygon fall apart into disjoint pieces for example. - This can be achieved using the \EdgeProcessor class for example: - - @code - poly = ... # a RBA::Polygon - poly.size(-50, 2) - ep = RBA::EdgeProcessor::new - # result is an array of RBA::Polygon objects - result = ep.simple_merge_p2p([ poly ], false, false, 1) - @/code - """ - @overload - def sized(self, d: float) -> DPolygon: - r""" - @brief Sizes the polygon (biasing) - - @brief Sizing (biasing) without modifying self - This method is equivalent to - @code - sized(d, d, 2) - @/code - - See \size and \sized for a detailed description. - """ - @overload - def sized(self, d: float, mode: int) -> DPolygon: - r""" - @brief Sizes the polygon (biasing) without modifying self - - Shifts the contour outwards (d>0) or inwards (d<0). - This method is equivalent to - @code - sized(d, d, mode) - @/code - - See \size and \sized for a detailed description. - """ - @overload - def sized(self, dx: float, dy: float, mode: int) -> DPolygon: - r""" - @brief Sizes the polygon (biasing) without modifying self - - This method applies sizing to the polygon but does not modify self. Instead a sized copy is returned. - See \size for a description of the operation. - - This method has been introduced in version 0.23. - """ - def split(self) -> List[DPolygon]: - r""" - @brief Splits the polygon into two or more parts - This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. - - The intended use for this method is a iteratively split polygons until the satisfy some maximum number of points limit. - - This method has been introduced in version 0.25.3. - """ - def to_itype(self, dbu: Optional[float] = ...) -> Polygon: - r""" - @brief Converts the polygon to an integer coordinate polygon - - The database unit can be specified to translate the floating-point coordinate polygon in micron units to an integer-coordinate polygon in database units. The polygons coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief Returns a string representing the polygon - """ - @overload - def touches(self, box: DBox) -> bool: - r""" - @brief Returns true, if the polygon touches the given box. - The box and the polygon touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, edge: DEdge) -> bool: - r""" - @brief Returns true, if the polygon touches the given edge. - The edge and the polygon touch if they overlap or the edge shares at least one point with the polygon's contour. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, polygon: DPolygon) -> bool: - r""" - @brief Returns true, if the polygon touches the other polygon. - The polygons touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, simple_polygon: DSimplePolygon) -> bool: - r""" - @brief Returns true, if the polygon touches the other polygon. - The polygons touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def transform(self, t: DCplxTrans) -> DPolygon: - r""" - @brief Transforms the polygon with a complex transformation (in-place) - - Transforms the polygon with the given complex transformation. - Modifies self and returns self. An out-of-place version which does not modify self is \transformed. - - @param t The transformation to apply. - - This method has been introduced in version 0.24. - """ - @overload - def transform(self, t: DTrans) -> DPolygon: - r""" - @brief Transforms the polygon (in-place) - - Transforms the polygon with the given transformation. - Modifies self and returns self. An out-of-place version which does not modify self is \transformed. - - @param t The transformation to apply. - - This method has been introduced in version 0.24. - """ - @overload - def transformed(self, t: DCplxTrans) -> DPolygon: - r""" - @brief Transforms the polygon with a complex transformation - - Transforms the polygon with the given complex transformation. - Does not modify the polygon but returns the transformed polygon. - - @param t The transformation to apply. - - @return The transformed polygon. - - With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. - """ - @overload - def transformed(self, t: DTrans) -> DPolygon: - r""" - @brief Transforms the polygon - - Transforms the polygon with the given transformation. - Does not modify the polygon but returns the transformed polygon. - - @param t The transformation to apply. - - @return The transformed polygon. - """ - @overload - def transformed(self, t: VCplxTrans) -> Polygon: - r""" - @brief Transforms the polygon with the given complex transformation - - - @param t The magnifying transformation to apply - @return The transformed polygon (in this case an integer coordinate polygon) - - This method has been introduced in version 0.25. - """ - -class LayerMap: - r""" - @brief An object representing an arbitrary mapping of physical layers to logical layers - - "Physical" layers are stream layers or other separated layers in a CAD file. "Logical" layers are the layers present in a \Layout object. Logical layers are represented by an integer index while physical layers are given by a layer and datatype number or name. A logical layer is created automatically in the layout on reading if it does not exist yet. - - The mapping describes an association of a set of physical layers to a set of logical ones, where multiple - physical layers can be mapped to a single logical one, which effectively merges the layers. - - For each logical layer, a target layer can be specified. A target layer is the layer/datatype/name combination - as which the logical layer appears in the layout. By using a target layer different from the source layer - renaming a layer can be achieved while loading a layout. Another use case for that feature is to assign - layer names to GDS layer/datatype combinations which are numerical only. - - LayerMap objects are used in two ways: as input for the reader (inside a \LoadLayoutOptions class) and - as output from the reader (i.e. Layout::read method). For layer map objects used as input, the layer indexes - (logical layers) can be consecutive numbers. They do not need to correspond with real layer indexes from - a layout object. When used as output, the layer map's logical layers correspond to the layer indexes inside - the layout that the layer map was used upon. - - This is a sample how to use the LayerMap object. It maps all datatypes of layers 1, 2 and 3 to datatype 0 and - assigns the names 'ONE', 'TWO' and 'THREE' to these layout layers: - - @codelm = RBA::LayerMap::new - lm.map("1/0-255 : ONE (1/0)", 0) - lm.map("2/0-255 : TWO (2/0)", 1) - lm.map("3/0-255 : THREE (3/0)", 2) - - # read the layout using the layer map - lo = RBA::LoadLayoutOptions::new - lo.layer_map.assign(lm) - ly = RBA::Layout::new - ly.read("input.gds", lo) - @/code - - 1:n mapping is supported: a physical layer can be mapped to multiple logical layers using 'mmap' instead of 'map'. When using this variant, mapping acts additive. - The following example will map layer 1, datatypes 0 to 255 to logical layer 0, and layer 1, datatype 17 to logical layers 0 plus 1: - @codelm = RBA::LayerMap::new - lm.map("1/0-255", 0) # (can be 'mmap' too) - lm.mmap("1/17", 1) - @/code - - 'unmapping' allows removing a mapping. This allows creating 'holes' in mapping ranges. The following example maps layer 1, datatypes 0 to 16 and 18 to 255 to logical layer 0: - @codelm = RBA::LayerMap::new - lm.map("1/0-255", 0) - lm.unmap("1/17") - @/code - - The LayerMap class has been introduced in version 0.18. Target layer have been introduced in version 0.20. 1:n mapping and unmapping has been introduced in version 0.27. - """ - def __copy__(self) -> LayerMap: + def __copy__(self) -> Connectivity: r""" @brief Creates a copy of self """ @@ -25107,248 +45971,146 @@ class LayerMap: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: LayerMap) -> None: + def assign(self, other: Connectivity) -> None: r""" @brief Assigns another object to self """ - def clear(self) -> None: + @overload + def connect(self, layer: int) -> None: r""" - @brief Clears the map + @brief Specifies intra-layer connectivity. """ - def dup(self) -> LayerMap: + @overload + def connect(self, layer_a: int, layer_b: int) -> None: + r""" + @brief Specifies inter-layer connectivity. + """ + def connect_global(self, layer: int, global_net_name: str) -> int: + r""" + @brief Connects the given layer to the global net given by name. + Returns the ID of the global net. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> Connectivity: r""" @brief Creates a copy of self """ - def from_string(self, arg0: str) -> LayerMap: + def global_net_id(self, global_net_name: str) -> int: r""" - @brief Creates a layer map from the given string - The format of the string is that used in layer mapping files: one mapping entry per line, comments are allowed using '#' or '//'. The format of each line is that used in the 'map(string, index)' method. - - This method has been introduced in version 0.23. + @brief Gets the ID for a given global net name. """ - def is_mapped(self, layer: LayerInfo) -> bool: + def global_net_name(self, global_net_id: int) -> str: r""" - @brief Check, if a given physical layer is mapped - @param layer The physical layer specified with an \LayerInfo object. - @return True, if the layer is mapped. + @brief Gets the name for a given global net ID. """ - def logicals(self, layer: LayerInfo) -> List[int]: + def is_const_object(self) -> bool: r""" - @brief Returns the logical layers for a given physical layer.n@param layer The physical layer specified with an \LayerInfo object. - @return This list of logical layers this physical layer as mapped to or empty if there is no mapping. - This method has been introduced in version 0.27. - """ - @overload - def map(self, map_expr: str, log_layer: int) -> None: - r""" - @brief Maps a physical layer given by a string to a logical one - @param map_expr The string describing the physical layer to map. - @param log_layer The logical layer to which the physical layers are mapped. - - The string expression is constructed using the syntax: - "list[/list][;..]" for layer/datatype pairs. "list" is a - sequence of numbers, separated by comma values or a range - separated by a hyphen. Examples are: "1/2", "1-5/0", "1,2,5/0", - "1/5;5/6". - - layer/datatype wildcards can be specified with "*". When "*" is used - for the upper limit, it is equivalent to "all layer above". When used - alone, it is equivalent to "all layers". Examples: "1 / *", "* / 10-*" - - Named layers are specified simply by specifying the name, if - necessary in single or double quotes (if the name begins with a digit or - contains non-word characters). layer/datatype and name descriptions can - be mixed, i.e. "AA;1/5" (meaning: name "AA" or layer 1/datatype 5). - - A target layer can be specified with the ":" notation, where - target is a valid string for a LayerProperties() object. - - A target can include relative layer/datatype specifications and wildcards. - For example, "1-10/0: *+1/0" will add 1 to the original layer number. - "1-10/0-50: * / *" will use the original layers. - - Target mapping has been added in version 0.20. - """ - @overload - def map(self, phys_layer: LayerInfo, log_layer: int) -> None: - r""" - @brief Maps a physical layer to a logical one - @param phys_layer The physical layer (a \LayerInfo object). - @param log_layer The logical layer to which the physical layer is mapped. - - In general, there may be more than one physical layer mapped - to one logical layer. This method will add the given physical layer to the mapping for the logical layer. - """ - @overload - def map(self, phys_layer: LayerInfo, log_layer: int, target_layer: LayerInfo) -> None: - r""" - @brief Maps a physical layer to a logical one with a target layer - @param phys_layer The physical layer (a \LayerInfo object). - @param log_layer The logical layer to which the physical layer is mapped. - @param target_layer The properties of the layer that will be created unless it already exists. - - In general, there may be more than one physical layer mapped - to one logical layer. This method will add the given physical layer to the mapping for the logical layer. - - This method has been added in version 0.20. - """ - @overload - def map(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int) -> None: - r""" - @brief Maps a physical layer interval to a logical one - @param pl_start The first physical layer (a \LayerInfo object). - @param pl_stop The last physical layer (a \LayerInfo object). - @param log_layer The logical layer to which the physical layers are mapped. - - This method maps an interval of layers l1..l2 and datatypes d1..d2 to the mapping for the given logical layer. l1 and d1 are given by the pl_start argument, while l2 and d2 are given by the pl_stop argument. - """ - @overload - def map(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int, layer_properties: LayerInfo) -> None: - r""" - @brief Maps a physical layer interval to a logical one with a target layer - @param pl_start The first physical layer (a \LayerInfo object). - @param pl_stop The last physical layer (a \LayerInfo object). - @param log_layer The logical layer to which the physical layers are mapped. - @param target_layer The properties of the layer that will be created unless it already exists. - - This method maps an interval of layers l1..l2 and datatypes d1..d2 to the mapping for the given logical layer. l1 and d1 are given by the pl_start argument, while l2 and d2 are given by the pl_stop argument. - This method has been added in version 0.20. - """ - def mapping(self, log_layer: int) -> LayerInfo: - r""" - @brief Returns the mapped physical (or target if one is specified) layer for a given logical layer - @param log_layer The logical layer for which the mapping is requested. - @return A \LayerInfo object which is the physical layer mapped to the logical layer. - In general, there may be more than one physical layer mapped - to one logical layer. This method will return a single one of - them. It will return the one with the lowest layer and datatype. - """ - def mapping_str(self, log_layer: int) -> str: - r""" - @brief Returns the mapping string for a given logical layer - @param log_layer The logical layer for which the mapping is requested. - @return A string describing the mapping. - The mapping string is compatible with the string that the "map" method accepts. - """ - @overload - def mmap(self, map_expr: str, log_layer: int) -> None: - r""" - @brief Maps a physical layer given by an expression to a logical one and adds to existing mappings - - This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. - For backward compatibility, 'map' still substitutes mapping. - - Multi-mapping has been added in version 0.27. - """ - @overload - def mmap(self, phys_layer: LayerInfo, log_layer: int) -> None: - r""" - @brief Maps a physical layer to a logical one and adds to existing mappings - - This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. - For backward compatibility, 'map' still substitutes mapping. - - Multi-mapping has been added in version 0.27. - """ - @overload - def mmap(self, phys_layer: LayerInfo, log_layer: int, target_layer: LayerInfo) -> None: - r""" - @brief Maps a physical layer to a logical one, adds to existing mappings and specifies a target layer - - This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. - For backward compatibility, 'map' still substitutes mapping. - - Multi-mapping has been added in version 0.27. - """ - @overload - def mmap(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int) -> None: - r""" - @brief Maps a physical layer from the given interval to a logical one and adds to existing mappings - - This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. - For backward compatibility, 'map' still substitutes mapping. - - Multi-mapping has been added in version 0.27. - """ - @overload - def mmap(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int, layer_properties: LayerInfo) -> None: - r""" - @brief Maps a physical layer from the given interval to a logical one, adds to existing mappings and specifies a target layer - - This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. - For backward compatibility, 'map' still substitutes mapping. - - Multi-mapping has been added in version 0.27. - """ - def to_string(self) -> str: - r""" - @brief Converts a layer mapping object to a string - This method is the inverse of the \from_string method. - - This method has been introduced in version 0.23. - """ - @overload - def unmap(self, expr: str) -> None: - r""" - @brief Unmaps the layers from the given expression - This method has been introduced in version 0.27. - """ - @overload - def unmap(self, phys_layer: LayerInfo) -> None: - r""" - @brief Unmaps the given layer - Unmapping will remove the specific layer from the mapping. This method allows generating 'mapping holes' by first mapping a range and then unmapping parts of it. - - This method has been introduced in version 0.27. - """ - @overload - def unmap(self, pl_start: LayerInfo, pl_stop: LayerInfo) -> None: - r""" - @brief Unmaps the layers from the given interval - This method has been introduced in version 0.27. + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. """ -class LoadLayoutOptions: +class LayoutToNetlist: r""" - @brief Layout reader options + @brief A generic framework for extracting netlists from layouts - This object describes various layer reader options used for loading layouts. + This class wraps various concepts from db::NetlistExtractor and db::NetlistDeviceExtractor + and more. It is supposed to provide a framework for extracting a netlist from a layout. - This class has been introduced in version 0.18. + The use model of this class consists of five steps which need to be executed in this order. + + @ul + @li Configuration: in this step, the LayoutToNetlist object is created and + if required, configured. Methods to be used in this step are \threads=, + \area_ratio= or \max_vertex_count=. The constructor for the LayoutToNetlist + object receives a \RecursiveShapeIterator object which basically supplies the + hierarchy and the layout taken as input. + @/li + @li Preparation + In this step, the device recognition and extraction layers are drawn from + the framework. Derived can now be computed using boolean operations. + Methods to use in this step are \make_layer and it's variants. + Layer preparation is not necessarily required to happen before all + other steps. Layers can be computed shortly before they are required. + @/li + @li Following the preparation, the devices can be extracted using \extract_devices. + This method needs to be called for each device extractor required. Each time, + a device extractor needs to be given plus a map of device layers. The device + layers are device extractor specific. Either original or derived layers + may be specified here. Layer preparation may happen between calls to \extract_devices. + @/li + @li Once the devices are derived, the netlist connectivity can be defined and the + netlist extracted. The connectivity is defined with \connect and it's + flavours. The actual netlist extraction happens with \extract_netlist. + @/li + @li After netlist extraction, the information is ready to be retrieved. + The produced netlist is available with \netlist. The Shapes of a + specific net are available with \shapes_of_net. \probe_net allows + finding a net by probing a specific location. + @/li + @/ul + + You can also use the extractor with an existing \DeepShapeStore object or even flat data. In this case, preparation means importing existing regions with the \register method. + If you want to use the \LayoutToNetlist object with flat data, use the 'LayoutToNetlist(topcell, dbu)' constructor. If you want to use it with hierarchical data and an existing DeepShapeStore object, use the 'LayoutToNetlist(dss)' constructor. + + This class has been introduced in version 0.26. """ - class CellConflictResolution: + class BuildNetHierarchyMode: r""" - @brief This enum specifies how cell conflicts are handled if a layout read into another layout and a cell name conflict arises. - Until version 0.26.8 and before, the mode was always 'AddToCell'. On reading, a cell was 'reopened' when encountering a cell name which already existed. This mode is still the default. The other modes are made available to support other ways of merging layouts. - - Proxy cells are never modified in the existing layout. Proxy cells are always local to their layout file. So if the existing cell is a proxy cell, the new cell will be renamed. - - If the new or existing cell is a ghost cell, both cells are merged always. - - This enum was introduced in version 0.27. + @brief This class represents the LayoutToNetlist::BuildNetHierarchyMode enum + This enum is used for \LayoutToNetlist#build_all_nets and \LayoutToNetlist#build_net. """ - AddToCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + BNH_Disconnected: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] r""" - @brief Add content to existing cell - This is the mode use in before version 0.27. Content of new cells is simply added to existing cells with the same name. + @brief This constant tells \build_net and \build_all_nets to produce local nets without connections to subcircuits (used for the "hier_mode" parameter). """ - OverwriteCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + BNH_Flatten: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] r""" - @brief The old cell is overwritten entirely (including child cells which are not used otherwise) + @brief This constant tells \build_net and \build_all_nets to flatten the nets (used for the "hier_mode" parameter). """ - RenameCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + BNH_SubcircuitCells: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] r""" - @brief The new cell will be renamed to become unique - """ - SkipNewCell: ClassVar[LoadLayoutOptions.CellConflictResolution] - r""" - @brief The new cell is skipped entirely (including child cells which are not used otherwise) + @brief This constant tells \build_net and \build_all_nets to produce a hierarchy of subcircuit cells per net (used for the "hier_mode" parameter). """ + @overload + @classmethod + def new(cls, i: int) -> LayoutToNetlist.BuildNetHierarchyMode: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> LayoutToNetlist.BuildNetHierarchyMode: + r""" + @brief Creates an enum from a string value + """ + @overload def __eq__(self, other: object) -> bool: r""" @brief Compares two enums """ @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload def __init__(self, i: int) -> None: r""" @brief Creates an enum from an integer value @@ -25358,17 +46120,29 @@ class LoadLayoutOptions: r""" @brief Creates an enum from a string value """ - def __lt__(self, other: LoadLayoutOptions.CellConflictResolution) -> bool: + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __lt__(self, other: LayoutToNetlist.BuildNetHierarchyMode) -> bool: r""" @brief Returns true if the first enum is less (in the enum symbol order) than the second """ + @overload def __ne__(self, other: object) -> bool: r""" @brief Compares two enums for inequality """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ def __repr__(self) -> str: r""" - @brief Gets the symbolic string from an enum + @brief Converts an enum to a visual string """ def __str__(self) -> str: r""" @@ -25386,6743 +46160,883 @@ class LoadLayoutOptions: r""" @brief Gets the symbolic string from an enum """ - AddToCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + BNH_Disconnected: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] r""" - @brief Add content to existing cell - This is the mode use in before version 0.27. Content of new cells is simply added to existing cells with the same name. + @brief This constant tells \build_net and \build_all_nets to produce local nets without connections to subcircuits (used for the "hier_mode" parameter). """ - OverwriteCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + BNH_Flatten: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] r""" - @brief The old cell is overwritten entirely (including child cells which are not used otherwise) + @brief This constant tells \build_net and \build_all_nets to flatten the nets (used for the "hier_mode" parameter). """ - RenameCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + BNH_SubcircuitCells: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] r""" - @brief The new cell will be renamed to become unique + @brief This constant tells \build_net and \build_all_nets to produce a hierarchy of subcircuit cells per net (used for the "hier_mode" parameter). """ - SkipNewCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + area_ratio: float r""" - @brief The new cell is skipped entirely (including child cells which are not used otherwise) - """ - cell_conflict_resolution: LoadLayoutOptions.CellConflictResolution - r""" - @brief Gets the cell conflict resolution mode - - Multiple layout files can be collected into a single Layout object by reading file after file into the Layout object. Cells with same names are considered a conflict. This mode indicates how such conflicts are resolved. See \LoadLayoutOptions::CellConflictResolution for the values allowed. The default mode is \LoadLayoutOptions::CellConflictResolution#AddToCell. - - This option has been introduced in version 0.27.@brief Sets the cell conflict resolution mode - - See \cell_conflict_resolution for details about this option. - - This option has been introduced in version 0.27. - """ - cif_create_other_layers: bool - r""" - @brief Gets a value indicating whether other layers shall be created - @return True, if other layers will be created. - This attribute acts together with a layer map (see \cif_layer_map=). Layers not listed in this map are created as well when \cif_create_other_layers? is true. Otherwise they are ignored. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.@brief Specifies whether other layers shall be created - @param create True, if other layers will be created. - See \cif_create_other_layers? for a description of this attribute. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - cif_dbu: float - r""" - @brief Specifies the database unit which the reader uses and produces - See \cif_dbu= method for a description of this property. - This property has been added in version 0.21. - @brief Specifies the database unit which the reader uses and produces - - This property has been added in version 0.21. - """ - cif_keep_layer_names: bool - r""" - @brief Gets a value indicating whether layer names are kept - @return True, if layer names are kept. - - When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15. - - This method has been added in version 0.25.3.@brief Gets a value indicating whether layer names are kept - @param keep True, if layer names are to be kept. - - See \cif_keep_layer_names? for a description of this property. - - This method has been added in version 0.25.3. - """ - cif_layer_map: LayerMap - r""" - @brief Gets the layer map - @return A reference to the layer map - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - - Python note: this method has been turned into a property in version 0.26.@brief Sets the layer map - This sets a layer mapping for the reader. Unlike \cif_set_layer_map, the 'create_other_layers' flag is not changed. - @param map The layer map to set. - - This convenience method has been added in version 0.26. - """ - cif_wire_mode: int - r""" - @brief Specifies how to read 'W' objects - See \cif_wire_mode= method for a description of this mode. - This property has been added in version 0.21 and was renamed to cif_wire_mode in 0.25. - @brief How to read 'W' objects - - This property specifies how to read 'W' (wire) objects. - Allowed values are 0 (as square ended paths), 1 (as flush ended paths), 2 (as round paths) - - This property has been added in version 0.21. - """ - create_other_layers: bool - r""" - @brief Gets a value indicating whether other layers shall be created - @return True, if other layers should be created. - This attribute acts together with a layer map (see \layer_map=). Layers not listed in this map are created as well when \create_other_layers? is true. Otherwise they are ignored. - - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration.@brief Specifies whether other layers shall be created - @param create True, if other layers should be created. - See \create_other_layers? for a description of this attribute. - - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. - """ - dxf_circle_accuracy: float - r""" - @brief Gets the accuracy of the circle approximation - - This property has been added in version 0.24.9. - @brief Specifies the accuracy of the circle approximation - - In addition to the number of points per circle, the circle accuracy can be specified. If set to a value larger than the database unit, the number of points per circle will be chosen such that the deviation from the ideal circle becomes less than this value. - - The actual number of points will not become bigger than the points specified through \dxf_circle_points=. The accuracy value is given in the DXF file units (see \dxf_unit) which is usually micrometers. - - \dxf_circle_points and \dxf_circle_accuracy also apply to other "round" structures such as arcs, ellipses and splines in the same sense than for circles. - - - This property has been added in version 0.24.9. - """ - dxf_circle_points: int - r""" - @brief Gets the number of points used per full circle for arc interpolation - - This property has been added in version 0.21.6. - @brief Specifies the number of points used per full circle for arc interpolation - See also \dxf_circle_accuracy for how to specify the number of points based on an approximation accuracy. - - \dxf_circle_points and \dxf_circle_accuracy also apply to other "round" structures such as arcs, ellipses and splines in the same sense than for circles. - - - This property has been added in version 0.21.6. - """ - dxf_contour_accuracy: float - r""" - @brief Gets the accuracy for contour closing - - - This property has been added in version 0.25.3. - @brief Specifies the accuracy for contour closing - - When polylines need to be connected or closed, this - value is used to indicate the accuracy. This is the value (in DXF units) - by which points may be separated and still be considered - connected. The default is 0.0 which implies exact - (within one DBU) closing. - - This value is effective in polyline mode 3 and 4. - - - This property has been added in version 0.25.3. - """ - dxf_create_other_layers: bool - r""" - @brief Gets a value indicating whether other layers shall be created - @return True, if other layers will be created. - This attribute acts together with a layer map (see \dxf_layer_map=). Layers not listed in this map are created as well when \dxf_create_other_layers? is true. Otherwise they are ignored. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.@brief Specifies whether other layers shall be created - @param create True, if other layers will be created. - See \dxf_create_other_layers? for a description of this attribute. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - dxf_dbu: float - r""" - @brief Specifies the database unit which the reader uses and produces - - This property has been added in version 0.21. - @brief Specifies the database unit which the reader uses and produces - - This property has been added in version 0.21. - """ - dxf_keep_layer_names: bool - r""" - @brief Gets a value indicating whether layer names are kept - @return True, if layer names are kept. - - When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15. - - This method has been added in version 0.25.3.@brief Gets a value indicating whether layer names are kept - @param keep True, if layer names are to be kept. - - See \cif_keep_layer_names? for a description of this property. - - This method has been added in version 0.25.3. - """ - dxf_keep_other_cells: bool - r""" - @brief If this option is true, all cells are kept, not only the top cell and it's children - - This property has been added in version 0.21.15. - @brief If this option is set to true, all cells are kept, not only the top cell and it's children - - This property has been added in version 0.21.15. - """ - dxf_layer_map: LayerMap - r""" - @brief Gets the layer map - @return A reference to the layer map - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - Python note: this method has been turned into a property in version 0.26.@brief Sets the layer map - This sets a layer mapping for the reader. Unlike \dxf_set_layer_map, the 'create_other_layers' flag is not changed. - @param map The layer map to set. - - This convenience method has been added in version 0.26. - """ - dxf_polyline_mode: int - r""" - @brief Specifies whether closed POLYLINE and LWPOLYLINE entities with width 0 are converted to polygons. - See \dxf_polyline_mode= for a description of this property. - - This property has been added in version 0.21.3. - @brief Specifies how to treat POLYLINE/LWPOLYLINE entities. - The mode is 0 (automatic), 1 (keep lines), 2 (create polygons from closed polylines with width = 0), 3 (merge all lines with width = 0 into polygons), 4 (as 3 plus auto-close open contours). - - This property has been added in version 0.21.3. - """ - dxf_render_texts_as_polygons: bool - r""" - @brief If this option is true, text objects are rendered as polygons - - This property has been added in version 0.21.15. - @brief If this option is set to true, text objects are rendered as polygons - - This property has been added in version 0.21.15. - """ - dxf_text_scaling: float - r""" - @brief Gets the text scaling factor (see \dxf_text_scaling=) - - This property has been added in version 0.21.20. - @brief Specifies the text scaling in percent of the default scaling - - The default value 100, meaning that the letter pitch is roughly 92 percent of the specified text height. Decrease this value to get smaller fonts and increase it to get larger fonts. - - This property has been added in version 0.21.20. - """ - dxf_unit: float - r""" - @brief Specifies the unit in which the DXF file is drawn - - This property has been added in version 0.21.3. - @brief Specifies the unit in which the DXF file is drawn. - - This property has been added in version 0.21.3. - """ - gds2_allow_big_records: bool - r""" - @brief Gets a value specifying whether to allow big records with a length of 32768 to 65535 bytes. - See \gds2_allow_big_records= method for a description of this property. - This property has been added in version 0.18. - @brief Allows big records with more than 32767 bytes - - Setting this property to true allows larger records by treating the record length as unsigned short, which for example allows larger polygons (~8000 points rather than ~4000 points) without using multiple XY records. - For strict compatibility with the standard, this property should be set to false. The default is true. - - This property has been added in version 0.18. - """ - gds2_allow_multi_xy_records: bool - r""" - @brief Gets a value specifying whether to allow big polygons with multiple XY records. - See \gds2_allow_multi_xy_records= method for a description of this property. - This property has been added in version 0.18. - @brief Allows the use of multiple XY records in BOUNDARY elements for unlimited large polygons - - Setting this property to true allows big polygons that span over multiple XY records. - For strict compatibility with the standard, this property should be set to false. The default is true. - - This property has been added in version 0.18. - """ - gds2_box_mode: int - r""" - @brief Gets a value specifying how to treat BOX records - See \gds2_box_mode= method for a description of this mode. - This property has been added in version 0.18. - @brief Sets a value specifying how to treat BOX records - This property specifies how BOX records are treated. - Allowed values are 0 (ignore), 1 (treat as rectangles), 2 (treat as boundaries) or 3 (treat as errors). The default is 1. - - This property has been added in version 0.18. - """ - layer_map: LayerMap - r""" - @brief Gets the layer map - @return A reference to the layer map - - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. - Python note: this method has been turned into a property in version 0.26.@brief Sets the layer map, but does not affect the "create_other_layers" flag. - Use \create_other_layers? to enable or disable other layers not listed in the layer map. - @param map The layer map to set. - This convenience method has been introduced with version 0.26. - """ - lefdef_config: LEFDEFReaderConfiguration - r""" - @brief Gets a copy of the LEF/DEF reader configuration - The LEF/DEF reader configuration is wrapped in a separate object of class \LEFDEFReaderConfiguration. See there for details. - This method will return a copy of the reader configuration. To modify the configuration, modify the copy and set the modified configuration with \lefdef_config=. - - - This method has been added in version 0.25. - @brief Sets the LEF/DEF reader configuration - - - This method has been added in version 0.25. - """ - mag_create_other_layers: bool - r""" - @brief Gets a value indicating whether other layers shall be created - @return True, if other layers will be created. - This attribute acts together with a layer map (see \mag_layer_map=). Layers not listed in this map are created as well when \mag_create_other_layers? is true. Otherwise they are ignored. - - This method has been added in version 0.26.2.@brief Specifies whether other layers shall be created - @param create True, if other layers will be created. - See \mag_create_other_layers? for a description of this attribute. - - This method has been added in version 0.26.2. - """ - mag_dbu: float - r""" - @brief Specifies the database unit which the reader uses and produces - See \mag_dbu= method for a description of this property. - - This property has been added in version 0.26.2. - @brief Specifies the database unit which the reader uses and produces - The database unit is the final resolution of the produced layout. This physical resolution is usually defined by the layout system - GDS for example typically uses 1nm (mag_dbu=0.001). - All geometry in the MAG file will first be scaled to \mag_lambda and is then brought to the database unit. - - This property has been added in version 0.26.2. - """ - mag_keep_layer_names: bool - r""" - @brief Gets a value indicating whether layer names are kept - @return True, if layer names are kept. - - When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15. - - This method has been added in version 0.26.2.@brief Gets a value indicating whether layer names are kept - @param keep True, if layer names are to be kept. - - See \mag_keep_layer_names? for a description of this property. - - This method has been added in version 0.26.2. - """ - mag_lambda: float - r""" - @brief Gets the lambda value - See \mag_lambda= method for a description of this attribute. - - This property has been added in version 0.26.2. - @brief Specifies the lambda value to used for reading - - The lambda value is the basic unit of the layout. Magic draws layout as multiples of this basic unit. The layout read by the MAG reader will use the database unit specified by \mag_dbu, but the physical layout coordinates will be multiples of \mag_lambda. - - This property has been added in version 0.26.2. - """ - mag_layer_map: LayerMap - r""" - @brief Gets the layer map - @return A reference to the layer map - - This method has been added in version 0.26.2.@brief Sets the layer map - This sets a layer mapping for the reader. Unlike \mag_set_layer_map, the 'create_other_layers' flag is not changed. - @param map The layer map to set. - - This method has been added in version 0.26.2. - """ - mag_library_paths: List[str] - r""" - @brief Gets the locations where to look up libraries (in this order) - See \mag_library_paths= method for a description of this attribute. - - This property has been added in version 0.26.2. - @brief Specifies the locations where to look up libraries (in this order) - - The reader will look up library reference in these paths when it can't find them locally. - Relative paths in this collection are resolved relative to the initial file's path. - Expression interpolation is supported in the path strings. - - This property has been added in version 0.26.2. - """ - mag_merge: bool - r""" - @brief Gets a value indicating whether boxes are merged into polygons - @return True, if boxes are merged. - - When set to true, the boxes and triangles of the Magic layout files are merged into polygons where possible. - - This method has been added in version 0.26.2.@brief Sets a value indicating whether boxes are merged into polygons - @param merge True, if boxes and triangles will be merged into polygons. - - See \mag_merge? for a description of this property. - - This method has been added in version 0.26.2. - """ - oasis_expect_strict_mode: int - r""" - @hide@hide - """ - oasis_read_all_properties: int - r""" - @hide@hide - """ - properties_enabled: bool - r""" - @brief Gets a value indicating whether properties shall be read - @return True, if properties should be read. - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration.@brief Specifies whether properties should be read - @param enabled True, if properties should be read. - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. - """ - text_enabled: bool - r""" - @brief Gets a value indicating whether text objects shall be read - @return True, if text objects should be read. - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration.@brief Specifies whether text objects shall be read - @param enabled True, if text objects should be read. - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. - """ - def __copy__(self) -> LoadLayoutOptions: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: LoadLayoutOptions) -> None: - r""" - @brief Assigns another object to self - """ - def cif_select_all_layers(self) -> None: - r""" - @brief Selects all layers and disables the layer map - - This disables any layer map and enables reading of all layers. - New layers will be created when required. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - def cif_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: - r""" - @brief Sets the layer map - This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. - @param map The layer map to set. - @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - def dup(self) -> LoadLayoutOptions: - r""" - @brief Creates a copy of self - """ - def dxf_select_all_layers(self) -> None: - r""" - @brief Selects all layers and disables the layer map - - This disables any layer map and enables reading of all layers. - New layers will be created when required. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - def dxf_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: - r""" - @brief Sets the layer map - This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. - @param map The layer map to set. - @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - def mag_select_all_layers(self) -> None: - r""" - @brief Selects all layers and disables the layer map - - This disables any layer map and enables reading of all layers. - New layers will be created when required. - - This method has been added in version 0.26.2. - """ - def mag_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: - r""" - @brief Sets the layer map - This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. - @param map The layer map to set. - @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. - - This method has been added in version 0.26.2. - """ - def select_all_layers(self) -> None: - r""" - @brief Selects all layers and disables the layer map - - This disables any layer map and enables reading of all layers. - New layers will be created when required. - - Starting with version 0.25 this method only applies to GDS2 and OASIS format. Other formats provide their own configuration. - """ - def set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: - r""" - @brief Sets the layer map - This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to add a layer name. - @param map The layer map to set.@param create_other_layers The flag telling whether other layer should be created as well. Set to false if just the layers in the mapping table should be read. - - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. - """ - -class RecursiveInstanceIterator: - r""" - @brief An iterator delivering instances recursively - - The iterator can be obtained from a cell and optionally a region. - It simplifies retrieval of instances while considering - subcells as well. - Some options can be specified in addition, i.e. the hierarchy level to which to look into. - The search can be confined to instances of certain cells (see \targets=) or to certain regions. Subtrees can be selected for traversal or excluded from it (see \select_cells). - - This is some sample code: - - @code - # prints the effective instances of cell "A" as seen from the initial cell "cell" - iter = cell.begin_instances_rec - iter.targets = "A" - while !iter.at_end? - puts "Instance of #{iter.inst_cell.name} in #{cell.name}: " + (iter.dtrans * iter.inst_dtrans).to_s - iter.next - end - @/code - - Here, a target cell is specified which confines the search to instances of this particular cell. - 'iter.dtrans' gives us the accumulated transformation of all parents up to the top cell. 'iter.inst_dtrans' gives us the transformation from the current instance. 'iter.inst_cell' finally gives us the target cell of the current instance (which is always 'A' in our case). - - \Cell offers three methods to get these iterators: begin_instances_rec, begin_instances_rec_touching and begin_instances_rec_overlapping. - \Cell#begin_instances_rec will deliver a standard recursive instance iterator which starts from the given cell and iterates over all child cells. \Cell#begin_instances_rec_touching creates a RecursiveInstanceIterator which delivers the instances whose bounding boxed touch the given search box. \Cell#begin_instances_rec_overlapping gives an iterator which delivers all instances whose bounding box overlaps the search box. - - A RecursiveInstanceIterator object can also be created directly, like this: - - @code - iter = RBA::RecursiveInstanceIterator::new(layout, cell [, options ]) - @/code - - "layout" is the layout object, "cell" the \Cell object of the initial cell. - - The recursive instance iterator can be confined to a maximum hierarchy depth. By using \max_depth=, the iterator will restrict the search depth to the given depth in the cell tree. - In the same way, the iterator can be configured to start from a certain hierarchy depth using \min_depth=. The hierarchy depth always applies to the parent of the instances iterated. - - In addition, the recursive instance iterator supports selection and exclusion of subtrees. For that purpose it keeps flags per cell telling it for which cells to turn instance delivery on and off. The \select_cells method sets the "start delivery" flag while \unselect_cells sets the "stop delivery" flag. In effect, using \unselect_cells will exclude that cell plus the subtree from delivery. Parts of that subtree can be turned on again using \select_cells. For the cells selected that way, the instances of these cells and their child cells are delivered, even if their parent was unselected. - - To get instances from a specific cell, i.e. "MACRO" plus its child cells, unselect the top cell first and the select the desired cell again: - - @code - # deliver all instances inside "MACRO" and the sub-hierarchy: - iter = RBA::RecursiveInstanceIterator::new(layout, cell) - iter.unselect_cells(cell.cell_index) - iter.select_cells("MACRO") - ... - @/code - - The \unselect_all_cells and \select_all_cells methods turn on the "stop" and "start" flag for all cells respectively. If you use \unselect_all_cells and use \select_cells for a specific cell, the iterator will deliver only the instances of the selected cell, not its children. Those are still unselected by \unselect_all_cells: - - @code - # deliver all instance inside "MACRO" but not of child cells: - iter = RBA::RecursiveInstanceIterator::new(layout, cell) - iter.unselect_all_cells - iter.select_cells("MACRO") - ... - @/code - - Cell selection is done using cell indexes or glob pattern. Glob pattern are equivalent to the usual file name wildcards used on various command line shells. For example "A*" matches all cells starting with an "A". The curly brace notation and character classes are supported as well. For example "C{125,512}" matches "C125" and "C512" and "[ABC]*" matches all cells starting with an "A", a "B" or "C". "[^ABC]*" matches all cells not starting with one of that letters. - - To confine instance iteration to instances of certain cells, use the \targets feature: - - @code - # deliver all instance of "INV1": - iter = RBA::RecursiveInstanceIterator::new(layout, cell) - iter.targets = "INV1" - ... - @/code - - Targets can be specified either as lists of cell indexes or through a glob pattern. - - Instances are always delivered depth-first with child instances before their parents. A default recursive instance iterator will first deliver leaf cells, followed by the parent of these cells. - - When a search region is used, instances whose bounding box touch or overlap (depending on 'overlapping' flag) will be reported. The instance bounding box taken as reference is computed using all layers of the layout. - - The iterator will deliver the individual elements of instance arrays, confined to the search region if one is given. Consequently the return value (\current_inst_element) is an \InstElement object which is basically a combination of an \Instance object and information about the current array element. - \inst_cell, \inst_trans and \inst_dtrans are methods provided for convenience to access the current array member's transformation and the target cell of the current instance. - - The RecursiveInstanceIterator class has been introduced in version 0.27. - """ - max_depth: int - r""" - @brief Gets the maximum hierarchy depth - - See \max_depth= for a description of that attribute. - @brief Specifies the maximum hierarchy depth to look into - - A depth of 0 instructs the iterator to deliver only instances from the initial cell. - A higher depth instructs the iterator to look deeper. - The depth must be specified before the instances are being retrieved. - """ - min_depth: int - r""" - @brief Gets the minimum hierarchy depth - - See \min_depth= for a description of that attribute. - @brief Specifies the minimum hierarchy depth to look into - - A depth of 0 instructs the iterator to deliver instances from the top level. - 1 instructs to deliver instances from the first child level. - The minimum depth must be specified before the instances are being retrieved. - """ - overlapping: bool - r""" - @brief Gets a flag indicating whether overlapping instances are selected when a region is used - @brief Sets a flag indicating whether overlapping instances are selected when a region is used - - If this flag is false, instances touching the search region are returned. - """ - region: Box - r""" - @brief Gets the basic region that this iterator is using - The basic region is the overall box the region iterator iterates over. There may be an additional complex region that confines the region iterator. See \complex_region for this attribute. - @brief Sets the rectangular region that this iterator is iterating over - See \region for a description of this attribute. - Setting a simple region will reset the complex region to a rectangle and reset the iterator to the beginning of the sequence. - """ - targets: List[int] - r""" - @brief Gets the list of target cells - See \targets= for a description of the target cell concept. This method returns a list of cell indexes of the selected target cells.@brief Specifies the target cells. - - If target cells are specified, only instances of these cells are delivered. This version takes a list of cell indexes for the targets. By default, no target cell list is present and the instances of all cells are delivered by the iterator. See \all_targets_enabled? and \enable_all_targets for a description of this mode. Once a target list is specified, the iteration is confined to the cells from this list. - The cells are given as a list of cell indexes. - - This method will also reset the iterator. - """ - def __copy__(self) -> RecursiveInstanceIterator: - r""" - @brief Creates a copy of self - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Comparison of iterators - equality - - Two iterators are equal if they point to the same instance. - """ - @overload - def __init__(self, layout: Layout, cell: Cell) -> None: - r""" - @brief Creates a recursive instance iterator. - @param layout The layout which shall be iterated - @param cell The initial cell which shall be iterated (including its children) - @param layer The layer (index) from which the shapes are taken - - This constructor creates a new recursive instance iterator which delivers the instances of the given cell plus its children. - """ - @overload - def __init__(self, layout: Layout, cell: Cell, box: Box, overlapping: Optional[bool] = ...) -> None: - r""" - @brief Creates a recursive instance iterator with a search region. - @param layout The layout which shall be iterated - @param cell The initial cell which shall be iterated (including its children) - @param box The search region - @param overlapping If set to true, instances overlapping the search region are reported, otherwise touching is sufficient - - This constructor creates a new recursive instance iterator which delivers the instances of the given cell plus its children. - - The search is confined to the region given by the "box" parameter. If "overlapping" is true, instances whose bounding box is overlapping the search region are reported. If "overlapping" is false, instances whose bounding box touches the search region are reported. The bounding box of instances is measured taking all layers of the target cell into account. - """ - @overload - def __init__(self, layout: Layout, cell: Cell, region: Region, overlapping: bool) -> None: - r""" - @brief Creates a recursive instance iterator with a search region. - @param layout The layout which shall be iterated - @param cell The initial cell which shall be iterated (including its children) - @param region The search region - @param overlapping If set to true, instances overlapping the search region are reported, otherwise touching is sufficient - - This constructor creates a new recursive instance iterator which delivers the instances of the given cell plus its children. - - The search is confined to the region given by the "region" parameter. The region needs to be a rectilinear region. - If "overlapping" is true, instances whose bounding box is overlapping the search region are reported. If "overlapping" is false, instances whose bounding box touches the search region are reported. The bounding box of instances is measured taking all layers of the target cell into account. - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Comparison of iterators - inequality - - Two iterators are not equal if they do not point to the same instance. - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def all_targets_enabled(self) -> bool: - r""" - @brief Gets a value indicating whether instances of all cells are reported - See \targets= for a description of the target cell concept. - """ - def assign(self, other: RecursiveInstanceIterator) -> None: - r""" - @brief Assigns another object to self - """ - def at_end(self) -> bool: - r""" - @brief End of iterator predicate - - Returns true, if the iterator is at the end of the sequence - """ - def cell(self) -> Cell: - r""" - @brief Gets the cell the current instance sits in - """ - def cell_index(self) -> int: - r""" - @brief Gets the index of the cell the current instance sits in - This is equivalent to 'cell.cell_index'. - """ - def complex_region(self) -> Region: - r""" - @brief Gets the complex region that this iterator is using - The complex region is the effective region (a \Region object) that the iterator is selecting from the layout. This region can be a single box or a complex region. - """ - @overload - def confine_region(self, box_region: Box) -> None: - r""" - @brief Confines the region that this iterator is iterating over - This method is similar to setting the region (see \region=), but will confine any region (complex or simple) already set. Essentially it does a logical AND operation between the existing and given region. Hence this method can only reduce a region, not extend it. - """ - @overload - def confine_region(self, complex_region: Region) -> None: - r""" - @brief Confines the region that this iterator is iterating over - This method is similar to setting the region (see \region=), but will confine any region (complex or simple) already set. Essentially it does a logical AND operation between the existing and given region. Hence this method can only reduce a region, not extend it. - """ - def current_inst_element(self) -> InstElement: - r""" - @brief Gets the current instance - - This is the instance/array element the iterator currently refers to. - This is a \InstElement object representing the current instance and the array element the iterator currently points at. - - See \inst_trans, \inst_dtrans and \inst_cell for convenience methods to access the details of the current element. - """ - def dtrans(self) -> DCplxTrans: - r""" - @brief Gets the accumulated transformation of the current instance parent cell to the top cell - - This transformation represents how the current instance is seen in the top cell. - This version returns the micron-unit transformation. - """ - def dup(self) -> RecursiveInstanceIterator: - r""" - @brief Creates a copy of self - """ - def enable_all_targets(self) -> None: - r""" - @brief Enables 'all targets' mode in which instances of all cells are reported - See \targets= for a description of the target cell concept. - """ - def inst_cell(self) -> Cell: - r""" - @brief Gets the target cell of the current instance - This is the cell the current instance refers to. It is one of the \targets if a target list is given. - """ - def inst_dtrans(self) -> DCplxTrans: - r""" - @brief Gets the micron-unit transformation of the current instance - This is the transformation of the current instance inside its parent. - 'dtrans * inst_dtrans' gives the full micron-unit transformation how the current cell is seen in the top cell. - See also \inst_trans and \inst_cell. - """ - def inst_trans(self) -> ICplxTrans: - r""" - @brief Gets the integer-unit transformation of the current instance - This is the transformation of the current instance inside its parent. - 'trans * inst_trans' gives the full transformation how the current cell is seen in the top cell. - See also \inst_dtrans and \inst_cell. - """ - def layout(self) -> Layout: - r""" - @brief Gets the layout this iterator is connected to - """ - def next(self) -> None: - r""" - @brief Increments the iterator - This moves the iterator to the next instance inside the search scope. - """ - def path(self) -> List[InstElement]: - r""" - @brief Gets the instantiation path of the instance addressed currently - - This attribute is a sequence of \InstElement objects describing the cell instance path from the initial cell to the current instance. The path is empty if the current instance is in the top cell. - """ - def reset(self) -> None: - r""" - @brief Resets the iterator to the initial state - """ - def reset_selection(self) -> None: - r""" - @brief Resets the selection to the default state - - In the initial state, the top cell and its children are selected. Child cells can be switched on and off together with their sub-hierarchy using \select_cells and \unselect_cells. - - This method will also reset the iterator. - """ - def select_all_cells(self) -> None: - r""" - @brief Selects all cells. - - This method will set the "selected" mark on all cells. The effect is that subsequent calls of \unselect_cells will unselect only the specified cells, not their children, because they are still unselected. - - This method will also reset the iterator. - """ - @overload - def select_cells(self, cells: Sequence[int]) -> None: - r""" - @brief Unselects the given cells. - - This method will sets the "selected" mark on the given cells. That means that these cells or their child cells are visited, unless they are marked as "unselected" again with the \unselect_cells method. - - The cells are given as a list of cell indexes. - - This method will also reset the iterator. - """ - @overload - def select_cells(self, cells: str) -> None: - r""" - @brief Unselects the given cells. - - This method will sets the "selected" mark on the given cells. That means that these cells or their child cells are visited, unless they are marked as "unselected" again with the \unselect_cells method. - - The cells are given as a glob pattern. - A glob pattern follows the syntax of file names on the shell (i.e. "A*" are all cells starting with a letter "A"). - - This method will also reset the iterator. - """ - def top_cell(self) -> Cell: - r""" - @brief Gets the top cell this iterator is connected to - """ - def trans(self) -> ICplxTrans: - r""" - @brief Gets the accumulated transformation of the current instance parent cell to the top cell - - This transformation represents how the current instance is seen in the top cell. - """ - def unselect_all_cells(self) -> None: - r""" - @brief Unselects all cells. - - This method will set the "unselected" mark on all cells. The effect is that subsequent calls of \select_cells will select only the specified cells, not their children, because they are still unselected. - - This method will also reset the iterator. - """ - @overload - def unselect_cells(self, cells: Sequence[int]) -> None: - r""" - @brief Unselects the given cells. - - This method will sets the "unselected" mark on the given cells. That means that these cells or their child cells will not be visited, unless they are marked as "selected" again with the \select_cells method. - - The cells are given as a list of cell indexes. - - This method will also reset the iterator. - """ - @overload - def unselect_cells(self, cells: str) -> None: - r""" - @brief Unselects the given cells. - - This method will sets the "unselected" mark on the given cells. That means that these cells or their child cells will not be visited, unless they are marked as "selected" again with the \select_cells method. - - The cells are given as a glob pattern. - A glob pattern follows the syntax of file names on the shell (i.e. "A*" are all cells starting with a letter "A"). - - This method will also reset the iterator. - """ - -class RecursiveShapeIterator: - r""" - @brief An iterator delivering shapes recursively - - The iterator can be obtained from a cell, a layer and optionally a region. - It simplifies retrieval of shapes from a geometrical region while considering - subcells as well. - Some options can be specified in addition, i.e. the level to which to look into or - shape classes and shape properties. The shapes are retrieved by using the \shape method, - \next moves to the next shape and \at_end tells, if the iterator has move shapes to deliver. - - This is some sample code: - - @code - # print the polygon-like objects as seen from the initial cell "cell" - iter = cell.begin_shapes_rec(layer) - while !iter.at_end? - if iter.shape.renders_polygon? - polygon = iter.shape.polygon.transformed(iter.itrans) - puts "In cell #{iter.cell.name}: " + polygon.to_s - end - iter.next - end - @/code - - \Cell offers three methods to get these iterators: begin_shapes_rec, begin_shapes_rec_touching and begin_shapes_rec_overlapping. - \Cell#begin_shapes_rec will deliver a standard recursive shape iterator which starts from the given cell and iterates over all child cells. \Cell#begin_shapes_rec_touching delivers a RecursiveShapeIterator which delivers the shapes whose bounding boxed touch the given search box. \Cell#begin_shapes_rec_overlapping delivers all shapes whose bounding box overlaps the search box. - - A RecursiveShapeIterator object can also be created explicitly. This allows some more options, i.e. using multiple layers. A multi-layer recursive shape iterator can be created like this: - - @code - iter = RBA::RecursiveShapeIterator::new(layout, cell, [ layer_index1, layer_index2 .. ]) - @/code - - "layout" is the layout object, "cell" the RBA::Cell object of the initial cell. layer_index1 etc. are the layer indexes of the layers to get the shapes from. While iterating, \RecursiveShapeIterator#layer delivers the layer index of the current shape. - - The recursive shape iterator can be confined to a maximum hierarchy depth. By using \max_depth=, the iterator will restrict the search depth to the given depth in the cell tree. - - In addition, the recursive shape iterator supports selection and exclusion of subtrees. For that purpose it keeps flags per cell telling it for which cells to turn shape delivery on and off. The \select_cells method sets the "start delivery" flag while \unselect_cells sets the "stop delivery" flag. In effect, using \unselect_cells will exclude that cell plus the subtree from delivery. Parts of that subtree can be turned on again using \select_cells. For the cells selected that way, the shapes of these cells and their child cells are delivered, even if their parent was unselected. - - To get shapes from a specific cell, i.e. "MACRO" plus its child cells, unselect the top cell first and the select the desired cell again: - - @code - # deliver all shapes inside "MACRO" and the sub-hierarchy: - iter = RBA::RecursiveShapeIterator::new(layout, cell, layer) - iter.unselect_cells(cell.cell_index) - iter.select_cells("MACRO") - @/code - - Note that if "MACRO" uses library cells for example which are used otherwise as well, the iterator will only deliver the shapes for those instances belonging to "MACRO" (directly or indirectly), not those for other instances of these library cells. - - The \unselect_all_cells and \select_all_cells methods turn on the "stop" and "start" flag for all cells respectively. If you use \unselect_all_cells and use \select_cells for a specific cell, the iterator will deliver only the shapes of the selected cell, not its children. Those are still unselected by \unselect_all_cells: - - @code - # deliver all shapes of "MACRO" but not of child cells: - iter = RBA::RecursiveShapeIterator::new(layout, cell, layer) - iter.unselect_all_cells - iter.select_cells("MACRO") - @/code - - Cell selection is done using cell indexes or glob pattern. Glob pattern are equivalent to the usual file name wildcards used on various command line shells. For example "A*" matches all cells starting with an "A". The curly brace notation and character classes are supported as well. For example "C{125,512}" matches "C125" and "C512" and "[ABC]*" matches all cells starting with an "A", a "B" or "C". "[^ABC]*" matches all cells not starting with one of that letters. - - The RecursiveShapeIterator class has been introduced in version 0.18 and has been extended substantially in 0.23. - """ - global_dtrans: DCplxTrans - r""" - @brief Gets the global transformation to apply to all shapes delivered (in micrometer units) - See also \global_dtrans=. - - This method has been introduced in version 0.27. - @brief Sets the global transformation to apply to all shapes delivered (transformation in micrometer units) - The global transformation will be applied to all shapes delivered by biasing the "trans" attribute. - The search regions apply to the coordinate space after global transformation. - - This method has been introduced in version 0.27. - """ - global_trans: ICplxTrans - r""" - @brief Gets the global transformation to apply to all shapes delivered - See also \global_trans=. - - This method has been introduced in version 0.27. - @brief Sets the global transformation to apply to all shapes delivered - The global transformation will be applied to all shapes delivered by biasing the "trans" attribute. - The search regions apply to the coordinate space after global transformation. - - This method has been introduced in version 0.27. - """ - max_depth: int - r""" - @brief Gets the maximum hierarchy depth - - See \max_depth= for a description of that attribute. - - This method has been introduced in version 0.23. - @brief Specifies the maximum hierarchy depth to look into - - A depth of 0 instructs the iterator to deliver only shapes from the initial cell. - The depth must be specified before the shapes are being retrieved. - Setting the depth resets the iterator. - """ - min_depth: int - r""" - @brief Gets the minimum hierarchy depth - - See \min_depth= for a description of that attribute. - - This method has been introduced in version 0.27. - @brief Specifies the minimum hierarchy depth to look into - - A depth of 0 instructs the iterator to deliver shapes from the top level. - 1 instructs to deliver shapes from the first child level. - The minimum depth must be specified before the shapes are being retrieved. - - This method has been introduced in version 0.27. - """ - overlapping: bool - r""" - @brief Gets a flag indicating whether overlapping shapes are selected when a region is used - - This method has been introduced in version 0.23. - @brief Sets a flag indicating whether overlapping shapes are selected when a region is used - - If this flag is false, shapes touching the search region are returned. - - This method has been introduced in version 0.23. - """ - region: Box - r""" - @brief Gets the basic region that this iterator is using - The basic region is the overall box the region iterator iterates over. There may be an additional complex region that confines the region iterator. See \complex_region for this attribute. - - This method has been introduced in version 0.23. - @brief Sets the rectangular region that this iterator is iterating over - See \region for a description of this attribute. - Setting a simple region will reset the complex region to a rectangle and reset the iterator to the beginning of the sequence. - This method has been introduced in version 0.23. - """ - shape_flags: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Specifies the shape selection flags - - The flags are the same then being defined in \Shapes (the default is RBA::Shapes::SAll). - The flags must be specified before the shapes are being retrieved. - Settings the shapes flags will reset the iterator. - """ - def __copy__(self) -> RecursiveShapeIterator: - r""" - @brief Creates a copy of self - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Comparison of iterators - equality - - Two iterators are equal if they point to the same shape. - """ - @overload - def __init__(self, layout: Layout, cell: Cell, layer: int) -> None: - r""" - @brief Creates a recursive, single-layer shape iterator. - @param layout The layout which shall be iterated - @param cell The initial cell which shall be iterated (including its children) - @param layer The layer (index) from which the shapes are taken - - This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layer given by the layer index in the "layer" parameter. - - This constructor has been introduced in version 0.23. - """ - @overload - def __init__(self, layout: Layout, cell: Cell, layers: Sequence[int]) -> None: - r""" - @brief Creates a recursive, multi-layer shape iterator. - @param layout The layout which shall be iterated - @param cell The initial cell which shall be iterated (including its children) - @param layers The layer indexes from which the shapes are taken - - This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. - While iterating use the \layer method to retrieve the layer of the current shape. - - This constructor has been introduced in version 0.23. - """ - @overload - def __init__(self, layout: Layout, cell: Cell, layer: int, box: Box, overlapping: Optional[bool] = ...) -> None: - r""" - @brief Creates a recursive, single-layer shape iterator with a region. - @param layout The layout which shall be iterated - @param cell The initial cell which shall be iterated (including its children) - @param layer The layer (index) from which the shapes are taken - @param box The search region - @param overlapping If set to true, shapes overlapping the search region are reported, otherwise touching is sufficient - - This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layer given by the layer index in the "layer" parameter. - - The search is confined to the region given by the "box" parameter. If "overlapping" is true, shapes whose bounding box is overlapping the search region are reported. If "overlapping" is false, shapes whose bounding box touches the search region are reported. - - This constructor has been introduced in version 0.23. The 'overlapping' parameter has been made optional in version 0.27. - """ - @overload - def __init__(self, layout: Layout, cell: Cell, layer: int, region: Region, overlapping: Optional[bool] = ...) -> None: - r""" - @brief Creates a recursive, single-layer shape iterator with a region. - @param layout The layout which shall be iterated - @param cell The initial cell which shall be iterated (including its children) - @param layer The layer (index) from which the shapes are taken - @param region The search region - @param overlapping If set to true, shapes overlapping the search region are reported, otherwise touching is sufficient - - This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layer given by the layer index in the "layer" parameter. - - The search is confined to the region given by the "region" parameter. The region needs to be a rectilinear region. - If "overlapping" is true, shapes whose bounding box is overlapping the search region are reported. If "overlapping" is false, shapes whose bounding box touches the search region are reported. - - This constructor has been introduced in version 0.25. The 'overlapping' parameter has been made optional in version 0.27. - """ - @overload - def __init__(self, layout: Layout, cell: Cell, layers: Sequence[int], box: Box, overlapping: Optional[bool] = ...) -> None: - r""" - @brief Creates a recursive, multi-layer shape iterator with a region. - @param layout The layout which shall be iterated - @param cell The initial cell which shall be iterated (including its children) - @param layers The layer indexes from which the shapes are taken - @param box The search region - @param overlapping If set to true, shapes overlapping the search region are reported, otherwise touching is sufficient - - This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. - While iterating use the \layer method to retrieve the layer of the current shape. - - The search is confined to the region given by the "box" parameter. If "overlapping" is true, shapes whose bounding box is overlapping the search region are reported. If "overlapping" is false, shapes whose bounding box touches the search region are reported. - - This constructor has been introduced in version 0.23. The 'overlapping' parameter has been made optional in version 0.27. - """ - @overload - def __init__(self, layout: Layout, cell: Cell, layers: Sequence[int], region: Region, overlapping: Optional[bool] = ...) -> None: - r""" - @brief Creates a recursive, multi-layer shape iterator with a region. - @param layout The layout which shall be iterated - @param cell The initial cell which shall be iterated (including its children) - @param layers The layer indexes from which the shapes are taken - @param region The search region - @param overlapping If set to true, shapes overlapping the search region are reported, otherwise touching is sufficient - - This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. - While iterating use the \layer method to retrieve the layer of the current shape. - - The search is confined to the region given by the "region" parameter. The region needs to be a rectilinear region. - If "overlapping" is true, shapes whose bounding box is overlapping the search region are reported. If "overlapping" is false, shapes whose bounding box touches the search region are reported. - - This constructor has been introduced in version 0.23. The 'overlapping' parameter has been made optional in version 0.27. - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Comparison of iterators - inequality - - Two iterators are not equal if they do not point to the same shape. - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def always_apply_dtrans(self) -> DCplxTrans: - r""" - @brief Gets the global transformation if at top level, unity otherwise (micrometer-unit version) - As the global transformation is only applicable on top level, use this method to transform shapes and instances into their local (cell-level) version while considering the global transformation properly. - - This method has been introduced in version 0.27. - """ - def always_apply_trans(self) -> ICplxTrans: - r""" - @brief Gets the global transformation if at top level, unity otherwise - As the global transformation is only applicable on top level, use this method to transform shapes and instances into their local (cell-level) version while considering the global transformation properly. - - This method has been introduced in version 0.27. - """ - def assign(self, other: RecursiveShapeIterator) -> None: - r""" - @brief Assigns another object to self - """ - def at_end(self) -> bool: - r""" - @brief End of iterator predicate - - Returns true, if the iterator is at the end of the sequence - """ - def cell(self) -> Cell: - r""" - @brief Gets the current cell's object - - This method has been introduced in version 0.23. - """ - def cell_index(self) -> int: - r""" - @brief Gets the current cell's index - """ - def complex_region(self) -> Region: - r""" - @brief Gets the complex region that this iterator is using - The complex region is the effective region (a \Region object) that the iterator is selecting from the layout layers. This region can be a single box or a complex region. - - This method has been introduced in version 0.25. - """ - @overload - def confine_region(self, box_region: Box) -> None: - r""" - @brief Confines the region that this iterator is iterating over - This method is similar to setting the region (see \region=), but will confine any region (complex or simple) already set. Essentially it does a logical AND operation between the existing and given region. Hence this method can only reduce a region, not extend it. - - This method has been introduced in version 0.25. - """ - @overload - def confine_region(self, complex_region: Region) -> None: - r""" - @brief Confines the region that this iterator is iterating over - This method is similar to setting the region (see \region=), but will confine any region (complex or simple) already set. Essentially it does a logical AND operation between the existing and given region. Hence this method can only reduce a region, not extend it. - - This method has been introduced in version 0.25. - """ - def dtrans(self) -> DCplxTrans: - r""" - @brief Gets the transformation into the initial cell applicable for floating point types - - This transformation corresponds to the one delivered by \trans, but is applicable for the floating-point shape types in micron unit space. - - This method has been introduced in version 0.25.3. - """ - def dup(self) -> RecursiveShapeIterator: - r""" - @brief Creates a copy of self - """ - def layer(self) -> int: - r""" - @brief Returns the layer index where the current shape is coming from. - - This method has been introduced in version 0.23. - """ - def layout(self) -> Layout: - r""" - @brief Gets the layout this iterator is connected to - - This method has been introduced in version 0.23. - """ - def next(self) -> None: - r""" - @brief Increments the iterator - This moves the iterator to the next shape inside the search scope. - """ - def path(self) -> List[InstElement]: - r""" - @brief Gets the instantiation path of the shape addressed currently - - This attribute is a sequence of \InstElement objects describing the cell instance path from the initial cell to the current cell containing the current shape. - - This method has been introduced in version 0.25. - """ - def reset(self) -> None: - r""" - @brief Resets the iterator to the initial state - - This method has been introduced in version 0.23. - """ - def reset_selection(self) -> None: - r""" - @brief Resets the selection to the default state - - In the initial state, the top cell and its children are selected. Child cells can be switched on and off together with their sub-hierarchy using \select_cells and \unselect_cells. - - This method will also reset the iterator. - - This method has been introduced in version 0.23. - """ - def select_all_cells(self) -> None: - r""" - @brief Selects all cells. - - This method will set the "selected" mark on all cells. The effect is that subsequent calls of \unselect_cells will unselect only the specified cells, not their children, because they are still unselected. - - This method will also reset the iterator. - - This method has been introduced in version 0.23. - """ - @overload - def select_cells(self, cells: Sequence[int]) -> None: - r""" - @brief Unselects the given cells. - - This method will sets the "selected" mark on the given cells. That means that these cells or their child cells are visited, unless they are marked as "unselected" again with the \unselect_cells method. - - The cells are given as a list of cell indexes. - - This method will also reset the iterator. - - This method has been introduced in version 0.23. - """ - @overload - def select_cells(self, cells: str) -> None: - r""" - @brief Unselects the given cells. - - This method will sets the "selected" mark on the given cells. That means that these cells or their child cells are visited, unless they are marked as "unselected" again with the \unselect_cells method. - - The cells are given as a glob pattern. - A glob pattern follows the syntax of file names on the shell (i.e. "A*" are all cells starting with a letter "A"). - - This method will also reset the iterator. - - This method has been introduced in version 0.23. - """ - def shape(self) -> Shape: - r""" - @brief Gets the current shape - - Returns the shape currently referred to by the recursive iterator. - This shape is not transformed yet and is located in the current cell. - """ - def top_cell(self) -> Cell: - r""" - @brief Gets the top cell this iterator is connected to - - This method has been introduced in version 0.23. - """ - def trans(self) -> ICplxTrans: - r""" - @brief Gets the current transformation by which the shapes must be transformed into the initial cell - - The shapes delivered are not transformed. Instead, this transformation must be applied to - get the shape in the coordinate system of the top cell. - - Starting with version 0.25, this transformation is a int-to-int transformation the 'itrans' method which was providing this transformation before is deprecated. - """ - def unselect_all_cells(self) -> None: - r""" - @brief Unselects all cells. - - This method will set the "unselected" mark on all cells. The effect is that subsequent calls of \select_cells will select only the specified cells, not their children, because they are still unselected. - - This method will also reset the iterator. - - This method has been introduced in version 0.23. - """ - @overload - def unselect_cells(self, cells: Sequence[int]) -> None: - r""" - @brief Unselects the given cells. - - This method will sets the "unselected" mark on the given cells. That means that these cells or their child cells will not be visited, unless they are marked as "selected" again with the \select_cells method. - - The cells are given as a list of cell indexes. - - This method will also reset the iterator. - - This method has been introduced in version 0.23. - """ - @overload - def unselect_cells(self, cells: str) -> None: - r""" - @brief Unselects the given cells. - - This method will sets the "unselected" mark on the given cells. That means that these cells or their child cells will not be visited, unless they are marked as "selected" again with the \select_cells method. - - The cells are given as a glob pattern. - A glob pattern follows the syntax of file names on the shell (i.e. "A*" are all cells starting with a letter "A"). - - This method will also reset the iterator. - - This method has been introduced in version 0.23. - """ - -class Region(ShapeCollection): - r""" - @brief A region (a potentially complex area consisting of multiple polygons) - - - This class was introduced to simplify operations on polygon sets like boolean or sizing operations. Regions consist of many polygons and thus are a generalization of single polygons which describes a single coherence set of points. Regions support a variety of operations and have several states. - - The region's state can be empty (does not contain anything) or box-like, i.e. the region consists of a single box. In that case, some operations can be simplified. Regions can have merged state. In merged state, regions consist of merged (non-touching, non-self overlapping) polygons. Each polygon describes one coherent area in merged state. - - The preferred representation of polygons inside the region are polygons with holes. - - Regions are always expressed in database units. If you want to use regions from different database unit domains, scale the regions accordingly, i.e. by using the \transformed method. - - - Regions provide convenient operators for the boolean operations. Hence it is often no longer required to work with the \EdgeProcessor class. For example: - - @code - r1 = RBA::Region::new(RBA::Box::new(0, 0, 100, 100)) - r2 = RBA::Region::new(RBA::Box::new(20, 20, 80, 80)) - # compute the XOR: - r1_xor_r2 = r1 ^ r2 - @/code - - Regions can be used in two different flavors: in raw mode or merged semantics. With merged semantics (the default), connected polygons are considered to belong together and are effectively merged. - Overlapping areas are counted once in that mode. Internal edges (i.e. arising from cut lines) are not considered. - In raw mode (without merged semantics), each polygon is considered as it is. Overlaps between polygons - may exists and merging has to be done explicitly using the \merge method. The semantics can be - selected using \merged_semantics=. - - - This class has been introduced in version 0.23. - """ - class Metrics: - r""" - @brief This class represents the metrics type for \Region#width and related checks. - - This enum has been introduced in version 0.27. - """ - Euclidian: ClassVar[Region.Metrics] - r""" - @brief Specifies Euclidian metrics for the check functions - This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies Euclidian metrics, i.e. the distance between two points is measured by: - - @code - d = sqrt(dx^2 + dy^2) - @/code - - All points within a circle with radius d around one point are considered to have a smaller distance than d. - """ - Projection: ClassVar[Region.Metrics] - r""" - @brief Specifies projected distance metrics for the check functions - This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies projected metrics, i.e. the distance is defined as the minimum distance measured perpendicular to one edge. That implies that the distance is defined only where two edges have a non-vanishing projection onto each other. - """ - Square: ClassVar[Region.Metrics] - r""" - @brief Specifies square metrics for the check functions - This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies square metrics, i.e. the distance between two points is measured by: - - @code - d = max(abs(dx), abs(dy)) - @/code - - All points within a square with length 2*d around one point are considered to have a smaller distance than d in this metrics. - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - def __lt__(self, other: Region.Metrics) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - class RectFilter: - r""" - @brief This class represents the error filter mode on rectangles for \Region#separation and related checks. - - This enum has been introduced in version 0.27. - """ - FourSidesAllowed: ClassVar[Region.RectFilter] - r""" - @brief Allow errors when on all sides - """ - NoRectFilter: ClassVar[Region.RectFilter] - r""" - @brief Specifies no filtering - """ - OneSideAllowed: ClassVar[Region.RectFilter] - r""" - @brief Allow errors on one side - """ - ThreeSidesAllowed: ClassVar[Region.RectFilter] - r""" - @brief Allow errors when on three sides - """ - TwoConnectedSidesAllowed: ClassVar[Region.RectFilter] - r""" - @brief Allow errors on two sides ("L" configuration) - """ - TwoOppositeSidesAllowed: ClassVar[Region.RectFilter] - r""" - @brief Allow errors on two opposite sides - """ - TwoSidesAllowed: ClassVar[Region.RectFilter] - r""" - @brief Allow errors on two sides (not specified which) - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - def __lt__(self, other: Region.RectFilter) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - class OppositeFilter: - r""" - @brief This class represents the opposite error filter mode for \Region#separation and related checks. - - This enum has been introduced in version 0.27. - """ - NoOppositeFilter: ClassVar[Region.OppositeFilter] - r""" - @brief No opposite filtering - """ - NotOpposite: ClassVar[Region.OppositeFilter] - r""" - @brief Only errors NOT appearing on opposite sides of a figure will be reported - """ - OnlyOpposite: ClassVar[Region.OppositeFilter] - r""" - @brief Only errors appearing on opposite sides of a figure will be reported - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - def __lt__(self, other: Region.OppositeFilter) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - Euclidian: ClassVar[Region.Metrics] - r""" - @brief Specifies Euclidian metrics for the check functions - This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies Euclidian metrics, i.e. the distance between two points is measured by: - - @code - d = sqrt(dx^2 + dy^2) - @/code - - All points within a circle with radius d around one point are considered to have a smaller distance than d. - """ - FourSidesAllowed: ClassVar[Region.RectFilter] - r""" - @brief Allow errors when on all sides - """ - NoOppositeFilter: ClassVar[Region.OppositeFilter] - r""" - @brief No opposite filtering - """ - NoRectFilter: ClassVar[Region.RectFilter] - r""" - @brief Specifies no filtering - """ - NotOpposite: ClassVar[Region.OppositeFilter] - r""" - @brief Only errors NOT appearing on opposite sides of a figure will be reported - """ - OneSideAllowed: ClassVar[Region.RectFilter] - r""" - @brief Allow errors on one side - """ - OnlyOpposite: ClassVar[Region.OppositeFilter] - r""" - @brief Only errors appearing on opposite sides of a figure will be reported - """ - Projection: ClassVar[Region.Metrics] - r""" - @brief Specifies projected distance metrics for the check functions - This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies projected metrics, i.e. the distance is defined as the minimum distance measured perpendicular to one edge. That implies that the distance is defined only where two edges have a non-vanishing projection onto each other. - """ - Square: ClassVar[Region.Metrics] - r""" - @brief Specifies square metrics for the check functions - This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies square metrics, i.e. the distance between two points is measured by: - - @code - d = max(abs(dx), abs(dy)) - @/code - - All points within a square with length 2*d around one point are considered to have a smaller distance than d in this metrics. - """ - ThreeSidesAllowed: ClassVar[Region.RectFilter] - r""" - @brief Allow errors when on three sides - """ - TwoConnectedSidesAllowed: ClassVar[Region.RectFilter] - r""" - @brief Allow errors on two sides ("L" configuration) - """ - TwoOppositeSidesAllowed: ClassVar[Region.RectFilter] - r""" - @brief Allow errors on two opposite sides - """ - TwoSidesAllowed: ClassVar[Region.RectFilter] - r""" - @brief Allow errors on two sides (not specified which) - """ - base_verbosity: int - r""" - @brief Gets the minimum verbosity for timing reports - See \base_verbosity= for details. - - This method has been introduced in version 0.26. - @brief Sets the minimum verbosity for timing reports - Timing reports will be given only if the verbosity is larger than this value. Detailed reports will be given when the verbosity is more than this value plus 10. - In binary operations, the base verbosity of the first argument is considered. - - This method has been introduced in version 0.26. - """ - merged_semantics: bool - r""" - @brief Gets a flag indicating whether merged semantics is enabled - See \merged_semantics= for a description of this attribute. - @brief Enables or disables merged semantics - If merged semantics is enabled (the default), coherent polygons will be considered - as single regions and artificial edges such as cut-lines will not be considered. - Merged semantics thus is equivalent to considering coherent areas rather than - single polygons - """ - min_coherence: bool - r""" - @brief Gets a flag indicating whether minimum coherence is selected - See \min_coherence= for a description of this attribute. - @brief Enable or disable minimum coherence - If minimum coherence is set, the merge operations (explicit merge with \merge or - implicit merge through merged_semantics) are performed using minimum coherence mode. - The coherence mode determines how kissing-corner situations are resolved. If - minimum coherence is selected, they are resolved such that multiple polygons are - created which touch at a corner). - - The default setting is maximum coherence (min_coherence = false). - """ - strict_handling: bool - r""" - @brief Gets a flag indicating whether merged semantics is enabled - See \strict_handling= for a description of this attribute. - - This method has been introduced in version 0.23.2.@brief Enables or disables strict handling - - Strict handling means to leave away some optimizations. Specifically the - output of boolean operations will be merged even if one input is empty. - Without strict handling, the operation will be optimized and output - won't be merged. - - Strict handling is disabled by default and optimization is in place. - - This method has been introduced in version 0.23.2. - """ - def __add__(self, other: Region) -> Region: - r""" - @brief Returns the combined region of self and the other region - - @return The resulting region - - This operator adds the polygons of the other region to self and returns a new combined region. This usually creates unmerged regions and polygons may overlap. Use \merge if you want to ensure the result region is merged. - """ - def __and__(self, other: Region) -> Region: - r""" - @brief Returns the boolean AND between self and the other region - - @return The result of the boolean AND operation - - This method will compute the boolean AND (intersection) between two regions. The result is often but not necessarily always merged. - """ - def __copy__(self) -> Region: - r""" - @brief Creates a copy of self - """ - def __getitem__(self, n: int) -> Polygon: - r""" - @brief Returns the nth polygon of the region - - This method returns nil if the index is out of range. It is available for flat regions only - i.e. those for which \has_valid_polygons? is true. Use \flatten to explicitly flatten a region. - This method returns the raw polygon (not merged polygons, even if merged semantics is enabled). - - The \each iterator is the more general approach to access the polygons. - """ - def __iadd__(self, other: Region) -> Region: - r""" - @brief Adds the polygons of the other region to self - - @return The region after modification (self) - - This operator adds the polygons of the other region to self. This usually creates unmerged regions and polygons may overlap. Use \merge if you want to ensure the result region is merged. - """ - def __iand__(self, other: Region) -> Region: - r""" - @brief Performs the boolean AND between self and the other region - - @return The region after modification (self) - - This method will compute the boolean AND (intersection) between two regions. The result is often but not necessarily always merged. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor - - This constructor creates an empty region. - """ - @overload - def __init__(self, array: Sequence[Polygon]) -> None: - r""" - @brief Constructor from a polygon array - - This constructor creates a region from an array of polygons. - """ - @overload - def __init__(self, box: Box) -> None: - r""" - @brief Box constructor - - This constructor creates a region from a box. - """ - @overload - def __init__(self, path: Path) -> None: - r""" - @brief Path constructor - - This constructor creates a region from a path. - """ - @overload - def __init__(self, polygon: Polygon) -> None: - r""" - @brief Polygon constructor - - This constructor creates a region from a polygon. - """ - @overload - def __init__(self, polygon: SimplePolygon) -> None: - r""" - @brief Simple polygon constructor - - This constructor creates a region from a simple polygon. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator) -> None: - r""" - @brief Constructor from a hierarchical shape set - - This constructor creates a region from the shapes delivered by the given recursive shape iterator. - Text objects and edges are not inserted, because they cannot be converted to polygons. - This method allows feeding the shapes from a hierarchy of cells into the region. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - r = RBA::Region::new(layout.begin_shapes(cell, layer)) - @/code - """ - @overload - def __init__(self, shapes: Shapes) -> None: - r""" - @brief Shapes constructor - - This constructor creates a region from a \Shapes collection. - - This constructor has been introduced in version 0.25. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None: - r""" - @brief Constructor from a hierarchical shape set with a transformation - - This constructor creates a region from the shapes delivered by the given recursive shape iterator. - Text objects and edges are not inserted, because they cannot be converted to polygons. - On the delivered shapes it applies the given transformation. - This method allows feeding the shapes from a hierarchy of cells into the region. - The transformation is useful to scale to a specific database unit for example. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::Region::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) - @/code - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, deep_shape_store: DeepShapeStore, area_ratio: Optional[float] = ..., max_vertex_count: Optional[int] = ...) -> None: - r""" - @brief Constructor for a deep region from a hierarchical shape set - - This constructor creates a hierarchical region. Use a \DeepShapeStore object to supply the hierarchical heap. See \DeepShapeStore for more details. - - 'area_ratio' and 'max_vertex' supply two optimization parameters which control how big polygons are split to reduce the region's polygon complexity. - - @param shape_iterator The recursive shape iterator which delivers the hierarchy to take - @param deep_shape_store The hierarchical heap (see there) - @param area_ratio The maximum ratio of bounding box to polygon area before polygons are split - - This method has been introduced in version 0.26. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> None: - r""" - @brief Constructor from a text set - - @param shape_iterator The iterator from which to derive the texts - @param expr The selection string - @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. - @param enl The per-side enlargement of the box to mark the text (1 gives a 2x2 DBU box) - This special constructor will create a region from the text objects delivered by the shape iterator. Each text object will give a small (non-empty) box that represents the text origin. - Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: - - @code - region = RBA::Region::new(iter, "*") # all texts - region = RBA::Region::new(iter, "A*") # all texts starting with an 'A' - region = RBA::Region::new(iter, "A*", false) # all texts exactly matching 'A*' - @/code - - This method has been introduced in version 0.25. The enlargement parameter has been added in version 0.26. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, deep_shape_store: DeepShapeStore, trans: ICplxTrans, area_ratio: Optional[float] = ..., max_vertex_count: Optional[int] = ...) -> None: - r""" - @brief Constructor for a deep region from a hierarchical shape set - - This constructor creates a hierarchical region. Use a \DeepShapeStore object to supply the hierarchical heap. See \DeepShapeStore for more details. - - 'area_ratio' and 'max_vertex' supply two optimization parameters which control how big polygons are split to reduce the region's polygon complexity. - - The transformation is useful to scale to a specific database unit for example. - - @param shape_iterator The recursive shape iterator which delivers the hierarchy to take - @param deep_shape_store The hierarchical heap (see there) - @param area_ratio The maximum ratio of bounding box to polygon area before polygons are split - @param trans The transformation to apply when storing the layout data - - This method has been introduced in version 0.26. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, expr: str, as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> None: - r""" - @brief Constructor from a text set - - @param shape_iterator The iterator from which to derive the texts - @param dss The \DeepShapeStore object that acts as a heap for hierarchical operations. - @param expr The selection string - @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. - @param enl The per-side enlargement of the box to mark the text (1 gives a 2x2 DBU box) - This special constructor will create a deep region from the text objects delivered by the shape iterator. Each text object will give a small (non-empty) box that represents the text origin. - Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: - - @code - region = RBA::Region::new(iter, dss, "*") # all texts - region = RBA::Region::new(iter, dss, "A*") # all texts starting with an 'A' - region = RBA::Region::new(iter, dss, "A*", false) # all texts exactly matching 'A*' - @/code - - This variant has been introduced in version 0.26. - """ - def __ior__(self, other: Region) -> Region: - r""" - @brief Performs the boolean OR between self and the other region - - @return The region after modification (self) - - The boolean OR is implemented by merging the polygons of both regions. To simply join the regions without merging, the + operator is more efficient. - """ - def __isub__(self, other: Region) -> Region: - r""" - @brief Performs the boolean NOT between self and the other region - - @return The region after modification (self) - - This method will compute the boolean NOT (intersection) between two regions. The result is often but not necessarily always merged. - """ - def __iter__(self) -> Iterator[Polygon]: - r""" - @brief Returns each polygon of the region - - This returns the raw polygons (not merged polygons if merged semantics is enabled). - """ - def __ixor__(self, other: Region) -> Region: - r""" - @brief Performs the boolean XOR between self and the other region - - @return The region after modification (self) - - This method will compute the boolean XOR (intersection) between two regions. The result is often but not necessarily always merged. - """ - def __or__(self, other: Region) -> Region: - r""" - @brief Returns the boolean OR between self and the other region - - @return The resulting region - - The boolean OR is implemented by merging the polygons of both regions. To simply join the regions without merging, the + operator is more efficient. - """ - def __repr__(self) -> str: - r""" - @brief Converts the region to a string - The length of the output is limited to 20 polygons to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. - """ - def __str__(self) -> str: - r""" - @brief Converts the region to a string - The length of the output is limited to 20 polygons to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. - """ - def __sub__(self, other: Region) -> Region: - r""" - @brief Returns the boolean NOT between self and the other region - - @return The result of the boolean NOT operation - - This method will compute the boolean NOT (intersection) between two regions. The result is often but not necessarily always merged. - """ - def __xor__(self, other: Region) -> Region: - r""" - @brief Returns the boolean XOR between self and the other region - - @return The result of the boolean XOR operation - - This method will compute the boolean XOR (intersection) between two regions. The result is often but not necessarily always merged. - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def andnot(self, other: Region) -> List[Region]: - r""" - @brief Returns the boolean AND and NOT between self and the other region - - @return A two-element array of regions with the first one being the AND result and the second one being the NOT result - - This method will compute the boolean AND and NOT between two regions simultaneously. Because this requires a single sweep only, using this method is faster than doing AND and NOT separately. - - This method has been added in version 0.27. - """ - @overload - def area(self) -> int: - r""" - @brief The area of the region - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - If merged semantics is not enabled, overlapping areas are counted twice. - """ - @overload - def area(self, rect: Box) -> int: - r""" - @brief The area of the region (restricted to a rectangle) - This version will compute the area of the shapes, restricting the computation to the given rectangle. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - If merged semantics is not enabled, overlapping areas are counted twice. - """ - def assign(self, other: ShapeCollection) -> None: - r""" - @brief Assigns another object to self - """ - def bbox(self) -> Box: - r""" - @brief Return the bounding box of the region - The bounding box is the box enclosing all points of all polygons. - """ - def break_(self, max_vertex_count: int, max_area_ratio: Optional[float] = ...) -> None: - r""" - @brief Breaks the polygons of the region into smaller ones - - There are two criteria for splitting a polygon: a polygon is split into parts with less then 'max_vertex_count' points and an bounding box-to-polygon area ratio less than 'max_area_ratio'. The area ratio is supposed to render polygons whose bounding box is a better approximation. This applies for example to 'L' shape polygons. - - Using a value of 0 for either limit means that the respective limit isn't checked. Breaking happens by cutting the polygons into parts at 'good' locations. The algorithm does not have a specific goal to minimize the number of parts for example. The only goal is to achieve parts within the given limits. - - This method has been introduced in version 0.26. - """ - def clear(self) -> None: - r""" - @brief Clears the region - """ - def complex_op(self, node: CompoundRegionOperationNode) -> Any: - r""" - @brief Executes a complex operation (see \CompoundRegionOperationNode for details) - - This method has been introduced in version 0.27. - """ - def corners(self, angle_min: Optional[float] = ..., angle_max: Optional[float] = ..., dim: Optional[int] = ..., include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> Region: - r""" - @brief This method will select all corners whose attached edges satisfy the angle condition. - - The angle values specify a range of angles: all corners whose attached edges form an angle between angle_min and angle_max will be reported boxes with 2*dim x 2*dim dimension. The default dimension is 2x2 DBU. - - If 'include_angle_min' is true, the angle condition is >= min. angle, otherwise it is > min. angle. Same for 'include_angle_,ax' and the max. angle. - - The angle is measured between the incoming and the outcoming edge in mathematical sense: a positive value is a turn left while a negative value is a turn right. Since polygon contours are oriented clockwise, positive angles will report concave corners while negative ones report convex ones. - - A similar function that reports corners as point-like edges is \corners_dots. - - This method has been introduced in version 0.25. 'include_min_angle' and 'include_max_angle' have been added in version 0.27. - """ - def corners_dots(self, angle_start: Optional[float] = ..., angle_end: Optional[float] = ..., include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> Edges: - r""" - @brief This method will select all corners whose attached edges satisfy the angle condition. - - This method is similar to \corners, but delivers an \Edges collection with dot-like edges for each corner. - - This method has been introduced in version 0.25. 'include_min_angle' and 'include_max_angle' have been added in version 0.27. - """ - def corners_edge_pairs(self, angle_start: Optional[float] = ..., angle_end: Optional[float] = ..., include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs: - r""" - @brief This method will select all corners whose attached edges satisfy the angle condition. - - This method is similar to \corners, but delivers an \EdgePairs collection with an edge pairs for each corner. - The first edge is the incoming edge of the corner, the second one the outgoing edge. - - This method has been introduced in version 0.27.1. - """ - def count(self) -> int: - r""" - @brief Returns the (flat) number of polygons in the region - - This returns the number of raw polygons (not merged polygons if merged semantics is enabled). - The count is computed 'as if flat', i.e. polygons inside a cell are multiplied by the number of times a cell is instantiated. - - The 'count' alias has been provided in version 0.26 to avoid ambiguity with the 'size' method which applies a geometrical bias. - """ - def covering(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Returns the polygons of this region which are completely covering polygons from the other region - - @return A new region containing the polygons which are covering polygons from the other region - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This attribute is sometimes called 'enclosing' instead of 'covering', but this term is reserved for the respective DRC function. - - This method has been introduced in version 0.27. - """ - def data_id(self) -> int: - r""" - @brief Returns the data ID (a unique identifier for the underlying data storage) - - This method has been added in version 0.26. - """ - def decompose_convex(self, preferred_orientation: Optional[int] = ...) -> Shapes: - r""" - @brief Decomposes the region into convex pieces. - - This method will return a \Shapes container that holds a decomposition of the region into convex, simple polygons. - See \Polygon#decompose_convex for details. If you want \Region output, you should use \decompose_convex_to_region. - - This method has been introduced in version 0.25. - """ - def decompose_convex_to_region(self, preferred_orientation: Optional[int] = ...) -> Region: - r""" - @brief Decomposes the region into convex pieces into a region. - - This method is identical to \decompose_convex, but delivers a \Region object. - - This method has been introduced in version 0.25. - """ - def decompose_trapezoids(self, mode: Optional[int] = ...) -> Shapes: - r""" - @brief Decomposes the region into trapezoids. - - This method will return a \Shapes container that holds a decomposition of the region into trapezoids. - See \Polygon#decompose_trapezoids for details. If you want \Region output, you should use \decompose_trapezoids_to_region. - - This method has been introduced in version 0.25. - """ - def decompose_trapezoids_to_region(self, mode: Optional[int] = ...) -> Region: - r""" - @brief Decomposes the region into trapezoids. - - This method is identical to \decompose_trapezoids, but delivers a \Region object. - - This method has been introduced in version 0.25. - """ - def disable_progress(self) -> None: - r""" - @brief Disable progress reporting - Calling this method will disable progress reporting. See \enable_progress. - """ - def dup(self) -> Region: - r""" - @brief Creates a copy of self - """ - def each(self) -> Iterator[Polygon]: - r""" - @brief Returns each polygon of the region - - This returns the raw polygons (not merged polygons if merged semantics is enabled). - """ - def each_merged(self) -> Iterator[Polygon]: - r""" - @brief Returns each merged polygon of the region - - This returns the raw polygons if merged semantics is disabled or the merged ones if merged semantics is enabled. - """ - def edges(self) -> Edges: - r""" - @brief Returns an edge collection representing all edges of the polygons in this region - This method will decompose the polygons into the individual edges. Edges making up the hulls of the polygons are oriented clockwise while edges making up the holes are oriented counterclockwise. - - The edge collection returned can be manipulated in various ways. See \Edges for a description of the possibilities of the edge collection. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - def enable_progress(self, label: str) -> None: - r""" - @brief Enable progress reporting - After calling this method, the region will report the progress through a progress bar while expensive operations are running. - The label is a text which is put in front of the progress bar. - Using a progress bar will imply a performance penalty of a few percent typically. - """ - def enclosed_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: - r""" - Note: This is an alias of 'inside_check'. - @brief Performs an inside check with options - @param d The minimum distance for which the polygons are checked - @param other The other region against which to check - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper limit of the projected length of one edge onto another - @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes - @param rect_filter Specifies an error filter for rectangular input shapes - @param negative Negative output from the first input - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. - - "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. - Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. - - "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. - - If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the distance is larger or equal to the limit. This is a way to flag the parts of the first input where the distance to the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge. - - Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) - - The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. - The 'enclosed_check' alias was introduced in version 0.27.5. - """ - def enclosing_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: - r""" - @brief Performs an enclosing check with options - @param d The minimum enclosing distance for which the polygons are checked - @param other The other region against which to check - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper limit of the projected length of one edge onto another - @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes - @param rect_filter Specifies an error filter for rectangular input shapes - @param negative Negative output from the first input - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. - - "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. - Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. - - "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. - - If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the enclosure is larger or equal to the limit. This is a way to flag the parts of the first input where the enclosure vs. the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge. - - Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) - - The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. - """ - def extent_refs(self, arg0: float, arg1: float, arg2: float, arg3: float, arg4: int, arg5: int) -> Region: - r""" - @hide - This method is provided for DRC implementation. - """ - def extent_refs_edges(self, arg0: float, arg1: float, arg2: float, arg3: float) -> Edges: - r""" - @hide - This method is provided for DRC implementation. - """ - @overload - def extents(self) -> Region: - r""" - @brief Returns a region with the bounding boxes of the polygons - This method will return a region consisting of the bounding boxes of the polygons. - The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def extents(self, d: int) -> Region: - r""" - @brief Returns a region with the enlarged bounding boxes of the polygons - This method will return a region consisting of the bounding boxes of the polygons enlarged by the given distance d. - The enlargement is specified per edge, i.e the width and height will be increased by 2*d. - The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def extents(self, dx: int, dy: int) -> Region: - r""" - @brief Returns a region with the enlarged bounding boxes of the polygons - This method will return a region consisting of the bounding boxes of the polygons enlarged by the given distance dx in x direction and dy in y direction. - The enlargement is specified per edge, i.e the width will be increased by 2*dx. - The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def fill(self, in_cell: Cell, fill_cell_index: int, fc_box: Box, origin: Optional[Point] = ..., remaining_parts: Optional[Region] = ..., fill_margin: Optional[Vector] = ..., remaining_polygons: Optional[Region] = ..., glue_box: Optional[Box] = ...) -> None: - r""" - @brief A mapping of \Cell#fill_region to the Region class - - This method is equivalent to \Cell#fill_region, but is based on Region (with the cell being the first parameter). - - This method has been introduced in version 0.27. - """ - @overload - def fill(self, in_cell: Cell, fill_cell_index: int, fc_origin: Box, row_step: Vector, column_step: Vector, origin: Optional[Point] = ..., remaining_parts: Optional[Region] = ..., fill_margin: Optional[Vector] = ..., remaining_polygons: Optional[Region] = ..., glue_box: Optional[Box] = ...) -> None: - r""" - @brief A mapping of \Cell#fill_region to the Region class - - This method is equivalent to \Cell#fill_region, but is based on Region (with the cell being the first parameter). - - This method has been introduced in version 0.27. - """ - def fill_multi(self, in_cell: Cell, fill_cell_index: int, fc_origin: Box, row_step: Vector, column_step: Vector, fill_margin: Optional[Vector] = ..., remaining_polygons: Optional[Region] = ..., glue_box: Optional[Box] = ...) -> None: - r""" - @brief A mapping of \Cell#fill_region to the Region class - - This method is equivalent to \Cell#fill_region, but is based on Region (with the cell being the first parameter). - - This method has been introduced in version 0.27. - """ - def flatten(self) -> Region: - r""" - @brief Explicitly flattens a region - - If the region is already flat (i.e. \has_valid_polygons? returns true), this method will not change it. - - Returns 'self', so this method can be used in a dot concatenation. - - This method has been introduced in version 0.26. - """ - def grid_check(self, gx: int, gy: int) -> EdgePairs: - r""" - @brief Returns a marker for all vertices not being on the given grid - This method will return an edge pair object for every vertex whose x coordinate is not a multiple of gx or whose y coordinate is not a multiple of gy. The edge pair objects contain two edges consisting of the same single point - the original vertex. - - If gx or gy is 0 or less, the grid is not checked in that direction. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - def has_valid_polygons(self) -> bool: - r""" - @brief Returns true if the region is flat and individual polygons can be accessed randomly - - This method has been introduced in version 0.26. - """ - def hier_count(self) -> int: - r""" - @brief Returns the (hierarchical) number of polygons in the region - - This returns the number of raw polygons (not merged polygons if merged semantics is enabled). - The count is computed 'hierarchical', i.e. polygons inside a cell are counted once even if the cell is instantiated multiple times. - - This method has been introduced in version 0.27. - """ - def holes(self) -> Region: - r""" - @brief Returns the holes of the region - This method returns all holes as filled polygons. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - If merge semantics is not enabled, the holes may not be detected if the polygons are taken from a hole-less representation (i.e. GDS2 file). Use explicit merge (\merge method) in order to merge the polygons and detect holes. - """ - def hulls(self) -> Region: - r""" - @brief Returns the hulls of the region - This method returns all hulls as polygons. The holes will be removed (filled). - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - If merge semantics is not enabled, the hull may also enclose holes if the polygons are taken from a hole-less representation (i.e. GDS2 file). Use explicit merge (\merge method) in order to merge the polygons and detect holes. - """ - @overload - def insert(self, array: Sequence[Polygon]) -> None: - r""" - @brief Inserts all polygons from the array into this region - """ - @overload - def insert(self, box: Box) -> None: - r""" - @brief Inserts a box - - Inserts a box into the region. - """ - @overload - def insert(self, path: Path) -> None: - r""" - @brief Inserts a path - - Inserts a path into the region. - """ - @overload - def insert(self, polygon: Polygon) -> None: - r""" - @brief Inserts a polygon - - Inserts a polygon into the region. - """ - @overload - def insert(self, polygon: SimplePolygon) -> None: - r""" - @brief Inserts a simple polygon - - Inserts a simple polygon into the region. - """ - @overload - def insert(self, region: Region) -> None: - r""" - @brief Inserts all polygons from the other region into this region - This method has been introduced in version 0.25. - """ - @overload - def insert(self, shape_iterator: RecursiveShapeIterator) -> None: - r""" - @brief Inserts all shapes delivered by the recursive shape iterator into this region - - This method will insert all shapes delivered by the shape iterator and insert them into the region. - Text objects and edges are not inserted, because they cannot be converted to polygons. - """ - @overload - def insert(self, shapes: Shapes) -> None: - r""" - @brief Inserts all polygons from the shape collection into this region - This method takes each "polygon-like" shape from the shape collection and inserts this shape into the region. Paths and boxes are converted to polygons during this process. Edges and text objects are ignored. - - This method has been introduced in version 0.25. - """ - @overload - def insert(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None: - r""" - @brief Inserts all shapes delivered by the recursive shape iterator into this region with a transformation - - This method will insert all shapes delivered by the shape iterator and insert them into the region. - Text objects and edges are not inserted, because they cannot be converted to polygons. - This variant will apply the given transformation to the shapes. This is useful to scale the shapes to a specific database unit for example. - """ - @overload - def insert(self, shapes: Shapes, trans: ICplxTrans) -> None: - r""" - @brief Inserts all polygons from the shape collection into this region with complex transformation - This method takes each "polygon-like" shape from the shape collection and inserts this shape into the region after applying the given complex transformation. Paths and boxes are converted to polygons during this process. Edges and text objects are ignored. - - This method has been introduced in version 0.25. - """ - @overload - def insert(self, shapes: Shapes, trans: Trans) -> None: - r""" - @brief Inserts all polygons from the shape collection into this region with transformation - This method takes each "polygon-like" shape from the shape collection and inserts this shape into the region after applying the given transformation. Paths and boxes are converted to polygons during this process. Edges and text objects are ignored. - - This method has been introduced in version 0.25. - """ - def insert_into(self, layout: Layout, cell_index: int, layer: int) -> None: - r""" - @brief Inserts this region into the given layout, below the given cell and into the given layer. - If the region is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused. - - This method has been introduced in version 0.26. - """ - def inside(self, other: Region) -> Region: - r""" - @brief Returns the polygons of this region which are completely inside polygons from the other region - - @return A new region containing the polygons which are inside polygons from the other region - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - def inside_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: - r""" - @brief Performs an inside check with options - @param d The minimum distance for which the polygons are checked - @param other The other region against which to check - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper limit of the projected length of one edge onto another - @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes - @param rect_filter Specifies an error filter for rectangular input shapes - @param negative Negative output from the first input - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. - - "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. - Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. - - "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. - - If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the distance is larger or equal to the limit. This is a way to flag the parts of the first input where the distance to the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge. - - Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) - - The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. - The 'enclosed_check' alias was introduced in version 0.27.5. - """ - @overload - def interacting(self, other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Returns the polygons of this region which overlap or touch edges from the edge collection - - 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with edges of the edge collection to make the polygon selected. A polygon is selected by this method if the number of edges interacting with the polygon is between min_count and max_count (including max_count). - - @return A new region containing the polygons overlapping or touching edges from the edge collection - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.25. - The min_count and max_count arguments have been added in version 0.27. - """ - @overload - def interacting(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Returns the polygons of this region which overlap or touch polygons from the other region - - 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with (different) polygons of the other region to make the polygon selected. A polygon is selected by this method if the number of polygons interacting with a polygon of this region is between min_count and max_count (including max_count). - - @return A new region containing the polygons overlapping or touching polygons from the other region - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - The min_count and max_count arguments have been added in version 0.27. - """ - @overload - def interacting(self, other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Returns the polygons of this region which overlap or touch texts - - 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with texts of the text collection to make the polygon selected. A polygon is selected by this method if the number of texts interacting with the polygon is between min_count and max_count (including max_count). - - @return A new region containing the polygons overlapping or touching texts - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27 - """ - def is_box(self) -> bool: - r""" - @brief Returns true, if the region is a simple box - - @return True if the region is a box. - - This method does not apply implicit merging if merge semantics is enabled. - If the region is not merged, this method may return false even - if the merged region would be a box. - """ - def is_deep(self) -> bool: - r""" - @brief Returns true if the region is a deep (hierarchical) one - - This method has been added in version 0.26. - """ - def is_empty(self) -> bool: - r""" - @brief Returns true if the region is empty - """ - def is_merged(self) -> bool: - r""" - @brief Returns true if the region is merged - If the region is merged, polygons will not touch or overlap. You can ensure merged state by calling \merge. - """ - def isolated_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: - r""" - @brief Performs a space check between edges of different polygons with options - @param d The minimum space for which the polygons are checked - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper limit of the projected length of one edge onto another - @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes - @param rect_filter Specifies an error filter for rectangular input shapes - @param negative If true, edges not violation the condition will be output as pseudo-edge pairs - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. - - "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. - Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. - - "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. - - Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) - - The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. - """ - def members_of(self, other: Region) -> Region: - r""" - @brief Returns all polygons which are members of the other region - This method returns all polygons in self which can be found in the other region as well with exactly the same geometry. - """ - @overload - def merge(self) -> Region: - r""" - @brief Merge the region - - @return The region after is has been merged (self). - - Merging removes overlaps and joins touching polygons. - If the region is already merged, this method does nothing - """ - @overload - def merge(self, min_wc: int) -> Region: - r""" - @brief Merge the region with options - - @param min_wc Overlap selection - @return The region after is has been merged (self). - - Merging removes overlaps and joins touching polygons. - This version provides one additional option: "min_wc" controls whether output is only produced if multiple polygons overlap. The value specifies the number of polygons that need to overlap. A value of 2 means that output is only produced if two or more polygons overlap. - - This method is equivalent to "merge(false, min_wc). - """ - @overload - def merge(self, min_coherence: bool, min_wc: int) -> Region: - r""" - @brief Merge the region with options - - @param min_coherence A flag indicating whether the resulting polygons shall have minimum coherence - @param min_wc Overlap selection - @return The region after is has been merged (self). - - Merging removes overlaps and joins touching polygons. - This version provides two additional options: if "min_coherence" is set to true, "kissing corners" are resolved by producing separate polygons. "min_wc" controls whether output is only produced if multiple polygons overlap. The value specifies the number of polygons that need to overlap. A value of 2 means that output is only produced if two or more polygons overlap. - """ - @overload - def merged(self) -> Region: - r""" - @brief Returns the merged region - - @return The region after is has been merged. - - Merging removes overlaps and joins touching polygons. - If the region is already merged, this method does nothing. - In contrast to \merge, this method does not modify the region but returns a merged copy. - """ - @overload - def merged(self, min_wc: int) -> Region: - r""" - @brief Returns the merged region (with options) - - @return The region after is has been merged. - - This version provides one additional options: "min_wc" controls whether output is only produced if multiple polygons overlap. The value specifies the number of polygons that need to overlap. A value of 2 means that output is only produced if two or more polygons overlap. - - This method is equivalent to "merged(false, min_wc)". - - In contrast to \merge, this method does not modify the region but returns a merged copy. - """ - @overload - def merged(self, min_coherence: bool, min_wc: int) -> Region: - r""" - @brief Returns the merged region (with options) - - @param min_coherence A flag indicating whether the resulting polygons shall have minimum coherence - @param min_wc Overlap selection - @return The region after is has been merged (self). - - Merging removes overlaps and joins touching polygons. - This version provides two additional options: if "min_coherence" is set to true, "kissing corners" are resolved by producing separate polygons. "min_wc" controls whether output is only produced if multiple polygons overlap. The value specifies the number of polygons that need to overlap. A value of 2 means that output is only produced if two or more polygons overlap. - - In contrast to \merge, this method does not modify the region but returns a merged copy. - """ - @overload - def minkowski_sum(self, b: Box) -> Region: - r""" - @brief Compute the Minkowski sum of the region and a box - - @param b The box. - - @return The new polygons representing the Minkowski sum of self and the box. - - The result is equivalent to the region-with-polygon Minkowski sum with the box used as the second polygon. - - The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) - """ - @overload - def minkowski_sum(self, b: Sequence[Point]) -> Region: - r""" - @brief Compute the Minkowski sum of the region and a contour of points (a trace) - - @param b The contour (a series of points forming the trace). - - @return The new polygons representing the Minkowski sum of self and the contour. - - The Minkowski sum of a region and a contour basically results in the area covered when "dragging" the region along the contour. The effect is similar to drawing the contour with a pencil that has the shape of the given region. - - The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) - """ - @overload - def minkowski_sum(self, e: Edge) -> Region: - r""" - @brief Compute the Minkowski sum of the region and an edge - - @param e The edge. - - @return The new polygons representing the Minkowski sum with the edge e. - - The Minkowski sum of a region and an edge basically results in the area covered when "dragging" the region along the line given by the edge. The effect is similar to drawing the line with a pencil that has the shape of the given region. - - The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) - """ - @overload - def minkowski_sum(self, p: Polygon) -> Region: - r""" - @brief Compute the Minkowski sum of the region and a polygon - - @param p The first argument. - - @return The new polygons representing the Minkowski sum of self and p. - - The Minkowski sum of a region and a polygon is basically the result of "painting" the region with a pen that has the shape of the second polygon. - - The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) - """ - @overload - def move(self, v: Vector) -> Region: - r""" - @brief Moves the region - - Moves the polygon by the given offset and returns the - moved region. The region is overwritten. - - @param v The distance to move the region. - - Starting with version 0.25 this method accepts a vector argument. - - @return The moved region (self). - """ - @overload - def move(self, x: int, y: int) -> Region: - r""" - @brief Moves the region - - Moves the region by the given offset and returns the - moved region. The region is overwritten. - - @param x The x distance to move the region. - @param y The y distance to move the region. - - @return The moved region (self). - """ - @overload - def moved(self, v: Vector) -> Region: - r""" - @brief Returns the moved region (does not modify self) - - Moves the region by the given offset and returns the - moved region. The region is not modified. - - Starting with version 0.25 this method accepts a vector argument. - - @param p The distance to move the region. - - @return The moved region. - """ - @overload - def moved(self, x: int, y: int) -> Region: - r""" - @brief Returns the moved region (does not modify self) - - Moves the region by the given offset and returns the - moved region. The region is not modified. - - @param x The x distance to move the region. - @param y The y distance to move the region. - - @return The moved region. - """ - def non_rectangles(self) -> Region: - r""" - @brief Returns all polygons which are not rectangles - This method returns all polygons in self which are not rectangles.Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - def non_rectilinear(self) -> Region: - r""" - @brief Returns all polygons which are not rectilinear - This method returns all polygons in self which are not rectilinear.Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - def non_squares(self) -> Region: - r""" - @brief Returns all polygons which are not squares - This method returns all polygons in self which are not squares.Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27. - """ - def not_covering(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Returns the polygons of this region which are not completely covering polygons from the other region - - @return A new region containing the polygons which are not covering polygons from the other region - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This attribute is sometimes called 'enclosing' instead of 'covering', but this term is reserved for the respective DRC function. - - This method has been introduced in version 0.27. - """ - def not_inside(self, other: Region) -> Region: - r""" - @brief Returns the polygons of this region which are not completely inside polygons from the other region - - @return A new region containing the polygons which are not inside polygons from the other region - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def not_interacting(self, other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Returns the polygons of this region which do not overlap or touch edges from the edge collection - - 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with edges of the edge collection to make the polygon not selected. A polygon is not selected by this method if the number of edges interacting with the polygon is between min_count and max_count (including max_count). - - @return A new region containing the polygons not overlapping or touching edges from the edge collection - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.25 - The min_count and max_count arguments have been added in version 0.27. - """ - @overload - def not_interacting(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Returns the polygons of this region which do not overlap or touch polygons from the other region - - 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with (different) polygons of the other region to make the polygon not selected. A polygon is not selected by this method if the number of polygons interacting with a polygon of this region is between min_count and max_count (including max_count). - - @return A new region containing the polygons not overlapping or touching polygons from the other region - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - The min_count and max_count arguments have been added in version 0.27. - """ - @overload - def not_interacting(self, other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Returns the polygons of this region which do not overlap or touch texts - - 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with texts of the text collection to make the polygon not selected. A polygon is not selected by this method if the number of texts interacting with the polygon is between min_count and max_count (including max_count). - - @return A new region containing the polygons not overlapping or touching texts - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27 - """ - def not_members_of(self, other: Region) -> Region: - r""" - @brief Returns all polygons which are not members of the other region - This method returns all polygons in self which can not be found in the other region with exactly the same geometry. - """ - def not_outside(self, other: Region) -> Region: - r""" - @brief Returns the polygons of this region which are not completely outside polygons from the other region - - @return A new region containing the polygons which are not outside polygons from the other region - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - def not_overlapping(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Returns the polygons of this region which do not overlap polygons from the other region - - @return A new region containing the polygons not overlapping polygons from the other region - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - The count options have been introduced in version 0.27. - """ - def notch_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., negative: Optional[bool] = ...) -> EdgePairs: - r""" - @brief Performs a space check between edges of the same polygon with options - @param d The minimum space for which the polygons are checked - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper limit of the projected length of one edge onto another - @param shielded Enables shielding - @param negative If true, edges not violation the condition will be output as pseudo-edge pairs - - This version is similar to the simple version with one parameter. In addition, it allows to specify many more options. - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the space check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. - - "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. - Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. - - Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) - - The 'shielded' and 'negative' options have been introduced in version 0.27. - """ - def outside(self, other: Region) -> Region: - r""" - @brief Returns the polygons of this region which are completely outside polygons from the other region - - @return A new region containing the polygons which are outside polygons from the other region - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - def overlap_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: - r""" - @brief Performs an overlap check with options - @param d The minimum overlap for which the polygons are checked - @param other The other region against which to check - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper limit of the projected length of one edge onto another - @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes - @param rect_filter Specifies an error filter for rectangular input shapes - @param negative Negative output from the first input - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. - - "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. - Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. - - "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. - - If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the overlap is larger or equal to the limit. This is a way to flag the parts of the first input where the overlap vs. the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge. - - Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) - - The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. - """ - def overlapping(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Returns the polygons of this region which overlap polygons from the other region - - @return A new region containing the polygons overlapping polygons from the other region - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - The count options have been introduced in version 0.27. - """ - @overload - def perimeter(self) -> int: - r""" - @brief The total perimeter of the polygons - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - If merged semantics is not enabled, internal edges are counted as well. - """ - @overload - def perimeter(self, rect: Box) -> int: - r""" - @brief The total perimeter of the polygons (restricted to a rectangle) - This version will compute the perimeter of the polygons, restricting the computation to the given rectangle. - Edges along the border are handled in a special way: they are counted when they are oriented with their inside side toward the rectangle (in other words: outside edges must coincide with the rectangle's border in order to be counted). - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - If merged semantics is not enabled, internal edges are counted as well. - """ - def pull_inside(self, other: Region) -> Region: - r""" - @brief Returns all polygons of "other" which are inside polygons of this region - The "pull_..." methods are similar to "select_..." but work the opposite way: they select shapes from the argument region rather than self. In a deep (hierarchical) context the output region will be hierarchically aligned with self, so the "pull_..." methods provide a way for re-hierarchization. - - @return The region after the polygons have been selected (from other) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.26.1 - """ - @overload - def pull_interacting(self, other: Edges) -> Edges: - r""" - @brief Returns all edges of "other" which are interacting with polygons of this region - See \pull_inside for a description of the "pull_..." methods. - - @return The edge collection after the edges have been selected (from other) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.26.1 - """ - @overload - def pull_interacting(self, other: Region) -> Region: - r""" - @brief Returns all polygons of "other" which are interacting with (overlapping, touching) polygons of this region - See \pull_inside for a description of the "pull_..." methods. - - @return The region after the polygons have been selected (from other) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.26.1 - """ - @overload - def pull_interacting(self, other: Texts) -> Texts: - r""" - @brief Returns all texts of "other" which are interacting with polygons of this region - See \pull_inside for a description of the "pull_..." methods. - - @return The text collection after the texts have been selected (from other) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27 - """ - def pull_overlapping(self, other: Region) -> Region: - r""" - @brief Returns all polygons of "other" which are overlapping polygons of this region - See \pull_inside for a description of the "pull_..." methods. - - @return The region after the polygons have been selected (from other) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.26.1 - """ - def rectangles(self) -> Region: - r""" - @brief Returns all polygons which are rectangles - This method returns all polygons in self which are rectangles.Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - def rectilinear(self) -> Region: - r""" - @brief Returns all polygons which are rectilinear - This method returns all polygons in self which are rectilinear.Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - def round_corners(self, r_inner: float, r_outer: float, n: int) -> None: - r""" - @brief Corner rounding - @param r_inner Inner corner radius (in database units) - @param r_outer Outer corner radius (in database units) - @param n The number of points per circle - - This method rounds the corners of the polygons in the region. Inner corners will be rounded with a radius of r_inner and outer corners with a radius of r_outer. The circles will be approximated by segments using n segments per full circle. - - This method modifies the region. \rounded_corners is a method that does the same but returns a new region without modifying self. Merged semantics applies for this method. - """ - def rounded_corners(self, r_inner: float, r_outer: float, n: int) -> Region: - r""" - @brief Corner rounding - @param r_inner Inner corner radius (in database units) - @param r_outer Outer corner radius (in database units) - @param n The number of points per circle - - See \round_corners for a description of this method. This version returns a new region instead of modifying self (out-of-place). - """ - def scale_and_snap(self, gx: int, mx: int, dx: int, gy: int, my: int, dy: int) -> None: - r""" - @brief Scales and snaps the region to the given grid - This method will first scale the region by a rational factor of mx/dx horizontally and my/dy vertically and then snap the region to the given grid - each x or y coordinate is brought on the gx or gy grid by rounding to the nearest value which is a multiple of gx or gy. - - If gx or gy is 0, the result is brought on a grid of 1. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.26.1. - """ - def scaled_and_snapped(self, gx: int, mx: int, dx: int, gy: int, my: int, dy: int) -> Region: - r""" - @brief Returns the scaled and snapped region - This method will scale and snap the region to the given grid and return the scaled and snapped region (see \scale_and_snap). The original region is not modified. - - This method has been introduced in version 0.26.1. - """ - def select_covering(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Selects the polygons of this region which are completely covering polygons from the other region - - @return The region after the polygons have been selected (self) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This attribute is sometimes called 'enclosing' instead of 'covering', but this term is reserved for the respective DRC function. - - This method has been introduced in version 0.27. - """ - def select_inside(self, other: Region) -> Region: - r""" - @brief Selects the polygons of this region which are completely inside polygons from the other region - - @return The region after the polygons have been selected (self) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def select_interacting(self, other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Selects the polygons from this region which overlap or touch edges from the edge collection - - 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with edges of the edge collection to make the polygon selected. A polygon is selected by this method if the number of edges interacting with the polygon is between min_count and max_count (including max_count). - - @return The region after the polygons have been selected (self) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.25 - The min_count and max_count arguments have been added in version 0.27. - """ - @overload - def select_interacting(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Selects the polygons from this region which overlap or touch polygons from the other region - - 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with (different) polygons of the other region to make the polygon selected. A polygon is selected by this method if the number of polygons interacting with a polygon of this region is between min_count and max_count (including max_count). - - @return The region after the polygons have been selected (self) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - The min_count and max_count arguments have been added in version 0.27. - """ - @overload - def select_interacting(self, other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Selects the polygons of this region which overlap or touch texts - - @return The region after the polygons have been selected (self) - - 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with texts of the text collection to make the polygon selected. A polygon is selected by this method if the number of texts interacting with the polygon is between min_count and max_count (including max_count). - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27 - """ - def select_not_covering(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Selects the polygons of this region which are not completely covering polygons from the other region - - @return The region after the polygons have been selected (self) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This attribute is sometimes called 'enclosing' instead of 'covering', but this term is reserved for the respective DRC function. - - This method has been introduced in version 0.27. - """ - def select_not_inside(self, other: Region) -> Region: - r""" - @brief Selects the polygons of this region which are not completely inside polygons from the other region - - @return The region after the polygons have been selected (self) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def select_not_interacting(self, other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Selects the polygons from this region which do not overlap or touch edges from the edge collection - - 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with edges of the edge collection to make the polygon not selected. A polygon is not selected by this method if the number of edges interacting with the polygon is between min_count and max_count (including max_count). - - @return The region after the polygons have been selected (self) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.25 - The min_count and max_count arguments have been added in version 0.27. - """ - @overload - def select_not_interacting(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Selects the polygons from this region which do not overlap or touch polygons from the other region - - 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with (different) polygons of the other region to make the polygon not selected. A polygon is not selected by this method if the number of polygons interacting with a polygon of this region is between min_count and max_count (including max_count). - - @return The region after the polygons have been selected (self) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - The min_count and max_count arguments have been added in version 0.27. - """ - @overload - def select_not_interacting(self, other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Selects the polygons of this region which do not overlap or touch texts - - 'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with texts of the text collection to make the polygon not selected. A polygon is not selected by this method if the number of texts interacting with the polygon is between min_count and max_count (including max_count). - - @return The region after the polygons have been selected (self) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27 - """ - def select_not_outside(self, other: Region) -> Region: - r""" - @brief Selects the polygons of this region which are not completely outside polygons from the other region - - @return The region after the polygons have been selected (self) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - def select_not_overlapping(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Selects the polygons from this region which do not overlap polygons from the other region - - @return The region after the polygons have been selected (self) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - The count options have been introduced in version 0.27. - """ - def select_outside(self, other: Region) -> Region: - r""" - @brief Selects the polygons of this region which are completely outside polygons from the other region - - @return The region after the polygons have been selected (self) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - def select_overlapping(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: - r""" - @brief Selects the polygons from this region which overlap polygons from the other region - - @return The region after the polygons have been selected (self) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - The count options have been introduced in version 0.27. - """ - def separation_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: - r""" - @brief Performs a separation check with options - @param d The minimum separation for which the polygons are checked - @param other The other region against which to check - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper limit of the projected length of one edge onto another - @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes - @param rect_filter Specifies an error filter for rectangular input shapes - @param negative Negative output from the first input - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. - - "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. - Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. - - "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. - - If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the separation is larger or equal to the limit. This is a way to flag the parts of the first input where the distance to the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge. - - Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) - - The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. - """ - @overload - def size(self, d: int) -> Region: - r""" - @brief Isotropic sizing (biasing) - - @return The region after the sizing has applied (self) - - This method is equivalent to "size(d, d, 2)". - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def size(self, d: int, mode: int) -> Region: - r""" - @brief Isotropic sizing (biasing) - - @return The region after the sizing has applied (self) - - This method is equivalent to "size(d, d, mode)". - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def size(self, dx: int, dy: int, mode: int) -> Region: - r""" - @brief Anisotropic sizing (biasing) - - @return The region after the sizing has applied (self) - - Shifts the contour outwards (dx,dy>0) or inwards (dx,dy<0). - dx is the sizing in x-direction and dy is the sizing in y-direction. The sign of dx and dy should be identical. - - This method applies a sizing to the region. Before the sizing is done, the - region is merged if this is not the case already. - - The mode defines at which bending angle cutoff occurs - (0:>0, 1:>45, 2:>90, 3:>135, 4:>approx. 168, other:>approx. 179) - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - The result is a set of polygons which may be overlapping, but are not self- - intersecting. Polygons may overlap afterwards because they grew big enough to overlap their neighbors. - In that case, \merge can be used to detect this overlaps by setting the "min_wc" parameter to value 1: - - @code - r = RBA::Region::new - r.insert(RBA::Box::new(0, 0, 50, 50)) - r.insert(RBA::Box::new(100, 0, 150, 50)) - r.size(50, 2) - r.merge(false, 1) - # r now is (50,-50;50,100;100,100;100,-50) - @/code - """ - @overload - def sized(self, d: int) -> Region: - r""" - @brief Isotropic sizing (biasing) - - @return The region after the sizing has applied (self) - - This method is equivalent to "sized(d, d, 2)". - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def sized(self, d: int, mode: int) -> Region: - r""" - @brief Returns the isotropically sized region - - @return The sized region - - This method is returns the sized region (see \size), but does not modify self. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def sized(self, dx: int, dy: int, mode: int) -> Region: - r""" - @brief Returns the anisotropically sized region - - @return The sized region - - This method is returns the sized region (see \size), but does not modify self. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - def smooth(self, d: int, keep_hv: Optional[bool] = ...) -> None: - r""" - @brief Smoothing - @param d The smoothing tolerance (in database units) - @param keep_hv If true, horizontal and vertical edges are maintained - - This method will simplify the merged polygons of the region by removing vertexes if the resulting polygon stays equivalent with the original polygon. Equivalence is measured in terms of a deviation which is guaranteed to not become larger than \d. - This method modifies the region. \smoothed is a method that does the same but returns a new region without modifying self. Merged semantics applies for this method. - """ - def smoothed(self, d: int, keep_hv: Optional[bool] = ...) -> Region: - r""" - @brief Smoothing - @param d The smoothing tolerance (in database units) - @param keep_hv If true, horizontal and vertical edges are maintained - - See \smooth for a description of this method. This version returns a new region instead of modifying self (out-of-place). It has been introduced in version 0.25. - """ - def snap(self, gx: int, gy: int) -> None: - r""" - @brief Snaps the region to the given grid - This method will snap the region to the given grid - each x or y coordinate is brought on the gx or gy grid by rounding to the nearest value which is a multiple of gx or gy. - - If gx or gy is 0, no snapping happens in that direction. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - def snapped(self, gx: int, gy: int) -> Region: - r""" - @brief Returns the snapped region - This method will snap the region to the given grid and return the snapped region (see \snap). The original region is not modified. - """ - def space_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: - r""" - @brief Performs a space check with options - @param d The minimum space for which the polygons are checked - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper limit of the projected length of one edge onto another - @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes - @param rect_filter Specifies an error filter for rectangular input shapes - @param negative If true, edges not violation the condition will be output as pseudo-edge pairs - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. - - "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. - Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. - - "opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures. - - Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) - - The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. - """ - def split_covering(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: - r""" - @brief Returns the polygons of this region which are completely covering polygons from the other region and the ones which are not at the same time - - @return Two new regions: the first containing the result of \covering, the second the result of \not_covering - - This method is equivalent to calling \covering and \not_covering, but is faster when both results are required. - Merged semantics applies for this method (see \merged_semantics= for a description of this concept). - - This method has been introduced in version 0.27. - """ - def split_inside(self, other: Region) -> List[Region]: - r""" - @brief Returns the polygons of this region which are completely inside polygons from the other region and the ones which are not at the same time - - @return Two new regions: the first containing the result of \inside, the second the result of \not_inside - - This method is equivalent to calling \inside and \not_inside, but is faster when both results are required. - Merged semantics applies for this method (see \merged_semantics= for a description of this concept). - - This method has been introduced in version 0.27. - """ - @overload - def split_interacting(self, other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: - r""" - @brief Returns the polygons of this region which are interacting with edges from the other edge collection and the ones which are not at the same time - - @return Two new regions: the first containing the result of \interacting, the second the result of \not_interacting - - This method is equivalent to calling \interacting and \not_interacting, but is faster when both results are required. - Merged semantics applies for this method (see \merged_semantics= for a description of this concept). - - This method has been introduced in version 0.27. - """ - @overload - def split_interacting(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: - r""" - @brief Returns the polygons of this region which are interacting with polygons from the other region and the ones which are not at the same time - - @return Two new regions: the first containing the result of \interacting, the second the result of \not_interacting - - This method is equivalent to calling \interacting and \not_interacting, but is faster when both results are required. - Merged semantics applies for this method (see \merged_semantics= for a description of this concept). - - This method has been introduced in version 0.27. - """ - @overload - def split_interacting(self, other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: - r""" - @brief Returns the polygons of this region which are interacting with texts from the other text collection and the ones which are not at the same time - - @return Two new regions: the first containing the result of \interacting, the second the result of \not_interacting - - This method is equivalent to calling \interacting and \not_interacting, but is faster when both results are required. - Merged semantics applies for this method (see \merged_semantics= for a description of this concept). - - This method has been introduced in version 0.27. - """ - def split_outside(self, other: Region) -> List[Region]: - r""" - @brief Returns the polygons of this region which are completely outside polygons from the other region and the ones which are not at the same time - - @return Two new regions: the first containing the result of \outside, the second the result of \not_outside - - This method is equivalent to calling \outside and \not_outside, but is faster when both results are required. - Merged semantics applies for this method (see \merged_semantics= for a description of this concept). - - This method has been introduced in version 0.27. - """ - def split_overlapping(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: - r""" - @brief Returns the polygons of this region which are overlapping with polygons from the other region and the ones which are not at the same time - - @return Two new regions: the first containing the result of \overlapping, the second the result of \not_overlapping - - This method is equivalent to calling \overlapping and \not_overlapping, but is faster when both results are required. - Merged semantics applies for this method (see \merged_semantics= for a description of this concept). - - This method has been introduced in version 0.27. - """ - def squares(self) -> Region: - r""" - @brief Returns all polygons which are squares - This method returns all polygons in self which are squares.Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27. - """ - def strange_polygon_check(self) -> Region: - r""" - @brief Returns a region containing those parts of polygons which are "strange" - Strange parts of polygons are self-overlapping parts or non-orientable parts (i.e. in the "8" configuration). - - Merged semantics does not apply for this method (see \merged_semantics= for a description of this concept) - """ - def swap(self, other: Region) -> None: - r""" - @brief Swap the contents of this region with the contents of another region - This method is useful to avoid excessive memory allocation in some cases. For managed memory languages such as Ruby, those cases will be rare. - """ - @overload - def texts(self, expr: Optional[str] = ..., as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region: - r""" - @hide - This method is provided for DRC implementation only. - """ - @overload - def texts(self, dss: DeepShapeStore, expr: Optional[str] = ..., as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region: - r""" - @hide - This method is provided for DRC implementation only. - """ - @overload - def texts_dots(self, expr: Optional[str] = ..., as_pattern: Optional[bool] = ...) -> Edges: - r""" - @hide - This method is provided for DRC implementation only. - """ - @overload - def texts_dots(self, dss: DeepShapeStore, expr: Optional[str] = ..., as_pattern: Optional[bool] = ...) -> Edges: - r""" - @hide - This method is provided for DRC implementation only. - """ - @overload - def to_s(self) -> str: - r""" - @brief Converts the region to a string - The length of the output is limited to 20 polygons to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. - """ - @overload - def to_s(self, max_count: int) -> str: - r""" - @brief Converts the region to a string - This version allows specification of the maximum number of polygons contained in the string. - """ - @overload - def transform(self, t: ICplxTrans) -> Region: - r""" - @brief Transform the region with a complex transformation (modifies self) - - Transforms the region with the given transformation. - This version modifies the region and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed region. - """ - @overload - def transform(self, t: IMatrix2d) -> Region: - r""" - @brief Transform the region (modifies self) - - Transforms the region with the given 2d matrix transformation. - This version modifies the region and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed region. - - This variant was introduced in version 0.27. - """ - @overload - def transform(self, t: IMatrix3d) -> Region: - r""" - @brief Transform the region (modifies self) - - Transforms the region with the given 3d matrix transformation. - This version modifies the region and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed region. - - This variant was introduced in version 0.27. - """ - @overload - def transform(self, t: Trans) -> Region: - r""" - @brief Transform the region (modifies self) - - Transforms the region with the given transformation. - This version modifies the region and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed region. - """ - @overload - def transformed(self, t: ICplxTrans) -> Region: - r""" - @brief Transforms the region with a complex transformation - - Transforms the region with the given complex transformation. - Does not modify the region but returns the transformed region. - - @param t The transformation to apply. - - @return The transformed region. - """ - @overload - def transformed(self, t: IMatrix2d) -> Region: - r""" - @brief Transforms the region - - Transforms the region with the given 2d matrix transformation. - Does not modify the region but returns the transformed region. - - @param t The transformation to apply. - - @return The transformed region. - - This variant was introduced in version 0.27. - """ - @overload - def transformed(self, t: IMatrix3d) -> Region: - r""" - @brief Transforms the region - - Transforms the region with the given 3d matrix transformation. - Does not modify the region but returns the transformed region. - - @param t The transformation to apply. - - @return The transformed region. - - This variant was introduced in version 0.27. - """ - @overload - def transformed(self, t: Trans) -> Region: - r""" - @brief Transforms the region - - Transforms the region with the given transformation. - Does not modify the region but returns the transformed region. - - @param t The transformation to apply. - - @return The transformed region. - """ - def width_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., negative: Optional[bool] = ...) -> EdgePairs: - r""" - @brief Performs a width check with options - @param d The minimum width for which the polygons are checked - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper limit of the projected length of one edge onto another - @param shielded Enables shielding - @param negative If true, edges not violation the condition will be output as pseudo-edge pairs - - This version is similar to the simple version with one parameter. In addition, it allows to specify many more options. - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle limit of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one limit, pass nil to the respective value. - - "shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. - Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat. - - Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) - - The 'shielded' and 'negative' options have been introduced in version 0.27. - """ - @overload - def with_angle(self, angle: float, inverse: bool) -> EdgePairs: - r""" - @brief Returns markers on every corner with the given angle (or not with the given angle) - If the inverse flag is false, this method returns an error marker (an \EdgePair object) for every corner whose connected edges form an angle with the given value (in degree). If the inverse flag is true, the method returns markers for every corner whose angle is not the given value. - - The edge pair objects returned will contain both edges forming the angle. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def with_angle(self, amin: float, amax: float, inverse: bool) -> EdgePairs: - r""" - @brief Returns markers on every corner with an angle of more than amin and less than amax (or the opposite) - If the inverse flag is false, this method returns an error marker (an \EdgePair object) for every corner whose connected edges form an angle whose value is more or equal to amin (in degree) or less (but not equal to) amax. If the inverse flag is true, the method returns markers for every corner whose angle is not matching that criterion. - - The edge pair objects returned will contain both edges forming the angle. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def with_area(self, area: int, inverse: bool) -> Region: - r""" - @brief Filter the polygons by area - Filters the polygons of the region by area. If "inverse" is false, only polygons which have the given area are returned. If "inverse" is true, polygons not having the given area are returned. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def with_area(self, min_area: Any, max_area: Any, inverse: bool) -> Region: - r""" - @brief Filter the polygons by area - Filters the polygons of the region by area. If "inverse" is false, only polygons which have an area larger or equal to "min_area" and less than "max_area" are returned. If "inverse" is true, polygons having an area less than "min_area" or larger or equal than "max_area" are returned. - - If you don't want to specify a lower or upper limit, pass nil to that parameter. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def with_area_ratio(self, ratio: float, inverse: bool) -> Region: - r""" - @brief Filters the polygons by the bounding box area to polygon area ratio - The area ratio is defined by the ratio of bounding box area to polygon area. It's a measure how much the bounding box is approximating the polygon. 'Thin polygons' have a large area ratio, boxes has an area ratio of 1. - The area ratio is always larger or equal to 1. - With 'inverse' set to false, this version filters polygons which have an area ratio equal to the given value. With 'inverse' set to true, all other polygons will be returned. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27. - """ - @overload - def with_area_ratio(self, min_ratio: Any, max_ratio: Any, inverse: bool, min_included: Optional[bool] = ..., max_included: Optional[bool] = ...) -> Region: - r""" - @brief Filters the polygons by the aspect ratio of their bounding boxes - The area ratio is defined by the ratio of bounding box area to polygon area. It's a measure how much the bounding box is approximating the polygon. 'Thin polygons' have a large area ratio, boxes has an area ratio of 1. - The area ratio is always larger or equal to 1. - With 'inverse' set to false, this version filters polygons which have an area ratio between 'min_ratio' and 'max_ratio'. With 'min_included' set to true, the 'min_ratio' value is included in the range, otherwise it's excluded. Same for 'max_included' and 'max_ratio'. With 'inverse' set to true, all other polygons will be returned. - - If you don't want to specify a lower or upper limit, pass nil to that parameter. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27. - """ - @overload - def with_bbox_aspect_ratio(self, ratio: float, inverse: bool) -> Region: - r""" - @brief Filters the polygons by the aspect ratio of their bounding boxes - Filters the polygons of the region by the aspect ratio of their bounding boxes. The aspect ratio is the ratio of larger to smaller dimension of the bounding box. A square has an aspect ratio of 1. - - With 'inverse' set to false, this version filters polygons which have a bounding box aspect ratio equal to the given value. With 'inverse' set to true, all other polygons will be returned. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27. - """ - @overload - def with_bbox_aspect_ratio(self, min_ratio: Any, max_ratio: Any, inverse: bool, min_included: Optional[bool] = ..., max_included: Optional[bool] = ...) -> Region: - r""" - @brief Filters the polygons by the aspect ratio of their bounding boxes - Filters the polygons of the region by the aspect ratio of their bounding boxes. The aspect ratio is the ratio of larger to smaller dimension of the bounding box. A square has an aspect ratio of 1. - - With 'inverse' set to false, this version filters polygons which have a bounding box aspect ratio between 'min_ratio' and 'max_ratio'. With 'min_included' set to true, the 'min_ratio' value is included in the range, otherwise it's excluded. Same for 'max_included' and 'max_ratio'. With 'inverse' set to true, all other polygons will be returned. - - If you don't want to specify a lower or upper limit, pass nil to that parameter. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27. - """ - @overload - def with_bbox_height(self, height: int, inverse: bool) -> Region: - r""" - @brief Filter the polygons by bounding box height - Filters the polygons of the region by the height of their bounding box. If "inverse" is false, only polygons whose bounding box has the given height are returned. If "inverse" is true, polygons whose bounding box does not have the given height are returned. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def with_bbox_height(self, min_height: Any, max_height: Any, inverse: bool) -> Region: - r""" - @brief Filter the polygons by bounding box height - Filters the polygons of the region by the height of their bounding box. If "inverse" is false, only polygons whose bounding box has a height larger or equal to "min_height" and less than "max_height" are returned. If "inverse" is true, all polygons not matching this criterion are returned. - If you don't want to specify a lower or upper limit, pass nil to that parameter. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def with_bbox_max(self, dim: int, inverse: bool) -> Region: - r""" - @brief Filter the polygons by bounding box width or height, whichever is larger - Filters the polygons of the region by the maximum dimension of their bounding box. If "inverse" is false, only polygons whose bounding box's larger dimension is equal to the given value are returned. If "inverse" is true, all polygons not matching this criterion are returned. - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def with_bbox_max(self, min_dim: Any, max_dim: Any, inverse: bool) -> Region: - r""" - @brief Filter the polygons by bounding box width or height, whichever is larger - Filters the polygons of the region by the minimum dimension of their bounding box. If "inverse" is false, only polygons whose bounding box's larger dimension is larger or equal to "min_dim" and less than "max_dim" are returned. If "inverse" is true, all polygons not matching this criterion are returned. - If you don't want to specify a lower or upper limit, pass nil to that parameter. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def with_bbox_min(self, dim: int, inverse: bool) -> Region: - r""" - @brief Filter the polygons by bounding box width or height, whichever is smaller - Filters the polygons inside the region by the minimum dimension of their bounding box. If "inverse" is false, only polygons whose bounding box's smaller dimension is equal to the given value are returned. If "inverse" is true, all polygons not matching this criterion are returned. - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def with_bbox_min(self, min_dim: Any, max_dim: Any, inverse: bool) -> Region: - r""" - @brief Filter the polygons by bounding box width or height, whichever is smaller - Filters the polygons of the region by the minimum dimension of their bounding box. If "inverse" is false, only polygons whose bounding box's smaller dimension is larger or equal to "min_dim" and less than "max_dim" are returned. If "inverse" is true, all polygons not matching this criterion are returned. - If you don't want to specify a lower or upper limit, pass nil to that parameter. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def with_bbox_width(self, width: int, inverse: bool) -> Region: - r""" - @brief Filter the polygons by bounding box width - Filters the polygons of the region by the width of their bounding box. If "inverse" is false, only polygons whose bounding box has the given width are returned. If "inverse" is true, polygons whose bounding box does not have the given width are returned. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def with_bbox_width(self, min_width: Any, max_width: Any, inverse: bool) -> Region: - r""" - @brief Filter the polygons by bounding box width - Filters the polygons of the region by the width of their bounding box. If "inverse" is false, only polygons whose bounding box has a width larger or equal to "min_width" and less than "max_width" are returned. If "inverse" is true, all polygons not matching this criterion are returned. - If you don't want to specify a lower or upper limit, pass nil to that parameter. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def with_holes(self, nholes: int, inverse: bool) -> Region: - r""" - @brief Filters the polygons by their number of holes - Filters the polygons of the region by number of holes. If "inverse" is false, only polygons which have the given number of holes are returned. If "inverse" is true, polygons not having the given of holes are returned. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27. - """ - @overload - def with_holes(self, min_bholes: Any, max_nholes: Any, inverse: bool) -> Region: - r""" - @brief Filter the polygons by their number of holes - Filters the polygons of the region by number of holes. If "inverse" is false, only polygons which have a hole count larger or equal to "min_nholes" and less than "max_nholes" are returned. If "inverse" is true, polygons having a hole count less than "min_nholes" or larger or equal than "max_nholes" are returned. - - If you don't want to specify a lower or upper limit, pass nil to that parameter. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27. - """ - @overload - def with_perimeter(self, perimeter: int, inverse: bool) -> Region: - r""" - @brief Filter the polygons by perimeter - Filters the polygons of the region by perimeter. If "inverse" is false, only polygons which have the given perimeter are returned. If "inverse" is true, polygons not having the given perimeter are returned. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def with_perimeter(self, min_perimeter: Any, max_perimeter: Any, inverse: bool) -> Region: - r""" - @brief Filter the polygons by perimeter - Filters the polygons of the region by perimeter. If "inverse" is false, only polygons which have a perimeter larger or equal to "min_perimeter" and less than "max_perimeter" are returned. If "inverse" is true, polygons having a perimeter less than "min_perimeter" or larger or equal than "max_perimeter" are returned. - - If you don't want to specify a lower or upper limit, pass nil to that parameter. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload - def with_relative_height(self, ratio: float, inverse: bool) -> Region: - r""" - @brief Filters the polygons by the ratio of height to width - This method filters the polygons of the region by the ratio of height vs. width of their bounding boxes. 'Tall' polygons have a large value while 'flat' polygons have a small value. A square has a relative height of 1. - - An alternative method is 'with_area_ratio' which can be more efficient because it's isotropic. - - With 'inverse' set to false, this version filters polygons which have a relative height equal to the given value. With 'inverse' set to true, all other polygons will be returned. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27. - """ - @overload - def with_relative_height(self, min_ratio: Any, max_ratio: Any, inverse: bool, min_included: Optional[bool] = ..., max_included: Optional[bool] = ...) -> Region: - r""" - @brief Filters the polygons by the bounding box height to width ratio - This method filters the polygons of the region by the ratio of height vs. width of their bounding boxes. 'Tall' polygons have a large value while 'flat' polygons have a small value. A square has a relative height of 1. - - An alternative method is 'with_area_ratio' which can be more efficient because it's isotropic. - - With 'inverse' set to false, this version filters polygons which have a relative height between 'min_ratio' and 'max_ratio'. With 'min_included' set to true, the 'min_ratio' value is included in the range, otherwise it's excluded. Same for 'max_included' and 'max_ratio'. With 'inverse' set to true, all other polygons will be returned. - - If you don't want to specify a lower or upper limit, pass nil to that parameter. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27. - """ - -class Shape: - r""" - @brief An object representing a shape in the layout database - - The shape proxy is basically a pointer to a shape of different kinds. - No copy of the shape is created: if the shape proxy is copied the copy still - points to the original shape. If the original shape is modified or deleted, - the shape proxy will also point to a modified or invalid shape. - The proxy can be "null" which indicates an invalid reference. - - Shape objects are used together with the \Shapes container object which - stores the actual shape objects and uses Shape references as pointers inside the - actual data storage. Shape references are used in various places, i.e. when removing or - transforming objects inside a \Shapes container. - """ - TBox: ClassVar[int] - r""" - """ - TBoxArray: ClassVar[int] - r""" - """ - TBoxArrayMember: ClassVar[int] - r""" - """ - TEdge: ClassVar[int] - r""" - """ - TEdgePair: ClassVar[int] - r""" - """ - TNull: ClassVar[int] - r""" - """ - TPath: ClassVar[int] - r""" - """ - TPathPtrArray: ClassVar[int] - r""" - """ - TPathPtrArrayMember: ClassVar[int] - r""" - """ - TPathRef: ClassVar[int] - r""" - """ - TPolygon: ClassVar[int] - r""" - """ - TPolygonPtrArray: ClassVar[int] - r""" - """ - TPolygonPtrArrayMember: ClassVar[int] - r""" - """ - TPolygonRef: ClassVar[int] - r""" - """ - TShortBox: ClassVar[int] - r""" - """ - TShortBoxArray: ClassVar[int] - r""" - """ - TShortBoxArrayMember: ClassVar[int] - r""" - """ - TSimplePolygon: ClassVar[int] - r""" - """ - TSimplePolygonPtrArray: ClassVar[int] - r""" - """ - TSimplePolygonPtrArrayMember: ClassVar[int] - r""" - """ - TSimplePolygonRef: ClassVar[int] - r""" - """ - TText: ClassVar[int] - r""" - """ - TTextPtrArray: ClassVar[int] - r""" - """ - TTextPtrArrayMember: ClassVar[int] - r""" - """ - TTextRef: ClassVar[int] - r""" - """ - TUserObject: ClassVar[int] - r""" - """ - box: Any - r""" - @brief Gets the box object - - Starting with version 0.23, this method returns nil, if the shape does not represent a box.@brief Replaces the shape by the given box - This method replaces the shape by the given box. This method can only be called for editable layouts. It does not change the user properties of the shape. - Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. - - This method has been introduced in version 0.22. - """ - box_center: Point - r""" - @brief Returns the center of the box - - Applies to boxes only. Returns the center of the box and throws an exception if the shape is not a box. - - This method has been introduced in version 0.23. - @brief Sets the center of the box - - Applies to boxes only. Changes the center of the box and throws an exception if the shape is not a box. - - This method has been introduced in version 0.23. - """ - box_dcenter: None - r""" - WARNING: This variable can only be set, not retrieved. - Note: This is an alias of 'box_center'. - @brief Sets the center of the box with the point being given in micrometer units - - Applies to boxes only. Changes the center of the box and throws an exception if the shape is not a box. - Translation from micrometer units to database units is done internally. - - This method has been introduced in version 0.25. - """ - box_dheight: float - r""" - @brief Returns the height of the box in micrometer units - - Applies to boxes only. Returns the height of the box in micrometers and throws an exception if the shape is not a box. - - This method has been introduced in version 0.25. - @brief Sets the height of the box - - Applies to boxes only. Changes the height of the box to the value given in micrometer units and throws an exception if the shape is not a box. - Translation to database units happens internally. - - This method has been introduced in version 0.25. - """ - box_dp1: None - r""" - WARNING: This variable can only be set, not retrieved. - Note: This is an alias of 'box_p1'. - @brief Sets the lower left corner of the box with the point being given in micrometer units - - Applies to boxes only. Changes the lower left point of the box and throws an exception if the shape is not a box. - Translation from micrometer units to database units is done internally. - - This method has been introduced in version 0.25. - """ - box_dp2: None - r""" - WARNING: This variable can only be set, not retrieved. - Note: This is an alias of 'box_p2'. - @brief Sets the upper right corner of the box with the point being given in micrometer units - - Applies to boxes only. Changes the upper right point of the box and throws an exception if the shape is not a box. - Translation from micrometer units to database units is done internally. - - This method has been introduced in version 0.25. - """ - box_dwidth: float - r""" - @brief Returns the width of the box in micrometer units - - Applies to boxes only. Returns the width of the box in micrometers and throws an exception if the shape is not a box. - - This method has been introduced in version 0.25. - @brief Sets the width of the box in micrometer units - - Applies to boxes only. Changes the width of the box to the value given in micrometer units and throws an exception if the shape is not a box. - Translation to database units happens internally. - - This method has been introduced in version 0.25. - """ - box_height: int - r""" - @brief Returns the height of the box - - Applies to boxes only. Returns the height of the box and throws an exception if the shape is not a box. - - This method has been introduced in version 0.23. - @brief Sets the height of the box - - Applies to boxes only. Changes the height of the box and throws an exception if the shape is not a box. - - This method has been introduced in version 0.23. - """ - box_p1: Point - r""" - @brief Returns the lower left point of the box - - Applies to boxes only. Returns the lower left point of the box and throws an exception if the shape is not a box. - - This method has been introduced in version 0.23. - @brief Sets the lower left point of the box - - Applies to boxes only. Changes the lower left point of the box and throws an exception if the shape is not a box. - - This method has been introduced in version 0.23. - """ - box_p2: Point - r""" - @brief Returns the upper right point of the box - - Applies to boxes only. Returns the upper right point of the box and throws an exception if the shape is not a box. - - This method has been introduced in version 0.23. - @brief Sets the upper right point of the box - - Applies to boxes only. Changes the upper right point of the box and throws an exception if the shape is not a box. - - This method has been introduced in version 0.23. - """ - box_width: int - r""" - @brief Returns the width of the box - - Applies to boxes only. Returns the width of the box and throws an exception if the shape is not a box. - - This method has been introduced in version 0.23. - @brief Sets the width of the box - - Applies to boxes only. Changes the width of the box and throws an exception if the shape is not a box. - - This method has been introduced in version 0.23. - """ - cell: Cell - r""" - @brief Gets a reference to the cell the shape belongs to - - This reference can be nil, if the Shape object is not living inside a cell - - This method has been introduced in version 0.22.@brief Moves the shape to a different cell - - Both the current and the target cell must reside in the same layout. - - This method has been introduced in version 0.23. - """ - dbox: None - r""" - WARNING: This variable can only be set, not retrieved. - Note: This is an alias of 'box'. - @brief Replaces the shape by the given box (in micrometer units) - This method replaces the shape by the given box, like \box= with a \Box argument does. This version translates the box from micrometer units to database units internally. - - This method has been introduced in version 0.25. - """ - dedge: None - r""" - WARNING: This variable can only be set, not retrieved. - Note: This is an alias of 'edge'. - @brief Replaces the shape by the given edge (in micrometer units) - This method replaces the shape by the given edge, like \edge= with a \Edge argument does. This version translates the edge from micrometer units to database units internally. - - This method has been introduced in version 0.25. - """ - dedge_pair: None - r""" - WARNING: This variable can only be set, not retrieved. - Note: This is an alias of 'edge_pair'. - @brief Replaces the shape by the given edge pair (in micrometer units) - This method replaces the shape by the given edge pair, like \edge_pair= with a \EdgePair argument does. This version translates the edge pair from micrometer units to database units internally. - - This method has been introduced in version 0.26. - """ - dpath: None - r""" - WARNING: This variable can only be set, not retrieved. - Note: This is an alias of 'path'. - @brief Replaces the shape by the given path (in micrometer units) - This method replaces the shape by the given path, like \path= with a \Path argument does. This version translates the path from micrometer units to database units internally. - - This method has been introduced in version 0.25. - """ - dpolygon: None - r""" - WARNING: This variable can only be set, not retrieved. - Note: This is an alias of 'polygon'. - @brief Replaces the shape by the given polygon (in micrometer units) - This method replaces the shape by the given polygon, like \polygon= with a \Polygon argument does. This version translates the polygon from micrometer units to database units internally. - - This method has been introduced in version 0.25. - """ - dsimple_polygon: None - r""" - WARNING: This variable can only be set, not retrieved. - Note: This is an alias of 'simple_polygon'. - @brief Replaces the shape by the given simple polygon (in micrometer units) - This method replaces the shape by the given text, like \simple_polygon= with a \SimplePolygon argument does. This version translates the polygon from micrometer units to database units internally. - - This method has been introduced in version 0.25. - """ - dtext: None - r""" - WARNING: This variable can only be set, not retrieved. - Note: This is an alias of 'text'. - @brief Replaces the shape by the given text (in micrometer units) - This method replaces the shape by the given text, like \text= with a \Text argument does. This version translates the text from micrometer units to database units internally. - - This method has been introduced in version 0.25. - """ - edge: Any - r""" - @brief Returns the edge object - - Starting with version 0.23, this method returns nil, if the shape does not represent an edge.@brief Replaces the shape by the given edge - This method replaces the shape by the given edge. This method can only be called for editable layouts. It does not change the user properties of the shape. - Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. - - This method has been introduced in version 0.22. - """ - edge_pair: Any - r""" - @brief Returns the edge pair object - - This method has been introduced in version 0.26.@brief Replaces the shape by the given edge pair - This method replaces the shape by the given edge pair. This method can only be called for editable layouts. It does not change the user properties of the shape. - Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. - - This method has been introduced in version 0.26. - """ - layer: int - r""" - @brief Returns the layer index of the layer the shape is on - Throws an exception if the shape does not reside inside a cell. - - This method has been added in version 0.23. - @brief Moves the shape to a layer given by the layer index object - - This method has been added in version 0.23. - """ - layer_info: LayerInfo - r""" - @brief Returns the \LayerInfo object of the layer the shape is on - If the shape does not reside inside a cell, an empty layer is returned. - - This method has been added in version 0.23. - @brief Moves the shape to a layer given by a \LayerInfo object - If no layer with the given properties exists, an exception is thrown. - - This method has been added in version 0.23. - """ - path: Any - r""" - @brief Returns the path object - - Starting with version 0.23, this method returns nil, if the shape does not represent a path.@brief Replaces the shape by the given path object - This method replaces the shape by the given path object. This method can only be called for editable layouts. It does not change the user properties of the shape. - Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. - - This method has been introduced in version 0.22. - """ - path_bgnext: int - r""" - @brief Gets the path's starting vertex extension - - Applies to paths only. Will throw an exception if the object is not a path. - @brief Sets the path's starting vertex extension - Applies to paths only. Will throw an exception if the object is not a path. - - This method has been introduced in version 0.23. - """ - path_dbgnext: float - r""" - @brief Gets the path's starting vertex extension in micrometer units - - Applies to paths only. Will throw an exception if the object is not a path. - - This method has been introduced in version 0.25.@brief Sets the path's starting vertex extension in micrometer units - Applies to paths only. Will throw an exception if the object is not a path. - - This method has been introduced in version 0.25. - """ - path_dendext: float - r""" - @brief Gets the path's end vertex extension in micrometer units - - Applies to paths only. Will throw an exception if the object is not a path. - - This method has been introduced in version 0.25.@brief Sets the path's end vertex extension in micrometer units - Applies to paths only. Will throw an exception if the object is not a path. - - This method has been introduced in version 0.25. - """ - path_dwidth: float - r""" - @brief Gets the path width in micrometer units - - Applies to paths only. Will throw an exception if the object is not a path. - - This method has been introduced in version 0.25.@brief Sets the path width in micrometer units - Applies to paths only. Will throw an exception if the object is not a path. - Conversion to database units is done internally. - - This method has been introduced in version 0.25. - """ - path_endext: int - r""" - @brief Obtain the path's end vertex extension - - Applies to paths only. Will throw an exception if the object is not a path. - @brief Sets the path's end vertex extension - Applies to paths only. Will throw an exception if the object is not a path. - - This method has been introduced in version 0.23. - """ - path_width: int - r""" - @brief Gets the path width - - Applies to paths only. Will throw an exception if the object is not a path. - @brief Sets the path width - Applies to paths only. Will throw an exception if the object is not a path. - - This method has been introduced in version 0.23. - """ - polygon: Any - r""" - @brief Returns the polygon object - - Returns the polygon object that this shape refers to or converts the object to a polygon. Paths, boxes and simple polygons are converted to polygons. For paths this operation renders the path's hull contour. - - Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a polygon. - @brief Replaces the shape by the given polygon object - This method replaces the shape by the given polygon object. This method can only be called for editable layouts. It does not change the user properties of the shape. - Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. - - This method has been introduced in version 0.22. - """ - prop_id: int - r""" - @brief Gets the properties ID associated with the shape - - The \Layout object can be used to retrieve the actual properties associated with the ID.@brief Sets the properties ID of this shape - - The \Layout object can be used to retrieve an ID for a given set of properties. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. - - This method has been introduced in version 0.22. - """ - round_path: bool - r""" - @brief Returns true, if the path has round ends - - Applies to paths only. Will throw an exception if the object is not a path. - @brief The path will be a round-ended path if this property is set to true - - Applies to paths only. Will throw an exception if the object is not a path. - Please note that the extensions will apply as well. To get a path with circular ends, set the begin and end extensions to half the path's width. - - This method has been introduced in version 0.23. - """ - simple_polygon: Any - r""" - @brief Returns the simple polygon object - - Returns the simple polygon object that this shape refers to or converts the object to a simple polygon. Paths, boxes and polygons are converted to simple polygons. Polygons with holes will have their holes removed but introducing cut lines that connect the hole contours with the outer contour. - Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a simple polygon. - @brief Replaces the shape by the given simple polygon object - This method replaces the shape by the given simple polygon object. This method can only be called for editable layouts. It does not change the user properties of the shape. - Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. - - This method has been introduced in version 0.22. - """ - text: Any - r""" - @brief Returns the text object - - Starting with version 0.23, this method returns nil, if the shape does not represent a text.@brief Replaces the shape by the given text object - This method replaces the shape by the given text object. This method can only be called for editable layouts. It does not change the user properties of the shape. - Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. - - This method has been introduced in version 0.22. - """ - text_dpos: None - r""" - WARNING: This variable can only be set, not retrieved. - Note: This is an alias of 'text_pos'. - @brief Sets the text's position in micrometer units - Applies to texts only. Will throw an exception if the object is not a text. - - This method has been added in version 0.25. - """ - text_dsize: float - r""" - @brief Gets the text size in micrometer units - - Applies to texts only. Will throw an exception if the object is not a text. - - This method has been introduced in version 0.25.@brief Sets the text size in micrometer units - - Applies to texts only. Will throw an exception if the object is not a text. - - This method has been introduced in version 0.25. - """ - text_dtrans: None - r""" - WARNING: This variable can only be set, not retrieved. - Note: This is an alias of 'text_trans'. - @brief Sets the text transformation in micrometer units - Applies to texts only. Will throw an exception if the object is not a text. - - This method has been introduced in version 0.25. - """ - text_font: int - r""" - @brief Gets the text's font - - Applies to texts only. Will throw an exception if the object is not a text. - @brief Sets the text's font - - Applies to texts only. Will throw an exception if the object is not a text. - - This method has been introduced in version 0.23. - """ - text_halign: int - r""" - @brief Gets the text's horizontal alignment - - Applies to texts only. Will throw an exception if the object is not a text. - The return value is 0 for left alignment, 1 for center alignment and 2 to right alignment. - - This method has been introduced in version 0.22. - @brief Sets the text's horizontal alignment - - Applies to texts only. Will throw an exception if the object is not a text. - See \text_halign for a description of that property. - - This method has been introduced in version 0.23. - """ - text_pos: Vector - r""" - @brief Gets the text's position - - Applies to texts only. Will throw an exception if the object is not a text. - @brief Sets the text's position - Applies to texts only. Will throw an exception if the object is not a text. - """ - text_rot: int - r""" - @brief Gets the text's orientation code (see \Trans) - - Applies to texts only. Will throw an exception if the object is not a text. - @brief Sets the text's orientation code (see \Trans) - - Applies to texts only. Will throw an exception if the object is not a text. - """ - text_size: int - r""" - @brief Gets the text size - - Applies to texts only. Will throw an exception if the object is not a text. - @brief Sets the text size - - Applies to texts only. Will throw an exception if the object is not a text. - - This method has been introduced in version 0.23. - """ - text_string: str - r""" - @brief Obtain the text string - - Applies to texts only. Will throw an exception if the object is not a text. - @brief Sets the text string - - Applies to texts only. Will throw an exception if the object is not a text. - - This method has been introduced in version 0.23. - """ - text_trans: Trans - r""" - @brief Gets the text transformation - - Applies to texts only. Will throw an exception if the object is not a text. - @brief Sets the text transformation - Applies to texts only. Will throw an exception if the object is not a text. - - This method has been introduced in version 0.23. - """ - text_valign: int - r""" - @brief Gets the text's vertical alignment - - Applies to texts only. Will throw an exception if the object is not a text. - The return value is 0 for top alignment, 1 for center alignment and 2 to bottom alignment. - - This method has been introduced in version 0.22. - @brief Sets the text's vertical alignment - - Applies to texts only. Will throw an exception if the object is not a text. - See \text_valign for a description of that property. - - This method has been introduced in version 0.23. - """ - def __copy__(self) -> Shape: - r""" - @brief Creates a copy of self - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Equality operator - - Equality of shapes is not specified by the identity of the objects but by the - identity of the pointers - both shapes must refer to the same object. - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Inequality operator - """ - def __repr__(self) -> str: - r""" - @brief Create a string showing the contents of the reference - - This method has been introduced with version 0.16. - """ - def __str__(self) -> str: - r""" - @brief Create a string showing the contents of the reference - - This method has been introduced with version 0.16. - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def area(self) -> int: - r""" - @brief Returns the area of the shape - This method has been added in version 0.22. - """ - def array_dtrans(self) -> DTrans: - r""" - @brief Gets the array instance member transformation in micrometer units - - This attribute is valid only if \is_array_member? is true. - The transformation returned describes the relative transformation of the - array member addressed. The displacement is given in micrometer units. - - This method has been added in version 0.25. - """ - def array_trans(self) -> Trans: - r""" - @brief Gets the array instance member transformation - - This attribute is valid only if \is_array_member? is true. - The transformation returned describes the relative transformation of the - array member addressed. - """ - def assign(self, other: Shape) -> None: - r""" - @brief Assigns another object to self - """ - def bbox(self) -> Box: - r""" - @brief Returns the bounding box of the shape - """ - def box_dcenter_(self) -> DPoint: - r""" - @brief Returns the center of the box as a \DPoint object in micrometer units - - Applies to boxes only. Returns the center of the box and throws an exception if the shape is not a box. - Conversion from database units to micrometers is done internally. - - This method has been introduced in version 0.25. - """ - def box_dp1_(self) -> DPoint: - r""" - @brief Returns the lower left point of the box as a \DPoint object in micrometer units - - Applies to boxes only. Returns the lower left point of the box and throws an exception if the shape is not a box. - Conversion from database units to micrometers is done internally. - - This method has been introduced in version 0.25. - """ - def box_dp2_(self) -> DPoint: - r""" - @brief Returns the upper right point of the box as a \DPoint object in micrometer units - - Applies to boxes only. Returns the upper right point of the box and throws an exception if the shape is not a box. - Conversion from database units to micrometers is done internally. - - This method has been introduced in version 0.25. - """ - def darea(self) -> float: - r""" - @brief Returns the area of the shape in square micrometer units - This method has been added in version 0.25. - """ - def dbbox(self) -> DBox: - r""" - @brief Returns the bounding box of the shape in micrometer units - This method has been added in version 0.25. - """ - def dbox_(self) -> Any: - r""" - @brief Gets the box object in micrometer units - See \box for a description of this method. This method returns the box after translation to micrometer units. - - This method has been added in version 0.25. - """ - def dedge_(self) -> Any: - r""" - @brief Returns the edge object as a \DEdge object in micrometer units - See \edge for a description of this method. This method returns the edge after translation to micrometer units. - - This method has been added in version 0.25. - """ - def dedge_pair_(self) -> Any: - r""" - @brief Returns the edge pair object as a \DEdgePair object in micrometer units - See \edge_pair for a description of this method. This method returns the edge pair after translation to micrometer units. - - This method has been added in version 0.26. - """ - def delete(self) -> None: - r""" - @brief Deletes the shape - - After the shape is deleted, the shape object is emptied and points to nothing. - - This method has been introduced in version 0.23. - """ - def delete_property(self, key: Any) -> None: - r""" - @brief Deletes the user property with the given key - This method is a convenience method that deletes the property with the given key. It does nothing if no property with that key exists. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. - This method may change the properties ID. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. - - This method has been introduced in version 0.22. - """ - def dpath_(self) -> Any: - r""" - @brief Returns the path object as a \DPath object in micrometer units - See \path for a description of this method. This method returns the path after translation to micrometer units. - - This method has been added in version 0.25. - """ - def dperimeter(self) -> float: - r""" - @brief Returns the perimeter of the shape in micrometer units - - This method will return an approximation of the perimeter for paths. - - This method has been added in version 0.25. - """ - def dpolygon_(self) -> Any: - r""" - @brief Returns the polygon object in micrometer units - - Returns the polygon object that this shape refers to or converts the object to a polygon. The method returns the same object than \polygon, but translates it to micrometer units internally. - - This method has been introduced in version 0.25. - """ - def dsimple_polygon_(self) -> Any: - r""" - @brief Returns the simple polygon object in micrometer units - - Returns the simple polygon object that this shape refers to or converts the object to a simple polygon. The method returns the same object than \simple_polygon, but translates it to micrometer units internally. - - This method has been introduced in version 0.25. - """ - def dtext_(self) -> Any: - r""" - @brief Returns the path object as a \DText object in micrometer units - See \text for a description of this method. This method returns the text after translation to micrometer units. - - This method has been added in version 0.25. - """ - def dup(self) -> Shape: - r""" - @brief Creates a copy of self - """ - @overload - def each_dedge(self) -> Iterator[DEdge]: - r""" - @brief Iterates over the edges of the object and returns edges in micrometer units - - This method iterates over all edges of polygons and simple polygons like \each_edge, but will deliver edges in micrometer units. Multiplication by the database unit is done internally. - - This method has been introduced in version 0.25. - """ - @overload - def each_dedge(self, contour: int) -> Iterator[DEdge]: - r""" - @brief Iterates over the edges of a single contour of the object and returns edges in micrometer units - - This method iterates over all edges of polygons and simple polygons like \each_edge, but will deliver edges in micrometer units. Multiplication by the database unit is done internally. - - This method has been introduced in version 0.25. - """ - def each_dpoint(self) -> Iterator[DPoint]: - r""" - @brief Iterates over all points of the object and returns points in micrometer units - - This method iterates over all points of the object like \each_point, but it returns \DPoint objects that are given in micrometer units already. Multiplication with the database unit happens internally. - - This method has been introduced in version 0.25. - """ - def each_dpoint_hole(self, hole_index: int) -> Iterator[DPoint]: - r""" - @brief Iterates over a hole contour of the object and returns points in micrometer units - - This method iterates over all points of the object's contour' like \each_point_hole, but it returns \DPoint objects that are given in micrometer units already. Multiplication with the database unit happens internally. - - This method has been introduced in version 0.25. - """ - def each_dpoint_hull(self) -> Iterator[DPoint]: - r""" - @brief Iterates over the hull contour of the object and returns points in micrometer units - - This method iterates over all points of the object's contour' like \each_point_hull, but it returns \DPoint objects that are given in micrometer units already. Multiplication with the database unit happens internally. - - This method has been introduced in version 0.25. - """ - @overload - def each_edge(self) -> Iterator[Edge]: - r""" - @brief Iterates over the edges of the object - - This method applies to polygons and simple polygons and delivers all edges that form the polygon's contours. Hole edges are oriented counterclockwise while hull edges are oriented clockwise. - - It will throw an exception if the object is not a polygon. - """ - @overload - def each_edge(self, contour: int) -> Iterator[Edge]: - r""" - @brief Iterates over the edges of a single contour of the object - @param contour The contour number (0 for hull, 1 for first hole ...) - - This method applies to polygons and simple polygons and delivers all edges that form the given contour of the polygon. The hull has contour number 0, the first hole has contour 1 etc. - Hole edges are oriented counterclockwise while hull edges are oriented clockwise. - - It will throw an exception if the object is not a polygon. - - This method was introduced in version 0.24. - """ - def each_point(self) -> Iterator[Point]: - r""" - @brief Iterates over all points of the object - - This method applies to paths and delivers all points of the path's center line. - It will throw an exception for other objects. - """ - def each_point_hole(self, hole_index: int) -> Iterator[Point]: - r""" - @brief Iterates over the points of a hole contour - - This method applies to polygons and delivers all points of the respective hole contour. - It will throw an exception for other objects. - Simple polygons deliver an empty sequence. - - @param hole The hole index (see holes () method) - """ - def each_point_hull(self) -> Iterator[Point]: - r""" - @brief Iterates over the hull contour of the object - - This method applies to polygons and delivers all points of the polygon hull contour. - It will throw an exception for other objects. - """ - def has_prop_id(self) -> bool: - r""" - @brief Returns true, if the shape has properties, i.e. has a properties ID - """ - def holes(self) -> int: - r""" - @brief Returns the number of holes - - This method applies to polygons and will throw an exception for other objects.. - Simple polygons deliver a value of zero. - """ - def is_array_member(self) -> bool: - r""" - @brief Returns true, if the shape is a member of a shape array - """ - def is_box(self) -> bool: - r""" - @brief Returns true if the shape is a box - """ - def is_edge(self) -> bool: - r""" - @brief Returns true, if the object is an edge - """ - def is_edge_pair(self) -> bool: - r""" - @brief Returns true, if the object is an edge pair - - This method has been introduced in version 0.26. - """ - def is_null(self) -> bool: - r""" - @brief Returns true, if the shape reference is a null reference (not referring to a shape) - """ - def is_path(self) -> bool: - r""" - @brief Returns true, if the shape is a path - """ - def is_polygon(self) -> bool: - r""" - @brief Returns true, if the shape is a polygon - - This method returns true only if the object is a polygon or a simple polygon. Other objects can convert to polygons, for example paths, so it may be possible to use the \polygon method also if is_polygon? does not return true. - """ - def is_simple_polygon(self) -> bool: - r""" - @brief Returns true, if the shape is a simple polygon - - This method returns true only if the object is a simple polygon. The simple polygon identity is contained in the polygon identity, so usually it is sufficient to use \is_polygon? and \polygon instead of specifically handle simply polygons. This method is provided only for specific optimisation purposes. - """ - def is_text(self) -> bool: - r""" - @brief Returns true, if the object is a text - """ - def is_user_object(self) -> bool: - r""" - @brief Returns true if the shape is a user defined object - """ - def is_valid(self) -> bool: - r""" - @brief Returns true, if the shape is valid - - After the shape is deleted, the shape object is no longer valid and this method returns false. - - This method has been introduced in version 0.23. - """ - def layout(self) -> Layout: - r""" - @brief Gets a reference to the Layout the shape belongs to - - This reference can be nil, if the Shape object is not living inside a layout. - - This method has been introduced in version 0.22. - """ - def path_dlength(self) -> float: - r""" - @brief Returns the length of the path in micrometer units - - Applies to paths only. Will throw an exception if the object is not a path. - This method returns the length of the spine plus extensions if present. - The value returned is given in micrometer units. - - This method has been added in version 0.25. - """ - def path_length(self) -> int: - r""" - @brief Returns the length of the path - - Applies to paths only. Will throw an exception if the object is not a path. - This method returns the length of the spine plus extensions if present. - - This method has been added in version 0.23. - """ - def perimeter(self) -> int: - r""" - @brief Returns the perimeter of the shape - - This method will return an approximation of the perimeter for paths. - - This method has been added in version 0.23. - """ - def property(self, key: Any) -> Any: - r""" - @brief Gets the user property with the given key - This method is a convenience method that gets the property with the given key. If no property with that key does not exist, it will return nil. Using that method is more convenient than using the layout object and the properties ID to retrieve the property value. - This method has been introduced in version 0.22. - """ - def set_property(self, key: Any, value: Any) -> None: - r""" - @brief Sets the user property with the given key to the given value - This method is a convenience method that sets the property with the given key to the given value. If no property with that key exists, it will create one. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. - This method may change the properties ID. Note: GDS only supports integer keys. OASIS supports numeric and string keys. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. - - This method has been introduced in version 0.22. - """ - def shapes(self) -> Shapes: - r""" - @brief Gets a reference to the Shapes container the shape lives in - - This reference can be nil, if the Shape object is not referring to an actual shape. - - This method has been introduced in version 0.22. - """ - def text_dpos_(self) -> DVector: - r""" - @brief Gets the text's position in micrometer units - - Applies to texts only. Will throw an exception if the object is not a text. - - This method has been added in version 0.25. - """ - def text_dtrans_(self) -> DTrans: - r""" - @brief Gets the text transformation in micrometer units - - Applies to texts only. Will throw an exception if the object is not a text. - - This method has been added in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief Create a string showing the contents of the reference - - This method has been introduced with version 0.16. - """ - @overload - def transform(self, trans: DCplxTrans) -> None: - r""" - @brief Transforms the shape with the given complex transformation, given in micrometer units - This method has been introduced in version 0.25. - """ - @overload - def transform(self, trans: DTrans) -> None: - r""" - @brief Transforms the shape with the given transformation, given in micrometer units - This method has been introduced in version 0.25. - """ - @overload - def transform(self, trans: ICplxTrans) -> None: - r""" - @brief Transforms the shape with the given complex transformation - This method has been introduced in version 0.23. - """ - @overload - def transform(self, trans: Trans) -> None: - r""" - @brief Transforms the shape with the given transformation - This method has been introduced in version 0.23. - """ - def type(self) -> int: - r""" - @brief Return the type of the shape - - The returned values are the t_... constants available through the corresponding class members. - """ - -class ShapeCollection: - r""" - @brief A base class for the shape collections (\Region, \Edges, \EdgePairs and \Texts) - - This class has been introduced in version 0.27. - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class ShapeProcessor: - r""" - @brief The shape processor (boolean, sizing, merge on shapes) - - The shape processor implements the boolean and edge set operations (size, merge). Because the shape processor might allocate resources which can be reused in later operations, it is implemented as an object that can be used several times. The shape processor is similar to the \EdgeProcessor. The latter is specialized on handling polygons and edges directly. - """ - def __copy__(self) -> ShapeProcessor: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: ShapeProcessor) -> None: - r""" - @brief Assigns another object to self - """ - @overload - def boolean(self, in_a: Sequence[Shape], in_b: Sequence[Shape], mode: int) -> List[Edge]: - r""" - @brief Boolean operation on two given shape sets into an edge set - - See the \EdgeProcessor for a description of the boolean operations. This implementation takes shapes - rather than polygons for input and produces an edge set. - - This version does not feature a transformation for each shape (unity is assumed). - - @param in_a The set of shapes to use for input A - @param in_b The set of shapes to use for input A - @param mode The boolean operation (see \EdgeProcessor) - """ - @overload - def boolean(self, in_a: Sequence[Shape], trans_a: Sequence[CplxTrans], in_b: Sequence[Shape], trans_b: Sequence[CplxTrans], mode: int) -> List[Edge]: - r""" - @brief Boolean operation on two given shape sets into an edge set - - See the \EdgeProcessor for a description of the boolean operations. This implementation takes shapes - rather than polygons for input and produces an edge set. - - @param in_a The set of shapes to use for input A - @param trans_a A set of transformations to apply before the shapes are used - @param in_b The set of shapes to use for input A - @param trans_b A set of transformations to apply before the shapes are used - @param mode The boolean operation (see \EdgeProcessor) - """ - @overload - def boolean(self, layout_a: Layout, cell_a: Cell, layer_a: int, layout_b: Layout, cell_b: Cell, layer_b: int, out: Shapes, mode: int, hierarchical: bool, resolve_holes: bool, min_coherence: bool) -> None: - r""" - @brief Boolean operation on shapes from layouts - - See the \EdgeProcessor for a description of the boolean operations. This implementation takes shapes - from layout cells (optionally all in hierarchy) and produces new shapes in a shapes container. - @param layout_a The layout from which to take the shapes for input A - @param cell_a The cell (in 'layout') from which to take the shapes for input A - @param layer_a The cell (in 'layout') from which to take the shapes for input A - @param layout_b The layout from which to take the shapes for input B - @param cell_b The cell (in 'layout') from which to take the shapes for input B - @param layer_b The cell (in 'layout') from which to take the shapes for input B - @param out The shapes container where to put the shapes into (is cleared before) - @param mode The boolean operation (see \EdgeProcessor) - @param hierarchical Collect shapes from sub cells as well - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if minimum polygons should be created for touching corners - """ - @overload - def boolean_to_polygon(self, in_a: Sequence[Shape], in_b: Sequence[Shape], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Boolean operation on two given shape sets into a polygon set - - See the \EdgeProcessor for a description of the boolean operations. This implementation takes shapes - rather than polygons for input and produces a polygon set. - - This version does not feature a transformation for each shape (unity is assumed). - - @param in_a The set of shapes to use for input A - @param in_b The set of shapes to use for input A - @param mode The boolean operation (see \EdgeProcessor) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if minimum polygons should be created for touching corners - """ - @overload - def boolean_to_polygon(self, in_a: Sequence[Shape], trans_a: Sequence[CplxTrans], in_b: Sequence[Shape], trans_b: Sequence[CplxTrans], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Boolean operation on two given shape sets into a polygon set - - See the \EdgeProcessor for a description of the boolean operations. This implementation takes shapes - rather than polygons for input and produces a polygon set. - - @param in_a The set of shapes to use for input A - @param trans_a A set of transformations to apply before the shapes are used - @param in_b The set of shapes to use for input A - @param trans_b A set of transformations to apply before the shapes are used - @param mode The boolean operation (see \EdgeProcessor) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if minimum polygons should be created for touching corners - """ - def dup(self) -> ShapeProcessor: - r""" - @brief Creates a copy of self - """ - @overload - def merge(self, in_: Sequence[Shape], min_wc: int) -> List[Edge]: - r""" - @brief Merge the given shapes - - See the \EdgeProcessor for a description of the merge method. This implementation takes shapes - rather than polygons for input and produces an edge set. - - This version does not feature a transformation for each shape (unity is assumed). - - @param in The set of shapes to merge - @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) - """ - @overload - def merge(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], min_wc: int) -> List[Edge]: - r""" - @brief Merge the given shapes - - See the \EdgeProcessor for a description of the merge method. This implementation takes shapes - rather than polygons for input and produces an edge set. - - @param in The set of shapes to merge - @param trans A corresponding set of transformations to apply on the shapes - @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) - """ - @overload - def merge(self, layout: Layout, cell: Cell, layer: int, out: Shapes, hierarchical: bool, min_wc: int, resolve_holes: bool, min_coherence: bool) -> None: - r""" - @brief Merge the given shapes from a layout into a shapes container - - See the \EdgeProcessor for a description of the merge method. This implementation takes shapes - from a layout cell (optionally all in hierarchy) and produces new shapes in a shapes container. - @param layout The layout from which to take the shapes - @param cell The cell (in 'layout') from which to take the shapes - @param layer The cell (in 'layout') from which to take the shapes - @param out The shapes container where to put the shapes into (is cleared before) - @param hierarchical Collect shapes from sub cells as well - @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if minimum polygons should be created for touching corners - """ - @overload - def merge_to_polygon(self, in_: Sequence[Shape], min_wc: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Merge the given shapes - - See the \EdgeProcessor for a description of the merge method. This implementation takes shapes - rather than polygons for input and produces a polygon set. - - This version does not feature a transformation for each shape (unity is assumed). - - @param in The set of shapes to merge - @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if minimum polygons should be created for touching corners - """ - @overload - def merge_to_polygon(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], min_wc: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Merge the given shapes - - See the \EdgeProcessor for a description of the merge method. This implementation takes shapes - rather than polygons for input and produces a polygon set. - - @param in The set of shapes to merge - @param trans A corresponding set of transformations to apply on the shapes - @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if minimum polygons should be created for touching corners - """ - @overload - def size(self, in_: Sequence[Shape], d: int, mode: int) -> List[Edge]: - r""" - @brief Size the given shapes - - See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes - rather than polygons for input and produces an edge set. This is isotropic version that does not allow - to specify different values in x and y direction. - This version does not feature a transformation for each shape (unity is assumed). - - @param in The set of shapes to size - @param d The sizing value - @param mode The sizing mode (see \EdgeProcessor) - """ - @overload - def size(self, in_: Sequence[Shape], dx: int, dy: int, mode: int) -> List[Edge]: - r""" - @brief Size the given shapes - - See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes - rather than polygons for input and produces an edge set. - - This version does not feature a transformation for each shape (unity is assumed). - - @param in The set of shapes to size - @param dx The sizing value in x-direction - @param dy The sizing value in y-direction - @param mode The sizing mode (see \EdgeProcessor) - """ - @overload - def size(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], d: int, mode: int) -> List[Edge]: - r""" - @brief Size the given shapes - - See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes - rather than polygons for input and produces an edge set. This is isotropic version that does not allow - to specify different values in x and y direction. - @param in The set of shapes to size - @param trans A corresponding set of transformations to apply on the shapes - @param d The sizing value - @param mode The sizing mode (see \EdgeProcessor) - """ - @overload - def size(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], dx: int, dy: int, mode: int) -> List[Edge]: - r""" - @brief Size the given shapes - - See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes - rather than polygons for input and produces an edge set. - - @param in The set of shapes to size - @param trans A corresponding set of transformations to apply on the shapes - @param dx The sizing value in x-direction - @param dy The sizing value in y-direction - @param mode The sizing mode (see \EdgeProcessor) - """ - @overload - def size(self, layout: Layout, cell: Cell, layer: int, out: Shapes, d: int, mode: int, hierarchical: bool, resolve_holes: bool, min_coherence: bool) -> None: - r""" - @brief Sizing operation on shapes from layouts - - See the \EdgeProcessor for a description of the sizing operation. This implementation takes shapes - from a layout cell (optionally all in hierarchy) and produces new shapes in a shapes container. This is the isotropic version which does not allow specification of different sizing values in x and y-direction. - @param layout The layout from which to take the shapes - @param cell The cell (in 'layout') from which to take the shapes - @param layer The cell (in 'layout') from which to take the shapes - @param out The shapes container where to put the shapes into (is cleared before) - @param d The sizing value (see \EdgeProcessor) - @param mode The sizing mode (see \EdgeProcessor) - @param hierarchical Collect shapes from sub cells as well - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if minimum polygons should be created for touching corners - """ - @overload - def size(self, layout: Layout, cell: Cell, layer: int, out: Shapes, dx: int, dy: int, mode: int, hierarchical: bool, resolve_holes: bool, min_coherence: bool) -> None: - r""" - @brief Sizing operation on shapes from layouts - - See the \EdgeProcessor for a description of the sizing operation. This implementation takes shapes - from a layout cell (optionally all in hierarchy) and produces new shapes in a shapes container. - @param layout The layout from which to take the shapes - @param cell The cell (in 'layout') from which to take the shapes - @param layer The cell (in 'layout') from which to take the shapes - @param out The shapes container where to put the shapes into (is cleared before) - @param dx The sizing value in x-direction (see \EdgeProcessor) - @param dy The sizing value in y-direction (see \EdgeProcessor) - @param mode The sizing mode (see \EdgeProcessor) - @param hierarchical Collect shapes from sub cells as well - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if minimum polygons should be created for touching corners - """ - @overload - def size_to_polygon(self, in_: Sequence[Shape], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Size the given shapes - - See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes - rather than polygons for input and produces a polygon set. This is isotropic version that does not allow - to specify different values in x and y direction. - This version does not feature a transformation for each shape (unity is assumed). - - @param in The set of shapes to size - @param d The sizing value - @param mode The sizing mode (see \EdgeProcessor) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if minimum polygons should be created for touching corners - """ - @overload - def size_to_polygon(self, in_: Sequence[Shape], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Size the given shapes - - See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes - rather than polygons for input and produces a polygon set. - - This version does not feature a transformation for each shape (unity is assumed). - - @param in The set of shapes to size - @param dx The sizing value in x-direction - @param dy The sizing value in y-direction - @param mode The sizing mode (see \EdgeProcessor) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if minimum polygons should be created for touching corners - """ - @overload - def size_to_polygon(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Size the given shapes - - See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes - rather than polygons for input and produces a polygon set. This is isotropic version that does not allow - to specify different values in x and y direction. - @param in The set of shapes to size - @param trans A corresponding set of transformations to apply on the shapes - @param d The sizing value - @param mode The sizing mode (see \EdgeProcessor) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if minimum polygons should be created for touching corners - """ - @overload - def size_to_polygon(self, in_: Sequence[Shape], trans: Sequence[CplxTrans], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Size the given shapes - - See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes - rather than polygons for input and produces a polygon set. - - @param in The set of shapes to size - @param trans A corresponding set of transformations to apply on the shapes - @param dx The sizing value in x-direction - @param dy The sizing value in y-direction - @param mode The sizing mode (see \EdgeProcessor) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if minimum polygons should be created for touching corners - """ - -class Shapes: - r""" - @brief A collection of shapes - - A shapes collection is a collection of geometrical objects, such as polygons, boxes, paths, edges, edge pairs or text objects. - - Shapes objects are the basic containers for geometrical objects of a cell. Inside a cell, there is one Shapes object per layer. - """ - SAll: ClassVar[int] - r""" - @brief Indicates that all shapes shall be retrieved - """ - SAllWithProperties: ClassVar[int] - r""" - @brief Indicates that all shapes with properties shall be retrieved - """ - SBoxes: ClassVar[int] - r""" - @brief Indicates that boxes shall be retrieved - """ - SEdgePairs: ClassVar[int] - r""" - @brief Indicates that edge pairs shall be retrieved - """ - SEdges: ClassVar[int] - r""" - @brief Indicates that edges shall be retrieved - """ - SPaths: ClassVar[int] - r""" - @brief Indicates that paths shall be retrieved - """ - SPolygons: ClassVar[int] - r""" - @brief Indicates that polygons shall be retrieved - """ - SProperties: ClassVar[int] - r""" - @brief Indicates that only shapes with properties shall be retrieved - """ - SRegions: ClassVar[int] - r""" - @brief Indicates that objects which can be polygonized shall be retrieved (paths, boxes, polygons etc.) - - This constant has been added in version 0.27. - """ - STexts: ClassVar[int] - r""" - @brief Indicates that texts be retrieved - """ - SUserObjects: ClassVar[int] - r""" - @brief Indicates that user objects shall be retrieved - """ - def __copy__(self) -> Shapes: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def __iter__(self) -> Iterator[Shape]: - r""" - @brief Gets all shapes - - This call is equivalent to each(SAll). This convenience method has been introduced in version 0.16 - """ - def __len__(self) -> int: - r""" - @brief Gets the number of shapes in this container - This method was introduced in version 0.16 - @return The number of shapes in this container - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: Shapes) -> None: - r""" - @brief Assigns another object to self - """ - def clear(self) -> None: - r""" - @brief Clears the shape container - This method has been introduced in version 0.16. It can only be used in editable mode. - """ - def dump_mem_statistics(self, detailed: Optional[bool] = ...) -> None: - r""" - @hide - """ - def dup(self) -> Shapes: - r""" - @brief Creates a copy of self - """ - @overload - def each(self) -> Iterator[Shape]: - r""" - @brief Gets all shapes - - This call is equivalent to each(SAll). This convenience method has been introduced in version 0.16 - """ - @overload - def each(self, flags: int) -> Iterator[Shape]: - r""" - @brief Gets all shapes - - @param flags An "or"-ed combination of the S... constants - """ - @overload - def each_overlapping(self, region: Box) -> Iterator[Shape]: - r""" - @brief Gets all shapes that overlap the search box (region) - @param region The rectangular search region - - This call is equivalent to each_overlapping(SAll,region). This convenience method has been introduced in version 0.16 - """ - @overload - def each_overlapping(self, region: DBox) -> Iterator[Shape]: - r""" - @brief Gets all shapes that overlap the search box (region) where the search box is given in micrometer units - @param region The rectangular search region as a \DBox object in micrometer units - This call is equivalent to each_touching(SAll,region). - - This method was introduced in version 0.25 - """ - @overload - def each_overlapping(self, flags: int, region: Box) -> Iterator[Shape]: - r""" - @brief Gets all shapes that overlap the search box (region) - This method was introduced in version 0.16 - - @param flags An "or"-ed combination of the S... constants - @param region The rectangular search region - """ - @overload - def each_overlapping(self, flags: int, region: DBox) -> Iterator[Shape]: - r""" - @brief Gets all shapes that overlap the search box (region) where the search box is given in micrometer units - @param flags An "or"-ed combination of the S... constants - @param region The rectangular search region as a \DBox object in micrometer units - - This method was introduced in version 0.25 - """ - @overload - def each_touching(self, region: Box) -> Iterator[Shape]: - r""" - @brief Gets all shapes that touch the search box (region) - @param region The rectangular search region - - This call is equivalent to each_touching(SAll,region). This convenience method has been introduced in version 0.16 - """ - @overload - def each_touching(self, region: DBox) -> Iterator[Shape]: - r""" - @brief Gets all shapes that touch the search box (region) where the search box is given in micrometer units - @param region The rectangular search region as a \DBox object in micrometer units - This call is equivalent to each_touching(SAll,region). - - This method was introduced in version 0.25 - """ - @overload - def each_touching(self, flags: int, region: Box) -> Iterator[Shape]: - r""" - @brief Gets all shapes that touch the search box (region) - This method was introduced in version 0.16 - - @param flags An "or"-ed combination of the S... constants - @param region The rectangular search region - """ - @overload - def each_touching(self, flags: int, region: DBox) -> Iterator[Shape]: - r""" - @brief Gets all shapes that touch the search box (region) where the search box is given in micrometer units - @param flags An "or"-ed combination of the S... constants - @param region The rectangular search region as a \DBox object in micrometer units - - This method was introduced in version 0.25 - """ - def erase(self, shape: Shape) -> None: - r""" - @brief Erases the shape pointed to by the given \Shape object - This method has been introduced in version 0.16. It can only be used in editable mode. - Erasing a shape will invalidate the shape reference. Access to this reference may then render invalid results. - - @param shape The shape which to destroy - """ - def find(self, shape: Shape) -> Shape: - r""" - @brief Finds a shape inside this collected - This method has been introduced in version 0.21. - This method tries to find the given shape in this collection. The original shape may be located in another collection. If the shape is found, this method returns a reference to the shape in this collection, otherwise a null reference is returned. - """ - @overload - def insert(self, box: Box) -> Shape: - r""" - @brief Inserts a box into the shapes list - @return A reference to the new shape (a \Shape object) - - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, box: DBox) -> Shape: - r""" - @brief Inserts a micrometer-unit box into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Box argument, except that it will internally translate the box from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, edge: DEdge) -> Shape: - r""" - @brief Inserts a micrometer-unit edge into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Edge argument, except that it will internally translate the edge from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, edge: Edge) -> Shape: - r""" - @brief Inserts an edge into the shapes list - - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, edge_pair: DEdgePair) -> Shape: - r""" - @brief Inserts a micrometer-unit edge pair into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \EdgePair argument, except that it will internally translate the edge pair from micrometer to database units. - - This variant has been introduced in version 0.26. - """ - @overload - def insert(self, edge_pair: EdgePair) -> Shape: - r""" - @brief Inserts an edge pair into the shapes list - - This method has been introduced in version 0.26. - """ - @overload - def insert(self, edge_pairs: EdgePairs) -> None: - r""" - @brief Inserts the edges from the edge pair collection into this shape container - @param edges The edge pairs to insert - - This method inserts all edge pairs from the edge pair collection into this shape container. - - This method has been introduced in version 0.26. - """ - @overload - def insert(self, edges: Edges) -> None: - r""" - @brief Inserts the edges from the edge collection into this shape container - @param edges The edges to insert - - This method inserts all edges from the edge collection into this shape container. - - This method has been introduced in version 0.23. - """ - @overload - def insert(self, iter: RecursiveShapeIterator) -> None: - r""" - @brief Inserts the shapes taken from a recursive shape iterator - @param iter The iterator from which to take the shapes from - - This method iterates over all shapes from the iterator and inserts them into the container. - - This method has been introduced in version 0.25.3. - """ - @overload - def insert(self, path: DPath) -> Shape: - r""" - @brief Inserts a micrometer-unit path into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Path argument, except that it will internally translate the path from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, path: Path) -> Shape: - r""" - @brief Inserts a path into the shapes list - @return A reference to the new shape (a \Shape object) - - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, polygon: DPolygon) -> Shape: - r""" - @brief Inserts a micrometer-unit polygon into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Polygon argument, except that it will internally translate the polygon from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, polygon: Polygon) -> Shape: - r""" - @brief Inserts a polygon into the shapes list - @return A reference to the new shape (a \Shape object) - - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, region: Region) -> None: - r""" - @brief Inserts the polygons from the region into this shape container - @param region The region to insert - - This method inserts all polygons from the region into this shape container. - - This method has been introduced in version 0.23. - """ - @overload - def insert(self, shape: Shape) -> Shape: - r""" - @brief Inserts a shape from a shape reference into the shapes list - @return A reference (a \Shape object) to the newly created shape - This method has been introduced in version 0.16. - """ - @overload - def insert(self, shapes: Shapes) -> None: - r""" - @brief Inserts the shapes taken from another shape container - @param shapes The other container from which to take the shapes from - - This method takes all shapes from the given container and inserts them into this one. - - This method has been introduced in version 0.25.3. - """ - @overload - def insert(self, simple_polygon: DSimplePolygon) -> Shape: - r""" - @brief Inserts a micrometer-unit simple polygon into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \SimplePolygon argument, except that it will internally translate the polygon from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, simple_polygon: SimplePolygon) -> Shape: - r""" - @brief Inserts a simple polygon into the shapes list - @return A reference to the new shape (a \Shape object) - - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, text: DText) -> Shape: - r""" - @brief Inserts a micrometer-unit text into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Text argument, except that it will internally translate the text from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, text: Text) -> Shape: - r""" - @brief Inserts a text into the shapes list - @return A reference to the new shape (a \Shape object) - - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, texts: Texts) -> None: - r""" - @brief Inserts the texts from the text collection into this shape container - @param texts The texts to insert - - This method inserts all texts from the text collection into this shape container. - - This method has been introduced in version 0.27. - """ - @overload - def insert(self, box: Box, property_id: int) -> Shape: - r""" - @brief Inserts a box with properties into the shapes list - @return A reference to the new shape (a \Shape object) - The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, box: DBox, property_id: int) -> Shape: - r""" - @brief Inserts a micrometer-unit box with properties into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Box argument and a property ID, except that it will internally translate the box from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, edge: DEdge, property_id: int) -> Shape: - r""" - @brief Inserts a micrometer-unit edge with properties into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Edge argument and a property ID, except that it will internally translate the edge from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, edge: Edge, property_id: int) -> Shape: - r""" - @brief Inserts an edge with properties into the shapes list - @return A reference to the new shape (a \Shape object) - The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. - Starting with version 0.16, this method returns a reference to the newly created shape. - """ - @overload - def insert(self, edge_pair: DEdgePair, property_id: int) -> Shape: - r""" - @brief Inserts a micrometer-unit edge pair with properties into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \EdgePair argument and a property ID, except that it will internally translate the edge pair from micrometer to database units. - - This variant has been introduced in version 0.26. - """ - @overload - def insert(self, edge_pair: EdgePair, property_id: int) -> Shape: - r""" - @brief Inserts an edge pair with properties into the shapes list - @return A reference to the new shape (a \Shape object) - The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. - This method has been introduced in version 0.26. - """ - @overload - def insert(self, edge_pairs: EdgePairs, trans: DCplxTrans) -> None: - r""" - @brief Inserts the edge pairs from the edge pair collection into this shape container with a transformation (given in micrometer units) - @param edges The edge pairs to insert - @param trans The transformation to apply (displacement in micrometer units) - - This method inserts all edge pairs from the edge pair collection into this shape container. - Before an edge pair is inserted, the given transformation is applied. - - This method has been introduced in version 0.26. - """ - @overload - def insert(self, edge_pairs: EdgePairs, trans: ICplxTrans) -> None: - r""" - @brief Inserts the edge pairs from the edge pair collection into this shape container with a transformation - @param edges The edge pairs to insert - @param trans The transformation to apply - - This method inserts all edge pairs from the edge pair collection into this shape container. - Before an edge pair is inserted, the given transformation is applied. - - This method has been introduced in version 0.26. - """ - @overload - def insert(self, edges: Edges, trans: DCplxTrans) -> None: - r""" - @brief Inserts the edges from the edge collection into this shape container with a transformation (given in micrometer units) - @param edges The edges to insert - @param trans The transformation to apply (displacement in micrometer units) - - This method inserts all edges from the edge collection into this shape container. - Before an edge is inserted, the given transformation is applied. - - This method has been introduced in version 0.25. - """ - @overload - def insert(self, edges: Edges, trans: ICplxTrans) -> None: - r""" - @brief Inserts the edges from the edge collection into this shape container with a transformation - @param edges The edges to insert - @param trans The transformation to apply - - This method inserts all edges from the edge collection into this shape container. - Before an edge is inserted, the given transformation is applied. - - This method has been introduced in version 0.23. - """ - @overload - def insert(self, iter: RecursiveShapeIterator, trans: ICplxTrans) -> None: - r""" - @brief Inserts the shapes taken from a recursive shape iterator with a transformation - @param iter The iterator from which to take the shapes from - @param trans The transformation to apply - - This method iterates over all shapes from the iterator and inserts them into the container. - The given transformation is applied before the shapes are inserted. - - This method has been introduced in version 0.25.3. - """ - @overload - def insert(self, path: DPath, property_id: int) -> Shape: - r""" - @brief Inserts a micrometer-unit path with properties into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Path argument and a property ID, except that it will internally translate the path from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, path: Path, property_id: int) -> Shape: - r""" - @brief Inserts a path with properties into the shapes list - @return A reference to the new shape (a \Shape object) - The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, polygon: DPolygon, property_id: int) -> Shape: - r""" - @brief Inserts a micrometer-unit polygon with properties into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Polygon argument and a property ID, except that it will internally translate the polygon from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, polygon: Polygon, property_id: int) -> Shape: - r""" - @brief Inserts a polygon with properties into the shapes list - @return A reference to the new shape (a \Shape object) - The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, region: Region, trans: DCplxTrans) -> None: - r""" - @brief Inserts the polygons from the region into this shape container with a transformation (given in micrometer units) - @param region The region to insert - @param trans The transformation to apply (displacement in micrometer units) - - This method inserts all polygons from the region into this shape container. - Before a polygon is inserted, the given transformation is applied. - - This method has been introduced in version 0.25. - """ - @overload - def insert(self, region: Region, trans: ICplxTrans) -> None: - r""" - @brief Inserts the polygons from the region into this shape container with a transformation - @param region The region to insert - @param trans The transformation to apply - - This method inserts all polygons from the region into this shape container. - Before a polygon is inserted, the given transformation is applied. - - This method has been introduced in version 0.23. - """ - @overload - def insert(self, shape: Shape, trans: DCplxTrans) -> Shape: - r""" - @brief Inserts a shape from a shape reference into the shapes list with a complex integer transformation (given in micrometer units) - @param shape The shape to insert - @param trans The transformation to apply before the shape is inserted (displacement in micrometer units) - @return A reference (a \Shape object) to the newly created shape - This method has been introduced in version 0.25. - """ - @overload - def insert(self, shape: Shape, trans: DTrans) -> Shape: - r""" - @brief Inserts a shape from a shape reference into the shapes list with a transformation (given in micrometer units) - @param shape The shape to insert - @param trans The transformation to apply before the shape is inserted (displacement in micrometers) - @return A reference (a \Shape object) to the newly created shape - This method has been introduced in version 0.25. - """ - @overload - def insert(self, shape: Shape, trans: ICplxTrans) -> Shape: - r""" - @brief Inserts a shape from a shape reference into the shapes list with a complex integer transformation - @param shape The shape to insert - @param trans The transformation to apply before the shape is inserted - @return A reference (a \Shape object) to the newly created shape - This method has been introduced in version 0.22. - """ - @overload - def insert(self, shape: Shape, trans: Trans) -> Shape: - r""" - @brief Inserts a shape from a shape reference into the shapes list with a transformation - @param shape The shape to insert - @param trans The transformation to apply before the shape is inserted - @return A reference (a \Shape object) to the newly created shape - This method has been introduced in version 0.22. - """ - @overload - def insert(self, shapes: Shapes, flags: int) -> None: - r""" - @brief Inserts the shapes taken from another shape container - @param shapes The other container from which to take the shapes from - @param flags The filter flags for taking the shapes from the input container (see S... constants) - - This method takes all selected shapes from the given container and inserts them into this one. - - This method has been introduced in version 0.25.3. - """ - @overload - def insert(self, shapes: Shapes, trans: ICplxTrans) -> None: - r""" - @brief Inserts the shapes taken from another shape container with a transformation - @param shapes The other container from which to take the shapes from - @param trans The transformation to apply - - This method takes all shapes from the given container and inserts them into this one after applying the given transformation. - - This method has been introduced in version 0.25.3. - """ - @overload - def insert(self, simple_polygon: DSimplePolygon, property_id: int) -> Shape: - r""" - @brief Inserts a micrometer-unit simple polygon with properties into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \SimplePolygon argument and a property ID, except that it will internally translate the simple polygon from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, simple_polygon: SimplePolygon, property_id: int) -> Shape: - r""" - @brief Inserts a simple polygon with properties into the shapes list - @return A reference to the new shape (a \Shape object) - The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, text: DText, property_id: int) -> Shape: - r""" - @brief Inserts a micrometer-unit text with properties into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Text argument and a property ID, except that it will internally translate the text from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, text: Text, property_id: int) -> Shape: - r""" - @brief Inserts a text with properties into the shapes list - @return A reference to the new shape (a \Shape object) - The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, texts: Texts, trans: DCplxTrans) -> None: - r""" - @brief Inserts the texts from the text collection into this shape container with a transformation (given in micrometer units) - @param edges The text to insert - @param trans The transformation to apply (displacement in micrometer units) - - This method inserts all texts from the text collection into this shape container. - Before an text is inserted, the given transformation is applied. - - This method has been introduced in version 0.27. - """ - @overload - def insert(self, texts: Texts, trans: ICplxTrans) -> None: - r""" - @brief Inserts the texts from the text collection into this shape container with a transformation - @param edges The texts to insert - @param trans The transformation to apply - - This method inserts all texts from the text collection into this shape container. - Before an text is inserted, the given transformation is applied. - - This method has been introduced in version 0.27. - """ - @overload - def insert(self, shapes: Shapes, flags: int, trans: ICplxTrans) -> None: - r""" - @brief Inserts the shapes taken from another shape container with a transformation - @param shapes The other container from which to take the shapes from - @param flags The filter flags for taking the shapes from the input container (see S... constants) - @param trans The transformation to apply - - This method takes all selected shapes from the given container and inserts them into this one after applying the given transformation. - - This method has been introduced in version 0.25.3. - """ - @overload - def insert_as_edges(self, edge_pairs: EdgePairs) -> None: - r""" - @brief Inserts the edge pairs from the edge pair collection as individual edges into this shape container - @param edge_pairs The edge pairs to insert - - This method inserts all edge pairs from the edge pair collection into this shape container. - Each edge from the edge pair is inserted individually into the shape container. - - This method has been introduced in version 0.23. - """ - @overload - def insert_as_edges(self, edge_pairs: EdgePairs, trans: DCplxTrans) -> None: - r""" - @brief Inserts the edge pairs from the edge pair collection as individual into this shape container with a transformation (given in micrometer units) - @param edges The edge pairs to insert - @param trans The transformation to apply (displacement in micrometer units) - - This method inserts all edge pairs from the edge pair collection into this shape container. - Each edge from the edge pair is inserted individually into the shape container. - Before each edge is inserted into the shape collection, the given transformation is applied. - - This method has been introduced in version 0.25. - """ - @overload - def insert_as_edges(self, edge_pairs: EdgePairs, trans: ICplxTrans) -> None: - r""" - @brief Inserts the edge pairs from the edge pair collection as individual into this shape container with a transformation - @param edges The edge pairs to insert - @param trans The transformation to apply - - This method inserts all edge pairs from the edge pair collection into this shape container. - Each edge from the edge pair is inserted individually into the shape container. - Before each edge is inserted into the shape collection, the given transformation is applied. - - This method has been introduced in version 0.23. - """ - @overload - def insert_as_polygons(self, edge_pairs: EdgePairs, e: int) -> None: - r""" - @brief Inserts the edge pairs from the edge pair collection as polygons into this shape container - @param edge_pairs The edge pairs to insert - @param e The extension to apply when converting the edges to polygons (in database units) - - This method inserts all edge pairs from the edge pair collection into this shape container. - The edge pairs are converted to polygons covering the area between the edges. - The extension parameter specifies a sizing which is applied when converting the edge pairs to polygons. This way, degenerated edge pairs (i.e. two point-like edges) do not vanish. - - This method has been introduced in version 0.23. - """ - @overload - def insert_as_polygons(self, edge_pairs: EdgePairs, e: float) -> None: - r""" - @brief Inserts the edge pairs from the edge pair collection as polygons into this shape container - @param edge_pairs The edge pairs to insert - @param e The extension to apply when converting the edges to polygons (in micrometer units) - - This method is identical to the version with a integer-type \e parameter, but for this version the \e parameter is given in micrometer units. - - This method has been introduced in version 0.25. - """ - @overload - def insert_as_polygons(self, edge_pairs: EdgePairs, e: DCplxTrans, trans: float) -> None: - r""" - @brief Inserts the edge pairs from the edge pair collection as polygons into this shape container with a transformation - @param edges The edge pairs to insert - @param e The extension to apply when converting the edges to polygons (in micrometer units) - @param trans The transformation to apply (displacement in micrometer units) - - This method is identical to the version with a integer-type \e and \trans parameter, but for this version the \e parameter is given in micrometer units and the \trans parameter is a micrometer-unit transformation. - - This method has been introduced in version 0.25. - """ - @overload - def insert_as_polygons(self, edge_pairs: EdgePairs, e: ICplxTrans, trans: int) -> None: - r""" - @brief Inserts the edge pairs from the edge pair collection as polygons into this shape container with a transformation - @param edges The edge pairs to insert - @param e The extension to apply when converting the edges to polygons (in database units) - @param trans The transformation to apply - - This method inserts all edge pairs from the edge pair collection into this shape container. - The edge pairs are converted to polygons covering the area between the edges. - The extension parameter specifies a sizing which is applied when converting the edge pairs to polygons. This way, degenerated edge pairs (i.e. two point-like edges) do not vanish. - Before a polygon is inserted into the shape collection, the given transformation is applied. - - This method has been introduced in version 0.23. - """ - def is_empty(self) -> bool: - r""" - @brief Returns a value indicating whether the shapes container is empty - This method has been introduced in version 0.20. - """ - def is_valid(self, shape: Shape) -> bool: - r""" - @brief Tests if the given \Shape object is still pointing to a valid object - This method has been introduced in version 0.16. - If the shape represented by the given reference has been deleted, this method returns false. If however, another shape has been inserted already that occupies the original shape's position, this method will return true again. - """ - @overload - def replace(self, shape: Shape, box: Box) -> Shape: - r""" - @brief Replaces the given shape with a box - @return A reference to the new shape (a \Shape object) - - This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the \replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. - This method is permitted in editable mode only. - """ - @overload - def replace(self, shape: Shape, box: DBox) -> Shape: - r""" - @brief Replaces the given shape with a box given in micrometer units - @return A reference to the new shape (a \Shape object) - - This method behaves like the \replace version with a \Box argument, except that it will internally translate the box from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def replace(self, shape: Shape, edge: DEdge) -> Shape: - r""" - @brief Replaces the given shape with an edge given in micrometer units - @return A reference to the new shape (a \Shape object) - - This method behaves like the \replace version with an \Edge argument, except that it will internally translate the edge from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def replace(self, shape: Shape, edge: Edge) -> Shape: - r""" - @brief Replaces the given shape with an edge object - - This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the \replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. - This method is permitted in editable mode only. - """ - @overload - def replace(self, shape: Shape, edge_pair: DEdgePair) -> Shape: - r""" - @brief Replaces the given shape with an edge pair given in micrometer units - @return A reference to the new shape (a \Shape object) - - This method behaves like the \replace version with an \EdgePair argument, except that it will internally translate the edge pair from micrometer to database units. - - This variant has been introduced in version 0.26. - """ - @overload - def replace(self, shape: Shape, edge_pair: EdgePair) -> Shape: - r""" - @brief Replaces the given shape with an edge pair object - - It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the \replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. - This method is permitted in editable mode only. - - This method has been introduced in version 0.26. - """ - @overload - def replace(self, shape: Shape, path: DPath) -> Shape: - r""" - @brief Replaces the given shape with a path given in micrometer units - @return A reference to the new shape (a \Shape object) - - This method behaves like the \replace version with a \Path argument, except that it will internally translate the path from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def replace(self, shape: Shape, path: Path) -> Shape: - r""" - @brief Replaces the given shape with a path - @return A reference to the new shape (a \Shape object) - - This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the \replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. - This method is permitted in editable mode only. - """ - @overload - def replace(self, shape: Shape, polygon: DPolygon) -> Shape: - r""" - @brief Replaces the given shape with a polygon given in micrometer units - @return A reference to the new shape (a \Shape object) - - This method behaves like the \replace version with a \Polygon argument, except that it will internally translate the polygon from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def replace(self, shape: Shape, polygon: Polygon) -> Shape: - r""" - @brief Replaces the given shape with a polygon - @return A reference to the new shape (a \Shape object) - - This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the \replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. - This method is permitted in editable mode only. - """ - @overload - def replace(self, shape: Shape, simple_polygon: DSimplePolygon) -> Shape: - r""" - @brief Replaces the given shape with a simple polygon given in micrometer units - @return A reference to the new shape (a \Shape object) - - This method behaves like the \replace version with a \SimplePolygon argument, except that it will internally translate the simple polygon from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def replace(self, shape: Shape, simple_polygon: SimplePolygon) -> Shape: - r""" - @brief Replaces the given shape with a simple polygon - @return A reference to the new shape (a \Shape object) - - This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the \replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. - This method is permitted in editable mode only. - """ - @overload - def replace(self, shape: Shape, text: DText) -> Shape: - r""" - @brief Replaces the given shape with a text given in micrometer units - @return A reference to the new shape (a \Shape object) - - This method behaves like the \replace version with a \Text argument, except that it will internally translate the text from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def replace(self, shape: Shape, text: Text) -> Shape: - r""" - @brief Replaces the given shape with a text object - @return A reference to the new shape (a \Shape object) - - This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the \replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. - This method is permitted in editable mode only. - """ - def replace_prop_id(self, shape: Shape, property_id: int) -> Shape: - r""" - @brief Replaces (or install) the properties of a shape - @return A \Shape object representing the new shape - This method has been introduced in version 0.16. It can only be used in editable mode. - Changes the properties Id of the given shape or install a properties Id on that shape if it does not have one yet. - The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. - This method will potentially invalidate the shape reference passed to it. Use the reference returned for future references. - """ - def size(self) -> int: - r""" - @brief Gets the number of shapes in this container - This method was introduced in version 0.16 - @return The number of shapes in this container - """ - @overload - def transform(self, trans: DCplxTrans) -> None: - r""" - @brief Transforms all shapes with the given transformation (given in micrometer units) - This method will invalidate all references to shapes inside this collection. - The displacement of the transformation is given in micrometer units. - - It has been introduced in version 0.25. - """ - @overload - def transform(self, trans: DTrans) -> None: - r""" - @brief Transforms all shapes with the given transformation (given in micrometer units) - This method will invalidate all references to shapes inside this collection. - The displacement of the transformation is given in micrometer units. - - It has been introduced in version 0.25. - """ - @overload - def transform(self, trans: ICplxTrans) -> None: - r""" - @brief Transforms all shapes with the given complex integer transformation - This method will invalidate all references to shapes inside this collection. - - It has been introduced in version 0.23. - """ - @overload - def transform(self, trans: Trans) -> None: - r""" - @brief Transforms all shapes with the given transformation - This method will invalidate all references to shapes inside this collection. - - It has been introduced in version 0.23. - """ - @overload - def transform(self, shape: Shape, trans: DCplxTrans) -> Shape: - r""" - @brief Transforms the shape given by the reference with the given complex transformation, where the transformation is given in micrometer units - @param trans The transformation to apply (displacement in micrometer units) - @return A reference (a \Shape object) to the new shape - The original shape may be deleted and re-inserted by this method. Therefore, a new reference is returned. - It is permitted in editable mode only. - This method has been introduced in version 0.25. - """ - @overload - def transform(self, shape: Shape, trans: DTrans) -> Shape: - r""" - @brief Transforms the shape given by the reference with the given transformation, where the transformation is given in micrometer units - @param trans The transformation to apply (displacement in micrometer units) - @return A reference (a \Shape object) to the new shape - The original shape may be deleted and re-inserted by this method. Therefore, a new reference is returned. - It is permitted in editable mode only. - This method has been introduced in version 0.25. - """ - @overload - def transform(self, shape: Shape, trans: ICplxTrans) -> Shape: - r""" - @brief Transforms the shape given by the reference with the given complex integer space transformation - @return A reference (a \Shape object) to the new shape - This method has been introduced in version 0.22. - The original shape may be deleted and re-inserted by this method. Therefore, a new reference is returned. - It is permitted in editable mode only. - """ - @overload - def transform(self, shape: Shape, trans: Trans) -> Shape: - r""" - @brief Transforms the shape given by the reference with the given transformation - @return A reference (a \Shape object) to the new shape - The original shape may be deleted and re-inserted by this method. Therefore, a new reference is returned. - It is permitted in editable mode only. - - This method has been introduced in version 0.16. - """ - -class TechnologyComponent: - r""" - @brief A part of a technology definition - Technology components extend technology definitions (class \Technology) by specialized subfeature definitions. For example, the net tracer supplies it's technology-dependent specification through a technology component called \NetTracerTechnology. - - Components are managed within technologies and can be accessed from a technology using \Technology#component. - - This class has been introduced in version 0.25. - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def description(self) -> str: - r""" - @brief Gets the human-readable description string of the technology component - """ - def name(self) -> str: - r""" - @brief Gets the formal name of the technology component - This is the name by which the component can be obtained from a technology using \Technology#component. - """ - -class Technology: - r""" - @brief Represents a technology - - This class represents one technology from a set of technologies. The set of technologies available in the system can be obtained with \technology_names. Individual technology definitions are returned with \technology_by_name. Use \create_technology to register new technologies and \remove_technology to delete technologies. - - The Technology class has been introduced in version 0.25. - """ - add_other_layers: bool - r""" - @brief Gets the flag indicating whether to add other layers to the layer properties - @brief Sets the flag indicating whether to add other layers to the layer properties - """ - dbu: float - r""" - @brief Gets the default database unit - - The default database unit is the one used when creating a layout for example.@brief Sets the default database unit - """ - default_base_path: str - r""" - @brief Gets the default base path - - See \base_path for details about the default base path. - @hide + Getter: + @brief Gets the area_ratio parameter for the hierarchical network processor + See \area_ratio= for details about this attribute. + Setter: + @brief Sets the area_ratio parameter for the hierarchical network processor + This parameter controls splitting of large polygons in order to reduce the + error made by the bounding box approximation. """ description: str r""" - @brief Gets the description + Getter: + @brief Gets the description of the database - The technology description is shown to the user in technology selection dialogs and for display purposes.@brief Sets the description + Setter: + @brief Sets the description of the database """ - explicit_base_path: str + device_scaling: float r""" - @brief Gets the explicit base path - - See \base_path for details about the explicit base path. - @brief Sets the explicit base path - - See \base_path for details about the explicit base path. + Getter: + @brief Gets the device scaling factor + See \device_scaling= for details about this attribute. + Setter: + @brief Sets the device scaling factor + This factor will scale the physical properties of the extracted devices + accordingly. The scale factor applies an isotropic shrink (<1) or expansion (>1). """ - group: str + generator: str r""" - @brief Gets the technology group + Getter: + @brief Gets the generator string. + The generator is the script that created this database. - The technology group is used to group certain technologies together in the technology selection menu. Technologies with the same group are put under a submenu with that group title. - - The 'group' attribute has been introduced in version 0.26.2. - @brief Sets the technology group - See \group for details about this attribute. - - The 'group' attribute has been introduced in version 0.26.2. + Setter: + @brief Sets the generator string. """ - layer_properties_file: str + include_floating_subcircuits: bool r""" - @brief Gets the path of the layer properties file + Getter: + @brief Gets a flag indicating whether to include floating subcircuits in the netlist. + See \include_floating_subcircuits= for details. - If empty, no layer properties file is associated with the technology. If non-empty, this path will be corrected by the base path (see \correct_path) and this layer properties file will be loaded for layouts with this technology.@brief Sets the path of the layer properties file + This attribute has been introduced in version 0.27. - See \layer_properties_file for details about this property. + Setter: + @brief Sets a flag indicating whether to include floating subcircuits in the netlist. + + With 'include_floating_subcircuits' set to true, subcircuits with no connection to their parent circuit are still included in the circuit as floating subcircuits. Specifically on flattening this means that these subcircuits are properly propagated to their parent instead of appearing as additional top circuits. + + This attribute has been introduced in version 0.27 and replaces the arguments of \extract_netlist. """ - load_layout_options: LoadLayoutOptions + max_vertex_count: int r""" - @brief Gets the layout reader options - - This method returns the layout reader options that are used when reading layouts with this technology. - - Change the reader options by modifying the object and using the setter to change it: - - @code - opt = tech.load_layout_options - opt.dxf_dbu = 2.5 - tech.load_layout_options = opt - @/code - @brief Sets the layout reader options - - See \load_layout_options for a description of this property. + Getter: + See \max_vertex_count= for details about this attribute. + Setter: + @brief Sets the max_vertex_count parameter for the hierarchical network processor + This parameter controls splitting of large polygons in order to enhance performance + for very big polygons. """ name: str r""" - @brief Gets the name of the technology@brief Sets the name of the technology + Getter: + @brief Gets the name of the database + + Setter: + @brief Sets the name of the database """ - save_layout_options: SaveLayoutOptions + original_file: str r""" - @brief Gets the layout writer options + Getter: + @brief Gets the original file name of the database + The original filename is the layout file from which the netlist DB was created. + Setter: + @brief Sets the original file name of the database + """ + threads: int + r""" + Getter: + @brief Gets the number of threads to use for operations which support multiple threads - This method returns the layout writer options that are used when writing layouts with this technology. + Setter: + @brief Sets the number of threads to use for operations which support multiple threads + """ + @overload + @classmethod + def new(cls) -> LayoutToNetlist: + r""" + @brief Creates a new and empty extractor object + The main objective for this constructor is to create an object suitable for reading an annotated netlist. + """ + @overload + @classmethod + def new(cls, dss: DeepShapeStore) -> LayoutToNetlist: + r""" + @brief Creates a new extractor object reusing an existing \DeepShapeStore object + This constructor can be used if there is a DSS object already from which the shapes can be taken. This version can only be used with \register to add layers (regions) inside the 'dss' object. - Change the reader options by modifying the object and using the setter to change it: + The make_... methods will not create new layers as there is no particular place defined where to create the layers. + The extractor will not take ownership of the dss object unless you call \keep_dss. + """ + @overload + @classmethod + def new(cls, iter: RecursiveShapeIterator) -> LayoutToNetlist: + r""" + @brief Creates a new extractor connected to an original layout + This constructor will attach the extractor to an original layout through the shape iterator. + """ + @overload + @classmethod + def new(cls, dss: DeepShapeStore, layout_index: int) -> LayoutToNetlist: + r""" + @brief Creates a new extractor object reusing an existing \DeepShapeStore object + This constructor can be used if there is a DSS object already from which the shapes can be taken. NOTE: in this case, the make_... functions will create new layers inside this DSS. To register existing layers (regions) use \register. + """ + @overload + @classmethod + def new(cls, topcell_name: str, dbu: float) -> LayoutToNetlist: + r""" + @brief Creates a new extractor object with a flat DSS + @param topcell_name The name of the top cell of the internal flat layout + @param dbu The database unit to use for the internal flat layout + + This constructor will create an extractor for flat extraction. Layers registered with \register will be flattened. New layers created with make_... will be flat layers. + + The database unit is mandatory because the physical parameter extraction for devices requires this unit for translation of layout to physical dimensions. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a new and empty extractor object + The main objective for this constructor is to create an object suitable for reading an annotated netlist. + """ + @overload + def __init__(self, dss: DeepShapeStore) -> None: + r""" + @brief Creates a new extractor object reusing an existing \DeepShapeStore object + This constructor can be used if there is a DSS object already from which the shapes can be taken. This version can only be used with \register to add layers (regions) inside the 'dss' object. + + The make_... methods will not create new layers as there is no particular place defined where to create the layers. + + The extractor will not take ownership of the dss object unless you call \keep_dss. + """ + @overload + def __init__(self, iter: RecursiveShapeIterator) -> None: + r""" + @brief Creates a new extractor connected to an original layout + This constructor will attach the extractor to an original layout through the shape iterator. + """ + @overload + def __init__(self, dss: DeepShapeStore, layout_index: int) -> None: + r""" + @brief Creates a new extractor object reusing an existing \DeepShapeStore object + This constructor can be used if there is a DSS object already from which the shapes can be taken. NOTE: in this case, the make_... functions will create new layers inside this DSS. To register existing layers (regions) use \register. + """ + @overload + def __init__(self, topcell_name: str, dbu: float) -> None: + r""" + @brief Creates a new extractor object with a flat DSS + @param topcell_name The name of the top cell of the internal flat layout + @param dbu The database unit to use for the internal flat layout + + This constructor will create an extractor for flat extraction. Layers registered with \register will be flattened. New layers created with make_... will be flat layers. + + The database unit is mandatory because the physical parameter extraction for devices requires this unit for translation of layout to physical dimensions. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + @overload + def antenna_check(self, gate: Region, metal: Region, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: + r""" + @brief Runs an antenna check on the extracted clusters + + The antenna check will traverse all clusters and run an antenna check + for all root clusters. The antenna ratio is defined by the total + area of all "metal" shapes divided by the total area of all "gate" shapes + on the cluster. Of all clusters where the antenna ratio is larger than + the limit ratio all metal shapes are copied to the output region as + error markers. + + The simple call is: + + @code + l2n = ... # a LayoutToNetlist object + l2n.extract_netlist + # check for antenna ratio 10.0 of metal vs. poly: + errors = l2n.antenna(poly, metal, 10.0) + @/code + + You can include diodes which rectify the antenna effect. Provide recognition layers for theses diodes and include them in the connections. Then specify the diode layers in the antenna call: + + @code + ... + # include diode_layer1: + errors = l2n.antenna(poly, metal, 10.0, [ diode_layer1 ]) + # include diode_layer1 and diode_layer2:errors = l2n.antenna(poly, metal, 10.0, [ diode_layer1, diode_layer2 ]) + @/code + + Diodes can be configured to partially reduce the antenna effect depending on their area. This will make the diode_layer1 increase the ratio by 50.0 per square micrometer area of the diode: + + @code + ... + # diode_layer1 increases the ratio by 50 per square micrometer area: + errors = l2n.antenna(poly, metal, 10.0 [ [ diode_layer, 50.0 ] ]) + @/code + + If 'texts' is non-nil, this text collection will receive labels explaining the error in terms of area values and relevant ratio. + + The 'texts' parameter has been added in version 0.27.11. + """ + @overload + def antenna_check(self, gate: Region, gate_perimeter_factor: float, metal: Region, metal_perimeter_factor: float, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: + r""" + @brief Runs an antenna check on the extracted clusters taking the perimeter into account + + This version of the \antenna_check method allows taking the perimeter of gate or metal into account. The effective area is computed using: + + @code + Aeff = A + P * t + @/code + + Here Aeff is the area used in the check, A is the polygon area, P the perimeter and t the perimeter factor. This formula applies to gate polygon area/perimeter with 'gate_perimeter_factor' for t and metal polygon area/perimeter with 'metal_perimeter_factor'. The perimeter_factor has the dimension of micrometers and can be thought of as the width of the material. Essentially the side walls of the material are taking into account for the surface area as well. + + This variant has been introduced in version 0.26.6. + """ + @overload + def antenna_check(self, gate: Region, gate_area_factor: float, gate_perimeter_factor: float, metal: Region, metal_area_factor: float, metal_perimeter_factor: float, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: + r""" + @brief Runs an antenna check on the extracted clusters taking the perimeter into account and providing an area factor + + This (most generic) version of the \antenna_check method allows taking the perimeter of gate or metal into account and also provides a scaling factor for the area part. + The effective area is computed using: + + @code + Aeff = A * f + P * t + @/code + + Here f is the area factor and t the perimeter factor. A is the polygon area and P the polygon perimeter. A use case for this variant is to set the area factor to zero. This way, only perimeter contributions are considered. + + This variant has been introduced in version 0.26.6. + """ + def build_all_nets(self, cmap: CellMapping, target: Layout, lmap: Dict[int, Region], net_cell_name_prefix: Optional[Any] = ..., netname_prop: Optional[Any] = ..., hier_mode: Optional[LayoutToNetlist.BuildNetHierarchyMode] = ..., circuit_cell_name_prefix: Optional[Any] = ..., device_cell_name_prefix: Optional[Any] = ...) -> None: + r""" + @brief Builds a full hierarchical representation of the nets + + This method copies all nets into cells corresponding to the circuits. It uses the 'cmap' + object to determine the target cell (create it with "cell_mapping_into" or "const_cell_mapping_into"). + If no mapping is provided for a specific circuit cell, the nets are copied into the next mapped parent as many times as the circuit cell appears there (circuit flattening). + + The method has three net annotation modes: + @ul + @li No annotation (net_cell_name_prefix == nil and netname_prop == nil): the shapes will be put + into the target cell simply. @/li + @li Net name property (net_cell_name_prefix == nil and netname_prop != nil): the shapes will be + annotated with a property named with netname_prop and containing the net name string. @/li + @li Individual subcells per net (net_cell_name_prefix != 0): for each net, a subcell is created + and the net shapes will be put there (name of the subcell = net_cell_name_prefix + net name). + (this mode can be combined with netname_prop too). @/li + @/ul + + In addition, net hierarchy is covered in three ways: + @ul + @li No connection indicated (hier_mode == \BNH_Disconnected: the net shapes are simply put into their + respective circuits. The connections are not indicated. @/li + @li Subnet hierarchy (hier_mode == \BNH_SubcircuitCells): for each root net, a full hierarchy is built + to accommodate the subnets (see build_net in recursive mode). @/li + @li Flat (hier_mode == \BNH_Flatten): each net is flattened and put into the circuit it + belongs to. @/li + @/ul + + If a device cell name prefix is given, cells will be produced for each device abstract + using a name like device_cell_name_prefix + device name. Otherwise the device shapes are + treated as part of the net. + + @param cmap The mapping of internal layout to target layout for the circuit mapping + @param target The target layout + @param lmap Target layer indexes (keys) and net regions (values) + @param hier_mode See description of this method + @param netname_prop An (optional) property name to which to attach the net name + @param circuit_cell_name_prefix See method description + @param net_cell_name_prefix See method description + @param device_cell_name_prefix See above + """ + def build_net(self, net: Net, target: Layout, target_cell: Cell, lmap: Dict[int, Region], netname_prop: Optional[Any] = ..., hier_mode: Optional[LayoutToNetlist.BuildNetHierarchyMode] = ..., circuit_cell_name_prefix: Optional[Any] = ..., device_cell_name_prefix: Optional[Any] = ...) -> None: + r""" + @brief Builds a net representation in the given layout and cell + + This method puts the shapes of a net into the given target cell using a variety of options + to represent the net name and the hierarchy of the net. + + If the netname_prop name is not nil, a property with the given name is created and assigned + the net name. + + Net hierarchy is covered in three ways: + @ul + @li No connection indicated (hier_mode == \BNH_Disconnected: the net shapes are simply put into their + respective circuits. The connections are not indicated. @/li + @li Subnet hierarchy (hier_mode == \BNH_SubcircuitCells): for each root net, a full hierarchy is built + to accommodate the subnets (see build_net in recursive mode). @/li + @li Flat (hier_mode == \BNH_Flatten): each net is flattened and put into the circuit it + belongs to. @/li + @/ul + If a device cell name prefix is given, cells will be produced for each device abstract + using a name like device_cell_name_prefix + device name. Otherwise the device shapes are + treated as part of the net. + + @param target The target layout + @param target_cell The target cell + @param lmap Target layer indexes (keys) and net regions (values) + @param hier_mode See description of this method + @param netname_prop An (optional) property name to which to attach the net name + @param cell_name_prefix Chooses recursive mode if non-null + @param device_cell_name_prefix See above + """ + def build_nets(self, nets: Sequence[Net], cmap: CellMapping, target: Layout, lmap: Dict[int, Region], net_cell_name_prefix: Optional[Any] = ..., netname_prop: Optional[Any] = ..., hier_mode: Optional[LayoutToNetlist.BuildNetHierarchyMode] = ..., circuit_cell_name_prefix: Optional[Any] = ..., device_cell_name_prefix: Optional[Any] = ...) -> None: + r""" + @brief Like \build_all_nets, but with the ability to select some nets. + """ + @overload + def cell_mapping_into(self, layout: Layout, cell: Cell, with_device_cells: Optional[bool] = ...) -> CellMapping: + r""" + @brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. + If 'with_device_cells' is true, cells will be produced for devices. These are cells not corresponding to circuits, so they are disabled normally. + Use this option, if you want to access device terminal shapes per device. + + CAUTION: this function may create new cells in 'layout'. Use \const_cell_mapping_into if you want to use the target layout's hierarchy and not modify it. + """ + @overload + def cell_mapping_into(self, layout: Layout, cell: Cell, nets: Sequence[Net], with_device_cells: Optional[bool] = ...) -> CellMapping: + r""" + @brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. + This version will only create cells which are required to represent the nets from the 'nets' argument. + + If 'with_device_cells' is true, cells will be produced for devices. These are cells not corresponding to circuits, so they are disabled normally. + Use this option, if you want to access device terminal shapes per device. + + CAUTION: this function may create new cells in 'layout'. Use \const_cell_mapping_into if you want to use the target layout's hierarchy and not modify it. + """ + def clear_join_net_names(self) -> None: + r""" + @brief Clears all implicit net joining expressions. + See \extract_netlist for more details about this feature. + + This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist. + """ + def clear_join_nets(self) -> None: + r""" + @brief Clears all explicit net joining expressions. + See \extract_netlist for more details about this feature. + + Explicit net joining has been introduced in version 0.27. + """ + @overload + def connect(self, l: Region) -> None: + r""" + @brief Defines an intra-layer connection for the given layer. + The layer is either an original layer created with \make_includelayer and it's variants or + a derived layer. Certain limitations apply. It's safe to use + boolean operations for deriving layers. Other operations are applicable as long as they are + capable of delivering hierarchical layers. + """ + @overload + def connect(self, a: Region, b: Region) -> None: + r""" + @brief Defines an inter-layer connection for the given layers. + The conditions mentioned with intra-layer \connect apply for this method too. + """ + @overload + def connect(self, a: Region, b: Texts) -> None: + r""" + @brief Defines an inter-layer connection for the given layers. + The conditions mentioned with intra-layer \connect apply for this method too. + As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons. + + This variant has been introduced in version 0.27. + """ + @overload + def connect(self, a: Texts, b: Region) -> None: + r""" + @brief Defines an inter-layer connection for the given layers. + The conditions mentioned with intra-layer \connect apply for this method too. + As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons. + + This variant has been introduced in version 0.27. + """ + @overload + def connect_global(self, l: Region, global_net_name: str) -> int: + r""" + @brief Defines a connection of the given layer with a global net. + This method returns the ID of the global net. Use \global_net_name to get the name back from the ID. + """ + @overload + def connect_global(self, l: Texts, global_net_name: str) -> int: + r""" + @brief Defines a connection of the given text layer with a global net. + This method returns the ID of the global net. Use \global_net_name to get the name back from the ID. + This variant has been introduced in version 0.27. + """ + def const_cell_mapping_into(self, layout: Layout, cell: Cell) -> CellMapping: + r""" + @brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. + This version will not create new cells in the target layout. + If the required cells do not exist there yet, flatting will happen. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dss(self) -> DeepShapeStore: + r""" + @brief Gets a reference to the internal DSS object. + """ + def dump_joined_net_names(self) -> str: + r""" + @hide + """ + def dump_joined_net_names_per_cell(self) -> str: + r""" + @hide + """ + def dump_joined_nets(self) -> str: + r""" + @hide + """ + def dump_joined_nets_per_cell(self) -> str: + r""" + @hide + """ + def extract_devices(self, extractor: DeviceExtractorBase, layers: Dict[str, ShapeCollection]) -> None: + r""" + @brief Extracts devices + See the class description for more details. + This method will run device extraction for the given extractor. The layer map is specific + for the extractor and uses the region objects derived with \make_layer and it's variants. + + In addition, derived regions can be passed too. Certain limitations apply. It's safe to use + boolean operations for deriving layers. Other operations are applicable as long as they are + capable of delivering hierarchical layers. + + If errors occur, the device extractor will contain theses errors. + """ + def extract_netlist(self) -> None: + r""" + @brief Runs the netlist extraction + + See the class description for more details. + + This method has been made parameter-less in version 0.27. Use \include_floating_subcircuits= and \join_net_names as substitutes for the arguments of previous versions. + """ + def filename(self) -> str: + r""" + @brief Gets the file name of the database + The filename is the name under which the database is stored or empty if it is not associated with a file. + """ + def global_net_name(self, global_net_id: int) -> str: + r""" + @brief Gets the global net name for the given global net ID. + """ + def internal_layout(self) -> Layout: + r""" + @brief Gets the internal layout + Usually it should not be required to obtain the internal layout. If you need to do so, make sure not to modify the layout as + the functionality of the netlist extractor depends on it. + """ + def internal_top_cell(self) -> Cell: + r""" + @brief Gets the internal top cell + Usually it should not be required to obtain the internal cell. If you need to do so, make sure not to modify the cell as + the functionality of the netlist extractor depends on it. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_extracted(self) -> bool: + r""" + @brief Gets a value indicating whether the netlist has been extracted + + This method has been introduced in version 0.27.1. + """ + @overload + def is_persisted(self, layer: Region) -> bool: + r""" + @brief Returns true, if the given layer is a persisted region. + Persisted layers are kept inside the LayoutToNetlist object and are not released if their object is destroyed. Named layers are persisted, unnamed layers are not. Only persisted, named layers can be put into \connect. + """ + @overload + def is_persisted(self, layer: Texts) -> bool: + r""" + @brief Returns true, if the given layer is a persisted texts collection. + Persisted layers are kept inside the LayoutToNetlist object and are not released if their object is destroyed. Named layers are persisted, unnamed layers are not. Only persisted, named layers can be put into \connect. + + The variant for Texts collections has been added in version 0.27. + """ + @overload + def join_net_names(self, pattern: str) -> None: + r""" + @brief Specifies another pattern for implicit joining of nets for the top level cell. + Use this method to register a pattern for net labels considered in implicit net joining. Implicit net joining allows connecting multiple parts of the same nets (e.g. supply rails) without need for a physical connection. The pattern specifies labels to look for. When parts are labelled with a name matching the expression, the parts carrying the same name are joined. + + This method adds a new pattern. Use \clear_join_net_names to clear the registered pattern. + + Each pattern is a glob expression. Valid glob expressions are: + @ul + @li "" no implicit connections.@/li + @li "*" to make all labels candidates for implicit connections.@/li + @li "VDD" to make all 'VDD'' nets candidates for implicit connections.@/li + @li "VDD" to make all 'VDD'+suffix nets candidates for implicit connections.@/li + @li "{VDD,VSS}" to all VDD and VSS nets candidates for implicit connections.@/li + @/ul + + Label matching is case sensitive. + + This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist. + """ + @overload + def join_net_names(self, cell_pattern: str, pattern: str) -> None: + r""" + @brief Specifies another pattern for implicit joining of nets for the cells from the given cell pattern. + This method allows applying implicit net joining for specific cells, not only for the top cell. + + This method adds a new pattern. Use \clear_join_net_names to clear the registered pattern. + + This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist. + """ + @overload + def join_nets(self, net_names: Sequence[str]) -> None: + r""" + @brief Specifies another name list for explicit joining of nets for the top level cell. + Use this method to join nets from the set of net names. All these nets will be connected together forming a single net. + Explicit joining will imply implicit joining for the involved nets - partial nets involved will be connected too (intra-net joining). + + This method adds a new name list. Use \clear_join_nets to clear the registered pattern. + + Explicit net joining has been introduced in version 0.27. + """ + @overload + def join_nets(self, cell_pattern: str, net_names: Sequence[str]) -> None: + r""" + @brief Specifies another name list for explicit joining of nets for the cells from the given cell pattern. + This method allows applying explicit net joining for specific cells, not only for the top cell. + + This method adds a new name list. Use \clear_join_nets to clear the registered pattern. + + Explicit net joining has been introduced in version 0.27. + """ + def keep_dss(self) -> None: + r""" + @brief Resumes ownership over the DSS object if created with an external one. + """ + def layer_by_index(self, index: int) -> Region: + r""" + @brief Gets a layer object for the given index. + Only named layers can be retrieved with this method. The returned object is a copy which represents the named layer. + """ + def layer_by_name(self, name: str) -> Region: + r""" + @brief Gets a layer object for the given name. + The returned object is a copy which represents the named layer. + """ + @overload + def layer_name(self, l: int) -> str: + r""" + @brief Gets the name of the given layer (by index) + """ + @overload + def layer_name(self, l: ShapeCollection) -> str: + r""" + @brief Gets the name of the given layer + """ + def layer_names(self) -> List[str]: + r""" + @brief Returns a list of names of the layer kept inside the LayoutToNetlist object. + """ + @overload + def layer_of(self, l: Region) -> int: + r""" + @brief Gets the internal layer for a given extraction layer + This method is required to derive the internal layer index - for example for + investigating the cluster tree. + """ + @overload + def layer_of(self, l: Texts) -> int: + r""" + @brief Gets the internal layer for a given text collection + This method is required to derive the internal layer index - for example for + investigating the cluster tree. + + The variant for Texts collections has been added in version 0.27. + """ + @overload + def make_layer(self, name: Optional[str] = ...) -> Region: + r""" + @brief Creates a new, empty hierarchical region + + The name is optional. If given, the layer will already be named accordingly (see \register). + """ + @overload + def make_layer(self, layer_index: int, name: Optional[str] = ...) -> Region: + r""" + @brief Creates a new hierarchical region representing an original layer + 'layer_index' is the layer index of the desired layer in the original layout. + This variant produces polygons and takes texts for net name annotation. + A variant not taking texts is \make_polygon_layer. A Variant only taking + texts is \make_text_layer. + + The name is optional. If given, the layer will already be named accordingly (see \register). + """ + def make_polygon_layer(self, layer_index: int, name: Optional[str] = ...) -> Region: + r""" + @brief Creates a new region representing an original layer taking polygons and texts + See \make_layer for details. + + The name is optional. If given, the layer will already be named accordingly (see \register). + """ + def make_text_layer(self, layer_index: int, name: Optional[str] = ...) -> Texts: + r""" + @brief Creates a new region representing an original layer taking texts only + See \make_layer for details. + + The name is optional. If given, the layer will already be named accordingly (see \register). + + Starting with version 0.27, this method returns a \Texts object. + """ + def netlist(self) -> Netlist: + r""" + @brief gets the netlist extracted (0 if no extraction happened yet) + """ + @overload + def probe_net(self, of_layer: Region, point: DPoint, sc_path_out: Optional[Sequence[SubCircuit]] = ..., initial_circuit: Optional[Circuit] = ...) -> Net: + r""" + @brief Finds the net by probing a specific location on the given layer + + This method will find a net looking at the given layer at the specific position. + It will traverse the hierarchy below if no shape in the requested layer is found + in the specified location. The function will report the topmost net from far above the + hierarchy of circuits as possible. + + If \initial_circuit is given, the probing will start from this circuit and from the cell this circuit represents. By default, the probing will start from the top circuit. + + If no net is found at all, 0 is returned. + + It is recommended to use \probe_net on the netlist right after extraction. + Optimization functions such as \Netlist#purge will remove parts of the net which means + shape to net probing may no longer work for these nets. + + If non-null and an array, 'sc_path_out' will receive a list of \SubCircuits objects which lead to the net from the top circuit of the database. + + This variant accepts a micrometer-unit location. The location is given in the + coordinate space of the initial cell. + + The \sc_path_out and \initial_circuit parameters have been added in version 0.27. + """ + @overload + def probe_net(self, of_layer: Region, point: Point, sc_path_out: Optional[Sequence[SubCircuit]] = ..., initial_circuit: Optional[Circuit] = ...) -> Net: + r""" + @brief Finds the net by probing a specific location on the given layer + See the description of the other \probe_net variant. + This variant accepts a database-unit location. The location is given in the + coordinate space of the initial cell. + + The \sc_path_out and \initial_circuit parameters have been added in version 0.27. + """ + def read(self, path: str) -> None: + r""" + @brief Reads the extracted netlist from the file. + This method employs the native format of KLayout. + """ + def read_l2n(self, path: str) -> None: + r""" + @brief Reads the extracted netlist from the file. + This method employs the native format of KLayout. + """ + def register(self, l: ShapeCollection, n: str) -> None: + r""" + @brief Names the given layer + 'l' must be a hierarchical \Region or \Texts object derived with \make_layer, \make_text_layer or \make_polygon_layer or a region derived from those by boolean operations or other hierarchical operations. + + Naming a layer allows the system to indicate the layer in various contexts, i.e. when writing the data to a file. Named layers are also persisted inside the LayoutToNetlist object. They are not discarded when the Region object is destroyed. + + If required, the system will assign a name automatically. + This method has been generalized in version 0.27. + """ + def reset_extracted(self) -> None: + r""" + @brief Resets the extracted netlist and enables re-extraction + This method is implicitly called when using \connect or \connect_global after a netlist has been extracted. + This enables incremental connect with re-extraction. + + This method has been introduced in version 0.27.1. + """ + @overload + def shapes_of_net(self, net: Net, of_layer: Region, recursive: bool) -> Region: + r""" + @brief Returns all shapes of a specific net and layer. + If 'recursive'' is true, the returned region will contain the shapes of + all subcircuits too. + """ + @overload + def shapes_of_net(self, net: Net, of_layer: Region, recursive: bool, to: Shapes, propid: Optional[int] = ...) -> None: + r""" + @brief Sends all shapes of a specific net and layer to the given Shapes container. + If 'recursive'' is true, the returned region will contain the shapes of + all subcircuits too. + "prop_id" is an optional properties ID. If given, this property set will be attached to the shapes. + """ + def write(self, path: str, short_format: Optional[bool] = ...) -> None: + r""" + @brief Writes the extracted netlist to a file. + This method employs the native format of KLayout. + """ + def write_l2n(self, path: str, short_format: Optional[bool] = ...) -> None: + r""" + @brief Writes the extracted netlist to a file. + This method employs the native format of KLayout. + """ + +class DeepShapeStore: + r""" + @brief An opaque layout heap for the deep region processor + + This class is used for keeping intermediate, hierarchical data for the deep region processor. It is used in conjunction with the region constructor to create a deep (hierarchical) region. @code - opt = tech.save_layout_options - opt.dbu = 0.01 - tech.save_layout_options = opt + layout = ... # a layout + layer = ... # a layer + cell = ... # a cell (initial cell for the deep region) + dss = RBA::DeepShapeStore::new + region = RBA::Region::new(cell.begin(layer), dss) @/code - @brief Sets the layout writer options - See \save_layout_options for a description of this property. + The DeepShapeStore object also supplies some configuration options for the operations acting on the deep regions. See for example \threads=. + + This class has been introduced in version 0.26. + """ + max_area_ratio: float + r""" + Getter: + @brief Gets the max. area ratio. + + Setter: + @brief Sets the max. area ratio for bounding box vs. polygon area + + This parameter is used to simplify complex polygons. It is used by + create_polygon_layer with the default parameters. It's also used by + boolean operations when they deliver their output. + """ + max_vertex_count: int + r""" + Getter: + @brief Gets the maximum vertex count. + + Setter: + @brief Sets the maximum vertex count default value + + This parameter is used to simplify complex polygons. It is used by + create_polygon_layer with the default parameters. It's also used by + boolean operations when they deliver their output. + """ + reject_odd_polygons: bool + r""" + Getter: + @brief Gets a flag indicating whether to reject odd polygons. + This attribute has been introduced in version 0.27. + Setter: + @brief Sets a flag indicating whether to reject odd polygons + + Some kind of 'odd' (e.g. non-orientable) polygons may spoil the functionality because they cannot be handled properly. By using this flag, the shape store we reject these kind of polygons. The default is 'accept' (without warning). + + This attribute has been introduced in version 0.27. + """ + text_enlargement: int + r""" + Getter: + @brief Gets the text enlargement value. + + Setter: + @brief Sets the text enlargement value + + If set to a non-negative value, text objects are converted to boxes with the + given enlargement (width = 2 * enlargement). The box centers are identical + to the original location of the text. + If this value is negative (the default), texts are ignored. + """ + text_property_name: Any + r""" + Getter: + @brief Gets the text property name. + + Setter: + @brief Sets the text property name. + + If set to a non-null variant, text strings are attached to the generated boxes + as properties with this particular name. This option has an effect only if the + text_enlargement property is not negative. + By default, the name is empty. + """ + threads: int + r""" + Getter: + @brief Gets the number of threads. + + Setter: + @brief Sets the number of threads to allocate for the hierarchical processor """ @classmethod - def clear_technologies(cls) -> None: + def instance_count(cls) -> int: r""" - @brief Clears all technologies - - This method has been introduced in version 0.26. + @hide """ @classmethod - def technologies_to_xml(cls) -> str: + def new(cls) -> DeepShapeStore: r""" - @brief Returns a XML representation of all technologies registered in the system - - \technologies_from_xml can be used to restore the technology definitions. This method is provided mainly as a substitute for the pre-0.25 way of accessing technology data through the 'technology-data' configuration parameter. This method will return the equivalent string. - """ - @classmethod - def technology_names(cls) -> List[str]: - r""" - @brief Gets a list of technology names defined in the system - """ - def __copy__(self) -> Technology: - r""" - @brief Creates a copy of self + @brief Creates a new object of this class """ def __init__(self) -> None: r""" @@ -32165,253 +47079,136 @@ class Technology: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: Technology) -> None: + def add_breakout_cell(self, layout_index: int, cell_index: Sequence[int]) -> None: r""" - @brief Assigns another object to self - """ - def base_path(self) -> str: - r""" - @brief Gets the base path of the technology + @brief Adds a cell indexe to the breakout cell list for the given layout inside the store + See \clear_breakout_cells for an explanation of breakout cells. - The base path is the effective path where files are read from if their file path is a relative one. If the explicit path is set (see \explicit_base_path=), it is - used. If not, the default path is used. The default path is the one from which - a technology file was imported. The explicit one is the one that is specified - explicitly with \explicit_base_path=. + This method has been added in version 0.26.1 """ - def component(self, name: str) -> TechnologyComponent: + @overload + def add_breakout_cells(self, pattern: str) -> None: r""" - @brief Gets the technology component with the given name - The names are unique system identifiers. For all names, use \component_names. - """ - def component_names(self) -> List[str]: - r""" - @brief Gets the names of all components available for \component - """ - def correct_path(self, path: str) -> str: - r""" - @brief Makes a file path relative to the base path if one is specified + @brief Adds cells (given by a cell name pattern) to the breakout cell list to all layouts inside the store + See \clear_breakout_cells for an explanation of breakout cells. - This method turns an absolute path into one relative to the base path. Only files below the base path will be made relative. Files above or beside won't be made relative. + This method has been added in version 0.26.1 + """ + @overload + def add_breakout_cells(self, layout_index: int, cells: Sequence[int]) -> None: + r""" + @brief Adds cell indexes to the breakout cell list for the given layout inside the store + See \clear_breakout_cells for an explanation of breakout cells. - See \base_path for details about the default base path. + This method has been added in version 0.26.1 """ - def create_technology(self, name: str) -> Technology: + @overload + def add_breakout_cells(self, layout_index: int, pattern: str) -> None: r""" - @brief Creates a new (empty) technology with the given name + @brief Adds cells (given by a cell name pattern) to the breakout cell list for the given layout inside the store + See \clear_breakout_cells for an explanation of breakout cells. - This method returns a reference to the new technology. + This method has been added in version 0.26.1 """ - def dup(self) -> Technology: + @overload + def clear_breakout_cells(self) -> None: r""" - @brief Creates a copy of self - """ - def eff_layer_properties_file(self) -> str: - r""" - @brief Gets the effective path of the layer properties file - """ - def eff_path(self, path: str) -> str: - r""" - @brief Makes a file path relative to the base path if one is specified + @brief Clears the breakout cells + See the other variant of \clear_breakout_cells for details. - This method will return the actual path for a file from the file's path. If the input path is a relative one, it will be made absolute by using the base path. + This method has been added in version 0.26.1 + """ + @overload + def clear_breakout_cells(self, layout_index: int) -> None: + r""" + @brief Clears the breakout cells + Breakout cells are a feature by which hierarchy handling can be disabled for specific cells. If cells are specified as breakout cells, they don't interact with neighbor or parent cells, hence are virtually isolated. Breakout cells are useful to shortcut hierarchy evaluation for cells which are otherwise difficult to handle. An example are memory array cells with overlaps to their neighbors: a precise handling of such cells would generate variants and the boundary of the array. Although precise, this behavior leads to partial flattening and propagation of shapes. In consequence, this will also result in wrong device detection in LVS applications. In such cases, these array cells can be declared 'breakout cells' which makes them isolated entities and variant generation does not happen. - See \base_path for details about the default base path. - """ - def has_technology(self, name: str) -> bool: - r""" - @brief Returns a value indicating whether there is a technology with this name - """ - def load(self, file: str) -> None: - r""" - @brief Loads the technology definition from a file - """ - def remove_technology(self, name: str) -> None: - r""" - @brief Removes the technology with the given name - """ - def save(self, file: str) -> None: - r""" - @brief Saves the technology definition to a file - """ - def technologies_from_xml(self, xml: str) -> None: - r""" - @brief Loads the technologies from a XML representation + See also \set_breakout_cells and \add_breakout_cells. - See \technologies_to_xml for details. This method is the corresponding setter. + This method has been added in version 0.26.1 """ - def technology_by_name(self, name: str) -> Technology: + def create(self) -> None: r""" - @brief Gets the technology object for a given name + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. """ - def technology_from_xml(self, xml: str) -> Technology: + def destroy(self) -> None: r""" - @brief Loads the technology from a XML representation + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_singular(self) -> bool: + r""" + @brief Gets a value indicating whether there is a single layout variant - See \technology_to_xml for details. + Specifically for network extraction, singular DSS objects are required. Multiple layouts may be present if different sources of layouts have been used. Such DSS objects are not usable for network extraction. """ - def to_xml(self) -> str: + def pop_state(self) -> None: r""" - @brief Returns a XML representation of this technolog + @brief Restores the store's state on the state state + This will restore the state pushed by \push_state. - \technology_from_xml can be used to restore the technology definition. + This method has been added in version 0.26.1 + """ + def push_state(self) -> None: + r""" + @brief Pushes the store's state on the state state + This will save the stores state (\threads, \max_vertex_count, \max_area_ratio, breakout cells ...) on the state stack. \pop_state can be used to restore the state. + + This method has been added in version 0.26.1 + """ + @overload + def set_breakout_cells(self, pattern: str) -> None: + r""" + @brief Sets the breakout cell list (as cell name pattern) for the all layouts inside the store + See \clear_breakout_cells for an explanation of breakout cells. + + This method has been added in version 0.26.1 + """ + @overload + def set_breakout_cells(self, layout_index: int, cells: Sequence[int]) -> None: + r""" + @brief Sets the breakout cell list (as cell indexes) for the given layout inside the store + See \clear_breakout_cells for an explanation of breakout cells. + + This method has been added in version 0.26.1 + """ + @overload + def set_breakout_cells(self, layout_index: int, pattern: str) -> None: + r""" + @brief Sets the breakout cell list (as cell name pattern) for the given layout inside the store + See \clear_breakout_cells for an explanation of breakout cells. + + This method has been added in version 0.26.1 """ -class Text: +class NetlistCompareLogger: r""" - @brief A text object - - A text object has a point (location), a text, a text transformation, - a text size and a font id. Text size and font id are provided to be - be able to render the text correctly. - Text objects are used as labels (i.e. for pins) or to indicate a particular position. - - The \Text class uses integer coordinates. A class that operates with floating-point coordinates is \DText. - - See @The Database API@ for more details about the database objects. - """ - font: int - r""" - @brief Get the font number - @brief Set the font number - """ - halign: int - r""" - @brief Get the horizontal alignment - - See \halign= for a description of this property. - @brief Set the horizontal alignment - - This property specifies how the text is aligned relative to the anchor point. Allowed values for this property are 0 (left), 1 (center) and 2 (right). - This property has been introduced in version 0.22. - """ - size: int - r""" - @brief Get the text height - @brief Set the text height of this object - """ - string: str - r""" - @brief Get the text string - @brief Assign a text string to this object - """ - trans: Trans - r""" - @brief Get the transformation - @brief Assign a transformation (text position and orientation) to this object - """ - valign: int - r""" - @brief Get the vertical alignment - - See \valign= for a description of this property. - @brief Set the vertical alignment - - This property specifies how the text is aligned relative to the anchor point. Allowed values for this property are 0 (top), 1 (center) and 2 (bottom). - This property has been introduced in version 0.22. - """ - x: int - r""" - @brief Gets the x location of the text - - This method has been introduced in version 0.23. - @brief Sets the x location of the text - - This method has been introduced in version 0.23. - """ - y: int - r""" - @brief Gets the y location of the text - - This method has been introduced in version 0.23. - @brief Sets the y location of the text - - This method has been introduced in version 0.23. + @brief A base class for netlist comparer event receivers + See \GenericNetlistCompareLogger for custom implementations of such receivers. """ @classmethod - def from_s(cls, s: str) -> Text: + def new(cls) -> NetlistCompareLogger: r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. + @brief Creates a new object of this class """ - def __copy__(self) -> Text: - r""" - @brief Creates a copy of self - """ - def __eq__(self, text: object) -> bool: - r""" - @brief Equality - - - Return true, if this text object and the given text are equal - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given text object. This method enables texts as hash keys. - - This method has been introduced in version 0.25. - """ - @overload def __init__(self) -> None: r""" - @brief Default constructor - - Creates a text with unit transformation and empty text. - """ - @overload - def __init__(self, dtext: DText) -> None: - r""" - @brief Creates an integer coordinate text from a floating-point coordinate text - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtext'. - """ - @overload - def __init__(self, string: str, trans: Trans) -> None: - r""" - @brief Constructor with string and transformation - - - A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. - """ - @overload - def __init__(self, string: str, x: int, y: int) -> None: - r""" - @brief Constructor with string and location - - - A string and a location is provided to this constructor. The location is specifies as a pair of x and y coordinates. - - This method has been introduced in version 0.23. - """ - @overload - def __init__(self, string: str, trans: Trans, height: int, font: int) -> None: - r""" - @brief Constructor with string, transformation, text height and font - - - A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified. - """ - def __lt__(self, t: Text) -> bool: - r""" - @brief Less operator - @param t The object to compare against - This operator is provided to establish some, not necessarily a certain sorting order - """ - def __ne__(self, text: object) -> bool: - r""" - @brief Inequality - - - Return true, if this text object and the given text are not equal - """ - def __repr__(self) -> str: - r""" - @brief Convert to a string - """ - def __str__(self) -> str: - r""" - @brief Convert to a string + @brief Creates a new object of this class """ def _create(self) -> None: r""" @@ -32450,279 +47247,274 @@ class Text: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: Text) -> None: + def create(self) -> None: r""" - @brief Assigns another object to self + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. """ - def dup(self) -> Text: + def destroy(self) -> None: r""" - @brief Creates a copy of self + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. """ - def hash(self) -> int: + def destroyed(self) -> bool: r""" - @brief Computes a hash value - Returns a hash value for the given text object. This method enables texts as hash keys. + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ - This method has been introduced in version 0.25. +class GenericNetlistCompareLogger(NetlistCompareLogger): + r""" + @brief An event receiver for the netlist compare feature. + The \NetlistComparer class will send compare events to a logger derived from this class. Use this class to implement your own logger class. You can override on of it's methods to receive certain kind of events. + This class has been introduced in version 0.26. + """ + class Severity: + r""" + @brief This class represents the log severity level for \GenericNetlistCompareLogger#log_entry. + This enum has been introduced in version 0.28. """ + Error: ClassVar[GenericNetlistCompareLogger.Severity] + r""" + @brief An error + """ + Info: ClassVar[GenericNetlistCompareLogger.Severity] + r""" + @brief Information only + """ + NoSeverity: ClassVar[GenericNetlistCompareLogger.Severity] + r""" + @brief Unspecific severity + """ + Warning: ClassVar[GenericNetlistCompareLogger.Severity] + r""" + @brief A warning + """ + @overload + @classmethod + def new(cls, i: int) -> GenericNetlistCompareLogger.Severity: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> GenericNetlistCompareLogger.Severity: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __lt__(self, other: GenericNetlistCompareLogger.Severity) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class NetlistComparer: + r""" + @brief Compares two netlists + This class performs a comparison of two netlists. + It can be used with an event receiver (logger) to track the errors and net mismatches. Event receivers are derived from class \GenericNetlistCompareLogger. + The netlist comparer can be configured in different ways. Specific hints can be given for nets, device classes or circuits to improve efficiency and reliability of the graph equivalence deduction algorithm. For example, objects can be marked as equivalent using \same_nets, \same_circuits etc. The compare algorithm will then use these hints to derive further equivalences. This way, ambiguities can be resolved. + + Another configuration option relates to swappable pins of subcircuits. If pins are marked this way, the compare algorithm may swap them to achieve net matching. Swappable pins belong to an 'equivalence group' and can be defined with \equivalent_pins. + + This class has been introduced in version 0.26. + """ + dont_consider_net_names: bool + r""" + Getter: + @brief Gets a value indicating whether net names shall not be considered + See \dont_consider_net_names= for details. + Setter: + @brief Sets a value indicating whether net names shall not be considered + If this value is set to true, net names will not be considered when resolving ambiguities. + Not considering net names usually is more expensive. The default is 'false' indicating that + net names will be considered for ambiguity resolution. + + This property has been introduced in version 0.26.7. + """ + max_branch_complexity: int + r""" + Getter: + @brief Gets the maximum branch complexity + See \max_branch_complexity= for details. + Setter: + @brief Sets the maximum branch complexity + This value limits the maximum branch complexity of the backtracking algorithm. + The complexity is the accumulated number of branch options with ambiguous + net matches. Backtracking will stop when the maximum number of options + has been exceeded. + + By default, from version 0.27 on the complexity is unlimited and can be reduced in cases where runtimes need to be limited at the cost less elaborate matching evaluation. + + As the computational complexity is the square of the branch count, + this value should be adjusted carefully. + """ + max_depth: int + r""" + Getter: + @brief Gets the maximum search depth + See \max_depth= for details. + Setter: + @brief Sets the maximum search depth + This value limits the search depth of the backtracking algorithm to the + given number of jumps. + + By default, from version 0.27 on the depth is unlimited and can be reduced in cases where runtimes need to be limited at the cost less elaborate matching evaluation. + """ + @property + def max_resistance(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Excludes all resistor devices with a resistance values higher than the given threshold. + To reset this constraint, set this attribute to zero. + """ + @property + def min_capacitance(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Excludes all capacitor devices with a capacitance values less than the given threshold. + To reset this constraint, set this attribute to zero. + """ + with_log: bool + r""" + Getter: + @brief Gets a value indicating that log messages are generated. + See \with_log= for details about this flag. + + This attribute have been introduced in version 0.28. + + Setter: + @brief Sets a value indicating that log messages are generated. + Log messages may be expensive to compute, hence they can be turned off. + By default, log messages are generated. + + This attribute have been introduced in version 0.28. + """ @overload - def move(self, distance: Vector) -> Text: - r""" - @brief Moves the text by a certain distance (modifies self) - - - Moves the text by a given offset and returns the moved - text. Does not check for coordinate overflows. - - @param p The offset to move the text. - - @return A reference to this text object - """ - @overload - def move(self, dx: int, dy: int) -> Text: - r""" - @brief Moves the text by a certain distance (modifies self) - - - Moves the text by a given distance in x and y direction and returns the moved - text. Does not check for coordinate overflows. - - @param dx The x distance to move the text. - @param dy The y distance to move the text. - - @return A reference to this text object - - This method was introduced in version 0.23. - """ - @overload - def moved(self, distance: Vector) -> Text: - r""" - @brief Returns the text moved by a certain distance (does not modify self) - - - Moves the text by a given offset and returns the moved - text. Does not modify *this. Does not check for coordinate - overflows. - - @param p The offset to move the text. - - @return The moved text. - """ - @overload - def moved(self, dx: int, dy: int) -> Text: - r""" - @brief Returns the text moved by a certain distance (does not modify self) - - - Moves the text by a given offset and returns the moved - text. Does not modify *this. Does not check for coordinate - overflows. - - @param dx The x distance to move the text. - @param dy The y distance to move the text. - - @return The moved text. - - This method was introduced in version 0.23. - """ - def to_dtype(self, dbu: Optional[float] = ...) -> DText: - r""" - @brief Converts the text to a floating-point coordinate text - The database unit can be specified to translate the integer-coordinate text into a floating-point coordinate text in micron units. The database unit is basically a scaling factor. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief Convert to a string - """ - @overload - def transformed(self, t: CplxTrans) -> DText: - r""" - @brief Transform the text with the given complex transformation - - - @param t The magnifying transformation to apply - @return The transformed text (a DText now) - """ - @overload - def transformed(self, t: ICplxTrans) -> Text: - r""" - @brief Transform the text with the given complex transformation - - - @param t The magnifying transformation to apply - @return The transformed text (in this case an integer coordinate object now) - - This method has been introduced in version 0.18. - """ - @overload - def transformed(self, t: Trans) -> Text: - r""" - @brief Transform the text with the given simple transformation - - - @param t The transformation to apply - @return The transformed text - """ - -class DText: - r""" - @brief A text object - - A text object has a point (location), a text, a text transformation, - a text size and a font id. Text size and font id are provided to be - be able to render the text correctly. - Text objects are used as labels (i.e. for pins) or to indicate a particular position. - - The \DText class uses floating-point coordinates. A class that operates with integer coordinates is \Text. - - See @The Database API@ for more details about the database objects. - """ - font: int - r""" - @brief Get the font number - @brief Set the font number - """ - halign: int - r""" - @brief Get the horizontal alignment - - See \halign= for a description of this property. - @brief Set the horizontal alignment - - This property specifies how the text is aligned relative to the anchor point. Allowed values for this property are 0 (left), 1 (center) and 2 (right). - This property has been introduced in version 0.22. - """ - size: float - r""" - @brief Get the text height - @brief Set the text height of this object - """ - string: str - r""" - @brief Get the text string - @brief Assign a text string to this object - """ - trans: DTrans - r""" - @brief Get the transformation - @brief Assign a transformation (text position and orientation) to this object - """ - valign: int - r""" - @brief Get the vertical alignment - - See \valign= for a description of this property. - @brief Set the vertical alignment - - This property specifies how the text is aligned relative to the anchor point. Allowed values for this property are 0 (top), 1 (center) and 2 (bottom). - This property has been introduced in version 0.22. - """ - x: float - r""" - @brief Gets the x location of the text - - This method has been introduced in version 0.23. - @brief Sets the x location of the text - - This method has been introduced in version 0.23. - """ - y: float - r""" - @brief Gets the y location of the text - - This method has been introduced in version 0.23. - @brief Sets the y location of the text - - This method has been introduced in version 0.23. - """ @classmethod - def from_s(cls, s: str) -> DText: + def new(cls) -> NetlistComparer: r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. + @brief Creates a new comparer object. + See the class description for more details. """ - def __copy__(self) -> DText: + @overload + @classmethod + def new(cls, logger: GenericNetlistCompareLogger) -> NetlistComparer: r""" - @brief Creates a copy of self - """ - def __eq__(self, text: object) -> bool: - r""" - @brief Equality - - - Return true, if this text object and the given text are equal - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given text object. This method enables texts as hash keys. - - This method has been introduced in version 0.25. + @brief Creates a new comparer object. + The logger is a delegate or event receiver which the comparer will send compare events to. See the class description for more details. """ @overload def __init__(self) -> None: r""" - @brief Default constructor - - Creates a text with unit transformation and empty text. + @brief Creates a new comparer object. + See the class description for more details. """ @overload - def __init__(self, Text: Text) -> None: + def __init__(self, logger: GenericNetlistCompareLogger) -> None: r""" - @brief Creates a floating-point coordinate text from an integer coordinate text - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itext'. - """ - @overload - def __init__(self, string: str, trans: DTrans) -> None: - r""" - @brief Constructor with string and transformation - - - A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. - """ - @overload - def __init__(self, string: str, x: float, y: float) -> None: - r""" - @brief Constructor with string and location - - - A string and a location is provided to this constructor. The location is specifies as a pair of x and y coordinates. - - This method has been introduced in version 0.23. - """ - @overload - def __init__(self, string: str, trans: DTrans, height: float, font: int) -> None: - r""" - @brief Constructor with string, transformation, text height and font - - - A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified. - """ - def __lt__(self, t: DText) -> bool: - r""" - @brief Less operator - @param t The object to compare against - This operator is provided to establish some, not necessarily a certain sorting order - """ - def __ne__(self, text: object) -> bool: - r""" - @brief Inequality - - - Return true, if this text object and the given text are not equal - """ - def __repr__(self) -> str: - r""" - @brief Convert to a string - """ - def __str__(self) -> str: - r""" - @brief Convert to a string + @brief Creates a new comparer object. + The logger is a delegate or event receiver which the comparer will send compare events to. See the class description for more details. """ def _create(self) -> None: r""" @@ -32761,121 +47553,727 @@ class DText: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: DText) -> None: + @overload + def compare(self, netlist_a: Netlist, netlist_b: Netlist) -> bool: r""" - @brief Assigns another object to self - """ - def dup(self) -> DText: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given text object. This method enables texts as hash keys. - - This method has been introduced in version 0.25. + @brief Compares two netlists. + This method will perform the actual netlist compare. It will return true if both netlists are identical. If the comparer has been configured with \same_nets or similar methods, the objects given there must be located inside 'circuit_a' and 'circuit_b' respectively. """ @overload - def move(self, distance: DVector) -> DText: + def compare(self, netlist_a: Netlist, netlist_b: Netlist, logger: NetlistCompareLogger) -> bool: r""" - @brief Moves the text by a certain distance (modifies self) - - - Moves the text by a given offset and returns the moved - text. Does not check for coordinate overflows. - - @param p The offset to move the text. - - @return A reference to this text object + @brief Compares two netlists. + This method will perform the actual netlist compare using the given logger. It will return true if both netlists are identical. If the comparer has been configured with \same_nets or similar methods, the objects given there must be located inside 'circuit_a' and 'circuit_b' respectively. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ @overload - def move(self, dx: float, dy: float) -> DText: + def equivalent_pins(self, circuit_b: Circuit, pin_ids: Sequence[int]) -> None: r""" - @brief Moves the text by a certain distance (modifies self) - - - Moves the text by a given distance in x and y direction and returns the moved - text. Does not check for coordinate overflows. - - @param dx The x distance to move the text. - @param dy The y distance to move the text. - - @return A reference to this text object - - This method was introduced in version 0.23. + @brief Marks several pins of the given circuit as equivalent (i.e. they can be swapped). + Only circuits from the second input can be given swappable pins. This will imply the same swappable pins on the equivalent circuit of the first input. This version is a generic variant of the two-pin version of this method. """ @overload - def moved(self, distance: DVector) -> DText: + def equivalent_pins(self, circuit_b: Circuit, pin_id1: int, pin_id2: int) -> None: r""" - @brief Returns the text moved by a certain distance (does not modify self) + @brief Marks two pins of the given circuit as equivalent (i.e. they can be swapped). + Only circuits from the second input can be given swappable pins. This will imply the same swappable pins on the equivalent circuit of the first input. To mark multiple pins as swappable, use the version that takes a list of pins. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def join_symmetric_nets(self, circuit: Circuit) -> None: + r""" + @brief Joins symmetric nodes in the given circuit. + Nodes are symmetrical if swapping them would not modify the circuit. + Hence they will carry the same potential and can be connected (joined). + This will simplify the circuit and can be applied before device combination + to render a schematic-equivalent netlist in some cases (split gate option). - Moves the text by a given offset and returns the moved - text. Does not modify *this. Does not check for coordinate - overflows. + This algorithm will apply the comparer's settings to the symmetry + condition (device filtering, device compare tolerances, device class + equivalence etc.). - @param p The offset to move the text. - - @return The moved text. + This method has been introduced in version 0.26.4. + """ + def same_circuits(self, circuit_a: Circuit, circuit_b: Circuit) -> None: + r""" + @brief Marks two circuits as identical. + This method makes a circuit circuit_a in netlist a identical to the corresponding + circuit circuit_b in netlist b (see \compare). By default circuits with the same name are identical. + """ + def same_device_classes(self, dev_cls_a: DeviceClass, dev_cls_b: DeviceClass) -> None: + r""" + @brief Marks two device classes as identical. + This makes a device class dev_cls_a in netlist a identical to the corresponding + device class dev_cls_b in netlist b (see \compare). + By default device classes with the same name are identical. """ @overload - def moved(self, dx: float, dy: float) -> DText: + def same_nets(self, net_a: Net, net_b: Net, must_match: Optional[bool] = ...) -> None: r""" - @brief Returns the text moved by a certain distance (does not modify self) + @brief Marks two nets as identical. + This makes a net net_a in netlist a identical to the corresponding + net net_b in netlist b (see \compare). + Otherwise, the algorithm will try to identify nets according to their topology. This method can be used to supply hints to the compare algorithm. It will use these hints to derive further identities. + If 'must_match' is true, the nets are required to match. If they don't, an error is reported. - Moves the text by a given offset and returns the moved - text. Does not modify *this. Does not check for coordinate - overflows. - - @param dx The x distance to move the text. - @param dy The y distance to move the text. - - @return The moved text. - - This method was introduced in version 0.23. - """ - def to_itype(self, dbu: Optional[float] = ...) -> Text: - r""" - @brief Converts the text to an integer coordinate text - - The database unit can be specified to translate the floating-point coordinate Text in micron units to an integer-coordinate text in database units. The text's coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief Convert to a string + The 'must_match' optional argument has been added in version 0.27.3. """ @overload - def transformed(self, t: DCplxTrans) -> DText: + def same_nets(self, circuit_a: Circuit, circuit_b: Circuit, net_a: Net, net_b: Net, must_match: Optional[bool] = ...) -> None: r""" - @brief Transform the text with the given complex transformation + @brief Marks two nets as identical. + This makes a net net_a in netlist a identical to the corresponding + net net_b in netlist b (see \compare). + Otherwise, the algorithm will try to identify nets according to their topology. This method can be used to supply hints to the compare algorithm. It will use these hints to derive further identities. + If 'must_match' is true, the nets are required to match. If they don't, an error is reported. - @param t The magnifying transformation to apply - @return The transformed text (a DText now) + This variant allows specifying nil for the nets indicating the nets are mismatched by definition. with 'must_match' this will render a net mismatch error. + + This variant has been added in version 0.27.3. + """ + def unmatched_circuits_a(self, a: Netlist, b: Netlist) -> List[Circuit]: + r""" + @brief Returns a list of circuits in A for which there is not corresponding circuit in B + This list can be used to flatten these circuits so they do not participate in the compare process. + """ + def unmatched_circuits_b(self, a: Netlist, b: Netlist) -> List[Circuit]: + r""" + @brief Returns a list of circuits in B for which there is not corresponding circuit in A + This list can be used to flatten these circuits so they do not participate in the compare process. + """ + +class NetlistCrossReference(NetlistCompareLogger): + r""" + @brief Represents the identity mapping between the objects of two netlists. + + The NetlistCrossReference object is a container for the results of a netlist comparison. It implemented the \NetlistCompareLogger interface, hence can be used as output for a netlist compare operation (\NetlistComparer#compare). It's purpose is to store the results of the compare. It is used in this sense inside the \LayoutVsSchematic framework. + + The basic idea of the cross reference object is pairing: the netlist comparer will try to identify matching items and store them as pairs inside the cross reference object. If no match is found, a single-sided pair is generated: one item is nil in this case. + Beside the items, a status is kept which gives more details about success or failure of the match operation. + + Item pairing happens on different levels, reflecting the hierarchy of the netlists. On the top level there are circuits. Inside circuits nets, devices, subcircuits and pins are paired. Nets further contribute their connected items through terminals (for devices), pins (outgoing) and subcircuit pins. + + This class has been introduced in version 0.26. + """ + class NetPairData: + r""" + @brief A net match entry. + This object is used to describe the relationship of two nets in a netlist match. + + Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. + This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. + """ + def first(self) -> Net: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> Net: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + def status(self) -> NetlistCrossReference.Status: + r""" + @brief Gets the status of the relation. + This enum described the match status of the relation pair. + """ + class DevicePairData: + r""" + @brief A device match entry. + This object is used to describe the relationship of two devices in a netlist match. + + Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. + This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. + """ + def first(self) -> Device: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> Device: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + def status(self) -> NetlistCrossReference.Status: + r""" + @brief Gets the status of the relation. + This enum described the match status of the relation pair. + """ + class PinPairData: + r""" + @brief A pin match entry. + This object is used to describe the relationship of two circuit pins in a netlist match. + + Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. + This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. + """ + def first(self) -> Pin: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> Pin: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + def status(self) -> NetlistCrossReference.Status: + r""" + @brief Gets the status of the relation. + This enum described the match status of the relation pair. + """ + class SubCircuitPairData: + r""" + @brief A subcircuit match entry. + This object is used to describe the relationship of two subcircuits in a netlist match. + + Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. + This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. + """ + def first(self) -> SubCircuit: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> SubCircuit: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + def status(self) -> NetlistCrossReference.Status: + r""" + @brief Gets the status of the relation. + This enum described the match status of the relation pair. + """ + class CircuitPairData: + r""" + @brief A circuit match entry. + This object is used to describe the relationship of two circuits in a netlist match. + + Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. + This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. + """ + def first(self) -> Circuit: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> Circuit: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + def status(self) -> NetlistCrossReference.Status: + r""" + @brief Gets the status of the relation. + This enum described the match status of the relation pair. + """ + class NetTerminalRefPair: + r""" + @brief A match entry for a net terminal pair. + This object is used to describe the matching terminal pairs or non-matching terminals on a net. + + Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found. + """ + def first(self) -> NetTerminalRef: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> NetTerminalRef: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + class NetPinRefPair: + r""" + @brief A match entry for a net pin pair. + This object is used to describe the matching pin pairs or non-matching pins on a net. + + Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found. + """ + def first(self) -> NetPinRef: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> NetPinRef: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + class NetSubcircuitPinRefPair: + r""" + @brief A match entry for a net subcircuit pin pair. + This object is used to describe the matching subcircuit pin pairs or non-matching subcircuit pins on a net. + + Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found. + """ + def first(self) -> NetSubcircuitPinRef: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> NetSubcircuitPinRef: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + class Status: + r""" + @brief This class represents the NetlistCrossReference::Status enum + """ + Match: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::Match + An exact match exists if this code is present. + """ + MatchWithWarning: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::MatchWithWarning + If this code is present, a match was found but a warning is issued. For nets, this means that the choice is ambiguous and one, unspecific candidate has been chosen. For devices, this means a device match was established, but parameters or the device class are not matching exactly. + """ + Mismatch: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::Mismatch + This code means there is a match candidate, but exact identity could not be confirmed. + """ + NoMatch: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::NoMatch + If this code is present, no match could be found. + There is also 'Mismatch' which means there is a candidate, but exact identity could not be confirmed. + """ + None_: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::None + No specific status is implied if this code is present. + """ + Skipped: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::Skipped + On circuits this code means that a match has not been attempted because subcircuits of this circuits were not matched. As circuit matching happens bottom-up, all subcircuits must match at least with respect to their pins to allow any parent circuit to be matched. + """ + @overload + @classmethod + def new(cls, i: int) -> NetlistCrossReference.Status: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> NetlistCrossReference.Status: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __lt__(self, other: NetlistCrossReference.Status) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + Match: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::Match + An exact match exists if this code is present. + """ + MatchWithWarning: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::MatchWithWarning + If this code is present, a match was found but a warning is issued. For nets, this means that the choice is ambiguous and one, unspecific candidate has been chosen. For devices, this means a device match was established, but parameters or the device class are not matching exactly. + """ + Mismatch: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::Mismatch + This code means there is a match candidate, but exact identity could not be confirmed. + """ + NoMatch: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::NoMatch + If this code is present, no match could be found. + There is also 'Mismatch' which means there is a candidate, but exact identity could not be confirmed. + """ + None_: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::None + No specific status is implied if this code is present. + """ + Skipped: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::Skipped + On circuits this code means that a match has not been attempted because subcircuits of this circuits were not matched. As circuit matching happens bottom-up, all subcircuits must match at least with respect to their pins to allow any parent circuit to be matched. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def circuit_count(self) -> int: + r""" + @brief Gets the number of circuit pairs in the cross-reference object. + """ + def clear(self) -> None: + r""" + @hide + """ + def each_circuit_pair(self) -> Iterator[NetlistCrossReference.CircuitPairData]: + r""" + @brief Delivers the circuit pairs and their status. + See the class description for details. + """ + def each_device_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.DevicePairData]: + r""" + @brief Delivers the device pairs and their status for the given circuit pair. + See the class description for details. + """ + def each_net_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.NetPairData]: + r""" + @brief Delivers the net pairs and their status for the given circuit pair. + See the class description for details. + """ + def each_net_pin_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetPinRefPair]: + r""" + @brief Delivers the pin pairs for the given net pair. + For the net pair, lists the pin pairs identified on this net. + """ + def each_net_subcircuit_pin_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetSubcircuitPinRefPair]: + r""" + @brief Delivers the subcircuit pin pairs for the given net pair. + For the net pair, lists the subcircuit pin pairs identified on this net. + """ + def each_net_terminal_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetTerminalRefPair]: + r""" + @brief Delivers the device terminal pairs for the given net pair. + For the net pair, lists the device terminal pairs identified on this net. + """ + def each_pin_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.PinPairData]: + r""" + @brief Delivers the pin pairs and their status for the given circuit pair. + See the class description for details. + """ + def each_subcircuit_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.SubCircuitPairData]: + r""" + @brief Delivers the subcircuit pairs and their status for the given circuit pair. + See the class description for details. + """ + def netlist_a(self) -> Netlist: + r""" + @brief Gets the first netlist which participated in the compare. + This member may be nil, if the respective netlist is no longer valid. In this case, the netlist cross-reference object cannot be used. + """ + def netlist_b(self) -> Netlist: + r""" + @brief Gets the second netlist which participated in the compare. + This member may be nil, if the respective netlist is no longer valid.In this case, the netlist cross-reference object cannot be used. + """ + def other_circuit_for(self, circuit: Circuit) -> Circuit: + r""" + @brief Gets the matching other circuit for a given primary circuit. + The return value will be nil if no match is found. Otherwise it is the 'b' circuit for circuits from the 'a' netlist and vice versa. + + This method has been introduced in version 0.27. + """ + def other_device_for(self, device: Device) -> Device: + r""" + @brief Gets the matching other device for a given primary device. + The return value will be nil if no match is found. Otherwise it is the 'b' device for devices from the 'a' netlist and vice versa. + + This method has been introduced in version 0.27. + """ + def other_net_for(self, net: Net) -> Net: + r""" + @brief Gets the matching other net for a given primary net. + The return value will be nil if no match is found. Otherwise it is the 'b' net for nets from the 'a' netlist and vice versa. + """ + def other_pin_for(self, pin: Pin) -> Pin: + r""" + @brief Gets the matching other pin for a given primary pin. + The return value will be nil if no match is found. Otherwise it is the 'b' pin for pins from the 'a' netlist and vice versa. + + This method has been introduced in version 0.27. + """ + def other_subcircuit_for(self, subcircuit: SubCircuit) -> SubCircuit: + r""" + @brief Gets the matching other subcircuit for a given primary subcircuit. + The return value will be nil if no match is found. Otherwise it is the 'b' subcircuit for subcircuits from the 'a' netlist and vice versa. + + This method has been introduced in version 0.27. + """ + +class LayoutVsSchematic(LayoutToNetlist): + r""" + @brief A generic framework for doing LVS (layout vs. schematic) + + This class extends the concept of the netlist extraction from a layout to LVS verification. It does so by adding these concepts to the \LayoutToNetlist class: + + @ul + @li A reference netlist. This will be the netlist against which the layout-derived netlist is compared against. See \reference and \reference=. + @/li + @li A compare step. During the compare the layout-derived netlist and the reference netlists are compared. The compare results are captured in the cross-reference object. See \compare and \NetlistComparer for the comparer object. + @/li + @li A cross-reference. This object (of class \NetlistCrossReference) will keep the relations between the objects of the two netlists. It also lists the differences between the netlists. See \xref about how to access this object.@/li + @/ul + + The LVS object can be persisted to and from a file in a specific format, so it is sometimes referred to as the "LVS database". + + LVS objects can be attached to layout views with \LayoutView#add_lvsdb so they become available in the netlist database browser. + + This class has been introduced in version 0.26. + """ + reference: Netlist + r""" + Getter: + @brief Gets the reference netlist. + + Setter: + @brief Sets the reference netlist. + This will set the reference netlist used inside \compare as the second netlist to compare against the layout-extracted netlist. + + The LVS object will take ownership over the netlist - i.e. if it goes out of scope, the reference netlist is deleted. + """ + @overload + @classmethod + def new(cls) -> LayoutVsSchematic: + r""" + @brief Creates a new LVS object + The main objective for this constructor is to create an object suitable for reading and writing LVS database files. """ @overload - def transformed(self, t: DTrans) -> DText: + @classmethod + def new(cls, dss: DeepShapeStore) -> LayoutVsSchematic: r""" - @brief Transform the text with the given simple transformation - - - @param t The transformation to apply - @return The transformed text + @brief Creates a new LVS object with the extractor object reusing an existing \DeepShapeStore object + See the corresponding constructor of the \LayoutToNetlist object for more details. """ @overload - def transformed(self, t: VCplxTrans) -> Text: + @classmethod + def new(cls, iter: RecursiveShapeIterator) -> LayoutVsSchematic: r""" - @brief Transforms the text with the given complex transformation + @brief Creates a new LVS object with the extractor connected to an original layout + This constructor will attach the extractor of the LVS object to an original layout through the shape iterator. + """ + @overload + @classmethod + def new(cls, dss: DeepShapeStore, layout_index: int) -> LayoutVsSchematic: + r""" + @brief Creates a new LVS object with the extractor object reusing an existing \DeepShapeStore object + See the corresponding constructor of the \LayoutToNetlist object for more details. + """ + @overload + @classmethod + def new(cls, topcell_name: str, dbu: float) -> LayoutVsSchematic: + r""" + @brief Creates a new LVS object with the extractor object taking a flat DSS + See the corresponding constructor of the \LayoutToNetlist object for more details. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a new LVS object + The main objective for this constructor is to create an object suitable for reading and writing LVS database files. + """ + @overload + def __init__(self, dss: DeepShapeStore) -> None: + r""" + @brief Creates a new LVS object with the extractor object reusing an existing \DeepShapeStore object + See the corresponding constructor of the \LayoutToNetlist object for more details. + """ + @overload + def __init__(self, iter: RecursiveShapeIterator) -> None: + r""" + @brief Creates a new LVS object with the extractor connected to an original layout + This constructor will attach the extractor of the LVS object to an original layout through the shape iterator. + """ + @overload + def __init__(self, dss: DeepShapeStore, layout_index: int) -> None: + r""" + @brief Creates a new LVS object with the extractor object reusing an existing \DeepShapeStore object + See the corresponding constructor of the \LayoutToNetlist object for more details. + """ + @overload + def __init__(self, topcell_name: str, dbu: float) -> None: + r""" + @brief Creates a new LVS object with the extractor object taking a flat DSS + See the corresponding constructor of the \LayoutToNetlist object for more details. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - @param t The magnifying transformation to apply - @return The transformed text (in this case an integer coordinate text) - - This method has been introduced in version 0.25. + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def compare(self, comparer: NetlistComparer) -> bool: + r""" + @brief Compare the layout-extracted netlist against the reference netlist using the given netlist comparer. + """ + def read(self, path: str) -> None: + r""" + @brief Reads the LVS object from the file. + This method employs the native format of KLayout. + """ + def read_l2n(self, path: str) -> None: + r""" + @brief Reads the \LayoutToNetlist part of the object from a file. + This method employs the native format of KLayout. + """ + def write(self, path: str, short_format: Optional[bool] = ...) -> None: + r""" + @brief Writes the LVS object to a file. + This method employs the native format of KLayout. + """ + def write_l2n(self, path: str, short_format: Optional[bool] = ...) -> None: + r""" + @brief Writes the \LayoutToNetlist part of the object to a file. + This method employs the native format of KLayout. + """ + def xref(self) -> NetlistCrossReference: + r""" + @brief Gets the cross-reference object + The cross-reference object is created while comparing the layout-extracted netlist against the reference netlist - i.e. during \compare. Before \compare is called, this object is nil. + It holds the results of the comparison - a cross-reference between the nets and other objects in the match case and a listing of non-matching nets and other objects for the non-matching cases. + See \NetlistCrossReference for more details. """ class Texts(ShapeCollection): @@ -32892,6 +48290,111 @@ class Texts(ShapeCollection): This class has been introduced in version 0.27. """ + @overload + @classmethod + def new(cls) -> Texts: + r""" + @brief Default constructor + + This constructor creates an empty text collection. + """ + @overload + @classmethod + def new(cls, array: Sequence[Text]) -> Texts: + r""" + @brief Constructor from an text array + + This constructor creates an text collection from an array of \Text objects. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator) -> Texts: + r""" + @brief Constructor from a hierarchical shape set + + This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. + Only texts are taken from the shape set and other shapes are ignored. + This method allows feeding the text collection from a hierarchy of cells. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::Texts::new(layout.begin_shapes(cell, layer)) + @/code + """ + @overload + @classmethod + def new(cls, shapes: Shapes) -> Texts: + r""" + @brief Shapes constructor + + This constructor creates an text collection from a \Shapes collection. + """ + @overload + @classmethod + def new(cls, text: Text) -> Texts: + r""" + @brief Constructor from a single edge pair object + + This constructor creates an text collection with a single text. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore) -> Texts: + r""" + @brief Creates a hierarchical text collection from an original layer + + This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. + This version will create a hierarchical text collection which supports hierarchical operations. + + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::Texts::new(layout.begin_shapes(cell, layer)) + @/code + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> Texts: + r""" + @brief Constructor from a hierarchical shape set with a transformation + + This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. + Only texts are taken from the shape set and other shapes are ignored. + The given transformation is applied to each text taken. + This method allows feeding the text collection from a hierarchy of cells. + The transformation is useful to scale to a specific database unit for example. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Texts::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans) -> Texts: + r""" + @brief Creates a hierarchical text collection from an original layer with a transformation + + This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. + This version will create a hierarchical text collection which supports hierarchical operations. + The transformation is useful to scale to a specific database unit for example. + + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Texts::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + """ def __add__(self, other: Texts) -> Texts: r""" @brief Returns the combined text collection of self and the other one @@ -32902,7 +48405,6 @@ class Texts(ShapeCollection): """ def __and__(self, other: Region) -> Texts: r""" - Note: This is an alias of 'interacting'. @brief Returns the texts from this text collection which are inside or on the edge of polygons from the given region @return A new text collection containing the texts inside or on the edge of polygons from the region @@ -33028,10 +48530,13 @@ class Texts(ShapeCollection): r""" @brief Returns each text of the text collection """ - def __repr__(self) -> str: + def __len__(self) -> int: r""" - @brief Converts the text collection to a string - The length of the output is limited to 20 texts to avoid giant strings on large collections. For full output use "to_s" with a maximum count parameter. + @brief Returns the (flat) number of texts in the text collection + + The count is computed 'as if flat', i.e. texts inside a cell are multiplied by the number of times a cell is instantiated. + + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. """ def __str__(self) -> str: r""" @@ -33040,7 +48545,6 @@ class Texts(ShapeCollection): """ def __sub__(self, other: Region) -> Texts: r""" - Note: This is an alias of 'not_interacting'. @brief Returns the texts from this text collection which are not inside or on the edge of polygons from the given region @return A new text collection containing the texts not inside or on the edge of polygons from the region @@ -33103,10 +48607,27 @@ class Texts(ShapeCollection): Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def data_id(self) -> int: r""" @brief Returns the data ID (a unique identifier for the underlying data storage) """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def disable_progress(self) -> None: r""" @brief Disable progress reporting @@ -33192,6 +48713,12 @@ class Texts(ShapeCollection): @return A new text collection containing the texts inside or on the edge of polygons from the region """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_deep(self) -> bool: r""" @brief Returns true if the edge pair collection is a deep (hierarchical) one @@ -33286,6 +48813,14 @@ class Texts(ShapeCollection): In contrast to \interacting, this method will modify self. """ + def size(self) -> int: + r""" + @brief Returns the (flat) number of texts in the text collection + + The count is computed 'as if flat', i.e. texts inside a cell are multiplied by the number of times a cell is instantiated. + + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. + """ def swap(self, other: Texts) -> None: r""" @brief Swap the contents of this collection with the contents of another collection @@ -33325,6 +48860,17 @@ class Texts(ShapeCollection): @param t The transformation to apply. + @return The transformed text collection. + """ + def transform_icplx(self, t: ICplxTrans) -> Texts: + r""" + @brief Transform the text collection with a complex transformation (modifies self) + + Transforms the text collection with the given transformation. + This version modifies the text collection and returns a reference to self. + + @param t The transformation to apply. + @return The transformed text collection. """ @overload @@ -33349,6 +48895,17 @@ class Texts(ShapeCollection): @param t The transformation to apply. + @return The transformed texts. + """ + def transformed_icplx(self, t: ICplxTrans) -> Texts: + r""" + @brief Transform the text collection with a complex transformation + + Transforms the text with the given complex transformation. + Does not modify the text collection but returns the transformed texts. + + @param t The transformation to apply. + @return The transformed texts. """ def with_match(self, pattern: str, inverse: bool) -> Texts: @@ -33365,4769 +48922,16 @@ class Texts(ShapeCollection): If "inverse" is true, this method returns the texts not having the given string. """ -class TileOutputReceiverBase: +class ShapeCollection: r""" - @hide - @alias TileOutputReceiver - """ - def __copy__(self) -> TileOutputReceiverBase: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: TileOutputReceiverBase) -> None: - r""" - @brief Assigns another object to self - """ - def dup(self) -> TileOutputReceiverBase: - r""" - @brief Creates a copy of self - """ - def processor(self) -> TilingProcessor: - r""" - @brief Gets the processor the receiver is attached to - - This attribute is set before begin and can be nil if the receiver is not attached to a processor. - - This method has been introduced in version 0.25. - """ - -class TileOutputReceiver(TileOutputReceiverBase): - r""" - @brief A receiver abstraction for the tiling processor. - - The tiling processor (\TilingProcessor) is a framework for executing sequences of operations on tiles of a layout or multiple layouts. The \TileOutputReceiver class is used to specify an output channel for the tiling processor. See \TilingProcessor#output for more details. - - This class has been introduced in version 0.23. - """ - def _assign(self, other: TileOutputReceiverBase) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _dup(self) -> TileOutputReceiver: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def begin(self, nx: int, ny: int, p0: DPoint, dx: float, dy: float, frame: DBox) -> None: - r""" - @brief Initiates the delivery - This method is called before the first tile delivers it's data. - - @param nx The number of tiles in x direction - @param ny The number of tiles in y direction - @param p0 The initial point - @param dx The tile's x dimension - @param dy The tile's y dimension - @param frame The overall frame that is the basis of the tiling - The tile's coordinates will be p0+(ix*dx,iy*dy)..p0+((ix+1)*dx,(iy+1)*dy) - where ix=0..nx-1, iy=0..ny-1. - - All coordinates are given in micron. If tiles are not used, nx and ny are 0. - - The frame parameter has been added in version 0.25. - """ - def finish(self, success: bool) -> None: - r""" - @brief Indicates the end of the execution - - This method is called when the tiling processor has finished the last tile and script item. - The success flag is set to true, if every tile has finished successfully. Otherwise, this value is false. - - The success flag has been added in version 0.25. - """ - def put(self, ix: int, iy: int, tile: Box, obj: Any, dbu: float, clip: bool) -> None: - r""" - @brief Delivers data for one tile - - When the script's "_output" function is called, the data will be delivered through this - method. "obj" is the data passed as the second argument to _output. - The interpretation of the object remains subject to the implementation. - - The obj and clip parameters are taken from the _output method call inside the script. - If clip is set to true, this usually means that output shall be clipped to the tile. - - @param ix The x index of the tile - @param iy The y index of the tile - @param tile The tile's box - @param obj The object which is delivered - @param dbu The database unit - @param clip True if clipping at the tile box is requested - """ - -class TilingProcessor: - r""" - @brief A processor for layout which distributes tasks over tiles - - The tiling processor executes one or several scripts on one or multiple layouts providing a tiling scheme. In that scheme, the processor divides the original layout into rectangular tiles and executes the scripts on each tile separately. The tiling processor allows one to specify multiple, independent scripts which are run separately on each tile. It can make use of multi-core CPU's by supporting multiple threads running the tasks in parallel (with respect to tiles and scripts). - - Tiling a optional - if no tiles are specified, the tiling processing basically operates flat and parallelization extends to the scripts only. - - Tiles can be overlapping to gather input from neighboring tiles into the current tile. In order to provide that feature, a border can be specified which gives the amount by which the search region is extended beyond the border of the tile. To specify the border, use the \TilingProcessor#tile_border method. - - The basis of the tiling processor are \Region objects and expressions. Expressions are a built-in simple language to form simple scripts. Expressions allow access to the objects and methods built into KLayout. Each script can consist of multiple operations. Scripts are specified using \TilingProcessor#queue. - - Input is provided to the script through variables holding a \Region object each. From outside the tiling processor, input is specified with the \TilingProcessor#input method. This method is given a name and a \RecursiveShapeIterator object which delivers the data for the input. On the script side, a \Region object is provided through a variable named like the first argument of the "input" method. - - Inside the script the following functions are provided: - - @ul - @li"_dbu" delivers the database unit used for the computations @/li - @li"_tile" delivers a region containing a mask for the tile (a rectangle) or nil if no tiling is used @/li - @li"_output" is used to deliver output (see below) @/li - @/ul - - Output can be obtained from the tiling processor by registering a receiver with a channel. A channel is basically a name. Inside the script, the name describes a variable which can be used as the first argument of the "_output" function to identify the channel. A channel is registers using the \TilingProcessor#output method. Beside the name, a receiver must be specified. A receiver is either another layout (a cell of that), a report database or a custom receiver implemented through the \TileOutputReceiver class. - - The "_output" function expects two or three parameters: one channel id (the variable that was defined by the name given in the output method call) and an object to output (a \Region, \Edges, \EdgePairs or a geometrical primitive such as \Polygon or \Box). In addition, a boolean argument can be given indicating whether clipping at the tile shall be applied. If clipping is requested (the default), the shapes will be clipped at the tile's box. - - The tiling can be specified either through a tile size, a tile number or both. If a tile size is specified with the \TilingProcessor#tile_size method, the tiling processor will compute the number of tiles required. If the tile count is given (through \TilingProcessor#tiles), the tile size will be computed. If both are given, the tiling array is fixed and the array is centered around the original layout's center. If the tiling origin is given as well, the tiling processor will use the given array without any modifications. - - Once the tiling processor has been set up, the operation can be launched using \TilingProcessor#execute. - - This is some sample code. It performs two XOR operations between two layouts and delivers the results to a report database: - - @code - ly1 = ... # first layout - ly2 = ... # second layout - - rdb = RBA::ReportDatabase::new("xor") - output_cell = rdb.create_cell(ly1.top_cell.name) - output_cat1 = rbd.create_category("XOR 1-10") - output_cat2 = rbd.create_category("XOR 2-11") - - tp = RBA::TilingProcessor::new - tp.input("a1", ly1, ly1.top_cell.cell_index, RBA::LayerInfo::new(1, 0)) - tp.input("a2", ly1, ly1.top_cell.cell_index, RBA::LayerInfo::new(2, 0)) - tp.input("b1", ly2, ly2.top_cell.cell_index, RBA::LayerInfo::new(11, 0)) - tp.input("b2", ly2, ly2.top_cell.cell_index, RBA::LayerInfo::new(12, 0)) - tp.output("o1", rdb, output_cell, output_cat1) - tp.output("o2", rdb, output_cell, output_cat2) - tp.queue("_output(o1, a1 ^ b1)") - tp.queue("_output(o2, a2 ^ b2)") - tp.tile_size(50.0, 50.0) - tp.execute("Job description") - @/code - - This class has been introduced in version 0.23. - """ - dbu: float - r""" - @brief Gets the database unit under which the computations will be done - @brief Sets the database unit under which the computations will be done - - All data used within the scripts will be brought to that database unit. If none is given it will be the database unit of the first layout given or 1nm if no layout is specified. - """ - frame: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the layout frame - - The layout frame is the box (in micron units) taken into account for computing - the tiles if the tile counts are not given. If the layout frame is not set or - set to an empty box, the processor will try to derive the frame from the given - inputs. - - This method has been introduced in version 0.25. - """ - scale_to_dbu: bool - r""" - @brief Gets a valid indicating whether automatic scaling to database unit is enabled - - This method has been introduced in version 0.23.2.@brief Enables or disabled automatic scaling to database unit - - If automatic scaling to database unit is enabled, the input is automatically scaled to the database unit set inside the tile processor. This is the default. - - This method has been introduced in version 0.23.2. - """ - threads: int - r""" - @brief Gets the number of threads to use - @brief Specifies the number of threads to use - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def execute(self, desc: str) -> None: - r""" - @brief Runs the job - - This method will initiate execution of the queued scripts, once for every tile. The desc is a text shown in the progress bar for example. - """ - @overload - def input(self, name: str, edge_pairs: EdgePairs) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from an \EdgePairs object. Edge pair collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. - - The name specifies the variable under which the input can be used in the scripts. - This variant has been introduced in version 0.27. - """ - @overload - def input(self, name: str, edges: Edges) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from an \Edges object. Edge collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. - - The name specifies the variable under which the input can be used in the scripts. - """ - @overload - def input(self, name: str, iter: RecursiveShapeIterator) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from a recursive shape iterator, hence from a hierarchy of shapes from a layout. - - The name specifies the variable under which the input can be used in the scripts. - """ - @overload - def input(self, name: str, region: Region) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from a \Region object. Regions don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. - - The name specifies the variable under which the input can be used in the scripts. - """ - @overload - def input(self, name: str, texts: Texts) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from an \Texts object. Text collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. - - The name specifies the variable under which the input can be used in the scripts. - This variant has been introduced in version 0.27. - """ - @overload - def input(self, name: str, edge_pairs: EdgePairs, trans: ICplxTrans) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from an \EdgePairs object. Edge pair collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. - - The name specifies the variable under which the input can be used in the scripts. - This variant has been introduced in version 0.27. - """ - @overload - def input(self, name: str, edges: Edges, trans: ICplxTrans) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from an \Edges object. Edge collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. - - The name specifies the variable under which the input can be used in the scripts. - This variant allows one to specify an additional transformation too. It has been introduced in version 0.23.2. - - """ - @overload - def input(self, name: str, iter: RecursiveShapeIterator, trans: ICplxTrans) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from a recursive shape iterator, hence from a hierarchy of shapes from a layout. - In addition, a transformation can be specified which will be applied to the shapes before they are used. - - The name specifies the variable under which the input can be used in the scripts. - """ - @overload - def input(self, name: str, region: Region, trans: ICplxTrans) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from a \Region object. Regions don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. - - The name specifies the variable under which the input can be used in the scripts. - This variant allows one to specify an additional transformation too. It has been introduced in version 0.23.2. - """ - @overload - def input(self, name: str, texts: Texts, trans: ICplxTrans) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from an \Texts object. Text collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. - - The name specifies the variable under which the input can be used in the scripts. - This variant has been introduced in version 0.27. - """ - @overload - def input(self, name: str, layout: Layout, cell_index: int, layer: int) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. - "layer" is the layer index of the input layer. - - The name specifies the variable under which the input can be used in the scripts. - """ - @overload - def input(self, name: str, layout: Layout, cell_index: int, lp: LayerInfo) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. - "lp" is a \LayerInfo object specifying the input layer. - - The name specifies the variable under which the input can be used in the scripts. - """ - @overload - def input(self, name: str, layout: Layout, cell_index: int, layer: int, trans: ICplxTrans) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. - "layer" is the layer index of the input layer. - In addition, a transformation can be specified which will be applied to the shapes before they are used. - - The name specifies the variable under which the input can be used in the scripts. - """ - @overload - def input(self, name: str, layout: Layout, cell_index: int, lp: LayerInfo, trans: ICplxTrans) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. - "lp" is a \LayerInfo object specifying the input layer. - In addition, a transformation can be specified which will be applied to the shapes before they are used. - - The name specifies the variable under which the input can be used in the scripts. - """ - @overload - def output(self, name: str, edge_pairs: EdgePairs) -> None: - r""" - @brief Specifies output to an \EdgePairs object - This method will establish an output channel to an \EdgePairs object. The output sent to that channel will be put into the specified edge pair collection. - Only \EdgePair objects are accepted. Other objects are discarded. - - The name is the name which must be used in the _output function of the scripts in order to address that channel. - - @param name The name of the channel - @param edge_pairs The \EdgePairs object to which the data is sent - """ - @overload - def output(self, name: str, edges: Edges) -> None: - r""" - @brief Specifies output to an \Edges object - This method will establish an output channel to an \Edges object. The output sent to that channel will be put into the specified edge collection. - 'Solid' objects such as polygons will be converted to edges by resolving their hulls into edges. Edge pairs are resolved into single edges. - - The name is the name which must be used in the _output function of the scripts in order to address that channel. - - @param name The name of the channel - @param edges The \Edges object to which the data is sent - """ - @overload - def output(self, name: str, rec: TileOutputReceiverBase) -> None: - r""" - @brief Specifies output for the tiling processor - This method will establish an output channel for the processor. For that it registers an output receiver which will receive data from the scripts. The scripts call the _output function to deliver data. - "name" will be name of the variable which must be passed to the first argument of the _output function in order to address this channel. - - Please note that the tiling processor will destroy the receiver object when it is freed itself. Hence if you need to address the receiver object later, make sure that the processor is still alive, i.e. by assigning the object to a variable. - - The following code uses the output receiver. It takes the shapes of a layer from a layout, computes the area of each tile and outputs the area to the custom receiver: - - @code - layout = ... # the layout - cell = ... # the top cell's index - layout = ... # the input layer - - class MyReceiver < RBA::TileOutputReceiver - def put(ix, iy, tile, obj, dbu, clip) - puts "got area for tile #{ix+1},#{iy+1}: #{obj.to_s}" - end - end - - tp = RBA::TilingProcessor::new - - # register the custom receiver - tp.output("my_receiver", MyReceiver::new) - tp.input("the_input", layout.begin_shapes(cell, layer)) - tp.tile_size(100, 100) # 100x100 um tile size - # The script clips the input at the tile and computes the (merged) area: - tp.queue("_output(my_receiver, (the_input & _tile).area)") - tp.execute("Job description") - @/code - """ - @overload - def output(self, name: str, region: Region) -> None: - r""" - @brief Specifies output to a \Region object - This method will establish an output channel to a \Region object. The output sent to that channel will be put into the specified region. - - The name is the name which must be used in the _output function of the scripts in order to address that channel. - Edges sent to this channel are discarded. Edge pairs are converted to polygons. - - @param name The name of the channel - @param region The \Region object to which the data is sent - """ - @overload - def output(self, name: str, sum: float) -> None: - r""" - @brief Specifies output to single value - This method will establish an output channel which sums up float data delivered by calling the _output function. - In order to specify the target for the data, a \Value object must be provided for the "sum" parameter. - - The name is the name which must be used in the _output function of the scripts in order to address that channel. - """ - @overload - def output(self, name: str, texts: Texts) -> None: - r""" - @brief Specifies output to an \Texts object - This method will establish an output channel to an \Texts object. The output sent to that channel will be put into the specified edge pair collection. - Only \Text objects are accepted. Other objects are discarded. - - The name is the name which must be used in the _output function of the scripts in order to address that channel. - - @param name The name of the channel - @param texts The \Texts object to which the data is sent - - This variant has been introduced in version 0.27. - """ - @overload - def output(self, name: str, layout: Layout, cell: int, layer_index: int) -> None: - r""" - @brief Specifies output to a layout layer - This method will establish an output channel to a layer in a layout. The output sent to that channel will be put into the specified layer and cell. In this version, the layer is specified through a layer index, hence it must be created before. - - The name is the name which must be used in the _output function of the scripts in order to address that channel. - - @param name The name of the channel - @param layout The layout to which the data is sent - @param cell The index of the cell to which the data is sent - @param layer_index The layer index where the output will be sent to - """ - @overload - def output(self, name: str, layout: Layout, cell: int, lp: LayerInfo) -> None: - r""" - @brief Specifies output to a layout layer - This method will establish an output channel to a layer in a layout. The output sent to that channel will be put into the specified layer and cell. In this version, the layer is specified through a \LayerInfo object, i.e. layer and datatype number. If no such layer exists, it will be created. - - The name is the name which must be used in the _output function of the scripts in order to address that channel. - - @param name The name of the channel - @param layout The layout to which the data is sent - @param cell The index of the cell to which the data is sent - @param lp The layer specification where the output will be sent to - """ - @overload - def output(self, name: str, rdb: rdb.ReportDatabase, cell_id: int, category_id: int) -> None: - r""" - @brief Specifies output to a report database - This method will establish an output channel for the processor. The output sent to that channel will be put into the report database given by the "rdb" parameter. "cell_id" specifies the cell and "category_id" the category to use. - - The name is the name which must be used in the _output function of the scripts in order to address that channel. - """ - def queue(self, script: str) -> None: - r""" - @brief Queues a script for parallel execution - - With this method, scripts are registered that are executed in parallel on each tile. - The scripts have "Expressions" syntax and can make use of several predefined variables and functions. - See the \TilingProcessor class description for details. - """ - def tile_border(self, bx: float, by: float) -> None: - r""" - @brief Sets the tile border - - Specifies the tile border. The border is a margin that is considered when fetching shapes. By specifying a border you can fetch shapes into the tile's data which are outside the tile but still must be considered in the computations (i.e. because they might grow into the tile). - - The tile border is given in micron. - """ - def tile_origin(self, xo: float, yo: float) -> None: - r""" - @brief Sets the tile origin - - Specifies the origin (lower left corner) of the tile field. If no origin is specified, the tiles are centered to the layout's bounding box. Giving the origin together with the tile count and dimensions gives full control over the tile array. - - The tile origin is given in micron. - """ - def tile_size(self, w: float, h: float) -> None: - r""" - @brief Sets the tile size - - Specifies the size of the tiles to be used. If no tile size is specified, tiling won't be used and all computations will be done on the whole layout. - - The tile size is given in micron. - """ - def tiles(self, nw: int, nh: int) -> None: - r""" - @brief Sets the tile count - - Specifies the number of tiles to be used. If no tile number is specified, the number of tiles required is computed from the layout's dimensions and the tile size. If a number is given, but no tile size, the tile size will be computed from the layout's dimensions. - """ - def var(self, name: str, value: Any) -> None: - r""" - @brief Defines a variable for the tiling processor script - - The name specifies the variable under which the value can be used in the scripts. - """ - -class Trans: - r""" - @brief A simple transformation - - Simple transformations only provide rotations about angles which a multiples of 90 degree. - Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). - These can be combined with a displacement which is applied after the rotation/mirror. - This version acts on integer coordinates. A version for floating-point coordinates is \DTrans. - - Here are some examples for using the Trans class: - - @code - t = RBA::Trans::new(0, 100) # displacement by 100 DBU in y direction - # the inverse: -> "r0 0,-100" - t.inverted.to_s - # concatenation: -> "r90 -100,0" - (RBA::Trans::R90 * t).to_s - # apply to a point: -> "0,100" - RBA::Trans::R90.trans(RBA::Point::new(100, 0)) - @/code - - See @The Database API@ for more details about the database objects. - """ - M0: ClassVar[Trans] - r""" - @brief A constant giving "mirrored at the x-axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M135: ClassVar[Trans] - r""" - @brief A constant giving "mirrored at the 135 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M45: ClassVar[Trans] - r""" - @brief A constant giving "mirrored at the 45 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M90: ClassVar[Trans] - r""" - @brief A constant giving "mirrored at the y (90 degree) axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R0: ClassVar[Trans] - r""" - @brief A constant giving "unrotated" (unit) transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R180: ClassVar[Trans] - r""" - @brief A constant giving "rotated by 180 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R270: ClassVar[Trans] - r""" - @brief A constant giving "rotated by 270 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R90: ClassVar[Trans] - r""" - @brief A constant giving "rotated by 90 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - angle: int - r""" - @brief Gets the angle in units of 90 degree - - This value delivers the rotation component. In addition, a mirroring at the x axis may be applied before if the \is_mirror? property is true. @brief Sets the angle in units of 90 degree - @param a The new angle - - This method was introduced in version 0.20. - """ - disp: Vector - r""" - @brief Gets to the displacement vector - - Staring with version 0.25 the displacement type is a vector.@brief Sets the displacement - @param u The new displacement - - This method was introduced in version 0.20. - Staring with version 0.25 the displacement type is a vector. - """ - mirror: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the mirror flag - "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag - - This method was introduced in version 0.20. - """ - rot: int - r""" - @brief Gets the angle/mirror code - - The angle/mirror code is one of the constants R0, R90, R180, R270, M0, M45, M90 and M135. rx is the rotation by an angle of x counter clockwise. mx is the mirroring at the axis given by the angle x (to the x-axis). @brief Sets the angle/mirror code - @param r The new angle/rotation code (see \rot property) - - This method was introduced in version 0.20. - """ - @classmethod - def from_s(cls, s: str) -> Trans: - r""" - @brief Creates a transformation from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - def __copy__(self) -> Trans: - r""" - @brief Creates a copy of self - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Tests for equality - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a unit transformation - """ - @overload - def __init__(self, dtrans: DTrans) -> None: - r""" - @brief Creates an integer coordinate transformation from a floating-point coordinate transformation - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. - """ - @overload - def __init__(self, u: Vector) -> None: - r""" - @brief Creates a transformation using a displacement only - - @param u The displacement - """ - @overload - def __init__(self, c: Trans, u: Optional[Vector] = ...) -> None: - r""" - @brief Creates a transformation from another transformation plus a displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - def __init__(self, x: int, y: int) -> None: - r""" - @brief Creates a transformation using a displacement given as two coordinates - - @param x The horizontal displacement - @param y The vertical displacement - """ - @overload - def __init__(self, c: Trans, x: int, y: int) -> None: - r""" - @brief Creates a transformation from another transformation plus a displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - def __init__(self, rot: int, mirr: Optional[bool] = ..., u: Optional[Vector] = ...) -> None: - r""" - @brief Creates a transformation using angle and mirror flag - - The sequence of operations is: mirroring at x axis, - rotation, application of displacement. - - @param rot The rotation in units of 90 degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - def __init__(self, rot: int, mirr: bool, x: int, y: int) -> None: - r""" - @brief Creates a transformation using angle and mirror flag and two coordinate values for displacement - - The sequence of operations is: mirroring at x axis, - rotation, application of displacement. - - @param rot The rotation in units of 90 degree - @param mirrx True, if mirrored at x axis - @param x The horizontal displacement - @param y The vertical displacement - """ - def __lt__(self, other: Trans) -> bool: - r""" - @brief Provides a 'less' criterion for sorting - This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. - """ - @overload - def __mul__(self, box: Box) -> Box: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, edge: Edge) -> Edge: - r""" - Note: This is an alias of 'trans'. - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, p: Point) -> Point: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __mul__(self, path: Path) -> Path: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, polygon: Polygon) -> Polygon: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, t: Trans) -> Trans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, text: Text) -> Text: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, v: Vector) -> Vector: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Tests for inequality - """ - def __repr__(self) -> str: - r""" - @brief String conversion - """ - @overload - def __rmul__(self, box: Box) -> Box: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, edge: Edge) -> Edge: - r""" - Note: This is an alias of 'trans'. - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, p: Point) -> Point: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __rmul__(self, path: Path) -> Path: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, polygon: Polygon) -> Polygon: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, t: Trans) -> Trans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __rmul__(self, text: Text) -> Text: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, v: Vector) -> Vector: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - def __str__(self) -> str: - r""" - @brief String conversion - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: Trans) -> None: - r""" - @brief Assigns another object to self - """ - def ctrans(self, d: int) -> int: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - """ - def dup(self) -> Trans: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - def invert(self) -> Trans: - r""" - @brief Inverts the transformation (in place) - - Inverts the transformation and replaces this object by the - inverted one. - - @return The inverted transformation - """ - def inverted(self) -> Trans: - r""" - @brief Returns the inverted transformation - Returns the inverted transformation - - @return The inverted transformation - """ - def is_mirror(self) -> bool: - r""" - @brief Gets the mirror flag - - If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. - """ - def to_dtype(self, dbu: Optional[float] = ...) -> DTrans: - r""" - @brief Converts the transformation to a floating-point coordinate transformation - - The database unit can be specified to translate the integer-coordinate transformation into a floating-point coordinate transformation in micron units. The database unit is basically a scaling factor. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief String conversion - """ - @overload - def trans(self, box: Box) -> Box: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, edge: Edge) -> Edge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, p: Point) -> Point: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def trans(self, path: Path) -> Path: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, polygon: Polygon) -> Polygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, text: Text) -> Text: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, v: Vector) -> Vector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - -class DTrans: - r""" - @brief A simple transformation - - Simple transformations only provide rotations about angles which a multiples of 90 degree. - Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). - These can be combined with a displacement which is applied after the rotation/mirror. - This version acts on floating-point coordinates. A version for integer coordinates is \Trans. - - Here are some examples for using the DTrans class: - - @code - t = RBA::DTrans::new(0, 100) # displacement by 100 DBU in y direction - # the inverse: -> "r0 0,-100" - t.inverted.to_s - # concatenation: -> "r90 -100,0" - (RBA::DTrans::new(RBA::DTrans::R90) * t).to_s - # apply to a point: -> "0,100" - RBA::DTrans::new(RBA::DTrans::R90).trans(RBA::DPoint::new(100, 0)) - @/code - - See @The Database API@ for more details about the database objects. - """ - M0: ClassVar[DTrans] - r""" - @brief A constant giving "mirrored at the x-axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M135: ClassVar[DTrans] - r""" - @brief A constant giving "mirrored at the 135 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M45: ClassVar[DTrans] - r""" - @brief A constant giving "mirrored at the 45 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M90: ClassVar[DTrans] - r""" - @brief A constant giving "mirrored at the y (90 degree) axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R0: ClassVar[DTrans] - r""" - @brief A constant giving "unrotated" (unit) transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R180: ClassVar[DTrans] - r""" - @brief A constant giving "rotated by 180 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R270: ClassVar[DTrans] - r""" - @brief A constant giving "rotated by 270 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R90: ClassVar[DTrans] - r""" - @brief A constant giving "rotated by 90 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - angle: int - r""" - @brief Gets the angle in units of 90 degree - - This value delivers the rotation component. In addition, a mirroring at the x axis may be applied before if the \is_mirror? property is true. @brief Sets the angle in units of 90 degree - @param a The new angle - - This method was introduced in version 0.20. - """ - disp: DVector - r""" - @brief Gets to the displacement vector - - Staring with version 0.25 the displacement type is a vector.@brief Sets the displacement - @param u The new displacement - - This method was introduced in version 0.20. - Staring with version 0.25 the displacement type is a vector. - """ - mirror: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the mirror flag - "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag - - This method was introduced in version 0.20. - """ - rot: int - r""" - @brief Gets the angle/mirror code - - The angle/mirror code is one of the constants R0, R90, R180, R270, M0, M45, M90 and M135. rx is the rotation by an angle of x counter clockwise. mx is the mirroring at the axis given by the angle x (to the x-axis). @brief Sets the angle/mirror code - @param r The new angle/rotation code (see \rot property) - - This method was introduced in version 0.20. - """ - @classmethod - def from_s(cls, s: str) -> DTrans: - r""" - @brief Creates a transformation from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - def __copy__(self) -> DTrans: - r""" - @brief Creates a copy of self - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Tests for equality - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a unit transformation - """ - @overload - def __init__(self, trans: Trans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from an integer coordinate transformation - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. - """ - @overload - def __init__(self, u: DVector) -> None: - r""" - @brief Creates a transformation using a displacement only - - @param u The displacement - """ - @overload - def __init__(self, c: DTrans, u: Optional[DVector] = ...) -> None: - r""" - @brief Creates a transformation from another transformation plus a displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - def __init__(self, x: float, y: float) -> None: - r""" - @brief Creates a transformation using a displacement given as two coordinates - - @param x The horizontal displacement - @param y The vertical displacement - """ - @overload - def __init__(self, c: DTrans, x: float, y: float) -> None: - r""" - @brief Creates a transformation from another transformation plus a displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - def __init__(self, rot: int, mirr: Optional[bool] = ..., u: Optional[DVector] = ...) -> None: - r""" - @brief Creates a transformation using angle and mirror flag - - The sequence of operations is: mirroring at x axis, - rotation, application of displacement. - - @param rot The rotation in units of 90 degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - def __init__(self, rot: int, mirr: bool, x: float, y: float) -> None: - r""" - @brief Creates a transformation using angle and mirror flag and two coordinate values for displacement - - The sequence of operations is: mirroring at x axis, - rotation, application of displacement. - - @param rot The rotation in units of 90 degree - @param mirrx True, if mirrored at x axis - @param x The horizontal displacement - @param y The vertical displacement - """ - def __lt__(self, other: DTrans) -> bool: - r""" - @brief Provides a 'less' criterion for sorting - This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. - """ - @overload - def __mul__(self, box: DBox) -> DBox: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, edge: DEdge) -> DEdge: - r""" - Note: This is an alias of 'trans'. - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, p: DPoint) -> DPoint: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __mul__(self, path: DPath) -> DPath: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, polygon: DPolygon) -> DPolygon: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, t: DTrans) -> DTrans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, text: DText) -> DText: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, v: DVector) -> DVector: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Tests for inequality - """ - def __repr__(self) -> str: - r""" - @brief String conversion - """ - @overload - def __rmul__(self, box: DBox) -> DBox: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, edge: DEdge) -> DEdge: - r""" - Note: This is an alias of 'trans'. - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, p: DPoint) -> DPoint: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __rmul__(self, path: DPath) -> DPath: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, polygon: DPolygon) -> DPolygon: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, t: DTrans) -> DTrans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __rmul__(self, text: DText) -> DText: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, v: DVector) -> DVector: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - def __str__(self) -> str: - r""" - @brief String conversion - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: DTrans) -> None: - r""" - @brief Assigns another object to self - """ - def ctrans(self, d: float) -> float: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - """ - def dup(self) -> DTrans: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - def invert(self) -> DTrans: - r""" - @brief Inverts the transformation (in place) - - Inverts the transformation and replaces this object by the - inverted one. - - @return The inverted transformation - """ - def inverted(self) -> DTrans: - r""" - @brief Returns the inverted transformation - Returns the inverted transformation - - @return The inverted transformation - """ - def is_mirror(self) -> bool: - r""" - @brief Gets the mirror flag - - If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. - """ - def to_itype(self, dbu: Optional[float] = ...) -> Trans: - r""" - @brief Converts the transformation to an integer coordinate transformation - - The database unit can be specified to translate the floating-point coordinate transformation in micron units to an integer-coordinate transformation in database units. The transformation's' coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief String conversion - """ - @overload - def trans(self, box: DBox) -> DBox: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, edge: DEdge) -> DEdge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, p: DPoint) -> DPoint: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def trans(self, path: DPath) -> DPath: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, polygon: DPolygon) -> DPolygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, text: DText) -> DText: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, v: DVector) -> DVector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - -class DCplxTrans: - r""" - @brief A complex transformation - - A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary - angle and a displacement. This is also the order, the operations are applied. - - A complex transformation provides a superset of the simple transformation. - In many applications, a complex transformation computes floating-point coordinates to minimize rounding effects. - This version can transform floating-point coordinate objects. - - Complex transformations are extensions of the simple transformation classes (\DTrans in that case) and behave similar. - - Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code: - - @code - # Create a transformation that applies a magnification of 1.5, a rotation by 90 degree - # and displacement of 10 in x and 20 units in y direction: - t = RBA::CplxTrans::new(1.5, 90, false, 10.0, 20.0) - t.to_s # r90 *1.5 10,20 - # compute the inverse: - t.inverted.to_s # r270 *0.666666667 -13,7 - # Combine with another displacement (applied after that): - (RBA::CplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 - # Transform a point: - t.trans(RBA::Point::new(100, 200)).to_s # -290,170 - @/code - - See @The Database API@ for more details about the database objects. - """ - M0: ClassVar[DCplxTrans] - r""" - @brief A constant giving "mirrored at the x-axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M135: ClassVar[DCplxTrans] - r""" - @brief A constant giving "mirrored at the 135 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M45: ClassVar[DCplxTrans] - r""" - @brief A constant giving "mirrored at the 45 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M90: ClassVar[DCplxTrans] - r""" - @brief A constant giving "mirrored at the y (90 degree) axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R0: ClassVar[DCplxTrans] - r""" - @brief A constant giving "unrotated" (unit) transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R180: ClassVar[DCplxTrans] - r""" - @brief A constant giving "rotated by 180 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R270: ClassVar[DCplxTrans] - r""" - @brief A constant giving "rotated by 270 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R90: ClassVar[DCplxTrans] - r""" - @brief A constant giving "rotated by 90 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - angle: float - r""" - @brief Gets the angle - - Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree. - - @return The rotation angle this transformation provides in degree units (0..360 deg). - @brief Sets the angle - @param a The new angle - See \angle for a description of that attribute. - """ - disp: DVector - r""" - @brief Gets the displacement - @brief Sets the displacement - @param u The new displacement - """ - mag: float - r""" - @brief Gets the magnification - @brief Sets the magnification - @param m The new magnification - """ - mirror: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the mirror flag - "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag - """ - @classmethod - def from_s(cls, s: str) -> DCplxTrans: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - def __copy__(self) -> DCplxTrans: - r""" - @brief Creates a copy of self - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Tests for equality - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a unit transformation - """ - @overload - def __init__(self, m: float) -> None: - r""" - @brief Creates a transformation from a magnification - - Creates a magnifying transformation without displacement and rotation given the magnification m. - """ - @overload - def __init__(self, t: DTrans) -> None: - r""" - @brief Creates a transformation from a simple transformation alone - - Creates a magnifying transformation from a simple transformation and a magnification of 1.0. - """ - @overload - def __init__(self, trans: CplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. - """ - @overload - def __init__(self, trans: ICplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. - """ - @overload - def __init__(self, trans: VCplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. - """ - @overload - def __init__(self, u: DVector) -> None: - r""" - @brief Creates a transformation from a displacement - - Creates a transformation with a displacement only. - - This method has been added in version 0.25. - """ - @overload - def __init__(self, t: DTrans, m: float) -> None: - r""" - @brief Creates a transformation from a simple transformation and a magnification - - Creates a magnifying transformation from a simple transformation and a magnification. - """ - @overload - def __init__(self, x: float, y: float) -> None: - r""" - @brief Creates a transformation from a x and y displacement - - This constructor will create a transformation with the specified displacement - but no rotation. - - @param x The x displacement - @param y The y displacement - """ - @overload - def __init__(self, c: DCplxTrans, m: Optional[float] = ..., u: Optional[DVector] = ...) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - def __init__(self, c: DCplxTrans, m: float, x: float, y: float) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, u: DVector) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, x: float, y: float) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param x The x displacement - @param y The y displacement - """ - def __lt__(self, other: DCplxTrans) -> bool: - r""" - @brief Provides a 'less' criterion for sorting - This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. - """ - @overload - def __mul__(self, box: DBox) -> DBox: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, edge: DEdge) -> DEdge: - r""" - Note: This is an alias of 'trans'. - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, p: DPoint) -> DPoint: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __mul__(self, p: DVector) -> DVector: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def __mul__(self, path: DPath) -> DPath: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, polygon: DPolygon) -> DPolygon: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, t: CplxTrans) -> CplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, t: DCplxTrans) -> DCplxTrans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, text: DText) -> DText: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Tests for inequality - """ - def __repr__(self) -> str: - r""" - @brief String conversion - """ - @overload - def __rmul__(self, box: DBox) -> DBox: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, edge: DEdge) -> DEdge: - r""" - Note: This is an alias of 'trans'. - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, p: DPoint) -> DPoint: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __rmul__(self, p: DVector) -> DVector: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def __rmul__(self, path: DPath) -> DPath: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, polygon: DPolygon) -> DPolygon: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, t: CplxTrans) -> CplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __rmul__(self, t: DCplxTrans) -> DCplxTrans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __rmul__(self, text: DText) -> DText: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - def __str__(self) -> str: - r""" - @brief String conversion - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: DCplxTrans) -> None: - r""" - @brief Assigns another object to self - """ - def ctrans(self, d: float) -> float: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - """ - def dup(self) -> DCplxTrans: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - def invert(self) -> DCplxTrans: - r""" - @brief Inverts the transformation (in place) - - Inverts the transformation and replaces this transformation by it's - inverted one. - - @return The inverted transformation - """ - def inverted(self) -> DCplxTrans: - r""" - @brief Returns the inverted transformation - - Returns the inverted transformation. This method does not modify the transformation. - - @return The inverted transformation - """ - def is_complex(self) -> bool: - r""" - @brief Returns true if the transformation is a complex one - - If this predicate is false, the transformation can safely be converted to a simple transformation. - Otherwise, this conversion will be lossy. - The predicate value is equivalent to 'is_mag || !is_ortho'. - - This method has been introduced in version 0.27.5. - """ - def is_mag(self) -> bool: - r""" - @brief Tests, if the transformation is a magnifying one - - This is the recommended test for checking if the transformation represents - a magnification. - """ - def is_mirror(self) -> bool: - r""" - @brief Gets the mirror flag - - If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. - """ - def is_ortho(self) -> bool: - r""" - @brief Tests, if the transformation is an orthogonal transformation - - If the rotation is by a multiple of 90 degree, this method will return true. - """ - def is_unity(self) -> bool: - r""" - @brief Tests, whether this is a unit transformation - """ - def rot(self) -> int: - r""" - @brief Returns the respective simple transformation equivalent rotation code if possible - - If this transformation is orthogonal (is_ortho () == true), then this method - will return the corresponding fixpoint transformation, not taking into account - magnification and displacement. If the transformation is not orthogonal, the result - reflects the quadrant the rotation goes into. - """ - def s_trans(self) -> DTrans: - r""" - @brief Extracts the simple transformation part - - The simple transformation part does not reflect magnification or arbitrary angles. - Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. - """ - def to_itrans(self, dbu: Optional[float] = ...) -> ICplxTrans: - r""" - @brief Converts the transformation to another transformation with integer input and output coordinates - - The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief String conversion - """ - def to_trans(self) -> CplxTrans: - r""" - @brief Converts the transformation to another transformation with integer input coordinates - - This method has been introduced in version 0.25. - """ - def to_vtrans(self, dbu: Optional[float] = ...) -> VCplxTrans: - r""" - @brief Converts the transformation to another transformation with integer output coordinates - - The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - @overload - def trans(self, box: DBox) -> DBox: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, edge: DEdge) -> DEdge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, p: DPoint) -> DPoint: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def trans(self, p: DVector) -> DVector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def trans(self, path: DPath) -> DPath: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, polygon: DPolygon) -> DPolygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, text: DText) -> DText: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - -class CplxTrans: - r""" - @brief A complex transformation - - A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary - angle and a displacement. This is also the order, the operations are applied. - This version can transform integer-coordinate objects into floating-point coordinate objects. This is the generic and exact case, for example for non-integer magnifications. - - Complex transformations are extensions of the simple transformation classes (\Trans or \DTrans in that case) and behave similar. - - Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code: - - @code - # Create a transformation that applies a magnification of 1.5, a rotation by 90 degree - # and displacement of 10 in x and 20 units in y direction: - t = RBA::DCplxTrans::new(1.5, 90, false, 10.0, 20.0) - t.to_s # r90 *1.5 10,20 - # compute the inverse: - t.inverted.to_s # r270 *0.666666667 -13,7 - # Combine with another displacement (applied after that): - (RBA::DCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 - # Transform a point: - t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 - @/code - - The inverse type of the CplxTrans type is VCplxTrans which will transform floating-point to integer coordinate objects. Transformations of CplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator CplxTrans * ICplxTrans is allowed (output types of ICplxTrans and input of CplxTrans are identical) while CplxTrans * DCplxTrans is not. - See @The Database API@ for more details about the database objects. - """ - M0: ClassVar[CplxTrans] - r""" - @brief A constant giving "mirrored at the x-axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M135: ClassVar[CplxTrans] - r""" - @brief A constant giving "mirrored at the 135 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M45: ClassVar[CplxTrans] - r""" - @brief A constant giving "mirrored at the 45 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M90: ClassVar[CplxTrans] - r""" - @brief A constant giving "mirrored at the y (90 degree) axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R0: ClassVar[CplxTrans] - r""" - @brief A constant giving "unrotated" (unit) transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R180: ClassVar[CplxTrans] - r""" - @brief A constant giving "rotated by 180 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R270: ClassVar[CplxTrans] - r""" - @brief A constant giving "rotated by 270 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R90: ClassVar[CplxTrans] - r""" - @brief A constant giving "rotated by 90 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - angle: float - r""" - @brief Gets the angle - - Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree. - - @return The rotation angle this transformation provides in degree units (0..360 deg). - @brief Sets the angle - @param a The new angle - See \angle for a description of that attribute. - """ - disp: DVector - r""" - @brief Gets the displacement - @brief Sets the displacement - @param u The new displacement - """ - mag: float - r""" - @brief Gets the magnification - @brief Sets the magnification - @param m The new magnification - """ - mirror: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the mirror flag - "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag - """ - @classmethod - def from_s(cls, s: str) -> CplxTrans: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - def __copy__(self) -> CplxTrans: - r""" - @brief Creates a copy of self - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Tests for equality - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a unit transformation - """ - @overload - def __init__(self, m: float) -> None: - r""" - @brief Creates a transformation from a magnification - - Creates a magnifying transformation without displacement and rotation given the magnification m. - """ - @overload - def __init__(self, t: Trans) -> None: - r""" - @brief Creates a transformation from a simple transformation alone - - Creates a magnifying transformation from a simple transformation and a magnification of 1.0. - """ - @overload - def __init__(self, trans: DCplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. - """ - @overload - def __init__(self, trans: ICplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. - """ - @overload - def __init__(self, trans: VCplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. - """ - @overload - def __init__(self, u: DVector) -> None: - r""" - @brief Creates a transformation from a displacement - - Creates a transformation with a displacement only. - - This method has been added in version 0.25. - """ - @overload - def __init__(self, t: Trans, m: float) -> None: - r""" - @brief Creates a transformation from a simple transformation and a magnification - - Creates a magnifying transformation from a simple transformation and a magnification. - """ - @overload - def __init__(self, x: float, y: float) -> None: - r""" - @brief Creates a transformation from a x and y displacement - - This constructor will create a transformation with the specified displacement - but no rotation. - - @param x The x displacement - @param y The y displacement - """ - @overload - def __init__(self, c: CplxTrans, m: Optional[float] = ..., u: Optional[DVector] = ...) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - def __init__(self, c: CplxTrans, m: float, x: int, y: int) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, u: DVector) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, x: float, y: float) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param x The x displacement - @param y The y displacement - """ - def __lt__(self, other: CplxTrans) -> bool: - r""" - @brief Provides a 'less' criterion for sorting - This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. - """ - @overload - def __mul__(self, box: Box) -> DBox: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, edge: Edge) -> DEdge: - r""" - Note: This is an alias of 'trans'. - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, p: Point) -> DPoint: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __mul__(self, p: Vector) -> DVector: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def __mul__(self, path: Path) -> DPath: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, polygon: Polygon) -> DPolygon: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, t: CplxTrans) -> CplxTrans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, t: ICplxTrans) -> CplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, t: VCplxTrans) -> DCplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, text: Text) -> DText: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Tests for inequality - """ - def __repr__(self) -> str: - r""" - @brief String conversion - """ - @overload - def __rmul__(self, box: Box) -> DBox: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, edge: Edge) -> DEdge: - r""" - Note: This is an alias of 'trans'. - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, p: Point) -> DPoint: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __rmul__(self, p: Vector) -> DVector: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def __rmul__(self, path: Path) -> DPath: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, polygon: Polygon) -> DPolygon: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, t: CplxTrans) -> CplxTrans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __rmul__(self, t: ICplxTrans) -> CplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __rmul__(self, t: VCplxTrans) -> DCplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __rmul__(self, text: Text) -> DText: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - def __str__(self) -> str: - r""" - @brief String conversion - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: CplxTrans) -> None: - r""" - @brief Assigns another object to self - """ - def ctrans(self, d: int) -> float: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - """ - def dup(self) -> CplxTrans: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - def invert(self) -> CplxTrans: - r""" - @brief Inverts the transformation (in place) - - Inverts the transformation and replaces this transformation by it's - inverted one. - - @return The inverted transformation - """ - def inverted(self) -> VCplxTrans: - r""" - @brief Returns the inverted transformation - - Returns the inverted transformation. This method does not modify the transformation. - - @return The inverted transformation - """ - def is_complex(self) -> bool: - r""" - @brief Returns true if the transformation is a complex one - - If this predicate is false, the transformation can safely be converted to a simple transformation. - Otherwise, this conversion will be lossy. - The predicate value is equivalent to 'is_mag || !is_ortho'. - - This method has been introduced in version 0.27.5. - """ - def is_mag(self) -> bool: - r""" - @brief Tests, if the transformation is a magnifying one - - This is the recommended test for checking if the transformation represents - a magnification. - """ - def is_mirror(self) -> bool: - r""" - @brief Gets the mirror flag - - If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. - """ - def is_ortho(self) -> bool: - r""" - @brief Tests, if the transformation is an orthogonal transformation - - If the rotation is by a multiple of 90 degree, this method will return true. - """ - def is_unity(self) -> bool: - r""" - @brief Tests, whether this is a unit transformation - """ - def rot(self) -> int: - r""" - @brief Returns the respective simple transformation equivalent rotation code if possible - - If this transformation is orthogonal (is_ortho () == true), then this method - will return the corresponding fixpoint transformation, not taking into account - magnification and displacement. If the transformation is not orthogonal, the result - reflects the quadrant the rotation goes into. - """ - def s_trans(self) -> Trans: - r""" - @brief Extracts the simple transformation part - - The simple transformation part does not reflect magnification or arbitrary angles. - Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. - """ - def to_itrans(self, dbu: Optional[float] = ...) -> ICplxTrans: - r""" - @brief Converts the transformation to another transformation with integer input and output coordinates - - The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief String conversion - """ - def to_trans(self) -> DCplxTrans: - r""" - @brief Converts the transformation to another transformation with floating-point input coordinates - - This method has been introduced in version 0.25. - """ - def to_vtrans(self, dbu: Optional[float] = ...) -> VCplxTrans: - r""" - @brief Converts the transformation to another transformation with integer output and floating-point input coordinates - - The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - @overload - def trans(self, box: Box) -> DBox: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, edge: Edge) -> DEdge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, p: Point) -> DPoint: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def trans(self, p: Vector) -> DVector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def trans(self, path: Path) -> DPath: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, polygon: Polygon) -> DPolygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, text: Text) -> DText: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - -class ICplxTrans: - r""" - @brief A complex transformation - - A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary - angle and a displacement. This is also the order, the operations are applied. - This version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact. - - Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar. - - Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code: - - @code - # Create a transformation that applies a magnification of 1.5, a rotation by 90 degree - # and displacement of 10 in x and 20 units in y direction: - t = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0) - t.to_s # r90 *1.5 10,20 - # compute the inverse: - t.inverted.to_s # r270 *0.666666667 -13,7 - # Combine with another displacement (applied after that): - (RBA::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 - # Transform a point: - t.trans(RBA::Point::new(100, 200)).to_s # -290,170 - @/code - - This class has been introduced in version 0.18. - - See @The Database API@ for more details about the database objects. - """ - M0: ClassVar[ICplxTrans] - r""" - @brief A constant giving "mirrored at the x-axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M135: ClassVar[ICplxTrans] - r""" - @brief A constant giving "mirrored at the 135 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M45: ClassVar[ICplxTrans] - r""" - @brief A constant giving "mirrored at the 45 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M90: ClassVar[ICplxTrans] - r""" - @brief A constant giving "mirrored at the y (90 degree) axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R0: ClassVar[ICplxTrans] - r""" - @brief A constant giving "unrotated" (unit) transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R180: ClassVar[ICplxTrans] - r""" - @brief A constant giving "rotated by 180 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R270: ClassVar[ICplxTrans] - r""" - @brief A constant giving "rotated by 270 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R90: ClassVar[ICplxTrans] - r""" - @brief A constant giving "rotated by 90 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - angle: float - r""" - @brief Gets the angle - - Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree. - - @return The rotation angle this transformation provides in degree units (0..360 deg). - @brief Sets the angle - @param a The new angle - See \angle for a description of that attribute. - """ - disp: Vector - r""" - @brief Gets the displacement - @brief Sets the displacement - @param u The new displacement - """ - mag: float - r""" - @brief Gets the magnification - @brief Sets the magnification - @param m The new magnification - """ - mirror: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the mirror flag - "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag - """ - @classmethod - def from_s(cls, s: str) -> ICplxTrans: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - def __copy__(self) -> ICplxTrans: - r""" - @brief Creates a copy of self - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Tests for equality - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a unit transformation - """ - @overload - def __init__(self, m: float) -> None: - r""" - @brief Creates a transformation from a magnification - - Creates a magnifying transformation without displacement and rotation given the magnification m. - """ - @overload - def __init__(self, t: Trans) -> None: - r""" - @brief Creates a transformation from a simple transformation alone - - Creates a magnifying transformation from a simple transformation and a magnification of 1.0. - """ - @overload - def __init__(self, trans: CplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_trans'. - """ - @overload - def __init__(self, trans: DCplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. - """ - @overload - def __init__(self, trans: VCplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. - """ - @overload - def __init__(self, u: Vector) -> None: - r""" - @brief Creates a transformation from a displacement - - Creates a transformation with a displacement only. - - This method has been added in version 0.25. - """ - @overload - def __init__(self, t: Trans, m: float) -> None: - r""" - @brief Creates a transformation from a simple transformation and a magnification - - Creates a magnifying transformation from a simple transformation and a magnification. - """ - @overload - def __init__(self, x: int, y: int) -> None: - r""" - @brief Creates a transformation from a x and y displacement - - This constructor will create a transformation with the specified displacement - but no rotation. - - @param x The x displacement - @param y The y displacement - """ - @overload - def __init__(self, c: ICplxTrans, m: Optional[float] = ..., u: Optional[Vector] = ...) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - def __init__(self, c: ICplxTrans, m: float, x: int, y: int) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, u: Vector) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, x: int, y: int) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param x The x displacement - @param y The y displacement - """ - def __lt__(self, other: ICplxTrans) -> bool: - r""" - @brief Provides a 'less' criterion for sorting - This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. - """ - @overload - def __mul__(self, box: Box) -> Box: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, edge: Edge) -> Edge: - r""" - Note: This is an alias of 'trans'. - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, p: Point) -> Point: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __mul__(self, p: Vector) -> Vector: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def __mul__(self, path: Path) -> Path: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, polygon: Polygon) -> Polygon: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, t: ICplxTrans) -> ICplxTrans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, t: VCplxTrans) -> VCplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, text: Text) -> Text: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Tests for inequality - """ - def __repr__(self) -> str: - r""" - @brief String conversion - """ - @overload - def __rmul__(self, box: Box) -> Box: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, edge: Edge) -> Edge: - r""" - Note: This is an alias of 'trans'. - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, p: Point) -> Point: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __rmul__(self, p: Vector) -> Vector: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def __rmul__(self, path: Path) -> Path: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, polygon: Polygon) -> Polygon: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, t: ICplxTrans) -> ICplxTrans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __rmul__(self, t: VCplxTrans) -> VCplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __rmul__(self, text: Text) -> Text: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - def __str__(self) -> str: - r""" - @brief String conversion - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: ICplxTrans) -> None: - r""" - @brief Assigns another object to self - """ - def ctrans(self, d: int) -> int: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - """ - def dup(self) -> ICplxTrans: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - def invert(self) -> ICplxTrans: - r""" - @brief Inverts the transformation (in place) - - Inverts the transformation and replaces this transformation by it's - inverted one. - - @return The inverted transformation - """ - def inverted(self) -> ICplxTrans: - r""" - @brief Returns the inverted transformation - - Returns the inverted transformation. This method does not modify the transformation. - - @return The inverted transformation - """ - def is_complex(self) -> bool: - r""" - @brief Returns true if the transformation is a complex one - - If this predicate is false, the transformation can safely be converted to a simple transformation. - Otherwise, this conversion will be lossy. - The predicate value is equivalent to 'is_mag || !is_ortho'. - - This method has been introduced in version 0.27.5. - """ - def is_mag(self) -> bool: - r""" - @brief Tests, if the transformation is a magnifying one - - This is the recommended test for checking if the transformation represents - a magnification. - """ - def is_mirror(self) -> bool: - r""" - @brief Gets the mirror flag - - If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. - """ - def is_ortho(self) -> bool: - r""" - @brief Tests, if the transformation is an orthogonal transformation - - If the rotation is by a multiple of 90 degree, this method will return true. - """ - def is_unity(self) -> bool: - r""" - @brief Tests, whether this is a unit transformation - """ - def rot(self) -> int: - r""" - @brief Returns the respective simple transformation equivalent rotation code if possible - - If this transformation is orthogonal (is_ortho () == true), then this method - will return the corresponding fixpoint transformation, not taking into account - magnification and displacement. If the transformation is not orthogonal, the result - reflects the quadrant the rotation goes into. - """ - def s_trans(self) -> Trans: - r""" - @brief Extracts the simple transformation part - - The simple transformation part does not reflect magnification or arbitrary angles. - Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. - """ - def to_itrans(self, dbu: Optional[float] = ...) -> DCplxTrans: - r""" - @brief Converts the transformation to another transformation with floating-point input and output coordinates - - The database unit can be specified to translate the integer coordinate displacement in database units to a floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief String conversion - """ - def to_trans(self) -> VCplxTrans: - r""" - @brief Converts the transformation to another transformation with floating-point input coordinates - - This method has been introduced in version 0.25. - """ - def to_vtrans(self, dbu: Optional[float] = ...) -> CplxTrans: - r""" - @brief Converts the transformation to another transformation with floating-point output coordinates - - The database unit can be specified to translate the integer coordinate displacement in database units to a floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit. - - This method has been introduced in version 0.25. - """ - @overload - def trans(self, box: Box) -> Box: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, edge: Edge) -> Edge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, p: Point) -> Point: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def trans(self, p: Vector) -> Vector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def trans(self, path: Path) -> Path: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, polygon: Polygon) -> Polygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, text: Text) -> Text: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - -class VCplxTrans: - r""" - @brief A complex transformation - - A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary - angle and a displacement. This is also the order, the operations are applied. - This version can transform floating point coordinate objects into integer coordinate objects, which may involve rounding and can be inexact. - - Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar. - - Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code: - - @code - # Create a transformation that applies a magnification of 1.5, a rotation by 90 degree - # and displacement of 10 in x and 20 units in y direction: - t = RBA::VCplxTrans::new(1.5, 90, false, 10, 20) - t.to_s # r90 *1.5 10,20 - # compute the inverse: - t.inverted.to_s # r270 *0.666666667 -13,7 - # Combine with another displacement (applied after that): - (RBA::VCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 - # Transform a point: - t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 - @/code - - The VCplxTrans type is the inverse transformation of the CplxTrans transformation and vice versa.Transformations of VCplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator VCplxTrans * CplxTrans is allowed (output types of CplxTrans and input of VCplxTrans are identical) while VCplxTrans * ICplxTrans is not. - - This class has been introduced in version 0.25. - - See @The Database API@ for more details about the database objects. - """ - M0: ClassVar[VCplxTrans] - r""" - @brief A constant giving "mirrored at the x-axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M135: ClassVar[VCplxTrans] - r""" - @brief A constant giving "mirrored at the 135 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M45: ClassVar[VCplxTrans] - r""" - @brief A constant giving "mirrored at the 45 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M90: ClassVar[VCplxTrans] - r""" - @brief A constant giving "mirrored at the y (90 degree) axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R0: ClassVar[VCplxTrans] - r""" - @brief A constant giving "unrotated" (unit) transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R180: ClassVar[VCplxTrans] - r""" - @brief A constant giving "rotated by 180 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R270: ClassVar[VCplxTrans] - r""" - @brief A constant giving "rotated by 270 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R90: ClassVar[VCplxTrans] - r""" - @brief A constant giving "rotated by 90 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - angle: float - r""" - @brief Gets the angle - - Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree. - - @return The rotation angle this transformation provides in degree units (0..360 deg). - @brief Sets the angle - @param a The new angle - See \angle for a description of that attribute. - """ - disp: Vector - r""" - @brief Gets the displacement - @brief Sets the displacement - @param u The new displacement - """ - mag: float - r""" - @brief Gets the magnification - @brief Sets the magnification - @param m The new magnification - """ - mirror: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the mirror flag - "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag - """ - @classmethod - def from_s(cls, s: str) -> VCplxTrans: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - def __copy__(self) -> VCplxTrans: - r""" - @brief Creates a copy of self - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Tests for equality - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a unit transformation - """ - @overload - def __init__(self, m: float) -> None: - r""" - @brief Creates a transformation from a magnification - - Creates a magnifying transformation without displacement and rotation given the magnification m. - """ - @overload - def __init__(self, t: DTrans) -> None: - r""" - @brief Creates a transformation from a simple transformation alone - - Creates a magnifying transformation from a simple transformation and a magnification of 1.0. - """ - @overload - def __init__(self, trans: CplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - """ - @overload - def __init__(self, trans: DCplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - """ - @overload - def __init__(self, trans: ICplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - """ - @overload - def __init__(self, u: Vector) -> None: - r""" - @brief Creates a transformation from a displacement - - Creates a transformation with a displacement only. - - This method has been added in version 0.25. - """ - @overload - def __init__(self, t: DTrans, m: float) -> None: - r""" - @brief Creates a transformation from a simple transformation and a magnification - - Creates a magnifying transformation from a simple transformation and a magnification. - """ - @overload - def __init__(self, x: int, y: int) -> None: - r""" - @brief Creates a transformation from a x and y displacement - - This constructor will create a transformation with the specified displacement - but no rotation. - - @param x The x displacement - @param y The y displacement - """ - @overload - def __init__(self, c: VCplxTrans, m: Optional[float] = ..., u: Optional[Vector] = ...) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - def __init__(self, c: VCplxTrans, m: float, x: float, y: float) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, u: Vector) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, x: int, y: int) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param x The x displacement - @param y The y displacement - """ - def __lt__(self, other: VCplxTrans) -> bool: - r""" - @brief Provides a 'less' criterion for sorting - This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. - """ - @overload - def __mul__(self, box: DBox) -> Box: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, edge: DEdge) -> Edge: - r""" - Note: This is an alias of 'trans'. - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, p: DPoint) -> Point: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __mul__(self, p: DVector) -> Vector: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def __mul__(self, path: DPath) -> Path: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, polygon: DPolygon) -> Polygon: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, t: CplxTrans) -> ICplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, t: DCplxTrans) -> VCplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, t: VCplxTrans) -> VCplxTrans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, text: DText) -> Text: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Tests for inequality - """ - def __repr__(self) -> str: - r""" - @brief String conversion - """ - @overload - def __rmul__(self, box: DBox) -> Box: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, edge: DEdge) -> Edge: - r""" - Note: This is an alias of 'trans'. - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, p: DPoint) -> Point: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __rmul__(self, p: DVector) -> Vector: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def __rmul__(self, path: DPath) -> Path: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, polygon: DPolygon) -> Polygon: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, t: CplxTrans) -> ICplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __rmul__(self, t: DCplxTrans) -> VCplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __rmul__(self, t: VCplxTrans) -> VCplxTrans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __rmul__(self, text: DText) -> Text: - r""" - Note: This is an alias of 'trans'. - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - def __str__(self) -> str: - r""" - @brief String conversion - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: VCplxTrans) -> None: - r""" - @brief Assigns another object to self - """ - def ctrans(self, d: float) -> int: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - """ - def dup(self) -> VCplxTrans: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - def invert(self) -> VCplxTrans: - r""" - @brief Inverts the transformation (in place) - - Inverts the transformation and replaces this transformation by it's - inverted one. - - @return The inverted transformation - """ - def inverted(self) -> CplxTrans: - r""" - @brief Returns the inverted transformation - - Returns the inverted transformation. This method does not modify the transformation. - - @return The inverted transformation - """ - def is_complex(self) -> bool: - r""" - @brief Returns true if the transformation is a complex one - - If this predicate is false, the transformation can safely be converted to a simple transformation. - Otherwise, this conversion will be lossy. - The predicate value is equivalent to 'is_mag || !is_ortho'. - - This method has been introduced in version 0.27.5. - """ - def is_mag(self) -> bool: - r""" - @brief Tests, if the transformation is a magnifying one - - This is the recommended test for checking if the transformation represents - a magnification. - """ - def is_mirror(self) -> bool: - r""" - @brief Gets the mirror flag - - If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. - """ - def is_ortho(self) -> bool: - r""" - @brief Tests, if the transformation is an orthogonal transformation - - If the rotation is by a multiple of 90 degree, this method will return true. - """ - def is_unity(self) -> bool: - r""" - @brief Tests, whether this is a unit transformation - """ - def rot(self) -> int: - r""" - @brief Returns the respective simple transformation equivalent rotation code if possible - - If this transformation is orthogonal (is_ortho () == true), then this method - will return the corresponding fixpoint transformation, not taking into account - magnification and displacement. If the transformation is not orthogonal, the result - reflects the quadrant the rotation goes into. - """ - def s_trans(self) -> DTrans: - r""" - @brief Extracts the simple transformation part - - The simple transformation part does not reflect magnification or arbitrary angles. - Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. - """ - def to_itrans(self, dbu: Optional[float] = ...) -> DCplxTrans: - r""" - @brief Converts the transformation to another transformation with floating-point output coordinates - - The database unit can be specified to translate the integer coordinate displacement in database units to a floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief String conversion - """ - def to_trans(self) -> ICplxTrans: - r""" - @brief Converts the transformation to another transformation with integer input coordinates - - This method has been introduced in version 0.25. - """ - def to_vtrans(self, dbu: Optional[float] = ...) -> CplxTrans: - r""" - @brief Converts the transformation to another transformation with integer input and floating-point output coordinates - - The database unit can be specified to translate the integer coordinate displacement in database units to an floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit. - - This method has been introduced in version 0.25. - """ - @overload - def trans(self, box: DBox) -> Box: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, edge: DEdge) -> Edge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, p: DPoint) -> Point: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def trans(self, p: DVector) -> Vector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def trans(self, path: DPath) -> Path: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, polygon: DPolygon) -> Polygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, text: DText) -> Text: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - -class Utils: - r""" - @brief This namespace provides a collection of utility functions + @brief A base class for the shape collections (\Region, \Edges, \EdgePairs and \Texts) This class has been introduced in version 0.27. """ - def __copy__(self) -> Utils: + @classmethod + def new(cls) -> ShapeCollection: r""" - @brief Creates a copy of self + @brief Creates a new object of this class """ def __init__(self) -> None: r""" @@ -38170,632 +48974,29 @@ class Utils: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: Utils) -> None: - r""" - @brief Assigns another object to self - """ - def dup(self) -> Utils: - r""" - @brief Creates a copy of self - """ - @overload - def spline_interpolation(self, control_points: Sequence[DPoint], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[DPoint]: - r""" - @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. - - This is the version for non-rational splines. It lacks the weight vector. - """ - @overload - def spline_interpolation(self, control_points: Sequence[Point], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[Point]: - r""" - @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. - - This is the version for integer-coordinate points for non-rational splines. - """ - @overload - def spline_interpolation(self, control_points: Sequence[DPoint], weights: Sequence[float], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[DPoint]: - r""" - @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. - - The knot vector needs to be padded and it's size must fulfill the condition: - - @code - knots.size == control_points.size + degree + 1 - @/code - - The accuracy parameters allow tuning the resolution of the curve to target a specific approximation quality. - "relative_accuracy" gives the accuracy relative to the local curvature radius, "absolute" accuracy gives the - absolute accuracy. "accuracy" is the allowed deviation of polygon approximation from the ideal curve. - The computed curve should meet at least one of the accuracy criteria. Setting both limits to a very small - value will result in long run times and a large number of points returned. - - This function supports both rational splines (NURBS) and non-rational splines. The latter use weights of - 1.0 for each point. - - The return value is a list of points forming a path which approximates the spline curve. - """ - @overload - def spline_interpolation(self, control_points: Sequence[Point], weights: Sequence[float], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[Point]: - r""" - @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. - - This is the version for integer-coordinate points. - """ - -class DVector: - r""" - @brief A vector class with double (floating-point) coordinates - A vector is a distance in cartesian, 2 dimensional space. A vector is given by two coordinates (x and y) and represents the distance between two points. Being the distance, transformations act differently on vectors: the displacement is not applied. - Vectors are not geometrical objects by itself. But they are frequently used in the database API for various purposes. Other than the integer variant (\Vector), points with floating-point coordinates can represent fractions of a database unit or vectors in physical (micron) units. - - This class has been introduced in version 0.25. - - See @The Database API@ for more details about the database objects. - """ - x: float - r""" - @brief Accessor to the x coordinate - @brief Write accessor to the x coordinate - """ - y: float - r""" - @brief Accessor to the y coordinate - @brief Write accessor to the y coordinate - """ - @classmethod - def from_s(cls, s: str) -> DVector: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - """ - @overload - def __add__(self, p: DPoint) -> DPoint: - r""" - @brief Adds a vector and a point - - - Returns the point p shifted by the vector. - """ - @overload - def __add__(self, v: DVector) -> DVector: - r""" - @brief Adds two vectors - - - Adds vector v to self by adding the coordinates. - """ - def __copy__(self) -> DVector: - r""" - @brief Creates a copy of self - """ - def __eq__(self, v: object) -> bool: - r""" - @brief Equality test operator - - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given vector. This method enables vectors as hash keys. - - This method has been introduced in version 0.25. - """ - def __imul__(self, f: float) -> DVector: - r""" - @brief Scaling by some factor - - - Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor: creates a null vector with coordinates (0,0) - """ - @overload - def __init__(self, p: DPoint) -> None: - r""" - @brief Default constructor: creates a vector from a point - This constructor is equivalent to computing p-point(0,0). - This method has been introduced in version 0.25. - """ - @overload - def __init__(self, vector: Vector) -> None: - r""" - @brief Creates a floating-point coordinate vector from an integer coordinate vector - """ - @overload - def __init__(self, x: float, y: float) -> None: - r""" - @brief Constructor for a vector from two coordinate values - - """ - def __itruediv__(self, d: float) -> DVector: - r""" - @brief Division by some divisor - - - Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded. - """ - def __lt__(self, v: DVector) -> bool: - r""" - @brief "less" comparison operator - - - This operator is provided to establish a sorting - order - """ - @overload - def __mul__(self, f: float) -> DVector: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - @overload - def __mul__(self, v: DVector) -> float: - r""" - @brief Computes the scalar product between self and the given vector - - - The scalar product of a and b is defined as: vp = ax*bx+ay*by. - """ - def __ne__(self, v: object) -> bool: - r""" - @brief Inequality test operator - - """ - def __neg__(self) -> DVector: - r""" - @brief Compute the negative of a vector - - - Returns a new vector with -x,-y. - """ - def __repr__(self) -> str: - r""" - @brief String conversion - """ - @overload - def __rmul__(self, f: float) -> DVector: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - @overload - def __rmul__(self, v: DVector) -> float: - r""" - @brief Computes the scalar product between self and the given vector - - - The scalar product of a and b is defined as: vp = ax*bx+ay*by. - """ - def __str__(self) -> str: - r""" - @brief String conversion - """ - def __sub__(self, v: DVector) -> DVector: - r""" - @brief Subtract two vectors - - - Subtract vector v from self by subtracting the coordinates. - """ - def __truediv__(self, d: float) -> DVector: - r""" - @brief Division by some divisor - - - Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded. - """ - def _create(self) -> None: + def create(self) -> None: r""" @brief Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. """ - def _destroy(self) -> None: + def destroy(self) -> None: r""" @brief Explicitly destroys the object Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing. """ - def _destroyed(self) -> bool: + def destroyed(self) -> bool: r""" @brief Returns a value indicating whether the object was already destroyed This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ - def _is_const_object(self) -> bool: + def is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def abs(self) -> float: - r""" - Note: This is an alias of 'length'. - @brief Returns the length of the vector - 'abs' is an alias provided for compatibility with the former point type. - """ - def assign(self, other: DVector) -> None: - r""" - @brief Assigns another object to self - """ - def dup(self) -> DVector: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given vector. This method enables vectors as hash keys. - - This method has been introduced in version 0.25. - """ - def length(self) -> float: - r""" - @brief Returns the length of the vector - 'abs' is an alias provided for compatibility with the former point type. - """ - def sprod(self, v: DVector) -> float: - r""" - @brief Computes the scalar product between self and the given vector - - - The scalar product of a and b is defined as: vp = ax*bx+ay*by. - """ - def sprod_sign(self, v: DVector) -> int: - r""" - @brief Computes the scalar product between self and the given vector and returns a value indicating the sign of the product - - - @return 1 if the scalar product is positive, 0 if it is zero and -1 if it is negative. - """ - def sq_abs(self) -> float: - r""" - Note: This is an alias of 'sq_length'. - @brief The square length of the vector - 'sq_abs' is an alias provided for compatibility with the former point type. - """ - def sq_length(self) -> float: - r""" - @brief The square length of the vector - 'sq_abs' is an alias provided for compatibility with the former point type. - """ - def to_itype(self, dbu: Optional[float] = ...) -> Vector: - r""" - @brief Converts the point to an integer coordinate point - - The database unit can be specified to translate the floating-point coordinate vector in micron units to an integer-coordinate vector in database units. The vector's' coordinates will be divided by the database unit. - """ - def to_p(self) -> DPoint: - r""" - @brief Turns the vector into a point - This method returns the point resulting from adding the vector to (0,0). - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief String conversion - """ - def vprod(self, v: DVector) -> float: - r""" - @brief Computes the vector product between self and the given vector - - - The vector product of a and b is defined as: vp = ax*by-ay*bx. - """ - def vprod_sign(self, v: DVector) -> int: - r""" - @brief Computes the vector product between self and the given vector and returns a value indicating the sign of the product - - - @return 1 if the vector product is positive, 0 if it is zero and -1 if it is negative. - """ - -class Vector: - r""" - @brief A integer vector class - A vector is a distance in cartesian, 2 dimensional space. A vector is given by two coordinates (x and y) and represents the distance between two points. Being the distance, transformations act differently on vectors: the displacement is not applied. - Vectors are not geometrical objects by itself. But they are frequently used in the database API for various purposes. - - This class has been introduced in version 0.25. - - See @The Database API@ for more details about the database objects. - """ - x: int - r""" - @brief Accessor to the x coordinate - @brief Write accessor to the x coordinate - """ - y: int - r""" - @brief Accessor to the y coordinate - @brief Write accessor to the y coordinate - """ - @classmethod - def from_s(cls, s: str) -> Vector: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - """ - @overload - def __add__(self, p: Point) -> Point: - r""" - @brief Adds a vector and a point - - - Returns the point p shifted by the vector. - """ - @overload - def __add__(self, v: Vector) -> Vector: - r""" - @brief Adds two vectors - - - Adds vector v to self by adding the coordinates. - """ - def __copy__(self) -> Vector: - r""" - @brief Creates a copy of self - """ - def __eq__(self, v: object) -> bool: - r""" - @brief Equality test operator - - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given vector. This method enables vectors as hash keys. - - This method has been introduced in version 0.25. - """ - def __imul__(self, f: float) -> Vector: - r""" - @brief Scaling by some factor - - - Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor: creates a null vector with coordinates (0,0) - """ - @overload - def __init__(self, dvector: DVector) -> None: - r""" - @brief Creates an integer coordinate vector from a floating-point coordinate vector - """ - @overload - def __init__(self, p: Point) -> None: - r""" - @brief Default constructor: creates a vector from a point - This constructor is equivalent to computing p-point(0,0). - This method has been introduced in version 0.25. - """ - @overload - def __init__(self, x: int, y: int) -> None: - r""" - @brief Constructor for a vector from two coordinate values - - """ - def __itruediv__(self, d: float) -> Vector: - r""" - @brief Division by some divisor - - - Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded. - """ - def __lt__(self, v: Vector) -> bool: - r""" - @brief "less" comparison operator - - - This operator is provided to establish a sorting - order - """ - @overload - def __mul__(self, f: float) -> Vector: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - @overload - def __mul__(self, v: Vector) -> int: - r""" - @brief Computes the scalar product between self and the given vector - - - The scalar product of a and b is defined as: vp = ax*bx+ay*by. - """ - def __ne__(self, v: object) -> bool: - r""" - @brief Inequality test operator - - """ - def __neg__(self) -> Vector: - r""" - @brief Compute the negative of a vector - - - Returns a new vector with -x,-y. - """ - def __repr__(self) -> str: - r""" - @brief String conversion - """ - @overload - def __rmul__(self, f: float) -> Vector: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - @overload - def __rmul__(self, v: Vector) -> int: - r""" - @brief Computes the scalar product between self and the given vector - - - The scalar product of a and b is defined as: vp = ax*bx+ay*by. - """ - def __str__(self) -> str: - r""" - @brief String conversion - """ - def __sub__(self, v: Vector) -> Vector: - r""" - @brief Subtract two vectors - - - Subtract vector v from self by subtracting the coordinates. - """ - def __truediv__(self, d: float) -> Vector: - r""" - @brief Division by some divisor - - - Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded. - """ - def _create(self) -> None: - r""" - @brief Ensures the C++ object is created - Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. - """ - def _destroy(self) -> None: - r""" - @brief Explicitly destroys the object - Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. - If the object is not owned by the script, this method will do nothing. - """ - def _destroyed(self) -> bool: - r""" - @brief Returns a value indicating whether the object was already destroyed - This method returns true, if the object was destroyed, either explicitly or by the C++ side. - The latter may happen, if the object is owned by a C++ object which got destroyed itself. - """ - def _is_const_object(self) -> bool: - r""" - @brief Returns a value indicating whether the reference is a const reference - This method returns true, if self is a const reference. - In that case, only const methods may be called on self. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def abs(self) -> float: - r""" - Note: This is an alias of 'length'. - @brief Returns the length of the vector - 'abs' is an alias provided for compatibility with the former point type. - """ - def assign(self, other: Vector) -> None: - r""" - @brief Assigns another object to self - """ - def dup(self) -> Vector: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given vector. This method enables vectors as hash keys. - - This method has been introduced in version 0.25. - """ - def length(self) -> float: - r""" - @brief Returns the length of the vector - 'abs' is an alias provided for compatibility with the former point type. - """ - def sprod(self, v: Vector) -> int: - r""" - @brief Computes the scalar product between self and the given vector - - - The scalar product of a and b is defined as: vp = ax*bx+ay*by. - """ - def sprod_sign(self, v: Vector) -> int: - r""" - @brief Computes the scalar product between self and the given vector and returns a value indicating the sign of the product - - - @return 1 if the scalar product is positive, 0 if it is zero and -1 if it is negative. - """ - def sq_abs(self) -> float: - r""" - Note: This is an alias of 'sq_length'. - @brief The square length of the vector - 'sq_abs' is an alias provided for compatibility with the former point type. - """ - def sq_length(self) -> float: - r""" - @brief The square length of the vector - 'sq_abs' is an alias provided for compatibility with the former point type. - """ - def to_dtype(self, dbu: Optional[float] = ...) -> DVector: - r""" - @brief Converts the vector to a floating-point coordinate vector - The database unit can be specified to translate the integer-coordinate vector into a floating-point coordinate vector in micron units. The database unit is basically a scaling factor. - """ - def to_p(self) -> Point: - r""" - @brief Turns the vector into a point - This method returns the point resulting from adding the vector to (0,0). - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief String conversion - """ - def vprod(self, v: Vector) -> int: - r""" - @brief Computes the vector product between self and the given vector - - - The vector product of a and b is defined as: vp = ax*by-ay*bx. - """ - def vprod_sign(self, v: Vector) -> int: - r""" - @brief Computes the vector product between self and the given vector and returns a value indicating the sign of the product - - - @return 1 if the vector product is positive, 0 if it is zero and -1 if it is negative. - """ class LEFDEFReaderConfiguration: r""" @@ -38812,66 +49013,94 @@ class LEFDEFReaderConfiguration: """ blockages_datatype: int r""" + Getter: @brief Gets the blockage marker layer datatype value. - See \produce_via_geometry for details about the layer production rules.@brief Sets the blockage marker layer datatype value. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the blockage marker layer datatype value. See \produce_via_geometry for details about the layer production rules. """ blockages_suffix: str r""" + Getter: @brief Gets the blockage marker layer name suffix. - See \produce_via_geometry for details about the layer production rules.@brief Sets the blockage marker layer name suffix. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the blockage marker layer name suffix. See \produce_via_geometry for details about the layer production rules. """ cell_outline_layer: str r""" + Getter: @brief Gets the layer on which to produce the cell outline (diearea). This attribute is a string corresponding to the string representation of \LayerInfo. This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \LayerInfo for details. - The setter for this attribute is \cell_outline_layer=. See also \produce_cell_outlines.@brief Sets the layer on which to produce the cell outline (diearea). + The setter for this attribute is \cell_outline_layer=. See also \produce_cell_outlines. + Setter: + @brief Sets the layer on which to produce the cell outline (diearea). See \cell_outline_layer for details. """ create_other_layers: bool r""" + Getter: @brief Gets a value indicating whether layers not mapped in the layer map shall be created too - See \layer_map for details.@brief Sets a value indicating whether layers not mapped in the layer map shall be created too + See \layer_map for details. + Setter: + @brief Sets a value indicating whether layers not mapped in the layer map shall be created too See \layer_map for details. """ dbu: float r""" + Getter: @brief Gets the database unit to use for producing the layout. This value specifies the database to be used for the layout that is read. When a DEF file is specified with a different database unit, the layout is translated into this database unit. + + Setter: @brief Sets the database unit to use for producing the layout. See \dbu for details. """ fills_datatype: int r""" + Getter: @brief Gets the fill geometry layer datatype value. See \produce_via_geometry for details about the layer production rules. - Fill support has been introduced in version 0.27.@brief Sets the fill geometry layer datatype value. + Fill support has been introduced in version 0.27. + Setter: + @brief Sets the fill geometry layer datatype value. See \produce_via_geometry for details about the layer production rules. Fill support has been introduced in version 0.27. """ fills_datatype_str: str r""" - @hide@hide + Getter: + @hide + Setter: + @hide """ fills_suffix: str r""" + Getter: @brief Gets the fill geometry layer name suffix. See \produce_via_geometry for details about the layer production rules. - Fill support has been introduced in version 0.27.@brief Sets the fill geometry layer name suffix. + Fill support has been introduced in version 0.27. + Setter: + @brief Sets the fill geometry layer name suffix. See \produce_via_geometry for details about the layer production rules. Fill support has been introduced in version 0.27. """ fills_suffix_str: str r""" - @hide@hide + Getter: + @hide + Setter: + @hide """ instance_property_name: Any r""" + Getter: @brief Gets a value indicating whether and how to produce instance names as properties. If set to a value not nil, instance names will be attached to the instances generated as user properties. This attribute then specifies the user property name to be used for attaching the instance names. @@ -38879,46 +49108,63 @@ class LEFDEFReaderConfiguration: The corresponding setter is \instance_property_name=. - This method has been introduced in version 0.26.4.@brief Sets a value indicating whether and how to produce instance names as properties. + This method has been introduced in version 0.26.4. + Setter: + @brief Sets a value indicating whether and how to produce instance names as properties. See \instance_property_name for details. This method has been introduced in version 0.26.4. """ labels_datatype: int r""" + Getter: @brief Gets the labels layer datatype value. - See \produce_via_geometry for details about the layer production rules.@brief Sets the labels layer datatype value. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the labels layer datatype value. See \produce_via_geometry for details about the layer production rules. """ labels_suffix: str r""" + Getter: @brief Gets the label layer name suffix. - See \produce_via_geometry for details about the layer production rules.@brief Sets the label layer name suffix. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the label layer name suffix. See \produce_via_geometry for details about the layer production rules. """ layer_map: LayerMap r""" + Getter: @brief Gets the layer map to be used for the LEF/DEF reader @return A reference to the layer map Because LEF/DEF layer mapping is substantially different than for normal layout files, the LEF/DEF reader employs a separate layer mapping table. The LEF/DEF specific layer mapping is stored within the LEF/DEF reader's configuration and can be accessed with this attribute. The layer mapping table of \LoadLayoutOptions will be ignored for the LEF/DEF reader. - The setter is \layer_map=. \create_other_layers= is available to control whether layers not specified in the layer mapping table shall be created automatically.@brief Sets the layer map to be used for the LEF/DEF reader + The setter is \layer_map=. \create_other_layers= is available to control whether layers not specified in the layer mapping table shall be created automatically. + Setter: + @brief Sets the layer map to be used for the LEF/DEF reader See \layer_map for details. """ lef_files: List[str] r""" + Getter: @brief Gets the list technology LEF files to additionally import Returns a list of path names for technology LEF files to read in addition to the primary file. Relative paths are resolved relative to the file to read or relative to the technology base path. - The setter for this property is \lef_files=.@brief Sets the list technology LEF files to additionally import + The setter for this property is \lef_files=. + Setter: + @brief Sets the list technology LEF files to additionally import See \lef_files for details. """ lef_labels_datatype: int r""" + Getter: @brief Gets the lef_labels layer datatype value. See \produce_via_geometry for details about the layer production rules. This method has been introduced in version 0.27.2 + + Setter: @brief Sets the lef_labels layer datatype value. See \produce_via_geometry for details about the layer production rules. @@ -38926,10 +49172,13 @@ class LEFDEFReaderConfiguration: """ lef_labels_suffix: str r""" + Getter: @brief Gets the label layer name suffix. See \produce_via_geometry for details about the layer production rules. This method has been introduced in version 0.27.2 + + Setter: @brief Sets the label layer name suffix. See \produce_via_geometry for details about the layer production rules. @@ -38937,26 +49186,39 @@ class LEFDEFReaderConfiguration: """ lef_pins_datatype: int r""" + Getter: @brief Gets the LEF pin geometry layer datatype value. - See \produce_via_geometry for details about the layer production rules.@brief Sets the LEF pin geometry layer datatype value. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the LEF pin geometry layer datatype value. See \produce_via_geometry for details about the layer production rules. """ lef_pins_datatype_str: str r""" - @hide@hide + Getter: + @hide + Setter: + @hide """ lef_pins_suffix: str r""" + Getter: @brief Gets the LEF pin geometry layer name suffix. - See \produce_via_geometry for details about the layer production rules.@brief Sets the LEF pin geometry layer name suffix. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the LEF pin geometry layer name suffix. See \produce_via_geometry for details about the layer production rules. """ lef_pins_suffix_str: str r""" - @hide@hide + Getter: + @hide + Setter: + @hide """ macro_layout_files: List[str] r""" + Getter: @brief Gets the list of layout files to read for substituting macros in DEF These files play the same role than the macro layouts (see \macro_layouts), except that this property specifies a list of file names. The given files are loaded automatically to resolve macro layouts instead of LEF geometry. See \macro_resolution_mode for details when this happens. Relative paths are resolved relative to the DEF file to read or relative to the technology base path. Macros in need for substitution are looked up in the layout files by searching for cells with the same name. The files are scanned in the order they are given in the file list. @@ -38965,6 +49227,8 @@ class LEFDEFReaderConfiguration: The setter for this property is \macro_layout_files=. This property has been added in version 0.27.1. + + Setter: @brief Sets the list of layout files to read for substituting macros in DEF See \macro_layout_files for details. @@ -38972,6 +49236,7 @@ class LEFDEFReaderConfiguration: """ macro_layouts: List[Layout] r""" + Getter: @brief Gets the layout objects used for resolving LEF macros in the DEF reader. The DEF reader can either use LEF geometry or use a separate source of layouts for the LEF macros. The \macro_resolution_mode controls whether to use LEF geometry. If LEF geometry is not used, the DEF reader will look up macro cells from the \macro_layouts and pull cell layouts from there. @@ -38980,6 +49245,8 @@ class LEFDEFReaderConfiguration: \macro_layout_files is another way of specifying such substitution layouts. This method accepts file names instead of layout objects. This property has been added in version 0.27. + + Setter: @brief Sets the layout objects used for resolving LEF macros in the DEF reader. See \macro_layouts for more details about this property. @@ -38989,6 +49256,7 @@ class LEFDEFReaderConfiguration: """ macro_resolution_mode: int r""" + Getter: @brief Gets the macro resolution mode (LEF macros into DEF). This property describes the way LEF macros are turned into layout cells when reading DEF. There are three modes available: @@ -39001,6 +49269,8 @@ class LEFDEFReaderConfiguration: If substitution layouts are specified with \macro_layouts, these are used to provide macro layouts in case no LEF geometry is taken. This property has been added in version 0.27. + + Setter: @brief Sets the macro resolution mode (LEF macros into DEF). See \macro_resolution_mode for details about this property. @@ -39008,11 +49278,14 @@ class LEFDEFReaderConfiguration: """ map_file: str r""" + Getter: @brief Gets the layer map file to use. If a layer map file is given, the reader will pull the layer mapping from this file. The layer mapping rules specified in the reader options are ignored in this case. These are the name suffix rules for vias, blockages, routing, special routing, pins etc. and the corresponding datatype rules. The \layer_map attribute will also be ignored. The layer map file path will be resolved relative to the technology base path if the LEF/DEF reader options are used in the context of a technology. This property has been added in version 0.27. + + Setter: @brief Sets the layer map file to use. See \map_file for details about this property. @@ -39020,34 +49293,45 @@ class LEFDEFReaderConfiguration: """ net_property_name: Any r""" + Getter: @brief Gets a value indicating whether and how to produce net names as properties. If set to a value not nil, net names will be attached to the net shapes generated as user properties. This attribute then specifies the user property name to be used for attaching the net names. If set to nil, no net names will be produced. - The corresponding setter is \net_property_name=.@brief Sets a value indicating whether and how to produce net names as properties. + The corresponding setter is \net_property_name=. + Setter: + @brief Sets a value indicating whether and how to produce net names as properties. See \net_property_name for details. """ obstructions_datatype: int r""" + Getter: @brief Gets the obstruction marker layer datatype value. - See \produce_via_geometry for details about the layer production rules.@brief Sets the obstruction marker layer datatype value. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the obstruction marker layer datatype value. See \produce_via_geometry for details about the layer production rules. """ obstructions_suffix: str r""" + Getter: @brief Gets the obstruction marker layer name suffix. - See \produce_via_geometry for details about the layer production rules.@brief Sets the obstruction marker layer name suffix. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the obstruction marker layer name suffix. See \produce_via_geometry for details about the layer production rules. """ - paths_relative_to_cwd: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets a value indicating whether to use paths relative to cwd (true) or DEF file (false) for map or LEF files - This write-only attribute has been introduced in version 0.27.9. - """ + @property + def paths_relative_to_cwd(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets a value indicating whether to use paths relative to cwd (true) or DEF file (false) for map or LEF files + This write-only attribute has been introduced in version 0.27.9. + """ pin_property_name: Any r""" + Getter: @brief Gets a value indicating whether and how to produce pin names as properties. If set to a value not nil, pin names will be attached to the pin shapes generated as user properties. This attribute then specifies the user property name to be used for attaching the pin names. @@ -39055,71 +49339,103 @@ class LEFDEFReaderConfiguration: The corresponding setter is \pin_property_name=. - This method has been introduced in version 0.26.4.@brief Sets a value indicating whether and how to produce pin names as properties. + This method has been introduced in version 0.26.4. + Setter: + @brief Sets a value indicating whether and how to produce pin names as properties. See \pin_property_name for details. This method has been introduced in version 0.26.4. """ pins_datatype: int r""" + Getter: @brief Gets the pin geometry layer datatype value. - See \produce_via_geometry for details about the layer production rules.@brief Sets the pin geometry layer datatype value. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the pin geometry layer datatype value. See \produce_via_geometry for details about the layer production rules. """ pins_datatype_str: str r""" - @hide@hide + Getter: + @hide + Setter: + @hide """ pins_suffix: str r""" + Getter: @brief Gets the pin geometry layer name suffix. - See \produce_via_geometry for details about the layer production rules.@brief Sets the pin geometry layer name suffix. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the pin geometry layer name suffix. See \produce_via_geometry for details about the layer production rules. """ pins_suffix_str: str r""" - @hide@hide + Getter: + @hide + Setter: + @hide """ placement_blockage_layer: str r""" + Getter: @brief Gets the layer on which to produce the placement blockage. - This attribute is a string corresponding to the string representation of \LayerInfo. This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \LayerInfo for details.The setter for this attribute is \placement_blockage_layer=. See also \produce_placement_blockages.@brief Sets the layer on which to produce the placement blockage. + This attribute is a string corresponding to the string representation of \LayerInfo. This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \LayerInfo for details.The setter for this attribute is \placement_blockage_layer=. See also \produce_placement_blockages. + Setter: + @brief Sets the layer on which to produce the placement blockage. See \placement_blockage_layer for details. """ produce_blockages: bool r""" + Getter: @brief Gets a value indicating whether routing blockage markers shall be produced. - See \produce_via_geometry for details about the layer production rules.@brief Sets a value indicating whether routing blockage markers shall be produced. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets a value indicating whether routing blockage markers shall be produced. See \produce_via_geometry for details about the layer production rules. """ produce_cell_outlines: bool r""" + Getter: @brief Gets a value indicating whether to produce cell outlines (diearea). - If set to true, cell outlines will be produced on the layer given by \cell_outline_layer. @brief Sets a value indicating whether to produce cell outlines (diearea). + If set to true, cell outlines will be produced on the layer given by \cell_outline_layer. + Setter: + @brief Sets a value indicating whether to produce cell outlines (diearea). See \produce_cell_outlines for details. """ produce_fills: bool r""" + Getter: @brief Gets a value indicating whether fill geometries shall be produced. See \produce_via_geometry for details about the layer production rules. - Fill support has been introduced in version 0.27.@brief Sets a value indicating whether fill geometries shall be produced. + Fill support has been introduced in version 0.27. + Setter: + @brief Sets a value indicating whether fill geometries shall be produced. See \produce_via_geometry for details about the layer production rules. Fill support has been introduced in version 0.27. """ produce_labels: bool r""" + Getter: @brief Gets a value indicating whether labels shall be produced. - See \produce_via_geometry for details about the layer production rules.@brief Sets a value indicating whether labels shall be produced. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets a value indicating whether labels shall be produced. See \produce_via_geometry for details about the layer production rules. """ produce_lef_labels: bool r""" + Getter: @brief Gets a value indicating whether lef_labels shall be produced. See \produce_via_geometry for details about the layer production rules. This method has been introduced in version 0.27.2 + + Setter: @brief Sets a value indicating whether lef_labels shall be produced. See \produce_via_geometry for details about the layer production rules. @@ -39127,55 +49443,77 @@ class LEFDEFReaderConfiguration: """ produce_lef_pins: bool r""" + Getter: @brief Gets a value indicating whether LEF pin geometries shall be produced. - See \produce_via_geometry for details about the layer production rules.@brief Sets a value indicating whether LEF pin geometries shall be produced. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets a value indicating whether LEF pin geometries shall be produced. See \produce_via_geometry for details about the layer production rules. """ produce_obstructions: bool r""" + Getter: @brief Gets a value indicating whether obstruction markers shall be produced. - See \produce_via_geometry for details about the layer production rules.@brief Sets a value indicating whether obstruction markers shall be produced. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets a value indicating whether obstruction markers shall be produced. See \produce_via_geometry for details about the layer production rules. """ produce_pins: bool r""" + Getter: @brief Gets a value indicating whether pin geometries shall be produced. - See \produce_via_geometry for details about the layer production rules.@brief Sets a value indicating whether pin geometries shall be produced. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets a value indicating whether pin geometries shall be produced. See \produce_via_geometry for details about the layer production rules. """ produce_placement_blockages: bool r""" + Getter: @brief Gets a value indicating whether to produce placement blockage regions. - If set to true, polygons will be produced representing the placement blockage region on the layer given by \placement_blockage_layer. @brief Sets a value indicating whether to produce placement blockage regions. + If set to true, polygons will be produced representing the placement blockage region on the layer given by \placement_blockage_layer. + Setter: + @brief Sets a value indicating whether to produce placement blockage regions. See \produce_placement_blockages for details. """ produce_regions: bool r""" + Getter: @brief Gets a value indicating whether to produce regions. If set to true, polygons will be produced representing the regions on the layer given by \region_layer. - The attribute has been introduced in version 0.27.@brief Sets a value indicating whether to produce regions. + The attribute has been introduced in version 0.27. + Setter: + @brief Sets a value indicating whether to produce regions. See \produce_regions for details. The attribute has been introduced in version 0.27. """ produce_routing: bool r""" + Getter: @brief Gets a value indicating whether routing geometry shall be produced. - See \produce_via_geometry for details about the layer production rules.@brief Sets a value indicating whether routing geometry shall be produced. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets a value indicating whether routing geometry shall be produced. See \produce_via_geometry for details about the layer production rules. """ produce_special_routing: bool r""" + Getter: @brief Gets a value indicating whether special routing geometry shall be produced. See \produce_via_geometry for details about the layer production rules. - The differentiation between special and normal routing has been introduced in version 0.27.@brief Sets a value indicating whether special routing geometry shall be produced. + The differentiation between special and normal routing has been introduced in version 0.27. + Setter: + @brief Sets a value indicating whether special routing geometry shall be produced. See \produce_via_geometry for details about the layer production rules. The differentiation between special and normal routing has been introduced in version 0.27. """ produce_via_geometry: bool r""" + Getter: @brief Sets a value indicating whether via geometries shall be produced. If set to true, shapes will be produced for each via. The layer to be produced will be determined from the via layer's name using the suffix provided by \via_geometry_suffix. If there is a specific mapping in the layer mapping table for the via layer including the suffix, the layer/datatype will be taken from the layer mapping table. If there is a mapping to the undecorated via layer, the datatype will be substituted with the \via_geometry_datatype value. If no mapping is defined, a unique number will be assigned to the layer number and the datatype will be taken from the \via_geometry_datatype value. @@ -39186,15 +49524,20 @@ class LEFDEFReaderConfiguration: @li If there is a mapping for 'V1.GEO', the layer and datatype will be taken from there. @/li @li If there is a mapping for 'V1', the layer will be taken from there and the datatype will be taken from \via_geometry_datatype. The name of the produced layer will be 'V1.GEO'. @/li @li If there is no mapping for both, the layer number will be a unique value, the datatype will be taken from \via_geometry_datatype and the layer name will be 'V1.GEO'. @/li@/ul + + Setter: @brief Sets a value indicating whether via geometries shall be produced. See \produce_via_geometry for details. """ read_lef_with_def: bool r""" + Getter: @brief Gets a value indicating whether to read all LEF files in the same directory than the DEF file. If this property is set to true (the default), the DEF reader will automatically consume all LEF files next to the DEF file in addition to the LEF files specified with \lef_files. If set to false, only the LEF files specified with \lef_files will be read. This property has been added in version 0.27. + + Setter: @brief Sets a value indicating whether to read all LEF files in the same directory than the DEF file. See \read_lef_with_def for details about this property. @@ -39202,40 +49545,58 @@ class LEFDEFReaderConfiguration: """ region_layer: str r""" + Getter: @brief Gets the layer on which to produce the regions. This attribute is a string corresponding to the string representation of \LayerInfo. This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \LayerInfo for details.The setter for this attribute is \region_layer=. See also \produce_regions. - The attribute has been introduced in version 0.27.@brief Sets the layer on which to produce the regions. + The attribute has been introduced in version 0.27. + Setter: + @brief Sets the layer on which to produce the regions. See \region_layer for details. The attribute has been introduced in version 0.27. """ routing_datatype: int r""" + Getter: @brief Gets the routing layer datatype value. - See \produce_via_geometry for details about the layer production rules.@brief Sets the routing layer datatype value. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the routing layer datatype value. See \produce_via_geometry for details about the layer production rules. """ routing_datatype_str: str r""" - @hide@hide + Getter: + @hide + Setter: + @hide """ routing_suffix: str r""" + Getter: @brief Gets the routing layer name suffix. - See \produce_via_geometry for details about the layer production rules.@brief Sets the routing layer name suffix. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the routing layer name suffix. See \produce_via_geometry for details about the layer production rules. """ routing_suffix_str: str r""" - @hide@hide + Getter: + @hide + Setter: + @hide """ separate_groups: bool r""" + Getter: @brief Gets a value indicating whether to create separate parent cells for individual groups. If this property is set to true, instances belonging to different groups are separated by putting them into individual parent cells. These parent cells are named after the groups and are put into the master top cell. If this property is set to false (the default), no such group parents will be formed. This property has been added in version 0.27. + + Setter: @brief Sets a value indicating whether to create separate parent cells for individual groups. See \separate_groups for details about this property. @@ -39243,34 +49604,49 @@ class LEFDEFReaderConfiguration: """ special_routing_datatype: int r""" + Getter: @brief Gets the special routing layer datatype value. See \produce_via_geometry for details about the layer production rules. - The differentiation between special and normal routing has been introduced in version 0.27.@brief Sets the special routing layer datatype value. + The differentiation between special and normal routing has been introduced in version 0.27. + Setter: + @brief Sets the special routing layer datatype value. See \produce_via_geometry for details about the layer production rules. The differentiation between special and normal routing has been introduced in version 0.27. """ special_routing_datatype_str: str r""" - @hide@hide + Getter: + @hide + Setter: + @hide """ special_routing_suffix: str r""" + Getter: @brief Gets the special routing layer name suffix. See \produce_via_geometry for details about the layer production rules. - The differentiation between special and normal routing has been introduced in version 0.27.@brief Sets the special routing layer name suffix. + The differentiation between special and normal routing has been introduced in version 0.27. + Setter: + @brief Sets the special routing layer name suffix. See \produce_via_geometry for details about the layer production rules. The differentiation between special and normal routing has been introduced in version 0.27. """ special_routing_suffix_str: str r""" - @hide@hide + Getter: + @hide + Setter: + @hide """ via_cellname_prefix: str r""" + Getter: @brief Gets the via cellname prefix. Vias are represented by cells. The cell name is formed by combining the via cell name prefix and the via name. This property has been added in version 0.27. + + Setter: @brief Sets the via cellname prefix. See \via_cellname_prefix for details about this property. @@ -39278,26 +49654,43 @@ class LEFDEFReaderConfiguration: """ via_geometry_datatype: int r""" + Getter: @brief Gets the via geometry layer datatype value. See \produce_via_geometry for details about this property. + + Setter: @brief Sets the via geometry layer datatype value. See \produce_via_geometry for details about this property. """ via_geometry_datatype_str: str r""" - @hide@hide + Getter: + @hide + Setter: + @hide """ via_geometry_suffix: str r""" + Getter: @brief Gets the via geometry layer name suffix. See \produce_via_geometry for details about this property. + + Setter: @brief Sets the via geometry layer name suffix. See \produce_via_geometry for details about this property. """ via_geometry_suffix_str: str r""" - @hide@hide + Getter: + @hide + Setter: + @hide """ + @classmethod + def new(cls) -> LEFDEFReaderConfiguration: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> LEFDEFReaderConfiguration: r""" @brief Creates a copy of self @@ -39443,11 +49836,28 @@ class LEFDEFReaderConfiguration: Mask specific rules have been introduced in version 0.27. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> LEFDEFReaderConfiguration: r""" @brief Creates a copy of self """ - def fills_datatype_(self, mask: int) -> int: + def fills_datatype(self, mask: int) -> int: r""" @brief Gets the fill geometry layer datatype value per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). @@ -39461,7 +49871,13 @@ class LEFDEFReaderConfiguration: Mask specific rules have been introduced in version 0.27. """ - def lef_pins_datatype_(self, mask: int) -> int: + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def lef_pins_datatype(self, mask: int) -> int: r""" @brief Gets the LEF pin geometry layer datatype value per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). @@ -39475,7 +49891,7 @@ class LEFDEFReaderConfiguration: Mask specific rules have been introduced in version 0.27. """ - def pins_datatype_(self, mask: int) -> int: + def pins_datatype(self, mask: int) -> int: r""" @brief Gets the pin geometry layer datatype value per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). @@ -39489,7 +49905,7 @@ class LEFDEFReaderConfiguration: Mask specific rules have been introduced in version 0.27. """ - def routing_datatype_(self, mask: int) -> int: + def routing_datatype(self, mask: int) -> int: r""" @brief Gets the routing geometry layer datatype value per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). @@ -39589,7 +50005,7 @@ class LEFDEFReaderConfiguration: Mask specific rules have been introduced in version 0.27. """ - def special_routing_datatype_(self, mask: int) -> int: + def special_routing_datatype(self, mask: int) -> int: r""" @brief Gets the special routing geometry layer datatype value per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). @@ -39603,7 +50019,7 @@ class LEFDEFReaderConfiguration: Mask specific rules have been introduced in version 0.27. """ - def via_geometry_datatype_(self, mask: int) -> int: + def via_geometry_datatype(self, mask: int) -> int: r""" @brief Gets the via geometry layer datatype value per mask. See \produce_via_geometry for details about this property. @@ -39717,6 +50133,11 @@ class NetElement: This class has been introduced in version 0.25. """ + @classmethod + def new(cls) -> NetElement: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> NetElement: r""" @brief Creates a copy of self @@ -39774,10 +50195,33 @@ class NetElement: r""" @brief Gets the index of the cell the shape is inside """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> NetElement: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def layer(self) -> int: r""" @brief Gets the index of the layer the shape is on @@ -39822,10 +50266,13 @@ class NetTracer: """ trace_depth: int r""" + Getter: @brief gets the trace depth See \trace_depth= for a description of this property. This method has been introduced in version 0.26.4. + + Setter: @brief Sets the trace depth (shape limit) Set this value to limit the maximum number of shapes delivered. Upon reaching this count, the tracer will stop and report the net as 'incomplete' (see \incomplete?). Setting a trace depth if 0 is equivalent to 'unlimited'. @@ -39833,6 +50280,11 @@ class NetTracer: This method has been introduced in version 0.26.4. """ + @classmethod + def new(cls) -> NetTracer: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> NetTracer: r""" @brief Creates a copy of self @@ -39886,6 +50338,23 @@ class NetTracer: r""" @brief Clears the data from the last extraction """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> NetTracer: r""" @brief Creates a copy of self @@ -39900,6 +50369,12 @@ class NetTracer: @brief Returns a value indicating whether the net is incomplete A net may be incomplete if the extraction has been stopped by the user for example. This attribute is useful only after the extraction has been performed. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def name(self) -> str: r""" @brief Returns the name of the net found during extraction diff --git a/src/pymod/distutils_src/klayout/laycore.pyi b/src/pymod/distutils_src/klayout/laycore.pyi new file mode 100644 index 000000000..8f33d9418 --- /dev/null +++ b/src/pymod/distutils_src/klayout/laycore.pyi @@ -0,0 +1,12905 @@ +from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional +from typing import overload +import klayout.tl as tl +import klayout.db as db +import klayout.rdb as rdb +class PixelBuffer: + r""" + @brief A simplistic pixel buffer representing an image of ARGB32 or RGB32 values + + This object is mainly provided for offline rendering of layouts in Qt-less environments. + It supports a rectangular pixel space with color values encoded in 32bit integers. It supports transparency through an optional alpha channel. The color format for a pixel is "0xAARRGGBB" where 'AA' is the alpha value which is ignored in non-transparent mode. + + This class supports basic operations such as initialization, single-pixel access and I/O to PNG. + + This class has been introduced in version 0.28. + """ + transparent: bool + r""" + Getter: + @brief Gets a flag indicating whether the pixel buffer supports an alpha channel + + Setter: + @brief Sets a flag indicating whether the pixel buffer supports an alpha channel + + By default, the pixel buffer does not support an alpha channel. + """ + @classmethod + def from_png_data(cls, data: bytes) -> PixelBuffer: + r""" + @brief Reads the pixel buffer from a PNG byte stream + This method may not be available if PNG support is not compiled into KLayout. + """ + @classmethod + def from_qimage(cls, qimage: QtGui.QImage_Native) -> PixelBuffer: + r""" + @brief Creates a pixel buffer object from a QImage object + """ + @classmethod + def new(cls, width: int, height: int) -> PixelBuffer: + r""" + @brief Creates a pixel buffer object + + @param width The width in pixels + @param height The height in pixels + + The pixels are basically uninitialized. You will need to use \fill to initialize them to a certain value. + """ + @classmethod + def read_png(cls, file: str) -> PixelBuffer: + r""" + @brief Reads the pixel buffer from a PNG file + This method may not be available if PNG support is not compiled into KLayout. + """ + def __copy__(self) -> PixelBuffer: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Returns a value indicating whether self is identical to the other image + """ + def __init__(self, width: int, height: int) -> None: + r""" + @brief Creates a pixel buffer object + + @param width The width in pixels + @param height The height in pixels + + The pixels are basically uninitialized. You will need to use \fill to initialize them to a certain value. + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Returns a value indicating whether self is not identical to the other image + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: PixelBuffer) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def diff(self, other: PixelBuffer) -> PixelBuffer: + r""" + @brief Creates a difference image + + This method is provided to support transfer of image differences - i.e. small updates instead of full images. It works for non-transparent images only and generates an image with transpareny enabled and with the new pixel values for pixels that have changed. The alpha value will be 0 for identical images and 255 for pixels with different values. This way, the difference image can be painted over the original image to generate the new image. + """ + def dup(self) -> PixelBuffer: + r""" + @brief Creates a copy of self + """ + @overload + def fill(self, color: int) -> None: + r""" + @brief Fills the pixel buffer with the given pixel value + """ + @overload + def fill(self, color: QtGui.QColor) -> None: + r""" + @brief Fills the pixel buffer with the given QColor + """ + def height(self) -> int: + r""" + @brief Gets the height of the pixel buffer in pixels + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def patch(self, other: PixelBuffer) -> None: + r""" + @brief Patches another pixel buffer into this one + + This method is the inverse of \diff - it will patch the difference image created by diff into this pixel buffer. Note that this method will not do true alpha blending and requires the other pixel buffer to have the same format than self. Self will be modified by this operation. + """ + def pixel(self, x: int, y: int) -> int: + r""" + @brief Gets the value of the pixel at position x, y + """ + def set_pixel(self, x: int, y: int, c: int) -> None: + r""" + @brief Sets the value of the pixel at position x, y + """ + def swap(self, other: PixelBuffer) -> None: + r""" + @brief Swaps data with another PixelBuffer object + """ + def to_png_data(self) -> bytes: + r""" + @brief Converts the pixel buffer to a PNG byte stream + This method may not be available if PNG support is not compiled into KLayout. + """ + def to_qimage(self) -> QtGui.QImage_Native: + r""" + @brief Converts the pixel buffer to a \QImage object + """ + def width(self) -> int: + r""" + @brief Gets the width of the pixel buffer in pixels + """ + def write_png(self, file: str) -> None: + r""" + @brief Writes the pixel buffer to a PNG file + This method may not be available if PNG support is not compiled into KLayout. + """ + +class BitmapBuffer: + r""" + @brief A simplistic pixel buffer representing monochrome image + + This object is mainly provided for offline rendering of layouts in Qt-less environments. + It supports a rectangular pixel space with color values encoded in single bits. + + This class supports basic operations such as initialization, single-pixel access and I/O to PNG. + + This class has been introduced in version 0.28. + """ + @classmethod + def from_png_data(cls, data: bytes) -> BitmapBuffer: + r""" + @brief Reads the pixel buffer from a PNG byte stream + This method may not be available if PNG support is not compiled into KLayout. + """ + @classmethod + def from_qimage(cls, qimage: QtGui.QImage_Native) -> BitmapBuffer: + r""" + @brief Creates a pixel buffer object from a QImage object + """ + @classmethod + def new(cls, width: int, height: int) -> BitmapBuffer: + r""" + @brief Creates a pixel buffer object + + @param width The width in pixels + @param height The height in pixels + + The pixels are basically uninitialized. You will need to use \fill to initialize them to a certain value. + """ + @classmethod + def read_png(cls, file: str) -> BitmapBuffer: + r""" + @brief Reads the pixel buffer from a PNG file + This method may not be available if PNG support is not compiled into KLayout. + """ + def __copy__(self) -> BitmapBuffer: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Returns a value indicating whether self is identical to the other image + """ + def __init__(self, width: int, height: int) -> None: + r""" + @brief Creates a pixel buffer object + + @param width The width in pixels + @param height The height in pixels + + The pixels are basically uninitialized. You will need to use \fill to initialize them to a certain value. + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Returns a value indicating whether self is not identical to the other image + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: BitmapBuffer) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> BitmapBuffer: + r""" + @brief Creates a copy of self + """ + def fill(self, color: bool) -> None: + r""" + @brief Fills the pixel buffer with the given pixel value + """ + def height(self) -> int: + r""" + @brief Gets the height of the pixel buffer in pixels + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def pixel(self, x: int, y: int) -> bool: + r""" + @brief Gets the value of the pixel at position x, y + """ + def set_pixel(self, x: int, y: int, c: bool) -> None: + r""" + @brief Sets the value of the pixel at position x, y + """ + def swap(self, other: BitmapBuffer) -> None: + r""" + @brief Swaps data with another BitmapBuffer object + """ + def to_png_data(self) -> bytes: + r""" + @brief Converts the pixel buffer to a PNG byte stream + This method may not be available if PNG support is not compiled into KLayout. + """ + def to_qimage(self) -> QtGui.QImage_Native: + r""" + @brief Converts the pixel buffer to a \QImage object + """ + def width(self) -> int: + r""" + @brief Gets the width of the pixel buffer in pixels + """ + def write_png(self, file: str) -> None: + r""" + @brief Writes the pixel buffer to a PNG file + This method may not be available if PNG support is not compiled into KLayout. + """ + +class MacroExecutionContext: + r""" + @brief Support for various debugger features + + This class implements some features that allow customization of the debugger behavior, specifically the generation of back traces and the handling of exception. These functions are particular useful for implementing DSL interpreters and providing proper error locations in the back traces or to suppress exceptions when re-raising them. + """ + @classmethod + def ignore_next_exception(cls) -> None: + r""" + @brief Ignores the next exception in the debugger + The next exception thrown will be ignored in the debugger. That feature is useful when re-raising exceptions if those new exception shall not appear in the debugger. + """ + @classmethod + def new(cls) -> MacroExecutionContext: + r""" + @brief Creates a new object of this class + """ + @classmethod + def remove_debugger_scope(cls) -> None: + r""" + @brief Removes a debugger scope previously set with \set_debugger_scope + """ + @classmethod + def set_debugger_scope(cls, filename: str) -> None: + r""" + @brief Sets a debugger scope (file level which shall appear in the debugger) + If a debugger scope is set, back traces will be produced starting from that scope. Setting a scope is useful for implementing DSL interpreters and giving a proper hint about the original location of an error. + """ + def __copy__(self) -> MacroExecutionContext: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: MacroExecutionContext) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> MacroExecutionContext: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + +class MacroInterpreter: + r""" + @brief A custom interpreter for a DSL (domain specific language) + + DSL interpreters are a way to provide macros written in a language specific for the application. One example are DRC scripts which are written in some special language optimized for DRC ruledecks. Interpreters for such languages can be built using scripts itself by providing the interpreter implementation through this object. + + An interpreter implementation involves at least these steps: + + @ul + @li Derive a new object from RBA::MacroInterpreter @/li + @li Reimplement the \execute method for the actual execution of the code @/li + @li In the initialize method configure the object using the attribute setters like \suffix= and register the object as DSL interpreter (in that order) @/li + @li Create at least one template macro in the initialize method @/li + @/ul + + Template macros provide a way for the macro editor to present macros for the new interpreter in the list of templates. Template macros can provide menu bindings, shortcuts and some initial text for example + + The simple implementation can be enhanced by providing more information, i.e. syntax highlighter information, the debugger to use etc. This involves reimplementing further methods, i.e. "syntax_scheme". + + This is a simple example for an interpreter in Ruby. Is is registered under the name 'simple-dsl' and just evaluates the script text: + + @code + class SimpleExecutable < RBA::Excutable + + # Constructor + def initialize(macro) + \@macro = macro + end + + # Implements the execute method + def execute + eval(\@macro.text, nil, \@macro.path) + nil + end + + end + + class SimpleInterpreter < RBA::MacroInterpreter + + # Constructor + def initialize + self.description = "A test interpreter" + # Registers the new interpreter + register("simple-dsl") + # create a template for the macro editor: + # Name is "new_simple", the description will be "Simple interpreter macro" + # in the "Special" group. + mt = create_template("new_simple") + mt.description = "Special;;Simple interpreter macro" + end + + # Creates the executable delegate + def executable(macro) + SimpleExecutable::new(macro) + end + + end + + # Register the new interpreter + SimpleInterpreter::new + + @/code + + Please note that such an implementation is dangerous because the evaluation of the script happens in the context of the interpreter object. In this implementation the script could redefine the execute method for example. This implementation is provided as an example only. + A real implementation should add execution of prolog and epilog code inside the execute method and proper error handling. + + In order to make the above code effective, store the code in an macro, set "early auto-run" and restart KLayout. + + This class has been introduced in version 0.23 and modified in 0.27. + """ + MacroFormat: ClassVar[Macro.Format] + r""" + @brief The macro has macro (XML) format + """ + NoDebugger: ClassVar[Macro.Interpreter] + r""" + @brief Indicates no debugging for \debugger_scheme + """ + PlainTextFormat: ClassVar[Macro.Format] + r""" + @brief The macro has plain text format + """ + PlainTextWithHashAnnotationsFormat: ClassVar[Macro.Format] + r""" + @brief The macro has plain text format with special pseudo-comment annotations + """ + RubyDebugger: ClassVar[Macro.Interpreter] + r""" + @brief Indicates Ruby debugger for \debugger_scheme + """ + @property + def debugger_scheme(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the debugger scheme (which debugger to use for the DSL macro) + + The value can be one of the constants \RubyDebugger or \NoDebugger. + + Use this attribute setter in the initializer before registering the interpreter. + + Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for performance reasons in version 0.25. + """ + @property + def description(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets a description string + + This string is used for showing the type of DSL macro in the file selection box together with the suffix for example. + Use this attribute setter in the initializer before registering the interpreter. + + Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for performance reasons in version 0.25. + """ + @property + def storage_scheme(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the storage scheme (the format as which the macro is stored) + + This value indicates how files for this DSL macro type shall be stored. The value can be one of the constants \PlainTextFormat, \PlainTextWithHashAnnotationsFormat and \MacroFormat. + + Use this attribute setter in the initializer before registering the interpreter. + + Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for performance reasons in version 0.25. + """ + @property + def suffix(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the file suffix + + This string defines which file suffix to associate with the DSL macro. If an empty string is given (the default) no particular suffix is assciated with that macro type and "lym" is assumed. + Use this attribute setter in the initializer before registering the interpreter. + + Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for performance reasons in version 0.25. + """ + @property + def supports_include_expansion(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets a value indicating whether this interpreter supports the default include file expansion scheme. + If this value is set to true (the default), lines like '# %include ...' will be substituted by the content of the file following the '%include' keyword. + Set this value to false if you don't want to support this feature. + + This attribute has been introduced in version 0.27. + """ + @property + def syntax_scheme(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets a string indicating the syntax highlighter scheme + + The scheme string can be empty (indicating no syntax highlighting), "ruby" for the Ruby syntax highlighter or another string. In that case, the highlighter will look for a syntax definition under the resource path ":/syntax/.xml". + + Use this attribute setter in the initializer before registering the interpreter. + + Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for performance reasons in version 0.25. + """ + @classmethod + def new(cls) -> MacroInterpreter: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> MacroInterpreter: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: MacroInterpreter) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def create_template(self, url: str) -> Macro: + r""" + @brief Creates a new macro template + @param url The template will be initialized from that URL. + + This method will create a register a new macro template. It returns a \Macro object which can be modified in order to adjust the template (for example to set description, add a content, menu binding, autorun flags etc.) + + This method must be called after \register has called. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> MacroInterpreter: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def register(self, name: str) -> None: + r""" + @brief Registers the macro interpreter + @param name The interpreter name. This is an arbitrary string which should be unique. + + Registration of the interpreter makes the object known to the system. After registration, macros whose interpreter is set to 'dsl' can use this object to run the script. For executing a script, the system will call the interpreter's \execute method. + """ + +class Macro: + r""" + @brief A macro class + + This class is provided mainly to support generation of template macros in the DSL interpreter framework provided by \MacroInterpreter. The implementation may be enhanced in future versions and provide access to macros stored inside KLayout's macro repository. + But it can be used to execute macro code in a consistent way: + + @code + path = "path-to-macro.lym" + RBA::Macro::new(path).run() + @/code + + Using the Macro class with \run for executing code will chose the right interpreter and is able to execute DRC and LVS scripts in the proper environment. This also provides an option to execute Ruby code from Python and vice versa. + + In this scenario you can pass values to the script using \Interpreter#define_variable. The interpreter to choose for DRC and LVS scripts is \Interpreter#ruby_interpreter. For passing values back from the script, wrap the variable value into a \Value object which can be modified by the called script and read back by the caller. + """ + class Format: + r""" + @brief Specifies the format of a macro + This enum has been introduced in version 0.27.5. + """ + MacroFormat: ClassVar[Macro.Format] + r""" + @brief The macro has macro (XML) format + """ + PlainTextFormat: ClassVar[Macro.Format] + r""" + @brief The macro has plain text format + """ + PlainTextWithHashAnnotationsFormat: ClassVar[Macro.Format] + r""" + @brief The macro has plain text format with special pseudo-comment annotations + """ + @overload + @classmethod + def new(cls, i: int) -> Macro.Format: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> Macro.Format: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __lt__(self, other: Macro.Format) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + class Interpreter: + r""" + @brief Specifies the interpreter used for executing a macro + This enum has been introduced in version 0.27.5. + """ + DSLInterpreter: ClassVar[Macro.Interpreter] + r""" + @brief A domain-specific interpreter (DSL) + """ + None_: ClassVar[Macro.Interpreter] + r""" + @brief No specific interpreter + """ + Python: ClassVar[Macro.Interpreter] + r""" + @brief The interpreter is Python + """ + Ruby: ClassVar[Macro.Interpreter] + r""" + @brief The interpreter is Ruby + """ + Text: ClassVar[Macro.Interpreter] + r""" + @brief Plain text + """ + @overload + @classmethod + def new(cls, i: int) -> Macro.Interpreter: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> Macro.Interpreter: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __lt__(self, other: Macro.Interpreter) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + DSLInterpreter: ClassVar[Macro.Interpreter] + r""" + @brief A domain-specific interpreter (DSL) + """ + MacroFormat: ClassVar[Macro.Format] + r""" + @brief The macro has macro (XML) format + """ + None_: ClassVar[Macro.Interpreter] + r""" + @brief No specific interpreter + """ + PlainTextFormat: ClassVar[Macro.Format] + r""" + @brief The macro has plain text format + """ + PlainTextWithHashAnnotationsFormat: ClassVar[Macro.Format] + r""" + @brief The macro has plain text format with special pseudo-comment annotations + """ + Python: ClassVar[Macro.Interpreter] + r""" + @brief The interpreter is Python + """ + Ruby: ClassVar[Macro.Interpreter] + r""" + @brief The interpreter is Ruby + """ + Text: ClassVar[Macro.Interpreter] + r""" + @brief Plain text + """ + category: str + r""" + Getter: + @brief Gets the category tags + + The category tags string indicates to which categories a macro will belong to. This string is only used for templates currently and is a comma-separated list of category names. + Setter: + @brief Sets the category tags string + See \category for details. + """ + description: str + r""" + Getter: + @brief Gets the description text + + The description text of a macro will appear in the macro list. If used as a macro template, the description text can have the format "Group;;Description". In that case, the macro will appear in a group with title "Group". + Setter: + @brief Sets the description text + @param description The description text. + See \description for details. + """ + doc: str + r""" + Getter: + @brief Gets the macro's documentation string + + This method has been introduced in version 0.27.5. + + Setter: + @brief Sets the macro's documentation string + + This method has been introduced in version 0.27.5. + """ + dsl_interpreter: str + r""" + Getter: + @brief Gets the macro's DSL interpreter name (if interpreter is DSLInterpreter) + + This method has been introduced in version 0.27.5. + + Setter: + @brief Sets the macro's DSL interpreter name (if interpreter is DSLInterpreter) + + This method has been introduced in version 0.27.5. + """ + epilog: str + r""" + Getter: + @brief Gets the epilog code + + The epilog is executed after the actual code is executed. Interpretation depends on the implementation of the DSL interpreter for DSL macros. + Setter: + @brief Sets the epilog + See \epilog for details. + """ + format: Macro.Format + r""" + Getter: + @brief Gets the macro's storage format + + This method has been introduced in version 0.27.5. + + Setter: + @brief Sets the macro's storage format + + This method has been introduced in version 0.27.5. + """ + group_name: str + r""" + Getter: + @brief Gets the menu group name + + If a group name is specified and \show_in_menu? is true, the macro will appear in a separate group (separated by a separator) together with other macros sharing the same group. + Setter: + @brief Sets the menu group name + See \group_name for details. + """ + interpreter: Macro.Interpreter + r""" + Getter: + @brief Gets the macro's interpreter + + This method has been introduced in version 0.27.5. + + Setter: + @brief Sets the macro's interpreter + + This method has been introduced in version 0.27.5. + """ + is_autorun: bool + r""" + Getter: + @brief Gets a flag indicating whether the macro is automatically executed on startup + + This method has been introduced in version 0.27.5. + + Setter: + @brief Sets a flag indicating whether the macro is automatically executed on startup + + This method has been introduced in version 0.27.5. + """ + is_autorun_early: bool + r""" + Getter: + @brief Gets a flag indicating whether the macro is automatically executed early on startup + + This method has been introduced in version 0.27.5. + + Setter: + @brief Sets a flag indicating whether the macro is automatically executed early on startup + + This method has been introduced in version 0.27.5. + """ + menu_path: str + r""" + Getter: + @brief Gets the menu path + + If a menu path is specified and \show_in_menu? is true, the macro will appear in the menu at the specified position. + Setter: + @brief Sets the menu path + See \menu_path for details. + """ + prolog: str + r""" + Getter: + @brief Gets the prolog code + + The prolog is executed before the actual code is executed. Interpretation depends on the implementation of the DSL interpreter for DSL macros. + Setter: + @brief Sets the prolog + See \prolog for details. + """ + shortcut: str + r""" + Getter: + @brief Gets the macro's keyboard shortcut + + This method has been introduced in version 0.27.5. + + Setter: + @brief Sets the macro's keyboard shortcut + + This method has been introduced in version 0.27.5. + """ + show_in_menu: bool + r""" + Getter: + @brief Gets a value indicating whether the macro shall be shown in the menu + + Setter: + @brief Sets a value indicating whether the macro shall be shown in the menu + """ + text: str + r""" + Getter: + @brief Gets the macro text + + The text is the code executed by the macro interpreter. Depending on the DSL interpreter, the text can be any kind of code. + Setter: + @brief Sets the macro text + See \text for details. + """ + version: str + r""" + Getter: + @brief Gets the macro's version + + This method has been introduced in version 0.27.5. + + Setter: + @brief Sets the macro's version + + This method has been introduced in version 0.27.5. + """ + @classmethod + def macro_by_path(cls, path: str) -> Macro: + r""" + @brief Finds the macro by installation path + + Returns nil if no macro with this path can be found. + + This method has been added in version 0.26. + """ + @classmethod + def new(cls, path: str) -> Macro: + r""" + @brief Loads the macro from the given file path + + This constructor has been introduced in version 0.27.5. + """ + @classmethod + def real_line(cls, path: str, line: int) -> int: + r""" + @brief Gets the real line number for an include-encoded path and line number + + When using KLayout's include scheme based on '# %include ...', __FILE__ and __LINE__ (Ruby) will not have the proper values but encoded file names. This method allows retrieving the real line number by using + + @code + # Ruby + real_line = RBA::Macro::real_line(__FILE__, __LINE__) + + # Python + real_line = pya::Macro::real_line(__file__, __line__) + @/code + + This substitution is not required for top-level macros as KLayout's interpreter will automatically use this function instead of __FILE__. Call this function when you need __FILE__ from files included through the languages mechanisms such as 'require' or 'load' where this substitution does not happen. + + For Python there is no equivalent for __LINE__, so you always have to use: + + @code + # Pythonimport inspect + real_line = pya.Macro.real_line(__file__, inspect.currentframe().f_back.f_lineno) + @/code + + This feature has been introduced in version 0.27. + """ + @classmethod + def real_path(cls, path: str, line: int) -> str: + r""" + @brief Gets the real path for an include-encoded path and line number + + When using KLayout's include scheme based on '# %include ...', __FILE__ and __LINE__ (Ruby) will not have the proper values but encoded file names. This method allows retrieving the real file by using + + @code + # Ruby + real_file = RBA::Macro::real_path(__FILE__, __LINE__) + @/code + + This substitution is not required for top-level macros as KLayout's interpreter will automatically use this function instead of __FILE__. Call this function when you need __FILE__ from files included through the languages mechanisms such as 'require' or 'load' where this substitution does not happen. + + For Python there is no equivalent for __LINE__, so you always have to use: + + @code + # Pythonimport inspect + real_file = pya.Macro.real_path(__file__, inspect.currentframe().f_back.f_lineno) + @/code + + This feature has been introduced in version 0.27. + """ + def __init__(self, path: str) -> None: + r""" + @brief Loads the macro from the given file path + + This constructor has been introduced in version 0.27.5. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def interpreter_name(self) -> str: + r""" + @brief Gets the macro interpreter name + This is the string version of \interpreter. + + This method has been introduced in version 0.27.5. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def name(self) -> str: + r""" + @brief Gets the name of the macro + + This attribute has been added in version 0.25. + """ + def path(self) -> str: + r""" + @brief Gets the path of the macro + + The path is the path where the macro is stored, starting with an abstract group identifier. The path is used to identify the macro in the debugger for example. + """ + def run(self) -> int: + r""" + @brief Executes the macro + + This method has been introduced in version 0.27.5. + """ + def save_to(self, path: str) -> None: + r""" + @brief Saves the macro to the given file + + This method has been introduced in version 0.27.5. + """ + def sync_properties_with_text(self) -> None: + r""" + @brief Synchronizes the macro properties with the text + + This method performs the reverse process of \sync_text_with_properties. + + This method has been introduced in version 0.27.5. + """ + def sync_text_with_properties(self) -> None: + r""" + @brief Synchronizes the macro text with the properties + + This method applies to PlainTextWithHashAnnotationsFormat format. The macro text will be enhanced with pseudo-comments reflecting the macro properties. This way, the macro properties can be stored in plain files. + + This method has been introduced in version 0.27.5. + """ + +class LayerProperties: + r""" + @brief The layer properties structure + + The layer properties encapsulate the settings relevant for + the display and source of a layer. + + Each attribute is present in two incarnations: local and real. + "real" refers to the effective attribute after collecting the + attributes from the parents to the leaf property node. + In the spirit of this distinction, all read accessors + are present in "local" and "real" form. The read accessors take + a boolean parameter "real" that must be set to true, if the real + value shall be returned. + + "brightness" is a index that indicates how much to make the + color brighter to darker rendering the effective color + (\eff_frame_color, \eff_fill_color). It's value is roughly between + -255 and 255. + """ + animation: int + r""" + Getter: + @brief Gets the animation state + + This method is a convenience method for "animation(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the animation state + + See the description of the \animation method for details about the animation state + """ + dither_pattern: int + r""" + Getter: + @brief Gets the dither pattern index + + This method is a convenience method for "dither_pattern(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the dither pattern index + + The dither pattern index must be one of the valid indices. + The first indices are reserved for built-in pattern, the following ones are custom pattern. + Index 0 is always solid filled and 1 is always the hollow filled pattern. + For custom pattern see \LayoutView#add_stipple. + """ + fill_brightness: int + r""" + Getter: + @brief Gets the fill brightness value + + This method is a convenience method for "fill_brightness(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the fill brightness + + For neutral brightness set this value to 0. For darker colors set it to a negative value (down to -255), for brighter colors to a positive value (up to 255) + """ + fill_color: int + r""" + Getter: + @brief Gets the fill color + + This method is a convenience method for "fill_color(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the fill color to the given value + + The color is a 32bit value encoding the blue value in the lower 8 bits, the green value in the next 8 bits and the red value in the 8 bits above that. + """ + frame_brightness: int + r""" + Getter: + @brief Gets the frame brightness value + + This method is a convenience method for "frame_brightness(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the frame brightness + + For neutral brightness set this value to 0. For darker colors set it to a negative value (down to -255), for brighter colors to a positive value (up to 255) + """ + frame_color: int + r""" + Getter: + @brief Gets the frame color + + This method is a convenience method for "frame_color(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the frame color to the given value + + The color is a 32bit value encoding the blue value in the lower 8 bits, the green value in the next 8 bits and the red value in the 8 bits above that. + """ + line_style: int + r""" + Getter: + @brief Gets the line style index + + This method is a convenience method for "line_style(true)" + + This method has been introduced in version 0.25. + Setter: + @brief Sets the line style index + + The line style index must be one of the valid indices. + The first indices are reserved for built-in pattern, the following ones are custom pattern. + Index 0 is always solid filled. + For custom line styles see \LayoutView#add_line_style. + + This method has been introduced in version 0.25. + """ + lower_hier_level: int + r""" + Getter: + @brief Gets the lower hierarchy level shown + + This method is a convenience method for "lower_hier_level(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the lower hierarchy level + + If this method is called, the lower hierarchy level is enabled. See \lower_hier_level for a description of this property. + """ + marked: bool + r""" + Getter: + @brief Gets the marked state + + This method is a convenience method for "marked?(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the marked state + """ + name: str + r""" + Getter: + @brief Gets the name + + Setter: + @brief Sets the name to the given string + """ + source: str + r""" + Getter: + @brief Gets the source specification + + This method is a convenience method for "source(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Loads the source specification from a string + + Sets the source specification to the given string. The source specification may contain the cellview index, the source layer (given by layer/datatype or layer name), transformation, property selector etc. + This method throws an exception if the specification is not valid. + """ + source_cellview: int + r""" + Getter: + @brief Gets the cellview index that this layer refers to + + This method is a convenience method for "source_cellview(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the cellview index that this layer refers to + + See \cellview for a description of the transformations. + """ + source_datatype: int + r""" + Getter: + @brief Gets the stream datatype that the shapes are taken from + + This method is a convenience method for "source_datatype(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the stream datatype that the shapes are taken from + + See \datatype for a description of this property + """ + source_layer: int + r""" + Getter: + @brief Gets the stream layer that the shapes are taken from + + This method is a convenience method for "source_layer(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the stream layer that the shapes are taken from + + See \source_layer for a description of this property + """ + source_layer_index: int + r""" + Getter: + @brief Gets the stream layer that the shapes are taken from + + This method is a convenience method for "source_layer_index(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the layer index specification that the shapes are taken from + + See \source_layer_index for a description of this property. + """ + source_name: str + r""" + Getter: + @brief Gets the stream name that the shapes are taken from + + This method is a convenience method for "source_name(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the stream layer name that the shapes are taken from + + See \name for a description of this property + """ + trans: List[db.DCplxTrans] + r""" + Getter: + @brief Gets the transformations that the layer is transformed with + + This method is a convenience method for "trans(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the transformations that the layer is transformed with + + See \trans for a description of the transformations. + """ + transparent: bool + r""" + Getter: + @brief Gets the transparency state + + This method is a convenience method for "transparent?(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the transparency state + """ + upper_hier_level: int + r""" + Getter: + @brief Gets the upper hierarchy level shown + + This method is a convenience method for "upper_hier_level(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets a upper hierarchy level + + If this method is called, the upper hierarchy level is enabled. See \upper_hier_level for a description of this property. + """ + valid: bool + r""" + Getter: + @brief Gets the validity state + + This method is a convenience method for "valid?(true)" + + This method has been introduced in version 0.23. + Setter: + @brief Sets the validity state + """ + visible: bool + r""" + Getter: + @brief Gets the visibility state + + This method is a convenience method for "visible?(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the visibility state + """ + width: int + r""" + Getter: + @brief Gets the line width + + This method is a convenience method for "width(true)" + + This method has been introduced in version 0.22. + Setter: + @brief Sets the line width to the given width + """ + xfill: bool + r""" + Getter: + @brief Gets a value indicating whether shapes are drawn with a cross + + This method is a convenience method for "xfill?(true)" + + This attribute has been introduced in version 0.25. + + Setter: + @brief Sets a value indicating whether shapes are drawn with a cross + + This attribute has been introduced in version 0.25. + """ + @classmethod + def new(cls) -> LayerProperties: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> LayerProperties: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Equality + + @param other The other object to compare against + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Inequality + + @param other The other object to compare against + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def animation(self, real: bool) -> int: + r""" + @brief Gets the animation state + + The animation state is an integer either being 0 (static), 1 (scrolling), 2 (blinking) or 3 (inversely blinking) + """ + def assign(self, other: LayerProperties) -> None: + r""" + @brief Assigns another object to self + """ + def cellview(self) -> int: + r""" + @brief Gets the the cellview index + + This is the index of the actual cellview to use. Basically, this method returns \source_cellview in "real" mode. The result may be different, if the cellview is not valid for example. In this case, a negative value is returned. + """ + def clear_dither_pattern(self) -> None: + r""" + @brief Clears the dither pattern + """ + def clear_fill_color(self) -> None: + r""" + @brief Resets the fill color + """ + def clear_frame_color(self) -> None: + r""" + @brief Resets the frame color + """ + def clear_line_style(self) -> None: + r""" + @brief Clears the line style + + This method has been introduced in version 0.25. + """ + def clear_lower_hier_level(self) -> None: + r""" + @brief Clears the lower hierarchy level specification + + See \has_lower_hier_level for a description of this property + """ + def clear_source_name(self) -> None: + r""" + @brief Removes any stream layer name specification from this layer + """ + def clear_upper_hier_level(self) -> None: + r""" + @brief Clears the upper hierarchy level specification + + See \has_upper_hier_level for a description of this property + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dither_pattern(self, real: bool) -> int: + r""" + @brief Gets the dither pattern index + + This method may deliver an invalid dither pattern index if it is not set. + + @param real Set to true to return the real instead of local value + """ + def dup(self) -> LayerProperties: + r""" + @brief Creates a copy of self + """ + @overload + def eff_dither_pattern(self) -> int: + r""" + @brief Gets the effective dither pattern index + + This method is a convenience method for "eff_dither_pattern(true)" + + This method has been introduced in version 0.22. + """ + @overload + def eff_dither_pattern(self, real: bool) -> int: + r""" + @brief Gets the effective dither pattern index + + The effective dither pattern index is always a valid index, even if no dither pattern is set. + @param real Set to true to return the real instead of local value + """ + @overload + def eff_fill_color(self) -> int: + r""" + @brief Gets the effective fill color + + This method is a convenience method for "eff_fill_color(true)" + + This method has been introduced in version 0.22. + """ + @overload + def eff_fill_color(self, real: bool) -> int: + r""" + @brief Gets the effective fill color + + The effective fill color is computed from the frame color brightness and the + frame color. + + @param real Set to true to return the real instead of local value + """ + @overload + def eff_frame_color(self) -> int: + r""" + @brief Gets the effective frame color + + This method is a convenience method for "eff_frame_color(true)" + + This method has been introduced in version 0.22. + """ + @overload + def eff_frame_color(self, real: bool) -> int: + r""" + @brief Gets the effective frame color + + The effective frame color is computed from the frame color brightness and the + frame color. + + @param real Set to true to return the real instead of local value + """ + @overload + def eff_line_style(self) -> int: + r""" + @brief Gets the line style index + + This method is a convenience method for "eff_line_style(true)" + + This method has been introduced in version 0.25. + """ + @overload + def eff_line_style(self, real: bool) -> int: + r""" + @brief Gets the effective line style index + + The effective line style index is always a valid index, even if no line style is set. In that case, a default style index will be returned. + + @param real Set to true to return the real instead of local value + + This method has been introduced in version 0.25. + """ + def fill_brightness(self, real: bool) -> int: + r""" + @brief Gets the fill brightness value + + If the brightness is not set, this method may return an invalid value + + @param real Set to true to return the real instead of local value + """ + def fill_color(self, real: bool) -> int: + r""" + @brief Gets the fill color + + This method may return an invalid color if the color is not set. + + @param real Set to true to return the real instead of local value + """ + def flat(self) -> LayerProperties: + r""" + @brief Returns the "flattened" (effective) layer properties entry for this node + + This method returns a \LayerProperties object that is not embedded into a hierarchy. + This object represents the effective layer properties for the given node. In particular, all 'local' properties are identical to the 'real' properties. Such an object can be used as a basis for manipulations. + This method has been introduced in version 0.22. + """ + def frame_brightness(self, real: bool) -> int: + r""" + @brief Gets the frame brightness value + + If the brightness is not set, this method may return an invalid value + + @param real Set to true to return the real instead of local value + """ + def frame_color(self, real: bool) -> int: + r""" + @brief Gets the frame color + + This method may return an invalid color if the color is not set. + + @param real Set to true to return the real instead of local value + """ + @overload + def has_dither_pattern(self) -> bool: + r""" + @brief True, if the dither pattern is set + + This method is a convenience method for "has_dither_pattern?(true)" + + This method has been introduced in version 0.22. + """ + @overload + def has_dither_pattern(self, real: bool) -> bool: + r""" + @brief True, if the dither pattern is set + """ + @overload + def has_fill_color(self) -> bool: + r""" + @brief True, if the fill color is set + + This method is a convenience method for "has_fill_color?(true)" + + This method has been introduced in version 0.22. + """ + @overload + def has_fill_color(self, real: bool) -> bool: + r""" + @brief True, if the fill color is set + """ + @overload + def has_frame_color(self) -> bool: + r""" + @brief True, if the frame color is set + + This method is a convenience method for "has_frame_color?(true)" + + This method has been introduced in version 0.22. + """ + @overload + def has_frame_color(self, real: bool) -> bool: + r""" + @brief True, if the frame color is set + """ + @overload + def has_line_style(self) -> bool: + r""" + @brief True, if the line style is set + + This method is a convenience method for "has_line_style?(true)" + + This method has been introduced in version 0.25. + """ + @overload + def has_line_style(self, real: bool) -> bool: + r""" + @brief Gets a value indicating whether the line style is set + + This method has been introduced in version 0.25. + """ + @overload + def has_lower_hier_level(self) -> bool: + r""" + @brief Gets a value indicating whether a lower hierarchy level is explicitly specified + + This method is a convenience method for "has_lower_hier_level?(true)" + + This method has been introduced in version 0.22. + """ + @overload + def has_lower_hier_level(self, real: bool) -> bool: + r""" + @brief Gets a value indicating whether a lower hierarchy level is explicitly specified + + If "real" is true, the effective value is returned. + """ + @overload + def has_source_name(self) -> bool: + r""" + @brief Gets a value indicating whether a stream layer name is specified for this layer + + This method is a convenience method for "has_source_name?(true)" + + This method has been introduced in version 0.22. + """ + @overload + def has_source_name(self, real: bool) -> bool: + r""" + @brief Gets a value indicating whether a stream layer name is specified for this layer + + If "real" is true, the effective value is returned. + """ + @overload + def has_upper_hier_level(self) -> bool: + r""" + @brief Gets a value indicating whether an upper hierarchy level is explicitly specified + + This method is a convenience method for "has_upper_hier_level?(true)" + + This method has been introduced in version 0.22. + """ + @overload + def has_upper_hier_level(self, real: bool) -> bool: + r""" + @brief Gets a value indicating whether an upper hierarchy level is explicitly specified + + If "real" is true, the effective value is returned. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def layer_index(self) -> int: + r""" + @brief Gets the the layer index + + This is the index of the actual layer used. The source specification given by \source_layer, \source_datatype, \source_name is evaluated and the corresponding layer is looked up in the layout object. If a \source_layer_index is specified, this layer index is taken as the layer index to use. + """ + def line_style(self, real: bool) -> int: + r""" + @brief Gets the line style index + + This method may deliver an invalid line style index if it is not set (see \has_line_style?). + + @param real Set to true to return the real instead of local value + This method has been introduced in version 0.25. + """ + def lower_hier_level(self, real: bool) -> int: + r""" + @brief Gets the lower hierarchy level shown + + This is the hierarchy level at which the drawing starts. This property is only meaningful, if \has_lower_hier_level is true. The hierarchy level can be relative in which case, 0 refers to the context cell's level. A mode can be specified for the hierarchy level which is 0 for absolute, 1 for minimum of specified level and set level and 2 for maximum of specified level and set level. + """ + @overload + def lower_hier_level_mode(self) -> int: + r""" + @brief Gets the mode for the lower hierarchy level. + + This method is a convenience method for "lower_hier_level_mode(true)" + + This method has been introduced in version 0.22. + """ + @overload + def lower_hier_level_mode(self, arg0: bool) -> int: + r""" + @brief Gets the mode for the lower hierarchy level. + @param real If true, the computed value is returned, otherwise the local node value + + The mode value can be 0 (value is given by \lower_hier_level), 1 for "minimum value" and 2 for "maximum value". + + This method has been introduced in version 0.20. + """ + @overload + def lower_hier_level_relative(self) -> bool: + r""" + @brief Gets a value indicating whether the upper hierarchy level is relative. + + This method is a convenience method for "lower_hier_level_relative(true)" + + This method has been introduced in version 0.22. + """ + @overload + def lower_hier_level_relative(self, real: bool) -> bool: + r""" + @brief Gets a value indicating whether the lower hierarchy level is relative. + + See \lower_hier_level for a description of this property. + + This method has been introduced in version 0.19. + """ + def marked(self, real: bool) -> bool: + r""" + @brief Gets the marked state + """ + @overload + def set_lower_hier_level(self, level: int, relative: bool) -> None: + r""" + @brief Sets the lower hierarchy level and if it is relative to the context cell + + If this method is called, the lower hierarchy level is enabled. See \lower_hier_level for a description of this property. + + This method has been introduced in version 0.19. + """ + @overload + def set_lower_hier_level(self, level: int, relative: bool, mode: int) -> None: + r""" + @brief Sets the lower hierarchy level, whether it is relative to the context cell and the mode + + If this method is called, the lower hierarchy level is enabled. See \lower_hier_level for a description of this property. + + This method has been introduced in version 0.20. + """ + @overload + def set_upper_hier_level(self, level: int, relative: bool) -> None: + r""" + @brief Sets the upper hierarchy level and if it is relative to the context cell + + If this method is called, the upper hierarchy level is enabled. See \upper_hier_level for a description of this property. + + This method has been introduced in version 0.19. + """ + @overload + def set_upper_hier_level(self, level: int, relative: bool, mode: int) -> None: + r""" + @brief Sets the upper hierarchy level, if it is relative to the context cell and the mode + + If this method is called, the upper hierarchy level is enabled. See \upper_hier_level for a description of this property. + + This method has been introduced in version 0.20. + """ + def source(self, real: bool) -> str: + r""" + @brief Gets the source specification + + This method delivers the source specification as a string + + @param real Set to true to return the computed instead of local value + """ + def source_cellview(self, real: bool) -> int: + r""" + @brief Gets the cellview index that this layer refers to + + If "real" is true, the effective value is returned. + """ + def source_datatype(self, real: bool) -> int: + r""" + @brief Gets the stream datatype that the shapes are taken from + + If the datatype is positive, the actual layer is looked up by this stream datatype. If a name or layer index is specified, the stream datatype is not used. + + If "real" is true, the effective value is returned. + """ + def source_layer(self, real: bool) -> int: + r""" + @brief Gets the stream layer that the shapes are taken from + + If the layer is positive, the actual layer is looked up by this stream layer. If a name or layer index is specified, the stream layer is not used. + + If "real" is true, the effective value is returned. + """ + def source_layer_index(self, real: bool) -> int: + r""" + @brief Gets the layer index that the shapes are taken from + + If the layer index is positive, the shapes drawn are taken from this layer rather than searched for by layer and datatype. This property is stronger than the layer/datatype or name specification. + + A different method is \layer_index which indicates the ID of the layer actually used. While "source_layer_index" is one of several ways to address the layer drawn, "layer_index" is the ID (index) of the layer matching the source specification and is >= 0 if such a layer is found. + + If "real" is true, the effective value is returned. + """ + def source_name(self, real: bool) -> str: + r""" + @brief Gets the stream name that the shapes are taken from + + If the name is non-empty, the actual layer is looked up by this stream layer name. If a layer index (see \layer_index) is specified, the stream datatype is not used. + A name is only meaningful for OASIS files. + + If "real" is true, the effective value is returned. + """ + def trans(self, real: bool) -> List[db.DCplxTrans]: + r""" + @brief Gets the transformations that the layer is transformed with + + The transformations returned by this accessor is the one used for displaying this layer. The layout is transformed with each of these transformations before it is drawn. + + If "real" is true, the effective value is returned. + """ + def transparent(self, real: bool) -> bool: + r""" + @brief Gets the transparency state + """ + def upper_hier_level(self, real: bool) -> int: + r""" + @brief Gets the upper hierarchy level shown + + This is the hierarchy level at which the drawing starts. This property is only meaningful, if \has_upper_hier_level is true. The hierarchy level can be relative in which case, 0 refers to the context cell's level. A mode can be specified for the hierarchy level which is 0 for absolute, 1 for minimum of specified level and set level and 2 for maximum of specified level and set level. + """ + @overload + def upper_hier_level_mode(self) -> int: + r""" + @brief Gets the mode for the upper hierarchy level. + + This method is a convenience method for "upper_hier_level_mode(true)" + + This method has been introduced in version 0.22. + """ + @overload + def upper_hier_level_mode(self, real: bool) -> int: + r""" + @brief Gets the mode for the upper hierarchy level. + @param real If true, the computed value is returned, otherwise the local node value + + The mode value can be 0 (value is given by \upper_hier_level), 1 for "minimum value" and 2 for "maximum value". + + This method has been introduced in version 0.20. + """ + @overload + def upper_hier_level_relative(self) -> bool: + r""" + @brief Gets a value indicating whether the upper hierarchy level is relative. + + This method is a convenience method for "upper_hier_level_relative(true)" + + This method has been introduced in version 0.22. + """ + @overload + def upper_hier_level_relative(self, real: bool) -> bool: + r""" + @brief Gets a value indicating whether if the upper hierarchy level is relative. + + See \upper_hier_level for a description of this property. + + This method has been introduced in version 0.19. + """ + def valid(self, real: bool) -> bool: + r""" + @brief Gets the validity state + """ + def visible(self, real: bool) -> bool: + r""" + @brief Gets the visibility state + """ + def width(self, real: bool) -> int: + r""" + @brief Gets the line width + """ + def xfill(self, real: bool) -> bool: + r""" + @brief Gets a value indicating whether shapes are drawn with a cross + + This attribute has been introduced in version 0.25. + """ + +class LayerPropertiesNode(LayerProperties): + r""" + @brief A layer properties node structure + + This class is derived from \LayerProperties. Objects of this class are used + in the hierarchy of layer views that are arranged in a tree while the \LayerProperties + object reflects the properties of a single node. + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Equality + + @param other The other object to compare against + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Inequality + + @param other The other object to compare against + """ + def _assign(self, other: LayerProperties) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _dup(self) -> LayerPropertiesNode: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + @overload + def add_child(self) -> LayerPropertiesNodeRef: + r""" + @brief Add a child entry + @return A reference to the node created + This method allows building a layer properties tree by adding children to node objects. It returns a reference to the node object created which is a freshly initialized one. + + The parameterless version of this method was introduced in version 0.25. + """ + @overload + def add_child(self, child: LayerProperties) -> LayerPropertiesNodeRef: + r""" + @brief Add a child entry + @return A reference to the node created + This method allows building a layer properties tree by adding children to node objects. It returns a reference to the node object created. + + This method was introduced in version 0.22. + """ + def bbox(self) -> db.DBox: + r""" + @brief Compute the bbox of this layer + + This takes the layout and path definition (supported by the + given default layout or path, if no specific is given). + The node must have been attached to a view to make this + operation possible. + + @return A bbox in micron units + """ + def clear_children(self) -> None: + r""" + @brief Clears all children + This method was introduced in version 0.22. + """ + def flat(self) -> LayerPropertiesNode: + r""" + @brief return the "flattened" (effective) layer properties node for this node + + This method returns a \LayerPropertiesNode object that is not embedded into a hierarchy. + This object represents the effective layer properties for the given node. In particular, all 'local' properties are identical to the 'real' properties. Such an object can be used as a basis for manipulations. + + Unlike the name suggests, this node will still contain a hierarchy of nodes below if the original node did so. + """ + def has_children(self) -> bool: + r""" + @brief Test, if there are children + """ + def id(self) -> int: + r""" + @brief Obtain the unique ID + + Each layer properties node object has a unique ID that is created + when a new LayerPropertiesNode object is instantiated. The ID is + copied when the object is copied. The ID can be used to identify the + object irregardless of it's content. + """ + def list_index(self) -> int: + r""" + @brief Gets the index of the layer properties list that the node lives in + """ + def view(self) -> LayoutView: + r""" + @brief Gets the view this node lives in + + This reference can be nil if the node is a orphan node that lives outside a view. + """ + +class LayerPropertiesNodeRef(LayerPropertiesNode): + r""" + @brief A class representing a reference to a layer properties node + + This object is returned by the layer properties iterator's current method (\LayerPropertiesIterator#current). A reference behaves like a layer properties node, but changes in the node are reflected in the view it is attached to. + + A typical use case for references is this: + + @code + # Hides a layers of a view + view = RBA::LayoutView::current + view.each_layer do |lref| + # lref is a LayerPropertiesNodeRef object + lref.visible = false + end + @/code + + This class has been introduced in version 0.25. + """ + def __copy__(self) -> LayerPropertiesNode: + r""" + @brief Creates a \LayerPropertiesNode object as a copy of the content of this node. + This method is mainly provided for backward compatibility with 0.24 and before. + """ + def _assign(self, other: LayerProperties) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _dup(self) -> LayerPropertiesNodeRef: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + @overload + def assign(self, other: LayerProperties) -> None: + r""" + @brief Assigns the contents of the 'other' object to self. + + This version accepts a \LayerPropertiesNode object and allows modification of the layer node's hierarchy. Assignment will reconfigure the layer node in the view. + """ + @overload + def assign(self, other: LayerProperties) -> None: + r""" + @brief Assigns the contents of the 'other' object to self. + + This version accepts a \LayerProperties object. Assignment will change the properties of the layer in the view. + """ + def delete(self) -> None: + r""" + @brief Erases the current node and all child nodes + + After erasing the node, the reference will become invalid. + """ + def dup(self) -> LayerPropertiesNode: + r""" + @brief Creates a \LayerPropertiesNode object as a copy of the content of this node. + This method is mainly provided for backward compatibility with 0.24 and before. + """ + def is_valid(self) -> bool: + r""" + @brief Returns true, if the reference points to a valid layer properties node + + Invalid references behave like ordinary \LayerPropertiesNode objects but without the ability to update the view upon changes of attributes. + """ + +class LayerPropertiesIterator: + r""" + @brief Layer properties iterator + + This iterator provides a flat view for the layers in the layer tree if used with the next method. In this mode it will descend into the hierarchy and deliver node by node as a linear (flat) sequence. + + The iterator can also be used to navigate through the node hierarchy using \next_sibling, \down_first_child, \parent etc. + + The iterator also plays an important role for manipulating the layer properties tree, i.e. by specifying insertion points in the tree for the \LayoutView class. + """ + @classmethod + def new(cls) -> LayerPropertiesIterator: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> LayerPropertiesIterator: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Equality + + @param other The other object to compare against + Returns true, if self and other point to the same layer properties node. Caution: this does not imply that both layer properties nodes sit in the same tab. Just their position in the tree is compared. + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def __lt__(self, other: LayerPropertiesIterator) -> bool: + r""" + @brief Comparison + + @param other The other object to compare against + + @return true, if self points to an object that comes before other + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Inequality + + @param other The other object to compare against + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: LayerPropertiesIterator) -> None: + r""" + @brief Assigns another object to self + """ + def at_end(self) -> bool: + r""" + @brief At-the-end property + + This predicate is true if the iterator is at the end of either all elements or + at the end of the child list (if \down_last_child or \down_first_child is used to iterate). + """ + def at_top(self) -> bool: + r""" + @brief At-the-top property + + This predicate is true if there is no parent node above the node addressed by self. + """ + def child_index(self) -> int: + r""" + @brief Returns the index of the child within the parent + + This method returns the index of that the properties node the iterator points to in the list + of children of it's parent. If the element does not have a parent, the + index of the element in the global list is returned. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def current(self) -> LayerPropertiesNodeRef: + r""" + @brief Returns a reference to the layer properties node that the iterator points to + + Starting with version 0.25, the returned object can be manipulated and the changes will be reflected in the view immediately. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def down_first_child(self) -> LayerPropertiesIterator: + r""" + @brief Move to the first child + + This method moves to the first child of the current element. If there is + no child, \at_end? will be true. Even then, the iterator is sitting at the + the child level and \up can be used to move back. + """ + def down_last_child(self) -> LayerPropertiesIterator: + r""" + @brief Move to the last child + + This method moves behind the last child of the current element. \at_end? will be + true then. Even then, the iterator points to the child level and \up + can be used to move back. + + Despite the name, the iterator does not address the last child, but the position after that child. To actually get the iterator for the last child, use down_last_child and next_sibling(-1). + """ + def dup(self) -> LayerPropertiesIterator: + r""" + @brief Creates a copy of self + """ + def first_child(self) -> LayerPropertiesIterator: + r""" + @brief Returns the iterator pointing to the first child + + If there is no children, the iterator will be a valid insert point but not + point to any valid element. It will report \at_end? = true. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_null(self) -> bool: + r""" + @brief "is null" predicate + + This predicate is true if the iterator is "null". Such an iterator can be + created with the default constructor or by moving a top-level iterator up. + """ + def last_child(self) -> LayerPropertiesIterator: + r""" + @brief Returns the iterator pointing behind the last child + + The iterator will be a valid insert point but not + point to any valid element. It will report \at_end? = true. + + Despite the name, the iterator does not address the last child, but the position after that child. To actually get the iterator for the last child, use last_child and call next_sibling(-1) on that iterator. + """ + def next(self) -> LayerPropertiesIterator: + r""" + @brief Increment operator + + The iterator will be incremented to point to the next layer entry. It will descend into the hierarchy to address child nodes if there are any. + """ + def next_sibling(self, n: int) -> LayerPropertiesIterator: + r""" + @brief Move to the next sibling by a given distance + + + The iterator is moved to the nth next sibling of the current element. Use negative distances to move backward. + """ + def num_siblings(self) -> int: + r""" + @brief Return the number of siblings + + The count includes the current element. More precisely, this property delivers the number of children of the current node's parent. + """ + def parent(self) -> LayerPropertiesIterator: + r""" + @brief Returns the iterator pointing to the parent node + + This method will return an iterator pointing to the parent element. + If there is no parent, the returned iterator will be a null iterator. + """ + def to_sibling(self, n: int) -> LayerPropertiesIterator: + r""" + @brief Move to the sibling with the given index + + + The iterator is moved to the nth sibling by selecting the nth child in the current node's parent. + """ + def up(self) -> LayerPropertiesIterator: + r""" + @brief Move up + + The iterator is moved to point to the current element's parent. + If the current element does not have a parent, the iterator will + become a null iterator. + """ + +class LayoutViewBase: + r""" + @hide + @alias LayoutView + """ + class SelectionMode: + r""" + @brief Specifies how selected objects interact with already selected ones. + + This enum was introduced in version 0.27. + """ + Add: ClassVar[LayoutViewBase.SelectionMode] + r""" + @brief Adds to any existing selection + """ + Invert: ClassVar[LayoutViewBase.SelectionMode] + r""" + @brief Adds to any existing selection, if it's not there yet or removes it from the selection if it's already selected + """ + Replace: ClassVar[LayoutViewBase.SelectionMode] + r""" + @brief Replaces the existing selection + """ + Reset: ClassVar[LayoutViewBase.SelectionMode] + r""" + @brief Removes from any existing selection + """ + @overload + @classmethod + def new(cls, i: int) -> LayoutViewBase.SelectionMode: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> LayoutViewBase.SelectionMode: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __lt__(self, other: LayoutViewBase.SelectionMode) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + Add: ClassVar[LayoutViewBase.SelectionMode] + r""" + @brief Adds to any existing selection + """ + Invert: ClassVar[LayoutViewBase.SelectionMode] + r""" + @brief Adds to any existing selection, if it's not there yet or removes it from the selection if it's already selected + """ + LV_Naked: ClassVar[int] + r""" + @brief With this option, no separate views will be provided + Use this value with the constructor's 'options' argument. + This option is basically equivalent to using \LV_NoLayers+\LV_NoHierarchyPanel+\LV_NoLibrariesView+\LV_NoBookmarksView + + This constant has been introduced in version 0.27. + """ + LV_NoBookmarksView: ClassVar[int] + r""" + @brief With this option, no bookmarks view will be provided (see \bookmarks_frame) + Use this value with the constructor's 'options' argument. + + This constant has been introduced in version 0.27. + """ + LV_NoEditorOptionsPanel: ClassVar[int] + r""" + @brief With this option, no editor options panel will be provided (see \editor_options_frame) + Use this value with the constructor's 'options' argument. + + This constant has been introduced in version 0.27. + """ + LV_NoGrid: ClassVar[int] + r""" + @brief With this option, the grid background is not shown + Use this value with the constructor's 'options' argument. + + This constant has been introduced in version 0.27. + """ + LV_NoHierarchyPanel: ClassVar[int] + r""" + @brief With this option, no cell hierarchy view will be provided (see \hierarchy_control_frame) + Use this value with the constructor's 'options' argument. + + This constant has been introduced in version 0.27. + """ + LV_NoLayers: ClassVar[int] + r""" + @brief With this option, no layers view will be provided (see \layer_control_frame) + Use this value with the constructor's 'options' argument. + + This constant has been introduced in version 0.27. + """ + LV_NoLibrariesView: ClassVar[int] + r""" + @brief With this option, no library view will be provided (see \libraries_frame) + Use this value with the constructor's 'options' argument. + + This constant has been introduced in version 0.27. + """ + LV_NoMove: ClassVar[int] + r""" + @brief With this option, move operations are not supported + Use this value with the constructor's 'options' argument. + + This constant has been introduced in version 0.27. + """ + LV_NoPlugins: ClassVar[int] + r""" + @brief With this option, all plugins are disabled + Use this value with the constructor's 'options' argument. + + This constant has been introduced in version 0.27. + """ + LV_NoPropertiesPopup: ClassVar[int] + r""" + @brief This option disables the properties popup on double click + Use this value with the constructor's 'options' argument. + + This constant has been introduced in version 0.28. + """ + LV_NoSelection: ClassVar[int] + r""" + @brief With this option, objects cannot be selected + Use this value with the constructor's 'options' argument. + + This constant has been introduced in version 0.27. + """ + LV_NoServices: ClassVar[int] + r""" + @brief This option disables all services except the ones for pure viewing + Use this value with the constructor's 'options' argument. + With this option, all manipulation features are disabled, except zooming. + It is equivalent to \LV_NoMove + \LV_NoTracker + \LV_NoSelection + \LV_NoPlugins. + + This constant has been introduced in version 0.27. + """ + LV_NoTracker: ClassVar[int] + r""" + @brief With this option, mouse position tracking is not supported + Use this value with the constructor's 'options' argument. + This option is not useful currently as no mouse tracking support is provided. + + This constant has been introduced in version 0.27. + """ + LV_NoZoom: ClassVar[int] + r""" + @brief With this option, zooming is disabled + Use this value with the constructor's 'options' argument. + + This constant has been introduced in version 0.27. + """ + Replace: ClassVar[LayoutViewBase.SelectionMode] + r""" + @brief Replaces the existing selection + """ + Reset: ClassVar[LayoutViewBase.SelectionMode] + r""" + @brief Removes from any existing selection + """ + @property + def active_setview_index(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Makes the cellview with the given index the active one (shown in hierarchy browser) + See \active_cellview_index. + + This method has been renamed from set_active_cellview_index to active_cellview_index= in version 0.25. The original name is still available, but is deprecated. + """ + current_layer: LayerPropertiesIterator + r""" + Getter: + @brief Gets the current layer view + + Returns the \LayerPropertiesIterator pointing to the current layer view (the one that has the focus). If no layer view is active currently, a null iterator is returned. + + Setter: + @brief Sets the current layer view + + Specifies an \LayerPropertiesIterator pointing to the new current layer view. + + This method has been introduced in version 0.23. + """ + current_layer_list: int + r""" + Getter: + @brief Gets the index of the currently selected layer properties tab + This method has been introduced in version 0.21. + + Setter: + @brief Sets the index of the currently selected layer properties tab + This method has been introduced in version 0.21. + """ + max_hier_levels: int + r""" + Getter: + @brief Returns the maximum hierarchy level up to which to display geometries + + @return The maximum level up to which to display geometries + Setter: + @brief Sets the maximum hierarchy level up to which to display geometries + + @param level The maximum level below which to display something + + This methods allows setting the maximum hierarchy below which to display geometries.This method may cause a redraw if required. + """ + min_hier_levels: int + r""" + Getter: + @brief Returns the minimum hierarchy level at which to display geometries + + @return The minimum level at which to display geometries + Setter: + @brief Sets the minimum hierarchy level at which to display geometries + + @param level The minimum level above which to display something + + This methods allows setting the minimum hierarchy level above which to display geometries.This method may cause a redraw if required. + """ + object_selection: List[ObjectInstPath] + r""" + Getter: + @brief Returns a list of selected objects + This method will deliver an array of \ObjectInstPath objects listing the selected geometrical objects. Other selected objects such as annotations and images will not be contained in that list. + + The list returned is an array of copies of \ObjectInstPath objects. They can be modified, but they will become a new selection only after re-introducing them into the view through \object_selection= or \select_object. + + Another way of obtaining the selected objects is \each_object_selected. + + This method has been introduced in version 0.24. + + Setter: + @brief Sets the list of selected objects + + This method will set the selection of geometrical objects such as shapes and instances. It is the setter which complements the \object_selection method. + + Another way of setting the selection is through \clear_object_selection and \select_object. + + This method has been introduced in version 0.24. + """ + on_active_cellview_changed: None + r""" + Getter: + @brief An event indicating that the active cellview has changed + + If the active cellview is changed by selecting a new one from the drop-down list, this event is triggered. + When this event is triggered, the cellview has already been changed. + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_active_cellview_changed/remove_active_cellview_changed) have been removed in 0.25. + + Setter: + @brief An event indicating that the active cellview has changed + + If the active cellview is changed by selecting a new one from the drop-down list, this event is triggered. + When this event is triggered, the cellview has already been changed. + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_active_cellview_changed/remove_active_cellview_changed) have been removed in 0.25. + """ + on_annotation_changed: None + r""" + Getter: + @brief A event indicating that an annotation has been modified + The argument of the event is the ID of the annotation that was changed. + This event has been added in version 0.25. + + Setter: + @brief A event indicating that an annotation has been modified + The argument of the event is the ID of the annotation that was changed. + This event has been added in version 0.25. + """ + on_annotation_selection_changed: None + r""" + Getter: + @brief A event indicating that the annotation selection has changed + This event has been added in version 0.25. + + Setter: + @brief A event indicating that the annotation selection has changed + This event has been added in version 0.25. + """ + on_annotations_changed: None + r""" + Getter: + @brief A event indicating that annotations have been added or removed + This event has been added in version 0.25. + + Setter: + @brief A event indicating that annotations have been added or removed + This event has been added in version 0.25. + """ + on_cell_visibility_changed: None + r""" + Getter: + @brief An event indicating that the visibility of one or more cells has changed + + This event is triggered after the visibility of one or more cells has changed. + + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_cell_visibility_observer/remove_cell_visibility_observer) have been removed in 0.25. + + Setter: + @brief An event indicating that the visibility of one or more cells has changed + + This event is triggered after the visibility of one or more cells has changed. + + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_cell_visibility_observer/remove_cell_visibility_observer) have been removed in 0.25. + """ + on_cellview_changed: None + r""" + Getter: + @brief An event indicating that a cellview has changed + + If a cellview is modified, this event is triggered. + When this event is triggered, the cellview have already been changed. + The integer parameter of this event will indicate the cellview that has changed. + + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_cellview_observer/remove_cellview_observer) have been removed in 0.25. + + Setter: + @brief An event indicating that a cellview has changed + + If a cellview is modified, this event is triggered. + When this event is triggered, the cellview have already been changed. + The integer parameter of this event will indicate the cellview that has changed. + + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_cellview_observer/remove_cellview_observer) have been removed in 0.25. + """ + on_cellviews_changed: None + r""" + Getter: + @brief An event indicating that the cellview collection has changed + + If new cellviews are added or cellviews are removed, this event is triggered. + When this event is triggered, the cellviews have already been changed. + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_cellview_list_observer/remove_cellview_list_observer) have been removed in 0.25. + + Setter: + @brief An event indicating that the cellview collection has changed + + If new cellviews are added or cellviews are removed, this event is triggered. + When this event is triggered, the cellviews have already been changed. + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_cellview_list_observer/remove_cellview_list_observer) have been removed in 0.25. + """ + on_current_layer_list_changed: None + r""" + Getter: + @brief An event indicating the current layer list (the selected tab) has changed + @param index The index of the new current layer list + + This event is triggered after the current layer list was changed - i.e. a new tab was selected. + + This event was introduced in version 0.25. + + Setter: + @brief An event indicating the current layer list (the selected tab) has changed + @param index The index of the new current layer list + + This event is triggered after the current layer list was changed - i.e. a new tab was selected. + + This event was introduced in version 0.25. + """ + on_file_open: None + r""" + Getter: + @brief An event indicating that a file was opened + + If a file is loaded, this event is triggered. + When this event is triggered, the file was already loaded and the new file is the new active cellview. + Despite it's name, this event is also triggered if a layout object is loaded into the view. + + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_file_open_observer/remove_file_open_observer) have been removed in 0.25. + + Setter: + @brief An event indicating that a file was opened + + If a file is loaded, this event is triggered. + When this event is triggered, the file was already loaded and the new file is the new active cellview. + Despite it's name, this event is also triggered if a layout object is loaded into the view. + + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_file_open_observer/remove_file_open_observer) have been removed in 0.25. + """ + on_image_changed: None + r""" + Getter: + @brief A event indicating that an image has been modified + The argument of the event is the ID of the image that was changed. + This event has been added in version 0.25. + + Setter: + @brief A event indicating that an image has been modified + The argument of the event is the ID of the image that was changed. + This event has been added in version 0.25. + """ + on_image_selection_changed: None + r""" + Getter: + @brief A event indicating that the image selection has changed + This event has been added in version 0.25. + + Setter: + @brief A event indicating that the image selection has changed + This event has been added in version 0.25. + """ + on_images_changed: None + r""" + Getter: + @brief A event indicating that images have been added or removed + This event has been added in version 0.25. + + Setter: + @brief A event indicating that images have been added or removed + This event has been added in version 0.25. + """ + on_l2ndb_list_changed: None + r""" + Getter: + @brief An event that is triggered the list of netlist databases is changed + + If a netlist database is added or removed, this event is triggered. + + This method has been added in version 0.26. + Setter: + @brief An event that is triggered the list of netlist databases is changed + + If a netlist database is added or removed, this event is triggered. + + This method has been added in version 0.26. + """ + on_layer_list_changed: None + r""" + Getter: + @brief An event indicating that the layer list has changed + + This event is triggered after the layer list has changed it's configuration. + The integer argument gives a hint about the nature of the changed: + Bit 0 is set, if the properties (visibility, color etc.) of one or more layers have changed. Bit 1 is + set if the hierarchy has changed. Bit 2 is set, if layer names have changed. + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_layer_list_observer/remove_layer_list_observer) have been removed in 0.25. + + Setter: + @brief An event indicating that the layer list has changed + + This event is triggered after the layer list has changed it's configuration. + The integer argument gives a hint about the nature of the changed: + Bit 0 is set, if the properties (visibility, color etc.) of one or more layers have changed. Bit 1 is + set if the hierarchy has changed. Bit 2 is set, if layer names have changed. + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_layer_list_observer/remove_layer_list_observer) have been removed in 0.25. + """ + on_layer_list_deleted: None + r""" + Getter: + @brief An event indicating that a layer list (a tab) has been removed + @param index The index of the layer list that was removed + + This event is triggered after the layer list has been removed - i.e. a tab was deleted. + + This event was introduced in version 0.25. + + Setter: + @brief An event indicating that a layer list (a tab) has been removed + @param index The index of the layer list that was removed + + This event is triggered after the layer list has been removed - i.e. a tab was deleted. + + This event was introduced in version 0.25. + """ + on_layer_list_inserted: None + r""" + Getter: + @brief An event indicating that a layer list (a tab) has been inserted + @param index The index of the layer list that was inserted + + This event is triggered after the layer list has been inserted - i.e. a new tab was created. + + This event was introduced in version 0.25. + + Setter: + @brief An event indicating that a layer list (a tab) has been inserted + @param index The index of the layer list that was inserted + + This event is triggered after the layer list has been inserted - i.e. a new tab was created. + + This event was introduced in version 0.25. + """ + on_rdb_list_changed: None + r""" + Getter: + @brief An event that is triggered the list of report databases is changed + + If a report database is added or removed, this event is triggered. + + This event was translated from the Observer pattern to an event in version 0.25. + Setter: + @brief An event that is triggered the list of report databases is changed + + If a report database is added or removed, this event is triggered. + + This event was translated from the Observer pattern to an event in version 0.25. + """ + on_selection_changed: None + r""" + Getter: + @brief An event that is triggered if the selection is changed + + If the selection changed, this event is triggered. + + This event was translated from the Observer pattern to an event in version 0.25. + Setter: + @brief An event that is triggered if the selection is changed + + If the selection changed, this event is triggered. + + This event was translated from the Observer pattern to an event in version 0.25. + """ + on_transient_selection_changed: None + r""" + Getter: + @brief An event that is triggered if the transient selection is changed + + If the transient selection is changed, this event is triggered. + The transient selection is the highlighted selection when the mouse hovers over some object(s). + This event was translated from the Observer pattern to an event in version 0.25. + Setter: + @brief An event that is triggered if the transient selection is changed + + If the transient selection is changed, this event is triggered. + The transient selection is the highlighted selection when the mouse hovers over some object(s). + This event was translated from the Observer pattern to an event in version 0.25. + """ + on_viewport_changed: None + r""" + Getter: + @brief An event indicating that the viewport (the visible rectangle) has changed + + This event is triggered after a new display rectangle was chosen - for example, because the user zoomed into the layout. + + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_viewport_changed_observer/remove_viewport_changed_observer) have been removed in 0.25. + + Setter: + @brief An event indicating that the viewport (the visible rectangle) has changed + + This event is triggered after a new display rectangle was chosen - for example, because the user zoomed into the layout. + + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_viewport_changed_observer/remove_viewport_changed_observer) have been removed in 0.25. + """ + title: str + r""" + Getter: + @brief Returns the view's title string + + @return The title string + + The title string is either a string composed of the file names loaded (in some "readable" manner) or a customized title string set by \set_title. + Setter: + @brief Sets the title of the view + + @param title The title string to use + + Override the standard title of the view indicating the file names loaded by the specified title string. The title string can be reset with \reset_title to the standard title again. + """ + @classmethod + def menu_symbols(cls) -> List[str]: + r""" + @brief Gets all available menu symbols (see \call_menu). + NOTE: currently this method delivers a superset of all available symbols. Depending on the context, no all symbols may trigger actual functionality. + + This method has been introduced in version 0.27. + """ + @classmethod + def new(cls) -> LayoutViewBase: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def active_cellview(self) -> CellView: + r""" + @brief Gets the active cellview (shown in hierarchy browser) + + This is a convenience method which is equivalent to cellview(active_cellview_index()). + + This method has been introduced in version 0.19. + Starting from version 0.25, the returned object can be manipulated which will have an immediate effect on the display. + """ + def active_cellview_index(self) -> int: + r""" + @brief Gets the index of the active cellview (shown in hierarchy browser) + """ + def add_l2ndb(self, db: db.LayoutToNetlist) -> int: + r""" + @brief Adds the given netlist database to the view + + This method will add an existing database to the view. It will then appear in the netlist database browser. + A similar method is \create_l2ndb which will create a new database within the view. + + @return The index of the database within the view (see \l2ndb) + + This method has been added in version 0.26. + """ + @overload + def add_line_style(self, name: str, string: str) -> int: + r""" + @brief Adds a custom line style from a string + + @param name The name under which this pattern will appear in the style editor + @param string A string describing the bits of the pattern ('.' for missing pixel, '*' for a set pixel) + @return The index of the newly created style, which can be used as the line style index of \LayerProperties. + This method has been introduced in version 0.25. + """ + @overload + def add_line_style(self, name: str, data: int, bits: int) -> int: + r""" + @brief Adds a custom line style + + @param name The name under which this pattern will appear in the style editor + @param data A bit set with the new line style pattern (bit 0 is the leftmost pixel) + @param bits The number of bits to be used + @return The index of the newly created style, which can be used as the line style index of \LayerProperties. + This method has been introduced in version 0.25. + """ + def add_lvsdb(self, db: db.LayoutVsSchematic) -> int: + r""" + @brief Adds the given database to the view + + This method will add an existing database to the view. It will then appear in the netlist database browser. + A similar method is \create_lvsdb which will create a new database within the view. + + @return The index of the database within the view (see \lvsdb) + + This method has been added in version 0.26. + """ + def add_missing_layers(self) -> None: + r""" + @brief Adds new layers to layer list + This method was introduced in version 0.19. + """ + def add_rdb(self, db: rdb.ReportDatabase) -> int: + r""" + @brief Adds the given report database to the view + + This method will add an existing database to the view. It will then appear in the marker database browser. + A similar method is \create_rdb which will create a new database within the view. + + @return The index of the database within the view (see \rdb) + + This method has been added in version 0.26. + """ + @overload + def add_stipple(self, name: str, string: str) -> int: + r""" + @brief Adds a stipple pattern given by a string + + 'string' is a string describing the pattern. It consists of one or more lines composed of '.' or '*' characters and separated by newline characters. A '.' is for a missing pixel and '*' for a set pixel. The length of each line must be the same. Blanks before or after each line are ignored. + + @param name The name under which this pattern will appear in the stipple editor + @param string See above + @return The index of the newly created stipple pattern, which can be used as the dither pattern index of \LayerProperties. + This method has been introduced in version 0.25. + """ + @overload + def add_stipple(self, name: str, data: Sequence[int], bits: int) -> int: + r""" + @brief Adds a stipple pattern + + 'data' is an array of unsigned integers describing the bits that make up the stipple pattern. If the array has less than 32 entries, the pattern will be repeated vertically. The number of bits used can be less than 32 bit which can be specified by the 'bits' parameter. Logically, the pattern will be put at the end of the list. + + @param name The name under which this pattern will appear in the stipple editor + @param data See above + @param bits See above + @return The index of the newly created stipple pattern, which can be used as the dither pattern index of \LayerProperties. + """ + def annotation(self, id: int) -> Annotation: + r""" + @brief Gets the annotation given by an ID + Returns a reference to the annotation given by the respective ID or an invalid annotation if the ID is not valid. + Use \Annotation#is_valid? to determine whether the returned annotation is valid or not. + + The returned annotation is a 'live' object and changing it will update the view. + + This method has been introduced in version 0.25. + """ + def annotation_templates(self) -> List[List[Any]]: + r""" + @brief Gets a list of \Annotation objects representing the annotation templates. + + Annotation templates are the rulers available in the ruler drop-down (preset ruler types). This method will fetch the templates available. This method returns triplets '(annotation, title, mode)'. The first member of the triplet is the annotation object representing the template. The second member is the title string displayed in the menu for this templates. The third member is the mode value (one of the RulerMode... constants - e.g \RulerModeNormal). + + The positions of the returned annotation objects are undefined. + + This method has been introduced in version 0.28. + """ + def ascend(self, index: int) -> db.InstElement: + r""" + @brief Ascends upwards in the hierarchy. + + Removes one element from the specific path of the cellview with the given index. Returns the element removed. + """ + @overload + def begin_layers(self) -> LayerPropertiesIterator: + r""" + @brief Begin iterator for the layers + + This iterator delivers the layers of this view, either in a recursive or non-recursive + fashion, depending which iterator increment methods are used. + The iterator delivered by \end_layers is the past-the-end iterator. It can be compared + against a current iterator to check, if there are no further elements. + + Starting from version 0.25, an alternative solution is provided with 'each_layer' which is based on the \LayerPropertiesNodeRef class. + """ + @overload + def begin_layers(self, index: int) -> LayerPropertiesIterator: + r""" + @brief Begin iterator for the layers + + This iterator delivers the layers of this view, either in a recursive or non-recursive + fashion, depending which iterator increment methods are used. + The iterator delivered by \end_layers is the past-the-end iterator. It can be compared + against a current iterator to check, if there are no further elements. + This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method has been introduced in version 0.21. + """ + def box(self) -> db.DBox: + r""" + @brief Returns the displayed box in micron space + """ + def call_menu(self, symbol: str) -> None: + r""" + @brief Calls the menu item with the provided symbol. + To obtain all symbols, use \menu_symbols. + + This method has been introduced in version 0.27. + """ + def cancel(self) -> None: + r""" + @brief Cancels all edit operations + + This method will stop all pending edit operations (i.e. drag and drop) and cancel the current selection. Calling this method is useful to ensure there are no potential interactions with the script's functionality. + """ + def cellview(self, cv_index: int) -> CellView: + r""" + @brief Gets the cellview object for a given index + + @param cv_index The cellview index for which to get the object for + + Starting with version 0.25, this method returns a \CellView object that can be manipulated to directly reflect any changes in the display. + """ + def cellviews(self) -> int: + r""" + @brief Gets the number of cellviews + """ + def clear_annotations(self) -> None: + r""" + @brief Clears all annotations on this view + """ + def clear_config(self) -> None: + r""" + @brief Clears the local configuration parameters + + See \set_config for a description of the local configuration parameters. + """ + def clear_images(self) -> None: + r""" + @brief Clear all images on this view + """ + @overload + def clear_layers(self) -> None: + r""" + @brief Clears all layers + """ + @overload + def clear_layers(self, index: int) -> None: + r""" + @brief Clears all layers for the given layer properties list + This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method has been introduced in version 0.21. + """ + def clear_line_styles(self) -> None: + r""" + @brief Removes all custom line styles + All line styles except the fixed ones are removed. If any of the custom styles is still used by the layers displayed, the results will be undefined. + This method has been introduced in version 0.25. + """ + def clear_object_selection(self) -> None: + r""" + @brief Clears the selection of geometrical objects (shapes or cell instances) + The selection of other objects (such as annotations and images) will not be affected. + + This method has been introduced in version 0.24 + """ + def clear_selection(self) -> None: + r""" + @brief Clears the selection of all objects (shapes, annotations, images ...) + + This method has been introduced in version 0.26.2 + """ + def clear_stipples(self) -> None: + r""" + @brief Removes all custom line styles + All stipple pattern except the fixed ones are removed. If any of the custom stipple pattern is still used by the layers displayed, the results will be undefined. + """ + def clear_transactions(self) -> None: + r""" + @brief Clears all transactions + + Discard all actions in the undo buffer. After clearing that buffer, no undo is available. It is important to clear the buffer when making database modifications outside transactions, i.e after that modifications have been done. If failing to do so, 'undo' operations are likely to produce invalid results. + This method was introduced in version 0.16. + """ + def clear_transient_selection(self) -> None: + r""" + @brief Clears the transient selection (mouse-over hightlights) of all objects (shapes, annotations, images ...) + + This method has been introduced in version 0.26.2 + """ + def commit(self) -> None: + r""" + @brief Ends a transaction + + See \transaction for a detailed description of transactions. + This method was introduced in version 0.16. + """ + def commit_config(self) -> None: + r""" + @brief Commits the configuration settings + + Some configuration options are queued for performance reasons and become active only after 'commit_config' has been called. After a sequence of \set_config calls, this method should be called to activate the settings made by these calls. + + This method has been introduced in version 0.25. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def create_l2ndb(self, name: str) -> int: + r""" + @brief Creates a new netlist database and returns the index of the new database + @param name The name of the new netlist database + @return The index of the new database + This method returns an index of the new netlist database. Use \l2ndb to get the actual object. If a netlist database with the given name already exists, a unique name will be created. + The name will be replaced by the file name when a file is loaded into the netlist database. + + This method has been added in version 0.26. + """ + @overload + def create_layout(self, add_cellview: bool) -> int: + r""" + @brief Creates a new, empty layout + + The add_cellview parameter controls whether to create a new cellview (true) + or clear all cellviews before (false). + + This version will associate the new layout with the default technology. + + @return The index of the cellview created. + """ + @overload + def create_layout(self, tech: str, add_cellview: bool) -> int: + r""" + @brief Create a new, empty layout and associate it with the given technology + + The add_cellview parameter controls whether to create a new cellview (true) + or clear all cellviews before (false). + + @return The index of the cellview created. + + This variant has been introduced in version 0.22. + """ + @overload + def create_layout(self, tech: str, add_cellview: bool, init_layers: bool) -> int: + r""" + @brief Create a new, empty layout and associate it with the given technology + + The add_cellview parameter controls whether to create a new cellview (true) + or clear all cellviews before (false). This variant also allows one to control whether the layer properties are + initialized (init_layers = true) or not (init_layers = false). + + @return The index of the cellview created. + + This variant has been introduced in version 0.22. + """ + def create_lvsdb(self, name: str) -> int: + r""" + @brief Creates a new netlist database and returns the index of the new database + @param name The name of the new netlist database + @return The index of the new database + This method returns an index of the new netlist database. Use \lvsdb to get the actual object. If a netlist database with the given name already exists, a unique name will be created. + The name will be replaced by the file name when a file is loaded into the netlist database. + + This method has been added in version 0.26. + """ + def create_measure_ruler(self, point: db.DPoint, ac: Optional[int] = ...) -> Annotation: + r""" + @brief Createas an auto-measure ruler at the given point. + + @param point The seed point where to create the auto-measure ruler + @param ac The orientation constraints (determines the search direction too) + + The \ac parameters takes one of the Angle... constants from \Annotation. + + This method will create a ruler with a measurement, looking to the sides of the seed point for visible layout in the vicinity. The angle constraint determines the main directions where to look. If suitable edges are found, the method will pull a line between the closest edges. The ruler's endpoints will sit on these lines and the ruler's length will be the distance. + Only visible layers will participate in the measurement. + + The new ruler is inserted into the view already. It is created with the default style of rulers. + If the measurement fails because there is no layout in the vicinity, a ruler with identical start and end points will be created. + + @return The new ruler object + + This method was introduced in version 0.26. + """ + def create_rdb(self, name: str) -> int: + r""" + @brief Creates a new report database and returns the index of the new database + @param name The name of the new report database + @return The index of the new database + This method returns an index of the new report database. Use \rdb to get the actual object. If a report database with the given name already exists, a unique name will be created. + The name will be replaced by the file name when a file is loaded into the report database. + """ + @overload + def delete_layer(self, iter: LayerPropertiesIterator) -> None: + r""" + @brief Deletes the layer properties node specified by the iterator + + This method deletes the object that the iterator points to and invalidates + the iterator since the object that the iterator points to is no longer valid. + """ + @overload + def delete_layer(self, index: int, iter: LayerPropertiesIterator) -> None: + r""" + @brief Deletes the layer properties node specified by the iterator + + This method deletes the object that the iterator points to and invalidates + the iterator since the object that the iterator points to is no longer valid. + This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method has been introduced in version 0.21. + """ + def delete_layer_list(self, index: int) -> None: + r""" + @brief Deletes the given properties list + At least one layer properties list must remain. This method may change the current properties list. + This method has been introduced in version 0.21. + """ + @overload + def delete_layers(self, iterators: Sequence[LayerPropertiesIterator]) -> None: + r""" + @brief Deletes the layer properties nodes specified by the iterator + + This method deletes the nodes specifies by the iterators. This method is the most convenient way to delete multiple entries. + + This method has been added in version 0.22. + """ + @overload + def delete_layers(self, index: int, iterators: Sequence[LayerPropertiesIterator]) -> None: + r""" + @brief Deletes the layer properties nodes specified by the iterator + + This method deletes the nodes specifies by the iterators. This method is the most convenient way to delete multiple entries. + This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method has been introduced in version 0.22. + """ + def descend(self, path: Sequence[db.InstElement], index: int) -> None: + r""" + @brief Descends further into the hierarchy. + + Adds the given path (given as an array of InstElement objects) to the specific path of the cellview with the given index. In effect, the cell addressed by the terminal of the new path components can be shown in the context of the upper cells, if the minimum hierarchy level is set to a negative value. + The path is assumed to originate from the current cell and contain specific instances sorted from top to bottom. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def each_annotation(self) -> Iterator[Annotation]: + r""" + @brief Iterates over all annotations attached to this view + """ + def each_annotation_selected(self) -> Iterator[Annotation]: + r""" + @brief Iterate over each selected annotation objects, yielding a \Annotation object for each of them + This method was introduced in version 0.19. + """ + def each_image(self) -> Iterator[Image]: + r""" + @brief Iterate over all images attached to this view + + With version 0.25, the objects returned by the iterator are references and can be manipulated to change their appearance. + """ + def each_image_selected(self) -> Iterator[Image]: + r""" + @brief Iterate over each selected image object, yielding a \Image object for each of them + This method was introduced in version 0.19. + """ + @overload + def each_layer(self) -> Iterator[LayerPropertiesNodeRef]: + r""" + @brief Hierarchically iterates over the layers in the first layer list + + This iterator will recursively deliver the layers in the first layer list of the view. The objects presented by the iterator are \LayerPropertiesNodeRef objects. They can be manipulated to apply changes to the layer settings or even the hierarchy of layers: + + @code + RBA::LayoutViewBase::current.each_layer do |lref| + # lref is a RBA::LayerPropertiesNodeRef object + lref.visible = false + end + @/code + + This method was introduced in version 0.25. + """ + @overload + def each_layer(self, layer_list: int) -> Iterator[LayerPropertiesNodeRef]: + r""" + @brief Hierarchically iterates over the layers in the given layer list + + This version of this method allows specification of the layer list to be iterated over. The layer list is specified by it's index which is a value between 0 and \num_layer_lists-1.For details see the parameter-less version of this method. + + This method was introduced in version 0.25. + """ + def each_object_selected(self) -> Iterator[ObjectInstPath]: + r""" + @brief Iterates over each selected geometrical object, yielding a \ObjectInstPath object for each of them + + This iterator will deliver const objects - they cannot be modified. In order to modify the selection, create a copy of the \ObjectInstPath objects, modify them and install the new selection using \select_object or \object_selection=. + + Another way of obtaining the selection is \object_selection, which returns an array of \ObjectInstPath objects. + """ + def each_object_selected_transient(self) -> Iterator[ObjectInstPath]: + r""" + @brief Iterates over each geometrical objects in the transient selection, yielding a \ObjectInstPath object for each of them + + This method was introduced in version 0.18. + """ + def enable_edits(self, enable: bool) -> None: + r""" + @brief Enables or disables edits + + @param enable Enable edits if set to true + + This method allows putting the view into read-only mode by disabling all edit functions. For doing so, this method has to be called with a 'false' argument. Calling it with a 'true' parameter enables all edits again. This method must not be confused with the edit/viewer mode. The LayoutView's enable_edits method is intended to temporarily disable all menu entries and functions which could allow the user to alter the database. + In 0.25, this method has been moved from MainWindow to LayoutView. + """ + @overload + def end_layers(self) -> LayerPropertiesIterator: + r""" + @brief End iterator for the layers + See \begin_layers for a description about this iterator + """ + @overload + def end_layers(self, index: int) -> LayerPropertiesIterator: + r""" + @brief End iterator for the layers + See \begin_layers for a description about this iterator + This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method has been introduced in version 0.21. + """ + def erase_annotation(self, id: int) -> None: + r""" + @brief Erases the annotation given by the id + Deletes an existing annotation given by the id parameter. The id of an annotation can be obtained through \Annotation#id. + + This method has been introduced in version 0.24. + Starting with version 0.25, the annotation's \Annotation#delete method can also be used to delete an annotation. + """ + def erase_cellview(self, index: int) -> None: + r""" + @brief Erases the cellview with the given index + + This closes the given cellview and unloads the layout associated with it, unless referred to by another cellview. + """ + def erase_image(self, id: int) -> None: + r""" + @brief Erase the given image + @param id The id of the object to erase + + Erases the image with the given Id. The Id can be obtained with if "id" method of the image object. + + This method has been introduced in version 0.20. + + With version 0.25, \Image#delete can be used to achieve the same results. + """ + @overload + def expand_layer_properties(self) -> None: + r""" + @brief Expands the layer properties for all tabs + + This method will expand all wildcard specifications in the layer properties by iterating over the specified objects (i.e. layers, cellviews) and by replacing default colors and stipples by the ones specified with the palettes. + + This method was introduced in version 0.21. + """ + @overload + def expand_layer_properties(self, index: int) -> None: + r""" + @brief Expands the layer properties for the given tab + + This method will expand all wildcard specifications in the layer properties by iterating over the specified objects (i.e. layers, cellviews) and by replacing default colors and stipples by the ones specified with the palettes. + + This method was introduced in version 0.21. + """ + def get_config(self, name: str) -> str: + r""" + @brief Gets the value of a local configuration parameter + + @param name The name of the configuration parameter whose value shall be obtained (a string) + + @return The value of the parameter + + See \set_config for a description of the local configuration parameters. + """ + def get_config_names(self) -> List[str]: + r""" + @brief Gets the configuration parameter names + + @return A list of configuration parameter names + + This method returns the names of all known configuration parameters. These names can be used to get and set configuration parameter values. + + This method was introduced in version 0.25. + """ + def get_current_cell_path(self, cv_index: int) -> List[int]: + r""" + @brief Gets the cell path of the current cell + + The current cell is the one highlighted in the browser with the focus rectangle. The + current path is returned for the cellview given by cv_index. + The cell path is a list of cell indices from the top cell to the current cell. + + @param cv_index The cellview index for which to get the current path from (usually this will be the active cellview index) + This method is was deprecated in version 0.25 since from then, the \CellView object can be used to obtain an manipulate the selected cell. + """ + def get_image(self, width: int, height: int) -> QtGui.QImage_Native: + r""" + @brief Gets the layout image as a \QImage + + @param width The width of the image to render in pixel. + @param height The height of the image to render in pixel. + + The image contains the current scene (layout, annotations etc.). + The image is drawn synchronously with the given width and height. Drawing may take some time. + """ + def get_image_with_options(self, width: int, height: int, linewidth: Optional[int] = ..., oversampling: Optional[int] = ..., resolution: Optional[float] = ..., target: Optional[db.DBox] = ..., monochrome: Optional[bool] = ...) -> QtGui.QImage_Native: + r""" + @brief Gets the layout image as a \QImage (with options) + + @param width The width of the image to render in pixel. + @param height The height of the image to render in pixel. + @param linewidth The width of a line in pixels (usually 1) or 0 for default. + @param oversampling The oversampling factor (1..3) or 0 for default. + @param resolution The resolution (pixel size compared to a screen pixel size, i.e 1/oversampling) or 0 for default. + @param target_box The box to draw or an empty box for default. + @param monochrome If true, monochrome images will be produced. + + The image contains the current scene (layout, annotations etc.). + The image is drawn synchronously with the given width and height. Drawing may take some time. Monochrome images don't have background or annotation objects currently. + + This method has been introduced in 0.23.10. + """ + def get_line_style(self, index: int) -> str: + r""" + @brief Gets the line style string for the style with the given index + + This method will return the line style string for the style with the given index. + The format of the string is the same than the string accepted by \add_line_style. + An empty string corresponds to 'solid line'. + + This method has been introduced in version 0.25. + """ + def get_pixels(self, width: int, height: int) -> PixelBuffer: + r""" + @brief Gets the layout image as a \PixelBuffer + + @param width The width of the image to render in pixel. + @param height The height of the image to render in pixel. + + The image contains the current scene (layout, annotations etc.). + The image is drawn synchronously with the given width and height. Drawing may take some time. + This method has been introduced in 0.28. + """ + def get_pixels_with_options(self, width: int, height: int, linewidth: Optional[int] = ..., oversampling: Optional[int] = ..., resolution: Optional[float] = ..., target: Optional[db.DBox] = ...) -> PixelBuffer: + r""" + @brief Gets the layout image as a \PixelBuffer (with options) + + @param width The width of the image to render in pixel. + @param height The height of the image to render in pixel. + @param linewidth The width of a line in pixels (usually 1) or 0 for default. + @param oversampling The oversampling factor (1..3) or 0 for default. + @param resolution The resolution (pixel size compared to a screen pixel size, i.e 1/oversampling) or 0 for default. + @param target_box The box to draw or an empty box for default. + + The image contains the current scene (layout, annotations etc.). + The image is drawn synchronously with the given width and height. Drawing may take some time. + This method has been introduced in 0.28. + """ + def get_pixels_with_options_mono(self, width: int, height: int, linewidth: Optional[int] = ..., target: Optional[db.DBox] = ...) -> BitmapBuffer: + r""" + @brief Gets the layout image as a \PixelBuffer (with options) + + @param width The width of the image to render in pixel. + @param height The height of the image to render in pixel. + @param linewidth The width of a line in pixels (usually 1) or 0 for default. + @param target_box The box to draw or an empty box for default. + + The image contains the current scene (layout, annotations etc.). + The image is drawn synchronously with the given width and height. Drawing may take some time. Monochrome images don't have background or annotation objects currently. + + This method has been introduced in 0.28. + """ + def get_screenshot(self) -> QtGui.QImage_Native: + r""" + @brief Gets a screenshot as a \QImage + + Getting the image requires the drawing to be complete. Ideally, synchronous mode is switched on for the application to guarantee this condition. The image will have the size of the viewport showing the current layout. + """ + def get_screenshot_pixels(self) -> PixelBuffer: + r""" + @brief Gets a screenshot as a \PixelBuffer + + Getting the image requires the drawing to be complete. Ideally, synchronous mode is switched on for the application to guarantee this condition. The image will have the size of the viewport showing the current layout. + This method has been introduced in 0.28. + """ + def get_stipple(self, index: int) -> str: + r""" + @brief Gets the stipple pattern string for the pattern with the given index + + This method will return the stipple pattern string for the pattern with the given index. + The format of the string is the same than the string accepted by \add_stipple. + + This method has been introduced in version 0.25. + """ + def has_annotation_selection(self) -> bool: + r""" + @brief Returns true, if annotations (rulers) are selected in this view + This method was introduced in version 0.19. + """ + def has_image_selection(self) -> bool: + r""" + @brief Returns true, if images are selected in this view + This method was introduced in version 0.19. + """ + def has_object_selection(self) -> bool: + r""" + @brief Returns true, if geometrical objects (shapes or cell instances) are selected in this view + """ + def has_selection(self) -> bool: + r""" + @brief Indicates whether any objects are selected + + This method has been introduced in version 0.27 + """ + def has_transient_object_selection(self) -> bool: + r""" + @brief Returns true, if geometrical objects (shapes or cell instances) are selected in this view in the transient selection + + The transient selection represents the objects selected when the mouse hovers over the layout windows. This selection is not used for operations but rather to indicate which object would be selected if the mouse is clicked. + + This method was introduced in version 0.18. + """ + def hide_cell(self, cell_index: int, cv_index: int) -> None: + r""" + @brief Hides the given cell for the given cellview + """ + def image(self, id: int) -> Image: + r""" + @brief Gets the image given by an ID + Returns a reference to the image given by the respective ID or an invalid image if the ID is not valid. + Use \Image#is_valid? to determine whether the returned image is valid or not. + + The returned image is a 'live' object and changing it will update the view. + + This method has been introduced in version 0.25. + """ + def init_layer_properties(self, props: LayerProperties) -> None: + r""" + @brief Fills the layer properties for a new layer + + This method initializes a layer properties object's color and stipples according to the defaults for the given layer source specification. The layer's source must be set already on the layer properties object. + + This method was introduced in version 0.19. + + @param props The layer properties object to initialize. + """ + def insert_annotation(self, obj: Annotation) -> None: + r""" + @brief Inserts an annotation object into the given view + Inserts a new annotation into the view. Existing annotation will remain. Use \clear_annotations to delete them before inserting new ones. Use \replace_annotation to replace an existing one with a new one. + Starting with version 0.25 this method modifies self's ID to reflect the ID of the ruler created. After an annotation is inserted into the view, it can be modified and the changes of properties will become reflected immediately in the view. + """ + def insert_image(self, obj: Image) -> None: + r""" + @brief Insert an image object into the given view + Insert the image object given by obj into the view. + + With version 0.25, this method will attach the image object to the view and the image object will become a 'live' object - i.e. changes to the object will change the appearance of the image on the screen. + """ + @overload + def insert_layer(self, iter: LayerPropertiesIterator, node: Optional[LayerProperties] = ...) -> LayerPropertiesNodeRef: + r""" + @brief Inserts the given layer properties node into the list before the given position + + This method inserts the new properties node before the position given by "iter" and returns a const reference to the element created. The iterator that specified the position will remain valid after the node was inserted and will point to the newly created node. It can be used to add further nodes. To add children to the node inserted, use iter.last_child as insertion point for the next insert operations. + + Since version 0.22, this method accepts LayerProperties and LayerPropertiesNode objects. A LayerPropertiesNode object can contain a hierarchy of further nodes. + Since version 0.26 the node parameter is optional and the reference returned by this method can be used to set the properties of the new node. + """ + @overload + def insert_layer(self, index: int, iter: LayerPropertiesIterator, node: Optional[LayerProperties] = ...) -> LayerPropertiesNodeRef: + r""" + @brief Inserts the given layer properties node into the list before the given position + + This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method inserts the new properties node before the position given by "iter" and returns a const reference to the element created. The iterator that specified the position will remain valid after the node was inserted and will point to the newly created node. It can be used to add further nodes. + This method has been introduced in version 0.21. + Since version 0.22, this method accepts LayerProperties and LayerPropertiesNode objects. A LayerPropertiesNode object can contain a hierarchy of further nodes. + Since version 0.26 the node parameter is optional and the reference returned by this method can be used to set the properties of the new node. + """ + def insert_layer_list(self, index: int) -> None: + r""" + @brief Inserts a new layer properties list at the given index + This method inserts a new tab at the given position. The current layer properties list will be changed to the new list. + This method has been introduced in version 0.21. + """ + def is_cell_hidden(self, cell_index: int, cv_index: int) -> bool: + r""" + @brief Returns true, if the cell is hidden + + @return True, if the cell with "cell_index" is hidden for the cellview "cv_index" + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_editable(self) -> bool: + r""" + @brief Returns true if the view is in editable mode + + This read-only attribute has been added in version 0.27.5. + """ + def is_transacting(self) -> bool: + r""" + @brief Indicates if a transaction is ongoing + + See \transaction for a detailed description of transactions. + This method was introduced in version 0.16. + """ + def l2ndb(self, index: int) -> db.LayoutToNetlist: + r""" + @brief Gets the netlist database with the given index + @return The \LayoutToNetlist object or nil if the index is not valid + This method has been added in version 0.26. + """ + @overload + def load_layer_props(self, fn: str) -> None: + r""" + @brief Loads the layer properties + + @param fn The file name of the .lyp file to load + + Load the layer properties from the file given in "fn" + """ + @overload + def load_layer_props(self, fn: str, add_default: bool) -> None: + r""" + @brief Loads the layer properties with options + + @param fn The file name of the .lyp file to load + @param add_default If true, default layers will be added for each other layer in the layout + + Load the layer properties from the file given in "fn". + This version allows one to specify whether defaults should be used for all other layers by setting "add_default" to true. + + This variant has been added on version 0.21. + """ + @overload + def load_layer_props(self, fn: str, cv_index: int, add_default: bool) -> None: + r""" + @brief Loads the layer properties with options + + @param fn The file name of the .lyp file to load + @param cv_index See description text + @param add_default If true, default layers will be added for each other layer in the layout + + Load the layer properties from the file given in "fn". + This version allows one to specify whether defaults should be used for all other layers by setting "add_default" to true. It can be used to load the layer properties for a specific cellview by setting "cv_index" to the index for which the layer properties file should be applied. All present definitions for this layout will be removed before the properties file is loaded. "cv_index" can be set to -1. In that case, the layer properties file is applied to each of the layouts individually. + + Note that this version will override all cellview index definitions in the layer properties file. + + This variant has been added on version 0.21. + """ + @overload + def load_layout(self, filename: str, add_cellview: Optional[bool] = ...) -> int: + r""" + @brief Loads a (new) file into the layout view + + Loads the file given by the "filename" parameter. + The add_cellview param controls whether to create a new cellview (true) + or clear all cellviews before (false). + + @return The index of the cellview loaded. The 'add_cellview' argument has been made optional in version 0.28. + """ + @overload + def load_layout(self, filename: str, options: db.LoadLayoutOptions, add_cellview: Optional[bool] = ...) -> int: + r""" + @brief Loads a (new) file into the layout view + + Loads the file given by the "filename" parameter. + The options specify various options for reading the file. + The add_cellview param controls whether to create a new cellview (true) + or clear all cellviews before (false). + + @return The index of the cellview loaded. + + This method has been introduced in version 0.18. The 'add_cellview' argument has been made optional in version 0.28. + """ + @overload + def load_layout(self, filename: str, technology: str, add_cellview: Optional[bool] = ...) -> int: + r""" + @brief Loads a (new) file into the layout view with the given technology + + Loads the file given by the "filename" parameter and associates it with the given technology. + The add_cellview param controls whether to create a new cellview (true) + or clear all cellviews before (false). + + @return The index of the cellview loaded. + + This version has been introduced in version 0.22. The 'add_cellview' argument has been made optional in version 0.28. + """ + @overload + def load_layout(self, filename: str, options: db.LoadLayoutOptions, technology: str, add_cellview: Optional[bool] = ...) -> int: + r""" + @brief Loads a (new) file into the layout view with the given technology + + Loads the file given by the "filename" parameter and associates it with the given technology. + The options specify various options for reading the file. + The add_cellview param controls whether to create a new cellview (true) + or clear all cellviews before (false). + + @return The index of the cellview loaded. + + This version has been introduced in version 0.22. The 'add_cellview' argument has been made optional in version 0.28. + """ + def lvsdb(self, index: int) -> db.LayoutVsSchematic: + r""" + @brief Gets the netlist database with the given index + @return The \LayoutVsSchematic object or nil if the index is not valid + This method has been added in version 0.26. + """ + def max_hier(self) -> None: + r""" + @brief Selects all hierarchy levels available + + Show the layout in full depth down to the deepest level of hierarchy. This method may cause a redraw. + """ + def menu(self) -> AbstractMenu: + r""" + @brief Gets the \AbstractMenu associated with this view. + + In normal UI application mode this is the main window's view. For a detached view or in non-UI applications this is the view's private menu. + + This method has been introduced in version 0.28. + """ + def mode_name(self) -> str: + r""" + @brief Gets the name of the current mode. + + See \switch_mode about a method to change the mode and \mode_names for a method to retrieve all available mode names. + + This method has been introduced in version 0.28. + """ + def mode_names(self) -> List[str]: + r""" + @brief Gets the names of the available modes. + + This method allows asking the view for the available mode names for \switch_mode and for the value returned by \mode. + + This method has been introduced in version 0.28. + """ + def netlist_browser(self) -> NetlistBrowserDialog: + r""" + @brief Gets the netlist browser object for the given layout view + + + This method has been added in version 0.27. + """ + def num_l2ndbs(self) -> int: + r""" + @brief Gets the number of netlist databases loaded into this view + @return The number of \LayoutToNetlist objects present in this view + + This method has been added in version 0.26. + """ + def num_layer_lists(self) -> int: + r""" + @brief Gets the number of layer properties tabs present + This method has been introduced in version 0.23. + """ + def num_rdbs(self) -> int: + r""" + @brief Gets the number of report databases loaded into this view + @return The number of \ReportDatabase objects present in this view + """ + def pan_center(self, p: db.DPoint) -> None: + r""" + @brief Pans to the given point + + The window is positioned such that "p" becomes the new center + """ + def pan_down(self) -> None: + r""" + @brief Pans down + """ + def pan_left(self) -> None: + r""" + @brief Pans to the left + """ + def pan_right(self) -> None: + r""" + @brief Pans to the right + """ + def pan_up(self) -> None: + r""" + @brief Pans upward + """ + def rdb(self, index: int) -> rdb.ReportDatabase: + r""" + @brief Gets the report database with the given index + @return The \ReportDatabase object or nil if the index is not valid + """ + def register_annotation_template(self, annotation: BasicAnnotation, title: str, mode: Optional[int] = ...) -> None: + r""" + @brief Registers the given annotation as a template for this particular view + @annotation The annotation to use for the template (positions are ignored) + @param title The title to use for the ruler template + @param mode The mode the ruler will be created in (see Ruler... constants) + + See \Annotation#register_template for a method doing the same on application level. This method is hardly useful normally, but can be used when customizing layout views as individual widgets. + + This method has been added in version 0.28. + """ + def reload_layout(self, cv: int) -> None: + r""" + @brief Reloads the given cellview + + @param cv The index of the cellview to reload + """ + def remove_l2ndb(self, index: int) -> None: + r""" + @brief Removes a netlist database with the given index + @param The index of the netlist database to remove from this view + This method has been added in version 0.26. + """ + def remove_line_style(self, index: int) -> None: + r""" + @brief Removes the line style with the given index + The line styles with an index less than the first custom style. If a style is removed that is still used, the results are undefined. + + This method has been introduced in version 0.25. + """ + def remove_rdb(self, index: int) -> None: + r""" + @brief Removes a report database with the given index + @param The index of the report database to remove from this view + """ + def remove_stipple(self, index: int) -> None: + r""" + @brief Removes the stipple pattern with the given index + The pattern with an index less than the first custom pattern cannot be removed. If a stipple pattern is removed that is still used, the results are undefined. + """ + def remove_unused_layers(self) -> None: + r""" + @brief Removes unused layers from layer list + This method was introduced in version 0.19. + """ + def rename_cellview(self, name: str, index: int) -> None: + r""" + @brief Renames the cellview with the given index + + If the name is not unique, a unique name will be constructed from the name given. + The name may be different from the filename but is associated with the layout object. + If a layout is shared between multiple cellviews (which may happen due to a clone of the layout view + for example), all cellviews are renamed. + """ + def rename_layer_list(self, index: int, name: str) -> None: + r""" + @brief Sets the title of the given layer properties tab + This method has been introduced in version 0.21. + """ + def replace_annotation(self, id: int, obj: Annotation) -> None: + r""" + @brief Replaces the annotation given by the id with the new one + Replaces an existing annotation given by the id parameter with the new one. The id of an annotation can be obtained through \Annotation#id. + + This method has been introduced in version 0.24. + """ + def replace_image(self, id: int, new_obj: Image) -> None: + r""" + @brief Replace an image object with the new image + + @param id The id of the object to replace + @param new_obj The new object to replace the old one + + Replaces the image with the given Id with the new object. The Id can be obtained with if "id" method of the image object. + + This method has been introduced in version 0.20. + """ + def replace_l2ndb(self, db_index: int, db: db.LayoutToNetlist) -> int: + r""" + @brief Replaces the netlist database with the given index + + If the index is not valid, the database will be added to the view (see \add_lvsdb). + + @return The index of the database within the view (see \lvsdb) + + This method has been added in version 0.26. + """ + @overload + def replace_layer_node(self, iter: LayerPropertiesIterator, node: LayerProperties) -> None: + r""" + @brief Replaces the layer node at the position given by "iter" with a new one + + Since version 0.22, this method accepts LayerProperties and LayerPropertiesNode objects. A LayerPropertiesNode object can contain a hierarchy of further nodes. + """ + @overload + def replace_layer_node(self, index: int, iter: LayerPropertiesIterator, node: LayerProperties) -> None: + r""" + @brief Replaces the layer node at the position given by "iter" with a new one + This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. + This method has been introduced in version 0.21. + Since version 0.22, this method accepts LayerProperties and LayerPropertiesNode objects. A LayerPropertiesNode object can contain a hierarchy of further nodes. + """ + def replace_lvsdb(self, db_index: int, db: db.LayoutVsSchematic) -> int: + r""" + @brief Replaces the database with the given index + + If the index is not valid, the database will be added to the view (see \add_lvsdb). + + @return The index of the database within the view (see \lvsdb) + + This method has been added in version 0.26. + """ + def replace_rdb(self, db_index: int, db: rdb.ReportDatabase) -> int: + r""" + @brief Replaces the report database with the given index + + If the index is not valid, the database will be added to the view (see \add_rdb). + + @return The index of the database within the view (see \rdb) + + This method has been added in version 0.26. + """ + def reset_title(self) -> None: + r""" + @brief Resets the title to the standard title + + See \set_title and \title for a description about how titles are handled. + """ + def resize(self, arg0: int, arg1: int) -> None: + r""" + @brief Resizes the layout view to the given dimension + + This method has been made available in all builds in 0.28. + """ + @overload + def save_as(self, index: int, filename: str, options: db.SaveLayoutOptions) -> None: + r""" + @brief Saves a layout to the given stream file + + @param index The cellview index of the layout to save. + @param filename The file to write. + @param options Writer options. + + The layout with the given index is written to the stream file with the given options. 'options' is a \SaveLayoutOptions object that specifies which format to write and further options such as scaling factor etc. + Calling this method is equivalent to calling 'write' on the respective layout object. + + If the file name ends with a suffix ".gz" or ".gzip", the file is compressed with the zlib algorithm. + """ + @overload + def save_as(self, index: int, filename: str, gzip: bool, options: db.SaveLayoutOptions) -> None: + r""" + @brief Saves a layout to the given stream file + + @param index The cellview index of the layout to save. + @param filename The file to write. + @param gzip Ignored. + @param options Writer options. + + The layout with the given index is written to the stream file with the given options. 'options' is a \SaveLayoutOptions object that specifies which format to write and further options such as scaling factor etc. + Calling this method is equivalent to calling 'write' on the respective layout object. + + This method is deprecated starting from version 0.23. The compression mode is determined from the file name automatically and the \gzip parameter is ignored. + """ + def save_image(self, filename: str, width: int, height: int) -> None: + r""" + @brief Saves the layout as an image to the given file + + @param filename The file to which to write the screenshot to. + @param width The width of the image to render in pixel. + @param height The height of the image to render in pixel. + + The image contains the current scene (layout, annotations etc.). + The image is written as a PNG file to the given file. The image is drawn synchronously with the given width and height. Drawing may take some time. + """ + def save_image_with_options(self, filename: str, width: int, height: int, linewidth: Optional[int] = ..., oversampling: Optional[int] = ..., resolution: Optional[float] = ..., target: Optional[db.DBox] = ..., monochrome: Optional[bool] = ...) -> None: + r""" + @brief Saves the layout as an image to the given file (with options) + + @param filename The file to which to write the screenshot to. + @param width The width of the image to render in pixel. + @param height The height of the image to render in pixel. + @param linewidth The line width scale factor (usually 1) or 0 for 1/resolution. + @param oversampling The oversampling factor (1..3) or 0 for the oversampling the view was configured with. + @param resolution The resolution (pixel size compared to a screen pixel) or 0 for 1/oversampling. + @param target_box The box to draw or an empty box for default. + @param monochrome If true, monochrome images will be produced. + + The image contains the current scene (layout, annotations etc.). + The image is written as a PNG file to the given file. The image is drawn synchronously with the given width and height. Drawing may take some time. Monochrome images don't have background or annotation objects currently. + + The 'linewidth' factor scales the layout style line widths. + + The 'oversampling' factor will use multiple passes passes to create a single image pixels. An oversampling factor of 2 uses 2x2 virtual pixels to generate an output pixel. This results in a smoother image. This however comes with a corresponding memory and run time penalty. When using oversampling, you can set linewidth and resolution to 0. This way, line widths and stipple pattern are scaled such that the resulting image is equivalent to the standard image. + + The 'resolution' is the pixel size used to translate font sizes and stipple pattern. A resolution of 0.5 renders twice as large fonts and stipple pattern. When combining this value with an oversampling factor of 2 and a line width factor of 2, the resulting image is an oversampled version of the standard image. + + Examples: + + @code + # standard image 500x500 pixels (oversampling as configured in the view) + layout_view.save_image_with_options("image.png", 500, 500) + + # 2x oversampled image with 500x500 pixels + layout_view.save_image_with_options("image.png", 500, 500, 0, 2, 0) + + # 2x scaled image with 1000x1000 pixels + layout_view.save_image_with_options("image.png", 1000, 1000, 2, 1, 0.5) + @/code + + This method has been introduced in 0.23.10. + """ + def save_layer_props(self, fn: str) -> None: + r""" + @brief Saves the layer properties + + Save the layer properties to the file given in "fn" + """ + def save_screenshot(self, filename: str) -> None: + r""" + @brief Saves a screenshot to the given file + + @param filename The file to which to write the screenshot to. + + The screenshot is written as a PNG file to the given file. This requires the drawing to be complete. Ideally, synchronous mode is switched on for the application to guarantee this condition. The image will have the size of the viewport showing the current layout. + """ + def select_all(self) -> None: + r""" + @brief Selects all objects from the view + + This method has been introduced in version 0.27 + """ + def select_cell(self, cell_index: int, cv_index: int) -> None: + r""" + @brief Selects a cell by index for a certain cell view + + Select the current (top) cell by specifying a path (a list of cell indices from top to the actual cell) and the cellview index for which this cell should become the currently shown one. + This method selects the cell to be drawn. In constrast, the \set_current_cell_path method selects the cell that is highlighted in the cell tree (but not necessarily drawn). + This method is was deprecated in version 0.25 since from then, the \CellView object can be used to obtain an manipulate the selected cell. + """ + def select_cell_path(self, cell_index: Sequence[int], cv_index: int) -> None: + r""" + @brief Selects a cell by cell index for a certain cell view + + Select the current (top) cell by specifying a cell indexand the cellview index for which this cell should become the currently shown one. The path to the cell is constructed by selecting one that leads to a top cell. + This method selects the cell to be drawn. In constrast, the \set_current_cell_path method selects the cell that is highlighted in the cell tree (but not necessarily drawn). + This method is was deprecated in version 0.25 since from then, the \CellView object can be used to obtain an manipulate the selected cell. + """ + @overload + def select_from(self, box: db.DBox, mode: Optional[LayoutViewBase.SelectionMode] = ...) -> None: + r""" + @brief Selects the objects from a given box + + The mode indicates whether to add to the selection, replace the selection, remove from selection or invert the selected status of the objects found inside the given box. + + This method has been introduced in version 0.27 + """ + @overload + def select_from(self, point: db.DPoint, mode: Optional[LayoutViewBase.SelectionMode] = ...) -> None: + r""" + @brief Selects the objects from a given point + + The mode indicates whether to add to the selection, replace the selection, remove from selection or invert the selected status of the objects found around the given point. + + This method has been introduced in version 0.27 + """ + def select_object(self, obj: ObjectInstPath) -> None: + r""" + @brief Adds the given selection to the list of selected objects + + The selection provided by the \ObjectInstPath descriptor is added to the list of selected objects. + To clear the previous selection, use \clear_object_selection. + + The selection of other objects (such as annotations and images) will not be affected. + + Another way of selecting objects is \object_selection=. + + This method has been introduced in version 0.24 + """ + def selected_cells_paths(self, cv_index: int) -> List[List[int]]: + r""" + @brief Gets the paths of the selected cells + + Gets a list of cell paths to the cells selected in the cellview given by \cv_index. The "selected cells" are the ones selected in the cell list or cell tree. This is not the "current cell" which is the one that is shown in the layout window. + + The cell paths are arrays of cell indexes where the last element is the actual cell selected. + + This method has be introduced in version 0.25. + """ + def selected_layers(self) -> List[LayerPropertiesIterator]: + r""" + @brief Gets the selected layers + + Returns an array of \LayerPropertiesIterator objects pointing to the currently selected layers. If no layer view is selected currently, an empty array is returned. + """ + def selection_bbox(self) -> db.DBox: + r""" + @brief Returns the bounding box of the current selection + + This method has been introduced in version 0.26.2 + """ + def selection_size(self) -> int: + r""" + @brief Returns the number of selected objects + + This method has been introduced in version 0.27 + """ + def send_enter_event(self) -> None: + r""" + @brief Sends a mouse window leave event + + This method is intended to emulate the mouse mouse window leave events sent by Qt normally in environments where Qt is not present. + This method was introduced in version 0.28. + """ + def send_key_press_event(self, key: int, buttons: int) -> None: + r""" + @brief Sends a key press event + + This method is intended to emulate the key press events sent by Qt normally in environments where Qt is not present. The arguments follow the conventions used within \Plugin#key_event for example. + + This method was introduced in version 0.28. + """ + def send_leave_event(self) -> None: + r""" + @brief Sends a mouse window leave event + + This method is intended to emulate the mouse mouse window leave events sent by Qt normally in environments where Qt is not present. + This method was introduced in version 0.28. + """ + def send_mouse_double_clicked_event(self, pt: db.DPoint, buttons: int) -> None: + r""" + @brief Sends a mouse button double-click event + + This method is intended to emulate the mouse button double-click events sent by Qt normally in environments where Qt is not present. The arguments follow the conventions used within \Plugin#mouse_move_event for example. + + This method was introduced in version 0.28. + """ + def send_mouse_move_event(self, pt: db.DPoint, buttons: int) -> None: + r""" + @brief Sends a mouse move event + + This method is intended to emulate the mouse move events sent by Qt normally in environments where Qt is not present. The arguments follow the conventions used within \Plugin#mouse_move_event for example. + + This method was introduced in version 0.28. + """ + def send_mouse_press_event(self, pt: db.DPoint, buttons: int) -> None: + r""" + @brief Sends a mouse button press event + + This method is intended to emulate the mouse button press events sent by Qt normally in environments where Qt is not present. The arguments follow the conventions used within \Plugin#mouse_move_event for example. + + This method was introduced in version 0.28. + """ + def send_mouse_release_event(self, pt: db.DPoint, buttons: int) -> None: + r""" + @brief Sends a mouse button release event + + This method is intended to emulate the mouse button release events sent by Qt normally in environments where Qt is not present. The arguments follow the conventions used within \Plugin#mouse_move_event for example. + + This method was introduced in version 0.28. + """ + def send_wheel_event(self, delta: int, horizontal: bool, pt: db.DPoint, buttons: int) -> None: + r""" + @brief Sends a mouse wheel event + + This method is intended to emulate the mouse wheel events sent by Qt normally in environments where Qt is not present. The arguments follow the conventions used within \Plugin#wheel_event for example. + + This method was introduced in version 0.28. + """ + def set_active_cellview_index(self, index: int) -> None: + r""" + @brief Makes the cellview with the given index the active one (shown in hierarchy browser) + See \active_cellview_index. + + This method has been renamed from set_active_cellview_index to active_cellview_index= in version 0.25. The original name is still available, but is deprecated. + """ + def set_config(self, name: str, value: str) -> None: + r""" + @brief Sets a local configuration parameter with the given name to the given value + + @param name The name of the configuration parameter to set + @param value The value to which to set the configuration parameter + + This method sets a local configuration parameter with the given name to the given value. Values can only be strings. Numerical values have to be converted into strings first. Local configuration parameters override global configurations for this specific view. This allows for example to override global settings of background colors. Any local settings are not written to the configuration file. + """ + def set_current_cell_path(self, cv_index: int, cell_path: Sequence[int]) -> None: + r""" + @brief Sets the path to the current cell + + The current cell is the one highlighted in the browser with the focus rectangle. The + cell given by the path is highlighted and scrolled into view. + To select the cell to be drawn, use the \select_cell or \select_cell_path method. + + @param cv_index The cellview index for which to set the current path for (usually this will be the active cellview index) + @param path The path to the current cell + + This method is was deprecated in version 0.25 since from then, the \CellView object can be used to obtain an manipulate the selected cell. + """ + def set_current_layer_list(self, index: int) -> None: + r""" + @brief Sets the index of the currently selected layer properties tab + This method has been introduced in version 0.21. + """ + @overload + def set_layer_properties(self, iter: LayerPropertiesIterator, props: LayerProperties) -> None: + r""" + @brief Sets the layer properties of the layer pointed to by the iterator + + This method replaces the layer properties of the element pointed to by "iter" by the properties given by "props". It will not change the hierarchy but just the properties of the given node. + """ + @overload + def set_layer_properties(self, index: int, iter: LayerPropertiesIterator, props: LayerProperties) -> None: + r""" + @brief Sets the layer properties of the layer pointed to by the iterator + + This method replaces the layer properties of the element pointed to by "iter" by the properties given by "props" in the tab given by "index". It will not change the hierarchy but just the properties of the given node.This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method has been introduced in version 0.21. + """ + def set_title(self, title: str) -> None: + r""" + @brief Sets the title of the view + + @param title The title string to use + + Override the standard title of the view indicating the file names loaded by the specified title string. The title string can be reset with \reset_title to the standard title again. + """ + @overload + def show_all_cells(self) -> None: + r""" + @brief Makes all cells shown (cancel effects of \hide_cell) + """ + @overload + def show_all_cells(self, cv_index: int) -> None: + r""" + @brief Makes all cells shown (cancel effects of \hide_cell) for the specified cell view + Unlike \show_all_cells, this method will only clear the hidden flag on the cell view selected by \cv_index. + + This variant has been added in version 0.25. + """ + def show_cell(self, cell_index: int, cv_index: int) -> None: + r""" + @brief Shows the given cell for the given cellview (cancel effect of \hide_cell) + """ + def show_image(self, id: int, visible: bool) -> None: + r""" + @brief Shows or hides the given image + @param id The id of the object to show or hide + @param visible True, if the image should be shown + + Sets the visibility of the image with the given Id. The Id can be obtained with if "id" method of the image object. + + This method has been introduced in version 0.20. + + With version 0.25, \Image#visible= can be used to achieve the same results. + """ + @overload + def show_layout(self, layout: db.Layout, add_cellview: bool) -> int: + r""" + @brief Shows an existing layout in the view + + Shows the given layout in the view. If add_cellview is true, the new layout is added to the list of cellviews in the view. + + Note: once a layout is passed to the view with show_layout, it is owned by the view and must not be destroyed with the 'destroy' method. + + @return The index of the cellview created. + + This method has been introduced in version 0.22. + """ + @overload + def show_layout(self, layout: db.Layout, tech: str, add_cellview: bool) -> int: + r""" + @brief Shows an existing layout in the view + + Shows the given layout in the view. If add_cellview is true, the new layout is added to the list of cellviews in the view. + The technology to use for that layout can be specified as well with the 'tech' parameter. Depending on the definition of the technology, layer properties may be loaded for example. + The technology string can be empty for the default technology. + + Note: once a layout is passed to the view with show_layout, it is owned by the view and must not be destroyed with the 'destroy' method. + + @return The index of the cellview created. + + This method has been introduced in version 0.22. + """ + @overload + def show_layout(self, layout: db.Layout, tech: str, add_cellview: bool, init_layers: bool) -> int: + r""" + @brief Shows an existing layout in the view + + Shows the given layout in the view. If add_cellview is true, the new layout is added to the list of cellviews in the view. + The technology to use for that layout can be specified as well with the 'tech' parameter. Depending on the definition of the technology, layer properties may be loaded for example. + The technology string can be empty for the default technology. + This variant also allows one to control whether the layer properties are + initialized (init_layers = true) or not (init_layers = false). + + Note: once a layout is passed to the view with show_layout, it is owned by the view and must not be destroyed with the 'destroy' method. + + @return The index of the cellview created. + + This method has been introduced in version 0.22. + """ + def stop(self) -> None: + r""" + @brief Stops redraw thread and close any browsers + This method usually does not need to be called explicitly. The redraw thread is stopped automatically. + """ + def stop_redraw(self) -> None: + r""" + @brief Stops the redraw thread + + It is very important to stop the redraw thread before applying changes to the layout or the cell views and the LayoutView configuration. This is usually done automatically. For rare cases, where this is not the case, this method is provided. + """ + def switch_mode(self, arg0: str) -> None: + r""" + @brief Switches the mode. + + See \mode_name about a method to get the name of the current mode and \mode_names for a method to retrieve all available mode names. + + This method has been introduced in version 0.28. + """ + def transaction(self, description: str) -> None: + r""" + @brief Begins a transaction + + @param description A text that appears in the 'undo' description + + A transaction brackets a sequence of database modifications that appear as a single undo action. Only modifications that are wrapped inside a transaction..commit call pair can be undone. + Each transaction must be terminated with a \commit method call, even if some error occurred. It is advisable therefore to catch errors and issue a commit call in this case. + + This method was introduced in version 0.16. + """ + def transient_to_selection(self) -> None: + r""" + @brief Turns the transient selection into the actual selection + + The current selection is cleared before. All highlighted objects under the mouse will become selected. This applies to all types of objects (rulers, shapes, images ...). + + This method has been introduced in version 0.26.2 + """ + def unregister_annotation_templates(self, category: str) -> None: + r""" + @brief Unregisters the template or templates with the given category string on this particular view + + See \Annotation#unregister_template for a method doing the same on application level.This method is hardly useful normally, but can be used when customizing layout views as individual widgets. + + This method has been added in version 0.28. + """ + def unselect_object(self, obj: ObjectInstPath) -> None: + r""" + @brief Removes the given selection from the list of selected objects + + The selection provided by the \ObjectInstPath descriptor is removed from the list of selected objects. + If the given object was not part of the selection, nothing will be changed. + The selection of other objects (such as annotations and images) will not be affected. + + This method has been introduced in version 0.24 + """ + def update_content(self) -> None: + r""" + @brief Updates the layout view to the current state + + This method triggers an update of the hierarchy tree and layer view tree. Usually, this method does not need to be called. The widgets are updated automatically in most cases. + + Currently, this method should be called however, after the layer view tree has been changed by the \insert_layer, \replace_layer_node or \delete_layer methods. + """ + def viewport_height(self) -> int: + r""" + @brief Return the viewport height in pixels + This method was introduced in version 0.18. + """ + def viewport_trans(self) -> db.DCplxTrans: + r""" + @brief Returns the transformation that converts micron coordinates to pixels + Hint: the transformation returned will convert any point in micron coordinate space into a pixel coordinate. Contrary to usual convention, the y pixel coordinate is given in a mathematically oriented space - which means the bottom coordinate is 0. + This method was introduced in version 0.18. + """ + def viewport_width(self) -> int: + r""" + @brief Returns the viewport width in pixels + This method was introduced in version 0.18. + """ + def zoom_box(self, box: db.DBox) -> None: + r""" + @brief Sets the viewport to the given box + + @param box The box to which to set the view in micron coordinates + """ + def zoom_fit(self) -> None: + r""" + @brief Fits the contents of the current view into the window + """ + def zoom_fit_sel(self) -> None: + r""" + @brief Fits the contents of the current selection into the window + + This method has been introduced in version 0.25. + """ + def zoom_in(self) -> None: + r""" + @brief Zooms in somewhat + """ + def zoom_out(self) -> None: + r""" + @brief Zooms out somewhat + """ + +class CellView: + r""" + @brief A class describing what is shown inside a layout view + + The cell view points to a specific cell within a certain layout and a hierarchical context. + For that, first of all a layout pointer is provided. The cell itself + is addressed by an cell_index or a cell object reference. + The layout pointer can be nil, indicating that the cell view is invalid. + + The cell is not only identified by it's index or object but also + by the path leading to that cell. This path indicates how to find the + cell in the hierarchical context of it's parent cells. + + The path is in fact composed of two parts: first in an unspecific fashion, + just describing which parent cells are used. The target of this path + is called the "context cell". It is accessible by the \ctx_cell_index + or \ctx_cell methods. In the viewer, the unspecific part of the path is + the location of the cell in the cell tree. + + Additionally the path's second part may further identify a specific instance of a certain + subcell in the context cell. This is done through a set of \InstElement + objects. The target of this specific path is the actual cell addressed by the + cellview. This target cell is accessible by the \cell_index or \cell methods. + In the viewer, the target cell is shown in the context of the context cell. + The hierarchy levels are counted from the context cell, which is on level 0. + If the context path is empty, the context cell is identical with the target cell. + + Starting with version 0.25, the cellview can be modified directly. This will have an immediate effect on the display. For example, the following code will select a different cell: + + @code + cv = RBA::CellView::active + cv.cell_name = "TOP2" + @/code + + See @The Application API@ for more details about the cellview objects. + """ + cell: db.Cell + r""" + Getter: + @brief Gets the reference to the target cell currently addressed + + Setter: + @brief Sets the cell by reference to a Cell object + Setting the cell reference to nil invalidates the cellview. This method will construct any path to this cell, not a + particular one. It will clear the context path + and update the context and target cell. + """ + cell_index: int + r""" + Getter: + @brief Gets the target cell's index + + Setter: + @brief Sets the path to the given cell + + This method will construct any path to this cell, not a + particular one. It will clear the context path + and update the context and target cell. Note that the cell is specified by it's index. + """ + cell_name: str + r""" + Getter: + @brief Gets the name of the target cell currently addressed + + Setter: + @brief Sets the cell by name + + If the name is not a valid one, the cellview will become + invalid. + This method will construct any path to this cell, not a + particular one. It will clear the context path + and update the context and target cell. + """ + context_path: List[db.InstElement] + r""" + Getter: + @brief Gets the cell's context path + The context path leads from the context cell to the target cell in a specific fashion, i.e. describing each instance in detail, not just by cell indexes. If the context and target cell are identical, the context path is empty. + Setter: + @brief Sets the context path explicitly + + This method assumes that the unspecific part of the path + is established already and that the context path starts + from the context cell. + """ + name: str + r""" + Getter: + @brief Gets the unique name associated with the layout behind the cellview + + Setter: + @brief sets the unique name associated with the layout behind the cellview + + this method has been introduced in version 0.25. + """ + on_technology_changed: None + r""" + Getter: + @brief An event indicating that the technology has changed + This event is triggered when the CellView is attached to a different technology. + + This event has been introduced in version 0.27. + + Setter: + @brief An event indicating that the technology has changed + This event is triggered when the CellView is attached to a different technology. + + This event has been introduced in version 0.27. + """ + path: List[int] + r""" + Getter: + @brief Gets the cell's unspecific part of the path leading to the context cell + + Setter: + @brief Sets the unspecific part of the path explicitly + + Setting the unspecific part of the path will clear the context path component and + update the context and target cell. + """ + technology: str + r""" + Getter: + @brief Returns the technology name for the layout behind the given cell view + This method has been added in version 0.23. + + Setter: + @brief Sets the technology for the layout behind the given cell view + According to the specification of the technology, new layer properties may be loaded or the net tracer may be reconfigured. If the layout is shown in multiple views, the technology is updated for all views. + This method has been added in version 0.22. + """ + @classmethod + def active(cls) -> CellView: + r""" + @brief Gets the active CellView + The active CellView is the one that is selected in the current layout view. This method is equivalent to + @code + RBA::LayoutView::current.active_cellview + @/code + If no CellView is active, this method returns nil. + + This method has been introduced in version 0.23. + """ + @classmethod + def new(cls) -> CellView: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> CellView: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Equality: indicates whether the cellviews refer to the same one + In version 0.25, the definition of the equality operator has been changed to reflect identity of the cellview. Before that version, identity of the cell shown was implied. + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def ascend(self) -> None: + r""" + @brief Ascends upwards in the hierarchy. + Removes one element from the specific path of the cellview with the given index. Returns the element removed. + This method has been added in version 0.25. + """ + def assign(self, other: CellView) -> None: + r""" + @brief Assigns another object to self + """ + def close(self) -> None: + r""" + @brief Closes this cell view + + This method will close the cellview - remove it from the layout view. After this method was called, the cellview will become invalid (see \is_valid?). + + This method was introduced in version 0.25. + """ + def context_dtrans(self) -> db.DCplxTrans: + r""" + @brief Gets the accumulated transformation of the context path in micron unit space + This is the transformation applied to the target cell before it is shown in the context cell + Technically this is the product of all transformations over the context path. + See \context_trans for a version delivering an integer-unit space transformation. + + This method has been introduced in version 0.27.3. + """ + def context_trans(self) -> db.ICplxTrans: + r""" + @brief Gets the accumulated transformation of the context path + This is the transformation applied to the target cell before it is shown in the context cell + Technically this is the product of all transformations over the context path. + See \context_dtrans for a version delivering a micron-unit space transformation. + + This method has been introduced in version 0.27.3. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def ctx_cell(self) -> db.Cell: + r""" + @brief Gets the reference to the context cell currently addressed + """ + def ctx_cell_index(self) -> int: + r""" + @brief Gets the context cell's index + """ + def descend(self, path: Sequence[db.InstElement]) -> None: + r""" + @brief Descends further into the hierarchy. + Adds the given path (given as an array of InstElement objects) to the specific path of the cellview with the given index. In effect, the cell addressed by the terminal of the new path components can be shown in the context of the upper cells, if the minimum hierarchy level is set to a negative value. + The path is assumed to originate from the current cell and contain specific instances sorted from top to bottom. + This method has been added in version 0.25. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> CellView: + r""" + @brief Creates a copy of self + """ + def filename(self) -> str: + r""" + @brief Gets filename associated with the layout behind the cellview + """ + def hide_cell(self, cell: db.Cell) -> None: + r""" + @brief Hides the given cell + + This method has been added in version 0.25. + """ + def index(self) -> int: + r""" + @brief Gets the index of this cellview in the layout view + The index will be negative if the cellview is not a valid one. + This method has been added in version 0.25. + """ + def is_cell_hidden(self, cell: db.Cell) -> bool: + r""" + @brief Returns true, if the given cell is hidden + + This method has been added in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_dirty(self) -> bool: + r""" + @brief Gets a flag indicating whether the layout needs saving + A layout is 'dirty' if it is modified and needs saving. This method returns true in this case. + + This method has been introduced in version 0.24.10. + """ + def is_valid(self) -> bool: + r""" + @brief Returns true, if the cellview is valid + A cellview may become invalid if the corresponding tab is closed for example. + """ + def layout(self) -> db.Layout: + r""" + @brief Gets the reference to the layout object addressed by this view + """ + def reset_cell(self) -> None: + r""" + @brief Resets the cell + + The cellview will become invalid. The layout object will + still be attached to the cellview, but no cell will be selected. + """ + def set_cell(self, cell_index: int) -> None: + r""" + @brief Sets the path to the given cell + + This method will construct any path to this cell, not a + particular one. It will clear the context path + and update the context and target cell. Note that the cell is specified by it's index. + """ + def set_cell_name(self, cell_name: str) -> None: + r""" + @brief Sets the cell by name + + If the name is not a valid one, the cellview will become + invalid. + This method will construct any path to this cell, not a + particular one. It will clear the context path + and update the context and target cell. + """ + def set_context_path(self, path: Sequence[db.InstElement]) -> None: + r""" + @brief Sets the context path explicitly + + This method assumes that the unspecific part of the path + is established already and that the context path starts + from the context cell. + """ + def set_path(self, path: Sequence[int]) -> None: + r""" + @brief Sets the unspecific part of the path explicitly + + Setting the unspecific part of the path will clear the context path component and + update the context and target cell. + """ + def show_all_cells(self) -> None: + r""" + @brief Makes all cells shown (cancel effects of \hide_cell) for the specified cell view + + This method has been added in version 0.25. + """ + def show_cell(self, cell: db.Cell) -> None: + r""" + @brief Shows the given cell (cancels the effect of \hide_cell) + + This method has been added in version 0.25. + """ + def view(self) -> LayoutView: + r""" + @brief Gets the view the cellview resides in + This reference will be nil if the cellview is not a valid one. + This method has been added in version 0.25. + """ + +class Marker: + r""" + @brief The floating-point coordinate marker object + + The marker is a visual object that "marks" (highlights) a + certain area of the layout, given by a database object. This object accepts database objects with floating-point coordinates in micron values. + """ + color: int + r""" + Getter: + @brief Gets the color of the marker + This value is valid only if \has_color? is true. + Setter: + @brief Sets the color of the marker + The color is a 32bit unsigned integer encoding the RGB values in the lower 3 bytes (blue in the lowest significant byte). The color can be reset with \reset_color, in which case, the default foreground color is used. + """ + dismissable: bool + r""" + Getter: + @brief Gets a value indicating whether the marker can be hidden + See \dismissable= for a description of this predicate. + Setter: + @brief Sets a value indicating whether the marker can be hidden + Dismissable markers can be hidden setting "View/Show Markers" to "off". The default setting is "false" meaning the marker can't be hidden. + + This attribute has been introduced in version 0.25.4. + """ + dither_pattern: int + r""" + Getter: + @brief Gets the stipple pattern index + See \dither_pattern= for a description of the stipple pattern index. + Setter: + @brief Sets the stipple pattern index + A value of -1 or less than zero indicates that the marker is not filled. Otherwise, the value indicates which pattern to use for filling the marker. + """ + frame_color: int + r""" + Getter: + @brief Gets the frame color of the marker + This value is valid only if \has_frame_color? is true.The set method has been added in version 0.20. + + Setter: + @brief Sets the frame color of the marker + The color is a 32bit unsigned integer encoding the RGB values in the lower 3 bytes (blue in the lowest significant byte). The color can be reset with \reset_frame_color, in which case the fill color is used. + The set method has been added in version 0.20. + """ + halo: int + r""" + Getter: + @brief Gets the halo flag + See \halo= for a description of the halo flag. + Setter: + @brief Sets the halo flag + The halo flag is either -1 (for taking the default), 0 to disable the halo or 1 to enable it. If the halo is enabled, a pixel border with the background color is drawn around the marker, the vertices and texts. + """ + line_style: int + r""" + Getter: + @brief Get the line style + See \line_style= for a description of the line style index. + This method has been introduced in version 0.25. + Setter: + @brief Sets the line style + The line style is given by an index. 0 is solid, 1 is dashed and so forth. + + This method has been introduced in version 0.25. + """ + line_width: int + r""" + Getter: + @brief Gets the line width of the marker + See \line_width= for a description of the line width. + Setter: + @brief Sets the line width of the marker + This is the width of the line drawn for the outline of the marker. + """ + vertex_size: int + r""" + Getter: + @brief Gets the vertex size of the marker + See \vertex_size= for a description. + Setter: + @brief Sets the vertex size of the marker + This is the size of the rectangles drawn for the vertices object. + """ + @classmethod + def new(cls, view: LayoutViewBase) -> Marker: + r""" + @brief Creates a marker + + A marker is always associated with a view, in which it is shown. The view this marker is associated with must be passed to the constructor. + """ + def __init__(self, view: LayoutViewBase) -> None: + r""" + @brief Creates a marker + + A marker is always associated with a view, in which it is shown. The view this marker is associated with must be passed to the constructor. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def has_color(self) -> bool: + r""" + @brief Returns a value indicating whether the marker has a specific color + """ + def has_frame_color(self) -> bool: + r""" + @brief Returns a value indicating whether the marker has a specific frame color + The set method has been added in version 0.20. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def reset_color(self) -> None: + r""" + @brief Resets the color of the marker + See \set_color for a description of the color property of the marker. + """ + def reset_frame_color(self) -> None: + r""" + @brief Resets the frame color of the marker + See \set_frame_color for a description of the frame color property of the marker.The set method has been added in version 0.20. + """ + @overload + def set(self, box: db.DBox) -> None: + r""" + @brief Sets the box the marker is to display + + Makes the marker show a box. The box must be given in micron units. + If the box is empty, no marker is drawn. + The set method has been added in version 0.20. + """ + @overload + def set(self, edge: db.DEdge) -> None: + r""" + @brief Sets the edge the marker is to display + + Makes the marker show a edge. The edge must be given in micron units. + The set method has been added in version 0.20. + """ + @overload + def set(self, path: db.DPath) -> None: + r""" + @brief Sets the path the marker is to display + + Makes the marker show a path. The path must be given in micron units. + The set method has been added in version 0.20. + """ + @overload + def set(self, polygon: db.DPolygon) -> None: + r""" + @brief Sets the polygon the marker is to display + + Makes the marker show a polygon. The polygon must be given in micron units. + The set method has been added in version 0.20. + """ + @overload + def set(self, text: db.DText) -> None: + r""" + @brief Sets the text the marker is to display + + Makes the marker show a text. The text must be given in micron units. + The set method has been added in version 0.20. + """ + def set_box(self, box: db.DBox) -> None: + r""" + @brief Sets the box the marker is to display + + Makes the marker show a box. The box must be given in micron units. + If the box is empty, no marker is drawn. + The set method has been added in version 0.20. + """ + def set_edge(self, edge: db.DEdge) -> None: + r""" + @brief Sets the edge the marker is to display + + Makes the marker show a edge. The edge must be given in micron units. + The set method has been added in version 0.20. + """ + def set_path(self, path: db.DPath) -> None: + r""" + @brief Sets the path the marker is to display + + Makes the marker show a path. The path must be given in micron units. + The set method has been added in version 0.20. + """ + def set_polygon(self, polygon: db.DPolygon) -> None: + r""" + @brief Sets the polygon the marker is to display + + Makes the marker show a polygon. The polygon must be given in micron units. + The set method has been added in version 0.20. + """ + def set_text(self, text: db.DText) -> None: + r""" + @brief Sets the text the marker is to display + + Makes the marker show a text. The text must be given in micron units. + The set method has been added in version 0.20. + """ + +class AbstractMenu: + r""" + @brief An abstraction for the application menus + + The abstract menu is a class that stores a main menu and several popup menus + in a generic form such that they can be manipulated and converted into GUI objects. + + Each item can be associated with a Action, which delivers a title, enabled/disable state etc. + The Action is either provided when new entries are inserted or created upon initialisation. + + The abstract menu class provides methods to manipulate the menu structure (the state of the + menu items, their title and shortcut key is provided and manipulated through the Action object). + + Menu items and submenus are referred to by a "path". The path is a string with this interpretation: + + @ + @@@@ + @@@@ + @@@@ + @@@@ + @@@@ + @
"" @is the root@
"[.]" @is an element of the submenu given by . If is omitted, this refers to an element in the root@
"[.]end" @refers to the item past the last item of the submenu given by or root@
"[.]begin" @refers to the first item of the submenu given by or root@
"[.]#" @refers to the nth item of the submenu given by or root (n is an integer number)@
+ + Menu items can be put into groups. The path strings of each group can be obtained with the + "group" method. An item is put into a group by appending ":" to the item's name. + This specification can be used several times. + + Detached menus (i.e. for use in context menus) can be created as virtual top-level submenus + with a name of the form "@@". A special detached menu is "@toolbar" which represents the tool bar of the main window. + Menus are closely related to the \Action class. Actions are used to represent selectable items inside menus, provide the title and other configuration settings. Actions also link the menu items with code. See the \Action class description for further details. + """ + @classmethod + def new(cls) -> AbstractMenu: + r""" + @hide + """ + @classmethod + def pack_key_binding(cls, path_to_keys: Dict[str, str]) -> str: + r""" + @brief Serializes a key binding definition into a single string + The serialized format is used by the 'key-bindings' config key. This method will take an array of path/key definitions (including the \Action#NoKeyBound option) and convert it to a single string suitable for assigning to the config key. + + This method has been introduced in version 0.26. + """ + @classmethod + def pack_menu_items_hidden(cls, path_to_visibility: Dict[str, bool]) -> str: + r""" + @brief Serializes a menu item visibility definition into a single string + The serialized format is used by the 'menu-items-hidden' config key. This method will take an array of path/visibility flag definitions and convert it to a single string suitable for assigning to the config key. + + This method has been introduced in version 0.26. + """ + @classmethod + def unpack_key_binding(cls, s: str) -> Dict[str, str]: + r""" + @brief Deserializes a key binding definition + This method is the reverse of \pack_key_binding. + + This method has been introduced in version 0.26. + """ + @classmethod + def unpack_menu_items_hidden(cls, s: str) -> Dict[str, bool]: + r""" + @brief Deserializes a menu item visibility definition + This method is the reverse of \pack_menu_items_hidden. + + This method has been introduced in version 0.26. + """ + def __init__(self) -> None: + r""" + @hide + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def action(self, path: str) -> ActionBase: + r""" + @brief Gets the reference to a Action object associated with the given path + + @param path The path to the item. + @return A reference to a Action object associated with this path or nil if the path is not valid + """ + def clear_menu(self, path: str) -> None: + r""" + @brief Deletes the children of the item given by the path + + @param path The path to the item whose children to delete + + This method has been introduced in version 0.28. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def delete_item(self, path: str) -> None: + r""" + @brief Deletes the item given by the path + + @param path The path to the item to delete + + This method will also delete all children of the given item. To clear the children only, use \clear_menu. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def group(self, group: str) -> List[str]: + r""" + @brief Gets the group members + + @param group The group name + @param A vector of all members (by path) of the group + """ + def insert_item(self, path: str, name: str, action: ActionBase) -> None: + r""" + @brief Inserts a new item before the one given by the path + + The Action object passed as the third parameter references the handler which both implements the action to perform and the menu item's appearance such as title, icon and keyboard shortcut. + + @param path The path to the item before which to insert the new item + @param name The name of the item to insert + @param action The Action object to insert + """ + @overload + def insert_menu(self, path: str, name: str, action: ActionBase) -> None: + r""" + @brief Inserts a new submenu before the item given by the path + + @param path The path to the item before which to insert the submenu + @param name The name of the submenu to insert + @param action The action object of the submenu to insert + + This method variant has been added in version 0.28. + """ + @overload + def insert_menu(self, path: str, name: str, title: str) -> None: + r""" + @brief Inserts a new submenu before the item given by the path + + The title string optionally encodes the key shortcut and icon resource + in the form ["("")"]["<"">"]. + + @param path The path to the item before which to insert the submenu + @param name The name of the submenu to insert + @param title The title of the submenu to insert + """ + def insert_separator(self, path: str, name: str) -> None: + r""" + @brief Inserts a new separator before the item given by the path + + @param path The path to the item before which to insert the separator + @param name The name of the separator to insert + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_menu(self, path: str) -> bool: + r""" + @brief Returns true if the item is a menu + + @param path The path to the item + @return false if the path is not valid or is not a menu + """ + def is_separator(self, path: str) -> bool: + r""" + @brief Returns true if the item is a separator + + @param path The path to the item + @return false if the path is not valid or is not a separator + + This method has been introduced in version 0.19. + """ + def is_valid(self, path: str) -> bool: + r""" + @brief Returns true if the path is a valid one + + @param path The path to check + @return false if the path is not a valid path to an item + """ + def items(self, path: str) -> List[str]: + r""" + @brief Gets the subitems for a given submenu + + @param path The path to the submenu + @return A vector or path strings for the child items or an empty vector if the path is not valid or the item does not have children + """ + +class ActionBase: + r""" + @hide + @alias Action + """ + NoKeyBound: ClassVar[str] + r""" + @brief Gets a shortcut value indicating that no shortcut shall be assigned + This method has been introduced in version 0.26. + """ + checkable: bool + r""" + Getter: + @brief Gets a value indicating whether the item is checkable + + Setter: + @brief Makes the item(s) checkable or not + + @param checkable true to make the item checkable + """ + checked: bool + r""" + Getter: + @brief Gets a value indicating whether the item is checked + + Setter: + @brief Checks or unchecks the item + + @param checked true to make the item checked + """ + default_shortcut: str + r""" + Getter: + @brief Gets the default keyboard shortcut + @return The default keyboard shortcut as a string + + This attribute has been introduced in version 0.25. + + Setter: + @brief Sets the default keyboard shortcut + + The default shortcut is used, if \shortcut is empty. + + This attribute has been introduced in version 0.25. + """ + enabled: bool + r""" + Getter: + @brief Gets a value indicating whether the item is enabled + + Setter: + @brief Enables or disables the action + + @param enabled true to enable the item + """ + hidden: bool + r""" + Getter: + @brief Gets a value indicating whether the item is hidden + If an item is hidden, it's always hidden and \is_visible? does not have an effect. + This attribute has been introduced in version 0.25. + + Setter: + @brief Sets a value that makes the item hidden always + See \is_hidden? for details. + + This attribute has been introduced in version 0.25 + """ + @property + def icon(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the icon to the given image file + + @param file The image file to load for the icon + + Passing an empty string will reset the icon. + """ + icon_text: str + r""" + Getter: + @brief Gets the icon's text + + Setter: + @brief Sets the icon's text + + If an icon text is set, this will be used for the text below the icon. + If no icon text is set, the normal text will be used for the icon. + Passing an empty string will reset the icon's text. + """ + on_menu_opening: None + r""" + Getter: + @brief This event is called if the menu item is a sub-menu and before the menu is opened. + + This event provides an opportunity to populate the menu before it is opened. + + This event has been introduced in version 0.28. + + Setter: + @brief This event is called if the menu item is a sub-menu and before the menu is opened. + + This event provides an opportunity to populate the menu before it is opened. + + This event has been introduced in version 0.28. + """ + on_triggered: None + r""" + Getter: + @brief This event is called if the menu item is selected. + + This event has been introduced in version 0.21 and moved to the ActionBase class in 0.28. + + Setter: + @brief This event is called if the menu item is selected. + + This event has been introduced in version 0.21 and moved to the ActionBase class in 0.28. + """ + separator: bool + r""" + Getter: + @brief Gets a value indicating whether the item is a separator + This method has been introduced in version 0.25. + + Setter: + @brief Makes an item a separator or not + + @param separator true to make the item a separator + This method has been introduced in version 0.25. + """ + shortcut: str + r""" + Getter: + @brief Gets the keyboard shortcut + @return The keyboard shortcut as a string + + Setter: + @brief Sets the keyboard shortcut + If the shortcut string is empty, the default shortcut will be used. If the string is equal to \Action#NoKeyBound, no keyboard shortcut will be assigned. + + @param shortcut The keyboard shortcut in Qt notation (i.e. "Ctrl+C") + + The NoKeyBound option has been added in version 0.26. + """ + title: str + r""" + Getter: + @brief Gets the title + + @return The current title string + + Setter: + @brief Sets the title + + @param title The title string to set (just the title) + """ + tool_tip: str + r""" + Getter: + @brief Gets the tool tip text. + + This method has been added in version 0.22. + + Setter: + @brief Sets the tool tip text + + The tool tip text is displayed in the tool tip window of the menu entry. + This is in particular useful for entries in the tool bar. + This method has been added in version 0.22. + """ + visible: bool + r""" + Getter: + @brief Gets a value indicating whether the item is visible + The visibility combines with \is_hidden?. To get the true visiblity, use \is_effective_visible?. + Setter: + @brief Sets the item's visibility + + @param visible true to make the item visible + """ + @classmethod + def new(cls) -> ActionBase: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def effective_shortcut(self) -> str: + r""" + @brief Gets the effective keyboard shortcut + @return The effective keyboard shortcut as a string + + The effective shortcut is the one that is taken. It's either \shortcut or \default_shortcut. + + This attribute has been introduced in version 0.25. + """ + def is_checkable(self) -> bool: + r""" + @brief Gets a value indicating whether the item is checkable + """ + def is_checked(self) -> bool: + r""" + @brief Gets a value indicating whether the item is checked + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_effective_enabled(self) -> bool: + r""" + @brief Gets a value indicating whether the item is really enabled + This is the combined value from \is_enabled? and dynamic value (\wants_enabled). + This attribute has been introduced in version 0.28. + """ + def is_effective_visible(self) -> bool: + r""" + @brief Gets a value indicating whether the item is really visible + This is the combined visibility from \is_visible? and \is_hidden? and dynamic visibility (\wants_visible). + This attribute has been introduced in version 0.25. + """ + def is_enabled(self) -> bool: + r""" + @brief Gets a value indicating whether the item is enabled + """ + def is_hidden(self) -> bool: + r""" + @brief Gets a value indicating whether the item is hidden + If an item is hidden, it's always hidden and \is_visible? does not have an effect. + This attribute has been introduced in version 0.25. + """ + def is_separator(self) -> bool: + r""" + @brief Gets a value indicating whether the item is a separator + This method has been introduced in version 0.25. + """ + def is_visible(self) -> bool: + r""" + @brief Gets a value indicating whether the item is visible + The visibility combines with \is_hidden?. To get the true visiblity, use \is_effective_visible?. + """ + def macro(self) -> Macro: + r""" + @brief Gets the macro associated with the action + If the action is associated with a macro, this method returns a reference to the \Macro object. Otherwise, this method returns nil. + + + This method has been added in version 0.25. + """ + def trigger(self) -> None: + r""" + @brief Triggers the action programmatically + """ + +class Action(ActionBase): + r""" + @brief The abstraction for an action (i.e. used inside menus) + + Actions act as a generalization of menu entries. The action provides the appearance of a menu entry such as title, key shortcut etc. and dispatches the menu events. The action can be manipulated to change to appearance of a menu entry and can be attached an observer that receives the events when the menu item is selected. + + Multiple action objects can refer to the same action internally, in which case the information and event handler is copied between the incarnations. This way, a single implementation can be provided for multiple places where an action appears, for example inside the toolbar and in addition as a menu entry. Both actions will shared the same icon, text, shortcut etc. + + Actions are mainly used for providing new menu items inside the \AbstractMenu class. This is some sample Ruby code for that case: + + @code + a = RBA::Action.new + a.title = "Push Me!" + a.on_triggered do + puts "I was pushed!" + end + + app = RBA::Application.instance + mw = app.main_window + + menu = mw.menu + menu.insert_separator("@toolbar.end", "name") + menu.insert_item("@toolbar.end", "my_action", a) + @/code + + This code will register a custom action in the toolbar. When the toolbar button is pushed a message is printed. The toolbar is addressed by a path starting with the pseudo root "@toolbar". + + In Version 0.23, the Action class has been merged with the ActionBase class. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class PluginFactory: + r""" + @brief The plugin framework's plugin factory object + + Plugins are components that extend KLayout's functionality in various aspects. Scripting support exists currently for providing mouse mode handlers and general on-demand functionality connected with a menu entry. + + Plugins are objects that implement the \Plugin interface. Each layout view is associated with one instance of such an object. The PluginFactory is a singleton which is responsible for creating \Plugin objects and providing certain configuration information such as where to put the menu items connected to this plugin and what configuration keys are used. + + An implementation of PluginFactory must at least provide an implementation of \create_plugin. This method must instantiate a new object of the specific plugin. + + After the factory has been created, it must be registered in the system using one of the \register methods. It is therefore recommended to put the call to \register at the end of the "initialize" method. For the registration to work properly, the menu items must be defined before \register is called. + + The following features can also be implemented: + + @
    + @
  • Reserve keys in the configuration file using \add_option in the constructor@
  • + @
  • Create menu items by using \add_menu_entry in the constructor@
  • + @
  • Set the title for the mode entry that appears in the tool bar using the \register argument@
  • + @
  • Provide global functionality (independent from the layout view) using \configure or \menu_activated@
  • + @
+ + This is a simple example for a plugin in Ruby. It switches the mouse cursor to a 'cross' cursor when it is active: + + @code + class PluginTestFactory < RBA::PluginFactory + + # Constructor + def initialize + # registers the new plugin class at position 100000 (at the end), with name + # "my_plugin_test" and title "My plugin test" + register(100000, "my_plugin_test", "My plugin test") + end + + # Create a new plugin instance of the custom type + def create_plugin(manager, dispatcher, view) + return PluginTest.new + end + + end + + # The plugin class + class PluginTest < RBA::Plugin + def mouse_moved_event(p, buttons, prio) + if prio + # Set the cursor to cross if our plugin is active. + set_cursor(RBA::Cursor::Cross) + end + # Returning false indicates that we don't want to consume the event. + # This way for example the cursor position tracker still works. + false + end + def mouse_click_event(p, buttons, prio) + if prio + puts "mouse button clicked." + # This indicates we want to consume the event and others don't receive the mouse click + # with prio = false. + return true + end + # don't consume the event if we are not active. + false + end + end + + # Instantiate the new plugin factory. + PluginTestFactory.new + @/code + + This class has been introduced in version 0.22. + """ + @property + def has_tool_entry(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Enables or disables the tool bar entry + Initially this property is set to true. This means that the plugin will have a visible entry in the toolbar. This property can be set to false to disable this feature. In that case, the title and icon given on registration will be ignored. + """ + @classmethod + def new(cls) -> PluginFactory: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def add_config_menu_item(self, menu_name: str, insert_pos: str, title: str, cname: str, cvalue: str) -> None: + r""" + @brief Adds a configuration menu item + + Menu items created this way will send a configuration request with 'cname' as the configuration parameter name and 'cvalue' as the configuration parameter value. + + This method has been introduced in version 0.27. + """ + @overload + def add_menu_entry(self, menu_name: str, insert_pos: str) -> None: + r""" + @brief Specifies a separator + Call this method in the factory constructor to build the menu items that this plugin shall create. + This specific call inserts a separator at the given position (insert_pos). The position uses abstract menu item paths and "menu_name" names the component that will be created. See \AbstractMenu for a description of the path. + """ + @overload + def add_menu_entry(self, symbol: str, menu_name: str, insert_pos: str, title: str) -> None: + r""" + @brief Specifies a menu item + Call this method in the factory constructor to build the menu items that this plugin shall create. + This specific call inserts a menu item at the specified position (insert_pos). The position uses abstract menu item paths and "menu_name" names the component that will be created. See \AbstractMenu for a description of the path. + When the menu item is selected "symbol" is the string that is sent to the \menu_activated callback (either the global one for the factory ot the one of the per-view plugin instance). + + @param symbol The string to send to the plugin if the menu is triggered + @param menu_name The name of entry to create at the given position + @param insert_pos The position where to create the entry + @param title The title string for the item. The title can contain a keyboard shortcut in round braces after the title text, i.e. "My Menu Item(F12)" + """ + @overload + def add_menu_entry(self, symbol: str, menu_name: str, insert_pos: str, title: str, sub_menu: bool) -> None: + r""" + @brief Specifies a menu item or sub-menu + Similar to the previous form of "add_menu_entry", but this version allows also to create sub-menus by setting the last parameter to "true". + + With version 0.27 it's more convenient to use \add_submenu. + """ + def add_menu_item_clone(self, symbol: str, menu_name: str, insert_pos: str, copy_from: str) -> None: + r""" + @brief Specifies a menu item as a clone of another one + Using this method, a menu item can be made a clone of another entry (given as path by 'copy_from'). + The new item will share the \Action object with the original one, so manipulating the action will change both the original entry and the new entry. + + This method has been introduced in version 0.27. + """ + def add_option(self, name: str, default_value: str) -> None: + r""" + @brief Specifies configuration variables. + Call this method in the factory constructor to add configuration key/value pairs to the configuration repository. Without specifying configuration variables, the status of a plugin cannot be persisted. + + Once the configuration variables are known, they can be retrieved on demand using "get_config" from \MainWindow or listening to \configure callbacks (either in the factory or the plugin instance). Configuration variables can be set using "set_config" from \MainWindow. This scheme also works without registering the configuration options, but doing so has the advantage that it is guaranteed that a variable with this keys exists and has the given default value initially. + + """ + def add_submenu(self, menu_name: str, insert_pos: str, title: str) -> None: + r""" + @brief Specifies a menu item or sub-menu + + This method has been introduced in version 0.27. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + @overload + def register(self, position: int, name: str, title: str) -> None: + r""" + @brief Registers the plugin factory + @param position An integer that determines the order in which the plugins are created. The internal plugins use the values from 1000 to 50000. + @param name The plugin name. This is an arbitrary string which should be unique. Hence it is recommended to use a unique prefix, i.e. "myplugin::ThePluginClass". + @param title The title string which is supposed to appear in the tool bar and menu related to this plugin. + + Registration of the plugin factory makes the object known to the system. Registration requires that the menu items have been set already. Hence it is recommended to put the registration at the end of the initialization method of the factory class. + """ + @overload + def register(self, position: int, name: str, title: str, icon: str) -> None: + r""" + @brief Registers the plugin factory + @param position An integer that determines the order in which the plugins are created. The internal plugins use the values from 1000 to 50000. + @param name The plugin name. This is an arbitrary string which should be unique. Hence it is recommended to use a unique prefix, i.e. "myplugin::ThePluginClass". + @param title The title string which is supposed to appear in the tool bar and menu related to this plugin. + @param icon The path to the icon that appears in the tool bar and menu related to this plugin. + + This version also allows registering an icon for the tool bar. + + Registration of the plugin factory makes the object known to the system. Registration requires that the menu items have been set already. Hence it is recommended to put the registration at the end of the initialization method of the factory class. + """ + +class Plugin: + r""" + @brief The plugin object + + This class provides the actual plugin implementation. Each view gets it's own instance of the plugin class. The plugin factory \PluginFactory class must be specialized to provide a factory for new objects of the Plugin class. See the documentation there for details about the plugin mechanism and the basic concepts. + + This class has been introduced in version 0.22. + """ + @classmethod + def new(cls) -> Plugin: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def grab_mouse(self) -> None: + r""" + @brief Redirects mouse events to this plugin, even if the plugin is not active. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def set_cursor(self, cursor_type: int) -> None: + r""" + @brief Sets the cursor in the view area to the given type + Setting the cursor has an effect only inside event handlers, i.e. mouse_press_event. The cursor is not set permanently. Is is reset in the mouse move handler unless a button is pressed or the cursor is explicitly set again in the mouse_move_event. + + The cursor type is one of the cursor constants in the \Cursor class, i.e. 'CursorArrow' for the normal cursor. + """ + def ungrab_mouse(self) -> None: + r""" + @brief Removes a mouse grab registered with \grab_mouse. + """ + +class Cursor: + r""" + @brief The namespace for the cursor constants + This class defines the constants for the cursor setting (for example for class \Plugin, method set_cursor). + This class has been introduced in version 0.22. + """ + Arrow: ClassVar[int] + r""" + @brief 'Arrow cursor' constant + """ + Blank: ClassVar[int] + r""" + @brief 'Blank cursor' constant + """ + Busy: ClassVar[int] + r""" + @brief 'Busy state cursor' constant + """ + ClosedHand: ClassVar[int] + r""" + @brief 'Closed hand cursor' constant + """ + Cross: ClassVar[int] + r""" + @brief 'Cross cursor' constant + """ + Forbidden: ClassVar[int] + r""" + @brief 'Forbidden area cursor' constant + """ + IBeam: ClassVar[int] + r""" + @brief 'I beam (text insert) cursor' constant + """ + None_: ClassVar[int] + r""" + @brief 'No cursor (default)' constant for \set_cursor (resets cursor to default) + """ + OpenHand: ClassVar[int] + r""" + @brief 'Open hand cursor' constant + """ + PointingHand: ClassVar[int] + r""" + @brief 'Pointing hand cursor' constant + """ + SizeAll: ClassVar[int] + r""" + @brief 'Size all directions cursor' constant + """ + SizeBDiag: ClassVar[int] + r""" + @brief 'Backward diagonal resize cursor' constant + """ + SizeFDiag: ClassVar[int] + r""" + @brief 'Forward diagonal resize cursor' constant + """ + SizeHor: ClassVar[int] + r""" + @brief 'Horizontal resize cursor' constant + """ + SizeVer: ClassVar[int] + r""" + @brief 'Vertical resize cursor' constant + """ + SplitH: ClassVar[int] + r""" + @brief 'split_horizontal cursor' constant + """ + SplitV: ClassVar[int] + r""" + @brief 'Split vertical cursor' constant + """ + UpArrow: ClassVar[int] + r""" + @brief 'Upward arrow cursor' constant + """ + Wait: ClassVar[int] + r""" + @brief 'Waiting cursor' constant + """ + WhatsThis: ClassVar[int] + r""" + @brief 'Question mark cursor' constant + """ + @classmethod + def new(cls) -> Cursor: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> Cursor: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: Cursor) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> Cursor: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + +class ButtonState: + r""" + @brief The namespace for the button state flags in the mouse events of the Plugin class. + This class defines the constants for the button state. In the event handler, the button state is indicated by a bitwise combination of these constants. See \Plugin for further details. + This class has been introduced in version 0.22. + """ + AltKey: ClassVar[int] + r""" + @brief Indicates that the Alt key is pressed + This constant is combined with other constants within \ButtonState + """ + ControlKey: ClassVar[int] + r""" + @brief Indicates that the Control key is pressed + This constant is combined with other constants within \ButtonState + """ + LeftButton: ClassVar[int] + r""" + @brief Indicates that the left mouse button is pressed + This constant is combined with other constants within \ButtonState + """ + MidButton: ClassVar[int] + r""" + @brief Indicates that the middle mouse button is pressed + This constant is combined with other constants within \ButtonState + """ + RightButton: ClassVar[int] + r""" + @brief Indicates that the right mouse button is pressed + This constant is combined with other constants within \ButtonState + """ + ShiftKey: ClassVar[int] + r""" + @brief Indicates that the Shift key is pressed + This constant is combined with other constants within \ButtonState + """ + @classmethod + def new(cls) -> ButtonState: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> ButtonState: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: ButtonState) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> ButtonState: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + +class KeyCode: + r""" + @brief The namespace for the some key codes. + This namespace defines some key codes understood by built-in \LayoutView components. When compiling with Qt, these codes are compatible with Qt's key codes. + The key codes are intended to be used when directly interfacing with \LayoutView in non-Qt-based environments. + + This class has been introduced in version 0.28. + """ + Backspace: ClassVar[int] + r""" + @brief Indicates the Backspace key + """ + Backtab: ClassVar[int] + r""" + @brief Indicates the Backtab key + """ + Delete: ClassVar[int] + r""" + @brief Indicates the Delete key + """ + Down: ClassVar[int] + r""" + @brief Indicates the Down key + """ + End: ClassVar[int] + r""" + @brief Indicates the End key + """ + Enter: ClassVar[int] + r""" + @brief Indicates the Enter key + """ + Escape: ClassVar[int] + r""" + @brief Indicates the Escape key + """ + Home: ClassVar[int] + r""" + @brief Indicates the Home key + """ + Insert: ClassVar[int] + r""" + @brief Indicates the Insert key + """ + Left: ClassVar[int] + r""" + @brief Indicates the Left key + """ + PageDown: ClassVar[int] + r""" + @brief Indicates the PageDown key + """ + PageUp: ClassVar[int] + r""" + @brief Indicates the PageUp key + """ + Return: ClassVar[int] + r""" + @brief Indicates the Return key + """ + Right: ClassVar[int] + r""" + @brief Indicates the Right key + """ + Tab: ClassVar[int] + r""" + @brief Indicates the Tab key + """ + Up: ClassVar[int] + r""" + @brief Indicates the Up key + """ + @classmethod + def new(cls) -> KeyCode: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> KeyCode: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: KeyCode) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> KeyCode: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + +class Dispatcher: + r""" + @brief Root of the configuration space in the plugin context and menu dispatcher + + This class provides access to the root configuration space in the context of plugin programming. You can use this class to obtain configuration parameters from the configuration tree during plugin initialization. However, the preferred way of plugin configuration is through \Plugin#configure. + + Currently, the application object provides an identical entry point for configuration modification. For example, "Application::instance.set_config" is identical to "Dispatcher::instance.set_config". Hence there is little motivation for the Dispatcher class currently and this interface may be modified or removed in the future. + This class has been introduced in version 0.25 as 'PluginRoot'. + It is renamed and enhanced as 'Dispatcher' in 0.27. + """ + @classmethod + def instance(cls) -> Dispatcher: + r""" + @brief Gets the singleton instance of the Dispatcher object + + @return The instance + """ + @classmethod + def new(cls) -> Dispatcher: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def clear_config(self) -> None: + r""" + @brief Clears the configuration parameters + """ + def commit_config(self) -> None: + r""" + @brief Commits the configuration settings + + Some configuration options are queued for performance reasons and become active only after 'commit_config' has been called. After a sequence of \set_config calls, this method should be called to activate the settings made by these calls. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def get_config(self, name: str) -> Any: + r""" + @brief Gets the value of a local configuration parameter + + @param name The name of the configuration parameter whose value shall be obtained (a string) + + @return The value of the parameter or nil if there is no such parameter + """ + def get_config_names(self) -> List[str]: + r""" + @brief Gets the configuration parameter names + + @return A list of configuration parameter names + + This method returns the names of all known configuration parameters. These names can be used to get and set configuration parameter values. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def read_config(self, file_name: str) -> bool: + r""" + @brief Reads the configuration from a file + @return A value indicating whether the operation was successful + + This method silently does nothing, if the config file does not + exist. If it does and an error occurred, the error message is printed + on stderr. In both cases, false is returned. + """ + def set_config(self, name: str, value: str) -> None: + r""" + @brief Set a local configuration parameter with the given name to the given value + + @param name The name of the configuration parameter to set + @param value The value to which to set the configuration parameter + + This method sets a configuration parameter with the given name to the given value. Values can only be strings. Numerical values have to be converted into strings first. Local configuration parameters override global configurations for this specific view. This allows for example to override global settings of background colors. Any local settings are not written to the configuration file. + """ + def write_config(self, file_name: str) -> bool: + r""" + @brief Writes configuration to a file + @return A value indicating whether the operation was successful + + If the configuration file cannot be written, false + is returned but no exception is thrown. + """ + +class DoubleValue: + r""" + @brief Encapsulate a floating point value + @hide + This class is provided as a return value of \InputDialog::get_double. + By using an object rather than a pure value, an object with \has_value? = false can be returned indicating that + the "Cancel" button was pressed. Starting with version 0.22, the InputDialog class offers new method which do no + longer requires to use this class. + """ + @classmethod + def new(cls) -> DoubleValue: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> DoubleValue: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DoubleValue) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> DoubleValue: + r""" + @brief Creates a copy of self + """ + def has_value(self) -> bool: + r""" + @brief True, if a value is present + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def to_f(self) -> float: + r""" + @brief Get the actual value (a synonym for \value) + """ + def value(self) -> float: + r""" + @brief Get the actual value + """ + +class IntValue: + r""" + @brief Encapsulate an integer value + @hide + This class is provided as a return value of \InputDialog::get_int. + By using an object rather than a pure value, an object with \has_value? = false can be returned indicating that + the "Cancel" button was pressed. Starting with version 0.22, the InputDialog class offers new method which do no + longer requires to use this class. + """ + @classmethod + def new(cls) -> IntValue: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> IntValue: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: IntValue) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> IntValue: + r""" + @brief Creates a copy of self + """ + def has_value(self) -> bool: + r""" + @brief True, if a value is present + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def to_i(self) -> int: + r""" + @brief Get the actual value (a synonym for \value) + """ + def value(self) -> int: + r""" + @brief Get the actual value + """ + +class StringValue: + r""" + @brief Encapsulate a string value + @hide + This class is provided as a return value of \InputDialog::get_string, \InputDialog::get_item and \FileDialog. + By using an object rather than a pure value, an object with \has_value? = false can be returned indicating that + the "Cancel" button was pressed. Starting with version 0.22, the InputDialog class offers new method which do no + longer requires to use this class. + """ + @classmethod + def new(cls) -> StringValue: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> StringValue: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def __str__(self) -> str: + r""" + @brief Get the actual value (a synonym for \value) + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: StringValue) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> StringValue: + r""" + @brief Creates a copy of self + """ + def has_value(self) -> bool: + r""" + @brief True, if a value is present + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def to_s(self) -> str: + r""" + @brief Get the actual value (a synonym for \value) + """ + def value(self) -> str: + r""" + @brief Get the actual value + """ + +class StringListValue: + r""" + @brief Encapsulate a string list + @hide + This class is provided as a return value of \FileDialog. + By using an object rather than a pure string list, an object with \has_value? = false can be returned indicating that + the "Cancel" button was pressed. Starting with version 0.22, the InputDialog class offers new method which do no + longer requires to use this class. + """ + @classmethod + def new(cls) -> StringListValue: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> StringListValue: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: StringListValue) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> StringListValue: + r""" + @brief Creates a copy of self + """ + def has_value(self) -> bool: + r""" + @brief True, if a value is present + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def value(self) -> List[str]: + r""" + @brief Get the actual value (a list of strings) + """ + +class BrowserDialog(QDialog_Native): + r""" + @brief A HTML display and browser dialog + + The browser dialog displays HTML code in a browser panel. The HTML code is delivered through a separate object of class \BrowserSource which acts as a "server" for a specific kind of URL scheme. Whenever the browser sees a URL starting with "int:" it will ask the connected BrowserSource object for the HTML code of that page using it's 'get' method. The task of the BrowserSource object is to format the data requested in HTML and deliver it. + + One use case for that class is the implementation of rich data browsers for structured information. In a simple scenario, the browser dialog can be instantiated with a static HTML page. In that case, only the content of that page is shown. + + Here's a simple example: + + @code + html = "Hello, world!" + RBA::BrowserDialog::new(html).exec + @/code + + And that is an example for the use case with a \BrowserSource as the "server": + + @code + class MySource < RBA::BrowserSource + def get(url) + if (url =~ /b.html$/) + return "The second page" + else + return "The first page with a link" + end + end + end + + source = MySource::new + RBA::BrowserDialog::new(source).exec + @/code + """ + @property + def caption(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the caption of the window + """ + @property + def home(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the browser's initial and current URL which is selected if the "home" location is chosen + The home URL is the one shown initially and the one which is selected when the "home" button is pressed. The default location is "int:/index.html". + """ + @property + def label(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the label text + + The label is shown left of the navigation buttons. + By default, no label is specified. + + This method has been introduced in version 0.23. + """ + @property + def source(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Connects to a source object + + Setting the source should be the first thing done after the BrowserDialog object is created. It will not have any effect after the browser has loaded the first page. In particular, \home= should be called after the source was set. + """ + @overload + @classmethod + def new(cls, html: str) -> BrowserDialog: + r""" + @brief Creates a HTML browser window with a static HTML content + This method has been introduced in version 0.23. + """ + @overload + @classmethod + def new(cls, source: BrowserSource) -> BrowserDialog: + r""" + @brief Creates a HTML browser window with a \BrowserSource as the source of HTML code + This method has been introduced in version 0.23. + """ + @overload + @classmethod + def new(cls, parent: QtWidgets.QWidget_Native, html: str) -> BrowserDialog: + r""" + @brief Creates a HTML browser window with a static HTML content + This method variant with a parent argument has been introduced in version 0.24.2. + """ + @overload + @classmethod + def new(cls, parent: QtWidgets.QWidget_Native, source: BrowserSource) -> BrowserDialog: + r""" + @brief Creates a HTML browser window with a \BrowserSource as the source of HTML code + This method variant with a parent argument has been introduced in version 0.24.2. + """ + @overload + def __init__(self, html: str) -> None: + r""" + @brief Creates a HTML browser window with a static HTML content + This method has been introduced in version 0.23. + """ + @overload + def __init__(self, source: BrowserSource) -> None: + r""" + @brief Creates a HTML browser window with a \BrowserSource as the source of HTML code + This method has been introduced in version 0.23. + """ + @overload + def __init__(self, parent: QtWidgets.QWidget_Native, html: str) -> None: + r""" + @brief Creates a HTML browser window with a static HTML content + This method variant with a parent argument has been introduced in version 0.24.2. + """ + @overload + def __init__(self, parent: QtWidgets.QWidget_Native, source: BrowserSource) -> None: + r""" + @brief Creates a HTML browser window with a \BrowserSource as the source of HTML code + This method variant with a parent argument has been introduced in version 0.24.2. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def exec_(self) -> int: + r""" + @brief Executes the HTML browser dialog as a modal window + """ + def execute(self) -> int: + r""" + @brief Executes the HTML browser dialog as a modal window + """ + def load(self, url: str) -> None: + r""" + @brief Loads the given URL into the browser dialog + Typically the URL has the "int:" scheme so the HTML code is taken from the \BrowserSource object. + """ + def reload(self) -> None: + r""" + @brief Reloads the current page + """ + def resize(self, width: int, height: int) -> None: + r""" + @brief Sets the size of the dialog window + """ + def search(self, search_item: str) -> None: + r""" + @brief Issues a search request using the given search item and the search URL specified with \set_search_url + + See \set_search_url for a description of the search mechanism. + """ + def set_caption(self, caption: str) -> None: + r""" + @brief Sets the caption of the window + """ + def set_home(self, home_url: str) -> None: + r""" + @brief Sets the browser's initial and current URL which is selected if the "home" location is chosen + The home URL is the one shown initially and the one which is selected when the "home" button is pressed. The default location is "int:/index.html". + """ + def set_search_url(self, url: str, query_item: str) -> None: + r""" + @brief Enables the search field and specifies the search URL generated for a search + + If a search URL is set, the search box right to the navigation bar will be enabled. When a text is entered into the search box, the browser will navigate to an URL composed of the search URL, the search item and the search text, i.e. "myurl?item=search_text". + + This method has been introduced in version 0.23. + """ + def set_size(self, width: int, height: int) -> None: + r""" + @brief Sets the size of the dialog window + """ + def set_source(self, source: BrowserSource) -> None: + r""" + @brief Connects to a source object + + Setting the source should be the first thing done after the BrowserDialog object is created. It will not have any effect after the browser has loaded the first page. In particular, \home= should be called after the source was set. + """ + +class BrowserSource_Native: + r""" + @hide + @alias BrowserSource + """ + @classmethod + def new(cls) -> BrowserSource_Native: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> BrowserSource_Native: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: BrowserSource_Native) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> BrowserSource_Native: + r""" + @brief Creates a copy of self + """ + def get(self, arg0: str) -> str: + r""" + """ + def get_image(self, url: str) -> QtGui.QImage_Native: + r""" + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def next_topic(self, url: str) -> str: + r""" + """ + def prev_topic(self, url: str) -> str: + r""" + """ + +class BrowserSource: + r""" + @brief The BrowserDialog's source for "int" URL's + + The source object basically acts as a "server" for special URL's using "int" as the scheme. + Classes that want to implement such functionality must derive from BrowserSource and reimplement + the \get method. This method is supposed to deliver a HTML page for the given URL. + + Alternatively to implementing this functionality, a source object may be instantiated using the + constructor with a HTML code string. This will create a source object that simply displays the given string + as the initial and only page. + """ + @classmethod + def new(cls, arg0: str) -> BrowserSource: + r""" + @brief Constructs a BrowserSource object with a default HTML string + + The default HTML string is sent when no specific implementation is provided. + """ + @classmethod + def new_html(cls, arg0: str) -> BrowserSource: + r""" + @brief Constructs a BrowserSource object with a default HTML string + + The default HTML string is sent when no specific implementation is provided. + """ + def __copy__(self) -> BrowserSource: + r""" + @brief Creates a copy of self + """ + def __init__(self, arg0: str) -> None: + r""" + @brief Constructs a BrowserSource object with a default HTML string + + The default HTML string is sent when no specific implementation is provided. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: BrowserSource) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> BrowserSource: + r""" + @brief Creates a copy of self + """ + def get_image(self, url: str) -> QtGui.QImage_Native: + r""" + @brief Gets the image object for a specific URL + + This method has been introduced in version 0.28. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def next_topic(self, url: str) -> str: + r""" + @brief Gets the next topic URL from a given URL + An empty string will be returned if no next topic is available. + + This method has been introduced in version 0.28. + """ + def prev_topic(self, url: str) -> str: + r""" + @brief Gets the previous topic URL from a given URL + An empty string will be returned if no previous topic is available. + + This method has been introduced in version 0.28. + """ + +class BrowserPanel(QWidget_Native): + r""" + @brief A HTML display and browser widget + + This widget provides the functionality of \BrowserDialog within a widget. It can be embedded into other dialogs. For details about the use model of this class see \BrowserDialog. + + This class has been introduced in version 0.25. + """ + @property + def home(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the browser widget's initial and current URL which is selected if the "home" location is chosen + The home URL is the one shown initially and the one which is selected when the "home" button is pressed. The default location is "int:/index.html". + """ + @property + def label(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the label text + + The label is shown left of the navigation buttons. + By default, no label is specified. + """ + @property + def source(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Connects to a source object + + Setting the source should be the first thing done after the BrowserDialog object is created. It will not have any effect after the browser has loaded the first page. In particular, \home= should be called after the source was set. + """ + @overload + @classmethod + def new(cls, parent: QtWidgets.QWidget_Native) -> BrowserPanel: + r""" + @brief Creates a HTML browser widget + """ + @overload + @classmethod + def new(cls, parent: QtWidgets.QWidget_Native, source: BrowserSource_Native) -> BrowserPanel: + r""" + @brief Creates a HTML browser widget with a \BrowserSource as the source of HTML code + """ + @overload + def __init__(self, parent: QtWidgets.QWidget_Native) -> None: + r""" + @brief Creates a HTML browser widget + """ + @overload + def __init__(self, parent: QtWidgets.QWidget_Native, source: BrowserSource_Native) -> None: + r""" + @brief Creates a HTML browser widget with a \BrowserSource as the source of HTML code + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def load(self, url: str) -> None: + r""" + @brief Loads the given URL into the browser widget + Typically the URL has the "int:" scheme so the HTML code is taken from the \BrowserSource object. + """ + def reload(self) -> None: + r""" + @brief Reloads the current page + """ + def search(self, search_item: str) -> None: + r""" + @brief Issues a search request using the given search item and the search URL specified with \set_search_url + + See \search_url= for a description of the search mechanism. + """ + def set_search_url(self, url: str, query_item: str) -> None: + r""" + @brief Enables the search field and specifies the search URL generated for a search + + If a search URL is set, the search box right to the navigation bar will be enabled. When a text is entered into the search box, the browser will navigate to an URL composed of the search URL, the search item and the search text, i.e. "myurl?item=search_text". + """ + def url(self) -> str: + r""" + @brief Gets the URL currently shown + """ + +class InputDialog: + r""" + @brief Various methods to open a dialog requesting data entry + This class provides some basic dialogs to enter a single value. Values can be strings floating-point values, integer values or an item from a list. + This functionality is provided through the static (class) methods ask_... + + Here are some examples: + + @code + # get a double value between -10 and 10 (initial value is 0): + v = RBA::InputDialog::ask_double_ex("Dialog Title", "Enter the value here:", 0, -10, 10, 1) + # get an item from a list: + v = RBA::InputDialog::ask_item("Dialog Title", "Select one:", [ "item 1", "item 2", "item 3" ], 1) + @/code + + All these examples return the "nil" value if "Cancel" is pressed. + + If you have enabled the Qt binding, you can use \QInputDialog directly. + """ + @classmethod + def ask_double(cls, title: str, label: str, value: float, digits: int) -> Any: + r""" + @brief Open an input dialog requesting a floating-point value + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @param digits The number of digits allowed + @return The value entered if "Ok" was pressed or nil if "Cancel" was pressed + This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. + """ + @classmethod + def ask_double_ex(cls, title: str, label: str, value: float, min: float, max: float, digits: int) -> Any: + r""" + @brief Open an input dialog requesting a floating-point value with enhanced capabilities + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @param min The minimum value allowed + @param max The maximum value allowed + @param digits The number of digits allowed + @return The value entered if "Ok" was pressed or nil if "Cancel" was pressed + This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. + """ + @classmethod + def ask_int(cls, title: str, label: str, value: int) -> Any: + r""" + @brief Open an input dialog requesting an integer value + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @return The value entered if "Ok" was pressed or nil if "Cancel" was pressed + This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. + """ + @classmethod + def ask_int_ex(cls, title: str, label: str, value: int, min: int, max: int, step: int) -> Any: + r""" + @brief Open an input dialog requesting an integer value with enhanced capabilities + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @param min The minimum value allowed + @param max The maximum value allowed + @param step The step size for the spin buttons + @return The value entered if "Ok" was pressed or nil if "Cancel" was pressed + This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. + """ + @classmethod + def ask_item(cls, title: str, label: str, items: Sequence[str], value: int) -> Any: + r""" + @brief Open an input dialog requesting an item from a list + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param items The list of items to show in the selection element + @param selection The initial selection (index of the element selected initially) + @return The string of the item selected if "Ok" was pressed or nil if "Cancel" was pressed + This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. + """ + @classmethod + def ask_string(cls, title: str, label: str, value: str) -> Any: + r""" + @brief Open an input dialog requesting a string + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @return The string entered if "Ok" was pressed or nil if "Cancel" was pressed + This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. + """ + @classmethod + def ask_string_password(cls, title: str, label: str, value: str) -> Any: + r""" + @brief Open an input dialog requesting a string without showing the actual characters entered + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @return The string entered if "Ok" was pressed or nil if "Cancel" was pressed + This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. + """ + @classmethod + def get_double(cls, title: str, label: str, value: float, digits: int) -> DoubleValue: + r""" + @brief Open an input dialog requesting a floating-point value + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @param digits The number of digits allowed + @return A \DoubleValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute + Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. + """ + @classmethod + def get_double_ex(cls, title: str, label: str, value: float, min: float, max: float, digits: int) -> DoubleValue: + r""" + @brief Open an input dialog requesting a floating-point value with enhanced capabilities + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @param min The minimum value allowed + @param max The maximum value allowed + @param digits The number of digits allowed + @return A \DoubleValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute + Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. + """ + @classmethod + def get_int(cls, title: str, label: str, value: int) -> IntValue: + r""" + @brief Open an input dialog requesting an integer value + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @return A \IntValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute + Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. + """ + @classmethod + def get_int_ex(cls, title: str, label: str, value: int, min: int, max: int, step: int) -> IntValue: + r""" + @brief Open an input dialog requesting an integer value with enhanced capabilities + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @param min The minimum value allowed + @param max The maximum value allowed + @param step The step size for the spin buttons + @return A \IntValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute + Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. + """ + @classmethod + def get_item(cls, title: str, label: str, items: Sequence[str], value: int) -> StringValue: + r""" + @brief Open an input dialog requesting an item from a list + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param items The list of items to show in the selection element + @param selection The initial selection (index of the element selected initially) + @return A \StringValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute + Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. + """ + @classmethod + def get_string(cls, title: str, label: str, value: str) -> StringValue: + r""" + @brief Open an input dialog requesting a string + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @return A \StringValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute + Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. + """ + @classmethod + def get_string_password(cls, title: str, label: str, value: str) -> StringValue: + r""" + @brief Open an input dialog requesting a string without showing the actual characters entered + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @return A \StringValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute + Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. + """ + @classmethod + def new(cls) -> InputDialog: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> InputDialog: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: InputDialog) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> InputDialog: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + +class FileDialog: + r""" + @brief Various methods to request a file name + + This class provides some basic dialogs to select a file or directory. This functionality is provided through the static (class) methods ask_... + + Here are some examples: + + @code + # get an existing directory: + v = RBA::FileDialog::ask_existing_dir("Dialog Title", ".") + # get multiple files: + v = RBA::FileDialog::ask_open_file_names("Title", ".", "All files (*)") + # ask for one file name to save a file: + v = RBA::FileDialog::ask_save_file_name("Title", ".", "All files (*)") + @/code + + All these examples return the "nil" value if "Cancel" is pressed. + + If you have enabled the Qt binding, you can use \QFileDialog directly. + """ + @classmethod + def ask_existing_dir(cls, title: str, dir: str) -> Any: + r""" + @brief Open a dialog to select a directory + + @param title The title of the dialog + @param dir The directory selected initially + @return The directory path selected or "nil" if "Cancel" was pressed + + This method has been introduced in version 0.23. It is somewhat easier to use than the get_... equivalent. + """ + @classmethod + def ask_open_file_name(cls, title: str, dir: str, filter: str) -> Any: + r""" + @brief Select one file for opening + + @param title The title of the dialog + @param dir The directory selected initially + @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" + @return The path of the file selected or "nil" if "Cancel" was pressed + + This method has been introduced in version 0.23. It is somewhat easier to use than the get_... equivalent. + """ + @classmethod + def ask_open_file_names(cls, title: str, dir: str, filter: str) -> Any: + r""" + @brief Select one or multiple files for opening + + @param title The title of the dialog + @param dir The directory selected initially + @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" + @return An array with the file paths selected or "nil" if "Cancel" was pressed + + This method has been introduced in version 0.23. It is somewhat easier to use than the get_... equivalent. + """ + @classmethod + def ask_save_file_name(cls, title: str, dir: str, filter: str) -> Any: + r""" + @brief Select one file for writing + + @param title The title of the dialog + @param dir The directory selected initially + @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" + @return The path of the file chosen or "nil" if "Cancel" was pressed + + This method has been introduced in version 0.23. It is somewhat easier to use than the get_... equivalent. + """ + @classmethod + def get_existing_dir(cls, title: str, dir: str) -> StringValue: + r""" + @brief Open a dialog to select a directory + + @param title The title of the dialog + @param dir The directory selected initially + @return A \StringValue object that contains the directory path selected or with has_value? = false if "Cancel" was pressed + + Starting with version 0.23 this method is deprecated. Use \ask_existing_dir instead. + """ + @classmethod + def get_open_file_name(cls, title: str, dir: str, filter: str) -> StringValue: + r""" + @brief Select one file for opening + + @param title The title of the dialog + @param dir The directory selected initially + @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" + @return A \StringValue object that contains the files selected or with has_value? = false if "Cancel" was pressed + + Starting with version 0.23 this method is deprecated. Use \ask_open_file_name instead. + """ + @classmethod + def get_open_file_names(cls, title: str, dir: str, filter: str) -> StringListValue: + r""" + @brief Select one or multiple files for opening + + @param title The title of the dialog + @param dir The directory selected initially + @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" + @return A \StringListValue object that contains the files selected or with has_value? = false if "Cancel" was pressed + + Starting with version 0.23 this method is deprecated. Use \ask_open_file_names instead. + """ + @classmethod + def get_save_file_name(cls, title: str, dir: str, filter: str) -> StringValue: + r""" + @brief Select one file for writing + + @param title The title of the dialog + @param dir The directory selected initially + @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" + @return A \StringValue object that contains the files selected or with has_value? = false if "Cancel" was pressed + + Starting with version 0.23 this method is deprecated. Use \ask_save_file_name instead. + """ + @classmethod + def new(cls) -> FileDialog: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> FileDialog: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: FileDialog) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> FileDialog: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + +class MessageBox(QMainWindow_Native): + r""" + @brief Various methods to display message boxes + This class provides some basic message boxes. This functionality is provided through the static (class) methods \warning, \question and so on. + + Here is some example: + + @code + # issue a warning and ask whether to continue: + v = RBA::MessageBox::warning("Dialog Title", "Something happened. Continue?", RBA::MessageBox::Yes + RBA::MessageBox::No) + if v == RBA::MessageBox::Yes + ... continue ... + end + @/code + + If you have enabled the Qt binding, you can use \QMessageBox directly. + """ + Abort: ClassVar[int] + r""" + @brief A constant describing the 'Abort' button + """ + Cancel: ClassVar[int] + r""" + @brief A constant describing the 'Cancel' button + """ + Ignore: ClassVar[int] + r""" + @brief A constant describing the 'Ignore' button + """ + No: ClassVar[int] + r""" + @brief A constant describing the 'No' button + """ + Ok: ClassVar[int] + r""" + @brief A constant describing the 'Ok' button + """ + Retry: ClassVar[int] + r""" + @brief A constant describing the 'Retry' button + """ + Yes: ClassVar[int] + r""" + @brief A constant describing the 'Yes' button + """ + @classmethod + def b_abort(cls) -> int: + r""" + @brief A constant describing the 'Abort' button + """ + @classmethod + def b_cancel(cls) -> int: + r""" + @brief A constant describing the 'Cancel' button + """ + @classmethod + def b_ignore(cls) -> int: + r""" + @brief A constant describing the 'Ignore' button + """ + @classmethod + def b_no(cls) -> int: + r""" + @brief A constant describing the 'No' button + """ + @classmethod + def b_ok(cls) -> int: + r""" + @brief A constant describing the 'Ok' button + """ + @classmethod + def b_retry(cls) -> int: + r""" + @brief A constant describing the 'Retry' button + """ + @classmethod + def b_yes(cls) -> int: + r""" + @brief A constant describing the 'Yes' button + """ + @classmethod + def critical(cls, title: str, text: str, buttons: int) -> int: + r""" + @brief Open a critical (error) message box + @param title The title of the window + @param text The text to show + @param buttons A combination (+) of button constants (\Ok and so on) describing the buttons to show for the message box + @return The button constant describing the button that was pressed + """ + @classmethod + def info(cls, title: str, text: str, buttons: int) -> int: + r""" + @brief Open a information message box + @param title The title of the window + @param text The text to show + @param buttons A combination (+) of button constants (\Ok and so on) describing the buttons to show for the message box + @return The button constant describing the button that was pressed + """ + @classmethod + def question(cls, title: str, text: str, buttons: int) -> int: + r""" + @brief Open a question message box + @param title The title of the window + @param text The text to show + @param buttons A combination (+) of button constants (\Ok and so on) describing the buttons to show for the message box + @return The button constant describing the button that was pressed + """ + @classmethod + def warning(cls, title: str, text: str, buttons: int) -> int: + r""" + @brief Open a warning message box + @param title The title of the window + @param text The text to show + @param buttons A combination (+) of button constants (\Ok and so on) describing the buttons to show for the message box + @return The button constant describing the button that was pressed + """ + def __copy__(self) -> MessageBox: + r""" + @brief Creates a copy of self + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: QObject_Native) -> None: + r""" + @brief Assigns another object to self + """ + def dup(self) -> MessageBox: + r""" + @brief Creates a copy of self + """ + +class NetlistObjectPath: + r""" + @brief An object describing the instantiation of a netlist object. + This class describes the instantiation of a net or a device or a circuit in terms of a root circuit and a subcircuit chain leading to the indicated object. + + See \net= or \device= for the indicated object, \path= for the subcircuit chain. + + This class has been introduced in version 0.27. + """ + device: db.Device + r""" + Getter: + @brief Gets the device the path points to. + + Setter: + @brief Sets the device the path points to. + If the path describes the location of a device, this member will indicate it. + The other way to describe a final object is \net=. If neither a device nor net is given, the path describes a circuit and how it is referenced from the root. + """ + net: db.Net + r""" + Getter: + @brief Gets the net the path points to. + + Setter: + @brief Sets the net the path points to. + If the path describes the location of a net, this member will indicate it. + The other way to describe a final object is \device=. If neither a device nor net is given, the path describes a circuit and how it is referenced from the root. + """ + path: List[db.SubCircuit] + r""" + Getter: + @brief Gets the path. + + Setter: + @brief Sets the path. + The path is a list of subcircuits leading from the root to the final object. The final (net, device) object is located in the circuit called by the last subcircuit of the subcircuit chain. If the subcircuit list is empty, the final object is located inside the root object. + """ + root: db.Circuit + r""" + Getter: + @brief Gets the root circuit of the path. + + Setter: + @brief Sets the root circuit of the path. + The root circuit is the circuit from which the path starts. + """ + @classmethod + def new(cls) -> NetlistObjectPath: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetlistObjectPath: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetlistObjectPath) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> NetlistObjectPath: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_null(self) -> bool: + r""" + @brief Returns a value indicating whether the path is an empty one. + """ + +class NetlistObjectsPath: + r""" + @brief An object describing the instantiation of a single netlist object or a pair of those. + This class is basically a pair of netlist object paths (see \NetlistObjectPath). When derived from a single netlist view, only the first path is valid and will point to the selected object (a net, a device or a circuit). The second path is null. + + If the path is derived from a paired netlist view (a LVS report view), the first path corresponds to the object in the layout netlist, the second one to the object in the schematic netlist. + If the selected object isn't a matched one, either the first or second path may be a null or a partial path without a final net or device object or a partial path. + + This class has been introduced in version 0.27. + """ + @classmethod + def new(cls) -> NetlistObjectsPath: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetlistObjectsPath: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetlistObjectsPath) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> NetlistObjectsPath: + r""" + @brief Creates a copy of self + """ + def first(self) -> NetlistObjectPath: + r""" + @brief Gets the first object's path. + In cases of paired netlists (LVS database), the first path points to the layout netlist object. + For the single netlist, the first path is the only path supplied. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def second(self) -> NetlistObjectPath: + r""" + @brief Gets the second object's path. + In cases of paired netlists (LVS database), the first path points to the schematic netlist object. + For the single netlist, the second path is always a null path. + """ + +class NetlistBrowserDialog: + r""" + @brief Represents the netlist browser dialog. + This dialog is a part of the \LayoutView class and can be obtained through \LayoutView#netlist_browser. + This interface allows to interact with the browser - mainly to get information about state changes. + + This class has been introduced in version 0.27. + """ + on_current_db_changed: None + r""" + Getter: + @brief This event is triggered when the current database is changed. + The current database can be obtained with \db. + Setter: + @brief This event is triggered when the current database is changed. + The current database can be obtained with \db. + """ + on_probe: None + r""" + Getter: + @brief This event is triggered when a net is probed. + The first path will indicate the location of the probed net in terms of two paths: one describing the instantiation of the net in layout space and one in schematic space. Both objects are \NetlistObjectPath objects which hold the root circuit, the chain of subcircuits leading to the circuit containing the net and the net itself. + Setter: + @brief This event is triggered when a net is probed. + The first path will indicate the location of the probed net in terms of two paths: one describing the instantiation of the net in layout space and one in schematic space. Both objects are \NetlistObjectPath objects which hold the root circuit, the chain of subcircuits leading to the circuit containing the net and the net itself. + """ + on_selection_changed: None + r""" + Getter: + @brief This event is triggered when the selection changed. + The selection can be obtained with \current_path_first, \current_path_second, \selected_nets, \selected_devices, \selected_subcircuits and \selected_circuits. + Setter: + @brief This event is triggered when the selection changed. + The selection can be obtained with \current_path_first, \current_path_second, \selected_nets, \selected_devices, \selected_subcircuits and \selected_circuits. + """ + @classmethod + def new(cls) -> NetlistBrowserDialog: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def current_path(self) -> NetlistObjectsPath: + r""" + @brief Gets the path of the current object as a path pair (combines layout and schematic object paths in case of a LVS database view). + """ + def current_path_first(self) -> NetlistObjectPath: + r""" + @brief Gets the path of the current object on the first (layout in case of LVS database) side. + """ + def current_path_second(self) -> NetlistObjectPath: + r""" + @brief Gets the path of the current object on the second (schematic in case of LVS database) side. + """ + def db(self) -> db.LayoutToNetlist: + r""" + @brief Gets the database the browser is connected to. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def selected_paths(self) -> List[NetlistObjectsPath]: + r""" + @brief Gets the nets currently selected objects (paths) in the netlist database browser. + The result is an array of path pairs. See \NetlistObjectsPath for details about these pairs. + """ + +class LayoutViewWidget(QFrame_Native): + r""" + This object produces a widget which embeds a LayoutView. This widget can be used inside Qt widget hierarchies. + To access the \LayoutView object within, use \view. + + This class has been introduced in version 0.28. + """ + @classmethod + def new(cls, parent: QtWidgets.QWidget_Native, editable: Optional[bool] = ..., manager: Optional[db.Manager] = ..., options: Optional[int] = ...) -> LayoutViewWidget: + r""" + @brief Creates a standalone view widget + + @param parent The parent widget in which to embed the view + @param editable True to make the view editable + @param manager The \Manager object to enable undo/redo + @param options A combination of the values in the LV_... constants from \LayoutViewBase + + This constructor has been introduced in version 0.25. + It has been enhanced with the arguments in version 0.27. + """ + def __init__(self, parent: QtWidgets.QWidget_Native, editable: Optional[bool] = ..., manager: Optional[db.Manager] = ..., options: Optional[int] = ...) -> None: + r""" + @brief Creates a standalone view widget + + @param parent The parent widget in which to embed the view + @param editable True to make the view editable + @param manager The \Manager object to enable undo/redo + @param options A combination of the values in the LV_... constants from \LayoutViewBase + + This constructor has been introduced in version 0.25. + It has been enhanced with the arguments in version 0.27. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def bookmarks_frame(self) -> QtWidgets.QWidget_Native: + r""" + @brief Gets the bookmarks side widget + For details about side widgets see \layer_control_frame. + + This method has been introduced in version 0.27 + """ + def hierarchy_control_frame(self) -> QtWidgets.QWidget_Native: + r""" + @brief Gets the cell view (hierarchy view) side widget + For details about side widgets see \layer_control_frame. + + This method has been introduced in version 0.27 + """ + def layer_control_frame(self) -> QtWidgets.QWidget_Native: + r""" + @brief Gets the layer control side widget + A 'side widget' is a widget attached to the view. It does not have a parent, so you can embed it into a different context. Please note that with embedding through 'setParent' it will be destroyed when your parent widget gets destroyed. It will be lost then to the view. + + The side widget can be configured through the views configuration interface. + + This method has been introduced in version 0.27 + """ + def layer_toolbox_frame(self) -> QtWidgets.QWidget_Native: + r""" + @brief Gets the layer toolbox side widget + A 'side widget' is a widget attached to the view. It does not have a parent, so you can embed it into a different context. Please note that with embedding through 'setParent' it will be destroyed when your parent widget gets destroyed. It will be lost then to the view. + + The side widget can be configured through the views configuration interface. + + This method has been introduced in version 0.28 + """ + def libraries_frame(self) -> QtWidgets.QWidget_Native: + r""" + @brief Gets the library view side widget + For details about side widgets see \layer_control_frame. + + This method has been introduced in version 0.27 + """ + def view(self) -> LayoutView: + r""" + @brief Gets the embedded view object. + """ + +class LayoutView(LayoutViewBase): + r""" + @brief The view object presenting one or more layout objects + + The visual part of the view is the tab panel in the main window. The non-visual part are the redraw thread, the layout handles, cell lists, layer view lists etc. This object controls these aspects of the view and controls the appearance of the data. + """ + on_close: None + r""" + Getter: + @brief A event indicating that the view is about to close + + This event is triggered when the view is going to be closed entirely. + + It has been added in version 0.25. + Setter: + @brief A event indicating that the view is about to close + + This event is triggered when the view is going to be closed entirely. + + It has been added in version 0.25. + """ + on_hide: None + r""" + Getter: + @brief A event indicating that the view is going to become invisible + + It has been added in version 0.25. + Setter: + @brief A event indicating that the view is going to become invisible + + It has been added in version 0.25. + """ + on_show: None + r""" + Getter: + @brief A event indicating that the view is going to become visible + + It has been added in version 0.25. + Setter: + @brief A event indicating that the view is going to become visible + + It has been added in version 0.25. + """ + @classmethod + def current(cls) -> LayoutView: + r""" + @brief Returns the current view + The current view is the one that is shown in the current tab. Returns nil if no layout is loaded. + + This method has been introduced in version 0.23. + """ + @classmethod + def new(cls, editable: Optional[bool] = ..., manager: Optional[db.Manager] = ..., options: Optional[int] = ...) -> LayoutView: + r""" + @brief Creates a standalone view + + This constructor is for special purposes only. To create a view in the context of a main window, use \MainWindow#create_view and related methods. + + @param editable True to make the view editable + @param manager The \Manager object to enable undo/redo + @param options A combination of the values in the LV_... constants from \LayoutViewBase + + This constructor has been introduced in version 0.25. + It has been enhanced with the arguments in version 0.27. + """ + def __init__(self, editable: Optional[bool] = ..., manager: Optional[db.Manager] = ..., options: Optional[int] = ...) -> None: + r""" + @brief Creates a standalone view + + This constructor is for special purposes only. To create a view in the context of a main window, use \MainWindow#create_view and related methods. + + @param editable True to make the view editable + @param manager The \Manager object to enable undo/redo + @param options A combination of the values in the LV_... constants from \LayoutViewBase + + This constructor has been introduced in version 0.25. + It has been enhanced with the arguments in version 0.27. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def bookmark_view(self, name: str) -> None: + r""" + @brief Bookmarks the current view under the given name + + @param name The name under which to bookmark the current state + """ + def close(self) -> None: + r""" + @brief Closes the view + + This method has been added in version 0.27. + """ + def show_l2ndb(self, l2ndb_index: int, cv_index: int) -> None: + r""" + @brief Shows a netlist database in the marker browser on a certain layout + The netlist browser is opened showing the netlist database with the index given by "l2ndb_index". + It will be attached (i.e. navigate to) the layout with the given cellview index in "cv_index". + + This method has been added in version 0.26. + """ + def show_lvsdb(self, lvsdb_index: int, cv_index: int) -> None: + r""" + @brief Shows a netlist database in the marker browser on a certain layout + The netlist browser is opened showing the netlist database with the index given by "lvsdb_index". + It will be attached (i.e. navigate to) the layout with the given cellview index in "cv_index". + + This method has been added in version 0.26. + """ + def show_rdb(self, rdb_index: int, cv_index: int) -> None: + r""" + @brief Shows a report database in the marker browser on a certain layout + The marker browser is opened showing the report database with the index given by "rdb_index". + It will be attached (i.e. navigate to) the layout with the given cellview index in "cv_index". + """ + +class BasicAnnotation: + r""" + @hide + @alias Annotation + """ + @classmethod + def new(cls) -> BasicAnnotation: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> BasicAnnotation: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: BasicAnnotation) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> BasicAnnotation: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + +class Annotation(BasicAnnotation): + r""" + @brief A layout annotation (i.e. ruler) + + Annotation objects provide a way to attach measurements or descriptive information to a layout view. Annotation objects can appear as rulers for example. Annotation objects can be configured in different ways using the styles provided. By configuring an annotation object properly, it can appear as a rectangle or a plain line for example. + See @Ruler properties@ for more details about the appearance options. + + Annotations are inserted into a layout view using \LayoutView#insert_annotation. Here is some sample code in Ruby: + + @code + app = RBA::Application.instance + mw = app.main_window + view = mw.current_view + + ant = RBA::Annotation::new + ant.p1 = RBA::DPoint::new(0, 0) + ant.p2 = RBA::DPoint::new(100, 0) + ant.style = RBA::Annotation::StyleRuler + view.insert_annotation(ant) + @/code + + Annotations can be retrieved from a view with \LayoutView#each_annotation and all annotations can be cleared with \LayoutView#clear_annotations. + + Starting with version 0.25, annotations are 'live' objects once they are inserted into the view. Changing properties of annotations will automatically update the view (however, that is not true the other way round). + + Here is some sample code of changing the style of all rulers to two-sided arrows: + + @code + view = RBA::LayoutView::current + + begin + + view.transaction("Restyle annotations") + + view.each_annotation do |a| + a.style = RBA::Annotation::StyleArrowBoth + end + + ensure + view.commit + end + @/code + """ + AlignAuto: ClassVar[int] + r""" + @brief This code indicates automatic alignment. + This code makes the annotation align the label the way it thinks is best. + + This constant has been introduced in version 0.25. + """ + AlignBottom: ClassVar[int] + r""" + @brief This code indicates bottom alignment. + If used in a vertical context, this alignment code makes the label aligned at the bottom side - i.e. it will appear top of the reference point. + + This constant has been introduced in version 0.25. + """ + AlignCenter: ClassVar[int] + r""" + @brief This code indicates automatic alignment. + This code makes the annotation align the label centered. When used in a horizontal context, centering is in horizontal direction. If used in a vertical context, centering is in vertical direction. + + This constant has been introduced in version 0.25. + """ + AlignDown: ClassVar[int] + r""" + @brief This code indicates left or bottom alignment, depending on the context. + This code is equivalent to \AlignLeft and \AlignBottom. + + This constant has been introduced in version 0.25. + """ + AlignLeft: ClassVar[int] + r""" + @brief This code indicates left alignment. + If used in a horizontal context, this alignment code makes the label aligned at the left side - i.e. it will appear right of the reference point. + + This constant has been introduced in version 0.25. + """ + AlignRight: ClassVar[int] + r""" + @brief This code indicates right alignment. + If used in a horizontal context, this alignment code makes the label aligned at the right side - i.e. it will appear left of the reference point. + + This constant has been introduced in version 0.25. + """ + AlignTop: ClassVar[int] + r""" + @brief This code indicates top alignment. + If used in a vertical context, this alignment code makes the label aligned at the top side - i.e. it will appear bottom of the reference point. + + This constant has been introduced in version 0.25. + """ + AlignUp: ClassVar[int] + r""" + @brief This code indicates right or top alignment, depending on the context. + This code is equivalent to \AlignRight and \AlignTop. + + This constant has been introduced in version 0.25. + """ + AngleAny: ClassVar[int] + r""" + @brief Gets the any angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, all angles will be allowed. + """ + AngleDiagonal: ClassVar[int] + r""" + @brief Gets the diagonal angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, only multiples of 45 degree are allowed. + """ + AngleGlobal: ClassVar[int] + r""" + @brief Gets the global angle code for use with the \angle_constraint method. + This code will tell the ruler or marker to use the angle constraint defined globally. + """ + AngleHorizontal: ClassVar[int] + r""" + @brief Gets the horizontal angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, only horizontal rulers are allowed. + """ + AngleOrtho: ClassVar[int] + r""" + @brief Gets the ortho angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, only multiples of 90 degree are allowed. + """ + AngleVertical: ClassVar[int] + r""" + @brief Gets the vertical angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, only vertical rulers are allowed. + """ + OutlineBox: ClassVar[int] + r""" + @brief Gets the box outline code for use with the \outline method + When this outline style is specified, a box is drawn with the corners specified by the start and end point. All box edges are drawn in the style specified with the \style attribute. + """ + OutlineDiag: ClassVar[int] + r""" + @brief Gets the diagonal output code for use with the \outline method + When this outline style is specified, a line connecting start and end points in the given style (ruler, arrow or plain line) is drawn. + """ + OutlineDiagXY: ClassVar[int] + r""" + @brief Gets the xy plus diagonal outline code for use with the \outline method + @brief outline_xy code used by the \outline method + When this outline style is specified, three lines are drawn: one horizontal from left to right and attached to the end of that a line from the bottom to the top. Another line is drawn connecting the start and end points directly. The lines are drawn in the specified style (see \style method). + """ + OutlineDiagYX: ClassVar[int] + r""" + @brief Gets the yx plus diagonal outline code for use with the \outline method + When this outline style is specified, three lines are drawn: one vertical from bottom to top and attached to the end of that a line from the left to the right. Another line is drawn connecting the start and end points directly. The lines are drawn in the specified style (see \style method). + """ + OutlineEllipse: ClassVar[int] + r""" + @brief Gets the ellipse outline code for use with the \outline method + When this outline style is specified, an ellipse is drawn with the extensions specified by the start and end point. The contour drawn as a line. + + This constant has been introduced in version 0.26. + """ + OutlineXY: ClassVar[int] + r""" + @brief Gets the xy outline code for use with the \outline method + When this outline style is specified, two lines are drawn: one horizontal from left to right and attached to the end of that a line from the bottom to the top. The lines are drawn in the specified style (see \style method). + """ + OutlineYX: ClassVar[int] + r""" + @brief Gets the yx outline code for use with the \outline method + When this outline style is specified, two lines are drawn: one vertical from bottom to top and attached to the end of that a line from the left to the right. The lines are drawn in the specified style (see \style method). + """ + PositionAuto: ClassVar[int] + r""" + @brief This code indicates automatic positioning. + The main label will be put either to p1 or p2, whichever the annotation considers best. + + This constant has been introduced in version 0.25. + """ + PositionCenter: ClassVar[int] + r""" + @brief This code indicates positioning of the main label at the mid point between p1 and p2. + The main label will be put to the center point. + + This constant has been introduced in version 0.25. + """ + PositionP1: ClassVar[int] + r""" + @brief This code indicates positioning of the main label at p1. + The main label will be put to p1. + + This constant has been introduced in version 0.25. + """ + PositionP2: ClassVar[int] + r""" + @brief This code indicates positioning of the main label at p2. + The main label will be put to p2. + + This constant has been introduced in version 0.25. + """ + RulerModeAutoMetric: ClassVar[int] + r""" + @brief Specifies auto-metric ruler mode for the \register_template method + In auto-metric mode, a ruler can be placed with a single click and p1/p2 will be determined from the neighborhood. + This constant has been introduced in version 0.25 + """ + RulerModeNormal: ClassVar[int] + r""" + @brief Specifies normal ruler mode for the \register_template method + + This constant has been introduced in version 0.25 + """ + RulerModeSingleClick: ClassVar[int] + r""" + @brief Specifies single-click ruler mode for the \register_template method + In single click-mode, a ruler can be placed with a single click and p1 will be == p2. + This constant has been introduced in version 0.25 + """ + StyleArrowBoth: ClassVar[int] + r""" + @brief Gets the both arrow ends style code for use the \style method + When this style is specified, a two-headed arrow is drawn. + """ + StyleArrowEnd: ClassVar[int] + r""" + @brief Gets the end arrow style code for use the \style method + When this style is specified, an arrow is drawn pointing from the start to the end point. + """ + StyleArrowStart: ClassVar[int] + r""" + @brief Gets the start arrow style code for use the \style method + When this style is specified, an arrow is drawn pointing from the end to the start point. + """ + StyleCrossBoth: ClassVar[int] + r""" + @brief Gets the line style code for use with the \style method + When this style is specified, a cross is drawn at both points. + + This constant has been added in version 0.26. + """ + StyleCrossEnd: ClassVar[int] + r""" + @brief Gets the line style code for use with the \style method + When this style is specified, a cross is drawn at the end point. + + This constant has been added in version 0.26. + """ + StyleCrossStart: ClassVar[int] + r""" + @brief Gets the line style code for use with the \style method + When this style is specified, a cross is drawn at the start point. + + This constant has been added in version 0.26. + """ + StyleLine: ClassVar[int] + r""" + @brief Gets the line style code for use with the \style method + When this style is specified, a plain line is drawn. + """ + StyleRuler: ClassVar[int] + r""" + @brief Gets the ruler style code for use the \style method + When this style is specified, the annotation will show a ruler with some ticks at distances indicating a decade of units and a suitable subdivision into minor ticks at intervals of 1, 2 or 5 units. + """ + angle_constraint: int + r""" + Getter: + @brief Returns the angle constraint attribute + See \angle_constraint= for a more detailed description. + Setter: + @brief Sets the angle constraint attribute + This attribute controls if an angle constraint is applied when moving one of the ruler's points. The Angle... values can be used for this purpose. + """ + category: str + r""" + Getter: + @brief Gets the category string + See \category= for details. + + This method has been introduced in version 0.25 + Setter: + @brief Sets the category string of the annotation + The category string is an arbitrary string that can be used by various consumers or generators to mark 'their' annotation. + + This method has been introduced in version 0.25 + """ + fmt: str + r""" + Getter: + @brief Returns the format used for the label + @return The format string + Format strings can contain placeholders for values and formulas for computing derived values. See @Ruler properties@ for more details. + Setter: + @brief Sets the format used for the label + @param format The format string + Format strings can contain placeholders for values and formulas for computing derived values. See @Ruler properties@ for more details. + """ + fmt_x: str + r""" + Getter: + @brief Returns the format used for the x-axis label + @return The format string + Format strings can contain placeholders for values and formulas for computing derived values. See @Ruler properties@ for more details. + Setter: + @brief Sets the format used for the x-axis label + X-axis labels are only used for styles that have a horizontal component. @param format The format string + Format strings can contain placeholders for values and formulas for computing derived values. See @Ruler properties@ for more details. + """ + fmt_y: str + r""" + Getter: + @brief Returns the format used for the y-axis label + @return The format string + Format strings can contain placeholders for values and formulas for computing derived values. See @Ruler properties@ for more details. + Setter: + @brief Sets the format used for the y-axis label + Y-axis labels are only used for styles that have a vertical component. @param format The format string + Format strings can contain placeholders for values and formulas for computing derived values. See @Ruler properties@ for more details. + """ + main_position: int + r""" + Getter: + @brief Gets the position of the main label + See \main_position= for details. + + This method has been introduced in version 0.25 + Setter: + @brief Sets the position of the main label + This method accepts one of the Position... constants. + + This method has been introduced in version 0.25 + """ + main_xalign: int + r""" + Getter: + @brief Gets the horizontal alignment type of the main label + See \main_xalign= for details. + + This method has been introduced in version 0.25 + Setter: + @brief Sets the horizontal alignment type of the main label + This method accepts one of the Align... constants. + + This method has been introduced in version 0.25 + """ + main_yalign: int + r""" + Getter: + @brief Gets the vertical alignment type of the main label + See \main_yalign= for details. + + This method has been introduced in version 0.25 + Setter: + @brief Sets the vertical alignment type of the main label + This method accepts one of the Align... constants. + + This method has been introduced in version 0.25 + """ + outline: int + r""" + Getter: + @brief Returns the outline style of the annotation object + + Setter: + @brief Sets the outline style used for drawing the annotation object + The Outline... values can be used for defining the annotation object's outline. The outline style determines what components are drawn. + """ + p1: db.DPoint + r""" + Getter: + @brief Gets the first point of the ruler or marker + The points of the ruler or marker are always given in micron units in floating-point coordinates. + @return The first point + + Setter: + @brief Sets the first point of the ruler or marker + The points of the ruler or marker are always given in micron units in floating-point coordinates. + """ + p2: db.DPoint + r""" + Getter: + @brief Gets the second point of the ruler or marker + The points of the ruler or marker are always given in micron units in floating-point coordinates. + @return The second point + + Setter: + @brief Sets the second point of the ruler or marker + The points of the ruler or marker are always given in micron units in floating-point coordinates. + """ + snap: bool + r""" + Getter: + @brief Returns the 'snap to objects' attribute + + Setter: + @brief Sets the 'snap to objects' attribute + If this attribute is set to true, the ruler or marker snaps to other objects when moved. + """ + style: int + r""" + Getter: + @brief Returns the style of the annotation object + + Setter: + @brief Sets the style used for drawing the annotation object + The Style... values can be used for defining the annotation object's style. The style determines if ticks or arrows are drawn. + """ + xlabel_xalign: int + r""" + Getter: + @brief Gets the horizontal alignment type of the x axis label + See \xlabel_xalign= for details. + + This method has been introduced in version 0.25 + Setter: + @brief Sets the horizontal alignment type of the x axis label + This method accepts one of the Align... constants. + + This method has been introduced in version 0.25 + """ + xlabel_yalign: int + r""" + Getter: + @brief Gets the vertical alignment type of the x axis label + See \xlabel_yalign= for details. + + This method has been introduced in version 0.25 + Setter: + @brief Sets the vertical alignment type of the x axis label + This method accepts one of the Align... constants. + + This method has been introduced in version 0.25 + """ + ylabel_xalign: int + r""" + Getter: + @brief Gets the horizontal alignment type of the y axis label + See \ylabel_xalign= for details. + + This method has been introduced in version 0.25 + Setter: + @brief Sets the horizontal alignment type of the y axis label + This method accepts one of the Align... constants. + + This method has been introduced in version 0.25 + """ + ylabel_yalign: int + r""" + Getter: + @brief Gets the vertical alignment type of the y axis label + See \ylabel_yalign= for details. + + This method has been introduced in version 0.25 + Setter: + @brief Sets the vertical alignment type of the y axis label + This method accepts one of the Align... constants. + + This method has been introduced in version 0.25 + """ + @classmethod + def angle_any(cls) -> int: + r""" + @brief Gets the any angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, all angles will be allowed. + """ + @classmethod + def angle_diagonal(cls) -> int: + r""" + @brief Gets the diagonal angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, only multiples of 45 degree are allowed. + """ + @classmethod + def angle_global(cls) -> int: + r""" + @brief Gets the global angle code for use with the \angle_constraint method. + This code will tell the ruler or marker to use the angle constraint defined globally. + """ + @classmethod + def angle_horizontal(cls) -> int: + r""" + @brief Gets the horizontal angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, only horizontal rulers are allowed. + """ + @classmethod + def angle_ortho(cls) -> int: + r""" + @brief Gets the ortho angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, only multiples of 90 degree are allowed. + """ + @classmethod + def angle_vertical(cls) -> int: + r""" + @brief Gets the vertical angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, only vertical rulers are allowed. + """ + @classmethod + def outline_box(cls) -> int: + r""" + @brief Gets the box outline code for use with the \outline method + When this outline style is specified, a box is drawn with the corners specified by the start and end point. All box edges are drawn in the style specified with the \style attribute. + """ + @classmethod + def outline_diag(cls) -> int: + r""" + @brief Gets the diagonal output code for use with the \outline method + When this outline style is specified, a line connecting start and end points in the given style (ruler, arrow or plain line) is drawn. + """ + @classmethod + def outline_diag_xy(cls) -> int: + r""" + @brief Gets the xy plus diagonal outline code for use with the \outline method + @brief outline_xy code used by the \outline method + When this outline style is specified, three lines are drawn: one horizontal from left to right and attached to the end of that a line from the bottom to the top. Another line is drawn connecting the start and end points directly. The lines are drawn in the specified style (see \style method). + """ + @classmethod + def outline_diag_yx(cls) -> int: + r""" + @brief Gets the yx plus diagonal outline code for use with the \outline method + When this outline style is specified, three lines are drawn: one vertical from bottom to top and attached to the end of that a line from the left to the right. Another line is drawn connecting the start and end points directly. The lines are drawn in the specified style (see \style method). + """ + @classmethod + def outline_ellipse(cls) -> int: + r""" + @brief Gets the ellipse outline code for use with the \outline method + When this outline style is specified, an ellipse is drawn with the extensions specified by the start and end point. The contour drawn as a line. + + This constant has been introduced in version 0.26. + """ + @classmethod + def outline_xy(cls) -> int: + r""" + @brief Gets the xy outline code for use with the \outline method + When this outline style is specified, two lines are drawn: one horizontal from left to right and attached to the end of that a line from the bottom to the top. The lines are drawn in the specified style (see \style method). + """ + @classmethod + def outline_yx(cls) -> int: + r""" + @brief Gets the yx outline code for use with the \outline method + When this outline style is specified, two lines are drawn: one vertical from bottom to top and attached to the end of that a line from the left to the right. The lines are drawn in the specified style (see \style method). + """ + @classmethod + def register_template(cls, annotation: BasicAnnotation, title: str, mode: Optional[int] = ...) -> None: + r""" + @brief Registers the given annotation as a template globally + @annotation The annotation to use for the template (positions are ignored) + @param title The title to use for the ruler template + @param mode The mode the ruler will be created in (see Ruler... constants) + + In order to register a system template, the category string of the annotation has to be a unique and non-empty string. The annotation is added to the list of annotation templates and becomes available as a new template in the ruler drop-down menu. + + The new annotation template is registered on all views. + + NOTE: this setting is persisted and the the application configuration is updated. + + This method has been added in version 0.25. + """ + @classmethod + def style_arrow_both(cls) -> int: + r""" + @brief Gets the both arrow ends style code for use the \style method + When this style is specified, a two-headed arrow is drawn. + """ + @classmethod + def style_arrow_end(cls) -> int: + r""" + @brief Gets the end arrow style code for use the \style method + When this style is specified, an arrow is drawn pointing from the start to the end point. + """ + @classmethod + def style_arrow_start(cls) -> int: + r""" + @brief Gets the start arrow style code for use the \style method + When this style is specified, an arrow is drawn pointing from the end to the start point. + """ + @classmethod + def style_cross_both(cls) -> int: + r""" + @brief Gets the line style code for use with the \style method + When this style is specified, a cross is drawn at both points. + + This constant has been added in version 0.26. + """ + @classmethod + def style_cross_end(cls) -> int: + r""" + @brief Gets the line style code for use with the \style method + When this style is specified, a cross is drawn at the end point. + + This constant has been added in version 0.26. + """ + @classmethod + def style_cross_start(cls) -> int: + r""" + @brief Gets the line style code for use with the \style method + When this style is specified, a cross is drawn at the start point. + + This constant has been added in version 0.26. + """ + @classmethod + def style_line(cls) -> int: + r""" + @brief Gets the line style code for use with the \style method + When this style is specified, a plain line is drawn. + """ + @classmethod + def style_ruler(cls) -> int: + r""" + @brief Gets the ruler style code for use the \style method + When this style is specified, the annotation will show a ruler with some ticks at distances indicating a decade of units and a suitable subdivision into minor ticks at intervals of 1, 2 or 5 units. + """ + @classmethod + def unregister_templates(cls, category: str) -> None: + r""" + @brief Unregisters the template or templates with the given category string globally + + This method will remove all templates with the given category string. If the category string is empty, all templates are removed. + + NOTE: this setting is persisted and the the application configuration is updated. + + This method has been added in version 0.28. + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Equality operator + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Inequality operator + """ + def __str__(self) -> str: + r""" + @brief Returns the string representation of the ruler + This method was introduced in version 0.19. + """ + def _assign(self, other: BasicAnnotation) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _dup(self) -> Annotation: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def box(self) -> db.DBox: + r""" + @brief Gets the bounding box of the object (not including text) + @return The bounding box + """ + def delete(self) -> None: + r""" + @brief Deletes this annotation from the view + If the annotation is an "active" one, this method will remove it from the view. This object will become detached and can still be manipulated, but without having an effect on the view. + This method has been introduced in version 0.25. + """ + def detach(self) -> None: + r""" + @brief Detaches the annotation object from the view + If the annotation object was inserted into the view, property changes will be reflected in the view. To disable this feature, 'detach' can be called after which the annotation object becomes inactive and changes will no longer be reflected in the view. + + This method has been introduced in version 0.25. + """ + def id(self) -> int: + r""" + @brief Returns the annotation's ID + The annotation ID is an integer that uniquely identifies an annotation inside a view. + The ID is used for replacing an annotation (see \LayoutView#replace_annotation). + + This method was introduced in version 0.24. + """ + def is_valid(self) -> bool: + r""" + @brief Returns a value indicating whether the object is a valid reference. + If this value is true, the object represents an annotation on the screen. Otherwise, the object is a 'detached' annotation which does not have a representation on the screen. + + This method was introduced in version 0.25. + """ + def text(self) -> str: + r""" + @brief Returns the formatted text for the main label + """ + def text_x(self) -> str: + r""" + @brief Returns the formatted text for the x-axis label + """ + def text_y(self) -> str: + r""" + @brief Returns the formatted text for the y-axis label + """ + def to_s(self) -> str: + r""" + @brief Returns the string representation of the ruler + This method was introduced in version 0.19. + """ + @overload + def transformed(self, t: db.DCplxTrans) -> Annotation: + r""" + @brief Transforms the ruler or marker with the given complex transformation + @param t The magnifying transformation to apply + @return The transformed object + + Starting with version 0.25, all overloads all available as 'transform'. + """ + @overload + def transformed(self, t: db.DTrans) -> Annotation: + r""" + @brief Transforms the ruler or marker with the given simple transformation + @param t The transformation to apply + @return The transformed object + """ + @overload + def transformed(self, t: db.ICplxTrans) -> Annotation: + r""" + @brief Transforms the ruler or marker with the given complex transformation + @param t The magnifying transformation to apply + @return The transformed object (in this case an integer coordinate object) + + This method has been introduced in version 0.18. + + Starting with version 0.25, all overloads all available as 'transform'. + """ + @overload + def transformed_cplx(self, t: db.DCplxTrans) -> Annotation: + r""" + @brief Transforms the ruler or marker with the given complex transformation + @param t The magnifying transformation to apply + @return The transformed object + + Starting with version 0.25, all overloads all available as 'transform'. + """ + @overload + def transformed_cplx(self, t: db.ICplxTrans) -> Annotation: + r""" + @brief Transforms the ruler or marker with the given complex transformation + @param t The magnifying transformation to apply + @return The transformed object (in this case an integer coordinate object) + + This method has been introduced in version 0.18. + + Starting with version 0.25, all overloads all available as 'transform'. + """ + +class ObjectInstPath: + r""" + @brief A class describing a selected shape or instance + + A shape or instance is addressed by a path which describes all instances leading to the specified + object. These instances are described through \InstElement objects, which specify the instance and, in case of array instances, the specific array member. + For shapes, additionally the layer and the shape itself is specified. The ObjectInstPath objects + encapsulates both forms, which can be distinguished with the \is_cell_inst? predicate. + + An instantiation path leads from a top cell down to the container cell which either holds the shape or the instance. + The top cell can be obtained through the \top attribute, the container cell through the \source attribute. Both are cell indexes which can be converted to \Cell objects through the \Layout#cell. In case of objects located in the top cell, \top and \source refer to the same cell. + The first element of the instantiation path is the instance located within the top cell leading to the first child cell. The second element leads to the next child cell and so forth. \path_nth can be used to obtain a specific element of the path. + + The \cv_index attribute specifies the cellview the selection applies to. Use \LayoutView#cellview to obtain the \CellView object from the index. + + The shape or instance the selection refers to can be obtained with \shape and \inst respectively. Use \is_cell_inst? to decide whether the selection refers to an instance or not. + + The ObjectInstPath class plays a role when retrieving and modifying the selection of shapes and instances through \LayoutView#object_selection, \LayoutView#object_selection=, \LayoutView#select_object and \LayoutView#unselect_object. \ObjectInstPath objects can be modified to reflect a new selection, but the new selection becomes active only after it is installed in the view. The following sample demonstrates that. It implements a function to convert all shapes to polygons: + + @code + mw = RBA::Application::instance::main_window + view = mw.current_view + + begin + + view.transaction("Convert selected shapes to polygons") + + sel = view.object_selection + + sel.each do |s| + if !s.is_cell_inst? && !s.shape.is_text? + ly = view.cellview(s.cv_index).layout + # convert to polygon + s.shape.polygon = s.shape.polygon + end + end + + view.object_selection = sel + + ensure + view.commit + end + @/code + + Note, that without resetting the selection in the above example, the application might raise errors because after modifying the selected objects, the current selection will no longer be valid. Establishing a new valid selection in the way shown above will help avoiding this issue. + """ + cv_index: int + r""" + Getter: + @brief Gets the cellview index that describes which cell view the shape or instance is located in + + Setter: + @brief Sets the cellview index that describes which cell view the shape or instance is located in + + This method has been introduced in version 0.24. + """ + layer: Any + r""" + Getter: + @brief Gets the layer index that describes which layer the selected shape is on + + Starting with version 0.27, this method returns nil for this property if \is_cell_inst? is false - i.e. the selection does not represent a shape. + Setter: + @brief Sets to the layer index that describes which layer the selected shape is on + + Setting the layer property to a valid layer index makes the path a shape selection path. + Setting the layer property to a negative layer index makes the selection an instance selection. + + This method has been introduced in version 0.24. + """ + path: List[db.InstElement] + r""" + Getter: + @brief Gets the instantiation path + The path is a sequence of \InstElement objects leading to the target object. + + This method was introduced in version 0.26. + + Setter: + @brief Sets the instantiation path + + This method was introduced in version 0.26. + """ + seq: int + r""" + Getter: + @brief Gets the sequence number + + The sequence number describes when the item was selected. + A sequence number of 0 indicates that the item was selected in the first selection action (without 'Shift' pressed). + + Setter: + @brief Sets the sequence number + + See \seq for a description of this property. + + This method was introduced in version 0.24. + """ + shape: Any + r""" + Getter: + @brief Gets the selected shape + + The shape object may be modified. This does not have an immediate effect on the selection. Instead, the selection must be set in the view using \LayoutView#object_selection= or \LayoutView#select_object. + + This method delivers valid results only for object selections that represent shapes. Starting with version 0.27, this method returns nil for this property if \is_cell_inst? is false. + Setter: + @brief Sets the shape object that describes the selected shape geometrically + + When using this setter, the layer index must be set to a valid layout layer (see \layer=). + Setting both properties makes the selection a shape selection. + + This method has been introduced in version 0.24. + """ + top: int + r""" + Getter: + @brief Gets the cell index of the top cell the selection applies to + + The top cell is identical to the current cell provided by the cell view. + It is the cell from which is instantiation path originates and the container cell if not instantiation path is set. + + This method has been introduced in version 0.24. + Setter: + @brief Sets the cell index of the top cell the selection applies to + + See \top_cell for a description of this property. + + This method has been introduced in version 0.24. + """ + @classmethod + def new(cls, si: db.RecursiveShapeIterator, cv_index: int) -> ObjectInstPath: + r""" + @brief Creates a new path object from a \RecursiveShapeIterator + Use this constructor to quickly turn a recursive shape iterator delivery into a shape selection. + """ + def __copy__(self) -> ObjectInstPath: + r""" + @brief Creates a copy of self + """ + def __eq__(self, b: object) -> bool: + r""" + @brief Equality of two ObjectInstPath objects + Note: this operator returns true if both instance paths refer to the same object, not just identical ones. + + This method has been introduced with version 0.24. + """ + def __init__(self, si: db.RecursiveShapeIterator, cv_index: int) -> None: + r""" + @brief Creates a new path object from a \RecursiveShapeIterator + Use this constructor to quickly turn a recursive shape iterator delivery into a shape selection. + """ + def __lt__(self, b: ObjectInstPath) -> bool: + r""" + @brief Provides an order criterion for two ObjectInstPath objects + Note: this operator is just provided to establish any order, not a particular one. + + This method has been introduced with version 0.24. + """ + def __ne__(self, b: object) -> bool: + r""" + @brief Inequality of two ObjectInstPath objects + See the comments on the == operator. + + This method has been introduced with version 0.24. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def append_path(self, element: db.InstElement) -> None: + r""" + @brief Appends an element to the instantiation path + + This method allows building of an instantiation path pointing to the selected object. + For an instance selection, the last component added is the instance which is selected. + For a shape selection, the path points to the cell containing the selected shape. + + This method was introduced in version 0.24. + """ + def assign(self, other: ObjectInstPath) -> None: + r""" + @brief Assigns another object to self + """ + def cell_index(self) -> int: + r""" + @brief Gets the cell index of the cell that the selection applies to. + This method returns the cell index that describes which cell the selected shape is located in or the cell whose instance is selected if \is_cell_inst? is true. + This property is set implicitly by setting the top cell and adding elements to the instantiation path. + To obtain the index of the container cell, use \source. + """ + def clear_path(self) -> None: + r""" + @brief Clears the instantiation path + + This method was introduced in version 0.24. + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dtrans(self) -> db.DCplxTrans: + r""" + @brief Gets the transformation applicable for the shape in micron space. + + This method returns the same transformation than \trans, but applicable to objects in micrometer units: + + @code + # renders the micrometer-unit polygon in top cell coordinates: + dpolygon_in_top = sel.dtrans * sel.shape.dpolygon + @/code + + This method is not applicable to instance selections. A more generic attribute is \source_dtrans. + + The method has been introduced in version 0.25. + """ + def dup(self) -> ObjectInstPath: + r""" + @brief Creates a copy of self + """ + def each_inst(self) -> Iterator[db.InstElement]: + r""" + @brief Yields the instantiation path + + The instantiation path describes by an sequence of \InstElement objects the path by which the cell containing the selected shape is found from the cell view's current cell. + If this object represents an instance, the path will contain the selected instance as the last element. + The elements are delivered top down. + """ + def inst(self) -> db.Instance: + r""" + @brief Deliver the instance represented by this selection + + This method delivers valid results only if \is_cell_inst? is true. + It returns the instance reference (an \Instance object) that this selection represents. + + This property is set implicitly by adding instance elements to the instantiation path. + + This method has been added in version 0.16. + """ + def is_cell_inst(self) -> bool: + r""" + @brief True, if this selection represents a cell instance + + If this attribute is true, the shape reference and layer are not valid. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_valid(self, view: LayoutViewBase) -> bool: + r""" + @brief Gets a value indicating whether the instance path refers to a valid object in the context of the given view + + This predicate has been introduced in version 0.27.12. + """ + def layout(self) -> db.Layout: + r""" + @brief Gets the Layout object the selected object lives in. + + This method returns the \Layout object that the selected object lives in. This method may return nil, if the selection does not point to a valid object. + + This method has been introduced in version 0.25. + """ + def path_length(self) -> int: + r""" + @brief Returns the length of the path (number of elements delivered by \each_inst) + + This method has been added in version 0.16. + """ + def path_nth(self, n: int) -> db.InstElement: + r""" + @brief Returns the nth element of the path (similar to \each_inst but with direct access through the index) + + @param n The index of the element to retrieve (0..\path_length-1) + This method has been added in version 0.16. + """ + def source(self) -> int: + r""" + @brief Returns to the cell index of the cell that the selected element resides inside. + + If this reference represents a cell instance, this method delivers the index of the cell in which the cell instance resides. Otherwise, this method returns the same value than \cell_index. + + This property is set implicitly by setting the top cell and adding elements to the instantiation path. + + This method has been added in version 0.16. + """ + def source_dtrans(self) -> db.DCplxTrans: + r""" + @brief Gets the transformation applicable for an instance and shape in micron space. + + This method returns the same transformation than \source_trans, but applicable to objects in micrometer units: + + @code + # renders the cell instance as seen from top level: + dcell_inst_in_top = sel.source_dtrans * sel.inst.dcell_inst + @/code + + The method has been introduced in version 0.25. + """ + def source_trans(self) -> db.ICplxTrans: + r""" + @brief Gets the transformation applicable for an instance and shape. + + If this object represents a shape, this transformation describes how the selected shape is transformed into the current cell of the cell view. + If this object represents an instance, this transformation describes how the selected instance is transformed into the current cell of the cell view. + This method is similar to \trans, except that the resulting transformation does not include the instance transformation if the object represents an instance. + + This property is set implicitly by setting the top cell and adding elements to the instantiation path. + + This method has been added in version 0.16. + """ + def trans(self) -> db.ICplxTrans: + r""" + @brief Gets the transformation applicable for the shape. + + If this object represents a shape, this transformation describes how the selected shape is transformed into the current cell of the cell view. + Basically, this transformation is the accumulated transformation over the instantiation path. If the ObjectInstPath represents a cell instance, this includes the transformation of the selected instance as well. + + This property is set implicitly by setting the top cell and adding elements to the instantiation path. + This method is not applicable for instance selections. A more generic attribute is \source_trans. + """ + +class ImageDataMapping: + r""" + @brief A structure describing the data mapping of an image object + + Data mapping is the process of transforming the data into RGB pixel values. + This implementation provides four adjustment steps: first, in the case of monochrome + data, the data is converted to a RGB triplet using the color map. The default color map + will copy the value to all channels rendering a gray scale. After having normalized the data + to 0..1 cooresponding to the min_value and max_value settings of the image, a color channel-independent + brightness and contrast adjustment is applied. Then, a per-channel multiplier (red_gain, green_gain, + blue_gain) is applied. Finally, the gamma function is applied and the result converted into a 0..255 + pixel value range and clipped. + """ + blue_gain: float + r""" + Getter: + @brief The blue channel gain + + This value is the multiplier by which the blue channel is scaled after applying + false color transformation and contrast/brightness/gamma. + + 1.0 is a neutral value. The gain should be >=0.0. + + Setter: + @brief Set the blue_gain + See \blue_gain for a description of this property. + """ + brightness: float + r""" + Getter: + @brief The brightness value + + The brightness is a double value between roughly -1.0 and 1.0. + Neutral (original) brightness is 0.0. + + Setter: + @brief Set the brightness + See \brightness for a description of this property. + """ + contrast: float + r""" + Getter: + @brief The contrast value + + The contrast is a double value between roughly -1.0 and 1.0. + Neutral (original) contrast is 0.0. + + Setter: + @brief Set the contrast + See \contrast for a description of this property. + """ + gamma: float + r""" + Getter: + @brief The gamma value + + The gamma value allows one to adjust for non-linearities in the display chain and to enhance contrast. + A value for linear intensity reproduction on the screen is roughly 0.5. The exact value depends on the + monitor calibration. Values below 1.0 give a "softer" appearance while values above 1.0 give a "harder" appearance. + + Setter: + @brief Set the gamma + See \gamma for a description of this property. + """ + green_gain: float + r""" + Getter: + @brief The green channel gain + + This value is the multiplier by which the green channel is scaled after applying + false color transformation and contrast/brightness/gamma. + + 1.0 is a neutral value. The gain should be >=0.0. + + Setter: + @brief Set the green_gain + See \green_gain for a description of this property. + """ + red_gain: float + r""" + Getter: + @brief The red channel gain + + This value is the multiplier by which the red channel is scaled after applying + false color transformation and contrast/brightness/gamma. + + 1.0 is a neutral value. The gain should be >=0.0. + + Setter: + @brief Set the red_gain + See \red_gain for a description of this property. + """ + @classmethod + def new(cls) -> ImageDataMapping: + r""" + @brief Create a new data mapping object with default settings + """ + def __copy__(self) -> ImageDataMapping: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Create a new data mapping object with default settings + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + @overload + def add_colormap_entry(self, value: float, color: int) -> None: + r""" + @brief Add a colormap entry for this data mapping object. + @param value The value at which the given color should be applied. + @param color The color to apply (a 32 bit RGB value). + + This settings establishes a color mapping for a given value in the monochrome channel. The color must be given as a 32 bit integer, where the lowest order byte describes the blue component (0 to 255), the second byte the green component and the third byte the red component, i.e. 0xff0000 is red and 0x0000ff is blue. + """ + @overload + def add_colormap_entry(self, value: float, lcolor: int, rcolor: int) -> None: + r""" + @brief Add a colormap entry for this data mapping object. + @param value The value at which the given color should be applied. + @param lcolor The color to apply left of the value (a 32 bit RGB value). + @param rcolor The color to apply right of the value (a 32 bit RGB value). + + This settings establishes a color mapping for a given value in the monochrome channel. The colors must be given as a 32 bit integer, where the lowest order byte describes the blue component (0 to 255), the second byte the green component and the third byte the red component, i.e. 0xff0000 is red and 0x0000ff is blue. + + In contrast to the version with one color, this version allows specifying a color left and right of the value - i.e. a discontinuous step. + + This variant has been introduced in version 0.27. + """ + def assign(self, other: ImageDataMapping) -> None: + r""" + @brief Assigns another object to self + """ + def clear_colormap(self) -> None: + r""" + @brief The the color map of this data mapping object. + """ + def colormap_color(self, n: int) -> int: + r""" + @brief Returns the color for a given color map entry. + @param n The index of the entry (0..\num_colormap_entries-1) + @return The color (see \add_colormap_entry for a description). + + NOTE: this version is deprecated and provided for backward compatibility. For discontinuous nodes this method delivers the left-sided color. + """ + def colormap_lcolor(self, n: int) -> int: + r""" + @brief Returns the left-side color for a given color map entry. + @param n The index of the entry (0..\num_colormap_entries-1) + @return The color (see \add_colormap_entry for a description). + + This method has been introduced in version 0.27. + """ + def colormap_rcolor(self, n: int) -> int: + r""" + @brief Returns the right-side color for a given color map entry. + @param n The index of the entry (0..\num_colormap_entries-1) + @return The color (see \add_colormap_entry for a description). + + This method has been introduced in version 0.27. + """ + def colormap_value(self, n: int) -> float: + r""" + @brief Returns the value for a given color map entry. + @param n The index of the entry (0..\num_colormap_entries-1) + @return The value (see \add_colormap_entry for a description). + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> ImageDataMapping: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def num_colormap_entries(self) -> int: + r""" + @brief Returns the current number of color map entries. + @return The number of entries. + """ + +class BasicImage: + r""" + @hide + @alias Image + """ + @classmethod + def new(cls) -> BasicImage: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> BasicImage: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: BasicImage) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> BasicImage: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + +class Image(BasicImage): + r""" + @brief An image to be stored as a layout annotation + + Images can be put onto the layout canvas as annotations, along with rulers and markers. + Images can be monochrome (represent scalar data) as well as color (represent color images). + The display of images can be adjusted in various ways, i.e. color mapping (translation of scalar values to + colors), geometrical transformations (including rotation by arbitrary angles) and similar. + Images are always based on floating point data. The actual data range is not fixed and can be adjusted to the data set (i.e. 0..255 or -1..1). This gives a great flexibility when displaying data which is the result of some measurement or calculation for example. + The basic parameters of an image are the width and height of the data set, the width and height of one pixel, the geometrical transformation to be applied, the data range (min_value to max_value) and the data mapping which is described by an own class, \ImageDataMapping. + + Starting with version 0.22, the basic transformation is a 3x3 matrix rather than the simple affine transformation. This matrix includes the pixel dimensions as well. One consequence of that is that the magnification part of the matrix and the pixel dimensions are no longer separated. That has certain consequences, i.e. setting an affine transformation with a magnification scales the pixel sizes as before but an affine transformation returned will no longer contain the pixel dimensions as magnification because it only supports isotropic scaling. For backward compatibility, the rotation center for the affine transformations while the default center and the center for matrix transformations is the image center. + + As with version 0.25, images become 'live' objects. Changes to image properties will be reflected in the view automatically once the image object has been inserted into a view. Note that changes are not immediately reflected in the view, but are delayed until the view is refreshed. Hence, iterating the view's images will not render the same results than the image objects attached to the view. To ensure synchronization, call \Image#update. + """ + data_mapping: ImageDataMapping + r""" + Getter: + @brief Gets the data mapping + @return The data mapping object + + The data mapping describes the transformation of a pixel value (any double value) into pixel data which can be sent to the graphics cards for display. See \ImageDataMapping for a more detailed description. + + Setter: + @brief Sets the data mapping object + + The data mapping describes the transformation of a pixel value (any double value) into pixel data which can be sent to the graphics cards for display. See \ImageDataMapping for a more detailed description. + """ + mask_data: List[bool] + r""" + Getter: + @brief Gets the mask from a array of boolean values + See \set_mask_data for a description of the data field. + + This method has been introduced in version 0.27. + + Setter: + @brief Sets the mask from a array of boolean values + The order of the boolean values is line first, from bottom to top and left to right and is the same as the order in the data array. + + This method has been introduced in version 0.27. + """ + matrix: db.Matrix3d + r""" + Getter: + @brief Returns the pixel-to-micron transformation matrix + + This transformation matrix converts pixel coordinates (0,0 being the center and each pixel having the dimension of pixel_width and pixel_height) + to micron coordinates. The coordinate of the pixel is the lower left corner of the pixel. + + The matrix is more general than the transformation used before and supports shear and perspective transformation. This property replaces the \trans property which is still functional, but deprecated. + + This method has been introduced in version 0.22. + Setter: + @brief Sets the transformation matrix + + This transformation matrix converts pixel coordinates (0,0 being the center and each pixel having the dimension of pixel_width and pixel_height) + to micron coordinates. The coordinate of the pixel is the lower left corner of the pixel. + + The matrix is more general than the transformation used before and supports shear and perspective transformation. This property replaces the \trans property which is still functional, but deprecated. + + This method has been introduced in version 0.22. + """ + max_value: float + r""" + Getter: + @brief Sets the maximum value + + See the \max_value method for the description of the maximum value property. + + Setter: + @brief Gets the upper limit of the values in the data set + + This value determines the upper end of the data mapping (i.e. white value etc.). + It does not necessarily correspond to the maximum value of the data set but it must be + larger than that. + """ + min_value: float + r""" + Getter: + @brief Gets the upper limit of the values in the data set + + This value determines the upper end of the data mapping (i.e. white value etc.). + It does not necessarily correspond to the minimum value of the data set but it must be + larger than that. + + Setter: + @brief Sets the minimum value + + See \min_value for the description of the minimum value property. + """ + pixel_height: float + r""" + Getter: + @brief Gets the pixel height + + See \pixel_height= for a description of that property. + + Starting with version 0.22, this property is incorporated into the transformation matrix. + This property is provided for convenience only. + Setter: + @brief Sets the pixel height + + The pixel height determines the height of on pixel in the original space which is transformed to + micron space with the transformation. + + Starting with version 0.22, this property is incorporated into the transformation matrix. + This property is provided for convenience only. + """ + pixel_width: float + r""" + Getter: + @brief Gets the pixel width + + See \pixel_width= for a description of that property. + + Starting with version 0.22, this property is incorporated into the transformation matrix. + This property is provided for convenience only. + Setter: + @brief Sets the pixel width + + The pixel width determines the width of on pixel in the original space which is transformed to + micron space with the transformation. + + Starting with version 0.22, this property is incorporated into the transformation matrix. + This property is provided for convenience only. + """ + trans: db.DCplxTrans + r""" + Getter: + @brief Returns the pixel-to-micron transformation + + This transformation converts pixel coordinates (0,0 being the lower left corner and each pixel having the dimension of pixel_width and pixel_height) + to micron coordinates. The coordinate of the pixel is the lower left corner of the pixel. + + The general property is \matrix which also allows perspective and shear transformation. This property will only work, if the transformation does not include perspective or shear components. Therefore this property is deprecated. + Please note that for backward compatibility, the rotation center is pixel 0,0 (lowest left one), while it is the image center for the matrix transformation. + Setter: + @brief Sets the transformation + + This transformation converts pixel coordinates (0,0 being the lower left corner and each pixel having the dimension of pixel_width and pixel_height) + to micron coordinates. The coordinate of the pixel is the lower left corner of the pixel. + + The general property is \matrix which also allows perspective and shear transformation. + Please note that for backward compatibility, the rotation center is pixel 0,0 (lowest left one), while it is the image center for the matrix transformation. + """ + visible: bool + r""" + Getter: + @brief Gets a flag indicating whether the image object is visible + + An image object can be made invisible by setting the visible property to false. + + This method has been introduced in version 0.20. + + Setter: + @brief Sets the visibility + + See the \is_visible? method for a description of this property. + + This method has been introduced in version 0.20. + """ + z_position: int + r""" + Getter: + @brief Gets the z position of the image + Images with a higher z position are painted in front of images with lower z position. + The z value is an integer that controls the position relative to other images. + + This method was introduced in version 0.25. + Setter: + @brief Sets the z position of the image + + See \z_position for details about the z position attribute. + + This method was introduced in version 0.25. + """ + @classmethod + def from_s(cls, s: str) -> Image: + r""" + @brief Creates an image from the string returned by \to_s. + This method has been introduced in version 0.27. + """ + @overload + @classmethod + def new(cls) -> Image: + r""" + @brief Create a new image with the default attributes + This will create an empty image without data and no particular pixel width or related. + Use the \read_file or \set_data methods to set image properties and pixel values. + """ + @overload + @classmethod + def new(cls, filename: str) -> Image: + r""" + @brief Constructor from a image file + + This constructor creates an image object from a file (which can have any format supported by Qt) and + a unit transformation. The image will originally be put to position 0,0 (lower left corner) and each pixel + will have a size of 1 (micron). + + @param filename The path to the image file to load. + """ + @overload + @classmethod + def new(cls, filename: str, trans: db.DCplxTrans) -> Image: + r""" + @brief Constructor from a image file + + This constructor creates an image object from a file (which can have any format supported by Qt) and + a transformation. The image will originally be put to position 0,0 (lower left corner) and each pixel + will have a size of 1. The transformation describes how to transform this image into micron space. + + @param filename The path to the image file to load. + @param trans The transformation to apply to the image when displaying it. + """ + @overload + @classmethod + def new(cls, w: int, h: int, data: Sequence[float]) -> Image: + r""" + @brief Constructor for a monochrome image with the given pixel values + + This constructor creates an image from the given pixel values. The values have to be organized + line by line. Each line must consist of "w" values where the first value is the leftmost pixel. + Note, that the rows are oriented in the mathematical sense (first one is the lowest) contrary to + the common convention for image data. + Initially the pixel width and height will be 1 micron and the data range will be 0 to 1.0 (black to white level). + To adjust the data range use the \min_value and \max_value properties. + + @param w The width of the image + @param h The height of the image + @param d The data (see method description) + """ + @overload + @classmethod + def new(cls, w: int, h: int, trans: db.DCplxTrans, data: Sequence[float]) -> Image: + r""" + @brief Constructor for a monochrome image with the given pixel values + + This constructor creates an image from the given pixel values. The values have to be organized + line by line. Each line must consist of "w" values where the first value is the leftmost pixel. + Note, that the rows are oriented in the mathematical sense (first one is the lowest) contrary to + the common convention for image data. + Initially the pixel width and height will be 1 micron and the data range will be 0 to 1.0 (black to white level). + To adjust the data range use the \min_value and \max_value properties. + + @param w The width of the image + @param h The height of the image + @param trans The transformation from pixel space to micron space + @param d The data (see method description) + """ + @overload + @classmethod + def new(cls, w: int, h: int, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> Image: + r""" + @brief Constructor for a color image with the given pixel values + + This constructor creates an image from the given pixel values. The values have to be organized + line by line and separated by color channel. Each line must consist of "w" values where the first value is the leftmost pixel. + Note, that the rows are oriented in the mathematical sense (first one is the lowest) contrary to + the common convention for image data. + Initially the pixel width and height will be 1 micron and the data range will be 0 to 1.0 (black to white level). + To adjust the data range use the \min_value and \max_value properties. + + @param w The width of the image + @param h The height of the image + @param red The red channel data set which will become owned by the image + @param green The green channel data set which will become owned by the image + @param blue The blue channel data set which will become owned by the image + """ + @overload + @classmethod + def new(cls, w: int, h: int, trans: db.DCplxTrans, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> Image: + r""" + @brief Constructor for a color image with the given pixel values + + This constructor creates an image from the given pixel values. The values have to be organized + line by line and separated by color channel. Each line must consist of "w" values where the first value is the leftmost pixel. + Note, that the rows are oriented in the mathematical sense (first one is the lowest) contrary to + the common convention for image data. + Initially the pixel width and height will be 1 micron and the data range will be 0 to 1.0 (black to white level). + To adjust the data range use the \min_value and \max_value properties. + + @param w The width of the image + @param h The height of the image + @param trans The transformation from pixel space to micron space + @param red The red channel data set which will become owned by the image + @param green The green channel data set which will become owned by the image + @param blue The blue channel data set which will become owned by the image + """ + @classmethod + def read(cls, path: str) -> Image: + r""" + @brief Loads the image from the given path. + + This method expects the image file as a KLayout image format file (.lyimg). This is a XML-based format containing the image data plus placement and transformation information for the image placement. In addition, image manipulation parameters for false color display and color channel enhancement are embedded. + + This method has been introduced in version 0.27. + """ + @overload + def __init__(self) -> None: + r""" + @brief Create a new image with the default attributes + This will create an empty image without data and no particular pixel width or related. + Use the \read_file or \set_data methods to set image properties and pixel values. + """ + @overload + def __init__(self, filename: str) -> None: + r""" + @brief Constructor from a image file + + This constructor creates an image object from a file (which can have any format supported by Qt) and + a unit transformation. The image will originally be put to position 0,0 (lower left corner) and each pixel + will have a size of 1 (micron). + + @param filename The path to the image file to load. + """ + @overload + def __init__(self, filename: str, trans: db.DCplxTrans) -> None: + r""" + @brief Constructor from a image file + + This constructor creates an image object from a file (which can have any format supported by Qt) and + a transformation. The image will originally be put to position 0,0 (lower left corner) and each pixel + will have a size of 1. The transformation describes how to transform this image into micron space. + + @param filename The path to the image file to load. + @param trans The transformation to apply to the image when displaying it. + """ + @overload + def __init__(self, w: int, h: int, data: Sequence[float]) -> None: + r""" + @brief Constructor for a monochrome image with the given pixel values + + This constructor creates an image from the given pixel values. The values have to be organized + line by line. Each line must consist of "w" values where the first value is the leftmost pixel. + Note, that the rows are oriented in the mathematical sense (first one is the lowest) contrary to + the common convention for image data. + Initially the pixel width and height will be 1 micron and the data range will be 0 to 1.0 (black to white level). + To adjust the data range use the \min_value and \max_value properties. + + @param w The width of the image + @param h The height of the image + @param d The data (see method description) + """ + @overload + def __init__(self, w: int, h: int, trans: db.DCplxTrans, data: Sequence[float]) -> None: + r""" + @brief Constructor for a monochrome image with the given pixel values + + This constructor creates an image from the given pixel values. The values have to be organized + line by line. Each line must consist of "w" values where the first value is the leftmost pixel. + Note, that the rows are oriented in the mathematical sense (first one is the lowest) contrary to + the common convention for image data. + Initially the pixel width and height will be 1 micron and the data range will be 0 to 1.0 (black to white level). + To adjust the data range use the \min_value and \max_value properties. + + @param w The width of the image + @param h The height of the image + @param trans The transformation from pixel space to micron space + @param d The data (see method description) + """ + @overload + def __init__(self, w: int, h: int, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> None: + r""" + @brief Constructor for a color image with the given pixel values + + This constructor creates an image from the given pixel values. The values have to be organized + line by line and separated by color channel. Each line must consist of "w" values where the first value is the leftmost pixel. + Note, that the rows are oriented in the mathematical sense (first one is the lowest) contrary to + the common convention for image data. + Initially the pixel width and height will be 1 micron and the data range will be 0 to 1.0 (black to white level). + To adjust the data range use the \min_value and \max_value properties. + + @param w The width of the image + @param h The height of the image + @param red The red channel data set which will become owned by the image + @param green The green channel data set which will become owned by the image + @param blue The blue channel data set which will become owned by the image + """ + @overload + def __init__(self, w: int, h: int, trans: db.DCplxTrans, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> None: + r""" + @brief Constructor for a color image with the given pixel values + + This constructor creates an image from the given pixel values. The values have to be organized + line by line and separated by color channel. Each line must consist of "w" values where the first value is the leftmost pixel. + Note, that the rows are oriented in the mathematical sense (first one is the lowest) contrary to + the common convention for image data. + Initially the pixel width and height will be 1 micron and the data range will be 0 to 1.0 (black to white level). + To adjust the data range use the \min_value and \max_value properties. + + @param w The width of the image + @param h The height of the image + @param trans The transformation from pixel space to micron space + @param red The red channel data set which will become owned by the image + @param green The green channel data set which will become owned by the image + @param blue The blue channel data set which will become owned by the image + """ + def __str__(self) -> str: + r""" + @brief Converts the image to a string + The string returned can be used to create an image object using \from_s. + @return The string + """ + def _assign(self, other: BasicImage) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _dup(self) -> Image: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def box(self) -> db.DBox: + r""" + @brief Gets the bounding box of the image + @return The bounding box + """ + def clear(self) -> None: + r""" + @brief Clears the image data (sets to 0 or black). + This method has been introduced in version 0.27. + """ + def data(self, channel: Optional[int] = ...) -> List[float]: + r""" + @brief Gets the data array for a specific color channel + Returns an array of pixel values for the given channel. For a color image, channel 0 is green, channel 1 is red and channel 2 is blue. For a monochrome image, the channel is ignored. + + For the format of the data see the constructor description. + + This method has been introduced in version 0.27. + """ + def delete(self) -> None: + r""" + @brief Deletes this image from the view + If the image is an "active" one, this method will remove it from the view. This object will become detached and can still be manipulated, but without having an effect on the view. + This method has been introduced in version 0.25. + """ + def detach(self) -> None: + r""" + @brief Detaches the image object from the view + If the image object was inserted into the view, property changes will be reflected in the view. To disable this feature, 'detach'' can be called after which the image object becomes inactive and changes will no longer be reflected in the view. + + This method has been introduced in version 0.25. + """ + def filename(self) -> str: + r""" + @brief Gets the name of the file loaded of an empty string if not file is loaded + @return The file name (path) + """ + @overload + def get_pixel(self, x: int, y: int) -> float: + r""" + @brief Gets one pixel (monochrome only) + + @param x The x coordinate of the pixel (0..width()-1) + @param y The y coordinate of the pixel (mathematical order: 0 is the lowest, 0..height()-1) + + If x or y value exceeds the image bounds, this method + returns 0.0. This method is valid for monochrome images only. For color images it will return 0.0 always. + Use \is_color? to decide whether the image is a color image or monochrome one. + """ + @overload + def get_pixel(self, x: int, y: int, component: int) -> float: + r""" + @brief Gets one pixel (monochrome and color) + + @param x The x coordinate of the pixel (0..width()-1) + @param y The y coordinate of the pixel (mathematical order: 0 is the lowest, 0..height()-1) + @param component 0 for red, 1 for green, 2 for blue. + + If the component index, x or y value exceeds the image bounds, this method + returns 0.0. For monochrome images, the component index is ignored. + """ + def height(self) -> int: + r""" + @brief Gets the height of the image in pixels + @return The height in pixels + """ + def id(self) -> int: + r""" + @brief Gets the Id + + The Id is an arbitrary integer that can be used to track the evolution of an + image object. The Id is not changed when the object is edited. + On initialization, a unique Id is given to the object. The Id cannot be changed. This behaviour has been modified in version 0.20. + """ + def is_color(self) -> bool: + r""" + @brief Returns true, if the image is a color image + @return True, if the image is a color image + """ + def is_empty(self) -> bool: + r""" + @brief Returns true, if the image does not contain any data (i.e. is default constructed) + @return True, if the image is empty + """ + def is_valid(self) -> bool: + r""" + @brief Returns a value indicating whether the object is a valid reference. + If this value is true, the object represents an image on the screen. Otherwise, the object is a 'detached' image which does not have a representation on the screen. + + This method was introduced in version 0.25. + """ + def is_visible(self) -> bool: + r""" + @brief Gets a flag indicating whether the image object is visible + + An image object can be made invisible by setting the visible property to false. + + This method has been introduced in version 0.20. + """ + def mask(self, x: int, y: int) -> bool: + r""" + @brief Gets the mask for one pixel + + @param x The x coordinate of the pixel (0..width()-1) + @param y The y coordinate of the pixel (mathematical order: 0 is the lowest, 0..height()-1) + @return false if the pixel is not drawn. + + See \set_mask for details about the mask. + + This method has been introduced in version 0.23. + """ + @overload + def set_data(self, w: int, h: int, d: Sequence[float]) -> None: + r""" + @brief Writes the image data field (monochrome) + @param w The width of the new data + @param h The height of the new data + @param d The (monochrome) data to load into the image + + See the constructor description for the data organisation in that field. + """ + @overload + def set_data(self, w: int, h: int, r: Sequence[float], g: Sequence[float], b: Sequence[float]) -> None: + r""" + @brief Writes the image data field (color) + @param w The width of the new data + @param h The height of the new data + @param r The red channel data to load into the image + @param g The green channel data to load into the image + @param b The blue channel data to load into the image + + See the constructor description for the data organisation in that field. + """ + def set_mask(self, x: int, y: int, m: bool) -> None: + r""" + @brief Sets the mask for a pixel + + @param x The x coordinate of the pixel (0..width()-1) + @param y The y coordinate of the pixel (mathematical order: 0 is the lowest, 0..height()-1) + @param m The mask + + If the mask of a pixel is set to false, the pixel is not drawn. The default is true for all pixels. + + This method has been introduced in version 0.23. + """ + @overload + def set_pixel(self, x: int, y: int, v: float) -> None: + r""" + @brief Sets one pixel (monochrome) + + @param x The x coordinate of the pixel (0..width()-1) + @param y The y coordinate of the pixel (mathematical order: 0 is the lowest, 0..height()-1) + @param v The value + + If the component index, x or y value exceeds the image bounds of the image is a color image, + this method does nothing. + """ + @overload + def set_pixel(self, x: int, y: int, r: float, g: float, b: float) -> None: + r""" + @brief Sets one pixel (color) + + @param x The x coordinate of the pixel (0..width()-1) + @param y The y coordinate of the pixel (mathematical order: 0 is the lowest, 0..height()-1) + @param red The red component + @param green The green component + @param blue The blue component + + If the component index, x or y value exceeds the image bounds of the image is not a color image, + this method does nothing. + """ + def to_s(self) -> str: + r""" + @brief Converts the image to a string + The string returned can be used to create an image object using \from_s. + @return The string + """ + @overload + def transformed(self, t: db.DCplxTrans) -> Image: + r""" + @brief Transforms the image with the given complex transformation + @param t The magnifying transformation to apply + @return The transformed object + """ + @overload + def transformed(self, t: db.DTrans) -> Image: + r""" + @brief Transforms the image with the given simple transformation + @param t The transformation to apply + @return The transformed object + """ + @overload + def transformed(self, t: db.Matrix3d) -> Image: + r""" + @brief Transforms the image with the given matrix transformation + @param t The transformation to apply (a matrix) + @return The transformed object + This method has been introduced in version 0.22. + """ + def transformed_cplx(self, t: db.DCplxTrans) -> Image: + r""" + @brief Transforms the image with the given complex transformation + @param t The magnifying transformation to apply + @return The transformed object + """ + def transformed_matrix(self, t: db.Matrix3d) -> Image: + r""" + @brief Transforms the image with the given matrix transformation + @param t The transformation to apply (a matrix) + @return The transformed object + This method has been introduced in version 0.22. + """ + def update(self) -> None: + r""" + @brief Forces an update of the view + Usually it is not required to call this method. The image object is automatically synchronized with the view's image objects. For performance reasons this update is delayed to collect multiple update requests. Calling 'update' will ensure immediate updates. + + This method has been introduced in version 0.25. + """ + def width(self) -> int: + r""" + @brief Gets the width of the image in pixels + @return The width in pixels + """ + def write(self, path: str) -> None: + r""" + @brief Saves the image to KLayout's image format (.lyimg) + This method has been introduced in version 0.27. + """ + +class HelpDialog(QDialog_Native): + r""" + @brief The help dialog + + This class makes the help dialog available as an individual object. + + This class has been added in version 0.25. + """ + @overload + @classmethod + def new(cls, modal: bool) -> HelpDialog: + r""" + @brief Creates a new help dialog + If the modal flag is true, the dialog will be shown as a modal window. + """ + @overload + @classmethod + def new(cls, parent: QtWidgets.QWidget_Native, modal: bool) -> HelpDialog: + r""" + @brief Creates a new help dialog + If the modal flag is true, the dialog will be shown as a modal window. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def load(self, url: str) -> None: + r""" + @brief Loads the specified URL + This method will call the page with the given URL. + """ + def search(self, topic: str) -> None: + r""" + @brief Issues a search on the specified topic + This method will call the search page with the given topic. + """ + +class HelpSource(BrowserSource_Native): + r""" + @brief A BrowserSource implementation delivering the help text for the help dialog + This class can be used together with a \BrowserPanel or \BrowserDialog object to implement custom help systems. + + The basic URL's served by this class are: "int:/index.xml" for the index page and "int:/search.xml?string=..." for the search topic retrieval. + + This class has been added in version 0.25. + """ + @classmethod + def create_index_file(cls, path: str) -> None: + r""" + @brief Reserved internal use + """ + @classmethod + def plain(cls) -> HelpSource: + r""" + @brief Reserved for internal use + """ + def _assign(self, other: BrowserSource_Native) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _dup(self) -> HelpSource: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def get_dom(self, path: str) -> QtXml.QDomDocument: + r""" + @brief Reserved for internal use + """ + def get_option(self, key: str) -> Any: + r""" + @brief Reserved for internal use + """ + def parent_of(self, path: str) -> str: + r""" + @brief Reserved internal use + """ + def scan(self) -> None: + r""" + @brief Reserved internal use + """ + def set_option(self, key: str, value: Any) -> None: + r""" + @brief Reserved for internal use + """ + def title_for(self, path: str) -> str: + r""" + @brief Reserved internal use + """ + def urls(self) -> List[str]: + r""" + @brief Reserved for internal use + """ + +class MainWindow(QMainWindow_Native): + r""" + @brief The main application window and central controller object + + This object first is the main window but also the main controller. The main controller is the port by which access can be gained to all the data objects, view and other aspects of the program. + """ + current_view_index: int + r""" + Getter: + @brief Returns the current view's index + + @return The index of the current view + + This method will return the index of the current view. + Setter: + @brief Selects the view with the given index + + @param index The index of the view to select (0 is the first) + + This method will make the view with the given index the current (front) view. + + This method was renamed from select_view to current_view_index= in version 0.25. The old name is still available, but deprecated. + """ + initial_technology: str + r""" + Getter: + @brief Gets the technology used for creating or loading layouts (unless explicitly specified) + + @return The current initial technology + This method was added in version 0.22. + Setter: + @brief Sets the technology used for creating or loading layouts (unless explicitly specified) + + Setting the technology will have an effect on the next load_layout or create_layout operation which does not explicitly specify the technology but might not be reflected correctly in the reader options dialog and changes will be reset when the application is restarted. + @param tech The new initial technology + + This method was added in version 0.22. + """ + on_current_view_changed: None + r""" + Getter: + @brief An event indicating that the current view has changed + + This event is triggered after the current view has changed. This happens, if the user switches the layout tab. + + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_current_view_observer/remove_current_view_observer) have been removed in 0.25. + + Setter: + @brief An event indicating that the current view has changed + + This event is triggered after the current view has changed. This happens, if the user switches the layout tab. + + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_current_view_observer/remove_current_view_observer) have been removed in 0.25. + """ + on_view_closed: None + r""" + Getter: + @brief An event indicating that a view was closed + @param index The index of the view that was closed + + This event is triggered after a view was closed. For example, because the tab was closed. + + This event has been added in version 0.25. + + Setter: + @brief An event indicating that a view was closed + @param index The index of the view that was closed + + This event is triggered after a view was closed. For example, because the tab was closed. + + This event has been added in version 0.25. + """ + on_view_created: None + r""" + Getter: + @brief An event indicating that a new view was created + @param index The index of the view that was created + + This event is triggered after a new view was created. For example, if a layout is loaded into a new panel. + + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_new_view_observer/remove_new_view_observer) have been removed in 0.25. + + Setter: + @brief An event indicating that a new view was created + @param index The index of the view that was created + + This event is triggered after a new view was created. For example, if a layout is loaded into a new panel. + + Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_new_view_observer/remove_new_view_observer) have been removed in 0.25. + """ + @property + def synchronous(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Puts the main window into synchronous mode + + @param sync_mode 'true' if the application should behave synchronously + + In synchronous mode, an application is allowed to block on redraw. While redrawing, no user interactions are possible. Although this is not desirable for smooth operation, it can be beneficial for test or automation purposes, i.e. if a screenshot needs to be produced once the application has finished drawing. + """ + @classmethod + def instance(cls) -> MainWindow: + r""" + @brief Gets application's main window instance + + This method has been added in version 0.24. + """ + @classmethod + def menu_symbols(cls) -> List[str]: + r""" + @brief Gets all available menu symbols (see \call_menu). + NOTE: currently this method delivers a superset of all available symbols. Depending on the context, no all symbols may trigger actual functionality. + + This method has been introduced in version 0.27. + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def call_menu(self, symbol: str) -> None: + r""" + @brief Calls the menu item with the provided symbol. + To obtain all symbols, use menu_symbols. + + This method has been introduced in version 0.27 and replaces the previous cm_... methods. Instead of calling a specific cm_... method, use LayoutView#call_menu with 'cm_...' as the symbol. + """ + def cancel(self) -> None: + r""" + @brief Cancels current editing operations + + This method call cancels all current editing operations and restores normal mouse mode. + """ + def clear_config(self) -> None: + r""" + @brief Clears the configuration parameters + This method is provided for using MainWindow without an Application object. It's a convience method which is equivalent to 'dispatcher().clear_config()'. See \Dispatcher#clear_config for details. + + This method has been introduced in version 0.27. + """ + def clone_current_view(self) -> None: + r""" + @brief Clones the current view and make it current + """ + def close_all(self) -> None: + r""" + @brief Closes all views + + This method unconditionally closes all views. No dialog will be opened if unsaved edits exist. + + This method was added in version 0.18. + """ + def close_current_view(self) -> None: + r""" + @brief Closes the current view + + This method does not open a dialog to ask which cell view to close if multiple cells are opened in the view, but rather closes all cells. + """ + def cm_adjust_origin(self) -> None: + r""" + @brief 'cm_adjust_origin' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_adjust_origin')" instead. + """ + def cm_bookmark_view(self) -> None: + r""" + @brief 'cm_bookmark_view' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_bookmark_view')" instead. + """ + def cm_cancel(self) -> None: + r""" + @brief 'cm_cancel' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_cancel')" instead. + """ + def cm_cell_copy(self) -> None: + r""" + @brief 'cm_cell_copy' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_cell_copy')" instead. + """ + def cm_cell_cut(self) -> None: + r""" + @brief 'cm_cell_cut' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_cell_cut')" instead. + """ + def cm_cell_delete(self) -> None: + r""" + @brief 'cm_cell_delete' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_cell_delete')" instead. + """ + def cm_cell_flatten(self) -> None: + r""" + @brief 'cm_cell_flatten' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_cell_flatten')" instead. + """ + def cm_cell_hide(self) -> None: + r""" + @brief 'cm_cell_hide' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_cell_hide')" instead. + """ + def cm_cell_paste(self) -> None: + r""" + @brief 'cm_cell_paste' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_cell_paste')" instead. + """ + def cm_cell_rename(self) -> None: + r""" + @brief 'cm_cell_rename' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_cell_rename')" instead. + """ + def cm_cell_select(self) -> None: + r""" + @brief 'cm_cell_select' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_cell_select')" instead. + """ + def cm_cell_show(self) -> None: + r""" + @brief 'cm_cell_show' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_cell_show')" instead. + """ + def cm_cell_show_all(self) -> None: + r""" + @brief 'cm_cell_show_all' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_cell_show_all')" instead. + """ + def cm_clear_layer(self) -> None: + r""" + @brief 'cm_clear_layer' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_clear_layer')" instead. + """ + def cm_clone(self) -> None: + r""" + @brief 'cm_clone' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_clone')" instead. + """ + def cm_close(self) -> None: + r""" + @brief 'cm_close' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_close')" instead. + """ + def cm_close_all(self) -> None: + r""" + @brief 'cm_close_all' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_close_all')" instead. + """ + def cm_copy(self) -> None: + r""" + @brief 'cm_copy' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_copy')" instead. + """ + def cm_copy_layer(self) -> None: + r""" + @brief 'cm_copy_layer' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_copy_layer')" instead. + """ + def cm_cut(self) -> None: + r""" + @brief 'cm_cut' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_cut')" instead. + """ + def cm_dec_max_hier(self) -> None: + r""" + @brief 'cm_dec_max_hier' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_dec_max_hier')" instead. + """ + def cm_delete(self) -> None: + r""" + @brief 'cm_delete' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_delete')" instead. + """ + def cm_delete_layer(self) -> None: + r""" + @brief 'cm_delete_layer' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_delete_layer')" instead. + """ + def cm_edit_layer(self) -> None: + r""" + @brief 'cm_edit_layer' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_edit_layer')" instead. + """ + def cm_exit(self) -> None: + r""" + @brief 'cm_exit' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_exit')" instead. + """ + def cm_goto_position(self) -> None: + r""" + @brief 'cm_goto_position' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_goto_position')" instead. + """ + def cm_help_about(self) -> None: + r""" + @brief 'cm_help_about' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_help_about')" instead. + """ + def cm_inc_max_hier(self) -> None: + r""" + @brief 'cm_inc_max_hier' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_inc_max_hier')" instead. + """ + def cm_last_display_state(self) -> None: + r""" + @brief 'cm_prev_display_state|#cm_last_display_state' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_prev_display_state|#cm_last_display_state')" instead. + """ + def cm_layout_props(self) -> None: + r""" + @brief 'cm_layout_props' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_layout_props')" instead. + """ + def cm_load_bookmarks(self) -> None: + r""" + @brief 'cm_load_bookmarks' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_load_bookmarks')" instead. + """ + def cm_load_layer_props(self) -> None: + r""" + @brief 'cm_load_layer_props' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_load_layer_props')" instead. + """ + def cm_lv_add_missing(self) -> None: + r""" + @brief 'cm_lv_add_missing' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_add_missing')" instead. + """ + def cm_lv_delete(self) -> None: + r""" + @brief 'cm_lv_delete' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_delete')" instead. + """ + def cm_lv_expand_all(self) -> None: + r""" + @brief 'cm_lv_expand_all' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_expand_all')" instead. + """ + def cm_lv_group(self) -> None: + r""" + @brief 'cm_lv_group' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_group')" instead. + """ + def cm_lv_hide(self) -> None: + r""" + @brief 'cm_lv_hide' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_hide')" instead. + """ + def cm_lv_hide_all(self) -> None: + r""" + @brief 'cm_lv_hide_all' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_hide_all')" instead. + """ + def cm_lv_insert(self) -> None: + r""" + @brief 'cm_lv_insert' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_insert')" instead. + """ + def cm_lv_new_tab(self) -> None: + r""" + @brief 'cm_lv_new_tab' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_new_tab')" instead. + """ + def cm_lv_regroup_by_datatype(self) -> None: + r""" + @brief 'cm_lv_regroup_by_datatype' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_regroup_by_datatype')" instead. + """ + def cm_lv_regroup_by_index(self) -> None: + r""" + @brief 'cm_lv_regroup_by_index' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_regroup_by_index')" instead. + """ + def cm_lv_regroup_by_layer(self) -> None: + r""" + @brief 'cm_lv_regroup_by_layer' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_regroup_by_layer')" instead. + """ + def cm_lv_regroup_flatten(self) -> None: + r""" + @brief 'cm_lv_regroup_flatten' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_regroup_flatten')" instead. + """ + def cm_lv_remove_tab(self) -> None: + r""" + @brief 'cm_lv_remove_tab' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_remove_tab')" instead. + """ + def cm_lv_remove_unused(self) -> None: + r""" + @brief 'cm_lv_remove_unused' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_remove_unused')" instead. + """ + def cm_lv_rename(self) -> None: + r""" + @brief 'cm_lv_rename' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_rename')" instead. + """ + def cm_lv_rename_tab(self) -> None: + r""" + @brief 'cm_lv_rename_tab' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_rename_tab')" instead. + """ + def cm_lv_select_all(self) -> None: + r""" + @brief 'cm_lv_select_all' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_select_all')" instead. + """ + def cm_lv_show(self) -> None: + r""" + @brief 'cm_lv_show' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_show')" instead. + """ + def cm_lv_show_all(self) -> None: + r""" + @brief 'cm_lv_show_all' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_show_all')" instead. + """ + def cm_lv_show_only(self) -> None: + r""" + @brief 'cm_lv_show_only' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_show_only')" instead. + """ + def cm_lv_sort_by_dli(self) -> None: + r""" + @brief 'cm_lv_sort_by_dli' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_sort_by_dli')" instead. + """ + def cm_lv_sort_by_idl(self) -> None: + r""" + @brief 'cm_lv_sort_by_idl' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_sort_by_idl')" instead. + """ + def cm_lv_sort_by_ild(self) -> None: + r""" + @brief 'cm_lv_sort_by_ild' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_sort_by_ild')" instead. + """ + def cm_lv_sort_by_ldi(self) -> None: + r""" + @brief 'cm_lv_sort_by_ldi' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_sort_by_ldi')" instead. + """ + def cm_lv_sort_by_name(self) -> None: + r""" + @brief 'cm_lv_sort_by_name' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_sort_by_name')" instead. + """ + def cm_lv_source(self) -> None: + r""" + @brief 'cm_lv_source' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_source')" instead. + """ + def cm_lv_ungroup(self) -> None: + r""" + @brief 'cm_lv_ungroup' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_lv_ungroup')" instead. + """ + def cm_macro_editor(self) -> None: + r""" + @brief 'cm_macro_editor' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_macro_editor')" instead. + """ + def cm_manage_bookmarks(self) -> None: + r""" + @brief 'cm_manage_bookmarks' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_manage_bookmarks')" instead. + """ + def cm_max_hier(self) -> None: + r""" + @brief 'cm_max_hier' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_max_hier')" instead. + """ + def cm_max_hier_0(self) -> None: + r""" + @brief 'cm_max_hier_0' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_max_hier_0')" instead. + """ + def cm_max_hier_1(self) -> None: + r""" + @brief 'cm_max_hier_1' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_max_hier_1')" instead. + """ + def cm_navigator_close(self) -> None: + r""" + @brief 'cm_navigator_close' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_navigator_close')" instead. + """ + def cm_navigator_freeze(self) -> None: + r""" + @brief 'cm_navigator_freeze' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_navigator_freeze')" instead. + """ + def cm_new_cell(self) -> None: + r""" + @brief 'cm_new_cell' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_new_cell')" instead. + """ + def cm_new_layer(self) -> None: + r""" + @brief 'cm_new_layer' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_new_layer')" instead. + """ + def cm_new_layout(self) -> None: + r""" + @brief 'cm_new_layout' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_new_layout')" instead. + """ + def cm_new_panel(self) -> None: + r""" + @brief 'cm_new_panel' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_new_panel')" instead. + """ + def cm_next_display_state(self) -> None: + r""" + @brief 'cm_next_display_state' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_next_display_state')" instead. + """ + def cm_open(self) -> None: + r""" + @brief 'cm_open' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_open')" instead. + """ + def cm_open_current_cell(self) -> None: + r""" + @brief 'cm_open_current_cell' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_open_current_cell')" instead. + """ + def cm_open_new_view(self) -> None: + r""" + @brief 'cm_open_new_view' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_open_new_view')" instead. + """ + def cm_open_too(self) -> None: + r""" + @brief 'cm_open_too' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_open_too')" instead. + """ + def cm_packages(self) -> None: + r""" + @brief 'cm_packages' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_packages')" instead. + """ + def cm_pan_down(self) -> None: + r""" + @brief 'cm_pan_down' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_pan_down')" instead. + """ + def cm_pan_left(self) -> None: + r""" + @brief 'cm_pan_left' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_pan_left')" instead. + """ + def cm_pan_right(self) -> None: + r""" + @brief 'cm_pan_right' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_pan_right')" instead. + """ + def cm_pan_up(self) -> None: + r""" + @brief 'cm_pan_up' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_pan_up')" instead. + """ + def cm_paste(self) -> None: + r""" + @brief 'cm_paste' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_paste')" instead. + """ + def cm_prev_display_state(self) -> None: + r""" + @brief 'cm_prev_display_state|#cm_last_display_state' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_prev_display_state|#cm_last_display_state')" instead. + """ + def cm_print(self) -> None: + r""" + @brief 'cm_print' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_print')" instead. + """ + def cm_pull_in(self) -> None: + r""" + @brief 'cm_pull_in' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_pull_in')" instead. + """ + def cm_reader_options(self) -> None: + r""" + @brief 'cm_reader_options' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_reader_options')" instead. + """ + def cm_redo(self) -> None: + r""" + @brief 'cm_redo' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_redo')" instead. + """ + def cm_redraw(self) -> None: + r""" + @brief 'cm_redraw' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_redraw')" instead. + """ + def cm_reload(self) -> None: + r""" + @brief 'cm_reload' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_reload')" instead. + """ + def cm_reset_window_state(self) -> None: + r""" + @brief 'cm_reset_window_state' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_reset_window_state')" instead. + """ + def cm_restore_session(self) -> None: + r""" + @brief 'cm_restore_session' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_restore_session')" instead. + """ + def cm_save(self) -> None: + r""" + @brief 'cm_save' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_save')" instead. + """ + def cm_save_all(self) -> None: + r""" + @brief 'cm_save_all' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_save_all')" instead. + """ + def cm_save_as(self) -> None: + r""" + @brief 'cm_save_as' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_save_as')" instead. + """ + def cm_save_bookmarks(self) -> None: + r""" + @brief 'cm_save_bookmarks' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_save_bookmarks')" instead. + """ + def cm_save_current_cell_as(self) -> None: + r""" + @brief 'cm_save_current_cell_as' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_save_current_cell_as')" instead. + """ + def cm_save_layer_props(self) -> None: + r""" + @brief 'cm_save_layer_props' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_save_layer_props')" instead. + """ + def cm_save_session(self) -> None: + r""" + @brief 'cm_save_session' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_save_session')" instead. + """ + def cm_screenshot(self) -> None: + r""" + @brief 'cm_screenshot' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_screenshot')" instead. + """ + def cm_sel_flip_x(self) -> None: + r""" + @brief 'cm_sel_flip_x' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_sel_flip_x')" instead. + """ + def cm_sel_flip_y(self) -> None: + r""" + @brief 'cm_sel_flip_y' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_sel_flip_y')" instead. + """ + def cm_sel_free_rot(self) -> None: + r""" + @brief 'cm_sel_free_rot' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_sel_free_rot')" instead. + """ + def cm_sel_move(self) -> None: + r""" + @brief 'cm_sel_move' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_sel_move')" instead. + """ + def cm_sel_move_to(self) -> None: + r""" + @brief 'cm_sel_move_to' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_sel_move_to')" instead. + """ + def cm_sel_rot_ccw(self) -> None: + r""" + @brief 'cm_sel_rot_ccw' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_sel_rot_ccw')" instead. + """ + def cm_sel_rot_cw(self) -> None: + r""" + @brief 'cm_sel_rot_cw' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_sel_rot_cw')" instead. + """ + def cm_sel_scale(self) -> None: + r""" + @brief 'cm_sel_scale' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_sel_scale')" instead. + """ + def cm_select_all(self) -> None: + r""" + @brief 'cm_select_all' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_select_all')" instead. + """ + def cm_select_cell(self) -> None: + r""" + @brief 'cm_select_cell' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_select_cell')" instead. + """ + def cm_select_current_cell(self) -> None: + r""" + @brief 'cm_select_current_cell' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_select_current_cell')" instead. + """ + def cm_setup(self) -> None: + r""" + @brief 'cm_setup' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_setup')" instead. + """ + def cm_show_properties(self) -> None: + r""" + @brief 'cm_show_properties' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_show_properties')" instead. + """ + def cm_technologies(self) -> None: + r""" + @brief 'cm_technologies' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_technologies')" instead. + """ + def cm_undo(self) -> None: + r""" + @brief 'cm_undo' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_undo')" instead. + """ + def cm_unselect_all(self) -> None: + r""" + @brief 'cm_unselect_all' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_unselect_all')" instead. + """ + def cm_view_log(self) -> None: + r""" + @brief 'cm_view_log' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_view_log')" instead. + """ + def cm_zoom_fit(self) -> None: + r""" + @brief 'cm_zoom_fit' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_zoom_fit')" instead. + """ + def cm_zoom_fit_sel(self) -> None: + r""" + @brief 'cm_zoom_fit_sel' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_zoom_fit_sel')" instead. + """ + def cm_zoom_in(self) -> None: + r""" + @brief 'cm_zoom_in' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_zoom_in')" instead. + """ + def cm_zoom_out(self) -> None: + r""" + @brief 'cm_zoom_out' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_zoom_out')" instead. + """ + def commit_config(self) -> None: + r""" + @brief Commits the configuration settings + This method is provided for using MainWindow without an Application object. It's a convience method which is equivalent to 'dispatcher().commit_config(...)'. See \Dispatcher#commit_config for details. + + This method has been introduced in version 0.27. + """ + @overload + def create_layout(self, mode: int) -> CellView: + r""" + @brief Creates a new, empty layout + + @param mode An integer value of 0, 1 or 2 that determines how the layout is created + @return The cellview of the layout that was created + + Create the layout in the current view, replacing the current layouts (mode 0), in a new view (mode 1) or adding it to the current view (mode 2). + In mode 1, the new view is made the current one. + + This version uses the initial technology and associates it with the new layout. + + Starting with version 0.25, this method returns a cellview object that can be modified to configure the cellview. + """ + @overload + def create_layout(self, tech: str, mode: int) -> CellView: + r""" + @brief Creates a new, empty layout with the given technology + + @param mode An integer value of 0, 1 or 2 that determines how the layout is created + @param tech The name of the technology to use for that layout. + @return The cellview of the layout that was created + + Create the layout in the current view, replacing the current layouts (mode 0), in a new view (mode 1) or adding it to the current view (mode 2). + In mode 1, the new view is made the current one. + + If the technology name is not a valid technology name, the default technology will be used. + + This version was introduced in version 0.22. + Starting with version 0.25, this method returns a cellview object that can be modified to configure the cellview. + """ + def create_view(self) -> int: + r""" + @brief Creates a new, empty view + + @return The index of the view that was created + + Creates an empty view that can be filled with layouts using the load_layout and create_layout methods on the view object. Use the \view method to obtain the view object from the view index. + This method has been added in version 0.22. + """ + def current_view(self) -> LayoutView: + r""" + @brief Returns a reference to the current view's object + + @return A reference to a \LayoutView object representing the current view. + """ + def dispatcher(self) -> Dispatcher: + r""" + @brief Gets the dispatcher interface (the plugin root configuration space) + This method has been introduced in version 0.27. + """ + def enable_edits(self, enable: bool) -> None: + r""" + @brief Enables or disables editing + + @param enable Enable edits if set to true + + Starting from version 0.25, this method enables/disables edits on the current view only. + Use LayoutView#enable_edits instead. + """ + def exit(self) -> None: + r""" + @brief Schedules an exit for the application + + This method does not immediately exit the application but sends an exit request to the application which will cause a clean shutdown of the GUI. + """ + def get_config(self, name: str) -> Any: + r""" + @brief Gets the value of a local configuration parameter + This method is provided for using MainWindow without an Application object. It's a convience method which is equivalent to 'dispatcher().get_config(...)'. See \Dispatcher#get_config for details. + + This method has been introduced in version 0.27. + """ + def get_config_names(self) -> List[str]: + r""" + @brief Gets the configuration parameter names + This method is provided for using MainWindow without an Application object. It's a convience method which is equivalent to 'dispatcher().get_config_names(...)'. See \Dispatcher#get_config_names for details. + + This method has been introduced in version 0.27. + """ + def get_default_key_bindings(self) -> Dict[str, str]: + r""" + @brief Gets the default key bindings + This method returns a hash with the default key binding vs. menu item path. + You can use this hash with \set_key_bindings to reset all key bindings to the default ones. + + This method has been introduced in version 0.27. + """ + def get_default_menu_items_hidden(self) -> Dict[str, bool]: + r""" + @brief Gets the flags indicating whether menu items are hidden by default + You can use this hash with \set_menu_items_hidden to restore the visibility of all menu items. + + This method has been introduced in version 0.27. + """ + def get_key_bindings(self) -> Dict[str, str]: + r""" + @brief Gets the current key bindings + This method returns a hash with the key binding vs. menu item path. + + This method has been introduced in version 0.27. + """ + def get_menu_items_hidden(self) -> Dict[str, bool]: + r""" + @brief Gets the flags indicating whether menu items are hidden + This method returns a hash with the hidden flag vs. menu item path. + You can use this hash with \set_menu_items_hidden. + + This method has been introduced in version 0.27. + """ + def grid_micron(self) -> float: + r""" + @brief Gets the global grid in micron + + @return The global grid in micron + + The global grid is used at various places, i.e. for ruler snapping, for grid display etc. + """ + def index_of(self, view: LayoutView) -> int: + r""" + @brief Gets the index of the given view + + @return The index of the view that was given + + If the given view is not a view object within the main window, a negative value will be returned. + + This method has been added in version 0.25. + """ + @overload + def load_layout(self, filename: str, mode: Optional[int] = ...) -> CellView: + r""" + @brief Loads a new layout + + @param filename The name of the file to load + @param mode An integer value of 0, 1 or 2 that determines how the file is loaded + @return The cellview into which the layout was loaded + + Loads the given file into the current view, replacing the current layouts (mode 0), into a new view (mode 1) or adding the layout to the current view (mode 2). + In mode 1, the new view is made the current one. + + This version will use the initial technology and the default reader options. Others versions are provided which allow specification of technology and reader options explicitly. + + Starting with version 0.25, this method returns a cellview object that can be modified to configure the cellview. The 'mode' argument has been made optional in version 0.28. + """ + @overload + def load_layout(self, filename: str, options: db.LoadLayoutOptions, mode: Optional[int] = ...) -> CellView: + r""" + @brief Loads a new layout with the given options + + @param filename The name of the file to load + @param options The reader options to use. + @param mode An integer value of 0, 1 or 2 that determines how the file is loaded + @return The cellview into which the layout was loaded + + Loads the given file into the current view, replacing the current layouts (mode 0), into a new view (mode 1) or adding the layout to the current view (mode 2). + In mode 1, the new view is made the current one. + + This version was introduced in version 0.22. + Starting with version 0.25, this method returns a cellview object that can be modified to configure the cellview. The 'mode' argument has been made optional in version 0.28. + """ + @overload + def load_layout(self, filename: str, tech: str, mode: Optional[int] = ...) -> CellView: + r""" + @brief Loads a new layout and associate it with the given technology + + @param filename The name of the file to load + @param tech The name of the technology to use for that layout. + @param mode An integer value of 0, 1 or 2 that determines how the file is loaded + @return The cellview into which the layout was loaded + + Loads the given file into the current view, replacing the current layouts (mode 0), into a new view (mode 1) or adding the layout to the current view (mode 2). + In mode 1, the new view is made the current one. + + If the technology name is not a valid technology name, the default technology will be used. The 'mode' argument has been made optional in version 0.28. + + This version was introduced in version 0.22. + Starting with version 0.25, this method returns a cellview object that can be modified to configure the cellview. + """ + @overload + def load_layout(self, filename: str, options: db.LoadLayoutOptions, tech: str, mode: Optional[int] = ...) -> CellView: + r""" + @brief Loads a new layout with the given options and associate it with the given technology + + @param filename The name of the file to load + @param options The reader options to use. + @param tech The name of the technology to use for that layout. + @param mode An integer value of 0, 1 or 2 that determines how the file is loaded + @return The cellview into which the layout was loaded + + Loads the given file into the current view, replacing the current layouts (mode 0), into a new view (mode 1) or adding the layout to the current view (mode 2). + In mode 1, the new view is made the current one. + + If the technology name is not a valid technology name, the default technology will be used. + + This version was introduced in version 0.22. + Starting with version 0.25, this method returns a cellview object that can be modified to configure the cellview. The 'mode' argument has been made optional in version 0.28. + """ + def manager(self) -> db.Manager: + r""" + @brief Gets the \Manager object of this window + + The manager object is responsible to managing the undo/redo stack. Usually this object is not required. It's more convenient and safer to use the related methods provided by \LayoutView (\LayoutView#transaction, \LayoutView#commit) and \MainWindow (such as \MainWindow#cm_undo and \MainWindow#cm_redo). + + This method has been added in version 0.24. + """ + def menu(self) -> AbstractMenu: + r""" + @brief Returns a reference to the abstract menu + + @return A reference to an \AbstractMenu object representing the menu system + """ + def message(self, message: str, time: int) -> None: + r""" + @brief Displays a message in the status bar + + @param message The message to display + @param time The time how long to display the message in ms + + This given message is shown in the status bar for the given time. + + This method has been added in version 0.18. + """ + def read_config(self, file_name: str) -> bool: + r""" + @brief Reads the configuration from a file + This method is provided for using MainWindow without an Application object. It's a convience method which is equivalent to 'dispatcher().read_config(...)'. See \Dispatcher#read_config for details. + + This method has been introduced in version 0.27. + """ + def redraw(self) -> None: + r""" + @brief Redraws the current view + + Issues a redraw request to the current view. This usually happens automatically, so this method does not need to be called in most relevant cases. + """ + def resize(self, width: int, height: int) -> None: + r""" + @brief Resizes the window + + @param width The new width of the window + @param height The new width of the window + + This method resizes the window to the given target size including decoration such as menu bar and control panels + """ + def restore_session(self, fn: str) -> None: + r""" + @brief Restores a session from the given file + + @param fn The path to the session file + + The session stored in the given session file is restored. All existing views are closed and all layout edits are discarded without notification. + + This method was added in version 0.18. + """ + def save_session(self, fn: str) -> None: + r""" + @brief Saves the session to the given file + + @param fn The path to the session file + + The session is saved to the given session file. Any existing layout edits are not automatically saved together with the session. The session just holds display settings and annotation objects. If layout edits exist, they have to be saved explicitly in a separate step. + + This method was added in version 0.18. + """ + def select_view(self, index: int) -> None: + r""" + @brief Selects the view with the given index + + @param index The index of the view to select (0 is the first) + + This method will make the view with the given index the current (front) view. + + This method was renamed from select_view to current_view_index= in version 0.25. The old name is still available, but deprecated. + """ + def set_config(self, name: str, value: str) -> None: + r""" + @brief Set a local configuration parameter with the given name to the given value + This method is provided for using MainWindow without an Application object. It's a convience method which is equivalent to 'dispatcher().set_config(...)'. See \Dispatcher#set_config for details. + + This method has been introduced in version 0.27. + """ + def set_key_bindings(self, bindings: Dict[str, str]) -> None: + r""" + @brief Sets key bindings. + Sets the given key bindings. Pass a hash listing the key bindings per menu item paths. Key strings follow the usual notation, e.g. 'Ctrl+A', 'Shift+X' or just 'F2'. + Use an empty value to remove a key binding from a menu entry. + + \get_key_bindings will give you the current key bindings, \get_default_key_bindings will give you the default ones. + + Examples: + + @code + # reset all key bindings to default: + mw = RBA::MainWindow.instance() + mw.set_key_bindings(mw.get_default_key_bindings()) + + # disable key binding for 'copy': + RBA::MainWindow.instance.set_key_bindings({ "edit_menu.copy" => "" }) + + # configure 'copy' to use Shift+K and 'cut' to use Ctrl+K: + RBA::MainWindow.instance.set_key_bindings({ "edit_menu.copy" => "Shift+K", "edit_menu.cut" => "Ctrl+K" }) + @/code + + This method has been introduced in version 0.27. + """ + def set_menu_items_hidden(self, arg0: Dict[str, bool]) -> None: + r""" + @brief sets the flags indicating whether menu items are hidden + This method allows hiding certain menu items. It takes a hash with hidden flags vs. menu item paths. + Examples: + + @code + # show all menu items: + mw = RBA::MainWindow.instance() + mw.set_menu_items_hidden(mw.get_default_menu_items_hidden()) + + # hide the 'copy' entry from the 'Edit' menu: + RBA::MainWindow.instance().set_menu_items_hidden({ "edit_menu.copy" => true }) + @/code + + This method has been introduced in version 0.27. + """ + def show_macro_editor(self, cat: Optional[str] = ..., add: Optional[bool] = ...) -> None: + r""" + @brief Shows the macro editor + If 'cat' is given, this category will be selected in the category tab. If 'add' is true, the 'new macro' dialog will be opened. + + This method has been introduced in version 0.26. + """ + def synchronous(self, sync_mode: bool) -> None: + r""" + @brief Puts the main window into synchronous mode + + @param sync_mode 'true' if the application should behave synchronously + + In synchronous mode, an application is allowed to block on redraw. While redrawing, no user interactions are possible. Although this is not desirable for smooth operation, it can be beneficial for test or automation purposes, i.e. if a screenshot needs to be produced once the application has finished drawing. + """ + def view(self, n: int) -> LayoutView: + r""" + @brief Returns a reference to a view object by index + + @return The view object's reference for the view with the given index. + """ + def views(self) -> int: + r""" + @brief Returns the number of views + + @return The number of views available so far. + """ + def write_config(self, file_name: str) -> bool: + r""" + @brief Writes configuration to a file + This method is provided for using MainWindow without an Application object. It's a convience method which is equivalent to 'dispatcher().write_config(...)'. See \Dispatcher#write_config for details. + + This method has been introduced in version 0.27. + """ + diff --git a/src/pymod/distutils_src/klayout/libcore.pyi b/src/pymod/distutils_src/klayout/libcore.pyi new file mode 100644 index 000000000..12f4f3fdf --- /dev/null +++ b/src/pymod/distutils_src/klayout/libcore.pyi @@ -0,0 +1,4 @@ +from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional +from typing import overload +import klayout.tl as tl +import klayout.db as db diff --git a/src/pymod/distutils_src/klayout/rdbcore.pyi b/src/pymod/distutils_src/klayout/rdbcore.pyi index 9e63c2908..a61683af3 100644 --- a/src/pymod/distutils_src/klayout/rdbcore.pyi +++ b/src/pymod/distutils_src/klayout/rdbcore.pyi @@ -1,5 +1,6 @@ from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional from typing import overload +import klayout.tl as tl import klayout.db as db class RdbReference: r""" @@ -8,17 +9,28 @@ class RdbReference: """ parent_cell_id: int r""" + Getter: @brief Gets parent cell ID for this reference @return The parent cell ID + + Setter: @brief Sets the parent cell ID for this reference """ trans: db.DCplxTrans r""" + Getter: @brief Gets the transformation for this reference The transformation describes the transformation of the child cell into the parent cell. In that sense that is the usual transformation of a cell reference. @return The transformation + + Setter: @brief Sets the transformation for this reference """ + @classmethod + def new(cls, trans: db.DCplxTrans, parent_cell_id: int) -> RdbReference: + r""" + @brief Creates a reference with a given transformation and parent cell ID + """ def __copy__(self) -> RdbReference: r""" @brief Creates a copy of self @@ -68,22 +80,50 @@ class RdbReference: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def database(self) -> ReportDatabase: r""" @brief Gets the database object that category is associated with This method has been introduced in version 0.23. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> RdbReference: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class RdbCell: r""" @brief A cell inside the report database This class represents a cell in the report database. There is not necessarily a 1:1 correspondence of RDB cells and layout database cells. Cells have an ID, a name, optionally a variant name and a set of references which describe at least one example instantiation in some parent cell. The references do not necessarily map to references or cover all references in the layout database. """ + @classmethod + def new(cls) -> RdbCell: + r""" + @brief Creates a new object of this class + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -134,12 +174,29 @@ class RdbCell: r""" @brief Removes all references from this cell """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def database(self) -> ReportDatabase: r""" @brief Gets the database object that category is associated with This method has been introduced in version 0.23. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def each_item(self) -> Iterator[RdbItem]: r""" @brief Iterates over all items inside the database which are associated with this cell @@ -150,6 +207,12 @@ class RdbCell: r""" @brief Iterates over all references """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def name(self) -> str: r""" @brief Gets the cell name @@ -188,11 +251,19 @@ class RdbCategory: """ description: str r""" + Getter: @brief Gets the category description @return The description string + + Setter: @brief Sets the category description @param description The description string """ + @classmethod + def new(cls) -> RdbCategory: + r""" + @brief Creates a new object of this class + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -234,12 +305,29 @@ class RdbCategory: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def database(self) -> ReportDatabase: r""" @brief Gets the database object that category is associated with This method has been introduced in version 0.23. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def each_item(self) -> Iterator[RdbItem]: r""" @brief Iterates over all items inside the database which are associated with this category @@ -250,6 +338,12 @@ class RdbCategory: r""" @brief Iterates over all sub-categories """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def name(self) -> str: r""" @brief Gets the category name @@ -360,11 +454,14 @@ class RdbItemValue: """ tag_id: int r""" + Getter: @brief Gets the tag ID if the value is a tagged value or 0 if not @return The tag ID See \tag_id= for details about tagged values. Tagged values have been added in version 0.24. + + Setter: @brief Sets the tag ID to make the value a tagged value or 0 to reset it @param id The tag ID To get a tag ID, use \RdbDatabase#user_tag_id (preferred) or \RdbDatabase#tag_id (for internal use). @@ -372,6 +469,66 @@ class RdbItemValue: This variant has been introduced in version 0.24 """ + @classmethod + def from_s(cls, s: str) -> RdbItemValue: + r""" + @brief Creates a value object from a string + The string format is the same than obtained by the to_s method. + """ + @overload + @classmethod + def new(cls, b: db.DBox) -> RdbItemValue: + r""" + @brief Creates a value representing a DBox object + """ + @overload + @classmethod + def new(cls, e: db.DEdge) -> RdbItemValue: + r""" + @brief Creates a value representing a DEdge object + """ + @overload + @classmethod + def new(cls, ee: db.DEdgePair) -> RdbItemValue: + r""" + @brief Creates a value representing a DEdgePair object + """ + @overload + @classmethod + def new(cls, f: float) -> RdbItemValue: + r""" + @brief Creates a value representing a numeric value + + This variant has been introduced in version 0.24 + """ + @overload + @classmethod + def new(cls, p: db.DPath) -> RdbItemValue: + r""" + @brief Creates a value representing a DPath object + + This method has been introduced in version 0.22. + """ + @overload + @classmethod + def new(cls, p: db.DPolygon) -> RdbItemValue: + r""" + @brief Creates a value representing a DPolygon object + """ + @overload + @classmethod + def new(cls, s: str) -> RdbItemValue: + r""" + @brief Creates a value representing a string + """ + @overload + @classmethod + def new(cls, t: db.DText) -> RdbItemValue: + r""" + @brief Creates a value representing a DText object + + This method has been introduced in version 0.22. + """ def __copy__(self) -> RdbItemValue: r""" @brief Creates a copy of self @@ -422,12 +579,6 @@ class RdbItemValue: This method has been introduced in version 0.22. """ - def __repr__(self) -> str: - r""" - @brief Converts a value to a string - The string can be used by the string constructor to create another object from it. - @return The string - """ def __str__(self) -> str: r""" @brief Converts a value to a string @@ -480,6 +631,23 @@ class RdbItemValue: @brief Gets the box if the value represents one. @return The \DBox object or nil """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> RdbItemValue: r""" @brief Creates a copy of self @@ -500,15 +668,16 @@ class RdbItemValue: @return The numeric value or 0 This method has been introduced in version 0.24. """ - def from_s(self, s: str) -> RdbItemValue: - r""" - @brief Creates a value object from a string - The string format is the same than obtained by the to_s method. - """ def is_box(self) -> bool: r""" @brief Returns true if the value object represents a box """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_edge(self) -> bool: r""" @brief Returns true if the value object represents an edge @@ -576,13 +745,43 @@ class RdbItem: @brief An item inside the report database An item is the basic information entity in the RDB. It is associated with a cell and a category. It can be assigned values which encapsulate other objects such as strings and geometrical objects. In addition, items can be assigned an image (i.e. a screenshot image) and tags which are basically boolean flags that can be defined freely. """ + @property + def image(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the attached image from a PixelBuffer object + + This method has been added in version 0.28. + """ + image_str: str + r""" + Getter: + @brief Gets the image associated with this item as a string + @return A base64-encoded image file (in PNG format) + + Setter: + @brief Sets the image from a string + @param image A base64-encoded image file (preferably in PNG format) + """ tags_str: str r""" + Getter: @brief Returns a string listing all tags of this item @return A comma-separated list of tags + + Setter: @brief Sets the tags from a string @param tags A comma-separated list of tags """ + @classmethod + def new(cls) -> RdbItem: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> RdbItem: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -688,6 +887,10 @@ class RdbItem: This method has been introduced in version 0.25.3. """ + def assign(self, other: RdbItem) -> None: + r""" + @brief Assigns another object to self + """ def category_id(self) -> int: r""" @brief Gets the category ID @@ -704,21 +907,61 @@ class RdbItem: r""" @brief Removes all values from this item """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def database(self) -> ReportDatabase: r""" @brief Gets the database object that item is associated with This method has been introduced in version 0.23. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> RdbItem: + r""" + @brief Creates a copy of self + """ def each_value(self) -> Iterator[RdbItemValue]: r""" @brief Iterates over all values """ + def has_image(self) -> bool: + r""" + @brief Gets a value indicating that the item has an image attached + See \image_str how to obtain the image. + + This method has been introduced in version 0.28. + """ def has_tag(self, tag_id: int) -> bool: r""" @brief Returns a value indicating whether the item has a tag with the given ID @return True, if the item has a tag with the given ID """ + def image_pixels(self) -> lay.PixelBuffer: + r""" + @brief Gets the attached image as a PixelBuffer object + + This method has been added in version 0.28. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_visited(self) -> bool: r""" @brief Gets a value indicating whether the item was already visited @@ -739,35 +982,54 @@ class ReportDatabase: """ description: str r""" + Getter: @brief Gets the databases description The description is a general purpose string that is supposed to further describe the database and it's content in a human-readable form. @return The description string + + Setter: @brief Sets the databases description @param desc The description string """ generator: str r""" + Getter: @brief Gets the databases generator The generator string describes how the database was created, i.e. DRC tool name and tool options. In a later version this will allow re-running the tool that created the report. @return The generator string + + Setter: @brief Sets the generator string @param generator The generator string """ original_file: str r""" + Getter: @brief Gets the original file name and path The original file name is supposed to describe the file from which this report database was generated. @return The original file name and path + + Setter: @brief Sets the original file name and path @param path The path """ top_cell_name: str r""" + Getter: @brief Gets the top cell name The top cell name identifies the top cell of the design for which the report was generated. This property must be set to establish a proper hierarchical context for a hierarchical report database. @return The top cell name + + Setter: @brief Sets the top cell name string @param cell_name The top cell name """ + @classmethod + def new(cls, name: str) -> ReportDatabase: + r""" + @brief Creates a report database + @param name The name of the database + The name of the database will be used in the user interface to refer to a certain database. + """ def __init__(self, name: str) -> None: r""" @brief Creates a report database @@ -834,6 +1096,11 @@ class ReportDatabase: @param qname The qualified name of the cell (name plus variant name optionally) @return The cell object or nil if no such cell exists """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ @overload def create_category(self, name: str) -> RdbCategory: r""" @@ -1009,6 +1276,18 @@ class ReportDatabase: @param shapes The shape container from which to take the items @param trans The transformation to apply """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def each_category(self) -> Iterator[RdbCategory]: r""" @brief Iterates over all top-level categories @@ -1043,6 +1322,12 @@ class ReportDatabase: This property is set when a database is saved or loaded. It cannot be set manually. @return The file name and path """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_modified(self) -> bool: r""" @brief Returns a value indicating whether the database has been modified diff --git a/src/pymod/distutils_src/klayout/tlcore.pyi b/src/pymod/distutils_src/klayout/tlcore.pyi index 3fdb16922..018b5409b 100644 --- a/src/pymod/distutils_src/klayout/tlcore.pyi +++ b/src/pymod/distutils_src/klayout/tlcore.pyi @@ -3,6 +3,11 @@ from typing import overload class EmptyClass: r""" """ + @classmethod + def new(cls) -> EmptyClass: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> EmptyClass: r""" @brief Creates a copy of self @@ -52,10 +57,33 @@ class EmptyClass: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> EmptyClass: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class Value: r""" @@ -65,9 +93,25 @@ class Value: """ value: Any r""" + Getter: @brief Gets the actual value. + + Setter: @brief Set the actual value. """ + @overload + @classmethod + def new(cls) -> Value: + r""" + @brief Constructs a nil object. + """ + @overload + @classmethod + def new(cls, value: Any) -> Value: + r""" + @brief Constructs a non-nil object with the given value. + This constructor has been introduced in version 0.22. + """ def __copy__(self) -> Value: r""" @brief Creates a copy of self @@ -83,10 +127,6 @@ class Value: @brief Constructs a non-nil object with the given value. This constructor has been introduced in version 0.22. """ - def __repr__(self) -> str: - r""" - @brief Convert this object to a string - """ def __str__(self) -> str: r""" @brief Convert this object to a string @@ -132,10 +172,33 @@ class Value: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> Value: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def to_s(self) -> str: r""" @brief Convert this object to a string @@ -161,6 +224,11 @@ class Interpreter: This class was introduced in version 0.27.5. """ @classmethod + def new(cls) -> Interpreter: + r""" + @brief Creates a new object of this class + """ + @classmethod def python_interpreter(cls) -> Interpreter: r""" @brief Gets the instance of the Python interpreter @@ -179,6 +247,12 @@ class Interpreter: @brief Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ def _destroyed(self) -> bool: r""" @brief Returns a value indicating whether the object was already destroyed @@ -205,11 +279,28 @@ class Interpreter: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def define_variable(self, name: str, value: Any) -> None: r""" @brief Defines a (global) variable with the given name and value You can use the \Value class to provide 'out' or 'inout' parameters which can be modified by code executed inside the interpreter and read back by the caller. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def eval_expr(self, string: str, filename: Optional[str] = ..., line: Optional[int] = ...) -> Any: r""" @brief Executes the expression inside the given string and returns the result value @@ -220,6 +311,12 @@ class Interpreter: @brief Executes the code inside the given string Use 'filename' and 'line' to indicate the original source for the error messages. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def load_file(self, path: str) -> None: r""" @brief Loads the given file into the interpreter @@ -233,6 +330,9 @@ class ArgType: TypeBool: ClassVar[int] r""" """ + TypeByteArray: ClassVar[int] + r""" + """ TypeChar: ClassVar[int] r""" """ @@ -293,6 +393,11 @@ class ArgType: TypeVoidPtr: ClassVar[int] r""" """ + @classmethod + def new(cls) -> ArgType: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> ArgType: r""" @brief Creates a copy of self @@ -309,10 +414,6 @@ class ArgType: r""" @brief Inequality of two types """ - def __repr__(self) -> str: - r""" - @brief Convert to a string - """ def __str__(self) -> str: r""" @brief Convert to a string @@ -362,11 +463,28 @@ class ArgType: r""" @brief Specifies the class for t_object.. types """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def default(self) -> Any: r""" @brief Returns the default value or nil is there is no default value Applies to arguments only. This method has been introduced in version 0.24. """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> ArgType: r""" @brief Creates a copy of self @@ -386,6 +504,12 @@ class ArgType: @brief Returns the inner ArgType object (i.e. key of a map) This method has been introduced in version 0.27. """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_cptr(self) -> bool: r""" @brief True, if the type is a const pointer to the given type @@ -435,6 +559,11 @@ class MethodOverload: r""" @hide """ + @classmethod + def new(cls) -> MethodOverload: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> MethodOverload: r""" @brief Creates a copy of self @@ -484,14 +613,37 @@ class MethodOverload: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def deprecated(self) -> bool: r""" @brief A value indicating that this overload is deprecated """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> MethodOverload: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_getter(self) -> bool: r""" @brief A value indicating that this overload is a property getter @@ -514,6 +666,15 @@ class Method: r""" @hide """ + @classmethod + def new(cls) -> Method: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> Method: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -561,10 +722,35 @@ class Method: This method has been introduced in version 0.24. """ + def assign(self, other: Method) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def doc(self) -> str: r""" @brief The documentation string for this method """ + def dup(self) -> Method: + r""" + @brief Creates a copy of self + """ def each_argument(self) -> Iterator[ArgType]: r""" @brief Iterate over all arguments of this method @@ -579,6 +765,12 @@ class Method: r""" @brief True, if this method does not alter the object """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def is_constructor(self) -> bool: r""" @brief True, if this method is a constructor @@ -625,6 +817,10 @@ class Method: This method has been introduced in version 0.24. """ + def python_methods(self) -> str: + r""" + @brief Gets the Python specific documentation + """ def ret_type(self) -> ArgType: r""" @brief The return type of this method @@ -639,6 +835,11 @@ class Class: r""" @brief Iterate over all classes """ + @classmethod + def new(cls) -> Class: + r""" + @brief Creates a new object of this class + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -696,6 +897,23 @@ class Class: This method has been introduced in version 0.22. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def doc(self) -> str: r""" @brief The documentation string for this class @@ -708,6 +926,12 @@ class Class: r""" @brief Iterate over all methods of this class """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def module(self) -> str: r""" @brief The name of module where the class lives @@ -720,6 +944,15 @@ class Class: r""" @brief The parent of the class """ + def python_methods(self, static: bool) -> List[PythonFunction]: + r""" + @brief Gets the Python methods (static or non-static) + """ + def python_properties(self, static: bool) -> List[PythonGetterSetterPair]: + r""" + @brief Gets the Python properties (static or non-static) as a list of getter/setter pairs + Note that if a getter or setter is not available the list of Python functions for this part is empty. + """ class Logger: r""" @@ -736,14 +969,49 @@ class Logger: This class has been introduced in version 0.23. """ - verbosity: int + verbosity: ClassVar[int] r""" @brief Returns the verbosity level - The verbosity level is defined by the application (see -d command line option for example). Level 0 is silent, levels 10, 20, 30 etc. denote levels with increasing verbosity. 11, 21, 31 .. are sublevels which also enable timing logs in addition to messages.@brief Sets the verbosity level for the application - - See \verbosity for a definition of the verbosity levels. Please note that this method changes the verbosity level for the whole application. + The verbosity level is defined by the application (see -d command line option for example). Level 0 is silent, levels 10, 20, 30 etc. denote levels with increasing verbosity. 11, 21, 31 .. are sublevels which also enable timing logs in addition to messages. """ + @classmethod + def error(cls, msg: str) -> None: + r""" + @brief Writes the given string to the error channel + + The error channel is formatted as an error (i.e. red in the logger window) and output unconditionally. + """ + @classmethod + def info(cls, msg: str) -> None: + r""" + @brief Writes the given string to the info channel + + The info channel is printed as neutral messages unconditionally. + """ + @classmethod + def log(cls, msg: str) -> None: + r""" + @brief Writes the given string to the log channel + + Log messages are printed as neutral messages and are output only if the verbosity is above 0. + """ + @classmethod + def new(cls) -> Logger: + r""" + @brief Creates a new object of this class + """ + @classmethod + def warn(cls, msg: str) -> None: + r""" + @brief Writes the given string to the warning channel + + The warning channel is formatted as a warning (i.e. blue in the logger window) and output unconditionally. + """ + def __copy__(self) -> Logger: + r""" + @brief Creates a copy of self + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -785,29 +1053,36 @@ class Logger: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def error(self, msg: str) -> None: + def assign(self, other: Logger) -> None: r""" - @brief Writes the given string to the error channel - - The error channel is formatted as an error (i.e. red in the logger window) and output unconditionally. + @brief Assigns another object to self """ - def info(self, msg: str) -> None: + def create(self) -> None: r""" - @brief Writes the given string to the info channel - - The info channel is printed as neutral messages unconditionally. + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. """ - def log(self, msg: str) -> None: + def destroy(self) -> None: r""" - @brief Writes the given string to the log channel - - Log messages are printed as neutral messages and are output only if the verbosity is above 0. + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. """ - def warn(self, msg: str) -> None: + def destroyed(self) -> bool: r""" - @brief Writes the given string to the warning channel - - The warning channel is formatted as a warning (i.e. blue in the logger window) and output unconditionally. + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> Logger: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. """ class Timer: @@ -835,6 +1110,11 @@ class Timer: This method has been introduced in version 0.27. """ + @classmethod + def new(cls) -> Timer: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> Timer: r""" @brief Creates a copy of self @@ -843,10 +1123,6 @@ class Timer: r""" @brief Creates a new object of this class """ - def __repr__(self) -> str: - r""" - @brief Produces a string with the currently elapsed times - """ def __str__(self) -> str: r""" @brief Produces a string with the currently elapsed times @@ -892,10 +1168,33 @@ class Timer: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> Timer: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def start(self) -> None: r""" @brief Starts the timer @@ -934,16 +1233,25 @@ class Progress: """ desc: str r""" + Getter: @brief Gets the description text of the progress object + + Setter: @brief Sets the description text of the progress object """ - title: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the title text of the progress object + @property + def title(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the title text of the progress object - Initially the title is equal to the description. - """ + Initially the title is equal to the description. + """ + @classmethod + def new(cls) -> Progress: + r""" + @brief Creates a new object of this class + """ def __init__(self) -> None: r""" @brief Creates a new object of this class @@ -985,6 +1293,29 @@ class Progress: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class AbstractProgress(Progress): r""" @@ -996,6 +1327,15 @@ class AbstractProgress(Progress): This class has been introduced in version 0.27. """ + @classmethod + def new(cls, desc: str) -> AbstractProgress: + r""" + @brief Creates an abstract progress reporter with the given description + """ + def __copy__(self) -> AbstractProgress: + r""" + @brief Creates a copy of self + """ def __init__(self, desc: str) -> None: r""" @brief Creates an abstract progress reporter with the given description @@ -1037,6 +1377,14 @@ class AbstractProgress(Progress): Usually it's not required to call this method. It has been introduced in version 0.24. """ + def assign(self, other: Progress) -> None: + r""" + @brief Assigns another object to self + """ + def dup(self) -> AbstractProgress: + r""" + @brief Creates a copy of self + """ class RelativeProgress(Progress): r""" @@ -1062,16 +1410,42 @@ class RelativeProgress(Progress): This class has been introduced in version 0.23. """ - format: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief sets the output format (sprintf notation) for the progress text - """ - value: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the progress value - """ + @property + def format(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief sets the output format (sprintf notation) for the progress text + """ + @property + def value(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the progress value + """ + @overload + @classmethod + def new(cls, desc: str, max_value: int) -> RelativeProgress: + r""" + @brief Creates a relative progress reporter with the given description and maximum value + + The reported progress will be 0 to 100% for values between 0 and the maximum value. + The values are always integers. Double values cannot be used property. + """ + @overload + @classmethod + def new(cls, desc: str, max_value: int, yield_interval: int) -> RelativeProgress: + r""" + @brief Creates a relative progress reporter with the given description and maximum value + + The reported progress will be 0 to 100% for values between 0 and the maximum value. + The values are always integers. Double values cannot be used property. + + The yield interval specifies, how often the event loop will be triggered. When the yield interval is 10 for example, the event loop will be executed every tenth call of \inc or \set. + """ + def __copy__(self) -> RelativeProgress: + r""" + @brief Creates a copy of self + """ @overload def __init__(self, desc: str, max_value: int) -> None: r""" @@ -1127,6 +1501,14 @@ class RelativeProgress(Progress): Usually it's not required to call this method. It has been introduced in version 0.24. """ + def assign(self, other: Progress) -> None: + r""" + @brief Assigns another object to self + """ + def dup(self) -> RelativeProgress: + r""" + @brief Creates a copy of self + """ def inc(self) -> RelativeProgress: r""" @brief Increments the progress value @@ -1170,32 +1552,54 @@ class AbsoluteProgress(Progress): This class has been introduced in version 0.23. """ - format: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief sets the output format (sprintf notation) for the progress text - """ - format_unit: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the format unit + @property + def format(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief sets the output format (sprintf notation) for the progress text + """ + @property + def format_unit(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the format unit - This is the unit used for formatted output. - The current count is divided by the format unit to render - the value passed to the format string. - """ - unit: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the unit + This is the unit used for formatted output. + The current count is divided by the format unit to render + the value passed to the format string. + """ + @property + def unit(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the unit - Specifies the count value corresponding to 1 percent on the progress bar. By default, the current value divided by the unit is used to create the formatted value from the output string. Another attribute is provided (\format_unit=) to specify a separate unit for that purpose. - """ - value: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the progress value - """ + Specifies the count value corresponding to 1 percent on the progress bar. By default, the current value divided by the unit is used to create the formatted value from the output string. Another attribute is provided (\format_unit=) to specify a separate unit for that purpose. + """ + @property + def value(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the progress value + """ + @overload + @classmethod + def new(cls, desc: str) -> AbsoluteProgress: + r""" + @brief Creates an absolute progress reporter with the given description + """ + @overload + @classmethod + def new(cls, desc: str, yield_interval: int) -> AbsoluteProgress: + r""" + @brief Creates an absolute progress reporter with the given description + + The yield interval specifies, how often the event loop will be triggered. When the yield interval is 10 for example, the event loop will be executed every tenth call of \inc or \set. + """ + def __copy__(self) -> AbsoluteProgress: + r""" + @brief Creates a copy of self + """ @overload def __init__(self, desc: str) -> None: r""" @@ -1245,6 +1649,14 @@ class AbsoluteProgress(Progress): Usually it's not required to call this method. It has been introduced in version 0.24. """ + def assign(self, other: Progress) -> None: + r""" + @brief Assigns another object to self + """ + def dup(self) -> AbsoluteProgress: + r""" + @brief Creates a copy of self + """ def inc(self) -> AbsoluteProgress: r""" @brief Increments the progress value @@ -1265,6 +1677,16 @@ class ExpressionContext: This class has been introduced in version 0.26 when \Expression was separated into the execution and context part. """ + @classmethod + def global_var(cls, name: str, value: Any) -> None: + r""" + @brief Defines a global variable with the given name and value + """ + @classmethod + def new(cls) -> ExpressionContext: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> ExpressionContext: r""" @brief Creates a copy of self @@ -1314,6 +1736,23 @@ class ExpressionContext: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> ExpressionContext: r""" @brief Creates a copy of self @@ -1323,9 +1762,11 @@ class ExpressionContext: @brief Compiles and evaluates the given expression in this context This method has been introduced in version 0.26. """ - def global_var(self, name: str, value: Any) -> None: + def is_const_object(self) -> bool: r""" - @brief Defines a global variable with the given name and value + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. """ def var(self, name: str, value: Any) -> None: r""" @@ -1342,11 +1783,37 @@ class Expression(ExpressionContext): This class has been introduced in version 0.25. In version 0.26 it was separated into execution and context. """ - text: None - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the given text as the expression. - """ + @property + def text(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the given text as the expression. + """ + @classmethod + def _class_eval(cls, expr: str) -> Any: + r""" + @brief A convience function to evaluate the given expression and directly return the result + This is a static method that does not require instantiation of the expression object first. + """ + @classmethod + def eval(cls, expr: str) -> Any: + r""" + @brief A convience function to evaluate the given expression and directly return the result + This is a static method that does not require instantiation of the expression object first. + """ + @overload + @classmethod + def new(cls, expr: str) -> Expression: + r""" + @brief Creates an expression evaluator + """ + @overload + @classmethod + def new(cls, expr: str, variables: Dict[str, Any]) -> Expression: + r""" + @brief Creates an expression evaluator + This version of the constructor takes a hash of variables available to the expressions. + """ @overload def __init__(self, expr: str) -> None: r""" @@ -1375,6 +1842,10 @@ class Expression(ExpressionContext): This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ + def _inst_eval(self) -> Any: + r""" + @brief Evaluates the current expression and returns the result + """ def _is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference @@ -1395,17 +1866,10 @@ class Expression(ExpressionContext): Usually it's not required to call this method. It has been introduced in version 0.24. """ - @overload def eval(self) -> Any: r""" @brief Evaluates the current expression and returns the result """ - @overload - def eval(self, expr: str) -> Any: - r""" - @brief A convience function to evaluate the given expression and directly return the result - This is a static method that does not require instantiation of the expression object first. - """ class GlobPattern: r""" @@ -1416,14 +1880,25 @@ class GlobPattern: """ case_sensitive: bool r""" - @brief Gets a value indicating whether the glob pattern match is case sensitive.@brief Sets a value indicating whether the glob pattern match is case sensitive. + Getter: + @brief Gets a value indicating whether the glob pattern match is case sensitive. + Setter: + @brief Sets a value indicating whether the glob pattern match is case sensitive. """ head_match: bool r""" + Getter: @brief Gets a value indicating whether trailing characters are allowed. + + Setter: @brief Sets a value indicating whether trailing characters are allowed. If this predicate is false, the glob pattern needs to match the full subject string. If true, the match function will ignore trailing characters and return true if the front part of the subject string matches. """ + @classmethod + def new(cls, pattern: str) -> GlobPattern: + r""" + @brief Creates a new glob pattern match object + """ def __copy__(self) -> GlobPattern: r""" @brief Creates a copy of self @@ -1473,10 +1948,33 @@ class GlobPattern: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> GlobPattern: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ def match(self, subject: str) -> Any: r""" @brief Matches the subject string against the pattern. @@ -1488,6 +1986,11 @@ class ExecutableBase: @hide @alias Executable """ + @classmethod + def new(cls) -> ExecutableBase: + r""" + @brief Creates a new object of this class + """ def __copy__(self) -> ExecutableBase: r""" @brief Creates a copy of self @@ -1537,10 +2040,33 @@ class ExecutableBase: r""" @brief Assigns another object to self """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ def dup(self) -> ExecutableBase: r""" @brief Creates a copy of self """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ class Executable(ExecutableBase): r""" @@ -1596,16 +2122,6 @@ class Executable(ExecutableBase): Usually it's not required to call this method. It has been introduced in version 0.24. """ - def cleanup(self) -> None: - r""" - @brief Reimplement this method to provide post-mortem cleanup functionality. - This method is always called after execute terminated. - """ - def execute(self) -> Any: - r""" - @brief Reimplement this method to provide the functionality of the executable. - This method is supposed to execute the operation with the given parameters and return the desired output. - """ class Recipe: r""" @@ -1627,6 +2143,18 @@ class Recipe: This class has been introduced in version 0.26. """ + @classmethod + def make(cls, generator: str, add_params: Optional[Dict[str, Any]] = ...) -> Any: + r""" + @brief Executes the recipe given by the generator string. + The generator string is the one delivered with \generator. + Additional parameters can be passed in "add_params". They have lower priority than the parameters kept inside the generator string. + """ + @classmethod + def new(cls, name: str, description: Optional[str] = ...) -> Recipe: + r""" + @brief Creates a new recipe object with the given name and (optional) description + """ def __init__(self, name: str, description: Optional[str] = ...) -> None: r""" @brief Creates a new recipe object with the given name and (optional) description @@ -1668,30 +2196,236 @@ class Recipe: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ def description(self) -> str: r""" @brief Gets the description of the recipe. """ - def executable(self, params: Dict[str, Any]) -> ExecutableBase: + def destroy(self) -> None: r""" - @brief Reimplement this method to provide an executable object for the actual implementation. - The reasoning behind this architecture is to supply a cleanup callback. This is useful when the actual function is executed as a script and the script terminates in the debugger. The cleanup callback allows implementing any kind of post-mortem action despite being cancelled in the debugger. - - This method has been introduced in version 0.27 and replaces 'execute'. + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ def generator(self, params: Dict[str, Any]) -> str: r""" @brief Delivers the generator string from the given parameters. The generator string can be used with \make to re-run the recipe. """ - def make(self, generator: str, add_params: Optional[Dict[str, Any]] = ...) -> Any: + def is_const_object(self) -> bool: r""" - @brief Executes the recipe given by the generator string. - The generator string is the one delivered with \generator. - Additional parameters can be passed in "add_params". They have lower priority than the parameters kept inside the generator string. + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. """ def name(self) -> str: r""" @brief Gets the name of the recipe. """ +class PythonGetterSetterPair: + r""" + @hide + """ + @classmethod + def new(cls) -> PythonGetterSetterPair: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> PythonGetterSetterPair: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: PythonGetterSetterPair) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> PythonGetterSetterPair: + r""" + @brief Creates a copy of self + """ + def getter(self) -> PythonFunction: + r""" + @brief Gets the getter function + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def setter(self) -> PythonFunction: + r""" + @brief Gets the setter function + """ + +class PythonFunction: + r""" + @hide + """ + @classmethod + def new(cls) -> PythonFunction: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> PythonFunction: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def _destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def _destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def _is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: PythonFunction) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief Ensures the C++ object is created + Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. + """ + def destroy(self) -> None: + r""" + @brief Explicitly destroys the object + Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. + If the object is not owned by the script, this method will do nothing. + """ + def destroyed(self) -> bool: + r""" + @brief Returns a value indicating whether the object was already destroyed + This method returns true, if the object was destroyed, either explicitly or by the C++ side. + The latter may happen, if the object is owned by a C++ object which got destroyed itself. + """ + def dup(self) -> PythonFunction: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief Returns a value indicating whether the reference is a const reference + This method returns true, if self is a const reference. + In that case, only const methods may be called on self. + """ + def is_protected(self) -> bool: + r""" + @brief Gets a value indicating whether this function is protected + """ + def is_static(self) -> bool: + r""" + @brief Gets the value indicating whether this Python function is 'static' (class function) + """ + def methods(self) -> List[Method]: + r""" + @brief Gets the list of methods bound to this Python function + """ + def name(self) -> str: + r""" + @brief Gets the name of this Python function + """ + From 24c6224a8448f66db2a4f3bf8677acacc781c8bd Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 24 Oct 2022 20:31:46 +0200 Subject: [PATCH 10/15] Do not produce Python methods masked by properties. --- src/pya/pya/pyaInternal.cc | 9 ++ src/pymod/distutils_src/klayout/dbcore.pyi | 162 -------------------- src/pymod/distutils_src/klayout/laycore.pyi | 158 ------------------- 3 files changed, 9 insertions(+), 320 deletions(-) diff --git a/src/pya/pya/pyaInternal.cc b/src/pya/pya/pyaInternal.cc index a4d2e3934..ea6703623 100644 --- a/src/pya/pya/pyaInternal.cc +++ b/src/pya/pya/pyaInternal.cc @@ -715,6 +715,15 @@ MethodTable::finish () { for (std::vector::iterator m = m_table.begin (); m != m_table.end (); ++m) { m->finish (); + if (m->is_enabled ()) { + // disable methods which are also present as properties + if (m_property_name_map.find (std::make_pair (m->is_static (), m->name ())) != m_property_name_map.end ()) { + m->set_enabled (false); + for (auto i = m->begin (); i != m->end (); ++i) { + mp_module->add_python_doc (*i, tl::to_string (tr ("This method is not available for Python"))); + } + } + } } for (std::vector >::iterator m = m_property_table.begin (); m != m_property_table.end (); ++m) { m->first.finish (); diff --git a/src/pymod/distutils_src/klayout/dbcore.pyi b/src/pymod/distutils_src/klayout/dbcore.pyi index e3039a029..7bd9ae59b 100644 --- a/src/pymod/distutils_src/klayout/dbcore.pyi +++ b/src/pymod/distutils_src/klayout/dbcore.pyi @@ -3199,14 +3199,6 @@ class Instance: The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array) for the given layer. If the layer is empty in this cell and all it's children', an empty bounding box will be returned. This method has been introduced in version 0.25. 'bbox' is the preferred synonym for it since version 0.28. """ - def cell(self) -> Cell: - r""" - @brief Gets the \Cell object of the cell this instance refers to - - This is the const version of the \cell method. It will return a const \Cell object and itself can be called on a const \Instance object. - - This variant has been introduced in version 0.25. - """ def change_pcell_parameter(self, name: str, value: Any) -> None: r""" @brief Changes a single parameter of a PCell instance to the given value @@ -3386,14 +3378,6 @@ class Instance: This const version of the method has been introduced in version 0.25. """ - def parent_cell(self) -> Cell: - r""" - @brief Gets the cell this instance is contained in - - Returns nil if the instance does not live inside a cell. - - This const version of the \parent_cell method has been introduced in version 0.25. - """ def pcell_declaration(self) -> PCellDeclaration_Native: r""" @brief Returns the PCell declaration object @@ -14900,22 +14884,6 @@ class SaveLayoutOptions: r""" @brief Assigns another object to self """ - def cif_blank_separator(self) -> bool: - r""" - @brief Gets a flag indicating whether blanks shall be used as x/y separator characters - See \cif_blank_separator= method for a description of that property. - This property has been added in version 0.23.10. - - The predicate version (cif_blank_separator?) has been added in version 0.25.1. - """ - def cif_dummy_calls(self) -> bool: - r""" - @brief Gets a flag indicating whether dummy calls shall be written - See \cif_dummy_calls= method for a description of that property. - This property has been added in version 0.23.10. - - The predicate version (cif_blank_separator?) has been added in version 0.25.1. - """ def clear_cells(self) -> None: r""" @brief Clears all cells to be saved @@ -14953,24 +14921,6 @@ class SaveLayoutOptions: r""" @brief Creates a copy of self """ - def gds2_no_zero_length_paths(self) -> bool: - r""" - @brief Gets a value indicating whether zero-length paths are eliminated - - This property has been added in version 0.23. - """ - def gds2_write_cell_properties(self) -> bool: - r""" - @brief Gets a value indicating whether cell properties are written - - This property has been added in version 0.23. - """ - def gds2_write_file_properties(self) -> bool: - r""" - @brief Gets a value indicating whether layout properties are written - - This property has been added in version 0.24. - """ def is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference @@ -23553,18 +23503,6 @@ class LoadLayoutOptions: r""" @brief Creates a copy of self """ - def dxf_keep_other_cells(self) -> bool: - r""" - @brief If this option is true, all cells are kept, not only the top cell and it's children - - This property has been added in version 0.21.15. - """ - def dxf_render_texts_as_polygons(self) -> bool: - r""" - @brief If this option is true, text objects are rendered as polygons - - This property has been added in version 0.21.15. - """ def dxf_select_all_layers(self) -> None: r""" @brief Selects all layers and disables the layer map @@ -23583,18 +23521,6 @@ class LoadLayoutOptions: This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. """ - def gds2_allow_big_records(self) -> bool: - r""" - @brief Gets a value specifying whether to allow big records with a length of 32768 to 65535 bytes. - See \gds2_allow_big_records= method for a description of this property. - This property has been added in version 0.18. - """ - def gds2_allow_multi_xy_records(self) -> bool: - r""" - @brief Gets a value specifying whether to allow big polygons with multiple XY records. - See \gds2_allow_multi_xy_records= method for a description of this property. - This property has been added in version 0.18. - """ def is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference @@ -28839,12 +28765,6 @@ class Shape: r""" @brief Returns the bounding box of the shape """ - def box(self) -> Any: - r""" - @brief Gets the box object - - Starting with version 0.23, this method returns nil, if the shape does not represent a box. - """ def create(self) -> None: r""" @brief Ensures the C++ object is created @@ -28988,18 +28908,6 @@ class Shape: This method applies to polygons and delivers all points of the polygon hull contour. It will throw an exception for other objects. """ - def edge(self) -> Any: - r""" - @brief Returns the edge object - - Starting with version 0.23, this method returns nil, if the shape does not represent an edge. - """ - def edge_pair(self) -> Any: - r""" - @brief Returns the edge pair object - - This method has been introduced in version 0.26. - """ def has_prop_id(self) -> bool: r""" @brief Returns true, if the shape has properties, i.e. has a properties ID @@ -29079,12 +28987,6 @@ class Shape: This method has been introduced in version 0.22. """ - def path(self) -> Any: - r""" - @brief Returns the path object - - Starting with version 0.23, this method returns nil, if the shape does not represent a path. - """ def path_dlength(self) -> float: r""" @brief Returns the length of the path in micrometer units @@ -29112,14 +29014,6 @@ class Shape: This method has been added in version 0.23. """ - def polygon(self) -> Any: - r""" - @brief Returns the polygon object - - Returns the polygon object that this shape refers to or converts the object to a polygon. Paths, boxes and simple polygons are converted to polygons. For paths this operation renders the path's hull contour. - - Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a polygon. - """ def property(self, key: Any) -> Any: r""" @brief Gets the user property with the given key @@ -29142,19 +29036,6 @@ class Shape: This method has been introduced in version 0.22. """ - def simple_polygon(self) -> Any: - r""" - @brief Returns the simple polygon object - - Returns the simple polygon object that this shape refers to or converts the object to a simple polygon. Paths, boxes and polygons are converted to simple polygons. Polygons with holes will have their holes removed but introducing cut lines that connect the hole contours with the outer contour. - Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a simple polygon. - """ - def text(self) -> Any: - r""" - @brief Returns the text object - - Starting with version 0.23, this method returns nil, if the shape does not represent a text. - """ def to_s(self) -> str: r""" @brief Create a string showing the contents of the reference @@ -49857,13 +49738,6 @@ class LEFDEFReaderConfiguration: r""" @brief Creates a copy of self """ - def fills_datatype(self, mask: int) -> int: - r""" - @brief Gets the fill geometry layer datatype value per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ def fills_suffix_per_mask(self, mask: int) -> str: r""" @brief Gets the fill geometry layer name suffix per mask. @@ -49877,25 +49751,11 @@ class LEFDEFReaderConfiguration: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ - def lef_pins_datatype(self, mask: int) -> int: - r""" - @brief Gets the LEF pin geometry layer datatype value per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ def lef_pins_suffix_per_mask(self, mask: int) -> str: r""" @brief Gets the LEF pin geometry layer name suffix per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - Mask specific rules have been introduced in version 0.27. - """ - def pins_datatype(self, mask: int) -> int: - r""" - @brief Gets the pin geometry layer datatype value per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - Mask specific rules have been introduced in version 0.27. """ def pins_suffix_per_mask(self, mask: int) -> str: @@ -49903,13 +49763,6 @@ class LEFDEFReaderConfiguration: @brief Gets the pin geometry layer name suffix per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - Mask specific rules have been introduced in version 0.27. - """ - def routing_datatype(self, mask: int) -> int: - r""" - @brief Gets the routing geometry layer datatype value per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - Mask specific rules have been introduced in version 0.27. """ def routing_suffix_per_mask(self, mask: int) -> str: @@ -50003,13 +49856,6 @@ class LEFDEFReaderConfiguration: See \produce_via_geometry for details about this property. The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - Mask specific rules have been introduced in version 0.27. - """ - def special_routing_datatype(self, mask: int) -> int: - r""" - @brief Gets the special routing geometry layer datatype value per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - Mask specific rules have been introduced in version 0.27. """ def special_routing_suffix_per_mask(self, mask: int) -> str: @@ -50017,14 +49863,6 @@ class LEFDEFReaderConfiguration: @brief Gets the special routing geometry layer name suffix per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - Mask specific rules have been introduced in version 0.27. - """ - def via_geometry_datatype(self, mask: int) -> int: - r""" - @brief Gets the via geometry layer datatype value per mask. - See \produce_via_geometry for details about this property. - The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - Mask specific rules have been introduced in version 0.27. """ def via_geometry_suffix_per_mask(self, mask: int) -> str: diff --git a/src/pymod/distutils_src/klayout/laycore.pyi b/src/pymod/distutils_src/klayout/laycore.pyi index 8f33d9418..ce9f8b66e 100644 --- a/src/pymod/distutils_src/klayout/laycore.pyi +++ b/src/pymod/distutils_src/klayout/laycore.pyi @@ -1688,12 +1688,6 @@ class LayerProperties: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def animation(self, real: bool) -> int: - r""" - @brief Gets the animation state - - The animation state is an integer either being 0 (static), 1 (scrolling), 2 (blinking) or 3 (inversely blinking) - """ def assign(self, other: LayerProperties) -> None: r""" @brief Assigns another object to self @@ -1755,14 +1749,6 @@ class LayerProperties: This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself. """ - def dither_pattern(self, real: bool) -> int: - r""" - @brief Gets the dither pattern index - - This method may deliver an invalid dither pattern index if it is not set. - - @param real Set to true to return the real instead of local value - """ def dup(self) -> LayerProperties: r""" @brief Creates a copy of self @@ -1842,22 +1828,6 @@ class LayerProperties: This method has been introduced in version 0.25. """ - def fill_brightness(self, real: bool) -> int: - r""" - @brief Gets the fill brightness value - - If the brightness is not set, this method may return an invalid value - - @param real Set to true to return the real instead of local value - """ - def fill_color(self, real: bool) -> int: - r""" - @brief Gets the fill color - - This method may return an invalid color if the color is not set. - - @param real Set to true to return the real instead of local value - """ def flat(self) -> LayerProperties: r""" @brief Returns the "flattened" (effective) layer properties entry for this node @@ -1866,22 +1836,6 @@ class LayerProperties: This object represents the effective layer properties for the given node. In particular, all 'local' properties are identical to the 'real' properties. Such an object can be used as a basis for manipulations. This method has been introduced in version 0.22. """ - def frame_brightness(self, real: bool) -> int: - r""" - @brief Gets the frame brightness value - - If the brightness is not set, this method may return an invalid value - - @param real Set to true to return the real instead of local value - """ - def frame_color(self, real: bool) -> int: - r""" - @brief Gets the frame color - - This method may return an invalid color if the color is not set. - - @param real Set to true to return the real instead of local value - """ @overload def has_dither_pattern(self) -> bool: r""" @@ -2000,21 +1954,6 @@ class LayerProperties: This is the index of the actual layer used. The source specification given by \source_layer, \source_datatype, \source_name is evaluated and the corresponding layer is looked up in the layout object. If a \source_layer_index is specified, this layer index is taken as the layer index to use. """ - def line_style(self, real: bool) -> int: - r""" - @brief Gets the line style index - - This method may deliver an invalid line style index if it is not set (see \has_line_style?). - - @param real Set to true to return the real instead of local value - This method has been introduced in version 0.25. - """ - def lower_hier_level(self, real: bool) -> int: - r""" - @brief Gets the lower hierarchy level shown - - This is the hierarchy level at which the drawing starts. This property is only meaningful, if \has_lower_hier_level is true. The hierarchy level can be relative in which case, 0 refers to the context cell's level. A mode can be specified for the hierarchy level which is 0 for absolute, 1 for minimum of specified level and set level and 2 for maximum of specified level and set level. - """ @overload def lower_hier_level_mode(self) -> int: r""" @@ -2052,10 +1991,6 @@ class LayerProperties: This method has been introduced in version 0.19. """ - def marked(self, real: bool) -> bool: - r""" - @brief Gets the marked state - """ @overload def set_lower_hier_level(self, level: int, relative: bool) -> None: r""" @@ -2092,73 +2027,6 @@ class LayerProperties: This method has been introduced in version 0.20. """ - def source(self, real: bool) -> str: - r""" - @brief Gets the source specification - - This method delivers the source specification as a string - - @param real Set to true to return the computed instead of local value - """ - def source_cellview(self, real: bool) -> int: - r""" - @brief Gets the cellview index that this layer refers to - - If "real" is true, the effective value is returned. - """ - def source_datatype(self, real: bool) -> int: - r""" - @brief Gets the stream datatype that the shapes are taken from - - If the datatype is positive, the actual layer is looked up by this stream datatype. If a name or layer index is specified, the stream datatype is not used. - - If "real" is true, the effective value is returned. - """ - def source_layer(self, real: bool) -> int: - r""" - @brief Gets the stream layer that the shapes are taken from - - If the layer is positive, the actual layer is looked up by this stream layer. If a name or layer index is specified, the stream layer is not used. - - If "real" is true, the effective value is returned. - """ - def source_layer_index(self, real: bool) -> int: - r""" - @brief Gets the layer index that the shapes are taken from - - If the layer index is positive, the shapes drawn are taken from this layer rather than searched for by layer and datatype. This property is stronger than the layer/datatype or name specification. - - A different method is \layer_index which indicates the ID of the layer actually used. While "source_layer_index" is one of several ways to address the layer drawn, "layer_index" is the ID (index) of the layer matching the source specification and is >= 0 if such a layer is found. - - If "real" is true, the effective value is returned. - """ - def source_name(self, real: bool) -> str: - r""" - @brief Gets the stream name that the shapes are taken from - - If the name is non-empty, the actual layer is looked up by this stream layer name. If a layer index (see \layer_index) is specified, the stream datatype is not used. - A name is only meaningful for OASIS files. - - If "real" is true, the effective value is returned. - """ - def trans(self, real: bool) -> List[db.DCplxTrans]: - r""" - @brief Gets the transformations that the layer is transformed with - - The transformations returned by this accessor is the one used for displaying this layer. The layout is transformed with each of these transformations before it is drawn. - - If "real" is true, the effective value is returned. - """ - def transparent(self, real: bool) -> bool: - r""" - @brief Gets the transparency state - """ - def upper_hier_level(self, real: bool) -> int: - r""" - @brief Gets the upper hierarchy level shown - - This is the hierarchy level at which the drawing starts. This property is only meaningful, if \has_upper_hier_level is true. The hierarchy level can be relative in which case, 0 refers to the context cell's level. A mode can be specified for the hierarchy level which is 0 for absolute, 1 for minimum of specified level and set level and 2 for maximum of specified level and set level. - """ @overload def upper_hier_level_mode(self) -> int: r""" @@ -2196,24 +2064,6 @@ class LayerProperties: This method has been introduced in version 0.19. """ - def valid(self, real: bool) -> bool: - r""" - @brief Gets the validity state - """ - def visible(self, real: bool) -> bool: - r""" - @brief Gets the visibility state - """ - def width(self, real: bool) -> int: - r""" - @brief Gets the line width - """ - def xfill(self, real: bool) -> bool: - r""" - @brief Gets a value indicating whether shapes are drawn with a cross - - This attribute has been introduced in version 0.25. - """ class LayerPropertiesNode(LayerProperties): r""" @@ -12875,14 +12725,6 @@ class MainWindow(QMainWindow_Native): This method has been introduced in version 0.26. """ - def synchronous(self, sync_mode: bool) -> None: - r""" - @brief Puts the main window into synchronous mode - - @param sync_mode 'true' if the application should behave synchronously - - In synchronous mode, an application is allowed to block on redraw. While redrawing, no user interactions are possible. Although this is not desirable for smooth operation, it can be beneficial for test or automation purposes, i.e. if a screenshot needs to be produced once the application has finished drawing. - """ def view(self, n: int) -> LayoutView: r""" @brief Returns a reference to a view object by index From c8d86f8e73bd351eb1a06b48174b49d11f36c3cf Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 24 Oct 2022 20:53:58 +0200 Subject: [PATCH 11/15] Improved doc, enough slots for getters and setters for Qt namespace --- src/lay/lay/layGSIHelpProvider.cc | 2 +- src/pya/pya/pyaCallables.cc | 64 +++++++++++++++++++++++++++++++ src/pya/pya/pyaInternal.cc | 7 +--- src/pya/pya/pyaModule.cc | 12 +++--- 4 files changed, 73 insertions(+), 12 deletions(-) diff --git a/src/lay/lay/layGSIHelpProvider.cc b/src/lay/lay/layGSIHelpProvider.cc index 670833917..d7f13c65a 100644 --- a/src/lay/lay/layGSIHelpProvider.cc +++ b/src/lay/lay/layGSIHelpProvider.cc @@ -1413,7 +1413,7 @@ GSIHelpProvider::produce_class_doc (const std::string &cls) const if (! pydoc.empty ()) { os << "

"; os << tl::to_string (QObject::tr ("Python specific notes: ")); - os << "
" << escape_xml (pydoc) << "

" << std::endl; + os << "
" << tl::replaced (escape_xml (pydoc), "\n\n", "
") << "

" << std::endl; } os << ""; diff --git a/src/pya/pya/pyaCallables.cc b/src/pya/pya/pyaCallables.cc index 6df8fb380..472f2c68b 100644 --- a/src/pya/pya/pyaCallables.cc +++ b/src/pya/pya/pyaCallables.cc @@ -1348,6 +1348,38 @@ static py_func_ptr_t property_getter_adaptors [] = &property_getter_adaptor<0x3e8>, &property_getter_adaptor<0x3e9>, &property_getter_adaptor<0x3ea>, &property_getter_adaptor<0x3eb>, &property_getter_adaptor<0x3ec>, &property_getter_adaptor<0x3ed>, &property_getter_adaptor<0x3ee>, &property_getter_adaptor<0x3ef>, &property_getter_adaptor<0x3f0>, &property_getter_adaptor<0x3f1>, &property_getter_adaptor<0x3f2>, &property_getter_adaptor<0x3f3>, &property_getter_adaptor<0x3f4>, &property_getter_adaptor<0x3f5>, &property_getter_adaptor<0x3f6>, &property_getter_adaptor<0x3f7>, &property_getter_adaptor<0x3f8>, &property_getter_adaptor<0x3f9>, &property_getter_adaptor<0x3fa>, &property_getter_adaptor<0x3fb>, &property_getter_adaptor<0x3fc>, &property_getter_adaptor<0x3fd>, &property_getter_adaptor<0x3fe>, &property_getter_adaptor<0x3ff>, + &property_getter_adaptor<0x400>, &property_getter_adaptor<0x401>, &property_getter_adaptor<0x402>, &property_getter_adaptor<0x403>, &property_getter_adaptor<0x404>, &property_getter_adaptor<0x405>, &property_getter_adaptor<0x406>, &property_getter_adaptor<0x407>, + &property_getter_adaptor<0x408>, &property_getter_adaptor<0x409>, &property_getter_adaptor<0x40a>, &property_getter_adaptor<0x40b>, &property_getter_adaptor<0x40c>, &property_getter_adaptor<0x40d>, &property_getter_adaptor<0x40e>, &property_getter_adaptor<0x40f>, + &property_getter_adaptor<0x410>, &property_getter_adaptor<0x411>, &property_getter_adaptor<0x412>, &property_getter_adaptor<0x413>, &property_getter_adaptor<0x414>, &property_getter_adaptor<0x415>, &property_getter_adaptor<0x416>, &property_getter_adaptor<0x417>, + &property_getter_adaptor<0x418>, &property_getter_adaptor<0x419>, &property_getter_adaptor<0x41a>, &property_getter_adaptor<0x41b>, &property_getter_adaptor<0x41c>, &property_getter_adaptor<0x41d>, &property_getter_adaptor<0x41e>, &property_getter_adaptor<0x41f>, + &property_getter_adaptor<0x420>, &property_getter_adaptor<0x421>, &property_getter_adaptor<0x422>, &property_getter_adaptor<0x423>, &property_getter_adaptor<0x424>, &property_getter_adaptor<0x425>, &property_getter_adaptor<0x426>, &property_getter_adaptor<0x427>, + &property_getter_adaptor<0x428>, &property_getter_adaptor<0x429>, &property_getter_adaptor<0x42a>, &property_getter_adaptor<0x42b>, &property_getter_adaptor<0x42c>, &property_getter_adaptor<0x42d>, &property_getter_adaptor<0x42e>, &property_getter_adaptor<0x42f>, + &property_getter_adaptor<0x430>, &property_getter_adaptor<0x431>, &property_getter_adaptor<0x432>, &property_getter_adaptor<0x433>, &property_getter_adaptor<0x434>, &property_getter_adaptor<0x435>, &property_getter_adaptor<0x436>, &property_getter_adaptor<0x437>, + &property_getter_adaptor<0x438>, &property_getter_adaptor<0x439>, &property_getter_adaptor<0x43a>, &property_getter_adaptor<0x43b>, &property_getter_adaptor<0x43c>, &property_getter_adaptor<0x43d>, &property_getter_adaptor<0x43e>, &property_getter_adaptor<0x43f>, + &property_getter_adaptor<0x440>, &property_getter_adaptor<0x441>, &property_getter_adaptor<0x442>, &property_getter_adaptor<0x443>, &property_getter_adaptor<0x444>, &property_getter_adaptor<0x445>, &property_getter_adaptor<0x446>, &property_getter_adaptor<0x447>, + &property_getter_adaptor<0x448>, &property_getter_adaptor<0x449>, &property_getter_adaptor<0x44a>, &property_getter_adaptor<0x44b>, &property_getter_adaptor<0x44c>, &property_getter_adaptor<0x44d>, &property_getter_adaptor<0x44e>, &property_getter_adaptor<0x44f>, + &property_getter_adaptor<0x450>, &property_getter_adaptor<0x451>, &property_getter_adaptor<0x452>, &property_getter_adaptor<0x453>, &property_getter_adaptor<0x454>, &property_getter_adaptor<0x455>, &property_getter_adaptor<0x456>, &property_getter_adaptor<0x457>, + &property_getter_adaptor<0x458>, &property_getter_adaptor<0x459>, &property_getter_adaptor<0x45a>, &property_getter_adaptor<0x45b>, &property_getter_adaptor<0x45c>, &property_getter_adaptor<0x45d>, &property_getter_adaptor<0x45e>, &property_getter_adaptor<0x45f>, + &property_getter_adaptor<0x460>, &property_getter_adaptor<0x461>, &property_getter_adaptor<0x462>, &property_getter_adaptor<0x463>, &property_getter_adaptor<0x464>, &property_getter_adaptor<0x465>, &property_getter_adaptor<0x466>, &property_getter_adaptor<0x467>, + &property_getter_adaptor<0x468>, &property_getter_adaptor<0x469>, &property_getter_adaptor<0x46a>, &property_getter_adaptor<0x46b>, &property_getter_adaptor<0x46c>, &property_getter_adaptor<0x46d>, &property_getter_adaptor<0x46e>, &property_getter_adaptor<0x46f>, + &property_getter_adaptor<0x470>, &property_getter_adaptor<0x471>, &property_getter_adaptor<0x472>, &property_getter_adaptor<0x473>, &property_getter_adaptor<0x474>, &property_getter_adaptor<0x475>, &property_getter_adaptor<0x476>, &property_getter_adaptor<0x477>, + &property_getter_adaptor<0x478>, &property_getter_adaptor<0x479>, &property_getter_adaptor<0x47a>, &property_getter_adaptor<0x47b>, &property_getter_adaptor<0x47c>, &property_getter_adaptor<0x47d>, &property_getter_adaptor<0x47e>, &property_getter_adaptor<0x47f>, + &property_getter_adaptor<0x480>, &property_getter_adaptor<0x481>, &property_getter_adaptor<0x482>, &property_getter_adaptor<0x483>, &property_getter_adaptor<0x484>, &property_getter_adaptor<0x485>, &property_getter_adaptor<0x486>, &property_getter_adaptor<0x487>, + &property_getter_adaptor<0x488>, &property_getter_adaptor<0x489>, &property_getter_adaptor<0x48a>, &property_getter_adaptor<0x48b>, &property_getter_adaptor<0x48c>, &property_getter_adaptor<0x48d>, &property_getter_adaptor<0x48e>, &property_getter_adaptor<0x48f>, + &property_getter_adaptor<0x490>, &property_getter_adaptor<0x491>, &property_getter_adaptor<0x492>, &property_getter_adaptor<0x493>, &property_getter_adaptor<0x494>, &property_getter_adaptor<0x495>, &property_getter_adaptor<0x496>, &property_getter_adaptor<0x497>, + &property_getter_adaptor<0x498>, &property_getter_adaptor<0x499>, &property_getter_adaptor<0x49a>, &property_getter_adaptor<0x49b>, &property_getter_adaptor<0x49c>, &property_getter_adaptor<0x49d>, &property_getter_adaptor<0x49e>, &property_getter_adaptor<0x49f>, + &property_getter_adaptor<0x4a0>, &property_getter_adaptor<0x4a1>, &property_getter_adaptor<0x4a2>, &property_getter_adaptor<0x4a3>, &property_getter_adaptor<0x4a4>, &property_getter_adaptor<0x4a5>, &property_getter_adaptor<0x4a6>, &property_getter_adaptor<0x4a7>, + &property_getter_adaptor<0x4a8>, &property_getter_adaptor<0x4a9>, &property_getter_adaptor<0x4aa>, &property_getter_adaptor<0x4ab>, &property_getter_adaptor<0x4ac>, &property_getter_adaptor<0x4ad>, &property_getter_adaptor<0x4ae>, &property_getter_adaptor<0x4af>, + &property_getter_adaptor<0x4b0>, &property_getter_adaptor<0x4b1>, &property_getter_adaptor<0x4b2>, &property_getter_adaptor<0x4b3>, &property_getter_adaptor<0x4b4>, &property_getter_adaptor<0x4b5>, &property_getter_adaptor<0x4b6>, &property_getter_adaptor<0x4b7>, + &property_getter_adaptor<0x4b8>, &property_getter_adaptor<0x4b9>, &property_getter_adaptor<0x4ba>, &property_getter_adaptor<0x4bb>, &property_getter_adaptor<0x4bc>, &property_getter_adaptor<0x4bd>, &property_getter_adaptor<0x4be>, &property_getter_adaptor<0x4bf>, + &property_getter_adaptor<0x4c0>, &property_getter_adaptor<0x4c1>, &property_getter_adaptor<0x4c2>, &property_getter_adaptor<0x4c3>, &property_getter_adaptor<0x4c4>, &property_getter_adaptor<0x4c5>, &property_getter_adaptor<0x4c6>, &property_getter_adaptor<0x4c7>, + &property_getter_adaptor<0x4c8>, &property_getter_adaptor<0x4c9>, &property_getter_adaptor<0x4ca>, &property_getter_adaptor<0x4cb>, &property_getter_adaptor<0x4cc>, &property_getter_adaptor<0x4cd>, &property_getter_adaptor<0x4ce>, &property_getter_adaptor<0x4cf>, + &property_getter_adaptor<0x4d0>, &property_getter_adaptor<0x4d1>, &property_getter_adaptor<0x4d2>, &property_getter_adaptor<0x4d3>, &property_getter_adaptor<0x4d4>, &property_getter_adaptor<0x4d5>, &property_getter_adaptor<0x4d6>, &property_getter_adaptor<0x4d7>, + &property_getter_adaptor<0x4d8>, &property_getter_adaptor<0x4d9>, &property_getter_adaptor<0x4da>, &property_getter_adaptor<0x4db>, &property_getter_adaptor<0x4dc>, &property_getter_adaptor<0x4dd>, &property_getter_adaptor<0x4de>, &property_getter_adaptor<0x4df>, + &property_getter_adaptor<0x4e0>, &property_getter_adaptor<0x4e1>, &property_getter_adaptor<0x4e2>, &property_getter_adaptor<0x4e3>, &property_getter_adaptor<0x4e4>, &property_getter_adaptor<0x4e5>, &property_getter_adaptor<0x4e6>, &property_getter_adaptor<0x4e7>, + &property_getter_adaptor<0x4e8>, &property_getter_adaptor<0x4e9>, &property_getter_adaptor<0x4ea>, &property_getter_adaptor<0x4eb>, &property_getter_adaptor<0x4ec>, &property_getter_adaptor<0x4ed>, &property_getter_adaptor<0x4ee>, &property_getter_adaptor<0x4ef>, + &property_getter_adaptor<0x4f0>, &property_getter_adaptor<0x4f1>, &property_getter_adaptor<0x4f2>, &property_getter_adaptor<0x4f3>, &property_getter_adaptor<0x4f4>, &property_getter_adaptor<0x4f5>, &property_getter_adaptor<0x4f6>, &property_getter_adaptor<0x4f7>, + &property_getter_adaptor<0x4f8>, &property_getter_adaptor<0x4f9>, &property_getter_adaptor<0x4fa>, &property_getter_adaptor<0x4fb>, &property_getter_adaptor<0x4fc>, &property_getter_adaptor<0x4fd>, &property_getter_adaptor<0x4fe>, &property_getter_adaptor<0x4ff>, }; py_func_ptr_t get_property_getter_adaptor (int n) @@ -1492,6 +1524,38 @@ static py_func_ptr_t property_setter_adaptors [] = &property_setter_adaptor<0x3e8>, &property_setter_adaptor<0x3e9>, &property_setter_adaptor<0x3ea>, &property_setter_adaptor<0x3eb>, &property_setter_adaptor<0x3ec>, &property_setter_adaptor<0x3ed>, &property_setter_adaptor<0x3ee>, &property_setter_adaptor<0x3ef>, &property_setter_adaptor<0x3f0>, &property_setter_adaptor<0x3f1>, &property_setter_adaptor<0x3f2>, &property_setter_adaptor<0x3f3>, &property_setter_adaptor<0x3f4>, &property_setter_adaptor<0x3f5>, &property_setter_adaptor<0x3f6>, &property_setter_adaptor<0x3f7>, &property_setter_adaptor<0x3f8>, &property_setter_adaptor<0x3f9>, &property_setter_adaptor<0x3fa>, &property_setter_adaptor<0x3fb>, &property_setter_adaptor<0x3fc>, &property_setter_adaptor<0x3fd>, &property_setter_adaptor<0x3fe>, &property_setter_adaptor<0x3ff>, + &property_setter_adaptor<0x400>, &property_setter_adaptor<0x401>, &property_setter_adaptor<0x402>, &property_setter_adaptor<0x403>, &property_setter_adaptor<0x404>, &property_setter_adaptor<0x405>, &property_setter_adaptor<0x406>, &property_setter_adaptor<0x407>, + &property_setter_adaptor<0x408>, &property_setter_adaptor<0x409>, &property_setter_adaptor<0x40a>, &property_setter_adaptor<0x40b>, &property_setter_adaptor<0x40c>, &property_setter_adaptor<0x40d>, &property_setter_adaptor<0x40e>, &property_setter_adaptor<0x40f>, + &property_setter_adaptor<0x410>, &property_setter_adaptor<0x411>, &property_setter_adaptor<0x412>, &property_setter_adaptor<0x413>, &property_setter_adaptor<0x414>, &property_setter_adaptor<0x415>, &property_setter_adaptor<0x416>, &property_setter_adaptor<0x417>, + &property_setter_adaptor<0x418>, &property_setter_adaptor<0x419>, &property_setter_adaptor<0x41a>, &property_setter_adaptor<0x41b>, &property_setter_adaptor<0x41c>, &property_setter_adaptor<0x41d>, &property_setter_adaptor<0x41e>, &property_setter_adaptor<0x41f>, + &property_setter_adaptor<0x420>, &property_setter_adaptor<0x421>, &property_setter_adaptor<0x422>, &property_setter_adaptor<0x423>, &property_setter_adaptor<0x424>, &property_setter_adaptor<0x425>, &property_setter_adaptor<0x426>, &property_setter_adaptor<0x427>, + &property_setter_adaptor<0x428>, &property_setter_adaptor<0x429>, &property_setter_adaptor<0x42a>, &property_setter_adaptor<0x42b>, &property_setter_adaptor<0x42c>, &property_setter_adaptor<0x42d>, &property_setter_adaptor<0x42e>, &property_setter_adaptor<0x42f>, + &property_setter_adaptor<0x430>, &property_setter_adaptor<0x431>, &property_setter_adaptor<0x432>, &property_setter_adaptor<0x433>, &property_setter_adaptor<0x434>, &property_setter_adaptor<0x435>, &property_setter_adaptor<0x436>, &property_setter_adaptor<0x437>, + &property_setter_adaptor<0x438>, &property_setter_adaptor<0x439>, &property_setter_adaptor<0x43a>, &property_setter_adaptor<0x43b>, &property_setter_adaptor<0x43c>, &property_setter_adaptor<0x43d>, &property_setter_adaptor<0x43e>, &property_setter_adaptor<0x43f>, + &property_setter_adaptor<0x440>, &property_setter_adaptor<0x441>, &property_setter_adaptor<0x442>, &property_setter_adaptor<0x443>, &property_setter_adaptor<0x444>, &property_setter_adaptor<0x445>, &property_setter_adaptor<0x446>, &property_setter_adaptor<0x447>, + &property_setter_adaptor<0x448>, &property_setter_adaptor<0x449>, &property_setter_adaptor<0x44a>, &property_setter_adaptor<0x44b>, &property_setter_adaptor<0x44c>, &property_setter_adaptor<0x44d>, &property_setter_adaptor<0x44e>, &property_setter_adaptor<0x44f>, + &property_setter_adaptor<0x450>, &property_setter_adaptor<0x451>, &property_setter_adaptor<0x452>, &property_setter_adaptor<0x453>, &property_setter_adaptor<0x454>, &property_setter_adaptor<0x455>, &property_setter_adaptor<0x456>, &property_setter_adaptor<0x457>, + &property_setter_adaptor<0x458>, &property_setter_adaptor<0x459>, &property_setter_adaptor<0x45a>, &property_setter_adaptor<0x45b>, &property_setter_adaptor<0x45c>, &property_setter_adaptor<0x45d>, &property_setter_adaptor<0x45e>, &property_setter_adaptor<0x45f>, + &property_setter_adaptor<0x460>, &property_setter_adaptor<0x461>, &property_setter_adaptor<0x462>, &property_setter_adaptor<0x463>, &property_setter_adaptor<0x464>, &property_setter_adaptor<0x465>, &property_setter_adaptor<0x466>, &property_setter_adaptor<0x467>, + &property_setter_adaptor<0x468>, &property_setter_adaptor<0x469>, &property_setter_adaptor<0x46a>, &property_setter_adaptor<0x46b>, &property_setter_adaptor<0x46c>, &property_setter_adaptor<0x46d>, &property_setter_adaptor<0x46e>, &property_setter_adaptor<0x46f>, + &property_setter_adaptor<0x470>, &property_setter_adaptor<0x471>, &property_setter_adaptor<0x472>, &property_setter_adaptor<0x473>, &property_setter_adaptor<0x474>, &property_setter_adaptor<0x475>, &property_setter_adaptor<0x476>, &property_setter_adaptor<0x477>, + &property_setter_adaptor<0x478>, &property_setter_adaptor<0x479>, &property_setter_adaptor<0x47a>, &property_setter_adaptor<0x47b>, &property_setter_adaptor<0x47c>, &property_setter_adaptor<0x47d>, &property_setter_adaptor<0x47e>, &property_setter_adaptor<0x47f>, + &property_setter_adaptor<0x480>, &property_setter_adaptor<0x481>, &property_setter_adaptor<0x482>, &property_setter_adaptor<0x483>, &property_setter_adaptor<0x484>, &property_setter_adaptor<0x485>, &property_setter_adaptor<0x486>, &property_setter_adaptor<0x487>, + &property_setter_adaptor<0x488>, &property_setter_adaptor<0x489>, &property_setter_adaptor<0x48a>, &property_setter_adaptor<0x48b>, &property_setter_adaptor<0x48c>, &property_setter_adaptor<0x48d>, &property_setter_adaptor<0x48e>, &property_setter_adaptor<0x48f>, + &property_setter_adaptor<0x490>, &property_setter_adaptor<0x491>, &property_setter_adaptor<0x492>, &property_setter_adaptor<0x493>, &property_setter_adaptor<0x494>, &property_setter_adaptor<0x495>, &property_setter_adaptor<0x496>, &property_setter_adaptor<0x497>, + &property_setter_adaptor<0x498>, &property_setter_adaptor<0x499>, &property_setter_adaptor<0x49a>, &property_setter_adaptor<0x49b>, &property_setter_adaptor<0x49c>, &property_setter_adaptor<0x49d>, &property_setter_adaptor<0x49e>, &property_setter_adaptor<0x49f>, + &property_setter_adaptor<0x4a0>, &property_setter_adaptor<0x4a1>, &property_setter_adaptor<0x4a2>, &property_setter_adaptor<0x4a3>, &property_setter_adaptor<0x4a4>, &property_setter_adaptor<0x4a5>, &property_setter_adaptor<0x4a6>, &property_setter_adaptor<0x4a7>, + &property_setter_adaptor<0x4a8>, &property_setter_adaptor<0x4a9>, &property_setter_adaptor<0x4aa>, &property_setter_adaptor<0x4ab>, &property_setter_adaptor<0x4ac>, &property_setter_adaptor<0x4ad>, &property_setter_adaptor<0x4ae>, &property_setter_adaptor<0x4af>, + &property_setter_adaptor<0x4b0>, &property_setter_adaptor<0x4b1>, &property_setter_adaptor<0x4b2>, &property_setter_adaptor<0x4b3>, &property_setter_adaptor<0x4b4>, &property_setter_adaptor<0x4b5>, &property_setter_adaptor<0x4b6>, &property_setter_adaptor<0x4b7>, + &property_setter_adaptor<0x4b8>, &property_setter_adaptor<0x4b9>, &property_setter_adaptor<0x4ba>, &property_setter_adaptor<0x4bb>, &property_setter_adaptor<0x4bc>, &property_setter_adaptor<0x4bd>, &property_setter_adaptor<0x4be>, &property_setter_adaptor<0x4bf>, + &property_setter_adaptor<0x4c0>, &property_setter_adaptor<0x4c1>, &property_setter_adaptor<0x4c2>, &property_setter_adaptor<0x4c3>, &property_setter_adaptor<0x4c4>, &property_setter_adaptor<0x4c5>, &property_setter_adaptor<0x4c6>, &property_setter_adaptor<0x4c7>, + &property_setter_adaptor<0x4c8>, &property_setter_adaptor<0x4c9>, &property_setter_adaptor<0x4ca>, &property_setter_adaptor<0x4cb>, &property_setter_adaptor<0x4cc>, &property_setter_adaptor<0x4cd>, &property_setter_adaptor<0x4ce>, &property_setter_adaptor<0x4cf>, + &property_setter_adaptor<0x4d0>, &property_setter_adaptor<0x4d1>, &property_setter_adaptor<0x4d2>, &property_setter_adaptor<0x4d3>, &property_setter_adaptor<0x4d4>, &property_setter_adaptor<0x4d5>, &property_setter_adaptor<0x4d6>, &property_setter_adaptor<0x4d7>, + &property_setter_adaptor<0x4d8>, &property_setter_adaptor<0x4d9>, &property_setter_adaptor<0x4da>, &property_setter_adaptor<0x4db>, &property_setter_adaptor<0x4dc>, &property_setter_adaptor<0x4dd>, &property_setter_adaptor<0x4de>, &property_setter_adaptor<0x4df>, + &property_setter_adaptor<0x4e0>, &property_setter_adaptor<0x4e1>, &property_setter_adaptor<0x4e2>, &property_setter_adaptor<0x4e3>, &property_setter_adaptor<0x4e4>, &property_setter_adaptor<0x4e5>, &property_setter_adaptor<0x4e6>, &property_setter_adaptor<0x4e7>, + &property_setter_adaptor<0x4e8>, &property_setter_adaptor<0x4e9>, &property_setter_adaptor<0x4ea>, &property_setter_adaptor<0x4eb>, &property_setter_adaptor<0x4ec>, &property_setter_adaptor<0x4ed>, &property_setter_adaptor<0x4ee>, &property_setter_adaptor<0x4ef>, + &property_setter_adaptor<0x4f0>, &property_setter_adaptor<0x4f1>, &property_setter_adaptor<0x4f2>, &property_setter_adaptor<0x4f3>, &property_setter_adaptor<0x4f4>, &property_setter_adaptor<0x4f5>, &property_setter_adaptor<0x4f6>, &property_setter_adaptor<0x4f7>, + &property_setter_adaptor<0x4f8>, &property_setter_adaptor<0x4f9>, &property_setter_adaptor<0x4fa>, &property_setter_adaptor<0x4fb>, &property_setter_adaptor<0x4fc>, &property_setter_adaptor<0x4fd>, &property_setter_adaptor<0x4fe>, &property_setter_adaptor<0x4ff>, }; py_func_ptr_t get_property_setter_adaptor (int n) diff --git a/src/pya/pya/pyaInternal.cc b/src/pya/pya/pyaInternal.cc index ea6703623..367f486ec 100644 --- a/src/pya/pya/pyaInternal.cc +++ b/src/pya/pya/pyaInternal.cc @@ -539,7 +539,7 @@ MethodTable::add_setter (const std::string &name, const gsi::MethodBase *setter) std::string new_name = name + "_"; add_setter_basic (new_name, setter); - mp_module->add_python_doc (setter, tl::sprintf (tl::to_string (tr ("This attribute setter is available as '%s' in Python")), new_name)); + mp_module->add_python_doc (setter, tl::sprintf (tl::to_string (tr ("This member is available as '%s' in Python")), new_name)); } else { add_setter_basic (name, setter); @@ -573,7 +573,7 @@ MethodTable::add_getter (const std::string &name, const gsi::MethodBase *getter) std::string new_name = name + "_"; add_getter_basic (new_name, getter); - mp_module->add_python_doc (getter, tl::sprintf (tl::to_string (tr ("This attribute getter is available as '%s' in Python")), new_name)); + mp_module->add_python_doc (getter, tl::sprintf (tl::to_string (tr ("This member is available as '%s' in Python")), new_name)); } else { add_getter_basic (name, getter); @@ -719,9 +719,6 @@ MethodTable::finish () // disable methods which are also present as properties if (m_property_name_map.find (std::make_pair (m->is_static (), m->name ())) != m_property_name_map.end ()) { m->set_enabled (false); - for (auto i = m->begin (); i != m->end (); ++i) { - mp_module->add_python_doc (*i, tl::to_string (tr ("This method is not available for Python"))); - } } } } diff --git a/src/pya/pya/pyaModule.cc b/src/pya/pya/pyaModule.cc index d88ebd126..39a8a1a09 100644 --- a/src/pya/pya/pyaModule.cc +++ b/src/pya/pya/pyaModule.cc @@ -191,16 +191,16 @@ void PythonModule::add_python_doc (const gsi::ClassBase & /*cls*/, const MethodTable *mt, int mid, const std::string &doc) { for (MethodTableEntry::method_iterator m = mt->begin (mid); m != mt->end (mid); ++m) { - std::string &doc_string = m_python_doc [*m]; - doc_string += doc; - doc_string += "\n\n"; + add_python_doc (*m, doc); } } void PythonModule::add_python_doc (const gsi::MethodBase *m, const std::string &doc) { - m_python_doc [m] += doc; + std::string &doc_string = m_python_doc [m]; + doc_string += doc; + doc_string += ".\n\n"; } std::string @@ -394,7 +394,7 @@ public: doc += "\n\n"; } doc += (*m)->doc (); - mp_module->add_python_doc (*m, tl::sprintf (tl::to_string (tr ("The object exposes a readable attribute '%s'. This is the getter.\n\n")), name)); + mp_module->add_python_doc (*m, tl::sprintf (tl::to_string (tr ("The object exposes a readable attribute '%s'. This is the getter")), name)); } for (MethodTableEntry::method_iterator m = begin_setters; m != end_setters; ++m) { @@ -402,7 +402,7 @@ public: doc += "\n\n"; } doc += (*m)->doc (); - mp_module->add_python_doc (*m, tl::sprintf (tl::to_string (tr ("The object exposes a writable attribute '%s'. This is the setter.\n\n")), name)); + mp_module->add_python_doc (*m, tl::sprintf (tl::to_string (tr ("The object exposes a writable attribute '%s'. This is the setter")), name)); } PythonRef attr; From 2b60e2f6e9d813801a56d451a38e017e5ffa6fd4 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 24 Oct 2022 21:06:03 +0200 Subject: [PATCH 12/15] Preventing overriding of getters by is_.. predicates --- src/pya/pya/pyaInternal.cc | 28 +++++++++++---- src/pymod/distutils_src/klayout/dbcore.pyi | 41 +++++++++++++--------- 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/src/pya/pya/pyaInternal.cc b/src/pya/pya/pyaInternal.cc index 367f486ec..35413acaa 100644 --- a/src/pya/pya/pyaInternal.cc +++ b/src/pya/pya/pyaInternal.cc @@ -167,13 +167,6 @@ MethodTable::MethodTable (const gsi::ClassBase *cls_decl, PythonModule *module) // static methods without arguments which start with a capital letter are treated as constants add_getter (syn->name, *m); } else { - if (syn->is_predicate && std::string (syn->name, 0, 3) == "is_") { - std::string n = std::string (syn->name, 3, std::string::npos); - if (is_property_setter (st, n) && ! is_property_getter (st, n)) { - // synthesize a getter from is_...? predicates (e.g. is_empty? -> empty getter) - add_getter (n, *m); - } - } add_method (syn->name, *m); } } @@ -181,6 +174,27 @@ MethodTable::MethodTable (const gsi::ClassBase *cls_decl, PythonModule *module) } } + + // synthesize a getter from is_...? predicates (e.g. is_empty? -> empty getter) + for (gsi::ClassBase::method_iterator m = cls_decl->begin_methods (); m != cls_decl->end_methods (); ++m) { + + if (! (*m)->is_callback () && ! (*m)->is_signal ()) { + + bool st = (*m)->is_static (); + bool no_args = ((*m)->end_arguments () == (*m)->begin_arguments ()); + + for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) { + if (no_args && ! syn->is_getter && ! syn->is_setter && syn->is_predicate && std::string (syn->name, 0, 3) == "is_") { + std::string n = std::string (syn->name, 3, std::string::npos); + if (is_property_setter (st, n) && ! is_property_getter (st, n)) { + add_getter (n, *m); + } + } + } + + } + + } } size_t diff --git a/src/pymod/distutils_src/klayout/dbcore.pyi b/src/pymod/distutils_src/klayout/dbcore.pyi index 7bd9ae59b..b540711c7 100644 --- a/src/pymod/distutils_src/klayout/dbcore.pyi +++ b/src/pymod/distutils_src/klayout/dbcore.pyi @@ -27898,11 +27898,12 @@ class Shape: TUserObject: ClassVar[int] r""" """ - box: bool + box: Any r""" Getter: - @brief Returns true if the shape is a box + @brief Gets the box object + Starting with version 0.23, this method returns nil, if the shape does not represent a box. Setter: @brief Replaces the shape by the given box (in micrometer units) This method replaces the shape by the given box, like \box= with a \Box argument does. This version translates the box from micrometer units to database units internally. @@ -28194,21 +28195,22 @@ class Shape: This method has been introduced in version 0.25. """ - edge: bool + edge: Any r""" Getter: - @brief Returns true, if the object is an edge + @brief Returns the edge object + Starting with version 0.23, this method returns nil, if the shape does not represent an edge. Setter: @brief Replaces the shape by the given edge (in micrometer units) This method replaces the shape by the given edge, like \edge= with a \Edge argument does. This version translates the edge from micrometer units to database units internally. This method has been introduced in version 0.25. """ - edge_pair: bool + edge_pair: Any r""" Getter: - @brief Returns true, if the object is an edge pair + @brief Returns the edge pair object This method has been introduced in version 0.26. Setter: @@ -28244,11 +28246,12 @@ class Shape: This method has been added in version 0.23. """ - path: bool + path: Any r""" Getter: - @brief Returns true, if the shape is a path + @brief Returns the path object + Starting with version 0.23, this method returns nil, if the shape does not represent a path. Setter: @brief Replaces the shape by the given path object This method replaces the shape by the given path object. This method can only be called for editable layouts. It does not change the user properties of the shape. @@ -28338,12 +28341,15 @@ class Shape: This method has been introduced in version 0.23. """ - polygon: bool + polygon: Any r""" Getter: - @brief Returns true, if the shape is a polygon + @brief Returns the polygon object + + Returns the polygon object that this shape refers to or converts the object to a polygon. Paths, boxes and simple polygons are converted to polygons. For paths this operation renders the path's hull contour. + + Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a polygon. - This method returns true only if the object is a polygon or a simple polygon. Other objects can convert to polygons, for example paths, so it may be possible to use the \polygon method also if is_polygon? does not return true. Setter: @brief Replaces the shape by the given polygon object This method replaces the shape by the given polygon object. This method can only be called for editable layouts. It does not change the user properties of the shape. @@ -28379,12 +28385,14 @@ class Shape: This method has been introduced in version 0.23. """ - simple_polygon: bool + simple_polygon: Any r""" Getter: - @brief Returns true, if the shape is a simple polygon + @brief Returns the simple polygon object + + Returns the simple polygon object that this shape refers to or converts the object to a simple polygon. Paths, boxes and polygons are converted to simple polygons. Polygons with holes will have their holes removed but introducing cut lines that connect the hole contours with the outer contour. + Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a simple polygon. - This method returns true only if the object is a simple polygon. The simple polygon identity is contained in the polygon identity, so usually it is sufficient to use \is_polygon? and \polygon instead of specifically handle simply polygons. This method is provided only for specific optimisation purposes. Setter: @brief Replaces the shape by the given simple polygon object This method replaces the shape by the given simple polygon object. This method can only be called for editable layouts. It does not change the user properties of the shape. @@ -28392,11 +28400,12 @@ class Shape: This method has been introduced in version 0.22. """ - text: bool + text: Any r""" Getter: - @brief Returns true, if the object is a text + @brief Returns the text object + Starting with version 0.23, this method returns nil, if the shape does not represent a text. Setter: @brief Replaces the shape by the given text object This method replaces the shape by the given text object. This method can only be called for editable layouts. It does not change the user properties of the shape. From a72888e3310cabf1b8ea37360614e8be33e7587b Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 24 Oct 2022 22:03:31 +0200 Subject: [PATCH 13/15] Enabling polymorphic re-throw, hence supporting TypeError --- src/pya/pya/pyaCallables.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pya/pya/pyaCallables.cc b/src/pya/pya/pyaCallables.cc index 472f2c68b..1ac8f47fd 100644 --- a/src/pya/pya/pyaCallables.cc +++ b/src/pya/pya/pyaCallables.cc @@ -614,7 +614,7 @@ push_args (gsi::SerialArgs &arglist, const gsi::MethodBase *meth, PyObject *args } ex.set_basic_msg (msg); - throw ex; + throw; } catch (...) { From 0262926b1193db04d2ec0ede6fd31f3abd5d8c6a Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 26 Oct 2022 10:40:20 +0200 Subject: [PATCH 14/15] Moved __deepcopy__ implementation and NotImplemented fallback from db.__init__ to C++ implementation for better performance and generalization. Added tests --- src/pya/pya/pyaCallables.cc | 32 +++++++- src/pya/pya/pyaCallables.h | 1 + src/pya/pya/pyaInternal.cc | 76 +++++++++++++++++-- src/pya/pya/pyaInternal.h | 16 +++- src/pya/pya/pyaModule.cc | 5 +- src/pya/pya/pyaUtils.h | 2 + .../distutils_src/klayout/db/__init__.py | 59 -------------- testdata/pymod/import_db.py | 13 ---- testdata/python/basic.py | 31 ++++++++ 9 files changed, 154 insertions(+), 81 deletions(-) diff --git a/src/pya/pya/pyaCallables.cc b/src/pya/pya/pyaCallables.cc index 1ac8f47fd..c0a782904 100644 --- a/src/pya/pya/pyaCallables.cc +++ b/src/pya/pya/pyaCallables.cc @@ -321,10 +321,20 @@ match_method (int mid, PyObject *self, PyObject *args, bool strict) } + } else if (meth && mt->fallback_not_implemented (mid)) { + + // one candidate, but needs checking whether compatibility is given - this avoid having to route NotImplemented over TypeError exceptions later + int i = 0; + for (gsi::MethodBase::argument_iterator a = meth->begin_arguments (); i < argc && a != meth->end_arguments (); ++a, ++i) { + if (! test_arg (*a, PyTuple_GetItem (args, i), true /*loose*/)) { + return 0; + } + } + } if (! meth) { - if (! strict) { + if (! strict || mt->fallback_not_implemented (mid)) { return 0; } else { throw tl::TypeError (tl::to_string (tr ("No overload with matching arguments"))); @@ -332,7 +342,7 @@ match_method (int mid, PyObject *self, PyObject *args, bool strict) } if (candidates > 1) { - if (! strict) { + if (! strict || mt->fallback_not_implemented (mid)) { return 0; } else { throw tl::TypeError (tl::to_string (tr ("Ambiguous overload variants - multiple method declarations match arguments"))); @@ -398,6 +408,19 @@ object_assign (PyObject *self, PyObject *args) return self; } +/** + * @brief Default implementation of "__deepcopy__" + */ +PyObject * +object_default_deepcopy_impl (PyObject *self, PyObject * /*args*/) +{ + PyObject *copy_method = PyObject_GetAttrString (self, "__copy__"); + tl_assert (copy_method != NULL); + + PythonRef empty_args (PyTuple_New (0)); + return PyObject_Call (copy_method, empty_args.get (), NULL); +} + /** * @brief Default implementation of "__ne__" */ @@ -638,6 +661,11 @@ method_adaptor (int mid, PyObject *self, PyObject *args) const gsi::MethodBase *meth = match_method (mid, self, args, true); + // method is not implemented + if (! meth) { + Py_RETURN_NOTIMPLEMENTED; + } + // handle special methods if (meth->smt () != gsi::MethodBase::None) { diff --git a/src/pya/pya/pyaCallables.h b/src/pya/pya/pyaCallables.h index b5dd11983..f6188b4fe 100644 --- a/src/pya/pya/pyaCallables.h +++ b/src/pya/pya/pyaCallables.h @@ -37,6 +37,7 @@ PyObject *object_default_ne_impl (PyObject *self, PyObject *args); PyObject *object_default_ge_impl (PyObject *self, PyObject *args); PyObject *object_default_le_impl (PyObject *self, PyObject *args); PyObject *object_default_gt_impl (PyObject *self, PyObject *args); +PyObject *object_default_deepcopy_impl (PyObject *self, PyObject *args); typedef PyObject *(*py_func_ptr_t) (PyObject *, PyObject *); diff --git a/src/pya/pya/pyaInternal.cc b/src/pya/pya/pyaInternal.cc index 35413acaa..86a56b443 100644 --- a/src/pya/pya/pyaInternal.cc +++ b/src/pya/pya/pyaInternal.cc @@ -37,7 +37,7 @@ namespace pya // MethodTableEntry implementation MethodTableEntry::MethodTableEntry (const std::string &name, bool st, bool prot) - : m_name (name), m_is_static (st), m_is_protected (prot), m_is_enabled (true), m_is_init (false) + : m_name (name), m_is_static (st), m_is_protected (prot), m_is_enabled (true), m_is_init (false), m_fallback_not_implemented (false) { } const std::string & @@ -64,6 +64,18 @@ MethodTableEntry::is_enabled () const return m_is_enabled; } +void +MethodTableEntry::set_fallback_not_implemented (bool f) +{ + m_fallback_not_implemented = f; +} + +bool +MethodTableEntry::fallback_not_implemented () const +{ + return m_fallback_not_implemented; +} + void MethodTableEntry::set_init (bool f) { @@ -424,6 +436,40 @@ static std::string extract_python_name (const std::string &name) } } +/** + * @brief Returns true, if the method with the given name shall fallback to NotImplemented + */ +static bool is_method_with_fallback (const std::string &name) +{ + if (name == "+") { + return true; + } else if (name == "-") { + return true; + } else if (name == "/") { + #if PY_MAJOR_VERSION < 3 + return false; + #else + return true; + #endif + } else if (name == "*") { + return true; + } else if (name == "%") { + return true; + } else if (name == "<<") { + return true; + } else if (name == ">>") { + return true; + } else if (name == "&") { + return true; + } else if (name == "|") { + return true; + } else if (name == "^") { + return true; + } else { + return false; + } +} + void MethodTable::add_method (const std::string &name, const gsi::MethodBase *mb) { @@ -511,11 +557,12 @@ MethodTable::add_method (const std::string &name, const gsi::MethodBase *mb) } else if (name == "dup" && mb->compatible_with_num_args (0)) { // If the object supports the dup method, then it is a good - // idea to define the __copy__ method. + // idea to define the __copy__ and __deepcopy__ method. add_method_basic ("__copy__", mb); + add_method_basic ("__deepcopy__", mb); add_method_basic (name, mb); - mp_module->add_python_doc (mb, tl::to_string (tr ("This method also implements '__copy__'"))); + mp_module->add_python_doc (mb, tl::to_string (tr ("This method also implements '__copy__' and '__deepcopy__'"))); } else { @@ -532,7 +579,8 @@ MethodTable::add_method (const std::string &name, const gsi::MethodBase *mb) } else { - add_method_basic (py_name, mb); + bool fb = is_method_with_fallback (name); + add_method_basic (py_name, mb, true, false, fb); if (name == "*") { // Supply a commutative multiplication version unless the operator is "*!" @@ -625,6 +673,18 @@ MethodTable::set_enabled (size_t mid, bool en) m_table [mid - m_method_offset].set_enabled (en); } +bool +MethodTable::fallback_not_implemented (size_t mid) const +{ + return m_table [mid - m_method_offset].fallback_not_implemented (); +} + +void +MethodTable::set_fallback_not_implemented (size_t mid, bool f) +{ + m_table [mid - m_method_offset].set_fallback_not_implemented (f); +} + bool MethodTable::is_init(size_t mid) const { @@ -743,7 +803,7 @@ MethodTable::finish () } void -MethodTable::add_method_basic (const std::string &name, const gsi::MethodBase *mb, bool enabled, bool init) +MethodTable::add_method_basic (const std::string &name, const gsi::MethodBase *mb, bool enabled, bool init, bool fallback_not_implemented) { bool st = mb->is_static () && ! init; @@ -758,6 +818,9 @@ MethodTable::add_method_basic (const std::string &name, const gsi::MethodBase *m if (init) { m_table.back ().set_init (true); } + if (fallback_not_implemented) { + m_table.back ().set_fallback_not_implemented (true); + } m_table.back ().add (mb); } else { @@ -773,6 +836,9 @@ MethodTable::add_method_basic (const std::string &name, const gsi::MethodBase *m if (init) { tl_assert (m_table [n->second].is_init ()); } + if (fallback_not_implemented) { + m_table.back ().set_fallback_not_implemented (true); + } } } diff --git a/src/pya/pya/pyaInternal.h b/src/pya/pya/pyaInternal.h index 0cbd071ae..4fc5ae3ee 100644 --- a/src/pya/pya/pyaInternal.h +++ b/src/pya/pya/pyaInternal.h @@ -67,6 +67,9 @@ public: void set_enabled (bool en); bool is_enabled () const; + void set_fallback_not_implemented (bool en); + bool fallback_not_implemented () const; + void set_init(bool f); bool is_init () const; @@ -91,6 +94,7 @@ private: bool m_is_protected : 1; bool m_is_enabled : 1; bool m_is_init : 1; + bool m_fallback_not_implemented : 1; std::vector m_methods; }; @@ -169,6 +173,16 @@ public: */ void set_enabled (size_t mid, bool en); + /** + * @brief Returns true if the method has a NotImplemented fallback + */ + bool fallback_not_implemented (size_t mid) const; + + /** + * @brief Sets a value indicating that the method has a fallback to NotImplemented for non-matching arguments + */ + void set_fallback_not_implemented (size_t mid, bool f); + /** * @brief Returns true if the method is an initializer */ @@ -277,7 +291,7 @@ private: std::vector > m_property_table; PythonModule *mp_module; - void add_method_basic (const std::string &name, const gsi::MethodBase *mb, bool enabled = true, bool init = false); + void add_method_basic (const std::string &name, const gsi::MethodBase *mb, bool enabled = true, bool init = false, bool fallback_not_implemented = false); void add_setter_basic (const std::string &name, const gsi::MethodBase *setter); void add_getter_basic (const std::string &name, const gsi::MethodBase *getter); bool is_property_setter (bool st, const std::string &name); diff --git a/src/pya/pya/pyaModule.cc b/src/pya/pya/pyaModule.cc index 39a8a1a09..fa9c1b48c 100644 --- a/src/pya/pya/pyaModule.cc +++ b/src/pya/pya/pyaModule.cc @@ -484,7 +484,10 @@ public: PyMethodDef *method = mp_module->make_method_def (); method->ml_name = mp_module->make_string (name); - if (mt->is_init (mid)) { + if (name == "__deepcopy__") { + // Special handling needed as the memo argument needs to be ignored + method->ml_meth = &object_default_deepcopy_impl; + } else if (mt->is_init (mid)) { method->ml_meth = (PyCFunction) get_method_init_adaptor (mid); } else { method->ml_meth = (PyCFunction) get_method_adaptor (mid); diff --git a/src/pya/pya/pyaUtils.h b/src/pya/pya/pyaUtils.h index 6f1294f72..05f684c86 100644 --- a/src/pya/pya/pyaUtils.h +++ b/src/pya/pya/pyaUtils.h @@ -29,6 +29,8 @@ namespace pya { + + /** * Some helper macros that translate C++ exceptions into Python errors */ diff --git a/src/pymod/distutils_src/klayout/db/__init__.py b/src/pymod/distutils_src/klayout/db/__init__.py index 362acbffd..fee5eb8c9 100644 --- a/src/pymod/distutils_src/klayout/db/__init__.py +++ b/src/pymod/distutils_src/klayout/db/__init__.py @@ -7,65 +7,6 @@ from klayout.db.pcell_declaration_helper import PCellDeclarationHelper __all__ = klayout.dbcore.__all__ + ["PCellDeclarationHelper"] # type: ignore -# Implementing deepcopy of common objects -# Point-like classes -PointLike = (Point, DPoint, DVector, Vector) - - -def pyaPoint__deepcopy__(self, memo): - return self.dup() - - -def convert_type_error_to_not_implemented(cls, method): - """If cls.method exists raises a TypeError, patch it so - it returns a NotImplemented error instead. - - - """ - if not hasattr(cls, method): - return - - old_func = getattr(cls, method) - - @functools.wraps(old_func) - def new_func(*args, **kwargs): - try: - return old_func(*args, **kwargs) - except TypeError: - return NotImplemented - try: - setattr(cls, method, new_func) - except TypeError: - # Some classes are immutable and cannot be changed. - # At the time of writing, this happens to (_StaticAttribute, _AmbiguousMethodDispatcher, _Iterator, _Signal).__or__ - return - -for PClass in PointLike: - PClass.__deepcopy__ = pyaPoint__deepcopy__ # type: ignore - -for cls in klayout.dbcore.__dict__.values(): - if not isinstance(cls, type): # skip if not a class - continue - for method in ( - "__add__", - "__sub__", - "__mul__", - "__matmul__", - "__truediv__", - "__floordiv__", - "__mod__", - "__divmod__", - "__pow__", - "__lshift__", - "__rshift__", - "__and__", - "__xor__", - "__or__", - ): - # list of methods extracted from https://docs.python.org/3.7/reference/datamodel.html#emulating-numeric-types - convert_type_error_to_not_implemented(cls, method) - - # If class has from_s, to_s, and assign, use them to # enable serialization. for name, cls in klayout.dbcore.__dict__.items(): diff --git a/testdata/pymod/import_db.py b/testdata/pymod/import_db.py index aa88e8221..d16f131aa 100755 --- a/testdata/pymod/import_db.py +++ b/testdata/pymod/import_db.py @@ -41,19 +41,6 @@ class BasicTest(unittest.TestCase): v.read(os.path.join(os.path.dirname(__file__), "..", "gds", "t10.gds")) self.assertEqual(v.top_cell().name, "RINGO") - def test_4(self): - class RMulObject: - def __init__(self, factor): - self.factor = factor - def __rmul__(self, point): - return point * self.factor - def __radd__(self, point): - return point + db.Vector(1,1) * self.factor - - p = db.Point(1, 0) - fac2 = RMulObject(2) - self.assertEqual(p * 2, p * fac2) # p.__mul__(fac2) should return NotImplemented, which will call fac2.__rmul__(p) - self.assertEqual(db.Point(3,2), p + fac2) # run unit tests if __name__ == '__main__': suite = unittest.TestSuite() diff --git a/testdata/python/basic.py b/testdata/python/basic.py index 4c524342f..7595babdc 100644 --- a/testdata/python/basic.py +++ b/testdata/python/basic.py @@ -21,6 +21,7 @@ import unittest import os import sys import gc +import copy # Set this to True to disable some tests involving exceptions leak_check = "TEST_LEAK_CHECK" in os.environ @@ -3073,6 +3074,36 @@ class BasicTest(unittest.TestCase): go = None self.assertEqual(pya.GObject.g_inst_count(), gc) + # fallback to __rmul__ for not implemented __mul__ + + def test_90(self): + class RMulObject: + def __init__(self, factor): + self.factor = factor + def __rmul__(self, point): + return point * self.factor + def __radd__(self, point): + return point + pya.Vector(1,1) * self.factor + + p = pya.Point(1, 0) + fac2 = RMulObject(2) + self.assertEqual(p * 2, p * fac2) # p.__mul__(fac2) should return NotImplemented, which will call fac2.__rmul__(p) + self.assertEqual(pya.Point(3,2), p + fac2) + + # copy and deepcopy + + def test_91(self): + + p = pya.Point(1, 0) + pc = copy.copy(p) + pdc = copy.deepcopy(p) + + pdc.x = 4 + pc.x = 3 + p.x = 2 + self.assertEqual(p.x, 2) + self.assertEqual(pc.x, 3) + self.assertEqual(pdc.x, 4) # run unit tests if __name__ == '__main__': From 6e2055b5556979b6853fd168e5959b68cfeab01e Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 26 Oct 2022 17:02:29 +0200 Subject: [PATCH 15/15] Removed original doc for type hints --- src/pymod/typehint_stubs.md | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 src/pymod/typehint_stubs.md diff --git a/src/pymod/typehint_stubs.md b/src/pymod/typehint_stubs.md deleted file mode 100644 index 4456a7672..000000000 --- a/src/pymod/typehint_stubs.md +++ /dev/null @@ -1,24 +0,0 @@ -Author: Thomas Ferreira de Lima -email: thomas@tlima.me - -## Notes -To use the stubgen script for the three main modules, run the following from the root folder of the repository: -`$ python ./src/pymod/stubgen.py db >! src/pymod/distutils_src/klayout/dbcore.pyi` -`$ python ./src/pymod/stubgen.py rdb >! src/pymod/distutils_src/klayout/rdbcore.pyi` -`$ python ./src/pymod/stubgen.py tl >! src/pymod/distutils_src/klayout/tlcore.pyi` - -To compare the generated stubs with a python self-inspection of the klayout module, try the following: -Navigate to `./src/pymod/distutils_src`. -Run, for example: -`$ stubtest klayout.tlcore` - -TODO: -- [ ] Integrate above scripts with CI -## Old notes -CHECKLIST: -- [x] 1. Use klayout.tl to inspect all classes and methods in pya. -- [x] 2. Figure out last few bugs. - - DPoint has a method with "=" when it should have been "*=". There must be an issue with the gsiDeclInternal algorithms. - - Some inner classes, e.g. LogicalOp inside CompoundRegionOperationNode are not returning -- [x] 3. Manually check and compare to mypy's output. - - Looks good, but there are a few discrepancies between actual python module and stubs. Namely, deprecated methods were not included in the stub. The opposite is sometimes true as well, though for newer, experimental classes e.g. `klayout.dbcore.GenericDeviceCombiner.combine_devices`. \ No newline at end of file