1 |
56cbe1cf
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2016 Leszek Koltunski //
|
3 |
|
|
// //
|
4 |
|
|
// This file is part of Distorted. //
|
5 |
|
|
// //
|
6 |
|
|
// Distorted is free software: you can redistribute it and/or modify //
|
7 |
|
|
// it under the terms of the GNU General Public License as published by //
|
8 |
|
|
// the Free Software Foundation, either version 2 of the License, or //
|
9 |
|
|
// (at your option) any later version. //
|
10 |
|
|
// //
|
11 |
|
|
// Distorted is distributed in the hope that it will be useful, //
|
12 |
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
13 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
14 |
|
|
// GNU General Public License for more details. //
|
15 |
|
|
// //
|
16 |
|
|
// You should have received a copy of the GNU General Public License //
|
17 |
|
|
// along with Distorted. If not, see <http://www.gnu.org/licenses/>. //
|
18 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
19 |
|
|
|
20 |
|
|
package org.distorted.examples.vertex3d;
|
21 |
|
|
|
22 |
|
|
import android.view.View;
|
23 |
|
|
import android.widget.SeekBar;
|
24 |
|
|
import android.widget.TextView;
|
25 |
|
|
|
26 |
|
|
import org.distorted.examples.R;
|
27 |
24991bc2
|
Leszek Koltunski
|
import org.distorted.library.DistortedObject;
|
28 |
56cbe1cf
|
Leszek Koltunski
|
import org.distorted.library.EffectNames;
|
29 |
|
|
import org.distorted.library.type.Dynamic1D;
|
30 |
|
|
import org.distorted.library.type.Dynamic2D;
|
31 |
|
|
import org.distorted.library.type.Dynamic3D;
|
32 |
|
|
import org.distorted.library.type.Dynamic4D;
|
33 |
|
|
import org.distorted.library.type.Static1D;
|
34 |
|
|
import org.distorted.library.type.Static2D;
|
35 |
|
|
import org.distorted.library.type.Static3D;
|
36 |
|
|
import org.distorted.library.type.Static4D;
|
37 |
|
|
|
38 |
|
|
import java.lang.ref.WeakReference;
|
39 |
|
|
|
40 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
41 |
|
|
|
42 |
|
|
public class Vertex3DEffect implements SeekBar.OnSeekBarChangeListener
|
43 |
|
|
{
|
44 |
|
|
private WeakReference<Vertex3DActivity> mAct;
|
45 |
|
|
|
46 |
|
|
private EffectNames mName;
|
47 |
|
|
private int[] mInter;
|
48 |
|
|
private int[] mInterRegion;
|
49 |
|
|
private int[] mInterCenter;
|
50 |
|
|
private int[] mSeekID;
|
51 |
|
|
private int[] mSeekRegionID;
|
52 |
|
|
private int[] mSeekCenterID;
|
53 |
|
|
private int mDimension;
|
54 |
|
|
private TextView mText,mTextRegion,mTextCenter;
|
55 |
|
|
|
56 |
|
|
private Dynamic1D mDyn1;
|
57 |
|
|
private Dynamic3D mDyn3;
|
58 |
|
|
private Static1D mSta1;
|
59 |
|
|
private Static3D mSta3;
|
60 |
|
|
private Dynamic4D mRegionDyn;
|
61 |
|
|
private Static4D mRegionSta;
|
62 |
|
|
private Dynamic2D mCenterDyn;
|
63 |
|
|
private Static2D mCenterSta;
|
64 |
|
|
|
65 |
24991bc2
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
66 |
8fd9f5fa
|
Leszek Koltunski
|
// requires knowledge about effect nature
|
67 |
|
|
|
68 |
|
|
private int getDimension()
|
69 |
|
|
{
|
70 |
|
|
switch(mName)
|
71 |
|
|
{
|
72 |
|
|
case SWIRL :
|
73 |
|
|
case SINK : return 1;
|
74 |
|
|
case DISTORT:
|
75 |
|
|
case DEFORM : return 3;
|
76 |
|
|
}
|
77 |
|
|
|
78 |
|
|
return 0;
|
79 |
|
|
}
|
80 |
|
|
|
81 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
82 |
|
|
// requires knowledge about effect nature
|
83 |
|
|
|
84 |
|
|
public void apply(DistortedObject object)
|
85 |
|
|
{
|
86 |
|
|
switch(mName)
|
87 |
|
|
{
|
88 |
|
|
case DISTORT: object.distort(mDyn3, mCenterDyn, mRegionDyn); break;
|
89 |
|
|
case DEFORM : object.deform (mDyn3, mCenterDyn ); break;
|
90 |
|
|
case SINK : object.sink (mDyn1, mCenterDyn, mRegionDyn); break;
|
91 |
|
|
case SWIRL : object.swirl (mDyn1, mCenterDyn, mRegionDyn); break;
|
92 |
|
|
}
|
93 |
|
|
}
|
94 |
|
|
|
95 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
96 |
|
|
// requires knowledge about effect nature
|
97 |
24991bc2
|
Leszek Koltunski
|
|
98 |
|
|
public boolean supportsRegion()
|
99 |
|
|
{
|
100 |
|
|
return mName == EffectNames.DEFORM ? false : true;
|
101 |
|
|
}
|
102 |
|
|
|
103 |
8fd9f5fa
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
104 |
|
|
// requires knowledge about effect nature
|
105 |
|
|
|
106 |
|
|
private void fillStatics()
|
107 |
|
|
{
|
108 |
|
|
switch(mName)
|
109 |
|
|
{
|
110 |
|
|
case DISTORT:
|
111 |
|
|
case DEFORM : float l = mAct.get().getWidth()/50.0f;
|
112 |
|
|
float x = (mInter[0]-50)*l;
|
113 |
|
|
float y = (mInter[1]-50)*l;
|
114 |
|
|
float z = (mInter[2]-50)*l;
|
115 |
|
|
mSta3.set(x,y,z);
|
116 |
|
|
break;
|
117 |
|
|
case SINK : mSta1.set(mInter[0] > 50 ? 50.0f/(100.01f-mInter[0]) : mInter[0] / 50.0f);
|
118 |
|
|
break;
|
119 |
|
|
case SWIRL : mSta1.set( 3.6f*(mInter[0]-50) );
|
120 |
|
|
break;
|
121 |
|
|
}
|
122 |
|
|
}
|
123 |
|
|
|
124 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
125 |
|
|
// requires knowledge about effect nature
|
126 |
|
|
|
127 |
|
|
private void setDefaultInter()
|
128 |
|
|
{
|
129 |
|
|
switch(mName)
|
130 |
|
|
{
|
131 |
|
|
case DISTORT:
|
132 |
|
|
case DEFORM : mInter[0] = 50;
|
133 |
|
|
mInter[1] = 50;
|
134 |
|
|
mInter[2] = 50;
|
135 |
|
|
break;
|
136 |
|
|
case SINK :
|
137 |
|
|
case SWIRL : mInter[0] = 50;
|
138 |
|
|
break;
|
139 |
|
|
}
|
140 |
|
|
}
|
141 |
|
|
|
142 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
143 |
|
|
// requires knowledge about effect nature
|
144 |
|
|
|
145 |
|
|
private void setText()
|
146 |
|
|
{
|
147 |
|
|
String text = mName.name();
|
148 |
|
|
|
149 |
|
|
if( mName==EffectNames.DISTORT || mName==EffectNames.DEFORM)
|
150 |
|
|
{
|
151 |
|
|
int f1 = (int)mSta3.getX();
|
152 |
|
|
int f2 = (int)mSta3.getY();
|
153 |
|
|
int f3 = (int)mSta3.getZ();
|
154 |
|
|
text += " ("+f1+","+f2+","+f3+")";
|
155 |
|
|
}
|
156 |
|
|
else
|
157 |
|
|
{
|
158 |
|
|
float f1 = ((int)(mSta1.getX()*100))/100.0f;
|
159 |
|
|
text += " ("+f1+")";
|
160 |
|
|
}
|
161 |
|
|
|
162 |
|
|
mText.setText(text);
|
163 |
|
|
}
|
164 |
|
|
|
165 |
56cbe1cf
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
166 |
|
|
|
167 |
|
|
private void fillCenterStatics()
|
168 |
|
|
{
|
169 |
|
|
Vertex3DActivity act = mAct.get();
|
170 |
|
|
|
171 |
950511ed
|
Leszek Koltunski
|
float x = (mInterCenter[0]*0.012f - 0.1f)*act.getWidth();
|
172 |
|
|
float y = (mInterCenter[1]*0.012f - 0.1f)*act.getHeight();
|
173 |
56cbe1cf
|
Leszek Koltunski
|
mCenterSta.set(x,y);
|
174 |
|
|
}
|
175 |
|
|
|
176 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
177 |
|
|
|
178 |
|
|
private void setDefaultCenterInter()
|
179 |
|
|
{
|
180 |
|
|
mInterCenter[0] = 50;
|
181 |
|
|
mInterCenter[1] = 50;
|
182 |
|
|
}
|
183 |
|
|
|
184 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
185 |
|
|
|
186 |
|
|
private void setCenterText()
|
187 |
|
|
{
|
188 |
|
|
int f0 = (int)mCenterSta.getX();
|
189 |
|
|
int f1 = (int)mCenterSta.getY();
|
190 |
|
|
|
191 |
|
|
mTextCenter.setText("center ("+f0+","+f1+")");
|
192 |
|
|
}
|
193 |
|
|
|
194 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
195 |
|
|
|
196 |
|
|
private void fillRegionStatics()
|
197 |
|
|
{
|
198 |
|
|
Vertex3DActivity act = mAct.get();
|
199 |
|
|
|
200 |
|
|
float factorX = act.getWidth() / 100.0f;
|
201 |
|
|
float factorY = act.getHeight()/ 100.0f;
|
202 |
|
|
|
203 |
|
|
float x = (mInterRegion[0]-50)*factorX;
|
204 |
|
|
float y = (mInterRegion[1]-50)*factorY;
|
205 |
|
|
float rx = mInterRegion[2] *factorX;
|
206 |
|
|
float ry = mInterRegion[3] *factorY;
|
207 |
|
|
|
208 |
|
|
mRegionSta.set(x,y,rx,ry);
|
209 |
|
|
}
|
210 |
|
|
|
211 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
212 |
|
|
|
213 |
|
|
private void setDefaultRegionInter()
|
214 |
|
|
{
|
215 |
|
|
mInterRegion[0] = 50;
|
216 |
|
|
mInterRegion[1] = 50;
|
217 |
|
|
mInterRegion[2] = 50;
|
218 |
|
|
mInterRegion[3] = 50;
|
219 |
|
|
}
|
220 |
|
|
|
221 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
222 |
|
|
|
223 |
|
|
private void setRegionText()
|
224 |
|
|
{
|
225 |
|
|
int f0 = (int)mRegionSta.getX();
|
226 |
|
|
int f1 = (int)mRegionSta.getY();
|
227 |
|
|
int f2 = (int)mRegionSta.getZ();
|
228 |
|
|
int f3 = (int)mRegionSta.getW();
|
229 |
|
|
|
230 |
|
|
mTextRegion.setText("region ("+f0+","+f1+","+f2+","+f3+")");
|
231 |
|
|
}
|
232 |
|
|
|
233 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
234 |
|
|
|
235 |
|
|
public Vertex3DEffect(EffectNames name, Vertex3DActivity act)
|
236 |
|
|
{
|
237 |
|
|
mAct = new WeakReference<>(act);
|
238 |
|
|
mName = name;
|
239 |
|
|
|
240 |
8fd9f5fa
|
Leszek Koltunski
|
mDimension = getDimension();
|
241 |
|
|
|
242 |
|
|
if( mDimension==1 )
|
243 |
56cbe1cf
|
Leszek Koltunski
|
{
|
244 |
|
|
mDyn1 = new Dynamic1D();
|
245 |
|
|
mSta1 = new Static1D(0);
|
246 |
|
|
mDyn1.add(mSta1);
|
247 |
|
|
mDyn3 = null;
|
248 |
|
|
}
|
249 |
8fd9f5fa
|
Leszek Koltunski
|
else if( mDimension==3 )
|
250 |
56cbe1cf
|
Leszek Koltunski
|
{
|
251 |
|
|
mDyn3 = new Dynamic3D();
|
252 |
|
|
mSta3 = new Static3D(0,0,0);
|
253 |
|
|
mDyn3.add(mSta3);
|
254 |
|
|
mDyn1 = null;
|
255 |
|
|
}
|
256 |
8fd9f5fa
|
Leszek Koltunski
|
else
|
257 |
|
|
{
|
258 |
|
|
throw new RuntimeException("unsupported effect");
|
259 |
|
|
}
|
260 |
56cbe1cf
|
Leszek Koltunski
|
|
261 |
|
|
mInter = new int[mDimension];
|
262 |
|
|
mSeekID= new int[mDimension];
|
263 |
|
|
|
264 |
|
|
mInterRegion = new int[4];
|
265 |
|
|
mSeekRegionID= new int[4];
|
266 |
|
|
mRegionDyn = new Dynamic4D();
|
267 |
|
|
mRegionSta = new Static4D(0,0,0,0);
|
268 |
|
|
mRegionDyn.add(mRegionSta);
|
269 |
|
|
|
270 |
|
|
mInterCenter = new int[2];
|
271 |
|
|
mSeekCenterID= new int[2];
|
272 |
|
|
mCenterDyn = new Dynamic2D();
|
273 |
|
|
mCenterSta = new Static2D(0,0);
|
274 |
|
|
mCenterDyn.add(mCenterSta);
|
275 |
|
|
}
|
276 |
|
|
|
277 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
278 |
|
|
|
279 |
|
|
public View createView()
|
280 |
|
|
{
|
281 |
|
|
View effect;
|
282 |
|
|
SeekBar[] seek = new SeekBar[mDimension];
|
283 |
|
|
|
284 |
|
|
Vertex3DActivity act = mAct.get();
|
285 |
|
|
|
286 |
|
|
switch(mDimension)
|
287 |
|
|
{
|
288 |
|
|
case 1 : effect = act.getLayoutInflater().inflate(R.layout.effect1d, null);
|
289 |
|
|
mText = (TextView)effect.findViewById(R.id.effect1dText);
|
290 |
|
|
seek[0] = (SeekBar)effect.findViewById(R.id.effect1dbar1);
|
291 |
|
|
mSeekID[0] = seek[0].getId();
|
292 |
|
|
break;
|
293 |
|
|
case 2 : effect = act.getLayoutInflater().inflate(R.layout.effect2d, null);
|
294 |
|
|
mText = (TextView)effect.findViewById(R.id.effect2dText);
|
295 |
|
|
seek[0] = (SeekBar)effect.findViewById(R.id.effect2dbar1);
|
296 |
|
|
seek[1] = (SeekBar)effect.findViewById(R.id.effect2dbar2);
|
297 |
|
|
mSeekID[0] = seek[0].getId();
|
298 |
|
|
mSeekID[1] = seek[1].getId();
|
299 |
|
|
break;
|
300 |
|
|
case 3 : effect = act.getLayoutInflater().inflate(R.layout.effect3d, null);
|
301 |
|
|
mText = (TextView)effect.findViewById(R.id.effect3dText);
|
302 |
|
|
seek[0] = (SeekBar)effect.findViewById(R.id.effect3dbar1);
|
303 |
|
|
seek[1] = (SeekBar)effect.findViewById(R.id.effect3dbar2);
|
304 |
|
|
seek[2] = (SeekBar)effect.findViewById(R.id.effect3dbar3);
|
305 |
|
|
mSeekID[0] = seek[0].getId();
|
306 |
|
|
mSeekID[1] = seek[1].getId();
|
307 |
|
|
mSeekID[2] = seek[2].getId();
|
308 |
|
|
break;
|
309 |
|
|
case 4 : effect = act.getLayoutInflater().inflate(R.layout.effect4d, null);
|
310 |
|
|
mText = (TextView)effect.findViewById(R.id.effect4dText);
|
311 |
|
|
seek[0] = (SeekBar)effect.findViewById(R.id.effect4dbar1);
|
312 |
|
|
seek[1] = (SeekBar)effect.findViewById(R.id.effect4dbar2);
|
313 |
|
|
seek[2] = (SeekBar)effect.findViewById(R.id.effect4dbar3);
|
314 |
|
|
seek[3] = (SeekBar)effect.findViewById(R.id.effect4dbar4);
|
315 |
|
|
mSeekID[0] = seek[0].getId();
|
316 |
|
|
mSeekID[1] = seek[1].getId();
|
317 |
|
|
mSeekID[2] = seek[2].getId();
|
318 |
|
|
mSeekID[3] = seek[3].getId();
|
319 |
|
|
break;
|
320 |
|
|
default: android.util.Log.e("Vertex3DEffect", "dimension "+mDimension+" not supported!");
|
321 |
|
|
return null;
|
322 |
|
|
}
|
323 |
|
|
|
324 |
|
|
setDefaultInter();
|
325 |
|
|
|
326 |
|
|
for(int i=0; i<mDimension; i++)
|
327 |
|
|
{
|
328 |
|
|
seek[i].setOnSeekBarChangeListener(this);
|
329 |
|
|
seek[i].setProgress( mInter[i] );
|
330 |
|
|
}
|
331 |
|
|
|
332 |
24991bc2
|
Leszek Koltunski
|
Vertex3DActivity.setSupportsRegion(supportsRegion());
|
333 |
|
|
|
334 |
56cbe1cf
|
Leszek Koltunski
|
return effect;
|
335 |
|
|
}
|
336 |
|
|
|
337 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
338 |
|
|
|
339 |
|
|
public View createRegion()
|
340 |
|
|
{
|
341 |
|
|
Vertex3DActivity act = mAct.get();
|
342 |
|
|
|
343 |
|
|
View region = act.getLayoutInflater().inflate(R.layout.effectregion, null);
|
344 |
|
|
|
345 |
|
|
SeekBar[] seek = new SeekBar[4];
|
346 |
|
|
|
347 |
|
|
seek[0] = (SeekBar)region.findViewById(R.id.effectRegionBarX );
|
348 |
|
|
seek[1] = (SeekBar)region.findViewById(R.id.effectRegionBarY );
|
349 |
|
|
seek[2] = (SeekBar)region.findViewById(R.id.effectRegionBarRX);
|
350 |
|
|
seek[3] = (SeekBar)region.findViewById(R.id.effectRegionBarRY);
|
351 |
|
|
|
352 |
|
|
mSeekRegionID[0] = seek[0].getId();
|
353 |
|
|
mSeekRegionID[1] = seek[1].getId();
|
354 |
|
|
mSeekRegionID[2] = seek[2].getId();
|
355 |
|
|
mSeekRegionID[3] = seek[3].getId();
|
356 |
|
|
|
357 |
24991bc2
|
Leszek Koltunski
|
mTextRegion = (TextView)region.findViewById(R.id.effectRegionText);
|
358 |
56cbe1cf
|
Leszek Koltunski
|
|
359 |
|
|
setDefaultRegionInter();
|
360 |
|
|
|
361 |
|
|
for(int i=0; i<4; i++)
|
362 |
|
|
{
|
363 |
|
|
seek[i].setOnSeekBarChangeListener(this);
|
364 |
|
|
seek[i].setProgress( mInterRegion[i] );
|
365 |
|
|
}
|
366 |
|
|
|
367 |
24991bc2
|
Leszek Koltunski
|
act.setRegion(mRegionSta.getX(),mRegionSta.getY(),mRegionSta.getZ());
|
368 |
|
|
|
369 |
56cbe1cf
|
Leszek Koltunski
|
return region;
|
370 |
|
|
}
|
371 |
|
|
|
372 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
373 |
|
|
|
374 |
|
|
public View createCenter()
|
375 |
|
|
{
|
376 |
|
|
Vertex3DActivity act = mAct.get();
|
377 |
|
|
|
378 |
|
|
View center = act.getLayoutInflater().inflate(R.layout.effectcenter, null);
|
379 |
|
|
|
380 |
|
|
SeekBar[] seek = new SeekBar[2];
|
381 |
|
|
|
382 |
|
|
seek[0] = (SeekBar)center.findViewById(R.id.effectCenterBarX );
|
383 |
|
|
seek[1] = (SeekBar)center.findViewById(R.id.effectCenterBarY );
|
384 |
|
|
|
385 |
|
|
mSeekCenterID[0] = seek[0].getId();
|
386 |
|
|
mSeekCenterID[1] = seek[1].getId();
|
387 |
|
|
|
388 |
8fd9f5fa
|
Leszek Koltunski
|
mTextCenter = (TextView)center.findViewById(R.id.effectCenterText);
|
389 |
56cbe1cf
|
Leszek Koltunski
|
|
390 |
|
|
setDefaultCenterInter();
|
391 |
|
|
|
392 |
|
|
for(int i=0; i<2; i++)
|
393 |
|
|
{
|
394 |
|
|
seek[i].setOnSeekBarChangeListener(this);
|
395 |
|
|
seek[i].setProgress( mInterCenter[i] );
|
396 |
|
|
}
|
397 |
|
|
|
398 |
24991bc2
|
Leszek Koltunski
|
act.setCenter(mCenterSta.getX(),mCenterSta.getY());
|
399 |
|
|
|
400 |
56cbe1cf
|
Leszek Koltunski
|
return center;
|
401 |
|
|
}
|
402 |
|
|
|
403 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
404 |
|
|
|
405 |
|
|
public void onProgressChanged(SeekBar bar, int progress, boolean fromUser)
|
406 |
|
|
{
|
407 |
|
|
if ( mDimension>=1 && bar.getId()==mSeekID[0] )
|
408 |
|
|
{
|
409 |
|
|
mInter[0] = progress;
|
410 |
|
|
fillStatics();
|
411 |
|
|
setText();
|
412 |
|
|
}
|
413 |
|
|
if ( mDimension>=2 && bar.getId()==mSeekID[1] )
|
414 |
|
|
{
|
415 |
|
|
mInter[1] = progress;
|
416 |
|
|
fillStatics();
|
417 |
|
|
setText();
|
418 |
|
|
}
|
419 |
|
|
if ( mDimension>=3 && bar.getId()==mSeekID[2] )
|
420 |
|
|
{
|
421 |
|
|
mInter[2] = progress;
|
422 |
|
|
fillStatics();
|
423 |
|
|
setText();
|
424 |
|
|
}
|
425 |
|
|
if ( mDimension>=4 && bar.getId()==mSeekID[3] )
|
426 |
|
|
{
|
427 |
|
|
mInter[3] = progress;
|
428 |
|
|
fillStatics();
|
429 |
|
|
setText();
|
430 |
|
|
}
|
431 |
|
|
|
432 |
|
|
if( bar.getId() == mSeekRegionID[0] )
|
433 |
|
|
{
|
434 |
|
|
mInterRegion[0] = progress;
|
435 |
|
|
fillRegionStatics();
|
436 |
|
|
setRegionText();
|
437 |
|
|
}
|
438 |
|
|
if( bar.getId() == mSeekRegionID[1] )
|
439 |
|
|
{
|
440 |
|
|
mInterRegion[1] = progress;
|
441 |
|
|
fillRegionStatics();
|
442 |
|
|
setRegionText();
|
443 |
|
|
}
|
444 |
|
|
if( bar.getId() == mSeekRegionID[2] )
|
445 |
|
|
{
|
446 |
|
|
mInterRegion[2] = progress;
|
447 |
|
|
fillRegionStatics();
|
448 |
|
|
setRegionText();
|
449 |
|
|
}
|
450 |
|
|
if( bar.getId() == mSeekRegionID[3] )
|
451 |
|
|
{
|
452 |
|
|
mInterRegion[3] = progress;
|
453 |
|
|
fillRegionStatics();
|
454 |
|
|
setRegionText();
|
455 |
|
|
}
|
456 |
|
|
|
457 |
|
|
if( bar.getId() == mSeekCenterID[0] )
|
458 |
|
|
{
|
459 |
|
|
mInterCenter[0] = progress;
|
460 |
|
|
fillCenterStatics();
|
461 |
|
|
setCenterText();
|
462 |
|
|
}
|
463 |
|
|
if( bar.getId() == mSeekCenterID[1] )
|
464 |
|
|
{
|
465 |
|
|
mInterCenter[1] = progress;
|
466 |
|
|
fillCenterStatics();
|
467 |
|
|
setCenterText();
|
468 |
|
|
}
|
469 |
24991bc2
|
Leszek Koltunski
|
|
470 |
|
|
if( fromUser )
|
471 |
|
|
{
|
472 |
|
|
Vertex3DActivity.setSupportsRegion(supportsRegion());
|
473 |
|
|
|
474 |
|
|
Vertex3DActivity act = mAct.get();
|
475 |
|
|
|
476 |
|
|
act.setCenter(mCenterSta.getX(),mCenterSta.getY());
|
477 |
|
|
act.setRegion(mRegionSta.getX(),mRegionSta.getY(),mRegionSta.getZ());
|
478 |
|
|
}
|
479 |
56cbe1cf
|
Leszek Koltunski
|
}
|
480 |
|
|
|
481 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
482 |
|
|
|
483 |
|
|
public void onStartTrackingTouch(SeekBar bar) { }
|
484 |
|
|
|
485 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
486 |
|
|
|
487 |
|
|
public void onStopTrackingTouch(SeekBar bar) { }
|
488 |
|
|
}
|