Normand Briere
2019-09-22 e96132853038f55cdb6e27f116852cff0e813f00
BezierPatch.java
....@@ -43,9 +43,9 @@
4343 return l;
4444 }
4545
46
- protected void deepCopySelf(Object3D other)
46
+ protected void deepCopyNode(Object3D other)
4747 {
48
- super.deepCopySelf(other);
48
+ super.deepCopyNode(other);
4949 BezierPatch bp = (BezierPatch)other;
5050 bp.depth = depth;
5151 int count = ctrlPnts.size();
....@@ -139,39 +139,43 @@
139139 Point prev = new Point(0, 0);
140140 Point curr = new Point(0, 0);
141141 Rectangle dummy = new Rectangle();
142
- calcHotSpot(sample, info, prev, dummy);
142
+ calcHotSpot(sample, //info,
143
+ prev, dummy);
143144 sample = ((Sphere)ctrlPnts.get(i)).getCenter();
144
- calcHotSpot(sample, info, curr, dummy);
145
+ calcHotSpot(sample, //info,
146
+ curr, dummy);
145147 info.g.drawLine(prev.x, prev.y, curr.x, curr.y);
146148 prev.x = curr.x;
147149 prev.y = curr.y;
148150 }
149151 }
150152
151
- void drawEditHandles(ClickInfo info, int level)
153
+ void drawEditHandles(//ClickInfo info,
154
+ int level)
152155 {
153
- info.g.setColor(Color.red);
156
+ clickInfo.g.setColor(Color.red);
154157 int count = ctrlPnts.size();
155158 for (int i=0; i < count; i++)
156159 {
157160 cVector p = ((Sphere)ctrlPnts.elementAt(i)).getCenter();
158
- Rectangle spot = calcHotSpot(p, info);
159
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
161
+ Rectangle spot = calcHotSpot(p); //, info);
162
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
160163 }
161164
162165 }
163166
164
- boolean doEditClick(ClickInfo info, int level)
167
+ boolean doEditClick(//ClickInfo info,
168
+ int level)
165169 {
166
- startX = info.x;
167
- startY = info.y;
170
+ startX = clickInfo.x;
171
+ startY = clickInfo.y;
168172 int nPoints = ctrlPnts.size();
169173 hitSomething = false;
170174 for (int i=0; i < nPoints; i++)
171175 {
172176 cVector p = ((Sphere)ctrlPnts.elementAt(i)).getCenter();
173
- Rectangle r = calcHotSpot(p, info);
174
- if (r.contains(info.x, info.y))
177
+ Rectangle r = calcHotSpot(p); //, clickInfo);
178
+ if (r.contains(clickInfo.x, clickInfo.y))
175179 {
176180 hitSomething = true;
177181 hitIndex = i;