Made FeatureParams::GetTypeMask private.

This commit is contained in:
vng 2014-09-03 12:40:06 +03:00 committed by Alex Zolotarev
parent dcccd9de97
commit f0a748ebb6
3 changed files with 13 additions and 12 deletions

View file

@ -528,15 +528,15 @@ void FeatureBuilder2::Serialize(buffers_holder_t & data, serial::CodingParams co
BitSink< PushBackByteSink<buffer_t> > bitSink(sink);
uint8_t const h = m_params.GetTypeMask();
EGeomType const type = m_params.GetGeomType();
if (h == HEADER_GEOM_LINE)
if (type == GEOM_LINE)
{
bitSink.Write(ptsCount, 4);
if (ptsCount == 0)
bitSink.Write(data.m_ptsMask, 4);
}
else if (h == HEADER_GEOM_AREA)
else if (type == GEOM_AREA)
{
bitSink.Write(trgCount, 4);
if (trgCount == 0)
@ -545,7 +545,7 @@ void FeatureBuilder2::Serialize(buffers_holder_t & data, serial::CodingParams co
bitSink.Finish();
if (h == HEADER_GEOM_LINE)
if (type == GEOM_LINE)
{
if (ptsCount > 0)
{
@ -574,7 +574,7 @@ void FeatureBuilder2::Serialize(buffers_holder_t & data, serial::CodingParams co
serial::WriteVarUintArray(data.m_ptsOffset, sink);
}
}
else if (h == HEADER_GEOM_AREA)
else if (type == GEOM_AREA)
{
if (trgCount > 0)
serial::SaveInnerTriangles(data.m_innerTrg, params, sink);

View file

@ -30,8 +30,8 @@ public:
void AddPoint(m2::PointD const & p);
/// Set that feature is linear type.
void SetLinear() { m_params.SetGeomType(feature::GEOM_LINE); }
void SetArea() { m_params.SetGeomType(feature::GEOM_AREA); }
inline void SetLinear() { m_params.SetGeomType(feature::GEOM_LINE); }
inline void SetArea() { m_params.SetGeomType(feature::GEOM_AREA); }
/// Set that feature is area and get ownership of holes.
void SetAreaAddHoles(list<vector<m2::PointD> > const & holes);
@ -218,12 +218,12 @@ public:
buffers_holder_t() : m_ptsMask(0), m_trgMask(0), m_ptsSimpMask(0) {}
};
bool IsLine() const { return (m_params.GetTypeMask() == feature::HEADER_GEOM_LINE); }
bool IsArea() const { return (m_params.GetTypeMask() == feature::HEADER_GEOM_AREA); }
inline bool IsLine() const { return (GetGeomType() == feature::GEOM_LINE); }
inline bool IsArea() const { return (GetGeomType() == feature::GEOM_AREA); }
bool IsDrawableInRange(int lowS, int highS) const;
points_t const & GetOuterPoly() const { return GetGeometry(); }
list<points_t> const & GetPolygons() const { return m_polygons; }
inline points_t const & GetOuterPoly() const { return GetGeometry(); }
inline list<points_t> const & GetPolygons() const { return m_polygons; }
/// @name Overwrite from base_type.
//@{

View file

@ -244,7 +244,6 @@ public:
void SetGeomType(feature::EGeomType t);
void SetGeomTypePointEx();
feature::EGeomType GetGeomType() const;
uint8_t GetTypeMask() const;
inline void AddType(uint32_t t) { m_Types.push_back(t); }
@ -297,6 +296,8 @@ public:
}
private:
uint8_t GetTypeMask() const;
static uint32_t GetIndexForType(uint32_t t);
static uint32_t GetTypeForIndex(uint32_t i);
};