Revision 10012 trunk/libraries/libDwg/src/com/iver/cit/jdwglib/dwg/objects/DwgInsert.java
DwgInsert.java | ||
---|---|---|
41 | 41 |
import com.iver.cit.gvsig.fmap.core.FPoint3D; |
42 | 42 |
import com.iver.cit.gvsig.fmap.core.FShape; |
43 | 43 |
import com.iver.cit.jdwglib.dwg.DwgFile; |
44 |
import com.iver.cit.jdwglib.dwg.DwgHandleReference; |
|
44 | 45 |
import com.iver.cit.jdwglib.dwg.DwgObject; |
45 | 46 |
import com.iver.cit.jdwglib.dwg.IDwg2FMap; |
46 | 47 |
import com.iver.cit.jdwglib.dwg.IDwg3DTestable; |
... | ... | |
62 | 63 |
private double[] scale; |
63 | 64 |
private double rotation; |
64 | 65 |
private double[] extrusion; |
65 |
private int blockHeaderHandle;
|
|
66 |
private int firstAttribHandle;
|
|
67 |
private int lastAttribHandle;
|
|
68 |
private int seqendHandle;
|
|
66 |
private DwgHandleReference blockHeaderHandle = null;
|
|
67 |
private DwgHandleReference firstAttribHandle = null;
|
|
68 |
private DwgHandleReference lastAttribHandle = null;
|
|
69 |
private DwgHandleReference seqendHandle = null;
|
|
69 | 70 |
|
70 | 71 |
|
71 | 72 |
/** |
72 | 73 |
* @return Returns the blockHeaderHandle. |
73 | 74 |
*/ |
74 |
public int getBlockHeaderHandle() {
|
|
75 |
public DwgHandleReference getBlockHeaderHandle() {
|
|
75 | 76 |
return blockHeaderHandle; |
76 | 77 |
} |
77 | 78 |
/** |
78 | 79 |
* @param blockHeaderHandle The blockHeaderHandle to set. |
79 | 80 |
*/ |
80 |
public void setBlockHeaderHandle(int blockHeaderHandle) {
|
|
81 |
public void setBlockHeaderHandle(DwgHandleReference blockHeaderHandle) {
|
|
81 | 82 |
this.blockHeaderHandle = blockHeaderHandle; |
82 | 83 |
} |
83 | 84 |
/** |
84 | 85 |
* @return Returns the firstAttribHandle. |
85 | 86 |
*/ |
86 |
public int getFirstAttribHandle() {
|
|
87 |
public DwgHandleReference getFirstAttribHandle() {
|
|
87 | 88 |
return firstAttribHandle; |
88 | 89 |
} |
89 | 90 |
/** |
90 | 91 |
* @param firstAttribHandle The firstAttribHandle to set. |
91 | 92 |
*/ |
92 |
public void setFirstAttribHandle(int firstAttribHandle) {
|
|
93 |
public void setFirstAttribHandle(DwgHandleReference firstAttribHandle) {
|
|
93 | 94 |
this.firstAttribHandle = firstAttribHandle; |
94 | 95 |
} |
95 | 96 |
/** |
... | ... | |
107 | 108 |
/** |
108 | 109 |
* @return Returns the lastAttribHandle. |
109 | 110 |
*/ |
110 |
public int getLastAttribHandle() {
|
|
111 |
public DwgHandleReference getLastAttribHandle() {
|
|
111 | 112 |
return lastAttribHandle; |
112 | 113 |
} |
113 | 114 |
/** |
114 | 115 |
* @param lastAttribHandle The lastAttribHandle to set. |
115 | 116 |
*/ |
116 |
public void setLastAttribHandle(int lastAttribHandle) {
|
|
117 |
public void setLastAttribHandle(DwgHandleReference lastAttribHandle) {
|
|
117 | 118 |
this.lastAttribHandle = lastAttribHandle; |
118 | 119 |
} |
119 | 120 |
/** |
... | ... | |
155 | 156 |
/** |
156 | 157 |
* @return Returns the seqendHandle. |
157 | 158 |
*/ |
158 |
public int getSeqendHandle() {
|
|
159 |
public DwgHandleReference getSeqendHandle() {
|
|
159 | 160 |
return seqendHandle; |
160 | 161 |
} |
161 | 162 |
/** |
162 | 163 |
* @param seqendHandle The seqendHandle to set. |
163 | 164 |
*/ |
164 |
public void setSeqendHandle(int seqendHandle) {
|
|
165 |
public void setSeqendHandle(DwgHandleReference seqendHandle) {
|
|
165 | 166 |
this.seqendHandle = seqendHandle; |
166 | 167 |
} |
167 | 168 |
/* (non-Javadoc) |
... | ... | |
245 | 246 |
Point2D point = new Point2D.Double(p[0], p[1]); |
246 | 247 |
double[] newScale = this.getScale(); |
247 | 248 |
double newRot = this.getRotation(); |
248 |
int newBlockHandle = this.getBlockHeaderHandle();
|
|
249 |
DwgHandleReference newBlockHandle = this.getBlockHeaderHandle();
|
|
249 | 250 |
Point2D pointAux = new Point2D.Double(point.getX() - bPoint[0], point.getY() - bPoint[1]); |
250 | 251 |
double laX = insPoint.getX() + ((pointAux.getX()*scale[0])*Math.cos(rot) + (pointAux.getY()*scale[1])*(-1)*Math.sin(rot)); |
251 | 252 |
double laY = insPoint.getY() + ((pointAux.getX()*scale[0])*Math.sin(rot) + (pointAux.getY()*scale[1])*Math.cos(rot)); |
... | ... | |
258 | 259 |
} else if (newRot>(2*Math.PI)) { |
259 | 260 |
newRot = newRot - (2*Math.PI); |
260 | 261 |
} |
261 |
callBack.manageInsert(newInsPoint, newScale, newRot, newBlockHandle, dwgObjectsWithoutBlocks); |
|
262 |
callBack.manageInsert(newInsPoint, newScale, newRot, newBlockHandle.getOffset(), dwgObjectsWithoutBlocks);
|
|
262 | 263 |
} |
263 | 264 |
} |
Also available in: Unified diff