Skip to content
Snippets Groups Projects
Commit 77ac0b7e authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix BDF small field export on Windows (apparently Windows does not conform
to ANSI C and uses 3 digits in %e instead of 2)
parent 76180afe
No related branches found
No related tags found
No related merge requests found
// $Id: MVertex.cpp,v 1.15 2007-09-04 13:47:01 remacle Exp $ // $Id: MVertex.cpp,v 1.16 2007-09-21 16:22:51 geuzaine Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -118,6 +118,16 @@ static void double_to_char8(double val, char *str){ ...@@ -118,6 +118,16 @@ static void double_to_char8(double val, char *str){
sprintf(str, "%f", val); sprintf(str, "%f", val);
else else
sprintf(str, "%.1E", val); sprintf(str, "%.1E", val);
#if defined(WIN32)
// Windows uses 3 digits in the exponent (which apparently does not
// conform with ANSI C): remove the extra 0
if(strlen(str) == 9 && (str[4] == 'E' || str[5] == 'E')){
str[6] = str[7];
str[7] = str[8];
}
#endif
str[8] = '\0'; str[8] = '\0';
} }
...@@ -160,13 +170,11 @@ MVertex::linearSearch(std::set<MVertex*, MVertexLessThanLexicographic> &pos) ...@@ -160,13 +170,11 @@ MVertex::linearSearch(std::set<MVertex*, MVertexLessThanLexicographic> &pos)
void parametricCoordinates(const MVertex *ver, const GFace *gf, double &u, double &v) void parametricCoordinates(const MVertex *ver, const GFace *gf, double &u, double &v)
{ {
GEntity *ge = ver->onWhat(); GEntity *ge = ver->onWhat();
if (ge->dim() == 2) if(ge->dim() == 2){
{
ver->getParameter(0, u); ver->getParameter(0, u);
ver->getParameter(1, v); ver->getParameter(1, v);
} }
else if (ge->dim() == 1) else if(ge->dim() == 1){
{
double t; double t;
ver->getParameter(0, t); ver->getParameter(0, t);
GEdge *ged = dynamic_cast<GEdge*>(ge); GEdge *ged = dynamic_cast<GEdge*>(ge);
...@@ -174,8 +182,7 @@ void parametricCoordinates ( const MVertex*ver, const GFace *gf, double &u, doub ...@@ -174,8 +182,7 @@ void parametricCoordinates ( const MVertex*ver, const GFace *gf, double &u, doub
u = p.x(); u = p.x();
v = p.y(); v = p.y();
} }
else else{
{
GVertex *gver = dynamic_cast<GVertex*>(ge); GVertex *gver = dynamic_cast<GVertex*>(ge);
SPoint2 p = gver->reparamOnFace((GFace*)gf, 1); SPoint2 p = gver->reparamOnFace((GFace*)gf, 1);
u = p.x(); u = p.x();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment