1 / 60

MAF

Marco Petrone m.petrone@cineca.it. MAF. Paolo Quadrani p.quadrani@cineca.it. 20-21 giugno 2005. MAF Architecture. Software layers. HAL: vertical applications, custom objects LAL: view, visual pipe, widgets, operations, logic

Télécharger la présentation

MAF

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Marco Petronem.petrone@cineca.it MAF Paolo Quadranip.quadrani@cineca.it 20-21 giugno 2005

  2. MAF Architecture

  3. Software layers • HAL: vertical applications, custom objects • LAL: view, visual pipe, widgets, operations, logic • MFL: VME, data pipe, vtk filters and all additional libraries used inside the framework HAL LAL MFL

  4. MAF structure App Logic View Manager Operation Manager Vme Manager Interaction Manager Views Operations Vmes Devices + Interactors

  5. Framework communication Logic Msg send: OnEvent() Call Command execution Operation Manager Module separation: who send a message do not know the listener Op

  6. What do the ‘App’ class? • Create the parent frame of the application • Make an instance of the logic • Plug the views and the operations used inside the application • Hide/Show the interface elements for the vertical application • Terminate the application deleting the logic

  7. Logic: the application’s behavior • Create and instance of each manager: mafViewManager, mafOpManager, mafVmeManager, mafInteractionManager • Create the menu’ • Create the toolbar • Create the sidebar • Create the timebar • Create the log area • Listen all the events raised from the managers and from the interface elements • Call (virtual) methods to mange the events

  8. mafViewManager • Create/Delete plugged views • Manage view selection • Add/Remove VMEs to/from the views • Has knowledge about the selected view and selected VME

  9. mafOpManager • Manage the operation execution • Manage the undo stack • Enable/Disable menu’ items and toolbar buttons according to the VME selected and to the operation execution

  10. mafVmeManager • Add/Remove a VME to/from the tree • Manage the file save, open, new • Manage the file history • Set the time to the VME tree

  11. mafInteractionManager • Make a default instance of mouse device • Manage interaction devices through DeviceManager • Make an instance of the Positional Event Router (PER), used to interact dynamically with a device and the selected VME through VME’s behavior • Make an instance of the Static Event Router (SER), used to interact statically with a device and a fixed VME

  12. How do the view work? • Copy: make an instance of itself, set the listener to the mafViewManager and call method Create() • Create: create the render window and create the view scene graph giving to it the information of which VMEs are creatable

  13. How do the view work? (2) • VmeAdd/VmeRemove: add/remove a VME to the scene graph • VmeCreatePipe/VmeDeletePipe: create/delete visualization pipeline for the VME that has to be shown/hidden (these are called by the mafSceneGraph on VmeShow call)

  14. How do the operation work? • Copy: make a copy of itself • OpRun: first method called by the mafOpManager; create the GUI for the operation • OnEvent: listen the messages sent from the GUI • OpStop: the operation is ending with wxOK or wxCANCEL, notify it to the OpManager • OpDo: called if the operation is terminated with wxOK • the op is pushed inside the undo stack (if the m_canundo flag is true) • OpUndo: called only when UnDo is required • The op is popped out from the undo stack • All the objects must be alive to establish previous situation

  15. VME Void * Pose Matrix CurrentData ClientData VME mflDataPipe: static vtk data or dynamically generated by a custom data pipe mafVmeData class, created by Logic

  16. Parent VME MAF View 4x4 pose VME matrix Matrix Array Render Visual 3D Window PIPE Data Array dataset Attributes Current Time VME 4D data structure • 4D data, positioned in space with a hierarchical organization

  17. Parent VME MAF View 4x4 pose VME matrix Matrix Array Render Visual 3D Window PIPE Data Array dataset Attributes Current Time VME 4D data structure • The kind of data stored inside a node:

  18. Parent VME MAF View 4x4 pose VME matrix Matrix Array Render Visual 3D Window PIPE Data Array dataset Attributes Current Time VME 4D data structure • Output: 4x4 matrix and VTK dataset

  19. Parent VME MAF View 4x4 pose VME matrix Matrix Array Render Visual 3D Window PIPE Data Array dataset Attributes Current Time VME 4D data structure • VME consumers

  20. Parent VME MAF View 4x4 pose VME matrix Matrix Array Render Visual 3D Window PIPE Data Array dataset Attributes Current Time VME 4D data structure • VME output changes according to input time

  21. Parent VME MAF View 4x4 pose VME matrix Matrix Array Render Visual MAF 3D Window PIPE Operation Data Array dataset Attributes Current Time VME 4D data structure • Data manipulation by means of Operations

  22. XML Hierarchy VME Tree <MSF Name="legs"> <VME Name="L-Femur"> ... ROOT <VME Name="L-Tibia"> ... </VME> L-Femur R-Femur Storage </VME> <VME Name="L-Femur"> L-Tibia ... </VME> </MSF> Data Storage • The VME tree is stored inside a folder as a single XML file (MSF file) storing hierarchy, pose and metadata, plus single data files of node’s data (VTK Datasets). • Hierarchy • Matrix Array • Data Array • Attributes

  23. Parent VME New VME MAF View 4x4 pose matrix Matrix Matrix Array PIPE MAF Render Visual Operation Data Array 3D Window PIPE dataset Data Attributes PIPE Current Time VME GUI VME Derived: Output Pipes • VMEs can be customized to generated different output data and matrix using custom pipes.

  24. Parent VME New VME MAF View 4x4 pose matrix Matrix Matrix Array PIPE MAF Render Visual Operation Data Array 3D Window PIPE dataset Data Attributes PIPE Current Time VME GUI VME Derived: Custom GUI • VMEs GUI can also be customized to set specific parameters…

  25. Parent VME VME Derived MAF View 4x4 pose VME 1 Link matrix Matrix PIPE Render Visual VME 2 3D Link Window PIPE dataset Data Attributes PIPE VME 3 Link Current MAF Time Operation VME Derived: VME Links • Links to other VME can be added to extend the tree into a Graph.

  26. Parent VME VME Derived MAF View 4x4 pose VME 1 Link matrix Matrix PIPE Render Visual VME 2 3D Link Window PIPE dataset Data Attributes PIPE VME 3 Link Current MAF Time Operation VME Derived: VME Links (2) • VME can listen to changes to linked VMES.

  27. VME Derived: VME Meter • An example of VME Derived is the VME Meter: it’s a VME continuously computing the distance in between linked VMEs. • VME Derived are sort of persistent operations which are saved in the data tree.

  28. MAF Interaction and Events • Interaction inside MAF is accomplished by processing input events coming from GUI or input devices

  29. Discrete and Continuous • Discrete Events: low frequency and typically causing application state change. Typically coming from GUI or discrete I/O device. • Continuous Events: rised when user interacts inside views using a continuous input device, like a mouse or a tracker.

  30. MAF Interaction Model • The typical MAF interaction model is composed by an event source (the device), an interpreter (the interactor) and a logic module (operations, logic or others) Device Interactor Operation

  31. Inter. Manager Speech Mouse Device Manager S.E.R. Tracker Haptic Sync Events Async Events Events from Device • Events coming from input devices are synchronized with the main application thread by Device Manager:

  32. Device Manager • Responsible for devices: • Creation • Storing/Restoring of device setup • Input events synchronization

  33. Device Setup & Config

  34. Device Setup & Config • Default devices • User adds newdevices

  35. Device Setup & Config • Selected devicesettings • Settings can bestored and restored

  36. Interaction with MAF • Direct Interaction with devices: • Static Event Routing • Interaction with objects in the scene: • Positional Event Routing

  37. Static Event Routing • Interaction with devices is called “Static Event Routing”, where devices are assigned directly to “actions” by user, and interactors are connected to “actions”by application: Logic Inter. Manager Op Manager Running Op S.E.R. Static Event Routing StaticInteractor Tracker Action

  38. SER Example Tracking device assigned to changing the point of view in the scene. Current View S.E.R. Camera Interactor Head Track Action

  39. Assign Device to Actions • Static bindings ofthe deviceto the actions • Actions are declaredby application modules

  40. Actions declaration (for Ops) • Define a GetActions() function in the operation returning the list of actions required by operation.

  41. Attach Interactors to Actions • Attach interactor to Action: Event ID Interactor Action Name • Detach interactor from Action: Event ID Interactor Action Name

  42. Positional Event Routing • A specialized interactor (P.E.R.), check where user is pointing in the view and routes events toward the interactor connected to the pointed object. Logic Inter. Manager View Manager VME Manager Op Manager SelectedView PointedVME S.E.R. Running Op P.E.R. Behavior PositionalRouting CameraInteractor

  43. Positional Event Routing (2) • P.E.R. is an interactor statically assigned to “PointAndManipulate” action. • Picking in the scene occurs only in response to “button down” events, therefore to be used with the P.E.R. an input device must be able to rise a button event.

  44. Attach Interactors to VME • The interactor should be set in the m_behavior field of the VmeData object connected to the VME, which can be retrieved with GetClientData() function (MAF 1.x):

  45. Create a Mouse Interactor • Create a Compositor Mouse interactor, and then use it to create interactors to be assigned to single mouse buttons: Left Button Translate Interactor Input Events Mouse Compositor Interactor Mouse Rotate Interactor Right Button

  46. Create a Mouse Interactor (2) • Header file (Op.h): • Body file (.cpp) Left Button!

  47. Applications

  48. Applications

  49. Applications

  50. Applications

More Related