mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 06:32:09 +00:00
bcf - fix inconsistent return types in add_viewpoint #4887
This commit is contained in:
@@ -268,7 +268,7 @@ class TopicHandler:
|
|||||||
|
|
||||||
return outfile
|
return outfile
|
||||||
|
|
||||||
def add_viewpoint(self, element: entity_instance) -> None:
|
def add_viewpoint(self, element: entity_instance) -> VisualizationInfoHandler:
|
||||||
"""Add a viewpoint pointed at the placement of an IFC element to the topic.
|
"""Add a viewpoint pointed at the placement of an IFC element to the topic.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -278,7 +278,9 @@ class TopicHandler:
|
|||||||
self.add_visinfo_handler(new_viewpoint)
|
self.add_visinfo_handler(new_viewpoint)
|
||||||
return new_viewpoint
|
return new_viewpoint
|
||||||
|
|
||||||
def add_viewpoint_from_point_and_guids(self, position: NDArray[np.float64], *guids: str) -> None:
|
def add_viewpoint_from_point_and_guids(
|
||||||
|
self, position: NDArray[np.float64], *guids: str
|
||||||
|
) -> VisualizationInfoHandler:
|
||||||
"""Add a viewpoint pointing at an XYZ point in space
|
"""Add a viewpoint pointing at an XYZ point in space
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ class TopicHandler:
|
|||||||
if self.bim_snippet:
|
if self.bim_snippet:
|
||||||
destination_zip.writestr(f"{self.topic.guid}/{ref_filename}", self.bim_snippet)
|
destination_zip.writestr(f"{self.topic.guid}/{ref_filename}", self.bim_snippet)
|
||||||
|
|
||||||
def add_viewpoint(self, element: entity_instance) -> None:
|
def add_viewpoint(self, element: entity_instance) -> VisualizationInfoHandler:
|
||||||
"""
|
"""
|
||||||
Add a viewpoint tergeting an IFC element to the topic.
|
Add a viewpoint tergeting an IFC element to the topic.
|
||||||
|
|
||||||
@@ -174,8 +174,11 @@ class TopicHandler:
|
|||||||
"""
|
"""
|
||||||
new_viewpoint = VisualizationInfoHandler.create_new(element, self._xml_handler)
|
new_viewpoint = VisualizationInfoHandler.create_new(element, self._xml_handler)
|
||||||
self.add_visinfo_handler(new_viewpoint)
|
self.add_visinfo_handler(new_viewpoint)
|
||||||
|
return new_viewpoint
|
||||||
|
|
||||||
def add_viewpoint_from_point_and_guids(self, position: NDArray[np.float64], *guids: str) -> None:
|
def add_viewpoint_from_point_and_guids(
|
||||||
|
self, position: NDArray[np.float64], *guids: str
|
||||||
|
) -> VisualizationInfoHandler:
|
||||||
"""
|
"""
|
||||||
Add a viewpoint tergeting an IFC element to the topic.
|
Add a viewpoint tergeting an IFC element to the topic.
|
||||||
|
|
||||||
@@ -186,6 +189,7 @@ class TopicHandler:
|
|||||||
position, *guids, xml_handler=self._xml_handler
|
position, *guids, xml_handler=self._xml_handler
|
||||||
)
|
)
|
||||||
self.add_visinfo_handler(vi_handler)
|
self.add_visinfo_handler(vi_handler)
|
||||||
|
return vi_handler
|
||||||
|
|
||||||
def add_visinfo_handler(self, new_viewpoint: VisualizationInfoHandler) -> None:
|
def add_visinfo_handler(self, new_viewpoint: VisualizationInfoHandler) -> None:
|
||||||
self.viewpoints[new_viewpoint.guid + ".bcfv"] = new_viewpoint
|
self.viewpoints[new_viewpoint.guid + ".bcfv"] = new_viewpoint
|
||||||
|
|||||||
Reference in New Issue
Block a user