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
Set dev version marker to 1.
[modules/smesh.git]
/
src
/
SMESH_I
/
SMESH_Mesh_i.cxx
diff --git
a/src/SMESH_I/SMESH_Mesh_i.cxx
b/src/SMESH_I/SMESH_Mesh_i.cxx
index f777d3ae003eddc6bed1274cd5d05ac5c88c6dd5..05043f6f280e79bf53a2a6506355623c447721c9 100644
(file)
--- a/
src/SMESH_I/SMESH_Mesh_i.cxx
+++ b/
src/SMESH_I/SMESH_Mesh_i.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
5
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
6
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
@@
-108,7
+108,6
@@
SMESH_Mesh_i::SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
CORBA::Long studyId )
: SALOME::GenericObj_i( thePOA )
{
CORBA::Long studyId )
: SALOME::GenericObj_i( thePOA )
{
- MESSAGE("SMESH_Mesh_i");
_impl = NULL;
_gen_i = gen_i;
_id = _idGenerator++;
_impl = NULL;
_gen_i = gen_i;
_id = _idGenerator++;
@@
-127,8
+126,6
@@
SMESH_Mesh_i::SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
SMESH_Mesh_i::~SMESH_Mesh_i()
{
SMESH_Mesh_i::~SMESH_Mesh_i()
{
- MESSAGE("~SMESH_Mesh_i");
-
// destroy groups
map<int, SMESH::SMESH_GroupBase_ptr>::iterator itGr;
for (itGr = _mapGroups.begin(); itGr != _mapGroups.end(); itGr++)
// destroy groups
map<int, SMESH::SMESH_GroupBase_ptr>::iterator itGr;
for (itGr = _mapGroups.begin(); itGr != _mapGroups.end(); itGr++)
@@
-293,7
+290,7
@@
void SMESH_Mesh_i::Clear() throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
- _preMeshInfo->Forget
AllData();
+ _preMeshInfo->Forget
OrLoad(); // load in case if !HasShapeToMesh()
try {
_impl->Clear();
try {
_impl->Clear();
@@
-1762,7
+1759,7
@@
SMESH_Mesh_i::CreateDimGroup(const SMESH::ListOfIDSources& theGroups,
while ( nIt->more() )
{
const SMDS_MeshNode* n = nIt->next();
while ( nIt->more() )
{
const SMDS_MeshNode* n = nIt->next();
- if ( n->GetID() >= isNodeInGroups.size() )
+ if ( n->GetID() >=
(int)
isNodeInGroups.size() )
isNodeInGroups.resize( n->GetID() + 1, false );
isNodeInGroups[ n->GetID() ] = true;
}
isNodeInGroups.resize( n->GetID() + 1, false );
isNodeInGroups[ n->GetID() ] = true;
}
@@
-1851,7
+1848,7
@@
void SMESH_Mesh_i::addGeomGroupData(GEOM::GEOM_Object_ptr theGeomObj,
CORBA::String_var entry = groupSO->GetID();
groupData._groupEntry = entry.in();
// indices
CORBA::String_var entry = groupSO->GetID();
groupData._groupEntry = entry.in();
// indices
- for (
int
i = 0; i < ids->length(); ++i )
+ for (
CORBA::ULong
i = 0; i < ids->length(); ++i )
groupData._indices.insert( ids[i] );
// SMESH object
groupData._smeshObject = CORBA::Object::_duplicate( theSmeshObj );
groupData._indices.insert( ids[i] );
// SMESH object
groupData._smeshObject = CORBA::Object::_duplicate( theSmeshObj );
@@
-1904,7
+1901,7
@@
TopoDS_Shape SMESH_Mesh_i::newGroupShape( TGeomGroupData & groupData)
GEOM::GEOM_IGroupOperations_wrap groupOp =
geomGen->GetIGroupOperations( _gen_i->GetCurrentStudyID() );
GEOM::ListOfLong_var ids = groupOp->GetObjects( geomGroup );
GEOM::GEOM_IGroupOperations_wrap groupOp =
geomGen->GetIGroupOperations( _gen_i->GetCurrentStudyID() );
GEOM::ListOfLong_var ids = groupOp->GetObjects( geomGroup );
- for (
int
i = 0; i < ids->length(); ++i )
+ for (
CORBA::ULong
i = 0; i < ids->length(); ++i )
curIndices.insert( ids[i] );
if ( groupData._indices == curIndices )
curIndices.insert( ids[i] );
if ( groupData._indices == curIndices )
@@
-1973,6
+1970,8
@@
void SMESH_Mesh_i::CheckGeomModif()
GEOM::GEOM_Object_var mainGO = _gen_i->ShapeToGeomObject( _impl->GetShapeToMesh() );
//if ( mainGO->_is_nil() ) return;
GEOM::GEOM_Object_var mainGO = _gen_i->ShapeToGeomObject( _impl->GetShapeToMesh() );
//if ( mainGO->_is_nil() ) return;
+ // Update after group modification
+
if ( mainGO->_is_nil() || /* shape was removed from GEOM_Client by newGroupShape()
called by other mesh (IPAL52735) */
mainGO->GetType() == GEOM_GROUP ||
if ( mainGO->_is_nil() || /* shape was removed from GEOM_Client by newGroupShape()
called by other mesh (IPAL52735) */
mainGO->GetType() == GEOM_GROUP ||
@@
-1982,6
+1981,8
@@
void SMESH_Mesh_i::CheckGeomModif()
return;
}
return;
}
+ // Update after shape transformation like Translate
+
GEOM_Client* geomClient = _gen_i->GetShapeReader();
if ( !geomClient ) return;
GEOM::GEOM_Gen_var geomGen = _gen_i->GetGeomEngine();
GEOM_Client* geomClient = _gen_i->GetShapeReader();
if ( !geomClient ) return;
GEOM::GEOM_Gen_var geomGen = _gen_i->GetGeomEngine();
@@
-3394,7
+3395,7
@@
void SMESH_Mesh_i::exportMEDFields( DriverMED_W_Field& fieldWriter,
{
const SMDS_MeshElement* e = elemIt->next();
const int shapeID = e->getshapeId();
{
const SMDS_MeshElement* e = elemIt->next();
const int shapeID = e->getshapeId();
- if ( shapeID < 1 || shapeID >= dblVals.size() )
+ if ( shapeID < 1 || shapeID >=
(int)
dblVals.size() )
fieldWriter.AddValue( noneDblValue );
else
fieldWriter.AddValue( dblVals[ shapeID ]);
fieldWriter.AddValue( noneDblValue );
else
fieldWriter.AddValue( dblVals[ shapeID ]);
@@
-3404,7
+3405,7
@@
void SMESH_Mesh_i::exportMEDFields( DriverMED_W_Field& fieldWriter,
{
const SMDS_MeshElement* e = elemIt->next();
const int shapeID = e->getshapeId();
{
const SMDS_MeshElement* e = elemIt->next();
const int shapeID = e->getshapeId();
- if ( shapeID < 1 || shapeID >= intVals.size() )
+ if ( shapeID < 1 || shapeID >=
(int)
intVals.size() )
fieldWriter.AddValue( (double) noneIntValue );
else
fieldWriter.AddValue( (double) intVals[ shapeID ]);
fieldWriter.AddValue( (double) noneIntValue );
else
fieldWriter.AddValue( (double) intVals[ shapeID ]);
@@
-3761,7
+3762,7
@@
CORBA::Long SMESH_Mesh_i::NbBiQuadQuadrangles()throw(SALOME::SALOME_Exception)
return _impl->NbBiQuadQuadrangles();
}
return _impl->NbBiQuadQuadrangles();
}
-CORBA::Long SMESH_Mesh_i::NbPolygons()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbPolygons()
throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
@@
-3770,6
+3771,15
@@
CORBA::Long SMESH_Mesh_i::NbPolygons()throw(SALOME::SALOME_Exception)
return _impl->NbPolygons();
}
return _impl->NbPolygons();
}
+CORBA::Long SMESH_Mesh_i::NbPolygonsOfOrder(SMESH::ElementOrder order) throw(SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ if ( _preMeshInfo )
+ return _preMeshInfo->NbPolygons((SMDSAbs_ElementOrder) order);
+
+ return _impl->NbPolygons((SMDSAbs_ElementOrder)order);
+}
+
CORBA::Long SMESH_Mesh_i::NbFacesOfOrder(SMESH::ElementOrder order)
throw(SALOME::SALOME_Exception)
{
CORBA::Long SMESH_Mesh_i::NbFacesOfOrder(SMESH::ElementOrder order)
throw(SALOME::SALOME_Exception)
{
@@
-4066,7
+4076,7
@@
SMESH::long_array* SMESH_Mesh_i::GetNodesId()
SMESH::ElementType SMESH_Mesh_i::GetElementType( const CORBA::Long id, const bool iselem )
throw (SALOME::SALOME_Exception)
{
SMESH::ElementType SMESH_Mesh_i::GetElementType( const CORBA::Long id, const bool iselem )
throw (SALOME::SALOME_Exception)
{
- SMESH::ElementType type;
+ SMESH::ElementType type
= SMESH::ALL
;
SMESH_TRY;
if ( _preMeshInfo )
SMESH_TRY;
if ( _preMeshInfo )
@@
-4214,7
+4224,7
@@
SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID,
SMESH::ElementType SMESH_Mesh_i::GetSubMeshElementType(const CORBA::Long ShapeID)
throw (SALOME::SALOME_Exception)
{
SMESH::ElementType SMESH_Mesh_i::GetSubMeshElementType(const CORBA::Long ShapeID)
throw (SALOME::SALOME_Exception)
{
- SMESH::ElementType type;
+ SMESH::ElementType type
= SMESH::ALL
;
SMESH_TRY;
if ( _preMeshInfo )
SMESH_TRY;
if ( _preMeshInfo )
@@
-4252,8
+4262,7
@@
CORBA::LongLong SMESH_Mesh_i::GetMeshPtr()
_preMeshInfo->FullLoadFromFile();
CORBA::LongLong pointeur = CORBA::LongLong(_impl);
_preMeshInfo->FullLoadFromFile();
CORBA::LongLong pointeur = CORBA::LongLong(_impl);
- if ( MYDEBUG )
- MESSAGE("CORBA::LongLong SMESH_Mesh_i::GetMeshPtr() "<<pointeur);
+ if ( MYDEBUG ) MESSAGE("CORBA::LongLong SMESH_Mesh_i::GetMeshPtr() "<<pointeur);
return pointeur;
}
return pointeur;
}
@@
-4660,7
+4669,7
@@
SMESH::long_array* SMESH_Mesh_i::GetElemFaceNodes(CORBA::Long elemId,
{
aResult->length( vtool.NbFaceNodes( faceIndex ));
const SMDS_MeshNode** nn = vtool.GetFaceNodes( faceIndex );
{
aResult->length( vtool.NbFaceNodes( faceIndex ));
const SMDS_MeshNode** nn = vtool.GetFaceNodes( faceIndex );
- for (
int
i = 0; i < aResult->length(); ++i )
+ for (
CORBA::ULong
i = 0; i < aResult->length(); ++i )
aResult[ i ] = nn[ i ]->GetID();
}
}
aResult[ i ] = nn[ i ]->GetID();
}
}
@@
-4709,7
+4718,7
@@
CORBA::Long SMESH_Mesh_i::FindElementByNodes(const SMESH::long_array& nodes)
if ( SMESHDS_Mesh* mesh = _impl->GetMeshDS() )
{
vector< const SMDS_MeshNode * > nn( nodes.length() );
if ( SMESHDS_Mesh* mesh = _impl->GetMeshDS() )
{
vector< const SMDS_MeshNode * > nn( nodes.length() );
- for (
int
i = 0; i < nodes.length(); ++i )
+ for (
CORBA::ULong
i = 0; i < nodes.length(); ++i )
if ( !( nn[i] = mesh->FindNode( nodes[i] )))
return elemID;
if ( !( nn[i] = mesh->FindNode( nodes[i] )))
return elemID;
@@
-4847,6
+4856,7
@@
SMESH_Mesh_i::MakeGroupsOfBadInputElements( int theSubShapeID,
THROW_SALOME_CORBA_EXCEPTION( "empty group name",SALOME::BAD_PARAM );
SMESH::ListOfGroups_var groups = new SMESH::ListOfGroups;
THROW_SALOME_CORBA_EXCEPTION( "empty group name",SALOME::BAD_PARAM );
SMESH::ListOfGroups_var groups = new SMESH::ListOfGroups;
+ ::SMESH_MeshEditor::ElemFeatures elemType;
// submesh by subshape id
if ( !_impl->HasShapeToMesh() ) theSubShapeID = 1;
// submesh by subshape id
if ( !_impl->HasShapeToMesh() ) theSubShapeID = 1;
@@
-4879,7
+4889,7
@@
SMESH_Mesh_i::MakeGroupsOfBadInputElements( int theSubShapeID,
if ( elem )
{
::SMESH_MeshEditor editor( _impl );
if ( elem )
{
::SMESH_MeshEditor editor( _impl );
- elem = editor.AddElement( nodes, elem
->GetType(), elem->IsPoly()
);
+ elem = editor.AddElement( nodes, elem
Type.Init( elem )
);
}
}
if ( elem )
}
}
if ( elem )
@@
-5097,11
+5107,11
@@
SMESH::string_array* SMESH_Mesh_i::GetLastParameters()
SALOMEDS::Study_var aStudy = gen->GetCurrentStudy();
if ( !aStudy->_is_nil()) {
SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aParameters);
SALOMEDS::Study_var aStudy = gen->GetCurrentStudy();
if ( !aStudy->_is_nil()) {
SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aParameters);
- if
(aSections->length() > 0
) {
- SALOMEDS::ListOfStrings aVars = aSections[
aSections->length()-1
];
- aResult->length(
aVars.length()
);
- for
(int i = 0;i < aVars.length();i++
)
- aResult[i] = CORBA::string_dup( aVars[i]);
+ if
( aSections->length() > 0
) {
+ SALOMEDS::ListOfStrings aVars = aSections[
aSections->length() - 1
];
+ aResult->length(
aVars.length()
);
+ for
( CORBA::ULong i = 0;i < aVars.length(); i++
)
+ aResult[i] = CORBA::string_dup( aVars[i]
);
}
}
}
}
}
}
@@
-5127,6
+5137,8
@@
SMESH::array_of_ElementType* SMESH_Mesh_i::GetTypes()
if (_impl->NbVolumes()) types[nbTypes++] = SMESH::VOLUME;
if (_impl->Nb0DElements()) types[nbTypes++] = SMESH::ELEM0D;
if (_impl->NbBalls()) types[nbTypes++] = SMESH::BALL;
if (_impl->NbVolumes()) types[nbTypes++] = SMESH::VOLUME;
if (_impl->Nb0DElements()) types[nbTypes++] = SMESH::ELEM0D;
if (_impl->NbBalls()) types[nbTypes++] = SMESH::BALL;
+ if (_impl->NbNodes() &&
+ nbTypes == 0 ) types[nbTypes++] = SMESH::NODE;
types->length( nbTypes );
return types._retn();
types->length( nbTypes );
return types._retn();
@@
-5391,7
+5403,7
@@
SMDS_ElemIteratorPtr SMESH_Mesh_i::GetElements(SMESH::SMESH_IDSource_ptr theObje
SMESH::ElementType theType)
{
SMDS_ElemIteratorPtr elemIt;
SMESH::ElementType theType)
{
SMDS_ElemIteratorPtr elemIt;
- bool typeOK =
false
;
+ bool typeOK =
( theType == SMESH::ALL )
;
SMDSAbs_ElementType elemType = SMDSAbs_ElementType( theType );
SMESH::SMESH_Mesh_var meshVar = theObject->GetMesh();
SMDSAbs_ElementType elemType = SMDSAbs_ElementType( theType );
SMESH::SMESH_Mesh_var meshVar = theObject->GetMesh();
@@
-5621,7
+5633,7
@@
class SMESH_DimHyp
if ( find( theOther->_hypotheses.begin(), otheEndIt, *hypIt ) != otheEndIt )
nbSame++;
// the submeshes are concurrent if their algorithms has different parameters
if ( find( theOther->_hypotheses.begin(), otheEndIt, *hypIt ) != otheEndIt )
nbSame++;
// the submeshes are concurrent if their algorithms has different parameters
- return nbSame != theOther->_hypotheses.size() - 1;
+ return nbSame !=
(int)
theOther->_hypotheses.size() - 1;
}
// Return true if algorithm of this SMESH_DimHyp is used if no
}
// Return true if algorithm of this SMESH_DimHyp is used if no
@@
-6054,14
+6066,14
@@
SMESH_MeshPartDS::SMESH_MeshPartDS(SMESH::SMESH_IDSource_ptr meshPart):
SMESH::array_of_ElementType_var types = meshPart->GetTypes();
if ( types->length() == 1 && types[0] == SMESH::NODE ) // group of nodes
{
SMESH::array_of_ElementType_var types = meshPart->GetTypes();
if ( types->length() == 1 && types[0] == SMESH::NODE ) // group of nodes
{
- for (
int i=0; i < anIDs->length(); i++
)
- if ( const SMDS_MeshNode * n = _meshDS->FindNode(
anIDs[i]
))
+ for (
CORBA::ULong i=0; i < anIDs->length(); i++
)
+ if ( const SMDS_MeshNode * n = _meshDS->FindNode(
anIDs[i]
))
if ( _elements[ SMDSAbs_Node ].insert( n ).second )
tmpInfo.Add( n );
}
else
{
if ( _elements[ SMDSAbs_Node ].insert( n ).second )
tmpInfo.Add( n );
}
else
{
- for (
int i=0; i < anIDs->length(); i++
)
+ for (
CORBA::ULong i=0; i < anIDs->length(); i++
)
if ( const SMDS_MeshElement * e = _meshDS->FindElement(anIDs[i]))
if ( _elements[ e->GetType() ].insert( e ).second )
{
if ( const SMDS_MeshElement * e = _meshDS->FindElement(anIDs[i]))
if ( _elements[ e->GetType() ].insert( e ).second )
{