use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class OldStyleLoaderTest method testStarredLinesAreIgnored.
@Test
public void testStarredLinesAreIgnored() throws Exception {
String text = "*data normal from to length compass clino\n" + "1\t2\t9.11\t121\t-23\n";
Survey survey = new Survey("TestSurvey");
OldStyleLoader.parse(text, survey);
assert survey.getAllStations().size() == 2;
}
use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class OldStyleLoaderTest method testReversedLegIsParsed.
@Test
public void testReversedLegIsParsed() throws Exception {
String text = "2\t1\t9.11\t121\t-23\n";
Survey survey = new Survey("TestSurvey");
OldStyleLoader.parse(text, survey);
assert survey.getAllStations().size() == 2;
assert survey.getOrigin().getConnectedOnwardLegs().get(0).getDestination().getName().equals("2");
assert survey.getOrigin().getConnectedOnwardLegs().get(0).wasShotBackwards();
}
use of org.hwyl.sexytopo.model.survey.Survey 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.Survey 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.Survey 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);
}
Aggregations