From edcdccbe357f12150a4b90cd01ba36dea6bfb384 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 3 Nov 2009 14:00:06 +0000 Subject: [PATCH] untabify --- src/OBJECT/SMESH_Actor.cxx | 104 +++++++++--------- src/OBJECT/SMESH_Actor.h | 8 +- src/OBJECT/SMESH_ActorDef.h | 6 +- src/OBJECT/SMESH_ActorUtils.cxx | 34 +++--- src/OBJECT/SMESH_ActorUtils.h | 32 +++--- src/OBJECT/SMESH_DeviceActor.cxx | 98 ++++++++--------- src/OBJECT/SMESH_DeviceActor.h | 12 +- src/OBJECT/SMESH_ExtractGeometry.cxx | 6 +- src/OBJECT/SMESH_FaceOrientationFilter.cxx | 6 +- src/OBJECT/SMESH_Object.cxx | 110 +++++++++---------- src/OBJECT/SMESH_Object.h | 6 +- src/OBJECT/SMESH_PreviewActorsCollection.cxx | 32 +++--- 12 files changed, 227 insertions(+), 227 deletions(-) diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 24fddc6c1..4bdf6f349 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -90,9 +90,9 @@ SMESH_ActorDef* SMESH_ActorDef::New(){ SMESH_Actor* SMESH_Actor::New(TVisualObjPtr theVisualObj, - const char* theEntry, - const char* theName, - int theIsClear) + const char* theEntry, + const char* theName, + int theIsClear) { SMESH_ActorDef* anActor = SMESH_ActorDef::New(); if(!anActor->Init(theVisualObj,theEntry,theName,theIsClear)){ @@ -664,7 +664,7 @@ SetControlMode(eControl theMode) void SMESH_ActorDef:: SetControlMode(eControl theMode, - bool theCheckEntityMode) + bool theCheckEntityMode) { SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr(); if( !mgr ) @@ -796,41 +796,41 @@ SetControlMode(eControl theMode, myControlMode = theMode; switch(myControlMode){ case eFreeNodes: - myNodeExtActor->SetExtControlMode(aFunctor); - break; + myNodeExtActor->SetExtControlMode(aFunctor); + break; case eFreeEdges: case eFreeBorders: - my1DExtActor->SetExtControlMode(aFunctor); - break; + my1DExtActor->SetExtControlMode(aFunctor); + break; case eFreeFaces: - my2DExtActor->SetExtControlMode(aFunctor); - break; + my2DExtActor->SetExtControlMode(aFunctor); + break; case eLength2D: case eMultiConnection2D: - my1DExtActor->SetExtControlMode(aFunctor,myScalarBarActor,myLookupTable); - break; + my1DExtActor->SetExtControlMode(aFunctor,myScalarBarActor,myLookupTable); + break; default: - myControlActor->SetControlMode(aFunctor,myScalarBarActor,myLookupTable); + myControlActor->SetControlMode(aFunctor,myScalarBarActor,myLookupTable); } } if(theCheckEntityMode){ if(myControlActor == my1DActor) - SetEntityMode(eEdges); + SetEntityMode(eEdges); else if(myControlActor == my2DActor){ - switch(myControlMode){ - case eLength2D: - case eFreeEdges: - case eFreeFaces: - case eMultiConnection2D: - //SetEntityMode(eEdges); - SetEntityMode(eFaces); - break; - default: - SetEntityMode(eFaces); - } + switch(myControlMode){ + case eLength2D: + case eFreeEdges: + case eFreeFaces: + case eMultiConnection2D: + //SetEntityMode(eEdges); + SetEntityMode(eFaces); + break; + default: + SetEntityMode(eFaces); + } }else if(myControlActor == my3DActor) - SetEntityMode(eVolumes); + SetEntityMode(eVolumes); } }else if(theCheckEntityMode){ @@ -900,9 +900,9 @@ void SMESH_ActorDef::RemoveFromRender(vtkRenderer* theRenderer){ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj, - const char* theEntry, - const char* theName, - int theIsClear) + const char* theEntry, + const char* theName, + int theIsClear) { Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(theEntry,"SMESH",theName); setIO(anIO); @@ -1149,21 +1149,21 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){ if(myControlMode != eNone){ switch(myControlMode){ case eFreeNodes: - myNodeExtActor->VisibilityOn(); - break; + myNodeExtActor->VisibilityOn(); + break; case eFreeEdges: case eFreeBorders: - my1DExtActor->VisibilityOn(); - break; + my1DExtActor->VisibilityOn(); + break; case eFreeFaces: - my2DExtActor->VisibilityOn(); - break; + my2DExtActor->VisibilityOn(); + break; case eLength2D: case eMultiConnection2D: - my1DExtActor->VisibilityOn(); + my1DExtActor->VisibilityOn(); default: - if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells()) - myScalarBarActor->VisibilityOn(); + if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells()) + myScalarBarActor->VisibilityOn(); } } @@ -1462,12 +1462,12 @@ void SMESH_ActorDef::UpdateHighlight(){ myHighlitableActor->SetHighlited(anIsVisible); myHighlitableActor->SetVisibility(anIsVisible); myHighlitableActor->GetExtractUnstructuredGrid()-> - SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::eCells); + SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::eCells); myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe); }else if(myRepresentation == ePoint || GetPointRepresentation()){ myHighlitableActor->SetHighlited(anIsVisible); myHighlitableActor->GetExtractUnstructuredGrid()-> - SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints); + SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints); myHighlitableActor->SetVisibility(anIsVisible); myHighlitableActor->SetRepresentation(SMESH_DeviceActor::ePoint); } @@ -1585,7 +1585,7 @@ void SMESH_ActorDef::SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType mySurfaceProp->SetColor(r,g,b); if( SMESH_GroupObj* aGroupObj = dynamic_cast( myVisualObj.get() ) ) if( aGroupObj->GetElementType() == SMDSAbs_Face || - aGroupObj->GetElementType() == SMDSAbs_Volume ) + aGroupObj->GetElementType() == SMDSAbs_Volume ) myNameActor->SetBackgroundColor(r,g,b); Modified(); } @@ -1758,8 +1758,8 @@ GetClippingPlane(vtkIdType theID) static void ComputeBoundsParam(vtkDataSet* theDataSet, - vtkFloatingPointType theDirection[3], vtkFloatingPointType theMinPnt[3], - vtkFloatingPointType& theMaxBoundPrj, vtkFloatingPointType& theMinBoundPrj) + vtkFloatingPointType theDirection[3], vtkFloatingPointType theMinPnt[3], + vtkFloatingPointType& theMaxBoundPrj, vtkFloatingPointType& theMinBoundPrj) { vtkFloatingPointType aBounds[6]; theDataSet->GetBounds(aBounds); @@ -1773,13 +1773,13 @@ static void ComputeBoundsParam(vtkDataSet* theDataSet, } vtkFloatingPointType aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]}, - {aBounds[1],aBounds[2],aBounds[4]}, - {aBounds[0],aBounds[3],aBounds[4]}, - {aBounds[1],aBounds[3],aBounds[4]}, - {aBounds[0],aBounds[2],aBounds[5]}, - {aBounds[1],aBounds[2],aBounds[5]}, - {aBounds[0],aBounds[3],aBounds[5]}, - {aBounds[1],aBounds[3],aBounds[5]}}; + {aBounds[1],aBounds[2],aBounds[4]}, + {aBounds[0],aBounds[3],aBounds[4]}, + {aBounds[1],aBounds[3],aBounds[4]}, + {aBounds[0],aBounds[2],aBounds[5]}, + {aBounds[1],aBounds[2],aBounds[5]}, + {aBounds[0],aBounds[3],aBounds[5]}, + {aBounds[1],aBounds[3],aBounds[5]}}; int aMaxId = 0, aMinId = aMaxId; theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]); @@ -1803,7 +1803,7 @@ static void ComputeBoundsParam(vtkDataSet* theDataSet, static void DistanceToPosition(vtkDataSet* theDataSet, - vtkFloatingPointType theDirection[3], vtkFloatingPointType theDist, vtkFloatingPointType thePos[3]) + vtkFloatingPointType theDirection[3], vtkFloatingPointType theDist, vtkFloatingPointType thePos[3]) { vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj); @@ -1815,7 +1815,7 @@ static void DistanceToPosition(vtkDataSet* theDataSet, static void PositionToDistance(vtkDataSet* theDataSet, - vtkFloatingPointType theDirection[3], vtkFloatingPointType thePos[3], vtkFloatingPointType& theDist) + vtkFloatingPointType theDirection[3], vtkFloatingPointType thePos[3], vtkFloatingPointType& theDist) { vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj); diff --git a/src/OBJECT/SMESH_Actor.h b/src/OBJECT/SMESH_Actor.h index 99005dcf1..89f4fc51a 100644 --- a/src/OBJECT/SMESH_Actor.h +++ b/src/OBJECT/SMESH_Actor.h @@ -44,9 +44,9 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor public: vtkTypeMacro(SMESH_Actor,SALOME_Actor); static SMESH_Actor* New(TVisualObjPtr theVisualObj, - const char* theEntry, - const char* theName, - int theIsClear); + const char* theEntry, + const char* theName, + int theIsClear); virtual void SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0; virtual void GetSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0; @@ -102,7 +102,7 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor enum eControl{eNone, eLength, eLength2D, eFreeBorders, eFreeEdges, eFreeNodes, eFreeFaces, eMultiConnection, eArea, eTaper, eAspectRatio, - eMinimumAngle, eWarping, eSkew, eAspectRatio3D, eMultiConnection2D, eVolume3D}; + eMinimumAngle, eWarping, eSkew, eAspectRatio3D, eMultiConnection2D, eVolume3D}; virtual void SetControlMode(eControl theMode) = 0; virtual eControl GetControlMode() = 0; diff --git a/src/OBJECT/SMESH_ActorDef.h b/src/OBJECT/SMESH_ActorDef.h index dbbe0a5bb..98f87fd04 100644 --- a/src/OBJECT/SMESH_ActorDef.h +++ b/src/OBJECT/SMESH_ActorDef.h @@ -272,9 +272,9 @@ class SMESH_ActorDef : public SMESH_Actor ~SMESH_ActorDef(); bool Init(TVisualObjPtr theVisualObj, - const char* theEntry, - const char* theName, - int theIsClear); + const char* theEntry, + const char* theName, + int theIsClear); void SetIsShrunkable(bool theShrunkable); void UpdateHighlight(); diff --git a/src/OBJECT/SMESH_ActorUtils.cxx b/src/OBJECT/SMESH_ActorUtils.cxx index c8fcbfe24..872a30acd 100644 --- a/src/OBJECT/SMESH_ActorUtils.cxx +++ b/src/OBJECT/SMESH_ActorUtils.cxx @@ -41,7 +41,7 @@ namespace SMESH vtkFloatingPointType GetFloat( const QString& theValue, - vtkFloatingPointType theDefault ) + vtkFloatingPointType theDefault ) { int pos = theValue.indexOf( ":" ); vtkFloatingPointType val = theDefault; @@ -50,15 +50,15 @@ namespace SMESH QString name = theValue.right( theValue.length()-pos-1 ), sect = theValue.left( pos ); if( !name.isEmpty() && !sect.isEmpty() ) - val = GetFloat( name, sect, theDefault ); + val = GetFloat( name, sect, theDefault ); } return val; } vtkFloatingPointType GetFloat( const QString& theValue, - const QString& theSection, - vtkFloatingPointType theDefault ) + const QString& theSection, + vtkFloatingPointType theDefault ) { vtkFloatingPointType val = theDefault; SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr(); @@ -70,7 +70,7 @@ namespace SMESH void WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, - const char* theFileName) + const char* theFileName) { vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New(); aWriter->SetFileName(theFileName); @@ -83,8 +83,8 @@ namespace SMESH QColor GetColor( const QString& theSect, - const QString& theName, - const QColor& def ) + const QString& theName, + const QColor& def ) { QColor c = def; SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr(); @@ -95,11 +95,11 @@ namespace SMESH void GetColor( const QString& theSect, - const QString& theName, - int& r, - int& g, - int& b, - const QColor& def ) + const QString& theName, + int& r, + int& g, + int& b, + const QColor& def ) { QColor c = def; SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr(); @@ -111,11 +111,11 @@ namespace SMESH void GetColor( const QString& theSect, - const QString& theName, - vtkFloatingPointType& r, - vtkFloatingPointType& g, - vtkFloatingPointType& b, - const QColor& def ) + const QString& theName, + vtkFloatingPointType& r, + vtkFloatingPointType& g, + vtkFloatingPointType& b, + const QColor& def ) { int ir( 0 ), ig( 0 ), ib( 0 ); GetColor( theSect, theName, ir, ig, ib, def ); diff --git a/src/OBJECT/SMESH_ActorUtils.h b/src/OBJECT/SMESH_ActorUtils.h index a494f743b..69451fcac 100644 --- a/src/OBJECT/SMESH_ActorUtils.h +++ b/src/OBJECT/SMESH_ActorUtils.h @@ -33,42 +33,42 @@ namespace SMESH SMESHOBJECT_EXPORT vtkFloatingPointType GetFloat( const QString& theValue, - vtkFloatingPointType theDefault = 0 ); + vtkFloatingPointType theDefault = 0 ); SMESHOBJECT_EXPORT vtkFloatingPointType GetFloat( const QString& theName, - const QString& theSection, - vtkFloatingPointType theDefault = 0 ); + const QString& theSection, + vtkFloatingPointType theDefault = 0 ); SMESHOBJECT_EXPORT QColor GetColor( const QString& theSect, - const QString& theName, - const QColor& = QColor() ); + const QString& theName, + const QColor& = QColor() ); SMESHOBJECT_EXPORT void GetColor( const QString& theSect, - const QString& theName, - int&, - int&, - int&, - const QColor& = QColor() ); + const QString& theName, + int&, + int&, + int&, + const QColor& = QColor() ); SMESHOBJECT_EXPORT void GetColor( const QString& theSect, - const QString& theName, - vtkFloatingPointType&, - vtkFloatingPointType&, - vtkFloatingPointType&, - const QColor& = QColor() ); + const QString& theName, + vtkFloatingPointType&, + vtkFloatingPointType&, + vtkFloatingPointType&, + const QColor& = QColor() ); SMESHOBJECT_EXPORT void WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, - const char* theFileName); + const char* theFileName); } diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index 2b7beccf8..4d0626902 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -91,7 +91,7 @@ SMESH_DeviceActor myMapper = vtkPolyDataMapper::New(); vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor, - myPolygonOffsetUnits); + myPolygonOffsetUnits); myMapper->UseLookupTableScalarRangeOn(); myMapper->SetColorModeToMapScalars(); @@ -281,8 +281,8 @@ SMESH_DeviceActor void SMESH_DeviceActor ::SetControlMode(SMESH::Controls::FunctorPtr theFunctor, - vtkScalarBarActor* theScalarBarActor, - vtkLookupTable* theLookupTable) + vtkScalarBarActor* theScalarBarActor, + vtkLookupTable* theLookupTable) { bool anIsInitialized = theFunctor; if(anIsInitialized){ @@ -304,23 +304,23 @@ SMESH_DeviceActor using namespace SMESH::Controls; if(NumericalFunctor* aNumericalFunctor = dynamic_cast(theFunctor.get())){ for(vtkIdType i = 0; i < aNbCells; i++){ - vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i); - vtkIdType anObjId = myVisualObj->GetElemObjId(anId); - double aValue = aNumericalFunctor->GetValue(anObjId); - aScalars->SetValue(i,aValue); + vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i); + vtkIdType anObjId = myVisualObj->GetElemObjId(anId); + double aValue = aNumericalFunctor->GetValue(anObjId); + aScalars->SetValue(i,aValue); } }else if(Predicate* aPredicate = dynamic_cast(theFunctor.get())){ for(vtkIdType i = 0; i < aNbCells; i++){ - vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i); - vtkIdType anObjId = myVisualObj->GetElemObjId(anId); - bool aValue = aPredicate->IsSatisfy(anObjId); - aScalars->SetValue(i,aValue); + vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i); + vtkIdType anObjId = myVisualObj->GetElemObjId(anId); + bool aValue = aPredicate->IsSatisfy(anObjId); + aScalars->SetValue(i,aValue); } } aDataSet->GetCellData()->SetScalars(aScalars); aScalars->Delete(); - + theLookupTable->SetRange(aScalars->GetRange()); theLookupTable->SetNumberOfTableValues(theScalarBarActor->GetMaximumNumberOfColors()); theLookupTable->Build(); @@ -335,8 +335,8 @@ SMESH_DeviceActor void SMESH_DeviceActor ::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor, - vtkScalarBarActor* theScalarBarActor, - vtkLookupTable* theLookupTable) + vtkScalarBarActor* theScalarBarActor, + vtkLookupTable* theLookupTable) { bool anIsInitialized = theFunctor; myExtractUnstructuredGrid->ClearRegisteredCells(); @@ -374,18 +374,18 @@ SMESH_DeviceActor Length2D::TValues::const_iterator anIter = aValues.begin(); for(vtkIdType aVtkId = 0; anIter != aValues.end(); anIter++,aVtkId++){ - const Length2D::Value& aValue = *anIter; - int aNode[2] = { - myVisualObj->GetNodeVTKId(aValue.myPntId[0]), - myVisualObj->GetNodeVTKId(aValue.myPntId[1]) - }; - if(aNode[0] >= 0 && aNode[1] >= 0){ - anIdList->SetId( 0, aNode[0] ); - anIdList->SetId( 1, aNode[1] ); - aConnectivity->InsertNextCell( anIdList ); - aCellTypesArray->InsertNextValue( VTK_LINE ); - aScalars->SetValue(aVtkId,aValue.myLength); - } + const Length2D::Value& aValue = *anIter; + int aNode[2] = { + myVisualObj->GetNodeVTKId(aValue.myPntId[0]), + myVisualObj->GetNodeVTKId(aValue.myPntId[1]) + }; + if(aNode[0] >= 0 && aNode[1] >= 0){ + anIdList->SetId( 0, aNode[0] ); + anIdList->SetId( 1, aNode[1] ); + aConnectivity->InsertNextCell( anIdList ); + aCellTypesArray->InsertNextValue( VTK_LINE ); + aScalars->SetValue(aVtkId,aValue.myLength); + } } VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); @@ -394,7 +394,7 @@ SMESH_DeviceActor aConnectivity->InitTraversal(); for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ ) - aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) ); + aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) ); aDataSet->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity ); SetUnstructuredGrid(aDataSet); @@ -434,18 +434,18 @@ SMESH_DeviceActor MultiConnection2D::MValues::const_iterator anIter = aValues.begin(); for(vtkIdType aVtkId = 0; anIter != aValues.end(); anIter++,aVtkId++){ - const MultiConnection2D::Value& aValue = (*anIter).first; - int aNode[2] = { - myVisualObj->GetNodeVTKId(aValue.myPntId[0]), - myVisualObj->GetNodeVTKId(aValue.myPntId[1]) - }; - if(aNode[0] >= 0 && aNode[1] >= 0){ - anIdList->SetId( 0, aNode[0] ); - anIdList->SetId( 1, aNode[1] ); - aConnectivity->InsertNextCell( anIdList ); - aCellTypesArray->InsertNextValue( VTK_LINE ); - aScalars->SetValue(aVtkId,(*anIter).second); - } + const MultiConnection2D::Value& aValue = (*anIter).first; + int aNode[2] = { + myVisualObj->GetNodeVTKId(aValue.myPntId[0]), + myVisualObj->GetNodeVTKId(aValue.myPntId[1]) + }; + if(aNode[0] >= 0 && aNode[1] >= 0){ + anIdList->SetId( 0, aNode[0] ); + anIdList->SetId( 1, aNode[1] ); + aConnectivity->InsertNextCell( anIdList ); + aCellTypesArray->InsertNextValue( VTK_LINE ); + aScalars->SetValue(aVtkId,(*anIter).second); + } } VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); @@ -454,7 +454,7 @@ SMESH_DeviceActor aConnectivity->InitTraversal(); for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ ) - aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) ); + aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) ); aDataSet->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity ); SetUnstructuredGrid(aDataSet); @@ -492,7 +492,7 @@ SMESH_DeviceActor for( vtkIdType i = 0; i < aNbCells; i++ ){ vtkIdType anObjId = myVisualObj->GetElemObjId(i); if(aFreePredicate->IsSatisfy(anObjId)) - myExtractUnstructuredGrid->RegisterCell(i); + myExtractUnstructuredGrid->RegisterCell(i); } if(!myExtractUnstructuredGrid->IsCellsRegistered()) myExtractUnstructuredGrid->RegisterCell(-1); @@ -520,15 +520,15 @@ SMESH_DeviceActor for(; anIter != aBorders.end(); anIter++){ const FreeEdges::Border& aBorder = *anIter; int aNode[2] = { - myVisualObj->GetNodeVTKId(aBorder.myPntId[0]), - myVisualObj->GetNodeVTKId(aBorder.myPntId[1]) + myVisualObj->GetNodeVTKId(aBorder.myPntId[0]), + myVisualObj->GetNodeVTKId(aBorder.myPntId[1]) }; //cout<<"aNode = "<= 0 && aNode[1] >= 0){ - anIdList->SetId( 0, aNode[0] ); - anIdList->SetId( 1, aNode[1] ); - aConnectivity->InsertNextCell( anIdList ); - aCellTypesArray->InsertNextValue( VTK_LINE ); + anIdList->SetId( 0, aNode[0] ); + anIdList->SetId( 1, aNode[1] ); + aConnectivity->InsertNextCell( anIdList ); + aCellTypesArray->InsertNextValue( VTK_LINE ); } } @@ -550,7 +550,7 @@ SMESH_DeviceActor for( vtkIdType i = 0; i < aNbNodes; i++ ){ vtkIdType anObjId = myVisualObj->GetNodeObjId(i); if(aFreeNodes->IsSatisfy(anObjId)) - myExtractUnstructuredGrid->RegisterCell(i); + myExtractUnstructuredGrid->RegisterCell(i); } if(!myExtractUnstructuredGrid->IsCellsRegistered()) myExtractUnstructuredGrid->RegisterCell(-1); @@ -827,7 +827,7 @@ SMESH_DeviceActor void SMESH_DeviceActor ::SetPolygonOffsetParameters(vtkFloatingPointType factor, - vtkFloatingPointType units) + vtkFloatingPointType units) { myPolygonOffsetFactor = factor; myPolygonOffsetUnits = units; diff --git a/src/OBJECT/SMESH_DeviceActor.h b/src/OBJECT/SMESH_DeviceActor.h index 218050160..0b9acb48f 100644 --- a/src/OBJECT/SMESH_DeviceActor.h +++ b/src/OBJECT/SMESH_DeviceActor.h @@ -109,11 +109,11 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{ vtkUnstructuredGrid* GetUnstructuredGrid(); void SetControlMode(SMESH::Controls::FunctorPtr theFunctor, - vtkScalarBarActor* theScalarBarActor, - vtkLookupTable* theLookupTable); + vtkScalarBarActor* theScalarBarActor, + vtkLookupTable* theLookupTable); void SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor, - vtkScalarBarActor* theScalarBarActor, - vtkLookupTable* theLookupTable); + vtkScalarBarActor* theScalarBarActor, + vtkLookupTable* theLookupTable); void SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor); bool IsHighlited() { return myIsHighlited;} @@ -161,11 +161,11 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{ void SetPolygonOffsetParameters(vtkFloatingPointType factor, - vtkFloatingPointType units); + vtkFloatingPointType units); void GetPolygonOffsetParameters(vtkFloatingPointType& factor, - vtkFloatingPointType& units) + vtkFloatingPointType& units) { factor = myPolygonOffsetFactor; units = myPolygonOffsetUnits; diff --git a/src/OBJECT/SMESH_ExtractGeometry.cxx b/src/OBJECT/SMESH_ExtractGeometry.cxx index 0376aba38..c7c63af36 100644 --- a/src/OBJECT/SMESH_ExtractGeometry.cxx +++ b/src/OBJECT/SMESH_ExtractGeometry.cxx @@ -152,7 +152,7 @@ int SMESH_ExtractGeometry::RequestData( { newId = newPts->InsertNextPoint(x); pointMap[ptId] = newId; - myNodeVTK2ObjIds.push_back(ptId); + myNodeVTK2ObjIds.push_back(ptId); outputPD->CopyData(pd,ptId,newId); } } @@ -175,7 +175,7 @@ int SMESH_ExtractGeometry::RequestData( { newId = newPts->InsertNextPoint(x); pointMap[ptId] = newId; - myNodeVTK2ObjIds.push_back(ptId); + myNodeVTK2ObjIds.push_back(ptId); outputPD->CopyData(pd,ptId,newId); } } @@ -228,7 +228,7 @@ int SMESH_ExtractGeometry::RequestData( x = input->GetPoint(ptId); newId = newPts->InsertNextPoint(x); pointMap[ptId] = newId; - myNodeVTK2ObjIds.push_back(ptId); + myNodeVTK2ObjIds.push_back(ptId); outputPD->CopyData(pd,ptId,newId); } newCellPts->InsertId(i,pointMap[ptId]); diff --git a/src/OBJECT/SMESH_FaceOrientationFilter.cxx b/src/OBJECT/SMESH_FaceOrientationFilter.cxx index a7f5d1d94..cf09779d0 100644 --- a/src/OBJECT/SMESH_FaceOrientationFilter.cxx +++ b/src/OBJECT/SMESH_FaceOrientationFilter.cxx @@ -209,8 +209,8 @@ void GetFaceParams( vtkCell* theFace, double theNormal[3], double& theSize ) double* aBounds = theFace->GetBounds(); theSize = pow( pow( aBounds[1] - aBounds[0], 2 ) + - pow( aBounds[3] - aBounds[2], 2 ) + - pow( aBounds[5] - aBounds[4], 2 ), 0.5 ); + pow( aBounds[3] - aBounds[2], 2 ) + + pow( aBounds[5] - aBounds[4], 2 ), 0.5 ); } /*! @@ -268,7 +268,7 @@ int SMESH_FaceOrientationFilter::RequestData( input->GetCellNeighbors( aCellId, aFace->PointIds, aNeighborIds ); if( aNeighborIds->GetNumberOfIds() > 0 ) - continue; + continue; double aSize, aNormal[3]; GetFaceParams( aFace, aNormal, aSize ); diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 943f0896d..a6908f78e 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -46,7 +46,7 @@ #include #include -#include +#include #include #include @@ -81,7 +81,7 @@ static int MYDEBUGWITHFILES = 0; // purpose : Get type of VTK cell //================================================================================= static inline vtkIdType getCellType( const SMDSAbs_ElementType theType, - const bool thePoly, + const bool thePoly, const int theNbNodes ) { switch( theType ) @@ -263,7 +263,7 @@ namespace{ typedef std::vector TConnect; int GetConnect(const SMDS_ElemIteratorPtr& theNodesIter, - TConnect& theConnect) + TConnect& theConnect) { theConnect.clear(); for(; theNodesIter->more();) @@ -273,10 +273,10 @@ namespace{ inline void SetId(vtkIdList *theIdList, - const SMESH_VisualObjDef::TMapOfIds& theSMDS2VTKNodes, - const TConnect& theConnect, - int thePosition, - int theId) + const SMESH_VisualObjDef::TMapOfIds& theSMDS2VTKNodes, + const TConnect& theConnect, + int thePosition, + int theId) { theIdList->SetId(thePosition,theSMDS2VTKNodes.find(theConnect[theId]->GetID())->second); } @@ -372,12 +372,12 @@ void SMESH_VisualObjDef::buildElemPrs() myVTK2SMDSElems.insert( TMapOfIds::value_type( iElem, anId ) ); SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator(); - switch (aType) { - case SMDSAbs_Volume:{ + switch (aType) { + case SMDSAbs_Volume:{ aConnect.clear(); - std::vector aConnectivities; - // Convertions connectivities from SMDS to VTK - if (anElem->IsPoly() && aNbNodes > 3) { // POLYEDRE + std::vector aConnectivities; + // Convertions connectivities from SMDS to VTK + if (anElem->IsPoly() && aNbNodes > 3) { // POLYEDRE if ( const SMDS_PolyhedralVolumeOfNodes* ph = dynamic_cast (anElem)) @@ -385,67 +385,67 @@ void SMESH_VisualObjDef::buildElemPrs() aNbNodes = GetConnect(ph->uniqueNodesIterator(),aConnect); anIdList->SetNumberOfIds( aNbNodes ); } - for (int k = 0; k < aNbNodes; k++) - aConnectivities.push_back(k); + for (int k = 0; k < aNbNodes; k++) + aConnectivities.push_back(k); } else if (aNbNodes == 4) { - static int anIds[] = {0,2,1,3}; - for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); + static int anIds[] = {0,2,1,3}; + for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); - } else if (aNbNodes == 5) { - static int anIds[] = {0,3,2,1,4}; - for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); + } else if (aNbNodes == 5) { + static int anIds[] = {0,3,2,1,4}; + for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); - } else if (aNbNodes == 6) { - static int anIds[] = {0,1,2,3,4,5}; - for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); + } else if (aNbNodes == 6) { + static int anIds[] = {0,1,2,3,4,5}; + for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); - } + } else if (aNbNodes == 8) { - static int anIds[] = {0,3,2,1,4,7,6,5}; - for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); + static int anIds[] = {0,3,2,1,4,7,6,5}; + for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); - } + } else if (aNbNodes == 10) { - static int anIds[] = {0,2,1,3,6,5,4,7,9,8}; - for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); - } + static int anIds[] = {0,2,1,3,6,5,4,7,9,8}; + for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); + } else if (aNbNodes == 13) { - static int anIds[] = {0,3,2,1,4,8,7,6,5,9,12,11,10}; - for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); - } + static int anIds[] = {0,3,2,1,4,8,7,6,5,9,12,11,10}; + for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); + } else if (aNbNodes == 15) { //static int anIds[] = {0,2,1,3,5,4,8,7,6,11,10,9,12,14,13}; static int anIds[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14}; - for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); - //for (int k = 0; k < aNbNodes; k++) { + for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]); + //for (int k = 0; k < aNbNodes; k++) { // int nn = aConnectivities[k]; // const SMDS_MeshNode* N = static_cast (aConnect[nn]); // cout<<"k="<X()<<","<Y()<<","<Z()<<")"< 0) { - for (vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++) - SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]); - } - break; - } - default: - for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){ - const SMDS_MeshElement* aNode = aNodesIter->next(); - anIdList->SetId( aNodeId, mySMDS2VTKNodes[aNode->GetID()] ); - } - } + if (aConnectivities.size() > 0) { + for (vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++) + SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]); + } + break; + } + default: + for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){ + const SMDS_MeshElement* aNode = aNodesIter->next(); + anIdList->SetId( aNodeId, mySMDS2VTKNodes[aNode->GetID()] ); + } + } aConnectivity->InsertNextCell( anIdList ); aCellTypesArray->InsertNextValue( getCellType( aType, anElem->IsPoly(), aNbNodes ) ); @@ -483,9 +483,9 @@ void SMESH_VisualObjDef::buildElemPrs() // purpose : Retrieve ids of nodes from edge of elements ( edge is numbered from 1 ) //================================================================================= bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId, - const int theEdgeNum, - int& theNodeId1, - int& theNodeId2 ) const + const int theEdgeNum, + int& theNodeId1, + int& theNodeId2 ) const { const SMDS_Mesh* aMesh = GetMesh(); if ( aMesh == 0 ) @@ -905,7 +905,7 @@ int SMESH_subMeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const case SMDSAbs_Volume: { SMESH::long_array_var anIds = - mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) ); + mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) ); return anIds->length(); } default: @@ -942,7 +942,7 @@ int SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityLis else { SMESH::long_array_var anIds = - mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) ); + mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) ); return getPointers( theType, anIds, aMesh, theResList ); } } diff --git a/src/OBJECT/SMESH_Object.h b/src/OBJECT/SMESH_Object.h index 3d4dbbf8b..118c13ad8 100644 --- a/src/OBJECT/SMESH_Object.h +++ b/src/OBJECT/SMESH_Object.h @@ -62,9 +62,9 @@ public: virtual SMDS_Mesh* GetMesh() const = 0; virtual bool GetEdgeNodes( const int theElemId, - const int theEdgeNum, - int& theNodeId1, - int& theNodeId2 ) const = 0; + const int theEdgeNum, + int& theNodeId1, + int& theNodeId2 ) const = 0; virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0; diff --git a/src/OBJECT/SMESH_PreviewActorsCollection.cxx b/src/OBJECT/SMESH_PreviewActorsCollection.cxx index d07e33b71..e565701da 100644 --- a/src/OBJECT/SMESH_PreviewActorsCollection.cxx +++ b/src/OBJECT/SMESH_PreviewActorsCollection.cxx @@ -137,25 +137,25 @@ GEOM_Actor* SMESH_PreviewActorsCollection::createActor(const TopoDS_Shape& shape actor->SetShape(shape,0,0); //Color Properties - /* - vtkProperty* aProp = vtkProperty::New(); - vtkProperty* aHLProp = vtkProperty::New(); - vtkProperty* aPHLProp = vtkProperty::New(); - - aProp->SetColor( 255, 0, 0); - actor->SetProperty(aProp); + /* + vtkProperty* aProp = vtkProperty::New(); + vtkProperty* aHLProp = vtkProperty::New(); + vtkProperty* aPHLProp = vtkProperty::New(); + + aProp->SetColor( 255, 0, 0); + actor->SetProperty(aProp); - aHLProp->SetColor( 255, 255, 255); - actor->SetHighlightProperty(aHLProp); + aHLProp->SetColor( 255, 255, 255); + actor->SetHighlightProperty(aHLProp); - aPHLProp->SetColor( 155, 155, 155); - aPHLProp->SetLineWidth ( 3 ); - aPHLProp->SetOpacity ( 0.75 ); - actor->SetPreHighlightProperty(aPHLProp); + aPHLProp->SetColor( 155, 155, 155); + aPHLProp->SetLineWidth ( 3 ); + aPHLProp->SetOpacity ( 0.75 ); + actor->SetPreHighlightProperty(aPHLProp); - aProp->Delete(); - aHLProp->Delete(); - aPHLProp->Delete(); + aProp->Delete(); + aHLProp->Delete(); + aPHLProp->Delete(); */ return actor;