mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-14 10:40:34 +05:00
PR: debug gui display
This commit is contained in:
parent
8c1dfe2d90
commit
64be032249
@ -264,9 +264,9 @@ void SMESH_VisualObjDef::buildPrs(bool buildGrid)
|
|||||||
myLocalGrid = false;
|
myLocalGrid = false;
|
||||||
vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
|
vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
|
||||||
myGrid->ShallowCopy(theGrid);
|
myGrid->ShallowCopy(theGrid);
|
||||||
MESSAGE(myGrid->GetReferenceCount());
|
//MESSAGE(myGrid->GetReferenceCount());
|
||||||
MESSAGE( "Update - myGrid->GetNumberOfCells() = "<<myGrid->GetNumberOfCells() );
|
//MESSAGE( "Update - myGrid->GetNumberOfCells() = "<<myGrid->GetNumberOfCells() );
|
||||||
MESSAGE( "Update - myGrid->GetNumberOfPoints() = "<<myGrid->GetNumberOfPoints() );
|
//MESSAGE( "Update - myGrid->GetNumberOfPoints() = "<<myGrid->GetNumberOfPoints() );
|
||||||
if( MYDEBUGWITHFILES ) SMESH::WriteUnstructuredGrid( myGrid,"/tmp/buildPrs" );
|
if( MYDEBUGWITHFILES ) SMESH::WriteUnstructuredGrid( myGrid,"/tmp/buildPrs" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -558,7 +558,7 @@ bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId,
|
|||||||
|
|
||||||
vtkUnstructuredGrid* SMESH_VisualObjDef::GetUnstructuredGrid()
|
vtkUnstructuredGrid* SMESH_VisualObjDef::GetUnstructuredGrid()
|
||||||
{
|
{
|
||||||
MESSAGE("SMESH_VisualObjDef::GetUnstructuredGrid " << myGrid);
|
//MESSAGE("SMESH_VisualObjDef::GetUnstructuredGrid " << myGrid);
|
||||||
return myGrid;
|
return myGrid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -569,7 +569,7 @@ vtkUnstructuredGrid* SMESH_VisualObjDef::GetUnstructuredGrid()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool SMESH_VisualObjDef::IsValid() const
|
bool SMESH_VisualObjDef::IsValid() const
|
||||||
{
|
{
|
||||||
MESSAGE("SMESH_VisualObjDef::IsValid");
|
//MESSAGE("SMESH_VisualObjDef::IsValid");
|
||||||
return GetNbEntities(SMDSAbs_Node) > 0 ||
|
return GetNbEntities(SMDSAbs_Node) > 0 ||
|
||||||
GetNbEntities(SMDSAbs_0DElement) > 0 ||
|
GetNbEntities(SMDSAbs_0DElement) > 0 ||
|
||||||
GetNbEntities(SMDSAbs_Edge) > 0 ||
|
GetNbEntities(SMDSAbs_Edge) > 0 ||
|
||||||
@ -611,7 +611,7 @@ SMESH_MeshObj::~SMESH_MeshObj()
|
|||||||
bool SMESH_MeshObj::Update( int theIsClear )
|
bool SMESH_MeshObj::Update( int theIsClear )
|
||||||
{
|
{
|
||||||
// Update SMDS_Mesh on client part
|
// Update SMDS_Mesh on client part
|
||||||
MESSAGE("SMESH_MeshObj::Update " << this);
|
//MESSAGE("SMESH_MeshObj::Update " << this);
|
||||||
if ( myClient.Update(theIsClear) || GetUnstructuredGrid()->GetNumberOfPoints()==0) {
|
if ( myClient.Update(theIsClear) || GetUnstructuredGrid()->GetNumberOfPoints()==0) {
|
||||||
buildPrs(); // Fill unstructured grid
|
buildPrs(); // Fill unstructured grid
|
||||||
return true;
|
return true;
|
||||||
|
@ -8,7 +8,13 @@ Problemes en cours
|
|||||||
creation d'une structure vtkUnstructuredGrid locale : iteration un peu lourde, et pas de partage avec la structure du maillage (pas evident)
|
creation d'une structure vtkUnstructuredGrid locale : iteration un peu lourde, et pas de partage avec la structure du maillage (pas evident)
|
||||||
- inversion d'un volume (tetra): exception
|
- inversion d'un volume (tetra): exception
|
||||||
- script de creation de noeuds et d'elements: OK, mais pas compatible avec version precedente (numerotation noeuds differente)
|
- script de creation de noeuds et d'elements: OK, mais pas compatible avec version precedente (numerotation noeuds differente)
|
||||||
- affichage numeros noeuds: numeros en trop sur (O,0,0) pas systematique, trouver la condition (enlever dans vtkUnstructuredGrid ?)
|
+ affichage numeros noeuds: numeros en trop sur (O,0,0) pas systematique, trouver la condition (enlever dans vtkUnstructuredGrid ?)
|
||||||
|
==> purge systematique noeuds et cellules en trop dans compactage grid.
|
||||||
|
+ gestion du mode embedded mal faite lors d'un script python : journal commandes intempestif
|
||||||
|
- affichage des noeuds apres changement lineaire <--> quadratique à l'IHM : pas pris en compte, alors que maillage OK,
|
||||||
|
mais script OK
|
||||||
|
==> cassé apres mode embedded ou elimination noeuds en trop ?
|
||||||
|
- extrusion elements 2D along a path : affichage apres calcul pas toujours OK (filaire)
|
||||||
|
|
||||||
A tester, non pris en compte
|
A tester, non pris en compte
|
||||||
============================
|
============================
|
||||||
|
@ -56,6 +56,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
|
|||||||
int startBloc = 0;
|
int startBloc = 0;
|
||||||
int endBloc = 0;
|
int endBloc = 0;
|
||||||
int alreadyCopied = 0;
|
int alreadyCopied = 0;
|
||||||
|
int holes = 0;
|
||||||
|
|
||||||
typedef enum {lookHoleStart, lookHoleEnd, lookBlocEnd} enumState;
|
typedef enum {lookHoleStart, lookHoleEnd, lookBlocEnd} enumState;
|
||||||
enumState compactState = lookHoleStart;
|
enumState compactState = lookHoleStart;
|
||||||
@ -71,7 +72,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
|
|||||||
vtkPoints *newPoints = 0;
|
vtkPoints *newPoints = 0;
|
||||||
if (newNodeSize)
|
if (newNodeSize)
|
||||||
{
|
{
|
||||||
MESSAGE("-------------- compactGrid, newNodeSize");
|
MESSAGE("-------------- compactGrid, newNodeSize " << newNodeSize);
|
||||||
newPoints = vtkPoints::New();
|
newPoints = vtkPoints::New();
|
||||||
newPoints->Initialize();
|
newPoints->Initialize();
|
||||||
newPoints->Allocate(newNodeSize);
|
newPoints->Allocate(newNodeSize);
|
||||||
@ -87,6 +88,11 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
|
|||||||
{
|
{
|
||||||
MESSAGE("-------------- newNodeSize, startHole " << i << " " << oldNodeSize);
|
MESSAGE("-------------- newNodeSize, startHole " << i << " " << oldNodeSize);
|
||||||
startHole = i;
|
startHole = i;
|
||||||
|
if (!alreadyCopied) // copy the first bloc
|
||||||
|
{
|
||||||
|
MESSAGE("--------- copy first nodes before hole " << i << " " << oldNodeSize);
|
||||||
|
copyNodes(newPoints, idNodesOldToNew, alreadyCopied, 0, startHole);
|
||||||
|
}
|
||||||
compactState = lookHoleEnd;
|
compactState = lookHoleEnd;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -105,12 +111,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
|
|||||||
if (endBloc)
|
if (endBloc)
|
||||||
{
|
{
|
||||||
MESSAGE("-------------- newNodeSize, endbloc " << endBloc << " " << oldNodeSize);
|
MESSAGE("-------------- newNodeSize, endbloc " << endBloc << " " << oldNodeSize);
|
||||||
void *target = newPoints->GetVoidPointer(3*alreadyCopied);
|
copyNodes(newPoints, idNodesOldToNew, alreadyCopied, startBloc, endBloc);
|
||||||
void *source = this->Points->GetVoidPointer(3*startBloc);
|
|
||||||
int nbPoints = endBloc - startBloc;
|
|
||||||
memcpy(target, source, 3*sizeof(float)*nbPoints);
|
|
||||||
for (int j=startBloc; j<endBloc; j++)
|
|
||||||
idNodesOldToNew[j] = alreadyCopied++;
|
|
||||||
compactState = lookHoleStart;
|
compactState = lookHoleStart;
|
||||||
startHole = i;
|
startHole = i;
|
||||||
endHole = 0;
|
endHole = 0;
|
||||||
@ -122,12 +123,10 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
|
|||||||
}
|
}
|
||||||
if (!alreadyCopied) // no hole, but shorter, no need to modify idNodesOldToNew
|
if (!alreadyCopied) // no hole, but shorter, no need to modify idNodesOldToNew
|
||||||
{
|
{
|
||||||
MESSAGE("------------- newNodeSize, shorter " << oldNodeSize)
|
MESSAGE("------------- newNodeSize, shorter " << oldNodeSize);
|
||||||
void *target = newPoints->GetVoidPointer(0);
|
copyNodes(newPoints, idNodesOldToNew, alreadyCopied, 0, newNodeSize);
|
||||||
void *source = this->Points->GetVoidPointer(0);
|
|
||||||
int nbPoints = newNodeSize;
|
|
||||||
memcpy(target, source, 3*sizeof(float)*nbPoints);
|
|
||||||
}
|
}
|
||||||
|
newPoints->Squeeze();
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- create new compacted Connectivity, Locations and Types
|
// --- create new compacted Connectivity, Locations and Types
|
||||||
@ -155,6 +154,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
|
|||||||
startBloc = 0;
|
startBloc = 0;
|
||||||
endBloc = 0;
|
endBloc = 0;
|
||||||
alreadyCopied = 0;
|
alreadyCopied = 0;
|
||||||
|
holes = 0;
|
||||||
compactState = lookHoleStart;
|
compactState = lookHoleStart;
|
||||||
|
|
||||||
vtkIdType tmpid[50];
|
vtkIdType tmpid[50];
|
||||||
@ -167,45 +167,36 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
|
|||||||
case lookHoleStart:
|
case lookHoleStart:
|
||||||
if (this->Types->GetValue(i) == VTK_EMPTY_CELL)
|
if (this->Types->GetValue(i) == VTK_EMPTY_CELL)
|
||||||
{
|
{
|
||||||
MESSAGE(" -------- newCellSize, startHole " << i << " " << oldCellSize);
|
MESSAGE(" -------- newCellSize, startHole " << i << " " << oldCellSize);
|
||||||
startHole = i;
|
startHole = i;
|
||||||
compactState = lookHoleEnd;
|
compactState = lookHoleEnd;
|
||||||
|
if (!alreadyCopied) // copy the first bloc
|
||||||
|
{
|
||||||
|
MESSAGE("--------- copy first bloc before hole " << i << " " << oldCellSize);
|
||||||
|
copyBloc(newTypes, idCellsOldToNew, idNodesOldToNew, newConnectivity, newLocations, pointsCell, alreadyCopied, 0, startHole);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case lookHoleEnd:
|
case lookHoleEnd:
|
||||||
if (this->Types->GetValue(i) != VTK_EMPTY_CELL)
|
if (this->Types->GetValue(i) != VTK_EMPTY_CELL)
|
||||||
{
|
{
|
||||||
MESSAGE(" -------- newCellSize, EndHole " << i << " " << oldCellSize);
|
MESSAGE(" -------- newCellSize, EndHole " << i << " " << oldCellSize);
|
||||||
endHole = i;
|
endHole = i;
|
||||||
startBloc = i;
|
startBloc = i;
|
||||||
compactState = lookBlocEnd;
|
compactState = lookBlocEnd;
|
||||||
|
holes += endHole - startHole;
|
||||||
|
//alreadyCopied = startBloc -holes;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case lookBlocEnd:
|
case lookBlocEnd:
|
||||||
|
endBloc =0;
|
||||||
if (this->Types->GetValue(i) == VTK_EMPTY_CELL) endBloc =i;
|
if (this->Types->GetValue(i) == VTK_EMPTY_CELL) endBloc =i;
|
||||||
else if (i == (oldCellSize-1)) endBloc = i+1;
|
else if (i == (oldCellSize-1)) endBloc = i+1;
|
||||||
if (endBloc)
|
if (endBloc)
|
||||||
{
|
{
|
||||||
MESSAGE(" -------- newCellSize, endBloc " << endBloc << " " << oldCellSize);
|
MESSAGE(" -------- newCellSize, endBloc " << endBloc << " " << oldCellSize);
|
||||||
for (int j=startBloc; j<endBloc; j++)
|
copyBloc(newTypes, idCellsOldToNew, idNodesOldToNew, newConnectivity, newLocations, pointsCell, alreadyCopied, startBloc, endBloc);
|
||||||
{
|
compactState = lookHoleStart;
|
||||||
newTypes->SetValue(alreadyCopied, this->Types->GetValue(j));
|
|
||||||
idCellsOldToNew[j] = alreadyCopied;
|
|
||||||
vtkIdType oldLoc = this->Locations->GetValue(j);
|
|
||||||
vtkIdType nbpts;
|
|
||||||
vtkIdType *oldPtsCell = 0;
|
|
||||||
this->Connectivity->GetCell(oldLoc, nbpts, oldPtsCell);
|
|
||||||
for (int l=0; l<nbpts; l++)
|
|
||||||
{
|
|
||||||
int oldval = oldPtsCell[l];
|
|
||||||
pointsCell[l] = idNodesOldToNew[oldval];
|
|
||||||
}
|
|
||||||
int newcnt = newConnectivity->InsertNextCell(nbpts, pointsCell);
|
|
||||||
int newLoc = newConnectivity->GetInsertLocation(nbpts);
|
|
||||||
newLocations->SetValue(alreadyCopied, newLoc);
|
|
||||||
alreadyCopied++;
|
|
||||||
}
|
|
||||||
compactState = lookHoleStart;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -213,27 +204,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
|
|||||||
if (!alreadyCopied) // no hole, but shorter
|
if (!alreadyCopied) // no hole, but shorter
|
||||||
{
|
{
|
||||||
MESSAGE(" -------- newCellSize, shorter " << oldCellSize);
|
MESSAGE(" -------- newCellSize, shorter " << oldCellSize);
|
||||||
for (int j=0; j<oldCellSize; j++)
|
copyBloc(newTypes, idCellsOldToNew, idNodesOldToNew, newConnectivity, newLocations, pointsCell, alreadyCopied, 0, oldCellSize);
|
||||||
{
|
|
||||||
newTypes->SetValue(alreadyCopied, this->Types->GetValue(j));
|
|
||||||
idCellsOldToNew[j] = alreadyCopied;
|
|
||||||
vtkIdType oldLoc = this->Locations->GetValue(j);
|
|
||||||
vtkIdType nbpts;
|
|
||||||
vtkIdType *oldPtsCell = 0;
|
|
||||||
this->Connectivity->GetCell(oldLoc, nbpts, oldPtsCell);
|
|
||||||
//MESSAGE(j << " " << alreadyCopied << " " << (int)this->Types->GetValue(j) << " " << oldLoc << " " << nbpts );
|
|
||||||
for (int l=0; l<nbpts; l++)
|
|
||||||
{
|
|
||||||
int oldval = oldPtsCell[l];
|
|
||||||
pointsCell[l] = idNodesOldToNew[oldval];
|
|
||||||
//MESSAGE(" " << oldval << " " << pointsCell[l]);
|
|
||||||
}
|
|
||||||
int newcnt = newConnectivity->InsertNextCell(nbpts, pointsCell);
|
|
||||||
int newLoc = newConnectivity->GetInsertLocation(nbpts);
|
|
||||||
//MESSAGE(newcnt << " " << newLoc);
|
|
||||||
newLocations->SetValue(alreadyCopied, newLoc);
|
|
||||||
alreadyCopied++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
newConnectivity->Squeeze();
|
newConnectivity->Squeeze();
|
||||||
@ -244,7 +215,60 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
|
|||||||
{
|
{
|
||||||
MESSAGE("------- newNodeSize, setPoints");
|
MESSAGE("------- newNodeSize, setPoints");
|
||||||
this->SetPoints(newPoints);
|
this->SetPoints(newPoints);
|
||||||
|
MESSAGE("NumberOfPoints: " << this->GetNumberOfPoints());
|
||||||
}
|
}
|
||||||
this->SetCells(newTypes, newLocations, newConnectivity);
|
this->SetCells(newTypes, newLocations, newConnectivity);
|
||||||
this->BuildLinks();
|
this->BuildLinks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SMDS_UnstructuredGrid::copyNodes(vtkPoints *newPoints,
|
||||||
|
std::vector<int>& idNodesOldToNew,
|
||||||
|
int& alreadyCopied,
|
||||||
|
int start,
|
||||||
|
int end)
|
||||||
|
{
|
||||||
|
MESSAGE("copyNodes " << alreadyCopied << " " << start << " " << end << " size: " << end - start << " total: " << alreadyCopied + end - start);
|
||||||
|
void *target = newPoints->GetVoidPointer(3*alreadyCopied);
|
||||||
|
void *source = this->Points->GetVoidPointer(3*start);
|
||||||
|
int nbPoints = end - start;
|
||||||
|
if (nbPoints >0)
|
||||||
|
{
|
||||||
|
memcpy(target, source, 3*sizeof(float)*nbPoints);
|
||||||
|
for (int j=start; j<end; j++)
|
||||||
|
idNodesOldToNew[j] = alreadyCopied++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray *newTypes,
|
||||||
|
std::vector<int>& idCellsOldToNew,
|
||||||
|
std::vector<int>& idNodesOldToNew,
|
||||||
|
vtkCellArray* newConnectivity,
|
||||||
|
vtkIdTypeArray* newLocations,
|
||||||
|
vtkIdType* pointsCell,
|
||||||
|
int& alreadyCopied,
|
||||||
|
int start,
|
||||||
|
int end)
|
||||||
|
{
|
||||||
|
MESSAGE("copyBloc " << alreadyCopied << " " << start << " " << end << " size: " << end - start << " total: " << alreadyCopied + end - start);
|
||||||
|
for (int j=start; j<end; j++)
|
||||||
|
{
|
||||||
|
newTypes->SetValue(alreadyCopied, this->Types->GetValue(j));
|
||||||
|
idCellsOldToNew[j] = alreadyCopied;
|
||||||
|
vtkIdType oldLoc = this->Locations->GetValue(j);
|
||||||
|
vtkIdType nbpts;
|
||||||
|
vtkIdType *oldPtsCell = 0;
|
||||||
|
this->Connectivity->GetCell(oldLoc, nbpts, oldPtsCell);
|
||||||
|
//MESSAGE(j << " " << alreadyCopied << " " << (int)this->Types->GetValue(j) << " " << oldLoc << " " << nbpts );
|
||||||
|
for (int l=0; l<nbpts; l++)
|
||||||
|
{
|
||||||
|
int oldval = oldPtsCell[l];
|
||||||
|
pointsCell[l] = idNodesOldToNew[oldval];
|
||||||
|
//MESSAGE(" " << oldval << " " << pointsCell[l]);
|
||||||
|
}
|
||||||
|
int newcnt = newConnectivity->InsertNextCell(nbpts, pointsCell);
|
||||||
|
int newLoc = newConnectivity->GetInsertLocation(nbpts);
|
||||||
|
//MESSAGE(newcnt << " " << newLoc);
|
||||||
|
newLocations->SetValue(alreadyCopied, newLoc);
|
||||||
|
alreadyCopied++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -26,6 +26,21 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
SMDS_UnstructuredGrid();
|
SMDS_UnstructuredGrid();
|
||||||
~SMDS_UnstructuredGrid();
|
~SMDS_UnstructuredGrid();
|
||||||
|
void copyNodes(vtkPoints *newPoints,
|
||||||
|
std::vector<int>& idNodesOldToNew,
|
||||||
|
int& alreadyCopied,
|
||||||
|
int start,
|
||||||
|
int end);
|
||||||
|
void copyBloc(vtkUnsignedCharArray *newTypes,
|
||||||
|
std::vector<int>& idCellsOldToNew,
|
||||||
|
std::vector<int>& idNodesOldToNew,
|
||||||
|
vtkCellArray* newConnectivity,
|
||||||
|
vtkIdTypeArray* newLocations,
|
||||||
|
vtkIdType* pointsCell,
|
||||||
|
int& alreadyCopied,
|
||||||
|
int start,
|
||||||
|
int end);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _SMDS_UNSTRUCTUREDGRID_HXX */
|
#endif /* _SMDS_UNSTRUCTUREDGRID_HXX */
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _DEBUG_
|
#ifdef _DEBUG_
|
||||||
static int MYDEBUG = 0;
|
static int MYDEBUG = 1;
|
||||||
#else
|
#else
|
||||||
static int MYDEBUG = 0;
|
static int MYDEBUG = 0;
|
||||||
#endif
|
#endif
|
||||||
@ -634,6 +634,7 @@ SMESH_Client::SMESH_Client(CORBA::ORB_ptr theORB,
|
|||||||
mySMESHDSMesh(NULL),
|
mySMESHDSMesh(NULL),
|
||||||
mySMDSMesh(NULL)
|
mySMDSMesh(NULL)
|
||||||
{
|
{
|
||||||
|
MESSAGE("SMESH_Client::SMESH_Client");
|
||||||
myMeshServer->Register();
|
myMeshServer->Register();
|
||||||
|
|
||||||
CORBA::Boolean anIsEmbeddedMode;
|
CORBA::Boolean anIsEmbeddedMode;
|
||||||
@ -649,7 +650,8 @@ SMESH_Client::SMESH_Client(CORBA::ORB_ptr theORB,
|
|||||||
SMESH_Mesh* aMesh = reinterpret_cast<SMESH_Mesh*> (pointeur);
|
SMESH_Mesh* aMesh = reinterpret_cast<SMESH_Mesh*> (pointeur);
|
||||||
if ( MYDEBUG )
|
if ( MYDEBUG )
|
||||||
MESSAGE("SMESH_Client::SMESH_Client aMesh "<<aMesh);
|
MESSAGE("SMESH_Client::SMESH_Client aMesh "<<aMesh);
|
||||||
if(aMesh->GetMeshDS()->IsEmbeddedMode()){
|
//if(aMesh->GetMeshDS()->IsEmbeddedMode()){
|
||||||
|
if(anIsEmbeddedMode){
|
||||||
mySMESHDSMesh = aMesh->GetMeshDS();
|
mySMESHDSMesh = aMesh->GetMeshDS();
|
||||||
mySMDSMesh = mySMESHDSMesh;
|
mySMDSMesh = mySMESHDSMesh;
|
||||||
}
|
}
|
||||||
@ -704,10 +706,12 @@ SMESH_Client::Update(bool theIsClear)
|
|||||||
{
|
{
|
||||||
bool anIsModified = true;
|
bool anIsModified = true;
|
||||||
if(mySMESHDSMesh){
|
if(mySMESHDSMesh){
|
||||||
|
MESSAGE("Update mySMESHDSMesh");
|
||||||
SMESHDS_Script* aScript = mySMESHDSMesh->GetScript();
|
SMESHDS_Script* aScript = mySMESHDSMesh->GetScript();
|
||||||
anIsModified = aScript->IsModified();
|
anIsModified = aScript->IsModified();
|
||||||
aScript->SetModified(false);
|
aScript->SetModified(false);
|
||||||
}else{
|
}else{
|
||||||
|
MESSAGE("Update CORBA");
|
||||||
SMESH::log_array_var aSeq = myMeshServer->GetLog( theIsClear );
|
SMESH::log_array_var aSeq = myMeshServer->GetLog( theIsClear );
|
||||||
CORBA::Long aLength = aSeq->length();
|
CORBA::Long aLength = aSeq->length();
|
||||||
anIsModified = aLength > 0;
|
anIsModified = aLength > 0;
|
||||||
|
@ -1782,10 +1782,11 @@ void SMESHDS_Mesh::compactMesh()
|
|||||||
int nbNodes = myNodes.size();
|
int nbNodes = myNodes.size();
|
||||||
int nbVtkNodes = myGrid->GetNumberOfPoints();
|
int nbVtkNodes = myGrid->GetNumberOfPoints();
|
||||||
MESSAGE("nbNodes=" << nbNodes << " nbVtkNodes=" << nbVtkNodes);
|
MESSAGE("nbNodes=" << nbNodes << " nbVtkNodes=" << nbVtkNodes);
|
||||||
if (nbNodes > nbVtkNodes) nbVtkNodes = nbNodes;
|
int nbNodeTemp = nbVtkNodes;
|
||||||
|
if (nbNodes > nbVtkNodes) nbNodeTemp = nbNodes;
|
||||||
vector<int> idNodesOldToNew;
|
vector<int> idNodesOldToNew;
|
||||||
idNodesOldToNew.clear();
|
idNodesOldToNew.clear();
|
||||||
idNodesOldToNew.resize(nbVtkNodes, -1); // all unused id will be -1
|
idNodesOldToNew.resize(nbNodeTemp, -1); // all unused id will be -1
|
||||||
|
|
||||||
bool areNodesModified = ! myNodeIDFactory->isPoolIdEmpty();
|
bool areNodesModified = ! myNodeIDFactory->isPoolIdEmpty();
|
||||||
MESSAGE("------------------------------------------------- SMESHDS_Mesh::compactMesh " << areNodesModified);
|
MESSAGE("------------------------------------------------- SMESHDS_Mesh::compactMesh " << areNodesModified);
|
||||||
@ -1804,16 +1805,19 @@ void SMESHDS_Mesh::compactMesh()
|
|||||||
{
|
{
|
||||||
for (int i=0; i<nbNodes; i++)
|
for (int i=0; i<nbNodes; i++)
|
||||||
idNodesOldToNew[i] = i;
|
idNodesOldToNew[i] = i;
|
||||||
|
if (nbNodes > nbVtkNodes)
|
||||||
|
newNodeSize = nbVtkNodes; // else 0 means nothing to change (no need to compact vtkPoints)
|
||||||
}
|
}
|
||||||
|
|
||||||
int newCellSize = 0;
|
int newCellSize = 0;
|
||||||
int nbCells = myCells.size();
|
int nbCells = myCells.size();
|
||||||
int nbVtkCells = myGrid->GetNumberOfCells();
|
int nbVtkCells = myGrid->GetNumberOfCells();
|
||||||
MESSAGE("nbCells=" << nbCells << " nbVtkCells=" << nbVtkCells);
|
MESSAGE("nbCells=" << nbCells << " nbVtkCells=" << nbVtkCells);
|
||||||
if (nbCells > nbVtkCells) nbVtkCells = nbCells;
|
int nbCellTemp = nbVtkCells;
|
||||||
|
if (nbCells > nbVtkCells) nbCellTemp = nbCells;
|
||||||
vector<int> idCellsOldToNew;
|
vector<int> idCellsOldToNew;
|
||||||
idCellsOldToNew.clear();
|
idCellsOldToNew.clear();
|
||||||
idCellsOldToNew.resize(nbVtkCells, -1); // all unused id will be -1
|
idCellsOldToNew.resize(nbCellTemp, -1); // all unused id will be -1
|
||||||
|
|
||||||
for (int i=0; i<nbCells; i++)
|
for (int i=0; i<nbCells; i++)
|
||||||
{
|
{
|
||||||
@ -1830,20 +1834,20 @@ void SMESHDS_Mesh::compactMesh()
|
|||||||
if (areNodesModified)
|
if (areNodesModified)
|
||||||
{
|
{
|
||||||
MESSAGE("-------------- modify myNodes");
|
MESSAGE("-------------- modify myNodes");
|
||||||
|
SetOfNodes newNodes;
|
||||||
|
newNodes.resize(newNodeSize);
|
||||||
|
|
||||||
for (int i=0; i<nbNodes; i++)
|
for (int i=0; i<nbNodes; i++)
|
||||||
{
|
{
|
||||||
if (myNodes[i])
|
if (myNodes[i])
|
||||||
{
|
{
|
||||||
int newid = idNodesOldToNew[i];
|
int newid = idNodesOldToNew[i];
|
||||||
if (newid != i)
|
//MESSAGE(i << " --> " << newid);;
|
||||||
{
|
myNodes[i]->setId(newid);
|
||||||
MESSAGE(i << " --> " << newid);
|
newNodes[newid] = myNodes[i];
|
||||||
myNodes[i]->setId(newid);
|
|
||||||
ASSERT(!myNodes[newid]);
|
|
||||||
myNodes[newid] = myNodes[i];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
myNodes.swap(newNodes);
|
||||||
this->myNodeIDFactory->emptyPool(newNodeSize);
|
this->myNodeIDFactory->emptyPool(newNodeSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1882,6 +1886,7 @@ void SMESHDS_Mesh::compactMesh()
|
|||||||
{
|
{
|
||||||
if (myCells[i])
|
if (myCells[i])
|
||||||
{
|
{
|
||||||
|
//MESSAGE(newSmdsId << " " << i);
|
||||||
newCells[newSmdsId] = myCells[i];
|
newCells[newSmdsId] = myCells[i];
|
||||||
int idvtk = myCells[i]->getVtkId();
|
int idvtk = myCells[i]->getVtkId();
|
||||||
newSmdsToVtk[newSmdsId] = idvtk;
|
newSmdsToVtk[newSmdsId] = idvtk;
|
||||||
|
@ -1093,6 +1093,7 @@ LightApp_Module( "SMESH" )
|
|||||||
{
|
{
|
||||||
CORBA::Boolean anIsEmbeddedMode;
|
CORBA::Boolean anIsEmbeddedMode;
|
||||||
myComponentSMESH = SMESH_Client::GetSMESHGen(getApp()->orb(),anIsEmbeddedMode);
|
myComponentSMESH = SMESH_Client::GetSMESHGen(getApp()->orb(),anIsEmbeddedMode);
|
||||||
|
MESSAGE("-------------------------------> anIsEmbeddedMode=" << anIsEmbeddedMode);
|
||||||
|
|
||||||
// 0019923: EDF 765 SMESH : default values of hypothesis
|
// 0019923: EDF 765 SMESH : default values of hypothesis
|
||||||
SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this);
|
SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this);
|
||||||
|
@ -326,7 +326,7 @@ namespace SMESH
|
|||||||
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
|
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
|
||||||
OCC_CATCH_SIGNALS;
|
OCC_CATCH_SIGNALS;
|
||||||
#endif
|
#endif
|
||||||
MESSAGE("GetVisualObj");
|
//MESSAGE("GetVisualObj");
|
||||||
if (nulData)
|
if (nulData)
|
||||||
objModified = aVisualObj->NulData();
|
objModified = aVisualObj->NulData();
|
||||||
else
|
else
|
||||||
@ -669,7 +669,7 @@ namespace SMESH
|
|||||||
|
|
||||||
bool UpdateView(SUIT_ViewWindow *theWnd, EDisplaing theAction, const char* theEntry)
|
bool UpdateView(SUIT_ViewWindow *theWnd, EDisplaing theAction, const char* theEntry)
|
||||||
{
|
{
|
||||||
MESSAGE("UpdateView");
|
//MESSAGE("UpdateView");
|
||||||
bool OK = false;
|
bool OK = false;
|
||||||
SVTK_ViewWindow* aViewWnd = GetVtkViewWindow(theWnd);
|
SVTK_ViewWindow* aViewWnd = GetVtkViewWindow(theWnd);
|
||||||
if (!aViewWnd)
|
if (!aViewWnd)
|
||||||
@ -694,10 +694,10 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
case eDisplayOnly:
|
case eDisplayOnly:
|
||||||
case eEraseAll: {
|
case eEraseAll: {
|
||||||
MESSAGE("---case eDisplayOnly");
|
//MESSAGE("---case eDisplayOnly");
|
||||||
while (vtkActor *anAct = aCollection->GetNextActor()) {
|
while (vtkActor *anAct = aCollection->GetNextActor()) {
|
||||||
if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
|
if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
|
||||||
MESSAGE("--- erase " << anActor);
|
//MESSAGE("--- erase " << anActor);
|
||||||
anActor->SetVisibility(false);
|
anActor->SetVisibility(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -707,12 +707,12 @@ namespace SMESH
|
|||||||
switch (theAction) {
|
switch (theAction) {
|
||||||
case eDisplay:
|
case eDisplay:
|
||||||
case eDisplayOnly:
|
case eDisplayOnly:
|
||||||
MESSAGE("--- display " << anActor);
|
//MESSAGE("--- display " << anActor);
|
||||||
anActor->SetVisibility(true);
|
anActor->SetVisibility(true);
|
||||||
if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange();
|
if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange();
|
||||||
break;
|
break;
|
||||||
case eErase:
|
case eErase:
|
||||||
MESSAGE("--- erase " << anActor);
|
//MESSAGE("--- erase " << anActor);
|
||||||
anActor->SetVisibility(false);
|
anActor->SetVisibility(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -721,7 +721,7 @@ namespace SMESH
|
|||||||
case eDisplay:
|
case eDisplay:
|
||||||
case eDisplayOnly:
|
case eDisplayOnly:
|
||||||
{
|
{
|
||||||
MESSAGE("---");
|
//MESSAGE("---");
|
||||||
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(theWnd->getViewManager()->study());
|
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(theWnd->getViewManager()->study());
|
||||||
_PTR(Study) aDocument = aStudy->studyDS();
|
_PTR(Study) aDocument = aStudy->studyDS();
|
||||||
// Pass non-visual objects (hypotheses, etc.), return true in this case
|
// Pass non-visual objects (hypotheses, etc.), return true in this case
|
||||||
@ -750,7 +750,7 @@ namespace SMESH
|
|||||||
|
|
||||||
|
|
||||||
bool UpdateView(EDisplaing theAction, const char* theEntry){
|
bool UpdateView(EDisplaing theAction, const char* theEntry){
|
||||||
MESSAGE("UpdateView");
|
//MESSAGE("UpdateView");
|
||||||
SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( GetActiveStudy() );
|
SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( GetActiveStudy() );
|
||||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( aStudy->application() );
|
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( aStudy->application() );
|
||||||
SUIT_ViewWindow *aWnd = app->activeViewManager()->getActiveView();
|
SUIT_ViewWindow *aWnd = app->activeViewManager()->getActiveView();
|
||||||
|
@ -459,6 +459,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::createMesh()
|
|||||||
// create a new mesh object servant, store it in a map in study context
|
// create a new mesh object servant, store it in a map in study context
|
||||||
SMESH_Mesh_i* meshServant = new SMESH_Mesh_i( GetPOA(), this, GetCurrentStudyID() );
|
SMESH_Mesh_i* meshServant = new SMESH_Mesh_i( GetPOA(), this, GetCurrentStudyID() );
|
||||||
// create a new mesh object
|
// create a new mesh object
|
||||||
|
MESSAGE("myIsEmbeddedMode " << myIsEmbeddedMode);
|
||||||
meshServant->SetImpl( myGen.CreateMesh( GetCurrentStudyID(), myIsEmbeddedMode ));
|
meshServant->SetImpl( myGen.CreateMesh( GetCurrentStudyID(), myIsEmbeddedMode ));
|
||||||
|
|
||||||
// activate the CORBA servant of Mesh
|
// activate the CORBA servant of Mesh
|
||||||
@ -516,6 +517,7 @@ void SMESH_Gen_i::SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo )
|
|||||||
void SMESH_Gen_i::SetEmbeddedMode( CORBA::Boolean theMode )
|
void SMESH_Gen_i::SetEmbeddedMode( CORBA::Boolean theMode )
|
||||||
{
|
{
|
||||||
myIsEmbeddedMode = theMode;
|
myIsEmbeddedMode = theMode;
|
||||||
|
MESSAGE("myIsEmbeddedMode " << myIsEmbeddedMode);
|
||||||
|
|
||||||
if ( !myIsEmbeddedMode ) {
|
if ( !myIsEmbeddedMode ) {
|
||||||
//PAL10867: disable signals catching with "noexcepthandler" option
|
//PAL10867: disable signals catching with "noexcepthandler" option
|
||||||
|
Loading…
Reference in New Issue
Block a user