bcf.v2.visinfo
¶
Module Contents¶
- class bcf.v2.visinfo.VisualizationInfoHandler(visualization_info: bcf.v2.model.VisualizationInfo, snapshot: bytes | None = None, bitmaps: dict[str, bytes] | None = None, xml_handler: bcf.xml_parser.AbstractXmlParserSerializer | None = None)¶
Handle the VisualizationInfo and related objects.
- classmethod create_from_point_and_guids(position: numpy.typing.NDArray[numpy.float64], *guids: str, xml_handler: bcf.xml_parser.AbstractXmlParserSerializer | None = None) VisualizationInfoHandler ¶
Create a new VisualizationInfoHandler object from an IFC element.
- Args:
position: target point coordinates. *guids: One or more IFC element GUID. xml_handler: The XML handler to use.
- Returns:
The VisualizationInfoHandler object.
- classmethod create_new(element: ifcopenshell.entity_instance, xml_handler: bcf.xml_parser.AbstractXmlParserSerializer | None = None) VisualizationInfoHandler ¶
Create a new VisualizationInfoHandler object from an IFC element.
- Args:
element: The IFC element to point at. xml_handler: The XML handler to use.
- Returns:
The VisualizationInfoHandler object.
- classmethod from_topic_viewpoints(topic_dir: zipfile.Path, vps: Iterable[bcf.v2.model.ViewPoint], xml_handler: bcf.xml_parser.AbstractXmlParserSerializer | None = None) dict[str, VisualizationInfoHandler] ¶
Create VisualizationInfoHandler objects of a Topic’s ViewPoints.
- get_elements_visibility() tuple[bool, list[str]] | None ¶
Return viewpoint elements visibility settings.
- Returns:
If viewpoint has no visibility settings, return None. Otherwise return a tuple containing the default visibility and a list of IFC element GUIDs listed as exceptions.
If default visibility is True, all elements are visible except the exceptions.
If default visibility is False, all elements are hidden except the exceptions.
- get_selected_guids() list[str] | None ¶
Return viewpoint selected elements IFC guids.
- Returns:
If viewpoint has no selection settings, return None. Otherwise return a list of selected elements IFC guids.
- classmethod load(topic_dir: zipfile.Path, vpt: bcf.v2.model.ViewPoint, xml_handler: bcf.xml_parser.AbstractXmlParserSerializer | None = None) VisualizationInfoHandler | None ¶
Load the VisualizationInfo and related objects from a BCF zip file.
- Args:
topic_dir: The directory in the BCF zip file to load from. vpt: The ViewPoint to load. xml_handler: The XML handler to use to parse the VisualizationInfo.
- Returns:
The VisualizationInfoHandler object.
- save(bcf_zip: bcf.inmemory_zipfile.ZipFileInterface, topic_dir: str, vpt: bcf.v2.model.ViewPoint) None ¶
Save the VisualizationInfo and related objects to a BCF zip file.
- Args:
bcf_zip: The BCF zip file to save to. topic_dir: The directory in the BCF zip file to save to. vpt: The ViewPoint to save.
- set_selected_elements(elements: list[ifcopenshell.entity_instance]) None ¶
- set_visibility(elements: list[ifcopenshell.entity_instance], elements_visibility: Literal['VISIBLE', 'HIDDEN']) None ¶
- set_visible_elements(elements: list[ifcopenshell.entity_instance]) None ¶
- bitmaps¶
- property guid: str¶
Return the GUID of the visualization info.
- snapshot¶
- visualization_info¶
- bcf.v2.visinfo.build_camera(elem_placement: numpy.typing.NDArray[numpy.float64]) bcf.v2.model.PerspectiveCamera ¶
Return a BCF camera for an IFC element placement matrix.
- Args:
elem_placement: The IFC element placement as a rototranslation matrix.
- Returns:
The BCF camera definition.
- bcf.v2.visinfo.build_camera_from_vectors(camera_position: numpy.typing.NDArray[numpy.float64], camera_dir: numpy.typing.NDArray[numpy.float64], camera_up: numpy.typing.NDArray[numpy.float64]) bcf.v2.model.PerspectiveCamera ¶
Return a BCF camera for an IFC element placement matrix.
- Args:
camera_position: camera position array camera_dir: camera direction versor camera_up_vector: camera up versor
- Returns:
The BCF camera definition.
- bcf.v2.visinfo.build_components(*guids: str) bcf.v2.model.Components ¶
Return the BCF components from an IFC element GUID.
- Args:
*guids: One or more selected IFC element GUID.
- Returns:
The BCF components definition.
- bcf.v2.visinfo.build_viewpoint(element: ifcopenshell.entity_instance) bcf.v2.model.VisualizationInfo ¶
Return a BCF viewpoint of an IFC element.
This function is cached to speed up the creation of multiple BCF topics regarding the same element.
- Args:
element: The IFC element to point at.
- Returns:
The BCF viewpoint definition.
- bcf.v2.visinfo.build_viewpoint_from_position_and_guids(position: numpy.typing.NDArray[numpy.float64], *guids: str) bcf.v2.model.VisualizationInfo ¶
Return a BCF viewpoint of an IFC element.
This function is cached to speed up the creation of multiple BCF topics regarding the same element.
- Args:
position: target point coordinates. *guids: One or more IFC element GUID.
- Returns:
The BCF viewpoint definition.