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
#16609: EDF - mesh computation : strange behavior
[modules/smesh.git]
/
src
/
SMDS
/
SMDS_VtkCellIterator.cxx
diff --git
a/src/SMDS/SMDS_VtkCellIterator.cxx
b/src/SMDS/SMDS_VtkCellIterator.cxx
index 0f474492576f364de0d49ef933eba26ec49e4e2f..5c6aec32ddb1b2dbaea01f0ee1be646bd175a011 100644
(file)
--- a/
src/SMDS/SMDS_VtkCellIterator.cxx
+++ b/
src/SMDS/SMDS_VtkCellIterator.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2010-201
6
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-201
9
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
@@
-23,37
+23,37
@@
#include <vtkCell.h>
#include <vtkIdList.h>
#include <vtkCell.h>
#include <vtkIdList.h>
-_GetVtkNodes::_GetVtkNodes(
vtkIdList* _vtkIdList
,
+_GetVtkNodes::_GetVtkNodes(
TVtkIdList& vtkIds
,
SMDS_Mesh* mesh,
int vtkCellId,
SMDS_Mesh* mesh,
int vtkCellId,
- SMDSAbs_EntityType
aT
ype )
+ SMDSAbs_EntityType
t
ype )
{
{
- vtkUnstructuredGrid* grid = mesh->GetGrid();
- const std::vector<int>& interlace = SMDS_MeshCell::fromVtkOrder( aType );
+ vtkUnstructuredGrid* grid = mesh->GetGrid();
+ const std::vector<int>& interlace = SMDS_MeshCell::fromVtkOrder( type );
+ vtkIdType npts, *pts;
+ grid->GetCellPoints( vtkCellId, npts, pts );
+ vtkIds.resize( npts );
if ( interlace.empty() )
{
if ( interlace.empty() )
{
-
grid->GetCellPoints( vtkCellId, _vtkIdList
);
+
vtkIds.assign( pts, pts + npts
);
}
else
{
}
else
{
- vtkIdType npts, *pts;
- grid->GetCellPoints( vtkCellId, npts, pts );
- _vtkIdList->SetNumberOfIds( npts );
- for (int i = 0; i < npts; i++)
- _vtkIdList->SetId(i, pts[interlace[i]]);
+ for (vtkIdType i = 0; i < npts; i++)
+ vtkIds[ i ] = pts[ interlace[i] ];
}
}
}
}
-_GetVtkNodesToUNV::_GetVtkNodesToUNV(
vtkIdList* _vtkIdList
,
+_GetVtkNodesToUNV::_GetVtkNodesToUNV(
TVtkIdList& vtkIds
,
SMDS_Mesh* mesh,
int vtkCellId,
SMDS_Mesh* mesh,
int vtkCellId,
- SMDSAbs_EntityType
aT
ype )
+ SMDSAbs_EntityType
t
ype )
{
{
- vtkIdType * pts, npts;
vtkUnstructuredGrid* grid = mesh->GetGrid();
vtkUnstructuredGrid* grid = mesh->GetGrid();
- grid->GetCellPoints( (vtkIdType)vtkCellId, npts, pts );
+ vtkIdType npts, *pts;
+ grid->GetCellPoints( vtkCellId, npts, pts );
const int *ids = 0;
const int *ids = 0;
- switch (
aType
)
+ switch (
type
)
{
case SMDSEntity_Quad_Edge:
{
{
case SMDSEntity_Quad_Edge:
{
@@
-115,28
+115,27
@@
_GetVtkNodesToUNV::_GetVtkNodesToUNV( vtkIdList* _vtkIdList,
case SMDSEntity_Polyhedra:
case SMDSEntity_Quad_Polyhedra:
default:
case SMDSEntity_Polyhedra:
case SMDSEntity_Quad_Polyhedra:
default:
- const std::vector<int>& i = SMDS_MeshCell::interlacedSmdsOrder(
aT
ype, npts );
+ const std::vector<int>& i = SMDS_MeshCell::interlacedSmdsOrder(
t
ype, npts );
if ( !i.empty() )
ids = & i[0];
}
if ( !i.empty() )
ids = & i[0];
}
-
_vtkIdList->SetNumberOfIds
( npts );
+
vtkIds.resize
( npts );
if ( ids )
for (int i = 0; i < npts; i++)
if ( ids )
for (int i = 0; i < npts; i++)
-
_vtkIdList->SetId(i, pts[ids[i]])
;
+
vtkIds[ i ] = pts[ ids[i] ]
;
else
else
- for (int i = 0; i < npts; i++)
- _vtkIdList->SetId(i, pts[i]);
+ vtkIds.assign( pts, pts + npts );
}
}
-_GetVtkNodesPolyh::_GetVtkNodesPolyh(
vtkIdList* _vtkIdList
,
+_GetVtkNodesPolyh::_GetVtkNodesPolyh(
TVtkIdList& vtkIds
,
SMDS_Mesh* mesh,
int vtkCellId,
SMDS_Mesh* mesh,
int vtkCellId,
- SMDSAbs_EntityType
aT
ype )
+ SMDSAbs_EntityType
t
ype )
{
vtkUnstructuredGrid* grid = mesh->GetGrid();
{
vtkUnstructuredGrid* grid = mesh->GetGrid();
- switch (
aType
)
+ switch (
type
)
{
case SMDSEntity_Polyhedra:
{
{
case SMDSEntity_Polyhedra:
{
@@
-144,20
+143,20
@@
_GetVtkNodesPolyh::_GetVtkNodesPolyh( vtkIdList* _vtkIdList,
vtkIdType* ptIds = 0;
grid->GetFaceStream( vtkCellId, nFaces, ptIds );
int id = 0, nbNodesInFaces = 0;
vtkIdType* ptIds = 0;
grid->GetFaceStream( vtkCellId, nFaces, ptIds );
int id = 0, nbNodesInFaces = 0;
- for (
int i = 0; i < nFaces; i++
)
+ for (
int i = 0; i < nFaces; i++
)
{
int nodesInFace = ptIds[id]; // nodeIds in ptIds[id+1 .. id+nodesInFace]
nbNodesInFaces += nodesInFace;
id += (nodesInFace + 1);
}
{
int nodesInFace = ptIds[id]; // nodeIds in ptIds[id+1 .. id+nodesInFace]
nbNodesInFaces += nodesInFace;
id += (nodesInFace + 1);
}
-
_vtkIdList->SetNumberOfIds
( nbNodesInFaces );
+
vtkIds.resize
( nbNodesInFaces );
id = 0;
int n = 0;
id = 0;
int n = 0;
- for (
int i = 0; i < nFaces; i++
)
+ for (
int i = 0; i < nFaces; i++
)
{
int nodesInFace = ptIds[id]; // nodeIds in ptIds[id+1 .. id+nodesInFace]
{
int nodesInFace = ptIds[id]; // nodeIds in ptIds[id+1 .. id+nodesInFace]
- for (
int k = 1; k <= nodesInFace; k++
)
-
_vtkIdList->SetId(n++, ptIds[id + k])
;
+ for (
int k = 1; k <= nodesInFace; k++
)
+
vtkIds[ n++ ] = ptIds[ id + k ]
;
id += (nodesInFace + 1);
}
break;
id += (nodesInFace + 1);
}
break;