mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-08 00:41:36 +00:00
Compare commits
113 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 16566f1766 | |||
| e01979187a | |||
| 816eba5145 | |||
| 4963bddd06 | |||
| 8718db63da | |||
| c013b9aca7 | |||
| 24e454ce0c | |||
| cb497b37f7 | |||
| 71c6950a59 | |||
| 5a8aa0a659 | |||
| f4526d152f | |||
| a7a7edfd27 | |||
| 6ca8c8ac94 | |||
| 5273569b08 | |||
| 78712ead98 | |||
| 6efb8a4373 | |||
| 9e25c12b16 | |||
| 0968d06780 | |||
| 3a8619726b | |||
| 1b1da821f1 | |||
| d772b24bd6 | |||
| 549f81a76e | |||
| e5c7206a37 | |||
| 5b968d5c75 | |||
| 6075187720 | |||
| 92528d84cd | |||
| 3955718145 | |||
| 501246cd0b | |||
| 1b863ff8be | |||
| dcd88b6cdd | |||
| fb8b2ee878 | |||
| 8a00ce84cc | |||
| 4032bbbd17 | |||
| d728f09d86 | |||
| 3e9ef82448 | |||
| a5c77fd096 | |||
| 56ed79792e | |||
| 9c91727402 | |||
| d183961280 | |||
| d30c25010c | |||
| 97d1a6e488 | |||
| 06d8b738e2 | |||
| 4d8633d40d | |||
| d6218307a9 | |||
| 1e7affa797 | |||
| bb54b33594 | |||
| 73f31477d5 | |||
| adf2b99569 | |||
| 815699f64b | |||
| ba629e9615 | |||
| 1f102bfd83 | |||
| 3700e2fdce | |||
| a31d3623bb | |||
| f898d19679 | |||
| 3a8bc04fc0 | |||
| 3377cb7225 | |||
| 43d34e6ca3 | |||
| d3e7fab7d5 | |||
| 6eee66a3cf | |||
| 89933d18bc | |||
| 8bfb039e36 | |||
| cbd7b58bf6 | |||
| 01252d9087 | |||
| aab8ed4f40 | |||
| 059d736e89 | |||
| 9c791d4a68 | |||
| 1542ab4afc | |||
| 43e87090e1 | |||
| 225b81c37e | |||
| b00714132d | |||
| c7cde331e9 | |||
| 5aca9ca67e | |||
| 997f03fe63 | |||
| c5d6d535d2 | |||
| eb2e4a44ee | |||
| d5e141b773 | |||
| 1e8aa0b7b8 | |||
| feffe88613 | |||
| 967dee0369 | |||
| b4e48cf300 | |||
| eb842a7f44 | |||
| 321f9dc099 | |||
| b12e807571 | |||
| e837a1b5e4 | |||
| 1986f4e3df | |||
| 69d62a66a0 | |||
| 95defa5657 | |||
| 4559fa8466 | |||
| 82a58d4554 | |||
| 352f2bf794 | |||
| 981d503b9d | |||
| 9fbd24ffb4 | |||
| 4aedeb71fd | |||
| 55c2deea37 | |||
| 6f871fb13b | |||
| 737097312e | |||
| 7f8ce5d44f | |||
| 451a9a74cf | |||
| 885844925e | |||
| 35e05a382d | |||
| bf6a71cda0 | |||
| 4bc8efd354 | |||
| cf08550d7e | |||
| 0a45bda8e4 | |||
| c750bd63e9 | |||
| 6c4189436d | |||
| ae51f08c6d | |||
| b0a7273e37 | |||
| ba2f48e210 | |||
| 3add345bb7 | |||
| 11daabc3ea | |||
| 7537435001 | |||
| a9af9341b9 |
@@ -109,7 +109,7 @@ jobs:
|
||||
# Ensure Bonsai and ifcsverchok enable/disable works before uploading to extensions repo.
|
||||
|
||||
# Download Blender.
|
||||
wget -q -O blender.tar.xz https://download.blender.org/release/Blender5.1/blender-5.1.0-linux-x64.tar.xz
|
||||
wget -q -O blender.tar.xz https://download.blender.org/release/Blender5.2/blender-5.2.0-linux-x64.tar.xz
|
||||
tar -xf blender.tar.xz
|
||||
|
||||
# Setup Blender.
|
||||
@@ -179,8 +179,7 @@ jobs:
|
||||
blender --online-mode --command extension install --enable --sync sun_position
|
||||
|
||||
cd IfcOpenShell/src/bonsai
|
||||
pip install pytest-blender
|
||||
pip install pytest-bdd
|
||||
pip install -r requirements-dev.txt
|
||||
blender --background --python scripts/setup_pytest.py
|
||||
blender --python-expr "import bonsai; print(bonsai.bbim_semver); import ifcopenshell; print(ifcopenshell.version)" --background
|
||||
make test
|
||||
|
||||
@@ -27,10 +27,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
uv tool install ruff
|
||||
uv tool install black
|
||||
uv tool install poethepoet
|
||||
uv tool install ty==0.0.34
|
||||
cat requirements-tools.txt | xargs -L1 uv tool install
|
||||
|
||||
# black doesn't catch all syntax errors, so we check them explicitly.
|
||||
- name: Check syntax errors
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
__pycache__
|
||||
*.py.bak
|
||||
venv
|
||||
uv.lock
|
||||
|
||||
# Visual Studio Code files
|
||||
.vscode
|
||||
|
||||
@@ -563,8 +563,8 @@ if(COMPILE_SCHEMA)
|
||||
# Bootstrap the parser
|
||||
message(STATUS "Compiling schema, this will take a while...")
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} bootstrap.py express.bnf
|
||||
WORKING_DIRECTORY ../src/ifcexpressparser
|
||||
COMMAND ${PYTHON_EXECUTABLE} bootstrap.py
|
||||
WORKING_DIRECTORY ../src/ifcopenshell-python/ifcopenshell/express
|
||||
OUTPUT_FILE express_parser.py
|
||||
RESULT_VARIABLE SUCCESS
|
||||
)
|
||||
@@ -575,7 +575,7 @@ if(COMPILE_SCHEMA)
|
||||
|
||||
# Generate code
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} ../ifcexpressparser/express_parser.py ../../${COMPILE_SCHEMA}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ../ifcopenshell-python/ifcopenshell/express/express_parser.py ../../${COMPILE_SCHEMA}
|
||||
WORKING_DIRECTORY ../src/ifcparse
|
||||
OUTPUT_VARIABLE COMPILED_SCHEMA_NAME
|
||||
)
|
||||
|
||||
+15
-5
@@ -50,7 +50,7 @@ Used environment variables:
|
||||
- ``NO_CLEAN`` - do not clean `ifcopenshell` build directories but continue working on current build
|
||||
(installed dependencies are never cleared).
|
||||
By default option is disabled, to enable pass any value from `1`, `on`, `true`.
|
||||
- ``IFCOS_SCHEMAS`` - schemas to be built; defaults to cmake default (IFC2X3; IFC4; IFC4X3_ADD2) - to be supplied as `2x3;4`
|
||||
- ``IFCOS_SCHEMAS`` - schemas to be built; defaults to cmake default (8 schemas), to be supplied as `2x3;4;4x3_add2`
|
||||
- ``USE_OCCT`` - whether to use official Open CASCADE instead of Community Edition
|
||||
(`true` by default, any other value is considered `false`)
|
||||
- ``WASM_PYTHON_PATH`` - path to WASM Python installation,
|
||||
@@ -155,7 +155,7 @@ MPFR_VERSION = "3.1.6" # latest is 4.1.0
|
||||
CGAL_VERSION = "v5.6.3"
|
||||
USD_VERSION = "23.05"
|
||||
TBB_VERSION = "2021.9.0"
|
||||
ROCKSDB_VERSION = "9.11.2"
|
||||
ROCKSDB_VERSION = "10.4.2"
|
||||
ZSTD_VERSION = "1.5.7"
|
||||
# binaries
|
||||
cp = "cp"
|
||||
@@ -627,9 +627,10 @@ def build_dependency(
|
||||
build_tool_args: "list[str]",
|
||||
download_url: str,
|
||||
download_name: str,
|
||||
*,
|
||||
download_tool: Literal["py", "git"] = download_tool_default,
|
||||
revision: "Union[str, None]" = None,
|
||||
patch: "Union[str, list[str], None]" = None,
|
||||
patch: list[str] | None = None,
|
||||
shell=None,
|
||||
pre_compile_subs: "Sequence[tuple[str, str, str]]" = (),
|
||||
additional_files: "Union[dict[str, str], None]" = None,
|
||||
@@ -714,8 +715,6 @@ def build_dependency(
|
||||
urlretrieve(url, os.path.join(extract_dir, path))
|
||||
|
||||
if patch is not None:
|
||||
if isinstance(patch, str):
|
||||
patch = [patch]
|
||||
for p in patch:
|
||||
patch_abs = (SCRIPT_PATH / p).absolute().__str__()
|
||||
if os.path.exists(patch_abs):
|
||||
@@ -724,6 +723,8 @@ def build_dependency(
|
||||
except Exception as e:
|
||||
# Assert that the patch has already been applied
|
||||
run(["patch", "-p1", "--batch", "--reverse", "--dry-run", "-i", patch_abs], cwd=extract_dir)
|
||||
else:
|
||||
raise FileNotFoundError(patch_abs)
|
||||
|
||||
if shell is not None:
|
||||
sp.run(shell, shell=True, check=True, cwd=extract_dir)
|
||||
@@ -1171,6 +1172,14 @@ if "cgal" in targets:
|
||||
os.environ["CC"] = MAC_CROSS_COMPILE_INTEL_CC
|
||||
gmp_args.extend(MAC_CROSS_COMPILE_INTEL_AUTOCONF_HOST_ARGS)
|
||||
|
||||
# Fixes configure failing to find a working compiler under GCC 15's default -std=gnu23.
|
||||
# Issue presumably will be resolved in any next gmp version, but currently the last one is 6.3.0.
|
||||
# Patch is just applying fix from upstream meantion below:
|
||||
# https://gmplib.org/list-archives/gmp-bugs/2025-February/005561.html
|
||||
gmp_patches = ["./patches/gmp/001-fix-std23.patch"]
|
||||
if GMP_VERSION != "6.3.0":
|
||||
raise Exception(f"GMP_VERSION changed to {GMP_VERSION}, check whether {gmp_patches} is still needed.")
|
||||
|
||||
build_dependency(
|
||||
name=f"gmp-{GMP_VERSION}",
|
||||
mode="autoconf",
|
||||
@@ -1178,6 +1187,7 @@ if "cgal" in targets:
|
||||
pre_compile_subs=(
|
||||
[("build/config.h", "HAVE_OBSTACK_VPRINTF 1", "HAVE_OBSTACK_VPRINTF 0")] if "wasm" in flags else []
|
||||
),
|
||||
patch=gmp_patches,
|
||||
# Sometimes ftp.gnu.org is very slow, use ftpmirror.gnu.org as a workaround.
|
||||
download_url="https://ftpmirror.gnu.org/gnu/gmp/",
|
||||
download_name=f"gmp-{GMP_VERSION}.tar.bz2",
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
Fixes configure failing to find a working compiler under GCC 15's default
|
||||
-std=gnu23 (upstream fix: https://gmplib.org/repo/gmp/rev/8e7bb4ae7a18).
|
||||
|
||||
Upstream fix is patching `acinclude.m4`, but since in the release tarball
|
||||
all macros are already expanded to `configure` script, so we're patching
|
||||
all occurrences of that macro.
|
||||
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -6568,7 +6568,7 @@
|
||||
|
||||
#if defined (__GNUC__) && ! defined (__cplusplus)
|
||||
typedef unsigned long long t1;typedef t1*t2;
|
||||
-void g(){}
|
||||
+void g(int,t1 const*,t1,t2,t1 const*,int){}
|
||||
void h(){}
|
||||
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
|
||||
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
|
||||
@@ -8187,7 +8187,7 @@
|
||||
|
||||
#if defined (__GNUC__) && ! defined (__cplusplus)
|
||||
typedef unsigned long long t1;typedef t1*t2;
|
||||
-void g(){}
|
||||
+void g(int,t1 const*,t1,t2,t1 const*,int){}
|
||||
void h(){}
|
||||
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
|
||||
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
|
||||
@@ -1,32 +0,0 @@
|
||||
http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff;h=0ab4e621833f4eae945a3762c9a29ee12e2eec53#patch1
|
||||
diff --git a/src/HLRBRep/HLRBRep_InternalAlgo.cxx b/src/HLRBRep/HLRBRep_InternalAlgo.cxx
|
||||
index ca885ca..c13cb06 100644 (file)
|
||||
--- a/src/HLRBRep/HLRBRep_InternalAlgo.cxx
|
||||
+++ b/src/HLRBRep/HLRBRep_InternalAlgo.cxx
|
||||
@@ -165,7 +165,7 @@ void HLRBRep_InternalAlgo::Update ()
|
||||
SB.Bounds(v1,v2,e1,e2,f1,f2);
|
||||
|
||||
for (Standard_Integer e = e1; e <= e2; e++) {
|
||||
- HLRBRep_EdgeData ed = aEDataArray.ChangeValue(e);
|
||||
+ HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(e);
|
||||
HLRAlgo::DecodeMinMax(ed.MinMax(), TheMin, TheMax);
|
||||
if (FirstTime) {
|
||||
FirstTime = Standard_False;
|
||||
@@ -307,7 +307,7 @@ void HLRBRep_InternalAlgo::InitEdgeStatus ()
|
||||
Standard_Integer nf = myDS->NbFaces();
|
||||
|
||||
for (Standard_Integer e = 1; e <= ne; e++) {
|
||||
- HLRBRep_EdgeData ed = aEDataArray.ChangeValue(e);
|
||||
+ HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(e);
|
||||
if (ed.Selected()) ed.Status().ShowAll();
|
||||
}
|
||||
// for (Standard_Integer f = 1; f <= nf; f++) {
|
||||
@@ -368,7 +368,7 @@ void HLRBRep_InternalAlgo::Select ()
|
||||
Standard_Integer nf = myDS->NbFaces();
|
||||
|
||||
for (Standard_Integer e = 1; e <= ne; e++) {
|
||||
- HLRBRep_EdgeData ed = aEDataArray.ChangeValue(e);
|
||||
+ HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(e);
|
||||
ed.Selected(Standard_True);
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
From a0deb4ce8b43cf3c8b8c0a4225c6be5296446dbd Mon Sep 17 00:00:00 2001
|
||||
From: Adam Eri <adam.eri@blackmirror.media>
|
||||
Date: Tue, 3 Sep 2019 23:30:20 +0200
|
||||
Subject: [PATCH] Resolves compile error on macOS
|
||||
|
||||
Resolves "no member named 'isnan' in namespace 'std'" on macOS
|
||||
---
|
||||
GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp b/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp
|
||||
index 1f9a3eef..dd6f5c59 100644
|
||||
--- a/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp
|
||||
+++ b/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "GeneratedSaxParserUtils.h"
|
||||
#include <math.h>
|
||||
+#include <cmath>
|
||||
#include <memory>
|
||||
#include <string.h>
|
||||
#include <limits>
|
||||
+42
-86
@@ -1,13 +1,8 @@
|
||||
[project]
|
||||
name = "IfcOpenShell"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"black==26.3.1",
|
||||
"ruff==0.15.12",
|
||||
"poethepoet",
|
||||
"ty==0.0.32",
|
||||
"gersemi==0.26.1",
|
||||
]
|
||||
# Don't provide requires-python explicitly
|
||||
# allowing pyprojects to set their own (e.g. bonsai and general ifcopenshell version differ).
|
||||
|
||||
[tool.black]
|
||||
line-length = 120
|
||||
@@ -43,6 +38,7 @@ exclude = [
|
||||
# then they will be inherited by projects' .toml files.
|
||||
# This allows using assuming different Python version for different projects.
|
||||
[tool.ruff]
|
||||
line-length = 120
|
||||
exclude = [
|
||||
# Submodules.
|
||||
"src/ifcopenshell-python/ifcopenshell/express",
|
||||
@@ -83,92 +79,39 @@ ignore = [
|
||||
]
|
||||
|
||||
[tool.ty.rules]
|
||||
all = "ignore"
|
||||
all = "error"
|
||||
|
||||
# Structural rules (no deep type inference needed, easier to adapt).
|
||||
abstract-method-in-final-class = "error"
|
||||
ambiguous-protocol-member = "error"
|
||||
conflicting-declarations = "error"
|
||||
conflicting-metaclass = "error"
|
||||
cyclic-class-definition = "error"
|
||||
cyclic-type-alias-definition = "error"
|
||||
dataclass-field-order = "error"
|
||||
duplicate-base = "error"
|
||||
duplicate-kw-only = "error"
|
||||
empty-body = "error"
|
||||
escape-character-in-forward-annotation = "error"
|
||||
final-on-non-method = "error"
|
||||
final-without-value = "error"
|
||||
ignore-comment-unknown-rule = "error"
|
||||
implicit-concatenated-string-type-annotation = "error"
|
||||
inconsistent-mro = "error"
|
||||
ineffective-final = "error"
|
||||
instance-layout-conflict = "error"
|
||||
invalid-dataclass = "error"
|
||||
invalid-dataclass-override = "error"
|
||||
invalid-enum-member-annotation = "error"
|
||||
invalid-explicit-override = "error"
|
||||
invalid-frozen-dataclass-subclass = "error"
|
||||
invalid-generic-class = "error"
|
||||
invalid-generic-enum = "error"
|
||||
invalid-ignore-comment = "error"
|
||||
invalid-legacy-positional-parameter = "error"
|
||||
invalid-legacy-type-variable = "error"
|
||||
invalid-named-tuple = "error"
|
||||
invalid-newtype = "error"
|
||||
invalid-overload = "error"
|
||||
invalid-paramspec = "error"
|
||||
invalid-protocol = "error"
|
||||
invalid-syntax-in-forward-annotation = "error"
|
||||
invalid-total-ordering = "error"
|
||||
invalid-type-alias-type = "error"
|
||||
invalid-type-checking-constant = "error"
|
||||
invalid-type-guard-definition = "error"
|
||||
invalid-type-variable-bound = "error"
|
||||
invalid-type-variable-constraints = "error"
|
||||
invalid-typed-dict-header = "error"
|
||||
invalid-typed-dict-statement = "error"
|
||||
override-of-final-method = "error"
|
||||
override-of-final-variable = "error"
|
||||
possibly-missing-import = "error"
|
||||
possibly-missing-submodule = "error"
|
||||
# Has false positives due to ty walrus operator bug.
|
||||
# possibly-unresolved-reference = "error"
|
||||
raw-string-type-annotation = "error"
|
||||
redundant-final-classvar = "error"
|
||||
shadowed-type-variable = "error"
|
||||
subclass-of-final-class = "error"
|
||||
super-call-in-named-tuple-method = "error"
|
||||
unavailable-implicit-super-arguments = "error"
|
||||
unbound-type-variable = "error"
|
||||
undefined-reveal = "error"
|
||||
unresolved-global = "error"
|
||||
unresolved-import = "error"
|
||||
unresolved-reference = "error"
|
||||
unused-ignore-comment = "error"
|
||||
unused-type-ignore-comment = "error"
|
||||
useless-overload-body = "error"
|
||||
possibly-unresolved-reference = "ignore"
|
||||
# Maybe later, requires to specify element types for all generics.
|
||||
missing-type-argument = "ignore"
|
||||
# Conflicts with `bpy` props defined using annotations.
|
||||
invalid-type-form = "ignore"
|
||||
|
||||
# Non-structural rules:
|
||||
deprecated = "error"
|
||||
zero-stepsize-in-slice = "error"
|
||||
possibly-missing-implicit-call = "error"
|
||||
unused-awaitable = "error"
|
||||
|
||||
# Function argument rules:
|
||||
# Conflicts with `ifcopenshell.api.geometry.add_representation` type of callables we have, confusing them with a module.
|
||||
# call-non-callable = "error"
|
||||
conflicting-argument-forms = "error"
|
||||
call-non-callable = "ignore"
|
||||
# bpy is missing some context manager implementations.
|
||||
invalid-context-manager = "ignore"
|
||||
# Doesn't go well with `bpy.ops.xxx.yyy`.
|
||||
unresolved-attribute = "ignore"
|
||||
# Too many false positives.
|
||||
# invalid-argument-type = "error"
|
||||
missing-argument = "error"
|
||||
parameter-already-assigned = "error"
|
||||
positional-only-parameter-as-kwarg = "error"
|
||||
too-many-positional-arguments = "error"
|
||||
unknown-argument = "error"
|
||||
# Has a lot of warnings due to current ty walrus operator issues.
|
||||
# index-out-of-bounds = "error"
|
||||
# unresolved-attribute = "error"
|
||||
invalid-argument-type = "ignore"
|
||||
invalid-method-override = "ignore"
|
||||
invalid-assignment = "ignore"
|
||||
invalid-parameter-default = "ignore"
|
||||
missing-override-decorator = "ignore"
|
||||
invalid-yield = "ignore"
|
||||
invalid-return-type = "ignore"
|
||||
non-callable-init-subclass = "ignore"
|
||||
not-iterable = "ignore"
|
||||
possibly-missing-attribute = "ignore"
|
||||
no-matching-overload = "ignore"
|
||||
not-subscriptable = "ignore"
|
||||
unsupported-dynamic-base = "ignore"
|
||||
unsupported-operator = "ignore"
|
||||
type-assertion-failure = "ignore"
|
||||
|
||||
[tool.ty.environment]
|
||||
extra-paths = [
|
||||
@@ -215,6 +158,18 @@ exclude = [
|
||||
|
||||
[tool.poe.tasks]
|
||||
|
||||
dev-setup.sequence = [
|
||||
{cmd = "uv sync"},
|
||||
{cmd = "uv pip install -e ./src/bsdd/"},
|
||||
{cmd = "uv pip install -e ./src/ifcopenshell-python/[advanced,dev]"},
|
||||
{cmd = "uv pip install -e ./src/ifcedit/"},
|
||||
{cmd = "uv pip install -e ./src/ifcpatch/"},
|
||||
{cmd = "uv pip install -e ./src/ifcquery/"},
|
||||
{cmd = "uv pip install -e './src/ifcmcp/[mcp]'"},
|
||||
{cmd = "uv pip install -r src/bonsai/requirements-dev.txt"},
|
||||
]
|
||||
dev-setup.help = "Install repo packages in editable mode"
|
||||
|
||||
ruff = "ruff check"
|
||||
|
||||
black = "black ."
|
||||
@@ -243,6 +198,7 @@ cmake-format = "gersemi . --in-place"
|
||||
# --ignore unresolved-reference: walrus operator false positives in ty.
|
||||
cmd = """
|
||||
ty check
|
||||
nix/
|
||||
src/bcf
|
||||
src/bsdd
|
||||
src/ifc2ca
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
black==26.3.1
|
||||
ruff==0.15.12
|
||||
poethepoet
|
||||
ty==0.0.59
|
||||
gersemi==0.26.1
|
||||
@@ -46,7 +46,7 @@ IFC_CONNECTED_TYPE = Union[bpy.types.Material, bpy.types.Object]
|
||||
class OperationData(TypedDict):
|
||||
id: int
|
||||
guid: NotRequired[str]
|
||||
obj: str
|
||||
obj: NotRequired[str]
|
||||
|
||||
|
||||
class EditObjectOperationData(TypedDict):
|
||||
|
||||
@@ -156,16 +156,13 @@ class BrickschemaReferencesData:
|
||||
for rel in getattr(tool.Ifc.get_entity(bpy.context.active_object), "HasAssociations", []):
|
||||
if rel.is_a("IfcRelAssociatesLibrary"):
|
||||
reference = rel.RelatingLibrary
|
||||
if tool.Ifc.get_schema() == "IFC2X3" and "#" not in reference.ItemReference:
|
||||
continue
|
||||
if tool.Ifc.get_schema() != "IFC2X3" and "#" not in reference.Identification:
|
||||
identification = tool.Document.get_external_reference_id(reference)
|
||||
if not identification or "#" not in identification:
|
||||
continue
|
||||
results.append(
|
||||
{
|
||||
"id": reference.id(),
|
||||
"identification": (
|
||||
reference.ItemReference if tool.Ifc.get_schema() == "IFC2X3" else reference.Identification
|
||||
),
|
||||
"identification": identification,
|
||||
"name": reference.Name or "Unnamed",
|
||||
}
|
||||
)
|
||||
|
||||
@@ -127,36 +127,25 @@ class ObjectDocumentData:
|
||||
identification = None
|
||||
|
||||
if is_information:
|
||||
if tool.Ifc.get_schema() == "IFC2X3":
|
||||
identification = relating_document.DocumentId
|
||||
else:
|
||||
identification = relating_document.Identification
|
||||
identification = tool.Document.get_document_information_id(relating_document)
|
||||
|
||||
location = getattr(relating_document, "Location", None)
|
||||
description = getattr(relating_document, "Description", "No description")
|
||||
else:
|
||||
description = relating_document.Description
|
||||
if tool.Ifc.get_schema() == "IFC2X3":
|
||||
reference_to_document = relating_document.ReferenceToDocument
|
||||
if not name and reference_to_document:
|
||||
name = reference_to_document[0].Name
|
||||
referenced_document = tool.Document.get_reference_document(relating_document)
|
||||
|
||||
identification = relating_document.ItemReference
|
||||
if not identification and reference_to_document:
|
||||
identification = reference_to_document[0].DocumentId
|
||||
location = relating_document.Location
|
||||
else:
|
||||
referenced_document = relating_document.ReferencedDocument
|
||||
if not name and referenced_document:
|
||||
name = referenced_document.Name
|
||||
if not name and referenced_document:
|
||||
name = referenced_document.Name
|
||||
|
||||
identification = relating_document.Identification
|
||||
if not identification and referenced_document:
|
||||
identification = referenced_document.Identification
|
||||
identification = tool.Document.get_external_reference_id(relating_document)
|
||||
if not identification and referenced_document:
|
||||
identification = tool.Document.get_document_information_id(referenced_document)
|
||||
|
||||
location = relating_document.Location
|
||||
if location is None and referenced_document:
|
||||
location = referenced_document.Location
|
||||
location = relating_document.Location
|
||||
# IFC2X3 IfcDocumentInformation has no Location to fall back to.
|
||||
if location is None and referenced_document and tool.Ifc.get_schema() != "IFC2X3":
|
||||
location = referenced_document.Location
|
||||
|
||||
location = cls.convert_to_file_uri(location) if location else None
|
||||
|
||||
|
||||
@@ -3586,7 +3586,7 @@ class EditSheet(bpy.types.Operator, tool.Ifc.Operator):
|
||||
if sheet.is_a("IfcDocumentInformation"):
|
||||
self.document_type = "SHEET"
|
||||
self.name = sheet.Name
|
||||
self.identification = sheet.DocumentId if tool.Ifc.get_schema() == "IFC2X3" else sheet.Identification
|
||||
self.identification = tool.Document.get_document_information_id(sheet)
|
||||
elif sheet.is_a("IfcDocumentReference") and tool.Drawing.get_reference_description(sheet) == "TITLEBLOCK":
|
||||
self.document_type = "TITLEBLOCK"
|
||||
else:
|
||||
|
||||
@@ -903,12 +903,8 @@ class SvgWriter:
|
||||
continue
|
||||
sheet = tool.Drawing.get_reference_document(sheet_reference)
|
||||
if sheet:
|
||||
if tool.Ifc.get_schema() == "IFC2X3":
|
||||
reference_id = sheet_reference.ItemReference or "-"
|
||||
sheet_id = sheet.DocumentId or "-"
|
||||
else:
|
||||
reference_id = sheet_reference.Identification or "-"
|
||||
sheet_id = sheet.Identification or "-"
|
||||
reference_id = tool.Document.get_external_reference_id(sheet_reference) or "-"
|
||||
sheet_id = tool.Document.get_document_information_id(sheet) or "-"
|
||||
return (reference_id, sheet_id)
|
||||
break
|
||||
return ("-", "-")
|
||||
|
||||
@@ -103,9 +103,7 @@ class LibraryReferencesData:
|
||||
results.append(
|
||||
{
|
||||
"id": library.id(),
|
||||
"identification": (
|
||||
library.ItemReference if tool.Ifc.get_schema() == "IFC2X3" else library.Identification
|
||||
),
|
||||
"identification": tool.Document.get_external_reference_id(library),
|
||||
"name": library.Name or "Unnamed",
|
||||
}
|
||||
)
|
||||
|
||||
@@ -418,6 +418,13 @@ class ImportQuickFavorites(bpy.types.Operator):
|
||||
bl_description = "Import operators from Blender's Quick Favorites menu, including their configured properties"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
if bpy.app.version[:2] not in tool.Misc.QuickFavorites.OFFSET_USER_MENUS:
|
||||
cls.poll_message_set(f"Blender version {bpy.app.version_string} is not supported.")
|
||||
return False
|
||||
return True
|
||||
|
||||
def execute(self, context) -> set["rna_enums.OperatorReturnItems"]:
|
||||
props = tool.Misc.get_misc_props()
|
||||
props.quick_favorites.clear()
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, cast
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import bpy
|
||||
import ifcopenshell
|
||||
@@ -122,8 +122,8 @@ class ExecuteIfcPatch(bpy.types.Operator):
|
||||
if props.should_load_from_memory and tool.Ifc.get():
|
||||
args["file"] = tool.Ifc.get()
|
||||
else:
|
||||
args["input"] = cast(str, props.ifc_patch_input)
|
||||
args["file"] = cast(ifcopenshell.file, ifcopenshell.open(props.ifc_patch_input))
|
||||
args["input"] = props.ifc_patch_input
|
||||
args["file"] = ifcopenshell.open(props.ifc_patch_input)
|
||||
|
||||
# Store this in case the patch recipe resets the Blender session, such as by loading a new project.
|
||||
ifc_patch_output = props.ifc_patch_output or props.ifc_patch_input
|
||||
|
||||
@@ -71,7 +71,11 @@ class LoadByDirection(TypedDict):
|
||||
|
||||
ProcessedLoad = TypedDict(
|
||||
"ProcessedLoad",
|
||||
{"linear loads": LoadByDirection, "max linear load": float, "discrete loads": list[list[DiscreteConfigItem]]},
|
||||
{
|
||||
"linear loads": dict[str, LoadByDirection] | None,
|
||||
"max linear load": float,
|
||||
"discrete loads": list[list[DiscreteConfigItem]],
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@@ -845,13 +849,16 @@ class ShaderInfo:
|
||||
v = l1[1] + fac * (pos - l1[0])
|
||||
return v
|
||||
|
||||
def interpolate(self, pos: float, loadinfo: list[LoadConfigItem], start: int, end: int, key: str) -> np.ndarray:
|
||||
def interpolate(self, pos: float, loadinfo: list[LoadConfigItem], start: int, end: int) -> np.ndarray:
|
||||
"""interpolate the result vectors between load poits"""
|
||||
result = np.zeros(6)
|
||||
for i in range(6):
|
||||
value1 = [loadinfo[start]["pos"], loadinfo[start][key][i]] # [position, force_component]
|
||||
value2 = [loadinfo[end]["pos"], loadinfo[end][key][i]] # [position, force_component]
|
||||
result[i] = self.interp1d(value1, value2, pos) # interpolated [position, force_component]
|
||||
# [position, force_component]
|
||||
value1 = [loadinfo[start]["pos"], loadinfo[start]["load values"][i]]
|
||||
# [position, force_component]
|
||||
value2 = [loadinfo[end]["pos"], loadinfo[end]["load values"][i]]
|
||||
# interpolated [position, force_component]
|
||||
result[i] = self.interp1d(value1, value2, pos)
|
||||
return result
|
||||
|
||||
def get_before_and_after(self, pos: float, load_config_list: list[list[LoadConfigItem]]) -> dict[str, list[float]]:
|
||||
@@ -895,8 +902,8 @@ class ShaderInfo:
|
||||
load_before += config[end]["load values"]
|
||||
|
||||
elif end - start == 1:
|
||||
load_before += self.interpolate(pos, config, start, end, "load values")
|
||||
load_after += self.interpolate(pos, config, start, end, "load values")
|
||||
load_before += self.interpolate(pos, config, start, end)
|
||||
load_after += self.interpolate(pos, config, start, end)
|
||||
start += 1
|
||||
end -= 1
|
||||
return_value = {"before": load_before.tolist(), "after": load_after.tolist()}
|
||||
|
||||
@@ -303,17 +303,7 @@ def add_drawing(
|
||||
ifc_representation_class=None,
|
||||
)
|
||||
|
||||
drawings_parent_group = None
|
||||
for group in ifc.get().by_type("IfcGroup"):
|
||||
if group.Name == "DRAWINGS" and group.ObjectType == "DRAWINGS":
|
||||
drawings_parent_group = group
|
||||
break
|
||||
|
||||
if not drawings_parent_group:
|
||||
drawings_parent_group = ifc.run("group.add_group")
|
||||
ifc.run(
|
||||
"group.edit_group", group=drawings_parent_group, attributes={"Name": "DRAWINGS", "ObjectType": "DRAWINGS"}
|
||||
)
|
||||
drawings_parent_group = drawing.ensure_drawings_parent_group()
|
||||
|
||||
group = ifc.run("group.add_group")
|
||||
ifc.run("group.edit_group", group=group, attributes={"Name": drawing_name, "ObjectType": "DRAWING"})
|
||||
@@ -352,19 +342,7 @@ def add_drawing(
|
||||
)
|
||||
drawing.setup_shading_styles_path(shading_styles_path)
|
||||
|
||||
drawings_parent_document = None
|
||||
for document in ifc.get().by_type("IfcDocumentInformation"):
|
||||
if document.Name == "DRAWINGS" and document.Scope == "DRAWINGS":
|
||||
drawings_parent_document = document
|
||||
break
|
||||
|
||||
if not drawings_parent_document:
|
||||
drawings_parent_document = ifc.run("document.add_information")
|
||||
if ifc.get_schema() == "IFC2X3":
|
||||
attributes = {"DocumentId": "DRAWINGS", "Name": "DRAWINGS", "Scope": "DRAWINGS"}
|
||||
else:
|
||||
attributes = {"Identification": "DRAWINGS", "Name": "DRAWINGS", "Scope": "DRAWINGS"}
|
||||
ifc.run("document.edit_information", information=drawings_parent_document, attributes=attributes)
|
||||
drawings_parent_document = drawing.ensure_drawings_parent_document()
|
||||
|
||||
information = ifc.run("document.add_information", parent=drawings_parent_document)
|
||||
uri = drawing.get_default_drawing_path(drawing_name)
|
||||
@@ -395,17 +373,7 @@ def duplicate_drawing(
|
||||
group = drawing_tool.get_drawing_group(new_drawing)
|
||||
ifc.run("group.unassign_group", group=group, products=[new_drawing])
|
||||
|
||||
drawings_parent_group = None
|
||||
for parent_group in ifc.get().by_type("IfcGroup"):
|
||||
if parent_group.Name == "DRAWINGS" and parent_group.ObjectType == "DRAWINGS":
|
||||
drawings_parent_group = parent_group
|
||||
break
|
||||
|
||||
if not drawings_parent_group:
|
||||
drawings_parent_group = ifc.run("group.add_group")
|
||||
ifc.run(
|
||||
"group.edit_group", group=drawings_parent_group, attributes={"Name": "DRAWINGS", "ObjectType": "DRAWINGS"}
|
||||
)
|
||||
drawings_parent_group = drawing_tool.ensure_drawings_parent_group()
|
||||
|
||||
new_group = ifc.run("group.add_group")
|
||||
ifc.run("group.edit_group", group=new_group, attributes={"Name": drawing_name, "ObjectType": "DRAWING"})
|
||||
@@ -426,19 +394,7 @@ def duplicate_drawing(
|
||||
old_reference = drawing_tool.get_drawing_document(new_drawing)
|
||||
ifc.run("document.unassign_document", products=[new_drawing], document=old_reference)
|
||||
|
||||
drawings_parent_document = None
|
||||
for document in ifc.get().by_type("IfcDocumentInformation"):
|
||||
if document.Name == "DRAWINGS" and document.Scope == "DRAWINGS":
|
||||
drawings_parent_document = document
|
||||
break
|
||||
|
||||
if not drawings_parent_document:
|
||||
drawings_parent_document = ifc.run("document.add_information")
|
||||
if ifc.get_schema() == "IFC2X3":
|
||||
attributes = {"DocumentId": "DRAWINGS", "Name": "DRAWINGS", "Scope": "DRAWINGS"}
|
||||
else:
|
||||
attributes = {"Identification": "DRAWINGS", "Name": "DRAWINGS", "Scope": "DRAWINGS"}
|
||||
ifc.run("document.edit_information", information=drawings_parent_document, attributes=attributes)
|
||||
drawings_parent_document = drawing_tool.ensure_drawings_parent_document()
|
||||
|
||||
information = ifc.run("document.add_information", parent=drawings_parent_document)
|
||||
uri = drawing_tool.get_default_drawing_path(drawing_name)
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
# Bonsai - OpenBIM Blender Add-on
|
||||
# Copyright (C) 2026
|
||||
#
|
||||
# This file is part of Bonsai.
|
||||
#
|
||||
# Bonsai 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 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Bonsai 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 Bonsai. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# This file was generated with the assistance of an AI coding tool.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import math
|
||||
from collections.abc import Iterable
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import bonsai.core.geometry
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import bpy
|
||||
|
||||
import bonsai.tool as tool
|
||||
|
||||
|
||||
Z_ROTATION_ALIGNMENT_TOLERANCE = 1e-9
|
||||
|
||||
|
||||
def _z_rotation_diff(target_z: float, source_z: float) -> float:
|
||||
"""Signed Z-Euler difference wrapped to [-π, π]."""
|
||||
return (target_z - source_z + math.pi) % (2 * math.pi) - math.pi
|
||||
|
||||
|
||||
def copy_z_rotation_to_selected(
|
||||
ifc: type[tool.Ifc],
|
||||
geometry: type[tool.Geometry],
|
||||
surveyor: type[tool.Surveyor],
|
||||
*,
|
||||
active: bpy.types.Object,
|
||||
targets: Iterable[bpy.types.Object],
|
||||
flip: bool = False,
|
||||
) -> int:
|
||||
"""Apply ``active``'s Z-Euler rotation to each target."""
|
||||
source_z = surveyor.get_z_rotation(active) # ty: ignore[missing-argument]
|
||||
if flip:
|
||||
source_z += math.pi
|
||||
rotated = 0
|
||||
for obj in targets:
|
||||
target_z = surveyor.get_z_rotation(obj) # ty: ignore[missing-argument]
|
||||
if abs(_z_rotation_diff(target_z, source_z)) < Z_ROTATION_ALIGNMENT_TOLERANCE:
|
||||
continue
|
||||
surveyor.set_z_rotation(obj, source_z) # ty: ignore[missing-argument]
|
||||
rotated += 1
|
||||
if ifc.get_entity(obj) is not None:
|
||||
bonsai.core.geometry.edit_object_placement(ifc, geometry, surveyor, obj=obj)
|
||||
return rotated
|
||||
@@ -354,6 +354,8 @@ class Drawing:
|
||||
def enable_editing_schedules(cls): pass
|
||||
def enable_editing_sheets(cls): pass
|
||||
def enable_editing_text(cls, obj): pass
|
||||
def ensure_drawings_parent_document(cls): pass
|
||||
def ensure_drawings_parent_group(cls): pass
|
||||
def ensure_unique_drawing_name(cls, name): pass
|
||||
def ensure_unique_identification(cls, identification): pass
|
||||
def export_font_size(cls, obj): pass
|
||||
@@ -1169,8 +1171,6 @@ class Style:
|
||||
@interface
|
||||
class Surveyor:
|
||||
def get_absolute_matrix(cls, obj): pass
|
||||
def get_z_rotation(cls, obj): pass
|
||||
def set_z_rotation(cls, obj, z): pass
|
||||
|
||||
|
||||
@interface
|
||||
|
||||
@@ -192,10 +192,9 @@ class Brick(bonsai.core.tool.Brick):
|
||||
def get_brick(cls, element: ifcopenshell.entity_instance) -> Union[str, None]:
|
||||
for rel in element.HasAssociations:
|
||||
if rel.is_a("IfcRelAssociatesLibrary"):
|
||||
if tool.Ifc.get_schema() == "IFC2X3" and "#" in rel.RelatingLibrary.ItemReference:
|
||||
return rel.RelatingLibrary.ItemReference
|
||||
if tool.Ifc.get_schema() != "IFC2X3" and "#" in rel.RelatingLibrary.Identification:
|
||||
return rel.RelatingLibrary.Identification
|
||||
identification = tool.Document.get_external_reference_id(rel.RelatingLibrary)
|
||||
if identification and "#" in identification:
|
||||
return identification
|
||||
|
||||
@classmethod
|
||||
def get_brick_class(cls, element: ifcopenshell.entity_instance) -> Union[str, None]:
|
||||
|
||||
@@ -261,7 +261,8 @@ class Document(bonsai.core.tool.Document):
|
||||
def get_reference_document(cls, reference: ifcopenshell.entity_instance) -> ifcopenshell.entity_instance | None:
|
||||
# TODO: migrate to util.document and replace all instances
|
||||
if reference.file.schema == "IFC2X3":
|
||||
return (reference.ReferenceToDocument or (None))[0]
|
||||
reference_to_document = reference.ReferenceToDocument
|
||||
return reference_to_document[0] if reference_to_document else None
|
||||
return reference.ReferencedDocument
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -38,6 +38,7 @@ import ifcopenshell.api.context
|
||||
import ifcopenshell.api.document
|
||||
import ifcopenshell.api.drawing
|
||||
import ifcopenshell.api.geometry
|
||||
import ifcopenshell.api.group
|
||||
import ifcopenshell.api.pset
|
||||
import ifcopenshell.api.root
|
||||
import ifcopenshell.geom
|
||||
@@ -773,6 +774,32 @@ class Drawing(bonsai.core.tool.Drawing):
|
||||
def get_drawing_target_view(cls, drawing: ifcopenshell.entity_instance) -> str:
|
||||
return ifcopenshell.util.element.get_psets(drawing).get("EPset_Drawing", {}).get("TargetView", "MODEL_VIEW")
|
||||
|
||||
@classmethod
|
||||
def ensure_drawings_parent_document(cls) -> ifcopenshell.entity_instance:
|
||||
ifc_file = tool.Ifc.get()
|
||||
for document in ifc_file.by_type("IfcDocumentInformation"):
|
||||
if document.Name == "DRAWINGS" and document.Scope == "DRAWINGS":
|
||||
return document
|
||||
document = ifcopenshell.api.document.add_information(ifc_file)
|
||||
if ifc_file.schema == "IFC2X3":
|
||||
attributes = {"DocumentId": "DRAWINGS", "Name": "DRAWINGS", "Scope": "DRAWINGS"}
|
||||
else:
|
||||
attributes = {"Identification": "DRAWINGS", "Name": "DRAWINGS", "Scope": "DRAWINGS"}
|
||||
ifcopenshell.api.document.edit_information(ifc_file, information=document, attributes=attributes)
|
||||
return document
|
||||
|
||||
@classmethod
|
||||
def ensure_drawings_parent_group(cls) -> ifcopenshell.entity_instance:
|
||||
ifc_file = tool.Ifc.get()
|
||||
for group in ifc_file.by_type("IfcGroup"):
|
||||
if group.Name == "DRAWINGS" and group.ObjectType == "DRAWINGS":
|
||||
return group
|
||||
group = ifcopenshell.api.group.add_group(ifc_file)
|
||||
ifcopenshell.api.group.edit_group(
|
||||
ifc_file, group=group, attributes={"Name": "DRAWINGS", "ObjectType": "DRAWINGS"}
|
||||
)
|
||||
return group
|
||||
|
||||
@classmethod
|
||||
def get_group_elements(cls, group: ifcopenshell.entity_instance) -> list[ifcopenshell.entity_instance]:
|
||||
for rel in group.IsGroupedBy or []:
|
||||
@@ -1140,10 +1167,7 @@ class Drawing(bonsai.core.tool.Drawing):
|
||||
new = documents_collection.add()
|
||||
new.ifc_definition_id = schedule.id()
|
||||
new.name = schedule.Name or "Unnamed"
|
||||
if tool.Ifc.get_schema() == "IFC2X3":
|
||||
new.identification = schedule.DocumentId
|
||||
else:
|
||||
new.identification = schedule.Identification
|
||||
new.identification = tool.Document.get_document_information_id(schedule) or ""
|
||||
|
||||
@classmethod
|
||||
def get_sheet_identification(cls, sheet: ifcopenshell.entity_instance) -> str:
|
||||
@@ -1184,10 +1208,7 @@ class Drawing(bonsai.core.tool.Drawing):
|
||||
new.ifc_definition_id = reference.id()
|
||||
new.is_sheet = False
|
||||
|
||||
if tool.Ifc.get_schema() == "IFC2X3":
|
||||
new.identification = reference.ItemReference or ""
|
||||
else:
|
||||
new.identification = reference.Identification or ""
|
||||
new.identification = tool.Document.get_external_reference_id(reference) or ""
|
||||
|
||||
new.name = os.path.basename(reference.Location)
|
||||
new.reference_type = reference_description
|
||||
@@ -2423,9 +2444,8 @@ class Drawing(bonsai.core.tool.Drawing):
|
||||
def get_reference_document(
|
||||
cls, reference: ifcopenshell.entity_instance
|
||||
) -> Union[ifcopenshell.entity_instance, None]:
|
||||
if tool.Ifc.get_schema() == "IFC2X3":
|
||||
return reference.ReferenceToDocument[0]
|
||||
return reference.ReferencedDocument
|
||||
# TODO: migrate to document.get_reference_document.
|
||||
return tool.Document.get_reference_document(reference)
|
||||
|
||||
@classmethod
|
||||
def select_assigned_product(cls, context: bpy.types.Context) -> None:
|
||||
|
||||
@@ -33,7 +33,6 @@ from typing import (
|
||||
Optional,
|
||||
TypeGuard,
|
||||
Union,
|
||||
cast,
|
||||
get_args,
|
||||
)
|
||||
|
||||
@@ -2187,7 +2186,7 @@ class Geometry(bonsai.core.tool.Geometry):
|
||||
setattr(item, attribute.name, attribute.get_value())
|
||||
|
||||
if item.is_a("IfcSweptAreaSolid"):
|
||||
item_profile = cast(str, props.item_profile)
|
||||
item_profile = props.item_profile
|
||||
profile = item.SweptArea
|
||||
profile_name: Union[str, None] = profile.ProfileName
|
||||
if item_profile == "-":
|
||||
|
||||
@@ -197,7 +197,6 @@ class Loader(bonsai.core.tool.Loader):
|
||||
cls, blender_material: bpy.types.Material, surface_style: ifcopenshell.entity_instance
|
||||
) -> None:
|
||||
surface_style = cls.surface_style_to_dict(surface_style)
|
||||
surface_style: dict[str, Any]
|
||||
|
||||
cls.create_surface_style_shading(blender_material, surface_style)
|
||||
|
||||
|
||||
@@ -112,10 +112,14 @@ class Misc(bonsai.core.tool.Misc):
|
||||
reading data and never writing, to avoid the possibility of corrupting user preferences.
|
||||
"""
|
||||
|
||||
# Byte offset of UserDef.user_menus within the UserDef C struct, per (major, minor)
|
||||
# Blender version. Shifts whenever UserDef's fields change, so must be re-derived
|
||||
# per version (e.g. from that Blender build's SDNA).
|
||||
OFFSET_USER_MENUS: dict[tuple[int, int], int] = {
|
||||
(4, 5): 10032,
|
||||
(5, 0): 10032,
|
||||
(5, 1): 10032,
|
||||
(5, 2): 10800,
|
||||
}
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -232,7 +232,7 @@ class Raycast(bonsai.core.tool.Raycast):
|
||||
return final_2d, v2
|
||||
|
||||
@classmethod
|
||||
def intersect_mouse_2d_bounding_box(cls, mouse_pos: tuple[int, int], bbox: list[float, float, float, float]):
|
||||
def intersect_mouse_2d_bounding_box(cls, mouse_pos: tuple[int, int], bbox: list[float]):
|
||||
x, y = mouse_pos
|
||||
xmin, xmax, ymin, ymax = bbox
|
||||
|
||||
|
||||
@@ -44,8 +44,6 @@ When a new Blender version is released and supported:
|
||||
|
||||
* - File
|
||||
- What to update
|
||||
* - ``.github/workflows/ci-bonsai.yml``
|
||||
- ``pyver`` matrix
|
||||
* - ``.github/workflows/ci-bonsai-daily.yml``
|
||||
- Blender download URL
|
||||
|
||||
@@ -61,6 +59,10 @@ When Blender ships with a new Python version:
|
||||
- What to update
|
||||
* - ``.github/workflows/ci-lint.yaml``
|
||||
- ``MIN_BLENDER_PY_VERSION``
|
||||
* - ``.github/workflows/ci-bonsai.yml``
|
||||
- ``pyver`` matrix
|
||||
* - ``.github/workflows/ci-bonsai-daily.yml``
|
||||
- ``pyver`` matrix
|
||||
* - ``.github/scripts/publish-bonsai-releases.py``
|
||||
- ``CURRENT_PYTHON_VERSION``
|
||||
* - ``src/bonsai/Makefile``
|
||||
|
||||
@@ -18,12 +18,6 @@ dependencies = [
|
||||
"ifcopenshell",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pytest-blender",
|
||||
"pytest-bdd",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "http://bonsaibim.org"
|
||||
Documentation = "https://docs.bonsaibim.org"
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
pytest
|
||||
pytest-blender
|
||||
pytest-bdd
|
||||
Regular → Executable
+3
-1
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Setup Bonsai Development Environment.
|
||||
|
||||
Script links existing Bonsai installation to the provided IfcOpenShell repository.
|
||||
@@ -78,7 +79,8 @@ BONSAI_PATH = find_bonsai_path()
|
||||
# ---------------------------
|
||||
|
||||
# Never changed by user.
|
||||
PYTHON_VERSION = "3.13" if BLENDER_VERSION == "5.1" else "3.11"
|
||||
BLENDER_VERSION_INT = tuple(map(int, BLENDER_VERSION.split(".")))
|
||||
PYTHON_VERSION = "3.13" if BLENDER_VERSION_INT >= (5, 1) else "3.11"
|
||||
PACKAGE_PATH = BLENDER_PATH / rf"extensions/.local/lib/python{PYTHON_VERSION}/site-packages"
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ from collections.abc import Generator
|
||||
from inspect import signature
|
||||
from math import radians
|
||||
from pathlib import Path
|
||||
from typing import Any, Union
|
||||
from typing import Any, Union, cast
|
||||
|
||||
import bpy
|
||||
import ifcopenshell
|
||||
@@ -140,7 +140,7 @@ class PanelSpy:
|
||||
else:
|
||||
props = kwargs.get("data")
|
||||
name = kwargs.get("property")
|
||||
props: bpy.types.bpy_struct
|
||||
props = cast(bpy.types.bpy_struct, props)
|
||||
text = kwargs.get("text", props.bl_rna.properties[name].name)
|
||||
icon = kwargs.get("icon", None)
|
||||
prop_type = props.bl_rna.properties[name].type
|
||||
|
||||
@@ -347,11 +347,13 @@ class TestAddDrawing:
|
||||
context="context",
|
||||
ifc_representation_class=None,
|
||||
).should_be_called().will_return("element")
|
||||
drawing.ensure_drawings_parent_group().should_be_called().will_return("drawings_parent_group")
|
||||
ifc.run("group.add_group").should_be_called().will_return("group")
|
||||
ifc.run(
|
||||
"group.edit_group", group="group", attributes={"Name": "name", "ObjectType": "DRAWING"}
|
||||
).should_be_called()
|
||||
ifc.run("group.assign_group", group="group", products=["element"]).should_be_called()
|
||||
ifc.run("group.assign_group", group="drawings_parent_group", products=["group"]).should_be_called()
|
||||
collector.assign("obj").should_be_called()
|
||||
ifc.run("pset.add_pset", product="element", name="EPset_Drawing").should_be_called().will_return("pset")
|
||||
drawing.get_default_drawing_resource_path("Stylesheet").should_be_called().will_return("stylesheet.css")
|
||||
@@ -381,8 +383,11 @@ class TestAddDrawing:
|
||||
"CurrentShadingStyle": "Blender Default",
|
||||
},
|
||||
).should_be_called()
|
||||
drawing.ensure_drawings_parent_document().should_be_called().will_return("drawings_parent_document")
|
||||
drawing.get_default_drawing_path("name").should_be_called().will_return("uri")
|
||||
ifc.run("document.add_information").should_be_called().will_return("information")
|
||||
ifc.run("document.add_information", parent="drawings_parent_document").should_be_called().will_return(
|
||||
"information"
|
||||
)
|
||||
ifc.run("document.add_reference", information="information").should_be_called().will_return("reference")
|
||||
ifc.get_schema().should_be_called().will_return("IFC4")
|
||||
ifc.run(
|
||||
@@ -406,11 +411,13 @@ class TestDuplicateDrawing:
|
||||
drawing.set_name("new_drawing", "unique_name").should_be_called()
|
||||
drawing.get_drawing_group("new_drawing").should_be_called().will_return("group")
|
||||
ifc.run("group.unassign_group", group="group", products=["new_drawing"]).should_be_called()
|
||||
drawing.ensure_drawings_parent_group().should_be_called().will_return("drawings_parent_group")
|
||||
ifc.run("group.add_group").should_be_called().will_return("new_group")
|
||||
ifc.run(
|
||||
"group.edit_group", group="new_group", attributes={"Name": "unique_name", "ObjectType": "DRAWING"}
|
||||
).should_be_called()
|
||||
ifc.run("group.assign_group", group="new_group", products=["new_drawing"]).should_be_called()
|
||||
ifc.run("group.assign_group", group="drawings_parent_group", products=["new_group"]).should_be_called()
|
||||
drawing.get_group_elements("group").should_be_called().will_return(["drawing", "annotation"])
|
||||
ifc.get_object("annotation").should_be_called().will_return("annotation_obj")
|
||||
geometry.duplicate_ifc_objects(["annotation_obj"]).should_be_called().will_return(
|
||||
@@ -425,7 +432,10 @@ class TestDuplicateDrawing:
|
||||
drawing.get_drawing_document("new_drawing").should_be_called().will_return("old_reference")
|
||||
ifc.run("document.unassign_document", products=["new_drawing"], document="old_reference").should_be_called()
|
||||
|
||||
ifc.run("document.add_information").should_be_called().will_return("information")
|
||||
drawing.ensure_drawings_parent_document().should_be_called().will_return("drawings_parent_document")
|
||||
ifc.run("document.add_information", parent="drawings_parent_document").should_be_called().will_return(
|
||||
"information"
|
||||
)
|
||||
ifc.run("document.add_reference", information="information").should_be_called().will_return("reference")
|
||||
ifc.get_schema().should_be_called().will_return("IFC4")
|
||||
drawing.get_default_drawing_path("unique_name").should_be_called().will_return("drawing_path")
|
||||
|
||||
@@ -203,6 +203,7 @@ class TestGetDebugInfo(NewFile):
|
||||
"bonsai_version",
|
||||
"bonsai_commit_hash",
|
||||
"bonsai_commit_date",
|
||||
"bonsai_git_branch",
|
||||
"last_actions",
|
||||
"last_error",
|
||||
}
|
||||
|
||||
+22
-1
@@ -21,6 +21,7 @@ import http.server
|
||||
import time
|
||||
import urllib.parse
|
||||
import uuid
|
||||
import warnings
|
||||
import webbrowser
|
||||
from typing import TYPE_CHECKING, Any, Literal, Optional, TypedDict
|
||||
|
||||
@@ -521,7 +522,17 @@ class Client:
|
||||
headers = {"User-Agent": "IfcOpenShell.bSDD.py/0.8.0"}
|
||||
if is_auth_required:
|
||||
headers["Authorization"] = "Bearer " + self.get_access_token()
|
||||
return requests.get(f"{self.baseurl}{endpoint}", timeout=10, headers=headers, params=params or None).json()
|
||||
response = requests.get(f"{self.baseurl}{endpoint}", timeout=10, headers=headers, params=params or None)
|
||||
try:
|
||||
response.raise_for_status()
|
||||
except requests.exceptions.HTTPError as e:
|
||||
try:
|
||||
data = response.json()
|
||||
message = data.get("message", data.get("error", str(e)))
|
||||
except requests.exceptions.JSONDecodeError:
|
||||
message = response.text or str(e)
|
||||
raise requests.exceptions.HTTPError(f"{e}: {message}", response=response) from e
|
||||
return response.json()
|
||||
|
||||
def _get_deprecated(self, endpoint, params=None, is_auth_required=False):
|
||||
headers = {"User-Agent": "IfcOpenShell.bSDD.py/0.8.0"}
|
||||
@@ -769,6 +780,16 @@ class Client:
|
||||
Get Class details
|
||||
this API replaces Classification
|
||||
"""
|
||||
# Not very well documented on bsdd side,
|
||||
# the deprecation note only occurs when you run into rate limit.
|
||||
# See https://github.com/buildingSMART/bSDD/issues/149
|
||||
if include_class_properties:
|
||||
warnings.warn(
|
||||
"include_class_properties=True is deprecated and heavily rate-limited by the bSDD API. "
|
||||
"Use get_class_properties() instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
endpoint = f"Class/v{version}"
|
||||
params = {
|
||||
"Uri": class_uri,
|
||||
|
||||
@@ -31,6 +31,7 @@ def test_get_nbs_classes():
|
||||
|
||||
def test_get_class():
|
||||
uri_light_fixture = next(l for l in get_ifc_classes()["classes"] if "IfcLightFixture" == l["code"])["uri"]
|
||||
# TODO: fix deprecation warning.
|
||||
ifc4x3_light_fixture = client.get_class(uri_light_fixture)
|
||||
assert "Maintenance Factor" and "Light Fixture Mounting Type" in [
|
||||
l["name"] for l in ifc4x3_light_fixture["classProperties"]
|
||||
@@ -39,7 +40,7 @@ def test_get_class():
|
||||
|
||||
def test_get_class_relations():
|
||||
uri_light_fixture = next(l for l in get_ifc_classes()["classes"] if "IfcLightFixture" == l["code"])["uri"]
|
||||
ifc4x3_light_fixture_relations = client.get_class_properties(uri_light_fixture, True)
|
||||
ifc4x3_light_fixture_relations = client.get_class_relations(uri_light_fixture, True)
|
||||
assert "Electrical unit for light-line system" and "Tubelight system" in [
|
||||
r["className"] for r in ifc4x3_light_fixture_relations["classRelations"]
|
||||
]
|
||||
|
||||
@@ -82,6 +82,11 @@ MAIN_CSV_HEADER_COLUMNS.extend(
|
||||
)
|
||||
|
||||
|
||||
class CostRate(TypedDict):
|
||||
Schedule: str | None
|
||||
RateID: str | None
|
||||
|
||||
|
||||
class CostItem(TypedDict):
|
||||
children: list[CostItem]
|
||||
ifc: NotRequired[ifcopenshell.entity_instance]
|
||||
@@ -97,6 +102,7 @@ class CostItem(TypedDict):
|
||||
Property: Union[str, None]
|
||||
Query: Union[str, None]
|
||||
|
||||
CostRate: CostRate | None
|
||||
Formula: Union[str, None]
|
||||
# QuantityClass: Union[str, None]
|
||||
|
||||
@@ -239,7 +245,7 @@ class Csv2Ifc:
|
||||
cost_values = float(cost_values) if cost_values else None
|
||||
|
||||
if self.has_rates:
|
||||
cost_rate = {
|
||||
cost_rate: CostRate = {
|
||||
"Schedule": row[(self.headers["RateSchedule"])] if "RateSchedule" in self.headers else None,
|
||||
"RateID": row[(self.headers["RateID"])] if "RateID" in self.headers else None,
|
||||
}
|
||||
|
||||
@@ -26,7 +26,8 @@ import logging
|
||||
import os
|
||||
import time
|
||||
from collections import Counter
|
||||
from typing import Optional, TypedDict, Union
|
||||
from typing import Optional, Union
|
||||
from typing_extensions import TypedDict
|
||||
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.cost
|
||||
@@ -35,7 +36,7 @@ import ifcopenshell.util.element
|
||||
import ifcopenshell.util.unit
|
||||
|
||||
|
||||
class CostItem(TypedDict):
|
||||
class CostItem(TypedDict, extra_items=float):
|
||||
# Exported columns.
|
||||
Index: int
|
||||
Hierarchy: str
|
||||
|
||||
@@ -17,6 +17,7 @@ classifiers = [
|
||||
]
|
||||
dependencies = [
|
||||
"ifcopenshell",
|
||||
"typing_extensions",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
|
||||
@@ -53,6 +53,8 @@ class ClashResult(TypedDict):
|
||||
p1: list[float]
|
||||
p2: list[float]
|
||||
distance: float
|
||||
# Added by `Clasher.smart_group_clashes`.
|
||||
smart_group: NotRequired[int]
|
||||
|
||||
|
||||
class ClashSet(TypedDict):
|
||||
@@ -286,7 +288,8 @@ class Clasher:
|
||||
|
||||
positions = []
|
||||
for clash in clashes.values():
|
||||
positions.append(clash["position"])
|
||||
# Midpoint of p1/p2 as an approximation of the clash location for clustering purposes.
|
||||
positions.append([(a + b) / 2 for a, b in zip(clash["p1"], clash["p2"])])
|
||||
|
||||
data = np.array(positions)
|
||||
|
||||
|
||||
+93
-18
@@ -18,9 +18,20 @@
|
||||
################################################################################
|
||||
|
||||
# check for 3ds Max SDK
|
||||
foreach(max_year RANGE 2014 2030)
|
||||
set(max_sdk "$ENV{ADSK_3DSMAX_SDK_${max_year}}")
|
||||
set(valid_max_years 2028 2027 2026 2025 2024 2023 2022 2021 2020 2019 2018 2017)
|
||||
|
||||
# might be dangerous to use tools 143 for all max versions
|
||||
set(max_toolset_versions_143 "2017" "2018" "2019" "2020" "2021" "2022" "2023" "2024" "2025" "2026" "2027" "2028" )
|
||||
# set(max_toolset_versions_143 "2025" "2026" "2027" "2028" )
|
||||
# set(max_toolset_versions_142 "2022" "2023" "2024" )
|
||||
# set(max_toolset_versions_141 "2020" "2021" )
|
||||
# set(max_toolset_versions_140 "2017" "2018" "2019" )
|
||||
# set(max_toolset_versions_110 "2015" "2016" )
|
||||
# set(max_toolset_versions_100 "2013" "2014" )
|
||||
# set(max_toolset_versions_90 "2010" "2011" "2012" )
|
||||
|
||||
foreach(max_year ${valid_max_years})
|
||||
set(max_sdk "$ENV{ADSK_3DSMAX_SDK_${max_year}}")
|
||||
if(NOT "${max_sdk}" STREQUAL "")
|
||||
message(STATUS "Autodesk 3ds Max SDK ${max_year} found at ${max_sdk}")
|
||||
list(APPEND FOUND_MAX_YEARS ${max_year})
|
||||
@@ -29,35 +40,58 @@ foreach(max_year RANGE 2014 2030)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(HAS_MAX)
|
||||
# build libraray for each found 3ds Max SDK
|
||||
foreach(max_year max_sdk IN ZIP_LISTS FOUND_MAX_YEARS FOUND_MAX_SDKS)
|
||||
message(STATUS "Building IFCMax library for Autodesk 3ds Max SDK ${max_year}")
|
||||
message(STATUS)
|
||||
|
||||
include_directories(
|
||||
if(HAS_MAX)
|
||||
# set depenency include and link directoris outside of MaxSDK loop
|
||||
include_directories(
|
||||
${INCLUDE_DIRECTORIES}
|
||||
${OPENCOLLADA_INCLUDE_DIRS}
|
||||
${ICU_INCLUDE_DIR}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${max_sdk}/include
|
||||
)
|
||||
|
||||
# All recent versions of 3ds Max (2014 and newer) are 64-bit only so assume lib/x64 directory
|
||||
link_directories(
|
||||
${LINK_DIRECTORIES}
|
||||
${IfcOpenShell_BINARY_DIR}
|
||||
${OPENCOLLADA_LIBRARY_DIR}
|
||||
${ICU_LIBRARY_DIR}
|
||||
${Boost_LIBRARY_DIRS}
|
||||
${max_sdk}/lib/x64/Release
|
||||
)
|
||||
|
||||
add_library(IfcMax_${max_year} SHARED IfcMax.h IfcMax.cpp)
|
||||
# Specify individual source files
|
||||
set(MAX_SOURCES
|
||||
IfcMax.h
|
||||
IfcMax.cpp
|
||||
IfcMax.rc
|
||||
resource.h
|
||||
# IfcHelper.h
|
||||
# IfcHelper.cpp
|
||||
# MaxUtils.h
|
||||
# MaxUtils.cpp
|
||||
)
|
||||
|
||||
# build library for each found 3ds Max SDK
|
||||
foreach(max_year max_sdk IN ZIP_LISTS FOUND_MAX_YEARS FOUND_MAX_SDKS)
|
||||
|
||||
# skip 3ds Max versions that do not match the vs toolset
|
||||
if( NOT ${max_year} IN_LIST max_toolset_versions_${MSVC_TOOLSET_VERSION} )
|
||||
continue()
|
||||
endif()
|
||||
|
||||
message(STATUS "Building IFCMax library for Autodesk 3ds Max SDK ${max_year}, Tier: ${BUILD_TIER_NAME}")
|
||||
|
||||
add_library(IfcMax_${max_year} SHARED ${MAX_SOURCES})
|
||||
|
||||
target_include_directories(IfcMax_${max_year} PRIVATE ${max_sdk}/include)
|
||||
|
||||
# All recent versions of 3ds Max (2014 and newer) are 64-bit only so assume lib/x64 directory
|
||||
target_link_directories(IfcMax_${max_year} PRIVATE ${max_sdk}/lib/x64/Release)
|
||||
|
||||
# TODO: find the minimal subset of 3dsmax libraries to reference
|
||||
target_link_libraries(
|
||||
IfcMax_${max_year}
|
||||
${IFCOPENSHELL_LIBRARIES}
|
||||
IfcMax_${max_year}
|
||||
${IFCOPENSHELL_LIBRARIES}
|
||||
bmm.lib
|
||||
Comctl32.lib
|
||||
core.lib
|
||||
@@ -73,8 +107,6 @@ if(HAS_MAX)
|
||||
maxnet.lib
|
||||
Maxscrpt.lib
|
||||
maxutil.lib
|
||||
MenuMan.lib
|
||||
menus.lib
|
||||
mesh.lib
|
||||
MNMath.lib
|
||||
Paramblk2.lib
|
||||
@@ -83,14 +115,57 @@ if(HAS_MAX)
|
||||
RenderUtil.lib
|
||||
tessint.lib
|
||||
viewfile.lib
|
||||
zlibdll.lib
|
||||
${OpenCASCADE_LIBRARIES}
|
||||
)
|
||||
${OPENCASCADE_LIBRARIES}
|
||||
)
|
||||
|
||||
# Note: libraries build by same major vs toolset versions are binary compatible. so v14x builds can be intermixed
|
||||
# Older Max versions using v110 or older require dependencies being build using the according toolset version ( most likely )
|
||||
if( ${max_year} IN_LIST max_toolset_versions_143 )
|
||||
set_target_properties( IfcMax_${max_year} PROPERTIES VS_PLATFORM_TOOLSET v143)
|
||||
elseif( ${max_year} IN_LIST max_toolset_versions_142 )
|
||||
set_target_properties( IfcMax_${max_year} PROPERTIES VS_PLATFORM_TOOLSET v142)
|
||||
elseif( ${max_year} IN_LIST max_toolset_versions_141 )
|
||||
set_target_properties( IfcMax_${max_year} PROPERTIES VS_PLATFORM_TOOLSET v141)
|
||||
elseif( ${max_year} IN_LIST max_toolset_versions_140 )
|
||||
set_target_properties( IfcMax_${max_year} PROPERTIES VS_PLATFORM_TOOLSET v140)
|
||||
elseif( ${max_year} IN_LIST max_toolset_versions_110 )
|
||||
set_target_properties( IfcMax_${max_year} PROPERTIES VS_PLATFORM_TOOLSET v110)
|
||||
elseif( ${max_year} IN_LIST max_toolset_versions_100 )
|
||||
set_target_properties( IfcMax_${max_year} PROPERTIES VS_PLATFORM_TOOLSET v100)
|
||||
elseif( ${max_year} IN_LIST max_toolset_versions_90 )
|
||||
set_target_properties( IfcMax_${max_year} PROPERTIES VS_PLATFORM_TOOLSET v90)
|
||||
endif()
|
||||
|
||||
# prevent minmax macro clashes occuring with ifcOpenShell v0.8
|
||||
target_compile_definitions(IfcMax_${max_year} PRIVATE NOMINMAX)
|
||||
|
||||
# fix 3ds Max 2020 SDK's "/permissive-" flag incompatibility / disables C++ language conformance mode
|
||||
if( ${max_year} EQUAL 2020 )
|
||||
set_source_files_properties( "IfcMax.cpp" PROPERTIES COMPILE_FLAGS "/permissive")
|
||||
endif()
|
||||
|
||||
# C++17 required for 3ds Max SDK 2025 and higher
|
||||
if( ${max_year} GREATER_EQUAL 2025 )
|
||||
set_target_properties(IfcMax_${max_year} PROPERTIES CXX_STANDARD 17)
|
||||
endif()
|
||||
|
||||
set_target_properties(IfcMax_${max_year} PROPERTIES SUFFIX ".dli")
|
||||
|
||||
if(BUILD_TIER_NAME)
|
||||
string(TOUPPER "${BUILD_TIER_NAME}" BUILD_TIER_NAME)
|
||||
target_compile_definitions(IfcMax_${max_year} PRIVATE BUILD_${BUILD_TIER_NAME}_TIER)
|
||||
|
||||
string(TOLOWER "${BUILD_TIER_NAME}" BUILD_TIER_lower)
|
||||
if(BUILD_TIER_lower STREQUAL "free")
|
||||
set_target_properties(IfcMax_${max_year} PROPERTIES OUTPUT_NAME "IfcMax_Free_${max_year}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
install(TARGETS IfcMax_${max_year})
|
||||
|
||||
endforeach()
|
||||
message(STATUS)
|
||||
else()
|
||||
message(STATUS "Autodesk 3ds Max SDK not found, is required to build IFCMax.")
|
||||
endif()
|
||||
|
||||
|
||||
+412
-141
@@ -22,17 +22,44 @@
|
||||
|
||||
#include <stdmat.h>
|
||||
#include <istdplug.h>
|
||||
#include <spline3d.h>
|
||||
#include <splshape.h>
|
||||
#include <hold.h>
|
||||
|
||||
// should fix a iterator missallignment assertion ?
|
||||
#define IFOPSH_WITH_ROCKSDB
|
||||
|
||||
#include "../ifcgeom/Iterator.h"
|
||||
#include "../ifcgeom/taxonomy.h"
|
||||
#include "../ifcgeom/ConversionSettings.h"
|
||||
#include "../ifcgeom/hybrid_kernel.h"
|
||||
|
||||
#include "resource.h"
|
||||
#include "IfcMax.h"
|
||||
|
||||
#include "../ifcgeom_schema_agnostic/IfcGeomIterator.h"
|
||||
#include "../ifcgeom_schema_agnostic/IfcGeomMaterial.h"
|
||||
#include "../ifcgeom/IfcGeomElement.h"
|
||||
// include those at last, as they cause compile errors regarding boost templates
|
||||
#include <maxscript/maxscript.h>
|
||||
#include <maxscript/util/listener.h>
|
||||
|
||||
|
||||
static const Class_ID IFCIMP_CLASS_ID = Class_ID(0x3f230dbf, 0x5b3015c2);
|
||||
static const TSTR IFCIMP_CLASS_NAME = _T("IFCImp");
|
||||
static const TSTR IFCIMP_CATEGORY_NAME = _T("Importer Plugins");
|
||||
|
||||
static const int NUM_MATERIAL_SLOTS = 24;
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE /*hinstDLL*/, ULONG /*fdwReason*/, LPVOID /*lpvReserved*/) {
|
||||
static HINSTANCE hInstance;
|
||||
static TCHAR *GetString(int id)
|
||||
{
|
||||
static TCHAR buf[256];
|
||||
if (hInstance)
|
||||
return LoadString(hInstance, id, buf, _countof(buf)) ? buf : NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, ULONG /*fdwReason*/, LPVOID /*lpvReserved*/) {
|
||||
static int controlsInit = false;
|
||||
hInstance = hinstDLL;
|
||||
if (!controlsInit) {
|
||||
controlsInit = true;
|
||||
InitCommonControls();
|
||||
@@ -45,65 +72,51 @@ public:
|
||||
int IsPublic() { return 1; }
|
||||
void * Create(BOOL /*loading = FALSE*/) { return new IFCImp; }
|
||||
// TODO Delete() function?
|
||||
const TCHAR * ClassName() { return _T("IFCImp"); }
|
||||
const TCHAR* ClassName() { return IFCIMP_CLASS_NAME; }
|
||||
|
||||
#if MAX_VERSION_MAJOR >= 24
|
||||
const TCHAR * NonLocalizedClassName() { return ClassName(); }
|
||||
#endif
|
||||
|
||||
SClass_ID SuperClassID() { return SCENE_IMPORT_CLASS_ID; }
|
||||
Class_ID ClassID() { return Class_ID(0x3f230dbf, 0x5b3015c2); }
|
||||
const TCHAR* Category() { return _T("Chrutilities"); }
|
||||
Class_ID ClassID() { return IFCIMP_CLASS_ID; }
|
||||
const TCHAR* Category() { return IFCIMP_CATEGORY_NAME; }
|
||||
} IFCImpDesc;
|
||||
|
||||
#define DLLEXPORT __declspec(dllexport)
|
||||
|
||||
extern "C" {
|
||||
|
||||
DLLEXPORT const TCHAR* LibDescription() {
|
||||
return _T("IfcOpenShell IFC Importer");
|
||||
}
|
||||
#if BUILD_FREE_TIER
|
||||
DLLEXPORT const TCHAR* LibDescription() { return GetString(IDS_LIBDESCRIPTION_FREE); }
|
||||
#else
|
||||
DLLEXPORT const TCHAR* LibDescription() { return GetString(IDS_LIBDESCRIPTION); }
|
||||
#endif
|
||||
|
||||
DLLEXPORT int LibNumberClasses() { return 1; }
|
||||
|
||||
DLLEXPORT ClassDesc* LibClassDesc(int i) {
|
||||
return i == 0 ? &IFCImpDesc : 0;
|
||||
}
|
||||
DLLEXPORT ClassDesc* LibClassDesc(int i) { return i == 0 ? &IFCImpDesc : 0; }
|
||||
|
||||
DLLEXPORT ULONG LibVersion() {
|
||||
return VERSION_3DSMAX;
|
||||
}
|
||||
DLLEXPORT ULONG LibVersion() { return VERSION_3DSMAX; }
|
||||
|
||||
} // extern "C"
|
||||
|
||||
int IFCImp::ExtCount() { return 1; }
|
||||
|
||||
const TCHAR * IFCImp::Ext(int n) {
|
||||
return n == 0 ? _T("IFC") : _T("");
|
||||
}
|
||||
const TCHAR * IFCImp::Ext(int n) { return n == 0 ? _T("IFC") : _T(""); }
|
||||
|
||||
const TCHAR * IFCImp::LongDesc() {
|
||||
return _T("IfcOpenShell IFC Importer for 3ds Max");
|
||||
}
|
||||
const TCHAR * IFCImp::LongDesc() { return GetString(IDS_LONG_DESCRIPTION); }
|
||||
|
||||
const TCHAR * IFCImp::ShortDesc() {
|
||||
return _T("Industry Foundation Classes");
|
||||
}
|
||||
const TCHAR * IFCImp::ShortDesc() { return GetString(IDS_SHORT_DESCRIPTION); }
|
||||
|
||||
const TCHAR * IFCImp::AuthorName() {
|
||||
return _T("Thomas Krijnen");
|
||||
}
|
||||
const TCHAR * IFCImp::AuthorName() { return GetString(IDS_AUTHOR_NAME); }
|
||||
|
||||
const TCHAR * IFCImp::CopyrightMessage() {
|
||||
return _T("Copyright (c) 2011-2016 IfcOpenShell");
|
||||
}
|
||||
const TCHAR * IFCImp::CopyrightMessage() { return GetString(IDS_COPYRIGHT_MESSAGE); }
|
||||
|
||||
const TCHAR * IFCImp::OtherMessage1() {
|
||||
return _T("");
|
||||
}
|
||||
const TCHAR * IFCImp::OtherMessage1() { return _T(""); }
|
||||
|
||||
const TCHAR * IFCImp::OtherMessage2() {
|
||||
return _T("");
|
||||
}
|
||||
const TCHAR * IFCImp::OtherMessage2() { return _T(""); }
|
||||
|
||||
unsigned int IFCImp::Version() {
|
||||
return 12;
|
||||
}
|
||||
unsigned int IFCImp::Version() { return 25; }
|
||||
|
||||
// TODO Use this in IFCImp::ShowAbout() if/when wanted
|
||||
//static BOOL CALLBACK AboutBoxDlgProc(HWND /*hWnd*/, UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/) {
|
||||
@@ -122,6 +135,40 @@ DWORD WINAPI fn(LPVOID /*arg*/) { return 0; }
|
||||
# define S(x) (CStr(x.c_str()))
|
||||
#endif
|
||||
|
||||
|
||||
// Function to log messages to the Listener
|
||||
static void LogToListener(const MCHAR* format, ...)
|
||||
{
|
||||
if (format == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
const int BUFFER_SIZE = 2048;
|
||||
static MCHAR buffer[BUFFER_SIZE];
|
||||
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
int result = _vstprintf_s(buffer, BUFFER_SIZE, format, args);
|
||||
|
||||
va_end(args);
|
||||
|
||||
#if BUILD_FREE_TIER
|
||||
if(result < 0) {
|
||||
the_listener->edit_stream->printf(_M("IfcImp[Free]: Skipped invalid log output !\n"));
|
||||
return;
|
||||
}
|
||||
the_listener->edit_stream->printf(_M("IfcImp[Free]: %s"), buffer);
|
||||
#else
|
||||
if(result < 0) {
|
||||
the_listener->edit_stream->printf(_M("IfcImp[Pro]: Skipped invalid log output !\n"));
|
||||
return;
|
||||
}
|
||||
the_listener->edit_stream->printf(_M("IfcImp[Pro]: %s"), buffer);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static Mtl* FindMaterialByName(MtlBaseLib* library, const std::string& material_name) {
|
||||
TSTR mat_name = S(material_name);
|
||||
const int mat_index = library->FindMtlByName(mat_name);
|
||||
@@ -132,27 +179,32 @@ static Mtl* FindMaterialByName(MtlBaseLib* library, const std::string& material_
|
||||
return m;
|
||||
}
|
||||
|
||||
static Mtl* FindOrCreateMaterial(MtlBaseLib* library, Interface* max_interface, int& slot, const IfcGeom::Material& material) {
|
||||
Mtl* m = FindMaterialByName(library, material.name());
|
||||
|
||||
static Mtl* FindOrCreateMaterial(MtlBaseLib* library, Interface* max_interface, int& slot, const ifcopenshell::geometry::taxonomy::style::ptr styleptr) {
|
||||
|
||||
auto& style = *styleptr;
|
||||
std::string material_name = style.name;
|
||||
|
||||
Mtl* m = FindMaterialByName(library, material_name);
|
||||
if (m == 0) {
|
||||
StdMat2* stdm = NewDefaultStdMat();
|
||||
const TimeValue t = -1;
|
||||
if (material.hasDiffuse()) {
|
||||
const double* diffuse = material.diffuse();
|
||||
stdm->SetDiffuse(Color(diffuse[0], diffuse[1], diffuse[2]),t);
|
||||
if (style.diffuse) {
|
||||
const ifcopenshell::geometry::taxonomy::colour diffuse = style.diffuse;
|
||||
stdm->SetDiffuse(Color(diffuse.r(), diffuse.g(), diffuse.b()),t);
|
||||
}
|
||||
if (material.hasSpecular()) {
|
||||
const double* specular = material.specular();
|
||||
stdm->SetSpecular(Color(specular[0], specular[1], specular[2]),t);
|
||||
if (style.specular) {
|
||||
const ifcopenshell::geometry::taxonomy::colour specular = style.specular;
|
||||
stdm->SetSpecular(Color(specular.r(), specular.g(), specular.b()),t);
|
||||
}
|
||||
if (material.hasSpecularity()) {
|
||||
stdm->SetShininess((float)material.specularity(), t);
|
||||
if (style.has_specularity()) {
|
||||
stdm->SetShininess((float)style.specularity, t);
|
||||
}
|
||||
if (material.hasTransparency()) {
|
||||
stdm->SetOpacity(1.0f - (float)material.transparency(), t);
|
||||
if (style.has_transparency()) {
|
||||
stdm->SetOpacity(1.0f - (float)style.transparency, t);
|
||||
}
|
||||
m = stdm;
|
||||
m->SetName(S(material.name()));
|
||||
m->SetName(S(material_name));
|
||||
library->Add(m);
|
||||
if (slot < NUM_MATERIAL_SLOTS) {
|
||||
max_interface->PutMtlToMtlEditor(m,slot++);
|
||||
@@ -161,18 +213,22 @@ static Mtl* FindOrCreateMaterial(MtlBaseLib* library, Interface* max_interface,
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
static Mtl* ComposeMultiMaterial(std::map<std::vector<std::string>, Mtl*>& multi_mats, MtlBaseLib* library,
|
||||
Interface* max_interface, int& slot, const std::vector<IfcGeom::Material>& materials,
|
||||
Interface* max_interface, int& slot, const std::vector<ifcopenshell::geometry::taxonomy::style::ptr> styleptrs,
|
||||
const std::string& object_type, const std::vector<int>& material_ids)
|
||||
{
|
||||
std::vector<std::string> material_names;
|
||||
bool needs_default = std::find(material_ids.begin(), material_ids.end(), -1) != material_ids.end();
|
||||
|
||||
if (needs_default) {
|
||||
material_names.push_back(object_type);
|
||||
}
|
||||
for (auto it = materials.begin(); it != materials.end(); ++it) {
|
||||
material_names.push_back(it->name());
|
||||
|
||||
for (auto it = styleptrs.begin(); it != styleptrs.end(); ++it) {
|
||||
material_names.push_back( (*it)->name);
|
||||
}
|
||||
|
||||
Mtl* default_material = 0;
|
||||
if (needs_default) {
|
||||
default_material = FindMaterialByName(library, object_type);
|
||||
@@ -185,13 +241,15 @@ static Mtl* ComposeMultiMaterial(std::map<std::vector<std::string>, Mtl*>& multi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (material_names.size() == 1) {
|
||||
if (needs_default) {
|
||||
return default_material;
|
||||
} else {
|
||||
return FindOrCreateMaterial(library, max_interface, slot, *materials.begin());
|
||||
return FindOrCreateMaterial(library, max_interface, slot, *styleptrs.begin());
|
||||
}
|
||||
}
|
||||
|
||||
std::map<std::vector<std::string>, Mtl*>::const_iterator i = multi_mats.find(material_names);
|
||||
if (i != multi_mats.end()) {
|
||||
return i->second;
|
||||
@@ -202,7 +260,7 @@ static Mtl* ComposeMultiMaterial(std::map<std::vector<std::string>, Mtl*>& multi
|
||||
if (needs_default) {
|
||||
multi_mat->SetSubMtlAndName(mtl_id ++, default_material, default_material->GetName());
|
||||
}
|
||||
for (auto it = materials.begin(); it != materials.end(); ++it) {
|
||||
for (auto it = styleptrs.begin(); it != styleptrs.end(); ++it) {
|
||||
Mtl* mtl = FindOrCreateMaterial(library, max_interface, slot, *it);
|
||||
multi_mat->SetSubMtl(mtl_id ++, mtl);
|
||||
}
|
||||
@@ -214,114 +272,327 @@ static Mtl* ComposeMultiMaterial(std::map<std::vector<std::string>, Mtl*>& multi
|
||||
return multi_mat;
|
||||
}
|
||||
|
||||
int IFCImp::DoImport(const TCHAR *name, ImpInterface *impitfc, Interface *itfc, BOOL /*suppressPrompts*/) {
|
||||
int IFCImp::DoImport(const TCHAR *file_name, ImpInterface *impitfc, Interface *ip, BOOL noPrompts ) {
|
||||
|
||||
IfcGeom::IteratorSettings settings;
|
||||
settings.set(IfcGeom::IteratorSettings::USE_WORLD_COORDS, false);
|
||||
settings.set(IfcGeom::IteratorSettings::WELD_VERTICES, true);
|
||||
settings.set(IfcGeom::IteratorSettings::SEW_SHELLS, true);
|
||||
ifcopenshell::geometry::Settings settings;
|
||||
|
||||
//settings.get<ifcopenshell::geometry::settings::MesherLinearDeflection>().value = 0.001;
|
||||
//settings.get<ifcopenshell::geometry::settings::MesherAngularDeflection>().value = 0.5;
|
||||
|
||||
|
||||
// should adapt to 3ds Max Systemm units ?
|
||||
//settings.get<ifcopenshell::geometry::settings::LengthUnit>().value = 1.0;
|
||||
//settings.get<ifcopenshell::geometry::settings::PlaneUnit>().value = 1.0;
|
||||
//settings.get<ifcopenshell::geometry::settings::Precision>().value = 0.00001;
|
||||
|
||||
//settings.get<ifcopenshell::geometry::settings::PrecisionFactor>().value = 1.0;
|
||||
//settings.get<ifcopenshell::geometry::settings::BooleanAttempt2d>().value = true;
|
||||
|
||||
//settings.get<ifcopenshell::geometry::settings::LayersetFirst>().value = false;
|
||||
//settings.get<ifcopenshell::geometry::settings::DisableBooleanResult>().value = false;
|
||||
//settings.get<ifcopenshell::geometry::settings::NoWireIntersectionCheck>().value = false;
|
||||
//settings.get<ifcopenshell::geometry::settings::NoWireIntersectionTolerance>().value = false;
|
||||
|
||||
|
||||
settings.get<ifcopenshell::geometry::settings::ReorientShells>().value = true; // should be true
|
||||
settings.get<ifcopenshell::geometry::settings::UnifyShapes>().value = true; // should be true
|
||||
settings.get<ifcopenshell::geometry::settings::UseWorldCoords>().value = false; // should be false to get a pivot with correct coordinates
|
||||
//settings.get<ifcopenshell::geometry::settings::UseMaterialNames>().value = false;
|
||||
//settings.get<ifcopenshell::geometry::settings::ConvertBackUnits>().value = false;
|
||||
|
||||
|
||||
// some settings which seem to make sense
|
||||
settings.get<ifcopenshell::geometry::settings::UseElementHierarchy>().value = true;
|
||||
settings.get<ifcopenshell::geometry::settings::BuildingLocalPlacement>().value = true; // should be true
|
||||
|
||||
// ATTENTION: breaks hierarchy positioning when active ( "site-local-placement" )
|
||||
settings.get<ifcopenshell::geometry::settings::SiteLocalPlacement>().value = false; // should be FALSE
|
||||
|
||||
// when vertex welding is enabled, normals calculation is internally disabled ( see OpenCascadeConversionResult.cpp:239 )
|
||||
settings.get<ifcopenshell::geometry::settings::WeldVertices>().value = true; // should be true
|
||||
|
||||
settings.get<ifcopenshell::geometry::settings::DontEmitNormals>().value = false;
|
||||
settings.get<ifcopenshell::geometry::settings::GenerateUvs>().value = false;
|
||||
|
||||
|
||||
settings.get<ifcopenshell::geometry::settings::CircleSegments>().value = 32; // should be 32
|
||||
settings.get<ifcopenshell::geometry::settings::EdgeArrows>().value = true;
|
||||
settings.get<ifcopenshell::geometry::settings::OutputDimensionality>().value = ifcopenshell::geometry::settings::SURFACES_AND_SOLIDS; // default is SURFACES_AND_SOLIDS
|
||||
|
||||
#ifdef _UNICODE
|
||||
int fn_buffer_size = WideCharToMultiByte(CP_UTF8, 0, name, -1, 0, 0, 0, 0);
|
||||
int fn_buffer_size = WideCharToMultiByte(CP_UTF8, 0, file_name, -1, 0, 0, 0, 0);
|
||||
char* fn_mb = new char[fn_buffer_size];
|
||||
WideCharToMultiByte(CP_UTF8, 0, name, -1, fn_mb, fn_buffer_size, 0, 0);
|
||||
WideCharToMultiByte(CP_UTF8, 0, file_name, -1, fn_mb, fn_buffer_size, 0, 0);
|
||||
#else
|
||||
const char* fn_mb = name;
|
||||
#endif
|
||||
|
||||
IfcParse::IfcFile file(fn_mb);
|
||||
IfcGeom::Iterator<float> iterator(settings, &file);
|
||||
delete fn_mb;
|
||||
if (!iterator.initialize()) return false;
|
||||
IfcParse::IfcFile file(fn_mb);
|
||||
|
||||
itfc->ProgressStart(_T("Importing file..."), TRUE, fn, NULL);
|
||||
IfcParse::file_open_status status = file.good();
|
||||
|
||||
MtlBaseLib* mats = itfc->GetSceneMtls();
|
||||
if (status != IfcParse::file_open_status::SUCCESS) {
|
||||
const MCHAR* reason = status == IfcParse::file_open_status::UNSUPPORTED_SCHEMA
|
||||
? _M("Import aborted: unsupported IFC Schema")
|
||||
: _M("Import aborted: failure parsing IFC file");
|
||||
|
||||
ip->DisplayTempPrompt( reason, 10000 );
|
||||
return false;
|
||||
}
|
||||
|
||||
auto mapped = file.instances_by_type( "IfcMappedItem" );
|
||||
auto annotations = file.instances_by_type("IfcAnnotation");
|
||||
auto solids = file.instances_by_type("IfcSolidModel");
|
||||
|
||||
// cgal kernels produce std::vector incompatiblities
|
||||
// TODO: cgal kernels produce std::vector incompatibilities -> 3ds Max asserts crashes
|
||||
// ifcopenshell::geometry::kernels::construct(&ifc_file, KernelName.at(Kernel::HybridCGALSimpleOCC), settings),
|
||||
IfcGeom::Iterator iterator(ifcopenshell::geometry::kernels::construct(&file, "opencascade", settings), settings, &file);
|
||||
|
||||
|
||||
delete[] fn_mb;
|
||||
|
||||
LogToListener(_M("Importing '%s'...\n"), file_name);
|
||||
if (!iterator.initialize()) {
|
||||
if(!iterator.had_error_processing_elements()) {
|
||||
LogToListener(_M("No elements found in '%s'...\n"), file_name);
|
||||
return IMPEXP_SUCCESS;
|
||||
}
|
||||
|
||||
LogToListener(_M("Error processing elements in '%s'...\n"), file_name);
|
||||
return IMPEXP_FAIL;
|
||||
}
|
||||
|
||||
ip->ProgressStart(_T("Importing file..."), TRUE, fn, NULL);
|
||||
|
||||
MtlBaseLib* mats = ip->GetSceneMtls();
|
||||
int slot = mats->Count();
|
||||
|
||||
std::vector<ImpNode *> impnode_cache;
|
||||
std::map<std::vector<std::string>, Mtl*> material_cache;
|
||||
|
||||
|
||||
do{
|
||||
const IfcGeom::TriangulationElement<float>* o = static_cast<const IfcGeom::TriangulationElement<float>*>(iterator.get());
|
||||
bool wasCanceled=false;
|
||||
auto startTime = std::chrono::high_resolution_clock::now();
|
||||
std::stringstream log_stream;
|
||||
|
||||
TSTR o_type = S(o->type());
|
||||
TSTR o_guid = S(o->guid());
|
||||
do {
|
||||
// clear the log
|
||||
log_stream.str("");
|
||||
|
||||
Mtl *m = ComposeMultiMaterial(material_cache, mats, itfc, slot, o->geometry().materials(), o->type(), o->geometry().material_ids());
|
||||
//const IfcGeom::Element* element = static_cast<const IfcGeom::Element*>(iterator.get());
|
||||
//const IfcGeom::BRepElement* brepElement = static_cast<const IfcGeom::BRepElement*>(iterator.get_native());
|
||||
const IfcGeom::Element* element = iterator.get();
|
||||
const IfcGeom::TriangulationElement* triElement = static_cast<const IfcGeom::TriangulationElement*>(element);
|
||||
|
||||
TriObject* tri = CreateNewTriObject();
|
||||
|
||||
const int numVerts = (int)o->geometry().verts().size()/3;
|
||||
tri->mesh.setNumVerts(numVerts);
|
||||
for( int i = 0; i < numVerts; i ++ ) {
|
||||
tri->mesh.setVert(i,o->geometry().verts()[3*i+0],o->geometry().verts()[3*i+1],o->geometry().verts()[3*i+2]);
|
||||
}
|
||||
const int numFaces = (int)o->geometry().faces().size()/3;
|
||||
tri->mesh.setNumFaces(numFaces);
|
||||
|
||||
bool needs_default = std::find(o->geometry().material_ids().begin(), o->geometry().material_ids().end(), -1) != o->geometry().material_ids().end();
|
||||
|
||||
typedef std::pair<int, int> edge_t;
|
||||
|
||||
std::set<edge_t> face_boundaries;
|
||||
for(std::vector<int>::const_iterator it = o->geometry().edges().begin(); it != o->geometry().edges().end();) {
|
||||
const int v1 = *it++;
|
||||
const int v2 = *it++;
|
||||
|
||||
const edge_t e((std::min)(v1, v2), (std::max)(v1, v2));
|
||||
face_boundaries.insert(e);
|
||||
if(triElement==nullptr)
|
||||
{
|
||||
LogToListener(_M("%3d%% - Skipping non/null TriangulationElement [#%d]\n"), iterator.progress(), element != nullptr ? element->id() : -1);
|
||||
continue;
|
||||
}
|
||||
|
||||
for( int i = 0; i < numFaces; i ++ ) {
|
||||
const int v1 = o->geometry().faces()[3*i+0];
|
||||
const int v2 = o->geometry().faces()[3*i+1];
|
||||
const int v3 = o->geometry().faces()[3*i+2];
|
||||
|
||||
const edge_t e1((std::min)(v1, v2), (std::max)(v1, v2));
|
||||
const edge_t e2((std::min)(v2, v3), (std::max)(v2, v3));
|
||||
const edge_t e3((std::min)(v3, v1), (std::max)(v3, v1));
|
||||
auto prod = triElement->product();
|
||||
TSTR e_type = TSTR::FromUTF8(triElement->type().c_str());
|
||||
TSTR e_guid = TSTR::FromUTF8(triElement->guid().c_str());
|
||||
TSTR e_name = TSTR::FromUTF8(triElement->name().c_str());
|
||||
TSTR e_idStr = TSTR(std::to_wstring(triElement->id()).c_str());
|
||||
|
||||
const bool b1 = face_boundaries.find(e1) != face_boundaries.end();
|
||||
const bool b2 = face_boundaries.find(e2) != face_boundaries.end();
|
||||
const bool b3 = face_boundaries.find(e3) != face_boundaries.end();
|
||||
|
||||
tri->mesh.faces[i].setVerts(v1, v2, v3);
|
||||
tri->mesh.faces[i].setEdgeVisFlags(b1, b2, b3);
|
||||
|
||||
MtlID mtlid = (MtlID)o->geometry().material_ids()[i];
|
||||
if (needs_default) {
|
||||
mtlid ++;
|
||||
// dump out the parent tree up to IfcProject for each element
|
||||
auto parents = triElement->parents(); // keep a persistent copy
|
||||
if (!parents.empty()) {
|
||||
for(auto it =parents.rbegin(); it != parents.rend(); ++it) {
|
||||
auto p_e = *it;
|
||||
log_stream << "->" << p_e->type() << " [#" << p_e->id() << "]";
|
||||
}
|
||||
tri->mesh.faces[i].setMatID(mtlid);
|
||||
}
|
||||
|
||||
tri->mesh.buildNormals();
|
||||
// Either use this or undefine the FACESETS_AS_COMPOUND option in IfcGeom.h to have
|
||||
// properly oriented normals. Using only the line below will result in a consistent
|
||||
// orientation of normals across shells, but not always oriented towards the
|
||||
// outside.
|
||||
// tri->mesh.UnifyNormals(false);
|
||||
tri->mesh.BuildStripsAndEdges();
|
||||
tri->mesh.InvalidateTopologyCache();
|
||||
tri->mesh.InvalidateGeomCache();
|
||||
TSTR logString = TSTR::FromUTF8(log_stream.str().c_str());
|
||||
LogToListener(_M("%3d%% - [#%d] %s: '%s' %s\n"), iterator.progress(), triElement->id(), e_type.data(), e_name.data(), logString.data());
|
||||
|
||||
ImpNode* node = impitfc->CreateNode();
|
||||
node->Reference(tri);
|
||||
node->SetName(o_guid);
|
||||
node->GetINode()->Hide(o->type() == "IfcOpeningElement" || o->type() == "IfcSpace");
|
||||
if (m) {
|
||||
node->GetINode()->SetMtl(m);
|
||||
}
|
||||
const std::vector<float>& matrix_data = o->transformation().matrix().data();
|
||||
node->SetTransform(0,Matrix3 ( Point3(matrix_data[0],matrix_data[1],matrix_data[2]),Point3(matrix_data[3],matrix_data[4],matrix_data[5]),
|
||||
Point3(matrix_data[6],matrix_data[7],matrix_data[8]),Point3(matrix_data[9],matrix_data[10],matrix_data[11]) ));
|
||||
impitfc->AddNodeToScene(node);
|
||||
Mtl *mat = ComposeMultiMaterial(material_cache, mats, ip, slot, triElement->geometry().materials(), triElement->type(), triElement->geometry().material_ids());
|
||||
|
||||
itfc->ProgressUpdate(iterator.progress(), true, _T(""));
|
||||
ImpNode* impNode = impitfc->CreateNode();
|
||||
|
||||
RefResult refSuccess = REF_INVALID;
|
||||
|
||||
auto mesh = BuildMesh(triElement);
|
||||
|
||||
if ( mesh != nullptr)
|
||||
refSuccess = impNode->Reference(mesh);
|
||||
|
||||
if (refSuccess != REF_SUCCEED) {
|
||||
LogToListener(_M("Error creating importer reference for imported element #%d.\n"), triElement->id());
|
||||
continue;
|
||||
}
|
||||
|
||||
TSTR longName;
|
||||
BuildFullName( *prod, longName);
|
||||
impNode->SetName(longName);
|
||||
|
||||
const auto& mtx = triElement->transformation().data()->ccomponents();
|
||||
impNode->SetTransform(0, Matrix3(Point3(mtx(0, 0), mtx(1, 0), mtx(2, 0)), Point3(mtx(0, 1), mtx(1, 1), mtx(2, 1)), Point3(mtx(0, 2), mtx(1, 2), mtx(2, 2)), Point3(mtx(0, 3), mtx(1, 3), mtx(2, 3))));
|
||||
|
||||
INode* inode = impNode->GetINode();
|
||||
|
||||
inode->Hide(triElement->type() == "IfcOpeningElement" || triElement->type() == "IfcSpace");
|
||||
|
||||
if (mat != nullptr) {
|
||||
inode->SetMtl(mat);
|
||||
|
||||
// set wirecolor to material color
|
||||
inode->SetWireColor(mat->GetDiffuse().toRGB());
|
||||
}
|
||||
|
||||
// add to the cache, not to the scene, thisd allows a clean exit if cancel was pressed
|
||||
impnode_cache.push_back(impNode);
|
||||
|
||||
ip->ProgressUpdate(iterator.progress(), true, _T(""));
|
||||
|
||||
if (ip->GetCancel()) {
|
||||
wasCanceled = noPrompts ? true : VerifyCancel();
|
||||
if (wasCanceled)
|
||||
break;
|
||||
else
|
||||
ip->SetCancel(false);
|
||||
}
|
||||
|
||||
} while (iterator.next());
|
||||
|
||||
itfc->ProgressEnd();
|
||||
|
||||
return true;
|
||||
ip->ProgressEnd();
|
||||
|
||||
if(wasCanceled) {
|
||||
LogToListener(_T("Import canceled by User\n"));
|
||||
return IMPEXP_CANCEL;
|
||||
}
|
||||
// add all objects to the scene
|
||||
for( int i = 0; i < impnode_cache.size(); i++ )
|
||||
impitfc->AddNodeToScene(impnode_cache[i]);
|
||||
|
||||
// Calculate the duration
|
||||
INT64 seconds = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::high_resolution_clock::now() - startTime).count();
|
||||
LogToListener(_M("Import finished in %u seconds\n"), seconds);
|
||||
|
||||
return IMPEXP_SUCCESS;
|
||||
}
|
||||
|
||||
BOOL IFCImp::VerifyCancel() {
|
||||
#if MAX_VERSION_MAJOR < 23
|
||||
return IDYES == MaxMsgBox(GetCOREInterface()->GetMAXHWnd(), GetString(IDS_IMPORT_CANCEL_MESSAGE), GetString(IDS_IMPORT_CANCEL_CAPTION), MB_YESNO);
|
||||
#else
|
||||
// new MaxMessageBox API
|
||||
return IDYES == MaxSDK::MaxMessageBox(GetCOREInterface()->GetMAXHWnd(), GetString(IDS_IMPORT_CANCEL_MESSAGE), GetString(IDS_IMPORT_CANCEL_CAPTION), MB_YESNO);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void IFCImp::BuildFullName( const IfcUtil::IfcBaseEntity& entity, MSTR& long_name)
|
||||
{
|
||||
TSTR name = TSTR::FromUTF8(entity.get_value<std::string>("Name", "").c_str());
|
||||
TSTR declName = TSTR::FromUTF8(entity.declaration().name().c_str());
|
||||
|
||||
if( _tcslen( name ) > 0) {
|
||||
long_name.printf(_M("%s/%s [#%d]"), declName.data(), name.data(), entity.id_);
|
||||
}
|
||||
else {
|
||||
long_name.printf(_M("%s [#%d]"), declName.data(), entity.id_);
|
||||
}
|
||||
}
|
||||
|
||||
TriObject* IFCImp::BuildMesh(const IfcGeom::TriangulationElement* element) {
|
||||
TriObject* tri = CreateNewTriObject();
|
||||
|
||||
const IfcGeom::Representation::Triangulation& ios_mesh = element->geometry();
|
||||
|
||||
const auto& verts = ios_mesh.verts();
|
||||
const int numVerts = (int)verts.size() / 3;
|
||||
|
||||
//const auto& normals = ios_mesh.normals();
|
||||
// const int numNormals = (int)normals.size() / 3;
|
||||
|
||||
// const auto& uvs = ios_mesh.uvs();
|
||||
// const int numUVs = (int)uvs.size() / 3;
|
||||
|
||||
|
||||
tri->mesh.setNumVerts(numVerts);
|
||||
for (int i = 0; i < numVerts; i++) {
|
||||
tri->mesh.setVert(i, Point3ByIndex(verts, i));
|
||||
//if( i < numNormals ) {
|
||||
// tri->mesh.setNormal(i, Point3ByIndex(normals, i));
|
||||
// }
|
||||
}
|
||||
|
||||
bool needs_default = std::find(ios_mesh.material_ids().begin(), ios_mesh.material_ids().end(), -1) != ios_mesh.material_ids().end();
|
||||
|
||||
typedef std::pair<int, int> edge_t;
|
||||
|
||||
std::set<edge_t> face_boundaries;
|
||||
for (std::vector<int>::const_iterator it = ios_mesh.edges().begin(); it != ios_mesh.edges().end();) {
|
||||
const int v1 = *it++;
|
||||
const int v2 = *it++;
|
||||
|
||||
const edge_t e((std::min)(v1, v2), (std::max)(v1, v2));
|
||||
face_boundaries.insert(e);
|
||||
}
|
||||
|
||||
const auto& faces = ios_mesh.faces();
|
||||
|
||||
const int numFaces = (int)faces.size() / 3;
|
||||
|
||||
tri->mesh.setNumFaces(numFaces);
|
||||
|
||||
for (int i = 0; i < numFaces; i++) {
|
||||
const int v1 = faces[3 * i + 0];
|
||||
const int v2 = faces[3 * i + 1];
|
||||
const int v3 = faces[3 * i + 2];
|
||||
|
||||
const edge_t e1((std::min)(v1, v2), (std::max)(v1, v2));
|
||||
const edge_t e2((std::min)(v2, v3), (std::max)(v2, v3));
|
||||
const edge_t e3((std::min)(v3, v1), (std::max)(v3, v1));
|
||||
|
||||
const bool b1 = face_boundaries.find(e1) != face_boundaries.end();
|
||||
const bool b2 = face_boundaries.find(e2) != face_boundaries.end();
|
||||
const bool b3 = face_boundaries.find(e3) != face_boundaries.end();
|
||||
|
||||
tri->mesh.faces[i].setVerts(v1, v2, v3);
|
||||
tri->mesh.faces[i].setEdgeVisFlags(b1, b2, b3);
|
||||
|
||||
MtlID mtlid = (MtlID)ios_mesh.material_ids()[i];
|
||||
if (needs_default) {
|
||||
mtlid++;
|
||||
}
|
||||
tri->mesh.faces[i].setMatID(mtlid);
|
||||
}
|
||||
|
||||
bool valid = tri->CheckObjectIntegrity();
|
||||
|
||||
if (!valid) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// apply simple box mapping
|
||||
#if MAX_VERSION_MAJOR < 22
|
||||
// in 3ds Max 2017-2019 SDK, Matrix3::Identity was declared in matrix3.h, but did'nt actually exist in the lib ....
|
||||
Matrix3 ident(TRUE);
|
||||
tri->mesh.ApplyUVWMap(MAP_ACAD_BOX, 1, 1, 1, 0, 0, 0, 0, ident);
|
||||
#else
|
||||
tri->mesh.ApplyUVWMap(MAP_ACAD_BOX, 1, 1, 1, 0, 0, 0, 0, Matrix3::Identity);
|
||||
#endif
|
||||
|
||||
// this one tends to crash, so we skip it for the time being
|
||||
// tri->mesh.buildNormals();
|
||||
|
||||
// Either use this or undefine the FACESETS_AS_COMPOUND option in IfcGeom.h to have
|
||||
// properly oriented normals. Using only the line below will result in a consistent
|
||||
// orientation of normals across shells, but not always oriented towards the
|
||||
// outside.
|
||||
// tri->mesh.UnifyNormals(false);
|
||||
|
||||
tri->mesh.BuildStripsAndEdges();
|
||||
tri->mesh.InvalidateTopologyCache();
|
||||
tri->mesh.InvalidateGeomCache();
|
||||
return tri;
|
||||
}
|
||||
|
||||
inline Point3 IFCImp::Point3ByIndex(const std::vector<double>& verts, int index) {
|
||||
return Point3(verts[3 * index + 0], verts[3 * index + 1], verts[3 * index + 2]);
|
||||
}
|
||||
|
||||
+19
-15
@@ -21,23 +21,27 @@
|
||||
#define IFCMAX_H
|
||||
|
||||
#include "Max.h"
|
||||
#include "../ifcgeom/IfcGeomElement.h"
|
||||
|
||||
extern ClassDesc* GetIFCImpDesc();
|
||||
class IFCImp : public SceneImport {
|
||||
public:
|
||||
int ExtCount(); // = 1
|
||||
const TCHAR* Ext(int n); // = "IFC"
|
||||
const TCHAR* LongDesc(); // = "IFC Importer for 3ds Max"
|
||||
const TCHAR* ShortDesc(); // = "Industry Foundation Classes"
|
||||
const TCHAR* AuthorName(); // = "Josef Wienerroither"
|
||||
const TCHAR* CopyrightMessage(); // = "Copyright (c) 2025 Josef Wienerroither, 2011-2016 IfcOpenShell"
|
||||
const TCHAR* OtherMessage1(); // = ""
|
||||
const TCHAR* OtherMessage2(); // = ""
|
||||
unsigned int Version(); // = 25
|
||||
void ShowAbout(HWND hWnd);
|
||||
int DoImport(const TCHAR* name, ImpInterface* ei, Interface* i, BOOL suppressPrompts);
|
||||
BOOL VerifyCancel();
|
||||
|
||||
class IFCImp : public SceneImport
|
||||
{
|
||||
public:
|
||||
int ExtCount(); // = 1
|
||||
const TCHAR * Ext(int n); // = "IFC"
|
||||
const TCHAR * LongDesc(); // = "IfcOpenShell IFC Importer for 3ds Max"
|
||||
const TCHAR * ShortDesc(); // = "Industry Foundation Classes"
|
||||
const TCHAR * AuthorName(); // = "Thomas Krijnen"
|
||||
const TCHAR * CopyrightMessage(); // = "Copyright (c) 2011-2016 IfcOpenShell"
|
||||
const TCHAR * OtherMessage1(); // = ""
|
||||
const TCHAR * OtherMessage2(); // = ""
|
||||
unsigned int Version(); // = 12
|
||||
void ShowAbout(HWND hWnd);
|
||||
int DoImport(const TCHAR *name,ImpInterface *ei,Interface *i, BOOL suppressPrompts);
|
||||
private:
|
||||
inline Point3 Point3ByIndex(const std::vector<double>& verts, int index);
|
||||
void BuildFullName(const IfcUtil::IfcBaseEntity& entity, MSTR& long_name);
|
||||
TriObject* BuildMesh(const IfcGeom::TriangulationElement* triElement);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by IfcMax.rc
|
||||
//
|
||||
#define IDS_LIBDESCRIPTION 101
|
||||
#define IDS_LIBDESCRIPTION_FREE 102
|
||||
#define IDS_SHORT_DESCRIPTION 103
|
||||
#define IDS_LONG_DESCRIPTION 104
|
||||
#define IDS_AUTHOR_NAME 105
|
||||
#define IDS_COPYRIGHT_MESSAGE 106
|
||||
#define IDS_IMPORT_CANCEL_CAPTION 107
|
||||
#define IDS_IMPORT_CANCEL_MESSAGE 108
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 102
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@@ -90,9 +90,9 @@ def add_boolean(
|
||||
|
||||
booleans = []
|
||||
for second_item in second_items:
|
||||
if first.is_a("IfcTesselatedFaceSet"):
|
||||
if first.is_a("IfcTessellatedFaceSet"):
|
||||
first.Closed = True # For now, trust the user to do the right thing.
|
||||
if second_item.is_a("IfcTesselatedFaceSet"):
|
||||
if second_item.is_a("IfcTessellatedFaceSet"):
|
||||
second_item.Closed = True # For now, trust the user to do the right thing.
|
||||
if (
|
||||
operator == "DIFFERENCE"
|
||||
|
||||
@@ -409,9 +409,9 @@ class entity_instance:
|
||||
@overload
|
||||
def is_a(self) -> str: ...
|
||||
@overload
|
||||
def is_a(self, ifc_class: str) -> bool: ...
|
||||
def is_a(self, ifc_class: str, /) -> bool: ...
|
||||
@overload
|
||||
def is_a(self, with_schema: bool) -> str: ...
|
||||
def is_a(self, with_schema: bool, /) -> str: ...
|
||||
def is_a(self, *args: Union[str, bool]) -> Union[str, bool]:
|
||||
"""Return the IFC class name of an instance, or checks if an instance belongs to a class.
|
||||
|
||||
|
||||
@@ -23,10 +23,7 @@ import itertools
|
||||
|
||||
from pyparsing import *
|
||||
|
||||
try:
|
||||
from functools import reduce
|
||||
except:
|
||||
pass
|
||||
from functools import reduce
|
||||
|
||||
|
||||
class Expression:
|
||||
@@ -97,15 +94,15 @@ PERIOD = Suppress(".")
|
||||
HASH = Suppress("#")
|
||||
|
||||
identifier = Word(alphanums + "_")
|
||||
keyword = Word(alphanums + "_").setParseAction(Keyword)
|
||||
keyword = Word(alphanums + "_").set_parse_action(Keyword)
|
||||
expression = Forward()
|
||||
optional = Group(LBRACK + expression + RBRACK).setParseAction(Optional)
|
||||
repeated = Group(LBRACE + expression + RBRACE).setParseAction(Repeated)
|
||||
terminal = quotedString.setParseAction(Terminal)
|
||||
term = (keyword | terminal | optional | repeated | (LPAREN + expression + RPAREN)).setParseAction(Term)
|
||||
concat = Group(term + OneOrMore(term)).setParseAction(Concat)
|
||||
optional = Group(LBRACK + expression + RBRACK).set_parse_action(Optional)
|
||||
repeated = Group(LBRACE + expression + RBRACE).set_parse_action(Repeated)
|
||||
terminal = quotedString.set_parse_action(Terminal)
|
||||
term = (keyword | terminal | optional | repeated | (LPAREN + expression + RPAREN)).set_parse_action(Term)
|
||||
concat = Group(term + OneOrMore(term)).set_parse_action(Concat)
|
||||
factor = concat | term
|
||||
union = Group(factor + OneOrMore(VBAR + factor)).setParseAction(Union)
|
||||
union = Group(factor + OneOrMore(VBAR + factor)).set_parse_action(Union)
|
||||
rule = identifier + EQUALS + expression + PERIOD
|
||||
|
||||
expression << (union | factor)
|
||||
@@ -113,7 +110,7 @@ expression << (union | factor)
|
||||
grammar = OneOrMore(Group(rule))
|
||||
grammar.ignore(HASH + restOfLine)
|
||||
|
||||
express = grammar.parseFile(os.path.join(os.path.dirname(__file__), "express.bnf"))
|
||||
express = grammar.parse_file(os.path.join(os.path.dirname(__file__), "express.bnf"))
|
||||
|
||||
|
||||
def find_bytype(expr, ty, li=None):
|
||||
@@ -161,6 +158,8 @@ statements = []
|
||||
|
||||
terminals = reduce(lambda x, y: x | y, (find_bytype(e, Terminal) for id, e in express))
|
||||
keywords = list(filter(operator.attrgetter("is_keyword"), terminals))
|
||||
# terminals is identity-ordered (no __eq__/__hash__), so sort for determinism
|
||||
keywords.sort(key=lambda x: repr(x))
|
||||
negated_keywords = map(lambda s: "~%s" % s, keywords)
|
||||
no_action = {
|
||||
"letter",
|
||||
@@ -185,36 +184,36 @@ while True:
|
||||
emitted.add(id)
|
||||
stmt = "(%s)" % expr
|
||||
if id in to_combine:
|
||||
stmt = " + ".join(itertools.chain(negated_keywords, ("originalTextFor(Combine%s)" % stmt,)))
|
||||
stmt = " + ".join(itertools.chain(negated_keywords, ("original_text_for(Combine%s)" % stmt,)))
|
||||
elif id in to_original_text:
|
||||
# We use lower() because it better matches the previous default of the CaselessLiterals for individual lexemes and express dictates case-insensitive comparisons anyway
|
||||
stmt = "(originalTextFor%s).addParseAction(tokenMap(str.lower))" % stmt
|
||||
stmt = "(original_text_for%s).add_parse_action(token_map(str.lower))" % stmt
|
||||
if id not in no_action and not isinstance(expr.contents, Keyword) and not id in to_combine:
|
||||
node_type = "ListNode" if "ZeroOrMore" in stmt else "Node"
|
||||
action = actions.get(id, 'lambda s, loc, t: %s(s, loc, t, rule="%s")' % (node_type, id))
|
||||
stmt = "%s.setParseAction(%s)" % (stmt, action)
|
||||
stmt = "%s.set_parse_action(%s)" % (stmt, action)
|
||||
statements.append('%s = %s("%s")' % (id, stmt, id))
|
||||
to_emit -= emitted_in_loop
|
||||
if not emitted_in_loop:
|
||||
break
|
||||
|
||||
for id in to_emit:
|
||||
for id in sorted(to_emit):
|
||||
statements.append('%s = Forward()("%s")' % (id, id))
|
||||
|
||||
for id in to_emit:
|
||||
for id in sorted(to_emit):
|
||||
expr = [e for k, e in express if k == id][0]
|
||||
stmt = "(%s)" % expr
|
||||
if id in to_combine:
|
||||
stmt = "Suppress%s" % stmt
|
||||
elif id in to_original_text:
|
||||
stmt = "(originalTextFor%s).addParseAction(tokenMap(str.lower))" % stmt
|
||||
stmt = "(original_text_for%s).add_parse_action(token_map(str.lower))" % stmt
|
||||
if id not in no_action and not isinstance(expr.contents, Keyword):
|
||||
children = list(
|
||||
map(operator.attrgetter("contents"), reduce(lambda x, y: x | y, (find_bytype(e, Keyword) for e in [expr])))
|
||||
)
|
||||
has_duplicates = len(children) > len(set(children))
|
||||
node_type = "ListNode" if ("ZeroOrMore" in stmt or has_duplicates) else "Node"
|
||||
action = ".setParseAction(%s)" % (
|
||||
action = ".set_parse_action(%s)" % (
|
||||
actions[id] if id in actions else 'lambda s, loc, t: %s(s, loc, t, rule="%s")' % (node_type, id)
|
||||
)
|
||||
stmt = "(%s)%s" % (stmt, action)
|
||||
@@ -222,7 +221,7 @@ for id in to_emit:
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(r"""
|
||||
# This file is generated by IfcOpenShell ifcexpressparser bootstrap.py
|
||||
# This file is generated by ifcopenshell.express.bootstrap
|
||||
|
||||
from __future__ import annotations
|
||||
import os
|
||||
@@ -240,19 +239,19 @@ def parse(fn: str) -> mapping.Mapping:
|
||||
if os.path.exists(cache_file) and os.path.getmtime(cache_file) >= os.path.getmtime(fn):
|
||||
with open(cache_file, "rb") as f:
|
||||
m = pickle.load(f)
|
||||
else:
|
||||
else:
|
||||
%s
|
||||
|
||||
syntax.ignore("--" + restOfLine)
|
||||
syntax.ignore(Regex(r"\((?:\*(?:[^*]*\*+)+?\))"))
|
||||
ast = syntax.parseFile(fn)
|
||||
ast = syntax.parse_file(fn)
|
||||
s = schema.Schema(ast)
|
||||
m = mapping.Mapping(s)
|
||||
|
||||
with open(cache_file, "wb") as f:
|
||||
pickle.dump(m, f, protocol=0)
|
||||
return m
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
m = parse(sys.argv[1])
|
||||
import importlib
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
import itertools
|
||||
import functools
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def indent(n, s):
|
||||
@@ -36,15 +37,4 @@ class Base:
|
||||
"""
|
||||
|
||||
def emit(self):
|
||||
import platform
|
||||
|
||||
if tuple(map(int, platform.python_version_tuple())) < (2, 8):
|
||||
from io import open as unicode_open
|
||||
|
||||
unicode_type = unicode
|
||||
else:
|
||||
unicode_open = open
|
||||
unicode_type = lambda x, *args, **kwargs: x
|
||||
f = unicode_open(self.file_name, "w", encoding="utf-8")
|
||||
f.write(unicode_type(repr(self), encoding="utf-8", errors="ignore"))
|
||||
f.close()
|
||||
Path(self.file_name).write_text(repr(self), encoding="utf-8")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
# This file is generated by IfcOpenShell ifcexpressparser bootstrap.py
|
||||
# This file is generated by ifcopenshell.express.bootstrap
|
||||
|
||||
from __future__ import annotations
|
||||
import os
|
||||
@@ -17,184 +17,184 @@ def parse(fn: str) -> mapping.Mapping:
|
||||
if os.path.exists(cache_file) and os.path.getmtime(cache_file) >= os.path.getmtime(fn):
|
||||
with open(cache_file, "rb") as f:
|
||||
m = pickle.load(f)
|
||||
else:
|
||||
ABS = (CaselessKeyword("abs")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ABS"))("ABS")
|
||||
ABSTRACT = (CaselessKeyword("abstract")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ABSTRACT"))("ABSTRACT")
|
||||
ACOS = (CaselessKeyword("acos")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ACOS"))("ACOS")
|
||||
AGGREGATE = (CaselessKeyword("aggregate")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="AGGREGATE"))("AGGREGATE")
|
||||
ALIAS = (CaselessKeyword("alias")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ALIAS"))("ALIAS")
|
||||
AND = (CaselessKeyword("and")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="AND"))("AND")
|
||||
ANDOR = (CaselessKeyword("andor")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ANDOR"))("ANDOR")
|
||||
ARRAY = (CaselessKeyword("array")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ARRAY"))("ARRAY")
|
||||
AS = (CaselessKeyword("as")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="AS"))("AS")
|
||||
ASIN = (CaselessKeyword("asin")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ASIN"))("ASIN")
|
||||
ATAN = (CaselessKeyword("atan")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ATAN"))("ATAN")
|
||||
BAG = (CaselessKeyword("bag")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BAG"))("BAG")
|
||||
BASED_ON = (CaselessKeyword("based_on")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BASED_ON"))("BASED_ON")
|
||||
BEGIN = (CaselessKeyword("begin")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BEGIN"))("BEGIN")
|
||||
BINARY = (CaselessKeyword("binary")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BINARY"))("BINARY")
|
||||
BLENGTH = (CaselessKeyword("blength")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BLENGTH"))("BLENGTH")
|
||||
BOOLEAN = (CaselessKeyword("boolean")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BOOLEAN"))("BOOLEAN")
|
||||
BY = (CaselessKeyword("by")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BY"))("BY")
|
||||
CASE = (CaselessKeyword("case")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="CASE"))("CASE")
|
||||
CONSTANT = (CaselessKeyword("constant")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="CONSTANT"))("CONSTANT")
|
||||
CONST_E = (CaselessKeyword("const_e")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="CONST_E"))("CONST_E")
|
||||
COS = (CaselessKeyword("cos")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="COS"))("COS")
|
||||
DERIVE = (CaselessKeyword("derive")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="DERIVE"))("DERIVE")
|
||||
DIV = (CaselessKeyword("div")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="DIV"))("DIV")
|
||||
ELSE = (CaselessKeyword("else")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ELSE"))("ELSE")
|
||||
END = (CaselessKeyword("end")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END"))("END")
|
||||
END_ALIAS = (CaselessKeyword("end_alias")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_ALIAS"))("END_ALIAS")
|
||||
END_CASE = (CaselessKeyword("end_case")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_CASE"))("END_CASE")
|
||||
END_CONSTANT = (CaselessKeyword("end_constant")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_CONSTANT"))("END_CONSTANT")
|
||||
END_ENTITY = (CaselessKeyword("end_entity")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_ENTITY"))("END_ENTITY")
|
||||
END_FUNCTION = (CaselessKeyword("end_function")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_FUNCTION"))("END_FUNCTION")
|
||||
END_IF = (CaselessKeyword("end_if")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_IF"))("END_IF")
|
||||
END_LOCAL = (CaselessKeyword("end_local")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_LOCAL"))("END_LOCAL")
|
||||
END_PROCEDURE = (CaselessKeyword("end_procedure")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_PROCEDURE"))("END_PROCEDURE")
|
||||
END_REPEAT = (CaselessKeyword("end_repeat")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_REPEAT"))("END_REPEAT")
|
||||
END_RULE = (CaselessKeyword("end_rule")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_RULE"))("END_RULE")
|
||||
END_SCHEMA = (CaselessKeyword("end_schema")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_SCHEMA"))("END_SCHEMA")
|
||||
END_SUBTYPE_CONSTRAINT = (CaselessKeyword("end_subtype_constraint")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_SUBTYPE_CONSTRAINT"))("END_SUBTYPE_CONSTRAINT")
|
||||
END_TYPE = (CaselessKeyword("end_type")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_TYPE"))("END_TYPE")
|
||||
ENTITY = (CaselessKeyword("entity")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ENTITY"))("ENTITY")
|
||||
ENUMERATION = (CaselessKeyword("enumeration")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ENUMERATION"))("ENUMERATION")
|
||||
ESCAPE = (CaselessKeyword("escape")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ESCAPE"))("ESCAPE")
|
||||
EXISTS = (CaselessKeyword("exists")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="EXISTS"))("EXISTS")
|
||||
EXTENSIBLE = (CaselessKeyword("extensible")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="EXTENSIBLE"))("EXTENSIBLE")
|
||||
EXP = (CaselessKeyword("exp")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="EXP"))("EXP")
|
||||
FALSE = (CaselessKeyword("false")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FALSE"))("FALSE")
|
||||
FIXED = (CaselessKeyword("fixed")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FIXED"))("FIXED")
|
||||
FOR = (CaselessKeyword("for")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FOR"))("FOR")
|
||||
FORMAT = (CaselessKeyword("format")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FORMAT"))("FORMAT")
|
||||
FROM = (CaselessKeyword("from")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FROM"))("FROM")
|
||||
FUNCTION = (CaselessKeyword("function")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FUNCTION"))("FUNCTION")
|
||||
GENERIC = (CaselessKeyword("generic")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="GENERIC"))("GENERIC")
|
||||
GENERIC_ENTITY = (CaselessKeyword("generic_entity")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="GENERIC_ENTITY"))("GENERIC_ENTITY")
|
||||
HIBOUND = (CaselessKeyword("hibound")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="HIBOUND"))("HIBOUND")
|
||||
HIINDEX = (CaselessKeyword("hiindex")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="HIINDEX"))("HIINDEX")
|
||||
IF = (CaselessKeyword("if")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="IF"))("IF")
|
||||
IN = (CaselessKeyword("in")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="IN"))("IN")
|
||||
INSERT = (CaselessKeyword("insert")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="INSERT"))("INSERT")
|
||||
INTEGER = (CaselessKeyword("integer")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="INTEGER"))("INTEGER")
|
||||
INVERSE = (CaselessKeyword("inverse")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="INVERSE"))("INVERSE")
|
||||
LENGTH = (CaselessKeyword("length")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LENGTH"))("LENGTH")
|
||||
LIKE = (CaselessKeyword("like")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LIKE"))("LIKE")
|
||||
LIST = (CaselessKeyword("list")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LIST"))("LIST")
|
||||
LOBOUND = (CaselessKeyword("lobound")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOBOUND"))("LOBOUND")
|
||||
LOCAL = (CaselessKeyword("local")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOCAL"))("LOCAL")
|
||||
LOG = (CaselessKeyword("log")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOG"))("LOG")
|
||||
LOG10 = (CaselessKeyword("log10")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOG10"))("LOG10")
|
||||
LOG2 = (CaselessKeyword("log2")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOG2"))("LOG2")
|
||||
LOGICAL = (CaselessKeyword("logical")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOGICAL"))("LOGICAL")
|
||||
LOINDEX = (CaselessKeyword("loindex")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOINDEX"))("LOINDEX")
|
||||
MOD = (CaselessKeyword("mod")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="MOD"))("MOD")
|
||||
NOT = (CaselessKeyword("not")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="NOT"))("NOT")
|
||||
NUMBER = (CaselessKeyword("number")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="NUMBER"))("NUMBER")
|
||||
NVL = (CaselessKeyword("nvl")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="NVL"))("NVL")
|
||||
ODD = (CaselessKeyword("odd")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ODD"))("ODD")
|
||||
OF = (CaselessKeyword("of")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="OF"))("OF")
|
||||
ONEOF = (CaselessKeyword("oneof")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ONEOF"))("ONEOF")
|
||||
OPTIONAL = (CaselessKeyword("optional")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="OPTIONAL"))("OPTIONAL")
|
||||
OR = (CaselessKeyword("or")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="OR"))("OR")
|
||||
OTHERWISE = (CaselessKeyword("otherwise")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="OTHERWISE"))("OTHERWISE")
|
||||
PI = (CaselessKeyword("pi")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="PI"))("PI")
|
||||
PROCEDURE = (CaselessKeyword("procedure")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="PROCEDURE"))("PROCEDURE")
|
||||
QUERY = (CaselessKeyword("query")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="QUERY"))("QUERY")
|
||||
REAL = (CaselessKeyword("real")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="REAL"))("REAL")
|
||||
REFERENCE = (CaselessKeyword("reference")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="REFERENCE"))("REFERENCE")
|
||||
REMOVE = (CaselessKeyword("remove")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="REMOVE"))("REMOVE")
|
||||
RENAMED = (CaselessKeyword("renamed")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="RENAMED"))("RENAMED")
|
||||
REPEAT = (CaselessKeyword("repeat")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="REPEAT"))("REPEAT")
|
||||
RETURN = (CaselessKeyword("return")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="RETURN"))("RETURN")
|
||||
ROLESOF = (CaselessKeyword("rolesof")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ROLESOF"))("ROLESOF")
|
||||
RULE = (CaselessKeyword("rule")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="RULE"))("RULE")
|
||||
SCHEMA = (CaselessKeyword("schema")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SCHEMA"))("SCHEMA")
|
||||
SELECT = (CaselessKeyword("select")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SELECT"))("SELECT")
|
||||
SELF = (CaselessKeyword("self")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SELF"))("SELF")
|
||||
SET = (CaselessKeyword("set")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SET"))("SET")
|
||||
SIN = (CaselessKeyword("sin")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SIN"))("SIN")
|
||||
SIZEOF = (CaselessKeyword("sizeof")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SIZEOF"))("SIZEOF")
|
||||
SKIP = (CaselessKeyword("skip")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SKIP"))("SKIP")
|
||||
SQRT = (CaselessKeyword("sqrt")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SQRT"))("SQRT")
|
||||
STRING = (CaselessKeyword("string")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="STRING"))("STRING")
|
||||
SUBTYPE = (CaselessKeyword("subtype")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SUBTYPE"))("SUBTYPE")
|
||||
SUBTYPE_CONSTRAINT = (CaselessKeyword("subtype_constraint")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SUBTYPE_CONSTRAINT"))("SUBTYPE_CONSTRAINT")
|
||||
SUPERTYPE = (CaselessKeyword("supertype")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SUPERTYPE"))("SUPERTYPE")
|
||||
TAN = (CaselessKeyword("tan")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TAN"))("TAN")
|
||||
THEN = (CaselessKeyword("then")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="THEN"))("THEN")
|
||||
TO = (CaselessKeyword("to")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TO"))("TO")
|
||||
TOTAL_OVER = (CaselessKeyword("total_over")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TOTAL_OVER"))("TOTAL_OVER")
|
||||
TRUE = (CaselessKeyword("true")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TRUE"))("TRUE")
|
||||
TYPE = (CaselessKeyword("type")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TYPE"))("TYPE")
|
||||
TYPEOF = (CaselessKeyword("typeof")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TYPEOF"))("TYPEOF")
|
||||
UNIQUE = (CaselessKeyword("unique")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="UNIQUE"))("UNIQUE")
|
||||
UNKNOWN = (CaselessKeyword("unknown")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="UNKNOWN"))("UNKNOWN")
|
||||
UNTIL = (CaselessKeyword("until")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="UNTIL"))("UNTIL")
|
||||
USE = (CaselessKeyword("use")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="USE"))("USE")
|
||||
USEDIN = (CaselessKeyword("usedin")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="USEDIN"))("USEDIN")
|
||||
VALUE = (CaselessKeyword("value")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="VALUE"))("VALUE")
|
||||
VALUE_IN = (CaselessKeyword("value_in")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="VALUE_IN"))("VALUE_IN")
|
||||
VALUE_UNIQUE = (CaselessKeyword("value_unique")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="VALUE_UNIQUE"))("VALUE_UNIQUE")
|
||||
VAR = (CaselessKeyword("var")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="VAR"))("VAR")
|
||||
WHERE = (CaselessKeyword("where")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="WHERE"))("WHERE")
|
||||
WHILE = (CaselessKeyword("while")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="WHILE"))("WHILE")
|
||||
WITH = (CaselessKeyword("with")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="WITH"))("WITH")
|
||||
XOR = (CaselessKeyword("xor")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="XOR"))("XOR")
|
||||
bit = ((CaselessLiteral("0") | CaselessLiteral("1"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="bit"))("bit")
|
||||
else:
|
||||
ABS = (CaselessKeyword("abs")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ABS"))("ABS")
|
||||
ABSTRACT = (CaselessKeyword("abstract")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ABSTRACT"))("ABSTRACT")
|
||||
ACOS = (CaselessKeyword("acos")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ACOS"))("ACOS")
|
||||
AGGREGATE = (CaselessKeyword("aggregate")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="AGGREGATE"))("AGGREGATE")
|
||||
ALIAS = (CaselessKeyword("alias")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ALIAS"))("ALIAS")
|
||||
AND = (CaselessKeyword("and")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="AND"))("AND")
|
||||
ANDOR = (CaselessKeyword("andor")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ANDOR"))("ANDOR")
|
||||
ARRAY = (CaselessKeyword("array")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ARRAY"))("ARRAY")
|
||||
AS = (CaselessKeyword("as")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="AS"))("AS")
|
||||
ASIN = (CaselessKeyword("asin")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ASIN"))("ASIN")
|
||||
ATAN = (CaselessKeyword("atan")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ATAN"))("ATAN")
|
||||
BAG = (CaselessKeyword("bag")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BAG"))("BAG")
|
||||
BASED_ON = (CaselessKeyword("based_on")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BASED_ON"))("BASED_ON")
|
||||
BEGIN = (CaselessKeyword("begin")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BEGIN"))("BEGIN")
|
||||
BINARY = (CaselessKeyword("binary")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BINARY"))("BINARY")
|
||||
BLENGTH = (CaselessKeyword("blength")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BLENGTH"))("BLENGTH")
|
||||
BOOLEAN = (CaselessKeyword("boolean")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BOOLEAN"))("BOOLEAN")
|
||||
BY = (CaselessKeyword("by")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BY"))("BY")
|
||||
CASE = (CaselessKeyword("case")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="CASE"))("CASE")
|
||||
CONSTANT = (CaselessKeyword("constant")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="CONSTANT"))("CONSTANT")
|
||||
CONST_E = (CaselessKeyword("const_e")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="CONST_E"))("CONST_E")
|
||||
COS = (CaselessKeyword("cos")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="COS"))("COS")
|
||||
DERIVE = (CaselessKeyword("derive")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="DERIVE"))("DERIVE")
|
||||
DIV = (CaselessKeyword("div")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="DIV"))("DIV")
|
||||
ELSE = (CaselessKeyword("else")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ELSE"))("ELSE")
|
||||
END = (CaselessKeyword("end")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END"))("END")
|
||||
END_ALIAS = (CaselessKeyword("end_alias")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_ALIAS"))("END_ALIAS")
|
||||
END_CASE = (CaselessKeyword("end_case")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_CASE"))("END_CASE")
|
||||
END_CONSTANT = (CaselessKeyword("end_constant")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_CONSTANT"))("END_CONSTANT")
|
||||
END_ENTITY = (CaselessKeyword("end_entity")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_ENTITY"))("END_ENTITY")
|
||||
END_FUNCTION = (CaselessKeyword("end_function")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_FUNCTION"))("END_FUNCTION")
|
||||
END_IF = (CaselessKeyword("end_if")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_IF"))("END_IF")
|
||||
END_LOCAL = (CaselessKeyword("end_local")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_LOCAL"))("END_LOCAL")
|
||||
END_PROCEDURE = (CaselessKeyword("end_procedure")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_PROCEDURE"))("END_PROCEDURE")
|
||||
END_REPEAT = (CaselessKeyword("end_repeat")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_REPEAT"))("END_REPEAT")
|
||||
END_RULE = (CaselessKeyword("end_rule")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_RULE"))("END_RULE")
|
||||
END_SCHEMA = (CaselessKeyword("end_schema")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_SCHEMA"))("END_SCHEMA")
|
||||
END_SUBTYPE_CONSTRAINT = (CaselessKeyword("end_subtype_constraint")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_SUBTYPE_CONSTRAINT"))("END_SUBTYPE_CONSTRAINT")
|
||||
END_TYPE = (CaselessKeyword("end_type")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_TYPE"))("END_TYPE")
|
||||
ENTITY = (CaselessKeyword("entity")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ENTITY"))("ENTITY")
|
||||
ENUMERATION = (CaselessKeyword("enumeration")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ENUMERATION"))("ENUMERATION")
|
||||
ESCAPE = (CaselessKeyword("escape")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ESCAPE"))("ESCAPE")
|
||||
EXISTS = (CaselessKeyword("exists")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="EXISTS"))("EXISTS")
|
||||
EXTENSIBLE = (CaselessKeyword("extensible")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="EXTENSIBLE"))("EXTENSIBLE")
|
||||
EXP = (CaselessKeyword("exp")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="EXP"))("EXP")
|
||||
FALSE = (CaselessKeyword("false")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FALSE"))("FALSE")
|
||||
FIXED = (CaselessKeyword("fixed")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FIXED"))("FIXED")
|
||||
FOR = (CaselessKeyword("for")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FOR"))("FOR")
|
||||
FORMAT = (CaselessKeyword("format")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FORMAT"))("FORMAT")
|
||||
FROM = (CaselessKeyword("from")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FROM"))("FROM")
|
||||
FUNCTION = (CaselessKeyword("function")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FUNCTION"))("FUNCTION")
|
||||
GENERIC = (CaselessKeyword("generic")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="GENERIC"))("GENERIC")
|
||||
GENERIC_ENTITY = (CaselessKeyword("generic_entity")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="GENERIC_ENTITY"))("GENERIC_ENTITY")
|
||||
HIBOUND = (CaselessKeyword("hibound")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="HIBOUND"))("HIBOUND")
|
||||
HIINDEX = (CaselessKeyword("hiindex")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="HIINDEX"))("HIINDEX")
|
||||
IF = (CaselessKeyword("if")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="IF"))("IF")
|
||||
IN = (CaselessKeyword("in")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="IN"))("IN")
|
||||
INSERT = (CaselessKeyword("insert")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="INSERT"))("INSERT")
|
||||
INTEGER = (CaselessKeyword("integer")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="INTEGER"))("INTEGER")
|
||||
INVERSE = (CaselessKeyword("inverse")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="INVERSE"))("INVERSE")
|
||||
LENGTH = (CaselessKeyword("length")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LENGTH"))("LENGTH")
|
||||
LIKE = (CaselessKeyword("like")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LIKE"))("LIKE")
|
||||
LIST = (CaselessKeyword("list")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LIST"))("LIST")
|
||||
LOBOUND = (CaselessKeyword("lobound")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOBOUND"))("LOBOUND")
|
||||
LOCAL = (CaselessKeyword("local")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOCAL"))("LOCAL")
|
||||
LOG = (CaselessKeyword("log")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOG"))("LOG")
|
||||
LOG10 = (CaselessKeyword("log10")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOG10"))("LOG10")
|
||||
LOG2 = (CaselessKeyword("log2")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOG2"))("LOG2")
|
||||
LOGICAL = (CaselessKeyword("logical")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOGICAL"))("LOGICAL")
|
||||
LOINDEX = (CaselessKeyword("loindex")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOINDEX"))("LOINDEX")
|
||||
MOD = (CaselessKeyword("mod")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="MOD"))("MOD")
|
||||
NOT = (CaselessKeyword("not")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="NOT"))("NOT")
|
||||
NUMBER = (CaselessKeyword("number")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="NUMBER"))("NUMBER")
|
||||
NVL = (CaselessKeyword("nvl")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="NVL"))("NVL")
|
||||
ODD = (CaselessKeyword("odd")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ODD"))("ODD")
|
||||
OF = (CaselessKeyword("of")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="OF"))("OF")
|
||||
ONEOF = (CaselessKeyword("oneof")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ONEOF"))("ONEOF")
|
||||
OPTIONAL = (CaselessKeyword("optional")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="OPTIONAL"))("OPTIONAL")
|
||||
OR = (CaselessKeyword("or")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="OR"))("OR")
|
||||
OTHERWISE = (CaselessKeyword("otherwise")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="OTHERWISE"))("OTHERWISE")
|
||||
PI = (CaselessKeyword("pi")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="PI"))("PI")
|
||||
PROCEDURE = (CaselessKeyword("procedure")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="PROCEDURE"))("PROCEDURE")
|
||||
QUERY = (CaselessKeyword("query")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="QUERY"))("QUERY")
|
||||
REAL = (CaselessKeyword("real")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="REAL"))("REAL")
|
||||
REFERENCE = (CaselessKeyword("reference")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="REFERENCE"))("REFERENCE")
|
||||
REMOVE = (CaselessKeyword("remove")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="REMOVE"))("REMOVE")
|
||||
RENAMED = (CaselessKeyword("renamed")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="RENAMED"))("RENAMED")
|
||||
REPEAT = (CaselessKeyword("repeat")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="REPEAT"))("REPEAT")
|
||||
RETURN = (CaselessKeyword("return")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="RETURN"))("RETURN")
|
||||
ROLESOF = (CaselessKeyword("rolesof")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ROLESOF"))("ROLESOF")
|
||||
RULE = (CaselessKeyword("rule")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="RULE"))("RULE")
|
||||
SCHEMA = (CaselessKeyword("schema")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SCHEMA"))("SCHEMA")
|
||||
SELECT = (CaselessKeyword("select")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SELECT"))("SELECT")
|
||||
SELF = (CaselessKeyword("self")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SELF"))("SELF")
|
||||
SET = (CaselessKeyword("set")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SET"))("SET")
|
||||
SIN = (CaselessKeyword("sin")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SIN"))("SIN")
|
||||
SIZEOF = (CaselessKeyword("sizeof")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SIZEOF"))("SIZEOF")
|
||||
SKIP = (CaselessKeyword("skip")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SKIP"))("SKIP")
|
||||
SQRT = (CaselessKeyword("sqrt")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SQRT"))("SQRT")
|
||||
STRING = (CaselessKeyword("string")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="STRING"))("STRING")
|
||||
SUBTYPE = (CaselessKeyword("subtype")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SUBTYPE"))("SUBTYPE")
|
||||
SUBTYPE_CONSTRAINT = (CaselessKeyword("subtype_constraint")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SUBTYPE_CONSTRAINT"))("SUBTYPE_CONSTRAINT")
|
||||
SUPERTYPE = (CaselessKeyword("supertype")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SUPERTYPE"))("SUPERTYPE")
|
||||
TAN = (CaselessKeyword("tan")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TAN"))("TAN")
|
||||
THEN = (CaselessKeyword("then")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="THEN"))("THEN")
|
||||
TO = (CaselessKeyword("to")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TO"))("TO")
|
||||
TOTAL_OVER = (CaselessKeyword("total_over")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TOTAL_OVER"))("TOTAL_OVER")
|
||||
TRUE = (CaselessKeyword("true")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TRUE"))("TRUE")
|
||||
TYPE = (CaselessKeyword("type")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TYPE"))("TYPE")
|
||||
TYPEOF = (CaselessKeyword("typeof")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TYPEOF"))("TYPEOF")
|
||||
UNIQUE = (CaselessKeyword("unique")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="UNIQUE"))("UNIQUE")
|
||||
UNKNOWN = (CaselessKeyword("unknown")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="UNKNOWN"))("UNKNOWN")
|
||||
UNTIL = (CaselessKeyword("until")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="UNTIL"))("UNTIL")
|
||||
USE = (CaselessKeyword("use")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="USE"))("USE")
|
||||
USEDIN = (CaselessKeyword("usedin")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="USEDIN"))("USEDIN")
|
||||
VALUE = (CaselessKeyword("value")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="VALUE"))("VALUE")
|
||||
VALUE_IN = (CaselessKeyword("value_in")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="VALUE_IN"))("VALUE_IN")
|
||||
VALUE_UNIQUE = (CaselessKeyword("value_unique")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="VALUE_UNIQUE"))("VALUE_UNIQUE")
|
||||
VAR = (CaselessKeyword("var")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="VAR"))("VAR")
|
||||
WHERE = (CaselessKeyword("where")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="WHERE"))("WHERE")
|
||||
WHILE = (CaselessKeyword("while")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="WHILE"))("WHILE")
|
||||
WITH = (CaselessKeyword("with")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="WITH"))("WITH")
|
||||
XOR = (CaselessKeyword("xor")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="XOR"))("XOR")
|
||||
bit = ((CaselessLiteral("0") | CaselessLiteral("1"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="bit"))("bit")
|
||||
digit = ((CaselessLiteral("0") | CaselessLiteral("1") | CaselessLiteral("2") | CaselessLiteral("3") | CaselessLiteral("4") | CaselessLiteral("5") | CaselessLiteral("6") | CaselessLiteral("7") | CaselessLiteral("8") | CaselessLiteral("9")))("digit")
|
||||
digits = ((digit + ZeroOrMore(digit)))("digits")
|
||||
hex_digit = ((digit | CaselessLiteral("a") | CaselessLiteral("b") | CaselessLiteral("c") | CaselessLiteral("d") | CaselessLiteral("e") | CaselessLiteral("f"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="hex_digit"))("hex_digit")
|
||||
hex_digit = ((digit | CaselessLiteral("a") | CaselessLiteral("b") | CaselessLiteral("c") | CaselessLiteral("d") | CaselessLiteral("e") | CaselessLiteral("f"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="hex_digit"))("hex_digit")
|
||||
letter = ((CaselessLiteral("a") | CaselessLiteral("b") | CaselessLiteral("c") | CaselessLiteral("d") | CaselessLiteral("e") | CaselessLiteral("f") | CaselessLiteral("g") | CaselessLiteral("h") | CaselessLiteral("i") | CaselessLiteral("j") | CaselessLiteral("k") | CaselessLiteral("l") | CaselessLiteral("m") | CaselessLiteral("n") | CaselessLiteral("o") | CaselessLiteral("p") | CaselessLiteral("q") | CaselessLiteral("r") | CaselessLiteral("s") | CaselessLiteral("t") | CaselessLiteral("u") | CaselessLiteral("v") | CaselessLiteral("w") | CaselessLiteral("x") | CaselessLiteral("y") | CaselessLiteral("z")))("letter")
|
||||
not_paren_star_quote_special = ((CaselessLiteral("!") | CaselessLiteral("#") | CaselessLiteral("$") | CaselessLiteral("%") | CaselessLiteral("&") | CaselessLiteral("+") | CaselessLiteral(",") | CaselessLiteral("-") | CaselessLiteral(".") | CaselessLiteral("/") | CaselessLiteral(":") | CaselessLiteral(";") | CaselessLiteral("<") | CaselessLiteral("=") | CaselessLiteral(">") | CaselessLiteral("?") | CaselessLiteral("@") | CaselessLiteral("[") | CaselessLiteral("\\") | CaselessLiteral("]") | CaselessLiteral("^") | CaselessLiteral("_") | CaselessLiteral("{") | CaselessLiteral("|") | CaselessLiteral("}") | CaselessLiteral("~")))("not_paren_star_quote_special")
|
||||
not_paren_star_special = ((not_paren_star_quote_special | CaselessLiteral("\"\""))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="not_paren_star_special"))("not_paren_star_special")
|
||||
not_paren_star_special = ((not_paren_star_quote_special | CaselessLiteral("\"\""))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="not_paren_star_special"))("not_paren_star_special")
|
||||
not_quote = ((not_paren_star_quote_special | letter | digit | CaselessLiteral("(") | CaselessLiteral(")") | CaselessLiteral("*")))("not_quote")
|
||||
octet = ((hex_digit + hex_digit)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="octet"))("octet")
|
||||
special = ((not_paren_star_quote_special | CaselessLiteral("(") | CaselessLiteral(")") | CaselessLiteral("*") | CaselessLiteral("\"\""))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="special"))("special")
|
||||
binary_literal = ((CaselessLiteral("%") + bit + ZeroOrMore(bit))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="binary_literal"))("binary_literal")
|
||||
octet = ((hex_digit + hex_digit)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="octet"))("octet")
|
||||
special = ((not_paren_star_quote_special | CaselessLiteral("(") | CaselessLiteral(")") | CaselessLiteral("*") | CaselessLiteral("\"\""))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="special"))("special")
|
||||
binary_literal = ((CaselessLiteral("%") + bit + ZeroOrMore(bit))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="binary_literal"))("binary_literal")
|
||||
integer_literal = (digits)("integer_literal")
|
||||
simple_id = ~CaselessKeyword("format") + ~CaselessKeyword("loindex") + ~CaselessKeyword("in") + ~CaselessKeyword("where") + ~CaselessKeyword("by") + ~CaselessKeyword("subtype") + ~CaselessKeyword("local") + ~CaselessKeyword("sin") + ~CaselessKeyword("case") + ~CaselessKeyword("false") + ~CaselessKeyword("entity") + ~CaselessKeyword("exp") + ~CaselessKeyword("hiindex") + ~CaselessKeyword("generic_entity") + ~CaselessKeyword("number") + ~CaselessKeyword("end_rule") + ~CaselessKeyword("schema") + ~CaselessKeyword("from") + ~CaselessKeyword("length") + ~CaselessKeyword("insert") + ~CaselessKeyword("real") + ~CaselessKeyword("like") + ~CaselessKeyword("hibound") + ~CaselessKeyword("if") + ~CaselessKeyword("end_schema") + ~CaselessKeyword("generic") + ~CaselessKeyword("extensible") + ~CaselessKeyword("pi") + ~CaselessKeyword("of") + ~CaselessKeyword("logical") + ~CaselessKeyword("rolesof") + ~CaselessKeyword("log") + ~CaselessKeyword("integer") + ~CaselessKeyword("or") + ~CaselessKeyword("odd") + ~CaselessKeyword("list") + ~CaselessKeyword("procedure") + ~CaselessKeyword("renamed") + ~CaselessKeyword("optional") + ~CaselessKeyword("log10") + ~CaselessKeyword("end_function") + ~CaselessKeyword("value_unique") + ~CaselessKeyword("fixed") + ~CaselessKeyword("repeat") + ~CaselessKeyword("rule") + ~CaselessKeyword("mod") + ~CaselessKeyword("exists") + ~CaselessKeyword("with") + ~CaselessKeyword("nvl") + ~CaselessKeyword("end_repeat") + ~CaselessKeyword("not") + ~CaselessKeyword("type") + ~CaselessKeyword("otherwise") + ~CaselessKeyword("lobound") + ~CaselessKeyword("query") + ~CaselessKeyword("function") + ~CaselessKeyword("reference") + ~CaselessKeyword("enumeration") + ~CaselessKeyword("oneof") + ~CaselessKeyword("bag") + ~CaselessKeyword("then") + ~CaselessKeyword("end_if") + ~CaselessKeyword("sizeof") + ~CaselessKeyword("end_procedure") + ~CaselessKeyword("end_type") + ~CaselessKeyword("string") + ~CaselessKeyword("end_case") + ~CaselessKeyword("return") + ~CaselessKeyword("end_entity") + ~CaselessKeyword("log2") + ~CaselessKeyword("end_alias") + ~CaselessKeyword("inverse") + ~CaselessKeyword("derive") + ~CaselessKeyword("select") + ~CaselessKeyword("for") + ~CaselessKeyword("set") + ~CaselessKeyword("aggregate") + ~CaselessKeyword("self") + ~CaselessKeyword("array") + ~CaselessKeyword("abs") + ~CaselessKeyword("tan") + ~CaselessKeyword("subtype_constraint") + ~CaselessKeyword("remove") + ~CaselessKeyword("to") + ~CaselessKeyword("acos") + ~CaselessKeyword("skip") + ~CaselessKeyword("end_subtype_constraint") + ~CaselessKeyword("end_local") + ~CaselessKeyword("use") + ~CaselessKeyword("abstract") + ~CaselessKeyword("sqrt") + ~CaselessKeyword("var") + ~CaselessKeyword("until") + ~CaselessKeyword("while") + ~CaselessKeyword("end") + ~CaselessKeyword("typeof") + ~CaselessKeyword("supertype") + ~CaselessKeyword("based_on") + ~CaselessKeyword("true") + ~CaselessKeyword("alias") + ~CaselessKeyword("total_over") + ~CaselessKeyword("andor") + ~CaselessKeyword("cos") + ~CaselessKeyword("div") + ~CaselessKeyword("and") + ~CaselessKeyword("const_e") + ~CaselessKeyword("unique") + ~CaselessKeyword("as") + ~CaselessKeyword("boolean") + ~CaselessKeyword("constant") + ~CaselessKeyword("escape") + ~CaselessKeyword("atan") + ~CaselessKeyword("unknown") + ~CaselessKeyword("asin") + ~CaselessKeyword("usedin") + ~CaselessKeyword("xor") + ~CaselessKeyword("else") + ~CaselessKeyword("blength") + ~CaselessKeyword("value_in") + ~CaselessKeyword("value") + ~CaselessKeyword("begin") + ~CaselessKeyword("binary") + ~CaselessKeyword("end_constant") + originalTextFor(Combine((letter + ZeroOrMore((letter | digit | CaselessLiteral("_"))))))("simple_id")
|
||||
simple_string_literal = (originalTextFor((CaselessLiteral("'") + ZeroOrMore(((CaselessLiteral("'") + CaselessLiteral("'")) | not_quote)) + CaselessLiteral("'")))).addParseAction(tokenMap(str.lower))("simple_string_literal")
|
||||
simple_id = ~CaselessKeyword("abs") + ~CaselessKeyword("abstract") + ~CaselessKeyword("acos") + ~CaselessKeyword("aggregate") + ~CaselessKeyword("alias") + ~CaselessKeyword("and") + ~CaselessKeyword("andor") + ~CaselessKeyword("array") + ~CaselessKeyword("as") + ~CaselessKeyword("asin") + ~CaselessKeyword("atan") + ~CaselessKeyword("bag") + ~CaselessKeyword("based_on") + ~CaselessKeyword("begin") + ~CaselessKeyword("binary") + ~CaselessKeyword("blength") + ~CaselessKeyword("boolean") + ~CaselessKeyword("by") + ~CaselessKeyword("case") + ~CaselessKeyword("const_e") + ~CaselessKeyword("constant") + ~CaselessKeyword("cos") + ~CaselessKeyword("derive") + ~CaselessKeyword("div") + ~CaselessKeyword("else") + ~CaselessKeyword("end") + ~CaselessKeyword("end_alias") + ~CaselessKeyword("end_case") + ~CaselessKeyword("end_constant") + ~CaselessKeyword("end_entity") + ~CaselessKeyword("end_function") + ~CaselessKeyword("end_if") + ~CaselessKeyword("end_local") + ~CaselessKeyword("end_procedure") + ~CaselessKeyword("end_repeat") + ~CaselessKeyword("end_rule") + ~CaselessKeyword("end_schema") + ~CaselessKeyword("end_subtype_constraint") + ~CaselessKeyword("end_type") + ~CaselessKeyword("entity") + ~CaselessKeyword("enumeration") + ~CaselessKeyword("escape") + ~CaselessKeyword("exists") + ~CaselessKeyword("exp") + ~CaselessKeyword("extensible") + ~CaselessKeyword("false") + ~CaselessKeyword("fixed") + ~CaselessKeyword("for") + ~CaselessKeyword("format") + ~CaselessKeyword("from") + ~CaselessKeyword("function") + ~CaselessKeyword("generic") + ~CaselessKeyword("generic_entity") + ~CaselessKeyword("hibound") + ~CaselessKeyword("hiindex") + ~CaselessKeyword("if") + ~CaselessKeyword("in") + ~CaselessKeyword("insert") + ~CaselessKeyword("integer") + ~CaselessKeyword("inverse") + ~CaselessKeyword("length") + ~CaselessKeyword("like") + ~CaselessKeyword("list") + ~CaselessKeyword("lobound") + ~CaselessKeyword("local") + ~CaselessKeyword("log") + ~CaselessKeyword("log10") + ~CaselessKeyword("log2") + ~CaselessKeyword("logical") + ~CaselessKeyword("loindex") + ~CaselessKeyword("mod") + ~CaselessKeyword("not") + ~CaselessKeyword("number") + ~CaselessKeyword("nvl") + ~CaselessKeyword("odd") + ~CaselessKeyword("of") + ~CaselessKeyword("oneof") + ~CaselessKeyword("optional") + ~CaselessKeyword("or") + ~CaselessKeyword("otherwise") + ~CaselessKeyword("pi") + ~CaselessKeyword("procedure") + ~CaselessKeyword("query") + ~CaselessKeyword("real") + ~CaselessKeyword("reference") + ~CaselessKeyword("remove") + ~CaselessKeyword("renamed") + ~CaselessKeyword("repeat") + ~CaselessKeyword("return") + ~CaselessKeyword("rolesof") + ~CaselessKeyword("rule") + ~CaselessKeyword("schema") + ~CaselessKeyword("select") + ~CaselessKeyword("self") + ~CaselessKeyword("set") + ~CaselessKeyword("sin") + ~CaselessKeyword("sizeof") + ~CaselessKeyword("skip") + ~CaselessKeyword("sqrt") + ~CaselessKeyword("string") + ~CaselessKeyword("subtype") + ~CaselessKeyword("subtype_constraint") + ~CaselessKeyword("supertype") + ~CaselessKeyword("tan") + ~CaselessKeyword("then") + ~CaselessKeyword("to") + ~CaselessKeyword("total_over") + ~CaselessKeyword("true") + ~CaselessKeyword("type") + ~CaselessKeyword("typeof") + ~CaselessKeyword("unique") + ~CaselessKeyword("unknown") + ~CaselessKeyword("until") + ~CaselessKeyword("use") + ~CaselessKeyword("usedin") + ~CaselessKeyword("value") + ~CaselessKeyword("value_in") + ~CaselessKeyword("value_unique") + ~CaselessKeyword("var") + ~CaselessKeyword("where") + ~CaselessKeyword("while") + ~CaselessKeyword("with") + ~CaselessKeyword("xor") + original_text_for(Combine((letter + ZeroOrMore((letter | digit | CaselessLiteral("_"))))))("simple_id")
|
||||
simple_string_literal = (original_text_for((CaselessLiteral("'") + ZeroOrMore(((CaselessLiteral("'") + CaselessLiteral("'")) | not_quote)) + CaselessLiteral("'")))).add_parse_action(token_map(str.lower))("simple_string_literal")
|
||||
abstract_entity_declaration = (ABSTRACT)("abstract_entity_declaration")
|
||||
abstract_supertype = ((ABSTRACT + SUPERTYPE + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="abstract_supertype"))("abstract_supertype")
|
||||
add_like_op = ((CaselessLiteral("+") | CaselessLiteral("-") | OR | XOR)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="add_like_op"))("add_like_op")
|
||||
abstract_supertype = ((ABSTRACT + SUPERTYPE + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="abstract_supertype"))("abstract_supertype")
|
||||
add_like_op = ((CaselessLiteral("+") | CaselessLiteral("-") | OR | XOR)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="add_like_op"))("add_like_op")
|
||||
attribute_id = (simple_id)("attribute_id")
|
||||
boolean_type = (BOOLEAN)("boolean_type")
|
||||
built_in_constant = ((CONST_E | PI | SELF | CaselessLiteral("?"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="built_in_constant"))("built_in_constant")
|
||||
built_in_function = ((ABS | ACOS | ASIN | ATAN | BLENGTH | COS | EXISTS | EXP | FORMAT | HIBOUND | HIINDEX | LENGTH | LOBOUND | LOINDEX | LOG | LOG2 | LOG10 | NVL | ODD | ROLESOF | SIN | SIZEOF | SQRT | TAN | TYPEOF | USEDIN | VALUE | VALUE_IN | VALUE_UNIQUE)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="built_in_function"))("built_in_function")
|
||||
built_in_procedure = ((INSERT | REMOVE)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="built_in_procedure"))("built_in_procedure")
|
||||
built_in_constant = ((CONST_E | PI | SELF | CaselessLiteral("?"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="built_in_constant"))("built_in_constant")
|
||||
built_in_function = ((ABS | ACOS | ASIN | ATAN | BLENGTH | COS | EXISTS | EXP | FORMAT | HIBOUND | HIINDEX | LENGTH | LOBOUND | LOINDEX | LOG | LOG2 | LOG10 | NVL | ODD | ROLESOF | SIN | SIZEOF | SQRT | TAN | TYPEOF | USEDIN | VALUE | VALUE_IN | VALUE_UNIQUE)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="built_in_function"))("built_in_function")
|
||||
built_in_procedure = ((INSERT | REMOVE)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="built_in_procedure"))("built_in_procedure")
|
||||
constant_id = (simple_id)("constant_id")
|
||||
entity_id = (simple_id)("entity_id")
|
||||
enumeration_id = (simple_id)("enumeration_id")
|
||||
enumeration_items = ((CaselessLiteral("(") + enumeration_id + ZeroOrMore((CaselessLiteral(",") + enumeration_id)) + CaselessLiteral(")"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="enumeration_items"))("enumeration_items")
|
||||
escape_stmt = ((ESCAPE + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="escape_stmt"))("escape_stmt")
|
||||
enumeration_items = ((CaselessLiteral("(") + enumeration_id + ZeroOrMore((CaselessLiteral(",") + enumeration_id)) + CaselessLiteral(")"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="enumeration_items"))("enumeration_items")
|
||||
escape_stmt = ((ESCAPE + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="escape_stmt"))("escape_stmt")
|
||||
function_id = (simple_id)("function_id")
|
||||
integer_type = (INTEGER)("integer_type")
|
||||
interval_op = ((CaselessLiteral("<=") | CaselessLiteral("<"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="interval_op"))("interval_op")
|
||||
logical_literal = ((FALSE | TRUE | UNKNOWN)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="logical_literal"))("logical_literal")
|
||||
interval_op = ((CaselessLiteral("<=") | CaselessLiteral("<"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="interval_op"))("interval_op")
|
||||
logical_literal = ((FALSE | TRUE | UNKNOWN)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="logical_literal"))("logical_literal")
|
||||
logical_type = (LOGICAL)("logical_type")
|
||||
multiplication_like_op = ((CaselessLiteral("*") | CaselessLiteral("/") | DIV | MOD | AND | CaselessLiteral("||"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="multiplication_like_op"))("multiplication_like_op")
|
||||
null_stmt = (CaselessLiteral(";")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="null_stmt"))("null_stmt")
|
||||
multiplication_like_op = ((CaselessLiteral("*") | CaselessLiteral("/") | DIV | MOD | AND | CaselessLiteral("||"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="multiplication_like_op"))("multiplication_like_op")
|
||||
null_stmt = (CaselessLiteral(";")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="null_stmt"))("null_stmt")
|
||||
number_type = (NUMBER)("number_type")
|
||||
parameter_id = (simple_id)("parameter_id")
|
||||
procedure_id = (simple_id)("procedure_id")
|
||||
rel_op = ((CaselessLiteral("<=") | CaselessLiteral(">=") | CaselessLiteral("<>") | CaselessLiteral("=") | CaselessLiteral(":<>:") | CaselessLiteral(":=:") | CaselessLiteral("<") | CaselessLiteral(">"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="rel_op"))("rel_op")
|
||||
rel_op_extended = ((rel_op | IN | LIKE)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="rel_op_extended"))("rel_op_extended")
|
||||
rel_op = ((CaselessLiteral("<=") | CaselessLiteral(">=") | CaselessLiteral("<>") | CaselessLiteral("=") | CaselessLiteral(":<>:") | CaselessLiteral(":=:") | CaselessLiteral("<") | CaselessLiteral(">"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="rel_op"))("rel_op")
|
||||
rel_op_extended = ((rel_op | IN | LIKE)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="rel_op_extended"))("rel_op_extended")
|
||||
rule_id = (simple_id)("rule_id")
|
||||
rule_label_id = (simple_id)("rule_label_id")
|
||||
schema_id = (simple_id)("schema_id")
|
||||
sign = ((CaselessLiteral("+") | CaselessLiteral("-"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="sign"))("sign")
|
||||
skip_stmt = ((SKIP + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="skip_stmt"))("skip_stmt")
|
||||
sign = ((CaselessLiteral("+") | CaselessLiteral("-"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="sign"))("sign")
|
||||
skip_stmt = ((SKIP + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="skip_stmt"))("skip_stmt")
|
||||
subtype_constraint_id = (simple_id)("subtype_constraint_id")
|
||||
type_id = (simple_id)("type_id")
|
||||
type_label_id = (simple_id)("type_label_id")
|
||||
unary_op = ((CaselessLiteral("+") | CaselessLiteral("-") | NOT)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="unary_op"))("unary_op")
|
||||
unary_op = ((CaselessLiteral("+") | CaselessLiteral("-") | NOT)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="unary_op"))("unary_op")
|
||||
variable_id = (simple_id)("variable_id")
|
||||
encoded_character = ((octet + octet + octet + octet)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="encoded_character"))("encoded_character")
|
||||
not_paren_star = ((letter | digit | not_paren_star_special)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="not_paren_star"))("not_paren_star")
|
||||
not_rparen_star = ((not_paren_star | CaselessLiteral("("))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="not_rparen_star"))("not_rparen_star")
|
||||
not_rparen_star_then_rparen = ((not_rparen_star + ZeroOrMore(not_rparen_star) + CaselessLiteral(")") + ZeroOrMore(CaselessLiteral(")")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="not_rparen_star_then_rparen"))("not_rparen_star_then_rparen")
|
||||
encoded_string_literal = ((CaselessLiteral("\"") + encoded_character + ZeroOrMore(encoded_character) + CaselessLiteral("\""))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="encoded_string_literal"))("encoded_string_literal")
|
||||
encoded_character = ((octet + octet + octet + octet)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="encoded_character"))("encoded_character")
|
||||
not_paren_star = ((letter | digit | not_paren_star_special)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="not_paren_star"))("not_paren_star")
|
||||
not_rparen_star = ((not_paren_star | CaselessLiteral("("))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="not_rparen_star"))("not_rparen_star")
|
||||
not_rparen_star_then_rparen = ((not_rparen_star + ZeroOrMore(not_rparen_star) + CaselessLiteral(")") + ZeroOrMore(CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="not_rparen_star_then_rparen"))("not_rparen_star_then_rparen")
|
||||
encoded_string_literal = ((CaselessLiteral("\"") + encoded_character + ZeroOrMore(encoded_character) + CaselessLiteral("\""))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="encoded_string_literal"))("encoded_string_literal")
|
||||
real_literal = (((digits + CaselessLiteral(".") + Optional(digits) + Optional((CaselessLiteral("e") + Optional(sign) + digits))) | integer_literal))("real_literal")
|
||||
attribute_ref = (attribute_id)("attribute_ref")
|
||||
constant_ref = (constant_id)("constant_ref")
|
||||
@@ -210,276 +210,276 @@ def parse(fn: str) -> mapping.Mapping:
|
||||
type_label_ref = (type_label_id)("type_label_ref")
|
||||
type_ref = (type_id)("type_ref")
|
||||
variable_ref = (variable_id)("variable_ref")
|
||||
attribute_qualifier = ((CaselessLiteral(".") + attribute_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="attribute_qualifier"))("attribute_qualifier")
|
||||
constant_factor = ((built_in_constant | constant_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="constant_factor"))("constant_factor")
|
||||
enumeration_extension = ((BASED_ON + type_ref + Optional((WITH + enumeration_items)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="enumeration_extension"))("enumeration_extension")
|
||||
enumeration_reference = ((Optional((type_ref + CaselessLiteral("."))) + enumeration_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="enumeration_reference"))("enumeration_reference")
|
||||
enumeration_type = ((Optional(EXTENSIBLE) + ENUMERATION + Optional(((OF + enumeration_items) | enumeration_extension)))).setParseAction(EnumerationType)("enumeration_type")
|
||||
general_ref = ((parameter_ref | variable_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_ref"))("general_ref")
|
||||
group_qualifier = ((CaselessLiteral("\\") + entity_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="group_qualifier"))("group_qualifier")
|
||||
named_types = ((entity_ref | type_ref)).setParseAction(NamedType)("named_types")
|
||||
named_type_or_rename = ((named_types + Optional((AS + (entity_id | type_id))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="named_type_or_rename"))("named_type_or_rename")
|
||||
attribute_qualifier = ((CaselessLiteral(".") + attribute_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="attribute_qualifier"))("attribute_qualifier")
|
||||
constant_factor = ((built_in_constant | constant_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="constant_factor"))("constant_factor")
|
||||
enumeration_extension = ((BASED_ON + type_ref + Optional((WITH + enumeration_items)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="enumeration_extension"))("enumeration_extension")
|
||||
enumeration_reference = ((Optional((type_ref + CaselessLiteral("."))) + enumeration_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="enumeration_reference"))("enumeration_reference")
|
||||
enumeration_type = ((Optional(EXTENSIBLE) + ENUMERATION + Optional(((OF + enumeration_items) | enumeration_extension)))).set_parse_action(EnumerationType)("enumeration_type")
|
||||
general_ref = ((parameter_ref | variable_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_ref"))("general_ref")
|
||||
group_qualifier = ((CaselessLiteral("\\") + entity_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="group_qualifier"))("group_qualifier")
|
||||
named_types = ((entity_ref | type_ref)).set_parse_action(NamedType)("named_types")
|
||||
named_type_or_rename = ((named_types + Optional((AS + (entity_id | type_id))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="named_type_or_rename"))("named_type_or_rename")
|
||||
population = (entity_ref)("population")
|
||||
qualified_attribute = ((SELF + group_qualifier + attribute_qualifier)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="qualified_attribute"))("qualified_attribute")
|
||||
redeclared_attribute = ((qualified_attribute + Optional((RENAMED + attribute_id)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="redeclared_attribute"))("redeclared_attribute")
|
||||
referenced_attribute = ((attribute_ref | qualified_attribute)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="referenced_attribute"))("referenced_attribute")
|
||||
rename_id = ((constant_id | entity_id | function_id | procedure_id | type_id)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="rename_id"))("rename_id")
|
||||
resource_ref = ((constant_ref | entity_ref | function_ref | procedure_ref | type_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="resource_ref"))("resource_ref")
|
||||
rule_head = ((RULE + rule_id + FOR + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")") + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="rule_head"))("rule_head")
|
||||
select_list = ((CaselessLiteral("(") + named_types + ZeroOrMore((CaselessLiteral(",") + named_types)) + CaselessLiteral(")"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="select_list"))("select_list")
|
||||
qualified_attribute = ((SELF + group_qualifier + attribute_qualifier)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="qualified_attribute"))("qualified_attribute")
|
||||
redeclared_attribute = ((qualified_attribute + Optional((RENAMED + attribute_id)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="redeclared_attribute"))("redeclared_attribute")
|
||||
referenced_attribute = ((attribute_ref | qualified_attribute)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="referenced_attribute"))("referenced_attribute")
|
||||
rename_id = ((constant_id | entity_id | function_id | procedure_id | type_id)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="rename_id"))("rename_id")
|
||||
resource_ref = ((constant_ref | entity_ref | function_ref | procedure_ref | type_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="resource_ref"))("resource_ref")
|
||||
rule_head = ((RULE + rule_id + FOR + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")") + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="rule_head"))("rule_head")
|
||||
select_list = ((CaselessLiteral("(") + named_types + ZeroOrMore((CaselessLiteral(",") + named_types)) + CaselessLiteral(")"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="select_list"))("select_list")
|
||||
string_literal = ((simple_string_literal | encoded_string_literal))("string_literal")
|
||||
subtype_constraint_head = ((SUBTYPE_CONSTRAINT + subtype_constraint_id + FOR + entity_ref + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_head"))("subtype_constraint_head")
|
||||
subtype_declaration = ((SUBTYPE + OF + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")"))).setParseAction(SubTypeExpression)("subtype_declaration")
|
||||
total_over = ((TOTAL_OVER + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")") + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="total_over"))("total_over")
|
||||
type_label = ((type_label_id | type_label_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="type_label"))("type_label")
|
||||
unique_rule = ((Optional((rule_label_id + CaselessLiteral(":"))) + referenced_attribute + ZeroOrMore((CaselessLiteral(",") + referenced_attribute)))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="unique_rule"))("unique_rule")
|
||||
use_clause = ((USE + FROM + schema_ref + Optional((CaselessLiteral("(") + named_type_or_rename + ZeroOrMore((CaselessLiteral(",") + named_type_or_rename)) + CaselessLiteral(")"))) + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="use_clause"))("use_clause")
|
||||
not_lparen_star = ((not_paren_star | CaselessLiteral(")"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="not_lparen_star"))("not_lparen_star")
|
||||
remark_ref = ((attribute_ref | constant_ref | entity_ref | enumeration_ref | function_ref | parameter_ref | procedure_ref | rule_label_ref | rule_ref | schema_ref | subtype_constraint_ref | type_label_ref | type_ref | variable_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="remark_ref"))("remark_ref")
|
||||
attribute_decl = ((redeclared_attribute | attribute_id)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="attribute_decl"))("attribute_decl")
|
||||
generic_entity_type = ((GENERIC_ENTITY + Optional((CaselessLiteral(":") + type_label)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="generic_entity_type"))("generic_entity_type")
|
||||
generic_type = ((GENERIC + Optional((CaselessLiteral(":") + type_label)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="generic_type"))("generic_type")
|
||||
literal = ((binary_literal | logical_literal | real_literal | string_literal)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="literal"))("literal")
|
||||
resource_or_rename = ((resource_ref + Optional((AS + rename_id)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="resource_or_rename"))("resource_or_rename")
|
||||
subtype_constraint_head = ((SUBTYPE_CONSTRAINT + subtype_constraint_id + FOR + entity_ref + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_head"))("subtype_constraint_head")
|
||||
subtype_declaration = ((SUBTYPE + OF + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")"))).set_parse_action(SubTypeExpression)("subtype_declaration")
|
||||
total_over = ((TOTAL_OVER + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")") + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="total_over"))("total_over")
|
||||
type_label = ((type_label_id | type_label_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="type_label"))("type_label")
|
||||
unique_rule = ((Optional((rule_label_id + CaselessLiteral(":"))) + referenced_attribute + ZeroOrMore((CaselessLiteral(",") + referenced_attribute)))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="unique_rule"))("unique_rule")
|
||||
use_clause = ((USE + FROM + schema_ref + Optional((CaselessLiteral("(") + named_type_or_rename + ZeroOrMore((CaselessLiteral(",") + named_type_or_rename)) + CaselessLiteral(")"))) + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="use_clause"))("use_clause")
|
||||
not_lparen_star = ((not_paren_star | CaselessLiteral(")"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="not_lparen_star"))("not_lparen_star")
|
||||
remark_ref = ((attribute_ref | constant_ref | entity_ref | enumeration_ref | function_ref | parameter_ref | procedure_ref | rule_label_ref | rule_ref | schema_ref | subtype_constraint_ref | type_label_ref | type_ref | variable_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="remark_ref"))("remark_ref")
|
||||
attribute_decl = ((redeclared_attribute | attribute_id)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="attribute_decl"))("attribute_decl")
|
||||
generic_entity_type = ((GENERIC_ENTITY + Optional((CaselessLiteral(":") + type_label)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="generic_entity_type"))("generic_entity_type")
|
||||
generic_type = ((GENERIC + Optional((CaselessLiteral(":") + type_label)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="generic_type"))("generic_type")
|
||||
literal = ((binary_literal | logical_literal | real_literal | string_literal)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="literal"))("literal")
|
||||
resource_or_rename = ((resource_ref + Optional((AS + rename_id)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="resource_or_rename"))("resource_or_rename")
|
||||
schema_version_id = (string_literal)("schema_version_id")
|
||||
select_extension = ((BASED_ON + type_ref + Optional((WITH + select_list)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="select_extension"))("select_extension")
|
||||
select_type = ((Optional((EXTENSIBLE + Optional(GENERIC_ENTITY))) + SELECT + Optional((select_list | select_extension)))).setParseAction(SelectType)("select_type")
|
||||
unique_clause = ((UNIQUE + unique_rule + CaselessLiteral(";") + ZeroOrMore((unique_rule + CaselessLiteral(";"))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="unique_clause"))("unique_clause")
|
||||
lparen_then_not_lparen_star = ((CaselessLiteral("(") + ZeroOrMore(CaselessLiteral("(")) + not_lparen_star + ZeroOrMore(not_lparen_star))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="lparen_then_not_lparen_star"))("lparen_then_not_lparen_star")
|
||||
remark_tag = ((CaselessLiteral("\"") + remark_ref + ZeroOrMore((CaselessLiteral(".") + remark_ref)) + CaselessLiteral("\""))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="remark_tag"))("remark_tag")
|
||||
tail_remark = ((CaselessLiteral("--") + Optional(remark_tag))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="tail_remark"))("tail_remark")
|
||||
constructed_types = ((enumeration_type | select_type)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="constructed_types"))("constructed_types")
|
||||
reference_clause = ((REFERENCE + FROM + schema_ref + Optional((CaselessLiteral("(") + resource_or_rename + ZeroOrMore((CaselessLiteral(",") + resource_or_rename)) + CaselessLiteral(")"))) + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="reference_clause"))("reference_clause")
|
||||
interface_specification = ((reference_clause | use_clause)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="interface_specification"))("interface_specification")
|
||||
rule_decl = Forward()("rule_decl")
|
||||
supertype_term = Forward()("supertype_term")
|
||||
alias_stmt = Forward()("alias_stmt")
|
||||
subtype_constraint_decl = Forward()("subtype_constraint_decl")
|
||||
real_type = Forward()("real_type")
|
||||
until_control = Forward()("until_control")
|
||||
remark = Forward()("remark")
|
||||
syntax = Forward()("syntax")
|
||||
derived_attr = Forward()("derived_attr")
|
||||
subtype_constraint = Forward()("subtype_constraint")
|
||||
aggregation_types = Forward()("aggregation_types")
|
||||
width = Forward()("width")
|
||||
simple_expression = Forward()("simple_expression")
|
||||
explicit_attr = Forward()("explicit_attr")
|
||||
precision_spec = Forward()("precision_spec")
|
||||
general_list_type = Forward()("general_list_type")
|
||||
concrete_types = Forward()("concrete_types")
|
||||
while_control = Forward()("while_control")
|
||||
aggregate_type = Forward()("aggregate_type")
|
||||
increment_control = Forward()("increment_control")
|
||||
index_qualifier = Forward()("index_qualifier")
|
||||
supertype_rule = Forward()("supertype_rule")
|
||||
subsuper = Forward()("subsuper")
|
||||
interval_low = Forward()("interval_low")
|
||||
bound_2 = Forward()("bound_2")
|
||||
index_1 = Forward()("index_1")
|
||||
return_stmt = Forward()("return_stmt")
|
||||
type_decl = Forward()("type_decl")
|
||||
increment = Forward()("increment")
|
||||
factor = Forward()("factor")
|
||||
underlying_type = Forward()("underlying_type")
|
||||
declaration = Forward()("declaration")
|
||||
function_decl = Forward()("function_decl")
|
||||
entity_constructor = Forward()("entity_constructor")
|
||||
derive_clause = Forward()("derive_clause")
|
||||
interval_item = Forward()("interval_item")
|
||||
stmt = Forward()("stmt")
|
||||
repeat_control = Forward()("repeat_control")
|
||||
select_extension = ((BASED_ON + type_ref + Optional((WITH + select_list)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="select_extension"))("select_extension")
|
||||
select_type = ((Optional((EXTENSIBLE + Optional(GENERIC_ENTITY))) + SELECT + Optional((select_list | select_extension)))).set_parse_action(SelectType)("select_type")
|
||||
unique_clause = ((UNIQUE + unique_rule + CaselessLiteral(";") + ZeroOrMore((unique_rule + CaselessLiteral(";"))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="unique_clause"))("unique_clause")
|
||||
lparen_then_not_lparen_star = ((CaselessLiteral("(") + ZeroOrMore(CaselessLiteral("(")) + not_lparen_star + ZeroOrMore(not_lparen_star))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="lparen_then_not_lparen_star"))("lparen_then_not_lparen_star")
|
||||
remark_tag = ((CaselessLiteral("\"") + remark_ref + ZeroOrMore((CaselessLiteral(".") + remark_ref)) + CaselessLiteral("\""))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="remark_tag"))("remark_tag")
|
||||
tail_remark = ((CaselessLiteral("--") + Optional(remark_tag))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="tail_remark"))("tail_remark")
|
||||
constructed_types = ((enumeration_type | select_type)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="constructed_types"))("constructed_types")
|
||||
reference_clause = ((REFERENCE + FROM + schema_ref + Optional((CaselessLiteral("(") + resource_or_rename + ZeroOrMore((CaselessLiteral(",") + resource_or_rename)) + CaselessLiteral(")"))) + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="reference_clause"))("reference_clause")
|
||||
interface_specification = ((reference_clause | use_clause)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="interface_specification"))("interface_specification")
|
||||
abstract_supertype_declaration = Forward()("abstract_supertype_declaration")
|
||||
bound_spec = Forward()("bound_spec")
|
||||
entity_decl = Forward()("entity_decl")
|
||||
actual_parameter_list = Forward()("actual_parameter_list")
|
||||
aggregate_initializer = Forward()("aggregate_initializer")
|
||||
aggregate_source = Forward()("aggregate_source")
|
||||
aggregate_type = Forward()("aggregate_type")
|
||||
aggregation_types = Forward()("aggregation_types")
|
||||
algorithm_head = Forward()("algorithm_head")
|
||||
alias_stmt = Forward()("alias_stmt")
|
||||
array_type = Forward()("array_type")
|
||||
assignment_stmt = Forward()("assignment_stmt")
|
||||
bag_type = Forward()("bag_type")
|
||||
binary_type = Forward()("binary_type")
|
||||
bound_1 = Forward()("bound_1")
|
||||
bound_2 = Forward()("bound_2")
|
||||
bound_spec = Forward()("bound_spec")
|
||||
case_action = Forward()("case_action")
|
||||
case_label = Forward()("case_label")
|
||||
case_stmt = Forward()("case_stmt")
|
||||
compound_stmt = Forward()("compound_stmt")
|
||||
concrete_types = Forward()("concrete_types")
|
||||
constant_body = Forward()("constant_body")
|
||||
constant_decl = Forward()("constant_decl")
|
||||
declaration = Forward()("declaration")
|
||||
derive_clause = Forward()("derive_clause")
|
||||
derived_attr = Forward()("derived_attr")
|
||||
domain_rule = Forward()("domain_rule")
|
||||
element = Forward()("element")
|
||||
embedded_remark = Forward()("embedded_remark")
|
||||
entity_body = Forward()("entity_body")
|
||||
entity_constructor = Forward()("entity_constructor")
|
||||
entity_decl = Forward()("entity_decl")
|
||||
entity_head = Forward()("entity_head")
|
||||
explicit_attr = Forward()("explicit_attr")
|
||||
expression = Forward()("expression")
|
||||
factor = Forward()("factor")
|
||||
formal_parameter = Forward()("formal_parameter")
|
||||
function_call = Forward()("function_call")
|
||||
function_decl = Forward()("function_decl")
|
||||
function_head = Forward()("function_head")
|
||||
general_aggregation_types = Forward()("general_aggregation_types")
|
||||
general_array_type = Forward()("general_array_type")
|
||||
general_bag_type = Forward()("general_bag_type")
|
||||
general_list_type = Forward()("general_list_type")
|
||||
general_set_type = Forward()("general_set_type")
|
||||
generalized_types = Forward()("generalized_types")
|
||||
if_stmt = Forward()("if_stmt")
|
||||
increment = Forward()("increment")
|
||||
increment_control = Forward()("increment_control")
|
||||
index = Forward()("index")
|
||||
index_1 = Forward()("index_1")
|
||||
index_2 = Forward()("index_2")
|
||||
index_qualifier = Forward()("index_qualifier")
|
||||
instantiable_type = Forward()("instantiable_type")
|
||||
interval = Forward()("interval")
|
||||
interval_high = Forward()("interval_high")
|
||||
interval_item = Forward()("interval_item")
|
||||
interval_low = Forward()("interval_low")
|
||||
inverse_attr = Forward()("inverse_attr")
|
||||
inverse_clause = Forward()("inverse_clause")
|
||||
list_type = Forward()("list_type")
|
||||
local_decl = Forward()("local_decl")
|
||||
local_variable = Forward()("local_variable")
|
||||
logical_expression = Forward()("logical_expression")
|
||||
numeric_expression = Forward()("numeric_expression")
|
||||
string_type = Forward()("string_type")
|
||||
formal_parameter = Forward()("formal_parameter")
|
||||
generalized_types = Forward()("generalized_types")
|
||||
function_head = Forward()("function_head")
|
||||
constant_decl = Forward()("constant_decl")
|
||||
actual_parameter_list = Forward()("actual_parameter_list")
|
||||
subtype_constraint_body = Forward()("subtype_constraint_body")
|
||||
procedure_decl = Forward()("procedure_decl")
|
||||
case_action = Forward()("case_action")
|
||||
term = Forward()("term")
|
||||
general_aggregation_types = Forward()("general_aggregation_types")
|
||||
function_call = Forward()("function_call")
|
||||
where_clause = Forward()("where_clause")
|
||||
local_variable = Forward()("local_variable")
|
||||
aggregate_initializer = Forward()("aggregate_initializer")
|
||||
binary_type = Forward()("binary_type")
|
||||
index = Forward()("index")
|
||||
case_stmt = Forward()("case_stmt")
|
||||
general_set_type = Forward()("general_set_type")
|
||||
procedure_call_stmt = Forward()("procedure_call_stmt")
|
||||
instantiable_type = Forward()("instantiable_type")
|
||||
general_array_type = Forward()("general_array_type")
|
||||
set_type = Forward()("set_type")
|
||||
supertype_factor = Forward()("supertype_factor")
|
||||
index_2 = Forward()("index_2")
|
||||
qualifiable_factor = Forward()("qualifiable_factor")
|
||||
algorithm_head = Forward()("algorithm_head")
|
||||
parameter_type = Forward()("parameter_type")
|
||||
one_of = Forward()("one_of")
|
||||
compound_stmt = Forward()("compound_stmt")
|
||||
primary = Forward()("primary")
|
||||
schema_decl = Forward()("schema_decl")
|
||||
embedded_remark = Forward()("embedded_remark")
|
||||
width_spec = Forward()("width_spec")
|
||||
assignment_stmt = Forward()("assignment_stmt")
|
||||
element = Forward()("element")
|
||||
schema_body = Forward()("schema_body")
|
||||
procedure_head = Forward()("procedure_head")
|
||||
general_bag_type = Forward()("general_bag_type")
|
||||
entity_head = Forward()("entity_head")
|
||||
entity_body = Forward()("entity_body")
|
||||
list_type = Forward()("list_type")
|
||||
expression = Forward()("expression")
|
||||
parameter = Forward()("parameter")
|
||||
simple_types = Forward()("simple_types")
|
||||
bag_type = Forward()("bag_type")
|
||||
repetition = Forward()("repetition")
|
||||
constant_body = Forward()("constant_body")
|
||||
if_stmt = Forward()("if_stmt")
|
||||
inverse_attr = Forward()("inverse_attr")
|
||||
interval = Forward()("interval")
|
||||
query_expression = Forward()("query_expression")
|
||||
array_type = Forward()("array_type")
|
||||
simple_factor = Forward()("simple_factor")
|
||||
case_label = Forward()("case_label")
|
||||
domain_rule = Forward()("domain_rule")
|
||||
repeat_stmt = Forward()("repeat_stmt")
|
||||
supertype_expression = Forward()("supertype_expression")
|
||||
supertype_constraint = Forward()("supertype_constraint")
|
||||
interval_high = Forward()("interval_high")
|
||||
local_decl = Forward()("local_decl")
|
||||
selector = Forward()("selector")
|
||||
aggregate_source = Forward()("aggregate_source")
|
||||
parameter_type = Forward()("parameter_type")
|
||||
precision_spec = Forward()("precision_spec")
|
||||
primary = Forward()("primary")
|
||||
procedure_call_stmt = Forward()("procedure_call_stmt")
|
||||
procedure_decl = Forward()("procedure_decl")
|
||||
procedure_head = Forward()("procedure_head")
|
||||
qualifiable_factor = Forward()("qualifiable_factor")
|
||||
qualifier = Forward()("qualifier")
|
||||
rule_decl << (((rule_head + algorithm_head + ZeroOrMore(stmt) + where_clause + END_RULE + CaselessLiteral(";")))).setParseAction(RuleDeclaration)
|
||||
supertype_term << (((one_of | (CaselessLiteral("(") + supertype_expression + CaselessLiteral(")")) | entity_ref))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="supertype_term"))
|
||||
alias_stmt << (((ALIAS + variable_id + FOR + general_ref + ZeroOrMore(qualifier) + CaselessLiteral(";") + stmt + ZeroOrMore(stmt) + END_ALIAS + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="alias_stmt"))
|
||||
subtype_constraint_decl << (((subtype_constraint_head + subtype_constraint_body + END_SUBTYPE_CONSTRAINT + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_decl"))
|
||||
real_type << (((REAL + Optional((CaselessLiteral("(") + precision_spec + CaselessLiteral(")")))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="real_type"))
|
||||
until_control << (((UNTIL + logical_expression))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="until_control"))
|
||||
remark << (((embedded_remark | tail_remark))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="remark"))
|
||||
syntax << (((schema_decl + ZeroOrMore(schema_decl)))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="syntax"))
|
||||
derived_attr << (((attribute_decl + CaselessLiteral(":") + parameter_type + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="derived_attr"))
|
||||
subtype_constraint << (((OF + CaselessLiteral("(") + supertype_expression + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint"))
|
||||
aggregation_types << (((array_type | bag_type | list_type | set_type))).setParseAction(AggregationType)
|
||||
width << (numeric_expression)
|
||||
simple_expression << (((term + ZeroOrMore((add_like_op + term))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="simple_expression"))
|
||||
explicit_attr << (((attribute_decl + ZeroOrMore((CaselessLiteral(",") + attribute_decl)) + CaselessLiteral(":") + Optional(OPTIONAL) + parameter_type + CaselessLiteral(";")))).setParseAction(ExplicitAttribute)
|
||||
precision_spec << (numeric_expression)
|
||||
general_list_type << (((LIST + Optional(bound_spec) + OF + Optional(UNIQUE) + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_list_type"))
|
||||
concrete_types << (((aggregation_types | simple_types | type_ref))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="concrete_types"))
|
||||
while_control << (((WHILE + logical_expression))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="while_control"))
|
||||
aggregate_type << (((AGGREGATE + Optional((CaselessLiteral(":") + type_label)) + OF + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="aggregate_type"))
|
||||
increment_control << (((variable_id + CaselessLiteral(":=") + bound_1 + TO + bound_2 + Optional((BY + increment))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="increment_control"))
|
||||
index_qualifier << (((CaselessLiteral("[") + index_1 + Optional((CaselessLiteral(":") + index_2)) + CaselessLiteral("]")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="index_qualifier"))
|
||||
supertype_rule << (((SUPERTYPE + subtype_constraint))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="supertype_rule"))
|
||||
subsuper << (((Optional(supertype_constraint) + Optional(subtype_declaration)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subsuper"))
|
||||
interval_low << (simple_expression)
|
||||
bound_2 << (numeric_expression)
|
||||
index_1 << (index)
|
||||
return_stmt << (((RETURN + Optional((CaselessLiteral("(") + expression + CaselessLiteral(")"))) + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="return_stmt"))
|
||||
type_decl << (((TYPE + type_id + CaselessLiteral("=") + underlying_type + CaselessLiteral(";") + Optional(where_clause) + END_TYPE + CaselessLiteral(";")))).setParseAction(TypeDeclaration)
|
||||
increment << (numeric_expression)
|
||||
factor << (((simple_factor + Optional((CaselessLiteral("**") + simple_factor))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="factor"))
|
||||
underlying_type << (((constructed_types | concrete_types))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="underlying_type"))
|
||||
declaration << (((entity_decl | function_decl | procedure_decl | subtype_constraint_decl | type_decl))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="declaration"))
|
||||
function_decl << (((function_head + algorithm_head + stmt + ZeroOrMore(stmt) + END_FUNCTION + CaselessLiteral(";")))).setParseAction(FunctionDeclaration)
|
||||
entity_constructor << (((entity_ref + CaselessLiteral("(") + Optional((expression + ZeroOrMore((CaselessLiteral(",") + expression)))) + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="entity_constructor"))
|
||||
derive_clause << (((DERIVE + derived_attr + ZeroOrMore(derived_attr)))).setParseAction(AttributeList)
|
||||
interval_item << (simple_expression)
|
||||
stmt << (((alias_stmt | assignment_stmt | case_stmt | compound_stmt | escape_stmt | if_stmt | null_stmt | procedure_call_stmt | repeat_stmt | return_stmt | skip_stmt))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="stmt"))
|
||||
repeat_control << (((Optional(increment_control) + Optional(while_control) + Optional(until_control)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="repeat_control"))
|
||||
abstract_supertype_declaration << (((ABSTRACT + SUPERTYPE + Optional(subtype_constraint)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="abstract_supertype_declaration"))
|
||||
bound_spec << (((CaselessLiteral("[") + bound_1 + CaselessLiteral(":") + bound_2 + CaselessLiteral("]")))).setParseAction(BoundSpecification)
|
||||
entity_decl << (((entity_head + entity_body + END_ENTITY + CaselessLiteral(";")))).setParseAction(EntityDeclaration)
|
||||
query_expression = Forward()("query_expression")
|
||||
real_type = Forward()("real_type")
|
||||
remark = Forward()("remark")
|
||||
repeat_control = Forward()("repeat_control")
|
||||
repeat_stmt = Forward()("repeat_stmt")
|
||||
repetition = Forward()("repetition")
|
||||
return_stmt = Forward()("return_stmt")
|
||||
rule_decl = Forward()("rule_decl")
|
||||
schema_body = Forward()("schema_body")
|
||||
schema_decl = Forward()("schema_decl")
|
||||
selector = Forward()("selector")
|
||||
set_type = Forward()("set_type")
|
||||
simple_expression = Forward()("simple_expression")
|
||||
simple_factor = Forward()("simple_factor")
|
||||
simple_types = Forward()("simple_types")
|
||||
stmt = Forward()("stmt")
|
||||
string_type = Forward()("string_type")
|
||||
subsuper = Forward()("subsuper")
|
||||
subtype_constraint = Forward()("subtype_constraint")
|
||||
subtype_constraint_body = Forward()("subtype_constraint_body")
|
||||
subtype_constraint_decl = Forward()("subtype_constraint_decl")
|
||||
supertype_constraint = Forward()("supertype_constraint")
|
||||
supertype_expression = Forward()("supertype_expression")
|
||||
supertype_factor = Forward()("supertype_factor")
|
||||
supertype_rule = Forward()("supertype_rule")
|
||||
supertype_term = Forward()("supertype_term")
|
||||
syntax = Forward()("syntax")
|
||||
term = Forward()("term")
|
||||
type_decl = Forward()("type_decl")
|
||||
underlying_type = Forward()("underlying_type")
|
||||
until_control = Forward()("until_control")
|
||||
where_clause = Forward()("where_clause")
|
||||
while_control = Forward()("while_control")
|
||||
width = Forward()("width")
|
||||
width_spec = Forward()("width_spec")
|
||||
abstract_supertype_declaration << (((ABSTRACT + SUPERTYPE + Optional(subtype_constraint)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="abstract_supertype_declaration"))
|
||||
actual_parameter_list << (((CaselessLiteral("(") + Optional(parameter) + ZeroOrMore((CaselessLiteral(",") + parameter)) + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="actual_parameter_list"))
|
||||
aggregate_initializer << (((CaselessLiteral("[") + Optional((element + ZeroOrMore((CaselessLiteral(",") + element)))) + CaselessLiteral("]")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="aggregate_initializer"))
|
||||
aggregate_source << (simple_expression)
|
||||
aggregate_type << (((AGGREGATE + Optional((CaselessLiteral(":") + type_label)) + OF + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="aggregate_type"))
|
||||
aggregation_types << (((array_type | bag_type | list_type | set_type))).set_parse_action(AggregationType)
|
||||
algorithm_head << (((ZeroOrMore(declaration) + Optional(constant_decl) + Optional(local_decl)))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="algorithm_head"))
|
||||
alias_stmt << (((ALIAS + variable_id + FOR + general_ref + ZeroOrMore(qualifier) + CaselessLiteral(";") + stmt + ZeroOrMore(stmt) + END_ALIAS + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="alias_stmt"))
|
||||
array_type << (((ARRAY + bound_spec + OF + Optional(OPTIONAL) + Optional(UNIQUE) + instantiable_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="array_type"))
|
||||
assignment_stmt << (((general_ref + ZeroOrMore(qualifier) + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="assignment_stmt"))
|
||||
bag_type << (((BAG + Optional(bound_spec) + OF + instantiable_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="bag_type"))
|
||||
binary_type << (((BINARY + Optional(width_spec)))).set_parse_action(BinaryType)
|
||||
bound_1 << (numeric_expression)
|
||||
inverse_clause << (((INVERSE + inverse_attr + ZeroOrMore(inverse_attr)))).setParseAction(AttributeList)
|
||||
bound_2 << (numeric_expression)
|
||||
bound_spec << (((CaselessLiteral("[") + bound_1 + CaselessLiteral(":") + bound_2 + CaselessLiteral("]")))).set_parse_action(BoundSpecification)
|
||||
case_action << (((case_label + ZeroOrMore((CaselessLiteral(",") + case_label)) + CaselessLiteral(":") + stmt))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="case_action"))
|
||||
case_label << (expression)
|
||||
case_stmt << (((CASE + selector + OF + ZeroOrMore(case_action) + Optional((OTHERWISE + CaselessLiteral(":") + stmt)) + END_CASE + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="case_stmt"))
|
||||
compound_stmt << (((BEGIN + stmt + ZeroOrMore(stmt) + END + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="compound_stmt"))
|
||||
concrete_types << (((aggregation_types | simple_types | type_ref))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="concrete_types"))
|
||||
constant_body << (((constant_id + CaselessLiteral(":") + instantiable_type + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="constant_body"))
|
||||
constant_decl << (((CONSTANT + constant_body + ZeroOrMore(constant_body) + END_CONSTANT + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="constant_decl"))
|
||||
declaration << (((entity_decl | function_decl | procedure_decl | subtype_constraint_decl | type_decl))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="declaration"))
|
||||
derive_clause << (((DERIVE + derived_attr + ZeroOrMore(derived_attr)))).set_parse_action(AttributeList)
|
||||
derived_attr << (((attribute_decl + CaselessLiteral(":") + parameter_type + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="derived_attr"))
|
||||
domain_rule << (((Optional((rule_label_id + CaselessLiteral(":"))) + expression))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="domain_rule"))
|
||||
element << (((expression + Optional((CaselessLiteral(":") + repetition))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="element"))
|
||||
embedded_remark << (((CaselessLiteral("(*") + Optional(remark_tag) + ZeroOrMore(((not_paren_star + ZeroOrMore(not_paren_star)) | lparen_then_not_lparen_star | (CaselessLiteral("*") + ZeroOrMore(CaselessLiteral("*"))) | not_rparen_star_then_rparen | embedded_remark)) + CaselessLiteral("*)")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="embedded_remark"))
|
||||
entity_body << (((ZeroOrMore(explicit_attr) + Optional(derive_clause) + Optional(inverse_clause) + Optional(unique_clause) + Optional(where_clause)))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="entity_body"))
|
||||
entity_constructor << (((entity_ref + CaselessLiteral("(") + Optional((expression + ZeroOrMore((CaselessLiteral(",") + expression)))) + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="entity_constructor"))
|
||||
entity_decl << (((entity_head + entity_body + END_ENTITY + CaselessLiteral(";")))).set_parse_action(EntityDeclaration)
|
||||
entity_head << (((ENTITY + entity_id + subsuper + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="entity_head"))
|
||||
explicit_attr << (((attribute_decl + ZeroOrMore((CaselessLiteral(",") + attribute_decl)) + CaselessLiteral(":") + Optional(OPTIONAL) + parameter_type + CaselessLiteral(";")))).set_parse_action(ExplicitAttribute)
|
||||
expression << (((simple_expression + Optional((rel_op_extended + simple_expression))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="expression"))
|
||||
factor << (((simple_factor + Optional((CaselessLiteral("**") + simple_factor))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="factor"))
|
||||
formal_parameter << (((parameter_id + ZeroOrMore((CaselessLiteral(",") + parameter_id)) + CaselessLiteral(":") + parameter_type))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="formal_parameter"))
|
||||
function_call << ((((built_in_function | function_ref) + actual_parameter_list))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="function_call"))
|
||||
function_decl << (((function_head + algorithm_head + stmt + ZeroOrMore(stmt) + END_FUNCTION + CaselessLiteral(";")))).set_parse_action(FunctionDeclaration)
|
||||
function_head << (((FUNCTION + function_id + Optional((CaselessLiteral("(") + formal_parameter + ZeroOrMore((CaselessLiteral(";") + formal_parameter)) + CaselessLiteral(")"))) + CaselessLiteral(":") + parameter_type + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="function_head"))
|
||||
general_aggregation_types << (((general_array_type | general_bag_type | general_list_type | general_set_type))).set_parse_action(AggregationType)
|
||||
general_array_type << (((ARRAY + Optional(bound_spec) + OF + Optional(OPTIONAL) + Optional(UNIQUE) + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_array_type"))
|
||||
general_bag_type << (((BAG + Optional(bound_spec) + OF + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_bag_type"))
|
||||
general_list_type << (((LIST + Optional(bound_spec) + OF + Optional(UNIQUE) + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_list_type"))
|
||||
general_set_type << (((SET + Optional(bound_spec) + OF + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_set_type"))
|
||||
generalized_types << (((aggregate_type | general_aggregation_types | generic_entity_type | generic_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="generalized_types"))
|
||||
if_stmt << (((IF + logical_expression + THEN + stmt + ZeroOrMore(stmt) + Optional((ELSE + stmt + ZeroOrMore(stmt))) + END_IF + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="if_stmt"))
|
||||
increment << (numeric_expression)
|
||||
increment_control << (((variable_id + CaselessLiteral(":=") + bound_1 + TO + bound_2 + Optional((BY + increment))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="increment_control"))
|
||||
index << (numeric_expression)
|
||||
index_1 << (index)
|
||||
index_2 << (index)
|
||||
index_qualifier << (((CaselessLiteral("[") + index_1 + Optional((CaselessLiteral(":") + index_2)) + CaselessLiteral("]")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="index_qualifier"))
|
||||
instantiable_type << (((concrete_types | entity_ref))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="instantiable_type"))
|
||||
interval << (((CaselessLiteral("{") + interval_low + interval_op + interval_item + interval_op + interval_high + CaselessLiteral("}")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="interval"))
|
||||
interval_high << (simple_expression)
|
||||
interval_item << (simple_expression)
|
||||
interval_low << (simple_expression)
|
||||
inverse_attr << (((attribute_decl + CaselessLiteral(":") + Optional(((SET | BAG) + Optional(bound_spec) + OF)) + entity_ref + FOR + Optional((entity_ref + CaselessLiteral("."))) + attribute_ref + CaselessLiteral(";")))).set_parse_action(InverseAttribute)
|
||||
inverse_clause << (((INVERSE + inverse_attr + ZeroOrMore(inverse_attr)))).set_parse_action(AttributeList)
|
||||
list_type << (((LIST + Optional(bound_spec) + OF + Optional(UNIQUE) + instantiable_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="list_type"))
|
||||
local_decl << (((LOCAL + local_variable + ZeroOrMore(local_variable) + END_LOCAL + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="local_decl"))
|
||||
local_variable << (((variable_id + ZeroOrMore((CaselessLiteral(",") + variable_id)) + CaselessLiteral(":") + parameter_type + Optional((CaselessLiteral(":=") + expression)) + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="local_variable"))
|
||||
logical_expression << (expression)
|
||||
numeric_expression << (simple_expression)
|
||||
string_type << (((STRING + Optional(width_spec)))).setParseAction(StringType)
|
||||
formal_parameter << (((parameter_id + ZeroOrMore((CaselessLiteral(",") + parameter_id)) + CaselessLiteral(":") + parameter_type))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="formal_parameter"))
|
||||
generalized_types << (((aggregate_type | general_aggregation_types | generic_entity_type | generic_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="generalized_types"))
|
||||
function_head << (((FUNCTION + function_id + Optional((CaselessLiteral("(") + formal_parameter + ZeroOrMore((CaselessLiteral(";") + formal_parameter)) + CaselessLiteral(")"))) + CaselessLiteral(":") + parameter_type + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="function_head"))
|
||||
constant_decl << (((CONSTANT + constant_body + ZeroOrMore(constant_body) + END_CONSTANT + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="constant_decl"))
|
||||
actual_parameter_list << (((CaselessLiteral("(") + Optional(parameter) + ZeroOrMore((CaselessLiteral(",") + parameter)) + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="actual_parameter_list"))
|
||||
subtype_constraint_body << (((Optional(abstract_supertype) + Optional(total_over) + Optional((supertype_expression + CaselessLiteral(";")))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_body"))
|
||||
procedure_decl << (((procedure_head + algorithm_head + ZeroOrMore(stmt) + END_PROCEDURE + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="procedure_decl"))
|
||||
case_action << (((case_label + ZeroOrMore((CaselessLiteral(",") + case_label)) + CaselessLiteral(":") + stmt))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="case_action"))
|
||||
term << (((factor + ZeroOrMore((multiplication_like_op + factor))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="term"))
|
||||
general_aggregation_types << (((general_array_type | general_bag_type | general_list_type | general_set_type))).setParseAction(AggregationType)
|
||||
function_call << ((((built_in_function | function_ref) + actual_parameter_list))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="function_call"))
|
||||
where_clause << (((WHERE + domain_rule + CaselessLiteral(";") + ZeroOrMore((domain_rule + CaselessLiteral(";")))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="where_clause"))
|
||||
local_variable << (((variable_id + ZeroOrMore((CaselessLiteral(",") + variable_id)) + CaselessLiteral(":") + parameter_type + Optional((CaselessLiteral(":=") + expression)) + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="local_variable"))
|
||||
aggregate_initializer << (((CaselessLiteral("[") + Optional((element + ZeroOrMore((CaselessLiteral(",") + element)))) + CaselessLiteral("]")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="aggregate_initializer"))
|
||||
binary_type << (((BINARY + Optional(width_spec)))).setParseAction(BinaryType)
|
||||
index << (numeric_expression)
|
||||
case_stmt << (((CASE + selector + OF + ZeroOrMore(case_action) + Optional((OTHERWISE + CaselessLiteral(":") + stmt)) + END_CASE + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="case_stmt"))
|
||||
general_set_type << (((SET + Optional(bound_spec) + OF + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_set_type"))
|
||||
procedure_call_stmt << ((((built_in_procedure | procedure_ref) + actual_parameter_list + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="procedure_call_stmt"))
|
||||
instantiable_type << (((concrete_types | entity_ref))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="instantiable_type"))
|
||||
general_array_type << (((ARRAY + Optional(bound_spec) + OF + Optional(OPTIONAL) + Optional(UNIQUE) + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_array_type"))
|
||||
set_type << (((SET + Optional(bound_spec) + OF + instantiable_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="set_type"))
|
||||
supertype_factor << (((supertype_term + ZeroOrMore((AND + supertype_term))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="supertype_factor"))
|
||||
index_2 << (index)
|
||||
qualifiable_factor << (((function_call | attribute_ref | constant_factor | general_ref | population))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="qualifiable_factor"))
|
||||
algorithm_head << (((ZeroOrMore(declaration) + Optional(constant_decl) + Optional(local_decl)))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="algorithm_head"))
|
||||
parameter_type << (((generalized_types | simple_types | named_types))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="parameter_type"))
|
||||
one_of << (((ONEOF + CaselessLiteral("(") + supertype_expression + ZeroOrMore((CaselessLiteral(",") + supertype_expression)) + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="one_of"))
|
||||
compound_stmt << (((BEGIN + stmt + ZeroOrMore(stmt) + END + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="compound_stmt"))
|
||||
primary << (((literal | (qualifiable_factor + ZeroOrMore(qualifier))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="primary"))
|
||||
schema_decl << (((SCHEMA + schema_id + Optional(schema_version_id) + CaselessLiteral(";") + schema_body + END_SCHEMA + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="schema_decl"))
|
||||
embedded_remark << (((CaselessLiteral("(*") + Optional(remark_tag) + ZeroOrMore(((not_paren_star + ZeroOrMore(not_paren_star)) | lparen_then_not_lparen_star | (CaselessLiteral("*") + ZeroOrMore(CaselessLiteral("*"))) | not_rparen_star_then_rparen | embedded_remark)) + CaselessLiteral("*)")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="embedded_remark"))
|
||||
width_spec << (((CaselessLiteral("(") + width + CaselessLiteral(")") + Optional(FIXED)))).setParseAction(WidthSpec)
|
||||
assignment_stmt << (((general_ref + ZeroOrMore(qualifier) + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="assignment_stmt"))
|
||||
element << (((expression + Optional((CaselessLiteral(":") + repetition))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="element"))
|
||||
schema_body << (((ZeroOrMore(interface_specification) + Optional(constant_decl) + ZeroOrMore((declaration | rule_decl))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="schema_body"))
|
||||
procedure_head << (((PROCEDURE + procedure_id + Optional((CaselessLiteral("(") + Optional(VAR) + formal_parameter + ZeroOrMore((CaselessLiteral(";") + Optional(VAR) + formal_parameter)) + CaselessLiteral(")"))) + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="procedure_head"))
|
||||
general_bag_type << (((BAG + Optional(bound_spec) + OF + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_bag_type"))
|
||||
entity_head << (((ENTITY + entity_id + subsuper + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="entity_head"))
|
||||
entity_body << (((ZeroOrMore(explicit_attr) + Optional(derive_clause) + Optional(inverse_clause) + Optional(unique_clause) + Optional(where_clause)))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="entity_body"))
|
||||
list_type << (((LIST + Optional(bound_spec) + OF + Optional(UNIQUE) + instantiable_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="list_type"))
|
||||
expression << (((simple_expression + Optional((rel_op_extended + simple_expression))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="expression"))
|
||||
one_of << (((ONEOF + CaselessLiteral("(") + supertype_expression + ZeroOrMore((CaselessLiteral(",") + supertype_expression)) + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="one_of"))
|
||||
parameter << (expression)
|
||||
simple_types << (((binary_type | boolean_type | integer_type | logical_type | number_type | real_type | string_type))).setParseAction(SimpleType)
|
||||
bag_type << (((BAG + Optional(bound_spec) + OF + instantiable_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="bag_type"))
|
||||
parameter_type << (((generalized_types | simple_types | named_types))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="parameter_type"))
|
||||
precision_spec << (numeric_expression)
|
||||
primary << (((literal | (qualifiable_factor + ZeroOrMore(qualifier))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="primary"))
|
||||
procedure_call_stmt << ((((built_in_procedure | procedure_ref) + actual_parameter_list + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="procedure_call_stmt"))
|
||||
procedure_decl << (((procedure_head + algorithm_head + ZeroOrMore(stmt) + END_PROCEDURE + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="procedure_decl"))
|
||||
procedure_head << (((PROCEDURE + procedure_id + Optional((CaselessLiteral("(") + Optional(VAR) + formal_parameter + ZeroOrMore((CaselessLiteral(";") + Optional(VAR) + formal_parameter)) + CaselessLiteral(")"))) + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="procedure_head"))
|
||||
qualifiable_factor << (((function_call | attribute_ref | constant_factor | general_ref | population))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="qualifiable_factor"))
|
||||
qualifier << (((attribute_qualifier | group_qualifier | index_qualifier))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="qualifier"))
|
||||
query_expression << (((QUERY + CaselessLiteral("(") + variable_id + CaselessLiteral("<*") + aggregate_source + CaselessLiteral("|") + logical_expression + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="query_expression"))
|
||||
real_type << (((REAL + Optional((CaselessLiteral("(") + precision_spec + CaselessLiteral(")")))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="real_type"))
|
||||
remark << (((embedded_remark | tail_remark))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="remark"))
|
||||
repeat_control << (((Optional(increment_control) + Optional(while_control) + Optional(until_control)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="repeat_control"))
|
||||
repeat_stmt << (((REPEAT + repeat_control + CaselessLiteral(";") + stmt + ZeroOrMore(stmt) + END_REPEAT + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="repeat_stmt"))
|
||||
repetition << (numeric_expression)
|
||||
constant_body << (((constant_id + CaselessLiteral(":") + instantiable_type + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="constant_body"))
|
||||
if_stmt << (((IF + logical_expression + THEN + stmt + ZeroOrMore(stmt) + Optional((ELSE + stmt + ZeroOrMore(stmt))) + END_IF + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="if_stmt"))
|
||||
inverse_attr << (((attribute_decl + CaselessLiteral(":") + Optional(((SET | BAG) + Optional(bound_spec) + OF)) + entity_ref + FOR + Optional((entity_ref + CaselessLiteral("."))) + attribute_ref + CaselessLiteral(";")))).setParseAction(InverseAttribute)
|
||||
interval << (((CaselessLiteral("{") + interval_low + interval_op + interval_item + interval_op + interval_high + CaselessLiteral("}")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="interval"))
|
||||
query_expression << (((QUERY + CaselessLiteral("(") + variable_id + CaselessLiteral("<*") + aggregate_source + CaselessLiteral("|") + logical_expression + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="query_expression"))
|
||||
array_type << (((ARRAY + bound_spec + OF + Optional(OPTIONAL) + Optional(UNIQUE) + instantiable_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="array_type"))
|
||||
simple_factor << (((aggregate_initializer | interval | query_expression | (Optional(unary_op) + ((CaselessLiteral("(") + expression + CaselessLiteral(")")) | primary)) | entity_constructor | enumeration_reference))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="simple_factor"))
|
||||
case_label << (expression)
|
||||
domain_rule << (((Optional((rule_label_id + CaselessLiteral(":"))) + expression))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="domain_rule"))
|
||||
repeat_stmt << (((REPEAT + repeat_control + CaselessLiteral(";") + stmt + ZeroOrMore(stmt) + END_REPEAT + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="repeat_stmt"))
|
||||
supertype_expression << (((supertype_factor + ZeroOrMore((ANDOR + supertype_factor))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="supertype_expression"))
|
||||
supertype_constraint << (((abstract_supertype_declaration | abstract_entity_declaration | supertype_rule))).setParseAction(SuperTypeExpression)
|
||||
interval_high << (simple_expression)
|
||||
local_decl << (((LOCAL + local_variable + ZeroOrMore(local_variable) + END_LOCAL + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="local_decl"))
|
||||
return_stmt << (((RETURN + Optional((CaselessLiteral("(") + expression + CaselessLiteral(")"))) + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="return_stmt"))
|
||||
rule_decl << (((rule_head + algorithm_head + ZeroOrMore(stmt) + where_clause + END_RULE + CaselessLiteral(";")))).set_parse_action(RuleDeclaration)
|
||||
schema_body << (((ZeroOrMore(interface_specification) + Optional(constant_decl) + ZeroOrMore((declaration | rule_decl))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="schema_body"))
|
||||
schema_decl << (((SCHEMA + schema_id + Optional(schema_version_id) + CaselessLiteral(";") + schema_body + END_SCHEMA + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="schema_decl"))
|
||||
selector << (expression)
|
||||
aggregate_source << (simple_expression)
|
||||
qualifier << (((attribute_qualifier | group_qualifier | index_qualifier))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="qualifier"))
|
||||
set_type << (((SET + Optional(bound_spec) + OF + instantiable_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="set_type"))
|
||||
simple_expression << (((term + ZeroOrMore((add_like_op + term))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="simple_expression"))
|
||||
simple_factor << (((aggregate_initializer | interval | query_expression | (Optional(unary_op) + ((CaselessLiteral("(") + expression + CaselessLiteral(")")) | primary)) | entity_constructor | enumeration_reference))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="simple_factor"))
|
||||
simple_types << (((binary_type | boolean_type | integer_type | logical_type | number_type | real_type | string_type))).set_parse_action(SimpleType)
|
||||
stmt << (((alias_stmt | assignment_stmt | case_stmt | compound_stmt | escape_stmt | if_stmt | null_stmt | procedure_call_stmt | repeat_stmt | return_stmt | skip_stmt))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="stmt"))
|
||||
string_type << (((STRING + Optional(width_spec)))).set_parse_action(StringType)
|
||||
subsuper << (((Optional(supertype_constraint) + Optional(subtype_declaration)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subsuper"))
|
||||
subtype_constraint << (((OF + CaselessLiteral("(") + supertype_expression + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint"))
|
||||
subtype_constraint_body << (((Optional(abstract_supertype) + Optional(total_over) + Optional((supertype_expression + CaselessLiteral(";")))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_body"))
|
||||
subtype_constraint_decl << (((subtype_constraint_head + subtype_constraint_body + END_SUBTYPE_CONSTRAINT + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_decl"))
|
||||
supertype_constraint << (((abstract_supertype_declaration | abstract_entity_declaration | supertype_rule))).set_parse_action(SuperTypeExpression)
|
||||
supertype_expression << (((supertype_factor + ZeroOrMore((ANDOR + supertype_factor))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="supertype_expression"))
|
||||
supertype_factor << (((supertype_term + ZeroOrMore((AND + supertype_term))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="supertype_factor"))
|
||||
supertype_rule << (((SUPERTYPE + subtype_constraint))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="supertype_rule"))
|
||||
supertype_term << (((one_of | (CaselessLiteral("(") + supertype_expression + CaselessLiteral(")")) | entity_ref))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="supertype_term"))
|
||||
syntax << (((schema_decl + ZeroOrMore(schema_decl)))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="syntax"))
|
||||
term << (((factor + ZeroOrMore((multiplication_like_op + factor))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="term"))
|
||||
type_decl << (((TYPE + type_id + CaselessLiteral("=") + underlying_type + CaselessLiteral(";") + Optional(where_clause) + END_TYPE + CaselessLiteral(";")))).set_parse_action(TypeDeclaration)
|
||||
underlying_type << (((constructed_types | concrete_types))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="underlying_type"))
|
||||
until_control << (((UNTIL + logical_expression))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="until_control"))
|
||||
where_clause << (((WHERE + domain_rule + CaselessLiteral(";") + ZeroOrMore((domain_rule + CaselessLiteral(";")))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="where_clause"))
|
||||
while_control << (((WHILE + logical_expression))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="while_control"))
|
||||
width << (numeric_expression)
|
||||
width_spec << (((CaselessLiteral("(") + width + CaselessLiteral(")") + Optional(FIXED)))).set_parse_action(WidthSpec)
|
||||
|
||||
syntax.ignore("--" + restOfLine)
|
||||
syntax.ignore(Regex(r"\((?:\*(?:[^*]*\*+)+?\))"))
|
||||
ast = syntax.parseFile(fn)
|
||||
ast = syntax.parse_file(fn)
|
||||
s = schema.Schema(ast)
|
||||
m = mapping.Mapping(s)
|
||||
|
||||
with open(cache_file, "wb") as f:
|
||||
pickle.dump(m, f, protocol=0)
|
||||
return m
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
m = parse(sys.argv[1])
|
||||
import importlib
|
||||
|
||||
@@ -11,16 +11,16 @@ ENTITY file_name;
|
||||
time_stamp : time_stamp_text;
|
||||
author : LIST [1:?] OF STRING (256);
|
||||
organization : LIST [1:?] OF STRING (256);
|
||||
preprocessor_version : STRING (256);
|
||||
preprocessor_version : STRING (256);
|
||||
originating_system : STRING (256);
|
||||
authorisation : STRING (256);
|
||||
authorisation : STRING (256);
|
||||
END_ENTITY;
|
||||
|
||||
ENTITY file_description;
|
||||
description : LIST [1:?] OF STRING (256);
|
||||
implementation_level : STRING (256);
|
||||
END_ENTITY;
|
||||
|
||||
|
||||
ENTITY file_schema;
|
||||
schema_identifiers : LIST [1:?] OF UNIQUE schema_name;
|
||||
END_ENTITY;
|
||||
|
||||
@@ -263,7 +263,7 @@ context_class = context
|
||||
|
||||
class codegen_rule:
|
||||
def __init__(self, pattern, fn):
|
||||
self.pattern = tuple(rule.parseString(pattern))
|
||||
self.pattern = tuple(rule.parse_string(pattern))
|
||||
self.fn = fn
|
||||
if not hasattr(codegen_rule, "all_rules"):
|
||||
codegen_rule.all_rules = []
|
||||
@@ -292,7 +292,7 @@ def process_rule_decl(context):
|
||||
class {context.rule_head.rule_id}:
|
||||
SCOPE = "file"
|
||||
|
||||
@staticmethod
|
||||
@staticmethod
|
||||
def __call__(file):
|
||||
{context.rule_head.entity_ref} = file.by_type("{context.rule_head.entity_ref}")
|
||||
{indent(8, context.algorithm_head.local_decl)}
|
||||
@@ -335,7 +335,7 @@ class {class_name}_{domain_rule.rule_label_id}:
|
||||
TYPE_NAME = "{class_name}"
|
||||
RULE_NAME = "{domain_rule.rule_label_id}"
|
||||
|
||||
@staticmethod
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
{indent(8, (f"{a.lower()} = self.{a}" for a in attributes if re.search(f'{wb}{a.lower()}{wb}', str(domain_rule))))}
|
||||
{indent(8, domain_rule)}
|
||||
@@ -741,7 +741,7 @@ class AttributeGetattrTransformer(ast.NodeTransformer):
|
||||
func=ast.Name(id="express_getattr", ctx=ast.Load()),
|
||||
args=[
|
||||
new_value,
|
||||
ast.Str(s=node.attr),
|
||||
ast.Constant(value=node.attr),
|
||||
ast.Name(id="INDETERMINATE", ctx=ast.Load()),
|
||||
],
|
||||
keywords=[],
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -4618,7 +4618,7 @@ class IfcConstructionMaterialResource_WR2:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or express_getattr(express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjectsType', INDETERMINATE) == express_getattr(IfcObjectTypeEnum, 'PRODUCT', INDETERMINATE)) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or express_getattr(express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjectsType', INDETERMINATE) == express_getattr(IfcObjectTypeEnum, 'PRODUCT', INDETERMINATE)) is not False
|
||||
|
||||
class IfcConstructionProductResource_WR1:
|
||||
SCOPE = 'entity'
|
||||
@@ -4636,7 +4636,7 @@ class IfcConstructionProductResource_WR2:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or express_getattr(express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjectsType', INDETERMINATE) == express_getattr(IfcObjectTypeEnum, 'PRODUCT', INDETERMINATE)) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or express_getattr(express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjectsType', INDETERMINATE) == express_getattr(IfcObjectTypeEnum, 'PRODUCT', INDETERMINATE)) is not False
|
||||
|
||||
class IfcCooledBeamType_WR1:
|
||||
SCOPE = 'entity'
|
||||
@@ -4876,7 +4876,7 @@ class IfcDocumentReference_WR1:
|
||||
def __call__(self):
|
||||
name = express_getattr(self, 'Name', INDETERMINATE)
|
||||
referencetodocument = express_getattr(self, 'ReferenceToDocument', INDETERMINATE)
|
||||
assert exists(name) ^ exists(lambda : express_getitem(referencetodocument, 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) is not False
|
||||
assert exists(name) ^ exists(lambda: express_getitem(referencetodocument, 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) is not False
|
||||
|
||||
class IfcDoorLiningProperties_WR31:
|
||||
SCOPE = 'entity'
|
||||
@@ -4929,7 +4929,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_WR31:
|
||||
SCOPE = 'entity'
|
||||
@@ -4938,7 +4938,7 @@ class IfcDoorPanelProperties_WR31:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
|
||||
class IfcDraughtingPreDefinedColour_WR31:
|
||||
SCOPE = 'entity'
|
||||
@@ -7195,7 +7195,7 @@ class IfcTypeProduct_WR41:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'ObjectTypeOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'ObjectTypeOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc2x3.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'ObjectTypeOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'ObjectTypeOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc2x3.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_WR21:
|
||||
SCOPE = 'entity'
|
||||
@@ -7331,7 +7331,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
|
||||
class IfcWorkControl_WR1:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -6565,7 +6565,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -6574,7 +6574,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -10952,7 +10952,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -11258,7 +11258,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -11267,7 +11267,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -6656,7 +6656,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -6665,7 +6665,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -11103,7 +11103,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x1.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x1.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -11409,7 +11409,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -11418,7 +11418,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -6877,7 +6877,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -6886,7 +6886,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -11365,7 +11365,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x2.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x2.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -11701,7 +11701,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -11710,7 +11710,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -7650,7 +7650,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -7659,7 +7659,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -12698,7 +12698,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_add2.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_add2.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -13075,7 +13075,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -13084,7 +13084,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -7549,7 +7549,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -7558,7 +7558,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -12384,7 +12384,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc1.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc1.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -12720,7 +12720,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -12729,7 +12729,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -7637,7 +7637,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -7646,7 +7646,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -12479,7 +12479,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc2.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc2.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -12815,7 +12815,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -12824,7 +12824,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -246,7 +246,7 @@ notdefined = IfcAlarmTypeEnum.NOTDEFINED
|
||||
IfcAlignmentCantSegmentTypeEnum = enum_namespace()
|
||||
constantcant = IfcAlignmentCantSegmentTypeEnum.CONSTANTCANT
|
||||
lineartransition = IfcAlignmentCantSegmentTypeEnum.LINEARTRANSITION
|
||||
helmertcurve = IfcAlignmentCantSegmentTypeEnum.HELMERTCURVE
|
||||
biquadraticparabola = IfcAlignmentCantSegmentTypeEnum.BIQUADRATICPARABOLA
|
||||
blosscurve = IfcAlignmentCantSegmentTypeEnum.BLOSSCURVE
|
||||
cosinecurve = IfcAlignmentCantSegmentTypeEnum.COSINECURVE
|
||||
sinecurve = IfcAlignmentCantSegmentTypeEnum.SINECURVE
|
||||
@@ -256,7 +256,7 @@ line = IfcAlignmentHorizontalSegmentTypeEnum.LINE
|
||||
circulararc = IfcAlignmentHorizontalSegmentTypeEnum.CIRCULARARC
|
||||
clothoid = IfcAlignmentHorizontalSegmentTypeEnum.CLOTHOID
|
||||
cubic = IfcAlignmentHorizontalSegmentTypeEnum.CUBIC
|
||||
helmertcurve = IfcAlignmentHorizontalSegmentTypeEnum.HELMERTCURVE
|
||||
biquadraticparabola = IfcAlignmentHorizontalSegmentTypeEnum.BIQUADRATICPARABOLA
|
||||
blosscurve = IfcAlignmentHorizontalSegmentTypeEnum.BLOSSCURVE
|
||||
cubicspiral = IfcAlignmentHorizontalSegmentTypeEnum.CUBICSPIRAL
|
||||
cosinecurve = IfcAlignmentHorizontalSegmentTypeEnum.COSINECURVE
|
||||
@@ -802,9 +802,9 @@ soundabsorption = IfcDiscreteAccessoryTypeEnum.SOUNDABSORPTION
|
||||
pointmachinemountingdevice = IfcDiscreteAccessoryTypeEnum.POINTMACHINEMOUNTINGDEVICE
|
||||
point_machine_locking_device = IfcDiscreteAccessoryTypeEnum.POINT_MACHINE_LOCKING_DEVICE
|
||||
rail_mechanical_equipment = IfcDiscreteAccessoryTypeEnum.RAIL_MECHANICAL_EQUIPMENT
|
||||
birdprotection = IfcDiscreteAccessoryTypeEnum.BIRDPROTECTION
|
||||
userdefined = IfcDiscreteAccessoryTypeEnum.USERDEFINED
|
||||
notdefined = IfcDiscreteAccessoryTypeEnum.NOTDEFINED
|
||||
birdprotection = IfcDiscreteAccessoryTypeEnum.BIRDPROTECTION
|
||||
IfcDistributionBoardTypeEnum = enum_namespace()
|
||||
switchboard = IfcDistributionBoardTypeEnum.SWITCHBOARD
|
||||
consumerunit = IfcDistributionBoardTypeEnum.CONSUMERUNIT
|
||||
@@ -1418,7 +1418,7 @@ logicalnotor = IfcLogicalOperatorEnum.LOGICALNOTOR
|
||||
IfcMarineFacilityTypeEnum = enum_namespace()
|
||||
canal = IfcMarineFacilityTypeEnum.CANAL
|
||||
waterwayshiplift = IfcMarineFacilityTypeEnum.WATERWAYSHIPLIFT
|
||||
revetment = IfcMarineFacilityTypeEnum.REVETMENT
|
||||
embankment = IfcMarineFacilityTypeEnum.EMBANKMENT
|
||||
launchrecovery = IfcMarineFacilityTypeEnum.LAUNCHRECOVERY
|
||||
marinedefence = IfcMarineFacilityTypeEnum.MARINEDEFENCE
|
||||
hydrolift = IfcMarineFacilityTypeEnum.HYDROLIFT
|
||||
@@ -1587,11 +1587,6 @@ dataoutlet = IfcOutletTypeEnum.DATAOUTLET
|
||||
telephoneoutlet = IfcOutletTypeEnum.TELEPHONEOUTLET
|
||||
userdefined = IfcOutletTypeEnum.USERDEFINED
|
||||
notdefined = IfcOutletTypeEnum.NOTDEFINED
|
||||
IfcPavementTypeEnum = enum_namespace()
|
||||
flexible = IfcPavementTypeEnum.FLEXIBLE
|
||||
rigid = IfcPavementTypeEnum.RIGID
|
||||
userdefined = IfcPavementTypeEnum.USERDEFINED
|
||||
notdefined = IfcPavementTypeEnum.NOTDEFINED
|
||||
IfcPerformanceHistoryTypeEnum = enum_namespace()
|
||||
userdefined = IfcPerformanceHistoryTypeEnum.USERDEFINED
|
||||
notdefined = IfcPerformanceHistoryTypeEnum.NOTDEFINED
|
||||
@@ -2073,7 +2068,6 @@ parking = IfcSpaceTypeEnum.PARKING
|
||||
gfa = IfcSpaceTypeEnum.GFA
|
||||
internal = IfcSpaceTypeEnum.INTERNAL
|
||||
external = IfcSpaceTypeEnum.EXTERNAL
|
||||
berth = IfcSpaceTypeEnum.BERTH
|
||||
userdefined = IfcSpaceTypeEnum.USERDEFINED
|
||||
notdefined = IfcSpaceTypeEnum.NOTDEFINED
|
||||
IfcSpatialZoneTypeEnum = enum_namespace()
|
||||
@@ -3126,9 +3120,6 @@ def IfcDirection(*args, **kwargs):
|
||||
def IfcDirectrixCurveSweptAreaSolid(*args, **kwargs):
|
||||
return ifcopenshell.create_entity('IfcDirectrixCurveSweptAreaSolid', 'IFC4X3_RC3', *args, **kwargs)
|
||||
|
||||
def IfcDirectrixDerivedReferenceSweptAreaSolid(*args, **kwargs):
|
||||
return ifcopenshell.create_entity('IfcDirectrixDerivedReferenceSweptAreaSolid', 'IFC4X3_RC3', *args, **kwargs)
|
||||
|
||||
def IfcDirectrixDistanceSweptAreaSolid(*args, **kwargs):
|
||||
return ifcopenshell.create_entity('IfcDirectrixDistanceSweptAreaSolid', 'IFC4X3_RC3', *args, **kwargs)
|
||||
|
||||
@@ -7670,7 +7661,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -7679,7 +7670,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -8276,7 +8267,7 @@ class IfcFacilityPart_CorrectPredefinedType:
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE)
|
||||
assert ((predefinedtype != express_getattr(IfcBridgePartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcRailwayPartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcRoadPartTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype != express_getattr(IfcMarinePartTypeEnum, 'USERDEFINED', INDETERMINATE)) or (predefinedtype != express_getattr(IfcFacilityPartCommonTypeEnum, 'USERDEFINED', INDETERMINATE))) or ((predefinedtype == express_getattr(IfcBridgePartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcRailwayPartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcRoadPartTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcMarinePartTypeEnum, 'USERDEFINED', INDETERMINATE)) or (predefinedtype == express_getattr(IfcFacilityPartCommonTypeEnum, 'USERDEFINED', INDETERMINATE))) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcBridgePartTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcRailwayPartTypeEnum, 'USERDEFINED', INDETERMINATE) and (predefinedtype != express_getattr(IfcRoadPartTypeEnum, 'USERDEFINED', INDETERMINATE)) and (predefinedtype != express_getattr(IfcMarinePartTypeEnum, 'USERDEFINED', INDETERMINATE)) and (predefinedtype != express_getattr(IfcFacilityPartCommonTypeEnum, 'USERDEFINED', INDETERMINATE))) or ((predefinedtype == express_getattr(IfcBridgePartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcRailwayPartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcRoadPartTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcMarinePartTypeEnum, 'USERDEFINED', INDETERMINATE)) or (predefinedtype == express_getattr(IfcFacilityPartCommonTypeEnum, 'USERDEFINED', INDETERMINATE))) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
|
||||
class IfcFan_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -8834,7 +8825,7 @@ class IfcImpactProtectionDevice_CorrectPredefinedType:
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE)
|
||||
assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) and (predefinedtype != express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE))) or ((predefinedtype == express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
|
||||
class IfcImpactProtectionDevice_CorrectTypeAssigned:
|
||||
SCOPE = 'entity'
|
||||
@@ -8854,7 +8845,7 @@ class IfcImpactProtectionDeviceType_CorrectPredefinedType:
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE)
|
||||
assert ((predefinedtype != express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
assert (predefinedtype != express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) and (predefinedtype != express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
|
||||
class IfcIndexedPolyCurve_Consecutive:
|
||||
SCOPE = 'entity'
|
||||
@@ -9523,36 +9514,6 @@ class IfcPath_IsContinuous:
|
||||
def __call__(self):
|
||||
assert IfcPathHeadToTail(self) is not False
|
||||
|
||||
class IfcPavement_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
TYPE_NAME = 'IfcPavement'
|
||||
RULE_NAME = 'CorrectPredefinedType'
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE)
|
||||
assert (not exists(predefinedtype) or predefinedtype != express_getattr(IfcPavementTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcPavementTypeEnum, 'USERDEFINED', INDETERMINATE) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
|
||||
class IfcPavement_CorrectTypeAssigned:
|
||||
SCOPE = 'entity'
|
||||
TYPE_NAME = 'IfcPavement'
|
||||
RULE_NAME = 'CorrectTypeAssigned'
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
istypedby = express_getattr(self, 'IsTypedBy', INDETERMINATE)
|
||||
assert (sizeof(istypedby) == 0 or 'ifc4x3_rc3.ifcpavementtype' in typeof(express_getattr(express_getitem(express_getattr(self, 'IsTypedBy', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatingType', INDETERMINATE))) is not False
|
||||
|
||||
class IfcPavementType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
TYPE_NAME = 'IfcPavementType'
|
||||
RULE_NAME = 'CorrectPredefinedType'
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE)
|
||||
assert (predefinedtype != express_getattr(IfcPavementTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcPavementTypeEnum, 'USERDEFINED', INDETERMINATE) and exists(express_getattr(self, 'ElementType', INDETERMINATE)))) is not False
|
||||
|
||||
class IfcPcurve_DimIs2D:
|
||||
SCOPE = 'entity'
|
||||
TYPE_NAME = 'IfcPcurve'
|
||||
@@ -9844,29 +9805,6 @@ class IfcPolyline_SameDim:
|
||||
points = express_getattr(self, 'Points', INDETERMINATE)
|
||||
assert (sizeof([temp for temp in points if express_getattr(temp, 'Dim', INDETERMINATE) != express_getattr(express_getitem(points, 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'Dim', INDETERMINATE)]) == 0) is not False
|
||||
|
||||
class IfcPolynomialCurve_ValidCoefficients:
|
||||
SCOPE = 'entity'
|
||||
TYPE_NAME = 'IfcPolynomialCurve'
|
||||
RULE_NAME = 'ValidCoefficients'
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
coefficientsx = express_getattr(self, 'CoefficientsX', INDETERMINATE)
|
||||
coefficientsy = express_getattr(self, 'CoefficientsY', INDETERMINATE)
|
||||
coefficientsz = express_getattr(self, 'CoefficientsZ', INDETERMINATE)
|
||||
assert (exists(coefficientsx) and exists(coefficientsy) or (exists(coefficientsx) and exists(coefficientsz)) or (exists(coefficientsy) and exists(coefficientsz)) or (exists(coefficientsx) and exists(coefficientsy) and exists(coefficientsz))) is not False
|
||||
|
||||
class IfcPolynomialCurve_CorrectPositionDim:
|
||||
SCOPE = 'entity'
|
||||
TYPE_NAME = 'IfcPolynomialCurve'
|
||||
RULE_NAME = 'CorrectPositionDim'
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
position = express_getattr(self, 'Position', INDETERMINATE)
|
||||
coefficientsz = express_getattr(self, 'CoefficientsZ', INDETERMINATE)
|
||||
assert (express_getattr(position, 'Dim', INDETERMINATE) == 2 and (not exists(coefficientsz)) or express_getattr(position, 'Dim', INDETERMINATE) == 3) is not False
|
||||
|
||||
class IfcPositioningElement_HasPlacement:
|
||||
SCOPE = 'entity'
|
||||
TYPE_NAME = 'IfcPositioningElement'
|
||||
@@ -11154,7 +11092,7 @@ class IfcSectionedSolidHorizontal_NoLongitudinalOffsets:
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
crosssectionpositions = express_getattr(self, 'CrossSectionPositions', INDETERMINATE)
|
||||
assert (sizeof([temp for temp in crosssectionpositions if exists(express_getattr(express_getattr(temp, 'Location', INDETERMINATE), 'OffsetLongitudinal', INDETERMINATE))]) == 0) is not False
|
||||
assert (sizeof([temp for temp in crosssectionpositions if exists(express_getattr(temp, 'OffsetLongitudinal', INDETERMINATE))]) == 0) is not False
|
||||
|
||||
class IfcSectionedSpine_CorrespondingSectionPositions:
|
||||
SCOPE = 'entity'
|
||||
@@ -12514,7 +12452,7 @@ class IfcTransportElement_CorrectPredefinedType:
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE)
|
||||
assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ElementType', INDETERMINATE)))) is not False
|
||||
assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
|
||||
class IfcTransportElement_CorrectTypeAssigned:
|
||||
SCOPE = 'entity'
|
||||
@@ -12534,7 +12472,7 @@ class IfcTransportElementType_CorrectPredefinedType:
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE)
|
||||
assert (predefinedtype != express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and exists(express_getattr(self, 'ElementType', INDETERMINATE))))) is not False
|
||||
assert (predefinedtype != express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or ((predefinedtype == express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ElementType', INDETERMINATE)))) is not False
|
||||
|
||||
def calc_IfcTriangulatedFaceSet_NumberOfTriangles(self):
|
||||
coordindex = express_getattr(self, 'CoordIndex', INDETERMINATE)
|
||||
@@ -12635,7 +12573,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc3.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc3.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -12991,7 +12929,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -13000,7 +12938,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -13440,8 +13378,6 @@ def IfcCurveDim(curve):
|
||||
if 'ifc4x3_rc3.ifccurvesegment2d' in typeof(curve):
|
||||
return 2
|
||||
if 'ifc4x3_rc3.ifcpolynomialcurve' in typeof(curve):
|
||||
if not exists(express_getattr(curve, 'CoefficientsZ', INDETERMINATE)) and express_getattr(express_getattr(curve, 'Position', INDETERMINATE), 'Dim', INDETERMINATE) == 2:
|
||||
return 2
|
||||
return 3
|
||||
if 'ifc4x3_rc3.ifcpcurve' in typeof(curve):
|
||||
return 3
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -7686,7 +7686,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -7695,7 +7695,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -12651,7 +12651,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc4.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc4.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -13007,7 +13007,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -13016,7 +13016,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
IF EXIST IFC2X3_TC1.exp (
|
||||
python express_parser.py IFC2X3_TC1.exp header implementation schema_class definitions
|
||||
|
||||
|
||||
IF EXIST Ifc2x3-schema.cpp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3.cpp txt/header_ifc2x3.txt Ifc2x3.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3.h txt/header_ifc2x3.txt Ifc2x3.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3-schema.cpp txt/header_ifc2x3.txt Ifc2x3-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3-schema.cpp txt/header_ifc2x3.txt Ifc2x3-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3-definitions.h txt/header_ifc2x3.txt Ifc2x3-definitions.h
|
||||
) ELSE (
|
||||
:: v0.5.0
|
||||
@@ -19,7 +19,7 @@ IF EXIST IFC2X3_TC1.exp (
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3-latebound.cpp txt/header_ifc2x3.txt txt/ifndef_ifc4.txt Ifc2x3-latebound.cpp txt/endif.txt
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3-latebound.h txt/header_ifc2x3.txt Ifc2x3-latebound.h
|
||||
)
|
||||
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
@@ -30,7 +30,7 @@ IF EXIST IFC4_ADD2TC1.exp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4.cpp txt/header_ifc4.txt Ifc4.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4.h txt/header_ifc4.txt Ifc4.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4-schema.cpp txt/header_ifc4.txt Ifc4-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4-schema.cpp txt/header_ifc4.txt Ifc4-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4-definitions.h txt/header_ifc4.txt Ifc4-definitions.h
|
||||
) ELSE (
|
||||
:: v0.5.0
|
||||
@@ -40,7 +40,7 @@ IF EXIST IFC4_ADD2TC1.exp (
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4-latebound.cpp txt/header_ifc4.txt txt/ifdef_ifc4.txt Ifc4-latebound.cpp txt/endif.txt
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4-latebound.h txt/header_ifc4.txt Ifc4-latebound.h
|
||||
)
|
||||
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
@@ -51,10 +51,10 @@ IF EXIST IFC4x1.exp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x1.cpp txt/header_ifc4x1.txt Ifc4x1.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x1.h txt/header_ifc4x1.txt Ifc4x1.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x1-schema.cpp txt/header_ifc4x1.txt Ifc4x1-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x1-schema.cpp txt/header_ifc4x1.txt Ifc4x1-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x1-definitions.h txt/header_ifc4x1.txt Ifc4x1-definitions.h
|
||||
)
|
||||
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
@@ -65,10 +65,10 @@ IF EXIST IFC4x2.exp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x2.cpp txt/header_ifc4x2.txt Ifc4x2.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x2.h txt/header_ifc4x2.txt Ifc4x2.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x2-schema.cpp txt/header_ifc4x2.txt Ifc4x2-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x2-schema.cpp txt/header_ifc4x2.txt Ifc4x2-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x2-definitions.h txt/header_ifc4x2.txt Ifc4x2-definitions.h
|
||||
)
|
||||
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
@@ -79,10 +79,10 @@ IF EXIST IFC4x3_RC1.exp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1.cpp txt/header_ifc4x3_rc1.txt Ifc4x3_rc1.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1.h txt/header_ifc4x3_rc1.txt Ifc4x3_rc1.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1-schema.cpp txt/header_ifc4x3_rc1.txt Ifc4x3_rc1-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1-schema.cpp txt/header_ifc4x3_rc1.txt Ifc4x3_rc1-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1-definitions.h txt/header_ifc4x3_rc1.txt Ifc4x3_rc1-definitions.h
|
||||
)
|
||||
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
@@ -93,10 +93,10 @@ IF EXIST IFC4x3_RC2.exp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc2.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc2.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc2-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc2-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc2-definitions.h
|
||||
)
|
||||
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
@@ -107,10 +107,10 @@ IF EXIST IFC4x3_RC3.exp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc3.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc3.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc3-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc3-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc3-definitions.h
|
||||
)
|
||||
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
@@ -121,10 +121,10 @@ IF EXIST IFC4x3_RC4.exp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc4.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc4.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc4-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc4-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc4-definitions.h
|
||||
)
|
||||
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
@@ -135,10 +135,10 @@ IF EXIST IFC4X3.exp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3.cpp txt/header_ifc4x3_rc2.txt Ifc4x3.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3.h txt/header_ifc4x3_rc2.txt Ifc4x3.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3-definitions.h
|
||||
)
|
||||
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
@@ -149,10 +149,10 @@ IF EXIST IFC4X3_TC1.exp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1.cpp txt/header_ifc4x3_tc1.txt Ifc4x3_tc1.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1.h txt/header_ifc4x3_tc1.txt Ifc4x3_tc1.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1-schema.cpp txt/header_ifc4x3_tc1.txt Ifc4x3_tc1-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1-schema.cpp txt/header_ifc4x3_tc1.txt Ifc4x3_tc1-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1-definitions.h txt/header_ifc4x3_tc1.txt Ifc4x3_tc1-definitions.h
|
||||
)
|
||||
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
@@ -163,10 +163,10 @@ IF EXIST IFC4X3_ADD1.exp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1.cpp txt/header_ifc4x3_add1.txt Ifc4x3_add1.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1.h txt/header_ifc4x3_add1.txt Ifc4x3_add1.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1-schema.cpp txt/header_ifc4x3_add1.txt Ifc4x3_add1-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1-schema.cpp txt/header_ifc4x3_add1.txt Ifc4x3_add1-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1-definitions.h txt/header_ifc4x3_add1.txt Ifc4x3_add1-definitions.h
|
||||
)
|
||||
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
@@ -177,9 +177,9 @@ IF EXIST IFC4X3_ADD2.exp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2.cpp txt/header_ifc4x3_add2.txt Ifc4x3_add2.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2.h txt/header_ifc4x3_add2.txt Ifc4x3_add2.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2-schema.cpp txt/header_ifc4x3_add2.txt Ifc4x3_add2-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2-schema.cpp txt/header_ifc4x3_add2.txt Ifc4x3_add2-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2-definitions.h txt/header_ifc4x3_add2.txt Ifc4x3_add2-definitions.h
|
||||
)
|
||||
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
@@ -18,15 +18,9 @@
|
||||
|
||||
|
||||
import nodes
|
||||
import platform
|
||||
import collections
|
||||
import pyparsing
|
||||
|
||||
if tuple(map(int, platform.python_version_tuple())) < (2, 7):
|
||||
import ordereddict
|
||||
|
||||
collections.OrderedDict = ordereddict.OrderedDict
|
||||
|
||||
|
||||
# According to ISO 10303-11 7.1.2: Letters: "... The case of
|
||||
# letters is significant only within explicit string literals."
|
||||
|
||||
@@ -911,9 +911,16 @@ class file:
|
||||
self,
|
||||
inst: ifcopenshell.entity_instance,
|
||||
allow_duplicate: Literal[True],
|
||||
with_attribute_indices: bool = False,
|
||||
with_attribute_indices: Literal[False] = False,
|
||||
) -> list[ifcopenshell.entity_instance]: ...
|
||||
@overload
|
||||
def get_inverse(
|
||||
self,
|
||||
inst: ifcopenshell.entity_instance,
|
||||
allow_duplicate: Literal[True],
|
||||
with_attribute_indices: Literal[True],
|
||||
) -> list[tuple[ifcopenshell.entity_instance, int]]: ...
|
||||
@overload
|
||||
def get_inverse(
|
||||
self,
|
||||
inst: ifcopenshell.entity_instance,
|
||||
@@ -925,7 +932,11 @@ class file:
|
||||
inst: ifcopenshell.entity_instance,
|
||||
allow_duplicate: bool = False,
|
||||
with_attribute_indices: bool = False,
|
||||
) -> Union[list[ifcopenshell.entity_instance], set[ifcopenshell.entity_instance]]:
|
||||
) -> (
|
||||
list[ifcopenshell.entity_instance]
|
||||
| set[ifcopenshell.entity_instance]
|
||||
| list[tuple[ifcopenshell.entity_instance, int]]
|
||||
):
|
||||
"""Return a list of entities that reference this entity
|
||||
|
||||
Warning: this is a slow function, especially when there is a large
|
||||
|
||||
@@ -174,7 +174,7 @@ class settings_mixin:
|
||||
def set(self: settings, k: SETTING, v: Any) -> None: ...
|
||||
@overload
|
||||
def set(self: serializer_settings, k: SERIALIZER_SETTING, v: Any) -> None: ...
|
||||
def set(self, k: SETTING, v: Any) -> None:
|
||||
def set(self, k: Union[SETTING, SERIALIZER_SETTING], v: Any) -> None:
|
||||
"""
|
||||
Set value of the setting named `k` to `v`.
|
||||
|
||||
|
||||
@@ -473,7 +473,6 @@ class ShapeBuilder:
|
||||
if arc_points and self.file.schema == "IFC2X3":
|
||||
raise Exception("Arcs are not supported for IFC2X3.")
|
||||
|
||||
points: np.ndarray
|
||||
points = np.array(points)
|
||||
if position_offset is not None:
|
||||
points = points + position_offset
|
||||
@@ -635,7 +634,6 @@ class ShapeBuilder:
|
||||
diff = (0.01, 0.01) * diff_sign
|
||||
middle_point = points[0] + diff
|
||||
|
||||
points: list[VectorType]
|
||||
points = [points[0], middle_point, points[1]]
|
||||
points = [ifc_safe_vector_type(p) for p in points]
|
||||
seg = self.file.createIfcArcIndex((1, 2, 3))
|
||||
|
||||
@@ -27,11 +27,13 @@ dependencies = [
|
||||
|
||||
[project.optional-dependencies]
|
||||
advanced = [
|
||||
# `express` module - only for generating schemas.
|
||||
"networkx",
|
||||
]
|
||||
dev = [
|
||||
"pytest",
|
||||
"tabulate",
|
||||
"types-networkx",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Download and compile ifcopenshell.express rules for all available schemas.
|
||||
|
||||
Missing schemas that are known to be available on GitHub are downloaded first.
|
||||
|
||||
Usage:
|
||||
python compile-exp-rules.py # print this message
|
||||
python compile-exp-rules.py --check # download schemas and report which are present
|
||||
python compile-exp-rules.py --compile # implies --check, then compile rules for them
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import subprocess
|
||||
import sys
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
from typing import NamedTuple
|
||||
|
||||
EXPRESS_DIR = Path(__file__).parent.parent / "ifcopenshell" / "express"
|
||||
|
||||
GITHUB_RAW_URL = (
|
||||
"https://raw.githubusercontent.com/buildingSMART/IFC4.x-development/refs/heads/ifc4.3-main/reference_schemas"
|
||||
)
|
||||
|
||||
# buildingSMART's website blocks automated/scripted downloads, so these have to be fetched manually.
|
||||
BUILDINGSMART_SCHEMAS_URL = "https://technical.buildingsmart.org/standards/ifc/ifc-schema-specifications/"
|
||||
|
||||
|
||||
class ExpFile(NamedTuple):
|
||||
name: str
|
||||
available_on_github: bool
|
||||
required: bool
|
||||
|
||||
|
||||
SCHEMA_TO_EXP_FILENAME = {
|
||||
# Main schemas.
|
||||
"IFC2X3": ExpFile("IFC2X3_TC1", True, True),
|
||||
"IFC4": ExpFile("IFC4_ADD2_TC1", True, True),
|
||||
# IFC4X3_ADD2 is available from https://technical.buildingsmart.org/standards/ifc/ifc-schema-specifications/
|
||||
"IFC4X3_ADD2": ExpFile("IFC4X3_ADD2", False, True),
|
||||
# Withdrawn schemas.
|
||||
"IFC4X1": ExpFile("IFC4x1", True, True),
|
||||
"IFC4X2": ExpFile("IFC4x2", True, True),
|
||||
# Retired schemas.
|
||||
"IFC4X3_RC1": ExpFile("IFC4x3_RC1", True, True),
|
||||
"IFC4X3_RC2": ExpFile("IFC4x3_RC2", True, True),
|
||||
"IFC4X3_RC3": ExpFile("IFC4x3_RC3", True, True),
|
||||
"IFC4X3_RC4": ExpFile("IFC4x3_RC4", True, True),
|
||||
## Couldn't find them anywhere, so I guess their .py will be missing updates.
|
||||
"IFC4X3": ExpFile("IFC4X3", False, False),
|
||||
"IFC4X3_ADD1": ExpFile("IFC4X3_ADD1", False, False),
|
||||
"IFC4X3_TC1": ExpFile("IFC4X3_TC1", False, False),
|
||||
}
|
||||
|
||||
|
||||
def download_schema(exp_filename: str, exp_path: Path) -> None:
|
||||
url = f"{GITHUB_RAW_URL}/{exp_filename}.exp"
|
||||
print(f"Downloading '{url}'...")
|
||||
with urllib.request.urlopen(url) as response:
|
||||
exp_path.write_bytes(response.read())
|
||||
|
||||
|
||||
def resolve_exp_paths() -> dict[str, Path]:
|
||||
exp_paths: dict[str, Path] = {}
|
||||
for schema_name, exp_file in SCHEMA_TO_EXP_FILENAME.items():
|
||||
exp_path = EXPRESS_DIR / f"{exp_file.name}.exp"
|
||||
if not exp_path.exists():
|
||||
if not exp_file.available_on_github:
|
||||
if exp_file.required:
|
||||
raise FileNotFoundError(
|
||||
f"{schema_name}: '{exp_path}' not found and not available on GitHub. "
|
||||
f"Download it from {BUILDINGSMART_SCHEMAS_URL} and save it to '{EXPRESS_DIR}'."
|
||||
)
|
||||
print(f"Skipping {schema_name}: '{exp_path}' not found and not available on GitHub.")
|
||||
continue
|
||||
download_schema(exp_file.name, exp_path)
|
||||
print(f"{schema_name}: present ({exp_path})")
|
||||
exp_paths[schema_name] = exp_path
|
||||
return exp_paths
|
||||
|
||||
|
||||
def compile_schema(schema_name: str, exp_path: Path) -> None:
|
||||
print(f"Compiling rules for {schema_name} from '{exp_path.name}'...")
|
||||
subprocess.run(
|
||||
[sys.executable, "-m", "rule_compiler", str(exp_path)],
|
||||
cwd=EXPRESS_DIR,
|
||||
check=True,
|
||||
)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
parser.add_argument("--check", action="store_true", help="download schemas and report which are present")
|
||||
parser.add_argument("--compile", action="store_true", help="implies --check, then compile rules for them")
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.check and not args.compile:
|
||||
print(__doc__)
|
||||
return
|
||||
|
||||
exp_paths = resolve_exp_paths()
|
||||
|
||||
if args.compile:
|
||||
for schema_name, exp_path in exp_paths.items():
|
||||
compile_schema(schema_name, exp_path)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Regular → Executable
+1
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Setup IfcOpenShell Development Environment.
|
||||
|
||||
Scripts creates symlinks in current user's site-packages to the IfcOpenShell repository.
|
||||
|
||||
@@ -39,3 +39,25 @@ def ifcopenshell_open_test(str_: str, bool_: bool):
|
||||
assert_type(ifc_file, ifcopenshell.stream)
|
||||
|
||||
ifc_file = ifcopenshell.open(str_, readonly=True)
|
||||
|
||||
|
||||
def get_inverse_test(ifc_file: ifcopenshell.file, inst: ifcopenshell.entity_instance, bool_: bool):
|
||||
# Default: allow_duplicate=False, with_attribute_indices=False
|
||||
result = ifc_file.get_inverse(inst)
|
||||
assert_type(result, set[ifcopenshell.entity_instance])
|
||||
|
||||
# Explicit allow_duplicate=False
|
||||
result = ifc_file.get_inverse(inst, allow_duplicate=False)
|
||||
assert_type(result, set[ifcopenshell.entity_instance])
|
||||
|
||||
# allow_duplicate=True without indices
|
||||
result = ifc_file.get_inverse(inst, allow_duplicate=True)
|
||||
assert_type(result, list[ifcopenshell.entity_instance])
|
||||
|
||||
# allow_duplicate=True with indices
|
||||
result = ifc_file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True)
|
||||
assert_type(result, list[tuple[ifcopenshell.entity_instance, int]])
|
||||
|
||||
# Dynamic bool values (falls back to generic overload)
|
||||
result = ifc_file.get_inverse(inst, allow_duplicate=bool_)
|
||||
assert_type(result, list[ifcopenshell.entity_instance] | set[ifcopenshell.entity_instance])
|
||||
|
||||
@@ -184,7 +184,7 @@ class PatcherDoc(TypedDict):
|
||||
class InputDoc(TypedDict):
|
||||
name: str
|
||||
description: str
|
||||
type: Union[str, list[str]]
|
||||
type: NotRequired[Union[str, list[str]]]
|
||||
default: NotRequired[Any]
|
||||
generic_type: NotRequired[str]
|
||||
enum_items: NotRequired[list[str]]
|
||||
@@ -201,7 +201,7 @@ def _extract_docs(cls: type, method_name: str, boilerplate_args: Union[Sequence[
|
||||
for name, parameter in signature.parameters.items():
|
||||
if name == "self" or name in boilerplate_args:
|
||||
continue
|
||||
input_doc: InputDoc = {"name": name}
|
||||
input_doc: InputDoc = {"name": name, "description": "Undocumented"}
|
||||
inputs[name] = input_doc
|
||||
if isinstance(parameter.default, (str, float, int, bool)):
|
||||
input_doc["default"] = parameter.default
|
||||
@@ -267,10 +267,6 @@ def _extract_docs(cls: type, method_name: str, boilerplate_args: Union[Sequence[
|
||||
assert is_valid_filter_glob(filter_glob), f"Invalid filter_glob pattern: '{filter_glob}'."
|
||||
inputs[param_name]["filter_glob"] = filter_glob
|
||||
|
||||
for param_name in inputs:
|
||||
if "description" not in inputs[param_name]:
|
||||
inputs[param_name]["description"] = "Undocumented"
|
||||
|
||||
docs = PatcherDoc(
|
||||
class_=cls,
|
||||
description=doc_description,
|
||||
@@ -309,6 +305,7 @@ def parse_docstring(docstring: str) -> DocstringData:
|
||||
line = line[1:]
|
||||
if line.startswith(PREFIXES):
|
||||
prefix = line.split(" ")[0]
|
||||
assert prefix in PREFIXES, f"Invalid line: '{line}'."
|
||||
current_section = prefix
|
||||
match_ = re.match(rf"{prefix}\s+(\w+):\s+(.*)", line)
|
||||
assert match_, f"Invalid line: '{line}'."
|
||||
|
||||
@@ -24,6 +24,7 @@ import os
|
||||
import re
|
||||
import sys
|
||||
from typing import Literal, Optional, TypedDict, Union
|
||||
from typing_extensions import NotRequired
|
||||
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.element
|
||||
@@ -96,6 +97,12 @@ class ResultsSpecification(TypedDict):
|
||||
applicability: list[str]
|
||||
requirements: list[ResultsRequirement]
|
||||
|
||||
# Filled in by `Html.report()`.
|
||||
is_prohibited: NotRequired[bool]
|
||||
has_requirements: NotRequired[bool]
|
||||
has_omitted_applicable: NotRequired[bool]
|
||||
total_omitted_applicable: NotRequired[int]
|
||||
|
||||
|
||||
class ResultsRequirement(TypedDict):
|
||||
facet_type: str
|
||||
@@ -111,6 +118,15 @@ class ResultsRequirement(TypedDict):
|
||||
total_fail: int
|
||||
percent_pass: ResultsPercent
|
||||
|
||||
# Filled in by `Html.report()`.
|
||||
total_failed_entities: NotRequired[int]
|
||||
total_omitted_failures: NotRequired[int]
|
||||
has_omitted_failures: NotRequired[bool]
|
||||
total_passed_entities: NotRequired[int]
|
||||
total_omitted_passes: NotRequired[int]
|
||||
has_omitted_passes: NotRequired[bool]
|
||||
instructions: NotRequired[str | None]
|
||||
|
||||
|
||||
# use different syntax because of the "class" key
|
||||
ResultsEntity = TypedDict(
|
||||
@@ -244,7 +260,7 @@ class Txt(Console):
|
||||
class Json(Reporter):
|
||||
def __init__(self, ids: Ids, hide_skipped=False):
|
||||
super().__init__(ids)
|
||||
self.results = Results()
|
||||
self.results = Results() # ty:ignore[missing-typed-dict-key]
|
||||
self.results["hide_skipped"] = hide_skipped
|
||||
|
||||
def report(self) -> Results:
|
||||
@@ -410,7 +426,7 @@ class Json(Reporter):
|
||||
"id": e.id(),
|
||||
"global_id": getattr(e, "GlobalId", None),
|
||||
"tag": getattr(e, "Tag", None),
|
||||
}
|
||||
} # ty:ignore[missing-typed-dict-key]
|
||||
)
|
||||
for e in specification.applicable_entities
|
||||
]
|
||||
@@ -428,7 +444,7 @@ class Json(Reporter):
|
||||
"id": e.id(),
|
||||
"global_id": getattr(e, "GlobalId", None),
|
||||
"tag": getattr(e, "Tag", None),
|
||||
}
|
||||
} # ty:ignore[missing-typed-dict-key]
|
||||
)
|
||||
for e in requirement.passed_entities
|
||||
]
|
||||
|
||||
@@ -15,7 +15,17 @@ classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
|
||||
]
|
||||
dependencies = ["ifcopenshell", "python-dateutil", "xmlschema", "numpy", "odfpy", "pystache", "bcf-client", "flask"]
|
||||
dependencies = [
|
||||
"ifcopenshell",
|
||||
"python-dateutil",
|
||||
"xmlschema",
|
||||
"numpy",
|
||||
"odfpy",
|
||||
"pystache",
|
||||
"bcf-client",
|
||||
"flask",
|
||||
"typing_extensions",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
advanced = [
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
from typing import Union, overload
|
||||
|
||||
|
||||
class entity_instance:
|
||||
@overload
|
||||
def is_a(self) -> str: ...
|
||||
@overload
|
||||
def is_a(self, ifc_class: str, /) -> bool: ...
|
||||
@overload
|
||||
def is_a(self, with_schema: bool, /) -> str: ...
|
||||
def is_a(self, *args: Union[str, bool]) -> Union[str, bool]:
|
||||
return args[0] if args else "foo"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,86 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 34300d41ad..efe3065499 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -363,6 +363,10 @@ else()
|
||||
set (USE_D3D OFF)
|
||||
endif()
|
||||
|
||||
+# IfcOpenShell begin
|
||||
+add_definitions(-DHAVE_NO_DLL)
|
||||
+# IfcOpenShell end
|
||||
+
|
||||
# Enable/Disable the floating point exceptions (FPE) during runtime.
|
||||
if (NOT BUILD_ENABLE_FPE_SIGNAL_HANDLER)
|
||||
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER OFF CACHE BOOL "${BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR}" FORCE)
|
||||
@@ -721,6 +725,8 @@ else()
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_DOT_EXECUTABLE")
|
||||
endif()
|
||||
|
||||
+list (REMOVE_ITEM BUILD_TOOLKITS ExpToCasExe)
|
||||
+
|
||||
# bison
|
||||
if (BUILD_YACCLEX)
|
||||
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/bison")
|
||||
diff --git a/adm/cmake/occt_defs_flags.cmake b/adm/cmake/occt_defs_flags.cmake
|
||||
index 5bd3313d3c..d647ff05ab 100644
|
||||
--- a/adm/cmake/occt_defs_flags.cmake
|
||||
+++ b/adm/cmake/occt_defs_flags.cmake
|
||||
@@ -214,7 +214,23 @@ if (CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
|
||||
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
|
||||
endif()
|
||||
|
||||
-if (BUILD_RELEASE_DISABLE_EXCEPTIONS)
|
||||
- set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
|
||||
- set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
|
||||
-endif()
|
||||
+# IfcOpenShell begin
|
||||
+# https://salsa.debian.org/science-team/opencascade/blob/739e7e9c4fbe575165eb3ff0251774bfad27139e/debian/patches/enable-exception-handling.patch
|
||||
+# if (BUILD_RELEASE_DISABLE_EXCEPTIONS)
|
||||
+# set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
|
||||
+# set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
|
||||
+# endif()
|
||||
+
|
||||
+if (MSVC AND MSVC_STATIC_RUNTIME)
|
||||
+ foreach(flag CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL
|
||||
+ CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
||||
+ CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||
+ if (${flag} MATCHES "/MD")
|
||||
+ string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
|
||||
+ endif()
|
||||
+ if (${flag} MATCHES "/MDd")
|
||||
+ string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
|
||||
+ endif()
|
||||
+ endforeach()
|
||||
+endif()
|
||||
+# IfcOpenShell end
|
||||
diff --git a/adm/cmake/occt_toolkit.cmake b/adm/cmake/occt_toolkit.cmake
|
||||
index 22e94d0629..c6995bb247 100644
|
||||
--- a/adm/cmake/occt_toolkit.cmake
|
||||
+++ b/adm/cmake/occt_toolkit.cmake
|
||||
@@ -135,15 +135,22 @@ else()
|
||||
else()
|
||||
set (aReleasePdbConf)
|
||||
endif()
|
||||
+ # IfcOpenShell begin
|
||||
if (BUILD_SHARED_LIBS)
|
||||
install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
|
||||
CONFIGURATIONS Debug ${aReleasePdbConf} RelWithDebInfo
|
||||
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
|
||||
else()
|
||||
- install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
|
||||
- CONFIGURATIONS Debug ${aReleasePdbConf} RelWithDebInfo
|
||||
- DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}")
|
||||
+ set_target_properties (${PROJECT_NAME} PROPERTIES
|
||||
+ COMPILE_PDB_NAME ${PROJECT_NAME}
|
||||
+ COMPILE_PDB_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/pdb/
|
||||
+ )
|
||||
+
|
||||
+ install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/pdb/\${CMAKE_INSTALL_CONFIG_NAME}/${PROJECT_NAME}.pdb
|
||||
+ CONFIGURATIONS Debug ${aReleasePdbConf} RelWithDebInfo
|
||||
+ DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}")
|
||||
endif()
|
||||
+ # IfcOpenShell end
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
|
||||
@@ -0,0 +1,14 @@
|
||||
diff --git a/msvc/vs22/msbuild.bat b/msvc/vs22/msbuild.bat
|
||||
index f119c3e9..35e46217 100644
|
||||
--- a/msvc/vs22/msbuild.bat
|
||||
+++ b/msvc/vs22/msbuild.bat
|
||||
@@ -14,7 +14,8 @@ set vs_version=2019
|
||||
|
||||
set vsw_exe="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
|
||||
-for /f "usebackq tokens=*" %%i in (`"!vsw_exe!" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
|
||||
+rem limit to VS2022, as VS2026 does not build currently
|
||||
+for /f "usebackq tokens=*" %%i in (`"!vsw_exe! -version [17,18)" -sort -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
|
||||
set InstallDir=%%i
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user