diff options
author | Willem Jan Palenstijn <wjp@usecode.org> | 2015-05-01 17:48:32 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-05-06 15:18:03 +0200 |
commit | 47fe3421585302f2101691a685ab99b0e1ad5cfc (patch) | |
tree | 5f7ff204c5d19f83313487a840748724e04ad8e5 /src/ConeProjectionGeometry3D.cpp | |
parent | bf31003d74f538a9096ef5999b31b0daa58c38c9 (diff) | |
download | astra-47fe3421585302f2101691a685ab99b0e1ad5cfc.tar.gz astra-47fe3421585302f2101691a685ab99b0e1ad5cfc.tar.bz2 astra-47fe3421585302f2101691a685ab99b0e1ad5cfc.tar.xz astra-47fe3421585302f2101691a685ab99b0e1ad5cfc.zip |
Change XMLNode* to XMLNode
An XMLNode object is already simply a pointer, so no need to dynamically allocate XMLNodes.
Diffstat (limited to 'src/ConeProjectionGeometry3D.cpp')
-rw-r--r-- | src/ConeProjectionGeometry3D.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/ConeProjectionGeometry3D.cpp b/src/ConeProjectionGeometry3D.cpp index 1976901..dd22eba 100644 --- a/src/ConeProjectionGeometry3D.cpp +++ b/src/ConeProjectionGeometry3D.cpp @@ -87,17 +87,15 @@ bool CConeProjectionGeometry3D::initialize(const Config& _cfg) CProjectionGeometry3D::initialize(_cfg); // Required: DistanceOriginDetector - XMLNode* node = _cfg.self->getSingleNode("DistanceOriginDetector"); + XMLNode node = _cfg.self.getSingleNode("DistanceOriginDetector"); ASTRA_CONFIG_CHECK(node, "ConeProjectionGeometry3D", "No DistanceOriginDetector tag specified."); - m_fOriginDetectorDistance = boost::lexical_cast<float32>(node->getContent()); - ASTRA_DELETE(node); + m_fOriginDetectorDistance = boost::lexical_cast<float32>(node.getContent()); CC.markNodeParsed("DistanceOriginDetector"); // Required: DetectorOriginSource - node = _cfg.self->getSingleNode("DistanceOriginSource"); + node = _cfg.self.getSingleNode("DistanceOriginSource"); ASTRA_CONFIG_CHECK(node, "ConeProjectionGeometry3D", "No DistanceOriginSource tag specified."); - m_fOriginSourceDistance = boost::lexical_cast<float32>(node->getContent()); - ASTRA_DELETE(node); + m_fOriginSourceDistance = boost::lexical_cast<float32>(node.getContent()); CC.markNodeParsed("DistanceOriginSource"); // success @@ -193,14 +191,14 @@ Config* CConeProjectionGeometry3D::getConfiguration() const { Config* cfg = new Config(); cfg->initialize("ProjectionGeometry3D"); - cfg->self->addAttribute("type", "cone"); - cfg->self->addChildNode("DetectorSpacingX", m_fDetectorSpacingX); - cfg->self->addChildNode("DetectorSpacingY", m_fDetectorSpacingY); - cfg->self->addChildNode("DetectorRowCount", m_iDetectorRowCount); - cfg->self->addChildNode("DetectorColCount", m_iDetectorColCount); - cfg->self->addChildNode("DistanceOriginDetector", m_fOriginDetectorDistance); - cfg->self->addChildNode("DistanceOriginSource", m_fOriginSourceDistance); - cfg->self->addChildNode("ProjectionAngles", m_pfProjectionAngles, m_iProjectionAngleCount); + cfg->self.addAttribute("type", "cone"); + cfg->self.addChildNode("DetectorSpacingX", m_fDetectorSpacingX); + cfg->self.addChildNode("DetectorSpacingY", m_fDetectorSpacingY); + cfg->self.addChildNode("DetectorRowCount", m_iDetectorRowCount); + cfg->self.addChildNode("DetectorColCount", m_iDetectorColCount); + cfg->self.addChildNode("DistanceOriginDetector", m_fOriginDetectorDistance); + cfg->self.addChildNode("DistanceOriginSource", m_fOriginSourceDistance); + cfg->self.addChildNode("ProjectionAngles", m_pfProjectionAngles, m_iProjectionAngleCount); return cfg; } |