Search in sources :

Example 81 with Leg

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

the class BasicTestSurveyCreator method create5MDown.

public static Survey create5MDown() {
    Survey survey = new Survey("Test Survey 1m Down");
    Leg leg0 = new Leg(5, 0, -90);
    SurveyUpdater.updateWithNewStation(survey, leg0);
    return survey;
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg)

Example 82 with Leg

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

the class BasicTestSurveyCreator method create5MEast.

public static Survey create5MEast() {
    Survey survey = new Survey("Test Survey 5m east");
    Leg leg0 = new Leg(5, 90, 0);
    SurveyUpdater.updateWithNewStation(survey, leg0);
    Leg splay0Left = new Leg(1, 0, 0);
    SurveyUpdater.update(survey, splay0Left);
    Leg splay0Right = new Leg(1, 180, 0);
    SurveyUpdater.update(survey, splay0Right);
    return survey;
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg)

Example 83 with Leg

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

the class BasicTestSurveyCreator method createStraightNorthWith2EBranchFromS2.

public static Survey createStraightNorthWith2EBranchFromS2() {
    Survey survey = new Survey("Test Straight Survey North With 2E Branch");
    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);
    survey.setActiveStation(survey.getStationByName("2"));
    Leg legBranch = new Leg(5, 90, 0);
    SurveyUpdater.updateWithNewStation(survey, legBranch);
    Leg legBranch2 = new Leg(5, 90, 0);
    SurveyUpdater.updateWithNewStation(survey, legBranch2);
    return survey;
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg)

Example 84 with Leg

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

the class GraphToListTranslatorTest method testChronoListGeneration.

@Test
public void testChronoListGeneration() {
    GraphToListTranslator translator = new GraphToListTranslator();
    Survey baseSurvey = BasicTestSurveyCreator.createStraightNorth();
    baseSurvey.setActiveStation(baseSurvey.getStationByName("1"));
    SurveyUpdater.updateWithNewStation(baseSurvey, new Leg(5, 270, 0));
    List<GraphToListTranslator.SurveyListEntry> chronoList = translator.toChronoListOfSurveyListEntries(baseSurvey);
    GraphToListTranslator.SurveyListEntry last = chronoList.get(chronoList.size() - 1);
    Assert.assertEquals("5", last.getLeg().getDestination().getName());
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg) Test(org.junit.Test)

Example 85 with Leg

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

the class Space3DUtilsTest method testTransform2MNorth.

@Test
public void testTransform2MNorth() {
    Leg north2MLeg = new Leg(2, 0, 0);
    Coord3D result = Space3DUtils.toCartesian(Coord3D.ORIGIN, north2MLeg);
    Coord3D expected = new Coord3D(0, 2, 0);
    assertEquals(expected, result);
}
Also used : Coord3D(org.hwyl.sexytopo.model.graph.Coord3D) Leg(org.hwyl.sexytopo.model.survey.Leg) Test(org.junit.Test)

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