PR: correct some warnings

This commit is contained in:
prascle 2010-11-30 22:35:24 +00:00
parent 8fa039a796
commit 2e16ca1281
18 changed files with 147 additions and 63 deletions

View File

@ -2588,8 +2588,8 @@ bool RangeOfIds::SetRangeStr( const TCollection_AsciiString& theStr )
while ( aMinStr.Search( "-" ) != -1 ) aMinStr.RemoveAll( '-' );
while ( aMaxStr.Search( "-" ) != -1 ) aMaxStr.RemoveAll( '-' );
if ( !aMinStr.IsEmpty() && !aMinStr.IsIntegerValue() ||
!aMaxStr.IsEmpty() && !aMaxStr.IsIntegerValue() )
if ( (!aMinStr.IsEmpty() && !aMinStr.IsIntegerValue()) ||
(!aMaxStr.IsEmpty() && !aMaxStr.IsIntegerValue()) )
return false;
myMin.Append( aMinStr.IsEmpty() ? IntegerFirst() : aMinStr.IntegerValue() );
@ -2635,7 +2635,7 @@ bool RangeOfIds::IsSatisfy( long theId )
else
{
const SMDS_MeshElement* anElem = myMesh->FindElement( theId );
if ( anElem == 0 || myType != anElem->GetType() && myType != SMDSAbs_All )
if ( anElem == 0 || (myType != anElem->GetType() && myType != SMDSAbs_All ))
return false;
}
@ -2826,8 +2826,8 @@ bool LogicalOR::IsSatisfy( long theId )
return
myPredicate1 &&
myPredicate2 &&
myPredicate1->IsSatisfy( theId ) ||
myPredicate2->IsSatisfy( theId );
(myPredicate1->IsSatisfy( theId ) ||
myPredicate2->IsSatisfy( theId ));
}

View File

@ -384,13 +384,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
if ( aMeshDimension == 2 && anIsZDimension ) // 2D only if mesh is in XOY plane
aMeshDimension = 3;
// PAL18941(a saved study with a mesh belong Z is opened and the mesh is belong X)
if ( aMeshDimension == 1 && !anIsXDimension ) // 1D only if mesh is along OX
if ( aMeshDimension == 1 && !anIsXDimension ) {// 1D only if mesh is along OX
if ( anIsYDimension ) {
aMeshDimension = 2;
anIsXDimension = true;
} else {
aMeshDimension = 3;
}
}
}
SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator(/*idInceasingOrder=*/true);
@ -430,7 +431,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
int myFacesDefaultFamilyId = 0;
int myVolumesDefaultFamilyId = 0;
int nbNodes = myMesh->NbNodes();
int nb0DElements = myMesh->Nb0DElements();
//int nb0DElements = myMesh->Nb0DElements();
int nbEdges = myMesh->NbEdges();
int nbFaces = myMesh->NbFaces();
int nbVolumes = myMesh->NbVolumes();

View File

@ -540,7 +540,7 @@ bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId,
int nbNodes = anElem->NbNodes();
if ( theEdgeNum < 0 || theEdgeNum > 3 || nbNodes != 3 && nbNodes != 4 || theEdgeNum > nbNodes )
if ( theEdgeNum < 0 || theEdgeNum > 3 || (nbNodes != 3 && nbNodes != 4) || theEdgeNum > nbNodes )
return false;
vector<int> anIds( nbNodes );
@ -642,6 +642,7 @@ bool SMESH_MeshObj::NulData()
myEmptyGrid->BuildLinks();
}
myGrid->ShallowCopy(myEmptyGrid);
return true;
}
//=================================================================================
// function : GetElemDimension

View File

@ -420,7 +420,7 @@ int SMDS_Down1D::computeFaces(int* pts, int* vtkIds, int nbcells, int* downFaces
{
int volId = _grid->CellIdToDownId(vtkId);
SMDS_Downward * downvol = _grid->getDownArray(vtkType);
const int *downIds = downvol->getDownCells(volId);
//const int *downIds = downvol->getDownCells(volId);
const unsigned char* downTypesVol = downvol->getDownTypes(volId);
int nbFaces = downvol->getNumberOfDownCells(volId);
const int* faceIds = downvol->getDownCells(volId);

View File

@ -269,7 +269,7 @@ SMDS_Mesh0DElement* SMDS_Mesh::Add0DElementWithID(const SMDS_MeshNode * n, int I
//MESSAGE("Add0DElementWithID" << ID)
SMDS_Mesh0DElement * el0d = new SMDS_Mesh0DElement(n);
if (myElementIDFactory->BindID(ID, el0d)) {
SMDS_MeshNode *node = const_cast<SMDS_MeshNode*>(n);
//SMDS_MeshNode *node = const_cast<SMDS_MeshNode*>(n);
//node->AddInverseElement(el0d);// --- fait avec BindID
adjustmyCellsCapacity(ID);
myCells[ID] = el0d;
@ -2988,8 +2988,10 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem,
//MESSAGE("SMDS_Mesh::RemoveElement " << elem->getVtkId() << " " << removenodes);
// get finite elements built on elem
set<const SMDS_MeshElement*> * s1;
if (elem->GetType() == SMDSAbs_0DElement || elem->GetType() == SMDSAbs_Edge && !hasConstructionEdges()
|| elem->GetType() == SMDSAbs_Face && !hasConstructionFaces() || elem->GetType() == SMDSAbs_Volume)
if ( (elem->GetType() == SMDSAbs_0DElement)
|| ((elem->GetType() == SMDSAbs_Edge) && !hasConstructionEdges())
|| ((elem->GetType() == SMDSAbs_Face) && !hasConstructionFaces())
|| (elem->GetType() == SMDSAbs_Volume) )
{
s1 = new set<const SMDS_MeshElement*> ();
s1->insert(elem);

View File

@ -32,10 +32,6 @@
#include "SMDS_Mesh.hxx"
#include <vtkUnstructuredGrid.h>
#define protected public
#include <vtkCellLinks.h>
#define protected protected
#include "utilities.h"
#include "Utils_SALOME_Exception.hxx"
#include <cassert>
@ -73,12 +69,13 @@ void SMDS_MeshNode::init(int id, int meshId, int shapeId, double x, double y, do
myIdInShape = -1;
//MESSAGE("Node " << myID << " " << myVtkID << " (" << x << ", " << y << ", " << z << ")");
SMDS_Mesh* mesh = SMDS_Mesh::_meshList[myMeshId];
vtkUnstructuredGrid * grid = mesh->getGrid();
SMDS_UnstructuredGrid * grid = mesh->getGrid();
vtkPoints *points = grid->GetPoints();
points->InsertPoint(myVtkID, x, y, z);
vtkCellLinks *cellLinks = grid->GetCellLinks();
if (myVtkID >=cellLinks->Size)
cellLinks->Resize(myVtkID+SMDS_Mesh::chunkSize);
SMDS_CellLinks *cellLinks = dynamic_cast<SMDS_CellLinks*>(grid->GetCellLinks());
assert(cellLinks);
if (myVtkID >= cellLinks->GetLinksSize())
cellLinks->ResizeL(myVtkID+SMDS_Mesh::chunkSize);
}
SMDS_MeshNode::~SMDS_MeshNode()

View File

@ -15,6 +15,31 @@
using namespace std;
SMDS_CellLinks* SMDS_CellLinks::New()
{
MESSAGE("SMDS_CellLinks::New");
return new SMDS_CellLinks();
}
vtkCellLinks::Link* SMDS_CellLinks::ResizeL(vtkIdType sz)
{
return vtkCellLinks::Resize(sz);
}
vtkIdType SMDS_CellLinks::GetLinksSize()
{
return this->Size;
}
SMDS_CellLinks::SMDS_CellLinks() :
vtkCellLinks()
{
}
SMDS_CellLinks::~SMDS_CellLinks()
{
}
SMDS_UnstructuredGrid* SMDS_UnstructuredGrid::New()
{
MESSAGE("SMDS_UnstructuredGrid::New");
@ -697,7 +722,7 @@ void SMDS_UnstructuredGrid::BuildDownwardConnectivity(bool withEdges)
int faceId2 = downFaces[idf];
int faceType = downTypes[idf];
//ASSERT(_downArray[faceType]);
SMDS_Down2D* downFace2 = static_cast<SMDS_Down2D*> (_downArray[faceType]);
//SMDS_Down2D* downFace2 = static_cast<SMDS_Down2D*> (_downArray[faceType]);
_downArray[vtkEdgeType]->addUpCell(connEdgeId, faceId2, faceType);
_downArray[faceType]->addDownCell(faceId2, connEdgeId, vtkEdgeType);
// MESSAGE(" From face t:" << vtkFaceType << " " << faceId <<
@ -839,3 +864,17 @@ int SMDS_UnstructuredGrid::getOrderedNodesOfFace(int vtkVolId, std::vector<int>&
return orderedNodes.size();
}
void SMDS_UnstructuredGrid::BuildLinks()
{
// Remove the old links if they are already built
if (this->Links)
{
this->Links->UnRegister(this);
}
this->Links = SMDS_CellLinks::New();
this->Links->Allocate(this->GetNumberOfPoints());
this->Links->Register(this);
this->Links->BuildLinks(this, this->Connectivity);
this->Links->Delete();
}

View File

@ -9,6 +9,7 @@
#define _SMDS_UNSTRUCTUREDGRID_HXX
#include <vtkUnstructuredGrid.h>
#include <vtkCellLinks.h>
#include "chrono.hxx"
#include <vector>
@ -30,6 +31,17 @@
class SMDS_Downward;
class SMDS_Mesh;
class SMDS_CellLinks: public vtkCellLinks
{
public:
vtkCellLinks::Link* ResizeL(vtkIdType sz);
vtkIdType GetLinksSize();
static SMDS_CellLinks* New();
protected:
SMDS_CellLinks();
~SMDS_CellLinks();
};
class SMDS_UnstructuredGrid: public vtkUnstructuredGrid
{
public:
@ -53,6 +65,7 @@ public:
void GetNodeIds(std::set<int>& nodeSet, int downId, unsigned char downType);
void ModifyCellNodes(int vtkVolId, std::map<int, int> localClonedNodeIds);
int getOrderedNodesOfFace(int vtkVolId, std::vector<int>& orderedNodes);
void BuildLinks();
vtkCellLinks* GetLinks()
{
return Links;

View File

@ -171,6 +171,7 @@ bool SMDS_VtkVolume::vtkOrder(const SMDS_MeshNode* nodes[], const int nbNodes)
default:
break;
}
return true;
}
SMDS_VtkVolume::~SMDS_VtkVolume()
@ -355,7 +356,7 @@ const SMDS_MeshNode* SMDS_VtkVolume::GetFaceNode(const int face_ind, const int n
/*! polyhedron only,
* return number of nodes for each face
*/
const std::vector<int> & SMDS_VtkVolume::GetQuantities() const
const std::vector<int> SMDS_VtkVolume::GetQuantities() const
{
vector<int> quantities;
quantities.clear();

View File

@ -45,7 +45,7 @@ public:
static bool isForward(double* a,double* b,double* c,double* d);
int NbUniqueNodes() const;
SMDS_ElemIteratorPtr uniqueNodesIterator() const;
const std::vector<int> & GetQuantities() const;
const std::vector<int> GetQuantities() const;
virtual SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const;
virtual SMDS_ElemIteratorPtr nodesIteratorToUNV() const;

View File

@ -133,36 +133,43 @@ SMESH_MeshEditor::AddElement(const vector<const SMDS_MeshNode*> & node,
SMESHDS_Mesh* mesh = GetMeshDS();
switch ( type ) {
case SMDSAbs_0DElement:
if ( nbnode == 1 )
if ( nbnode == 1 ) {
if ( ID >= 0 ) e = mesh->Add0DElementWithID(node[0], ID);
else e = mesh->Add0DElement (node[0] );
}
break;
case SMDSAbs_Edge:
if ( nbnode == 2 )
if ( nbnode == 2 ) {
if ( ID >= 0 ) e = mesh->AddEdgeWithID(node[0], node[1], ID);
else e = mesh->AddEdge (node[0], node[1] );
else if ( nbnode == 3 )
}
else if ( nbnode == 3 ) {
if ( ID >= 0 ) e = mesh->AddEdgeWithID(node[0], node[1], node[2], ID);
else e = mesh->AddEdge (node[0], node[1], node[2] );
}
break;
case SMDSAbs_Face:
if ( !isPoly ) {
if (nbnode == 3)
if (nbnode == 3) {
if ( ID >= 0 ) e = mesh->AddFaceWithID(node[0], node[1], node[2], ID);
else e = mesh->AddFace (node[0], node[1], node[2] );
else if (nbnode == 4)
}
else if (nbnode == 4) {
if ( ID >= 0 ) e = mesh->AddFaceWithID(node[0], node[1], node[2], node[3], ID);
else e = mesh->AddFace (node[0], node[1], node[2], node[3] );
else if (nbnode == 6)
}
else if (nbnode == 6) {
if ( ID >= 0 ) e = mesh->AddFaceWithID(node[0], node[1], node[2], node[3],
node[4], node[5], ID);
else e = mesh->AddFace (node[0], node[1], node[2], node[3],
node[4], node[5] );
else if (nbnode == 8)
}
else if (nbnode == 8) {
if ( ID >= 0 ) e = mesh->AddFaceWithID(node[0], node[1], node[2], node[3],
node[4], node[5], node[6], node[7], ID);
else e = mesh->AddFace (node[0], node[1], node[2], node[3],
node[4], node[5], node[6], node[7] );
}
} else {
if ( ID >= 0 ) e = mesh->AddPolygonalFaceWithID(node, ID);
else e = mesh->AddPolygonalFace (node );
@ -170,32 +177,37 @@ SMESH_MeshEditor::AddElement(const vector<const SMDS_MeshNode*> & node,
break;
case SMDSAbs_Volume:
if ( !isPoly ) {
if (nbnode == 4)
if (nbnode == 4) {
if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3], ID);
else e = mesh->AddVolume (node[0], node[1], node[2], node[3] );
else if (nbnode == 5)
}
else if (nbnode == 5) {
if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3],
node[4], ID);
else e = mesh->AddVolume (node[0], node[1], node[2], node[3],
node[4] );
else if (nbnode == 6)
}
else if (nbnode == 6) {
if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3],
node[4], node[5], ID);
else e = mesh->AddVolume (node[0], node[1], node[2], node[3],
node[4], node[5] );
else if (nbnode == 8)
}
else if (nbnode == 8) {
if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3],
node[4], node[5], node[6], node[7], ID);
else e = mesh->AddVolume (node[0], node[1], node[2], node[3],
node[4], node[5], node[6], node[7] );
else if (nbnode == 10)
}
else if (nbnode == 10) {
if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3],
node[4], node[5], node[6], node[7],
node[8], node[9], ID);
else e = mesh->AddVolume (node[0], node[1], node[2], node[3],
node[4], node[5], node[6], node[7],
node[8], node[9] );
else if (nbnode == 13)
}
else if (nbnode == 13) {
if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3],
node[4], node[5], node[6], node[7],
node[8], node[9], node[10],node[11],
@ -204,7 +216,8 @@ SMESH_MeshEditor::AddElement(const vector<const SMDS_MeshNode*> & node,
node[4], node[5], node[6], node[7],
node[8], node[9], node[10],node[11],
node[12] );
else if (nbnode == 15)
}
else if (nbnode == 15) {
if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3],
node[4], node[5], node[6], node[7],
node[8], node[9], node[10],node[11],
@ -213,7 +226,8 @@ SMESH_MeshEditor::AddElement(const vector<const SMDS_MeshNode*> & node,
node[4], node[5], node[6], node[7],
node[8], node[9], node[10],node[11],
node[12],node[13],node[14] );
else if (nbnode == 20)
}
else if (nbnode == 20) {
if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3],
node[4], node[5], node[6], node[7],
node[8], node[9], node[10],node[11],
@ -224,6 +238,7 @@ SMESH_MeshEditor::AddElement(const vector<const SMDS_MeshNode*> & node,
node[8], node[9], node[10],node[11],
node[12],node[13],node[14],node[15],
node[16],node[17],node[18],node[19] );
}
}
}
if ( e ) myLastCreatedElems.Append( e );
@ -531,12 +546,14 @@ bool SMESH_MeshEditor::InverseDiag (const SMDS_MeshElement * theTria1,
// find indices of 1,2 and of A,B in theTria1
int iA = 0, iB = 0, i1 = 0, i2 = 0;
for ( i = 0; i < 6; i++ ) {
if ( sameInd [ i ] == 0 )
if ( sameInd [ i ] == 0 ) {
if ( i < 3 ) i1 = i;
else i2 = i;
else if (i < 3)
}
else if (i < 3) {
if ( iA ) iB = i;
else iA = i;
}
}
// nodes 1 and 2 should not be the same
if ( aNodes[ i1 ] == aNodes[ i2 ] )
@ -623,7 +640,7 @@ static bool findTriangles(const SMDS_MeshNode * theNode1,
it = theNode2->GetInverseElementIterator(SMDSAbs_Face);
while (it->more()) {
const SMDS_MeshElement* elem = it->next();
if ( emap.find( elem ) != emap.end() )
if ( emap.find( elem ) != emap.end() ) {
if ( theTria1 ) {
// theTria1 must be element with minimum ID
if( theTria1->GetID() < elem->GetID() ) {
@ -638,6 +655,7 @@ static bool findTriangles(const SMDS_MeshNode * theNode1,
else {
theTria1 = elem;
}
}
}
return ( theTria1 && theTria2 );
}
@ -1998,7 +2016,7 @@ double getAngle(const SMDS_MeshElement * tr1,
int i = 0, iDiag = -1;
while ( it->more()) {
const SMDS_MeshElement *n = it->next();
if ( n == n1 || n == n2 )
if ( n == n1 || n == n2 ) {
if ( iDiag < 0)
iDiag = i;
else {
@ -2008,6 +2026,7 @@ double getAngle(const SMDS_MeshElement * tr1,
nFirst[ t ] = n;
break;
}
}
i++;
}
}
@ -5535,12 +5554,12 @@ SMESH_MeshEditor::Transform (TIDSortedElemSet & theElems,
// Regular elements
int* i = index[ FORWARD ];
if ( needReverse && nbNodes > 2) // reverse mirrored faces and volumes
if ( needReverse && nbNodes > 2) {// reverse mirrored faces and volumes
if ( elemType == SMDSAbs_Face )
i = index[ REV_FACE ];
else
i = index[ nbNodes - 4 ];
}
if(elem->IsQuadratic()) {
static int anIds[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
i = anIds;
@ -7024,12 +7043,12 @@ bool SMESH_MeshEditor::isOut( const SMDS_MeshElement* element, const gp_Pnt& poi
vector<const SMDS_MeshNode*> nodeList;
SMDS_ElemIteratorPtr nodeIt = element->nodesIterator();
if ( element->IsQuadratic() )
if ( element->IsQuadratic() ) {
if (const SMDS_VtkFace* f=dynamic_cast<const SMDS_VtkFace*>(element))
nodeIt = f->interlacedNodesElemIterator();
else if (const SMDS_VtkEdge* e =dynamic_cast<const SMDS_VtkEdge*>(element))
nodeIt = e->interlacedNodesElemIterator();
}
while ( nodeIt->more() )
{
const SMDS_MeshNode* node = cast2Node( nodeIt->next() );
@ -7826,7 +7845,7 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes)
}
}
else {
int elemId = elem->GetID();
//int elemId = elem->GetID();
//MESSAGE("Change regular element or polygon " << elemId);
SMDSAbs_ElementType etyp = elem->GetType();
uniqueNodes.resize(nbUniqueNodes);

View File

@ -860,12 +860,14 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
{
if ( uvOK[0] && uvOK[1] )
{
if ( IsDegenShape( n1->getshapeId() ))
if ( IsDegenShape( n1->getshapeId() )) {
if ( myParIndex & U_periodic ) uv[0].SetCoord( 1, uv[1].Coord( 1 ));
else uv[0].SetCoord( 2, uv[1].Coord( 2 ));
else if ( IsDegenShape( n2->getshapeId() ))
}
else if ( IsDegenShape( n2->getshapeId() )) {
if ( myParIndex & U_periodic ) uv[1].SetCoord( 1, uv[0].Coord( 1 ));
else uv[1].SetCoord( 2, uv[0].Coord( 2 ));
}
TopLoc_Location loc;
Handle(Geom_Surface) S = BRep_Tool::Surface(F,loc);
@ -1586,7 +1588,7 @@ bool SMESH_MesherHelper::IsSubShape( const TopoDS_Shape& shape, SMESH_Mesh* aMes
return
aMesh->GetMeshDS()->ShapeToIndex( shape ) ||
// PAL16202
shape.ShapeType() == TopAbs_COMPOUND && aMesh->GetMeshDS()->IsGroupOfSubShapes( shape );
(shape.ShapeType() == TopAbs_COMPOUND && aMesh->GetMeshDS()->IsGroupOfSubShapes( shape ));
}
//================================================================================
@ -1954,7 +1956,7 @@ namespace { // Structures used by FixQuadraticElements()
// propagate from quadrangle to neighbour faces
if ( link->MediumPos() >= pos ) {
int nbLinkFaces = link->_faces.size();
if ( nbLinkFaces == 4 || nbLinkFaces < 4 && link->OnBoundary()) {
if ( nbLinkFaces == 4 || (nbLinkFaces < 4 && link->OnBoundary())) {
// hexahedral mesh or boundary quadrangles - goto a continous face
if ( const QFace* f = link->GetContinuesFace( this ))
return f->GetLinkChain( *chLink, chain, pos, error );

View File

@ -1529,11 +1529,12 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
ComputeSubMeshStateEngine( CHECK_COMPUTE_STATE );
break;
case CHECK_COMPUTE_STATE:
if ( !IsMeshComputed() )
if ( !IsMeshComputed() ) {
if (_algoState == HYP_OK)
_computeState = READY_TO_COMPUTE;
else
_computeState = NOT_READY;
}
break;
default:
ASSERT(0);

View File

@ -66,13 +66,14 @@ class MyIterator: public SMDS_ElemIterator
MyIterator(SMDSAbs_ElementType type, const SMESHDS_SubMesh* subMesh)
: myType(type), myElem(0)
{
if ( subMesh )
if ( subMesh ) {
if ( myType == SMDSAbs_Node )
myNodeIt = subMesh->GetNodes();
else {
myElemIt = subMesh->GetElements();
next();
}
}
}
bool more()
{

View File

@ -1065,10 +1065,12 @@ void SMESHDS_Mesh::UnSetMeshElementOnShape(const SMDS_MeshElement * elem,
map<int,SMESHDS_SubMesh*>::iterator it = myShapeIndexToSubMesh.find( Index );
if ( it != myShapeIndexToSubMesh.end() )
if ( elem->GetType() == SMDSAbs_Node )
it->second->RemoveNode( static_cast<const SMDS_MeshNode* >( elem ), /*deleted=*/false );
else
it->second->RemoveElement( elem, /*deleted=*/false );
{
if (elem->GetType() == SMDSAbs_Node)
it->second->RemoveNode(static_cast<const SMDS_MeshNode*> (elem), /*deleted=*/false);
else
it->second->RemoveElement(elem, /*deleted=*/false);
}
}
//=======================================================================

View File

@ -140,7 +140,7 @@ bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N, bool isNodeDeleted)
// if (!isNodeDeleted) // alive node has valid ID and can be found
// {
int idInSubShape = N->getIdInShape();
int shapeId = N->getshapeId();
//int shapeId = N->getshapeId();
//MESSAGE("in "<< myIndex << " RemoveNode " << shapeId << " " << idInSubShape << " " << N->GetID());
SMDS_MeshNode* node = (SMDS_MeshNode*) (N);
node->setShapeId(0);

View File

@ -1026,7 +1026,7 @@ void StdMeshers_Hexa_3D::GetConv2DCoefs(const faceQuadStruct & quad,
VB = quad.side[0]->LastVertex();
int a1, b1, c1, a2, b2, c2;
if (VA.IsSame(V0))
if (VA.IsSame(V0)) {
if (VB.IsSame(V1))
{
a1 = 1;
@ -1046,7 +1046,8 @@ void StdMeshers_Hexa_3D::GetConv2DCoefs(const faceQuadStruct & quad,
b2 = 0;
c2 = 0; // x
}
if (VA.IsSame(V1))
}
if (VA.IsSame(V1)) {
if (VB.IsSame(V2))
{
a1 = 0;
@ -1066,7 +1067,8 @@ void StdMeshers_Hexa_3D::GetConv2DCoefs(const faceQuadStruct & quad,
b2 = 1;
c2 = 0; // y
}
if (VA.IsSame(V2))
}
if (VA.IsSame(V2)) {
if (VB.IsSame(V3))
{
a1 = -1;
@ -1086,7 +1088,8 @@ void StdMeshers_Hexa_3D::GetConv2DCoefs(const faceQuadStruct & quad,
b2 = 0;
c2 = 1; // 1-x
}
if (VA.IsSame(V3))
}
if (VA.IsSame(V3)) {
if (VB.IsSame(V0))
{
a1 = 0;
@ -1106,6 +1109,7 @@ void StdMeshers_Hexa_3D::GetConv2DCoefs(const faceQuadStruct & quad,
b2 = -1;
c2 = 1; // 1-y
}
}
// MESSAGE("X = " << c1 << "+ " << a1 << "*x + " << b1 << "*y");
// MESSAGE("Y = " << c2 << "+ " << a2 << "*x + " << b2 << "*y");
conv.a1 = a1;

View File

@ -1000,13 +1000,14 @@ bool StdMeshers_RadialQuadrangle_1D2D::computeLayerPositions(const gp_Pnt&
}
if ( hyp1D ) // try to compute with hyp1D
{
if ( !TNodeDistributor::GetDistributor(*mesh)->Compute( myLayerPositions,p1,p2,*mesh,hyp1D ))
if ( !TNodeDistributor::GetDistributor(*mesh)->Compute( myLayerPositions,p1,p2,*mesh,hyp1D )) {
if ( myDistributionHypo ) { // bad hyp assigned
return error( TNodeDistributor::GetDistributor(*mesh)->GetComputeError() );
}
else {
// bad hyp found, its Ok, lets try with default nb of segnents
}
}
}
if ( myLayerPositions.empty() ) // try to use nb of layers