mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-29 02:40:35 +05:00
PR: adjust points number
This commit is contained in:
parent
ea70fb0809
commit
faf44b9356
@ -63,7 +63,7 @@ using namespace std;
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG_
|
||||
static int MYDEBUG = 0;
|
||||
static int MYDEBUG = 1;
|
||||
static int MYDEBUGWITHFILES = 0;
|
||||
#else
|
||||
static int MYDEBUG = 0;
|
||||
@ -132,11 +132,13 @@ static inline vtkIdType getCellType( const SMDSAbs_ElementType theType,
|
||||
//=================================================================================
|
||||
SMESH_VisualObjDef::SMESH_VisualObjDef()
|
||||
{
|
||||
MESSAGE("---------------------------------------------SMESH_VisualObjDef::SMESH_VisualObjDef");
|
||||
myGrid = vtkUnstructuredGrid::New();
|
||||
}
|
||||
SMESH_VisualObjDef::~SMESH_VisualObjDef()
|
||||
{
|
||||
if ( MYDEBUG )
|
||||
MESSAGE("---------------------------------------------SMESH_VisualObjDef::~SMESH_VisualObjDef");
|
||||
//if ( MYDEBUG )
|
||||
MESSAGE( "~SMESH_MeshObj - myGrid->GetReferenceCount() = " << myGrid->GetReferenceCount() );
|
||||
myGrid->Delete();
|
||||
}
|
||||
@ -236,9 +238,12 @@ void SMESH_VisualObjDef::buildPrs()
|
||||
// myGrid->SetCells( 0, 0, 0 );
|
||||
// throw;
|
||||
// }
|
||||
myGrid = GetMesh()->getGrid();
|
||||
|
||||
if( MYDEBUG ) MESSAGE( "Update - myGrid->GetNumberOfCells() = "<<myGrid->GetNumberOfCells() );
|
||||
MESSAGE("----------------------------------------------------------SMESH_VisualObjDef::buildPrs");
|
||||
vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
|
||||
myGrid->ShallowCopy(theGrid);
|
||||
MESSAGE(myGrid->GetReferenceCount());
|
||||
MESSAGE( "Update - myGrid->GetNumberOfCells() = "<<myGrid->GetNumberOfCells() );
|
||||
MESSAGE( "Update - myGrid->GetNumberOfPoints() = "<<myGrid->GetNumberOfPoints() );
|
||||
if( MYDEBUGWITHFILES ) SMESH::WriteUnstructuredGrid( myGrid,"/tmp/buildPrs" );
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "SMDS_SpacePosition.hxx"
|
||||
|
||||
#include <vtkUnstructuredGrid.h>
|
||||
#include <vtkUnsignedCharArray.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
@ -2783,7 +2784,7 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem,
|
||||
void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem)
|
||||
{
|
||||
int elemId = elem->GetID();
|
||||
//MESSAGE("SMDS_Mesh::RemoveFreeElement " << elemId);
|
||||
MESSAGE("SMDS_Mesh::RemoveFreeElement " << elemId);
|
||||
SMDSAbs_ElementType aType = elem->GetType();
|
||||
SMDS_MeshElement* todest = (SMDS_MeshElement*)(elem);
|
||||
if (aType == SMDSAbs_Node) {
|
||||
@ -2801,6 +2802,8 @@ void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem)
|
||||
// this methods is only for meshes without descendants
|
||||
return;
|
||||
|
||||
int vtkid = this->fromSmdsToVtk(elemId);
|
||||
|
||||
// Remove element from <InverseElements> of its nodes
|
||||
SMDS_ElemIteratorPtr itn = elem->nodesIterator();
|
||||
while (itn->more()) {
|
||||
@ -2835,6 +2838,9 @@ void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem)
|
||||
break;
|
||||
}
|
||||
myElementIDFactory->ReleaseID(elemId);
|
||||
|
||||
this->myGrid->GetCellTypesArray()->SetValue(vtkid, VTK_EMPTY_CELL);
|
||||
// --- to do: keep vtkid in a list of reusable cells
|
||||
}
|
||||
}
|
||||
|
||||
@ -3582,3 +3588,9 @@ void SMDS_Mesh::incrementCellsCapacity(int nbCells)
|
||||
MESSAGE(" ------------------- resize myCells " << val << " --> " << val + nbCells);
|
||||
myNodes.resize(val +nbCells, 0);
|
||||
}
|
||||
|
||||
void SMDS_Mesh::adjustStructure()
|
||||
{
|
||||
myGrid->GetPoints()->GetData()->SetNumberOfTuples(myNodeIDFactory->GetMaxID()+1);
|
||||
}
|
||||
|
||||
|
@ -568,6 +568,7 @@ public:
|
||||
|
||||
void incrementNodesCapacity(int nbNodes);
|
||||
void incrementCellsCapacity(int nbCells);
|
||||
void adjustStructure();
|
||||
|
||||
int myCellLinksSize;
|
||||
|
||||
|
@ -29,6 +29,8 @@ public:
|
||||
void BuildLinks(); // initialise un SMDS_CellLinks;
|
||||
SMDS_CellLinks* GetCellLinks();
|
||||
|
||||
vtkIdType GetCellArraySize() { return (this->Connectivity ? this->Connectivity->GetSize() : 0); };
|
||||
|
||||
//virtual void Delete();
|
||||
static SMDS_UnstructuredGrid* New();
|
||||
protected:
|
||||
|
@ -295,6 +295,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
|
||||
MEMOSTAT;
|
||||
|
||||
SMESHDS_Mesh *myMesh = aMesh.GetMeshDS();
|
||||
myMesh->adjustStructure();
|
||||
list<int> listind = myMesh->SubMeshIndices();
|
||||
list<int>::iterator it = listind.begin();
|
||||
int total = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user