@@ -53,13 +53,13 @@ def __init__(self) -> None:
5353
5454 self .server = get_server (client_type = CLIENT_TYPE )
5555 self .state , self .ctrl = self .server .state , self .server .controller
56-
56+
5757 # Initialize state variables for toggles
5858 self .state .dark_background = False
5959 self .state .measure_active = False
6060 self .state .mesh_slider_active = False
6161 self .state .ruler_active = False
62-
62+
6363 # Store reference to plotter for controller methods
6464 self .plotter = None
6565
@@ -111,11 +111,11 @@ def toggle_mesh_slider():
111111 for actor in self .plotter .scene .actors .values ():
112112 if hasattr (actor , 'mapper' ) and hasattr (actor .mapper , "dataset" ):
113113 meshes .append (actor .mapper .dataset )
114-
114+
115115 if meshes :
116116 mb = pv .MultiBlock (meshes ).combine ()
117117 self ._widget_actor = self .plotter .scene .add_mesh_clip_plane (mb )
118-
118+
119119 # Store original actors before removing them
120120 for mesh in meshes :
121121 if isinstance (mesh , pv .PolyData ):
@@ -126,7 +126,7 @@ def toggle_mesh_slider():
126126 mesh_id = "MultiBlock(" + mesh .memory_address + ")"
127127 elif isinstance (mesh , pv .StructuredGrid ):
128128 mesh_id = "StructuredGrid(" + mesh .memory_address + ")"
129-
129+
130130 if mesh_id in self .plotter .scene .actors :
131131 self ._mesh_actor_list .append (self .plotter .scene .actors [mesh_id ])
132132 self .plotter .scene .remove_actor (mesh_id )
@@ -344,7 +344,7 @@ def view_xy_plus():
344344 except Exception as e :
345345 print (f"Error setting XY+ view: { e } " )
346346
347- @self .ctrl .set ("view_xy_minus" )
347+ @self .ctrl .set ("view_xy_minus" )
348348 def view_xy_minus ():
349349 """Set camera to XY- view."""
350350 try :
@@ -418,133 +418,133 @@ def view_reset_camera():
418418 mode = "trame"
419419 )
420420 self .ctrl .view_update = view .update
421-
421+
422422 # Store the view reference for local rendering updates
423423 self .view = view
424424
425425 # Add buttons to side drawer/menu
426426 with layout .drawer :
427- with v3 .VList (shaped = True ):
427+ with v3 .VList (shaped = True ):
428428 # Tools Section
429429 with v3 .VListGroup (value = ("true" ,)):
430430 with v3 .Template (v_slot_activator = True ):
431431 with v3 .VListItemContent ():
432432 v3 .VListItemTitle ("Tools" )
433-
433+
434434 with v3 .VListItem (click = self .ctrl .toggle_measure ):
435435 with v3 .VListItemIcon ():
436436 v3 .VIcon ("mdi-ruler" )
437437 with v3 .VListItemContent ():
438438 v3 .VListItemTitle ("Measurement Tool" )
439-
439+
440440 with v3 .VListItem (click = self .ctrl .toggle_mesh_slider ):
441441 with v3 .VListItemIcon ():
442442 v3 .VIcon ("mdi-content-cut" )
443443 with v3 .VListItemContent ():
444444 v3 .VListItemTitle ("Mesh Slicer" )
445-
445+
446446 with v3 .VListItem (click = self .ctrl .toggle_ruler ):
447447 with v3 .VListItemIcon ():
448448 v3 .VIcon ("mdi-ruler" )
449449 with v3 .VListItemContent ():
450450 v3 .VListItemTitle ("Ruler" )
451-
451+
452452 # Camera Movement Section
453453 with v3 .VListGroup (value = ("true" ,)):
454454 with v3 .Template (v_slot_activator = True ):
455455 with v3 .VListItemContent ():
456456 v3 .VListItemTitle ("Camera Movement" )
457-
457+
458458 with v3 .VListItem (click = self .ctrl .displace_camera_x_up ):
459459 with v3 .VListItemIcon ():
460460 v3 .VIcon ("mdi-arrow-up-bold" )
461461 with v3 .VListItemContent ():
462462 v3 .VListItemTitle ("Move X+" )
463-
463+
464464 with v3 .VListItem (click = self .ctrl .displace_camera_x_down ):
465465 with v3 .VListItemIcon ():
466466 v3 .VIcon ("mdi-arrow-down-bold" )
467467 with v3 .VListItemContent ():
468468 v3 .VListItemTitle ("Move X-" )
469-
469+
470470 with v3 .VListItem (click = self .ctrl .displace_camera_y_up ):
471471 with v3 .VListItemIcon ():
472472 v3 .VIcon ("mdi-arrow-up-bold" )
473473 with v3 .VListItemContent ():
474474 v3 .VListItemTitle ("Move Y+" )
475-
475+
476476 with v3 .VListItem (click = self .ctrl .displace_camera_y_down ):
477477 with v3 .VListItemIcon ():
478478 v3 .VIcon ("mdi-arrow-down-bold" )
479479 with v3 .VListItemContent ():
480480 v3 .VListItemTitle ("Move Y-" )
481-
481+
482482 with v3 .VListItem (click = self .ctrl .displace_camera_z_up ):
483483 with v3 .VListItemIcon ():
484484 v3 .VIcon ("mdi-arrow-up-bold" )
485485 with v3 .VListItemContent ():
486486 v3 .VListItemTitle ("Move Z+" )
487-
487+
488488 with v3 .VListItem (click = self .ctrl .displace_camera_z_down ):
489489 with v3 .VListItemIcon ():
490490 v3 .VIcon ("mdi-arrow-down-bold" )
491491 with v3 .VListItemContent ():
492492 v3 .VListItemTitle ("Move Z-" )
493-
493+
494494 # Camera Views Section
495495 with v3 .VListGroup ():
496496 with v3 .Template (v_slot_activator = True ):
497497 with v3 .VListItemContent ():
498498 v3 .VListItemTitle ("Camera Views" )
499-
499+
500500 with v3 .VListItem (click = self .ctrl .view_xy_plus ):
501501 with v3 .VListItemIcon ():
502502 v3 .VIcon ("mdi-axis-arrow" )
503503 with v3 .VListItemContent ():
504504 v3 .VListItemTitle ("XY+ View" )
505-
505+
506506 with v3 .VListItem (click = self .ctrl .view_xy_minus ):
507507 with v3 .VListItemIcon ():
508508 v3 .VIcon ("mdi-axis-arrow" )
509509 with v3 .VListItemContent ():
510510 v3 .VListItemTitle ("XY- View" )
511-
511+
512512 with v3 .VListItem (click = self .ctrl .view_xz_plus ):
513513 with v3 .VListItemIcon ():
514514 v3 .VIcon ("mdi-axis-arrow" )
515515 with v3 .VListItemContent ():
516516 v3 .VListItemTitle ("XZ+ View" )
517-
517+
518518 with v3 .VListItem (click = self .ctrl .view_xz_minus ):
519519 with v3 .VListItemIcon ():
520520 v3 .VIcon ("mdi-axis-arrow" )
521521 with v3 .VListItemContent ():
522522 v3 .VListItemTitle ("XZ- View" )
523-
523+
524524 with v3 .VListItem (click = self .ctrl .view_yz_plus ):
525525 with v3 .VListItemIcon ():
526526 v3 .VIcon ("mdi-axis-arrow" )
527527 with v3 .VListItemContent ():
528528 v3 .VListItemTitle ("YZ+ View" )
529-
529+
530530 with v3 .VListItem (click = self .ctrl .view_yz_minus ):
531531 with v3 .VListItemIcon ():
532532 v3 .VIcon ("mdi-axis-arrow" )
533533 with v3 .VListItemContent ():
534534 v3 .VListItemTitle ("YZ- View" )
535-
535+
536536 with v3 .VListItem (click = self .ctrl .view_isometric ):
537537 with v3 .VListItemIcon ():
538538 v3 .VIcon ("mdi-cube-outline" )
539539 with v3 .VListItemContent ():
540540 v3 .VListItemTitle ("Isometric View" )
541-
541+
542542 # Display Controls Section
543543 with v3 .VListGroup ():
544544 with v3 .Template (v_slot_activator = True ):
545545 with v3 .VListItemContent ():
546546 v3 .VListItemTitle ("Display Options" )
547-
547+
548548 with v3 .VListItem (click = self .ctrl .toggle_dark_mode ):
549549 with v3 .VListItemIcon ():
550550 v3 .VIcon ("mdi-theme-light-dark" )
0 commit comments