Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
22806: EDF SMESH: Regression: Prism_3D error
[modules/smesh.git]
/
src
/
SMESH_I
/
SMESH_Gen_i_1.cxx
diff --git
a/src/SMESH_I/SMESH_Gen_i_1.cxx
b/src/SMESH_I/SMESH_Gen_i_1.cxx
index a3bc1733171339e1d0f5e16efeb89cd3e41a892a..b59479fce561d0c5a843b181968fc5604a4b7b76 100644
(file)
--- a/
src/SMESH_I/SMESH_Gen_i_1.cxx
+++ b/
src/SMESH_I/SMESH_Gen_i_1.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
3
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
4
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-6,7
+6,7
@@
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License
, or (at your option) any later version
.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-43,6
+43,8
@@
#include <TCollection_AsciiString.hxx>
#include <TopoDS_Solid.hxx>
#include <TCollection_AsciiString.hxx>
#include <TopoDS_Solid.hxx>
+#include <cctype>
+
#ifdef _DEBUG_
static int MYDEBUG = 0;
//static int VARIABLE_DEBUG = 0;
#ifdef _DEBUG_
static int MYDEBUG = 0;
//static int VARIABLE_DEBUG = 0;
@@
-160,7
+162,7
@@
long SMESH_Gen_i::GetBallElementsGroupsTag()
bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
{
if(MYDEBUG) MESSAGE("CanPublishInStudy - "<<!CORBA::is_nil(myCurrentStudy));
bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
{
if(MYDEBUG) MESSAGE("CanPublishInStudy - "<<!CORBA::is_nil(myCurrentStudy));
- if(
CORBA::is_nil(myCurrentStudy)
)
+ if(
GetCurrentStudyID() < 0
)
return false;
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(theIOR);
return false;
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(theIOR);
@@
-341,9
+343,15
@@
void SMESH_Gen_i::SetName(SALOMEDS::SObject_ptr theSObject,
SALOMEDS::GenericAttribute_wrap anAttr =
aStudyBuilder->FindOrCreateAttribute( theSObject, "AttributeName" );
SALOMEDS::AttributeName_wrap aNameAttr = anAttr;
SALOMEDS::GenericAttribute_wrap anAttr =
aStudyBuilder->FindOrCreateAttribute( theSObject, "AttributeName" );
SALOMEDS::AttributeName_wrap aNameAttr = anAttr;
- if ( theName && strlen( theName ) != 0 )
- aNameAttr->SetValue( theName );
- else {
+ if ( theName && theName[0] ) {
+ std::string name( theName ); // trim trailing white spaces
+ for ( size_t i = name.size()-1; i > 0; --i )
+ if ( isspace( name[i] )) name[i] = '\0';
+ else break;
+ aNameAttr->SetValue( name.c_str() );
+ }
+ else
+ {
CORBA::String_var curName = aNameAttr->Value();
if ( strlen( curName.in() ) == 0 ) {
SMESH_Comment aName(theDefaultName);
CORBA::String_var curName = aNameAttr->Value();
if ( strlen( curName.in() ) == 0 ) {
SMESH_Comment aName(theDefaultName);
@@
-355,7
+363,7
@@
void SMESH_Gen_i::SetName(SALOMEDS::SObject_ptr theSObject,
//=======================================================================
//function : SetPixMap
//=======================================================================
//function : SetPixMap
-//purpose :
+//purpose :
//=======================================================================
void SMESH_Gen_i::SetPixMap(SALOMEDS::SObject_ptr theSObject,
//=======================================================================
void SMESH_Gen_i::SetPixMap(SALOMEDS::SObject_ptr theSObject,