Commit 63e4e954 authored by Ulrich Kemloh's avatar Ulrich Kemloh

More tests for geoemtry, loose walls

parent 5277cfbf
......@@ -158,7 +158,7 @@ void TrajectoriesJPSV04::WriteGeometry(Building* building)
// first the rooms
//to avoid writing navigation line twice
vector<int> navLineWritten;
//rooms_to_plot.push_back("Verteilerebene_001");
rooms_to_plot.push_back("U9");
for (const auto& it:building->GetAllRooms())
{
......@@ -168,7 +168,7 @@ void TrajectoriesJPSV04::WriteGeometry(Building* building)
continue;
for (int k = 0; k < r->GetNumberOfSubRooms(); k++) {
SubRoom* s = r->GetSubRoom(k); //if(s->GetSubRoomID()!=25) continue;
SubRoom* s = r->GetSubRoom(k); //if(s->GetSubRoomID()!=7) continue;
geometry.append(s->WriteSubRoom());
// the hlines
......
......@@ -51,15 +51,15 @@
using namespace std;
Building::Building()
{
_caption = "no_caption";
_projectFilename = "";
_geometryFilename= "";
_routingEngine = nullptr;
_linkedCellGrid = nullptr;
_savePathway = false;
}
//Building::Building()
//{
// _caption = "no_caption";
// _projectFilename = "";
// _geometryFilename= "";
// _routingEngine = nullptr;
// _linkedCellGrid = nullptr;
// _savePathway = false;
//}
#ifdef _SIMULATOR
Building::Building(const std::string& filename, const std::string& rootDir, RoutingEngine& engine, PedDistributor& distributor, double linkedCellSize)
......
......@@ -73,7 +73,7 @@ private:
public:
/// constructor
Building();
//Building();
Building(const std::string&, const std::string&, RoutingEngine&, PedDistributor&, double);
/// destructor
virtual ~Building();
......
......@@ -237,21 +237,23 @@ Point Line::ShortestPoint(const Point &p) const {
* algorithm from:
* http://stackoverflow.com/questions/328107/how-can-you-determine-a-point-is-between-two-other-points-on-a-line-segment
*
* TODO: Failing with test ( 30.1379 : 124.485 )--( 41.4647 : 124.485 ) and ( 38.4046 : 104.715 )--( 33.7146 : 104.715 )
* TODO: FIXME Failing with test ( 30.1379 : 124.485 )--( 41.4647 : 124.485 ) and ( 38.4046 : 104.715 )--( 33.7146 : 104.715 )
* */
bool Line::IsInLineSegment(const Point &p) const {
Point differenceTwoAndOne = _point2 - _point1;
Point differencePAndOne = p - _point1;
// cross product to check if point i colinear
if ((differenceTwoAndOne).CrossProduct(differencePAndOne) > J_EPS)
return false;
// dotproduct and distSquared to check if point is in segment and not just in line
double dotp = differencePAndOne.ScalarProduct(differenceTwoAndOne);
return !(dotp < 0 || (differenceTwoAndOne).NormSquare() < dotp);
//return fabs( (_point1-p ).Norm() + (_point2-p ).Norm() - (_point2-_point1 ).Norm() )<J_EPS;
bool Line::IsInLineSegment(const Point &p) const
{
/*
Point differenceTwoAndOne = _point2 - _point1;
Point differencePAndOne = p - _point1;
// cross product to check if point i colinear
if ((differenceTwoAndOne).CrossProduct(differencePAndOne) > J_EPS)
return false;
// dotproduct and distSquared to check if point is in segment and not just in line
double dotp = differencePAndOne.ScalarProduct(differenceTwoAndOne);
return !(dotp < 0 || (differenceTwoAndOne).NormSquare() < dotp);
*/
return fabs( (_point1-p ).Norm() + (_point2-p ).Norm() - (_point2-_point1 ).Norm() )<J_EPS;
}
/* Berechnet direkt den Abstand von p zum Segment l
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment