mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 21:58:46 +00:00
Create UI to input georeferencing variables
This commit is contained in:
@@ -461,34 +461,34 @@ class IfcParser():
|
|||||||
|
|
||||||
def get_map_conversion(self):
|
def get_map_conversion(self):
|
||||||
scene = bpy.context.scene
|
scene = bpy.context.scene
|
||||||
if 'HasMapConversion' not in scene:
|
if not scene.BIMProperties.has_georeferencing:
|
||||||
return {}
|
return {}
|
||||||
return {
|
return {
|
||||||
'ifc': None,
|
'ifc': None,
|
||||||
'attributes': {
|
'attributes': {
|
||||||
'Eastings': float(scene['Eastings']),
|
'Eastings': float(scene.MapConversion.eastings),
|
||||||
'Northings': float(scene['Northings']),
|
'Northings': float(scene.MapConversion.northings),
|
||||||
'OrthogonalHeight': float(scene['OrthogonalHeight']),
|
'OrthogonalHeight': float(scene.MapConversion.orthogonal_height),
|
||||||
'XAxisAbscissa': float(scene['XAxisAbscissa']),
|
'XAxisAbscissa': float(scene.MapConversion.x_axis_abscissa),
|
||||||
'XAxisOrdinate': float(scene['XAxisOrdinate']),
|
'XAxisOrdinate': float(scene.MapConversion.x_axis_ordinate),
|
||||||
'Scale': float(scene['Scale'])
|
'Scale': float(scene.MapConversion.scale)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_target_crs(self):
|
def get_target_crs(self):
|
||||||
scene = bpy.context.scene
|
scene = bpy.context.scene
|
||||||
if 'HasMapConversion' not in scene:
|
if not scene.BIMProperties.has_georeferencing:
|
||||||
return {}
|
return {}
|
||||||
return {
|
return {
|
||||||
'ifc': None,
|
'ifc': None,
|
||||||
'attributes': {
|
'attributes': {
|
||||||
'Name': scene['Name'],
|
'Name': scene.TargetCRS.name,
|
||||||
'Description': scene['Description'],
|
'Description': scene.TargetCRS.description,
|
||||||
'GeodeticDatum': scene['GeodeticDatum'],
|
'GeodeticDatum': scene.TargetCRS.geodetic_datum,
|
||||||
'VerticalDatum': scene['VerticalDatum'],
|
'VerticalDatum': scene.TargetCRS.vertical_datum,
|
||||||
'MapProjection': scene['MapProjection'],
|
'MapProjection': scene.TargetCRS.map_projection,
|
||||||
'MapZone': str(scene['MapZone']),
|
'MapZone': str(scene.TargetCRS.map_zone),
|
||||||
'MapUnit': scene['MapUnit']
|
'MapUnit': scene.TargetCRS.map_unit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,24 @@ class BIMProperties(bpy.types.PropertyGroup):
|
|||||||
qa_reject_element_reason: bpy.props.StringProperty(name="Element Rejection Reason")
|
qa_reject_element_reason: bpy.props.StringProperty(name="Element Rejection Reason")
|
||||||
pset_name: bpy.props.EnumProperty(items=getPsetNames, name="Pset Name")
|
pset_name: bpy.props.EnumProperty(items=getPsetNames, name="Pset Name")
|
||||||
pset_file: bpy.props.EnumProperty(items=getPsetFiles, name="Pset File")
|
pset_file: bpy.props.EnumProperty(items=getPsetFiles, name="Pset File")
|
||||||
|
has_georeferencing: bpy.props.BoolProperty(name="Has Georeferencing", default=False)
|
||||||
|
|
||||||
|
class MapConversion(bpy.types.PropertyGroup):
|
||||||
|
eastings: bpy.props.StringProperty(name="Eastings")
|
||||||
|
northings: bpy.props.StringProperty(name="Northings")
|
||||||
|
orthogonal_height: bpy.props.StringProperty(name="Orthogonal Height")
|
||||||
|
x_axis_abscissa: bpy.props.StringProperty(name="X Axis Abscissa")
|
||||||
|
x_axis_ordinate: bpy.props.StringProperty(name="X Axis Ordinate")
|
||||||
|
scale: bpy.props.StringProperty(name="Scale")
|
||||||
|
|
||||||
|
class TargetCRS(bpy.types.PropertyGroup):
|
||||||
|
name: bpy.props.StringProperty(name="Name")
|
||||||
|
description: bpy.props.StringProperty(name="Description")
|
||||||
|
geodetic_datum: bpy.props.StringProperty(name="Geodetic Datum")
|
||||||
|
vertical_datum: bpy.props.StringProperty(name="Vertical Datum")
|
||||||
|
map_projection: bpy.props.StringProperty(name="Map Projection")
|
||||||
|
map_zone: bpy.props.StringProperty(name="Map Zone")
|
||||||
|
map_unit: bpy.props.StringProperty(name="Map Unit")
|
||||||
|
|
||||||
class Attribute(bpy.types.PropertyGroup):
|
class Attribute(bpy.types.PropertyGroup):
|
||||||
name: bpy.props.StringProperty(name="Name")
|
name: bpy.props.StringProperty(name="Name")
|
||||||
@@ -164,6 +182,36 @@ class MaterialPanel(bpy.types.Panel):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(bpy.context.active_object.active_material.MaterialProperties, 'name')
|
row.prop(bpy.context.active_object.active_material.MaterialProperties, 'name')
|
||||||
|
|
||||||
|
class GISPanel(bpy.types.Panel):
|
||||||
|
bl_label = 'IFC Georeferencing'
|
||||||
|
bl_idname = "BIM_PT_gis"
|
||||||
|
bl_space_type = 'PROPERTIES'
|
||||||
|
bl_region_type = 'WINDOW'
|
||||||
|
bl_context = "scene"
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
layout.use_property_split = True
|
||||||
|
|
||||||
|
layout.row().prop(bpy.context.scene.BIMProperties, 'has_georeferencing')
|
||||||
|
|
||||||
|
layout.label(text="Map Conversion:")
|
||||||
|
layout.row().prop(bpy.context.scene.MapConversion, 'eastings')
|
||||||
|
layout.row().prop(bpy.context.scene.MapConversion, 'northings')
|
||||||
|
layout.row().prop(bpy.context.scene.MapConversion, 'orthogonal_height')
|
||||||
|
layout.row().prop(bpy.context.scene.MapConversion, 'x_axis_abscissa')
|
||||||
|
layout.row().prop(bpy.context.scene.MapConversion, 'x_axis_ordinate')
|
||||||
|
layout.row().prop(bpy.context.scene.MapConversion, 'scale')
|
||||||
|
|
||||||
|
layout.label(text="Target CRS:")
|
||||||
|
layout.row().prop(bpy.context.scene.TargetCRS, 'name')
|
||||||
|
layout.row().prop(bpy.context.scene.TargetCRS, 'description')
|
||||||
|
layout.row().prop(bpy.context.scene.TargetCRS, 'geodetic_datum')
|
||||||
|
layout.row().prop(bpy.context.scene.TargetCRS, 'vertical_datum')
|
||||||
|
layout.row().prop(bpy.context.scene.TargetCRS, 'map_projection')
|
||||||
|
layout.row().prop(bpy.context.scene.TargetCRS, 'map_zone')
|
||||||
|
layout.row().prop(bpy.context.scene.TargetCRS, 'map_unit')
|
||||||
|
|
||||||
class BIMPanel(bpy.types.Panel):
|
class BIMPanel(bpy.types.Panel):
|
||||||
bl_label = "Building Information Modeling"
|
bl_label = "Building Information Modeling"
|
||||||
bl_idname = "BIM_PT_bim"
|
bl_idname = "BIM_PT_bim"
|
||||||
@@ -173,6 +221,7 @@ class BIMPanel(bpy.types.Panel):
|
|||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
layout.use_property_split = True
|
||||||
|
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
bim_properties = bpy.context.scene.BIMProperties
|
bim_properties = bpy.context.scene.BIMProperties
|
||||||
|
|||||||
Reference in New Issue
Block a user