Search in sources :

Example 21 with Leg

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

the class BasicTestSurveyCreator method createStraightSouth.

public static Survey createStraightSouth() {
    Survey survey = new Survey("Test Straight Survey South");
    Leg leg0 = new Leg(5, 180, 0);
    SurveyUpdater.updateWithNewStation(survey, leg0);
    Leg leg1 = new Leg(5, 180, 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 22 with Leg

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

the class Space3DUtilsTest method testTransform1MNorth.

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

Example 23 with Leg

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

the class Space3DUtilsTest method testTransform10mNEUAndBack.

@Test
public void testTransform10mNEUAndBack() {
    Leg northEastAndUp10M = new Leg(10, 45, 45);
    Coord3D result = Space3DUtils.toCartesian(Coord3D.ORIGIN, northEastAndUp10M);
    Leg reverse = new Leg(10, 225, -45);
    result = Space3DUtils.toCartesian(result, reverse);
    assertEquals(Coord3D.ORIGIN, result);
}
Also used : Coord3D(org.hwyl.sexytopo.model.graph.Coord3D) Leg(org.hwyl.sexytopo.model.survey.Leg) Test(org.junit.Test)

Example 24 with Leg

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

the class Space3DUtilsTest method testTransform1MEast.

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

Example 25 with Leg

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

the class StationRenameTest method testAverageLegs.

@Test
public void testAverageLegs() {
    Leg leg1 = new Leg(10, 359, -1);
    Leg leg2 = new Leg(20, 1, +1);
    List<Leg> legs = new ArrayList<>(2);
    legs.add(leg1);
    legs.add(leg2);
    Leg avgLeg = SurveyUpdater.averageLegs(legs);
    Assert.assertEquals("Dist", 15.0, avgLeg.getDistance(), SexyTopo.ALLOWED_DOUBLE_DELTA);
    Assert.assertEquals("Azm", 0.0, avgLeg.getAzimuth(), SexyTopo.ALLOWED_DOUBLE_DELTA);
    Assert.assertEquals("Inc", 0.0, avgLeg.getInclination(), SexyTopo.ALLOWED_DOUBLE_DELTA);
}
Also used : ArrayList(java.util.ArrayList) 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