Back to index

salome-smesh  6.5.0
Public Types | Public Member Functions | Private Attributes
SMESH::TPolySimulation Class Reference

List of all members.

Public Types

typedef std::vector< vtkIdType > TVTKIds

Public Member Functions

 TPolySimulation (SalomeApp_Application *app)
void SetPosition (SMESH_Actor *theActor, vtkIdType theType, const TVTKIds &theIds, bool theReset=true)
void ResetGrid (bool theReset=true)
void SetVisibility (bool theVisibility)
 ~TPolySimulation ()

Private Attributes

SVTK_ViewWindow * myViewWindow
SALOME_Actor * myPreviewActor
vtkDataSetMapper * myMapper
vtkUnstructuredGrid * myGrid

Detailed Description

Definition at line 90 of file SMESHGUI_CreatePolyhedralVolumeDlg.cxx.


Member Typedef Documentation

typedef std::vector<vtkIdType> SMESH::TPolySimulation::TVTKIds

Definition at line 133 of file SMESHGUI_CreatePolyhedralVolumeDlg.cxx.


Constructor & Destructor Documentation

SMESH::TPolySimulation::TPolySimulation ( SalomeApp_Application *  app) [inline]

Definition at line 100 of file SMESHGUI_CreatePolyhedralVolumeDlg.cxx.

    {
      SUIT_ViewManager* mgr = app->activeViewManager();
      myViewWindow = mgr ? dynamic_cast<SVTK_ViewWindow*>( mgr->getActiveView() ) : NULL;

      myGrid = vtkUnstructuredGrid::New();
  
      // Create and display actor
      myMapper = vtkDataSetMapper::New();
      myMapper->SetInput( myGrid );

      myPreviewActor = SALOME_Actor::New();
      myPreviewActor->PickableOff();
      myPreviewActor->VisibilityOff();
      myPreviewActor->SetMapper( myMapper );
      myPreviewActor->SetRepresentation( 3 );

      vtkFloatingPointType anRGB[3];
      vtkProperty* aProp = vtkProperty::New();
      GetColor( "SMESH", "selection_element_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
      aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
      myPreviewActor->SetProperty( aProp );
      vtkFloatingPointType aFactor,aUnits;
      myPreviewActor->SetResolveCoincidentTopology(true);
      myPreviewActor->GetPolygonOffsetParameters(aFactor,aUnits);
      myPreviewActor->SetPolygonOffsetParameters(aFactor,0.2*aUnits);
      aProp->Delete();

      myViewWindow->AddActor( myPreviewActor );
      
    }

Here is the call graph for this function:

Definition at line 171 of file SMESHGUI_CreatePolyhedralVolumeDlg.cxx.

                      {
      if( myViewWindow )
        myViewWindow->RemoveActor(myPreviewActor);

      myPreviewActor->Delete();

      myMapper->RemoveAllInputs();
      myMapper->Delete();

      myGrid->Delete();
    }

Member Function Documentation

void SMESH::TPolySimulation::ResetGrid ( bool  theReset = true) [inline]

Definition at line 161 of file SMESHGUI_CreatePolyhedralVolumeDlg.cxx.

                                      {
      if (theReset) myGrid->Reset();
    }

Here is the caller graph for this function:

void SMESH::TPolySimulation::SetPosition ( SMESH_Actor *  theActor,
vtkIdType  theType,
const TVTKIds theIds,
bool  theReset = true 
) [inline]

Definition at line 134 of file SMESHGUI_CreatePolyhedralVolumeDlg.cxx.

    {
      vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
      myGrid->SetPoints(aGrid->GetPoints());

      ResetGrid(theReset);
      
      vtkIdList *anIds = vtkIdList::New();

      for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
        anIds->InsertId(i,theIds[i]);

      myGrid->InsertNextCell(theType,anIds);
      if(theIds.size()!=0){
        myGrid->InsertNextCell(theType,anIds);
        myGrid->Modified();
      }
        
      anIds->Delete();

      SetVisibility(true);

    }

Here is the call graph for this function:

void SMESH::TPolySimulation::SetVisibility ( bool  theVisibility) [inline]

Definition at line 165 of file SMESHGUI_CreatePolyhedralVolumeDlg.cxx.

                                          {
      myPreviewActor->SetVisibility(theVisibility);
      RepaintCurrentView();
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

vtkUnstructuredGrid* SMESH::TPolySimulation::myGrid [private]

Definition at line 96 of file SMESHGUI_CreatePolyhedralVolumeDlg.cxx.

vtkDataSetMapper* SMESH::TPolySimulation::myMapper [private]

Definition at line 95 of file SMESHGUI_CreatePolyhedralVolumeDlg.cxx.

SALOME_Actor* SMESH::TPolySimulation::myPreviewActor [private]

Definition at line 94 of file SMESHGUI_CreatePolyhedralVolumeDlg.cxx.

SVTK_ViewWindow* SMESH::TPolySimulation::myViewWindow [private]

Definition at line 92 of file SMESHGUI_CreatePolyhedralVolumeDlg.cxx.


The documentation for this class was generated from the following file: