mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 11:18:18 +00:00
Purge deprecated "set north" operators from georeference superseded by new visualisation features
This commit is contained in:
@@ -37,10 +37,6 @@ classes = (
|
|||||||
operator.ImportPlot,
|
operator.ImportPlot,
|
||||||
operator.RemoveGeoreferencing,
|
operator.RemoveGeoreferencing,
|
||||||
operator.RemoveTrueNorth,
|
operator.RemoveTrueNorth,
|
||||||
operator.SetBlenderGridNorth,
|
|
||||||
operator.SetBlenderTrueNorth,
|
|
||||||
operator.SetIfcGridNorth,
|
|
||||||
operator.SetIfcTrueNorth,
|
|
||||||
prop.BIMGeoreferenceProperties,
|
prop.BIMGeoreferenceProperties,
|
||||||
ui.BIM_PT_gis,
|
ui.BIM_PT_gis,
|
||||||
ui.BIM_PT_gis_blender,
|
ui.BIM_PT_gis_blender,
|
||||||
|
|||||||
@@ -73,26 +73,6 @@ class DisableEditingGeoreferencing(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
core.disable_editing_georeferencing(tool.Georeference)
|
core.disable_editing_georeferencing(tool.Georeference)
|
||||||
|
|
||||||
|
|
||||||
class SetIfcGridNorth(bpy.types.Operator, tool.Ifc.Operator):
|
|
||||||
bl_idname = "bim.set_ifc_grid_north"
|
|
||||||
bl_label = "Set IFC Grid North"
|
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
|
||||||
bl_description = "Set IFC grid north based on current Blender North Offset"
|
|
||||||
|
|
||||||
def _execute(self, context):
|
|
||||||
core.set_ifc_grid_north(tool.Georeference)
|
|
||||||
|
|
||||||
|
|
||||||
class SetBlenderGridNorth(bpy.types.Operator, tool.Ifc.Operator):
|
|
||||||
bl_idname = "bim.set_blender_grid_north"
|
|
||||||
bl_label = "Set Blender Grid North"
|
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
|
||||||
bl_description = "Set Blender North Offset based on current IFC grid north"
|
|
||||||
|
|
||||||
def _execute(self, context):
|
|
||||||
core.set_blender_grid_north(tool.Georeference)
|
|
||||||
|
|
||||||
|
|
||||||
class GetCursorLocation(bpy.types.Operator, tool.Ifc.Operator):
|
class GetCursorLocation(bpy.types.Operator, tool.Ifc.Operator):
|
||||||
bl_idname = "bim.get_cursor_location"
|
bl_idname = "bim.get_cursor_location"
|
||||||
bl_label = "Get Cursor Location"
|
bl_label = "Get Cursor Location"
|
||||||
@@ -107,26 +87,6 @@ class GetCursorLocation(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
core.get_cursor_location(tool.Georeference)
|
core.get_cursor_location(tool.Georeference)
|
||||||
|
|
||||||
|
|
||||||
class SetIfcTrueNorth(bpy.types.Operator, tool.Ifc.Operator):
|
|
||||||
bl_idname = "bim.set_ifc_true_north"
|
|
||||||
bl_label = "Set IFC True North"
|
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
|
||||||
bl_description = "Set IFC true north based on current Blender North Offset"
|
|
||||||
|
|
||||||
def _execute(self, context):
|
|
||||||
core.set_ifc_true_north(tool.Georeference)
|
|
||||||
|
|
||||||
|
|
||||||
class SetBlenderTrueNorth(bpy.types.Operator, tool.Ifc.Operator):
|
|
||||||
bl_idname = "bim.set_blender_true_north"
|
|
||||||
bl_label = "Set Blender True North"
|
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
|
||||||
bl_description = "Set Blender North Offset based on current IFC true north"
|
|
||||||
|
|
||||||
def _execute(self, context):
|
|
||||||
core.set_blender_true_north(tool.Georeference)
|
|
||||||
|
|
||||||
|
|
||||||
class ConvertLocalToGlobal(bpy.types.Operator, tool.Ifc.Operator):
|
class ConvertLocalToGlobal(bpy.types.Operator, tool.Ifc.Operator):
|
||||||
bl_idname = "bim.convert_local_to_global"
|
bl_idname = "bim.convert_local_to_global"
|
||||||
bl_label = "Convert Local To Global"
|
bl_label = "Convert Local To Global"
|
||||||
|
|||||||
@@ -74,10 +74,6 @@ class BIM_PT_gis(Panel):
|
|||||||
row.prop(
|
row.prop(
|
||||||
props, "x_axis_is_null", icon="RADIOBUT_OFF" if props.x_axis_is_null else "RADIOBUT_ON", text=""
|
props, "x_axis_is_null", icon="RADIOBUT_OFF" if props.x_axis_is_null else "RADIOBUT_ON", text=""
|
||||||
)
|
)
|
||||||
if hasattr(context.scene, "sun_pos_properties"):
|
|
||||||
row = self.layout.row(align=True)
|
|
||||||
row.operator("bim.set_ifc_grid_north", text="Set IFC North")
|
|
||||||
row.operator("bim.set_blender_grid_north", text="Set Blender North")
|
|
||||||
else:
|
else:
|
||||||
draw_attribute(attribute, self.layout.row())
|
draw_attribute(attribute, self.layout.row())
|
||||||
|
|
||||||
@@ -160,10 +156,6 @@ class BIM_PT_gis_true_north(Panel):
|
|||||||
row.prop(self.props, "true_north_abscissa", text="Abscissa")
|
row.prop(self.props, "true_north_abscissa", text="Abscissa")
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.prop(self.props, "true_north_ordinate", text="Ordinate")
|
row.prop(self.props, "true_north_ordinate", text="Ordinate")
|
||||||
if hasattr(context.scene, "sun_pos_properties"):
|
|
||||||
row = self.layout.row(align=True)
|
|
||||||
row.operator("bim.set_ifc_true_north", text="Set IFC North")
|
|
||||||
row.operator("bim.set_blender_true_north", text="Set Blender North")
|
|
||||||
|
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.operator("bim.edit_true_north", icon="CHECKMARK")
|
row.operator("bim.edit_true_north", icon="CHECKMARK")
|
||||||
|
|||||||
@@ -45,22 +45,6 @@ def edit_georeferencing(ifc, georeference):
|
|||||||
georeference.set_model_origin()
|
georeference.set_model_origin()
|
||||||
|
|
||||||
|
|
||||||
def set_ifc_grid_north(georeference):
|
|
||||||
georeference.set_ifc_grid_north()
|
|
||||||
|
|
||||||
|
|
||||||
def set_blender_grid_north(georeference):
|
|
||||||
georeference.set_blender_grid_north()
|
|
||||||
|
|
||||||
|
|
||||||
def set_ifc_true_north(georeference):
|
|
||||||
georeference.set_ifc_true_north()
|
|
||||||
|
|
||||||
|
|
||||||
def set_blender_true_north(georeference):
|
|
||||||
georeference.set_blender_true_north()
|
|
||||||
|
|
||||||
|
|
||||||
def get_cursor_location(georeference):
|
def get_cursor_location(georeference):
|
||||||
georeference.set_coordinates("local", georeference.get_cursor_location())
|
georeference.set_coordinates("local", georeference.get_cursor_location())
|
||||||
|
|
||||||
|
|||||||
@@ -245,21 +245,6 @@ class Georeference(blenderbim.core.tool.Georeference):
|
|||||||
scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
||||||
bpy.context.scene.cursor.location = [co * scale for co in coordinates]
|
bpy.context.scene.cursor.location = [co * scale for co in coordinates]
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def set_ifc_true_north(cls):
|
|
||||||
y_angle = -bpy.context.scene.sun_pos_properties.north_offset + radians(90)
|
|
||||||
bpy.context.scene.BIMGeoreferenceProperties.true_north_abscissa = str(cos(y_angle))
|
|
||||||
bpy.context.scene.BIMGeoreferenceProperties.true_north_ordinate = str(sin(y_angle))
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def set_blender_true_north(cls):
|
|
||||||
bpy.context.scene.sun_pos_properties.north_offset = -radians(
|
|
||||||
ifcopenshell.util.geolocation.yaxis2angle(
|
|
||||||
float(bpy.context.scene.BIMGeoreferenceProperties.true_north_abscissa),
|
|
||||||
float(bpy.context.scene.BIMGeoreferenceProperties.true_north_ordinate),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def xyz2enh(cls, coordinates, should_return_in_map_units=True):
|
def xyz2enh(cls, coordinates, should_return_in_map_units=True):
|
||||||
props = bpy.context.scene.BIMGeoreferenceProperties
|
props = bpy.context.scene.BIMGeoreferenceProperties
|
||||||
@@ -295,22 +280,6 @@ class Georeference(blenderbim.core.tool.Georeference):
|
|||||||
)
|
)
|
||||||
return coordinates
|
return coordinates
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def set_ifc_grid_north(cls):
|
|
||||||
x_angle = bpy.context.scene.sun_pos_properties.north_offset
|
|
||||||
props = bpy.context.scene.BIMGeoreferenceProperties
|
|
||||||
props.coordinate_operation.get("XAxisAbscissa").string_value = str(cos(x_angle))
|
|
||||||
props.coordinate_operation.get("XAxisOrdinate").string_value = str(sin(x_angle))
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def set_blender_grid_north(cls):
|
|
||||||
props = bpy.context.scene.BIMGeoreferenceProperties
|
|
||||||
angle = ifcopenshell.util.geolocation.xaxis2angle(
|
|
||||||
float(props.coordinate_operation.get("XAxisAbscissa").string_value),
|
|
||||||
float(props.coordinate_operation.get("XAxisOrdinate").string_value),
|
|
||||||
)
|
|
||||||
bpy.context.scene.sun_pos_properties.north_offset = -radians(angle)
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def angle2coords(cls, angle, type):
|
def angle2coords(cls, angle, type):
|
||||||
if type == "rel_x":
|
if type == "rel_x":
|
||||||
|
|||||||
Reference in New Issue
Block a user