diff --git a/Geo/MElement.cpp b/Geo/MElement.cpp index ffb98b2a5d2d0851842391ca20eac3769101f8c0..1eb6015326564247a64f1610c8c0a814844fd5b5 100644 --- a/Geo/MElement.cpp +++ b/Geo/MElement.cpp @@ -620,44 +620,6 @@ void MElement::writeBDF(FILE *fp, int format, int elementary) void MElement::writeDIFF(FILE *fp, bool binary, int physical_property) { - /* nbn = 4; - if(s->VSUP) { - type = TETRAHEDRON_2; - nbs = 6; - if(s->Volume_Simplexe() < 0) { - Vertex *temp; - temp = s->V[0]; s->V[0] = s->V[1]; s->V[1] = temp; - temp = s->VSUP[1]; s->VSUP[1] = s->VSUP[2]; s->VSUP[2] = temp; - temp = s->VSUP[5]; s->VSUP[5] = s->VSUP[3]; s->VSUP[3] = temp; - } - } - else{ - type = TETRAHEDRON; - if(s->Volume_Simplexe() < 0) { - Vertex *temp; - temp = s->V[0]; - s->V[0] = s->V[1]; - s->V[1] = temp; - } - } - fprintf(MSHFILE, "%d %d 2 %d %d", - MSH_ELEMENT_NUM++, type, MSH_PHYSICAL_NUM ? MSH_PHYSICAL_NUM : s->iEnt, - s->iEnt); - - if(DIFF_PHYSICAL_ORI > 0) { - for(i = 0; i < nbn; i++) - fprintf(DIFFFILE, " %d", s->V[i]->Num); - for(i = 0; i < nbs; i++) - fprintf(DIFFFILE, " %d", s->VSUP[i]->Num); - } - else { - for(i = 0; i < nbn; i++) - fprintf(DIFFFILE, " %d", s->V[nbn - i - 1]->Num); - for(i = 0; i < nbs; i++) - fprintf(DIFFFILE, " %d", s->VSUP[nbs - i - 1]->Num); - } - fprintf(DIFFFILE, "\n");*/ - int type = getTypeForDIFF(); if(!type) return; static int first = 1; diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp index ba4edd87867902196dd38f07c4f470ebda1d4ea9..59e4c76bdade3533ae50b0c85b062ea0851403b9 100644 --- a/Mesh/Field.cpp +++ b/Mesh/Field.cpp @@ -1331,18 +1331,19 @@ Field::Field() } #if !defined(HAVE_NO_POST) -void Field::put_on_new_view(){ +void Field::put_on_new_view() +{ std::map<int, std::vector<double> > d; std::vector<GEntity*> entities; GModel::current()->getEntities(entities); for(unsigned int i = 0; i < entities.size(); i++){ - for(unsigned int j = 0; j < entities[i]->mesh_vertices.size(); j++){ - MVertex *v = entities[i]->mesh_vertices[j]; - d[v->getNum()].push_back((*this)(v->x(),v->y(),v->z(),entities[i])); - } + for(unsigned int j = 0; j < entities[i]->mesh_vertices.size(); j++){ + MVertex *v = entities[i]->mesh_vertices[j]; + d[v->getNum()].push_back((*this)(v->x(), v->y(), v->z(), entities[i])); + } } std::ostringstream oss; - oss<<"Field "<<id; + oss << "Field " << id; PView *view= new PView(oss.str().c_str(), "NodeData", GModel::current(), d); view->setChanged(true); } diff --git a/Post/PViewOptions.cpp b/Post/PViewOptions.cpp index cac0c95175a31d857f7490b00f52141dfb3bf7f5..e1289b31e2edfa3e46ab0dcec6a04b85dfd7dd61 100644 --- a/Post/PViewOptions.cpp +++ b/Post/PViewOptions.cpp @@ -46,7 +46,6 @@ double PViewOptions::getScaleValue(int iso, int numIso, double min, double max) return 0.; } -// return index between 0 and (numIso-1) int PViewOptions::getScaleIndex(double val, int numIso, double min, double max, bool forceLinear) { @@ -67,7 +66,6 @@ int PViewOptions::getScaleIndex(double val, int numIso, double min, double max, return 0; } -// val in [min, max] unsigned int PViewOptions::getColor(double val, double min, double max, bool forceLinear, int numColors) { @@ -88,7 +86,6 @@ unsigned int PViewOptions::getColor(double val, double min, double max, } } -// i in [0, nb - 1] unsigned int PViewOptions::getColor(int i, int nb) { int index = (nb == 1) ? CT.size / 2 : diff --git a/Post/PViewOptions.h b/Post/PViewOptions.h index ce466e949e59f908b95ffc313ae01f60754ad654..e3c2cad1b749c8801e91e6041ca77d453be8aaf2 100644 --- a/Post/PViewOptions.h +++ b/Post/PViewOptions.h @@ -96,14 +96,23 @@ class PViewOptions { static PViewOptions reference; PViewOptions(); ~PViewOptions(); - void createGeneralRaise(); - void destroyGeneralRaise(); + // return a floating point value in [min, max] corresponding to the + // integer iso in [0, numIso - 1] double getScaleValue(int iso, int numIso, double min, double max); + // return an integer in [0, numIso - 1] corresponding to the + // floating point value val in [min, max] int getScaleIndex(double val, int numIso, double min, double max, bool forceLinear=false); - unsigned int getColor(int i, int nb); + // get color for val in [min, max] (only use numColors if > 0 + // instead of all available colors) unsigned int getColor(double val, double min, double max, bool forceLinear=false, int numColors=-1); + // get i-th color amongst nb (i in [0, nb - 1]) + unsigned int getColor(int i, int nb); + // create/destroy math evaluators for general raise option + void createGeneralRaise(); + void destroyGeneralRaise(); + // return true if one should not draw elements with numEdges edges bool skipElement(int numEdges); }; diff --git a/doc/VERSIONS.txt b/doc/VERSIONS.txt index 9517c27282208db3cb958f35b94e12254c868dea..264bdc3ae84232502ddf9084cce0a4bc10a74c42 100644 --- a/doc/VERSIONS.txt +++ b/doc/VERSIONS.txt @@ -1,7 +1,7 @@ -$Id: VERSIONS.txt,v 1.7 2008-10-05 16:57:23 geuzaine Exp $ +$Id: VERSIONS.txt,v 1.8 2008-10-20 18:40:14 geuzaine Exp $ -2.2.5: lots of small bug fixes; upgrade Netgen; builing now requires -FLTK >= 1.1.7; added Visual C++ support. +2.2.5: lots of small bug fixes; upgrade Netgen; better STL import; +builing now requires FLTK >= 1.1.7; added support for Visual C++. 2.2.4 (Aug 14, 2008): integrated Metis and Chaco mesh partitioners; variables can now be deleted in geo files; added support for point