#include "utilities.h"
#ifdef _DEBUG_
-static int MYDEBUG = 1;
-#else
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
#endif
static int aLineWidthInc = 2;
void
SMESH_ActorDef::
-SetControlMode(eControl theMode,
- bool theCheckEntityMode)
+SetControlMode( eControl theMode, bool theCheckEntityMode )
{
vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10;
#endif
#ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
static int MYDEBUGWITHFILES = 0;//1;
#else
static int MYDEBUG = 0;
//=================================================================================
SMESH_VisualObjDef::SMESH_VisualObjDef()
{
- MESSAGE("---------------------------------------------SMESH_VisualObjDef::SMESH_VisualObjDef");
+ if ( MYDEBUG ) MESSAGE("-------------------------------SMESH_VisualObjDef::SMESH_VisualObjDef");
myGrid = vtkUnstructuredGrid::New();
myLocalGrid = false;
ClearEntitiesFlags();
}
SMESH_VisualObjDef::~SMESH_VisualObjDef()
{
- MESSAGE("---------------------------------------------SMESH_VisualObjDef::~SMESH_VisualObjDef");
- //if ( MYDEBUG )
- MESSAGE( "~SMESH_MeshObj - myGrid->GetReferenceCount() = " << myGrid->GetReferenceCount() );
+ if ( MYDEBUG ) MESSAGE("--------------------------------SMESH_VisualObjDef::~SMESH_VisualObjDef");
+ if ( MYDEBUG ) MESSAGE( "myGrid->GetReferenceCount() = " << myGrid->GetReferenceCount() );
myGrid->Delete();
}
//=================================================================================
void SMESH_VisualObjDef::buildPrs(bool buildGrid)
{
- MESSAGE("----------------------------------------------------------SMESH_VisualObjDef::buildPrs " << buildGrid);
+ if ( MYDEBUG ) MESSAGE("---------------------------SMESH_VisualObjDef::buildPrs " << buildGrid);
if (buildGrid)
{
myLocalGrid = true;
myLocalGrid = false;
if (!GetMesh()->isCompacted())
{
- MESSAGE("*** buildPrs ==> compactMesh!");
+ if ( MYDEBUG ) MESSAGE("*** buildPrs ==> compactMesh!");
GetMesh()->compactMesh();
}
vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
bool SMESH_MeshObj::Update( int theIsClear )
{
// 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) {
- MESSAGE("buildPrs");
+ if ( MYDEBUG ) MESSAGE("buildPrs");
buildPrs(); // Fill unstructured grid
return true;
}
bool SMESH_MeshObj::NulData()
{
- MESSAGE ("SMESH_MeshObj::NulData() ==================================================================================");
+ if ( MYDEBUG ) MESSAGE ("SMESH_MeshObj::NulData() =============================================");
if (!myEmptyGrid)
{
myEmptyGrid = SMDS_UnstructuredGrid::New();
//=================================================================================
bool SMESH_SubMeshObj::Update( int theIsClear )
{
- MESSAGE("SMESH_SubMeshObj::Update " << this)
+ if ( MYDEBUG ) MESSAGE("SMESH_SubMeshObj::Update " << this)
bool changed = myMeshObj->Update( theIsClear );
buildPrs(true);
return changed;
if ( !e1 || !e2 || !e3 ) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
- MESSAGE("AddFaceWithID" << ID);
SMDS_MeshFace * face = new SMDS_FaceOfEdges(e1,e2,e3);
adjustmyCellsCapacity(ID);
{
if (!hasConstructionEdges())
return NULL;
- //MESSAGE("AddFaceWithID" );
return AddFaceWithID(e1,e2,e3,e4, myElementIDFactory->GetFreeID());
}
{
if (!hasConstructionEdges())
return NULL;
- MESSAGE("AddFaceWithID" << ID);
if ( !e1 || !e2 || !e3 || !e4 ) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
SMDS_MeshFace * face = new SMDS_FaceOfEdges(e1,e2,e3,e4);
const SMDS_MeshNode * n4)
{
int ID = myElementIDFactory->GetFreeID();
- //MESSAGE("AddVolumeWithID " << ID);
SMDS_MeshVolume * v = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, ID);
if(v==NULL) myElementIDFactory->ReleaseID(ID);
return v;
int idnode4,
int ID)
{
- //MESSAGE("AddVolumeWithID" << ID);
SMDS_MeshNode *node1, *node2, *node3, *node4;
node1 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode1);
node2 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode2);
const SMDS_MeshNode * n4,
int ID)
{
- //MESSAGE("AddVolumeWithID " << ID);
SMDS_MeshVolume* volume = 0;
if ( !n1 || !n2 || !n3 || !n4) return volume;
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
myInfo.myNbTetras++;
}
else if(hasConstructionEdges()) {
- MESSAGE("Error : Not implemented");
return NULL;
}
else {
const SMDS_MeshNode * n5)
{
int ID = myElementIDFactory->GetFreeID();
- //MESSAGE("AddVolumeWithID " << ID);
SMDS_MeshVolume * v = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, ID);
if(v==NULL) myElementIDFactory->ReleaseID(ID);
return v;
int idnode5,
int ID)
{
- //MESSAGE("AddVolumeWithID " << ID);
SMDS_MeshNode *node1, *node2, *node3, *node4, *node5;
node1 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode1);
node2 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode2);
const SMDS_MeshNode * n5,
int ID)
{
- //MESSAGE("AddVolumeWithID " << ID);
SMDS_MeshVolume* volume = 0;
if ( !n1 || !n2 || !n3 || !n4 || !n5) return volume;
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
myInfo.myNbPyramids++;
}
else if(hasConstructionEdges()) {
- MESSAGE("Error : Not implemented");
return NULL;
}
else {
const SMDS_MeshNode * n6)
{
int ID = myElementIDFactory->GetFreeID();
- //MESSAGE("AddVolumeWithID " << ID);
SMDS_MeshVolume * v = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, ID);
if(v==NULL) myElementIDFactory->ReleaseID(ID);
return v;
int idnode6,
int ID)
{
- //MESSAGE("AddVolumeWithID " << ID);
SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6;
node1 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode1);
node2 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode2);
const SMDS_MeshNode * n6,
int ID)
{
- //MESSAGE("AddVolumeWithID " << ID);
SMDS_MeshVolume* volume = 0;
if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6) return volume;
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
myInfo.myNbPrisms++;
}
else if(hasConstructionEdges()) {
- MESSAGE("Error : Not implemented");
return NULL;
}
else {
return volume;
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
if(hasConstructionFaces()) {
- MESSAGE("Error : Not implemented");
return NULL;
}
else if(hasConstructionEdges()) {
- MESSAGE("Error : Not implemented");
return NULL;
}
else {
int idnode8,
int ID)
{
- //MESSAGE("AddVolumeWithID " << ID);
SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6, *node7, *node8;
node1 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode1);
node2 = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(idnode2);
const SMDS_MeshNode * n8,
int ID)
{
- //MESSAGE("AddVolumeWithID " << ID);
SMDS_MeshVolume* volume = 0;
if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8) return volume;
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
myInfo.myNbHexas++;
}
else if(hasConstructionEdges()) {
- MESSAGE("Error : Not implemented");
return NULL;
}
else {
const SMDS_MeshFace * f3,
const SMDS_MeshFace * f4)
{
- //MESSAGE("AddVolumeWithID");
if (!hasConstructionFaces())
return NULL;
return AddVolumeWithID(f1,f2,f3,f4, myElementIDFactory->GetFreeID());
const SMDS_MeshFace * f4,
int ID)
{
- MESSAGE("AddVolumeWithID" << ID);
if (!hasConstructionFaces())
return NULL;
if ( !f1 || !f2 || !f3 || !f4) return 0;
const SMDS_MeshFace * f4,
const SMDS_MeshFace * f5)
{
- //MESSAGE("AddVolumeWithID");
if (!hasConstructionFaces())
return NULL;
return AddVolumeWithID(f1,f2,f3,f4,f5, myElementIDFactory->GetFreeID());
const SMDS_MeshFace * f5,
int ID)
{
- MESSAGE("AddVolumeWithID" << ID);
if (!hasConstructionFaces())
return NULL;
if ( !f1 || !f2 || !f3 || !f4 || !f5) return 0;
const SMDS_MeshFace * f5,
const SMDS_MeshFace * f6)
{
- //MESSAGE("AddVolumeWithID" );
if (!hasConstructionFaces())
return NULL;
return AddVolumeWithID(f1,f2,f3,f4,f5,f6, myElementIDFactory->GetFreeID());
const SMDS_MeshFace * f6,
int ID)
{
- MESSAGE("AddVolumeWithID" << ID);
if (!hasConstructionFaces())
return NULL;
if ( !f1 || !f2 || !f3 || !f4 || !f5 || !f6) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
if (hasConstructionEdges())
{
- MESSAGE("Error : Not implemented");
return NULL;
}
else
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
if (hasConstructionEdges())
{
- MESSAGE("Error : Not implemented");
return NULL;
}
else
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
if (hasConstructionFaces())
{
- MESSAGE("Error : Not implemented");
return NULL;
}
else if (hasConstructionEdges())
{
- MESSAGE("Error : Not implemented");
return NULL;
}
else
{
//#ifdef VTK_HAVE_POLYHEDRON
- //MESSAGE("AddPolyhedralVolumeWithID vtk " << ID);
myNodeIds.resize( nodes.size() );
for ( size_t i = 0; i < nodes.size(); ++i )
myNodeIds[i] = nodes[i]->getVtkId();
}
volume = volvtk;
//#else
- // MESSAGE("AddPolyhedralVolumeWithID smds " << ID);
// for ( int i = 0; i < nodes.size(); ++i )
// if ( !nodes[ i ] ) return 0;
// volume = new SMDS_PolyhedralVolumeOfNodes(nodes, quantities);
///////////////////////////////////////////////////////////////////////////////
bool SMDS_Mesh::registerElement(int ID, SMDS_MeshElement* element)
{
- //MESSAGE("registerElement " << ID);
if ((ID >=0) && (ID < (int)myCells.size()) && myCells[ID]) // --- already bound
{
MESSAGE(" ------------------ already bound "<< ID << " " << myCells[ID]->getVtkId());
if (vtkId >= (int)myCellIdVtkToSmds.size()) // --- resize local vector
{
-// MESSAGE(" --------------------- resize myCellIdVtkToSmds " << vtkId << " --> " << vtkId + SMDS_Mesh::chunkSize);
myCellIdVtkToSmds.resize(vtkId + SMDS_Mesh::chunkSize, -1);
}
myCellIdVtkToSmds[vtkId] = ID;
{
if (ID < 1 || ID >= (int)myNodes.size())
{
-// MESSAGE("------------------------------------------------------------------------- ");
-// MESSAGE("----------------------------------- bad ID " << ID << " " << myNodes.size());
-// MESSAGE("------------------------------------------------------------------------- ");
return 0;
}
return (const SMDS_MeshNode *)myNodes[ID];
face = facevtk;
adjustmyCellsCapacity(ID);
myCells[ID] = face;
- //MESSAGE("createTriangle " << ID << " " << face);
myInfo.myNbTriangles++;
return face;
}
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
if(hasConstructionEdges())
{
- //MESSAGE("createQuadrangle hasConstructionEdges "<< ID);
SMDS_MeshEdge *edge1, *edge2, *edge3, *edge4;
edge1=FindEdgeOrCreate(node1,node2);
edge2=FindEdgeOrCreate(node2,node3);
void SMDS_Mesh::RemoveNode(const SMDS_MeshNode * node)
{
- MESSAGE("RemoveNode");
RemoveElement(node, true);
}
void SMDS_Mesh::Remove0DElement(const SMDS_Mesh0DElement * elem0d)
{
- MESSAGE("Remove0DElement");
RemoveElement(elem0d,true);
}
void SMDS_Mesh::RemoveEdge(const SMDS_MeshEdge * edge)
{
- MESSAGE("RemoveEdge");
RemoveElement(edge,true);
}
void SMDS_Mesh::RemoveFace(const SMDS_MeshFace * face)
{
- MESSAGE("RemoveFace");
RemoveElement(face, true);
}
void SMDS_Mesh::RemoveVolume(const SMDS_MeshVolume * volume)
{
- MESSAGE("RemoveVolume");
RemoveElement(volume, true);
}
const SMDS_MeshNode * nodes[],
const int nbnodes)
{
- MESSAGE("SMDS_Mesh::ChangeElementNodes");
// keep current nodes of elem
set<const SMDS_MeshNode*> oldNodes( element->begin_nodes(), element->end_nodes() );
{
if ( IDelem <= 0 || IDelem >= (int)myCells.size() )
{
- MESSAGE("--------------------------------------------------------------------------------- ");
- MESSAGE("----------------------------------- bad IDelem " << IDelem << " " << myCells.size());
- MESSAGE("--------------------------------------------------------------------------------- ");
- // TODO raise an exception
- //assert(0);
return 0;
}
return myCells[IDelem];
void SMDS_Mesh::DumpNodes() const
{
- MESSAGE("dump nodes of mesh : ");
- SMDS_NodeIteratorPtr itnode=nodesIterator();
- while(itnode->more()) ; //MESSAGE(itnode->next());
+ SMDS_NodeIteratorPtr itnode=nodesIterator();
+ while(itnode->more()) ; //MESSAGE(itnode->next());
}
//=======================================================================
//=======================================================================
void SMDS_Mesh::Dump0DElements() const
{
- MESSAGE("dump 0D elements of mesh : ");
SMDS_ElemIteratorPtr it0d = elementsIterator(SMDSAbs_0DElement);
while(it0d->more()) ; //MESSAGE(it0d->next());
}
void SMDS_Mesh::DumpEdges() const
{
- MESSAGE("dump edges of mesh : ");
- SMDS_EdgeIteratorPtr itedge=edgesIterator();
- while(itedge->more()) ; //MESSAGE(itedge->next());
+ SMDS_EdgeIteratorPtr itedge=edgesIterator();
+ while(itedge->more()) ; //MESSAGE(itedge->next());
}
//=======================================================================
void SMDS_Mesh::DumpFaces() const
{
- MESSAGE("dump faces of mesh : ");
- SMDS_FaceIteratorPtr itface=facesIterator();
- while(itface->more()) ; //MESSAGE(itface->next());
+ SMDS_FaceIteratorPtr itface=facesIterator();
+ while(itface->more()) ; //MESSAGE(itface->next());
}
//=======================================================================
void SMDS_Mesh::DumpVolumes() const
{
- MESSAGE("dump volumes of mesh : ");
- SMDS_VolumeIteratorPtr itvol=volumesIterator();
- while(itvol->more()) ; //MESSAGE(itvol->next());
+ SMDS_VolumeIteratorPtr itvol=volumesIterator();
+ while(itvol->more()) ; //MESSAGE(itvol->next());
}
//=======================================================================
///////////////////////////////////////////////////////////////////////////////
int SMDS_Mesh::NbNodes() const
{
- //MESSAGE(myGrid->GetNumberOfPoints());
- //MESSAGE(myInfo.NbNodes());
- //MESSAGE(myNodeMax);
- return myInfo.NbNodes();
+ return myInfo.NbNodes();
}
///////////////////////////////////////////////////////////////////////////////
void SMDS_Mesh::Clear()
{
- MESSAGE("SMDS_Mesh::Clear");
if (myParent!=NULL)
{
SMDS_ElemIteratorPtr eIt = elementsIterator();
///////////////////////////////////////////////////////////////////////////////
static set<const SMDS_MeshElement*> * getFinitElements(const SMDS_MeshElement * element)
{
- int numberOfSets=element->NbNodes();
- set<const SMDS_MeshElement*> *initSet = new set<const SMDS_MeshElement*>[numberOfSets];
+ int numberOfSets=element->NbNodes();
+ set<const SMDS_MeshElement*> *initSet = new set<const SMDS_MeshElement*>[numberOfSets];
- SMDS_ElemIteratorPtr itNodes=element->nodesIterator();
-
- int i=0;
- while(itNodes->more())
- {
- const SMDS_MeshElement* node = itNodes->next();
- MYASSERT(node);
- const SMDS_MeshNode * n=static_cast<const SMDS_MeshNode*>(node);
- SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
+ SMDS_ElemIteratorPtr itNodes=element->nodesIterator();
- //initSet[i]=set<const SMDS_MeshElement*>();
- while(itFe->more())
- {
- const SMDS_MeshElement* elem = itFe->next();
- MYASSERT(elem);
- initSet[i].insert(elem);
+ int i = 0;
+ while ( itNodes->more() )
+ {
+ const SMDS_MeshElement* node = itNodes->next();
+ MYASSERT(node);
+ const SMDS_MeshNode * n=static_cast<const SMDS_MeshNode*>(node);
+ SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
- }
+ while ( itFe->more() )
+ {
+ const SMDS_MeshElement* elem = itFe->next();
+ MYASSERT(elem);
+ initSet[i].insert(elem);
+ }
- i++;
- }
- set<const SMDS_MeshElement*> *retSet=intersectionOfSets(initSet, numberOfSets);
-// MESSAGE("nb elems " << i << " intersection " << retSet->size());
- delete [] initSet;
- return retSet;
+ i++;
+ }
+ set<const SMDS_MeshElement*> *retSet = intersectionOfSets( initSet, numberOfSets );
+ delete [] initSet;
+ return retSet;
}
///////////////////////////////////////////////////////////////////////////////
{
int elemId = elem->GetID();
int vtkId = elem->getVtkId();
- //MESSAGE("RemoveFreeElement " << elemId);
SMDSAbs_ElementType aType = elem->GetType();
SMDS_MeshElement* todest = (SMDS_MeshElement*)(elem);
if (aType == SMDSAbs_Node) {
- //MESSAGE("Remove free node " << elemId);
// only free node can be removed by this method
const SMDS_MeshNode* n = static_cast<SMDS_MeshNode*>(todest);
SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
// this methods is only for meshes without descendants
return;
- //MESSAGE("Remove free element " << elemId);
// Remove element from <InverseElements> of its nodes
SMDS_ElemIteratorPtr itn = elem->nodesIterator();
while (itn->more()) {
void SMDS_Mesh::Renumber (const bool isNodes, const int startID, const int deltaID)
{
- MESSAGE("Renumber");
if ( deltaID == 0 )
return;
// MESSAGE(" ------------------- resize myCellIdSmdsToVtk " << val << " --> " << val + nbNodes);
// myCellIdSmdsToVtk.resize(val + nbNodes, -1); // fill new elements with -1
int val = myNodes.size();
- MESSAGE(" ------------------- resize myNodes " << val << " --> " << val + nbNodes);
myNodes.resize(val +nbNodes, 0);
}
void SMDS_Mesh::incrementCellsCapacity(int nbCells)
{
int val = myCellIdVtkToSmds.size();
- MESSAGE(" ------------------- resize myCellIdVtkToSmds " << val << " --> " << val + nbCells);
myCellIdVtkToSmds.resize(val + nbCells, -1); // fill new elements with -1
val = myCells.size();
- MESSAGE(" ------------------- resize myCells " << val << " --> " << val + nbCells);
myNodes.resize(val +nbCells, 0);
}
void SMDS_Mesh::dumpGrid(string ficdump)
{
- MESSAGE("SMDS_Mesh::dumpGrid " << ficdump);
-// vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New();
-// aWriter->SetFileName(ficdump.c_str());
-// aWriter->SetInput(myGrid);
-// if(myGrid->GetNumberOfCells())
-// {
-// aWriter->Write();
-// }
-// aWriter->Delete();
+ // vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New();
+ // aWriter->SetFileName(ficdump.c_str());
+ // aWriter->SetInput(myGrid);
+ // if(myGrid->GetNumberOfCells())
+ // {
+ // aWriter->Write();
+ // }
+ // aWriter->Delete();
ficdump = ficdump + "_connectivity";
ofstream ficcon(ficdump.c_str(), ios::out);
int nbPoints = myGrid->GetNumberOfPoints();
ficcon << "-------------------------------- points " << nbPoints << endl;
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();
ficcon << "-------------------------------- cells " << nbCells << endl;
for (int i=0; i<nbCells; i++)
{
-// MESSAGE(i << " " << myGrid->GetCell(i));
-// MESSAGE(" " << myGrid->GetCell(i)->GetCellType());
- ficcon << i << " - " << myGrid->GetCell(i)->GetCellType() << " -";
- int nbptcell = myGrid->GetCell(i)->GetNumberOfPoints();
- vtkIdList *listid = myGrid->GetCell(i)->GetPointIds();
- for (int j=0; j<nbptcell; j++)
- {
- ficcon << " " << listid->GetId(j);
- }
- ficcon << endl;
+ ficcon << i << " - " << myGrid->GetCell(i)->GetCellType() << " -";
+ int nbptcell = myGrid->GetCell(i)->GetNumberOfPoints();
+ vtkIdList *listid = myGrid->GetCell(i)->GetPointIds();
+ for (int j=0; j<nbptcell; j++)
+ {
+ ficcon << " " << listid->GetId(j);
+ }
+ ficcon << endl;
}
ficcon << "-------------------------------- connectivity " << nbPoints << endl;
- vtkCellLinks *links = myGrid->GetCellLinks();
+ vtkCellLinks *links = myGrid->GetCellLinks();
for (int i=0; i<nbPoints; i++)
{
- int ncells = links->GetNcells(i);
- vtkIdType *cells = links->GetCells(i);
- ficcon << i << " - " << ncells << " -";
- for (int j=0; j<ncells; j++)
- {
- ficcon << " " << cells[j];
+ int ncells = links->GetNcells(i);
+ vtkIdType *cells = links->GetCells(i);
+ ficcon << i << " - " << ncells << " -";
+ for (int j=0; j<ncells; j++)
+ {
+ ficcon << " " << cells[j];
}
ficcon << endl;
}
if ((xmax - xmin) > dmax) dmax = xmax -xmin;
if ((ymax - ymin) > dmax) dmax = ymax -ymin;
if ((zmax - zmin) > dmax) dmax = zmax -zmin;
- MESSAGE("getMaxDim " << dmax);
return dmax;
}
void SMDS_Mesh::Modified()
{
if (this->myModified)
- {
- this->myModifTime++;
- MESSAGE("modified");
- myModified = false;
- }
+ {
+ this->myModifTime++;
+ myModified = false;
+ }
}
//! get last modification timeStamp
bool SMDS_Mesh::isCompacted()
{
if (this->myModifTime > this->myCompactTime)
- {
- MESSAGE(" *** isCompacted " << myCompactTime << " < " << myModifTime);
- this->myCompactTime = this->myModifTime;
- return false;
- }
+ {
+ this->myCompactTime = this->myModifTime;
+ return false;
+ }
return true;
}
int SMDS_MeshIDFactory::GetFreeID()
{
- int newid;
- if (myPoolOfID.empty())
- {
- newid = ++myMaxID;
- //MESSAGE("GetFreeID new " << newid);
- }
- else
- {
- set<int>::iterator i = myPoolOfID.begin();
- newid = *i;//myPoolOfID.top();
- myPoolOfID.erase( i );//myPoolOfID.pop();
- //MESSAGE("GetFreeID pool " << newid);
- }
- return newid;
+ int newid;
+ if (myPoolOfID.empty())
+ {
+ newid = ++myMaxID;
+ }
+ else
+ {
+ set<int>::iterator i = myPoolOfID.begin();
+ newid = *i;//myPoolOfID.top();
+ myPoolOfID.erase( i );//myPoolOfID.pop();
+ }
+ return newid;
}
//=======================================================================
//function : ReleaseID
-//purpose :
+//purpose :
//=======================================================================
void SMDS_MeshIDFactory::ReleaseID(int ID, int vtkId)
{
void SMDS_MeshIDFactory::Clear()
{
- myMaxID = 0;
- myPoolOfID.clear();
+ myMaxID = 0;
+ myPoolOfID.clear();
}
void SMDS_MeshIDFactory::SetMesh(SMDS_Mesh *mesh)
{
- myMesh = mesh;
+ myMesh = mesh;
}
SMDS_Mesh* SMDS_MeshIDFactory::GetMesh()
{
- return myMesh;
+ return myMesh;
}
void SMDS_MeshIDFactory::emptyPool(int maxId)
{
- MESSAGE("SMDS_MeshIDFactory::emptyPool " << myMaxID << " --> " << maxId);
- myMaxID = maxId;
- myPoolOfID.clear();
+ myMaxID = maxId;
+ myPoolOfID.clear();
}
SMDS_CellLinks* SMDS_CellLinks::New()
{
- MESSAGE("SMDS_CellLinks::New");
return new SMDS_CellLinks();
}
SMDS_UnstructuredGrid* SMDS_UnstructuredGrid::New()
{
- MESSAGE("SMDS_UnstructuredGrid::New");
return new SMDS_UnstructuredGrid();
}
unsigned long SMDS_UnstructuredGrid::GetMTime()
{
unsigned long mtime = vtkUnstructuredGrid::GetMTime();
- MESSAGE("vtkUnstructuredGrid::GetMTime: " << mtime);
return mtime;
}
// OUV_PORTING_VTK6: seems to be useless
/*
void SMDS_UnstructuredGrid::Update()
{
- MESSAGE("SMDS_UnstructuredGrid::Update");
return vtkUnstructuredGrid::Update();
}
void SMDS_UnstructuredGrid::UpdateInformation()
{
- MESSAGE("SMDS_UnstructuredGrid::UpdateInformation");
return vtkUnstructuredGrid::UpdateInformation();
}
*/
vtkPoints* SMDS_UnstructuredGrid::GetPoints()
{
// 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 vtkUnstructuredGrid::InsertNextLinkedCell(type, npts, pts);
// --- type = VTK_POLYHEDRON
- //MESSAGE("InsertNextLinkedCell VTK_POLYHEDRON");
int cellid = this->InsertNextCell(type, npts, pts);
set<vtkIdType> setOfNodes;
i++;
for (int k = 0; k < nbnodes; k++)
{
- //MESSAGE(" cell " << cellid << " face " << nf << " node " << pts[i]);
setOfNodes.insert(pts[i]);
i++;
}
set<vtkIdType>::iterator it = setOfNodes.begin();
for (; it != setOfNodes.end(); ++it)
{
- //MESSAGE("reverse link for node " << *it << " cell " << cellid);
this->Links->ResizeCellList(*it, 1);
this->Links->AddCellReference(cellid, *it);
}
void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int newNodeSize,
std::vector<int>& idCellsOldToNew, int newCellSize)
{
- MESSAGE("------------------------- SMDS_UnstructuredGrid::compactGrid " << newNodeSize << " " << newCellSize);//CHRONO(1);
+ //MESSAGE("------------------------- compactGrid " << newNodeSize << " " << newCellSize);//CHRONO(1);
int alreadyCopied = 0;
// --- if newNodeSize, create a new compacted vtkPoints
newPoints->SetNumberOfPoints(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"
// using double type for storing coordinates of nodes instead float.
int oldNodeSize = idNodesOldToNew.size();
newConnectivity->Initialize();
int oldCellDataSize = this->Connectivity->GetData()->GetSize();
newConnectivity->Allocate(oldCellDataSize);
- MESSAGE("oldCellSize="<< oldCellSize << " oldCellDataSize=" << oldCellDataSize);
vtkUnsignedCharArray *newTypes = vtkUnsignedCharArray::New();
newTypes->Initialize();
newConnectivity->Squeeze();
if (1/*newNodeSize*/)
- {
- MESSAGE("------- newNodeSize, setPoints");
- this->SetPoints(newPoints);
- MESSAGE("NumberOfPoints: " << this->GetNumberOfPoints());
- }
+ {
+ this->SetPoints(newPoints);
+ }
if (vtkDoubleArray* diameters =
vtkDoubleArray::SafeDownCast( vtkDataSet::CellData->GetScalars() )) // Balls
}
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();
- newFaceLocations->Initialize();
- newFaceLocations->Allocate(newTypes->GetSize());
- vtkIdTypeArray *newFaces = vtkIdTypeArray::New();
- newFaces->Initialize();
- newFaces->Allocate(this->Faces->GetSize());
- for (int i = 0; i < oldCellSize; i++)
+ if (this->Types->GetValue(i) == VTK_EMPTY_CELL)
+ continue;
+ int newCellId = idCellsOldToNew[i];
+ if (newTypes->GetValue(newCellId) == VTK_POLYHEDRON)
+ {
+ newFaceLocations->InsertNextValue(newFaces->GetMaxId()+1);
+ 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)
- continue;
- int newCellId = idCellsOldToNew[i];
- if (newTypes->GetValue(newCellId) == VTK_POLYHEDRON)
- {
- newFaceLocations->InsertNextValue(newFaces->GetMaxId()+1);
- 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);
- }
+ 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]);
+ }
}
- newFaceLocations->Squeeze();
- newFaces->Squeeze();
- this->SetCells(newTypes, newLocations, newConnectivity, newFaceLocations, newFaces);
- newFaceLocations->Delete();
- newFaces->Delete();
+ }
+ else
+ {
+ newFaceLocations->InsertNextValue(-1);
+ }
}
+ newFaceLocations->Squeeze();
+ newFaces->Squeeze();
+ this->SetCells(newTypes, newLocations, newConnectivity, newFaceLocations, newFaces);
+ newFaceLocations->Delete();
+ newFaces->Delete();
+ }
else
{
this->SetCells(newTypes, newLocations, newConnectivity, FaceLocations, Faces);
this->BuildLinks();
}
-void SMDS_UnstructuredGrid::copyNodes(vtkPoints *newPoints, std::vector<int>& idNodesOldToNew, int& alreadyCopied,
- int start, int end)
+void SMDS_UnstructuredGrid::copyNodes(vtkPoints * newPoints,
+ std::vector<int>& idNodesOldToNew,
+ int& alreadyCopied,
+ int start,
+ int end)
{
- MESSAGE("copyNodes " << alreadyCopied << " " << start << " " << end << " size: " << end - start << " total: " << alreadyCopied + end - start);
void *target = newPoints->GetVoidPointer(3 * alreadyCopied);
void *source = this->Points->GetVoidPointer(3 * start);
int nbPoints = end - start;
int start,
int end)
{
- //MESSAGE("copyBloc " << alreadyCopied << " " << start << " " << end << " size: " << end - start << " total: " << alreadyCopied + end - start);
for (int j = start; j < end; j++)
{
newTypes->SetValue(alreadyCopied, this->Types->GetValue(j));
vtkIdType *oldPtsCell = 0;
this->Connectivity->GetCell(oldLoc, nbpts, oldPtsCell);
assert(nbpts < NBMAXNODESINCELL);
- //MESSAGE(j << " " << alreadyCopied << " " << (int)this->Types->GetValue(j) << " " << oldLoc << " " << nbpts );
for (int l = 0; l < nbpts; l++)
{
int oldval = oldPtsCell[l];
pointsCell[l] = idNodesOldToNew[oldval];
- //MESSAGE(" " << oldval << " " << pointsCell[l]);
}
/*int newcnt = */newConnectivity->InsertNextCell(nbpts, pointsCell);
int newLoc = newConnectivity->GetInsertLocation(nbpts);
- //MESSAGE(newcnt << " " << newLoc);
newLocations->SetValue(alreadyCopied, newLoc);
alreadyCopied++;
}
{
if ((vtkCellId < 0) || (vtkCellId >= (int)_cellIdToDownId.size()))
{
- //MESSAGE("SMDS_UnstructuredGrid::CellIdToDownId structure not up to date: vtkCellId="
- // << vtkCellId << " max="<< _cellIdToDownId.size());
return -1;
}
return _cellIdToDownId[vtkCellId];
* @param nodeDomains: map(original id --> map(domain --> duplicated node id))
* @return ok if success.
*/
-SMDS_MeshCell* SMDS_UnstructuredGrid::extrudeVolumeFromFace(int vtkVolId,
- int domain1,
- int domain2,
- std::set<int>& originalNodes,
- std::map<int, std::map<int, int> >& nodeDomains,
- std::map<int, std::map<long, int> >& nodeQuadDomains)
+SMDS_MeshCell*
+SMDS_UnstructuredGrid::extrudeVolumeFromFace(int vtkVolId,
+ int domain1,
+ int domain2,
+ std::set<int>& originalNodes,
+ std::map<int, std::map<int, int> >& nodeDomains,
+ std::map<int, std::map<long, int> >& nodeQuadDomains)
{
//MESSAGE("extrudeVolumeFromFace " << vtkVolId);
vector<vtkIdType> orderedOriginals;
bool isQuadratic = false;
switch (orderedOriginals.size())
{
- case 3:
- if (dim == 2)
- isQuadratic = true;
- break;
- case 6:
- case 8:
+ case 3:
+ if (dim == 2)
isQuadratic = true;
- break;
- default:
- isQuadratic = false;
+ break;
+ case 6:
+ case 8:
+ isQuadratic = true;
+ break;
+ default:
+ isQuadratic = false;
break;
}
SMESH_Gen::SMESH_Gen()
{
- MESSAGE("SMESH_Gen::SMESH_Gen");
_localId = 0;
_hypId = 0;
_segmentation = _nbSegments = 10;
SMDS_Mesh::_meshList.clear();
- MESSAGE(SMDS_Mesh::_meshList.size());
_compute_canceled = false;
//vtkDebugLeaks::SetExitError(0);
}
SMESH_Gen::~SMESH_Gen()
{
- MESSAGE("SMESH_Gen::~SMESH_Gen");
std::map < int, StudyContextStruct * >::iterator i_sc = _mapStudyContext.begin();
for ( ; i_sc != _mapStudyContext.end(); ++i_sc )
{
throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
- MESSAGE("SMESH_Gen::CreateMesh");
// Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
StudyContextStruct *aStudyContext = GetStudyContext(theStudyId);
const ::MeshDimension aDim /*=::MeshDim_3D*/,
TSetOfInt* aShapesId /*=0*/)
{
- MESSAGE("SMESH_Gen::Compute");
MEMOSTAT;
bool ret = true;
ret = Compute( aMesh, aShape, aShapeOnly, /*anUpward=*/true, aDim, aShapesId );
}
- MESSAGE( "VSR - SMESH_Gen::Compute() finished, OK = " << ret);
MEMOSTAT;
SMESHDS_Mesh *myMesh = aMesh.GetMeshDS();
- MESSAGE("*** compactMesh after compute");
+ //MESSAGE("*** compactMesh after compute");
myMesh->compactMesh();
// fix quadratic mesh by bending iternal links near concave boundary
const bool anUpward,
TSetOfInt* aShapesId)
{
- MESSAGE("SMESH_Gen::Evaluate");
-
bool ret = true;
SMESH_subMesh *sm = aMesh.GetSubMesh(aShape);
if ( aCheckedMap.count( aSubMesh ))
return true;
- //MESSAGE("=====checkMissing");
-
int ret = true;
SMESH_Algo* algo = 0;
const TopoDS_Shape& theShape,
list< TAlgoStateError > & theErrors)
{
- //MESSAGE("SMESH_Gen::CheckAlgoState");
-
bool ret = true;
bool hasAlgo = false;
// well defined
// ----------------------------------------------------------------
- //MESSAGE( "---info on missing hypothesis and find out if all needed algos are");
-
// find max dim of global algo
int aTopAlgoDim = 0;
for (dim = 3; dim > 0; dim--)
SMESH_Hypothesis::~SMESH_Hypothesis()
{
- MESSAGE("SMESH_Hypothesis::~SMESH_Hypothesis");
StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
myStudyContext->mapHypothesis[_hypId] = 0;
}
void SMESH_Hypothesis::NotifySubMeshesHypothesisModification()
{
- MESSAGE("SMESH_Hypothesis::NotifySubMeshesHypothesisModification");
-
// for all meshes in study
StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
bool SMESH_MeshEditor::InverseDiag (const SMDS_MeshElement * theTria1,
const SMDS_MeshElement * theTria2 )
{
- MESSAGE("InverseDiag");
myLastCreatedElems.Clear();
myLastCreatedNodes.Clear();
myLastCreatedElems.Clear();
myLastCreatedNodes.Clear();
- MESSAGE( "::InverseDiag()" );
-
const SMDS_MeshElement *tr1, *tr2;
if ( !findTriangles( theNode1, theNode2, tr1, tr2 ))
return false;
myLastCreatedElems.Clear();
myLastCreatedNodes.Clear();
- MESSAGE( "::DeleteDiag()" );
-
const SMDS_MeshElement *tr1, *tr2;
if ( !findTriangles( theNode1, theNode2, tr1, tr2 ))
return false;
bool SMESH_MeshEditor::Reorient (const SMDS_MeshElement * theElem)
{
- MESSAGE("Reorient");
myLastCreatedElems.Clear();
myLastCreatedNodes.Clear();
myLastCreatedElems.Clear();
myLastCreatedNodes.Clear();
- MESSAGE( "::QuadToTri()" );
-
SMESHDS_Mesh * aMesh = GetMeshDS();
Handle(Geom_Surface) surface;
myLastCreatedElems.Clear();
myLastCreatedNodes.Clear();
- MESSAGE( "::TriToQuad()" );
-
if ( !theCrit.get() )
return false;
myLastCreatedElems.Clear();
myLastCreatedNodes.Clear();
- MESSAGE((theSmoothMethod==LAPLACIAN ? "LAPLACIAN" : "CENTROIDAL") << "--::Smooth()");
-
if ( theTgtAspectRatio < 1.0 )
theTgtAspectRatio = 1.0;
const size_t nbSteps,
SMESH_SequenceOfElemPtr& srcElements)
{
- //MESSAGE("sweepElement " << nbSteps);
SMESHDS_Mesh* aMesh = GetMeshDS();
const int nbNodes = elem->NbNodes();
// source elements for each generated one
SMESH_SequenceOfElemPtr srcElems, srcNodes;
- MESSAGE( "RotationSweep()");
gp_Trsf aTrsf;
aTrsf.SetRotation( theAxis, theAngle );
gp_Trsf aTrsf2;
const gp_Pnt& theRefPoint,
const bool theMakeGroups)
{
- MESSAGE("ExtrusionAlongTrack");
myLastCreatedElems.Clear();
myLastCreatedNodes.Clear();
string groupPostfix;
switch ( theTrsf.Form() ) {
case gp_PntMirror:
- MESSAGE("gp_PntMirror");
needReverse = true;
groupPostfix = "mirrored";
break;
case gp_Ax1Mirror:
- MESSAGE("gp_Ax1Mirror");
groupPostfix = "mirrored";
break;
case gp_Ax2Mirror:
- MESSAGE("gp_Ax2Mirror");
needReverse = true;
groupPostfix = "mirrored";
break;
case gp_Rotation:
- MESSAGE("gp_Rotation");
groupPostfix = "rotated";
break;
case gp_Translation:
- MESSAGE("gp_Translation");
groupPostfix = "translated";
break;
case gp_Scale:
- MESSAGE("gp_Scale");
groupPostfix = "scaled";
break;
case gp_CompoundTrsf: // different scale by axis
- MESSAGE("gp_CompoundTrsf");
groupPostfix = "scaled";
break;
default:
- MESSAGE("default");
needReverse = false;
groupPostfix = "transformed";
}
void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes)
{
- MESSAGE("MergeNodes");
myLastCreatedElems.Clear();
myLastCreatedNodes.Clear();
myLastCreatedElems.Clear();
myLastCreatedNodes.Clear();
- MESSAGE("::SewFreeBorder()");
Sew_Error aResult = SEW_OK;
// ====================================
myLastCreatedElems.Clear();
myLastCreatedNodes.Clear();
- MESSAGE ("::::SewSideElements()");
if ( theSide1.size() != theSide2.size() )
return SEW_DIFF_NB_OF_ELEMENTS;
TNodeNodeMap& theNodeNodeMap,
const bool theIsDoubleElem )
{
- MESSAGE("doubleNodes");
// iterate through element and duplicate them (by nodes duplication)
bool res = false;
std::vector<const SMDS_MeshNode*> newNodes;
bool SMESH_MeshEditor::DoubleNodes( const std::list< int >& theListOfNodes,
const std::list< int >& theListOfModifiedElems )
{
- MESSAGE("DoubleNodes");
myLastCreatedElems.Clear();
myLastCreatedNodes.Clear();
const SMDS_MeshElement* anElem = anElemToNodesIter->first;
vector<const SMDS_MeshNode*> aNodeArr = anElemToNodesIter->second;
if ( anElem )
- {
- MESSAGE("ChangeElementNodes");
+ {
aMeshDS->ChangeElementNodes( anElem, &aNodeArr[ 0 ], anElem->NbNodes() );
- }
+ }
}
return true;
continue;
gp_XYZ normal;
SMESH_MeshAlgos::FaceNormal( anElem, normal, /*normalized=*/true );
- MESSAGE("element " << ielem++ << " normal " << normal.X() << " " << normal.Y() << " " << normal.Z());
std::set<const SMDS_MeshNode*> nodesElem;
nodesElem.clear();
SMDS_ElemIteratorPtr nodeItr = anElem->nodesIterator();
std::set<const SMDS_MeshNode*>::iterator nodit = nodesElem.begin();
for (; nodit != nodesElem.end(); nodit++)
{
- MESSAGE(" noeud ");
const SMDS_MeshNode* aNode = *nodit;
if ( !aNode || theNodesNot.find(aNode) != theNodesNot.end() )
continue;
SMDS_ElemIteratorPtr backElemItr = aNode->GetInverseElementIterator();
while ( backElemItr->more() )
{
- MESSAGE(" backelem ");
const SMDS_MeshElement* curElem = backElemItr->next();
if (alreadyCheckedElems.find(curElem) != alreadyCheckedElems.end())
continue;
p.SetCoord( x/nb -aNode->X(),
y/nb -aNode->Y(),
z/nb -aNode->Z() );
- MESSAGE(" check " << p.X() << " " << p.Y() << " " << p.Z());
if (normal*p > 0)
{
- MESSAGE(" --- inserted")
theAffectedElems.insert( curElem );
}
else if (curElem->GetType() == SMDSAbs_Edge)
}
if (onside)
{
- MESSAGE(" --- edge onside inserted")
theAffectedElems.insert(anEdge);
}
}
int ielem;
for ( ielem = 1; elemItr != theElems.end(); ++elemItr )
{
- MESSAGE("element " << ielem++);
SMDS_MeshElement* anElem = (SMDS_MeshElement*)*elemItr;
if (!anElem)
continue;
SMDS_ElemIteratorPtr nodeItr = anElem->nodesIterator();
while ( nodeItr->more() )
{
- MESSAGE(" noeud ");
const SMDS_MeshNode* aNode = cast2Node(nodeItr->next());
if ( !aNode || theNodesNot.find(aNode) != theNodesNot.end() )
continue;
SMDS_ElemIteratorPtr backElemItr = aNode->GetInverseElementIterator();
while ( backElemItr->more() )
{
- MESSAGE(" backelem ");
const SMDS_MeshElement* curElem = backElemItr->next();
if ( curElem && theElems.find(curElem) == theElems.end() &&
( bsc3d.get() ?
*/
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 v1(p0, g1);
gp_Vec v2(p0, g2);
}
#if defined(_DEBUG_) || defined(_DEBUG)
-#define MEMOSTAT memostat( __FILE__, __LINE__ )
+#define MEMOSTAT //memostat( __FILE__, __LINE__ )
#else
#define MEMOSTAT
#endif
#endif
#ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
#else
static int MYDEBUG = 0;
#endif
SMESH_Client::Update(bool theIsClear)
{
bool anIsModified = true;
- if(mySMESHDSMesh){
- MESSAGE("Update mySMESHDSMesh");
+ if(mySMESHDSMesh)
+ {
+ if ( MYDEBUG ) MESSAGE("Update mySMESHDSMesh");
SMESHDS_Script* aScript = mySMESHDSMesh->GetScript();
anIsModified = aScript->IsModified();
aScript->SetModified(false);
- }else{
- MESSAGE("Update CORBA");
+ }
+ else
+ {
+ if ( MYDEBUG ) MESSAGE("Update CORBA");
SMESH::log_array_var aSeq = myMeshServer->GetLog( theIsClear );
CORBA::Long aLength = aSeq->length();
anIsModified = aLength > 0;
- if( MYDEBUG )
- MESSAGE( "Update: length of the script is "<<aLength );
+ if ( MYDEBUG ) MESSAGE( "Update: length of the script is "<<aLength );
- if(!anIsModified)
+ if ( !anIsModified )
return false;
// update client mesh structure by logged changes commands
const SMDS_MeshNode * nodes[],
const int nbnodes)
{
- //MESSAGE("SMESHDS_Mesh::ChangeElementNodes");
if ( ! SMDS_Mesh::ChangeElementNodes( elem, nodes, nbnodes ))
return false;
SMESHDS_SubMesh * subMesh,
bool fromGroups)
{
- //MESSAGE(" --------------------------------> SMESHDS_Mesh::RemoveFreeElement " << subMesh << " " << fromGroups);
if (elt->GetType() == SMDSAbs_Node) {
RemoveFreeNode( static_cast<const SMDS_MeshNode*>(elt), subMesh, fromGroups);
return;
bool all = ( type == TopAbs_SHAPE );
if ( all ) // corresponding simple submesh may exist
aMainIndex = -aMainIndex;
- //MESSAGE("AddCompoundSubmesh index = " << aMainIndex );
SMESHDS_SubMesh * aNewSub = NewSubMesh( aMainIndex );
if ( !aNewSub->IsComplexSubmesh() ) // is empty
{
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n5,
- const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
- const SMDS_MeshNode * n8,
+ const SMDS_MeshNode * n8,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
- const SMDS_MeshNode * n41,
+ const SMDS_MeshNode * n41,
const SMDS_MeshNode * n56,
const SMDS_MeshNode * n67,
const SMDS_MeshNode * n78,
- const SMDS_MeshNode * n85,
+ const SMDS_MeshNode * n85,
const SMDS_MeshNode * n15,
const SMDS_MeshNode * n26,
const SMDS_MeshNode * n37,
int newNodeSize = 0;
int nbNodes = myNodes.size();
int nbVtkNodes = myGrid->GetNumberOfPoints();
- MESSAGE("nbNodes=" << nbNodes << " nbVtkNodes=" << nbVtkNodes);
+ //MESSAGE("nbNodes=" << nbNodes << " nbVtkNodes=" << nbVtkNodes);
int nbNodeTemp = nbVtkNodes;
if (nbNodes > nbVtkNodes)
nbNodeTemp = nbNodes;
idNodesOldToNew.resize(nbNodeTemp, -1); // all unused id will be -1
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)
- newNodeSize++;
- }
+ int vtkid = myNodes[i]->getVtkId();
+ idNodesOldToNew[vtkid] = i; // old vtkId --> old smdsId (valid smdsId are >= 0)
+ newNodeSize++;
}
+ }
bool areNodesModified = (newNodeSize < nbVtkNodes);
- MESSAGE("------------------------- compactMesh Nodes Modified: " << areNodesModified);
+ //MESSAGE("------------------------- compactMesh Nodes Modified: " << areNodesModified);
areNodesModified = true;
int newCellSize = 0;
int nbCells = myCells.size();
int nbVtkCells = myGrid->GetNumberOfCells();
- MESSAGE("nbCells=" << nbCells << " nbVtkCells=" << nbVtkCells);
+ //MESSAGE("nbCells=" << nbCells << " nbVtkCells=" << nbVtkCells);
int nbCellTemp = nbVtkCells;
if (nbCells > nbVtkCells)
nbCellTemp = nbCells;
idCellsOldToNew.resize(nbCellTemp, -1); // all unused id will be -1
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[vtkid] = i; // old vtkId --> old smdsId (not used in input)
- newCellSize++;
- }
+ // //idCellsOldToNew[i] = myCellIdVtkToSmds[i]; // valid vtk indexes are > = 0
+ // int vtkid = myCells[i]->getVtkId();
+ // idCellsOldToNew[vtkid] = i; // old vtkId --> old smdsId (not used in input)
+ newCellSize++;
}
+ }
if (areNodesModified)
myGrid->compactGrid(idNodesOldToNew, newNodeSize, idCellsOldToNew, newCellSize);
else
int nbVtkPts = myGrid->GetNumberOfPoints();
nbVtkCells = myGrid->GetNumberOfCells();
if (nbVtkPts != newNodeSize)
- {
- MESSAGE("===> nbVtkPts != newNodeSize " << nbVtkPts << " " << newNodeSize);
- if (nbVtkPts > newNodeSize) newNodeSize = nbVtkPts; // several points with same SMDS Id
- }
+ {
+ MESSAGE("===> nbVtkPts != newNodeSize " << nbVtkPts << " " << newNodeSize);
+ if (nbVtkPts > newNodeSize) newNodeSize = nbVtkPts; // several points with same SMDS Id
+ }
if (nbVtkCells != newCellSize)
- {
- MESSAGE("===> nbVtkCells != newCellSize " << nbVtkCells << " " << newCellSize);
- if (nbVtkCells > newCellSize) newCellSize = nbVtkCells; // several cells with same SMDS Id
- }
+ {
+ MESSAGE("===> nbVtkCells != newCellSize " << nbVtkCells << " " << newCellSize);
+ 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
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");
- SetOfNodes newNodes;
- newNodes.resize(newNodeSize+1,0); // 0 not used, SMDS numbers 1..n
- int newSmdsId = 0;
- for (int i = 0; i < nbNodes; i++)
- {
- if (myNodes[i])
- {
- newSmdsId++; // SMDS id start to 1
- int oldVtkId = myNodes[i]->getVtkId();
- 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());
+ if (myNodes[i])
+ {
+ newSmdsId++; // SMDS id start to 1
+ int oldVtkId = myNodes[i]->getVtkId();
+ 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());
+ }
// --- SMDS_MeshCell, myCellIdVtkToSmds, myCellIdSmdsToVtk, myCells
int vtkIndexSize = myCellIdVtkToSmds.size();
int maxVtkId = -1;
for (int oldVtkId = 0; oldVtkId < vtkIndexSize; oldVtkId++)
+ {
+ int oldSmdsId = this->myCellIdVtkToSmds[oldVtkId];
+ if (oldSmdsId > 0)
{
- int oldSmdsId = this->myCellIdVtkToSmds[oldVtkId];
- if (oldSmdsId > 0)
- {
- int newVtkId = idCellsOldToNew[oldVtkId];
- if (newVtkId > maxVtkId)
- maxVtkId = newVtkId;
- //MESSAGE("myCells["<< oldSmdsId << "] vtkId " << oldVtkId << " --> " << newVtkId);
- myCells[oldSmdsId]->setVtkId(newVtkId);
- }
+ int newVtkId = idCellsOldToNew[oldVtkId];
+ if (newVtkId > maxVtkId)
+ maxVtkId = newVtkId;
+ //MESSAGE("myCells["<< oldSmdsId << "] vtkId " << oldVtkId << " --> " << newVtkId);
+ myCells[oldSmdsId]->setVtkId(newVtkId);
}
-// MESSAGE("myCells.size()=" << myCells.size()
-// << " myCellIdSmdsToVtk.size()=" << myCellIdSmdsToVtk.size()
-// << " myCellIdVtkToSmds.size()=" << myCellIdVtkToSmds.size() );
+ }
+ // MESSAGE("myCells.size()=" << myCells.size()
+ // << " myCellIdSmdsToVtk.size()=" << myCellIdSmdsToVtk.size()
+ // << " myCellIdVtkToSmds.size()=" << myCellIdVtkToSmds.size() );
SetOfCells newCells;
//vector<int> newSmdsToVtk;
myCells.swap(newCells);
//myCellIdSmdsToVtk.swap(newSmdsToVtk);
myCellIdVtkToSmds.swap(newVtkToSmds);
- MESSAGE("myCells.size()=" << myCells.size()
- << " myCellIdVtkToSmds.size()=" << myCellIdVtkToSmds.size() );
+ //MESSAGE("myCells.size()="<< myCells.size()<<" myCellIdVtkToSmds.size()="<<myCellIdVtkToSmds.size() );
this->myElementIDFactory->emptyPool(newSmdsId);
this->myScript->SetModified(true); // notify GUI client for buildPrs when update
if(!anIO.IsNull()){
_PTR(SObject) SO = aStudy->FindObjectID( It.Value()->getEntry() );
if ( SO ) {
- CORBA::Object_var aObject = SMESH::SObjectToObject( SO );
- SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( aObject );
- SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( aObject );
- SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( aObject );
- if ( !aMesh->_is_nil() || !aSubMesh->_is_nil() || !aGroup->_is_nil() ) {
- if ( SMESH_Actor *anActor = SMESH::FindActorByEntry(anIO->getEntry()) ) {
- anActor->SetControlMode(aControl);
- anActor->GetScalarBarActor()->SetTitle( functorToString( anActor->GetFunctor() ).toLatin1().constData() );
+ CORBA::Object_var aObject = SMESH::SObjectToObject( SO );
+ SMESH::SMESH_IDSource_var anIDSrc = SMESH::SMESH_IDSource::_narrow( aObject );
+ if ( !anIDSrc->_is_nil() ) {
+ if ( SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry()) ) {
+ QString functorName = functorToString( anActor->GetFunctor() );
+ anActor->SetControlMode( aControl );
+ anActor->GetScalarBarActor()->SetTitle( functorName.toLatin1().constData() );
SMESH::RepaintCurrentView();
#ifndef DISABLE_PLOT2DVIEWER
if ( anActor->GetPlot2Histogram() ) {
SPlot2d_Histogram* aHistogram = anActor->UpdatePlot2Histogram();
- QString functorName = functorToString( anActor->GetFunctor() );
QString aHistogramName("%1 : %2");
aHistogramName = aHistogramName.arg( anIO->getName() ).arg( functorName );
aHistogram->setName( aHistogramName );
{
CORBA::Boolean anIsEmbeddedMode;
myComponentSMESH = SMESH_Client::GetSMESHGen(getApp()->orb(),anIsEmbeddedMode);
- MESSAGE("-------------------------------> anIsEmbeddedMode=" << anIsEmbeddedMode);
+ //MESSAGE("-------------------------------> anIsEmbeddedMode=" << anIsEmbeddedMode);
// 0019923: EDF 765 SMESH : default values of hypothesis
SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this);
case SMESHOp::OpShow:
case SMESHOp::OpShowOnly:
{
+ SUIT_OverrideCursor wc;
SMESH::EDisplaing anAction;
switch (theCommandID) {
case SMESHOp::OpHide: anAction = SMESH::eErase; break;
if ( theCommandID==SMESHOp::OpShowOnly )
{
- MESSAGE("anAction = SMESH::eDisplayOnly");
+ //MESSAGE("anAction = SMESH::eDisplayOnly");
startOperation( myEraseAll );
}
// PAL13338 + PAL15161 -->
if ( ( theCommandID==SMESHOp::OpShow || theCommandID==SMESHOp::OpShowOnly ) && !checkLock(aStudy)) {
- MESSAGE("anAction = SMESH::eDisplayOnly");
SMESH::UpdateView();
SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged();
}
}
if (anAction == SMESH::eErase) {
- MESSAGE("anAction == SMESH::eErase");
SALOME_ListIO l1;
aSel->setSelectedObjects( l1 );
}
( new SMESHGUI_NodesDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"),
- tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(),tr("SMESH_WRN_WARNING"),tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), tr( "NOT_A_VTK_VIEWER" ) );
break;
}
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), tr( "NOT_A_VTK_VIEWER" ) );
break;
}
( new SMESHGUI_SmoothingDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(), tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
EmitSignalDeactivateDialog();
( new SMESHGUI_ExtrusionDlg ( this ) )->show();
} else {
- SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(),tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
EmitSignalDeactivateDialog();
( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show();
} else {
- SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(),tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
( new SMESHGUI_RevolutionDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(),tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
( new SMESHGUI_MeshPatternDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(),tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),tr( "NOT_A_VTK_VIEWER" ) );
break;
}
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),tr( "NOT_A_VTK_VIEWER" ) );
break;
}
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),tr( "NOT_A_VTK_VIEWER" ) );
break;
}
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),tr( "NOT_A_VTK_VIEWER" ) );
break;
}
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),tr( "NOT_A_VTK_VIEWER" ) );
break;
}
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),tr( "NOT_A_VTK_VIEWER" ) );
break;
}
( new SMESHGUI_AddMeshElementDlg( this, type ) )->show();
}
else {
- SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(),tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(),tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
return false;
if ( algoData->BasicHypos.contains( hypType ))
return true;
- if ( algoData->OptionalHypos.contains( hypType)) {
+ if ( algoData->OptionalHypos.contains( hypType )) {
isAuxiliary = true;
return true;
}
bool Update(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
{
- MESSAGE("Update");
+ //MESSAGE("Update");
_PTR(Study) aStudy = GetActiveStudyDocument();
CORBA::Long anId = aStudy->StudyId();
if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry())) {
bool UpdateNulData(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
{
- MESSAGE("UpdateNulData");
+ //MESSAGE("UpdateNulData");
_PTR(Study) aStudy = GetActiveStudyDocument();
CORBA::Long anId = aStudy->StudyId();
if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry(), true)) {
return false;
}
- void UpdateSelectionProp( SMESHGUI* theModule ) {
+ void UpdateSelectionProp( SMESHGUI* theModule )
+ {
if( !theModule )
return;
return;
}
- QColor aHiColor = mgr->colorValue( "SMESH", "selection_object_color", Qt::white ),
- aSelColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow ),
- aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
+ QColor
+ aHiColor = mgr->colorValue( "SMESH", "selection_object_color", Qt::white ),
+ 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 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 maxSize = aElem0DSize;
if (aElem0DSize > maxSize) maxSize = aElem0DSize;
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 ),
- SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ),
- SP3 = mgr->doubleValue( "SMESH", "selection_precision_object", 0.025 );
+ double
+ SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 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
- if(SVTK_ViewWindow* aVtkView = GetVtkViewWindow( views[i] )){
+ if ( SVTK_ViewWindow* aVtkView = GetVtkViewWindow( views[i] ))
+ {
// mesh element selection
aVtkView->SetSelectionProp(aSelColor.red()/255.,
aSelColor.green()/255.,
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
- while(vtkActor *anAct = aCollection->GetNextActor()){
- if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
+ while ( vtkActor *anAct = aCollection->GetNextActor() ) {
+ if ( SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct) ) {
anActor->SetHighlightColor(aHiColor.red()/255.,
aHiColor.green()/255.,
aHiColor.blue()/255.);
//----------------------------------------------------------------------------
- void SetPointRepresentation(bool theIsVisible){
- if(SVTK_ViewWindow* aViewWindow = GetCurrentVtkView()){
+ void SetPointRepresentation(bool theIsVisible)
+ {
+ if ( SVTK_ViewWindow* aViewWindow = GetCurrentVtkView() ) {
vtkRenderer *aRenderer = aViewWindow->getRenderer();
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
vtkActorCollection *aCollection = aCopy.GetActors();
}
- void SetPickable(SMESH_Actor* theActor){
- if(SVTK_ViewWindow* aWnd = GetCurrentVtkView()){
+ void SetPickable(SMESH_Actor* theActor)
+ {
+ if ( SVTK_ViewWindow* aWnd = GetCurrentVtkView() ) {
int anIsAllPickable = (theActor == NULL);
vtkRenderer *aRenderer = aWnd->getRenderer();
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
//----------------------------------------------------------------------------
- int GetNameOfSelectedNodes(SVTK_Selector* theSelector,
+ int GetNameOfSelectedNodes(SVTK_Selector* theSelector,
const Handle(SALOME_InteractiveObject)& theIO,
- QString& theName)
+ QString& theName)
{
theName = "";
TColStd_IndexedMapOfInteger aMapIndex;
return -1;
}
- int GetNameOfSelectedNodes(LightApp_SelectionMgr *theMgr, QString& theName){
+ int GetNameOfSelectedNodes(LightApp_SelectionMgr *theMgr, QString& theName)
+ {
theName = "";
SALOME_ListIO selected; theMgr->selectedObjects( selected );
if(selected.Extent() == 1){
}
- int GetNameOfSelectedElements(LightApp_SelectionMgr *theMgr,
+ int GetNameOfSelectedElements(LightApp_SelectionMgr * theMgr,
const Handle(SALOME_InteractiveObject)& theIO,
- QString& theName)
+ QString& theName)
{
theName = "";
if(theIO->hasEntry()){
}
double aBoundPoints[8][3] = { {theBounds[0],theBounds[2],theBounds[4]},
- {theBounds[1],theBounds[2],theBounds[4]},
- {theBounds[0],theBounds[3],theBounds[4]},
- {theBounds[1],theBounds[3],theBounds[4]},
- {theBounds[0],theBounds[2],theBounds[5]},
- {theBounds[1],theBounds[2],theBounds[5]},
- {theBounds[0],theBounds[3],theBounds[5]},
- {theBounds[1],theBounds[3],theBounds[5]}};
+ {theBounds[1],theBounds[2],theBounds[4]},
+ {theBounds[0],theBounds[3],theBounds[4]},
+ {theBounds[1],theBounds[3],theBounds[4]},
+ {theBounds[0],theBounds[2],theBounds[5]},
+ {theBounds[1],theBounds[2],theBounds[5]},
+ {theBounds[0],theBounds[3],theBounds[5]},
+ {theBounds[1],theBounds[3],theBounds[5]}};
int aMaxId = 0;
theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]);
*/
//================================================================================
- void ClearPlot2Viewers( SUIT_ViewWindow* theWindow ) {
- if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWindow)){
+ void ClearPlot2Viewers( SUIT_ViewWindow* theWindow )
+ {
+ if ( SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWindow) ) {
vtkRenderer *aRenderer = aViewWindow->getRenderer();
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
vtkActorCollection *aCollection = aCopy.GetActors();
}
}
}
-
+
#endif
} // end of namespace SMESH
QString aResName = atts.value("resources");
if (aResName != "")
{
- MESSAGE("Loading Resources " << aResName.toLatin1().data());
+ //MESSAGE("Loading Resources " << aResName.toLatin1().data());
SUIT_ResourceMgr* resMgr = SMESHGUI::resourceMgr();
QString lang = resMgr->stringValue( resMgr->langSection(), "language", "en" );
resMgr->loadTranslator( "resources", QString( "%1_msg_%2.qm" ).arg( aResName, lang ) );
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA )
{
- MESSAGE( "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" );
}
//================================================================================
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA )
{
- MESSAGE( "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" );
}
//================================================================================
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "SMESH_Algo_i::SMESH_Algo_i" );
}
//=============================================================================
SMESH_Algo_i::~SMESH_Algo_i()
{
- MESSAGE( "SMESH_Algo_i::~SMESH_Algo_i" );
}
//=============================================================================
SMESH::ListOfHypothesisName* SMESH_Algo_i::GetCompatibleHypothesis()
{
- MESSAGE( "SMESH_Algo_i::GetCompatibleHypothesis" );
SMESH::ListOfHypothesisName_var listOfHypothesis = new SMESH::ListOfHypothesisName;
const vector<string>& hypList = ( ( ::SMESH_Algo* )myBaseImpl )->GetCompatibleHypothesis();
int nbHyp = hypList.size();
const char* interfaceName )
: Engines_Component_i( orb, poa, contId, instanceName, interfaceName )
{
- MESSAGE( "SMESH_Gen_i::SMESH_Gen_i : standard constructor" );
myOrb = CORBA::ORB::_duplicate(orb);
myPoa = PortableServer::POA::_duplicate(poa);
SMESH_Gen_i::~SMESH_Gen_i()
{
- MESSAGE( "SMESH_Gen_i::~SMESH_Gen_i" );
-
// delete hypothesis creators
map<string, GenericHypothesisCreator_i*>::iterator itHyp, itHyp2;
for (itHyp = myHypCreatorMap.begin(); itHyp != myHypCreatorMap.end(); itHyp++)
// 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() );
// create a new mesh object
- MESSAGE("myIsEmbeddedMode " << myIsEmbeddedMode);
+ if(MYDEBUG) MESSAGE("myIsEmbeddedMode " << myIsEmbeddedMode);
meshServant->SetImpl( myGen.CreateMesh( GetCurrentStudyID(), myIsEmbeddedMode ));
// activate the CORBA servant of Mesh
void SMESH_Gen_i::SetEmbeddedMode( CORBA::Boolean theMode )
{
myIsEmbeddedMode = theMode;
- MESSAGE("myIsEmbeddedMode " << myIsEmbeddedMode);
if ( !myIsEmbeddedMode ) {
//PAL10867: disable signals catching with "noexcepthandler" option
: SALOME::GenericObj_i( thePOA ),
SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
{
- //MESSAGE("SMESH_Group_i; this = "<<this );
}
SMESH_GroupOnGeom_i::SMESH_GroupOnGeom_i( PortableServer::POA_ptr thePOA,
: SALOME::GenericObj_i( thePOA ),
SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
{
- //MESSAGE("SMESH_GroupOnGeom_i; this = "<<this );
}
SMESH_GroupOnFilter_i::SMESH_GroupOnFilter_i( PortableServer::POA_ptr thePOA,
: SALOME::GenericObj_i( thePOA ),
SMESH_GroupBase_i( thePOA, theMeshServant, theLocalID )
{
- //MESSAGE("SMESH_GroupOnGeom_i; this = "<<this );
}
//=============================================================================
::SMESH_Group* aGroup = GetSmeshGroup();
if (aGroup)
return CORBA::string_dup (aGroup->GetName());
- MESSAGE("get name of a vague group");
return CORBA::string_dup( "NO_NAME" );
}
}
return aType;
}
- MESSAGE("get type of a vague group");
return SMESH::ALL;
}
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
if (aGroupDS)
return aGroupDS->Extent();
- MESSAGE("get size of a vague group");
return 0;
}
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
if (aGroupDS)
return aGroupDS->IsEmpty();
- MESSAGE("checking IsEmpty of a vague group");
return true;
}
return;
}
Modified(); // notify dependent Filter with FT_BelongToMeshGroup criterion
-
- MESSAGE("attempt to clear a vague group");
}
//=============================================================================
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
if (aGroupDS)
return aGroupDS->Contains(theID);
- MESSAGE("attempt to check contents of a vague group");
return false;
}
return aColor;
}
- MESSAGE("get color of a group");
return SALOMEDS::Color();
}
if ( 0 < aRes->length() && aRes->length() < 100 ) // for comfortable testing ;)
std::sort( &aRes[0], &aRes[0] + aRes->length() );
}
- MESSAGE("get list of IDs of a vague group");
return aRes._retn();
}
CORBA::Long studyId )
: SALOME::GenericObj_i( thePOA )
{
- MESSAGE("SMESH_Mesh_i");
_impl = NULL;
_gen_i = gen_i;
_id = _idGenerator++;
SMESH_Mesh_i::~SMESH_Mesh_i()
{
- MESSAGE("~SMESH_Mesh_i");
-
// destroy groups
map<int, SMESH::SMESH_GroupBase_ptr>::iterator itGr;
for (itGr = _mapGroups.begin(); itGr != _mapGroups.end(); itGr++)
_preMeshInfo->FullLoadFromFile();
CORBA::LongLong pointeur = CORBA::LongLong(_impl);
- if ( MYDEBUG )
- MESSAGE("CORBA::LongLong SMESH_Mesh_i::GetMeshPtr() "<<pointeur);
+ if ( MYDEBUG ) MESSAGE("CORBA::LongLong SMESH_Mesh_i::GetMeshPtr() "<<pointeur);
return pointeur;
}
{
_src2tgtNodes.clear();
- MESSAGE("Projection_2D Compute");
if ( !_sourceHypo )
return false;
{
// projection in case if the faces are similar in 2D space
projDone = projectBy2DSimilarity( tgtFace, srcFace, tgtWires, srcWires,
- shape2ShapeMap, _src2tgtNodes, is1DComputed);
+ shape2ShapeMap, _src2tgtNodes, is1DComputed );
}
if ( !projDone )
{
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
-StdMeshers_Regular_1D::StdMeshers_Regular_1D(int hypId, int studyId,
+StdMeshers_Regular_1D::StdMeshers_Regular_1D(int hypId,
+ int studyId,
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";
_shapeType = (1 << TopAbs_EDGE);
_fpHyp = 0;
string hypName = theHyp->GetName();
- if (hypName == "LocalLength")
+ if ( hypName == "LocalLength" )
{
const StdMeshers_LocalLength * hyp =
dynamic_cast <const StdMeshers_LocalLength * >(theHyp);
aStatus = SMESH_Hypothesis::HYP_OK;
}
- else if (hypName == "MaxLength")
+ else if ( hypName == "MaxLength" )
{
const StdMeshers_MaxLength * hyp =
dynamic_cast <const StdMeshers_MaxLength * >(theHyp);
aStatus = SMESH_Hypothesis::HYP_OK;
}
- else if (hypName == "NumberOfSegments")
+ else if ( hypName == "NumberOfSegments" )
{
- MESSAGE("CheckHypothesis: NumberOfSegments");
const StdMeshers_NumberOfSegments * hyp =
dynamic_cast <const StdMeshers_NumberOfSegments * >(theHyp);
ASSERT(hyp);
aStatus = SMESH_Hypothesis::HYP_OK;
}
- else if (hypName == "Arithmetic1D")
+ else if ( hypName == "Arithmetic1D" )
{
const StdMeshers_Arithmetic1D * hyp =
dynamic_cast <const StdMeshers_Arithmetic1D * >(theHyp);
aStatus = SMESH_Hypothesis::HYP_OK;
}
- else if (hypName == "GeometricProgression")
+ else if ( hypName == "GeometricProgression" )
{
const StdMeshers_Geometric1D * hyp =
dynamic_cast <const StdMeshers_Geometric1D * >(theHyp);
aStatus = SMESH_Hypothesis::HYP_OK;
}
- else if (hypName == "FixedPoints1D") {
+ else if ( hypName == "FixedPoints1D" ) {
_fpHyp = dynamic_cast <const StdMeshers_FixedPoints1D*>(theHyp);
ASSERT(_fpHyp);
_hypType = FIXED_POINTS_1D;
aStatus = SMESH_Hypothesis::HYP_OK;
}
- else if (hypName == "StartEndLength")
+ else if ( hypName == "StartEndLength" )
{
const StdMeshers_StartEndLength * hyp =
dynamic_cast <const StdMeshers_StartEndLength * >(theHyp);
aStatus = SMESH_Hypothesis::HYP_OK;
}
- else if (hypName == "Deflection1D")
+ else if ( hypName == "Deflection1D" )
{
const StdMeshers_Deflection1D * hyp =
dynamic_cast <const StdMeshers_Deflection1D * >(theHyp);
aStatus = SMESH_Hypothesis::HYP_OK;
}
- else if (hypName == "AutomaticLength")
+ else if ( hypName == "AutomaticLength" )
{
StdMeshers_AutomaticLength * hyp = const_cast<StdMeshers_AutomaticLength *>
(dynamic_cast <const StdMeshers_AutomaticLength * >(theHyp));
_hypType = MAX_LENGTH;
aStatus = SMESH_Hypothesis::HYP_OK;
}
- else if (hypName == "Adaptive1D")
+ else if ( hypName == "Adaptive1D" )
{
_adaptiveHyp = dynamic_cast < const StdMeshers_Adaptive1D* >(theHyp);
ASSERT(_adaptiveHyp);
// never do this way
//OSD::SetSignal( true );
- if (nbSeg <= 0)
+ if ( nbSeg <= 0 )
return false;
- MESSAGE( "computeParamByFunc" );
-
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 ))
return false;
for ( int i = 1; i < nbSeg; i++ )
{
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 );
if ( !Discret.IsDone() )
return false;
}
if ( _hypType == NB_SEGMENTS )
{
- MESSAGE("redistributeNearVertices NB_SEGMENTS");
compensateError(0, vertexLength, f, l, theLength, theC3d, theParameters, true );
}
else if ( nPar <= 3 )
const bool theReverse,
bool theConsiderPropagation)
{
- MESSAGE("computeInternalParameters");
theParams.clear();
double f = theFirstU, l = theLastU;
if ( ! SMESH_Algo::GetSortedNodesOnEdge( theMesh.GetMeshDS(), mainEdge, _quadraticMesh,
mainEdgeParamsOfNodes, SMDSAbs_Edge ))
return error("Bad node parameters on the source edge of Propagation Of Distribution");
- MESSAGE("mainEdgeParamsOfNodes.size(): " << mainEdgeParamsOfNodes.size());
vector< double > segLen( mainEdgeParamsOfNodes.size() - 1 );
double totalLen = 0;
BRepAdaptor_Curve mainEdgeCurve( mainEdge );
{
case LOCAL_LENGTH:
case MAX_LENGTH:
- case NB_SEGMENTS: {
- MESSAGE("computeInternalParameters: LOCAL_LENGTH MAX_LENGTH NB_SEGMENTS");
+ case NB_SEGMENTS:
+ {
double eltSize = 1;
int nbSegments;
if ( _hypType == MAX_LENGTH )
}
if (computed) {
SMESHDS_SubMesh* smds = sm->GetSubMeshDS();
- int nb_segments = smds->NbElements();
- MESSAGE("nb_segments: "<<nb_segments);
+ int nb_segments = smds->NbElements();
if (nbseg - 1 <= nb_segments && nb_segments <= nbseg + 1) {
isFound = true;
nbseg = nb_segments;
break;
case StdMeshers_NumberOfSegments::DT_Regular:
eltSize = theLength / nbSegments;
- MESSAGE("eltSize = theLength / nbSegments " << eltSize << " = " << theLength << " / " << nbSegments );
break;
default:
return false;
for ( int i = 2; i < NbPoints; i++ ) // skip 1st and last points
{
double param = Discret.Parameter(i);
- MESSAGE("computeInternalParameters: theParams " << i << " " << param);
theParams.push_back( param );
}
compensateError( eltSize, eltSize, f, l, theLength, theC3d, theParams, true ); // for PAL9899
return true;
}
- case ARITHMETIC_1D: {
-
+ case ARITHMETIC_1D:
+ {
// arithmetic progression: SUM(n) = ( an - a1 + q ) * ( a1 + an ) / ( 2 * q ) = theLength
double a1 = _value[ BEG_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<<") "<<
"for an edge of length "<<theLength);
- 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 ));
+ 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 ));
double U1 = theReverse ? l : f;
double Un = theReverse ? f : l;
eltSize += q;
}
compensateError( a1, an, U1, Un, theLength, theC3d, theParams );
- if (theReverse) theParams.reverse(); // NPAL18025
+ if ( theReverse ) theParams.reverse(); // NPAL18025
return true;
}
- case GEOMETRIC_1D: {
-
+ case GEOMETRIC_1D:
+ {
double a1 = _value[ BEG_LENGTH_IND ], an;
double q = _value[ END_LENGTH_IND ];
return true;
}
- case FIXED_POINTS_1D: {
+ case FIXED_POINTS_1D:
+ {
const std::vector<double>& aPnts = _fpHyp->GetPoints();
const std::vector<int>& nbsegs = _fpHyp->GetNbSegments();
TColStd_SequenceOfReal Params;
if( aPnts[i]<0.0001 || aPnts[i]>0.9999 ) continue;
int j=1;
bool IsExist = false;
- for(; j<=Params.Length(); j++) {
- if( fabs(aPnts[i]-Params.Value(j)) < 1e-4 ) {
+ for ( ; j <= Params.Length(); j++ ) {
+ if ( Abs( aPnts[i] - Params.Value(j) ) < 1e-4 ) {
IsExist = true;
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;
par1 = f;
- lp = l;
+ lp = l;
double sign = 1.0;
- if(theReverse) {
+ if ( theReverse ) {
par1 = l;
- lp = f;
+ lp = f;
sign = -1.0;
}
double eltSize, segmentSize = 0.;
for ( int i = 0; i < Params.Length(); 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;
- GCPnts_AbscissaPoint APnt(theC3d, sign*segmentSize, par1);
- if( !APnt.IsDone() )
+ GCPnts_AbscissaPoint APnt( theC3d, sign*segmentSize, par1 );
+ if ( !APnt.IsDone() )
return error( "GCPnts_AbscissaPoint failed");
- par2 = APnt.Parameter();
+ par2 = APnt.Parameter();
eltSize = segmentSize/nbseg;
- GCPnts_UniformAbscissa Discret(theC3d, eltSize, par1, par2);
- if(theReverse)
- Discret.Initialize(theC3d, eltSize, par2, par1);
+ GCPnts_UniformAbscissa Discret( theC3d, eltSize, par1, par2 );
+ if ( theReverse )
+ Discret.Initialize( theC3d, eltSize, par2, par1 );
else
- Discret.Initialize(theC3d, eltSize, par1, par2);
+ Discret.Initialize( theC3d, eltSize, par1, par2 );
if ( !Discret.IsDone() )
return error( "GCPnts_UniformAbscissa failed");
int NbPoints = Discret.NbPoints();
list<double> tmpParams;
- for(int i=2; i<NbPoints; i++) {
+ for ( int i = 2; i < NbPoints; i++ ) {
double param = Discret.Parameter(i);
tmpParams.push_back( param );
}
- if (theReverse) {
+ if ( theReverse ) {
compensateError( eltSize, eltSize, par2, par1, segmentSize, theC3d, tmpParams );
tmpParams.reverse();
}
else {
compensateError( eltSize, eltSize, par1, par2, segmentSize, theC3d, tmpParams );
}
- list<double>::iterator itP = tmpParams.begin();
- for(; itP != tmpParams.end(); itP++) {
- theParams.push_back( *(itP) );
- }
+ theParams.splice( theParams.end(), tmpParams );
theParams.push_back( par2 );
par1 = par2;
segmentSize = theLength - currAbscissa;
eltSize = segmentSize/nbseg;
GCPnts_UniformAbscissa Discret;
- if(theReverse)
- Discret.Initialize(theC3d, eltSize, par1, lp);
+ if ( theReverse )
+ Discret.Initialize( theC3d, eltSize, par1, lp );
else
- Discret.Initialize(theC3d, eltSize, lp, par1);
+ Discret.Initialize( theC3d, eltSize, lp, par1 );
if ( !Discret.IsDone() )
return error( "GCPnts_UniformAbscissa failed");
int NbPoints = Discret.NbPoints();
list<double> tmpParams;
- for(int i=2; i<NbPoints; i++) {
+ for ( int i = 2; i < NbPoints; i++ ) {
double param = Discret.Parameter(i);
tmpParams.push_back( param );
}
- if (theReverse) {
+ if ( theReverse ) {
compensateError( eltSize, eltSize, lp, par1, segmentSize, theC3d, tmpParams );
tmpParams.reverse();
}
else {
compensateError( eltSize, eltSize, par1, lp, segmentSize, theC3d, tmpParams );
}
- list<double>::iterator itP = tmpParams.begin();
- for(; itP != tmpParams.end(); itP++) {
- theParams.push_back( *(itP) );
- }
+ theParams.splice( theParams.end(), tmpParams );
- if (theReverse) {
+ if ( theReverse )
theParams.reverse(); // NPAL18025
- }
+
return true;
}
- case DEFLECTION: {
-
- GCPnts_UniformDeflection Discret(theC3d, _value[ DEFLECTION_IND ], f, l, true);
+ case DEFLECTION:
+ {
+ GCPnts_UniformDeflection Discret( theC3d, _value[ DEFLECTION_IND ], f, l, true );
if ( !Discret.IsDone() )
return false;
bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & theShape)
{
- MESSAGE("Compute");
if ( _hypType == NONE )
return false;
//Add the Node in the DataStructure
SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
- MESSAGE("meshDS->AddNode parameter " << param << " coords=" << "("<< P.X() <<", " << P.Y() << ", " << P.Z() << ")");
meshDS->SetNodeOnEdge(node, shapeID, param);
if(_quadraticMesh) {
}
else
{
- //MESSAGE("************* Degenerated edge! *****************");
-
// Edge is a degenerated Edge : We put n = 5 points on the edge.
const int NbPoints = 5;
BRep_Tool::Range( E, f, l ); // PAL15185
}
else {
- //MESSAGE("************* Degenerated edge! *****************");
// Edge is a degenerated Edge : We put n = 5 points on the edge.
- if(_quadraticMesh) {
+ if ( _quadraticMesh ) {
aVec[SMDSEntity_Node] = 11;
aVec[SMDSEntity_Quad_Edge] = 6;
}
return;
//mySelectionMgr->clearSelected();
- TColStd_MapOfInteger aIndexes;
+ myPreviewActor->HighlightAll( false );
QList<QListWidgetItem*> selItems = myListWidget->selectedItems();
QListWidgetItem* anItem;
foreach(anItem, selItems)
myPreviewActor->HighlightID( anItem->text().toInt() );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->Repaint();
+
// update remove button
myRemoveButton->setEnabled( selItems.size() > 0 );
STDMESHERS_I_EXPORT
GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName)
{
- MESSAGE("Get HypothesisCreator for " << aHypName);
-
GenericHypothesisCreator_i* aCreator = 0;
// Hypotheses