Version: 6.3.1
Public Types | Public Member Functions | Private Attributes

SMESH.TPolySimulation Class Reference

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_ActormyPreviewActor
vtkDataSetMapper * myMapper
vtkUnstructuredGridmyGrid

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)

Definition at line 100 of file SMESHGUI_CreatePolyhedralVolumeDlg.cxx.

References SMESH.GetColor(), SMESH.TPolySimulation.myGrid, SMESH.TPolySimulation.myMapper, SMESH.TPolySimulation.myPreviewActor, and SMESH.TPolySimulation.myViewWindow.

    {
      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 );
      
    }
SMESH.TPolySimulation.~TPolySimulation ( )

Member Function Documentation

void SMESH.TPolySimulation.ResetGrid ( bool  theReset = true)
void SMESH.TPolySimulation.SetPosition ( SMESH_Actor theActor,
vtkIdType  theType,
const TVTKIds theIds,
bool  theReset = true 
)

Definition at line 134 of file SMESHGUI_CreatePolyhedralVolumeDlg.cxx.

References SMESH_BelongToGeom.anIds, SMESH_Actor.GetUnstructuredGrid(), SMESH.TPolySimulation.myGrid, SMESH.TPolySimulation.ResetGrid(), and SMESH.TPolySimulation.SetVisibility().

Referenced by SMESHGUI_CreatePolyhedralVolumeDlg.displaySimulation().

    {
      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);

    }
void SMESH.TPolySimulation.SetVisibility ( bool  theVisibility)

Field Documentation

vtkDataSetMapper* SMESH.TPolySimulation.myMapper [private]
SVTK_ViewWindow* SMESH.TPolySimulation.myViewWindow [private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS