diff --git a/contrib/mobile/Android/src/org/geuz/onelab/MainActivity.java b/contrib/mobile/Android/src/org/geuz/onelab/MainActivity.java index 4ef8effb28c3c8d3d8fe33cba2c9793c9a4c1a8e..d6b9b0983dedb8285a39e0cdee9be489b3456c44 100644 --- a/contrib/mobile/Android/src/org/geuz/onelab/MainActivity.java +++ b/contrib/mobile/Android/src/org/geuz/onelab/MainActivity.java @@ -10,7 +10,6 @@ import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.Notification; -import android.app.Notification.Builder; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; @@ -23,7 +22,6 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.os.Parcelable; -import android.app.FragmentTransaction; import android.view.Menu; import android.view.MenuItem; import android.view.Window; diff --git a/contrib/mobile/Android/src/org/geuz/onelab/ModelList.java b/contrib/mobile/Android/src/org/geuz/onelab/ModelList.java index 5ea77bd4119460895613311ddb0daaf05fbaec07..4ebcf151997d50e03671f262ea9b128accfe7b74 100644 --- a/contrib/mobile/Android/src/org/geuz/onelab/ModelList.java +++ b/contrib/mobile/Android/src/org/geuz/onelab/ModelList.java @@ -127,8 +127,7 @@ public class ModelList extends Activity { Uri uri = data.getData(); String[] projection = { MediaStore.Images.Media.DATA }; Cursor cursor = managedQuery(uri, projection, null, null, null); - int column_index = cursor - .getColumnIndexOrThrow(MediaStore.Images.Media.DATA); + int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst(); Intent intent = new Intent(ModelList.this, MainActivity.class); intent.putExtra("file", cursor.getString(column_index)); diff --git a/contrib/mobile/Android/src/org/geuz/onelab/OptionsPostProcessingFragment.java b/contrib/mobile/Android/src/org/geuz/onelab/OptionsPostProcessingFragment.java index 1b12d24dd3b2f9c40d78c66b5bb5132c494b1ae9..68e83f9331f49b36a45ec3eb6452ea9d1fbc063b 100644 --- a/contrib/mobile/Android/src/org/geuz/onelab/OptionsPostProcessingFragment.java +++ b/contrib/mobile/Android/src/org/geuz/onelab/OptionsPostProcessingFragment.java @@ -57,12 +57,9 @@ public class OptionsPostProcessingFragment extends Fragment{ final SeekBar raiseZ = (SeekBar)layout.findViewById(R.id.raisez); raiseZ.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { - public void onStopTrackingTouch(SeekBar seekBar) {} // UNUSED Auto-generated method stub + public void onStopTrackingTouch(SeekBar seekBar) {_gmsh.setPView(_pview, -1, -1, -1, seekBar.getProgress());} public void onStartTrackingTouch(SeekBar seekBar) {} // UNUSED Auto-generated method stub - public void onProgressChanged(SeekBar seekBar, int progress, - boolean fromUser) { - _gmsh.setPView(_pview, -1, -1, -1, progress); - } + public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { } // UNUSED Auto-generated method stub }); raiseZ.setProgress(Integer.parseInt(infos[4])); intervalsType.setEnabled(infos[2].equals("1")); diff --git a/contrib/mobile/androidGModel.cpp b/contrib/mobile/androidGModel.cpp index 629258807c8fbbefafc4213abb7ca6d407557d48..22cdf6e3c9e8053cd74d60252d7ddba68d8f0647 100644 --- a/contrib/mobile/androidGModel.cpp +++ b/contrib/mobile/androidGModel.cpp @@ -294,7 +294,7 @@ JNIEXPORT void JNICALL Java_org_geuz_onelab_Gmsh_setPView if(intervalsType > 0 && intervalsType < 4) PView::list[pos]->getOptions()->intervalsType = intervalsType; if(visible >= 0) PView::list[pos]->getOptions()->visible = visible; if(nIntervals > 0) PView::list[pos]->getOptions()->nbIso = nIntervals; - if(raisez>0) PView::list[pos]->getOptions()->raise[2] = raisez; + if(raisez>=0) PView::list[pos]->getOptions()->raise[2] = raisez; PView::list[pos]->setChanged(true); } diff --git a/contrib/mobile/drawContext.cpp b/contrib/mobile/drawContext.cpp index 7727740e6dccfdc5d18b9833bd03c2591606f331..5c453e38dd2c75a984c4d3b626031caf871c033e 100644 --- a/contrib/mobile/drawContext.cpp +++ b/contrib/mobile/drawContext.cpp @@ -216,10 +216,13 @@ void drawContext::initView(int w, int h) this->OrthofFromGModel(); glClearColor(.83,.85,.98,1.); + glDepthMask(GL_TRUE); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glDepthFunc(GL_LESS); } -void drawArray(VertexArray *va, GLint type, bool colorArray) +void drawArray(VertexArray *va, GLint type, bool useColorArray, bool useNormalArray) { if(!va) return; glEnable(GL_BLEND); @@ -227,14 +230,15 @@ void drawArray(VertexArray *va, GLint type, bool colorArray) glShadeModel(GL_SMOOTH); glVertexPointer(3, GL_FLOAT, 0, va->getVertexArray()); glEnableClientState(GL_VERTEX_ARRAY); - glNormalPointer(GL_BYTE, 0, va->getNormalArray()); - glEnableClientState(GL_NORMAL_ARRAY); - if(colorArray){ + if(useNormalArray){ + glNormalPointer(GL_BYTE, 0, va->getNormalArray()); + glEnableClientState(GL_NORMAL_ARRAY); + } + if(useColorArray){ glColorPointer(4, GL_UNSIGNED_BYTE, 0, va->getColorArray()); glEnableClientState(GL_COLOR_ARRAY); } glDrawArrays(type, 0, va->getNumVertices()); - glDisable(GL_POLYGON_OFFSET_FILL); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_COLOR_ARRAY); @@ -346,9 +350,9 @@ void drawContext::drawPView(PView *p) glPointSize((GLfloat)opt->pointSize); glLineWidth((GLfloat)opt->lineWidth); - drawArray(p->va_points, GL_POINTS,true); - drawArray(p->va_lines, GL_LINES,true); - drawArray(p->va_triangles, GL_TRIANGLES,true); + drawArray(p->va_points, GL_POINTS, true); + drawArray(p->va_lines, GL_LINES, true); + drawArray(p->va_triangles, GL_TRIANGLES, true, true); glLineWidth(1); glPointSize(1); @@ -571,14 +575,16 @@ void drawContext::drawView() this->_bottom + (this->_top - this->_bottom)/15.0, 0, (this->_top - this->_bottom)/20.); checkGlError("Draw axes"); - this->drawPost(); - checkGlError("Draw post-pro"); - this->drawGeom(); - checkGlError("Draw geometry"); + glEnable(GL_DEPTH_TEST); this->drawMesh(); checkGlError("Draw mesh"); + this->drawGeom(); + checkGlError("Draw geometry"); + this->drawPost(); + checkGlError("Draw post-pro"); this->drawScale(); checkGlError("Draw scales"); + glDisable(GL_DEPTH_TEST); } std::vector<std::string> commandToVector(const std::string cmd) diff --git a/contrib/mobile/drawContext.h b/contrib/mobile/drawContext.h index 4ea981b43e02131a2f47b88cba2f5c84b386dbba..ef5fd7159740247a2cfb8512104e3aaedfc2b7ab 100644 --- a/contrib/mobile/drawContext.h +++ b/contrib/mobile/drawContext.h @@ -19,7 +19,7 @@ #include "movePosition.h" -void drawArray(VertexArray *va, int type, bool colorArray=false); +void drawArray(VertexArray *va, int type, bool useColorArray=false, bool useNormalArray=false); int onelab_cb(std::string); class drawContext{