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/FanFlatProjectionGeometry2D.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/FanFlatProjectionGeometry2D.cpp')
-rw-r--r-- | src/FanFlatProjectionGeometry2D.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/FanFlatProjectionGeometry2D.cpp b/src/FanFlatProjectionGeometry2D.cpp index d757f18..32a19bc 100644 --- a/src/FanFlatProjectionGeometry2D.cpp +++ b/src/FanFlatProjectionGeometry2D.cpp @@ -134,17 +134,15 @@ bool CFanFlatProjectionGeometry2D::initialize(const Config& _cfg) CProjectionGeometry2D::initialize(_cfg); // Required: DistanceOriginDetector - XMLNode* node = _cfg.self->getSingleNode("DistanceOriginDetector"); + XMLNode node = _cfg.self.getSingleNode("DistanceOriginDetector"); ASTRA_CONFIG_CHECK(node, "FanFlatProjectionGeometry2D", "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, "FanFlatProjectionGeometry2D", "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 @@ -209,12 +207,12 @@ Config* CFanFlatProjectionGeometry2D::getConfiguration() const { Config* cfg = new Config(); cfg->initialize("ProjectionGeometry2D"); - cfg->self->addAttribute("type", "fanflat"); - cfg->self->addChildNode("DetectorCount", getDetectorCount()); - cfg->self->addChildNode("DetectorWidth", getDetectorWidth()); - cfg->self->addChildNode("DistanceOriginSource", getOriginSourceDistance()); - cfg->self->addChildNode("DistanceOriginDetector", getOriginDetectorDistance()); - cfg->self->addChildNode("ProjectionAngles", m_pfProjectionAngles, m_iProjectionAngleCount); + cfg->self.addAttribute("type", "fanflat"); + cfg->self.addChildNode("DetectorCount", getDetectorCount()); + cfg->self.addChildNode("DetectorWidth", getDetectorWidth()); + cfg->self.addChildNode("DistanceOriginSource", getOriginSourceDistance()); + cfg->self.addChildNode("DistanceOriginDetector", getOriginDetectorDistance()); + cfg->self.addChildNode("ProjectionAngles", m_pfProjectionAngles, m_iProjectionAngleCount); return cfg; } //---------------------------------------------------------------------------------------- |