fw4spl
Bundles/core/dataReg/src/dataReg/parser/TransformationMatrix3D.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include "dataReg/parser/TransformationMatrix3D.hpp"
8 
9 #include <fwData/TransformationMatrix3D.hpp>
10 
11 #include <fwServices/macros.hpp>
12 
15 
16 namespace dataReg
17 {
18 namespace parser
19 {
20 
21 //------------------------------------------------------------------------------
22 
24 {
25  SLM_FATAL("This method is deprecated, and thus shouldn't be used.");
26 }
27 
28 //------------------------------------------------------------------------------
29 
30 void TransformationMatrix3D::createConfig( ::fwTools::Object::sptr _obj )
31 {
32  ::fwData::TransformationMatrix3D::sptr matrix = ::fwData::TransformationMatrix3D::dynamicCast( _obj );
33  SLM_ASSERT("matrix not instanced", matrix);
34 
35  for( ::fwRuntime::ConfigurationElement::csptr elem : m_cfg->getElements() )
36  {
37  if ( elem->getName() == "matrix" )
38  {
39  std::string input = elem->getValue();
40  std::istringstream inputString( input );
41 
42  double coef;
43  for ( unsigned int k = 0; k < 16; k++)
44  {
45  inputString >> coef;
46  matrix->getCoefficients()[k] = coef;
47  }
48  }
49  }
50 }
51 
52 //------------------------------------------------------------------------------
53 
54 } //namespace parser
55 } //namespace dataReg
Specific service for the construction of a TransformationMatrix3D and its associated services from an...
The namespace dataReg (data registration) contains classes which allow to parse the xml configuration...
#define SLM_FATAL(message)
Definition: spyLog.hpp:283
virtual DATAREG_API void updating() override
Updating method : create the process object.
#define SLM_ASSERT(message, cond)
work like &#39;assert&#39; from &#39;cassert&#39;, with in addition a message logged by spylog (with FATAL loglevel) ...
Definition: spyLog.hpp:308
This class represents a 3D transformation matrix (4x4).
Service type for the construction of an object and associated services from an XML-based description...
Definition: IXMLParser.hpp:36