-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// 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
#include <Utils_SALOME_Exception.hxx>
-vtkStandardNewMacro(SMESH_SVTKActor);
+vtkStandardNewMacro(SMESH_SVTKActor)
/*!
Constructor
void
SMESH_SVTKActor
::MapCells(SALOME_Actor* theMapActor,
- const TColStd_IndexedMapOfInteger& theMapIndex)
+ const SVTK_TIndexedMapOfVtkId& theMapIndex)
{
myUnstructuredGrid->Initialize();
myUnstructuredGrid->Allocate();
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();
//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++){
- int aPartId = theMapIndex( ind );
+ for(int ind = 1; ind <= aNbOfParts; ind++)
+ {
+ vtkIdType aPartId = theMapIndex( ind );
if(vtkCell* aCell = theMapActor->GetElemCell(aPartId))
{
if (aCell->GetCellType() != VTK_POLYHEDRON)
{
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());
}
}
myBallActor->GetProperty()->SetPointSize(theSize);
}
+void SMESH_SVTKActor::SetBallScale(double theScale) {
+ myBallActor->SetBallScale(theScale);
+}
+
void SMESH_SVTKActor::SetVisualObject(TVisualObjPtr theVisualObj) {
myVisualObj = theVisualObj;
}