MCPcopy Create free account
hub / github.com/MITK/MITK / WriteEventXMLConfig

Function WriteEventXMLConfig

Modules/Core/src/Interactions/mitkEventRecorder.cpp:27–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27static void WriteEventXMLConfig(std::ofstream &stream)
28{
29 // <config>
30 stream << " <" << mitk::InteractionEventConst::xmlTagConfigRoot() << ">\n";
31
32 // write renderer config
33 // for all registered 2D renderers write name and viewdirection.
34 auto rendererIterator = mitk::BaseRenderer::baseRendererMap.begin();
35 auto end = mitk::BaseRenderer::baseRendererMap.end();
36
37 for (; rendererIterator != end; ++rendererIterator)
38 {
39 std::string rendererName = (*rendererIterator).second->GetName();
40
41 mitk::AnatomicalPlane viewDirection =
42 (*rendererIterator).second->GetSliceNavigationController()->GetDefaultViewDirection();
43 MapperSlotId mapperID = (*rendererIterator).second->GetMapperID();
44
45 // <renderer RendererName="stdmulti.widget1" ViewDirection="1" MapperID="1" SizeX="200" SizeY="200" SizeZ="1"/>
46 stream << " <" << mitk::InteractionEventConst::xmlTagRenderer() << " "
47 << mitk::InteractionEventConst::xmlEventPropertyRendererName() << "=\"" << rendererName << "\" "
48 << mitk::InteractionEventConst::xmlEventPropertyViewDirection() << "=\"" << static_cast<int>(viewDirection) << "\" "
49 << mitk::InteractionEventConst::xmlEventPropertyMapperID() << "=\"" << mapperID << "\" "
50 << mitk::InteractionEventConst::xmlRenderSizeX() << "=\"" << (*rendererIterator).second->GetSize()[0]
51 << "\" " << mitk::InteractionEventConst::xmlRenderSizeY() << "=\""
52 << (*rendererIterator).second->GetSize()[1] << "\" " << mitk::InteractionEventConst::xmlRenderSizeZ()
53 << "=\"" << (*rendererIterator).second->GetSize()[2] << "\" ";
54 ;
55
56 if ((*rendererIterator).second->GetMapperID() == mitk::BaseRenderer::Standard3D)
57 {
58 // For a 3D render window, rotation and zoom settings are determined by the vtkCamera parameters
59 // these are recorded here:
60 stream << mitk::InteractionEventConst::xmlViewUpX() << "=\""
61 << (*rendererIterator).second->GetVtkRenderer()->GetActiveCamera()->GetViewUp()[0] << "\" "
62 << mitk::InteractionEventConst::xmlViewUpY() << "=\""
63 << (*rendererIterator).second->GetVtkRenderer()->GetActiveCamera()->GetViewUp()[1] << "\" "
64 << mitk::InteractionEventConst::xmlViewUpZ() << "=\""
65 << (*rendererIterator).second->GetVtkRenderer()->GetActiveCamera()->GetViewUp()[2] << "\" "
66 << mitk::InteractionEventConst::xmlCameraFocalPointX() << "=\""
67 << (*rendererIterator).second->GetVtkRenderer()->GetActiveCamera()->GetFocalPoint()[0] << "\" "
68 << mitk::InteractionEventConst::xmlCameraFocalPointY() << "=\""
69 << (*rendererIterator).second->GetVtkRenderer()->GetActiveCamera()->GetFocalPoint()[1] << "\" "
70 << mitk::InteractionEventConst::xmlCameraFocalPointZ() << "=\""
71 << (*rendererIterator).second->GetVtkRenderer()->GetActiveCamera()->GetFocalPoint()[2] << "\" "
72 << mitk::InteractionEventConst::xmlCameraPositionX() << "=\""
73 << (*rendererIterator).second->GetVtkRenderer()->GetActiveCamera()->GetPosition()[0] << "\" "
74 << mitk::InteractionEventConst::xmlCameraPositionY() << "=\""
75 << (*rendererIterator).second->GetVtkRenderer()->GetActiveCamera()->GetPosition()[1] << "\" "
76 << mitk::InteractionEventConst::xmlCameraPositionZ() << "=\""
77 << (*rendererIterator).second->GetVtkRenderer()->GetActiveCamera()->GetPosition()[2] << "\" ";
78 }
79 stream << "/>\n";
80 }
81
82 // </config>
83 stream << " </" << mitk::InteractionEventConst::xmlTagConfigRoot() << ">\n";
84}

Callers 1

StartRecordingMethod · 0.85

Calls 7

beginMethod · 0.45
endMethod · 0.45
GetNameMethod · 0.45
GetSizeMethod · 0.45
GetVtkRendererMethod · 0.45
GetPositionMethod · 0.45

Tested by

no test coverage detected