Class Center3DObjectHandler

java.lang.Object
io.goobi.viewer.model.job.mq.Center3DObjectHandler
All Implemented Interfaces:
MessageHandler<MessageStatus>

public class Center3DObjectHandler extends Object implements MessageHandler<MessageStatus>
Message handler that auto-generates a centered Voyager SVX scene file for a GLTF or GLB 3D object.

The bounding-box centre of the model is computed from the GLTF POSITION accessor min/max values and stored as a node translation in the generated *.svx.json file. This ensures that the Voyager viewer rotates around the object's actual centre rather than the coordinate-system origin.

If an svx.json file already exists for the model (e.g. from manual editing in voyager-story) it is left untouched so that manual scene adjustments are preserved.

  • Constructor Details

    • Center3DObjectHandler

      public Center3DObjectHandler()
      Production constructor – resolves dependencies from DataManager at call time.
  • Method Details

    • call

      public MessageStatus call(ViewerMessage message, MessageQueueManager queueManager)
      Description copied from interface: MessageHandler
      Call this method to execute the ticket.
      Specified by:
      call in interface MessageHandler<MessageStatus>
      Parameters:
      message - The ticket to handle
      queueManager - reference to to manage the queue
      Returns:
      V
    • getMessageHandlerName

      public String getMessageHandlerName()
      Specified by:
      getMessageHandlerName in interface MessageHandler<MessageStatus>
    • createMessage

      public static ViewerMessage createMessage(String pi, String filename)
      Creates a ViewerMessage that triggers centering for the given record's 3D model. Skips the task if an SVX file already exists (force=false).
      Parameters:
      pi - persistent identifier of the record
      filename - 3D model filename (.gltf or .glb)
      Returns:
      ready-to-dispatch ViewerMessage
    • createMessage

      public static ViewerMessage createMessage(String pi, String filename, boolean force)
      Creates a ViewerMessage that triggers centering for the given record's 3D model.
      Parameters:
      pi - persistent identifier of the record
      filename - 3D model filename (.gltf or .glb)
      force - if true, any existing SVX scene file will be overwritten
      Returns:
      ready-to-dispatch ViewerMessage