cigvis.vispynodes.vis_canvas module#

class cigvis.vispynodes.vis_canvas.VisCanvas(size: Tuple = (800, 720), visual_nodes: List | Dict = None, grid: Tuple = None, share: bool = False, bgcolor: str = 'white', cbar_region_ratio: float = 0.125, scale_factor: float = None, center=None, fov: float = 30, azimuth: float = 50, elevation: float = 50, zoom_factor: float = 1.0, axis_scales: Tuple = (1.0, 1.0, 1.0), savedir: str = './', title: str = 'Seismic3D', shortcut_save_kw: Dict = None, keys: str = 'interactive')#

Bases: SceneCanvas, EventMixin, AxisMixin

A canvas that automatically draw all contents in a 3D seismic visualization scene, which may include 3D seismic volume slices, axis legend, colorbar, etc.

Parameters#

sizeTuple

canvas size

visual_nodesUnion[List, Dict]

nodes, can be a List like: [mesh1, mesh2, …] (for a single widget), or [[mesh1, mesh2, …], [image1, mesh3, …], …] (must input ‘grid’). It also can be a Dict like: {‘0,0’: [mesh1, img1, …], ‘0,1’: [mesh2, …]}. Its keys represent the location in the grid

gridTuple

a 2D Tuple, (nrows, ncols)

sharebool

whether link all cameras when ‘grid’ is not None

bgcolorstr or Color

background color

cbar_region_ratiofloat

colorbar region ration, i.e., (width*cbar_region_ratio, hight)

scale_factorfloat

camera scale factor

centerTuple

center position, default is None

fovfloat

camera fov

azimuthfloat

camera azimuth

elevationfloat

camera elevation

zoom_factorfloat

camera zoom factor

axis_scalesTuple

axis scale, default is (1, 1, 1)

savedirstr

the dir to save sreenshot when press <s>

titlestr

canvas title name, which is also used as the save screenshot name

add_node(node)#

Add a node to the canvas. NOTE: this function is valid only when one canvas, i.e., self.nrows and self.ncols are both 1

add_nodes(visual_nodes: List | Dict, grid: Tuple = None)#
add_visual_nodes()#

Add all visual nodes

link all cameras

remove_node(node, delete=True)#

Remove a node from the canvas. NOTE: this function is valid only when one canvas, i.e., self.nrows and self.ncols are both 1

set_prompt_callback(cb)#

cb signature: cb(xyz: tuple[int,int,int], hover_on, event)

update_axis_scales(axis_scales)#
update_camera(azimuth, elevation, fov)#