+SMESH_ActorDef::SMESH_ActorDef()
+{
+ if(MYDEBUG) MESSAGE("SMESH_ActorDef - "<<this);
+
+ myTimeStamp = vtkTimeStamp::New();
+
+ myIsPointsVisible = false;
+
+ myIsShrinkable = false;
+ myIsShrunk = false;
+
+ myControlsPrecision = -1;
+ SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
+ if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
+ myControlsPrecision = (long)SMESH::GetFloat( "SMESH", "controls_precision", -1 );
+
+ vtkFloatingPointType aPointSize = SMESH::GetFloat("SMESH:node_size",3);
+ vtkFloatingPointType aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
+
+ vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
+ VTKViewer_ExtractUnstructuredGrid* aFilter = NULL;
+
+ //Definition 2D and 3D divices of the actor
+ //-----------------------------------------
+ vtkFloatingPointType anRGB[3] = {1,1,1};
+ mySurfaceProp = vtkProperty::New();
+ SMESH::GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
+ mySurfaceProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
+
+ myBackSurfaceProp = vtkProperty::New();
+ SMESH::GetColor( "SMESH", "backface_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 0, 255 ) );
+ myBackSurfaceProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
+
+ my2DActor = SMESH_DeviceActor::New();
+ my2DActor->SetUserMatrix(aMatrix);
+ my2DActor->PickableOff();
+ my2DActor->SetProperty(mySurfaceProp);
+ my2DActor->SetBackfaceProperty(myBackSurfaceProp);
+ my2DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
+ aFilter = my2DActor->GetExtractUnstructuredGrid();
+ aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+ aFilter->RegisterCellsWithType(VTK_TRIANGLE);
+ aFilter->RegisterCellsWithType(VTK_POLYGON);
+ aFilter->RegisterCellsWithType(VTK_QUAD);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
+
+ my3DActor = SMESH_DeviceActor::New();
+ my3DActor->SetUserMatrix(aMatrix);
+ my3DActor->PickableOff();
+ my3DActor->SetProperty(mySurfaceProp);
+ my3DActor->SetBackfaceProperty(myBackSurfaceProp);
+ my3DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
+ aFilter = my3DActor->GetExtractUnstructuredGrid();
+ aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+ aFilter->RegisterCellsWithType(VTK_TETRA);
+ aFilter->RegisterCellsWithType(VTK_VOXEL);
+ aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
+ aFilter->RegisterCellsWithType(VTK_WEDGE);
+ aFilter->RegisterCellsWithType(VTK_PYRAMID);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
+ aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
+
+
+ //Definition 1D divice of the actor
+ //---------------------------------
+ myEdgeProp = vtkProperty::New();
+ myEdgeProp->SetAmbient(1.0);
+ myEdgeProp->SetDiffuse(0.0);
+ myEdgeProp->SetSpecular(0.0);
+ SMESH::GetColor( "SMESH", "outline_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
+ myEdgeProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ myEdgeProp->SetLineWidth(aLineWidth);
+
+ my1DActor = SMESH_DeviceActor::New();
+ my1DActor->SetUserMatrix(aMatrix);
+ my1DActor->PickableOff();
+ my1DActor->SetHighlited(true);
+ my1DActor->SetProperty(myEdgeProp);
+ my1DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
+ aFilter = my1DActor->GetExtractUnstructuredGrid();
+ aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+ aFilter->RegisterCellsWithType(VTK_LINE);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
+
+ my1DProp = vtkProperty::New();
+ my1DProp->DeepCopy(myEdgeProp);
+ my1DProp->SetLineWidth(aLineWidth + aLineWidthInc);
+ my1DProp->SetPointSize(aPointSize);
+
+ my1DExtProp = vtkProperty::New();
+ my1DExtProp->DeepCopy(myEdgeProp);
+ anRGB[0] = 1 - anRGB[0];
+ anRGB[1] = 1 - anRGB[1];
+ anRGB[2] = 1 - anRGB[2];
+ my1DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ my1DExtProp->SetLineWidth(aLineWidth + aLineWidthInc);
+ my1DExtProp->SetPointSize(aPointSize + aPointSizeInc);
+
+ my1DExtActor = SMESH_DeviceActor::New();
+ my1DExtActor->SetUserMatrix(aMatrix);
+ my1DExtActor->PickableOff();
+ my1DExtActor->SetHighlited(true);
+ my1DExtActor->SetVisibility(false);
+ my1DExtActor->SetProperty(my1DExtProp);
+ my1DExtActor->SetRepresentation(SMESH_DeviceActor::eInsideframe);
+ aFilter = my1DExtActor->GetExtractUnstructuredGrid();
+ aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+ aFilter->RegisterCellsWithType(VTK_LINE);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
+
+
+ //Definition 0D divice of the actor
+ //---------------------------------
+ myNodeProp = vtkProperty::New();
+ SMESH::GetColor( "SMESH", "node_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 0, 0 ) );
+ myNodeProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ myNodeProp->SetPointSize(aPointSize);
+
+ myNodeActor = SMESH_DeviceActor::New();
+ myNodeActor->SetUserMatrix(aMatrix);
+ myNodeActor->SetStoreClippingMapping(true);
+ myNodeActor->PickableOff();
+ myNodeActor->SetVisibility(false);
+ myNodeActor->SetProperty(myNodeProp);
+ myNodeActor->SetRepresentation(SMESH_DeviceActor::ePoint);
+ aFilter = myNodeActor->GetExtractUnstructuredGrid();
+ aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
+
+
+ //Definition of Pickable and Highlitable engines
+ //----------------------------------------------
+
+ myBaseActor = SMESH_DeviceActor::New();
+ myBaseActor->SetUserMatrix(aMatrix);
+ myBaseActor->SetStoreGemetryMapping(true);
+ myBaseActor->GetProperty()->SetOpacity(0.0);
+
+ myPickableActor = myBaseActor;
+
+ myHighlightProp = vtkProperty::New();
+ myHighlightProp->SetAmbient(1.0);
+ myHighlightProp->SetDiffuse(0.0);
+ myHighlightProp->SetSpecular(0.0);
+ SMESH::GetColor( "SMESH", "selection_object_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
+ myHighlightProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ myHighlightProp->SetPointSize(aPointSize);
+ myHighlightProp->SetRepresentation(1);
+
+ myPreselectProp = vtkProperty::New();
+ myPreselectProp->SetAmbient(1.0);
+ myPreselectProp->SetDiffuse(0.0);
+ myPreselectProp->SetSpecular(0.0);
+ SMESH::GetColor( "SMESH", "highlight_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 255 ) );
+ myPreselectProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ myPreselectProp->SetPointSize(aPointSize);
+ myPreselectProp->SetRepresentation(1);
+
+ myHighlitableActor = SMESH_DeviceActor::New();
+ myHighlitableActor->SetUserMatrix(aMatrix);
+ myHighlitableActor->PickableOff();
+ myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);