mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-29 03:37:21 +00:00
Minor refactor of tool/polyline
This commit is contained in:
committed by
Bruno Perdigão
parent
55df9a42e6
commit
1a587dea7d
@@ -580,9 +580,16 @@ class Nest:
|
|||||||
class Patch:
|
class Patch:
|
||||||
def run_migrate_patch(cls, infile, outfile, schema): pass
|
def run_migrate_patch(cls, infile, outfile, schema): pass
|
||||||
|
|
||||||
|
|
||||||
@interface
|
@interface
|
||||||
class Polyline:
|
class Polyline:
|
||||||
pass
|
def create_input_ui(cls, init_z=False, init_area=False): pass
|
||||||
|
def create_tool_state(cls): pass
|
||||||
|
def calculate_distance_and_angle(cls, context, input_ui, tool_state): pass
|
||||||
|
def calculate_area(cls, context, input_ui): pass
|
||||||
|
def calculate_x_y_and_z(cls, context, input_ui, tool_state): pass
|
||||||
|
def validate_input(cls, input_number, input_type): pass
|
||||||
|
|
||||||
|
|
||||||
@interface
|
@interface
|
||||||
class Owner:
|
class Owner:
|
||||||
@@ -671,10 +678,12 @@ class Qto:
|
|||||||
def get_rounded_value(cls, new_quantity): pass
|
def get_rounded_value(cls, new_quantity): pass
|
||||||
def set_qto_result(cls, result): pass
|
def set_qto_result(cls, result): pass
|
||||||
|
|
||||||
|
|
||||||
@interface
|
@interface
|
||||||
class Raycast:
|
class Raycast:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@interface
|
@interface
|
||||||
class Resource:
|
class Resource:
|
||||||
def clear_productivity_data(cls, props): pass
|
def clear_productivity_data(cls, props): pass
|
||||||
@@ -948,10 +957,12 @@ class Spatial:
|
|||||||
class Covering:
|
class Covering:
|
||||||
def get_z_from_ceiling_height(cls): pass
|
def get_z_from_ceiling_height(cls): pass
|
||||||
|
|
||||||
|
|
||||||
@interface
|
@interface
|
||||||
class Snap:
|
class Snap:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@interface
|
@interface
|
||||||
class Structural:
|
class Structural:
|
||||||
def disable_editing_structural_analysis_model(cls): pass
|
def disable_editing_structural_analysis_model(cls): pass
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Bonsai - OpenBIM Blender Add-on
|
# Bonsai - OpenBIM Blender Add-on
|
||||||
# Copyright (C) 2022 Cyril Waechter <cyril@biminsight.ch>
|
# Copyright (C) 2024 Bruno Perdigão <contact@brunopo.com>
|
||||||
#
|
#
|
||||||
# This file is part of Bonsai.
|
# This file is part of Bonsai.
|
||||||
#
|
#
|
||||||
@@ -20,15 +20,17 @@ import bpy
|
|||||||
import bonsai.core.tool
|
import bonsai.core.tool
|
||||||
import bonsai.tool as tool
|
import bonsai.tool as tool
|
||||||
from bonsai.bim.module.drawing.helper import format_distance
|
from bonsai.bim.module.drawing.helper import format_distance
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass
|
||||||
from lark import Lark, Transformer
|
from lark import Lark, Transformer
|
||||||
from math import sin, cos, radians, degrees, atan2, acos
|
from math import radians
|
||||||
from mathutils import Vector, Matrix
|
from mathutils import Vector
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
class Polyline(bonsai.core.tool.Polyline):
|
||||||
class PolylineUI:
|
|
||||||
|
@dataclass
|
||||||
|
class PolylineUI:
|
||||||
_D: str = ""
|
_D: str = ""
|
||||||
_A: str = ""
|
_A: str = ""
|
||||||
_X: str = ""
|
_X: str = ""
|
||||||
@@ -83,8 +85,8 @@ class PolylineUI:
|
|||||||
|
|
||||||
return format_distance(value * factor, precision=precision, suppress_zero_inches=True, in_unit_length=True)
|
return format_distance(value * factor, precision=precision, suppress_zero_inches=True, in_unit_length=True)
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class ToolState:
|
class ToolState:
|
||||||
use_default_container: bool = None
|
use_default_container: bool = None
|
||||||
snap_angle: float = None
|
snap_angle: float = None
|
||||||
is_input_on: bool = None
|
is_input_on: bool = None
|
||||||
@@ -98,21 +100,18 @@ class ToolState:
|
|||||||
Backspace: Remove
|
Backspace: Remove
|
||||||
X Y: Axis
|
X Y: Axis
|
||||||
Shift: Lock axis
|
Shift: Lock axis
|
||||||
"""
|
"""
|
||||||
snap_info: str = None
|
snap_info: str = None
|
||||||
mode: str = None
|
mode: str = None
|
||||||
input_type: str = None
|
input_type: str = None
|
||||||
|
|
||||||
|
|
||||||
class Polyline(bonsai.core.tool.Polyline):
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create_input_ui(cls, init_z=False, init_area=False):
|
def create_input_ui(cls, init_z=False, init_area=False):
|
||||||
return PolylineUI(init_z=init_z, init_area=init_area)
|
return cls.PolylineUI(init_z=init_z, init_area=init_area)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create_tool_state(cls):
|
def create_tool_state(cls):
|
||||||
return ToolState()
|
return cls.ToolState()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def calculate_distance_and_angle(cls, context, input_ui, tool_state):
|
def calculate_distance_and_angle(cls, context, input_ui, tool_state):
|
||||||
|
|||||||
Reference in New Issue
Block a user