use of net.sf.latexdraw.models.interfaces.shape.ITriangle in project latexdraw by arnobl.
the class TestParsingPstriangle method testHeightNegative.
@Test
public void testHeightNegative() {
parser("\\pstriangle(35,-10)");
ITriangle tri = getShapeAt(0);
assertEquals(10d * IShape.PPC, tri.getHeight(), 0.001);
assertEquals(Math.PI, tri.getRotationAngle(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.ITriangle in project latexdraw by arnobl.
the class TestParsingPstriangle method testParse2CoordinatesFloat2.
@Test
public void testParse2CoordinatesFloat2() {
parser("\\pstriangle(0.5,.5)(35.5,50.5)");
ITriangle tri = getShapeAt(0);
assertEquals(0.5 * IShape.PPC - 35.5 / 2d * IShape.PPC, tri.getPosition().getX(), 0.001);
assertEquals(0.5 * -IShape.PPC, tri.getPosition().getY(), 0.001);
assertEquals(35.5 * IShape.PPC, tri.getWidth(), 0.001);
assertEquals(50.5 * IShape.PPC, tri.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.ITriangle in project latexdraw by arnobl.
the class TestParsingPstriangle method testCoordinatesMm.
@Test
public void testCoordinatesMm() {
parser("\\pstriangle(0,0)(350mm,200mm)");
ITriangle tri = getShapeAt(0);
assertEquals(-35d / 2d * IShape.PPC, tri.getPosition().getX(), 0.001);
assertEquals(0d, tri.getPosition().getY(), 0.001);
assertEquals(35d * IShape.PPC, tri.getWidth(), 0.001);
assertEquals(20d * IShape.PPC, tri.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.ITriangle in project latexdraw by arnobl.
the class TestParsingPstriangle method testParse2CoordinatesTwoLastMissing.
@Test
public void testParse2CoordinatesTwoLastMissing() {
parser("\\pstriangle(0,0)(,)");
ITriangle tri = getShapeAt(0);
assertEquals(-IShape.PPC / 2d, tri.getPosition().getX(), 0.001);
assertEquals(0d, tri.getPosition().getY(), 0.001);
assertEquals(IShape.PPC, tri.getWidth(), 0.001);
assertEquals(IShape.PPC, tri.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.ITriangle in project latexdraw by arnobl.
the class TestITriangle method testConstructor1.
@Test
public void testConstructor1() {
final ITriangle shape = ShapeFactory.INST.createTriangle();
assertEqualsDouble(1d, shape.getWidth());
assertEqualsDouble(1d, shape.getHeight());
assertEqualsDouble(0d, shape.getPosition().getX());
assertEqualsDouble(1d, shape.getPosition().getY());
}
Aggregations