Examples of ICircleArc


Examples of net.sf.latexdraw.glib.models.interfaces.shape.ICircleArc

    assertTrue(PSTParser.errorLogs().isEmpty());
  }

  @Test
  public void testAngle1() throws ParseException {
    ICircleArc arc =  (ICircleArc)parser.parsePSTCode("\\"+getCommandName()+"{10}{10}{20}").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(Math.toRadians(10.), arc.getAngleStart(), 0.0000001);
    assertTrue(PSTParser.errorLogs().isEmpty());
    arc =  (ICircleArc)parser.parsePSTCode("\\"+getCommandName()+"{10}{-10.12}{20}").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(Math.toRadians(-10.12), arc.getAngleStart(), 0.0000001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.ICircleArc

  }


  @Test
  public void testMissingOrigin() throws ParseException {
    ICircleArc arc =  (ICircleArc)parser.parsePSTCode("\\"+getCommandName()+"{10}{10}{20}").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(-10.*IShape.PPC, arc.getPosition().getX(), 0.0000001);
    assertEquals(-10.*IShape.PPC*-1., arc.getPosition().getY(), 0.0000001);
    assertEquals(10.*IShape.PPC*2., arc.getWidth(), 0.0000001);
    assertEquals(10.*IShape.PPC*2., arc.getHeight(), 0.0000001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.ICircleArc

  }


  @Test
  public void testCoordinatesPt() throws ParseException {
    ICircleArc arc =  (ICircleArc)parser.parsePSTCode("\\"+getCommandName()+"(35pt,20pt){10pt}{10}{20}").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(35.*IShape.PPC/PSTricksConstants.CM_VAL_PT-10.*IShape.PPC/PSTricksConstants.CM_VAL_PT, arc.getPosition().getX(), 0.0000001);
    assertEquals((20.*IShape.PPC/PSTricksConstants.CM_VAL_PT-10.*IShape.PPC/PSTricksConstants.CM_VAL_PT)*-1., arc.getPosition().getY(), 0.0000001);
    assertEquals(10.*IShape.PPC/PSTricksConstants.CM_VAL_PT*2., arc.getWidth(), 0.0000001);
    assertEquals(10.*IShape.PPC/PSTricksConstants.CM_VAL_PT*2., arc.getHeight(), 0.0000001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.ICircleArc

  }


  @Test
  public void testCoordinatesMm() throws ParseException {
    ICircleArc arc =  (ICircleArc)parser.parsePSTCode("\\"+getCommandName()+"(350mm,200mm){10mm}{10}{20}").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(35.*IShape.PPC-1.*IShape.PPC, arc.getPosition().getX(), 0.0000001);
    assertEquals((20.*IShape.PPC-1.*IShape.PPC)*-1., arc.getPosition().getY(), 0.0000001);
    assertEquals(1.*IShape.PPC*2., arc.getWidth(), 0.0000001);
    assertEquals(1.*IShape.PPC*2., arc.getHeight(), 0.0000001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.ICircleArc

  }


  @Test
  public void testCoordinatesInch() throws ParseException {
    ICircleArc arc =  (ICircleArc)parser.parsePSTCode("\\"+getCommandName()+"(35in,20in){1.2in}{10}{20}").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(35.*IShape.PPC/2.54-1.2*IShape.PPC/2.54, arc.getPosition().getX(), 0.0000001);
    assertEquals((20.*IShape.PPC/2.54-1.2*IShape.PPC/2.54)*-1., arc.getPosition().getY(), 0.0000001);
    assertEquals(1.2*IShape.PPC/2.54*2., arc.getWidth(), 0.0000001);
    assertEquals(1.2*IShape.PPC/2.54*2., arc.getHeight(), 0.0000001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.ICircleArc

  }


  @Test
  public void testCoordinatesCm() throws ParseException {
    ICircleArc arc =  (ICircleArc)parser.parsePSTCode("\\"+getCommandName()+"(35cm,20cm){.5cm}{10}{20}").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(35.*IShape.PPC-.5*IShape.PPC, arc.getPosition().getX(), 0.001);
    assertEquals((20.*IShape.PPC-.5*IShape.PPC)*-1., arc.getPosition().getY(), 0.001);
    assertEquals(.5*IShape.PPC*2., arc.getWidth(), 0.0000001);
    assertEquals(.5*IShape.PPC*2., arc.getHeight(), 0.0000001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.ICircleArc

  }


  @Test
  public void testCoordinatesRadius() throws ParseException {
    ICircleArc arc =  (ICircleArc)parser.parsePSTCode("\\"+getCommandName()+"(35,20){10}{10}{20}").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(35.*IShape.PPC-10.*IShape.PPC, arc.getPosition().getX(), 0.0000001);
    assertEquals((20.*IShape.PPC-10.*IShape.PPC)*-1., arc.getPosition().getY(), 0.0000001);
    assertEquals(10.*IShape.PPC*2., arc.getWidth(), 0.0000001);
    assertEquals(10.*IShape.PPC*2., arc.getHeight(), 0.0000001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.ICircleArc

  }


  @Test
  public void testFloatSigns() throws ParseException {
    ICircleArc arc =  (ICircleArc)parser.parsePSTCode("\\"+getCommandName()+"(+++35.5,--50.5){--+12}{10}{20}").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(35.5*IShape.PPC-12.*IShape.PPC, arc.getPosition().getX(), 0.001);
    assertEquals((50.5*IShape.PPC-12.*IShape.PPC)*-1., arc.getPosition().getY(), 0.001);
    assertEquals(12.*IShape.PPC*2., arc.getWidth(), 0.0000001);
    assertEquals(12.*IShape.PPC*2., arc.getHeight(), 0.0000001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.ICircleArc



  @Test
  public void testNegativeRadius() throws ParseException {
    ICircleArc arc =  (ICircleArc)parser.parsePSTCode("\\"+getCommandName()+"(0,0){-1}{10}{20}").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertTrue(arc.getWidth()>0);
    assertTrue(arc.getHeight()>0);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.ICircleArc

  }


  @Test
  public void test2CoordinatesFloat2() throws ParseException {
    ICircleArc arc =  (ICircleArc)parser.parsePSTCode("\\"+getCommandName()+"(35.5,50.5){1.25}{10}{20}").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(35.5*IShape.PPC-1.25*IShape.PPC, arc.getPosition().getX(), 0.001);
    assertEquals((50.5*IShape.PPC-1.25*IShape.PPC)*-1., arc.getPosition().getY(), 0.001);
    assertEquals(1.25*IShape.PPC*2., arc.getWidth(), 0.0000001);
    assertEquals(1.25*IShape.PPC*2., arc.getHeight(), 0.0000001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.