Fix compilation warnings

This commit is contained in:
gdd 2011-05-12 15:33:16 +00:00
parent b159d92e9d
commit add84232c6
17 changed files with 52 additions and 91 deletions

View File

@ -44,12 +44,9 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform()
int intNumMaille, Degre;
int ValElement;
int ValDegre;
int NoeudsMaille[20];
int NoeudMaille;
bool ok;
MESSAGE("in DriverDAT_R_SMDS_Mesh::Read()");
/****************************************************************************
* OUVERTURE DU FICHIER EN LECTURE *
@ -72,7 +69,7 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform()
for (i = 0; i < nbNodes; i++){
fscanf(aFileId, "%d %e %e %e\n", &intNumPoint, &coordX, &coordY, &coordZ);
ok = myMesh->AddNodeWithID(coordX, coordY, coordZ, intNumPoint);
myMesh->AddNodeWithID(coordX, coordY, coordZ, intNumPoint);
}
fprintf(stdout, "%d noeuds\n", myMesh->NbNodes());
@ -100,29 +97,25 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform()
switch (ValElement) {
case 102:
case 103:
ValDegre = 3;
nbNoeuds = 2;
ok = myMesh->AddEdgeWithID(NoeudsMaille[0], NoeudsMaille[1],
myMesh->AddEdgeWithID(NoeudsMaille[0], NoeudsMaille[1],
intNumMaille);
break;
case 204:
case 208:
ValDegre = 9;
nbNoeuds = 4;
ok = myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1],
myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1],
NoeudsMaille[2], NoeudsMaille[3],
intNumMaille);
break;
case 203:
case 206:
ValDegre = 5;
nbNoeuds = 3;
ok = myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1],
myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1],
NoeudsMaille[2], intNumMaille);
break;
case 308:
case 320:
ValDegre = 12;
nbNoeuds = 8;
if (ValElement == 320){
//A voir, correspondance VTK
@ -131,7 +124,7 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform()
NoeudsMaille[6] = NoeudsMaille[10];
NoeudsMaille[7] = NoeudsMaille[11];
}
ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
NoeudsMaille[2], NoeudsMaille[3],
NoeudsMaille[4], NoeudsMaille[5],
NoeudsMaille[6], NoeudsMaille[7],
@ -139,17 +132,15 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform()
break;
case 304:
case 310:
ValDegre = 10;
nbNoeuds = 4;
if (ValElement == 310)
NoeudsMaille[3] = NoeudsMaille[6];
ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
NoeudsMaille[2], NoeudsMaille[3],
intNumMaille);
break;
case 306:
case 315:
ValDegre = 12;
nbNoeuds = 8;
if (ValElement == 315) {
NoeudsMaille[3] = NoeudsMaille[6];
@ -161,7 +152,7 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform()
NoeudsMaille[5] = NoeudsMaille[4];
NoeudsMaille[4] = NoeudsMaille[3];
NoeudsMaille[3] = NoeudsMaille[2];
ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
NoeudsMaille[2], NoeudsMaille[3],
NoeudsMaille[4], NoeudsMaille[5],
intNumMaille);

View File

@ -280,8 +280,8 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
}
}
// if(!anElement)
// MESSAGE("DriverUNV_R_SMDS_Mesh::Perform - can not add element with ID = "<<aLabel<<" and type = "<<aRec.fe_descriptor_id);
if(!anElement)
MESSAGE("DriverUNV_R_SMDS_Mesh::Perform - can not add element with ID = "<<aLabel<<" and type = "<<aRec.fe_descriptor_id);
}
}
{

View File

@ -141,7 +141,7 @@ void aptrte( Z nutysu, R aretmx,
//no st1, st2, st3, 0 (non quadrangle)
R d, tcpu=0;
R3 direction=R3(0,0,0); //direction pour areteideale() inactive ici!
// R3 direction=R3(0,0,0); //direction pour areteideale() inactive ici!
Z nbarfr=nudslf[nblf]; //nombre total d'aretes des lignes fermees
Z mxtrou = Max( 1024, nblf ); //nombre maximal de trous dans la surface

View File

@ -42,11 +42,11 @@
#include <vtkXMLUnstructuredGridWriter.h>
#include <vtkUnstructuredGridWriter.h>
#ifdef _DEBUG_
static int MYDEBUG = 1;
#else
static int MYDEBUG = 0;
#endif
//#ifdef _DEBUG_
//static int MYDEBUG = 1;
//#else
//static int MYDEBUG = 0;
//#endif
namespace SMESH
{

View File

@ -35,11 +35,11 @@
using namespace std;
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
static int MYDEBUG = 0;
#endif
//#ifdef _DEBUG_
//static int MYDEBUG = 0;
//#else
//static int MYDEBUG = 0;
//#endif
#if defined __GNUC__
#if __GNUC__ == 2

View File

@ -800,7 +800,6 @@ void SMDS_Down3D::getNodeIds(int cellId, std::set<int>& nodeSet)
int SMDS_Down3D::FindFaceByNodes(int cellId, ElemByNodesType& faceByNodes)
{
int *faces = &_cellIds[_nbDownCells * cellId];
int faceNodeSet[10];
int npoints = 0;
for (int i = 0; i < _nbDownCells; i++)
@ -808,11 +807,7 @@ int SMDS_Down3D::FindFaceByNodes(int cellId, ElemByNodesType& faceByNodes)
if ((faces[i] >= 0) && (faceByNodes.vtkType == _cellTypes[i]))
{
if (npoints == 0)
{
for (int j = 0; j < faceByNodes.nbNodes; j++)
faceNodeSet[j] = faceByNodes.nodeIds[j];
npoints = faceByNodes.nbNodes;
}
npoints = faceByNodes.nbNodes;
int nodeSet[10];
int npts = this->_grid->getDownArray(faceByNodes.vtkType)->getNodeSet(faces[i], nodeSet);

View File

@ -762,7 +762,6 @@ int SMDS_UnstructuredGrid::GetParentVolumes(int* volVtkIds, int vtkId)
int vtkType = this->GetCellType(vtkId);
int dim = SMDS_Downward::getCellDimension(vtkType);
int nbFaces = 0;
int faces[1000];
unsigned char cellTypes[1000];
int downCellId[1000];
if (dim == 1)
@ -778,7 +777,6 @@ int SMDS_UnstructuredGrid::GetParentVolumes(int* volVtkIds, int vtkId)
const unsigned char* upTypes = _downArray[vtkType]->getUpTypes(downId);
for (int i=0; i< nbFaces; i++)
{
faces[i] = _downArray[upTypes[i]]->getVtkCellId(upCells[i]);
cellTypes[i] = upTypes[i];
downCellId[i] = upCells[i];
}
@ -786,7 +784,6 @@ int SMDS_UnstructuredGrid::GetParentVolumes(int* volVtkIds, int vtkId)
else if (dim == 2)
{
nbFaces = 1;
faces[0] = vtkId;
cellTypes[0] = this->GetCellType(vtkId);
int downId = this->CellIdToDownId(vtkId);
if (downId < 0)
@ -826,7 +823,6 @@ int SMDS_UnstructuredGrid::GetParentVolumes(int* volVtkIds, int downId, unsigned
int vtkType = downType;
int dim = SMDS_Downward::getCellDimension(vtkType);
int nbFaces = 0;
int faces[1000];
unsigned char cellTypes[1000];
int downCellId[1000];
if (dim == 1)
@ -836,7 +832,6 @@ int SMDS_UnstructuredGrid::GetParentVolumes(int* volVtkIds, int downId, unsigned
const unsigned char* upTypes = _downArray[vtkType]->getUpTypes(downId);
for (int i=0; i< nbFaces; i++)
{
faces[i] = _downArray[upTypes[i]]->getVtkCellId(upCells[i]);
cellTypes[i] = upTypes[i];
downCellId[i] = upCells[i];
}

View File

@ -1188,10 +1188,12 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index,
if ( minInd >= firstMediumInd )
return false; // medium nodes are not linked
if ( maxInd < firstMediumInd ) // both nodes are corners
{
if ( theIgnoreMediumNodes )
type = SMDSAbs_EntityType( int(type)-1 ); // check linkage of corner nodes
else
return false; // corner nodes are not linked directly in a quadratic cell
}
}
switch ( type ) {

View File

@ -1132,26 +1132,13 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems,
myLastCreatedNodes.Append(newN);
// create a new element
const SMDS_MeshNode* N[6];
if ( aBadRate1 <= aBadRate2 ) {
N[0] = aNodes[0];
N[1] = aNodes[1];
N[2] = aNodes[2];
N[3] = aNodes[4];
N[4] = aNodes[5];
N[5] = newN;
newElem1 = aMesh->AddFace(aNodes[2], aNodes[3], aNodes[0],
aNodes[6], aNodes[7], newN );
newElem2 = aMesh->AddFace(aNodes[2], aNodes[0], aNodes[1],
newN, aNodes[4], aNodes[5] );
}
else {
N[0] = aNodes[1];
N[1] = aNodes[2];
N[2] = aNodes[3];
N[3] = aNodes[5];
N[4] = aNodes[6];
N[5] = newN;
newElem1 = aMesh->AddFace(aNodes[3], aNodes[0], aNodes[1],
aNodes[7], aNodes[4], newN );
newElem2 = aMesh->AddFace(aNodes[3], aNodes[1], aNodes[2],
@ -1958,26 +1945,13 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems,
// create a new element
const SMDS_MeshElement* newElem1 = 0;
const SMDS_MeshElement* newElem2 = 0;
const SMDS_MeshNode* N[6];
if ( the13Diag ) {
N[0] = aNodes[0];
N[1] = aNodes[1];
N[2] = aNodes[2];
N[3] = aNodes[4];
N[4] = aNodes[5];
N[5] = newN;
newElem1 = aMesh->AddFace(aNodes[2], aNodes[3], aNodes[0],
aNodes[6], aNodes[7], newN );
newElem2 = aMesh->AddFace(aNodes[2], aNodes[0], aNodes[1],
newN, aNodes[4], aNodes[5] );
}
else {
N[0] = aNodes[1];
N[1] = aNodes[2];
N[2] = aNodes[3];
N[3] = aNodes[5];
N[4] = aNodes[6];
N[5] = newN;
newElem1 = aMesh->AddFace(aNodes[3], aNodes[0], aNodes[1],
aNodes[7], aNodes[4], newN );
newElem2 = aMesh->AddFace(aNodes[3], aNodes[1], aNodes[2],
@ -2928,7 +2902,7 @@ void SMESH_MeshEditor::Smooth (TIDSortedElemSet & theElems,
Handle(Geom_Surface) surface;
SMESHDS_SubMesh* faceSubMesh = 0;
TopoDS_Face face;
double fToler2 = 0, vPeriod = 0., uPeriod = 0., f,l;
double fToler2 = 0, f,l;
double u1 = 0, u2 = 0, v1 = 0, v2 = 0;
bool isUPeriodic = false, isVPeriodic = false;
if ( *fId ) {
@ -2939,10 +2913,10 @@ void SMESH_MeshEditor::Smooth (TIDSortedElemSet & theElems,
fToler2 *= fToler2 * 10.;
isUPeriodic = surface->IsUPeriodic();
if ( isUPeriodic )
vPeriod = surface->UPeriod();
surface->UPeriod();
isVPeriodic = surface->IsVPeriodic();
if ( isVPeriodic )
uPeriod = surface->VPeriod();
surface->VPeriod();
surface->Bounds( u1, u2, v1, v2 );
}
// ---------------------------------------------------------
@ -4934,9 +4908,6 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet & theElements,
list<SMESH_MeshEditor_PathPoint> currList = *itLLPP;
itPP = currList.begin();
SMESH_MeshEditor_PathPoint PP2 = currList.front();
gp_Pnt P1 = PP1.Pnt();
//cout<<" PP1: Pnt("<<P1.X()<<","<<P1.Y()<<","<<P1.Z()<<")"<<endl;
gp_Pnt P2 = PP2.Pnt();
gp_Dir D1 = PP1.Tangent();
gp_Dir D2 = PP2.Tangent();
gp_Dir Dnew( gp_Vec( (D1.X()+D2.X())/2, (D1.Y()+D2.Y())/2,
@ -5660,8 +5631,8 @@ SMESH_MeshEditor::Transform (TIDSortedElemSet & theElems,
PGroupIDs newGroupIDs;
if ( theMakeGroups && theCopy ||
theMakeGroups && theTargetMesh )
if ( ( theMakeGroups && theCopy ) ||
( theMakeGroups && theTargetMesh ) )
newGroupIDs = generateGroups( srcNodes, srcElems, groupPostfix, theTargetMesh );
return newGroupIDs;
@ -10175,7 +10146,7 @@ SMESH_MeshEditor::SewSideElements (TIDSortedElemSet& theSide1,
}
// check similarity of elements of the sides
if (aResult == SEW_OK && ( face[0] && !face[1] ) || ( !face[0] && face[1] )) {
if (aResult == SEW_OK && (( face[0] && !face[1] ) || ( !face[0] && face[1] ))) {
MESSAGE("Correspondent face not found on side " << ( face[0] ? 1 : 0 ));
if ( nReplaceMap.size() == 2 ) { // faces on input nodes not found
aResult = ( face[0] ? SEW_BAD_SIDE2_NODES : SEW_BAD_SIDE1_NODES );

View File

@ -2750,7 +2750,9 @@ void SMESH_MesherHelper::FixQuadraticElements(bool volumeOnly)
faces.Add( f.Current() ); // in not meshed solid
}
else { // fix nodes in the solid and its faces
#ifdef _DEBUG_
MSG("FIX SOLID " << nbSolids-- << " #" << GetMeshDS()->ShapeToIndex(s.Current()));
#endif
SMESH_MesherHelper h(*myMesh);
h.SetSubShape( s.Current() );
h.FixQuadraticElements(false);

View File

@ -1899,7 +1899,7 @@ bool SMESH_Pattern::
for ( nIt = startNodes.begin(); nIt != startNodes.end(); nIt++ )
{
TIsoNode* prevN[2], *node = *nIt;
TIsoNode *node = *nIt;
if ( node->IsUVComputed() || !node->IsMovable() )
continue;
gp_XY newUV( 0, 0 ), sumDir( 0, 0 );
@ -1960,7 +1960,6 @@ bool SMESH_Pattern::
newUV += prevNode1->myUV + dir * step[ iDir ];
}
sumDir += dir;
prevN[ iDir ] = prevNode1;
nbComp++;
}
}
@ -2022,7 +2021,7 @@ bool SMESH_Pattern::
}
// define ratio
bool ok = true; // <- stupid fix TO AVOID PB OF NODES WITH NULL BND NODES
double locR[2] = { 0, 0 };
// double locR[2] = { 0, 0 };
for ( iDir = 0; iDir < 2; iDir++ )
{
const int iCoord = 2 - iDir; // coord changing along an isoline
@ -2036,7 +2035,7 @@ bool SMESH_Pattern::
double par3 = bndNode2->myInitUV.Coord( iCoord );
double r = ( par2 - par1 ) / ( par3 - par1 );
r = Abs ( r - 0.5 ) * 2.0; // [0,1] - distance from the middle
locR[ iDir ] = ( 1 - r * r ) * 0.25;
// locR[ iDir ] = ( 1 - r * r ) * 0.25;
}
//locR[0] = locR[1] = 0.25;
// intersect the 2 lines and move a node

View File

@ -1267,7 +1267,7 @@ namespace SMESH
{theBounds[0],theBounds[3],theBounds[5]},
{theBounds[1],theBounds[3],theBounds[5]}};
int aMaxId = 0, aMinId = aMaxId;
int aMaxId = 0;
theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]);
theMinBoundPrj = theMaxBoundPrj;
for(int i = 1; i < 8; i++){
@ -1278,7 +1278,6 @@ namespace SMESH
}
if(theMinBoundPrj > aTmp){
theMinBoundPrj = aTmp;
aMinId = i;
}
}
vtkFloatingPointType *aMinPnt = aBoundPoints[aMaxId];

View File

@ -2191,7 +2191,6 @@ bool StdMeshers_Quadrangle_2D::ComputeReduced (SMESH_Mesh & aMesh,
int nb1 = nb;
int nr1 = nr;
int nt1 = nt;
int nl1 = nl;
if (nr == nl) {
if (nb < nt) {
@ -2200,7 +2199,6 @@ bool StdMeshers_Quadrangle_2D::ComputeReduced (SMESH_Mesh & aMesh,
}
}
else if (nb == nt) {
nl1 = nb; // and == nt
nr1 = nb; // and == nt
if (nl < nr) {
nt1 = nl;
@ -2216,7 +2214,7 @@ bool StdMeshers_Quadrangle_2D::ComputeReduced (SMESH_Mesh & aMesh,
}
// number of rows and columns
int nrows = nr1 - 1; // and also == nl1 - 1
int nrows = nr1 - 1;
int ncol_top = nt1 - 1;
int ncol_bot = nb1 - 1;
// maximum number of bottom elements for "tree" simple reduce 3->1

View File

@ -2093,13 +2093,22 @@ bool _ViscousBuilder::smoothAndCheck(_SolidData& data,
distToIntersection = Precision::Infinite();
double dist;
const SMDS_MeshElement* intFace = 0, *closestFace = 0;
#ifdef __myDEBUG
const SMDS_MeshElement* *closestFace = 0;
int iLE = 0;
#endif
for ( unsigned i = 0; i < data._edges.size(); ++i )
{
if ( data._edges[i]->FindIntersection( *searcher, dist, data._epsilon, &intFace ))
return false;
if ( distToIntersection > dist )
distToIntersection = dist, closestFace = intFace, iLE = i;
{
distToIntersection = dist;
#ifdef __myDEBUG
iLE = i;
closestFace = intFace;
#endif
}
}
#ifdef __myDEBUG
if ( closestFace )
@ -3811,7 +3820,7 @@ bool _ViscousBuilder::addBoundaryElements()
// Find out orientation and type of face to create
bool reverse = false, tria = false, isOnFace;
bool reverse = false, isOnFace;
map< TGeomID, TopoDS_Shape >::iterator e2f =
data._shrinkShape2Shape.find( getMeshDS()->ShapeToIndex( E ));
@ -3834,8 +3843,6 @@ bool _ViscousBuilder::addBoundaryElements()
!_ignoreShapeIds.count( e2f->first ))
F = *pF;
}
tria = true;
}
// Find the sub-mesh to add new faces
SMESHDS_SubMesh* sm = 0;

View File

@ -414,7 +414,7 @@ sizeHint() const
{
if( cachedSizeHint().isValid() )
return cachedSizeHint();
return QTableWidget::sizeHint();
// QSize sh = QTableWidget::sizeHint();
// if( sh.width() < 400 )
// sh.setWidth( 400 );

View File

@ -299,10 +299,12 @@ QString StdMeshersGUI_NbSegmentsCreator::storeParams() const
break;
}
if ( hasConv )
{
if ( data.myConv )
valStr += "; " + tr("SMESH_CUT_NEG_MODE");
else
valStr += "; " + tr("SMESH_EXP_MODE");
}
return valStr;
}

View File

@ -158,7 +158,7 @@ int main(int argc, char *argv[])
int V[6];
int S[4]; // Signature du T4 courant
int NG[4]; // Num. globaux des sommets
//int NG[4]; // Num. globaux des sommets
// Acquisition maillage initial
//cout << chrono() << " - Acquisition du maillage initial" << endl;
@ -264,7 +264,7 @@ int main(int argc, char *argv[])
for (int is = 0; is < 4; is++)
{
int ng = *(MAILLAGE1->CNX[TETRA4] + 4 * it4 + is);
NG[is] = ng;
//NG[is] = ng;
S[is] = *(POSN + ng - 1);
}