Merge remote branch 'origin/V7_dev'
@ -4,10 +4,11 @@
|
|||||||
|
|
||||||
\n This mesh quality control highlights faces sharing only one border
|
\n This mesh quality control highlights faces sharing only one border
|
||||||
with other faces. In other words, the faces having all thier nodes on
|
with other faces. In other words, the faces having all thier nodes on
|
||||||
the external border of the mesh are highlighted.
|
the free border of the 2D mesh are highlighted.
|
||||||
|
|
||||||
\note The highlighted faces are actually over-constrained only if, at the computation time,
|
\note The highlighted faces are actually over-constrained only if, at
|
||||||
the boundary conditions on the borders where the nodes are located are all Dirichlet boundary conditions.
|
the computation time, the boundary conditions on the borders where the
|
||||||
|
nodes are located are all Dirichlet boundary conditions.
|
||||||
|
|
||||||
\image html over_constrained_faces.png
|
\image html over_constrained_faces.png
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@
|
|||||||
<parameter name="Plug-ins/MGCleaner plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/MGCleaner/index.html"/>
|
<parameter name="Plug-ins/MGCleaner plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/MGCleaner/index.html"/>
|
||||||
<parameter name="Plug-ins/Z-cracks plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/zcracks/index.html"/>
|
<parameter name="Plug-ins/Z-cracks plugin User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/zcracks/index.html"/>
|
||||||
<parameter name="Plug-ins/MacMesh plugin" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/MacMesh/index.html"/>
|
<parameter name="Plug-ins/MacMesh plugin" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/MacMesh/index.html"/>
|
||||||
<parameter name="Plug-ins/plugin blocFissure" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/blocFissure/index.html"/>
|
<parameter name="Plug-ins/blocFissure plugin" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/blocFissure/index.html"/>
|
||||||
<parameter name="Developer's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/tui/SMESH/index.html"/>
|
<parameter name="Developer's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/tui/SMESH/index.html"/>
|
||||||
</section>
|
</section>
|
||||||
<section name="resources">
|
<section name="resources">
|
||||||
|
@ -1832,10 +1832,10 @@ void Length2D::GetValues(TValues& theValues)
|
|||||||
dynamic_cast<const SMDS_VtkFace*>(anElem);
|
dynamic_cast<const SMDS_VtkFace*>(anElem);
|
||||||
// use special nodes iterator
|
// use special nodes iterator
|
||||||
SMDS_ElemIteratorPtr anIter = F->interlacedNodesElemIterator();
|
SMDS_ElemIteratorPtr anIter = F->interlacedNodesElemIterator();
|
||||||
long aNodeId[4];
|
long aNodeId[4] = { 0,0,0,0 };
|
||||||
gp_Pnt P[4];
|
gp_Pnt P[4];
|
||||||
|
|
||||||
double aLength;
|
double aLength = 0;
|
||||||
const SMDS_MeshElement* aNode;
|
const SMDS_MeshElement* aNode;
|
||||||
if(anIter->more()){
|
if(anIter->more()){
|
||||||
aNode = anIter->next();
|
aNode = anIter->next();
|
||||||
@ -1957,7 +1957,7 @@ double MultiConnection2D::GetValue( long theElementId )
|
|||||||
SMDS_ElemIteratorPtr anIter = aFaceElem->nodesIterator();
|
SMDS_ElemIteratorPtr anIter = aFaceElem->nodesIterator();
|
||||||
if (!anIter) break;
|
if (!anIter) break;
|
||||||
|
|
||||||
const SMDS_MeshNode *aNode, *aNode0;
|
const SMDS_MeshNode *aNode, *aNode0 = 0;
|
||||||
TColStd_MapOfInteger aMap, aMapPrev;
|
TColStd_MapOfInteger aMap, aMapPrev;
|
||||||
|
|
||||||
for (i = 0; i <= len; i++) {
|
for (i = 0; i <= len; i++) {
|
||||||
@ -2038,7 +2038,7 @@ void MultiConnection2D::GetValues(MValues& theValues)
|
|||||||
(anElem)->interlacedNodesElemIterator();
|
(anElem)->interlacedNodesElemIterator();
|
||||||
else
|
else
|
||||||
aNodesIter = anElem->nodesIterator();
|
aNodesIter = anElem->nodesIterator();
|
||||||
long aNodeId[3];
|
long aNodeId[3] = {0,0,0};
|
||||||
|
|
||||||
//int aNbConnects=0;
|
//int aNbConnects=0;
|
||||||
const SMDS_MeshNode* aNode0;
|
const SMDS_MeshNode* aNode0;
|
||||||
@ -2511,7 +2511,7 @@ void FreeEdges::GetBoreders(TBorders& theBorders)
|
|||||||
interlacedNodesElemIterator();
|
interlacedNodesElemIterator();
|
||||||
else
|
else
|
||||||
aNodesIter = anElem->nodesIterator();
|
aNodesIter = anElem->nodesIterator();
|
||||||
long aNodeId[2];
|
long aNodeId[2] = {0,0};
|
||||||
const SMDS_MeshElement* aNode;
|
const SMDS_MeshElement* aNode;
|
||||||
if(aNodesIter->more()){
|
if(aNodesIter->more()){
|
||||||
aNode = aNodesIter->next();
|
aNode = aNodesIter->next();
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
//#include <stdlib.h>
|
//#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef _DEBUG_
|
#ifdef _DEBUG_
|
||||||
static int MYDEBUG = 1;
|
static int MYDEBUG = 0;
|
||||||
//#define _DEXCEPT_
|
//#define _DEXCEPT_
|
||||||
#else
|
#else
|
||||||
static int MYDEBUG = 0;
|
static int MYDEBUG = 0;
|
||||||
|
@ -644,7 +644,7 @@ namespace MED
|
|||||||
TIntVector aVec;
|
TIntVector aVec;
|
||||||
aVec.resize(theMeshInfo->GetDim());
|
aVec.resize(theMeshInfo->GetDim());
|
||||||
for(int aAxe=0;aAxe<theMeshInfo->GetDim();aAxe++){
|
for(int aAxe=0;aAxe<theMeshInfo->GetDim();aAxe++){
|
||||||
ETable aATable;
|
ETable aATable = eCOOR_IND1;
|
||||||
switch(aAxe){
|
switch(aAxe){
|
||||||
case 0:
|
case 0:
|
||||||
aATable = eCOOR_IND1;
|
aATable = eCOOR_IND1;
|
||||||
|
@ -2739,7 +2739,7 @@ namespace MED
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(aMaillageType == eSTRUCTURE && aGrilleType != eGRILLE_STANDARD){
|
if(aMaillageType == eSTRUCTURE && aGrilleType != eGRILLE_STANDARD){
|
||||||
ETable aTable;
|
ETable aTable = eCOOR_IND1;
|
||||||
for(med_int anAxis = 1; anAxis <= aMeshInfo.myDim; anAxis++){
|
for(med_int anAxis = 1; anAxis <= aMeshInfo.myDim; anAxis++){
|
||||||
switch(anAxis){
|
switch(anAxis){
|
||||||
case 1 :
|
case 1 :
|
||||||
|
@ -82,9 +82,9 @@
|
|||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
|
|
||||||
#ifdef _DEBUG_
|
#ifdef _DEBUG_
|
||||||
static int MYDEBUG = 1;
|
static int MYDEBUG = 0;
|
||||||
#else
|
#else
|
||||||
static int MYDEBUG = 1;
|
static int MYDEBUG = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int aLineWidthInc = 2;
|
static int aLineWidthInc = 2;
|
||||||
@ -799,8 +799,7 @@ SetControlMode(eControl theMode)
|
|||||||
|
|
||||||
void
|
void
|
||||||
SMESH_ActorDef::
|
SMESH_ActorDef::
|
||||||
SetControlMode(eControl theMode,
|
SetControlMode( eControl theMode, bool theCheckEntityMode )
|
||||||
bool theCheckEntityMode)
|
|
||||||
{
|
{
|
||||||
vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
|
vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
|
||||||
bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10;
|
bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10;
|
||||||
|
@ -311,7 +311,7 @@ SMESH_DeviceActor
|
|||||||
vtkIdType aNbCells = aGrid->GetNumberOfCells();
|
vtkIdType aNbCells = aGrid->GetNumberOfCells();
|
||||||
aScalars->SetNumberOfComponents(1);
|
aScalars->SetNumberOfComponents(1);
|
||||||
aScalars->SetNumberOfTuples(aNbCells);
|
aScalars->SetNumberOfTuples(aNbCells);
|
||||||
double* range;// = aScalars->GetRange();
|
double* range = 0;// = aScalars->GetRange();
|
||||||
|
|
||||||
myVisualObj->UpdateFunctor(theFunctor);
|
myVisualObj->UpdateFunctor(theFunctor);
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ using namespace std;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _DEBUG_
|
#ifdef _DEBUG_
|
||||||
static int MYDEBUG = 1;
|
static int MYDEBUG = 0;
|
||||||
static int MYDEBUGWITHFILES = 0;//1;
|
static int MYDEBUGWITHFILES = 0;//1;
|
||||||
#else
|
#else
|
||||||
static int MYDEBUG = 0;
|
static int MYDEBUG = 0;
|
||||||
@ -133,7 +133,7 @@ static int MYDEBUGWITHFILES = 0;
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
SMESH_VisualObjDef::SMESH_VisualObjDef()
|
SMESH_VisualObjDef::SMESH_VisualObjDef()
|
||||||
{
|
{
|
||||||
MESSAGE("---------------------------------------------SMESH_VisualObjDef::SMESH_VisualObjDef");
|
if ( MYDEBUG ) MESSAGE("-------------------------------SMESH_VisualObjDef::SMESH_VisualObjDef");
|
||||||
myGrid = vtkUnstructuredGrid::New();
|
myGrid = vtkUnstructuredGrid::New();
|
||||||
myLocalGrid = false;
|
myLocalGrid = false;
|
||||||
ClearEntitiesFlags();
|
ClearEntitiesFlags();
|
||||||
@ -141,9 +141,8 @@ SMESH_VisualObjDef::SMESH_VisualObjDef()
|
|||||||
}
|
}
|
||||||
SMESH_VisualObjDef::~SMESH_VisualObjDef()
|
SMESH_VisualObjDef::~SMESH_VisualObjDef()
|
||||||
{
|
{
|
||||||
MESSAGE("---------------------------------------------SMESH_VisualObjDef::~SMESH_VisualObjDef");
|
if ( MYDEBUG ) MESSAGE("--------------------------------SMESH_VisualObjDef::~SMESH_VisualObjDef");
|
||||||
//if ( MYDEBUG )
|
if ( MYDEBUG ) MESSAGE( "myGrid->GetReferenceCount() = " << myGrid->GetReferenceCount() );
|
||||||
MESSAGE( "~SMESH_MeshObj - myGrid->GetReferenceCount() = " << myGrid->GetReferenceCount() );
|
|
||||||
myGrid->Delete();
|
myGrid->Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,7 +247,7 @@ void SMESH_VisualObjDef::createPoints( vtkPoints* thePoints )
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESH_VisualObjDef::buildPrs(bool buildGrid)
|
void SMESH_VisualObjDef::buildPrs(bool buildGrid)
|
||||||
{
|
{
|
||||||
MESSAGE("----------------------------------------------------------SMESH_VisualObjDef::buildPrs " << buildGrid);
|
if ( MYDEBUG ) MESSAGE("---------------------------SMESH_VisualObjDef::buildPrs " << buildGrid);
|
||||||
if (buildGrid)
|
if (buildGrid)
|
||||||
{
|
{
|
||||||
myLocalGrid = true;
|
myLocalGrid = true;
|
||||||
@ -281,7 +280,7 @@ void SMESH_VisualObjDef::buildPrs(bool buildGrid)
|
|||||||
myLocalGrid = false;
|
myLocalGrid = false;
|
||||||
if (!GetMesh()->isCompacted())
|
if (!GetMesh()->isCompacted())
|
||||||
{
|
{
|
||||||
MESSAGE("*** buildPrs ==> compactMesh!");
|
if ( MYDEBUG ) MESSAGE("*** buildPrs ==> compactMesh!");
|
||||||
GetMesh()->compactMesh();
|
GetMesh()->compactMesh();
|
||||||
}
|
}
|
||||||
vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
|
vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
|
||||||
@ -697,9 +696,9 @@ 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);
|
if ( MYDEBUG ) MESSAGE("SMESH_MeshObj::Update " << this);
|
||||||
if ( myClient.Update(theIsClear) || GetUnstructuredGrid()->GetNumberOfPoints()==0) {
|
if ( myClient.Update(theIsClear) || GetUnstructuredGrid()->GetNumberOfPoints()==0) {
|
||||||
MESSAGE("buildPrs");
|
if ( MYDEBUG ) MESSAGE("buildPrs");
|
||||||
buildPrs(); // Fill unstructured grid
|
buildPrs(); // Fill unstructured grid
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -708,7 +707,7 @@ bool SMESH_MeshObj::Update( int theIsClear )
|
|||||||
|
|
||||||
bool SMESH_MeshObj::NulData()
|
bool SMESH_MeshObj::NulData()
|
||||||
{
|
{
|
||||||
MESSAGE ("SMESH_MeshObj::NulData() ==================================================================================");
|
if ( MYDEBUG ) MESSAGE ("SMESH_MeshObj::NulData() =============================================");
|
||||||
if (!myEmptyGrid)
|
if (!myEmptyGrid)
|
||||||
{
|
{
|
||||||
myEmptyGrid = SMDS_UnstructuredGrid::New();
|
myEmptyGrid = SMDS_UnstructuredGrid::New();
|
||||||
@ -901,7 +900,7 @@ void SMESH_SubMeshObj::UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunc
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool SMESH_SubMeshObj::Update( int theIsClear )
|
bool SMESH_SubMeshObj::Update( int theIsClear )
|
||||||
{
|
{
|
||||||
MESSAGE("SMESH_SubMeshObj::Update " << this)
|
if ( MYDEBUG ) MESSAGE("SMESH_SubMeshObj::Update " << this)
|
||||||
bool changed = myMeshObj->Update( theIsClear );
|
bool changed = myMeshObj->Update( theIsClear );
|
||||||
buildPrs(true);
|
buildPrs(true);
|
||||||
return changed;
|
return changed;
|
||||||
|
@ -321,8 +321,8 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
|
|||||||
// rnv begin
|
// rnv begin
|
||||||
// Customization of the vtkScalarBarActor to show distribution histogram.
|
// Customization of the vtkScalarBarActor to show distribution histogram.
|
||||||
bool distrVisibility = (numColors == (int)this->myNbValues.size());
|
bool distrVisibility = (numColors == (int)this->myNbValues.size());
|
||||||
vtkPoints *distrPts;
|
vtkPoints *distrPts = 0;
|
||||||
vtkCellArray *distrPolys;
|
vtkCellArray *distrPolys = 0;
|
||||||
vtkUnsignedCharArray *distColors = 0;
|
vtkUnsignedCharArray *distColors = 0;
|
||||||
int numDistrPts = 0, numPositiveVal=0, maxValue=0;
|
int numDistrPts = 0, numPositiveVal=0, maxValue=0;
|
||||||
if(!distrVisibility)
|
if(!distrVisibility)
|
||||||
|
@ -525,7 +525,6 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshEdge * e1,
|
|||||||
if ( !e1 || !e2 || !e3 ) return 0;
|
if ( !e1 || !e2 || !e3 ) return 0;
|
||||||
|
|
||||||
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
||||||
MESSAGE("AddFaceWithID" << ID);
|
|
||||||
|
|
||||||
SMDS_MeshFace * face = new SMDS_FaceOfEdges(e1,e2,e3);
|
SMDS_MeshFace * face = new SMDS_FaceOfEdges(e1,e2,e3);
|
||||||
adjustmyCellsCapacity(ID);
|
adjustmyCellsCapacity(ID);
|
||||||
@ -552,7 +551,6 @@ SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshEdge * e1,
|
|||||||
{
|
{
|
||||||
if (!hasConstructionEdges())
|
if (!hasConstructionEdges())
|
||||||
return NULL;
|
return NULL;
|
||||||
//MESSAGE("AddFaceWithID" );
|
|
||||||
return AddFaceWithID(e1,e2,e3,e4, myElementIDFactory->GetFreeID());
|
return AddFaceWithID(e1,e2,e3,e4, myElementIDFactory->GetFreeID());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -568,7 +566,6 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshEdge * e1,
|
|||||||
{
|
{
|
||||||
if (!hasConstructionEdges())
|
if (!hasConstructionEdges())
|
||||||
return NULL;
|
return NULL;
|
||||||
MESSAGE("AddFaceWithID" << ID);
|
|
||||||
if ( !e1 || !e2 || !e3 || !e4 ) return 0;
|
if ( !e1 || !e2 || !e3 || !e4 ) return 0;
|
||||||
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
||||||
SMDS_MeshFace * face = new SMDS_FaceOfEdges(e1,e2,e3,e4);
|
SMDS_MeshFace * face = new SMDS_FaceOfEdges(e1,e2,e3,e4);
|
||||||
@ -596,7 +593,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
|
|||||||
const SMDS_MeshNode * n4)
|
const SMDS_MeshNode * n4)
|
||||||
{
|
{
|
||||||
int ID = myElementIDFactory->GetFreeID();
|
int ID = myElementIDFactory->GetFreeID();
|
||||||
//MESSAGE("AddVolumeWithID " << ID);
|
|
||||||
SMDS_MeshVolume * v = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, ID);
|
SMDS_MeshVolume * v = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, ID);
|
||||||
if(v==NULL) myElementIDFactory->ReleaseID(ID);
|
if(v==NULL) myElementIDFactory->ReleaseID(ID);
|
||||||
return v;
|
return v;
|
||||||
@ -615,7 +611,6 @@ SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1,
|
|||||||
int idnode4,
|
int idnode4,
|
||||||
int ID)
|
int ID)
|
||||||
{
|
{
|
||||||
//MESSAGE("AddVolumeWithID" << ID);
|
|
||||||
SMDS_MeshNode *node1, *node2, *node3, *node4;
|
SMDS_MeshNode *node1, *node2, *node3, *node4;
|
||||||
node1 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode1);
|
node1 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode1);
|
||||||
node2 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode2);
|
node2 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode2);
|
||||||
@ -637,7 +632,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
const SMDS_MeshNode * n4,
|
const SMDS_MeshNode * n4,
|
||||||
int ID)
|
int ID)
|
||||||
{
|
{
|
||||||
//MESSAGE("AddVolumeWithID " << ID);
|
|
||||||
SMDS_MeshVolume* volume = 0;
|
SMDS_MeshVolume* volume = 0;
|
||||||
if ( !n1 || !n2 || !n3 || !n4) return volume;
|
if ( !n1 || !n2 || !n3 || !n4) return volume;
|
||||||
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
||||||
@ -652,7 +646,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
myInfo.myNbTetras++;
|
myInfo.myNbTetras++;
|
||||||
}
|
}
|
||||||
else if(hasConstructionEdges()) {
|
else if(hasConstructionEdges()) {
|
||||||
MESSAGE("Error : Not implemented");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -697,7 +690,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
|
|||||||
const SMDS_MeshNode * n5)
|
const SMDS_MeshNode * n5)
|
||||||
{
|
{
|
||||||
int ID = myElementIDFactory->GetFreeID();
|
int ID = myElementIDFactory->GetFreeID();
|
||||||
//MESSAGE("AddVolumeWithID " << ID);
|
|
||||||
SMDS_MeshVolume * v = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, ID);
|
SMDS_MeshVolume * v = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, ID);
|
||||||
if(v==NULL) myElementIDFactory->ReleaseID(ID);
|
if(v==NULL) myElementIDFactory->ReleaseID(ID);
|
||||||
return v;
|
return v;
|
||||||
@ -718,7 +710,6 @@ SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1,
|
|||||||
int idnode5,
|
int idnode5,
|
||||||
int ID)
|
int ID)
|
||||||
{
|
{
|
||||||
//MESSAGE("AddVolumeWithID " << ID);
|
|
||||||
SMDS_MeshNode *node1, *node2, *node3, *node4, *node5;
|
SMDS_MeshNode *node1, *node2, *node3, *node4, *node5;
|
||||||
node1 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode1);
|
node1 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode1);
|
||||||
node2 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode2);
|
node2 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode2);
|
||||||
@ -743,7 +734,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
const SMDS_MeshNode * n5,
|
const SMDS_MeshNode * n5,
|
||||||
int ID)
|
int ID)
|
||||||
{
|
{
|
||||||
//MESSAGE("AddVolumeWithID " << ID);
|
|
||||||
SMDS_MeshVolume* volume = 0;
|
SMDS_MeshVolume* volume = 0;
|
||||||
if ( !n1 || !n2 || !n3 || !n4 || !n5) return volume;
|
if ( !n1 || !n2 || !n3 || !n4 || !n5) return volume;
|
||||||
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
||||||
@ -758,7 +748,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
myInfo.myNbPyramids++;
|
myInfo.myNbPyramids++;
|
||||||
}
|
}
|
||||||
else if(hasConstructionEdges()) {
|
else if(hasConstructionEdges()) {
|
||||||
MESSAGE("Error : Not implemented");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -805,7 +794,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
|
|||||||
const SMDS_MeshNode * n6)
|
const SMDS_MeshNode * n6)
|
||||||
{
|
{
|
||||||
int ID = myElementIDFactory->GetFreeID();
|
int ID = myElementIDFactory->GetFreeID();
|
||||||
//MESSAGE("AddVolumeWithID " << ID);
|
|
||||||
SMDS_MeshVolume * v = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, ID);
|
SMDS_MeshVolume * v = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, ID);
|
||||||
if(v==NULL) myElementIDFactory->ReleaseID(ID);
|
if(v==NULL) myElementIDFactory->ReleaseID(ID);
|
||||||
return v;
|
return v;
|
||||||
@ -827,7 +815,6 @@ SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1,
|
|||||||
int idnode6,
|
int idnode6,
|
||||||
int ID)
|
int ID)
|
||||||
{
|
{
|
||||||
//MESSAGE("AddVolumeWithID " << ID);
|
|
||||||
SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6;
|
SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6;
|
||||||
node1 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode1);
|
node1 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode1);
|
||||||
node2 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode2);
|
node2 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode2);
|
||||||
@ -854,7 +841,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
const SMDS_MeshNode * n6,
|
const SMDS_MeshNode * n6,
|
||||||
int ID)
|
int ID)
|
||||||
{
|
{
|
||||||
//MESSAGE("AddVolumeWithID " << ID);
|
|
||||||
SMDS_MeshVolume* volume = 0;
|
SMDS_MeshVolume* volume = 0;
|
||||||
if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6) return volume;
|
if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6) return volume;
|
||||||
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
||||||
@ -870,7 +856,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
myInfo.myNbPrisms++;
|
myInfo.myNbPrisms++;
|
||||||
}
|
}
|
||||||
else if(hasConstructionEdges()) {
|
else if(hasConstructionEdges()) {
|
||||||
MESSAGE("Error : Not implemented");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -994,11 +979,9 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
return volume;
|
return volume;
|
||||||
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
||||||
if(hasConstructionFaces()) {
|
if(hasConstructionFaces()) {
|
||||||
MESSAGE("Error : Not implemented");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else if(hasConstructionEdges()) {
|
else if(hasConstructionEdges()) {
|
||||||
MESSAGE("Error : Not implemented");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1074,7 +1057,6 @@ SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1,
|
|||||||
int idnode8,
|
int idnode8,
|
||||||
int ID)
|
int ID)
|
||||||
{
|
{
|
||||||
//MESSAGE("AddVolumeWithID " << ID);
|
|
||||||
SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6, *node7, *node8;
|
SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6, *node7, *node8;
|
||||||
node1 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode1);
|
node1 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode1);
|
||||||
node2 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode2);
|
node2 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode2);
|
||||||
@ -1108,7 +1090,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
const SMDS_MeshNode * n8,
|
const SMDS_MeshNode * n8,
|
||||||
int ID)
|
int ID)
|
||||||
{
|
{
|
||||||
//MESSAGE("AddVolumeWithID " << ID);
|
|
||||||
SMDS_MeshVolume* volume = 0;
|
SMDS_MeshVolume* volume = 0;
|
||||||
if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8) return volume;
|
if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8) return volume;
|
||||||
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
||||||
@ -1125,7 +1106,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
myInfo.myNbHexas++;
|
myInfo.myNbHexas++;
|
||||||
}
|
}
|
||||||
else if(hasConstructionEdges()) {
|
else if(hasConstructionEdges()) {
|
||||||
MESSAGE("Error : Not implemented");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1171,7 +1151,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshFace * f1,
|
|||||||
const SMDS_MeshFace * f3,
|
const SMDS_MeshFace * f3,
|
||||||
const SMDS_MeshFace * f4)
|
const SMDS_MeshFace * f4)
|
||||||
{
|
{
|
||||||
//MESSAGE("AddVolumeWithID");
|
|
||||||
if (!hasConstructionFaces())
|
if (!hasConstructionFaces())
|
||||||
return NULL;
|
return NULL;
|
||||||
return AddVolumeWithID(f1,f2,f3,f4, myElementIDFactory->GetFreeID());
|
return AddVolumeWithID(f1,f2,f3,f4, myElementIDFactory->GetFreeID());
|
||||||
@ -1189,7 +1168,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshFace * f1,
|
|||||||
const SMDS_MeshFace * f4,
|
const SMDS_MeshFace * f4,
|
||||||
int ID)
|
int ID)
|
||||||
{
|
{
|
||||||
MESSAGE("AddVolumeWithID" << ID);
|
|
||||||
if (!hasConstructionFaces())
|
if (!hasConstructionFaces())
|
||||||
return NULL;
|
return NULL;
|
||||||
if ( !f1 || !f2 || !f3 || !f4) return 0;
|
if ( !f1 || !f2 || !f3 || !f4) return 0;
|
||||||
@ -1218,7 +1196,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshFace * f1,
|
|||||||
const SMDS_MeshFace * f4,
|
const SMDS_MeshFace * f4,
|
||||||
const SMDS_MeshFace * f5)
|
const SMDS_MeshFace * f5)
|
||||||
{
|
{
|
||||||
//MESSAGE("AddVolumeWithID");
|
|
||||||
if (!hasConstructionFaces())
|
if (!hasConstructionFaces())
|
||||||
return NULL;
|
return NULL;
|
||||||
return AddVolumeWithID(f1,f2,f3,f4,f5, myElementIDFactory->GetFreeID());
|
return AddVolumeWithID(f1,f2,f3,f4,f5, myElementIDFactory->GetFreeID());
|
||||||
@ -1237,7 +1214,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshFace * f1,
|
|||||||
const SMDS_MeshFace * f5,
|
const SMDS_MeshFace * f5,
|
||||||
int ID)
|
int ID)
|
||||||
{
|
{
|
||||||
MESSAGE("AddVolumeWithID" << ID);
|
|
||||||
if (!hasConstructionFaces())
|
if (!hasConstructionFaces())
|
||||||
return NULL;
|
return NULL;
|
||||||
if ( !f1 || !f2 || !f3 || !f4 || !f5) return 0;
|
if ( !f1 || !f2 || !f3 || !f4 || !f5) return 0;
|
||||||
@ -1267,7 +1243,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshFace * f1,
|
|||||||
const SMDS_MeshFace * f5,
|
const SMDS_MeshFace * f5,
|
||||||
const SMDS_MeshFace * f6)
|
const SMDS_MeshFace * f6)
|
||||||
{
|
{
|
||||||
//MESSAGE("AddVolumeWithID" );
|
|
||||||
if (!hasConstructionFaces())
|
if (!hasConstructionFaces())
|
||||||
return NULL;
|
return NULL;
|
||||||
return AddVolumeWithID(f1,f2,f3,f4,f5,f6, myElementIDFactory->GetFreeID());
|
return AddVolumeWithID(f1,f2,f3,f4,f5,f6, myElementIDFactory->GetFreeID());
|
||||||
@ -1287,7 +1262,6 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshFace * f1,
|
|||||||
const SMDS_MeshFace * f6,
|
const SMDS_MeshFace * f6,
|
||||||
int ID)
|
int ID)
|
||||||
{
|
{
|
||||||
MESSAGE("AddVolumeWithID" << ID);
|
|
||||||
if (!hasConstructionFaces())
|
if (!hasConstructionFaces())
|
||||||
return NULL;
|
return NULL;
|
||||||
if ( !f1 || !f2 || !f3 || !f4 || !f5 || !f6) return 0;
|
if ( !f1 || !f2 || !f3 || !f4 || !f5 || !f6) return 0;
|
||||||
@ -1334,7 +1308,6 @@ SMDS_Mesh::AddPolygonalFaceWithID (const vector<const SMDS_MeshNode*> & nodes,
|
|||||||
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
||||||
if (hasConstructionEdges())
|
if (hasConstructionEdges())
|
||||||
{
|
{
|
||||||
MESSAGE("Error : Not implemented");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1399,7 +1372,6 @@ SMDS_Mesh::AddQuadPolygonalFaceWithID (const vector<const SMDS_MeshNode*> & node
|
|||||||
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
||||||
if (hasConstructionEdges())
|
if (hasConstructionEdges())
|
||||||
{
|
{
|
||||||
MESSAGE("Error : Not implemented");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1472,18 +1444,15 @@ SMDS_Mesh::AddPolyhedralVolumeWithID (const vector<const SMDS_MeshNode*>& nodes,
|
|||||||
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
||||||
if (hasConstructionFaces())
|
if (hasConstructionFaces())
|
||||||
{
|
{
|
||||||
MESSAGE("Error : Not implemented");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else if (hasConstructionEdges())
|
else if (hasConstructionEdges())
|
||||||
{
|
{
|
||||||
MESSAGE("Error : Not implemented");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//#ifdef VTK_HAVE_POLYHEDRON
|
//#ifdef VTK_HAVE_POLYHEDRON
|
||||||
//MESSAGE("AddPolyhedralVolumeWithID vtk " << ID);
|
|
||||||
myNodeIds.resize( nodes.size() );
|
myNodeIds.resize( nodes.size() );
|
||||||
for ( size_t i = 0; i < nodes.size(); ++i )
|
for ( size_t i = 0; i < nodes.size(); ++i )
|
||||||
myNodeIds[i] = nodes[i]->getVtkId();
|
myNodeIds[i] = nodes[i]->getVtkId();
|
||||||
@ -1498,7 +1467,6 @@ SMDS_Mesh::AddPolyhedralVolumeWithID (const vector<const SMDS_MeshNode*>& nodes,
|
|||||||
}
|
}
|
||||||
volume = volvtk;
|
volume = volvtk;
|
||||||
//#else
|
//#else
|
||||||
// MESSAGE("AddPolyhedralVolumeWithID smds " << ID);
|
|
||||||
// for ( int i = 0; i < nodes.size(); ++i )
|
// for ( int i = 0; i < nodes.size(); ++i )
|
||||||
// if ( !nodes[ i ] ) return 0;
|
// if ( !nodes[ i ] ) return 0;
|
||||||
// volume = new SMDS_PolyhedralVolumeOfNodes(nodes, quantities);
|
// volume = new SMDS_PolyhedralVolumeOfNodes(nodes, quantities);
|
||||||
@ -1648,7 +1616,6 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceFromVtkIdsWithID(const std::vector<vtkIdType>&
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
bool SMDS_Mesh::registerElement(int ID, SMDS_MeshElement* element)
|
bool SMDS_Mesh::registerElement(int ID, SMDS_MeshElement* element)
|
||||||
{
|
{
|
||||||
//MESSAGE("registerElement " << ID);
|
|
||||||
if ((ID >=0) && (ID < (int)myCells.size()) && myCells[ID]) // --- already bound
|
if ((ID >=0) && (ID < (int)myCells.size()) && myCells[ID]) // --- already bound
|
||||||
{
|
{
|
||||||
MESSAGE(" ------------------ already bound "<< ID << " " << myCells[ID]->getVtkId());
|
MESSAGE(" ------------------ already bound "<< ID << " " << myCells[ID]->getVtkId());
|
||||||
@ -1666,7 +1633,6 @@ bool SMDS_Mesh::registerElement(int ID, SMDS_MeshElement* element)
|
|||||||
|
|
||||||
if (vtkId >= (int)myCellIdVtkToSmds.size()) // --- resize local vector
|
if (vtkId >= (int)myCellIdVtkToSmds.size()) // --- resize local vector
|
||||||
{
|
{
|
||||||
// MESSAGE(" --------------------- resize myCellIdVtkToSmds " << vtkId << " --> " << vtkId + SMDS_Mesh::chunkSize);
|
|
||||||
myCellIdVtkToSmds.resize(vtkId + SMDS_Mesh::chunkSize, -1);
|
myCellIdVtkToSmds.resize(vtkId + SMDS_Mesh::chunkSize, -1);
|
||||||
}
|
}
|
||||||
myCellIdVtkToSmds[vtkId] = ID;
|
myCellIdVtkToSmds[vtkId] = ID;
|
||||||
@ -1693,9 +1659,6 @@ const SMDS_MeshNode * SMDS_Mesh::FindNode(int ID) const
|
|||||||
{
|
{
|
||||||
if (ID < 1 || ID >= (int)myNodes.size())
|
if (ID < 1 || ID >= (int)myNodes.size())
|
||||||
{
|
{
|
||||||
// MESSAGE("------------------------------------------------------------------------- ");
|
|
||||||
// MESSAGE("----------------------------------- bad ID " << ID << " " << myNodes.size());
|
|
||||||
// MESSAGE("------------------------------------------------------------------------- ");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return (const SMDS_MeshNode *)myNodes[ID];
|
return (const SMDS_MeshNode *)myNodes[ID];
|
||||||
@ -1762,7 +1725,6 @@ SMDS_MeshFace * SMDS_Mesh::createTriangle(const SMDS_MeshNode * node1,
|
|||||||
face = facevtk;
|
face = facevtk;
|
||||||
adjustmyCellsCapacity(ID);
|
adjustmyCellsCapacity(ID);
|
||||||
myCells[ID] = face;
|
myCells[ID] = face;
|
||||||
//MESSAGE("createTriangle " << ID << " " << face);
|
|
||||||
myInfo.myNbTriangles++;
|
myInfo.myNbTriangles++;
|
||||||
return face;
|
return face;
|
||||||
}
|
}
|
||||||
@ -1782,7 +1744,6 @@ SMDS_MeshFace * SMDS_Mesh::createQuadrangle(const SMDS_MeshNode * node1,
|
|||||||
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
||||||
if(hasConstructionEdges())
|
if(hasConstructionEdges())
|
||||||
{
|
{
|
||||||
//MESSAGE("createQuadrangle hasConstructionEdges "<< ID);
|
|
||||||
SMDS_MeshEdge *edge1, *edge2, *edge3, *edge4;
|
SMDS_MeshEdge *edge1, *edge2, *edge3, *edge4;
|
||||||
edge1=FindEdgeOrCreate(node1,node2);
|
edge1=FindEdgeOrCreate(node1,node2);
|
||||||
edge2=FindEdgeOrCreate(node2,node3);
|
edge2=FindEdgeOrCreate(node2,node3);
|
||||||
@ -1827,7 +1788,6 @@ SMDS_MeshFace * SMDS_Mesh::createQuadrangle(const SMDS_MeshNode * node1,
|
|||||||
|
|
||||||
void SMDS_Mesh::RemoveNode(const SMDS_MeshNode * node)
|
void SMDS_Mesh::RemoveNode(const SMDS_MeshNode * node)
|
||||||
{
|
{
|
||||||
MESSAGE("RemoveNode");
|
|
||||||
RemoveElement(node, true);
|
RemoveElement(node, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1837,7 +1797,6 @@ void SMDS_Mesh::RemoveNode(const SMDS_MeshNode * node)
|
|||||||
|
|
||||||
void SMDS_Mesh::Remove0DElement(const SMDS_Mesh0DElement * elem0d)
|
void SMDS_Mesh::Remove0DElement(const SMDS_Mesh0DElement * elem0d)
|
||||||
{
|
{
|
||||||
MESSAGE("Remove0DElement");
|
|
||||||
RemoveElement(elem0d,true);
|
RemoveElement(elem0d,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1847,7 +1806,6 @@ void SMDS_Mesh::Remove0DElement(const SMDS_Mesh0DElement * elem0d)
|
|||||||
|
|
||||||
void SMDS_Mesh::RemoveEdge(const SMDS_MeshEdge * edge)
|
void SMDS_Mesh::RemoveEdge(const SMDS_MeshEdge * edge)
|
||||||
{
|
{
|
||||||
MESSAGE("RemoveEdge");
|
|
||||||
RemoveElement(edge,true);
|
RemoveElement(edge,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1857,7 +1815,6 @@ void SMDS_Mesh::RemoveEdge(const SMDS_MeshEdge * edge)
|
|||||||
|
|
||||||
void SMDS_Mesh::RemoveFace(const SMDS_MeshFace * face)
|
void SMDS_Mesh::RemoveFace(const SMDS_MeshFace * face)
|
||||||
{
|
{
|
||||||
MESSAGE("RemoveFace");
|
|
||||||
RemoveElement(face, true);
|
RemoveElement(face, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1867,7 +1824,6 @@ void SMDS_Mesh::RemoveFace(const SMDS_MeshFace * face)
|
|||||||
|
|
||||||
void SMDS_Mesh::RemoveVolume(const SMDS_MeshVolume * volume)
|
void SMDS_Mesh::RemoveVolume(const SMDS_MeshVolume * volume)
|
||||||
{
|
{
|
||||||
MESSAGE("RemoveVolume");
|
|
||||||
RemoveElement(volume, true);
|
RemoveElement(volume, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1914,7 +1870,6 @@ bool SMDS_Mesh::ChangeElementNodes(const SMDS_MeshElement * element,
|
|||||||
const SMDS_MeshNode * nodes[],
|
const SMDS_MeshNode * nodes[],
|
||||||
const int nbnodes)
|
const int nbnodes)
|
||||||
{
|
{
|
||||||
MESSAGE("SMDS_Mesh::ChangeElementNodes");
|
|
||||||
// keep current nodes of elem
|
// keep current nodes of elem
|
||||||
set<const SMDS_MeshNode*> oldNodes( element->begin_nodes(), element->end_nodes() );
|
set<const SMDS_MeshNode*> oldNodes( element->begin_nodes(), element->end_nodes() );
|
||||||
|
|
||||||
@ -2428,11 +2383,6 @@ const SMDS_MeshElement* SMDS_Mesh::FindElement(int IDelem) const
|
|||||||
{
|
{
|
||||||
if ( IDelem <= 0 || IDelem >= (int)myCells.size() )
|
if ( IDelem <= 0 || IDelem >= (int)myCells.size() )
|
||||||
{
|
{
|
||||||
MESSAGE("--------------------------------------------------------------------------------- ");
|
|
||||||
MESSAGE("----------------------------------- bad IDelem " << IDelem << " " << myCells.size());
|
|
||||||
MESSAGE("--------------------------------------------------------------------------------- ");
|
|
||||||
// TODO raise an exception
|
|
||||||
//assert(0);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return myCells[IDelem];
|
return myCells[IDelem];
|
||||||
@ -2505,9 +2455,8 @@ const SMDS_MeshElement* SMDS_Mesh::FindElement (const vector<const SMDS_MeshNode
|
|||||||
|
|
||||||
void SMDS_Mesh::DumpNodes() const
|
void SMDS_Mesh::DumpNodes() const
|
||||||
{
|
{
|
||||||
MESSAGE("dump nodes of mesh : ");
|
SMDS_NodeIteratorPtr itnode=nodesIterator();
|
||||||
SMDS_NodeIteratorPtr itnode=nodesIterator();
|
while(itnode->more()) ; //MESSAGE(itnode->next());
|
||||||
while(itnode->more()) ; //MESSAGE(itnode->next());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -2516,7 +2465,6 @@ void SMDS_Mesh::DumpNodes() const
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void SMDS_Mesh::Dump0DElements() const
|
void SMDS_Mesh::Dump0DElements() const
|
||||||
{
|
{
|
||||||
MESSAGE("dump 0D elements of mesh : ");
|
|
||||||
SMDS_ElemIteratorPtr it0d = elementsIterator(SMDSAbs_0DElement);
|
SMDS_ElemIteratorPtr it0d = elementsIterator(SMDSAbs_0DElement);
|
||||||
while(it0d->more()) ; //MESSAGE(it0d->next());
|
while(it0d->more()) ; //MESSAGE(it0d->next());
|
||||||
}
|
}
|
||||||
@ -2528,9 +2476,8 @@ void SMDS_Mesh::Dump0DElements() const
|
|||||||
|
|
||||||
void SMDS_Mesh::DumpEdges() const
|
void SMDS_Mesh::DumpEdges() const
|
||||||
{
|
{
|
||||||
MESSAGE("dump edges of mesh : ");
|
SMDS_EdgeIteratorPtr itedge=edgesIterator();
|
||||||
SMDS_EdgeIteratorPtr itedge=edgesIterator();
|
while(itedge->more()) ; //MESSAGE(itedge->next());
|
||||||
while(itedge->more()) ; //MESSAGE(itedge->next());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -2540,9 +2487,8 @@ void SMDS_Mesh::DumpEdges() const
|
|||||||
|
|
||||||
void SMDS_Mesh::DumpFaces() const
|
void SMDS_Mesh::DumpFaces() const
|
||||||
{
|
{
|
||||||
MESSAGE("dump faces of mesh : ");
|
SMDS_FaceIteratorPtr itface=facesIterator();
|
||||||
SMDS_FaceIteratorPtr itface=facesIterator();
|
while(itface->more()) ; //MESSAGE(itface->next());
|
||||||
while(itface->more()) ; //MESSAGE(itface->next());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -2552,9 +2498,8 @@ void SMDS_Mesh::DumpFaces() const
|
|||||||
|
|
||||||
void SMDS_Mesh::DumpVolumes() const
|
void SMDS_Mesh::DumpVolumes() const
|
||||||
{
|
{
|
||||||
MESSAGE("dump volumes of mesh : ");
|
SMDS_VolumeIteratorPtr itvol=volumesIterator();
|
||||||
SMDS_VolumeIteratorPtr itvol=volumesIterator();
|
while(itvol->more()) ; //MESSAGE(itvol->next());
|
||||||
while(itvol->more()) ; //MESSAGE(itvol->next());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -2612,10 +2557,7 @@ void SMDS_Mesh::DebugStats() const
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
int SMDS_Mesh::NbNodes() const
|
int SMDS_Mesh::NbNodes() const
|
||||||
{
|
{
|
||||||
//MESSAGE(myGrid->GetNumberOfPoints());
|
return myInfo.NbNodes();
|
||||||
//MESSAGE(myInfo.NbNodes());
|
|
||||||
//MESSAGE(myNodeMax);
|
|
||||||
return myInfo.NbNodes();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -2718,7 +2660,6 @@ SMDS_Mesh::~SMDS_Mesh()
|
|||||||
|
|
||||||
void SMDS_Mesh::Clear()
|
void SMDS_Mesh::Clear()
|
||||||
{
|
{
|
||||||
MESSAGE("SMDS_Mesh::Clear");
|
|
||||||
if (myParent!=NULL)
|
if (myParent!=NULL)
|
||||||
{
|
{
|
||||||
SMDS_ElemIteratorPtr eIt = elementsIterator();
|
SMDS_ElemIteratorPtr eIt = elementsIterator();
|
||||||
@ -3077,34 +3018,31 @@ static set<const SMDS_MeshElement*> * intersectionOfSets(
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
static set<const SMDS_MeshElement*> * getFinitElements(const SMDS_MeshElement * element)
|
static set<const SMDS_MeshElement*> * getFinitElements(const SMDS_MeshElement * element)
|
||||||
{
|
{
|
||||||
int numberOfSets=element->NbNodes();
|
int numberOfSets=element->NbNodes();
|
||||||
set<const SMDS_MeshElement*> *initSet = new set<const SMDS_MeshElement*>[numberOfSets];
|
set<const SMDS_MeshElement*> *initSet = new set<const SMDS_MeshElement*>[numberOfSets];
|
||||||
|
|
||||||
SMDS_ElemIteratorPtr itNodes=element->nodesIterator();
|
SMDS_ElemIteratorPtr itNodes=element->nodesIterator();
|
||||||
|
|
||||||
int i=0;
|
int i = 0;
|
||||||
while(itNodes->more())
|
while ( itNodes->more() )
|
||||||
{
|
{
|
||||||
const SMDS_MeshElement* node = itNodes->next();
|
const SMDS_MeshElement* node = itNodes->next();
|
||||||
MYASSERT(node);
|
MYASSERT(node);
|
||||||
const SMDS_MeshNode * n=static_cast<const SMDS_MeshNode*>(node);
|
const SMDS_MeshNode * n=static_cast<const SMDS_MeshNode*>(node);
|
||||||
SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
|
SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
|
||||||
|
|
||||||
//initSet[i]=set<const SMDS_MeshElement*>();
|
while ( itFe->more() )
|
||||||
while(itFe->more())
|
{
|
||||||
{
|
const SMDS_MeshElement* elem = itFe->next();
|
||||||
const SMDS_MeshElement* elem = itFe->next();
|
MYASSERT(elem);
|
||||||
MYASSERT(elem);
|
initSet[i].insert(elem);
|
||||||
initSet[i].insert(elem);
|
}
|
||||||
|
|
||||||
}
|
i++;
|
||||||
|
}
|
||||||
i++;
|
set<const SMDS_MeshElement*> *retSet = intersectionOfSets( initSet, numberOfSets );
|
||||||
}
|
delete [] initSet;
|
||||||
set<const SMDS_MeshElement*> *retSet=intersectionOfSets(initSet, numberOfSets);
|
return retSet;
|
||||||
// MESSAGE("nb elems " << i << " intersection " << retSet->size());
|
|
||||||
delete [] initSet;
|
|
||||||
return retSet;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -3401,11 +3339,9 @@ void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem)
|
|||||||
{
|
{
|
||||||
int elemId = elem->GetID();
|
int elemId = elem->GetID();
|
||||||
int vtkId = elem->getVtkId();
|
int vtkId = elem->getVtkId();
|
||||||
//MESSAGE("RemoveFreeElement " << elemId);
|
|
||||||
SMDSAbs_ElementType aType = elem->GetType();
|
SMDSAbs_ElementType aType = elem->GetType();
|
||||||
SMDS_MeshElement* todest = (SMDS_MeshElement*)(elem);
|
SMDS_MeshElement* todest = (SMDS_MeshElement*)(elem);
|
||||||
if (aType == SMDSAbs_Node) {
|
if (aType == SMDSAbs_Node) {
|
||||||
//MESSAGE("Remove free node " << elemId);
|
|
||||||
// only free node can be removed by this method
|
// only free node can be removed by this method
|
||||||
const SMDS_MeshNode* n = static_cast<SMDS_MeshNode*>(todest);
|
const SMDS_MeshNode* n = static_cast<SMDS_MeshNode*>(todest);
|
||||||
SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
|
SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
|
||||||
@ -3422,7 +3358,6 @@ void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem)
|
|||||||
// this methods is only for meshes without descendants
|
// this methods is only for meshes without descendants
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//MESSAGE("Remove free element " << elemId);
|
|
||||||
// Remove element from <InverseElements> of its nodes
|
// Remove element from <InverseElements> of its nodes
|
||||||
SMDS_ElemIteratorPtr itn = elem->nodesIterator();
|
SMDS_ElemIteratorPtr itn = elem->nodesIterator();
|
||||||
while (itn->more()) {
|
while (itn->more()) {
|
||||||
@ -3538,7 +3473,6 @@ int SMDS_Mesh::MinElementID() const
|
|||||||
|
|
||||||
void SMDS_Mesh::Renumber (const bool isNodes, const int startID, const int deltaID)
|
void SMDS_Mesh::Renumber (const bool isNodes, const int startID, const int deltaID)
|
||||||
{
|
{
|
||||||
MESSAGE("Renumber");
|
|
||||||
if ( deltaID == 0 )
|
if ( deltaID == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -4709,17 +4643,14 @@ void SMDS_Mesh::incrementNodesCapacity(int nbNodes)
|
|||||||
// MESSAGE(" ------------------- resize myCellIdSmdsToVtk " << val << " --> " << val + nbNodes);
|
// MESSAGE(" ------------------- resize myCellIdSmdsToVtk " << val << " --> " << val + nbNodes);
|
||||||
// myCellIdSmdsToVtk.resize(val + nbNodes, -1); // fill new elements with -1
|
// myCellIdSmdsToVtk.resize(val + nbNodes, -1); // fill new elements with -1
|
||||||
int val = myNodes.size();
|
int val = myNodes.size();
|
||||||
MESSAGE(" ------------------- resize myNodes " << val << " --> " << val + nbNodes);
|
|
||||||
myNodes.resize(val +nbNodes, 0);
|
myNodes.resize(val +nbNodes, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SMDS_Mesh::incrementCellsCapacity(int nbCells)
|
void SMDS_Mesh::incrementCellsCapacity(int nbCells)
|
||||||
{
|
{
|
||||||
int val = myCellIdVtkToSmds.size();
|
int val = myCellIdVtkToSmds.size();
|
||||||
MESSAGE(" ------------------- resize myCellIdVtkToSmds " << val << " --> " << val + nbCells);
|
|
||||||
myCellIdVtkToSmds.resize(val + nbCells, -1); // fill new elements with -1
|
myCellIdVtkToSmds.resize(val + nbCells, -1); // fill new elements with -1
|
||||||
val = myCells.size();
|
val = myCells.size();
|
||||||
MESSAGE(" ------------------- resize myCells " << val << " --> " << val + nbCells);
|
|
||||||
myNodes.resize(val +nbCells, 0);
|
myNodes.resize(val +nbCells, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4730,48 +4661,45 @@ void SMDS_Mesh::adjustStructure()
|
|||||||
|
|
||||||
void SMDS_Mesh::dumpGrid(string ficdump)
|
void SMDS_Mesh::dumpGrid(string ficdump)
|
||||||
{
|
{
|
||||||
MESSAGE("SMDS_Mesh::dumpGrid " << ficdump);
|
// vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New();
|
||||||
// vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New();
|
// aWriter->SetFileName(ficdump.c_str());
|
||||||
// aWriter->SetFileName(ficdump.c_str());
|
// aWriter->SetInput(myGrid);
|
||||||
// aWriter->SetInput(myGrid);
|
// if(myGrid->GetNumberOfCells())
|
||||||
// if(myGrid->GetNumberOfCells())
|
// {
|
||||||
// {
|
// aWriter->Write();
|
||||||
// aWriter->Write();
|
// }
|
||||||
// }
|
// aWriter->Delete();
|
||||||
// aWriter->Delete();
|
|
||||||
ficdump = ficdump + "_connectivity";
|
ficdump = ficdump + "_connectivity";
|
||||||
ofstream ficcon(ficdump.c_str(), ios::out);
|
ofstream ficcon(ficdump.c_str(), ios::out);
|
||||||
int nbPoints = myGrid->GetNumberOfPoints();
|
int nbPoints = myGrid->GetNumberOfPoints();
|
||||||
ficcon << "-------------------------------- points " << nbPoints << endl;
|
ficcon << "-------------------------------- points " << nbPoints << endl;
|
||||||
for (int i=0; i<nbPoints; i++)
|
for (int i=0; i<nbPoints; i++)
|
||||||
{
|
{
|
||||||
ficcon << i << " " << *(myGrid->GetPoint(i)) << " " << *(myGrid->GetPoint(i)+1) << " " << " " << *(myGrid->GetPoint(i)+2) << endl;
|
ficcon << i << " " << *(myGrid->GetPoint(i)) << " " << *(myGrid->GetPoint(i)+1) << " " << " " << *(myGrid->GetPoint(i)+2) << endl;
|
||||||
}
|
}
|
||||||
int nbCells = myGrid->GetNumberOfCells();
|
int nbCells = myGrid->GetNumberOfCells();
|
||||||
ficcon << "-------------------------------- cells " << nbCells << endl;
|
ficcon << "-------------------------------- cells " << nbCells << endl;
|
||||||
for (int i=0; i<nbCells; i++)
|
for (int i=0; i<nbCells; i++)
|
||||||
{
|
{
|
||||||
// MESSAGE(i << " " << myGrid->GetCell(i));
|
ficcon << i << " - " << myGrid->GetCell(i)->GetCellType() << " -";
|
||||||
// MESSAGE(" " << myGrid->GetCell(i)->GetCellType());
|
int nbptcell = myGrid->GetCell(i)->GetNumberOfPoints();
|
||||||
ficcon << i << " - " << myGrid->GetCell(i)->GetCellType() << " -";
|
vtkIdList *listid = myGrid->GetCell(i)->GetPointIds();
|
||||||
int nbptcell = myGrid->GetCell(i)->GetNumberOfPoints();
|
for (int j=0; j<nbptcell; j++)
|
||||||
vtkIdList *listid = myGrid->GetCell(i)->GetPointIds();
|
{
|
||||||
for (int j=0; j<nbptcell; j++)
|
ficcon << " " << listid->GetId(j);
|
||||||
{
|
}
|
||||||
ficcon << " " << listid->GetId(j);
|
ficcon << endl;
|
||||||
}
|
|
||||||
ficcon << endl;
|
|
||||||
}
|
}
|
||||||
ficcon << "-------------------------------- connectivity " << nbPoints << endl;
|
ficcon << "-------------------------------- connectivity " << nbPoints << endl;
|
||||||
vtkCellLinks *links = myGrid->GetCellLinks();
|
vtkCellLinks *links = myGrid->GetCellLinks();
|
||||||
for (int i=0; i<nbPoints; i++)
|
for (int i=0; i<nbPoints; i++)
|
||||||
{
|
{
|
||||||
int ncells = links->GetNcells(i);
|
int ncells = links->GetNcells(i);
|
||||||
vtkIdType *cells = links->GetCells(i);
|
vtkIdType *cells = links->GetCells(i);
|
||||||
ficcon << i << " - " << ncells << " -";
|
ficcon << i << " - " << ncells << " -";
|
||||||
for (int j=0; j<ncells; j++)
|
for (int j=0; j<ncells; j++)
|
||||||
{
|
{
|
||||||
ficcon << " " << cells[j];
|
ficcon << " " << cells[j];
|
||||||
}
|
}
|
||||||
ficcon << endl;
|
ficcon << endl;
|
||||||
}
|
}
|
||||||
@ -4820,7 +4748,6 @@ double SMDS_Mesh::getMaxDim()
|
|||||||
if ((xmax - xmin) > dmax) dmax = xmax -xmin;
|
if ((xmax - xmin) > dmax) dmax = xmax -xmin;
|
||||||
if ((ymax - ymin) > dmax) dmax = ymax -ymin;
|
if ((ymax - ymin) > dmax) dmax = ymax -ymin;
|
||||||
if ((zmax - zmin) > dmax) dmax = zmax -zmin;
|
if ((zmax - zmin) > dmax) dmax = zmax -zmin;
|
||||||
MESSAGE("getMaxDim " << dmax);
|
|
||||||
return dmax;
|
return dmax;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4828,11 +4755,10 @@ double SMDS_Mesh::getMaxDim()
|
|||||||
void SMDS_Mesh::Modified()
|
void SMDS_Mesh::Modified()
|
||||||
{
|
{
|
||||||
if (this->myModified)
|
if (this->myModified)
|
||||||
{
|
{
|
||||||
this->myModifTime++;
|
this->myModifTime++;
|
||||||
MESSAGE("modified");
|
myModified = false;
|
||||||
myModified = false;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! get last modification timeStamp
|
//! get last modification timeStamp
|
||||||
@ -4844,10 +4770,9 @@ unsigned long SMDS_Mesh::GetMTime() const
|
|||||||
bool SMDS_Mesh::isCompacted()
|
bool SMDS_Mesh::isCompacted()
|
||||||
{
|
{
|
||||||
if (this->myModifTime > this->myCompactTime)
|
if (this->myModifTime > this->myCompactTime)
|
||||||
{
|
{
|
||||||
MESSAGE(" *** isCompacted " << myCompactTime << " < " << myModifTime);
|
this->myCompactTime = this->myModifTime;
|
||||||
this->myCompactTime = this->myModifTime;
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -42,20 +42,18 @@ SMDS_MeshIDFactory::SMDS_MeshIDFactory():myMaxID(0), myMesh(0)
|
|||||||
|
|
||||||
int SMDS_MeshIDFactory::GetFreeID()
|
int SMDS_MeshIDFactory::GetFreeID()
|
||||||
{
|
{
|
||||||
int newid;
|
int newid;
|
||||||
if (myPoolOfID.empty())
|
if (myPoolOfID.empty())
|
||||||
{
|
{
|
||||||
newid = ++myMaxID;
|
newid = ++myMaxID;
|
||||||
//MESSAGE("GetFreeID new " << newid);
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
set<int>::iterator i = myPoolOfID.begin();
|
||||||
set<int>::iterator i = myPoolOfID.begin();
|
newid = *i;//myPoolOfID.top();
|
||||||
newid = *i;//myPoolOfID.top();
|
myPoolOfID.erase( i );//myPoolOfID.pop();
|
||||||
myPoolOfID.erase( i );//myPoolOfID.pop();
|
}
|
||||||
//MESSAGE("GetFreeID pool " << newid);
|
return newid;
|
||||||
}
|
|
||||||
return newid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -91,24 +89,23 @@ void SMDS_MeshIDFactory::ReleaseID(int ID, int vtkId)
|
|||||||
|
|
||||||
void SMDS_MeshIDFactory::Clear()
|
void SMDS_MeshIDFactory::Clear()
|
||||||
{
|
{
|
||||||
myMaxID = 0;
|
myMaxID = 0;
|
||||||
myPoolOfID.clear();
|
myPoolOfID.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SMDS_MeshIDFactory::SetMesh(SMDS_Mesh *mesh)
|
void SMDS_MeshIDFactory::SetMesh(SMDS_Mesh *mesh)
|
||||||
{
|
{
|
||||||
myMesh = mesh;
|
myMesh = mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
SMDS_Mesh* SMDS_MeshIDFactory::GetMesh()
|
SMDS_Mesh* SMDS_MeshIDFactory::GetMesh()
|
||||||
{
|
{
|
||||||
return myMesh;
|
return myMesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SMDS_MeshIDFactory::emptyPool(int maxId)
|
void SMDS_MeshIDFactory::emptyPool(int maxId)
|
||||||
{
|
{
|
||||||
MESSAGE("SMDS_MeshIDFactory::emptyPool " << myMaxID << " --> " << maxId);
|
myMaxID = maxId;
|
||||||
myMaxID = maxId;
|
myPoolOfID.clear();
|
||||||
myPoolOfID.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ using namespace std;
|
|||||||
|
|
||||||
SMDS_CellLinks* SMDS_CellLinks::New()
|
SMDS_CellLinks* SMDS_CellLinks::New()
|
||||||
{
|
{
|
||||||
MESSAGE("SMDS_CellLinks::New");
|
|
||||||
return new SMDS_CellLinks();
|
return new SMDS_CellLinks();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +64,6 @@ SMDS_CellLinks::~SMDS_CellLinks()
|
|||||||
|
|
||||||
SMDS_UnstructuredGrid* SMDS_UnstructuredGrid::New()
|
SMDS_UnstructuredGrid* SMDS_UnstructuredGrid::New()
|
||||||
{
|
{
|
||||||
MESSAGE("SMDS_UnstructuredGrid::New");
|
|
||||||
return new SMDS_UnstructuredGrid();
|
return new SMDS_UnstructuredGrid();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,27 +83,23 @@ SMDS_UnstructuredGrid::~SMDS_UnstructuredGrid()
|
|||||||
unsigned long SMDS_UnstructuredGrid::GetMTime()
|
unsigned long SMDS_UnstructuredGrid::GetMTime()
|
||||||
{
|
{
|
||||||
unsigned long mtime = vtkUnstructuredGrid::GetMTime();
|
unsigned long mtime = vtkUnstructuredGrid::GetMTime();
|
||||||
MESSAGE("vtkUnstructuredGrid::GetMTime: " << mtime);
|
|
||||||
return mtime;
|
return mtime;
|
||||||
}
|
}
|
||||||
// OUV_PORTING_VTK6: seems to be useless
|
// OUV_PORTING_VTK6: seems to be useless
|
||||||
/*
|
/*
|
||||||
void SMDS_UnstructuredGrid::Update()
|
void SMDS_UnstructuredGrid::Update()
|
||||||
{
|
{
|
||||||
MESSAGE("SMDS_UnstructuredGrid::Update");
|
|
||||||
return vtkUnstructuredGrid::Update();
|
return vtkUnstructuredGrid::Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SMDS_UnstructuredGrid::UpdateInformation()
|
void SMDS_UnstructuredGrid::UpdateInformation()
|
||||||
{
|
{
|
||||||
MESSAGE("SMDS_UnstructuredGrid::UpdateInformation");
|
|
||||||
return vtkUnstructuredGrid::UpdateInformation();
|
return vtkUnstructuredGrid::UpdateInformation();
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
vtkPoints* SMDS_UnstructuredGrid::GetPoints()
|
vtkPoints* SMDS_UnstructuredGrid::GetPoints()
|
||||||
{
|
{
|
||||||
// TODO erreur incomprehensible de la macro vtk GetPoints apparue avec la version paraview de fin aout 2010
|
// TODO erreur incomprehensible de la macro vtk GetPoints apparue avec la version paraview de fin aout 2010
|
||||||
//MESSAGE("*********************** SMDS_UnstructuredGrid::GetPoints " << this->Points << " " << vtkUnstructuredGrid::GetPoints());
|
|
||||||
return this->Points;
|
return this->Points;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +110,6 @@ int SMDS_UnstructuredGrid::InsertNextLinkedCell(int type, int npts, vtkIdType *p
|
|||||||
return vtkUnstructuredGrid::InsertNextLinkedCell(type, npts, pts);
|
return vtkUnstructuredGrid::InsertNextLinkedCell(type, npts, pts);
|
||||||
|
|
||||||
// --- type = VTK_POLYHEDRON
|
// --- type = VTK_POLYHEDRON
|
||||||
//MESSAGE("InsertNextLinkedCell VTK_POLYHEDRON");
|
|
||||||
int cellid = this->InsertNextCell(type, npts, pts);
|
int cellid = this->InsertNextCell(type, npts, pts);
|
||||||
|
|
||||||
set<vtkIdType> setOfNodes;
|
set<vtkIdType> setOfNodes;
|
||||||
@ -129,7 +122,6 @@ int SMDS_UnstructuredGrid::InsertNextLinkedCell(int type, int npts, vtkIdType *p
|
|||||||
i++;
|
i++;
|
||||||
for (int k = 0; k < nbnodes; k++)
|
for (int k = 0; k < nbnodes; k++)
|
||||||
{
|
{
|
||||||
//MESSAGE(" cell " << cellid << " face " << nf << " node " << pts[i]);
|
|
||||||
setOfNodes.insert(pts[i]);
|
setOfNodes.insert(pts[i]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@ -138,7 +130,6 @@ int SMDS_UnstructuredGrid::InsertNextLinkedCell(int type, int npts, vtkIdType *p
|
|||||||
set<vtkIdType>::iterator it = setOfNodes.begin();
|
set<vtkIdType>::iterator it = setOfNodes.begin();
|
||||||
for (; it != setOfNodes.end(); ++it)
|
for (; it != setOfNodes.end(); ++it)
|
||||||
{
|
{
|
||||||
//MESSAGE("reverse link for node " << *it << " cell " << cellid);
|
|
||||||
this->Links->ResizeCellList(*it, 1);
|
this->Links->ResizeCellList(*it, 1);
|
||||||
this->Links->AddCellReference(cellid, *it);
|
this->Links->AddCellReference(cellid, *it);
|
||||||
}
|
}
|
||||||
@ -155,7 +146,7 @@ void SMDS_UnstructuredGrid::setSMDS_mesh(SMDS_Mesh *mesh)
|
|||||||
void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int newNodeSize,
|
void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int newNodeSize,
|
||||||
std::vector<int>& idCellsOldToNew, int newCellSize)
|
std::vector<int>& idCellsOldToNew, int newCellSize)
|
||||||
{
|
{
|
||||||
MESSAGE("------------------------- SMDS_UnstructuredGrid::compactGrid " << newNodeSize << " " << newCellSize);//CHRONO(1);
|
//MESSAGE("------------------------- compactGrid " << newNodeSize << " " << newCellSize);//CHRONO(1);
|
||||||
int alreadyCopied = 0;
|
int alreadyCopied = 0;
|
||||||
|
|
||||||
// --- if newNodeSize, create a new compacted vtkPoints
|
// --- if newNodeSize, create a new compacted vtkPoints
|
||||||
@ -165,7 +156,6 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
|
|||||||
newPoints->SetNumberOfPoints(newNodeSize);
|
newPoints->SetNumberOfPoints(newNodeSize);
|
||||||
if (newNodeSize)
|
if (newNodeSize)
|
||||||
{
|
{
|
||||||
MESSAGE("-------------- compactGrid, newNodeSize " << newNodeSize);
|
|
||||||
// rnv: to fix bug "21125: EDF 1233 SMESH: Degradation of precision in a test case for quadratic conversion"
|
// rnv: to fix bug "21125: EDF 1233 SMESH: Degradation of precision in a test case for quadratic conversion"
|
||||||
// using double type for storing coordinates of nodes instead float.
|
// using double type for storing coordinates of nodes instead float.
|
||||||
int oldNodeSize = idNodesOldToNew.size();
|
int oldNodeSize = idNodesOldToNew.size();
|
||||||
@ -194,7 +184,6 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
|
|||||||
newConnectivity->Initialize();
|
newConnectivity->Initialize();
|
||||||
int oldCellDataSize = this->Connectivity->GetData()->GetSize();
|
int oldCellDataSize = this->Connectivity->GetData()->GetSize();
|
||||||
newConnectivity->Allocate(oldCellDataSize);
|
newConnectivity->Allocate(oldCellDataSize);
|
||||||
MESSAGE("oldCellSize="<< oldCellSize << " oldCellDataSize=" << oldCellDataSize);
|
|
||||||
|
|
||||||
vtkUnsignedCharArray *newTypes = vtkUnsignedCharArray::New();
|
vtkUnsignedCharArray *newTypes = vtkUnsignedCharArray::New();
|
||||||
newTypes->Initialize();
|
newTypes->Initialize();
|
||||||
@ -230,11 +219,9 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
|
|||||||
newConnectivity->Squeeze();
|
newConnectivity->Squeeze();
|
||||||
|
|
||||||
if (1/*newNodeSize*/)
|
if (1/*newNodeSize*/)
|
||||||
{
|
{
|
||||||
MESSAGE("------- newNodeSize, setPoints");
|
this->SetPoints(newPoints);
|
||||||
this->SetPoints(newPoints);
|
}
|
||||||
MESSAGE("NumberOfPoints: " << this->GetNumberOfPoints());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (vtkDoubleArray* diameters =
|
if (vtkDoubleArray* diameters =
|
||||||
vtkDoubleArray::SafeDownCast( vtkDataSet::CellData->GetScalars() )) // Balls
|
vtkDoubleArray::SafeDownCast( vtkDataSet::CellData->GetScalars() )) // Balls
|
||||||
@ -250,46 +237,46 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this->FaceLocations)
|
if (this->FaceLocations)
|
||||||
|
{
|
||||||
|
vtkIdTypeArray *newFaceLocations = vtkIdTypeArray::New();
|
||||||
|
newFaceLocations->Initialize();
|
||||||
|
newFaceLocations->Allocate(newTypes->GetSize());
|
||||||
|
vtkIdTypeArray *newFaces = vtkIdTypeArray::New();
|
||||||
|
newFaces->Initialize();
|
||||||
|
newFaces->Allocate(this->Faces->GetSize());
|
||||||
|
for (int i = 0; i < oldCellSize; i++)
|
||||||
{
|
{
|
||||||
vtkIdTypeArray *newFaceLocations = vtkIdTypeArray::New();
|
if (this->Types->GetValue(i) == VTK_EMPTY_CELL)
|
||||||
newFaceLocations->Initialize();
|
continue;
|
||||||
newFaceLocations->Allocate(newTypes->GetSize());
|
int newCellId = idCellsOldToNew[i];
|
||||||
vtkIdTypeArray *newFaces = vtkIdTypeArray::New();
|
if (newTypes->GetValue(newCellId) == VTK_POLYHEDRON)
|
||||||
newFaces->Initialize();
|
{
|
||||||
newFaces->Allocate(this->Faces->GetSize());
|
newFaceLocations->InsertNextValue(newFaces->GetMaxId()+1);
|
||||||
for (int i = 0; i < oldCellSize; i++)
|
int oldFaceLoc = this->FaceLocations->GetValue(i);
|
||||||
|
int nCellFaces = this->Faces->GetValue(oldFaceLoc++);
|
||||||
|
newFaces->InsertNextValue(nCellFaces);
|
||||||
|
for (int n=0; n<nCellFaces; n++)
|
||||||
{
|
{
|
||||||
if (this->Types->GetValue(i) == VTK_EMPTY_CELL)
|
int nptsInFace = this->Faces->GetValue(oldFaceLoc++);
|
||||||
continue;
|
newFaces->InsertNextValue(nptsInFace);
|
||||||
int newCellId = idCellsOldToNew[i];
|
for (int k=0; k<nptsInFace; k++)
|
||||||
if (newTypes->GetValue(newCellId) == VTK_POLYHEDRON)
|
{
|
||||||
{
|
int oldpt = this->Faces->GetValue(oldFaceLoc++);
|
||||||
newFaceLocations->InsertNextValue(newFaces->GetMaxId()+1);
|
newFaces->InsertNextValue(idNodesOldToNew[oldpt]);
|
||||||
int oldFaceLoc = this->FaceLocations->GetValue(i);
|
}
|
||||||
int nCellFaces = this->Faces->GetValue(oldFaceLoc++);
|
|
||||||
newFaces->InsertNextValue(nCellFaces);
|
|
||||||
for (int n=0; n<nCellFaces; n++)
|
|
||||||
{
|
|
||||||
int nptsInFace = this->Faces->GetValue(oldFaceLoc++);
|
|
||||||
newFaces->InsertNextValue(nptsInFace);
|
|
||||||
for (int k=0; k<nptsInFace; k++)
|
|
||||||
{
|
|
||||||
int oldpt = this->Faces->GetValue(oldFaceLoc++);
|
|
||||||
newFaces->InsertNextValue(idNodesOldToNew[oldpt]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newFaceLocations->InsertNextValue(-1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
newFaceLocations->Squeeze();
|
}
|
||||||
newFaces->Squeeze();
|
else
|
||||||
this->SetCells(newTypes, newLocations, newConnectivity, newFaceLocations, newFaces);
|
{
|
||||||
newFaceLocations->Delete();
|
newFaceLocations->InsertNextValue(-1);
|
||||||
newFaces->Delete();
|
}
|
||||||
}
|
}
|
||||||
|
newFaceLocations->Squeeze();
|
||||||
|
newFaces->Squeeze();
|
||||||
|
this->SetCells(newTypes, newLocations, newConnectivity, newFaceLocations, newFaces);
|
||||||
|
newFaceLocations->Delete();
|
||||||
|
newFaces->Delete();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->SetCells(newTypes, newLocations, newConnectivity, FaceLocations, Faces);
|
this->SetCells(newTypes, newLocations, newConnectivity, FaceLocations, Faces);
|
||||||
@ -302,10 +289,12 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
|
|||||||
this->BuildLinks();
|
this->BuildLinks();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SMDS_UnstructuredGrid::copyNodes(vtkPoints *newPoints, std::vector<int>& idNodesOldToNew, int& alreadyCopied,
|
void SMDS_UnstructuredGrid::copyNodes(vtkPoints * newPoints,
|
||||||
int start, int end)
|
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 *target = newPoints->GetVoidPointer(3 * alreadyCopied);
|
||||||
void *source = this->Points->GetVoidPointer(3 * start);
|
void *source = this->Points->GetVoidPointer(3 * start);
|
||||||
int nbPoints = end - start;
|
int nbPoints = end - start;
|
||||||
@ -327,7 +316,6 @@ void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray *newTypes,
|
|||||||
int start,
|
int start,
|
||||||
int end)
|
int end)
|
||||||
{
|
{
|
||||||
//MESSAGE("copyBloc " << alreadyCopied << " " << start << " " << end << " size: " << end - start << " total: " << alreadyCopied + end - start);
|
|
||||||
for (int j = start; j < end; j++)
|
for (int j = start; j < end; j++)
|
||||||
{
|
{
|
||||||
newTypes->SetValue(alreadyCopied, this->Types->GetValue(j));
|
newTypes->SetValue(alreadyCopied, this->Types->GetValue(j));
|
||||||
@ -337,16 +325,13 @@ void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray *newTypes,
|
|||||||
vtkIdType *oldPtsCell = 0;
|
vtkIdType *oldPtsCell = 0;
|
||||||
this->Connectivity->GetCell(oldLoc, nbpts, oldPtsCell);
|
this->Connectivity->GetCell(oldLoc, nbpts, oldPtsCell);
|
||||||
assert(nbpts < NBMAXNODESINCELL);
|
assert(nbpts < NBMAXNODESINCELL);
|
||||||
//MESSAGE(j << " " << alreadyCopied << " " << (int)this->Types->GetValue(j) << " " << oldLoc << " " << nbpts );
|
|
||||||
for (int l = 0; l < nbpts; l++)
|
for (int l = 0; l < nbpts; l++)
|
||||||
{
|
{
|
||||||
int oldval = oldPtsCell[l];
|
int oldval = oldPtsCell[l];
|
||||||
pointsCell[l] = idNodesOldToNew[oldval];
|
pointsCell[l] = idNodesOldToNew[oldval];
|
||||||
//MESSAGE(" " << oldval << " " << pointsCell[l]);
|
|
||||||
}
|
}
|
||||||
/*int newcnt = */newConnectivity->InsertNextCell(nbpts, pointsCell);
|
/*int newcnt = */newConnectivity->InsertNextCell(nbpts, pointsCell);
|
||||||
int newLoc = newConnectivity->GetInsertLocation(nbpts);
|
int newLoc = newConnectivity->GetInsertLocation(nbpts);
|
||||||
//MESSAGE(newcnt << " " << newLoc);
|
|
||||||
newLocations->SetValue(alreadyCopied, newLoc);
|
newLocations->SetValue(alreadyCopied, newLoc);
|
||||||
alreadyCopied++;
|
alreadyCopied++;
|
||||||
}
|
}
|
||||||
@ -356,8 +341,6 @@ int SMDS_UnstructuredGrid::CellIdToDownId(int vtkCellId)
|
|||||||
{
|
{
|
||||||
if ((vtkCellId < 0) || (vtkCellId >= (int)_cellIdToDownId.size()))
|
if ((vtkCellId < 0) || (vtkCellId >= (int)_cellIdToDownId.size()))
|
||||||
{
|
{
|
||||||
//MESSAGE("SMDS_UnstructuredGrid::CellIdToDownId structure not up to date: vtkCellId="
|
|
||||||
// << vtkCellId << " max="<< _cellIdToDownId.size());
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return _cellIdToDownId[vtkCellId];
|
return _cellIdToDownId[vtkCellId];
|
||||||
@ -1016,12 +999,13 @@ void SMDS_UnstructuredGrid::BuildLinks()
|
|||||||
* @param nodeDomains: map(original id --> map(domain --> duplicated node id))
|
* @param nodeDomains: map(original id --> map(domain --> duplicated node id))
|
||||||
* @return ok if success.
|
* @return ok if success.
|
||||||
*/
|
*/
|
||||||
SMDS_MeshCell* SMDS_UnstructuredGrid::extrudeVolumeFromFace(int vtkVolId,
|
SMDS_MeshCell*
|
||||||
int domain1,
|
SMDS_UnstructuredGrid::extrudeVolumeFromFace(int vtkVolId,
|
||||||
int domain2,
|
int domain1,
|
||||||
std::set<int>& originalNodes,
|
int domain2,
|
||||||
std::map<int, std::map<int, int> >& nodeDomains,
|
std::set<int>& originalNodes,
|
||||||
std::map<int, std::map<long, int> >& nodeQuadDomains)
|
std::map<int, std::map<int, int> >& nodeDomains,
|
||||||
|
std::map<int, std::map<long, int> >& nodeQuadDomains)
|
||||||
{
|
{
|
||||||
//MESSAGE("extrudeVolumeFromFace " << vtkVolId);
|
//MESSAGE("extrudeVolumeFromFace " << vtkVolId);
|
||||||
vector<vtkIdType> orderedOriginals;
|
vector<vtkIdType> orderedOriginals;
|
||||||
@ -1037,16 +1021,16 @@ SMDS_MeshCell* SMDS_UnstructuredGrid::extrudeVolumeFromFace(int vtkVolId,
|
|||||||
bool isQuadratic = false;
|
bool isQuadratic = false;
|
||||||
switch (orderedOriginals.size())
|
switch (orderedOriginals.size())
|
||||||
{
|
{
|
||||||
case 3:
|
case 3:
|
||||||
if (dim == 2)
|
if (dim == 2)
|
||||||
isQuadratic = true;
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
case 8:
|
|
||||||
isQuadratic = true;
|
isQuadratic = true;
|
||||||
break;
|
break;
|
||||||
default:
|
case 6:
|
||||||
isQuadratic = false;
|
case 8:
|
||||||
|
isQuadratic = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
isQuadratic = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,12 +64,10 @@ using namespace std;
|
|||||||
|
|
||||||
SMESH_Gen::SMESH_Gen()
|
SMESH_Gen::SMESH_Gen()
|
||||||
{
|
{
|
||||||
MESSAGE("SMESH_Gen::SMESH_Gen");
|
|
||||||
_localId = 0;
|
_localId = 0;
|
||||||
_hypId = 0;
|
_hypId = 0;
|
||||||
_segmentation = _nbSegments = 10;
|
_segmentation = _nbSegments = 10;
|
||||||
SMDS_Mesh::_meshList.clear();
|
SMDS_Mesh::_meshList.clear();
|
||||||
MESSAGE(SMDS_Mesh::_meshList.size());
|
|
||||||
_compute_canceled = false;
|
_compute_canceled = false;
|
||||||
//vtkDebugLeaks::SetExitError(0);
|
//vtkDebugLeaks::SetExitError(0);
|
||||||
}
|
}
|
||||||
@ -82,7 +80,6 @@ SMESH_Gen::SMESH_Gen()
|
|||||||
|
|
||||||
SMESH_Gen::~SMESH_Gen()
|
SMESH_Gen::~SMESH_Gen()
|
||||||
{
|
{
|
||||||
MESSAGE("SMESH_Gen::~SMESH_Gen");
|
|
||||||
std::map < int, StudyContextStruct * >::iterator i_sc = _mapStudyContext.begin();
|
std::map < int, StudyContextStruct * >::iterator i_sc = _mapStudyContext.begin();
|
||||||
for ( ; i_sc != _mapStudyContext.end(); ++i_sc )
|
for ( ; i_sc != _mapStudyContext.end(); ++i_sc )
|
||||||
{
|
{
|
||||||
@ -102,7 +99,6 @@ SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode)
|
|||||||
throw(SALOME_Exception)
|
throw(SALOME_Exception)
|
||||||
{
|
{
|
||||||
Unexpect aCatch(SalomeException);
|
Unexpect aCatch(SalomeException);
|
||||||
MESSAGE("SMESH_Gen::CreateMesh");
|
|
||||||
|
|
||||||
// Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
|
// Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
|
||||||
StudyContextStruct *aStudyContext = GetStudyContext(theStudyId);
|
StudyContextStruct *aStudyContext = GetStudyContext(theStudyId);
|
||||||
@ -131,7 +127,6 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
|
|||||||
const ::MeshDimension aDim /*=::MeshDim_3D*/,
|
const ::MeshDimension aDim /*=::MeshDim_3D*/,
|
||||||
TSetOfInt* aShapesId /*=0*/)
|
TSetOfInt* aShapesId /*=0*/)
|
||||||
{
|
{
|
||||||
MESSAGE("SMESH_Gen::Compute");
|
|
||||||
MEMOSTAT;
|
MEMOSTAT;
|
||||||
|
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
@ -369,11 +364,10 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
|
|||||||
ret = Compute( aMesh, aShape, aShapeOnly, /*anUpward=*/true, aDim, aShapesId );
|
ret = Compute( aMesh, aShape, aShapeOnly, /*anUpward=*/true, aDim, aShapesId );
|
||||||
}
|
}
|
||||||
|
|
||||||
MESSAGE( "VSR - SMESH_Gen::Compute() finished, OK = " << ret);
|
|
||||||
MEMOSTAT;
|
MEMOSTAT;
|
||||||
|
|
||||||
SMESHDS_Mesh *myMesh = aMesh.GetMeshDS();
|
SMESHDS_Mesh *myMesh = aMesh.GetMeshDS();
|
||||||
MESSAGE("*** compactMesh after compute");
|
//MESSAGE("*** compactMesh after compute");
|
||||||
myMesh->compactMesh();
|
myMesh->compactMesh();
|
||||||
|
|
||||||
// fix quadratic mesh by bending iternal links near concave boundary
|
// fix quadratic mesh by bending iternal links near concave boundary
|
||||||
@ -463,8 +457,6 @@ bool SMESH_Gen::Evaluate(SMESH_Mesh & aMesh,
|
|||||||
const bool anUpward,
|
const bool anUpward,
|
||||||
TSetOfInt* aShapesId)
|
TSetOfInt* aShapesId)
|
||||||
{
|
{
|
||||||
MESSAGE("SMESH_Gen::Evaluate");
|
|
||||||
|
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
|
|
||||||
SMESH_subMesh *sm = aMesh.GetSubMesh(aShape);
|
SMESH_subMesh *sm = aMesh.GetSubMesh(aShape);
|
||||||
@ -707,8 +699,6 @@ static bool checkMissing(SMESH_Gen* aGen,
|
|||||||
if ( aCheckedMap.count( aSubMesh ))
|
if ( aCheckedMap.count( aSubMesh ))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//MESSAGE("=====checkMissing");
|
|
||||||
|
|
||||||
int ret = true;
|
int ret = true;
|
||||||
SMESH_Algo* algo = 0;
|
SMESH_Algo* algo = 0;
|
||||||
|
|
||||||
@ -829,8 +819,6 @@ bool SMESH_Gen::GetAlgoState(SMESH_Mesh& theMesh,
|
|||||||
const TopoDS_Shape& theShape,
|
const TopoDS_Shape& theShape,
|
||||||
list< TAlgoStateError > & theErrors)
|
list< TAlgoStateError > & theErrors)
|
||||||
{
|
{
|
||||||
//MESSAGE("SMESH_Gen::CheckAlgoState");
|
|
||||||
|
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
bool hasAlgo = false;
|
bool hasAlgo = false;
|
||||||
|
|
||||||
@ -908,8 +896,6 @@ bool SMESH_Gen::GetAlgoState(SMESH_Mesh& theMesh,
|
|||||||
// well defined
|
// well defined
|
||||||
// ----------------------------------------------------------------
|
// ----------------------------------------------------------------
|
||||||
|
|
||||||
//MESSAGE( "---info on missing hypothesis and find out if all needed algos are");
|
|
||||||
|
|
||||||
// find max dim of global algo
|
// find max dim of global algo
|
||||||
int aTopAlgoDim = 0;
|
int aTopAlgoDim = 0;
|
||||||
for (dim = 3; dim > 0; dim--)
|
for (dim = 3; dim > 0; dim--)
|
||||||
|
@ -59,7 +59,6 @@ SMESH_Hypothesis::SMESH_Hypothesis(int hypId,
|
|||||||
|
|
||||||
SMESH_Hypothesis::~SMESH_Hypothesis()
|
SMESH_Hypothesis::~SMESH_Hypothesis()
|
||||||
{
|
{
|
||||||
MESSAGE("SMESH_Hypothesis::~SMESH_Hypothesis");
|
|
||||||
StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
|
StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
|
||||||
myStudyContext->mapHypothesis[_hypId] = 0;
|
myStudyContext->mapHypothesis[_hypId] = 0;
|
||||||
}
|
}
|
||||||
@ -115,8 +114,6 @@ int SMESH_Hypothesis::GetStudyId() const
|
|||||||
|
|
||||||
void SMESH_Hypothesis::NotifySubMeshesHypothesisModification()
|
void SMESH_Hypothesis::NotifySubMeshesHypothesisModification()
|
||||||
{
|
{
|
||||||
MESSAGE("SMESH_Hypothesis::NotifySubMeshesHypothesisModification");
|
|
||||||
|
|
||||||
// for all meshes in study
|
// for all meshes in study
|
||||||
|
|
||||||
StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
|
StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
|
||||||
|
@ -112,7 +112,7 @@ SMESH_Mesh::SMESH_Mesh(int theLocalId,
|
|||||||
SMESHDS_Document* theDocument):
|
SMESHDS_Document* theDocument):
|
||||||
_groupId( 0 ), _nbSubShapes( 0 )
|
_groupId( 0 ), _nbSubShapes( 0 )
|
||||||
{
|
{
|
||||||
MESSAGE("SMESH_Mesh::SMESH_Mesh(int localId)");
|
if(MYDEBUG) MESSAGE("SMESH_Mesh::SMESH_Mesh(int localId)");
|
||||||
_id = theLocalId;
|
_id = theLocalId;
|
||||||
_studyId = theStudyId;
|
_studyId = theStudyId;
|
||||||
_gen = theGen;
|
_gen = theGen;
|
||||||
@ -179,7 +179,7 @@ namespace
|
|||||||
|
|
||||||
SMESH_Mesh::~SMESH_Mesh()
|
SMESH_Mesh::~SMESH_Mesh()
|
||||||
{
|
{
|
||||||
MESSAGE("SMESH_Mesh::~SMESH_Mesh");
|
if(MYDEBUG) MESSAGE("SMESH_Mesh::~SMESH_Mesh");
|
||||||
|
|
||||||
// avoid usual removal of elements while processing RemoveHypothesis( algo ) event
|
// avoid usual removal of elements while processing RemoveHypothesis( algo ) event
|
||||||
SMESHDS_SubMeshIteratorPtr smIt = _myMeshDS->SubMeshes();
|
SMESHDS_SubMeshIteratorPtr smIt = _myMeshDS->SubMeshes();
|
||||||
@ -361,10 +361,19 @@ double SMESH_Mesh::GetShapeDiagonalSize(const TopoDS_Shape & aShape)
|
|||||||
int nbFaces = 0;
|
int nbFaces = 0;
|
||||||
for ( TopExp_Explorer f( aShape, TopAbs_FACE ); f.More() && nbFaces < maxNbFaces; f.Next() )
|
for ( TopExp_Explorer f( aShape, TopAbs_FACE ); f.More() && nbFaces < maxNbFaces; f.Next() )
|
||||||
++nbFaces;
|
++nbFaces;
|
||||||
|
bool isPrecise = false;
|
||||||
if ( nbFaces < maxNbFaces )
|
if ( nbFaces < maxNbFaces )
|
||||||
GEOMUtils::PreciseBoundingBox(aShape, Box);
|
try {
|
||||||
else
|
GEOMUtils::PreciseBoundingBox( aShape, Box );
|
||||||
BRepBndLib::Add( aShape, Box);
|
isPrecise = true;
|
||||||
|
}
|
||||||
|
catch (...) {
|
||||||
|
isPrecise = false;
|
||||||
|
}
|
||||||
|
if ( !isPrecise )
|
||||||
|
{
|
||||||
|
BRepBndLib::Add( aShape, Box );
|
||||||
|
}
|
||||||
if ( !Box.IsVoid() )
|
if ( !Box.IsVoid() )
|
||||||
return sqrt( Box.SquareExtent() );
|
return sqrt( Box.SquareExtent() );
|
||||||
}
|
}
|
||||||
|
@ -683,7 +683,6 @@ static bool getNodesFromTwoTria(const SMDS_MeshElement * theTria1,
|
|||||||
bool SMESH_MeshEditor::InverseDiag (const SMDS_MeshElement * theTria1,
|
bool SMESH_MeshEditor::InverseDiag (const SMDS_MeshElement * theTria1,
|
||||||
const SMDS_MeshElement * theTria2 )
|
const SMDS_MeshElement * theTria2 )
|
||||||
{
|
{
|
||||||
MESSAGE("InverseDiag");
|
|
||||||
myLastCreatedElems.Clear();
|
myLastCreatedElems.Clear();
|
||||||
myLastCreatedNodes.Clear();
|
myLastCreatedNodes.Clear();
|
||||||
|
|
||||||
@ -888,8 +887,6 @@ bool SMESH_MeshEditor::InverseDiag (const SMDS_MeshNode * theNode1,
|
|||||||
myLastCreatedElems.Clear();
|
myLastCreatedElems.Clear();
|
||||||
myLastCreatedNodes.Clear();
|
myLastCreatedNodes.Clear();
|
||||||
|
|
||||||
MESSAGE( "::InverseDiag()" );
|
|
||||||
|
|
||||||
const SMDS_MeshElement *tr1, *tr2;
|
const SMDS_MeshElement *tr1, *tr2;
|
||||||
if ( !findTriangles( theNode1, theNode2, tr1, tr2 ))
|
if ( !findTriangles( theNode1, theNode2, tr1, tr2 ))
|
||||||
return false;
|
return false;
|
||||||
@ -1011,8 +1008,6 @@ bool SMESH_MeshEditor::DeleteDiag (const SMDS_MeshNode * theNode1,
|
|||||||
myLastCreatedElems.Clear();
|
myLastCreatedElems.Clear();
|
||||||
myLastCreatedNodes.Clear();
|
myLastCreatedNodes.Clear();
|
||||||
|
|
||||||
MESSAGE( "::DeleteDiag()" );
|
|
||||||
|
|
||||||
const SMDS_MeshElement *tr1, *tr2;
|
const SMDS_MeshElement *tr1, *tr2;
|
||||||
if ( !findTriangles( theNode1, theNode2, tr1, tr2 ))
|
if ( !findTriangles( theNode1, theNode2, tr1, tr2 ))
|
||||||
return false;
|
return false;
|
||||||
@ -1105,7 +1100,6 @@ bool SMESH_MeshEditor::DeleteDiag (const SMDS_MeshNode * theNode1,
|
|||||||
|
|
||||||
bool SMESH_MeshEditor::Reorient (const SMDS_MeshElement * theElem)
|
bool SMESH_MeshEditor::Reorient (const SMDS_MeshElement * theElem)
|
||||||
{
|
{
|
||||||
MESSAGE("Reorient");
|
|
||||||
myLastCreatedElems.Clear();
|
myLastCreatedElems.Clear();
|
||||||
myLastCreatedNodes.Clear();
|
myLastCreatedNodes.Clear();
|
||||||
|
|
||||||
@ -1518,7 +1512,7 @@ void SMESH_MeshEditor::QuadTo4Tri (TIDSortedElemSet & theElems)
|
|||||||
gp_XY uv [9]; uv[8] = gp_XY(0,0);
|
gp_XY uv [9]; uv[8] = gp_XY(0,0);
|
||||||
gp_XYZ xyz[9];
|
gp_XYZ xyz[9];
|
||||||
vector< const SMDS_MeshNode* > nodes;
|
vector< const SMDS_MeshNode* > nodes;
|
||||||
SMESHDS_SubMesh* subMeshDS;
|
SMESHDS_SubMesh* subMeshDS = 0;
|
||||||
TopoDS_Face F;
|
TopoDS_Face F;
|
||||||
Handle(Geom_Surface) surface;
|
Handle(Geom_Surface) surface;
|
||||||
TopLoc_Location loc;
|
TopLoc_Location loc;
|
||||||
@ -2931,8 +2925,6 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems,
|
|||||||
myLastCreatedElems.Clear();
|
myLastCreatedElems.Clear();
|
||||||
myLastCreatedNodes.Clear();
|
myLastCreatedNodes.Clear();
|
||||||
|
|
||||||
MESSAGE( "::QuadToTri()" );
|
|
||||||
|
|
||||||
SMESHDS_Mesh * aMesh = GetMeshDS();
|
SMESHDS_Mesh * aMesh = GetMeshDS();
|
||||||
|
|
||||||
Handle(Geom_Surface) surface;
|
Handle(Geom_Surface) surface;
|
||||||
@ -3153,8 +3145,6 @@ bool SMESH_MeshEditor::TriToQuad (TIDSortedElemSet & theElems,
|
|||||||
myLastCreatedElems.Clear();
|
myLastCreatedElems.Clear();
|
||||||
myLastCreatedNodes.Clear();
|
myLastCreatedNodes.Clear();
|
||||||
|
|
||||||
MESSAGE( "::TriToQuad()" );
|
|
||||||
|
|
||||||
if ( !theCrit.get() )
|
if ( !theCrit.get() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -3259,7 +3249,7 @@ bool SMESH_MeshEditor::TriToQuad (TIDSortedElemSet & theElems,
|
|||||||
if ( startElem ) {
|
if ( startElem ) {
|
||||||
// Get candidates to be fused
|
// Get candidates to be fused
|
||||||
const SMDS_MeshElement *tr1 = startElem, *tr2 = 0, *tr3 = 0;
|
const SMDS_MeshElement *tr1 = startElem, *tr2 = 0, *tr3 = 0;
|
||||||
const SMESH_TLink *link12, *link13;
|
const SMESH_TLink *link12 = 0, *link13 = 0;
|
||||||
startElem = 0;
|
startElem = 0;
|
||||||
ASSERT( mapEl_setLi.find( tr1 ) != mapEl_setLi.end() );
|
ASSERT( mapEl_setLi.find( tr1 ) != mapEl_setLi.end() );
|
||||||
set< SMESH_TLink >& setLi = mapEl_setLi[ tr1 ];
|
set< SMESH_TLink >& setLi = mapEl_setLi[ tr1 ];
|
||||||
@ -3938,8 +3928,6 @@ void SMESH_MeshEditor::Smooth (TIDSortedElemSet & theElems,
|
|||||||
myLastCreatedElems.Clear();
|
myLastCreatedElems.Clear();
|
||||||
myLastCreatedNodes.Clear();
|
myLastCreatedNodes.Clear();
|
||||||
|
|
||||||
MESSAGE((theSmoothMethod==LAPLACIAN ? "LAPLACIAN" : "CENTROIDAL") << "--::Smooth()");
|
|
||||||
|
|
||||||
if ( theTgtAspectRatio < 1.0 )
|
if ( theTgtAspectRatio < 1.0 )
|
||||||
theTgtAspectRatio = 1.0;
|
theTgtAspectRatio = 1.0;
|
||||||
|
|
||||||
@ -4476,7 +4464,6 @@ void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement* elem,
|
|||||||
const size_t nbSteps,
|
const size_t nbSteps,
|
||||||
SMESH_SequenceOfElemPtr& srcElements)
|
SMESH_SequenceOfElemPtr& srcElements)
|
||||||
{
|
{
|
||||||
//MESSAGE("sweepElement " << nbSteps);
|
|
||||||
SMESHDS_Mesh* aMesh = GetMeshDS();
|
SMESHDS_Mesh* aMesh = GetMeshDS();
|
||||||
|
|
||||||
const int nbNodes = elem->NbNodes();
|
const int nbNodes = elem->NbNodes();
|
||||||
@ -5368,7 +5355,6 @@ SMESH_MeshEditor::RotationSweep(TIDSortedElemSet theElemSets[2],
|
|||||||
// source elements for each generated one
|
// source elements for each generated one
|
||||||
SMESH_SequenceOfElemPtr srcElems, srcNodes;
|
SMESH_SequenceOfElemPtr srcElems, srcNodes;
|
||||||
|
|
||||||
MESSAGE( "RotationSweep()");
|
|
||||||
gp_Trsf aTrsf;
|
gp_Trsf aTrsf;
|
||||||
aTrsf.SetRotation( theAxis, theAngle );
|
aTrsf.SetRotation( theAxis, theAngle );
|
||||||
gp_Trsf aTrsf2;
|
gp_Trsf aTrsf2;
|
||||||
@ -5939,7 +5925,6 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet theElements[2],
|
|||||||
const gp_Pnt& theRefPoint,
|
const gp_Pnt& theRefPoint,
|
||||||
const bool theMakeGroups)
|
const bool theMakeGroups)
|
||||||
{
|
{
|
||||||
MESSAGE("ExtrusionAlongTrack");
|
|
||||||
myLastCreatedElems.Clear();
|
myLastCreatedElems.Clear();
|
||||||
myLastCreatedNodes.Clear();
|
myLastCreatedNodes.Clear();
|
||||||
|
|
||||||
@ -6732,37 +6717,29 @@ SMESH_MeshEditor::Transform (TIDSortedElemSet & theElems,
|
|||||||
string groupPostfix;
|
string groupPostfix;
|
||||||
switch ( theTrsf.Form() ) {
|
switch ( theTrsf.Form() ) {
|
||||||
case gp_PntMirror:
|
case gp_PntMirror:
|
||||||
MESSAGE("gp_PntMirror");
|
|
||||||
needReverse = true;
|
needReverse = true;
|
||||||
groupPostfix = "mirrored";
|
groupPostfix = "mirrored";
|
||||||
break;
|
break;
|
||||||
case gp_Ax1Mirror:
|
case gp_Ax1Mirror:
|
||||||
MESSAGE("gp_Ax1Mirror");
|
|
||||||
groupPostfix = "mirrored";
|
groupPostfix = "mirrored";
|
||||||
break;
|
break;
|
||||||
case gp_Ax2Mirror:
|
case gp_Ax2Mirror:
|
||||||
MESSAGE("gp_Ax2Mirror");
|
|
||||||
needReverse = true;
|
needReverse = true;
|
||||||
groupPostfix = "mirrored";
|
groupPostfix = "mirrored";
|
||||||
break;
|
break;
|
||||||
case gp_Rotation:
|
case gp_Rotation:
|
||||||
MESSAGE("gp_Rotation");
|
|
||||||
groupPostfix = "rotated";
|
groupPostfix = "rotated";
|
||||||
break;
|
break;
|
||||||
case gp_Translation:
|
case gp_Translation:
|
||||||
MESSAGE("gp_Translation");
|
|
||||||
groupPostfix = "translated";
|
groupPostfix = "translated";
|
||||||
break;
|
break;
|
||||||
case gp_Scale:
|
case gp_Scale:
|
||||||
MESSAGE("gp_Scale");
|
|
||||||
groupPostfix = "scaled";
|
groupPostfix = "scaled";
|
||||||
break;
|
break;
|
||||||
case gp_CompoundTrsf: // different scale by axis
|
case gp_CompoundTrsf: // different scale by axis
|
||||||
MESSAGE("gp_CompoundTrsf");
|
|
||||||
groupPostfix = "scaled";
|
groupPostfix = "scaled";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
MESSAGE("default");
|
|
||||||
needReverse = false;
|
needReverse = false;
|
||||||
groupPostfix = "transformed";
|
groupPostfix = "transformed";
|
||||||
}
|
}
|
||||||
@ -7271,7 +7248,6 @@ int SMESH_MeshEditor::SimplifyFace (const vector<const SMDS_MeshNode *>& faceNod
|
|||||||
|
|
||||||
void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes)
|
void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes)
|
||||||
{
|
{
|
||||||
MESSAGE("MergeNodes");
|
|
||||||
myLastCreatedElems.Clear();
|
myLastCreatedElems.Clear();
|
||||||
myLastCreatedNodes.Clear();
|
myLastCreatedNodes.Clear();
|
||||||
|
|
||||||
@ -8120,7 +8096,6 @@ SMESH_MeshEditor::SewFreeBorder (const SMDS_MeshNode* theBordFirstNode,
|
|||||||
myLastCreatedElems.Clear();
|
myLastCreatedElems.Clear();
|
||||||
myLastCreatedNodes.Clear();
|
myLastCreatedNodes.Clear();
|
||||||
|
|
||||||
MESSAGE("::SewFreeBorder()");
|
|
||||||
Sew_Error aResult = SEW_OK;
|
Sew_Error aResult = SEW_OK;
|
||||||
|
|
||||||
// ====================================
|
// ====================================
|
||||||
@ -8228,7 +8203,7 @@ SMESH_MeshEditor::SewFreeBorder (const SMDS_MeshNode* theBordFirstNode,
|
|||||||
//const SMDS_MeshNode* faceNodes[ 4 ];
|
//const SMDS_MeshNode* faceNodes[ 4 ];
|
||||||
|
|
||||||
const SMDS_MeshNode* sideNode;
|
const SMDS_MeshNode* sideNode;
|
||||||
const SMDS_MeshElement* sideElem;
|
const SMDS_MeshElement* sideElem = 0;
|
||||||
const SMDS_MeshNode* prevSideNode = theSideFirstNode;
|
const SMDS_MeshNode* prevSideNode = theSideFirstNode;
|
||||||
const SMDS_MeshNode* prevBordNode = theBordFirstNode;
|
const SMDS_MeshNode* prevBordNode = theBordFirstNode;
|
||||||
nBordIt = bordNodes.begin();
|
nBordIt = bordNodes.begin();
|
||||||
@ -8253,7 +8228,7 @@ SMESH_MeshEditor::SewFreeBorder (const SMDS_MeshNode* theBordFirstNode,
|
|||||||
{
|
{
|
||||||
const SMDS_MeshElement* elem = invElemIt->next();
|
const SMDS_MeshElement* elem = invElemIt->next();
|
||||||
// prepare data for a loop on links coming to prevSideNode, of a face or a volume
|
// prepare data for a loop on links coming to prevSideNode, of a face or a volume
|
||||||
int iPrevNode, iNode = 0, nbNodes = elem->NbNodes();
|
int iPrevNode = 0, iNode = 0, nbNodes = elem->NbNodes();
|
||||||
vector< const SMDS_MeshNode* > faceNodes( nbNodes, (const SMDS_MeshNode*)0 );
|
vector< const SMDS_MeshNode* > faceNodes( nbNodes, (const SMDS_MeshNode*)0 );
|
||||||
bool isVolume = volume.Set( elem );
|
bool isVolume = volume.Set( elem );
|
||||||
const SMDS_MeshNode** nodes = isVolume ? volume.GetNodes() : & faceNodes[0];
|
const SMDS_MeshNode** nodes = isVolume ? volume.GetNodes() : & faceNodes[0];
|
||||||
@ -8801,7 +8776,7 @@ void SMESH_MeshEditor::InsertNodesIntoLink(const SMDS_MeshElement* theElemen
|
|||||||
}
|
}
|
||||||
// decide how to split a quadrangle: compare possible variants
|
// decide how to split a quadrangle: compare possible variants
|
||||||
// and choose which of splits to be a quadrangle
|
// and choose which of splits to be a quadrangle
|
||||||
int i1, i2, iSplit, nbSplits = nbLinkNodes - 1, iBestQuad;
|
int i1, i2, iSplit, nbSplits = nbLinkNodes - 1, iBestQuad = 0;
|
||||||
if ( nbFaceNodes == 3 ) {
|
if ( nbFaceNodes == 3 ) {
|
||||||
iBestQuad = nbSplits;
|
iBestQuad = nbSplits;
|
||||||
i4 = i3;
|
i4 = i3;
|
||||||
@ -9757,7 +9732,6 @@ SMESH_MeshEditor::SewSideElements (TIDSortedElemSet& theSide1,
|
|||||||
myLastCreatedElems.Clear();
|
myLastCreatedElems.Clear();
|
||||||
myLastCreatedNodes.Clear();
|
myLastCreatedNodes.Clear();
|
||||||
|
|
||||||
MESSAGE ("::::SewSideElements()");
|
|
||||||
if ( theSide1.size() != theSide2.size() )
|
if ( theSide1.size() != theSide2.size() )
|
||||||
return SEW_DIFF_NB_OF_ELEMENTS;
|
return SEW_DIFF_NB_OF_ELEMENTS;
|
||||||
|
|
||||||
@ -10436,7 +10410,7 @@ void SMESH_MeshEditor::DoubleElements( const TIDSortedElemSet& theElements )
|
|||||||
|
|
||||||
// get an element type and an iterator over elements
|
// get an element type and an iterator over elements
|
||||||
|
|
||||||
SMDSAbs_ElementType type;
|
SMDSAbs_ElementType type = SMDSAbs_All;
|
||||||
SMDS_ElemIteratorPtr elemIt;
|
SMDS_ElemIteratorPtr elemIt;
|
||||||
vector< const SMDS_MeshElement* > allElems;
|
vector< const SMDS_MeshElement* > allElems;
|
||||||
if ( theElements.empty() )
|
if ( theElements.empty() )
|
||||||
@ -10538,7 +10512,6 @@ bool SMESH_MeshEditor::doubleNodes(SMESHDS_Mesh* theMeshDS,
|
|||||||
TNodeNodeMap& theNodeNodeMap,
|
TNodeNodeMap& theNodeNodeMap,
|
||||||
const bool theIsDoubleElem )
|
const bool theIsDoubleElem )
|
||||||
{
|
{
|
||||||
MESSAGE("doubleNodes");
|
|
||||||
// iterate through element and duplicate them (by nodes duplication)
|
// iterate through element and duplicate them (by nodes duplication)
|
||||||
bool res = false;
|
bool res = false;
|
||||||
std::vector<const SMDS_MeshNode*> newNodes;
|
std::vector<const SMDS_MeshNode*> newNodes;
|
||||||
@ -10603,7 +10576,6 @@ bool SMESH_MeshEditor::doubleNodes(SMESHDS_Mesh* theMeshDS,
|
|||||||
bool SMESH_MeshEditor::DoubleNodes( const std::list< int >& theListOfNodes,
|
bool SMESH_MeshEditor::DoubleNodes( const std::list< int >& theListOfNodes,
|
||||||
const std::list< int >& theListOfModifiedElems )
|
const std::list< int >& theListOfModifiedElems )
|
||||||
{
|
{
|
||||||
MESSAGE("DoubleNodes");
|
|
||||||
myLastCreatedElems.Clear();
|
myLastCreatedElems.Clear();
|
||||||
myLastCreatedNodes.Clear();
|
myLastCreatedNodes.Clear();
|
||||||
|
|
||||||
@ -10677,10 +10649,9 @@ bool SMESH_MeshEditor::DoubleNodes( const std::list< int >& theListOfNodes,
|
|||||||
const SMDS_MeshElement* anElem = anElemToNodesIter->first;
|
const SMDS_MeshElement* anElem = anElemToNodesIter->first;
|
||||||
vector<const SMDS_MeshNode*> aNodeArr = anElemToNodesIter->second;
|
vector<const SMDS_MeshNode*> aNodeArr = anElemToNodesIter->second;
|
||||||
if ( anElem )
|
if ( anElem )
|
||||||
{
|
{
|
||||||
MESSAGE("ChangeElementNodes");
|
|
||||||
aMeshDS->ChangeElementNodes( anElem, &aNodeArr[ 0 ], anElem->NbNodes() );
|
aMeshDS->ChangeElementNodes( anElem, &aNodeArr[ 0 ], anElem->NbNodes() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -10788,7 +10759,6 @@ bool SMESH_MeshEditor::AffectedElemGroupsInRegion( const TIDSortedElemSet& theEl
|
|||||||
continue;
|
continue;
|
||||||
gp_XYZ normal;
|
gp_XYZ normal;
|
||||||
SMESH_MeshAlgos::FaceNormal( anElem, normal, /*normalized=*/true );
|
SMESH_MeshAlgos::FaceNormal( anElem, normal, /*normalized=*/true );
|
||||||
MESSAGE("element " << ielem++ << " normal " << normal.X() << " " << normal.Y() << " " << normal.Z());
|
|
||||||
std::set<const SMDS_MeshNode*> nodesElem;
|
std::set<const SMDS_MeshNode*> nodesElem;
|
||||||
nodesElem.clear();
|
nodesElem.clear();
|
||||||
SMDS_ElemIteratorPtr nodeItr = anElem->nodesIterator();
|
SMDS_ElemIteratorPtr nodeItr = anElem->nodesIterator();
|
||||||
@ -10800,7 +10770,6 @@ bool SMESH_MeshEditor::AffectedElemGroupsInRegion( const TIDSortedElemSet& theEl
|
|||||||
std::set<const SMDS_MeshNode*>::iterator nodit = nodesElem.begin();
|
std::set<const SMDS_MeshNode*>::iterator nodit = nodesElem.begin();
|
||||||
for (; nodit != nodesElem.end(); nodit++)
|
for (; nodit != nodesElem.end(); nodit++)
|
||||||
{
|
{
|
||||||
MESSAGE(" noeud ");
|
|
||||||
const SMDS_MeshNode* aNode = *nodit;
|
const SMDS_MeshNode* aNode = *nodit;
|
||||||
if ( !aNode || theNodesNot.find(aNode) != theNodesNot.end() )
|
if ( !aNode || theNodesNot.find(aNode) != theNodesNot.end() )
|
||||||
continue;
|
continue;
|
||||||
@ -10810,7 +10779,6 @@ bool SMESH_MeshEditor::AffectedElemGroupsInRegion( const TIDSortedElemSet& theEl
|
|||||||
SMDS_ElemIteratorPtr backElemItr = aNode->GetInverseElementIterator();
|
SMDS_ElemIteratorPtr backElemItr = aNode->GetInverseElementIterator();
|
||||||
while ( backElemItr->more() )
|
while ( backElemItr->more() )
|
||||||
{
|
{
|
||||||
MESSAGE(" backelem ");
|
|
||||||
const SMDS_MeshElement* curElem = backElemItr->next();
|
const SMDS_MeshElement* curElem = backElemItr->next();
|
||||||
if (alreadyCheckedElems.find(curElem) != alreadyCheckedElems.end())
|
if (alreadyCheckedElems.find(curElem) != alreadyCheckedElems.end())
|
||||||
continue;
|
continue;
|
||||||
@ -10832,10 +10800,8 @@ bool SMESH_MeshEditor::AffectedElemGroupsInRegion( const TIDSortedElemSet& theEl
|
|||||||
p.SetCoord( x/nb -aNode->X(),
|
p.SetCoord( x/nb -aNode->X(),
|
||||||
y/nb -aNode->Y(),
|
y/nb -aNode->Y(),
|
||||||
z/nb -aNode->Z() );
|
z/nb -aNode->Z() );
|
||||||
MESSAGE(" check " << p.X() << " " << p.Y() << " " << p.Z());
|
|
||||||
if (normal*p > 0)
|
if (normal*p > 0)
|
||||||
{
|
{
|
||||||
MESSAGE(" --- inserted")
|
|
||||||
theAffectedElems.insert( curElem );
|
theAffectedElems.insert( curElem );
|
||||||
}
|
}
|
||||||
else if (curElem->GetType() == SMDSAbs_Edge)
|
else if (curElem->GetType() == SMDSAbs_Edge)
|
||||||
@ -10861,7 +10827,6 @@ bool SMESH_MeshEditor::AffectedElemGroupsInRegion( const TIDSortedElemSet& theEl
|
|||||||
}
|
}
|
||||||
if (onside)
|
if (onside)
|
||||||
{
|
{
|
||||||
MESSAGE(" --- edge onside inserted")
|
|
||||||
theAffectedElems.insert(anEdge);
|
theAffectedElems.insert(anEdge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10886,21 +10851,18 @@ bool SMESH_MeshEditor::AffectedElemGroupsInRegion( const TIDSortedElemSet& theEl
|
|||||||
int ielem;
|
int ielem;
|
||||||
for ( ielem = 1; elemItr != theElems.end(); ++elemItr )
|
for ( ielem = 1; elemItr != theElems.end(); ++elemItr )
|
||||||
{
|
{
|
||||||
MESSAGE("element " << ielem++);
|
|
||||||
SMDS_MeshElement* anElem = (SMDS_MeshElement*)*elemItr;
|
SMDS_MeshElement* anElem = (SMDS_MeshElement*)*elemItr;
|
||||||
if (!anElem)
|
if (!anElem)
|
||||||
continue;
|
continue;
|
||||||
SMDS_ElemIteratorPtr nodeItr = anElem->nodesIterator();
|
SMDS_ElemIteratorPtr nodeItr = anElem->nodesIterator();
|
||||||
while ( nodeItr->more() )
|
while ( nodeItr->more() )
|
||||||
{
|
{
|
||||||
MESSAGE(" noeud ");
|
|
||||||
const SMDS_MeshNode* aNode = cast2Node(nodeItr->next());
|
const SMDS_MeshNode* aNode = cast2Node(nodeItr->next());
|
||||||
if ( !aNode || theNodesNot.find(aNode) != theNodesNot.end() )
|
if ( !aNode || theNodesNot.find(aNode) != theNodesNot.end() )
|
||||||
continue;
|
continue;
|
||||||
SMDS_ElemIteratorPtr backElemItr = aNode->GetInverseElementIterator();
|
SMDS_ElemIteratorPtr backElemItr = aNode->GetInverseElementIterator();
|
||||||
while ( backElemItr->more() )
|
while ( backElemItr->more() )
|
||||||
{
|
{
|
||||||
MESSAGE(" backelem ");
|
|
||||||
const SMDS_MeshElement* curElem = backElemItr->next();
|
const SMDS_MeshElement* curElem = backElemItr->next();
|
||||||
if ( curElem && theElems.find(curElem) == theElems.end() &&
|
if ( curElem && theElems.find(curElem) == theElems.end() &&
|
||||||
( bsc3d.get() ?
|
( bsc3d.get() ?
|
||||||
@ -10986,10 +10948,6 @@ bool SMESH_MeshEditor::DoubleNodesInRegion( const TIDSortedElemSet& theElems,
|
|||||||
*/
|
*/
|
||||||
double SMESH_MeshEditor::OrientedAngle(const gp_Pnt& p0, const gp_Pnt& p1, const gp_Pnt& g1, const gp_Pnt& g2)
|
double SMESH_MeshEditor::OrientedAngle(const gp_Pnt& p0, const gp_Pnt& p1, const gp_Pnt& g1, const gp_Pnt& g2)
|
||||||
{
|
{
|
||||||
// MESSAGE(" p0: " << p0.X() << " " << p0.Y() << " " << p0.Z());
|
|
||||||
// MESSAGE(" p1: " << p1.X() << " " << p1.Y() << " " << p1.Z());
|
|
||||||
// MESSAGE(" g1: " << g1.X() << " " << g1.Y() << " " << g1.Z());
|
|
||||||
// MESSAGE(" g2: " << g2.X() << " " << g2.Y() << " " << g2.Z());
|
|
||||||
gp_Vec vref(p0, p1);
|
gp_Vec vref(p0, p1);
|
||||||
gp_Vec v1(p0, g1);
|
gp_Vec v1(p0, g1);
|
||||||
gp_Vec v2(p0, g2);
|
gp_Vec v2(p0, g2);
|
||||||
|
@ -308,11 +308,18 @@ void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh)
|
|||||||
{
|
{
|
||||||
double f,l, r = 0.2345;
|
double f,l, r = 0.2345;
|
||||||
Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface( edge, face, f, l );
|
Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface( edge, face, f, l );
|
||||||
uv2 = C2d->Value( f * r + l * ( 1.-r ));
|
if ( C2d.IsNull() )
|
||||||
if ( du < Precision::PConfusion() )
|
{
|
||||||
isSeam = ( Abs( uv1.Coord(1) - uv2.Coord(1) ) < Precision::PConfusion() );
|
isSeam = false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
isSeam = ( Abs( uv1.Coord(2) - uv2.Coord(2) ) < Precision::PConfusion() );
|
{
|
||||||
|
uv2 = C2d->Value( f * r + l * ( 1.-r ));
|
||||||
|
if ( du < Precision::PConfusion() )
|
||||||
|
isSeam = ( Abs( uv1.Coord(1) - uv2.Coord(1) ) < Precision::PConfusion() );
|
||||||
|
else
|
||||||
|
isSeam = ( Abs( uv1.Coord(2) - uv2.Coord(2) ) < Precision::PConfusion() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( isSeam )
|
if ( isSeam )
|
||||||
@ -653,8 +660,7 @@ gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face& F,
|
|||||||
{
|
{
|
||||||
if ( !IsSubShape( V, F ))
|
if ( !IsSubShape( V, F ))
|
||||||
{
|
{
|
||||||
MESSAGE ( "SMESH_MesherHelper::GetNodeUV(); Vertex " << vertexID
|
MESSAGE("GetNodeUV() Vertex "<< vertexID <<" not in face "<< GetMeshDS()->ShapeToIndex(F));
|
||||||
<< " not in face " << GetMeshDS()->ShapeToIndex( F ) );
|
|
||||||
// get UV of a vertex closest to the node
|
// get UV of a vertex closest to the node
|
||||||
double dist = 1e100;
|
double dist = 1e100;
|
||||||
gp_Pnt pn = XYZ( n );
|
gp_Pnt pn = XYZ( n );
|
||||||
@ -1073,7 +1079,6 @@ bool SMESH_MesherHelper::CheckNodeU(const TopoDS_Edge& E,
|
|||||||
}
|
}
|
||||||
Quantity_Parameter U = projector->LowerDistanceParameter();
|
Quantity_Parameter U = projector->LowerDistanceParameter();
|
||||||
u = double( U );
|
u = double( U );
|
||||||
MESSAGE(" f " << f << " l " << l << " u " << u);
|
|
||||||
curvPnt = curve->Value( u );
|
curvPnt = curve->Value( u );
|
||||||
dist = nodePnt.Distance( curvPnt );
|
dist = nodePnt.Distance( curvPnt );
|
||||||
if ( distXYZ ) {
|
if ( distXYZ ) {
|
||||||
@ -1083,8 +1088,7 @@ bool SMESH_MesherHelper::CheckNodeU(const TopoDS_Edge& E,
|
|||||||
}
|
}
|
||||||
if ( dist > tol )
|
if ( dist > tol )
|
||||||
{
|
{
|
||||||
MESSAGE( "SMESH_MesherHelper::CheckNodeU(), invalid projection" );
|
MESSAGE( "CheckNodeU(), invalid projection; distance " << dist << "; tol " << tol );
|
||||||
MESSAGE("distance " << dist << " " << tol );
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// store the fixed U on the edge
|
// store the fixed U on the edge
|
||||||
@ -1609,7 +1613,7 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
|
|||||||
|
|
||||||
// get type of shape for the new medium node
|
// get type of shape for the new medium node
|
||||||
int faceID = -1, edgeID = -1;
|
int faceID = -1, edgeID = -1;
|
||||||
TopoDS_Edge E; double u [2];
|
TopoDS_Edge E; double u [2] = {0.,0.};
|
||||||
TopoDS_Face F; gp_XY uv[2];
|
TopoDS_Face F; gp_XY uv[2];
|
||||||
bool uvOK[2] = { true, true };
|
bool uvOK[2] = { true, true };
|
||||||
const bool useCurSubShape = ( !myShape.IsNull() && myShape.ShapeType() == TopAbs_EDGE );
|
const bool useCurSubShape = ( !myShape.IsNull() && myShape.ShapeType() == TopAbs_EDGE );
|
||||||
@ -3049,8 +3053,6 @@ bool SMESH_MesherHelper::IsSubShape( const TopoDS_Shape& shape,
|
|||||||
if ( shape.IsSame( exp.Current() ))
|
if ( shape.IsSame( exp.Current() ))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
SCRUTE((shape.IsNull()));
|
|
||||||
SCRUTE((mainShape.IsNull()));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5324,3 +5326,19 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief DEBUG
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
void SMESH_MesherHelper::WriteShape(const TopoDS_Shape& s)
|
||||||
|
{
|
||||||
|
const char* name = "/tmp/shape.brep";
|
||||||
|
BRepTools::Write( s, name );
|
||||||
|
#ifdef _DEBUG_
|
||||||
|
std::cout << name << std::endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -684,6 +684,8 @@ public:
|
|||||||
|
|
||||||
virtual ~SMESH_MesherHelper();
|
virtual ~SMESH_MesherHelper();
|
||||||
|
|
||||||
|
static void WriteShape(const TopoDS_Shape& s);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -499,7 +499,7 @@ static gp_XY project (const SMDS_MeshNode* theNode,
|
|||||||
MESSAGE( "SMESH_Pattern: point projection FAILED");
|
MESSAGE( "SMESH_Pattern: point projection FAILED");
|
||||||
return gp_XY(0.,0.);
|
return gp_XY(0.,0.);
|
||||||
}
|
}
|
||||||
double u, v, minVal = DBL_MAX;
|
double u =0, v =0, minVal = DBL_MAX;
|
||||||
for ( int i = theProjectorPS.NbExt(); i > 0; i-- )
|
for ( int i = theProjectorPS.NbExt(); i > 0; i-- )
|
||||||
if ( theProjectorPS.SquareDistance( i ) < minVal ) {
|
if ( theProjectorPS.SquareDistance( i ) < minVal ) {
|
||||||
minVal = theProjectorPS.SquareDistance( i );
|
minVal = theProjectorPS.SquareDistance( i );
|
||||||
@ -2339,7 +2339,7 @@ bool SMESH_Pattern::sortSameSizeWires (TListOfEdgesList & theWire
|
|||||||
// " \t vertex: " << vGcVec[iW].X() << " " << vGcVec[iW].Y() << endl;
|
// " \t vertex: " << vGcVec[iW].X() << " " << vGcVec[iW].Y() << endl;
|
||||||
double minDist = DBL_MAX;
|
double minDist = DBL_MAX;
|
||||||
gp_XY & wGc = vGcVec[ iW ];
|
gp_XY & wGc = vGcVec[ iW ];
|
||||||
int bIndex;
|
int bIndex = 0;
|
||||||
for ( int iB = 0; iB < nbWires; iB++ ) {
|
for ( int iB = 0; iB < nbWires; iB++ ) {
|
||||||
if ( bndFound[ iB ] ) continue;
|
if ( bndFound[ iB ] ) continue;
|
||||||
double dist = ( wGc - gcVec[ iB ] ).SquareModulus();
|
double dist = ( wGc - gcVec[ iB ] ).SquareModulus();
|
||||||
|
@ -30,14 +30,18 @@ void memostat(const char* f, int l)
|
|||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
//rnv: TODO: find alternative of the malloc_stats() on windows platform
|
//rnv: TODO: find alternative of the malloc_stats() on windows platform
|
||||||
#else
|
#else
|
||||||
/* struct mallinfo mem = mallinfo(); */
|
struct mallinfo mem = mallinfo();
|
||||||
/* std::cerr << f << ":"<< l << " " << mem.arena << " " << mem.ordblks << " " << mem.hblks << " " << mem.hblkhd << " " << mem.uordblks << " " << mem.fordblks << " " << mem.keepcost << std::endl; */
|
std::cerr << f << ":"<< l << " " << mem.arena << " " << mem.ordblks << " " << mem.hblks << " " << mem.hblkhd << " " << mem.uordblks << " " << mem.fordblks << " " << mem.keepcost << std::endl;
|
||||||
std::cerr << f << ":" << l << " --------------------------" << std::endl;
|
std::cerr << f << ":" << l << " --------------------------" << std::endl;
|
||||||
malloc_stats();
|
malloc_stats();
|
||||||
std::cerr << f << ":" << l << " --------------------------" << std::endl;
|
std::cerr << f << ":" << l << " --------------------------" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(_DEBUG_) || defined(_DEBUG)
|
||||||
#define MEMOSTAT //memostat( __FILE__, __LINE__ )
|
#define MEMOSTAT //memostat( __FILE__, __LINE__ )
|
||||||
|
#else
|
||||||
|
#define MEMOSTAT
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _DEBUG_
|
#ifdef _DEBUG_
|
||||||
static int MYDEBUG = 1;
|
static int MYDEBUG = 0;
|
||||||
#else
|
#else
|
||||||
static int MYDEBUG = 0;
|
static int MYDEBUG = 0;
|
||||||
#endif
|
#endif
|
||||||
@ -886,20 +886,22 @@ bool
|
|||||||
SMESH_Client::Update(bool theIsClear)
|
SMESH_Client::Update(bool theIsClear)
|
||||||
{
|
{
|
||||||
bool anIsModified = true;
|
bool anIsModified = true;
|
||||||
if(mySMESHDSMesh){
|
if(mySMESHDSMesh)
|
||||||
MESSAGE("Update mySMESHDSMesh");
|
{
|
||||||
|
if ( MYDEBUG ) 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{
|
}
|
||||||
MESSAGE("Update CORBA");
|
else
|
||||||
|
{
|
||||||
|
if ( MYDEBUG ) 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;
|
||||||
if( MYDEBUG )
|
if ( MYDEBUG ) MESSAGE( "Update: length of the script is "<<aLength );
|
||||||
MESSAGE( "Update: length of the script is "<<aLength );
|
|
||||||
|
|
||||||
if(!anIsModified)
|
if ( !anIsModified )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// update client mesh structure by logged changes commands
|
// update client mesh structure by logged changes commands
|
||||||
|
@ -220,7 +220,6 @@ bool SMESHDS_Mesh::ChangeElementNodes(const SMDS_MeshElement * elem,
|
|||||||
const SMDS_MeshNode * nodes[],
|
const SMDS_MeshNode * nodes[],
|
||||||
const int nbnodes)
|
const int nbnodes)
|
||||||
{
|
{
|
||||||
//MESSAGE("SMESHDS_Mesh::ChangeElementNodes");
|
|
||||||
if ( ! SMDS_Mesh::ChangeElementNodes( elem, nodes, nbnodes ))
|
if ( ! SMDS_Mesh::ChangeElementNodes( elem, nodes, nbnodes ))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -978,7 +977,6 @@ void SMESHDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elt,
|
|||||||
SMESHDS_SubMesh * subMesh,
|
SMESHDS_SubMesh * subMesh,
|
||||||
bool fromGroups)
|
bool fromGroups)
|
||||||
{
|
{
|
||||||
//MESSAGE(" --------------------------------> SMESHDS_Mesh::RemoveFreeElement " << subMesh << " " << fromGroups);
|
|
||||||
if (elt->GetType() == SMDSAbs_Node) {
|
if (elt->GetType() == SMDSAbs_Node) {
|
||||||
RemoveFreeNode( static_cast<const SMDS_MeshNode*>(elt), subMesh, fromGroups);
|
RemoveFreeNode( static_cast<const SMDS_MeshNode*>(elt), subMesh, fromGroups);
|
||||||
return;
|
return;
|
||||||
@ -1345,7 +1343,6 @@ int SMESHDS_Mesh::AddCompoundSubmesh(const TopoDS_Shape& S,
|
|||||||
bool all = ( type == TopAbs_SHAPE );
|
bool all = ( type == TopAbs_SHAPE );
|
||||||
if ( all ) // corresponding simple submesh may exist
|
if ( all ) // corresponding simple submesh may exist
|
||||||
aMainIndex = -aMainIndex;
|
aMainIndex = -aMainIndex;
|
||||||
//MESSAGE("AddCompoundSubmesh index = " << aMainIndex );
|
|
||||||
SMESHDS_SubMesh * aNewSub = NewSubMesh( aMainIndex );
|
SMESHDS_SubMesh * aNewSub = NewSubMesh( aMainIndex );
|
||||||
if ( !aNewSub->IsComplexSubmesh() ) // is empty
|
if ( !aNewSub->IsComplexSubmesh() ) // is empty
|
||||||
{
|
{
|
||||||
@ -2155,7 +2152,7 @@ void SMESHDS_Mesh::compactMesh()
|
|||||||
int newNodeSize = 0;
|
int newNodeSize = 0;
|
||||||
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);
|
||||||
int nbNodeTemp = nbVtkNodes;
|
int nbNodeTemp = nbVtkNodes;
|
||||||
if (nbNodes > nbVtkNodes)
|
if (nbNodes > nbVtkNodes)
|
||||||
nbNodeTemp = nbNodes;
|
nbNodeTemp = nbNodes;
|
||||||
@ -2164,22 +2161,22 @@ void SMESHDS_Mesh::compactMesh()
|
|||||||
idNodesOldToNew.resize(nbNodeTemp, -1); // all unused id will be -1
|
idNodesOldToNew.resize(nbNodeTemp, -1); // all unused id will be -1
|
||||||
|
|
||||||
for (int i = 0; i < nbNodes; i++)
|
for (int i = 0; i < nbNodes; i++)
|
||||||
|
{
|
||||||
|
if (myNodes[i])
|
||||||
{
|
{
|
||||||
if (myNodes[i])
|
int vtkid = myNodes[i]->getVtkId();
|
||||||
{
|
idNodesOldToNew[vtkid] = i; // old vtkId --> old smdsId (valid smdsId are >= 0)
|
||||||
int vtkid = myNodes[i]->getVtkId();
|
newNodeSize++;
|
||||||
idNodesOldToNew[vtkid] = i; // old vtkId --> old smdsId (valid smdsId are >= 0)
|
|
||||||
newNodeSize++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
bool areNodesModified = (newNodeSize < nbVtkNodes);
|
bool areNodesModified = (newNodeSize < nbVtkNodes);
|
||||||
MESSAGE("------------------------- compactMesh Nodes Modified: " << areNodesModified);
|
//MESSAGE("------------------------- compactMesh Nodes Modified: " << areNodesModified);
|
||||||
areNodesModified = true;
|
areNodesModified = true;
|
||||||
|
|
||||||
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);
|
||||||
int nbCellTemp = nbVtkCells;
|
int nbCellTemp = nbVtkCells;
|
||||||
if (nbCells > nbVtkCells)
|
if (nbCells > nbVtkCells)
|
||||||
nbCellTemp = nbCells;
|
nbCellTemp = nbCells;
|
||||||
@ -2188,15 +2185,15 @@ void SMESHDS_Mesh::compactMesh()
|
|||||||
idCellsOldToNew.resize(nbCellTemp, -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++)
|
||||||
|
{
|
||||||
|
if (myCells[i])
|
||||||
{
|
{
|
||||||
if (myCells[i])
|
// //idCellsOldToNew[i] = myCellIdVtkToSmds[i]; // valid vtk indexes are > = 0
|
||||||
{
|
// int vtkid = myCells[i]->getVtkId();
|
||||||
// //idCellsOldToNew[i] = myCellIdVtkToSmds[i]; // valid vtk indexes are > = 0
|
// idCellsOldToNew[vtkid] = i; // old vtkId --> old smdsId (not used in input)
|
||||||
// int vtkid = myCells[i]->getVtkId();
|
newCellSize++;
|
||||||
// idCellsOldToNew[vtkid] = i; // old vtkId --> old smdsId (not used in input)
|
|
||||||
newCellSize++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (areNodesModified)
|
if (areNodesModified)
|
||||||
myGrid->compactGrid(idNodesOldToNew, newNodeSize, idCellsOldToNew, newCellSize);
|
myGrid->compactGrid(idNodesOldToNew, newNodeSize, idCellsOldToNew, newCellSize);
|
||||||
else
|
else
|
||||||
@ -2205,62 +2202,62 @@ void SMESHDS_Mesh::compactMesh()
|
|||||||
int nbVtkPts = myGrid->GetNumberOfPoints();
|
int nbVtkPts = myGrid->GetNumberOfPoints();
|
||||||
nbVtkCells = myGrid->GetNumberOfCells();
|
nbVtkCells = myGrid->GetNumberOfCells();
|
||||||
if (nbVtkPts != newNodeSize)
|
if (nbVtkPts != newNodeSize)
|
||||||
{
|
{
|
||||||
MESSAGE("===> nbVtkPts != newNodeSize " << nbVtkPts << " " << newNodeSize);
|
MESSAGE("===> nbVtkPts != newNodeSize " << nbVtkPts << " " << newNodeSize);
|
||||||
if (nbVtkPts > newNodeSize) newNodeSize = nbVtkPts; // several points with same SMDS Id
|
if (nbVtkPts > newNodeSize) newNodeSize = nbVtkPts; // several points with same SMDS Id
|
||||||
}
|
}
|
||||||
if (nbVtkCells != newCellSize)
|
if (nbVtkCells != newCellSize)
|
||||||
{
|
{
|
||||||
MESSAGE("===> nbVtkCells != newCellSize " << nbVtkCells << " " << newCellSize);
|
MESSAGE("===> nbVtkCells != newCellSize " << nbVtkCells << " " << newCellSize);
|
||||||
if (nbVtkCells > newCellSize) newCellSize = nbVtkCells; // several cells with same SMDS Id
|
if (nbVtkCells > newCellSize) newCellSize = nbVtkCells; // several cells with same SMDS Id
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- SMDS_MeshNode and myNodes (id in SMDS and in VTK are the same), myNodeIdFactory
|
// --- SMDS_MeshNode and myNodes (id in SMDS and in VTK are the same), myNodeIdFactory
|
||||||
|
|
||||||
if (areNodesModified)
|
if (areNodesModified)
|
||||||
|
{
|
||||||
|
//MESSAGE("-------------- modify myNodes");
|
||||||
|
SetOfNodes newNodes;
|
||||||
|
newNodes.resize(newNodeSize+1,0); // 0 not used, SMDS numbers 1..n
|
||||||
|
int newSmdsId = 0;
|
||||||
|
for (int i = 0; i < nbNodes; i++)
|
||||||
{
|
{
|
||||||
MESSAGE("-------------- modify myNodes");
|
if (myNodes[i])
|
||||||
SetOfNodes newNodes;
|
{
|
||||||
newNodes.resize(newNodeSize+1,0); // 0 not used, SMDS numbers 1..n
|
newSmdsId++; // SMDS id start to 1
|
||||||
int newSmdsId = 0;
|
int oldVtkId = myNodes[i]->getVtkId();
|
||||||
for (int i = 0; i < nbNodes; i++)
|
int newVtkId = idNodesOldToNew[oldVtkId];
|
||||||
{
|
//MESSAGE("myNodes["<< i << "] vtkId " << oldVtkId << " --> " << newVtkId);
|
||||||
if (myNodes[i])
|
myNodes[i]->setVtkId(newVtkId);
|
||||||
{
|
myNodes[i]->setId(newSmdsId);
|
||||||
newSmdsId++; // SMDS id start to 1
|
newNodes[newSmdsId] = myNodes[i];
|
||||||
int oldVtkId = myNodes[i]->getVtkId();
|
//MESSAGE("myNodes["<< i << "] --> newNodes[" << newSmdsId << "]");
|
||||||
int newVtkId = idNodesOldToNew[oldVtkId];
|
}
|
||||||
//MESSAGE("myNodes["<< i << "] vtkId " << oldVtkId << " --> " << newVtkId);
|
|
||||||
myNodes[i]->setVtkId(newVtkId);
|
|
||||||
myNodes[i]->setId(newSmdsId);
|
|
||||||
newNodes[newSmdsId] = myNodes[i];
|
|
||||||
//MESSAGE("myNodes["<< i << "] --> newNodes[" << newSmdsId << "]");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
myNodes.swap(newNodes);
|
|
||||||
this->myNodeIDFactory->emptyPool(newSmdsId); // newSmdsId = number of nodes
|
|
||||||
MESSAGE("myNodes.size " << myNodes.size());
|
|
||||||
}
|
}
|
||||||
|
myNodes.swap(newNodes);
|
||||||
|
this->myNodeIDFactory->emptyPool(newSmdsId); // newSmdsId = number of nodes
|
||||||
|
//MESSAGE("myNodes.size " << myNodes.size());
|
||||||
|
}
|
||||||
|
|
||||||
// --- SMDS_MeshCell, myCellIdVtkToSmds, myCellIdSmdsToVtk, myCells
|
// --- SMDS_MeshCell, myCellIdVtkToSmds, myCellIdSmdsToVtk, myCells
|
||||||
|
|
||||||
int vtkIndexSize = myCellIdVtkToSmds.size();
|
int vtkIndexSize = myCellIdVtkToSmds.size();
|
||||||
int maxVtkId = -1;
|
int maxVtkId = -1;
|
||||||
for (int oldVtkId = 0; oldVtkId < vtkIndexSize; oldVtkId++)
|
for (int oldVtkId = 0; oldVtkId < vtkIndexSize; oldVtkId++)
|
||||||
|
{
|
||||||
|
int oldSmdsId = this->myCellIdVtkToSmds[oldVtkId];
|
||||||
|
if (oldSmdsId > 0)
|
||||||
{
|
{
|
||||||
int oldSmdsId = this->myCellIdVtkToSmds[oldVtkId];
|
int newVtkId = idCellsOldToNew[oldVtkId];
|
||||||
if (oldSmdsId > 0)
|
if (newVtkId > maxVtkId)
|
||||||
{
|
maxVtkId = newVtkId;
|
||||||
int newVtkId = idCellsOldToNew[oldVtkId];
|
//MESSAGE("myCells["<< oldSmdsId << "] vtkId " << oldVtkId << " --> " << newVtkId);
|
||||||
if (newVtkId > maxVtkId)
|
myCells[oldSmdsId]->setVtkId(newVtkId);
|
||||||
maxVtkId = newVtkId;
|
|
||||||
//MESSAGE("myCells["<< oldSmdsId << "] vtkId " << oldVtkId << " --> " << newVtkId);
|
|
||||||
myCells[oldSmdsId]->setVtkId(newVtkId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// MESSAGE("myCells.size()=" << myCells.size()
|
}
|
||||||
// << " myCellIdSmdsToVtk.size()=" << myCellIdSmdsToVtk.size()
|
// MESSAGE("myCells.size()=" << myCells.size()
|
||||||
// << " myCellIdVtkToSmds.size()=" << myCellIdVtkToSmds.size() );
|
// << " myCellIdSmdsToVtk.size()=" << myCellIdSmdsToVtk.size()
|
||||||
|
// << " myCellIdVtkToSmds.size()=" << myCellIdVtkToSmds.size() );
|
||||||
|
|
||||||
SetOfCells newCells;
|
SetOfCells newCells;
|
||||||
//vector<int> newSmdsToVtk;
|
//vector<int> newSmdsToVtk;
|
||||||
@ -2292,8 +2289,7 @@ void SMESHDS_Mesh::compactMesh()
|
|||||||
myCells.swap(newCells);
|
myCells.swap(newCells);
|
||||||
//myCellIdSmdsToVtk.swap(newSmdsToVtk);
|
//myCellIdSmdsToVtk.swap(newSmdsToVtk);
|
||||||
myCellIdVtkToSmds.swap(newVtkToSmds);
|
myCellIdVtkToSmds.swap(newVtkToSmds);
|
||||||
MESSAGE("myCells.size()=" << myCells.size()
|
//MESSAGE("myCells.size()="<< myCells.size()<<" myCellIdVtkToSmds.size()="<<myCellIdVtkToSmds.size() );
|
||||||
<< " myCellIdVtkToSmds.size()=" << myCellIdVtkToSmds.size() );
|
|
||||||
this->myElementIDFactory->emptyPool(newSmdsId);
|
this->myElementIDFactory->emptyPool(newSmdsId);
|
||||||
|
|
||||||
this->myScript->SetModified(true); // notify GUI client for buildPrs when update
|
this->myScript->SetModified(true); // notify GUI client for buildPrs when update
|
||||||
|
@ -299,10 +299,10 @@ public:
|
|||||||
|
|
||||||
template<typename VALUE> class MyIterator : public SMDS_Iterator<VALUE>
|
template<typename VALUE> class MyIterator : public SMDS_Iterator<VALUE>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyIterator (const set<const SMESHDS_SubMesh*>& theSubMeshes)
|
MyIterator (const set<const SMESHDS_SubMesh*>& theSubMeshes)
|
||||||
: myMore(false), mySubIt( theSubMeshes.begin() ), mySubEnd( theSubMeshes.end() )
|
: myMore(false), mySubIt( theSubMeshes.begin() ), mySubEnd( theSubMeshes.end() )
|
||||||
{}
|
{}
|
||||||
bool more()
|
bool more()
|
||||||
{
|
{
|
||||||
while (( !myElemIt.get() || !myElemIt->more() ) && mySubIt != mySubEnd)
|
while (( !myElemIt.get() || !myElemIt->more() ) && mySubIt != mySubEnd)
|
||||||
@ -320,11 +320,11 @@ template<typename VALUE> class MyIterator : public SMDS_Iterator<VALUE>
|
|||||||
elem = myElemIt->next();
|
elem = myElemIt->next();
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
virtual boost::shared_ptr< SMDS_Iterator<VALUE> >
|
virtual boost::shared_ptr< SMDS_Iterator<VALUE> >
|
||||||
getElements(const SMESHDS_SubMesh*) const = 0;
|
getElements(const SMESHDS_SubMesh*) const = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool myMore;
|
bool myMore;
|
||||||
set<const SMESHDS_SubMesh*>::const_iterator mySubIt, mySubEnd;
|
set<const SMESHDS_SubMesh*>::const_iterator mySubIt, mySubEnd;
|
||||||
boost::shared_ptr< SMDS_Iterator<VALUE> > myElemIt;
|
boost::shared_ptr< SMDS_Iterator<VALUE> > myElemIt;
|
||||||
@ -336,7 +336,7 @@ template<typename VALUE> class MyIterator : public SMDS_Iterator<VALUE>
|
|||||||
|
|
||||||
class MyElemIterator: public MyIterator<const SMDS_MeshElement*>
|
class MyElemIterator: public MyIterator<const SMDS_MeshElement*>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyElemIterator (const set<const SMESHDS_SubMesh*>& theSubMeshes)
|
MyElemIterator (const set<const SMESHDS_SubMesh*>& theSubMeshes)
|
||||||
:MyIterator<const SMDS_MeshElement*>( theSubMeshes ) {}
|
:MyIterator<const SMDS_MeshElement*>( theSubMeshes ) {}
|
||||||
SMDS_ElemIteratorPtr getElements(const SMESHDS_SubMesh* theSubMesh) const
|
SMDS_ElemIteratorPtr getElements(const SMESHDS_SubMesh* theSubMesh) const
|
||||||
@ -349,7 +349,7 @@ class MyElemIterator: public MyIterator<const SMDS_MeshElement*>
|
|||||||
|
|
||||||
class MyNodeIterator: public MyIterator<const SMDS_MeshNode*>
|
class MyNodeIterator: public MyIterator<const SMDS_MeshNode*>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyNodeIterator (const set<const SMESHDS_SubMesh*>& theSubMeshes)
|
MyNodeIterator (const set<const SMESHDS_SubMesh*>& theSubMeshes)
|
||||||
:MyIterator<const SMDS_MeshNode*>( theSubMeshes ) {}
|
:MyIterator<const SMDS_MeshNode*>( theSubMeshes ) {}
|
||||||
SMDS_NodeIteratorPtr getElements(const SMESHDS_SubMesh* theSubMesh) const
|
SMDS_NodeIteratorPtr getElements(const SMESHDS_SubMesh* theSubMesh) const
|
||||||
@ -365,7 +365,9 @@ SMDS_ElemIteratorPtr SMESHDS_SubMesh::GetElements() const
|
|||||||
{
|
{
|
||||||
if ( IsComplexSubmesh() )
|
if ( IsComplexSubmesh() )
|
||||||
return SMDS_ElemIteratorPtr( new MyElemIterator( mySubMeshes ));
|
return SMDS_ElemIteratorPtr( new MyElemIterator( mySubMeshes ));
|
||||||
return SMDS_ElemIteratorPtr(new MySetIterator<const SMDS_MeshElement*, std::vector<const SMDS_MeshElement*> >(myElements));
|
|
||||||
|
return SMDS_ElemIteratorPtr
|
||||||
|
(new MySetIterator<const SMDS_MeshElement*, std::vector<const SMDS_MeshElement*> >(myElements));
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -378,7 +380,8 @@ SMDS_NodeIteratorPtr SMESHDS_SubMesh::GetNodes() const
|
|||||||
if ( IsComplexSubmesh() )
|
if ( IsComplexSubmesh() )
|
||||||
return SMDS_NodeIteratorPtr( new MyNodeIterator( mySubMeshes ));
|
return SMDS_NodeIteratorPtr( new MyNodeIterator( mySubMeshes ));
|
||||||
|
|
||||||
return SMDS_NodeIteratorPtr(new MySetIterator<const SMDS_MeshNode*, std::vector<const SMDS_MeshNode*> >(myNodes));
|
return SMDS_NodeIteratorPtr
|
||||||
|
(new MySetIterator<const SMDS_MeshNode*, std::vector<const SMDS_MeshNode*> >(myNodes));
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -503,6 +506,24 @@ SMESHDS_SubMeshIteratorPtr SMESHDS_SubMesh::GetSubMeshIterator() const
|
|||||||
|
|
||||||
void SMESHDS_SubMesh::Clear()
|
void SMESHDS_SubMesh::Clear()
|
||||||
{
|
{
|
||||||
|
if ( myParent && myParent->NbNodes() > 0 )
|
||||||
|
{
|
||||||
|
for ( size_t i = 0; i < myElements.size(); ++i )
|
||||||
|
{
|
||||||
|
if ( myElements[i] &&
|
||||||
|
myElements[i]->GetID() > 0 &&
|
||||||
|
myElements[i] == myParent->FindElement( myElements[i]->GetID() )) // not deleted
|
||||||
|
const_cast< SMDS_MeshElement* >( myElements[i] )->setShapeId( 0 );
|
||||||
|
}
|
||||||
|
for ( size_t i = 0; i < myNodes.size(); ++i )
|
||||||
|
{
|
||||||
|
if ( myNodes[i] &&
|
||||||
|
myNodes[i]->GetID() > 0 &&
|
||||||
|
myNodes[i] == myParent->FindNode( myNodes[i]->GetID() )) // not deleted
|
||||||
|
const_cast< SMDS_MeshNode* >( myNodes[i] )->setShapeId( 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
clearVector( myElements );
|
clearVector( myElements );
|
||||||
clearVector( myNodes );
|
clearVector( myNodes );
|
||||||
myUnusedIdNodes = 0;
|
myUnusedIdNodes = 0;
|
||||||
@ -530,12 +551,12 @@ void SMESHDS_SubMesh::compactList()
|
|||||||
{
|
{
|
||||||
std::vector<const SMDS_MeshElement*> newElems;
|
std::vector<const SMDS_MeshElement*> newElems;
|
||||||
newElems.reserve( myElements.size() - myUnusedIdElements );
|
newElems.reserve( myElements.size() - myUnusedIdElements );
|
||||||
for (size_t i = 0; i < myElements.size(); i++)
|
for ( size_t i = 0; i < myElements.size(); i++)
|
||||||
if (myElements[i])
|
if ( myElements[i] )
|
||||||
{
|
{
|
||||||
SMDS_MeshElement* elem = (SMDS_MeshElement*)myElements[i];
|
SMDS_MeshElement* elem = (SMDS_MeshElement*)myElements[i];
|
||||||
elem->setIdInShape(newElems.size());
|
elem->setIdInShape( newElems.size() );
|
||||||
newElems.push_back(elem);
|
newElems.push_back( elem );
|
||||||
}
|
}
|
||||||
myElements.swap(newElems);
|
myElements.swap(newElems);
|
||||||
myUnusedIdElements = 0;
|
myUnusedIdElements = 0;
|
||||||
@ -545,12 +566,12 @@ void SMESHDS_SubMesh::compactList()
|
|||||||
{
|
{
|
||||||
std::vector<const SMDS_MeshNode*> newNodes;
|
std::vector<const SMDS_MeshNode*> newNodes;
|
||||||
newNodes.reserve( myNodes.size() - myUnusedIdNodes );
|
newNodes.reserve( myNodes.size() - myUnusedIdNodes );
|
||||||
for (size_t i = 0; i < myNodes.size(); i++)
|
for ( size_t i = 0; i < myNodes.size(); i++ )
|
||||||
if (myNodes[i])
|
if ( myNodes[i] )
|
||||||
{
|
{
|
||||||
SMDS_MeshNode* node = (SMDS_MeshNode*)myNodes[i];
|
SMDS_MeshNode* node = (SMDS_MeshNode*)myNodes[i];
|
||||||
node->setIdInShape(newNodes.size());
|
node->setIdInShape( newNodes.size() );
|
||||||
newNodes.push_back(node);
|
newNodes.push_back( node );
|
||||||
}
|
}
|
||||||
myNodes.swap(newNodes);
|
myNodes.swap(newNodes);
|
||||||
myUnusedIdNodes = 0;
|
myUnusedIdNodes = 0;
|
||||||
|
@ -608,7 +608,7 @@ namespace
|
|||||||
// Get parameters of export operation
|
// Get parameters of export operation
|
||||||
|
|
||||||
QString aFilename;
|
QString aFilename;
|
||||||
SMESH::MED_VERSION aFormat;
|
SMESH::MED_VERSION aFormat = SMESH::MED_V2_2;
|
||||||
// Init the parameters with the default values
|
// Init the parameters with the default values
|
||||||
bool aIsASCII_STL = true;
|
bool aIsASCII_STL = true;
|
||||||
bool toCreateGroups = false;
|
bool toCreateGroups = false;
|
||||||
@ -1649,19 +1649,17 @@ namespace
|
|||||||
if(!anIO.IsNull()){
|
if(!anIO.IsNull()){
|
||||||
_PTR(SObject) SO = aStudy->FindObjectID( It.Value()->getEntry() );
|
_PTR(SObject) SO = aStudy->FindObjectID( It.Value()->getEntry() );
|
||||||
if ( SO ) {
|
if ( SO ) {
|
||||||
CORBA::Object_var aObject = SMESH::SObjectToObject( SO );
|
CORBA::Object_var aObject = SMESH::SObjectToObject( SO );
|
||||||
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( aObject );
|
SMESH::SMESH_IDSource_var anIDSrc = SMESH::SMESH_IDSource::_narrow( aObject );
|
||||||
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( aObject );
|
if ( !anIDSrc->_is_nil() ) {
|
||||||
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( aObject );
|
if ( SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry()) ) {
|
||||||
if ( !aMesh->_is_nil() || !aSubMesh->_is_nil() || !aGroup->_is_nil() ) {
|
QString functorName = functorToString( anActor->GetFunctor() );
|
||||||
if ( SMESH_Actor *anActor = SMESH::FindActorByEntry(anIO->getEntry()) ) {
|
anActor->SetControlMode( aControl );
|
||||||
anActor->SetControlMode(aControl);
|
anActor->GetScalarBarActor()->SetTitle( functorName.toLatin1().constData() );
|
||||||
anActor->GetScalarBarActor()->SetTitle( functorToString( anActor->GetFunctor() ).toLatin1().constData() );
|
|
||||||
SMESH::RepaintCurrentView();
|
SMESH::RepaintCurrentView();
|
||||||
#ifndef DISABLE_PLOT2DVIEWER
|
#ifndef DISABLE_PLOT2DVIEWER
|
||||||
if ( anActor->GetPlot2Histogram() ) {
|
if ( anActor->GetPlot2Histogram() ) {
|
||||||
SPlot2d_Histogram* aHistogram = anActor->UpdatePlot2Histogram();
|
SPlot2d_Histogram* aHistogram = anActor->UpdatePlot2Histogram();
|
||||||
QString functorName = functorToString( anActor->GetFunctor() );
|
|
||||||
QString aHistogramName("%1 : %2");
|
QString aHistogramName("%1 : %2");
|
||||||
aHistogramName = aHistogramName.arg( anIO->getName() ).arg( functorName );
|
aHistogramName = aHistogramName.arg( anIO->getName() ).arg( functorName );
|
||||||
aHistogram->setName( aHistogramName );
|
aHistogram->setName( aHistogramName );
|
||||||
@ -1956,7 +1954,7 @@ SalomeApp_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);
|
//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);
|
||||||
@ -2596,6 +2594,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
case SMESHOp::OpShow:
|
case SMESHOp::OpShow:
|
||||||
case SMESHOp::OpShowOnly:
|
case SMESHOp::OpShowOnly:
|
||||||
{
|
{
|
||||||
|
SUIT_OverrideCursor wc;
|
||||||
SMESH::EDisplaing anAction;
|
SMESH::EDisplaing anAction;
|
||||||
switch (theCommandID) {
|
switch (theCommandID) {
|
||||||
case SMESHOp::OpHide: anAction = SMESH::eErase; break;
|
case SMESHOp::OpHide: anAction = SMESH::eErase; break;
|
||||||
@ -2610,7 +2609,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
|
|
||||||
if ( theCommandID==SMESHOp::OpShowOnly )
|
if ( theCommandID==SMESHOp::OpShowOnly )
|
||||||
{
|
{
|
||||||
MESSAGE("anAction = SMESH::eDisplayOnly");
|
//MESSAGE("anAction = SMESH::eDisplayOnly");
|
||||||
startOperation( myEraseAll );
|
startOperation( myEraseAll );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2639,7 +2638,6 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
|
|
||||||
// PAL13338 + PAL15161 -->
|
// PAL13338 + PAL15161 -->
|
||||||
if ( ( theCommandID==SMESHOp::OpShow || theCommandID==SMESHOp::OpShowOnly ) && !checkLock(aStudy)) {
|
if ( ( theCommandID==SMESHOp::OpShow || theCommandID==SMESHOp::OpShowOnly ) && !checkLock(aStudy)) {
|
||||||
MESSAGE("anAction = SMESH::eDisplayOnly");
|
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged();
|
SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged();
|
||||||
}
|
}
|
||||||
@ -2650,7 +2648,6 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (anAction == SMESH::eErase) {
|
if (anAction == SMESH::eErase) {
|
||||||
MESSAGE("anAction == SMESH::eErase");
|
|
||||||
SALOME_ListIO l1;
|
SALOME_ListIO l1;
|
||||||
aSel->setSelectedObjects( l1 );
|
aSel->setSelectedObjects( l1 );
|
||||||
}
|
}
|
||||||
@ -2670,9 +2667,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
( new SMESHGUI_NodesDlg( this ) )->show();
|
( new SMESHGUI_NodesDlg( this ) )->show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SUIT_MessageBox::warning(desktop(),
|
SUIT_MessageBox::warning(desktop(),tr("SMESH_WRN_WARNING"),tr("SMESH_WRN_VIEWER_VTK"));
|
||||||
tr("SMESH_WRN_WARNING"),
|
|
||||||
tr("SMESH_WRN_VIEWER_VTK"));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2706,8 +2701,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
{
|
{
|
||||||
if ( !vtkwnd )
|
if ( !vtkwnd )
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
|
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), tr( "NOT_A_VTK_VIEWER" ) );
|
||||||
tr( "NOT_A_VTK_VIEWER" ) );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2737,8 +2731,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
{
|
{
|
||||||
if ( !vtkwnd )
|
if ( !vtkwnd )
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
|
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), tr( "NOT_A_VTK_VIEWER" ) );
|
||||||
tr( "NOT_A_VTK_VIEWER" ) );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2767,8 +2760,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
( new SMESHGUI_SmoothingDlg( this ) )->show();
|
( new SMESHGUI_SmoothingDlg( this ) )->show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SUIT_MessageBox::warning(desktop(),
|
SUIT_MessageBox::warning(desktop(), tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
|
||||||
tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2779,8 +2771,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
EmitSignalDeactivateDialog();
|
EmitSignalDeactivateDialog();
|
||||||
( new SMESHGUI_ExtrusionDlg ( this ) )->show();
|
( new SMESHGUI_ExtrusionDlg ( this ) )->show();
|
||||||
} else {
|
} else {
|
||||||
SUIT_MessageBox::warning(desktop(),
|
SUIT_MessageBox::warning(desktop(),tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
|
||||||
tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2791,8 +2782,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
EmitSignalDeactivateDialog();
|
EmitSignalDeactivateDialog();
|
||||||
( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show();
|
( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show();
|
||||||
} else {
|
} else {
|
||||||
SUIT_MessageBox::warning(desktop(),
|
SUIT_MessageBox::warning(desktop(),tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
|
||||||
tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2804,8 +2794,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
( new SMESHGUI_RevolutionDlg( this ) )->show();
|
( new SMESHGUI_RevolutionDlg( this ) )->show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SUIT_MessageBox::warning(desktop(),
|
SUIT_MessageBox::warning(desktop(),tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
|
||||||
tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2819,8 +2808,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
( new SMESHGUI_MeshPatternDlg( this ) )->show();
|
( new SMESHGUI_MeshPatternDlg( this ) )->show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SUIT_MessageBox::warning(desktop(),
|
SUIT_MessageBox::warning(desktop(),tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
|
||||||
tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2837,8 +2825,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
{
|
{
|
||||||
if ( !vtkwnd )
|
if ( !vtkwnd )
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
|
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),tr( "NOT_A_VTK_VIEWER" ) );
|
||||||
tr( "NOT_A_VTK_VIEWER" ) );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2865,8 +2852,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
{
|
{
|
||||||
if ( !vtkwnd )
|
if ( !vtkwnd )
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
|
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),tr( "NOT_A_VTK_VIEWER" ) );
|
||||||
tr( "NOT_A_VTK_VIEWER" ) );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2943,8 +2929,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
{
|
{
|
||||||
if ( !vtkwnd )
|
if ( !vtkwnd )
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
|
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),tr( "NOT_A_VTK_VIEWER" ) );
|
||||||
tr( "NOT_A_VTK_VIEWER" ) );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3000,8 +2985,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
{
|
{
|
||||||
if ( !vtkwnd )
|
if ( !vtkwnd )
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
|
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),tr( "NOT_A_VTK_VIEWER" ) );
|
||||||
tr( "NOT_A_VTK_VIEWER" ) );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3041,8 +3025,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
{
|
{
|
||||||
if ( !vtkwnd )
|
if ( !vtkwnd )
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
|
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),tr( "NOT_A_VTK_VIEWER" ) );
|
||||||
tr( "NOT_A_VTK_VIEWER" ) );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3080,8 +3063,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
{
|
{
|
||||||
if ( !vtkwnd )
|
if ( !vtkwnd )
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
|
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),tr( "NOT_A_VTK_VIEWER" ) );
|
||||||
tr( "NOT_A_VTK_VIEWER" ) );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3223,8 +3205,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
( new SMESHGUI_AddMeshElementDlg( this, type ) )->show();
|
( new SMESHGUI_AddMeshElementDlg( this, type ) )->show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SUIT_MessageBox::warning(desktop(),
|
SUIT_MessageBox::warning(desktop(),tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
|
||||||
tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3236,8 +3217,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show();
|
( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SUIT_MessageBox::warning(SMESHGUI::desktop(),
|
SUIT_MessageBox::warning(desktop(),tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
|
||||||
tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -6067,6 +6047,12 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
TPlaneData aPlaneData;
|
TPlaneData aPlaneData;
|
||||||
|
aPlaneData.AbsoluteOrientation = false;
|
||||||
|
aPlaneData.RelativeOrientation = 0;
|
||||||
|
aPlaneData.Distance = aPlaneData.Angle[0] = aPlaneData.Angle[1] = 0;
|
||||||
|
aPlaneData.X = aPlaneData.Y = aPlaneData.Z = 0;
|
||||||
|
aPlaneData.Dx = aPlaneData.Dy = aPlaneData.Dz = 0;
|
||||||
|
|
||||||
aPlaneData.Id = aClippingPlaneId;
|
aPlaneData.Id = aClippingPlaneId;
|
||||||
|
|
||||||
ok = false;
|
ok = false;
|
||||||
|
@ -537,7 +537,7 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
|
|||||||
myNbMidFaceNodes = 0;
|
myNbMidFaceNodes = 0;
|
||||||
myNbCenterNodes = 0;
|
myNbCenterNodes = 0;
|
||||||
|
|
||||||
int aNumRows;
|
int aNumRows = 0;
|
||||||
|
|
||||||
switch (myGeomType) {
|
switch (myGeomType) {
|
||||||
case SMDSEntity_Quad_Edge:
|
case SMDSEntity_Quad_Edge:
|
||||||
@ -768,7 +768,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SMESH::ElementType anElementType;
|
SMESH::ElementType anElementType = SMESH::ALL;
|
||||||
long anElemId = -1, nbElemsBefore = 0;
|
long anElemId = -1, nbElemsBefore = 0;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
switch (myGeomType) {
|
switch (myGeomType) {
|
||||||
@ -1055,7 +1055,7 @@ void SMESHGUI_AddQuadraticElementDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
// process groups
|
// process groups
|
||||||
if ( !myMesh->_is_nil() && myEntry != aCurrentEntry ) {
|
if ( !myMesh->_is_nil() && myEntry != aCurrentEntry ) {
|
||||||
SMESH::ElementType anElementType;
|
SMESH::ElementType anElementType = SMESH::ALL;
|
||||||
switch ( myGeomType ) {
|
switch ( myGeomType ) {
|
||||||
case SMDSEntity_Quad_Edge:
|
case SMDSEntity_Quad_Edge:
|
||||||
anElementType = SMESH::EDGE; break;
|
anElementType = SMESH::EDGE; break;
|
||||||
@ -1371,8 +1371,8 @@ void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity )
|
|||||||
for ( int row = 0; row < myTable->rowCount(); row++ )
|
for ( int row = 0; row < myTable->rowCount(); row++ )
|
||||||
myTable->item( row, 1 )->setText("");
|
myTable->item( row, 1 )->setText("");
|
||||||
|
|
||||||
int* aFirstColIds;
|
int* aFirstColIds = 0;
|
||||||
int* aLastColIds;
|
int* aLastColIds = 0;
|
||||||
|
|
||||||
switch (myGeomType) {
|
switch (myGeomType) {
|
||||||
case SMDSEntity_Quad_Edge:
|
case SMDSEntity_Quad_Edge:
|
||||||
|
@ -766,7 +766,7 @@ bool SMESHGUI_ClippingDlg::AddPlane ( SMESH::TActorList theActorList,
|
|||||||
double aDir[2][3] = {{0, 0, 0}, {0, 0, 0}};
|
double aDir[2][3] = {{0, 0, 0}, {0, 0, 0}};
|
||||||
static double aCoeff = vtkMath::Pi()/180.0;
|
static double aCoeff = vtkMath::Pi()/180.0;
|
||||||
|
|
||||||
int anOrientation;
|
int anOrientation = 0;
|
||||||
if ( thePlane->PlaneMode == SMESH::Absolute )
|
if ( thePlane->PlaneMode == SMESH::Absolute )
|
||||||
anOrientation = thePlane->myAbsoluteOrientation;
|
anOrientation = thePlane->myAbsoluteOrientation;
|
||||||
else if ( thePlane->PlaneMode == SMESH::Relative )
|
else if ( thePlane->PlaneMode == SMESH::Relative )
|
||||||
@ -1436,7 +1436,7 @@ void SMESHGUI_ClippingDlg::SetCurrentPlaneParam()
|
|||||||
static double aCoeff = vtkMath::Pi()/180.0;
|
static double aCoeff = vtkMath::Pi()/180.0;
|
||||||
|
|
||||||
double aRot[2] = { getRotation1(), getRotation2() };
|
double aRot[2] = { getRotation1(), getRotation2() };
|
||||||
int anOrient;
|
int anOrient = 0;
|
||||||
if ( aPlane->PlaneMode == SMESH::Absolute )
|
if ( aPlane->PlaneMode == SMESH::Absolute )
|
||||||
anOrient = CBAbsoluteOrientation->currentIndex();
|
anOrient = CBAbsoluteOrientation->currentIndex();
|
||||||
else if ( aPlane->PlaneMode == SMESH::Relative )
|
else if ( aPlane->PlaneMode == SMESH::Relative )
|
||||||
@ -1623,8 +1623,8 @@ void SMESHGUI_ClippingDlg::absolutePlaneToRelative ( double theOrigin[3], double
|
|||||||
double eps = 0.0001;
|
double eps = 0.0001;
|
||||||
|
|
||||||
int anOrientation = CBRelativeOrientation->currentIndex();
|
int anOrientation = CBRelativeOrientation->currentIndex();
|
||||||
double aDirection[3];
|
double aDirection[3] = { 0.,0.,0. };
|
||||||
double aRotation1, aRotation2;
|
double aRotation1 = 0, aRotation2 = 0;
|
||||||
switch( anOrientation ) {
|
switch( anOrientation ) {
|
||||||
case 0:
|
case 0:
|
||||||
aDirection[0] = theDir[0] + eps;
|
aDirection[0] = theDir[0] + eps;
|
||||||
|
@ -943,7 +943,9 @@ void SMESHGUI_BaseComputeOp::computeMesh()
|
|||||||
if ( !smSObj ) continue;
|
if ( !smSObj ) continue;
|
||||||
SMESH::SMESH_IDSource_var aSubMeshObj =
|
SMESH::SMESH_IDSource_var aSubMeshObj =
|
||||||
SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( smSObj );
|
SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( smSObj );
|
||||||
aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aSubMeshObj, smSObj ));
|
SMESH_Actor *anActor = SMESH::FindActorByObject( aSubMeshObj );
|
||||||
|
if ( anActor && anActor->GetVisibility() )
|
||||||
|
aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aSubMeshObj, smSObj ));
|
||||||
}
|
}
|
||||||
// put Groups into list
|
// put Groups into list
|
||||||
SMESH::ListOfGroups_var aGroups = myMesh->GetGroups();
|
SMESH::ListOfGroups_var aGroups = myMesh->GetGroups();
|
||||||
@ -959,7 +961,9 @@ void SMESHGUI_BaseComputeOp::computeMesh()
|
|||||||
if ( !aGroupSO ) continue;
|
if ( !aGroupSO ) continue;
|
||||||
SMESH::SMESH_IDSource_var aGroupObj =
|
SMESH::SMESH_IDSource_var aGroupObj =
|
||||||
SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aGroupSO );
|
SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aGroupSO );
|
||||||
aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aGroupObj, aGroupSO ));
|
SMESH_Actor *anActor = SMESH::FindActorByObject( aGroupObj );
|
||||||
|
if ( anActor && anActor->GetVisibility() )
|
||||||
|
aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aGroupObj, aGroupSO ));
|
||||||
}
|
}
|
||||||
|
|
||||||
// update mesh, sub-mesh and groups, if it's possible
|
// update mesh, sub-mesh and groups, if it's possible
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include <SUIT_Session.h>
|
#include <SUIT_Session.h>
|
||||||
#include <SUIT_MessageBox.h>
|
#include <SUIT_MessageBox.h>
|
||||||
#include <SUIT_ResourceMgr.h>
|
#include <SUIT_ResourceMgr.h>
|
||||||
|
#include <SUIT_OverrideCursor.h>
|
||||||
|
|
||||||
#include <SalomeApp_Study.h>
|
#include <SalomeApp_Study.h>
|
||||||
#include <LightApp_Application.h>
|
#include <LightApp_Application.h>
|
||||||
@ -205,6 +206,8 @@ bool SMESHGUI_DeleteGroupDlg::onApply()
|
|||||||
if (!isValid())
|
if (!isValid())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
SUIT_OverrideCursor wc;
|
||||||
|
|
||||||
myBlockSelection = true;
|
myBlockSelection = true;
|
||||||
|
|
||||||
QList<SMESH::SMESH_GroupBase_var>::iterator anIter;
|
QList<SMESH::SMESH_GroupBase_var>::iterator anIter;
|
||||||
|
@ -936,7 +936,7 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
QStringList anEntryList;
|
QStringList anEntryList;
|
||||||
|
|
||||||
SMESH::SMESH_GroupBase_var resultGroup;
|
SMESH::SMESH_GroupBase_var resultGroup;
|
||||||
bool isCreation, isConversion = false;
|
bool isCreation = false, isConversion = false;
|
||||||
|
|
||||||
SUIT_OverrideCursor wc;
|
SUIT_OverrideCursor wc;
|
||||||
|
|
||||||
|
@ -378,7 +378,7 @@ namespace SMESH
|
|||||||
return false;
|
return false;
|
||||||
if ( algoData->BasicHypos.contains( hypType ))
|
if ( algoData->BasicHypos.contains( hypType ))
|
||||||
return true;
|
return true;
|
||||||
if ( algoData->OptionalHypos.contains( hypType)) {
|
if ( algoData->OptionalHypos.contains( hypType )) {
|
||||||
isAuxiliary = true;
|
isAuxiliary = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1227,7 +1227,7 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
|||||||
int shapeID = pos->shapeID;
|
int shapeID = pos->shapeID;
|
||||||
if ( shapeID > 0 ) {
|
if ( shapeID > 0 ) {
|
||||||
QString shapeType;
|
QString shapeType;
|
||||||
double u, v;
|
double u = 0, v = 0;
|
||||||
switch ( pos->shapeType ) {
|
switch ( pos->shapeType ) {
|
||||||
case GEOM::EDGE:
|
case GEOM::EDGE:
|
||||||
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" );
|
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" );
|
||||||
@ -1751,7 +1751,7 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
|
|||||||
int shapeID = pos->shapeID;
|
int shapeID = pos->shapeID;
|
||||||
if ( shapeID > 0 ) {
|
if ( shapeID > 0 ) {
|
||||||
QString shapeType;
|
QString shapeType;
|
||||||
double u, v;
|
double u = 0, v = 0;
|
||||||
switch ( pos->shapeType ) {
|
switch ( pos->shapeType ) {
|
||||||
case GEOM::EDGE:
|
case GEOM::EDGE:
|
||||||
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" );
|
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" );
|
||||||
|
@ -1308,7 +1308,7 @@ bool SMESHGUI_SewingDlg::ClickOnApply()
|
|||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
|
|
||||||
int aConstructorId = GetConstructorId();
|
int aConstructorId = GetConstructorId();
|
||||||
SMESH::SMESH_MeshEditor::Sew_Error anError;
|
SMESH::SMESH_MeshEditor::Sew_Error anError = SMESH::SMESH_MeshEditor::SEW_OK;
|
||||||
|
|
||||||
if (aConstructorId == 0)
|
if (aConstructorId == 0)
|
||||||
{
|
{
|
||||||
@ -1954,11 +1954,15 @@ void SMESHGUI_SewingDlg::BorderGroupDisplayer::getPartEnds( int p
|
|||||||
|
|
||||||
ids.push_back( aBRD.nodeIDs[ aPART.node1 ]);
|
ids.push_back( aBRD.nodeIDs[ aPART.node1 ]);
|
||||||
ids.push_back( aBRD.nodeIDs[ aPART.nodeLast ]);
|
ids.push_back( aBRD.nodeIDs[ aPART.nodeLast ]);
|
||||||
|
if ( aPART.node1 == aPART.nodeLast )
|
||||||
|
ids.push_back( aBRD.nodeIDs[ aPART.node2 ]);
|
||||||
|
|
||||||
SMDS_Mesh* mesh = myPartActors[ partIndex ]->GetObject()->GetMesh();
|
SMDS_Mesh* mesh = myPartActors[ partIndex ]->GetObject()->GetMesh();
|
||||||
|
|
||||||
coords.push_back( SMESH_TNodeXYZ( mesh->FindNode( aPART.node1+1 )));
|
coords.push_back( SMESH_TNodeXYZ( mesh->FindNode( aPART.node1+1 )));
|
||||||
coords.push_back( SMESH_TNodeXYZ( mesh->FindNode( aPART.nodeLast+1 )));
|
coords.push_back( SMESH_TNodeXYZ( mesh->FindNode( aPART.nodeLast+1 )));
|
||||||
|
if ( aPART.node1 == aPART.nodeLast )
|
||||||
|
coords.push_back( SMESH_TNodeXYZ( mesh->FindNode( aPART.node2+1 )));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SMESHGUI_SewingDlg::BorderGroupDisplayer::Update()
|
void SMESHGUI_SewingDlg::BorderGroupDisplayer::Update()
|
||||||
|
@ -854,7 +854,7 @@ namespace SMESH
|
|||||||
|
|
||||||
bool Update(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
|
bool Update(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
|
||||||
{
|
{
|
||||||
MESSAGE("Update");
|
//MESSAGE("Update");
|
||||||
_PTR(Study) aStudy = GetActiveStudyDocument();
|
_PTR(Study) aStudy = GetActiveStudyDocument();
|
||||||
CORBA::Long anId = aStudy->StudyId();
|
CORBA::Long anId = aStudy->StudyId();
|
||||||
if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry())) {
|
if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry())) {
|
||||||
@ -867,7 +867,7 @@ namespace SMESH
|
|||||||
|
|
||||||
bool UpdateNulData(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
|
bool UpdateNulData(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
|
||||||
{
|
{
|
||||||
MESSAGE("UpdateNulData");
|
//MESSAGE("UpdateNulData");
|
||||||
_PTR(Study) aStudy = GetActiveStudyDocument();
|
_PTR(Study) aStudy = GetActiveStudyDocument();
|
||||||
CORBA::Long anId = aStudy->StudyId();
|
CORBA::Long anId = aStudy->StudyId();
|
||||||
if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry(), true)) {
|
if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry(), true)) {
|
||||||
@ -878,7 +878,8 @@ namespace SMESH
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateSelectionProp( SMESHGUI* theModule ) {
|
void UpdateSelectionProp( SMESHGUI* theModule )
|
||||||
|
{
|
||||||
if( !theModule )
|
if( !theModule )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -905,25 +906,29 @@ namespace SMESH
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor aHiColor = mgr->colorValue( "SMESH", "selection_object_color", Qt::white ),
|
QColor
|
||||||
aSelColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow ),
|
aHiColor = mgr->colorValue( "SMESH", "selection_object_color", Qt::white ),
|
||||||
aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
|
aSelColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow ),
|
||||||
|
aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
|
||||||
|
|
||||||
int aElem0DSize = mgr->integerValue("SMESH", "elem0d_size", 5);
|
int aElem0DSize = mgr->integerValue("SMESH", "elem0d_size", 5);
|
||||||
// int aBallSize = mgr->integerValue("SMESH", "ball_elem_size", 5);
|
// int aBallSize = mgr->integerValue("SMESH", "ball_elem_size", 5);
|
||||||
int aLineWidth = mgr->integerValue("SMESH", "element_width", 1);
|
int aLineWidth = mgr->integerValue("SMESH", "element_width", 1);
|
||||||
int maxSize = aElem0DSize;
|
int maxSize = aElem0DSize;
|
||||||
if (aElem0DSize > maxSize) maxSize = aElem0DSize;
|
if (aElem0DSize > maxSize) maxSize = aElem0DSize;
|
||||||
if (aLineWidth > maxSize) maxSize = aLineWidth;
|
if (aLineWidth > maxSize) maxSize = aLineWidth;
|
||||||
// if (aBallSize > maxSize) maxSize = aBallSize;
|
// if (aBallSize > maxSize) maxSize = aBallSize;
|
||||||
|
|
||||||
double SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ),
|
double
|
||||||
SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ),
|
SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ),
|
||||||
SP3 = mgr->doubleValue( "SMESH", "selection_precision_object", 0.025 );
|
SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ),
|
||||||
|
SP3 = mgr->doubleValue( "SMESH", "selection_precision_object", 0.025 );
|
||||||
|
|
||||||
for ( int i=0, n=views.count(); i<n; i++ ){
|
for ( int i=0, n=views.count(); i<n; i++ )
|
||||||
|
{
|
||||||
// update VTK viewer properties
|
// update VTK viewer properties
|
||||||
if(SVTK_ViewWindow* aVtkView = GetVtkViewWindow( views[i] )){
|
if ( SVTK_ViewWindow* aVtkView = GetVtkViewWindow( views[i] ))
|
||||||
|
{
|
||||||
// mesh element selection
|
// mesh element selection
|
||||||
aVtkView->SetSelectionProp(aSelColor.red()/255.,
|
aVtkView->SetSelectionProp(aSelColor.red()/255.,
|
||||||
aSelColor.green()/255.,
|
aSelColor.green()/255.,
|
||||||
@ -940,8 +945,8 @@ namespace SMESH
|
|||||||
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
||||||
vtkActorCollection *aCollection = aCopy.GetActors();
|
vtkActorCollection *aCollection = aCopy.GetActors();
|
||||||
aCollection->InitTraversal();
|
aCollection->InitTraversal();
|
||||||
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) ) {
|
||||||
anActor->SetHighlightColor(aHiColor.red()/255.,
|
anActor->SetHighlightColor(aHiColor.red()/255.,
|
||||||
aHiColor.green()/255.,
|
aHiColor.green()/255.,
|
||||||
aHiColor.blue()/255.);
|
aHiColor.blue()/255.);
|
||||||
@ -1076,8 +1081,9 @@ namespace SMESH
|
|||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void SetPointRepresentation(bool theIsVisible){
|
void SetPointRepresentation(bool theIsVisible)
|
||||||
if(SVTK_ViewWindow* aViewWindow = GetCurrentVtkView()){
|
{
|
||||||
|
if ( SVTK_ViewWindow* aViewWindow = GetCurrentVtkView() ) {
|
||||||
vtkRenderer *aRenderer = aViewWindow->getRenderer();
|
vtkRenderer *aRenderer = aViewWindow->getRenderer();
|
||||||
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
||||||
vtkActorCollection *aCollection = aCopy.GetActors();
|
vtkActorCollection *aCollection = aCopy.GetActors();
|
||||||
@ -1094,8 +1100,9 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SetPickable(SMESH_Actor* theActor){
|
void SetPickable(SMESH_Actor* theActor)
|
||||||
if(SVTK_ViewWindow* aWnd = GetCurrentVtkView()){
|
{
|
||||||
|
if ( SVTK_ViewWindow* aWnd = GetCurrentVtkView() ) {
|
||||||
int anIsAllPickable = (theActor == NULL);
|
int anIsAllPickable = (theActor == NULL);
|
||||||
vtkRenderer *aRenderer = aWnd->getRenderer();
|
vtkRenderer *aRenderer = aWnd->getRenderer();
|
||||||
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
||||||
@ -1116,9 +1123,9 @@ namespace SMESH
|
|||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
int GetNameOfSelectedNodes(SVTK_Selector* theSelector,
|
int GetNameOfSelectedNodes(SVTK_Selector* theSelector,
|
||||||
const Handle(SALOME_InteractiveObject)& theIO,
|
const Handle(SALOME_InteractiveObject)& theIO,
|
||||||
QString& theName)
|
QString& theName)
|
||||||
{
|
{
|
||||||
theName = "";
|
theName = "";
|
||||||
TColStd_IndexedMapOfInteger aMapIndex;
|
TColStd_IndexedMapOfInteger aMapIndex;
|
||||||
@ -1204,7 +1211,8 @@ namespace SMESH
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetNameOfSelectedNodes(LightApp_SelectionMgr *theMgr, QString& theName){
|
int GetNameOfSelectedNodes(LightApp_SelectionMgr *theMgr, QString& theName)
|
||||||
|
{
|
||||||
theName = "";
|
theName = "";
|
||||||
SALOME_ListIO selected; theMgr->selectedObjects( selected );
|
SALOME_ListIO selected; theMgr->selectedObjects( selected );
|
||||||
if(selected.Extent() == 1){
|
if(selected.Extent() == 1){
|
||||||
@ -1215,9 +1223,9 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int GetNameOfSelectedElements(LightApp_SelectionMgr *theMgr,
|
int GetNameOfSelectedElements(LightApp_SelectionMgr * theMgr,
|
||||||
const Handle(SALOME_InteractiveObject)& theIO,
|
const Handle(SALOME_InteractiveObject)& theIO,
|
||||||
QString& theName)
|
QString& theName)
|
||||||
{
|
{
|
||||||
theName = "";
|
theName = "";
|
||||||
if(theIO->hasEntry()){
|
if(theIO->hasEntry()){
|
||||||
@ -1342,13 +1350,13 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
|
|
||||||
double aBoundPoints[8][3] = { {theBounds[0],theBounds[2],theBounds[4]},
|
double aBoundPoints[8][3] = { {theBounds[0],theBounds[2],theBounds[4]},
|
||||||
{theBounds[1],theBounds[2],theBounds[4]},
|
{theBounds[1],theBounds[2],theBounds[4]},
|
||||||
{theBounds[0],theBounds[3],theBounds[4]},
|
{theBounds[0],theBounds[3],theBounds[4]},
|
||||||
{theBounds[1],theBounds[3],theBounds[4]},
|
{theBounds[1],theBounds[3],theBounds[4]},
|
||||||
{theBounds[0],theBounds[2],theBounds[5]},
|
{theBounds[0],theBounds[2],theBounds[5]},
|
||||||
{theBounds[1],theBounds[2],theBounds[5]},
|
{theBounds[1],theBounds[2],theBounds[5]},
|
||||||
{theBounds[0],theBounds[3],theBounds[5]},
|
{theBounds[0],theBounds[3],theBounds[5]},
|
||||||
{theBounds[1],theBounds[3],theBounds[5]}};
|
{theBounds[1],theBounds[3],theBounds[5]}};
|
||||||
|
|
||||||
int aMaxId = 0;
|
int aMaxId = 0;
|
||||||
theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]);
|
theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]);
|
||||||
@ -1445,8 +1453,9 @@ namespace SMESH
|
|||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
void ClearPlot2Viewers( SUIT_ViewWindow* theWindow ) {
|
void ClearPlot2Viewers( SUIT_ViewWindow* theWindow )
|
||||||
if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWindow)){
|
{
|
||||||
|
if ( SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWindow) ) {
|
||||||
vtkRenderer *aRenderer = aViewWindow->getRenderer();
|
vtkRenderer *aRenderer = aViewWindow->getRenderer();
|
||||||
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
||||||
vtkActorCollection *aCollection = aCopy.GetActors();
|
vtkActorCollection *aCollection = aCopy.GetActors();
|
||||||
|
@ -104,7 +104,7 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&,
|
|||||||
QString aResName = atts.value("resources");
|
QString aResName = atts.value("resources");
|
||||||
if (aResName != "")
|
if (aResName != "")
|
||||||
{
|
{
|
||||||
MESSAGE("Loading Resources " << aResName.toLatin1().data());
|
//MESSAGE("Loading Resources " << aResName.toLatin1().data());
|
||||||
SUIT_ResourceMgr* resMgr = SMESHGUI::resourceMgr();
|
SUIT_ResourceMgr* resMgr = SMESHGUI::resourceMgr();
|
||||||
QString lang = resMgr->stringValue( resMgr->langSection(), "language", "en" );
|
QString lang = resMgr->stringValue( resMgr->langSection(), "language", "en" );
|
||||||
resMgr->loadTranslator( "resources", QString( "%1_msg_%2.qm" ).arg( aResName, lang ) );
|
resMgr->loadTranslator( "resources", QString( "%1_msg_%2.qm" ).arg( aResName, lang ) );
|
||||||
|
@ -930,6 +930,7 @@ void SMESH_Block::refineParametersOnFace( const gp_Pnt& thePoint,
|
|||||||
{
|
{
|
||||||
// find UV of thePoint on the FACE
|
// find UV of thePoint on the FACE
|
||||||
Standard_Real U,V;
|
Standard_Real U,V;
|
||||||
|
U=V=0;
|
||||||
|
|
||||||
const TFace& tface = myFace[ theFaceID - ID_FirstF ];
|
const TFace& tface = myFace[ theFaceID - ID_FirstF ];
|
||||||
if ( !tface.Surface() ) return;
|
if ( !tface.Surface() ) return;
|
||||||
@ -1778,7 +1779,7 @@ bool SMESH_Block::FindBlockShapes(const TopoDS_Shell& theShell,
|
|||||||
|
|
||||||
if ( V000.IsNull() ) {
|
if ( V000.IsNull() ) {
|
||||||
// find vertex 000 - the one with smallest coordinates
|
// find vertex 000 - the one with smallest coordinates
|
||||||
double minVal = DBL_MAX, minX, val;
|
double minVal = DBL_MAX, minX = DBL_MAX, val;
|
||||||
for ( int i = 1; i <= 8; i++ ) {
|
for ( int i = 1; i <= 8; i++ ) {
|
||||||
const TopoDS_Vertex& v = TopoDS::Vertex( vfMap.FindKey( i ));
|
const TopoDS_Vertex& v = TopoDS::Vertex( vfMap.FindKey( i ));
|
||||||
gp_Pnt P = BRep_Tool::Pnt( v );
|
gp_Pnt P = BRep_Tool::Pnt( v );
|
||||||
@ -1822,7 +1823,7 @@ bool SMESH_Block::FindBlockShapes(const TopoDS_Shell& theShell,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
TopTools_ListIteratorOfListOfShape f001It, f000It ( f000List );
|
TopTools_ListIteratorOfListOfShape f001It, f000It ( f000List );
|
||||||
int i, j, iFound1, iFound2;
|
int i, j, iFound1=0, iFound2=0;
|
||||||
for ( j = 0; f000It.More(); f000It.Next(), j++ )
|
for ( j = 0; f000It.More(); f000It.Next(), j++ )
|
||||||
{
|
{
|
||||||
if ( NB_FACES_BY_VERTEX == 6 && j % 2 ) continue; // each face encounters twice
|
if ( NB_FACES_BY_VERTEX == 6 && j % 2 ) continue; // each face encounters twice
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <NCollection_DataMap.hxx>
|
#include <NCollection_DataMap.hxx>
|
||||||
|
#include <Precision.hxx>
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
|
|
||||||
using namespace SMESH_MeshAlgos;
|
using namespace SMESH_MeshAlgos;
|
||||||
@ -62,6 +63,7 @@ namespace
|
|||||||
bool HasCloseEdgeWithNode( const BNode* n ) const;
|
bool HasCloseEdgeWithNode( const BNode* n ) const;
|
||||||
bool IsCloseEdge( const BEdge*, double * u = 0 ) const;
|
bool IsCloseEdge( const BEdge*, double * u = 0 ) const;
|
||||||
bool operator<(const BNode& other) const { return Node()->GetID() < other.Node()->GetID(); }
|
bool operator<(const BNode& other) const { return Node()->GetID() < other.Node()->GetID(); }
|
||||||
|
double SquareDistance(const BNode& e2) const { return ( e2 - *this ).SquareModulus(); }
|
||||||
};
|
};
|
||||||
/*!
|
/*!
|
||||||
* \brief Edge of a free border
|
* \brief Edge of a free border
|
||||||
@ -133,6 +135,12 @@ namespace
|
|||||||
myNext->SetID( id + 1 );
|
myNext->SetID( id + 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Checks if a point is closer to this BEdge than tol
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
bool IsOut( const gp_XYZ& point, const double tol, double& u ) const
|
bool IsOut( const gp_XYZ& point, const double tol, double& u ) const
|
||||||
{
|
{
|
||||||
gp_XYZ me = *myBNode2 - *myBNode1;
|
gp_XYZ me = *myBNode2 - *myBNode1;
|
||||||
@ -145,6 +153,12 @@ namespace
|
|||||||
double dist2 = ( point - proj ).SquareModulus();
|
double dist2 = ( point - proj ).SquareModulus();
|
||||||
return ( dist2 > tol * tol );
|
return ( dist2 > tol * tol );
|
||||||
}
|
}
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Checks if two BEdges can be considered as overlapping
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
bool IsOverlappingProjection( const BEdge* toE, const double u, bool is1st ) const
|
bool IsOverlappingProjection( const BEdge* toE, const double u, bool is1st ) const
|
||||||
{
|
{
|
||||||
// is1st shows which end of toE is projected on this at u
|
// is1st shows which end of toE is projected on this at u
|
||||||
@ -160,6 +174,12 @@ namespace
|
|||||||
return Abs( u - u2 ) > eps;
|
return Abs( u - u2 ) > eps;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Finds all neighbor BEdge's having the same close borders
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
bool GetRangeOfSameCloseBorders(BEdge* eRange[2], const std::set< int >& bordIDs)
|
bool GetRangeOfSameCloseBorders(BEdge* eRange[2], const std::set< int >& bordIDs)
|
||||||
{
|
{
|
||||||
if ( this->myCloseBorders != bordIDs )
|
if ( this->myCloseBorders != bordIDs )
|
||||||
@ -221,6 +241,64 @@ namespace
|
|||||||
}
|
}
|
||||||
}; // class BEdge
|
}; // class BEdge
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Checks if all border parts include the whole closed border, and if so
|
||||||
|
* returns \c true and choose starting BEdge's with most coincident nodes
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
bool chooseStartOfClosedBorders( std::vector< BEdge* >& ranges ) // PAL23078#c21002
|
||||||
|
{
|
||||||
|
bool allClosed = true;
|
||||||
|
for ( size_t iR = 1; iR < ranges.size() && allClosed; iR += 2 )
|
||||||
|
allClosed = ( ranges[ iR-1 ]->myPrev == ranges[ iR ] );
|
||||||
|
if ( !allClosed )
|
||||||
|
return allClosed;
|
||||||
|
|
||||||
|
double u, minDiff = Precision::Infinite();
|
||||||
|
std::vector< BEdge* > start( ranges.size() / 2 );
|
||||||
|
BEdge* range0 = start[0] = ranges[0];
|
||||||
|
do
|
||||||
|
{
|
||||||
|
double maxDiffU = 0;
|
||||||
|
double maxDiff = 0;
|
||||||
|
for ( size_t iR = 3; iR < ranges.size(); iR += 2 )
|
||||||
|
{
|
||||||
|
int borderID = ranges[iR]->myBorderID;
|
||||||
|
if ( BEdge* e = start[0]->myBNode1->GetCloseEdgeOfBorder( borderID, & u ))
|
||||||
|
{
|
||||||
|
start[ iR / 2 ] = e;
|
||||||
|
double diffU = Min( Abs( u ), Abs( 1.-u ));
|
||||||
|
double diff = e->myBNode1->SquareDistance( *e->myBNode2 ) * diffU * diffU;
|
||||||
|
maxDiffU = Max( diffU, maxDiffU );
|
||||||
|
maxDiff = Max( diff, maxDiff );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( maxDiff < minDiff )
|
||||||
|
{
|
||||||
|
minDiff = maxDiff;
|
||||||
|
for ( size_t iR = 1; iR < ranges.size(); iR += 2 )
|
||||||
|
{
|
||||||
|
ranges[ iR-1 ] = start[ iR/2 ];
|
||||||
|
ranges[ iR ] = ranges[ iR-1]->myPrev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( maxDiffU < 1e-6 )
|
||||||
|
break;
|
||||||
|
start[0] = start[0]->myNext;
|
||||||
|
}
|
||||||
|
while ( start[0] != range0 );
|
||||||
|
|
||||||
|
return allClosed;
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Tries to include neighbor BEdge's into a border part
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
void extendPart( BEdge* & e1, BEdge* & e2, const std::set< int >& bordIDs, int groupID )
|
void extendPart( BEdge* & e1, BEdge* & e2, const std::set< int >& bordIDs, int groupID )
|
||||||
{
|
{
|
||||||
if (( e1->myPrev == e2 ) ||
|
if (( e1->myPrev == e2 ) ||
|
||||||
@ -268,6 +346,12 @@ namespace
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Connect BEdge's incident at this node
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
void BNode::AddLinked( BEdge* e ) const
|
void BNode::AddLinked( BEdge* e ) const
|
||||||
{
|
{
|
||||||
myLinkedEdges.reserve(2);
|
myLinkedEdges.reserve(2);
|
||||||
@ -670,8 +754,9 @@ void SMESH_MeshAlgos::FindCoincidentFreeBorders(SMDS_Mesh& mesh,
|
|||||||
|
|
||||||
if ( ranges.size() > 2 )
|
if ( ranges.size() > 2 )
|
||||||
{
|
{
|
||||||
for ( size_t iR = 1; iR < ranges.size(); iR += 2 )
|
if ( !chooseStartOfClosedBorders( ranges ))
|
||||||
extendPart( ranges[ iR-1 ], ranges[ iR ], be1st->myCloseBorders, groupID );
|
for ( size_t iR = 1; iR < ranges.size(); iR += 2 )
|
||||||
|
extendPart( ranges[ iR-1 ], ranges[ iR ], be1st->myCloseBorders, groupID );
|
||||||
|
|
||||||
// fill in a group
|
// fill in a group
|
||||||
beRange[0] = ranges[0];
|
beRange[0] = ranges[0];
|
||||||
|
@ -1194,7 +1194,7 @@ bool SMESH_MeshAlgos::IsOut( const SMDS_MeshElement* element, const gp_Pnt& poin
|
|||||||
dist.back() = dist.front();
|
dist.back() = dist.front();
|
||||||
// find the closest intersection
|
// find the closest intersection
|
||||||
int iClosest = -1;
|
int iClosest = -1;
|
||||||
double rClosest, distClosest = 1e100;;
|
double rClosest = 0, distClosest = 1e100;;
|
||||||
gp_Pnt pClosest;
|
gp_Pnt pClosest;
|
||||||
for ( i = 0; i < nbNodes; ++i )
|
for ( i = 0; i < nbNodes; ++i )
|
||||||
{
|
{
|
||||||
|
@ -186,6 +186,7 @@ typedef struct uvPtStruct
|
|||||||
uvPtStruct(): node(NULL) {}
|
uvPtStruct(): node(NULL) {}
|
||||||
|
|
||||||
inline gp_XY UV() const { return gp_XY( u, v ); }
|
inline gp_XY UV() const { return gp_XY( u, v ); }
|
||||||
|
inline void SetUV( const gp_XY& uv ) { u = uv.X(); v = uv.Y(); }
|
||||||
|
|
||||||
struct NodeAccessor // accessor to iterate on nodes in UVPtStructVec
|
struct NodeAccessor // accessor to iterate on nodes in UVPtStructVec
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,6 @@ SMESH_2D_Algo_i::SMESH_2D_Algo_i( PortableServer::POA_ptr thePOA )
|
|||||||
SMESH_Hypothesis_i( thePOA ),
|
SMESH_Hypothesis_i( thePOA ),
|
||||||
SMESH_Algo_i( thePOA )
|
SMESH_Algo_i( thePOA )
|
||||||
{
|
{
|
||||||
MESSAGE( "SMESH_2D_Algo_i::SMESH_2D_Algo_i" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
@ -58,7 +57,6 @@ SMESH_2D_Algo_i::SMESH_2D_Algo_i( PortableServer::POA_ptr thePOA )
|
|||||||
|
|
||||||
SMESH_2D_Algo_i::~SMESH_2D_Algo_i()
|
SMESH_2D_Algo_i::~SMESH_2D_Algo_i()
|
||||||
{
|
{
|
||||||
MESSAGE( "SMESH_2D_Algo_i::~SMESH_2D_Algo_i" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
@ -45,7 +45,6 @@ SMESH_3D_Algo_i::SMESH_3D_Algo_i( PortableServer::POA_ptr thePOA )
|
|||||||
SMESH_Hypothesis_i( thePOA ),
|
SMESH_Hypothesis_i( thePOA ),
|
||||||
SMESH_Algo_i( thePOA )
|
SMESH_Algo_i( thePOA )
|
||||||
{
|
{
|
||||||
MESSAGE( "SMESH_3D_Algo_i::SMESH_3D_Algo_i" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
@ -58,7 +57,6 @@ SMESH_3D_Algo_i::SMESH_3D_Algo_i( PortableServer::POA_ptr thePOA )
|
|||||||
|
|
||||||
SMESH_3D_Algo_i::~SMESH_3D_Algo_i()
|
SMESH_3D_Algo_i::~SMESH_3D_Algo_i()
|
||||||
{
|
{
|
||||||
MESSAGE( "SMESH_3D_Algo_i::~SMESH_3D_Algo_i" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
@ -48,7 +48,6 @@ SMESH_Algo_i::SMESH_Algo_i( PortableServer::POA_ptr thePOA )
|
|||||||
: SALOME::GenericObj_i( thePOA ),
|
: SALOME::GenericObj_i( thePOA ),
|
||||||
SMESH_Hypothesis_i( thePOA )
|
SMESH_Hypothesis_i( thePOA )
|
||||||
{
|
{
|
||||||
MESSAGE( "SMESH_Algo_i::SMESH_Algo_i" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
@ -61,7 +60,6 @@ SMESH_Algo_i::SMESH_Algo_i( PortableServer::POA_ptr thePOA )
|
|||||||
|
|
||||||
SMESH_Algo_i::~SMESH_Algo_i()
|
SMESH_Algo_i::~SMESH_Algo_i()
|
||||||
{
|
{
|
||||||
MESSAGE( "SMESH_Algo_i::~SMESH_Algo_i" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
@ -74,7 +72,6 @@ SMESH_Algo_i::~SMESH_Algo_i()
|
|||||||
|
|
||||||
SMESH::ListOfHypothesisName* SMESH_Algo_i::GetCompatibleHypothesis()
|
SMESH::ListOfHypothesisName* SMESH_Algo_i::GetCompatibleHypothesis()
|
||||||
{
|
{
|
||||||
MESSAGE( "SMESH_Algo_i::GetCompatibleHypothesis" );
|
|
||||||
SMESH::ListOfHypothesisName_var listOfHypothesis = new SMESH::ListOfHypothesisName;
|
SMESH::ListOfHypothesisName_var listOfHypothesis = new SMESH::ListOfHypothesisName;
|
||||||
const vector<string>& hypList = ( ( ::SMESH_Algo* )myBaseImpl )->GetCompatibleHypothesis();
|
const vector<string>& hypList = ( ( ::SMESH_Algo* )myBaseImpl )->GetCompatibleHypothesis();
|
||||||
int nbHyp = hypList.size();
|
int nbHyp = hypList.size();
|
||||||
|
@ -285,7 +285,6 @@ SMESH_Gen_i::SMESH_Gen_i( CORBA::ORB_ptr orb,
|
|||||||
const char* interfaceName )
|
const char* interfaceName )
|
||||||
: Engines_Component_i( orb, poa, contId, instanceName, interfaceName )
|
: Engines_Component_i( orb, poa, contId, instanceName, interfaceName )
|
||||||
{
|
{
|
||||||
MESSAGE( "SMESH_Gen_i::SMESH_Gen_i : standard constructor" );
|
|
||||||
|
|
||||||
myOrb = CORBA::ORB::_duplicate(orb);
|
myOrb = CORBA::ORB::_duplicate(orb);
|
||||||
myPoa = PortableServer::POA::_duplicate(poa);
|
myPoa = PortableServer::POA::_duplicate(poa);
|
||||||
@ -335,8 +334,6 @@ SMESH_Gen_i::SMESH_Gen_i( CORBA::ORB_ptr orb,
|
|||||||
|
|
||||||
SMESH_Gen_i::~SMESH_Gen_i()
|
SMESH_Gen_i::~SMESH_Gen_i()
|
||||||
{
|
{
|
||||||
MESSAGE( "SMESH_Gen_i::~SMESH_Gen_i" );
|
|
||||||
|
|
||||||
// delete hypothesis creators
|
// delete hypothesis creators
|
||||||
map<string, GenericHypothesisCreator_i*>::iterator itHyp, itHyp2;
|
map<string, GenericHypothesisCreator_i*>::iterator itHyp, itHyp2;
|
||||||
for (itHyp = myHypCreatorMap.begin(); itHyp != myHypCreatorMap.end(); itHyp++)
|
for (itHyp = myHypCreatorMap.begin(); itHyp != myHypCreatorMap.end(); itHyp++)
|
||||||
@ -512,7 +509,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);
|
if(MYDEBUG) 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
|
||||||
@ -571,7 +568,6 @@ 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
|
||||||
@ -4489,7 +4485,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
|
|||||||
|
|
||||||
// --> try to find SUB-MESHES containers for each type of submesh
|
// --> try to find SUB-MESHES containers for each type of submesh
|
||||||
for ( int j = GetSubMeshOnVertexTag(); j <= GetSubMeshOnCompoundTag(); j++ ) {
|
for ( int j = GetSubMeshOnVertexTag(); j <= GetSubMeshOnCompoundTag(); j++ ) {
|
||||||
const char* name_meshgroup;
|
const char* name_meshgroup = 0;
|
||||||
if ( j == GetSubMeshOnVertexTag() )
|
if ( j == GetSubMeshOnVertexTag() )
|
||||||
name_meshgroup = "SubMeshes On Vertex";
|
name_meshgroup = "SubMeshes On Vertex";
|
||||||
else if ( j == GetSubMeshOnEdgeTag() )
|
else if ( j == GetSubMeshOnEdgeTag() )
|
||||||
|
@ -771,8 +771,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr theStudy
|
|||||||
SetName( aRootSO, aRootNames[aType] );
|
SetName( aRootSO, aRootNames[aType] );
|
||||||
|
|
||||||
// Add new group to corresponding sub-tree
|
// Add new group to corresponding sub-tree
|
||||||
SMESH::array_of_ElementType_var elemTypes = theGroup->GetTypes();
|
int isEmpty = false;
|
||||||
int isEmpty = ( elemTypes->length() == 0 );
|
|
||||||
std::string pm[2] = { "ICON_SMESH_TREE_GROUP", "ICON_SMESH_TREE_MESH_WARN" };
|
std::string pm[2] = { "ICON_SMESH_TREE_GROUP", "ICON_SMESH_TREE_MESH_WARN" };
|
||||||
if ( SMESH::DownCast< SMESH_GroupOnFilter_i* > ( theGroup ))
|
if ( SMESH::DownCast< SMESH_GroupOnFilter_i* > ( theGroup ))
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,6 @@ SMESH_Group_i::SMESH_Group_i( PortableServer::POA_ptr thePOA,
|
|||||||
: SALOME::GenericObj_i( thePOA ),
|
: SALOME::GenericObj_i( thePOA ),
|
||||||
SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
|
SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
|
||||||
{
|
{
|
||||||
//MESSAGE("SMESH_Group_i; this = "<<this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SMESH_GroupOnGeom_i::SMESH_GroupOnGeom_i( PortableServer::POA_ptr thePOA,
|
SMESH_GroupOnGeom_i::SMESH_GroupOnGeom_i( PortableServer::POA_ptr thePOA,
|
||||||
@ -81,7 +80,6 @@ SMESH_GroupOnGeom_i::SMESH_GroupOnGeom_i( PortableServer::POA_ptr thePOA,
|
|||||||
: SALOME::GenericObj_i( thePOA ),
|
: SALOME::GenericObj_i( thePOA ),
|
||||||
SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
|
SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
|
||||||
{
|
{
|
||||||
//MESSAGE("SMESH_GroupOnGeom_i; this = "<<this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SMESH_GroupOnFilter_i::SMESH_GroupOnFilter_i( PortableServer::POA_ptr thePOA,
|
SMESH_GroupOnFilter_i::SMESH_GroupOnFilter_i( PortableServer::POA_ptr thePOA,
|
||||||
@ -90,7 +88,6 @@ SMESH_GroupOnFilter_i::SMESH_GroupOnFilter_i( PortableServer::POA_ptr thePOA,
|
|||||||
: SALOME::GenericObj_i( thePOA ),
|
: SALOME::GenericObj_i( thePOA ),
|
||||||
SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
|
SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
|
||||||
{
|
{
|
||||||
//MESSAGE("SMESH_GroupOnGeom_i; this = "<<this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
@ -176,7 +173,6 @@ char* SMESH_GroupBase_i::GetName()
|
|||||||
::SMESH_Group* aGroup = GetSmeshGroup();
|
::SMESH_Group* aGroup = GetSmeshGroup();
|
||||||
if (aGroup)
|
if (aGroup)
|
||||||
return CORBA::string_dup (aGroup->GetName());
|
return CORBA::string_dup (aGroup->GetName());
|
||||||
MESSAGE("get name of a vague group");
|
|
||||||
return CORBA::string_dup( "NO_NAME" );
|
return CORBA::string_dup( "NO_NAME" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,7 +199,6 @@ SMESH::ElementType SMESH_GroupBase_i::GetType()
|
|||||||
}
|
}
|
||||||
return aType;
|
return aType;
|
||||||
}
|
}
|
||||||
MESSAGE("get type of a vague group");
|
|
||||||
return SMESH::ALL;
|
return SMESH::ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +217,6 @@ CORBA::Long SMESH_GroupBase_i::Size()
|
|||||||
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
|
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
|
||||||
if (aGroupDS)
|
if (aGroupDS)
|
||||||
return aGroupDS->Extent();
|
return aGroupDS->Extent();
|
||||||
MESSAGE("get size of a vague group");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +234,6 @@ CORBA::Boolean SMESH_GroupBase_i::IsEmpty()
|
|||||||
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
|
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
|
||||||
if (aGroupDS)
|
if (aGroupDS)
|
||||||
return aGroupDS->IsEmpty();
|
return aGroupDS->IsEmpty();
|
||||||
MESSAGE("checking IsEmpty of a vague group");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,8 +273,6 @@ void SMESH_Group_i::Clear()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Modified(); // notify dependent Filter with FT_BelongToMeshGroup criterion
|
Modified(); // notify dependent Filter with FT_BelongToMeshGroup criterion
|
||||||
|
|
||||||
MESSAGE("attempt to clear a vague group");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
@ -298,7 +289,6 @@ CORBA::Boolean SMESH_GroupBase_i::Contains( CORBA::Long theID )
|
|||||||
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
|
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
|
||||||
if (aGroupDS)
|
if (aGroupDS)
|
||||||
return aGroupDS->Contains(theID);
|
return aGroupDS->Contains(theID);
|
||||||
MESSAGE("attempt to check contents of a vague group");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -631,7 +621,6 @@ SALOMEDS::Color SMESH_GroupBase_i::GetColor()
|
|||||||
|
|
||||||
return aColor;
|
return aColor;
|
||||||
}
|
}
|
||||||
MESSAGE("get color of a group");
|
|
||||||
return SALOMEDS::Color();
|
return SALOMEDS::Color();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -889,7 +878,6 @@ SMESH::long_array* SMESH_GroupOnFilter_i::GetListOfID()
|
|||||||
if ( 0 < aRes->length() && aRes->length() < 100 ) // for comfortable testing ;)
|
if ( 0 < aRes->length() && aRes->length() < 100 ) // for comfortable testing ;)
|
||||||
std::sort( &aRes[0], &aRes[0] + aRes->length() );
|
std::sort( &aRes[0], &aRes[0] + aRes->length() );
|
||||||
}
|
}
|
||||||
MESSAGE("get list of IDs of a vague group");
|
|
||||||
return aRes._retn();
|
return aRes._retn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,6 @@ SMESH_Mesh_i::SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
|
|||||||
CORBA::Long studyId )
|
CORBA::Long studyId )
|
||||||
: SALOME::GenericObj_i( thePOA )
|
: SALOME::GenericObj_i( thePOA )
|
||||||
{
|
{
|
||||||
MESSAGE("SMESH_Mesh_i");
|
|
||||||
_impl = NULL;
|
_impl = NULL;
|
||||||
_gen_i = gen_i;
|
_gen_i = gen_i;
|
||||||
_id = _idGenerator++;
|
_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
|
// destroy groups
|
||||||
map<int, SMESH::SMESH_GroupBase_ptr>::iterator itGr;
|
map<int, SMESH::SMESH_GroupBase_ptr>::iterator itGr;
|
||||||
for (itGr = _mapGroups.begin(); itGr != _mapGroups.end(); itGr++)
|
for (itGr = _mapGroups.begin(); itGr != _mapGroups.end(); itGr++)
|
||||||
@ -4079,7 +4076,7 @@ SMESH::long_array* SMESH_Mesh_i::GetNodesId()
|
|||||||
SMESH::ElementType SMESH_Mesh_i::GetElementType( const CORBA::Long id, const bool iselem )
|
SMESH::ElementType SMESH_Mesh_i::GetElementType( const CORBA::Long id, const bool iselem )
|
||||||
throw (SALOME::SALOME_Exception)
|
throw (SALOME::SALOME_Exception)
|
||||||
{
|
{
|
||||||
SMESH::ElementType type;
|
SMESH::ElementType type = SMESH::ALL;
|
||||||
SMESH_TRY;
|
SMESH_TRY;
|
||||||
|
|
||||||
if ( _preMeshInfo )
|
if ( _preMeshInfo )
|
||||||
@ -4227,7 +4224,7 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID,
|
|||||||
SMESH::ElementType SMESH_Mesh_i::GetSubMeshElementType(const CORBA::Long ShapeID)
|
SMESH::ElementType SMESH_Mesh_i::GetSubMeshElementType(const CORBA::Long ShapeID)
|
||||||
throw (SALOME::SALOME_Exception)
|
throw (SALOME::SALOME_Exception)
|
||||||
{
|
{
|
||||||
SMESH::ElementType type;
|
SMESH::ElementType type = SMESH::ALL;
|
||||||
|
|
||||||
SMESH_TRY;
|
SMESH_TRY;
|
||||||
if ( _preMeshInfo )
|
if ( _preMeshInfo )
|
||||||
@ -4265,8 +4262,7 @@ CORBA::LongLong SMESH_Mesh_i::GetMeshPtr()
|
|||||||
_preMeshInfo->FullLoadFromFile();
|
_preMeshInfo->FullLoadFromFile();
|
||||||
|
|
||||||
CORBA::LongLong pointeur = CORBA::LongLong(_impl);
|
CORBA::LongLong pointeur = CORBA::LongLong(_impl);
|
||||||
if ( MYDEBUG )
|
if ( MYDEBUG ) MESSAGE("CORBA::LongLong SMESH_Mesh_i::GetMeshPtr() "<<pointeur);
|
||||||
MESSAGE("CORBA::LongLong SMESH_Mesh_i::GetMeshPtr() "<<pointeur);
|
|
||||||
return pointeur;
|
return pointeur;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3050,7 +3050,7 @@ namespace
|
|||||||
_Node* orderNodes [20];
|
_Node* orderNodes [20];
|
||||||
TGeomID orderShapeIDs[20];
|
TGeomID orderShapeIDs[20];
|
||||||
size_t nbN = 0;
|
size_t nbN = 0;
|
||||||
TGeomID id, *pID;
|
TGeomID id, *pID = 0;
|
||||||
for ( e = edges.begin(); e != edges.end(); ++e )
|
for ( e = edges.begin(); e != edges.end(); ++e )
|
||||||
{
|
{
|
||||||
if (( id = _grid->_shapes.FindIndex( SMESH_MesherHelper::IthVertex( 0, *e ))) &&
|
if (( id = _grid->_shapes.FindIndex( SMESH_MesherHelper::IthVertex( 0, *e ))) &&
|
||||||
|
@ -382,12 +382,12 @@ namespace
|
|||||||
const TopTools_MapOfShape& cornerVV,
|
const TopTools_MapOfShape& cornerVV,
|
||||||
TopTools_MapOfShape& internEE)
|
TopTools_MapOfShape& internEE)
|
||||||
{
|
{
|
||||||
TopTools_IndexedMapOfShape subEE, subFF;
|
TopTools_IndexedMapOfShape subEE;
|
||||||
TopExp::MapShapes( shape, TopAbs_EDGE, subEE );
|
TopExp::MapShapes( shape, TopAbs_EDGE, subEE );
|
||||||
TopExp::MapShapes( shape, TopAbs_FACE, subFF );
|
//TopExp::MapShapes( shape, TopAbs_FACE, subFF );
|
||||||
|
|
||||||
TopoDS_Vertex VV[2];
|
TopoDS_Vertex VV[2];
|
||||||
TopTools_MapOfShape subChecked/*, ridgeEE*/;
|
TopTools_MapOfShape subChecked, ridgeEE;
|
||||||
TopTools_MapIteratorOfMapOfShape vIt( cornerVV );
|
TopTools_MapIteratorOfMapOfShape vIt( cornerVV );
|
||||||
for ( ; vIt.More(); vIt.Next() )
|
for ( ; vIt.More(); vIt.Next() )
|
||||||
{
|
{
|
||||||
@ -401,6 +401,8 @@ namespace
|
|||||||
TopoDS_Edge ridgeE = TopoDS::Edge( *riE );
|
TopoDS_Edge ridgeE = TopoDS::Edge( *riE );
|
||||||
while ( !ridgeE.IsNull() )
|
while ( !ridgeE.IsNull() )
|
||||||
{
|
{
|
||||||
|
if ( !ridgeEE.Add( ridgeE ))
|
||||||
|
break;
|
||||||
TopExp::Vertices( ridgeE, VV[0], VV[1] );
|
TopExp::Vertices( ridgeE, VV[0], VV[1] );
|
||||||
TopoDS_Shape V1 = VV[ V0.IsSame( VV[0] )];
|
TopoDS_Shape V1 = VV[ V0.IsSame( VV[0] )];
|
||||||
if ( cornerVV.Contains( V1 ) )
|
if ( cornerVV.Contains( V1 ) )
|
||||||
@ -451,6 +453,11 @@ namespace
|
|||||||
} // loop on ridge EDGEs around a corner VERTEX
|
} // loop on ridge EDGEs around a corner VERTEX
|
||||||
} // loop on on corner VERTEXes
|
} // loop on on corner VERTEXes
|
||||||
|
|
||||||
|
if ( subEE.Extent() > ridgeEE.Extent() + internEE.Extent() ) // PAL23269
|
||||||
|
for ( int i = 1; i < subEE.Extent(); ++i )
|
||||||
|
if ( !ridgeEE.Contains( subEE(i) ))
|
||||||
|
internEE.Add( subEE(i) );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // getInternalEdges()
|
} // getInternalEdges()
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -144,7 +144,6 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace,
|
|||||||
double p4 = myFirst[i]+(myLast[i]-myFirst[i])/4.;
|
double p4 = myFirst[i]+(myLast[i]-myFirst[i])/4.;
|
||||||
double d2 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p2 );
|
double d2 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p2 );
|
||||||
double d4 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p4 );
|
double d4 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p4 );
|
||||||
//cout<<"len = "<<len<<" d2 = "<<d2<<" fabs(2*d2/len-1.0) = "<<fabs(2*d2/len-1.0)<<endl;
|
|
||||||
myIsUniform[i] = !( fabs(2*d2/myEdgeLength[i]-1.0) > 0.01 || fabs(2*d4/d2-1.0) > 0.01 );
|
myIsUniform[i] = !( fabs(2*d2/myEdgeLength[i]-1.0) > 0.01 || fabs(2*d4/d2-1.0) > 0.01 );
|
||||||
Handle(Geom_Curve) C3d = BRep_Tool::Curve(myEdge[i],d2,d4);
|
Handle(Geom_Curve) C3d = BRep_Tool::Curve(myEdge[i],d2,d4);
|
||||||
myC3dAdaptor[i].Load( C3d, d2,d4 );
|
myC3dAdaptor[i].Load( C3d, d2,d4 );
|
||||||
@ -232,9 +231,11 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const StdMeshers_FaceSide* theSide,
|
|||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
StdMeshers_FaceSide::StdMeshers_FaceSide(UVPtStructVec& theSideNodes,
|
StdMeshers_FaceSide::StdMeshers_FaceSide(UVPtStructVec& theSideNodes,
|
||||||
const TopoDS_Face& theFace)
|
const TopoDS_Face& theFace,
|
||||||
|
const TopoDS_Edge& theEdge,
|
||||||
|
SMESH_Mesh* theMesh)
|
||||||
{
|
{
|
||||||
myEdge.resize( 1 );
|
myEdge.resize( 1, theEdge );
|
||||||
myEdgeID.resize( 1, -1 );
|
myEdgeID.resize( 1, -1 );
|
||||||
myC2d.resize( 1 );
|
myC2d.resize( 1 );
|
||||||
myC3dAdaptor.resize( 1 );
|
myC3dAdaptor.resize( 1 );
|
||||||
@ -244,6 +245,17 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(UVPtStructVec& theSideNodes,
|
|||||||
myIsUniform.resize( 1, 1 );
|
myIsUniform.resize( 1, 1 );
|
||||||
myMissingVertexNodes = myIgnoreMediumNodes = false;
|
myMissingVertexNodes = myIgnoreMediumNodes = false;
|
||||||
myDefaultPnt2d.SetCoord( 1e100, 1e100 );
|
myDefaultPnt2d.SetCoord( 1e100, 1e100 );
|
||||||
|
if ( theMesh ) myProxyMesh.reset( new SMESH_ProxyMesh( *theMesh ));
|
||||||
|
if ( !theEdge.IsNull() )
|
||||||
|
{
|
||||||
|
if ( theMesh ) myEdgeID[0] = theMesh->GetMeshDS()->ShapeToIndex( theEdge );
|
||||||
|
if ( theFace.IsNull() )
|
||||||
|
BRep_Tool::Range( theEdge, myFirst[0], myLast[0] );
|
||||||
|
else
|
||||||
|
myC2d[0] = BRep_Tool::CurveOnSurface( theEdge, theFace, myFirst[0], myLast[0] );
|
||||||
|
if ( theEdge.Orientation() == TopAbs_REVERSED )
|
||||||
|
std::swap( myFirst[0], myLast[0] );
|
||||||
|
}
|
||||||
|
|
||||||
myFace = theFace;
|
myFace = theFace;
|
||||||
myPoints = theSideNodes;
|
myPoints = theSideNodes;
|
||||||
|
@ -97,7 +97,9 @@ public:
|
|||||||
* \brief Create a side from an UVPtStructVec
|
* \brief Create a side from an UVPtStructVec
|
||||||
*/
|
*/
|
||||||
StdMeshers_FaceSide(UVPtStructVec& theSideNodes,
|
StdMeshers_FaceSide(UVPtStructVec& theSideNodes,
|
||||||
const TopoDS_Face& theFace = TopoDS_Face());
|
const TopoDS_Face& theFace = TopoDS_Face(),
|
||||||
|
const TopoDS_Edge& theEdge = TopoDS_Edge(),
|
||||||
|
SMESH_Mesh* theMesh = 0);
|
||||||
|
|
||||||
// static "consrtuctors"
|
// static "consrtuctors"
|
||||||
static StdMeshers_FaceSidePtr New(const TopoDS_Face& Face,
|
static StdMeshers_FaceSidePtr New(const TopoDS_Face& Face,
|
||||||
@ -245,6 +247,10 @@ public:
|
|||||||
* \brief Return all edges
|
* \brief Return all edges
|
||||||
*/
|
*/
|
||||||
const std::vector<TopoDS_Edge>& Edges() const { return myEdge; }
|
const std::vector<TopoDS_Edge>& Edges() const { return myEdge; }
|
||||||
|
/*!
|
||||||
|
* \brief Return the FACE
|
||||||
|
*/
|
||||||
|
const TopoDS_Face& Face() const { return myFace; }
|
||||||
/*!
|
/*!
|
||||||
* \brief Return 1st vertex of the i-th edge (count starts from zero)
|
* \brief Return 1st vertex of the i-th edge (count starts from zero)
|
||||||
*/
|
*/
|
||||||
|
@ -1367,7 +1367,7 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes,
|
|||||||
|
|
||||||
// find the other edges of theFace and orientation of e1
|
// find the other edges of theFace and orientation of e1
|
||||||
TopoDS_Edge e1, e2, eTop;
|
TopoDS_Edge e1, e2, eTop;
|
||||||
bool rev1, CumOri = false;
|
bool rev1 = false, CumOri = false;
|
||||||
TopExp_Explorer exp( theFace, TopAbs_EDGE );
|
TopExp_Explorer exp( theFace, TopAbs_EDGE );
|
||||||
int nbEdges = 0;
|
int nbEdges = 0;
|
||||||
for ( ; exp.More(); exp.Next() ) {
|
for ( ; exp.More(); exp.Next() ) {
|
||||||
|
@ -1116,7 +1116,7 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism)
|
|||||||
( ! botSM->GetAlgo() ||
|
( ! botSM->GetAlgo() ||
|
||||||
! _gen->Compute( *botSM->GetFather(), botSM->GetSubShape(), /*shapeOnly=*/true )))
|
! _gen->Compute( *botSM->GetFather(), botSM->GetSubShape(), /*shapeOnly=*/true )))
|
||||||
return error( COMPERR_BAD_INPUT_MESH,
|
return error( COMPERR_BAD_INPUT_MESH,
|
||||||
TCom( "No mesher defined to compute the face #")
|
TCom( "No mesher defined to compute the base face #")
|
||||||
<< shapeID( thePrism.myBottom ));
|
<< shapeID( thePrism.myBottom ));
|
||||||
|
|
||||||
// Make all side FACEs of thePrism meshed with quads
|
// Make all side FACEs of thePrism meshed with quads
|
||||||
@ -3155,7 +3155,7 @@ bool StdMeshers_Prism_3D::initPrism(Prism_3D::TPrismTopo& thePrism,
|
|||||||
|
|
||||||
// find vertex 000 - the one with smallest coordinates (for easy DEBUG :-)
|
// find vertex 000 - the one with smallest coordinates (for easy DEBUG :-)
|
||||||
TopoDS_Vertex V000;
|
TopoDS_Vertex V000;
|
||||||
double minVal = DBL_MAX, minX, val;
|
double minVal = DBL_MAX, minX = 0, val;
|
||||||
for ( TopExp_Explorer exp( botSM->GetSubShape(), TopAbs_VERTEX );
|
for ( TopExp_Explorer exp( botSM->GetSubShape(), TopAbs_VERTEX );
|
||||||
exp.More(); exp.Next() )
|
exp.More(); exp.Next() )
|
||||||
{
|
{
|
||||||
|
@ -1147,6 +1147,51 @@ namespace {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
/*
|
||||||
|
* Set initial association of VERTEXes for the case of projection
|
||||||
|
* from a quadrangle FACE to a closed FACE, where opposite src EDGEs
|
||||||
|
* have different nb of segments
|
||||||
|
*/
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
void initAssoc4Quad2Closed(const TopoDS_Shape& tgtFace,
|
||||||
|
SMESH_MesherHelper& tgtHelper,
|
||||||
|
const TopoDS_Shape& srcFace,
|
||||||
|
SMESH_Mesh* srcMesh,
|
||||||
|
TAssocTool::TShapeShapeMap & assocMap)
|
||||||
|
{
|
||||||
|
if ( !tgtHelper.HasRealSeam() || srcFace.ShapeType() != TopAbs_FACE )
|
||||||
|
return; // no seam edge
|
||||||
|
list< TopoDS_Edge > tgtEdges, srcEdges;
|
||||||
|
list< int > tgtNbEW, srcNbEW;
|
||||||
|
int tgtNbW = SMESH_Block::GetOrderedEdges( TopoDS::Face( tgtFace ), tgtEdges, tgtNbEW );
|
||||||
|
int srcNbW = SMESH_Block::GetOrderedEdges( TopoDS::Face( srcFace ), srcEdges, srcNbEW );
|
||||||
|
if ( tgtNbW != 1 || srcNbW != 1 ||
|
||||||
|
tgtNbEW.front() != 4 || srcNbEW.front() != 4 )
|
||||||
|
return; // not quads
|
||||||
|
|
||||||
|
int srcNbSeg[4];
|
||||||
|
list< TopoDS_Edge >::iterator edgeS = srcEdges.begin(), edgeT = tgtEdges.begin();
|
||||||
|
for ( int i = 0; edgeS != srcEdges.end(); ++i, ++edgeS )
|
||||||
|
if ( SMESHDS_SubMesh* sm = srcMesh->GetMeshDS()->MeshElements( *edgeS ))
|
||||||
|
srcNbSeg[ i ] = sm->NbNodes();
|
||||||
|
else
|
||||||
|
return; // not meshed
|
||||||
|
if ( srcNbSeg[0] == srcNbSeg[2] && srcNbSeg[1] == srcNbSeg[3] )
|
||||||
|
return; // same nb segments
|
||||||
|
if ( srcNbSeg[0] != srcNbSeg[2] && srcNbSeg[1] != srcNbSeg[3] )
|
||||||
|
return; // all different nb segments
|
||||||
|
|
||||||
|
edgeS = srcEdges.begin();
|
||||||
|
if ( srcNbSeg[0] != srcNbSeg[2] )
|
||||||
|
++edgeS;
|
||||||
|
TAssocTool::InsertAssociation( tgtHelper.IthVertex( 0,*edgeT ),
|
||||||
|
tgtHelper.IthVertex( 0,*edgeS ), assocMap );
|
||||||
|
TAssocTool::InsertAssociation( tgtHelper.IthVertex( 1,*edgeT ),
|
||||||
|
tgtHelper.IthVertex( 1,*edgeS ), assocMap );
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
@ -1159,7 +1204,6 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
|
|||||||
{
|
{
|
||||||
_src2tgtNodes.clear();
|
_src2tgtNodes.clear();
|
||||||
|
|
||||||
MESSAGE("Projection_2D Compute");
|
|
||||||
if ( !_sourceHypo )
|
if ( !_sourceHypo )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -1178,8 +1222,12 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
|
|||||||
TopoDS_Face tgtFace = TopoDS::Face( theShape.Oriented(TopAbs_FORWARD));
|
TopoDS_Face tgtFace = TopoDS::Face( theShape.Oriented(TopAbs_FORWARD));
|
||||||
TopoDS_Shape srcShape = _sourceHypo->GetSourceFace().Oriented(TopAbs_FORWARD);
|
TopoDS_Shape srcShape = _sourceHypo->GetSourceFace().Oriented(TopAbs_FORWARD);
|
||||||
|
|
||||||
|
helper.SetSubShape( tgtFace );
|
||||||
|
|
||||||
TAssocTool::TShapeShapeMap shape2ShapeMap;
|
TAssocTool::TShapeShapeMap shape2ShapeMap;
|
||||||
TAssocTool::InitVertexAssociation( _sourceHypo, shape2ShapeMap );
|
TAssocTool::InitVertexAssociation( _sourceHypo, shape2ShapeMap );
|
||||||
|
if ( shape2ShapeMap.IsEmpty() )
|
||||||
|
initAssoc4Quad2Closed( tgtFace, helper, srcShape, srcMesh, shape2ShapeMap );
|
||||||
if ( !TAssocTool::FindSubShapeAssociation( tgtFace, tgtMesh, srcShape, srcMesh,
|
if ( !TAssocTool::FindSubShapeAssociation( tgtFace, tgtMesh, srcShape, srcMesh,
|
||||||
shape2ShapeMap) ||
|
shape2ShapeMap) ||
|
||||||
!shape2ShapeMap.IsBound( tgtFace ))
|
!shape2ShapeMap.IsBound( tgtFace ))
|
||||||
@ -1257,7 +1305,7 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
|
|||||||
{
|
{
|
||||||
// projection in case if the faces are similar in 2D space
|
// projection in case if the faces are similar in 2D space
|
||||||
projDone = projectBy2DSimilarity( tgtFace, srcFace, tgtWires, srcWires,
|
projDone = projectBy2DSimilarity( tgtFace, srcFace, tgtWires, srcWires,
|
||||||
shape2ShapeMap, _src2tgtNodes, is1DComputed);
|
shape2ShapeMap, _src2tgtNodes, is1DComputed );
|
||||||
}
|
}
|
||||||
if ( !projDone )
|
if ( !projDone )
|
||||||
{
|
{
|
||||||
@ -1266,8 +1314,6 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
|
|||||||
// shape2ShapeMap, _src2tgtNodes, is1DComputed);
|
// shape2ShapeMap, _src2tgtNodes, is1DComputed);
|
||||||
}
|
}
|
||||||
|
|
||||||
helper.SetSubShape( tgtFace );
|
|
||||||
|
|
||||||
// it will remove mesh built on edges and vertices in failure case
|
// it will remove mesh built on edges and vertices in failure case
|
||||||
MeshCleaner cleaner( tgtSubMesh );
|
MeshCleaner cleaner( tgtSubMesh );
|
||||||
|
|
||||||
|
@ -519,7 +519,7 @@ bool StdMeshers_Quadrangle_2D::computeQuadDominant(SMESH_Mesh& aMesh,
|
|||||||
// for each node of the down edge find nearest node
|
// for each node of the down edge find nearest node
|
||||||
// in the first row of the regular grid and link them
|
// in the first row of the regular grid and link them
|
||||||
for (i = 0; i < stop; i++) {
|
for (i = 0; i < stop; i++) {
|
||||||
const SMDS_MeshNode *a, *b, *c, *d;
|
const SMDS_MeshNode *a, *b, *c=0, *d;
|
||||||
a = uv_e0[i].node;
|
a = uv_e0[i].node;
|
||||||
b = uv_e0[i + 1].node;
|
b = uv_e0[i + 1].node;
|
||||||
gp_Pnt pb (b->X(), b->Y(), b->Z());
|
gp_Pnt pb (b->X(), b->Y(), b->Z());
|
||||||
@ -533,6 +533,7 @@ bool StdMeshers_Quadrangle_2D::computeQuadDominant(SMESH_Mesh& aMesh,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// find in the grid node c, nearest to the b
|
// find in the grid node c, nearest to the b
|
||||||
|
c = 0;
|
||||||
double mind = RealLast();
|
double mind = RealLast();
|
||||||
for (int k = g; k <= iup; k++) {
|
for (int k = g; k <= iup; k++) {
|
||||||
|
|
||||||
@ -734,6 +735,7 @@ bool StdMeshers_Quadrangle_2D::computeQuadDominant(SMESH_Mesh& aMesh,
|
|||||||
gp_Pnt pb (b->X(), b->Y(), b->Z());
|
gp_Pnt pb (b->X(), b->Y(), b->Z());
|
||||||
|
|
||||||
// find node c in the grid, nearest to the b
|
// find node c in the grid, nearest to the b
|
||||||
|
c = 0;
|
||||||
int near = g;
|
int near = g;
|
||||||
if (i == stop - 1) { // up bondary reached
|
if (i == stop - 1) { // up bondary reached
|
||||||
c = quad->uv_grid[nbhoriz*(jup + 1) - 2].node;
|
c = quad->uv_grid[nbhoriz*(jup + 1) - 2].node;
|
||||||
@ -2138,7 +2140,7 @@ bool StdMeshers_Quadrangle_2D::computeQuadPref (SMESH_Mesh & aMesh,
|
|||||||
npl.Append(uv_el[i].normParam);
|
npl.Append(uv_el[i].normParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dl,dr;
|
int dl = 0, dr = 0;
|
||||||
if (OldVersion) {
|
if (OldVersion) {
|
||||||
// add some params to right and left after the first param
|
// add some params to right and left after the first param
|
||||||
// insert to right
|
// insert to right
|
||||||
@ -2380,7 +2382,7 @@ bool StdMeshers_Quadrangle_2D::computeQuadPref (SMESH_Mesh & aMesh,
|
|||||||
TColgp_SequenceOfXY UVtmp;
|
TColgp_SequenceOfXY UVtmp;
|
||||||
double drparam = npr.Value(nr) - npr.Value(nnn-1);
|
double drparam = npr.Value(nr) - npr.Value(nnn-1);
|
||||||
double dlparam = npl.Value(nnn) - npl.Value(nnn-1);
|
double dlparam = npl.Value(nnn) - npl.Value(nnn-1);
|
||||||
double y0,y1;
|
double y0 = 0, y1 = 0;
|
||||||
for (i=1; i<=drl; i++) {
|
for (i=1; i<=drl; i++) {
|
||||||
// add existed nodes from right edge
|
// add existed nodes from right edge
|
||||||
NodesC.SetValue(nb,i+1,uv_er[nnn+i-2].node);
|
NodesC.SetValue(nb,i+1,uv_er[nnn+i-2].node);
|
||||||
@ -3296,7 +3298,11 @@ bool StdMeshers_Quadrangle_2D::computeReduced (SMESH_Mesh & aMesh,
|
|||||||
|
|
||||||
vector<UVPtStruct> curr_base = uv_eb, next_base;
|
vector<UVPtStruct> curr_base = uv_eb, next_base;
|
||||||
|
|
||||||
UVPtStruct nullUVPtStruct; nullUVPtStruct.node = 0;
|
UVPtStruct nullUVPtStruct;
|
||||||
|
nullUVPtStruct.node = 0;
|
||||||
|
nullUVPtStruct.x = nullUVPtStruct.y = nullUVPtStruct.u = nullUVPtStruct.y = 0;
|
||||||
|
nullUVPtStruct.param = 0;
|
||||||
|
|
||||||
|
|
||||||
int curr_base_len = nb;
|
int curr_base_len = nb;
|
||||||
int next_base_len = 0;
|
int next_base_len = 0;
|
||||||
@ -4108,7 +4114,7 @@ bool StdMeshers_Quadrangle_2D::check()
|
|||||||
StdMeshers_FaceSidePtr wire = wireVec[0];
|
StdMeshers_FaceSidePtr wire = wireVec[0];
|
||||||
|
|
||||||
// find a right angle VERTEX
|
// find a right angle VERTEX
|
||||||
int iVertex;
|
int iVertex = 0;
|
||||||
double maxAngle = -1e100;
|
double maxAngle = -1e100;
|
||||||
for ( int i = 0; i < wire->NbEdges(); ++i )
|
for ( int i = 0; i < wire->NbEdges(); ++i )
|
||||||
{
|
{
|
||||||
@ -5145,6 +5151,8 @@ void StdMeshers_Quadrangle_2D::updateSideUV( FaceQuadStruct::Side& side,
|
|||||||
for ( iS = 0; iS < q->side.size(); ++iS )
|
for ( iS = 0; iS < q->side.size(); ++iS )
|
||||||
if ( side.grid == q->side[ iS ].grid )
|
if ( side.grid == q->side[ iS ].grid )
|
||||||
break;
|
break;
|
||||||
|
if ( iS == q->side.size() )
|
||||||
|
continue;
|
||||||
bool isOut;
|
bool isOut;
|
||||||
if ( !q->side[ iS ].IsReversed() )
|
if ( !q->side[ iS ].IsReversed() )
|
||||||
isOut = ( q->side[ iS ].from > iCur || q->side[ iS ].to-1 <= iCur );
|
isOut = ( q->side[ iS ].from > iCur || q->side[ iS ].to-1 <= iCur );
|
||||||
|
@ -76,11 +76,11 @@ using namespace StdMeshers;
|
|||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
StdMeshers_Regular_1D::StdMeshers_Regular_1D(int hypId, int studyId,
|
StdMeshers_Regular_1D::StdMeshers_Regular_1D(int hypId,
|
||||||
|
int studyId,
|
||||||
SMESH_Gen * gen)
|
SMESH_Gen * gen)
|
||||||
:SMESH_1D_Algo(hypId, studyId, gen)
|
:SMESH_1D_Algo( hypId, studyId, gen )
|
||||||
{
|
{
|
||||||
MESSAGE("StdMeshers_Regular_1D::StdMeshers_Regular_1D");
|
|
||||||
_name = "Regular_1D";
|
_name = "Regular_1D";
|
||||||
_shapeType = (1 << TopAbs_EDGE);
|
_shapeType = (1 << TopAbs_EDGE);
|
||||||
_fpHyp = 0;
|
_fpHyp = 0;
|
||||||
@ -155,7 +155,7 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh& aMesh,
|
|||||||
|
|
||||||
string hypName = theHyp->GetName();
|
string hypName = theHyp->GetName();
|
||||||
|
|
||||||
if (hypName == "LocalLength")
|
if ( hypName == "LocalLength" )
|
||||||
{
|
{
|
||||||
const StdMeshers_LocalLength * hyp =
|
const StdMeshers_LocalLength * hyp =
|
||||||
dynamic_cast <const StdMeshers_LocalLength * >(theHyp);
|
dynamic_cast <const StdMeshers_LocalLength * >(theHyp);
|
||||||
@ -167,7 +167,7 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh& aMesh,
|
|||||||
aStatus = SMESH_Hypothesis::HYP_OK;
|
aStatus = SMESH_Hypothesis::HYP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (hypName == "MaxLength")
|
else if ( hypName == "MaxLength" )
|
||||||
{
|
{
|
||||||
const StdMeshers_MaxLength * hyp =
|
const StdMeshers_MaxLength * hyp =
|
||||||
dynamic_cast <const StdMeshers_MaxLength * >(theHyp);
|
dynamic_cast <const StdMeshers_MaxLength * >(theHyp);
|
||||||
@ -182,7 +182,7 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh& aMesh,
|
|||||||
aStatus = SMESH_Hypothesis::HYP_OK;
|
aStatus = SMESH_Hypothesis::HYP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (hypName == "NumberOfSegments")
|
else if ( hypName == "NumberOfSegments" )
|
||||||
{
|
{
|
||||||
const StdMeshers_NumberOfSegments * hyp =
|
const StdMeshers_NumberOfSegments * hyp =
|
||||||
dynamic_cast <const StdMeshers_NumberOfSegments * >(theHyp);
|
dynamic_cast <const StdMeshers_NumberOfSegments * >(theHyp);
|
||||||
@ -217,7 +217,7 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh& aMesh,
|
|||||||
aStatus = SMESH_Hypothesis::HYP_OK;
|
aStatus = SMESH_Hypothesis::HYP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (hypName == "Arithmetic1D")
|
else if ( hypName == "Arithmetic1D" )
|
||||||
{
|
{
|
||||||
const StdMeshers_Arithmetic1D * hyp =
|
const StdMeshers_Arithmetic1D * hyp =
|
||||||
dynamic_cast <const StdMeshers_Arithmetic1D * >(theHyp);
|
dynamic_cast <const StdMeshers_Arithmetic1D * >(theHyp);
|
||||||
@ -232,7 +232,7 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh& aMesh,
|
|||||||
aStatus = SMESH_Hypothesis::HYP_OK;
|
aStatus = SMESH_Hypothesis::HYP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (hypName == "GeometricProgression")
|
else if ( hypName == "GeometricProgression" )
|
||||||
{
|
{
|
||||||
const StdMeshers_Geometric1D * hyp =
|
const StdMeshers_Geometric1D * hyp =
|
||||||
dynamic_cast <const StdMeshers_Geometric1D * >(theHyp);
|
dynamic_cast <const StdMeshers_Geometric1D * >(theHyp);
|
||||||
@ -247,7 +247,7 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh& aMesh,
|
|||||||
aStatus = SMESH_Hypothesis::HYP_OK;
|
aStatus = SMESH_Hypothesis::HYP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (hypName == "FixedPoints1D") {
|
else if ( hypName == "FixedPoints1D" ) {
|
||||||
_fpHyp = dynamic_cast <const StdMeshers_FixedPoints1D*>(theHyp);
|
_fpHyp = dynamic_cast <const StdMeshers_FixedPoints1D*>(theHyp);
|
||||||
ASSERT(_fpHyp);
|
ASSERT(_fpHyp);
|
||||||
_hypType = FIXED_POINTS_1D;
|
_hypType = FIXED_POINTS_1D;
|
||||||
@ -257,7 +257,7 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh& aMesh,
|
|||||||
aStatus = SMESH_Hypothesis::HYP_OK;
|
aStatus = SMESH_Hypothesis::HYP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (hypName == "StartEndLength")
|
else if ( hypName == "StartEndLength" )
|
||||||
{
|
{
|
||||||
const StdMeshers_StartEndLength * hyp =
|
const StdMeshers_StartEndLength * hyp =
|
||||||
dynamic_cast <const StdMeshers_StartEndLength * >(theHyp);
|
dynamic_cast <const StdMeshers_StartEndLength * >(theHyp);
|
||||||
@ -272,7 +272,7 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh& aMesh,
|
|||||||
aStatus = SMESH_Hypothesis::HYP_OK;
|
aStatus = SMESH_Hypothesis::HYP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (hypName == "Deflection1D")
|
else if ( hypName == "Deflection1D" )
|
||||||
{
|
{
|
||||||
const StdMeshers_Deflection1D * hyp =
|
const StdMeshers_Deflection1D * hyp =
|
||||||
dynamic_cast <const StdMeshers_Deflection1D * >(theHyp);
|
dynamic_cast <const StdMeshers_Deflection1D * >(theHyp);
|
||||||
@ -283,7 +283,7 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh& aMesh,
|
|||||||
aStatus = SMESH_Hypothesis::HYP_OK;
|
aStatus = SMESH_Hypothesis::HYP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (hypName == "AutomaticLength")
|
else if ( hypName == "AutomaticLength" )
|
||||||
{
|
{
|
||||||
StdMeshers_AutomaticLength * hyp = const_cast<StdMeshers_AutomaticLength *>
|
StdMeshers_AutomaticLength * hyp = const_cast<StdMeshers_AutomaticLength *>
|
||||||
(dynamic_cast <const StdMeshers_AutomaticLength * >(theHyp));
|
(dynamic_cast <const StdMeshers_AutomaticLength * >(theHyp));
|
||||||
@ -293,7 +293,7 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh& aMesh,
|
|||||||
_hypType = MAX_LENGTH;
|
_hypType = MAX_LENGTH;
|
||||||
aStatus = SMESH_Hypothesis::HYP_OK;
|
aStatus = SMESH_Hypothesis::HYP_OK;
|
||||||
}
|
}
|
||||||
else if (hypName == "Adaptive1D")
|
else if ( hypName == "Adaptive1D" )
|
||||||
{
|
{
|
||||||
_adaptiveHyp = dynamic_cast < const StdMeshers_Adaptive1D* >(theHyp);
|
_adaptiveHyp = dynamic_cast < const StdMeshers_Adaptive1D* >(theHyp);
|
||||||
ASSERT(_adaptiveHyp);
|
ASSERT(_adaptiveHyp);
|
||||||
@ -351,13 +351,11 @@ static bool computeParamByFunc(Adaptor3d_Curve& C3d,
|
|||||||
// never do this way
|
// never do this way
|
||||||
//OSD::SetSignal( true );
|
//OSD::SetSignal( true );
|
||||||
|
|
||||||
if (nbSeg <= 0)
|
if ( nbSeg <= 0 )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
MESSAGE( "computeParamByFunc" );
|
|
||||||
|
|
||||||
int nbPnt = 1 + nbSeg;
|
int nbPnt = 1 + nbSeg;
|
||||||
vector<double> x(nbPnt, 0.);
|
vector<double> x( nbPnt, 0. );
|
||||||
|
|
||||||
if ( !buildDistribution( func, 0.0, 1.0, nbSeg, x, 1E-4 ))
|
if ( !buildDistribution( func, 0.0, 1.0, nbSeg, x, 1E-4 ))
|
||||||
return false;
|
return false;
|
||||||
@ -374,7 +372,7 @@ static bool computeParamByFunc(Adaptor3d_Curve& C3d,
|
|||||||
for ( int i = 1; i < nbSeg; i++ )
|
for ( int i = 1; i < nbSeg; i++ )
|
||||||
{
|
{
|
||||||
double curvLength = length * (x[i] - x[i-1]) * sign;
|
double curvLength = length * (x[i] - x[i-1]) * sign;
|
||||||
double tol = Min( Precision::Confusion(), curvLength / 100. );
|
double tol = Min( Precision::Confusion(), curvLength / 100. );
|
||||||
GCPnts_AbscissaPoint Discret( tol, C3d, curvLength, prevU );
|
GCPnts_AbscissaPoint Discret( tol, C3d, curvLength, prevU );
|
||||||
if ( !Discret.IsDone() )
|
if ( !Discret.IsDone() )
|
||||||
return false;
|
return false;
|
||||||
@ -686,7 +684,6 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh,
|
|||||||
if ( ! SMESH_Algo::GetSortedNodesOnEdge( theMesh.GetMeshDS(), mainEdge, _quadraticMesh,
|
if ( ! SMESH_Algo::GetSortedNodesOnEdge( theMesh.GetMeshDS(), mainEdge, _quadraticMesh,
|
||||||
mainEdgeParamsOfNodes, SMDSAbs_Edge ))
|
mainEdgeParamsOfNodes, SMDSAbs_Edge ))
|
||||||
return error("Bad node parameters on the source edge of Propagation Of Distribution");
|
return error("Bad node parameters on the source edge of Propagation Of Distribution");
|
||||||
|
|
||||||
vector< double > segLen( mainEdgeParamsOfNodes.size() - 1 );
|
vector< double > segLen( mainEdgeParamsOfNodes.size() - 1 );
|
||||||
double totalLen = 0;
|
double totalLen = 0;
|
||||||
BRepAdaptor_Curve mainEdgeCurve( mainEdge );
|
BRepAdaptor_Curve mainEdgeCurve( mainEdge );
|
||||||
@ -715,7 +712,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh,
|
|||||||
++nbParams;
|
++nbParams;
|
||||||
}
|
}
|
||||||
if ( nbParams != segLen.size()-1 )
|
if ( nbParams != segLen.size()-1 )
|
||||||
return error( SMESH_Comment("Can't divide into ") << segLen.size() << " segements");
|
return error( SMESH_Comment("Can't divide into ") << segLen.size() << " segments");
|
||||||
|
|
||||||
compensateError( segLen[ theReverse ? segLen.size()-1 : 0 ],
|
compensateError( segLen[ theReverse ? segLen.size()-1 : 0 ],
|
||||||
segLen[ theReverse ? 0 : segLen.size()-1 ],
|
segLen[ theReverse ? 0 : segLen.size()-1 ],
|
||||||
@ -728,8 +725,8 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh,
|
|||||||
{
|
{
|
||||||
case LOCAL_LENGTH:
|
case LOCAL_LENGTH:
|
||||||
case MAX_LENGTH:
|
case MAX_LENGTH:
|
||||||
case NB_SEGMENTS: {
|
case NB_SEGMENTS:
|
||||||
|
{
|
||||||
double eltSize = 1;
|
double eltSize = 1;
|
||||||
int nbSegments;
|
int nbSegments;
|
||||||
if ( _hypType == MAX_LENGTH )
|
if ( _hypType == MAX_LENGTH )
|
||||||
@ -761,7 +758,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh,
|
|||||||
}
|
}
|
||||||
if (computed) {
|
if (computed) {
|
||||||
SMESHDS_SubMesh* smds = sm->GetSubMeshDS();
|
SMESHDS_SubMesh* smds = sm->GetSubMeshDS();
|
||||||
int nb_segments = smds->NbElements();
|
int nb_segments = smds->NbElements();
|
||||||
if (nbseg - 1 <= nb_segments && nb_segments <= nbseg + 1) {
|
if (nbseg - 1 <= nb_segments && nb_segments <= nbseg + 1) {
|
||||||
isFound = true;
|
isFound = true;
|
||||||
nbseg = nb_segments;
|
nbseg = nb_segments;
|
||||||
@ -893,18 +890,18 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ARITHMETIC_1D: {
|
case ARITHMETIC_1D:
|
||||||
|
{
|
||||||
// arithmetic progression: SUM(n) = ( an - a1 + q ) * ( a1 + an ) / ( 2 * q ) = theLength
|
// arithmetic progression: SUM(n) = ( an - a1 + q ) * ( a1 + an ) / ( 2 * q ) = theLength
|
||||||
|
|
||||||
double a1 = _value[ BEG_LENGTH_IND ];
|
double a1 = _value[ BEG_LENGTH_IND ];
|
||||||
double an = _value[ END_LENGTH_IND ];
|
double an = _value[ END_LENGTH_IND ];
|
||||||
if ( 1.01*theLength < a1 + an)
|
if ( 1.01*theLength < a1 + an )
|
||||||
return error ( SMESH_Comment("Invalid segment lengths (")<<a1<<" and "<<an<<") "<<
|
return error ( SMESH_Comment("Invalid segment lengths (")<<a1<<" and "<<an<<") "<<
|
||||||
"for an edge of length "<<theLength);
|
"for an edge of length "<<theLength);
|
||||||
|
|
||||||
double q = ( an - a1 ) / ( 2 *theLength/( a1 + an ) - 1 );
|
double q = ( an - a1 ) / ( 2 *theLength/( a1 + an ) - 1 );
|
||||||
int n = int(fabs(q) > numeric_limits<double>::min() ? ( 1+( an-a1 )/q ) : ( 1+theLength/a1 ));
|
int n = int(fabs(q) > numeric_limits<double>::min() ? ( 1+( an-a1 )/q ) : ( 1+theLength/a1 ));
|
||||||
|
|
||||||
double U1 = theReverse ? l : f;
|
double U1 = theReverse ? l : f;
|
||||||
double Un = theReverse ? f : l;
|
double Un = theReverse ? f : l;
|
||||||
@ -927,14 +924,14 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh,
|
|||||||
eltSize += q;
|
eltSize += q;
|
||||||
}
|
}
|
||||||
compensateError( a1, an, U1, Un, theLength, theC3d, theParams );
|
compensateError( a1, an, U1, Un, theLength, theC3d, theParams );
|
||||||
if (theReverse) theParams.reverse(); // NPAL18025
|
if ( theReverse ) theParams.reverse(); // NPAL18025
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
case GEOMETRIC_1D: {
|
case GEOMETRIC_1D:
|
||||||
|
{
|
||||||
double a1 = _value[ BEG_LENGTH_IND ], an;
|
double a1 = _value[ BEG_LENGTH_IND ], an = 0;
|
||||||
double q = _value[ END_LENGTH_IND ];
|
double q = _value[ END_LENGTH_IND ];
|
||||||
|
|
||||||
double U1 = theReverse ? l : f;
|
double U1 = theReverse ? l : f;
|
||||||
@ -977,7 +974,8 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
case FIXED_POINTS_1D: {
|
case FIXED_POINTS_1D:
|
||||||
|
{
|
||||||
const std::vector<double>& aPnts = _fpHyp->GetPoints();
|
const std::vector<double>& aPnts = _fpHyp->GetPoints();
|
||||||
const std::vector<int>& nbsegs = _fpHyp->GetNbSegments();
|
const std::vector<int>& nbsegs = _fpHyp->GetNbSegments();
|
||||||
TColStd_SequenceOfReal Params;
|
TColStd_SequenceOfReal Params;
|
||||||
@ -986,22 +984,22 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh,
|
|||||||
if( aPnts[i]<0.0001 || aPnts[i]>0.9999 ) continue;
|
if( aPnts[i]<0.0001 || aPnts[i]>0.9999 ) continue;
|
||||||
int j=1;
|
int j=1;
|
||||||
bool IsExist = false;
|
bool IsExist = false;
|
||||||
for(; j<=Params.Length(); j++) {
|
for ( ; j <= Params.Length(); j++ ) {
|
||||||
if( fabs(aPnts[i]-Params.Value(j)) < 1e-4 ) {
|
if ( Abs( aPnts[i] - Params.Value(j) ) < 1e-4 ) {
|
||||||
IsExist = true;
|
IsExist = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if( aPnts[i]<Params.Value(j) ) break;
|
if ( aPnts[i]<Params.Value(j) ) break;
|
||||||
}
|
}
|
||||||
if(!IsExist) Params.InsertBefore(j,aPnts[i]);
|
if ( !IsExist ) Params.InsertBefore( j, aPnts[i] );
|
||||||
}
|
}
|
||||||
double par2, par1, lp;
|
double par2, par1, lp;
|
||||||
par1 = f;
|
par1 = f;
|
||||||
lp = l;
|
lp = l;
|
||||||
double sign = 1.0;
|
double sign = 1.0;
|
||||||
if(theReverse) {
|
if ( theReverse ) {
|
||||||
par1 = l;
|
par1 = l;
|
||||||
lp = f;
|
lp = f;
|
||||||
sign = -1.0;
|
sign = -1.0;
|
||||||
}
|
}
|
||||||
double eltSize, segmentSize = 0.;
|
double eltSize, segmentSize = 0.;
|
||||||
@ -1009,37 +1007,34 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh,
|
|||||||
for ( int i = 0; i < Params.Length(); i++ )
|
for ( int i = 0; i < Params.Length(); i++ )
|
||||||
{
|
{
|
||||||
int nbseg = ( i > (int)nbsegs.size()-1 ) ? nbsegs[0] : nbsegs[i];
|
int nbseg = ( i > (int)nbsegs.size()-1 ) ? nbsegs[0] : nbsegs[i];
|
||||||
segmentSize = Params.Value(i+1)*theLength - currAbscissa;
|
segmentSize = Params.Value( i+1 ) * theLength - currAbscissa;
|
||||||
currAbscissa += segmentSize;
|
currAbscissa += segmentSize;
|
||||||
GCPnts_AbscissaPoint APnt(theC3d, sign*segmentSize, par1);
|
GCPnts_AbscissaPoint APnt( theC3d, sign*segmentSize, par1 );
|
||||||
if( !APnt.IsDone() )
|
if ( !APnt.IsDone() )
|
||||||
return error( "GCPnts_AbscissaPoint failed");
|
return error( "GCPnts_AbscissaPoint failed");
|
||||||
par2 = APnt.Parameter();
|
par2 = APnt.Parameter();
|
||||||
eltSize = segmentSize/nbseg;
|
eltSize = segmentSize/nbseg;
|
||||||
GCPnts_UniformAbscissa Discret(theC3d, eltSize, par1, par2);
|
GCPnts_UniformAbscissa Discret( theC3d, eltSize, par1, par2 );
|
||||||
if(theReverse)
|
if ( theReverse )
|
||||||
Discret.Initialize(theC3d, eltSize, par2, par1);
|
Discret.Initialize( theC3d, eltSize, par2, par1 );
|
||||||
else
|
else
|
||||||
Discret.Initialize(theC3d, eltSize, par1, par2);
|
Discret.Initialize( theC3d, eltSize, par1, par2 );
|
||||||
if ( !Discret.IsDone() )
|
if ( !Discret.IsDone() )
|
||||||
return error( "GCPnts_UniformAbscissa failed");
|
return error( "GCPnts_UniformAbscissa failed");
|
||||||
int NbPoints = Discret.NbPoints();
|
int NbPoints = Discret.NbPoints();
|
||||||
list<double> tmpParams;
|
list<double> tmpParams;
|
||||||
for(int i=2; i<NbPoints; i++) {
|
for ( int i = 2; i < NbPoints; i++ ) {
|
||||||
double param = Discret.Parameter(i);
|
double param = Discret.Parameter(i);
|
||||||
tmpParams.push_back( param );
|
tmpParams.push_back( param );
|
||||||
}
|
}
|
||||||
if (theReverse) {
|
if ( theReverse ) {
|
||||||
compensateError( eltSize, eltSize, par2, par1, segmentSize, theC3d, tmpParams );
|
compensateError( eltSize, eltSize, par2, par1, segmentSize, theC3d, tmpParams );
|
||||||
tmpParams.reverse();
|
tmpParams.reverse();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
compensateError( eltSize, eltSize, par1, par2, segmentSize, theC3d, tmpParams );
|
compensateError( eltSize, eltSize, par1, par2, segmentSize, theC3d, tmpParams );
|
||||||
}
|
}
|
||||||
list<double>::iterator itP = tmpParams.begin();
|
theParams.splice( theParams.end(), tmpParams );
|
||||||
for(; itP != tmpParams.end(); itP++) {
|
|
||||||
theParams.push_back( *(itP) );
|
|
||||||
}
|
|
||||||
theParams.push_back( par2 );
|
theParams.push_back( par2 );
|
||||||
|
|
||||||
par1 = par2;
|
par1 = par2;
|
||||||
@ -1049,39 +1044,36 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh,
|
|||||||
segmentSize = theLength - currAbscissa;
|
segmentSize = theLength - currAbscissa;
|
||||||
eltSize = segmentSize/nbseg;
|
eltSize = segmentSize/nbseg;
|
||||||
GCPnts_UniformAbscissa Discret;
|
GCPnts_UniformAbscissa Discret;
|
||||||
if(theReverse)
|
if ( theReverse )
|
||||||
Discret.Initialize(theC3d, eltSize, par1, lp);
|
Discret.Initialize( theC3d, eltSize, par1, lp );
|
||||||
else
|
else
|
||||||
Discret.Initialize(theC3d, eltSize, lp, par1);
|
Discret.Initialize( theC3d, eltSize, lp, par1 );
|
||||||
if ( !Discret.IsDone() )
|
if ( !Discret.IsDone() )
|
||||||
return error( "GCPnts_UniformAbscissa failed");
|
return error( "GCPnts_UniformAbscissa failed");
|
||||||
int NbPoints = Discret.NbPoints();
|
int NbPoints = Discret.NbPoints();
|
||||||
list<double> tmpParams;
|
list<double> tmpParams;
|
||||||
for(int i=2; i<NbPoints; i++) {
|
for ( int i = 2; i < NbPoints; i++ ) {
|
||||||
double param = Discret.Parameter(i);
|
double param = Discret.Parameter(i);
|
||||||
tmpParams.push_back( param );
|
tmpParams.push_back( param );
|
||||||
}
|
}
|
||||||
if (theReverse) {
|
if ( theReverse ) {
|
||||||
compensateError( eltSize, eltSize, lp, par1, segmentSize, theC3d, tmpParams );
|
compensateError( eltSize, eltSize, lp, par1, segmentSize, theC3d, tmpParams );
|
||||||
tmpParams.reverse();
|
tmpParams.reverse();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
compensateError( eltSize, eltSize, par1, lp, segmentSize, theC3d, tmpParams );
|
compensateError( eltSize, eltSize, par1, lp, segmentSize, theC3d, tmpParams );
|
||||||
}
|
}
|
||||||
list<double>::iterator itP = tmpParams.begin();
|
theParams.splice( theParams.end(), tmpParams );
|
||||||
for(; itP != tmpParams.end(); itP++) {
|
|
||||||
theParams.push_back( *(itP) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (theReverse) {
|
if ( theReverse )
|
||||||
theParams.reverse(); // NPAL18025
|
theParams.reverse(); // NPAL18025
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
case DEFLECTION: {
|
case DEFLECTION:
|
||||||
|
{
|
||||||
GCPnts_UniformDeflection Discret(theC3d, _value[ DEFLECTION_IND ], f, l, true);
|
GCPnts_UniformDeflection Discret( theC3d, _value[ DEFLECTION_IND ], f, l, true );
|
||||||
if ( !Discret.IsDone() )
|
if ( !Discret.IsDone() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -1241,8 +1233,6 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & t
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//MESSAGE("************* Degenerated edge! *****************");
|
|
||||||
|
|
||||||
// Edge is a degenerated Edge : We put n = 5 points on the edge.
|
// Edge is a degenerated Edge : We put n = 5 points on the edge.
|
||||||
const int NbPoints = 5;
|
const int NbPoints = 5;
|
||||||
BRep_Tool::Range( E, f, l ); // PAL15185
|
BRep_Tool::Range( E, f, l ); // PAL15185
|
||||||
@ -1345,9 +1335,8 @@ bool StdMeshers_Regular_1D::Evaluate(SMESH_Mesh & theMesh,
|
|||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//MESSAGE("************* Degenerated edge! *****************");
|
|
||||||
// Edge is a degenerated Edge : We put n = 5 points on the edge.
|
// Edge is a degenerated Edge : We put n = 5 points on the edge.
|
||||||
if(_quadraticMesh) {
|
if ( _quadraticMesh ) {
|
||||||
aVec[SMDSEntity_Node] = 11;
|
aVec[SMDSEntity_Node] = 11;
|
||||||
aVec[SMDSEntity_Quad_Edge] = 6;
|
aVec[SMDSEntity_Quad_Edge] = 6;
|
||||||
}
|
}
|
||||||
|
@ -113,6 +113,7 @@ namespace VISCOUS_2D
|
|||||||
//virtual int NbElements() const { return _elements.size()+1; }
|
//virtual int NbElements() const { return _elements.size()+1; }
|
||||||
virtual int NbNodes() const { return Max( 0, _uvPtStructVec.size()-2 ); }
|
virtual int NbNodes() const { return Max( 0, _uvPtStructVec.size()-2 ); }
|
||||||
void SetUVPtStructVec(UVPtStructVec& vec) { _uvPtStructVec.swap( vec ); }
|
void SetUVPtStructVec(UVPtStructVec& vec) { _uvPtStructVec.swap( vec ); }
|
||||||
|
UVPtStructVec& GetUVPtStructVec() { return _uvPtStructVec; }
|
||||||
};
|
};
|
||||||
_ProxyMeshOfFace(const SMESH_Mesh& mesh): SMESH_ProxyMesh(mesh) {}
|
_ProxyMeshOfFace(const SMESH_Mesh& mesh): SMESH_ProxyMesh(mesh) {}
|
||||||
_EdgeSubMesh* GetEdgeSubMesh(int ID) { return (_EdgeSubMesh*) getProxySubMesh(ID); }
|
_EdgeSubMesh* GetEdgeSubMesh(int ID) { return (_EdgeSubMesh*) getProxySubMesh(ID); }
|
||||||
@ -299,6 +300,8 @@ namespace VISCOUS_2D
|
|||||||
double _D; // _vec1.Crossed( _vec2 )
|
double _D; // _vec1.Crossed( _vec2 )
|
||||||
double _param1, _param2; // intersection param on _seg1 and _seg2
|
double _param1, _param2; // intersection param on _seg1 and _seg2
|
||||||
|
|
||||||
|
_SegmentIntersection(): _param1(0), _param2(0), _D(0) {}
|
||||||
|
|
||||||
bool Compute(const _Segment& seg1, const _Segment& seg2, bool seg2IsRay = false )
|
bool Compute(const _Segment& seg1, const _Segment& seg2, bool seg2IsRay = false )
|
||||||
{
|
{
|
||||||
// !!! If seg2IsRay, returns true at any _param2 !!!
|
// !!! If seg2IsRay, returns true at any _param2 !!!
|
||||||
@ -515,29 +518,53 @@ SMESH_ProxyMesh::Ptr
|
|||||||
StdMeshers_ViscousLayers2D::Compute(SMESH_Mesh& theMesh,
|
StdMeshers_ViscousLayers2D::Compute(SMESH_Mesh& theMesh,
|
||||||
const TopoDS_Face& theFace)
|
const TopoDS_Face& theFace)
|
||||||
{
|
{
|
||||||
SMESH_ProxyMesh::Ptr pm;
|
using namespace VISCOUS_2D;
|
||||||
|
|
||||||
vector< const StdMeshers_ViscousLayers2D* > hyps;
|
vector< const StdMeshers_ViscousLayers2D* > hyps;
|
||||||
vector< TopoDS_Shape > hypShapes;
|
vector< TopoDS_Shape > hypShapes;
|
||||||
if ( VISCOUS_2D::findHyps( theMesh, theFace, hyps, hypShapes ))
|
|
||||||
|
SMESH_ProxyMesh::Ptr pm = _ProxyMeshHolder::FindProxyMeshOfFace( theFace, theMesh );
|
||||||
|
if ( !pm )
|
||||||
{
|
{
|
||||||
VISCOUS_2D::_ViscousBuilder2D builder( theMesh, theFace, hyps, hypShapes );
|
if ( findHyps( theMesh, theFace, hyps, hypShapes ))
|
||||||
pm = builder.Compute();
|
{
|
||||||
SMESH_ComputeErrorPtr error = builder.GetError();
|
VISCOUS_2D::_ViscousBuilder2D builder( theMesh, theFace, hyps, hypShapes );
|
||||||
if ( error && !error->IsOK() )
|
pm = builder.Compute();
|
||||||
theMesh.GetSubMesh( theFace )->GetComputeError() = error;
|
SMESH_ComputeErrorPtr error = builder.GetError();
|
||||||
else if ( !pm )
|
if ( error && !error->IsOK() )
|
||||||
|
theMesh.GetSubMesh( theFace )->GetComputeError() = error;
|
||||||
|
else if ( !pm )
|
||||||
|
pm.reset( new SMESH_ProxyMesh( theMesh ));
|
||||||
|
if ( getenv("__ONLY__VL2D__"))
|
||||||
|
pm.reset();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
pm.reset( new SMESH_ProxyMesh( theMesh ));
|
pm.reset( new SMESH_ProxyMesh( theMesh ));
|
||||||
if ( getenv("__ONLY__VL2D__"))
|
}
|
||||||
pm.reset();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pm.reset( new SMESH_ProxyMesh( theMesh ));
|
|
||||||
}
|
}
|
||||||
return pm;
|
return pm;
|
||||||
}
|
}
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
|
void StdMeshers_ViscousLayers2D::SetProxyMeshOfEdge( const StdMeshers_FaceSide& edgeNodes )
|
||||||
|
{
|
||||||
|
using namespace VISCOUS_2D;
|
||||||
|
SMESH_ProxyMesh::Ptr pm =
|
||||||
|
_ProxyMeshHolder::FindProxyMeshOfFace( edgeNodes.Face(), *edgeNodes.GetMesh() );
|
||||||
|
if ( !pm ) {
|
||||||
|
_ProxyMeshOfFace* proxyMeshOfFace = new _ProxyMeshOfFace( *edgeNodes.GetMesh() );
|
||||||
|
pm.reset( proxyMeshOfFace );
|
||||||
|
new _ProxyMeshHolder( edgeNodes.Face(), pm );
|
||||||
|
}
|
||||||
|
_ProxyMeshOfFace* proxyMeshOfFace = static_cast<_ProxyMeshOfFace*>( pm.get() );
|
||||||
|
_ProxyMeshOfFace::_EdgeSubMesh* sm = proxyMeshOfFace->GetEdgeSubMesh( edgeNodes.EdgeID(0) );
|
||||||
|
sm->GetUVPtStructVec() = edgeNodes.GetUVPtStruct();
|
||||||
|
}
|
||||||
|
// --------------------------------------------------------------------------------
|
||||||
|
bool StdMeshers_ViscousLayers2D::HasProxyMesh( const TopoDS_Face& face, SMESH_Mesh& mesh )
|
||||||
|
{
|
||||||
|
return VISCOUS_2D::_ProxyMeshHolder::FindProxyMeshOfFace( face, mesh );
|
||||||
|
}
|
||||||
|
// --------------------------------------------------------------------------------
|
||||||
SMESH_ComputeErrorPtr
|
SMESH_ComputeErrorPtr
|
||||||
StdMeshers_ViscousLayers2D::CheckHypothesis(SMESH_Mesh& theMesh,
|
StdMeshers_ViscousLayers2D::CheckHypothesis(SMESH_Mesh& theMesh,
|
||||||
const TopoDS_Shape& theShape,
|
const TopoDS_Shape& theShape,
|
||||||
@ -1794,7 +1821,7 @@ bool _ViscousBuilder2D::shrink()
|
|||||||
// x-x-x-x-----x-----x----
|
// x-x-x-x-----x-----x----
|
||||||
// | | | | e1 e2 e3
|
// | | | | e1 e2 e3
|
||||||
|
|
||||||
int isRShrinkedForAdjacent;
|
int isRShrinkedForAdjacent = 0;
|
||||||
UVPtStructVec nodeDataForAdjacent;
|
UVPtStructVec nodeDataForAdjacent;
|
||||||
for ( int isR = 0; isR < 2; ++isR )
|
for ( int isR = 0; isR < 2; ++isR )
|
||||||
{
|
{
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "StdMeshers_ViscousLayers.hxx"
|
#include "StdMeshers_ViscousLayers.hxx"
|
||||||
|
|
||||||
class TopoDS_Face;
|
class TopoDS_Face;
|
||||||
|
class StdMeshers_FaceSide;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Hypothesis defining parameters of viscous layers
|
* \brief Hypothesis defining parameters of viscous layers
|
||||||
@ -72,6 +73,9 @@ public:
|
|||||||
|
|
||||||
static const char* GetHypType() { return "ViscousLayers2D"; }
|
static const char* GetHypType() { return "ViscousLayers2D"; }
|
||||||
|
|
||||||
|
static void SetProxyMeshOfEdge( const StdMeshers_FaceSide& edgeNodes );
|
||||||
|
static bool HasProxyMesh( const TopoDS_Face& face, SMESH_Mesh& theMesh );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ void StdMeshersGUI_DistrPreview::update()
|
|||||||
|
|
||||||
int size = graph.length()/2;
|
int size = graph.length()/2;
|
||||||
double* x = new double[size], *y = new double[size];
|
double* x = new double[size], *y = new double[size];
|
||||||
double min_x, max_x, min_y, max_y;
|
double min_x = 0, max_x = 0, min_y = 0, max_y = 0;
|
||||||
for( int i=0; i<size; i++ )
|
for( int i=0; i<size; i++ )
|
||||||
{
|
{
|
||||||
x[i] = graph[2*i];
|
x[i] = graph[2*i];
|
||||||
|
@ -418,12 +418,15 @@ void StdMeshersGUI_SubShapeSelectorWdg::onListSelectionChanged()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
//mySelectionMgr->clearSelected();
|
//mySelectionMgr->clearSelected();
|
||||||
TColStd_MapOfInteger aIndexes;
|
myPreviewActor->HighlightAll( false );
|
||||||
QList<QListWidgetItem*> selItems = myListWidget->selectedItems();
|
QList<QListWidgetItem*> selItems = myListWidget->selectedItems();
|
||||||
QListWidgetItem* anItem;
|
QListWidgetItem* anItem;
|
||||||
foreach(anItem, selItems)
|
foreach(anItem, selItems)
|
||||||
myPreviewActor->HighlightID( anItem->text().toInt() );
|
myPreviewActor->HighlightID( anItem->text().toInt() );
|
||||||
|
|
||||||
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
|
aViewWindow->Repaint();
|
||||||
|
|
||||||
// update remove button
|
// update remove button
|
||||||
myRemoveButton->setEnabled( selItems.size() > 0 );
|
myRemoveButton->setEnabled( selItems.size() > 0 );
|
||||||
|
|
||||||
|
@ -53,7 +53,6 @@ StdMeshers_ViscousLayers_i::StdMeshers_ViscousLayers_i( PortableServer::POA_ptr
|
|||||||
: SALOME::GenericObj_i( thePOA ),
|
: SALOME::GenericObj_i( thePOA ),
|
||||||
SMESH_Hypothesis_i( thePOA )
|
SMESH_Hypothesis_i( thePOA )
|
||||||
{
|
{
|
||||||
MESSAGE( "StdMeshers_ViscousLayers_i::StdMeshers_ViscousLayers_i" );
|
|
||||||
myBaseImpl = new ::StdMeshers_ViscousLayers( theGenImpl->GetANewId(),
|
myBaseImpl = new ::StdMeshers_ViscousLayers( theGenImpl->GetANewId(),
|
||||||
theStudyId,
|
theStudyId,
|
||||||
theGenImpl );
|
theGenImpl );
|
||||||
@ -69,7 +68,6 @@ StdMeshers_ViscousLayers_i::StdMeshers_ViscousLayers_i( PortableServer::POA_ptr
|
|||||||
|
|
||||||
StdMeshers_ViscousLayers_i::~StdMeshers_ViscousLayers_i()
|
StdMeshers_ViscousLayers_i::~StdMeshers_ViscousLayers_i()
|
||||||
{
|
{
|
||||||
MESSAGE( "StdMeshers_ViscousLayers_i::~StdMeshers_ViscousLayers_i" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
@ -265,7 +263,6 @@ void StdMeshers_ViscousLayers_i::SetMethod( ::StdMeshers::VLExtrusionMethod how
|
|||||||
|
|
||||||
::StdMeshers_ViscousLayers* StdMeshers_ViscousLayers_i::GetImpl()
|
::StdMeshers_ViscousLayers* StdMeshers_ViscousLayers_i::GetImpl()
|
||||||
{
|
{
|
||||||
MESSAGE( "StdMeshers_ViscousLayers_i::GetImpl" );
|
|
||||||
return ( ::StdMeshers_ViscousLayers* )myBaseImpl;
|
return ( ::StdMeshers_ViscousLayers* )myBaseImpl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,8 +134,6 @@ extern "C"
|
|||||||
STDMESHERS_I_EXPORT
|
STDMESHERS_I_EXPORT
|
||||||
GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName)
|
GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName)
|
||||||
{
|
{
|
||||||
MESSAGE("Get HypothesisCreator for " << aHypName);
|
|
||||||
|
|
||||||
GenericHypothesisCreator_i* aCreator = 0;
|
GenericHypothesisCreator_i* aCreator = 0;
|
||||||
|
|
||||||
// Hypotheses
|
// Hypotheses
|
||||||
|
@ -72,13 +72,13 @@ int main(int argc, char *argv[])
|
|||||||
debug = false;
|
debug = false;
|
||||||
string ficMEDin;
|
string ficMEDin;
|
||||||
string ficMEDout;
|
string ficMEDout;
|
||||||
float xNormal;
|
float xNormal = 0;
|
||||||
float yNormal;
|
float yNormal = 0;
|
||||||
float zNormal;
|
float zNormal = 0;
|
||||||
float xm;
|
float xm = 0;
|
||||||
float ym;
|
float ym = 0;
|
||||||
float zm;
|
float zm = 0;
|
||||||
float tolerance;
|
float tolerance = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (argc != 13)
|
if (argc != 13)
|
||||||
|
@ -84,7 +84,7 @@ int MESHCUT::positionNoeudPlan(int indiceNoeud)
|
|||||||
int MESHCUT::intersectionSegmentPlan(int it4, int na)
|
int MESHCUT::intersectionSegmentPlan(int it4, int na)
|
||||||
{
|
{
|
||||||
|
|
||||||
int ngA, ngB; // Numéros des noeuds extrémités AB
|
int ngA = -1, ngB = -1; // Numéros des noeuds extrémités AB
|
||||||
float lambda, ps; //, ab; // ab = longueur AB
|
float lambda, ps; //, ab; // ab = longueur AB
|
||||||
float A[3], B[3];
|
float A[3], B[3];
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ float Maillage::distanceNoeudMaille(int ngnoeud, int imaille, TYPE_MAILLE tm)
|
|||||||
int Maillage::noeudVoisin(int ngnoeud, int imaille, TYPE_MAILLE tm)
|
int Maillage::noeudVoisin(int ngnoeud, int imaille, TYPE_MAILLE tm)
|
||||||
{
|
{
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
int ngv;
|
int ngv = -1;
|
||||||
float x0 = XX[ngnoeud - 1];
|
float x0 = XX[ngnoeud - 1];
|
||||||
float y0 = YY[ngnoeud - 1];
|
float y0 = YY[ngnoeud - 1];
|
||||||
float z0 = ZZ[ngnoeud - 1];
|
float z0 = ZZ[ngnoeud - 1];
|
||||||
@ -557,13 +557,13 @@ void Maillage::inputMED(std::string fichierMED)
|
|||||||
ostringstream OSCOORD;
|
ostringstream OSCOORD;
|
||||||
|
|
||||||
med_int nnoe = 0; // Nbre de noeuds
|
med_int nnoe = 0; // Nbre de noeuds
|
||||||
med_float *coo1; // Table des coordonnées
|
med_float *coo1 = 0; // Table des coordonnées
|
||||||
// char nomcoo[mdim * MED_SNAME_SIZE + 1]; // Table des noms des coordonnées
|
// char nomcoo[mdim * MED_SNAME_SIZE + 1]; // Table des noms des coordonnées
|
||||||
// char unicoo[mdim * MED_SNAME_SIZE + 1]; // Table des unités des coordonnées
|
// char unicoo[mdim * MED_SNAME_SIZE + 1]; // Table des unités des coordonnées
|
||||||
char *nomnoe;
|
char *nomnoe = 0;
|
||||||
|
|
||||||
med_int *numnoe;
|
med_int *numnoe = 0;
|
||||||
med_int *nufano;
|
med_int *nufano = 0;
|
||||||
// med_grid_type rep;
|
// med_grid_type rep;
|
||||||
// med_bool inonoe, inunoe;
|
// med_bool inonoe, inunoe;
|
||||||
// med_int profil[2] = { 2, 3 };
|
// med_int profil[2] = { 2, 3 };
|
||||||
@ -1133,7 +1133,7 @@ void Maillage::outputMED(std::string fichierMED)
|
|||||||
// float x, y, z;
|
// float x, y, z;
|
||||||
|
|
||||||
med_int nnoe = nombreNoeudsMaillage; // Nombre de noeuds
|
med_int nnoe = nombreNoeudsMaillage; // Nombre de noeuds
|
||||||
med_float *coo; // Table des coordonnées
|
med_float *coo = 0; // Table des coordonnées
|
||||||
|
|
||||||
// Noms des coordonnées (variable nomcoo)
|
// Noms des coordonnées (variable nomcoo)
|
||||||
char* nomcoo = new char[mdim * MED_SNAME_SIZE + 1];
|
char* nomcoo = new char[mdim * MED_SNAME_SIZE + 1];
|
||||||
@ -1169,9 +1169,9 @@ void Maillage::outputMED(std::string fichierMED)
|
|||||||
|
|
||||||
// Tables des noms, numeros, numeros de familles des noeuds
|
// Tables des noms, numeros, numeros de familles des noeuds
|
||||||
// autant d'elements que de noeuds - les noms ont pout longueur MED_SNAME_SIZE
|
// autant d'elements que de noeuds - les noms ont pout longueur MED_SNAME_SIZE
|
||||||
char *nomnoe;
|
char *nomnoe = 0;
|
||||||
med_int *numnoe = NULL;
|
med_int *numnoe = NULL;
|
||||||
med_int *nufano;
|
med_int *nufano = NULL;
|
||||||
med_bool inonoe = MED_FALSE;
|
med_bool inonoe = MED_FALSE;
|
||||||
med_bool inunoe = MED_FALSE;
|
med_bool inunoe = MED_FALSE;
|
||||||
|
|
||||||
@ -1580,7 +1580,7 @@ int Maillage::NGLOBAL(TYPE_MAILLE typeMaille, int nlocal)
|
|||||||
TYPE_MAILLE Maillage::TYPE(int nglobal)
|
TYPE_MAILLE Maillage::TYPE(int nglobal)
|
||||||
{
|
{
|
||||||
// Attention, les num. globaux commencent à 1, les num. locaux à 0
|
// Attention, les num. globaux commencent à 1, les num. locaux à 0
|
||||||
TYPE_MAILLE resultat;
|
TYPE_MAILLE resultat = (TYPE_MAILLE)-1;
|
||||||
int cpt = 0;
|
int cpt = 0;
|
||||||
for (int itm = (int) POI1; itm <= (int) HEXA20; itm++)
|
for (int itm = (int) POI1; itm <= (int) HEXA20; itm++)
|
||||||
{
|
{
|
||||||
|
@ -534,7 +534,7 @@ int MESHCUT::copieFichier(std::string source, std::string cible)
|
|||||||
|
|
||||||
med_geometry_type MESHCUT::InstanceMGE(TYPE_MAILLE TYPE)
|
med_geometry_type MESHCUT::InstanceMGE(TYPE_MAILLE TYPE)
|
||||||
{
|
{
|
||||||
med_geometry_type typeBanaliseMED;
|
med_geometry_type typeBanaliseMED = MED_NONE;
|
||||||
|
|
||||||
switch (TYPE)
|
switch (TYPE)
|
||||||
{
|
{
|
||||||
|
@ -83,7 +83,8 @@ pygments_style = 'sphinx'
|
|||||||
# The style sheet to use for HTML and HTML Help pages. A file of that name
|
# The style sheet to use for HTML and HTML Help pages. A file of that name
|
||||||
# must exist either in Sphinx' static/ path, or in one of the custom paths
|
# must exist either in Sphinx' static/ path, or in one of the custom paths
|
||||||
# given in html_static_path.
|
# given in html_static_path.
|
||||||
html_style = 'default'
|
#html_style = 'default'
|
||||||
|
html_theme = 'default'
|
||||||
|
|
||||||
# The name for this set of Sphinx documents. If None, it defaults to
|
# The name for this set of Sphinx documents. If None, it defaults to
|
||||||
# "<project> v<release> documentation".
|
# "<project> v<release> documentation".
|
||||||
|
19
src/Tools/blocFissure/doc/faq.rst
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
.. _faq:
|
||||||
|
|
||||||
|
#######################
|
||||||
|
FAQ
|
||||||
|
#######################
|
||||||
|
|
||||||
|
- Does Bloc Fissure works on a 2D mesh ?
|
||||||
|
|
||||||
|
No, Bloc Fissure works only for 3D meshes. However, the user can extrude the 2D mesh to a 3D mesh, insert a crack and then extract a surface containing the crack.
|
||||||
|
|
||||||
|
- Can I insert a crack in a symmetry plan ?
|
||||||
|
|
||||||
|
No, the user must insert the crack without using the symmetry plan passing through the crack lips.
|
||||||
|
|
||||||
|
- I can't have Bloc Fissure working, it raises a pure python error, what can I do ?
|
||||||
|
|
||||||
|
Bloc Fissure has some error messages for the most commonly encountered misuses. If the program raises a pure python error, it means that this error is rare or has not been encountered by the programmers yet.
|
||||||
|
|
||||||
|
Still, either the case can't be treated using Bloc Fissure or the insertion procedure was not fully respected. In the first case, use Zcracks (soon available). In the second case, see the :ref:`tutorial <tutorials>`.
|
79
src/Tools/blocFissure/doc/gui.rst
Executable file
@ -0,0 +1,79 @@
|
|||||||
|
.. _gui:
|
||||||
|
|
||||||
|
With GUI
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
To make the use of « Bloc Fissure » easier, a Graphical User Interface (GUI) was developed.
|
||||||
|
Inputs are similar to those of :ref:`script mode <script>`. GUI is accessible in the SMESH extension *Add a crack in a mesh*
|
||||||
|
|
||||||
|
.. figure:: images/BF_GUI_capture.png
|
||||||
|
:width: 700
|
||||||
|
:align: center
|
||||||
|
|
||||||
|
Windows of the graphical interface
|
||||||
|
|
||||||
|
+------------------------------------------------------------------------------------------------------------------+
|
||||||
|
| GUI parameters |
|
||||||
|
+======================+===================================+=======================================================+
|
||||||
|
| **maillageSain** | *[string]* | Relative address of the input structure 3D mesh |
|
||||||
|
| | ex: mesh/maillage.med | in MED format (base is repertoire de travail) |
|
||||||
|
+----------------------+-----------------------------------+-------------------------------------------------------+
|
||||||
|
| **FaceFissure** | *[string]* | Relative address of the input crack geometry |
|
||||||
|
| | ex: mesh/fissure.brep | in BREP format (base is repertoire de travail) |
|
||||||
|
+----------------------+-----------------------------------+-------------------------------------------------------+
|
||||||
|
| **index edges fond | *[list of integers]* | List of edges number which define the crack front |
|
||||||
|
| fissure** | ex: [1,2] | |
|
||||||
|
+----------------------+-----------------------------------+-------------------------------------------------------+
|
||||||
|
| **min** | *[float]* | Float defining the minimum size of elements |
|
||||||
|
| | ex: 1.00000 | to mesh the crack |
|
||||||
|
+----------------------+-----------------------------------+-------------------------------------------------------+
|
||||||
|
| **max** | *[float]* | Float defining the maximum size of elements |
|
||||||
|
| | ex: 10.0000 | to mesh the crack |
|
||||||
|
+----------------------+-----------------------------------+-------------------------------------------------------+
|
||||||
|
| **distance | *[float]* | Length of influence - distance that defines the |
|
||||||
|
| influence** | ex: 20.0000 | size of the extracted Box around the crack |
|
||||||
|
+----------------------+-----------------------------------+-------------------------------------------------------+
|
||||||
|
| **rayon pipe** | *[float]* | Radius of the tore around the front |
|
||||||
|
| | ex: 5.00000 | |
|
||||||
|
+----------------------+-----------------------------------+-------------------------------------------------------+
|
||||||
|
| **longueur mailles** | *[float]* | Length of the segments of the tore along crack front |
|
||||||
|
| | ex: 5.00000 | |
|
||||||
|
+----------------------+-----------------------------------+-------------------------------------------------------+
|
||||||
|
| **couronnes** | *[integer]* | Number of radial segment of the tore |
|
||||||
|
| | ex: 5 | |
|
||||||
|
+----------------------+-----------------------------------+-------------------------------------------------------+
|
||||||
|
| **secteurs** | *[integer]* | Number of sectors of the tore |
|
||||||
|
| | ex: 16 | |
|
||||||
|
+----------------------+-----------------------------------+-------------------------------------------------------+
|
||||||
|
| **arete face | *[float]* | Mesh size of elements for the Box remeshing |
|
||||||
|
| fissure** | ex: 5.0000 | |
|
||||||
|
+----------------------+-----------------------------------+-------------------------------------------------------+
|
||||||
|
| **repertoire de | *[string]* | Absolute address of the directory where files are |
|
||||||
|
| travail** | ex: /home/A123456 | saved |
|
||||||
|
+----------------------+-----------------------------------+-------------------------------------------------------+
|
||||||
|
| **nom résultat** | *[string]* | Name of the resulting mesh |
|
||||||
|
| | ex: maillage_fissure | |
|
||||||
|
+----------------------+-----------------------------------+-------------------------------------------------------+
|
||||||
|
| **mode** | *[choice]* | Verbose mode for Salome messages |
|
||||||
|
| | ex: verbose | |
|
||||||
|
+----------------------+-----------------------------------+-------------------------------------------------------+
|
||||||
|
|
||||||
|
.. figure:: images/parametres_GUI.png
|
||||||
|
:width: 350
|
||||||
|
:align: center
|
||||||
|
|
||||||
|
Tore parameters
|
||||||
|
|
||||||
|
|
||||||
|
- **Reset**: clears all the parameters
|
||||||
|
|
||||||
|
- **Précédent**: loads the last set of parameters used
|
||||||
|
|
||||||
|
- **Recharger**: loads a .dic file containing parameters
|
||||||
|
|
||||||
|
- **Sauver**: save a .dic file with the active parameters
|
||||||
|
|
||||||
|
- **Cancel**: exit GUI
|
||||||
|
|
||||||
|
- **Sauver**: Launch calculation
|
||||||
|
|
BIN
src/Tools/blocFissure/doc/images/01_CubeAngle.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
src/Tools/blocFissure/doc/images/01_CubeAngle_2.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
src/Tools/blocFissure/doc/images/02_CubeAngle2.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
src/Tools/blocFissure/doc/images/02_CubeAngle2_2.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/Tools/blocFissure/doc/images/03_cylindre.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
src/Tools/blocFissure/doc/images/03_cylindre_2.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
src/Tools/blocFissure/doc/images/04_cylindre2.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
src/Tools/blocFissure/doc/images/04_cylindre2_2.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
src/Tools/blocFissure/doc/images/05_disque.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
src/Tools/blocFissure/doc/images/05_disque_2.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
src/Tools/blocFissure/doc/images/06_ellipse1.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
src/Tools/blocFissure/doc/images/06_ellipse1_2.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
src/Tools/blocFissure/doc/images/07_ellipse2.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
src/Tools/blocFissure/doc/images/07_ellipse2_2.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
src/Tools/blocFissure/doc/images/08_eprouvetteCourbe.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
src/Tools/blocFissure/doc/images/08_eprouvetteCourbe_2.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
src/Tools/blocFissure/doc/images/09_eprouvetteDroite.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
src/Tools/blocFissure/doc/images/09_eprouvetteDroite_2.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
src/Tools/blocFissure/doc/images/10_eprouvetteDroite2.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
src/Tools/blocFissure/doc/images/10_eprouvetteDroite2_2.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
src/Tools/blocFissure/doc/images/11_faceGauche.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
src/Tools/blocFissure/doc/images/11_faceGauche_2.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
src/Tools/blocFissure/doc/images/12_faceGauche2.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
src/Tools/blocFissure/doc/images/12_faceGauche2_2.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
src/Tools/blocFissure/doc/images/13_vis_1.png
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
src/Tools/blocFissure/doc/images/13_vis_1_2.png
Normal file
After Width: | Height: | Size: 71 KiB |
BIN
src/Tools/blocFissure/doc/images/BF_GUI_capture.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
src/Tools/blocFissure/doc/images/Capture_GUI_pipes.png
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
src/Tools/blocFissure/doc/images/Capture_GUI_pipes_2.png
Normal file
After Width: | Height: | Size: 170 KiB |
BIN
src/Tools/blocFissure/doc/images/GUI_BG.png
Normal file
After Width: | Height: | Size: 193 KiB |
BIN
src/Tools/blocFissure/doc/images/coude_0.png
Normal file
After Width: | Height: | Size: 18 KiB |