From 5a32f9edcdd9d5d37782a3116e8b98fccafc1168 Mon Sep 17 00:00:00 2001 From: gdd Date: Tue, 23 Aug 2011 12:00:34 +0000 Subject: [PATCH] Fix bug when no hypothesis is defined. --- src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx | 4 +++- src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx | 9 +++++++-- src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) 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 -- 2.39.2