use of org.hwyl.sexytopo.model.survey.Station in project sexytopo by richsmith.
the class SurveyUpdater method setDirectionOfSubtree.
public static void setDirectionOfSubtree(Station station, Direction direction) {
station.setExtendedElevationDirection(direction);
for (Leg leg : station.getConnectedOnwardLegs()) {
Station destination = leg.getDestination();
setDirectionOfSubtree(destination, direction);
}
}
use of org.hwyl.sexytopo.model.survey.Station in project sexytopo by richsmith.
the class Space2DUtils method transform.
@SuppressWarnings("ConstantConditions")
public static Space<Coord2D> transform(Space<Coord2D> space, Coord2D point) {
Space<Coord2D> newSpace = new Space<>();
Map<Station, Coord2D> stations = space.getStationMap();
for (Station station : stations.keySet()) {
Coord2D coord = stations.get(station);
Coord2D newCoord = coord.plus(point);
newSpace.addStation(station, newCoord);
}
Map<Leg, Line<Coord2D>> legs = space.getLegMap();
for (Leg leg : legs.keySet()) {
Line<Coord2D> line = legs.get(leg);
Line<Coord2D> newLine = transformLine(line, point);
newSpace.addLeg(leg, newLine);
}
return newSpace;
}
use of org.hwyl.sexytopo.model.survey.Station in project sexytopo by richsmith.
the class StationNamer method getAllStationNames.
public static Set<String> getAllStationNames(Survey survey) {
List<Station> stations = survey.getAllStations();
Set<String> allNames = new HashSet<>();
for (Station station : stations) {
allNames.add(station.getName());
}
return allNames;
}
use of org.hwyl.sexytopo.model.survey.Station in project sexytopo by richsmith.
the class LrudTest method testStraightNorthCrossSectionRightSplay.
@Test
public void testStraightNorthCrossSectionRightSplay() {
Survey testSurvey = BasicTestSurveyCreator.createStraightNorth();
Station s2 = testSurvey.getStationByName("2");
double angle = CrossSectioner.getAngleOfSection(testSurvey, s2);
Leg splay = LRUD.RIGHT.createSplay(testSurvey, s2, 5);
Assert.assertEquals(90.0, splay.getAzimuth(), SexyTopo.ALLOWED_DOUBLE_DELTA);
}
use of org.hwyl.sexytopo.model.survey.Station in project sexytopo by richsmith.
the class CrossSectionerTest method testStraightSouthCrossSection.
@Test
public void testStraightSouthCrossSection() {
Survey testSurvey = BasicTestSurveyCreator.createStraightSouth();
Station s2 = testSurvey.getStationByName("2");
double angle = CrossSectioner.getAngleOfSection(testSurvey, s2);
Assert.assertEquals(180.0, angle, SexyTopo.ALLOWED_DOUBLE_DELTA);
}
Aggregations