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
Merge branch 'V9_9_BR'
[modules/smesh.git]
/
src
/
SMDS
/
SMDS_MeshCell.cxx
diff --git
a/src/SMDS/SMDS_MeshCell.cxx
b/src/SMDS/SMDS_MeshCell.cxx
index 25c2f367a4d7c58b4e798778d8d40789666c79c5..f2998c111b8805582df2bddf7f4f51a3cc30a8af 100644
(file)
--- a/
src/SMDS/SMDS_MeshCell.cxx
+++ b/
src/SMDS/SMDS_MeshCell.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2010-20
16
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-20
22
CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@
-461,8
+461,8
@@
void SMDS_MeshCell::init( SMDSAbs_EntityType theEntity, int theNbNodes, ... )
}
va_end( vl );
}
va_end( vl );
- int vtkType = toVtkType( theEntity );
-
int
vtkID = getGrid()->InsertNextLinkedCell( vtkType, theNbNodes, vtkIds );
+ int
vtkType = toVtkType( theEntity );
+
vtkIdType
vtkID = getGrid()->InsertNextLinkedCell( vtkType, theNbNodes, vtkIds );
setVtkID( vtkID );
}
setVtkID( vtkID );
}
@@
-473,25
+473,27
@@
void SMDS_MeshCell::init( SMDSAbs_EntityType theEntity,
for ( size_t i = 0; i < nodes.size(); ++i )
vtkIds[i] = nodes[i]->GetVtkID();
for ( size_t i = 0; i < nodes.size(); ++i )
vtkIds[i] = nodes[i]->GetVtkID();
- int vtkType = toVtkType( theEntity );
-
int
vtkID = getGrid()->InsertNextLinkedCell( vtkType, nodes.size(), &vtkIds[0] );
+ int
vtkType = toVtkType( theEntity );
+
vtkIdType
vtkID = getGrid()->InsertNextLinkedCell( vtkType, nodes.size(), &vtkIds[0] );
setVtkID( vtkID );
}
void SMDS_MeshCell::init( SMDSAbs_EntityType theEntity,
const std::vector<vtkIdType>& vtkNodeIds )
{
setVtkID( vtkID );
}
void SMDS_MeshCell::init( SMDSAbs_EntityType theEntity,
const std::vector<vtkIdType>& vtkNodeIds )
{
- int vtkType = toVtkType( theEntity );
-
int
vtkID = getGrid()->InsertNextLinkedCell( vtkType, vtkNodeIds.size(),
- const_cast< vtkIdType* > ( &vtkNodeIds[0] ));
+ int
vtkType = toVtkType( theEntity );
+
vtkIdType
vtkID = getGrid()->InsertNextLinkedCell( vtkType, vtkNodeIds.size(),
+
const_cast< vtkIdType* > ( &vtkNodeIds[0] ));
setVtkID( vtkID );
}
bool SMDS_MeshCell::ChangeNodes(const SMDS_MeshNode* nodes[], const int theNbNodes)
{
vtkIdType npts = 0;
setVtkID( vtkID );
}
bool SMDS_MeshCell::ChangeNodes(const SMDS_MeshNode* nodes[], const int theNbNodes)
{
vtkIdType npts = 0;
- vtkIdType* pts = 0;
- getGrid()->GetCellPoints( GetVtkID(), npts, pts );
+ vtkIdType *pts(nullptr);
+ vtkIdType const *tmp(nullptr);
+ getGrid()->GetCellPoints( GetVtkID(), npts, tmp );
+ pts = const_cast<vtkIdType *>(tmp);
if ( theNbNodes != npts )
{
MESSAGE("ChangeNodes problem: not the same number of nodes " << npts << " -> " << theNbNodes);
if ( theNbNodes != npts )
{
MESSAGE("ChangeNodes problem: not the same number of nodes " << npts << " -> " << theNbNodes);
@@
-519,8
+521,7
@@
int SMDS_MeshCell::NbNodes() const
{
if ( GetVtkType() == VTK_POLYHEDRON )
return static_cast< const SMDS_MeshVolume* >( this )->SMDS_MeshVolume::NbNodes();
{
if ( GetVtkType() == VTK_POLYHEDRON )
return static_cast< const SMDS_MeshVolume* >( this )->SMDS_MeshVolume::NbNodes();
- vtkIdType *pts, npts;
- getGrid()->GetCellPoints( GetVtkID(), npts, pts );
+ vtkIdType npts = getGrid()->GetCells()->GetCellSize( GetVtkID() );
return npts;
}
return npts;
}
@@
-631,7
+632,8
@@
const SMDS_MeshNode* SMDS_MeshCell::GetNode(const int ind) const
if ( GetVtkType() == VTK_POLYHEDRON )
return static_cast< const SMDS_MeshVolume* >( this )->SMDS_MeshVolume::GetNode( ind );
if ( GetVtkType() == VTK_POLYHEDRON )
return static_cast< const SMDS_MeshVolume* >( this )->SMDS_MeshVolume::GetNode( ind );
- vtkIdType npts, *pts;
+ vtkIdType npts;
+ vtkIdType const *pts;
getGrid()->GetCellPoints( GetVtkID(), npts, pts );
const std::vector<int>& interlace = SMDS_MeshCell::fromVtkOrder( VTKCellType( GetVtkType() ));
return GetMesh()->FindNodeVtk( pts[ interlace.empty() ? ind : interlace[ ind ]]);
getGrid()->GetCellPoints( GetVtkID(), npts, pts );
const std::vector<int>& interlace = SMDS_MeshCell::fromVtkOrder( VTKCellType( GetVtkType() ));
return GetMesh()->FindNodeVtk( pts[ interlace.empty() ? ind : interlace[ ind ]]);
@@
-639,10
+641,14
@@
const SMDS_MeshNode* SMDS_MeshCell::GetNode(const int ind) const
int SMDS_MeshCell::GetNodeIndex( const SMDS_MeshNode* node ) const
{
int SMDS_MeshCell::GetNodeIndex( const SMDS_MeshNode* node ) const
{
+ if ( !node || node->IsNull() )
+ return -1;
+
if ( GetVtkType() == VTK_POLYHEDRON )
return static_cast< const SMDS_MeshVolume* >( this )->SMDS_MeshVolume::GetNodeIndex( node );
if ( GetVtkType() == VTK_POLYHEDRON )
return static_cast< const SMDS_MeshVolume* >( this )->SMDS_MeshVolume::GetNodeIndex( node );
- vtkIdType npts, *pts;
+ vtkIdType npts;
+ vtkIdType const *pts;
getGrid()->GetCellPoints( GetVtkID(), npts, pts );
for ( vtkIdType i = 0; i < npts; ++i )
if ( pts[i] == node->GetVtkID() )
getGrid()->GetCellPoints( GetVtkID(), npts, pts );
for ( vtkIdType i = 0; i < npts; ++i )
if ( pts[i] == node->GetVtkID() )