mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-23 22:53:43 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -12,44 +12,42 @@ using namespace feature;
|
||||
|
||||
namespace
|
||||
{
|
||||
typedef m2::PointD P;
|
||||
typedef m2::PointD P;
|
||||
|
||||
class VectorEmitter : public FeatureEmitterIFace
|
||||
class VectorEmitter : public FeatureEmitterIFace
|
||||
{
|
||||
std::vector<FeatureBuilder> m_vec;
|
||||
|
||||
public:
|
||||
virtual void operator()(FeatureBuilder const & fb) { m_vec.push_back(fb); }
|
||||
|
||||
size_t GetSize() const { return m_vec.size(); }
|
||||
|
||||
void Check(uint32_t type, size_t count) const
|
||||
{
|
||||
std::vector<FeatureBuilder> m_vec;
|
||||
public:
|
||||
virtual void operator() (FeatureBuilder const & fb)
|
||||
{
|
||||
m_vec.push_back(fb);
|
||||
}
|
||||
size_t test = 0;
|
||||
for (size_t i = 0; i < m_vec.size(); ++i)
|
||||
if (m_vec[i].HasType(type))
|
||||
++test;
|
||||
|
||||
size_t GetSize() const { return m_vec.size(); }
|
||||
|
||||
void Check(uint32_t type, size_t count) const
|
||||
{
|
||||
size_t test = 0;
|
||||
for (size_t i = 0; i < m_vec.size(); ++i)
|
||||
if (m_vec[i].HasType(type))
|
||||
++test;
|
||||
|
||||
TEST_EQUAL(test, count, ());
|
||||
}
|
||||
};
|
||||
}
|
||||
TEST_EQUAL(test, count, ());
|
||||
}
|
||||
};
|
||||
} // namespace
|
||||
|
||||
UNIT_TEST(FeatureMerger_MultipleTypes)
|
||||
{
|
||||
classificator::Load();
|
||||
|
||||
P arrPt[] = { P(0, 0), P(1, 1), P(2, 2), P(3, 3) };
|
||||
size_t const count = ARRAY_SIZE(arrPt)-1;
|
||||
P arrPt[] = {P(0, 0), P(1, 1), P(2, 2), P(3, 3)};
|
||||
size_t const count = ARRAY_SIZE(arrPt) - 1;
|
||||
|
||||
FeatureBuilder arrF[count];
|
||||
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
arrF[i].SetLinear();
|
||||
arrF[i].AssignPoints({ arrPt[i], arrPt[i+1] });
|
||||
arrF[i].AssignPoints({arrPt[i], arrPt[i + 1]});
|
||||
|
||||
arrF[i].AddType(0);
|
||||
}
|
||||
@@ -96,28 +94,28 @@ UNIT_TEST(FeatureMerger_Branches)
|
||||
std::vector<FeatureBuilder> vF;
|
||||
|
||||
vF.push_back(FeatureBuilder());
|
||||
vF.back().AssignPoints({ P(-2, 0), P(-1, 0) });
|
||||
vF.back().AssignPoints({P(-2, 0), P(-1, 0)});
|
||||
|
||||
vF.push_back(FeatureBuilder());
|
||||
vF.back().AssignPoints({ P(-1, 0), P(0, 1) });
|
||||
vF.back().AssignPoints({P(-1, 0), P(0, 1)});
|
||||
|
||||
vF.push_back(FeatureBuilder());
|
||||
vF.back().AssignPoints({ P(-1, 0), P(0, 0) });
|
||||
vF.back().AssignPoints({P(-1, 0), P(0, 0)});
|
||||
|
||||
vF.push_back(FeatureBuilder());
|
||||
vF.back().AssignPoints({ P(-1, 0), P(0, -1) });
|
||||
vF.back().AssignPoints({P(-1, 0), P(0, -1)});
|
||||
|
||||
vF.push_back(FeatureBuilder());
|
||||
vF.back().AssignPoints({ P(0, 1), P(1, 0) });
|
||||
vF.back().AssignPoints({P(0, 1), P(1, 0)});
|
||||
|
||||
vF.push_back(FeatureBuilder());
|
||||
vF.back().AssignPoints({ P(0, 0), P(1, 0) });
|
||||
vF.back().AssignPoints({P(0, 0), P(1, 0)});
|
||||
|
||||
vF.push_back(FeatureBuilder());
|
||||
vF.back().AssignPoints({ P(0, -1), P(1, 0) });
|
||||
vF.back().AssignPoints({P(0, -1), P(1, 0)});
|
||||
|
||||
vF.push_back(FeatureBuilder());
|
||||
vF.back().AssignPoints({ P(1, 0), P(2, 0) });
|
||||
vF.back().AssignPoints({P(1, 0), P(2, 0)});
|
||||
|
||||
FeatureMergeProcessor processor(kPointCoordBits);
|
||||
|
||||
@@ -142,21 +140,21 @@ UNIT_TEST(FeatureMerger_Rounds)
|
||||
std::vector<FeatureBuilder> vF;
|
||||
|
||||
vF.push_back(FeatureBuilder());
|
||||
vF.back().AssignPoints({ P(-10, 0), P(-5, 0) });
|
||||
vF.back().AssignPoints({P(-10, 0), P(-5, 0)});
|
||||
|
||||
// make first round feature
|
||||
vF.push_back(FeatureBuilder());
|
||||
vF.back().AssignPoints({ P(-4, 1), P(-3, 0), P(-4, -1), P(-5, 0), P(-4, 1) });
|
||||
vF.back().AssignPoints({P(-4, 1), P(-3, 0), P(-4, -1), P(-5, 0), P(-4, 1)});
|
||||
|
||||
vF.push_back(FeatureBuilder());
|
||||
vF.back().AssignPoints({ P(-3, 0), P(3, 0) });
|
||||
vF.back().AssignPoints({P(-3, 0), P(3, 0)});
|
||||
|
||||
// make second round feature
|
||||
vF.push_back(FeatureBuilder());
|
||||
vF.back().AssignPoints({ P(4, -1), P(3, 0), P(4, 1), P(5, 0), P(4, -1) });
|
||||
vF.back().AssignPoints({P(4, -1), P(3, 0), P(4, 1), P(5, 0), P(4, -1)});
|
||||
|
||||
vF.push_back(FeatureBuilder());
|
||||
vF.back().AssignPoints({ P(5, 0), P(10, 0) });
|
||||
vF.back().AssignPoints({P(5, 0), P(10, 0)});
|
||||
|
||||
FeatureMergeProcessor processor(kPointCoordBits);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user