X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOBJECT%2FSMESH_SVTKActor.cxx;h=103a46f1e5256fff6145ea8954e89d476dc8a9ab;hb=907c315580012ca7e75c640c88f79e3ff2239276;hp=ca1d4ba5767a2e93ed2c32e3e400f66a79a10f9b;hpb=db4fd22d08c1c2f80e854c94f0cc86fa3e052cf8;p=modules%2Fsmesh.git diff --git a/src/OBJECT/SMESH_SVTKActor.cxx b/src/OBJECT/SMESH_SVTKActor.cxx index ca1d4ba57..103a46f1e 100644 --- a/src/OBJECT/SMESH_SVTKActor.cxx +++ b/src/OBJECT/SMESH_SVTKActor.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -43,7 +43,7 @@ #include -vtkStandardNewMacro(SMESH_SVTKActor); +vtkStandardNewMacro(SMESH_SVTKActor) /*! Constructor @@ -119,11 +119,10 @@ SMESH_SVTKActor myBallGrid->Initialize(); myBallGrid->Allocate(); - vtkDataSet *aSourceDataSet = theMapActor->GetInput(); - SVTK::CopyPoints( GetSource(), aSourceDataSet ); - SVTK::CopyPoints( myBallGrid, aSourceDataSet ); - SVTK::CopyPoints( my0DGrid, aSourceDataSet ); - + vtkUnstructuredGrid * aSourceGrid = (vtkUnstructuredGrid *)theMapActor->GetInput(); + GetSource()->SetPoints( aSourceGrid->GetPoints() ); + myBallGrid->SetPoints( aSourceGrid->GetPoints() ); + my0DGrid->SetPoints( aSourceGrid->GetPoints() ); int aNbOfParts = theMapIndex.Extent(); @@ -132,7 +131,7 @@ SMESH_SVTKActor //Copy deamaters of the balls if(myVisualObj) { outputCD = myBallGrid->GetCellData(); - cd = aSourceDataSet->GetCellData(); + cd = aSourceGrid->GetCellData(); } outputCD->CopyAllocate(cd,aNbOfParts,aNbOfParts/2); for(int ind = 1; ind <= aNbOfParts; ind++){ @@ -143,12 +142,14 @@ SMESH_SVTKActor { if(aCell->GetCellType() == VTK_VERTEX ) { my0DGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds()); - } else if(aCell->GetCellType() == VTK_POLY_VERTEX ) { + } + else if(aCell->GetCellType() == VTK_POLY_VERTEX ) { vtkIdType newCellId = myBallGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds()); if(myVisualObj) { outputCD->CopyData(cd, myVisualObj->GetElemVTKId(aPartId), newCellId); } - } else { + } + else { myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds()); } } @@ -197,6 +198,10 @@ void SMESH_SVTKActor::SetBallSize(float theSize) { myBallActor->GetProperty()->SetPointSize(theSize); } +void SMESH_SVTKActor::SetBallScale(double theScale) { + myBallActor->SetBallScale(theScale); +} + void SMESH_SVTKActor::SetVisualObject(TVisualObjPtr theVisualObj) { myVisualObj = theVisualObj; }