+SMESH_ActorDef::SMESH_ActorDef(){
+ if(MYDEBUG) MESSAGE("SMESH_ActorDef");
+
+ myTimeStamp = vtkTimeStamp::New();
+
+ myIsPointsVisible = false;
+
+ myIsShrinkable = false;
+ myIsShrunk = false;
+
+ myControlsPrecision = (long)SMESH::GetFloat( "SMESH:ControlsPrecision", -1 );
+
+ float aPointSize = SMESH::GetFloat("SMESH:SettingsNodesSize",3);
+ float aLineWidth = SMESH::GetFloat("SMESH:SettingsWidth",1);
+
+ vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
+ SALOME_ExtractUnstructuredGrid* aFilter = NULL;
+
+ //Definition 2D and 3D divices of the actor
+ //-----------------------------------------
+ float anRGB[3] = {1,1,1};
+ mySurfaceProp = vtkProperty::New();
+ anRGB[0] = SMESH::GetFloat("SMESH:SettingsFillColorRed", 0)/255.;
+ anRGB[1] = SMESH::GetFloat("SMESH:SettingsFillColorGreen", 170)/255.;
+ anRGB[2] = SMESH::GetFloat("SMESH:SettingsFillColorBlue", 255)/255.;
+ mySurfaceProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+
+ myBackSurfaceProp = vtkProperty::New();
+ anRGB[0] = SMESH::GetFloat("SMESH:SettingsBackFaceColorRed", 0)/255.;
+ anRGB[1] = SMESH::GetFloat("SMESH:SettingsBackFaceColorGreen", 0)/255.;
+ anRGB[2] = SMESH::GetFloat("SMESH:SettingsBackFaceColorBlue", 255)/255.;
+ myBackSurfaceProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+
+ my2DActor = SMESH_DeviceActor::New();
+ my2DActor->SetUserMatrix(aMatrix);
+ my2DActor->SetStoreMapping(true);
+ my2DActor->PickableOff();
+ my2DActor->SetProperty(mySurfaceProp);
+ my2DActor->SetBackfaceProperty(myBackSurfaceProp);
+ my2DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
+ aFilter = my2DActor->GetExtractUnstructuredGrid();
+ aFilter->SetModeOfChanging(SALOME_ExtractUnstructuredGrid::eAdding);
+ aFilter->RegisterCellsWithType(VTK_TRIANGLE);
+ aFilter->RegisterCellsWithType(VTK_POLYGON);
+ aFilter->RegisterCellsWithType(VTK_QUAD);
+
+ my3DActor = SMESH_DeviceActor::New();
+ my3DActor->SetUserMatrix(aMatrix);
+ my3DActor->SetStoreMapping(true);
+ my3DActor->PickableOff();
+ my3DActor->SetProperty(mySurfaceProp);
+ my3DActor->SetBackfaceProperty(myBackSurfaceProp);
+ my3DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
+ aFilter = my3DActor->GetExtractUnstructuredGrid();
+ aFilter->SetModeOfChanging(SALOME_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_CONVEX_POINT_SET);
+
+
+ //Definition 1D divice of the actor
+ //---------------------------------
+ myEdgeProp = vtkProperty::New();
+ myEdgeProp->SetAmbient(1.0);
+ myEdgeProp->SetDiffuse(0.0);
+ myEdgeProp->SetSpecular(0.0);
+ anRGB[0] = SMESH::GetFloat("SMESH:SettingsOutlineColorRed", 0)/255.;
+ anRGB[1] = SMESH::GetFloat("SMESH:SettingsOutlineColorGreen", 170)/255.;
+ anRGB[2] = SMESH::GetFloat("SMESH:SettingsOutlineColorBlue", 255)/255.;
+ myEdgeProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ myEdgeProp->SetLineWidth(aLineWidth);
+
+ my1DActor = SMESH_DeviceActor::New();
+ my1DActor->SetUserMatrix(aMatrix);
+ my1DActor->SetStoreMapping(true);
+ my1DActor->PickableOff();
+ my1DActor->SetHighlited(true);
+ my1DActor->SetProperty(myEdgeProp);
+ my1DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
+ aFilter = my1DActor->GetExtractUnstructuredGrid();
+ aFilter->SetModeOfChanging(SALOME_ExtractUnstructuredGrid::eAdding);
+ aFilter->RegisterCellsWithType(VTK_LINE);
+
+ 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->SetStoreMapping(true);
+ my1DExtActor->PickableOff();
+ my1DExtActor->SetHighlited(true);
+ my1DExtActor->SetVisibility(false);
+ my1DExtActor->SetProperty(my1DExtProp);
+ my1DExtActor->SetRepresentation(SMESH_DeviceActor::eInsideframe);
+ aFilter = my1DExtActor->GetExtractUnstructuredGrid();
+ aFilter->SetModeOfChanging(SALOME_ExtractUnstructuredGrid::eAdding);
+ aFilter->RegisterCellsWithType(VTK_LINE);
+
+
+ //Definition 0D divice of the actor
+ //---------------------------------
+ myNodeProp = vtkProperty::New();
+ anRGB[0] = SMESH::GetFloat("SMESH:SettingsNodeColorRed",255)/255.;
+ anRGB[1] = SMESH::GetFloat("SMESH:SettingsNodeColorGreen",0)/255.;
+ anRGB[2] = SMESH::GetFloat("SMESH:SettingsNodeColorBlue",0)/255.;
+ myNodeProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ myNodeProp->SetPointSize(aPointSize);
+
+ myNodeActor = SMESH_DeviceActor::New();
+ myNodeActor->SetUserMatrix(aMatrix);
+ myNodeActor->SetStoreMapping(true);
+ myNodeActor->PickableOff();
+ myNodeActor->SetVisibility(false);
+ myNodeActor->SetProperty(myNodeProp);
+ myNodeActor->SetRepresentation(SMESH_DeviceActor::ePoint);
+ aFilter = myNodeActor->GetExtractUnstructuredGrid();
+ aFilter->SetModeOfExtraction(SALOME_ExtractUnstructuredGrid::ePoints);
+
+
+ //Definition of Pickable and Highlitable engines
+ //----------------------------------------------
+
+ myBaseActor = SMESH_DeviceActor::New();
+ myBaseActor->SetUserMatrix(aMatrix);
+ myBaseActor->SetStoreMapping(true);
+ myBaseActor->GetProperty()->SetOpacity(0.0);
+ myBaseActor->myGeomFilter->SetInside(true);
+
+ myPickableActor = myBaseActor;
+
+ myHighlightProp = vtkProperty::New();
+ myHighlightProp->SetAmbient(1.0);
+ myHighlightProp->SetDiffuse(0.0);
+ myHighlightProp->SetSpecular(0.0);
+ anRGB[0] = SMESH::GetFloat("SMESH:SettingsSelectColorRed", 255)/255.; // 1;
+ anRGB[1] = SMESH::GetFloat("SMESH:SettingsSelectColorGreen", 255)/255.; // 1;
+ anRGB[2] = SMESH::GetFloat("SMESH:SettingsSelectColorBlue", 255)/255.; // 1;
+ 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);
+ anRGB[0] = SMESH::GetFloat("SMESH:SettingsPreSelectColorRed", 0)/255.; // 0;
+ anRGB[1] = SMESH::GetFloat("SMESH:SettingsPreSelectColorGreen", 255)/255.; // 1;
+ anRGB[2] = SMESH::GetFloat("SMESH:SettingsPreSelectColorBlue", 255)/255.; // 1;
+ myPreselectProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ myPreselectProp->SetPointSize(aPointSize);
+ myPreselectProp->SetRepresentation(1);
+
+ myHighlitableActor = SMESH_DeviceActor::New();
+ myHighlitableActor->SetUserMatrix(aMatrix);
+ myHighlitableActor->SetStoreMapping(false);
+ myHighlitableActor->PickableOff();
+ myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
+
+ myNodeHighlitableActor = SMESH_DeviceActor::New();
+ myNodeHighlitableActor->SetUserMatrix(aMatrix);
+ myNodeHighlitableActor->SetStoreMapping(false);
+ myNodeHighlitableActor->PickableOff();
+ myNodeHighlitableActor->SetRepresentation(SMESH_DeviceActor::ePoint);
+ aFilter = myNodeHighlitableActor->GetExtractUnstructuredGrid();
+ aFilter->SetModeOfExtraction(SALOME_ExtractUnstructuredGrid::ePoints);
+
+
+ SetShrinkFactor(SMESH::GetFloat("SMESH:SettingsShrinkCoeff", 75)/100.);