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
#24666 [CEA][Windows] BLSURPLUGIN compilation issue
[modules/smesh.git]
/
src
/
SMESH_I
/
SMESH_Gen_i.cxx
diff --git
a/src/SMESH_I/SMESH_Gen_i.cxx
b/src/SMESH_I/SMESH_Gen_i.cxx
index e89466cfbdc42868373a38f9e039a2d55e9b2525..f997c096c0c56fc3bbbc8ad1a48fe1b0f02fb843 100644
(file)
--- a/
src/SMESH_I/SMESH_Gen_i.cxx
+++ b/
src/SMESH_I/SMESH_Gen_i.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-202
0
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-202
1
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
@@
-237,6
+237,14
@@
CORBA::Object_var SMESH_Gen_i::SObjectToObject( SALOMEDS::SObject_ptr theSObject
return anObj;
}
return anObj;
}
+// Set Naming Service object
+void SMESH_Gen_i::SetNS(SALOME_NamingService_Abstract *ns)
+{
+ if(myNS)
+ delete myNS;
+ myNS = ns;
+}
+
//=============================================================================
/*!
* GetNS [ static ]
//=============================================================================
/*!
* GetNS [ static ]
@@
-247,7
+255,7
@@
CORBA::Object_var SMESH_Gen_i::SObjectToObject( SALOMEDS::SObject_ptr theSObject
SALOME_NamingService_Abstract* SMESH_Gen_i::GetNS()
{
SALOME_NamingService_Abstract* SMESH_Gen_i::GetNS()
{
- if (
myNS == NULL
) {
+ if (
!myNS
) {
myNS = SINGLETON_<SALOME_NamingService>::Instance();
ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting());
myNS->init_orb( GetORB() );
myNS = SINGLETON_<SALOME_NamingService>::Instance();
ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting());
myNS->init_orb( GetORB() );
@@
-2315,9
+2323,8
@@
SMESH::MeshPreviewStruct* SMESH_Gen_i::Precompute( SMESH::SMESH_Mesh_ptr theMesh
*/
//=============================================================================
*/
//=============================================================================
-SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
- GEOM::GEOM_Object_ptr theShapeObject)
-// SMESH::long_array& theNbElems)
+SMESH::smIdType_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
+ GEOM::GEOM_Object_ptr theShapeObject)
{
Unexpect aCatch(SALOME_SalomeException);
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::Evaluate" );
{
Unexpect aCatch(SALOME_SalomeException);
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::Evaluate" );
@@
-2328,7
+2335,7
@@
SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
if ( CORBA::is_nil( theMesh ) )
THROW_SALOME_CORBA_EXCEPTION( "bad Mesh reference", SALOME::BAD_PARAM );
if ( CORBA::is_nil( theMesh ) )
THROW_SALOME_CORBA_EXCEPTION( "bad Mesh reference", SALOME::BAD_PARAM );
- SMESH::
long_array_var nbels = new SMESH::long
_array;
+ SMESH::
smIdType_array_var nbels = new SMESH::smIdType
_array;
nbels->length(SMESH::Entity_Last);
int i = SMESH::Entity_Node;
for (; i < SMESH::Entity_Last; i++)
nbels->length(SMESH::Entity_Last);
int i = SMESH::Entity_Node;
for (; i < SMESH::Entity_Last; i++)
@@
-2358,9
+2365,9
@@
SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
/*CORBA::Boolean ret =*/ myGen.Evaluate( myLocMesh, myLocShape, aResMap);
MapShapeNbElemsItr anIt = aResMap.begin();
for(; anIt!=aResMap.end(); anIt++) {
/*CORBA::Boolean ret =*/ myGen.Evaluate( myLocMesh, myLocShape, aResMap);
MapShapeNbElemsItr anIt = aResMap.begin();
for(; anIt!=aResMap.end(); anIt++) {
- const vector<
int
>& aVec = (*anIt).second;
+ const vector<
smIdType
>& aVec = (*anIt).second;
for ( i = SMESH::Entity_Node; i < (int)aVec.size(); i++ ) {
for ( i = SMESH::Entity_Node; i < (int)aVec.size(); i++ ) {
-
int
nbElem = aVec[i];
+
smIdType
nbElem = aVec[i];
if ( nbElem < 0 ) // algo failed, check that it has reported a message
{
SMESH_subMesh* sm = anIt->first;
if ( nbElem < 0 ) // algo failed, check that it has reported a message
{
SMESH_subMesh* sm = anIt->first;
@@
-2403,7
+2410,7
@@
SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr
SMESH_Gen_i::GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr
SMESH_Gen_i::GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
-
CORBA::Long
theElementID,
+
SMESH::smIdType
theElementID,
const char* theGeomName)
{
Unexpect aCatch(SALOME_SalomeException);
const char* theGeomName)
{
Unexpect aCatch(SALOME_SalomeException);
@@
-2467,7
+2474,7
@@
SMESH_Gen_i::GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr
SMESH_Gen_i::FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr
SMESH_Gen_i::FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
-
CORBA::Long
theElementID)
+
SMESH::smIdType
theElementID)
{
Unexpect aCatch(SALOME_SalomeException);
if ( CORBA::is_nil( theMesh ) )
{
Unexpect aCatch(SALOME_SalomeException);
if ( CORBA::is_nil( theMesh ) )
@@
-2655,7
+2662,7
@@
SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray,
}
// remember nb of elements before filling in
}
// remember nb of elements before filling in
- SMESH::
long
_array_var prevState = newMesh->GetNbElementsByType();
+ SMESH::
smIdType
_array_var prevState = newMesh->GetNbElementsByType();
// copy nodes
// copy nodes
@@
-2700,12
+2707,12
@@
SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray,
{
// type names
const char* typeNames[] = { "All","Nodes","Edges","Faces","Volumes","0DElems","Balls" };
{
// type names
const char* typeNames[] = { "All","Nodes","Edges","Faces","Volumes","0DElems","Balls" };
- { // check of typeNames: compilation failure mains that NB_ELEMENT_TYPES changed:
- const int nbNames = sizeof(typeNames) / sizeof(const char*);
- int _assert[( nbNames == SMESH::NB_ELEMENT_TYPES ) ? 2 : -1 ]; _assert[0]=_assert[1]=0;
- }
- SMESH::long_array_var curState = newMesh->GetNbElementsByType();
+ // check of typeNames: compilation failure mains that NB_ELEMENT_TYPES changed:
+ static_assert( sizeof(typeNames) / sizeof(const char*) ==SMESH::NB_ELEMENT_TYPES,
+ "Update names of ElementType's!!!" );
+
+ SMESH::smIdType_array_var curState = newMesh->GetNbElementsByType();
for( groupType = SMESH::NODE;
groupType < SMESH::NB_ELEMENT_TYPES;
for( groupType = SMESH::NODE;
groupType < SMESH::NB_ELEMENT_TYPES;
@@
-2752,7
+2759,7
@@
SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray,
SMESH::SMESH_GroupBase_ptr group;
CORBA::String_var groupName;
SMESH::SMESH_GroupBase_ptr group;
CORBA::String_var groupName;
- SMESH::
long_array_var newIDs = new SMESH::long
_array();
+ SMESH::
smIdType_array_var newIDs = new SMESH::smIdType
_array();
// loop on groups of a source mesh
SMESH::ListOfGroups_var listOfGroups = initImpl->GetGroups();
// loop on groups of a source mesh
SMESH::ListOfGroups_var listOfGroups = initImpl->GetGroups();
@@
-2917,7
+2924,7
@@
SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
}
else
{
}
else
{
- SMESH::
long
_array_var ids = meshPart->GetIDs();
+ SMESH::
smIdType
_array_var ids = meshPart->GetIDs();
if ( srcElemTypes->length() == 1 && srcElemTypes[0] == SMESH::NODE ) // group of nodes
{
for ( CORBA::ULong i=0; i < ids->length(); i++ )
if ( srcElemTypes->length() == 1 && srcElemTypes[0] == SMESH::NODE ) // group of nodes
{
for ( CORBA::ULong i=0; i < ids->length(); i++ )
@@
-3040,8
+3047,8
@@
SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
{
TE2EMap & e2eMap = e2eMapByType[ groupDS->GetType() ];
if ( e2eMap.empty() ) continue;
{
TE2EMap & e2eMap = e2eMapByType[ groupDS->GetType() ];
if ( e2eMap.empty() ) continue;
-
int
minID = e2eMap.begin()->first->GetID();
-
int
maxID = e2eMap.rbegin()->first->GetID();
+
smIdType
minID = e2eMap.begin()->first->GetID();
+
smIdType
maxID = e2eMap.rbegin()->first->GetID();
TE2EMap::iterator e2e;
while ( eIt->more() && groupElems.size() < e2eMap.size())
{
TE2EMap::iterator e2e;
while ( eIt->more() && groupElems.size() < e2eMap.size())
{
@@
-3872,7
+3879,7
@@
CORBA::Boolean SMESH_Gen_i::CopyMeshWithGeom( SMESH::SMESH_Mesh_ptr theSou
{
if ( newMeshDS->GetMeshInfo().NbElements( SMDSAbs_ElementType( elemType )) > 0 )
{
{
if ( newMeshDS->GetMeshInfo().NbElements( SMDSAbs_ElementType( elemType )) > 0 )
{
- SMESH::
long
_array_var elemIDs = stdlGroup->GetIDs();
+ SMESH::
smIdType
_array_var elemIDs = stdlGroup->GetIDs();
const bool isElem = ( elemType != SMESH::NODE );
CORBA::ULong iE = 0;
for ( ; iE < elemIDs->length(); ++iE ) // check if any element has been copied
const bool isElem = ( elemType != SMESH::NODE );
CORBA::ULong iE = 0;
for ( ; iE < elemIDs->length(); ++iE ) // check if any element has been copied
@@
-4199,8
+4206,9
@@
SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
system(cmd.ToCString());
// MED writer to be used by storage process
system(cmd.ToCString());
// MED writer to be used by storage process
- DriverMED_W_SMESHDS_Mesh myWriter;
- myWriter.SetFile( meshfile.ToCString() );
+ DriverMED_W_SMESHDS_Mesh writer;
+ writer.SetFile( meshfile.ToCString() );
+ //writer.SetSaveNumbers( false ); // bos #24400 -- it leads to change of element IDs
// IMP issue 20918
// SetStoreName() to groups before storing hypotheses to let them refer to
// IMP issue 20918
// SetStoreName() to groups before storing hypotheses to let them refer to
@@
-4407,8
+4415,8
@@
SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
// check if the mesh is not empty
if ( mySMESHDSMesh->NbNodes() > 0 ) {
// write mesh data to med file
// check if the mesh is not empty
if ( mySMESHDSMesh->NbNodes() > 0 ) {
// write mesh data to med file
-
myW
riter.SetMesh( mySMESHDSMesh );
-
myW
riter.SetMeshId( id );
+
w
riter.SetMesh( mySMESHDSMesh );
+
w
riter.SetMeshId( id );
strHasData = "1";
}
aSize[ 0 ] = strHasData.length() + 1;
strHasData = "1";
}
aSize[ 0 ] = strHasData.length() + 1;
@@
-4456,7
+4464,7
@@
SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
// write reference on a shape if exists
SALOMEDS::SObject_wrap myRef;
bool shapeRefFound = false;
// write reference on a shape if exists
SALOMEDS::SObject_wrap myRef;
bool shapeRefFound = false;
- bool found = gotBranch->FindSubObject( GetRefOnShapeTag(), myRef.inout() );
+ bool found = gotBranch->FindSubObject(
(CORBA::Long)
GetRefOnShapeTag(), myRef.inout() );
if ( found ) {
SALOMEDS::SObject_wrap myShape;
bool ok = myRef->ReferencedObject( myShape.inout() );
if ( found ) {
SALOMEDS::SObject_wrap myShape;
bool ok = myRef->ReferencedObject( myShape.inout() );
@@
-4487,7
+4495,7
@@
SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
// write applied hypotheses if exist
SALOMEDS::SObject_wrap myHypBranch;
// write applied hypotheses if exist
SALOMEDS::SObject_wrap myHypBranch;
- found = gotBranch->FindSubObject( GetRefOnAppliedHypothesisTag(), myHypBranch.inout() );
+ found = gotBranch->FindSubObject(
(CORBA::Long)
GetRefOnAppliedHypothesisTag(), myHypBranch.inout() );
if ( found && !shapeRefFound && hasShape ) { // remove applied hyps
aStudy->NewBuilder()->RemoveObjectWithChildren( myHypBranch );
}
if ( found && !shapeRefFound && hasShape ) { // remove applied hyps
aStudy->NewBuilder()->RemoveObjectWithChildren( myHypBranch );
}
@@
-4882,7
+4890,7
@@
SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
// Pass SMESHDS_Group to MED writer
SMESHDS_Group* aGrpDS = dynamic_cast<SMESHDS_Group*>( aGrpBaseDS );
if ( aGrpDS )
// Pass SMESHDS_Group to MED writer
SMESHDS_Group* aGrpDS = dynamic_cast<SMESHDS_Group*>( aGrpBaseDS );
if ( aGrpDS )
-
myW
riter.AddGroup( aGrpDS );
+
w
riter.AddGroup( aGrpDS );
// write reference on a shape if exists
SMESHDS_GroupOnGeom* aGeomGrp =
// write reference on a shape if exists
SMESHDS_GroupOnGeom* aGeomGrp =
@@
-4907,7
+4915,7
@@
SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
else // shape ref is invalid:
{
// save a group on geometry as ordinary group
else // shape ref is invalid:
{
// save a group on geometry as ordinary group
-
myW
riter.AddGroup( aGeomGrp );
+
w
riter.AddGroup( aGeomGrp );
}
}
else if ( SMESH_GroupOnFilter_i* aFilterGrp_i =
}
}
else if ( SMESH_GroupOnFilter_i* aFilterGrp_i =
@@
-4930,7
+4938,7
@@
SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
if ( strcmp( strHasData.c_str(), "1" ) == 0 )
{
// Flush current mesh information into MED file
if ( strcmp( strHasData.c_str(), "1" ) == 0 )
{
// Flush current mesh information into MED file
-
myW
riter.Perform();
+
w
riter.Perform();
// save info on nb of elements
SMESH_PreMeshInfo::SaveToFile( myImpl, id, aFile );
// save info on nb of elements
SMESH_PreMeshInfo::SaveToFile( myImpl, id, aFile );
@@
-4957,7
+4965,7
@@
SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
{
SMDS_ElemIteratorPtr eIt =
mySMESHDSMesh->elementsIterator( isNode ? SMDSAbs_Node : SMDSAbs_All );
{
SMDS_ElemIteratorPtr eIt =
mySMESHDSMesh->elementsIterator( isNode ? SMDSAbs_Node : SMDSAbs_All );
-
int
nbElems = isNode ? mySMESHDSMesh->NbNodes() : mySMESHDSMesh->GetMeshInfo().NbElements();
+
smIdType
nbElems = isNode ? mySMESHDSMesh->NbNodes() : mySMESHDSMesh->GetMeshInfo().NbElements();
if ( nbElems < 1 )
continue;
std::vector<int> smIDs; smIDs.reserve( nbElems );
if ( nbElems < 1 )
continue;
std::vector<int> smIDs; smIDs.reserve( nbElems );
@@
-4998,7
+5006,7
@@
SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
SMESHDS_SubMesh* aSubMesh = const_cast< SMESHDS_SubMesh* >( smIt->next() );
if ( aSubMesh->IsComplexSubmesh() )
continue; // submesh containing other submeshs
SMESHDS_SubMesh* aSubMesh = const_cast< SMESHDS_SubMesh* >( smIt->next() );
if ( aSubMesh->IsComplexSubmesh() )
continue; // submesh containing other submeshs
-
int
nbNodes = aSubMesh->NbNodes();
+
smIdType
nbNodes = aSubMesh->NbNodes();
if ( nbNodes == 0 ) continue;
int aShapeID = aSubMesh->GetID();
if ( nbNodes == 0 ) continue;
int aShapeID = aSubMesh->GetID();
@@
-5540,7
+5548,7
@@
bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
}
} // reading MESHes
}
} // reading MESHes
- // As all object that can be referred by hypothesis are created,
+ // As all object
s
that can be referred by hypothesis are created,
// we can restore hypothesis data
list< pair< SMESH_Hypothesis_i*, string > >::iterator hyp_data;
// we can restore hypothesis data
list< pair< SMESH_Hypothesis_i*, string > >::iterator hyp_data;
@@
-5716,7
+5724,7
@@
bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
if ( aSubMesh->_is_nil() )
continue;
string iorSubString = GetORB()->object_to_string( aSubMesh );
if ( aSubMesh->_is_nil() )
continue;
string iorSubString = GetORB()->object_to_string( aSubMesh );
- int newSubId = myStudyContext->findId( iorSubString );
+ int
newSubId = myStudyContext->findId( iorSubString );
myStudyContext->mapOldToNew( subid, newSubId );
}
}
myStudyContext->mapOldToNew( subid, newSubId );
}
}
@@
-6233,7
+6241,7
@@
int SMESH_Gen_i::RegisterObject(CORBA::Object_ptr theObject)
*/
//================================================================================
*/
//================================================================================
-CORBA::Long SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject)
+CORBA::Long
SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject)
{
if ( myStudyContext && !CORBA::is_nil( theObject )) {
string iorString = GetORB()->object_to_string( theObject );
{
if ( myStudyContext && !CORBA::is_nil( theObject )) {
string iorString = GetORB()->object_to_string( theObject );
@@
-6533,7
+6541,7
@@
std::vector<long> SMESH_Gen_i::_GetInside( SMESH::SMESH_IDSource_ptr meshPart,
SMESH::SMESH_Group_var gsource = SMESH::SMESH_Group::_narrow(meshPart);
if ( !gsource->_is_nil() ) {
if(theElemType == SMESH::NODE) {
SMESH::SMESH_Group_var gsource = SMESH::SMESH_Group::_narrow(meshPart);
if ( !gsource->_is_nil() ) {
if(theElemType == SMESH::NODE) {
- SMESH::
long
_array_var nodes = gsource->GetNodeIDs();
+ SMESH::
smIdType
_array_var nodes = gsource->GetNodeIDs();
for ( CORBA::ULong i = 0; i < nodes->length(); ++i ) {
if ( const SMDS_MeshNode* node = meshDS->FindNode( nodes[i] )) {
long anId = node->GetID();
for ( CORBA::ULong i = 0; i < nodes->length(); ++i ) {
if ( const SMDS_MeshNode* node = meshDS->FindNode( nodes[i] )) {
long anId = node->GetID();
@@
-6542,7
+6550,7
@@
std::vector<long> SMESH_Gen_i::_GetInside( SMESH::SMESH_IDSource_ptr meshPart,
}
}
} else if (gsource->GetType() == theElemType || theElemType == SMESH::ALL ) {
}
}
} else if (gsource->GetType() == theElemType || theElemType == SMESH::ALL ) {
- SMESH::
long
_array_var elems = gsource->GetListOfID();
+ SMESH::
smIdType
_array_var elems = gsource->GetListOfID();
for ( CORBA::ULong i = 0; i < elems->length(); ++i ) {
if ( const SMDS_MeshElement* elem = meshDS->FindElement( elems[i] )) {
long anId = elem->GetID();
for ( CORBA::ULong i = 0; i < elems->length(); ++i ) {
if ( const SMDS_MeshElement* elem = meshDS->FindElement( elems[i] )) {
long anId = elem->GetID();
@@
-6554,7
+6562,7
@@
std::vector<long> SMESH_Gen_i::_GetInside( SMESH::SMESH_IDSource_ptr meshPart,
}
SMESH::SMESH_subMesh_var smsource = SMESH::SMESH_subMesh::_narrow(meshPart);
if ( !smsource->_is_nil() ) {
}
SMESH::SMESH_subMesh_var smsource = SMESH::SMESH_subMesh::_narrow(meshPart);
if ( !smsource->_is_nil() ) {
- SMESH::
long
_array_var elems = smsource->GetElementsByType( theElemType );
+ SMESH::
smIdType
_array_var elems = smsource->GetElementsByType( theElemType );
for ( CORBA::ULong i = 0; i < elems->length(); ++i ) {
const SMDS_MeshElement* elem = ( theElemType == SMESH::NODE ) ? meshDS->FindNode( elems[i] ) : meshDS->FindElement( elems[i] );
if (elem) {
for ( CORBA::ULong i = 0; i < elems->length(); ++i ) {
const SMDS_MeshElement* elem = ( theElemType == SMESH::NODE ) ? meshDS->FindNode( elems[i] ) : meshDS->FindElement( elems[i] );
if (elem) {