Public Member Functions | |
| TIdPreview (SVTK_ViewWindow *theViewWindow) | |
| void | SetPointsData (SMDS_Mesh *theMesh, TColStd_MapOfInteger &theNodesIdMap) |
| void | SetElemsData (TColStd_MapOfInteger &theElemsIdMap, std::list< gp_XYZ > &aGrCentersXYZ) |
| void | AddToRender (vtkRenderer *theRenderer) |
| void | RemoveFromRender (vtkRenderer *theRenderer) |
| void | SetPointsLabeled (bool theIsPointsLabeled, bool theIsActorVisible=true) |
| ~TIdPreview () | |
Private Attributes | |
| SVTK_ViewWindow * | myViewWindow |
| vtkUnstructuredGrid * | myIdGrid |
| SALOME_Actor * | myIdActor |
| vtkUnstructuredGrid * | myPointsNumDataSet |
| vtkMaskPoints * | myPtsMaskPoints |
| vtkSelectVisiblePoints * | myPtsSelectVisiblePoints |
| vtkLabeledDataMapper * | myPtsLabeledDataMapper |
| vtkTextProperty * | aPtsTextProp |
| bool | myIsPointsLabeled |
| vtkActor2D * | myPointLabels |
| std::vector< int > | myIDs |
Definition at line 102 of file SMESHGUI_MergeDlg.cxx.
| SMESH.TIdPreview.TIdPreview | ( | SVTK_ViewWindow * | theViewWindow | ) |
Definition at line 120 of file SMESHGUI_MergeDlg.cxx.
References SMESH.TIdPreview.AddToRender(), SMESH.TIdPreview.aPtsTextProp, SMESH.TIdPreview.myIdActor, SMESH.TIdPreview.myIdGrid, SMESH.TIdPreview.myIsPointsLabeled, SMESH.TIdPreview.myPointLabels, SMESH.TIdPreview.myPointsNumDataSet, SMESH.TIdPreview.myPtsLabeledDataMapper, SMESH.TIdPreview.myPtsMaskPoints, SMESH.TIdPreview.myPtsSelectVisiblePoints, and SMESH.TIdPreview.myViewWindow.
:
myViewWindow(theViewWindow)
{
myIdGrid = vtkUnstructuredGrid::New();
// Create and display actor
vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
aMapper->SetInput( myIdGrid );
myIdActor = SALOME_Actor::New();
myIdActor->SetInfinitive(true);
myIdActor->VisibilityOff();
myIdActor->PickableOff();
myIdActor->SetMapper( aMapper );
aMapper->Delete();
myViewWindow->AddActor(myIdActor);
//Definition of points numbering pipeline
myPointsNumDataSet = vtkUnstructuredGrid::New();
myPtsMaskPoints = vtkMaskPoints::New();
myPtsMaskPoints->SetInput(myPointsNumDataSet);
myPtsMaskPoints->SetOnRatio(1);
myPtsSelectVisiblePoints = vtkSelectVisiblePoints::New();
myPtsSelectVisiblePoints->SetInput(myPtsMaskPoints->GetOutput());
myPtsSelectVisiblePoints->SelectInvisibleOff();
myPtsSelectVisiblePoints->SetTolerance(0.1);
myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
myPtsLabeledDataMapper->SetInput(myPtsSelectVisiblePoints->GetOutput());
#if (VTK_XVERSION < 0x050200)
myPtsLabeledDataMapper->SetLabelFormat("%g");
#endif
myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
vtkTextProperty* aPtsTextProp = vtkTextProperty::New();
aPtsTextProp->SetFontFamilyToTimes();
static int aPointsFontSize = 12;
aPtsTextProp->SetFontSize(aPointsFontSize);
aPtsTextProp->SetBold(1);
aPtsTextProp->SetItalic(0);
aPtsTextProp->SetShadow(0);
myPtsLabeledDataMapper->SetLabelTextProperty(aPtsTextProp);
aPtsTextProp->Delete();
myIsPointsLabeled = false;
myPointLabels = vtkActor2D::New();
myPointLabels->SetMapper(myPtsLabeledDataMapper);
myPointLabels->GetProperty()->SetColor(1,1,1);
myPointLabels->SetVisibility(myIsPointsLabeled);
AddToRender(myViewWindow->getRenderer());
}
| SMESH.TIdPreview.~TIdPreview | ( | ) |
Definition at line 261 of file SMESHGUI_MergeDlg.cxx.
References SMESH.TIdPreview.myIdActor, SMESH.TIdPreview.myIdGrid, SMESH.TIdPreview.myPointLabels, SMESH.TIdPreview.myPointsNumDataSet, SMESH.TIdPreview.myPtsLabeledDataMapper, SMESH.TIdPreview.myPtsMaskPoints, SMESH.TIdPreview.myPtsSelectVisiblePoints, SMESH.TIdPreview.myViewWindow, and SMESH.TIdPreview.RemoveFromRender().
{
RemoveFromRender(myViewWindow->getRenderer());
myIdGrid->Delete();
myViewWindow->RemoveActor(myIdActor);
myIdActor->Delete();
//Deleting of points numbering pipeline
//---------------------------------------
myPointsNumDataSet->Delete();
//myPtsLabeledDataMapper->RemoveAllInputs(); //vtk 5.0 porting
myPtsLabeledDataMapper->Delete();
//myPtsSelectVisiblePoints->UnRegisterAllOutputs(); //vtk 5.0 porting
myPtsSelectVisiblePoints->Delete();
//myPtsMaskPoints->UnRegisterAllOutputs(); //vtk 5.0 porting
myPtsMaskPoints->Delete();
myPointLabels->Delete();
// myTimeStamp->Delete();
}
| void SMESH.TIdPreview.AddToRender | ( | vtkRenderer * | theRenderer | ) |
Definition at line 223 of file SMESHGUI_MergeDlg.cxx.
References SMESH.TIdPreview.myIdActor, SMESH.TIdPreview.myPointLabels, and SMESH.TIdPreview.myPtsSelectVisiblePoints.
Referenced by SMESH.TIdPreview.TIdPreview().
{
myIdActor->AddToRender(theRenderer);
myPtsSelectVisiblePoints->SetRenderer(theRenderer);
theRenderer->AddActor2D(myPointLabels);
}
| void SMESH.TIdPreview.RemoveFromRender | ( | vtkRenderer * | theRenderer | ) |
Definition at line 231 of file SMESHGUI_MergeDlg.cxx.
References SMESH.TIdPreview.myIdActor, SMESH.TIdPreview.myPointLabels, and SMESH.TIdPreview.myPtsSelectVisiblePoints.
Referenced by SMESH.TIdPreview.~TIdPreview().
{
myIdActor->RemoveFromRender(theRenderer);
myPtsSelectVisiblePoints->SetRenderer(theRenderer);
theRenderer->RemoveActor(myPointLabels);
}
| void SMESH.TIdPreview.SetElemsData | ( | TColStd_MapOfInteger & | theElemsIdMap, |
| std::list< gp_XYZ > & | aGrCentersXYZ | ||
| ) |
Definition at line 199 of file SMESHGUI_MergeDlg.cxx.
References SMESH.TIdPreview.myIdActor, SMESH.TIdPreview.myIdGrid, and SMESH.TIdPreview.myIDs.
Referenced by SMESHGUI_MergeDlg.onSelectElementFromGroup(), and SMESHGUI_MergeDlg.onSelectGroup().
{
vtkPoints* aPoints = vtkPoints::New();
aPoints->SetNumberOfPoints(theElemsIdMap.Extent());
myIDs.clear();
TColStd_MapIteratorOfMapOfInteger idIter( theElemsIdMap );
for( ; idIter.More(); idIter.Next() ) {
myIDs.push_back(idIter.Key());
}
gp_XYZ aXYZ;
std::list<gp_XYZ>::iterator coordIt = aGrCentersXYZ.begin();
for( int i = 0; coordIt != aGrCentersXYZ.end(); coordIt++, i++ ) {
aXYZ = *coordIt;
aPoints->SetPoint( i, aXYZ.X(), aXYZ.Y(), aXYZ.Z() );
}
myIdGrid->SetPoints(aPoints);
aPoints->Delete();
myIdActor->GetMapper()->Update();
}
| void SMESH.TIdPreview.SetPointsData | ( | SMDS_Mesh * | theMesh, |
| TColStd_MapOfInteger & | theNodesIdMap | ||
| ) |
Definition at line 178 of file SMESHGUI_MergeDlg.cxx.
References SMDS_Mesh.FindNode(), SMESH.TIdPreview.myIdActor, SMESH.TIdPreview.myIdGrid, SMESH.TIdPreview.myIDs, SMDS_MeshNode.X(), SMDS_MeshNode.Y(), and SMDS_MeshNode.Z().
Referenced by SMESHGUI_MergeDlg.onSelectElementFromGroup(), and SMESHGUI_MergeDlg.onSelectGroup().
{
vtkPoints* aPoints = vtkPoints::New();
aPoints->SetNumberOfPoints(theNodesIdMap.Extent());
myIDs.clear();
TColStd_MapIteratorOfMapOfInteger idIter( theNodesIdMap );
for( int i = 0; idIter.More(); idIter.Next(), i++ ) {
const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key());
aPoints->SetPoint( i, aNode->X(), aNode->Y(), aNode->Z() );
myIDs.push_back(idIter.Key());
}
myIdGrid->SetPoints(aPoints);
aPoints->Delete();
myIdActor->GetMapper()->Update();
}
Definition at line 239 of file SMESHGUI_MergeDlg.cxx.
References SMESH.TIdPreview.myIdGrid, SMESH.TIdPreview.myIDs, SMESH.TIdPreview.myIsPointsLabeled, SMESH.TIdPreview.myPointLabels, SMESH.TIdPreview.myPointsNumDataSet, and SMESH.TIdPreview.myPtsMaskPoints.
Referenced by SMESHGUI_MergeDlg.ClickOnCancel(), SMESHGUI_MergeDlg.onSelectElementFromGroup(), SMESHGUI_MergeDlg.onSelectGroup(), SMESHGUI_MergeDlg.onTypeChanged(), and SMESHGUI_MergeDlg.SelectionIntoArgument().
{
myIsPointsLabeled = theIsPointsLabeled && myIdGrid->GetNumberOfPoints();
if ( myIsPointsLabeled ) {
myPointsNumDataSet->ShallowCopy(myIdGrid);
vtkDataSet *aDataSet = myPointsNumDataSet;
int aNbElem = myIDs.size();
vtkIntArray *anArray = vtkIntArray::New();
anArray->SetNumberOfValues( aNbElem );
for ( int i = 0; i < aNbElem; i++ )
anArray->SetValue( i, myIDs[i] );
aDataSet->GetPointData()->SetScalars( anArray );
anArray->Delete();
myPtsMaskPoints->SetInput( aDataSet );
myPointLabels->SetVisibility( theIsActorVisible );
}
else {
myPointLabels->SetVisibility( false );
}
}
vtkTextProperty* SMESH.TIdPreview.aPtsTextProp [private] |
Definition at line 113 of file SMESHGUI_MergeDlg.cxx.
Referenced by SMESH.TIdPreview.TIdPreview().
SALOME_Actor* SMESH.TIdPreview.myIdActor [private] |
Definition at line 107 of file SMESHGUI_MergeDlg.cxx.
Referenced by SMESH.TIdPreview.AddToRender(), SMESH.TIdPreview.RemoveFromRender(), SMESH.TIdPreview.SetElemsData(), SMESH.TIdPreview.SetPointsData(), SMESH.TIdPreview.TIdPreview(), and SMESH.TIdPreview.~TIdPreview().
vtkUnstructuredGrid* SMESH.TIdPreview.myIdGrid [private] |
Definition at line 106 of file SMESHGUI_MergeDlg.cxx.
Referenced by SMESH.TIdPreview.SetElemsData(), SMESH.TIdPreview.SetPointsData(), SMESH.TIdPreview.SetPointsLabeled(), SMESH.TIdPreview.TIdPreview(), and SMESH.TIdPreview.~TIdPreview().
std::vector<int> SMESH.TIdPreview.myIDs [private] |
Definition at line 117 of file SMESHGUI_MergeDlg.cxx.
Referenced by SMESH.TIdPreview.SetElemsData(), SMESH.TIdPreview.SetPointsData(), and SMESH.TIdPreview.SetPointsLabeled().
bool SMESH.TIdPreview.myIsPointsLabeled [private] |
Definition at line 114 of file SMESHGUI_MergeDlg.cxx.
Referenced by SMESH.TIdPreview.SetPointsLabeled(), and SMESH.TIdPreview.TIdPreview().
vtkActor2D* SMESH.TIdPreview.myPointLabels [private] |
Definition at line 115 of file SMESHGUI_MergeDlg.cxx.
Referenced by SMESH.TIdPreview.AddToRender(), SMESH.TIdPreview.RemoveFromRender(), SMESH.TIdPreview.SetPointsLabeled(), SMESH.TIdPreview.TIdPreview(), and SMESH.TIdPreview.~TIdPreview().
Definition at line 109 of file SMESHGUI_MergeDlg.cxx.
Referenced by SMESH.TIdPreview.SetPointsLabeled(), SMESH.TIdPreview.TIdPreview(), and SMESH.TIdPreview.~TIdPreview().
vtkLabeledDataMapper* SMESH.TIdPreview.myPtsLabeledDataMapper [private] |
Definition at line 112 of file SMESHGUI_MergeDlg.cxx.
Referenced by SMESH.TIdPreview.TIdPreview(), and SMESH.TIdPreview.~TIdPreview().
vtkMaskPoints* SMESH.TIdPreview.myPtsMaskPoints [private] |
Definition at line 110 of file SMESHGUI_MergeDlg.cxx.
Referenced by SMESH.TIdPreview.SetPointsLabeled(), SMESH.TIdPreview.TIdPreview(), and SMESH.TIdPreview.~TIdPreview().
vtkSelectVisiblePoints* SMESH.TIdPreview.myPtsSelectVisiblePoints [private] |
Definition at line 111 of file SMESHGUI_MergeDlg.cxx.
Referenced by SMESH.TIdPreview.AddToRender(), SMESH.TIdPreview.RemoveFromRender(), SMESH.TIdPreview.TIdPreview(), and SMESH.TIdPreview.~TIdPreview().
SVTK_ViewWindow* SMESH.TIdPreview.myViewWindow [private] |
Definition at line 104 of file SMESHGUI_MergeDlg.cxx.
Referenced by SMESH.TIdPreview.TIdPreview(), and SMESH.TIdPreview.~TIdPreview().