Search in sources :

Example 6 with IArc

use of net.sf.latexdraw.models.interfaces.shape.IArc in project latexdraw by arnobl.

the class TestParsingPswedge method testCoordinatesPt.

@Theory
public void testCoordinatesPt(final String cmd) {
    parser(cmd + "(35pt,20pt){10pt}{10}{20}");
    IArc arc = getShapeAt(0);
    assertEquals(35d * IShape.PPC / PSTricksConstants.CM_VAL_PT - 10d * IShape.PPC / PSTricksConstants.CM_VAL_PT, arc.getPosition().getX(), 0.0000001);
    assertEquals((20d * IShape.PPC / PSTricksConstants.CM_VAL_PT - 10d * IShape.PPC / PSTricksConstants.CM_VAL_PT) * -1d, arc.getPosition().getY(), 0.0000001);
    assertEquals(10d * IShape.PPC / PSTricksConstants.CM_VAL_PT * 2d, arc.getWidth(), 0.0000001);
    assertEquals(10d * IShape.PPC / PSTricksConstants.CM_VAL_PT * 2d, arc.getHeight(), 0.0000001);
}
Also used : IArc(net.sf.latexdraw.models.interfaces.shape.IArc) Theory(org.junit.experimental.theories.Theory)

Example 7 with IArc

use of net.sf.latexdraw.models.interfaces.shape.IArc in project latexdraw by arnobl.

the class TestParsingPswedge method testNegativeRadius.

@Theory
public void testNegativeRadius(final String cmd) {
    parser(cmd + "(0,0){-1}{10}{20}");
    IArc arc = getShapeAt(0);
    assertThat(arc.getWidth(), greaterThan(0d));
    assertThat(arc.getHeight(), greaterThan(0d));
}
Also used : IArc(net.sf.latexdraw.models.interfaces.shape.IArc) Theory(org.junit.experimental.theories.Theory)

Example 8 with IArc

use of net.sf.latexdraw.models.interfaces.shape.IArc in project latexdraw by arnobl.

the class TestSVGArc method testStartAngle.

@Theory
public void testStartAngle(@ArcData(withParamVariants = true) final IArc sh) {
    final IArc s2 = produceOutputShapeFrom(sh);
    CompareShapeMatcher.INST.assertEqualsArc(sh, s2);
}
Also used : IArc(net.sf.latexdraw.models.interfaces.shape.IArc) Theory(org.junit.experimental.theories.Theory)

Example 9 with IArc

use of net.sf.latexdraw.models.interfaces.shape.IArc in project latexdraw by arnobl.

the class TestParsingPswedge method testCoordinatesInch.

@Theory
public void testCoordinatesInch(final String cmd) {
    parser(cmd + "(35in,20in){1.2in}{10}{20}");
    IArc arc = getShapeAt(0);
    assertEquals(35d * IShape.PPC / 2.54 - 1.2 * IShape.PPC / 2.54, arc.getPosition().getX(), 0.0000001);
    assertEquals((20d * IShape.PPC / 2.54 - 1.2 * IShape.PPC / 2.54) * -1d, arc.getPosition().getY(), 0.0000001);
    assertEquals(1.2 * IShape.PPC / 2.54 * 2d, arc.getWidth(), 0.0000001);
    assertEquals(1.2 * IShape.PPC / 2.54 * 2d, arc.getHeight(), 0.0000001);
}
Also used : IArc(net.sf.latexdraw.models.interfaces.shape.IArc) Theory(org.junit.experimental.theories.Theory)

Example 10 with IArc

use of net.sf.latexdraw.models.interfaces.shape.IArc in project latexdraw by arnobl.

the class TestParsingPswedge method testCoordinatesMm.

@Theory
public void testCoordinatesMm(final String cmd) {
    parser(cmd + "(350mm,200mm){10mm}{10}{20}");
    IArc arc = getShapeAt(0);
    assertEquals(35d * IShape.PPC - 1d * IShape.PPC, arc.getPosition().getX(), 0.0000001);
    assertEquals((20d * IShape.PPC - 1d * IShape.PPC) * -1d, arc.getPosition().getY(), 0.0000001);
    assertEquals(1d * IShape.PPC * 2d, arc.getWidth(), 0.0000001);
    assertEquals(1d * IShape.PPC * 2d, arc.getHeight(), 0.0000001);
}
Also used : IArc(net.sf.latexdraw.models.interfaces.shape.IArc) Theory(org.junit.experimental.theories.Theory)

Aggregations

IArc (net.sf.latexdraw.models.interfaces.shape.IArc)17 Theory (org.junit.experimental.theories.Theory)12 Test (org.junit.Test)4