Revision 89

View differences:

trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfEntityMaker.java
469 469
			blk.add(entity);
470 470
		}
471 471
	}
472
	
473
	/**
474
	 * TODO Detectados fallos en las rotaciones de bloques. Hoja 72231.
475
	 *      Detectado en los bloques correspondientes a campos de futbol,
476
	 *      de tipo solid.
477
	 */
472 478
	public void createInsert(DxfGroupVector grp) throws Exception {
473 479
		double x = 0.0, y = 0.0, z = 0.0;
474 480
		DxfGroup g = null;
......
534 540
		
535 541
		gestionaInsert(entity, layer);
536 542
		
543
		System.out.println("createInsert: entity.getBlockName = " + entity.getBlockName());
537 544
		System.out.println("createInsert: entity.getRotAngle = " + entity.getRotAngle());
538 545
		
539 546
		if (addingToBlock == false) {
......
544 551
			blk.add(entity);
545 552
		}
546 553
	}
554
	
547 555
	public void createSolid(DxfGroupVector grp) throws Exception {
548 556
		double x = 0.0, y = 0.0, z1 = 0.0, z2 = 0.0, z3 = 0.0, z4 = 0.0;
549 557
		DxfGroup g = null;
......
600 608
			blk.add(entity);
601 609
		}
602 610
	}
611
	
612
	/*public void createSpline(DxfGroupVector grp) throws Exception {
613
		double x = 0.0, y = 0.0, z1 = 0.0, z2 = 0.0, z3 = 0.0, z4 = 0.0;
614
		DxfGroup g = null;
615
		//Point2D pt1 = null, pt2 = null, pt3 = null, pt4 = null;
616
		Point2D[] pts = new Point2D[4];
617
		DxfLayer layer = (DxfLayer) layers.getByName(grp.getDataAsString(8));
618

  
619
		x = grp.getDataAsDouble(10);
620
		y = grp.getDataAsDouble(20);
621
		if (grp.hasCode(30)) z1 = grp.getDataAsDouble(30);
622
		pts[0] = proj.createPoint(x, y);
623
		x = grp.getDataAsDouble(11);
624
		y = grp.getDataAsDouble(21);
625
		if (grp.hasCode(31)) z2 = grp.getDataAsDouble(31);
626
		pts[1] = proj.createPoint(x, y);
627
		x = grp.getDataAsDouble(12);
628
		y = grp.getDataAsDouble(22);
629
		if (grp.hasCode(32)) z3 = grp.getDataAsDouble(32);
630
		pts[2] = proj.createPoint(x, y);
631
		x = grp.getDataAsDouble(13);
632
		y = grp.getDataAsDouble(23);
633
		if (grp.hasCode(33)) z2 = grp.getDataAsDouble(33);
634
		pts[3] = proj.createPoint(x, y);
635
		if (grp.hasCode(210))
636
			xtruX = grp.getDataAsDouble(210);
637
		if (grp.hasCode(220))
638
			xtruY = grp.getDataAsDouble(220);
639
		if (grp.hasCode(230))
640
			xtruZ = grp.getDataAsDouble(230);
641
		Point3D point_in1 = new Point3D(pts[0].getX(), pts[0].getY(), z1);
642
		Point3D point_in2 = new Point3D(pts[1].getX(), pts[1].getY(), z2);
643
		Point3D point_in3 = new Point3D(pts[2].getX(), pts[2].getY(), z3);
644
		Point3D point_in4 = new Point3D(pts[3].getX(), pts[3].getY(), z4);
645
		Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
646
		Point2D point_out1 = DxfCalXtru.CalculateXtru(point_in1, xtru);
647
		Point2D point_out2 = DxfCalXtru.CalculateXtru(point_in2, xtru);
648
		Point2D point_out3 = DxfCalXtru.CalculateXtru(point_in3, xtru);
649
		Point2D point_out4 = DxfCalXtru.CalculateXtru(point_in4, xtru);
650
		pts[0].setLocation(point_out1);
651
		pts[1].setLocation(point_out2);
652
		pts[2].setLocation(point_out3);
653
		pts[3].setLocation(point_out4);
654
		DxfSolid entity = new DxfSolid(proj, layer, pts);
655
		if (grp.hasCode(62)) {
656
			entity.dxfColor = grp.getDataAsInt(62);
657
		} else {
658
			//entity.dxfColor = 0;
659
		}
660
		if (addingToBlock == false) {
661
			//System.out.println("createLine(): A?adimos una linea a la lista de entidades");
662
			entities.add(entity);
663
		} else {
664
			//System.out.println("createLine(): A?adimos una linea al bloque " + iterator);
665
			blk.add(entity);
666
		}
667
	}*/
668
	
603 669
	public void createBlock(DxfGroupVector grp) throws Exception {
604 670
		DxfLayer layer = (DxfLayer) layers.getByName(grp.getDataAsString(8));
605 671
		blk = new DxfBlock(proj);
......
726 792
				//System.out.println("entity.pt.getX() = " + entity.pt.getX());
727 793
				//System.out.println("point1.getX() = " + point1.getX());
728 794
				//System.out.println("entity.rotAngle = " + entity.rotAngle);
729
				//point11.setLocation(entity.pt.getX() - entity.block.bPoint.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() - entity.block.bPoint.getY() + ((point1.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point1.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
730
				point11.setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().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() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((point1.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point1.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
731
				//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()));
795
				//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()));
796
				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()));
797
				//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()));
732 798
				point2 = dxfLine.getPts()[1];
733
				//point22.setLocation(entity.pt.getX() - entity.block.bPoint.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() - entity.block.bPoint.getY() + ((point2.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point2.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
734
				point22.setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().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() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((point2.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point2.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
735
				//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()));
799
				//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()));
800
				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()));
801
				//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()));
736 802
				DxfLine dxfLinee = new DxfLine(proj, layer, point11, point22);
737 803
				if (addingToBlock == false) {
738 804
					entities.add(dxfLinee);
......
740 806
			} else if (dxfEntity instanceof DxfInsert){
741 807
				dxfInsert = (DxfInsert)dxfEntity;
742 808
				point1 = dxfInsert.pt;
743
				//point11.setLocation(entity.pt.getX() - entity.block.bPoint.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() - entity.block.bPoint.getY() + ((point1.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point1.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
744
				point11.setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().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() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((point1.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point1.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
809
				//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()));
810
				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()));
745 811
				DxfInsert dxfInsertt = new DxfInsert(proj, layer);
746 812
				
747 813
				dxfInsertt.pt = point11;
......
764 830
				for (int j=0; j<dxfPolyline.pts.size(); j++) {
765 831
					points[j] = (Point2D)dxfPolyline.pts.get(j);
766 832
					pointss[j] = new Point2D.Double();					
767
					//pointss[j].setLocation(entity.pt.getX() - entity.block.bPoint.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() - entity.block.bPoint.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
768
					pointss[j].setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().getX()) + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
769
					//pointss[j].setLocation(entity.pt.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
833
					//pointss[j].setLocation(entity.pt.getX() - entity.block.bPoint.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - entity.block.bPoint.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
834
					pointss[j].setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().getX()) + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
835
					//pointss[j].setLocation(entity.pt.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
770 836
					dxfPolylinee.add(pointss[j]);
771 837
				}
772 838
				if (addingToBlock == false) entities.add(dxfPolylinee);
......
777 843
				for (int j=0; j<dxfArc.pts.length; j++) {
778 844
					points[j] = (Point2D)dxfArc.pts[j];
779 845
					pointss[j] = new Point2D.Double();
780
					//pointss[j].setLocation(entity.pt.getX() - entity.block.bPoint.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() - entity.block.bPoint.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
781
					pointss[j].setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().getX()) + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
782
					//pointss[j].setLocation(entity.pt.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
846
					//pointss[j].setLocation(entity.pt.getX() - entity.block.bPoint.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - entity.block.bPoint.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
847
					pointss[j].setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().getX()) + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
848
					//pointss[j].setLocation(entity.pt.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
783 849
				}
784 850
				DxfArc dxfArcc = new DxfArc(proj, layer, pointss);
785 851
				if (addingToBlock == false) entities.add(dxfArcc);
......
790 856
				for (int j=0; j<dxfCircle.pts.length; j++) {
791 857
					points[j] = (Point2D)dxfCircle.pts[j];
792 858
					pointss[j] = new Point2D.Double();
793
					//pointss[j].setLocation(entity.pt.getX() - entity.block.bPoint.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() - entity.block.bPoint.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
794
					pointss[j].setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().getX()) + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
795
					//pointss[j].setLocation(entity.pt.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
859
					//pointss[j].setLocation(entity.pt.getX() - entity.block.bPoint.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - entity.block.bPoint.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
860
					pointss[j].setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().getX()) + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
861
					//pointss[j].setLocation(entity.pt.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
796 862
				}
797 863
				DxfCircle dxfCirclee = new DxfCircle(proj, layer, pointss);
798 864
				if (addingToBlock == false) entities.add(dxfCirclee);
......
804 870
				for (int j=0; j<dxfLwPolyline.pts.size(); j++) {
805 871
					points[j] = (Point2D)dxfLwPolyline.pts.get(j);
806 872
					pointss[j] = new Point2D.Double();					
807
					//pointss[j].setLocation(entity.pt.getX() - entity.block.bPoint.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() - entity.block.bPoint.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
808
					pointss[j].setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().getX()) + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
809
					//pointss[j].setLocation(entity.pt.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
873
					//pointss[j].setLocation(entity.pt.getX() - entity.block.bPoint.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - entity.block.bPoint.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
874
					pointss[j].setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().getX()) + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
875
					//pointss[j].setLocation(entity.pt.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
810 876
					dxfLwPolylinee.add(pointss[j]);
811 877
				}
812 878
				if (addingToBlock == false) entities.add(dxfLwPolylinee);
813 879
			} else if (dxfEntity instanceof DxfPoint) {
814 880
				dxfPoint = (DxfPoint)dxfEntity;
815 881
				point1 = dxfPoint.pt;
816
				//point11.setLocation(entity.pt.getX() - entity.block.bPoint.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() - entity.block.bPoint.getY() + ((point1.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point1.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
817
				point11.setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().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() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((point1.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point1.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
818
				//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()));
882
				//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()));
883
				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()));
884
				//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()));
819 885
				DxfPoint dxfPointt = new DxfPoint(proj, layer);
820 886
				dxfPointt.pt = point11;
821 887
				if (addingToBlock == false) entities.add(dxfPointt);
822 888
			} else if (dxfEntity instanceof DxfText) {
823 889
				dxfText = (DxfText)dxfEntity;
824 890
				point1 = dxfText.pts[0];
825
				//point11.setLocation(entity.pt.getX() - entity.block.bPoint.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() - entity.block.bPoint.getY() + ((point1.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point1.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
826
				point11.setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().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() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((point1.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point1.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
827
				//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()));
891
				//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()));
892
				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()));
893
				//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()));
828 894
				point2 = dxfText.pts[1];
829
				//point22.setLocation(entity.pt.getX() - entity.block.bPoint.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() - entity.block.bPoint.getY() + ((point2.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point2.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
830
				point22.setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().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() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((point2.getX()*Math.sin((entity.rotAngle*Math.PI)/180) + point2.getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
831
				//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()));
895
				//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()));
896
				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()));
897
				//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()));
832 898
				DxfText dxfTextt = new DxfText(proj, layer, dxfText.text);
833 899
				dxfTextt.pts[0] = point11;
834 900
				dxfTextt.pts[1] = point22;
......
840 906
				for (int j=0; j<dxfSolid.pts.length; j++) {
841 907
					points[j] = (Point2D)dxfSolid.pts[j];
842 908
					pointss[j] = new Point2D.Double();
843
					//pointss[j].setLocation(entity.pt.getX() - entity.block.bPoint.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() - entity.block.bPoint.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
844
					pointss[j].setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().getX()) + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
845
					//pointss[j].setLocation(entity.pt.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getX()), entity.pt.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180)) * entity.scaleFactor.getY()));
909
					//pointss[j].setLocation(entity.pt.getX() - entity.block.bPoint.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - entity.block.bPoint.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
910
					pointss[j].setLocation(entity.pt.getX() - (entity.block.bPoint.getX() * entity.getScaleFactor().getX()) + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() - (entity.block.bPoint.getY() * entity.getScaleFactor().getY()) + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
911
					//pointss[j].setLocation(entity.pt.getX() + ((points[j].getX()*Math.cos((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*(-1)*Math.sin((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getX()), entity.pt.getY() + ((points[j].getX()*Math.sin((entity.rotAngle*Math.PI)/180.0) + points[j].getY()*Math.cos((entity.rotAngle*Math.PI)/180.0)) * entity.scaleFactor.getY()));
846 912
				}
847 913
				DxfSolid dxfSolidd = new DxfSolid(proj, layer, pointss);
848 914
				Point2D aux = dxfSolidd.pts[2];

Also available in: Unified diff