Skip to content
Snippets Groups Projects
Commit bb41eedf authored by Tom Fischer's avatar Tom Fischer
Browse files

[GL] Dynamic type checks for classes Station and Borehole.

parent 28685c8f
No related branches found
No related tags found
No related merge requests found
......@@ -75,5 +75,11 @@ Station* Station::createStation(const std::string &name, double x, double y, dou
return station;
}
bool isStation(GeoLib::Point const* pnt)
{
GeoLib::Station const* bh(dynamic_cast<GeoLib::Station const*>(pnt));
return bh != nullptr;
}
} // namespace
......@@ -103,6 +103,7 @@ private:
};
bool isStation(GeoLib::Point const* pnt);
} // namespace
#endif // GEO_STATION_H
......@@ -292,4 +292,12 @@ void StationBorehole::addSoilLayer ( double x, double y, double z, const std::st
_profilePntVec.push_back (new Point (x, y, z));
_soilName.push_back(soil_name);
}
bool isBorehole(GeoLib::Point const* pnt)
{
GeoLib::StationBorehole const* bh(
dynamic_cast<GeoLib::StationBorehole const*>(pnt));
return bh != nullptr;
}
} // namespace
......@@ -116,6 +116,9 @@ private:
/// Contains the points for the lower boundaries of all layers
std::vector<Point*> _profilePntVec;
};
bool isBorehole(GeoLib::Point const* pnt);
} // namespace
#endif // GEO_STATIONBOREHOLE_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment