use of org.hwyl.sexytopo.model.survey.Station in project sexytopo by richsmith.
the class TherionImporterTest method testElevationDirectionExtraction.
@Test
public void testElevationDirectionExtraction() throws Exception {
Survey survey = new Survey("Test");
TherionImporter.updateCentreline(LINES, survey);
Station stationTwo = survey.getStationByName("2");
Direction stationTwoDirection = stationTwo.getExtendedElevationDirection();
Assert.assertEquals(Direction.LEFT, stationTwoDirection);
Station stationThree = survey.getStationByName("3");
Direction stationThreeDirection = stationThree.getExtendedElevationDirection();
Assert.assertEquals(Direction.LEFT, stationThreeDirection);
Station stationFive = survey.getStationByName("5");
Direction stationFiveDirection = stationFive.getExtendedElevationDirection();
Assert.assertEquals(Direction.RIGHT, stationFiveDirection);
}
use of org.hwyl.sexytopo.model.survey.Station in project sexytopo by richsmith.
the class ExtendedElevationProjectionTest method testProject1MNorth1MEast.
@Test
public void testProject1MNorth1MEast() {
Survey survey = BasicTestSurveyCreator.create5MEast();
Space<Coord2D> space = Projection2D.EXTENDED_ELEVATION.project(survey);
Map<Station, Coord2D> stationMap = space.getStationMap();
Map<Leg, Line<Coord2D>> legMap = space.getLegMap();
Station two = survey.getStationByName("2");
Coord2D twoCoord = stationMap.get(two);
Coord2D expected = new Coord2D(5, 0);
Assert.assertEquals(expected, twoCoord);
Leg splayLeft = two.getUnconnectedOnwardLegs().get(0);
Line<Coord2D> splayLeftLine = legMap.get(splayLeft);
expected = new Coord2D(5, 0);
assert splayLeftLine != null;
Assert.assertEquals(expected, splayLeftLine.getEnd());
Leg splayRight = two.getUnconnectedOnwardLegs().get(1);
Line<Coord2D> splayRightLine = legMap.get(splayRight);
expected = new Coord2D(5, 0);
assert splayRightLine != null;
Assert.assertEquals(expected, splayRightLine.getEnd());
}
use of org.hwyl.sexytopo.model.survey.Station in project sexytopo by richsmith.
the class ExtendedElevationProjectionTest method testProject5MNorthReversed.
@Test
public void testProject5MNorthReversed() {
Survey survey = BasicTestSurveyCreator.createStraightNorth();
survey.getStationByName("2").switchDirection();
Space<Coord2D> space = Projection2D.EXTENDED_ELEVATION.project(survey);
Map<Station, Coord2D> stationMap = space.getStationMap();
Station two = survey.getStationByName("2");
Coord2D twoCoord = stationMap.get(two);
Coord2D expected = new Coord2D(-5, 0);
Assert.assertEquals(expected, twoCoord);
}
use of org.hwyl.sexytopo.model.survey.Station in project sexytopo by richsmith.
the class ExtendedElevationProjectionTest method testProject5MDown.
@Test
public void testProject5MDown() {
Survey survey = BasicTestSurveyCreator.create5MDown();
Space<Coord2D> space = Projection2D.EXTENDED_ELEVATION.project(survey);
Map<Station, Coord2D> stationMap = space.getStationMap();
Station two = survey.getStationByName("2");
Coord2D twoCoord = stationMap.get(two);
Coord2D expected = new Coord2D(0, 5);
Assert.assertEquals(expected, twoCoord);
}
use of org.hwyl.sexytopo.model.survey.Station in project sexytopo by richsmith.
the class ExtendedElevationProjectionTest method testProject5MNorth.
@Test
public void testProject5MNorth() {
Survey survey = BasicTestSurveyCreator.createStraightNorth();
Space<Coord2D> space = Projection2D.EXTENDED_ELEVATION.project(survey);
Map<Station, Coord2D> stationMap = space.getStationMap();
Station two = survey.getStationByName("2");
Coord2D twoCoord = stationMap.get(two);
Coord2D expected = new Coord2D(5, 0);
Assert.assertEquals(expected, twoCoord);
}
Aggregations