Presentation is loading. Please wait.

Presentation is loading. Please wait.

MAF Paolo Quadrani 20-21 giugno 2005 Marco Petrone

Similar presentations


Presentation on theme: "MAF Paolo Quadrani 20-21 giugno 2005 Marco Petrone"— Presentation transcript:

1 MAF Paolo Quadrani p.quadrani@cineca.itp.quadrani@cineca.it 20-21 giugno 2005 Marco Petrone m.petrone@cineca.itm.petrone@cineca.it

2 MAF MAF Architecture

3 MAF 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 MAF structure Logic View Manager Operation Manager Vme Manager Interaction Manager App Views Operations Vmes Devices + Interactors

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

6 MAF 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 MAF 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 MAF 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 MAF 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 MAF 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 MAF 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 MAF 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 MAF 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 MAF 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 MAF VME CurrentDataPose MatrixVoid * ClientData mafVmeData class, created by Logic mflDataPipe: static vtk data or dynamically generated by a custom data pipe

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

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

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

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

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

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

22 MAF Data Storage ROOT R-FemurL-Femur L-Tibia Storage......... VME Tree XML Hierarchy 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 MAF VME Derived: Output Pipes New VME Parent VME Attributes VME GUI 4x4 pose matrix 3D dataset Visual PIPE Render Window MAF View Current Time Matrix PIPE Data PIPE Matrix Array Data Array MAF Operation VMEs can be customized to generated different output data and matrix using custom pipes.

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

25 MAF VME Derived: VME Links Links to other VME can be added to extend the tree into a Graph.

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

27 MAF 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 MAF Interaction and Events Interaction inside MAF is accomplished by processing input events coming from GUI or input devices

29 MAF 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 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) InteractorOperationDevice

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

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

33 MAF Device Setup & Config

34 MAF Device Setup & Config Default devices User adds new devices

35 MAF Device Setup & Config Selected device settings Settings can be stored and restored

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

37 MAF 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: Static Interactor Inter. Manager Logic Op Manager Running Op Static Event Routing Tracker Action S.E.R.

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

39 MAF Assign Device to Actions Static bindings of the device to the actions Actions are declared by application modules

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

41 MAF Attach interactor to Action: Event IDAction Name Attach Interactors to Actions Interactor Action NameEvent ID Detach interactor from Action:

42 MAF 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. S.E.R. P.E.R. View Manager Selected View Inter. Manager Logic VME ManagerOp Manager Pointed VME Behavior Running Op Positional Routing Camera Interactor

43 MAF 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 MAF 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 MAF Create a Mouse Interactor Create a Compositor Mouse interactor, and then use it to create interactors to be assigned to single mouse buttons: Mouse Compositor Interactor Translate Interactor Input Events Rotate Interactor Left Button Right Button Mouse

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

47 MAF Applications

48 MAF Applications

49 MAF Applications

50 MAF Applications

51 MAF Applications

52 MAF Applications

53 MAF Exercise Open the ExampleApp project with Visual Studio 6 and: 1.Add visibility for mflVMELandmark type into mafViewCustom. 2.Change the visual pipe used to render the surfaces in mafPipeCustom

54 MAF Exercise Open the ExampleApp project and the mmoInteractonOp files and uncomment code to: 1.Declare a new Action 2.Create a mouse interactor 3.Attach mouse interactor to the action 4.Attach mouse interactor to the VME

55 MAF Ex: declare the new Action Uncomment code of GetAction() function inside the.cpp : also inside the.h file:

56 MAF Ex: Create the Interactor Uncomment code to create interactor in.cpp file:

57 MAF Ex: Destroy Interactor Inside OpStop() uncomment code to destroy interactor:

58 MAF Ex: Assign Interactor to Action Uncomment code to send event to attach interactor inside OpRun() function: And inside OpStop() to detach it:

59 MAF Ex: Attach Interactor to VME First, comment out lines assigning interactor to action (PASS 3)! Set the interactor in the m_behavior field of VME’s mafVmeData inside OpRun():

60 MAF Ex: Attach Interactor to VME(2) Also uncomment code to detach interaction inside OpStop():


Download ppt "MAF Paolo Quadrani 20-21 giugno 2005 Marco Petrone"

Similar presentations


Ads by Google