Search in sources :

Example 76 with Station

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);
    }
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Leg(org.hwyl.sexytopo.model.survey.Leg)

Example 77 with Station

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;
}
Also used : Space(org.hwyl.sexytopo.model.graph.Space) Station(org.hwyl.sexytopo.model.survey.Station) Line(org.hwyl.sexytopo.model.graph.Line) Coord2D(org.hwyl.sexytopo.model.graph.Coord2D) Leg(org.hwyl.sexytopo.model.survey.Leg)

Example 78 with Station

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;
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) HashSet(java.util.HashSet)

Example 79 with Station

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);
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg) Test(org.junit.Test)

Example 80 with Station

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);
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Survey(org.hwyl.sexytopo.model.survey.Survey) Test(org.junit.Test)

Aggregations

Station (org.hwyl.sexytopo.model.survey.Station)85 Leg (org.hwyl.sexytopo.model.survey.Leg)32 Survey (org.hwyl.sexytopo.model.survey.Survey)30 Coord2D (org.hwyl.sexytopo.model.graph.Coord2D)20 Test (org.junit.Test)19 ArrayList (java.util.ArrayList)9 HashMap (java.util.HashMap)9 SuppressLint (android.annotation.SuppressLint)8 AlertDialog (android.app.AlertDialog)8 JSONException (org.json.JSONException)7 Line (org.hwyl.sexytopo.model.graph.Line)6 SurveyConnection (org.hwyl.sexytopo.model.survey.SurveyConnection)6 JSONObject (org.json.JSONObject)6 View (android.view.View)5 Set (java.util.Set)5 Direction (org.hwyl.sexytopo.model.graph.Direction)5 Space (org.hwyl.sexytopo.model.graph.Space)5 JSONArray (org.json.JSONArray)5 Context (android.content.Context)4 HashSet (java.util.HashSet)4