Search in sources :

Example 16 with Leg

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

Example 17 with Leg

use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.

the class LrudTest method testStraightNorthCrossSectionLeftSplay.

@Test
public void testStraightNorthCrossSectionLeftSplay() {
    Survey testSurvey = BasicTestSurveyCreator.createStraightNorth();
    Station s2 = testSurvey.getStationByName("2");
    double angle = CrossSectioner.getAngleOfSection(testSurvey, s2);
    Leg splay = LRUD.LEFT.createSplay(testSurvey, s2, 5);
    Assert.assertEquals(270.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 18 with Leg

use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.

the class BasicTestSurveyCreator method createRightRight.

public static Survey createRightRight() {
    Survey survey = new Survey("Test n-shaped Survey");
    Leg leg0 = new Leg(5, 0, 0);
    SurveyUpdater.updateWithNewStation(survey, leg0);
    Leg leg1 = new Leg(5, 90, 0);
    SurveyUpdater.updateWithNewStation(survey, leg1);
    Leg leg2 = new Leg(5, 180, 0);
    SurveyUpdater.updateWithNewStation(survey, leg2);
    return survey;
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg)

Example 19 with Leg

use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.

the class BasicTestSurveyCreator method createStraightNorthThroughRepeats.

public static Survey createStraightNorthThroughRepeats() {
    Survey survey = new Survey("Test Straight Survey North");
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            Leg leg = new Leg(5, 0, 0);
            SurveyUpdater.update(survey, leg);
        }
    }
    return survey;
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg)

Example 20 with Leg

use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.

the class BasicTestSurveyCreator method createStraightNorth.

public static Survey createStraightNorth() {
    Survey survey = new Survey("Test Straight Survey North");
    Leg leg0 = new Leg(5, 0, 0);
    SurveyUpdater.updateWithNewStation(survey, leg0);
    Leg leg1 = new Leg(5, 0, 0);
    SurveyUpdater.updateWithNewStation(survey, leg1);
    Leg leg2 = new Leg(5, 0, 0);
    SurveyUpdater.updateWithNewStation(survey, leg2);
    return survey;
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg)

Aggregations

Leg (org.hwyl.sexytopo.model.survey.Leg)94 Station (org.hwyl.sexytopo.model.survey.Station)30 Test (org.junit.Test)30 Survey (org.hwyl.sexytopo.model.survey.Survey)23 Coord3D (org.hwyl.sexytopo.model.graph.Coord3D)17 Line (org.hwyl.sexytopo.model.graph.Line)8 ArrayList (java.util.ArrayList)7 Coord2D (org.hwyl.sexytopo.model.graph.Coord2D)7 JSONArray (org.json.JSONArray)6 JSONObject (org.json.JSONObject)6 Space (org.hwyl.sexytopo.model.graph.Space)4 TextView (android.widget.TextView)3 GraphToListTranslator (org.hwyl.sexytopo.control.util.GraphToListTranslator)3 TableCol (org.hwyl.sexytopo.model.table.TableCol)3 JSONException (org.json.JSONException)3 AlertDialog (android.app.AlertDialog)2 ParseException (java.text.ParseException)2 HashMap (java.util.HashMap)2 LRUD (org.hwyl.sexytopo.model.table.LRUD)2 SuppressLint (android.annotation.SuppressLint)1