From 113760ae44df4b84fe712a9dd4bd694588a8a13c Mon Sep 17 00:00:00 2001 From: bourcier Date: Tue, 8 Oct 2013 11:56:53 +0000 Subject: [PATCH] Fix bug with dump study in PreCad periodicity without vertices set from GUI --- src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx index 8321191..f4d0d3b 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx @@ -2413,17 +2413,23 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi bool onFace = (periodicity_i[PERIODICITY_SHAPE_TYPE]=="1") ? true : false; BLSURFPlugin::TEntryList_var sourceVertices = new BLSURFPlugin::TEntryList(); - sourceVertices->length(3); - sourceVertices[0]=CORBA::string_dup(p1Source.c_str()); - sourceVertices[1]=CORBA::string_dup(p2Source.c_str()); - sourceVertices[2]=CORBA::string_dup(p3Source.c_str()); + if (not p1Source.empty()) + { + sourceVertices->length(3); + sourceVertices[0]=CORBA::string_dup(p1Source.c_str()); + sourceVertices[1]=CORBA::string_dup(p2Source.c_str()); + sourceVertices[2]=CORBA::string_dup(p3Source.c_str()); + } BLSURFPlugin::TEntryList_var targetVertices = new BLSURFPlugin::TEntryList(); - targetVertices->length(3); - targetVertices[0]=CORBA::string_dup(p1Target.c_str()); - targetVertices[1]=CORBA::string_dup(p2Target.c_str()); - targetVertices[2]=CORBA::string_dup(p3Target.c_str()); + if (not p1Target.empty()) + { + targetVertices->length(3); + targetVertices[0]=CORBA::string_dup(p1Target.c_str()); + targetVertices[1]=CORBA::string_dup(p2Target.c_str()); + targetVertices[2]=CORBA::string_dup(p3Target.c_str()); + } if (onFace) h->AddPreCadFacesPeriodicityEntry(source.c_str(), target.c_str(), sourceVertices, targetVertices); -- 2.39.2