Public Types | |
| typedef std::vector< vtkIdType > | TVTKIds |
| typedef std::vector< vtkIdType > | TVTKIds |
Public Member Functions | |
| TElementSimulation (SalomeApp_Application *theApplication) | |
| void | SetPosition (SMESH_Actor *theActor, vtkIdType theType, const TVTKIds &theIds) |
| void | SetVisibility (bool theVisibility, bool theShowOrientation=false) |
| ~TElementSimulation () | |
| TElementSimulation (SalomeApp_Application *theApplication) | |
| void | SetPosition (SMESH_Actor *theActor, const int theType, TVTKIds &theIds, const int theMode, const bool theReverse) |
| void | SetVisibility (bool theVisibility, bool theShowOrientation=false) |
| ~TElementSimulation () | |
Private Attributes | |
| SalomeApp_Application * | myApplication |
| SUIT_ViewWindow * | myViewWindow |
| SVTK_ViewWindow * | myVTKViewWindow |
| SALOME_Actor * | myPreviewActor |
| vtkDataSetMapper * | myMapper |
| vtkUnstructuredGrid * | myGrid |
| SALOME_Actor * | myFaceOrientation |
| vtkPolyDataMapper * | myFaceOrientationDataMapper |
| SMESH_FaceOrientationFilter * | myFaceOrientationFilter |
Definition at line 88 of file SMESHGUI_AddMeshElementDlg.cxx.
| typedef std::vector<vtkIdType> SMESH.TElementSimulation.TVTKIds |
Definition at line 158 of file SMESHGUI_AddMeshElementDlg.cxx.
| typedef std::vector<vtkIdType> SMESH.TElementSimulation.TVTKIds |
Definition at line 223 of file SMESHGUI_AddQuadraticElementDlg.cxx.
| SMESH.TElementSimulation.TElementSimulation | ( | SalomeApp_Application * | theApplication | ) |
Definition at line 103 of file SMESHGUI_AddMeshElementDlg.cxx.
References SMESH.GetColor(), SMESH.GetVtkViewWindow(), SMESH.TElementSimulation.myApplication, SMESH.TElementSimulation.myFaceOrientation, SMESH.TElementSimulation.myFaceOrientationDataMapper, SMESH.TElementSimulation.myFaceOrientationFilter, SMESH.TElementSimulation.myGrid, SMESH.TElementSimulation.myMapper, SMESH.TElementSimulation.myPreviewActor, SMESH.TElementSimulation.myViewWindow, SMESH.TElementSimulation.myVTKViewWindow, and SMESH_FaceOrientationFilter.New().
{
myApplication = theApplication;
SUIT_ViewManager* mgr = theApplication->activeViewManager();
if (!mgr) return;
myViewWindow = mgr->getActiveView();
myVTKViewWindow = GetVtkViewWindow(myViewWindow);
myGrid = vtkUnstructuredGrid::New();
// Create and display actor
myMapper = vtkDataSetMapper::New();
myMapper->SetInput(myGrid);
myPreviewActor = SALOME_Actor::New();
myPreviewActor->PickableOff();
myPreviewActor->VisibilityOff();
myPreviewActor->SetMapper(myMapper);
vtkFloatingPointType anRGB[3];
vtkProperty* aProp = vtkProperty::New();
GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
aProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
myPreviewActor->SetProperty( aProp );
aProp->Delete();
vtkProperty* aBackProp = vtkProperty::New();
GetColor( "SMESH", "backface_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 0, 255 ) );
aBackProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
myPreviewActor->SetBackfaceProperty( aBackProp );
aBackProp->Delete();
myVTKViewWindow->AddActor(myPreviewActor);
// Orientation of faces
myFaceOrientationFilter = SMESH_FaceOrientationFilter::New();
myFaceOrientationFilter->SetInput(myGrid);
myFaceOrientationDataMapper = vtkPolyDataMapper::New();
myFaceOrientationDataMapper->SetInput(myFaceOrientationFilter->GetOutput());
myFaceOrientation = SALOME_Actor::New();
myFaceOrientation->PickableOff();
myFaceOrientation->VisibilityOff();
myFaceOrientation->SetMapper(myFaceOrientationDataMapper);
vtkProperty* anOrientationProp = vtkProperty::New();
GetColor( "SMESH", "orientation_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
anOrientationProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
myFaceOrientation->SetProperty( anOrientationProp );
anOrientationProp->Delete();
myVTKViewWindow->AddActor(myFaceOrientation);
}
| SMESH.TElementSimulation.~TElementSimulation | ( | ) |
Definition at line 215 of file SMESHGUI_AddMeshElementDlg.cxx.
References SMESH.FindVtkViewWindow(), SMESH.TElementSimulation.myApplication, SMESH.TElementSimulation.myFaceOrientation, SMESH.TElementSimulation.myFaceOrientationDataMapper, SMESH.TElementSimulation.myFaceOrientationFilter, SMESH.TElementSimulation.myGrid, SMESH.TElementSimulation.myMapper, SMESH.TElementSimulation.myPreviewActor, SMESH.TElementSimulation.myViewWindow, and SMESH.TElementSimulation.myVTKViewWindow.
{
if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
myVTKViewWindow->RemoveActor(myPreviewActor);
myVTKViewWindow->RemoveActor(myFaceOrientation);
}
myPreviewActor->Delete();
myFaceOrientation->Delete();
myMapper->RemoveAllInputs();
myMapper->Delete();
myFaceOrientationFilter->Delete();
myFaceOrientationDataMapper->RemoveAllInputs();
myFaceOrientationDataMapper->Delete();
myGrid->Delete();
}
| SMESH.TElementSimulation.TElementSimulation | ( | SalomeApp_Application * | theApplication | ) |
Definition at line 168 of file SMESHGUI_AddQuadraticElementDlg.cxx.
References SMESH.GetColor(), SMESH.GetVtkViewWindow(), SMESH.TElementSimulation.myApplication, SMESH.TElementSimulation.myFaceOrientation, SMESH.TElementSimulation.myFaceOrientationDataMapper, SMESH.TElementSimulation.myFaceOrientationFilter, SMESH.TElementSimulation.myGrid, SMESH.TElementSimulation.myMapper, SMESH.TElementSimulation.myPreviewActor, SMESH.TElementSimulation.myViewWindow, SMESH.TElementSimulation.myVTKViewWindow, and SMESH_FaceOrientationFilter.New().
{
myApplication = theApplication;
SUIT_ViewManager* mgr = theApplication->activeViewManager();
if (!mgr) return;
myViewWindow = mgr->getActiveView();
myVTKViewWindow = GetVtkViewWindow(myViewWindow);
myGrid = vtkUnstructuredGrid::New();
// Create and display actor
myMapper = vtkDataSetMapper::New();
myMapper->SetInput(myGrid);
myPreviewActor = SALOME_Actor::New();
myPreviewActor->PickableOff();
myPreviewActor->VisibilityOff();
myPreviewActor->SetMapper(myMapper);
vtkProperty* myProp = vtkProperty::New();
vtkFloatingPointType aRGB[3], aBackRGB[3];
GetColor( "SMESH", "fill_color", aRGB[0], aRGB[1], aRGB[2], QColor( 0, 170, 255 ) );
myProp->SetColor( aRGB[0], aRGB[1], aRGB[2] );
myPreviewActor->SetProperty( myProp );
myProp->Delete();
vtkProperty* myBackProp = vtkProperty::New();
GetColor( "SMESH", "backface_color", aBackRGB[0], aBackRGB[1], aBackRGB[2], QColor( 0, 0, 255 ) );
myBackProp->SetColor( aBackRGB[0], aBackRGB[1], aBackRGB[2] );
myPreviewActor->SetBackfaceProperty( myBackProp );
myBackProp->Delete();
myVTKViewWindow->AddActor(myPreviewActor);
// Orientation of faces
myFaceOrientationFilter = SMESH_FaceOrientationFilter::New();
myFaceOrientationFilter->SetInput(myGrid);
myFaceOrientationDataMapper = vtkPolyDataMapper::New();
myFaceOrientationDataMapper->SetInput(myFaceOrientationFilter->GetOutput());
myFaceOrientation = SALOME_Actor::New();
myFaceOrientation->PickableOff();
myFaceOrientation->VisibilityOff();
myFaceOrientation->SetMapper(myFaceOrientationDataMapper);
vtkProperty* anOrientationProp = vtkProperty::New();
GetColor( "SMESH", "orientation_color", aRGB[0], aRGB[1], aRGB[2], QColor( 255, 255, 255 ) );
anOrientationProp->SetColor( aRGB[0], aRGB[1], aRGB[2] );
myFaceOrientation->SetProperty( anOrientationProp );
anOrientationProp->Delete();
myVTKViewWindow->AddActor(myFaceOrientation);
}
| SMESH.TElementSimulation.~TElementSimulation | ( | ) |
Definition at line 314 of file SMESHGUI_AddQuadraticElementDlg.cxx.
References SMESH.FindVtkViewWindow(), SMESH.TElementSimulation.myApplication, SMESH.TElementSimulation.myFaceOrientation, SMESH.TElementSimulation.myFaceOrientationDataMapper, SMESH.TElementSimulation.myFaceOrientationFilter, SMESH.TElementSimulation.myGrid, SMESH.TElementSimulation.myMapper, SMESH.TElementSimulation.myPreviewActor, SMESH.TElementSimulation.myViewWindow, and SMESH.TElementSimulation.myVTKViewWindow.
{
if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
myVTKViewWindow->RemoveActor(myPreviewActor);
myVTKViewWindow->RemoveActor(myFaceOrientation);
}
myPreviewActor->Delete();
myFaceOrientation->Delete();
myMapper->RemoveAllInputs();
myMapper->Delete();
myFaceOrientationFilter->Delete();
myFaceOrientationDataMapper->RemoveAllInputs();
myFaceOrientationDataMapper->Delete();
myGrid->Delete();
// myProp->Delete();
// myBackProp->Delete();
}
| void SMESH.TElementSimulation.SetPosition | ( | SMESH_Actor * | theActor, |
| vtkIdType | theType, | ||
| const TVTKIds & | theIds | ||
| ) |
Definition at line 159 of file SMESHGUI_AddMeshElementDlg.cxx.
References SMESH_BelongToGeom.anIds, SMESH_Actor.GetFacesOriented(), SMESH_Actor.GetUnstructuredGrid(), SMESH.TElementSimulation.myGrid, and SMESH.TElementSimulation.SetVisibility().
Referenced by SMESHGUI_AddQuadraticElementDlg.displaySimulation(), and SMESHGUI_AddMeshElementDlg.displaySimulation().
{
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
myGrid->SetPoints(aGrid->GetPoints());
const int* aConn = NULL;
switch (theType) {
case VTK_TETRA:
{
static int anIds[] = {0,2,1,3};
aConn = anIds;
break;
}
case VTK_PYRAMID:
{
static int anIds[] = {0,3,2,1,4};
aConn = anIds;
break;
}
case VTK_HEXAHEDRON:
{
static int anIds[] = {0,3,2,1,4,7,6,5};
aConn = anIds;
break;
}
}
myGrid->Reset();
vtkIdList *anIds = vtkIdList::New();
if(aConn)
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
anIds->InsertId(i,theIds[aConn[i]]);
else
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
anIds->InsertId(i,theIds[i]);
myGrid->InsertNextCell(theType,anIds);
anIds->Delete();
myGrid->Modified();
SetVisibility(true, theActor->GetFacesOriented());
}
| void SMESH.TElementSimulation.SetPosition | ( | SMESH_Actor * | theActor, |
| const int | theType, | ||
| TVTKIds & | theIds, | ||
| const int | theMode, | ||
| const bool | theReverse | ||
| ) |
Definition at line 224 of file SMESHGUI_AddQuadraticElementDlg.cxx.
References SMESH_BelongToGeom.anIds, SMESH_Actor.GetFacesOriented(), SMESH_Actor.GetUnstructuredGrid(), SMESH.TElementSimulation.myGrid, SMESH.TElementSimulation.myPreviewActor, QUAD_EDGE, QUAD_HEXAHEDRON, QUAD_PENTAHEDRON, QUAD_PYRAMID, QUAD_QUADRANGLE, QUAD_TETRAHEDRON, QUAD_TRIANGLE, SMESH.ReverseConnectivity(), and SMESH.TElementSimulation.SetVisibility().
{
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
myGrid->SetPoints(aGrid->GetPoints());
//add points
vtkIdType aType = 0;
switch (theType) {
case QUAD_EDGE:
aType = VTK_QUADRATIC_EDGE;
break;
case QUAD_TRIANGLE:
aType = VTK_QUADRATIC_TRIANGLE;
break;
case QUAD_QUADRANGLE:
aType = VTK_QUADRATIC_QUAD;
break;
case QUAD_TETRAHEDRON:
aType = VTK_QUADRATIC_TETRA;
break;
case QUAD_PYRAMID:
//aType = VTK_QUADRATIC_PYRAMID; // NOT SUPPORTED IN VTK4.2
aType = VTK_CONVEX_POINT_SET;
break;
case QUAD_PENTAHEDRON:
aType = VTK_QUADRATIC_WEDGE;
//aType = VTK_CONVEX_POINT_SET;
break;
case QUAD_HEXAHEDRON:
aType = VTK_QUADRATIC_HEXAHEDRON;
break;
}
// take care of orientation
if ( aType == VTK_CONVEX_POINT_SET ) {
if ( theReverse && theMode == VTK_SURFACE ) {
//myPreviewActor->GetProperty()->SetColor( myBackRGB[0], myBackRGB[1], myBackRGB[2] );
}
}
else {
// VTK cell connectivity opposites the MED one for volumic elements
if( aType != VTK_QUADRATIC_WEDGE) {
if ( theIds.size() > 8 ? !theReverse : theReverse ) {
ReverseConnectivity( theIds, theType );
}
}
else if(theReverse)
ReverseConnectivity( theIds, theType );
}
myGrid->Reset();
vtkIdList *anIds = vtkIdList::New();
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++) {
anIds->InsertId(i,theIds[i]);
//std::cout << i<< ": " << theIds[i] << std::endl;
}
myGrid->InsertNextCell(aType,anIds);
anIds->Delete();
myGrid->Modified();
myPreviewActor->GetMapper()->Update();
myPreviewActor->SetRepresentation( theMode );
SetVisibility(true, theActor->GetFacesOriented());
// restore normal orientation
if ( aType == VTK_CONVEX_POINT_SET ) {
if ( theReverse && theMode == VTK_SURFACE ) {
//myPreviewActor->GetProperty()->SetColor( myRGB[0], myRGB[1], myRGB[2] );
}
}
}
Definition at line 306 of file SMESHGUI_AddQuadraticElementDlg.cxx.
References SMESH.TElementSimulation.myFaceOrientation, SMESH.TElementSimulation.myPreviewActor, and SMESH.RepaintCurrentView().
{
myPreviewActor->SetVisibility(theVisibility);
myFaceOrientation->SetVisibility(theShowOrientation);
RepaintCurrentView();
}
Definition at line 207 of file SMESHGUI_AddMeshElementDlg.cxx.
References SMESH.TElementSimulation.myFaceOrientation, SMESH.TElementSimulation.myPreviewActor, and SMESH.RepaintCurrentView().
Referenced by SMESHGUI_AddMeshElementDlg.CheckBox(), SMESHGUI_AddQuadraticElementDlg.ClickOnApply(), SMESHGUI_AddMeshElementDlg.ClickOnApply(), SMESHGUI_AddQuadraticElementDlg.ClickOnCancel(), SMESHGUI_AddMeshElementDlg.ClickOnCancel(), SMESHGUI_AddQuadraticElementDlg.DeactivateActiveDialog(), SMESHGUI_AddMeshElementDlg.DeactivateActiveDialog(), SMESHGUI_AddQuadraticElementDlg.displaySimulation(), SMESHGUI_AddQuadraticElementDlg.onReverse(), SMESHGUI_AddQuadraticElementDlg.onTextChange(), SMESHGUI_AddMeshElementDlg.onTextChange(), SMESHGUI_AddQuadraticElementDlg.SelectionIntoArgument(), SMESHGUI_AddMeshElementDlg.SelectionIntoArgument(), and SMESH.TElementSimulation.SetPosition().
{
myPreviewActor->SetVisibility(theVisibility);
myFaceOrientation->SetVisibility(theShowOrientation);
RepaintCurrentView();
}
SalomeApp_Application * SMESH.TElementSimulation::myApplication [private] |
Definition at line 90 of file SMESHGUI_AddMeshElementDlg.cxx.
Referenced by SMESH.TElementSimulation.TElementSimulation(), and SMESH.TElementSimulation.~TElementSimulation().
Definition at line 98 of file SMESHGUI_AddMeshElementDlg.cxx.
Referenced by SMESH.TElementSimulation.SetVisibility(), SMESH.TElementSimulation.TElementSimulation(), and SMESH.TElementSimulation.~TElementSimulation().
vtkPolyDataMapper * SMESH.TElementSimulation::myFaceOrientationDataMapper [private] |
Definition at line 99 of file SMESHGUI_AddMeshElementDlg.cxx.
Referenced by SMESH.TElementSimulation.TElementSimulation(), and SMESH.TElementSimulation.~TElementSimulation().
Definition at line 100 of file SMESHGUI_AddMeshElementDlg.cxx.
Referenced by SMESH.TElementSimulation.TElementSimulation(), and SMESH.TElementSimulation.~TElementSimulation().
vtkUnstructuredGrid * SMESH.TElementSimulation::myGrid [private] |
Definition at line 96 of file SMESHGUI_AddMeshElementDlg.cxx.
Referenced by SMESH.TElementSimulation.SetPosition(), SMESH.TElementSimulation.TElementSimulation(), and SMESH.TElementSimulation.~TElementSimulation().
vtkDataSetMapper * SMESH.TElementSimulation::myMapper [private] |
Definition at line 95 of file SMESHGUI_AddMeshElementDlg.cxx.
Referenced by SMESH.TElementSimulation.TElementSimulation(), and SMESH.TElementSimulation.~TElementSimulation().
SALOME_Actor * SMESH.TElementSimulation::myPreviewActor [private] |
Definition at line 94 of file SMESHGUI_AddMeshElementDlg.cxx.
Referenced by SMESH.TElementSimulation.SetPosition(), SMESH.TElementSimulation.SetVisibility(), SMESH.TElementSimulation.TElementSimulation(), and SMESH.TElementSimulation.~TElementSimulation().
SUIT_ViewWindow * SMESH.TElementSimulation::myViewWindow [private] |
Definition at line 91 of file SMESHGUI_AddMeshElementDlg.cxx.
Referenced by SMESH.TElementSimulation.TElementSimulation(), and SMESH.TElementSimulation.~TElementSimulation().
SVTK_ViewWindow * SMESH.TElementSimulation::myVTKViewWindow [private] |
Definition at line 92 of file SMESHGUI_AddMeshElementDlg.cxx.
Referenced by SMESH.TElementSimulation.TElementSimulation(), and SMESH.TElementSimulation.~TElementSimulation().