use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class TestSurveyCreator method createLruds.
public static void createLruds(Survey survey, Station station) {
for (LRUD lrud : LRUD.values()) {
Leg splay = lrud.createSplay(survey, station, 1 + random.nextInt(3));
SurveyUpdater.update(survey, splay);
}
}
use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class GraphToListTranslator method createMap.
public static Map<TableCol, Object> createMap(SurveyListEntry entry) {
Station from = entry.getFrom();
Leg leg = entry.getLeg();
Map<TableCol, Object> map = new HashMap<>();
if (leg.hasDestination() && leg.getDestination().hasComment()) {
map.put(TableCol.COMMENT, leg.getDestination().getComment());
}
if (leg.wasShotBackwards()) {
map.put(TableCol.FROM, leg.getDestination());
map.put(TableCol.TO, from);
leg = leg.asBacksight();
} else {
map.put(TableCol.FROM, from);
map.put(TableCol.TO, leg.getDestination());
}
map.put(TableCol.DISTANCE, leg.getDistance());
map.put(TableCol.AZIMUTH, leg.getAzimuth());
map.put(TableCol.INCLINATION, leg.getInclination());
return map;
}
use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class LegMover method removeDownstreamStations.
private static void removeDownstreamStations(Leg leg, List<Station> stations) {
if (!leg.hasDestination()) {
return;
}
Station station = leg.getDestination();
stations.remove(station);
for (Leg onwardLeg : station.getConnectedOnwardLegs()) {
removeDownstreamStations(onwardLeg, stations);
}
}
use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class SurveyStats method calcLongestLeg.
public static float calcLongestLeg(Survey survey) {
List<Leg> legs = survey.getAllLegs();
if (legs.isEmpty()) {
return 0;
}
float max = 0.0f;
for (Leg leg : legs) {
max = Math.max(leg.getDistance(), max);
}
return max;
}
use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class SurveyUpdater method upgradeSplayToConnectedLeg.
public static void upgradeSplayToConnectedLeg(Survey survey, Leg leg, InputMode inputMode) {
Station newStation = new Station(getNextStationName(survey));
Leg newLeg = Leg.manuallyUpgradeSplayToConnectedLeg(leg, newStation);
if (inputMode == InputMode.BACKWARD) {
newLeg = newLeg.reverse();
}
editLeg(survey, leg, newLeg);
survey.setActiveStation(newStation);
}
Aggregations