Review fixes

This commit is contained in:
Maksim Andrianov 2019-11-21 17:14:08 +03:00 committed by mpimenov
parent 6844bd758e
commit c52ab9a34e
3 changed files with 8 additions and 10 deletions

View file

@ -88,8 +88,6 @@ bool FeatureBuilder::IsGeometryClosed() const
m2::PointD FeatureBuilder::GetGeometryCenter() const
{
//TODO(vng): Check requirements in this assert
//ASSERT ( IsGeometryClosed(), () );
m2::PointD ret(0.0, 0.0);
PointSeq const & poly = GetOuterGeometry();

View file

@ -73,10 +73,11 @@ void TransformToPoint(FeatureBuilder & feature)
void TransformToLine(FeatureBuilder & feature)
{
if (feature.IsArea() || feature.IsLine())
feature.SetLinear(feature.GetParams().m_reverseGeometry);
else
CHECK(false, (feature));
if (feature.IsLine())
return;
CHECK(feature.IsArea(), (feature));
feature.SetLinear(feature.GetParams().m_reverseGeometry);
}
FeatureBuilder MakePoint(FeatureBuilder const & feature)

View file

@ -222,10 +222,7 @@ bool FeatureParamsBase::operator == (FeatureParamsBase const & rhs) const
bool FeatureParamsBase::IsValid() const
{
if (layer <= LAYER_LOW || layer >= LAYER_HIGH)
return false;
return true;
return layer > LAYER_LOW && layer < LAYER_HIGH;
}
string FeatureParamsBase::DebugString() const
@ -399,6 +396,7 @@ void FeatureParams::SetGeomTypePointEx()
feature::GeomType FeatureParams::GetGeomType() const
{
CHECK(IsValid(), ());
switch (m_geomType)
{
case HeaderGeomType::Line: return GeomType::Line;
@ -409,6 +407,7 @@ feature::GeomType FeatureParams::GetGeomType() const
HeaderGeomType FeatureParams::GetHeaderGeomType() const
{
CHECK(IsValid(), ());
return m_geomType;
}