v0.2.49..v0.2.50 changeset BuildingMergerCreator.cpp
Garret Voltz edited this page Nov 6, 2019
·
1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMergerCreator.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMergerCreator.cpp
index 8614049..6ebdc58 100644
--- a/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMergerCreator.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMergerCreator.cpp
@@ -43,7 +43,7 @@ BuildingMergerCreator::BuildingMergerCreator()
{
}
-bool BuildingMergerCreator::createMergers(const MatchSet& matches, vector<Merger*>& mergers) const
+bool BuildingMergerCreator::createMergers(const MatchSet& matches, vector<MergerPtr>& mergers) const
{
LOG_TRACE("Creating mergers with " << className() << "...");
@@ -55,9 +55,9 @@ bool BuildingMergerCreator::createMergers(const MatchSet& matches, vector<Merger
// go through all the matches
for (MatchSet::const_iterator it = matches.begin(); it != matches.end(); ++it)
{
- const Match* m = *it;
+ ConstMatchPtr m = *it;
LOG_VART(m->toString());
- const BuildingMatch* bm = dynamic_cast<const BuildingMatch*>(m);
+ const BuildingMatch* bm = dynamic_cast<const BuildingMatch*>(m.get());
// check to make sure all the input matches are building matches.
if (bm == 0)
{
@@ -76,7 +76,7 @@ bool BuildingMergerCreator::createMergers(const MatchSet& matches, vector<Merger
// only add the building merge if there are elements to merge.
if (eids.size() > 0)
{
- mergers.push_back(new BuildingMerger(eids));
+ mergers.push_back(MergerPtr(new BuildingMerger(eids)));
result = true;
}
@@ -91,17 +91,17 @@ vector<CreatorDescription> BuildingMergerCreator::getAllCreators() const
return result;
}
-bool BuildingMergerCreator::isConflicting(const ConstOsmMapPtr& map, const Match* m1,
- const Match* m2) const
+bool BuildingMergerCreator::isConflicting(const ConstOsmMapPtr& map, ConstMatchPtr m1,
+ ConstMatchPtr m2) const
{
- const BuildingMatch* bm1 = dynamic_cast<const BuildingMatch*>(m1);
- const BuildingMatch* bm2 = dynamic_cast<const BuildingMatch*>(m2);
+ const BuildingMatch* bm1 = dynamic_cast<const BuildingMatch*>(m1.get());
+ const BuildingMatch* bm2 = dynamic_cast<const BuildingMatch*>(m2.get());
// this shouldn't ever return true, but I'm calling the BuildingMatch::isConflicting just in
// case the logic changes at some point.
if (bm1 && bm2)
{
- return bm1->isConflicting(*bm2, map);
+ return m1->isConflicting(m2, map);
}
else
{