From: ouv Date: Fri, 25 Sep 2009 09:01:49 +0000 (+0000) Subject: Remove tabs X-Git-Tag: V5_1_main_20090928~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=31369de693baa7a898af0b13643fa3d732df805d;p=modules%2Fvisu.git Remove tabs --- diff --git a/src/VISU_I/VISU_CutLinesBase_i.cc b/src/VISU_I/VISU_CutLinesBase_i.cc index 5c474f90..946db55d 100644 --- a/src/VISU_I/VISU_CutLinesBase_i.cc +++ b/src/VISU_I/VISU_CutLinesBase_i.cc @@ -310,11 +310,11 @@ VISU::CutLinesBase_i vtkDataArray *aScalars = aPointData->GetScalars(); vtkCellDataToPointData *aFilter = NULL; if(!aScalars) { - aFilter = vtkCellDataToPointData::New(); - aFilter->SetInput(aDataSet); - aFilter->PassCellDataOn(); - aDataSet = aFilter->GetOutput(); - aDataSet->Update(); + aFilter = vtkCellDataToPointData::New(); + aFilter->SetInput(aDataSet); + aFilter->PassCellDataOn(); + aDataSet = aFilter->GetOutput(); + aDataSet->Update(); } aPointData = aDataSet->GetPointData(); aScalars = aPointData->GetScalars(); @@ -331,23 +331,23 @@ VISU::CutLinesBase_i else aDivide = 1.0; for(int i = 0; i < aNbPoints; i++){ - aDataSet->GetPoint(i,aPnt); + aDataSet->GetPoint(i,aPnt); for(int j = 0; j < 3; j++) aVect[j] = aPnt[j] - aBasePnt[j]; - //VISU::Sub(aPnt,aBasePnt,aVect); - if ( fabs(aBoundPrjLn[2]) < EPS_machine ) - aDist = 0.5; - else - { - aDist = vtkMath::Dot(aVect,aDirLn)/aDivide; - // the workaround - if(aDist < 0.0) aDist = 0.0; - if(aDist > aTopBnd) aDist = aTopBnd; - } - aXYMap[aDist] = aScalars->GetTuple1(i); + //VISU::Sub(aPnt,aBasePnt,aVect); + if ( fabs(aBoundPrjLn[2]) < EPS_machine ) + aDist = 0.5; + else + { + aDist = vtkMath::Dot(aVect,aDirLn)/aDivide; + // the workaround + if(aDist < 0.0) aDist = 0.0; + if(aDist > aTopBnd) aDist = aTopBnd; + } + aXYMap[aDist] = aScalars->GetTuple1(i); } if(aFilter) - aFilter->Delete(); + aFilter->Delete(); } if(aXYMapCont.size() == 0) throw std::runtime_error("CutPlanes_i::BuildTableOfReal aXYMapCont.size() == 0 !!!"); @@ -355,39 +355,39 @@ VISU::CutLinesBase_i { // Invertion all curves in the table, which has inversion flag is TRUE (see \a myMapCurvesInverted) for(int iLine=0; iLine < iLineEnd; iLine++){ - if (!IsCurveInverted(iLine)) continue; - TXYMap aNewXYMap; - TXYMap& aXYMap = aXYMapCont[iLine]; - TXYMap::const_iterator aXYMapIter = aXYMap.begin(); - std::list XKeys; - for (;aXYMapIter != aXYMap.end() ; aXYMapIter++) XKeys.push_back(aXYMapIter->first); - XKeys.sort(); - if (XKeys.size() > 1) { - vtkFloatingPointType a_first_indx = XKeys.front(); - vtkFloatingPointType a_last_indx = XKeys.back(); - if (a_first_indx > a_last_indx){ - XKeys.reverse(); - vtkFloatingPointType tmp = a_first_indx; - a_first_indx = a_last_indx; - a_last_indx = tmp; - } - std::list::const_iterator aIter = XKeys.begin(); - for (int k=0;k= 0 and aDist<=1.0 - vtkFloatingPointType aTopBnd = aBoundPrjLn[2]; - if( !IsUseAbsoluteLength() ){ - aTopBnd = 1.0; - } - aNewXYMap[aTopBnd - *aIter] = aXYMap[*aIter]; - } - TXYMap::const_iterator aNewXYMapIter = aNewXYMap.begin(); - aXYMap.clear(); - for (;aNewXYMapIter != aNewXYMap.end();aNewXYMapIter++) { - aXYMap[aNewXYMapIter->first] = aNewXYMapIter->second; - } - } + if (!IsCurveInverted(iLine)) continue; + TXYMap aNewXYMap; + TXYMap& aXYMap = aXYMapCont[iLine]; + TXYMap::const_iterator aXYMapIter = aXYMap.begin(); + std::list XKeys; + for (;aXYMapIter != aXYMap.end() ; aXYMapIter++) XKeys.push_back(aXYMapIter->first); + XKeys.sort(); + if (XKeys.size() > 1) { + vtkFloatingPointType a_first_indx = XKeys.front(); + vtkFloatingPointType a_last_indx = XKeys.back(); + if (a_first_indx > a_last_indx){ + XKeys.reverse(); + vtkFloatingPointType tmp = a_first_indx; + a_first_indx = a_last_indx; + a_last_indx = tmp; + } + std::list::const_iterator aIter = XKeys.begin(); + for (int k=0;k= 0 and aDist<=1.0 + vtkFloatingPointType aTopBnd = aBoundPrjLn[2]; + if( !IsUseAbsoluteLength() ){ + aTopBnd = 1.0; + } + aNewXYMap[aTopBnd - *aIter] = aXYMap[*aIter]; + } + TXYMap::const_iterator aNewXYMapIter = aNewXYMap.begin(); + aXYMap.clear(); + for (;aNewXYMapIter != aNewXYMap.end();aNewXYMapIter++) { + aXYMap[aNewXYMapIter->first] = aNewXYMapIter->second; + } + } } } //Resorting of theXYMap @@ -395,25 +395,25 @@ VISU::CutLinesBase_i for(; aXYMapContIter != aXYMapCont.end(); aXYMapContIter++){ TXYMap& aXYMap = aXYMapContIter->second, aNewXYMap; if(aXYMap.size() > 2){ - // Try to smooth the values of the line by applying linear approximation - TXYMap::const_iterator aXYMapIter[2] = {aXYMap.begin(), ++aXYMap.begin()}; - aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second; - aXCont.insert(aXYMapIter[0]->first); - for(; aXYMapIter[1] != aXYMap.end(); aXYMapIter[0]++, aXYMapIter[1]++){ - vtkFloatingPointType aY[3] = {aXYMapIter[0]->second, aXYMapIter[1]->second, 0.0}; - aY[2] = (aY[0] + aY[1])/2.0; - vtkFloatingPointType aX[3] = {aXYMapIter[0]->first, aXYMapIter[1]->first, 0.0}; - aX[2] = (aX[0] + aX[1])/2.0; - aNewXYMap[aX[2]] = aY[2]; - aXCont.insert(aX[2]); - } - aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second; - aXCont.insert(aXYMapIter[0]->first); - aXYMap = aNewXYMap; + // Try to smooth the values of the line by applying linear approximation + TXYMap::const_iterator aXYMapIter[2] = {aXYMap.begin(), ++aXYMap.begin()}; + aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second; + aXCont.insert(aXYMapIter[0]->first); + for(; aXYMapIter[1] != aXYMap.end(); aXYMapIter[0]++, aXYMapIter[1]++){ + vtkFloatingPointType aY[3] = {aXYMapIter[0]->second, aXYMapIter[1]->second, 0.0}; + aY[2] = (aY[0] + aY[1])/2.0; + vtkFloatingPointType aX[3] = {aXYMapIter[0]->first, aXYMapIter[1]->first, 0.0}; + aX[2] = (aX[0] + aX[1])/2.0; + aNewXYMap[aX[2]] = aY[2]; + aXCont.insert(aX[2]); + } + aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second; + aXCont.insert(aXYMapIter[0]->first); + aXYMap = aNewXYMap; }else{ - TXYMap::const_iterator aXYMapIter = aXYMap.begin(); - for(; aXYMapIter != aXYMap.end(); aXYMapIter++) - aXCont.insert(aXYMapIter->first); + TXYMap::const_iterator aXYMapIter = aXYMap.begin(); + for(; aXYMapIter != aXYMap.end(); aXYMapIter++) + aXCont.insert(aXYMapIter->first); } } if(aXCont.size() == 0) @@ -430,14 +430,14 @@ VISU::CutLinesBase_i if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal aDist = "<first; - long iLineId = aLineIdCont[iLine]; - const TXYMap& aXYMap = aXYMapCont[iLine]; - TXYMap::const_iterator aXYMapIter = aXYMap.find(aDist); - // Can we find some value that belong to the line and have the same X coordinate? - if(aXYMapIter == aXYMap.end()) continue; - vtkFloatingPointType aVal = aXYMapIter->second; - aTableOfReal->PutValue(aVal,iLineId+2,i+1); + long iLine = aXYMapContIter->first; + long iLineId = aLineIdCont[iLine]; + const TXYMap& aXYMap = aXYMapCont[iLine]; + TXYMap::const_iterator aXYMapIter = aXYMap.find(aDist); + // Can we find some value that belong to the line and have the same X coordinate? + if(aXYMapIter == aXYMap.end()) continue; + vtkFloatingPointType aVal = aXYMapIter->second; + aTableOfReal->PutValue(aVal,iLineId+2,i+1); } } { @@ -446,18 +446,18 @@ VISU::CutLinesBase_i QString aUnitName = GetField()->myUnitNames[0].c_str(); int aScalarMode = myCutLinesBasePL->GetScalarMode(); if(aScalarMode != 0) - aUnitName = GetField()->myUnitNames[aScalarMode-1].c_str(); + aUnitName = GetField()->myUnitNames[aScalarMode-1].c_str(); aUnitName = aUnitName.simplified(); if(aUnitName.isEmpty()) aUnitName = "-"; TXYMapCont::const_iterator aXYMapContIter = aXYMapCont.begin(); for(; aXYMapContIter != aXYMapCont.end(); aXYMapContIter++){ - long iLine = aXYMapContIter->first; - long iLineId = aLineIdCont[iLine]; - aString.sprintf("Y%d",iLine); - if(MYDEBUG) - MESSAGE("CutPlanes_i::BuildTableOfReal - SetRowTitle("<SetRowTitle(iLineId+2,(const char*)aString.toLatin1()); - aTableOfReal->SetRowUnit(iLineId+2,(const char*)aUnitName.toLatin1()); + long iLine = aXYMapContIter->first; + long iLineId = aLineIdCont[iLine]; + aString.sprintf("Y%d",iLine); + if(MYDEBUG) + MESSAGE("CutPlanes_i::BuildTableOfReal - SetRowTitle("<SetRowTitle(iLineId+2,(const char*)aString.toLatin1()); + aTableOfReal->SetRowUnit(iLineId+2,(const char*)aUnitName.toLatin1()); } } }catch(std::exception& exc){