honeybee_vtk.assistant module

An assistant class to the Scene object.

class honeybee_vtk.assistant.Assistant(background_color: Tuple[int, int, int], camera: honeybee_vtk.camera.Camera, actors: List[honeybee_vtk.actor.Actor], legend_parameters: list, text_actor: honeybee_vtk.text_actor.TextActor = None)[source]

Bases: object

Initialize an Assistant object.

This is more of a helper class and the interface for this class is the Scene object. This class takes a camera and a list of actors to assemble a vtk interactor, a vtk renderWindow, and a vtk renderer objects.

Parameters
  • background_color – A tuple of three integers that represent RGB values of the color that you’d like to set as the background color.

  • actors – A list of actors.

  • camera – A Camera object.

  • legend_parameters – A list of legend parameter objects to be added to the scene

  • text_actor – A TextActor object. Defaults to None.

auto_image_dimension(image_width: int = 0, image_height: int = 0) → Tuple[int][source]

Calculate image dimension.

If image width and image height are not specified by the user, Camera’s x and y dimension are used instead. Note that a Camera object gets x and y dimension from its parent Radiance View object.

Parameters
  • image_width – Image width in pixels set by the user. Defaults to 0, which will use view’s x dimension.

  • image_height – Image height in pixels set by the user. Defaults to 0, which will use view’s y dimension.

Returns

A tuple with two elements

  • image_width: Image width in pixels.

  • image_height: Image height in pixels.

auto_text_height(image_width, image_height) → None[source]

Calculate text height based on image dimension.

If a user has not specified the text height in legend parameters, it will be calculated based on the average of image width and image height. 2.5% of this average is used as the text height.

Parameters
  • image_width – Image width in pixels set by the user.

  • image_height – Image height in pixels set by the user.

property vtk_camera