Public Member Functions | |
| TNodeSimulation (SVTK_ViewWindow *theViewWindow) | |
| void | SetPosition (float x, float y, float z) |
| void | SetVisibility (bool theVisibility) |
| ~TNodeSimulation () | |
Private Attributes | |
| SVTK_ViewWindow * | myViewWindow |
| SALOME_Actor * | myPreviewActor |
| vtkDataSetMapper * | myMapper |
| vtkPoints * | myPoints |
Definition at line 123 of file SMESHGUI_NodesDlg.cxx.
| SMESH.TNodeSimulation.TNodeSimulation | ( | SVTK_ViewWindow * | theViewWindow | ) |
Definition at line 132 of file SMESHGUI_NodesDlg.cxx.
References SMESH.GetColor(), SMESH.GetFloat(), SMESH.TNodeSimulation.myMapper, SMESH.TNodeSimulation.myPoints, SMESH.TNodeSimulation.myPreviewActor, and SMESH.TNodeSimulation.myViewWindow.
:
myViewWindow( theViewWindow )
{
vtkUnstructuredGrid* aGrid = vtkUnstructuredGrid::New();
// Create points
myPoints = vtkPoints::New();
myPoints->SetNumberOfPoints( 1 );
myPoints->SetPoint( 0, 0.0, 0.0, 0.0 );
// Create cells
vtkIdList *anIdList = vtkIdList::New();
anIdList->SetNumberOfIds( 1 );
vtkCellArray *aCells = vtkCellArray::New();
aCells->Allocate( 2, 0 );
vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New();
aCellTypesArray->SetNumberOfComponents( 1 );
aCellTypesArray->Allocate( 1 );
anIdList->SetId( 0, 0 );
aCells->InsertNextCell( anIdList );
aCellTypesArray->InsertNextValue( VTK_VERTEX );
VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
aCellLocationsArray->SetNumberOfComponents( 1 );
aCellLocationsArray->SetNumberOfTuples( 1 );
aCells->InitTraversal();
vtkIdType npts = 0;
aCellLocationsArray->SetValue( 0, aCells->GetTraversalLocation( npts ) );
aGrid->SetCells( aCellTypesArray, aCellLocationsArray, aCells );
aGrid->SetPoints( myPoints );
aGrid->SetCells( aCellTypesArray, aCellLocationsArray, aCells );
aCellLocationsArray->Delete();
aCellTypesArray->Delete();
aCells->Delete();
anIdList->Delete();
// Create and display actor
myMapper = vtkDataSetMapper::New();
myMapper->SetInput( aGrid );
aGrid->Delete();
myPreviewActor = SALOME_Actor::New();
myPreviewActor->SetInfinitive( true );
myPreviewActor->VisibilityOff();
myPreviewActor->PickableOff();
myPreviewActor->SetMapper( myMapper );
vtkProperty* aProp = vtkProperty::New();
aProp->SetRepresentationToPoints();
vtkFloatingPointType anRGB[3];
GetColor( "SMESH", "node_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 0 ) );
aProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
vtkFloatingPointType aPointSize = GetFloat( "SMESH:node_size", 3 );
aProp->SetPointSize( aPointSize );
myPreviewActor->SetProperty( aProp );
aProp->Delete();
myViewWindow->AddActor( myPreviewActor );
}
| SMESH.TNodeSimulation.~TNodeSimulation | ( | ) |
Definition at line 214 of file SMESHGUI_NodesDlg.cxx.
References SMESH.TNodeSimulation.myMapper, SMESH.TNodeSimulation.myPoints, SMESH.TNodeSimulation.myPreviewActor, and SMESH.TNodeSimulation.myViewWindow.
{
myViewWindow->RemoveActor( myPreviewActor );
myPreviewActor->Delete();
myMapper->RemoveAllInputs();
myMapper->Delete();
myPoints->Delete();
}
| void SMESH.TNodeSimulation.SetPosition | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
Definition at line 201 of file SMESHGUI_NodesDlg.cxx.
References SMESH.TNodeSimulation.myPoints, and SMESH.TNodeSimulation.SetVisibility().
Referenced by SMESHGUI_NodesDlg.SelectionIntoArgument(), and SMESHGUI_NodesDlg.ValueChangedInSpinBox().
{
myPoints->SetPoint( 0, x, y, z );
myPoints->Modified();
SetVisibility( true );
}
| void SMESH.TNodeSimulation.SetVisibility | ( | bool | theVisibility | ) |
Definition at line 208 of file SMESHGUI_NodesDlg.cxx.
References SMESH.TNodeSimulation.myPreviewActor, and SMESH.RepaintCurrentView().
Referenced by SMESHGUI_NodesDlg.ClickOnApply(), SMESHGUI_NodesDlg.ClickOnCancel(), SMESHGUI_NodesDlg.DeactivateActiveDialog(), SMESHGUI_NodesDlg.SelectionIntoArgument(), and SMESH.TNodeSimulation.SetPosition().
{
myPreviewActor->SetVisibility( theVisibility );
RepaintCurrentView();
}
vtkDataSetMapper* SMESH.TNodeSimulation.myMapper [private] |
Definition at line 128 of file SMESHGUI_NodesDlg.cxx.
Referenced by SMESH.TNodeSimulation.TNodeSimulation(), and SMESH.TNodeSimulation.~TNodeSimulation().
vtkPoints* SMESH.TNodeSimulation.myPoints [private] |
Definition at line 129 of file SMESHGUI_NodesDlg.cxx.
Referenced by SMESH.TNodeSimulation.SetPosition(), SMESH.TNodeSimulation.TNodeSimulation(), and SMESH.TNodeSimulation.~TNodeSimulation().
SALOME_Actor* SMESH.TNodeSimulation.myPreviewActor [private] |
Definition at line 127 of file SMESHGUI_NodesDlg.cxx.
Referenced by SMESH.TNodeSimulation.SetVisibility(), SMESH.TNodeSimulation.TNodeSimulation(), and SMESH.TNodeSimulation.~TNodeSimulation().
SVTK_ViewWindow* SMESH.TNodeSimulation.myViewWindow [private] |
Definition at line 125 of file SMESHGUI_NodesDlg.cxx.
Referenced by SMESH.TNodeSimulation.TNodeSimulation(), and SMESH.TNodeSimulation.~TNodeSimulation().