Revision 39b925d5
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/examples/meshfile/MeshFileActivity.java | ||
---|---|---|
33 | 33 |
|
34 | 34 |
import org.distorted.examples.R; |
35 | 35 |
import org.distorted.library.main.DistortedLibrary; |
36 |
import org.distorted.library.mesh.MeshFile; |
|
36 | 37 |
|
37 | 38 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
38 | 39 |
|
... | ... | |
40 | 41 |
SeekBar.OnSeekBarChangeListener, |
41 | 42 |
View.OnClickListener |
42 | 43 |
{ |
44 |
private static final int OFFSET = 100000; |
|
45 |
|
|
43 | 46 |
private LinearLayout mLayout; |
44 | 47 |
private int mResource; |
45 | 48 |
private String[] mNames = new String[] { "deferredjob", |
... | ... | |
153 | 156 |
TextView index = view.findViewById(R.id.meshfileComponentText); |
154 | 157 |
index.setText(String.valueOf(endIndex)); |
155 | 158 |
|
156 |
Button butt = view.findViewById(R.id.meshfileComponentDisappear); |
|
157 |
butt.setId(component); |
|
158 |
butt.setOnClickListener(this); |
|
159 |
Button disappear = view.findViewById(R.id.meshfileComponentDisappear); |
|
160 |
disappear.setId(component); |
|
161 |
disappear.setOnClickListener(this); |
|
162 |
|
|
163 |
Button appear = view.findViewById(R.id.meshfileComponentAppear); |
|
164 |
appear.setId(component+OFFSET); |
|
165 |
appear.setOnClickListener(this); |
|
159 | 166 |
|
160 | 167 |
return view; |
161 | 168 |
} |
... | ... | |
190 | 197 |
|
191 | 198 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
192 | 199 |
|
193 |
@Override |
|
194 |
public void onClick(View v) |
|
195 |
{ |
|
196 |
int id = v.getId(); |
|
200 |
@Override |
|
201 |
public void onClick(View v) |
|
202 |
{ |
|
203 |
int id = v.getId(); |
|
204 |
|
|
205 |
MeshFileSurfaceView view = findViewById(R.id.meshfileSurfaceView); |
|
206 |
MeshFileRenderer renderer = view.getRenderer(); |
|
197 | 207 |
|
198 |
android.util.Log.e("act", "clicked: "+id); |
|
199 |
} |
|
208 |
MeshFile mesh = renderer.getMesh(); |
|
209 |
|
|
210 |
if( id>=OFFSET ) |
|
211 |
{ |
|
212 |
id -= OFFSET; |
|
213 |
mesh.setEffectAssociation(id,0,id); |
|
214 |
} |
|
215 |
else |
|
216 |
{ |
|
217 |
mesh.setEffectAssociation(id,1,id); |
|
218 |
} |
|
219 |
} |
|
200 | 220 |
|
201 | 221 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
202 | 222 |
|
Also available in: Unified diff
Progress with the MeshFile app: disappear works now.