Revision 67
trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfEntityMaker.java | ||
---|---|---|
475 | 475 |
|
476 | 476 |
entity.encuentraBloque(blockName); |
477 | 477 |
|
478 |
gestionaInsert(blk, entity, layer); |
|
478 |
//gestionaInsert(blk, entity, layer); |
|
479 |
gestionaInsert(entity, layer); |
|
479 | 480 |
|
480 | 481 |
if (addingToBlock == false) { |
481 | 482 |
//entities.add(entity); |
... | ... | |
555 | 556 |
public DxfEntityList getEntities() { return entities;} |
556 | 557 |
public DxfTable getLayers() { return layers;} |
557 | 558 |
|
558 |
public void gestionaInsert(DxfBlock blk, DxfInsert entity, DxfLayer layer) { |
|
559 |
//public void gestionaInsert(DxfBlock blk, DxfInsert entity, DxfLayer layer) { |
|
560 |
public void gestionaInsert(DxfInsert entity, DxfLayer layer) { |
|
559 | 561 |
DxfEntity dxfEntity = null; |
560 | 562 |
DxfLine dxfLine = null; |
561 | 563 |
DxfInsert dxfInsert = null; |
... | ... | |
580 | 582 |
System.out.println("entity.pt.getX() = " + entity.pt.getX()); |
581 | 583 |
System.out.println("point1.getX() = " + point1.getX()); |
582 | 584 |
System.out.println("entity.rotAngle = " + entity.rotAngle); |
583 |
|
|
584 | 585 |
//x = (c2.getX()*Math.cos(alfa) + c2.getY()*(-1)*Math.sin(alfa)) * scale.getX(); |
585 | 586 |
//y = (c2.getX()*Math.sin(alfa) + c2.getY()*Math.cos(alfa)) * scale.getY(); |
586 |
|
|
587 | 587 |
point11.setLocation(entity.pt.getX() + ((point1.getX()*Math.cos((entity.rotAngle*Math.PI)/180) + point1.getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() + ((point1.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point1.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY())); |
588 | 588 |
//entity.add(point11); |
589 | 589 |
point2 = dxfLine.getPts()[1]; |
590 | 590 |
point22.setLocation(entity.pt.getX() + ((point2.getX()*Math.cos((entity.rotAngle*Math.PI)/180) + point2.getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() + ((point2.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point2.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY())); |
591 | 591 |
//entity.add(point22); |
592 |
|
|
593 | 592 |
DxfLine dxfLinee = new DxfLine(proj, layer, point11, point22); |
594 | 593 |
entities.add(dxfLinee); |
595 | 594 |
/*if (addingToBlock == false) { |
... | ... | |
600 | 599 |
}*/ |
601 | 600 |
} else if (dxfEntity instanceof DxfInsert){ |
602 | 601 |
//Vector points = new Vector(); |
602 |
|
|
603 | 603 |
dxfInsert = (DxfInsert)dxfEntity; |
604 |
String name1 = dxfInsert.blockName; |
|
604 |
point1 = dxfInsert.pt; |
|
605 |
point11.setLocation(entity.pt.getX() + ((point1.getX()*Math.cos((entity.rotAngle*Math.PI)/180) + point1.getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() + ((point1.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point1.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY())); |
|
606 |
DxfInsert dxfInsertt = new DxfInsert(proj, layer); |
|
607 |
dxfInsertt.pt = point11; |
|
608 |
dxfInsertt.blkList = dxfInsert.blkList; |
|
609 |
dxfInsertt.block = dxfInsert.block; |
|
610 |
dxfInsertt.blockName = dxfInsert.blockName; |
|
611 |
dxfInsertt.layer = dxfInsert.layer; |
|
612 |
dxfInsertt.proj = dxfInsert.proj; |
|
613 |
dxfInsertt.rotAngle = dxfInsert.rotAngle; // * entity.rotAngle; |
|
614 |
//System.out.println("dxfInsertt.scaleFactor = " + dxfInsertt.scaleFactor); |
|
615 |
//System.out.println("dxfInsert.scaleFactor.getX() = " + dxfInsert.scaleFactor.getX()); |
|
616 |
//System.out.println("entity.scaleFactor.getX() = " + entity.scaleFactor.getX()); |
|
617 |
dxfInsertt.scaleFactor = new Point2D.Double(dxfInsert.scaleFactor.getX() * entity.scaleFactor.getX(), dxfInsert.scaleFactor.getY() * entity.scaleFactor.getY()); |
|
618 |
//dxfInsertt.scaleFactor.setLocation(dxfInsert.scaleFactor.getX() * entity.scaleFactor.getX(), dxfInsert.scaleFactor.getY() * entity.scaleFactor.getY()); |
|
619 |
|
|
620 |
/*String name1 = dxfInsert.blockName; |
|
605 | 621 |
System.out.println("INSERTS: name1 = " + name1); |
606 | 622 |
point1 = dxfInsert.pt; |
607 | 623 |
point11.setLocation(entity.pt.getX() + point1.getX(), entity.pt.getY() + point1.getY()); |
... | ... | |
616 | 632 |
scale11.setLocation(entity.scaleFactor.getX() * scale1.getX(), entity.scaleFactor.getY() * scale1.getY()); |
617 | 633 |
//dxfInsert.scaleFactor = scale11; |
618 | 634 |
System.out.println("INSERTS: scale1 = " + scale1); |
619 |
System.out.println("INSERTS: scale11 = " + scale11); |
|
620 |
DxfBlock bl = new DxfBlock(proj); |
|
635 |
System.out.println("INSERTS: scale11 = " + scale11);*/
|
|
636 |
/*DxfBlock bl = new DxfBlock(proj);
|
|
621 | 637 |
bl = dxfInsert.getDxfBlock(); |
622 | 638 |
String name2 = bl.blkName; |
623 |
System.out.println("INSERTS: name2 = " + name2); |
|
639 |
System.out.println("INSERTS: name2 = " + name2);*/
|
|
624 | 640 |
|
625 | 641 |
/*for (int j=0; j<dxfInsert.pts.size(); j++) { |
626 | 642 |
System.out.println("PILTRAFILLA: dxfInsert.pts.get(j) = " + dxfInsert.pts.get(j)); |
... | ... | |
637 | 653 |
} else { |
638 | 654 |
blk.add(entity); |
639 | 655 |
}*/ |
640 |
gestionaInsert(bl, dxfInsert, layer); |
|
656 |
//gestionaInsert(bl, dxfInsert, layer); |
|
657 |
gestionaInsert(dxfInsertt, layer); |
|
641 | 658 |
} else if (dxfEntity instanceof DxfPolyline) { |
642 | 659 |
dxfPolyline = (DxfPolyline)dxfEntity; |
643 | 660 |
DxfPolyline dxfPolylinee = new DxfPolyline(proj, layer); |
Also available in: Unified diff