Revision 120 trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfEntityMaker.java
DxfEntityMaker.java | ||
---|---|---|
47 | 47 |
public void setAddingToBlock(boolean a) { addingToBlock = a; } |
48 | 48 |
|
49 | 49 |
public void createLayer(DxfGroupVector grp) throws Exception { |
50 |
DxfLayer layer = new DxfLayer(grp.getDataAsString(2), grp.getDataAsInt(62)); |
|
50 |
int color = grp.getDataAsInt(62); |
|
51 |
DxfLayer layer = new DxfLayer(grp.getDataAsString(2), Math.abs(grp.getDataAsInt(62))); |
|
52 |
if (color < 0) { |
|
53 |
layer.isOff = true; |
|
54 |
} |
|
51 | 55 |
layer.lType = grp.getDataAsString(6); |
52 | 56 |
layer.setFlags(grp.getDataAsInt(70)); |
53 | 57 |
// compruebo flags |
... | ... | |
781 | 785 |
if (dxfEntity instanceof DxfLine) { |
782 | 786 |
dxfLine = (DxfLine)dxfEntity; |
783 | 787 |
point1 = dxfLine.getPts()[0]; |
784 |
//System.out.println("entity.pt.getX() = " + entity.pt.getX()); |
|
785 |
//System.out.println("point1.getX() = " + point1.getX()); |
|
786 |
//System.out.println("entity.rotAngle = " + entity.rotAngle); |
|
787 |
//point11.setLocation(entity.pt.getX() - entity.block.bPoint.getX() + ((point1.getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + point1.getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - entity.block.bPoint.getY() + ((point1.getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + point1.getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY())); |
|
788 |
point11.setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().getX()) + ((point1.getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + point1.getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((point1.getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + point1.getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY())); |
|
789 |
//point11.setLocation(entity.pt.getX() + ((point1.getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + point1.getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() + ((point1.getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + point1.getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY())); |
|
788 |
double laX = entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().getX()) + ((point1.getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + point1.getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()); |
|
789 |
double laY = entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((point1.getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + point1.getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()); |
|
790 |
point11.setLocation(laX, laY); |
|
790 | 791 |
point2 = dxfLine.getPts()[1]; |
791 |
//point22.setLocation(entity.pt.getX() - entity.block.bPoint.getX() + ((point2.getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + point2.getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - entity.block.bPoint.getY() + ((point2.getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + point2.getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY())); |
|
792 | 792 |
point22.setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().getX()) + ((point2.getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + point2.getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((point2.getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + point2.getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY())); |
793 |
//point22.setLocation(entity.pt.getX() + ((point2.getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + point2.getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() + ((point2.getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + point2.getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY())); |
|
794 | 793 |
DxfLine dxfLinee = new DxfLine(proj, layer, point11, point22); |
795 | 794 |
if (addingToBlock == false) { |
796 | 795 |
entities.add(dxfLinee); |
Also available in: Unified diff