From: gdd Date: Tue, 23 Aug 2011 12:00:34 +0000 (+0000) Subject: Fix bug when no hypothesis is defined. X-Git-Tag: V6_4_0a1~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5a32f9edcdd9d5d37782a3116e8b98fccafc1168;p=plugins%2Fblsurfplugin.git Fix bug when no hypothesis is defined. --- diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx index 191a186..ebae152 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx @@ -1592,7 +1592,9 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) //return false; } - std::string GMFFileName = _hypothesis->GetGMFFile(); + std::string GMFFileName = BLSURFPlugin_Hypothesis::GetDefaultGMFFile(); + if (_hypothesis) + GMFFileName = _hypothesis->GetGMFFile(); if (GMFFileName != "") { // bool GMFFileMode = _hypothesis->GetGMFFileMode(); bool asciiFound = (GMFFileName.find(".mesh",GMFFileName.length()-5) != std::string::npos); diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx index d425913..feb9401 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx @@ -68,7 +68,8 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_G _coordsEnfVertexMap(GetDefaultCoordsEnfVertexMap()), _faceEntryEnfVertexEntryListMap(GetDefaultFaceEntryEnfVertexEntryListMap()), _enfVertexEntryEnfVertexMap(GetDefaultEnfVertexEntryEnfVertexMap()), - _groupNameNodeIDMap(GetDefaultGroupNameNodeIDMap()) + _groupNameNodeIDMap(GetDefaultGroupNameNodeIDMap()), + _GMFFileName(GetDefaultGMFFile()) /* TODO GROUPS _groupNameEnfVertexListMap(GetDefaultGroupNameEnfVertexListMap()), _enfVertexGroupNameMap(GetDefaultEnfVertexGroupNameMap()) @@ -77,7 +78,6 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_G _name = "BLSURF_Parameters"; _param_algo_dim = 2; - _GMFFileName = ""; // no GMF export // _GMFFileMode = false; // GMF ascii mode // to disable writing boundaries @@ -1590,3 +1590,8 @@ bool BLSURFPlugin_Hypothesis::GetDefaultDecimesh() { double BLSURFPlugin_Hypothesis::GetDefaultPreCADEpsNano() { return undefinedDouble(); //1e-4; } + +//====================================================================== +std::string BLSURFPlugin_Hypothesis::GetDefaultGMFFile() { + return ""; +} diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx index f6bdec6..9e47632 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx @@ -324,6 +324,7 @@ public: // void SetGMFFile(const std::string& theFileName, bool isBinary); void SetGMFFile(const std::string& theFileName); std::string GetGMFFile() const { return _GMFFileName; } + static std::string GetDefaultGMFFile(); // bool GetGMFFileMode() const { return _GMFFileMode; } // Persistence