+
+ bool distributionVisibility = mgr->booleanValue("SMESH","distribution_visibility");
+ myScalarBarActor->SetDistributionVisibility(distributionVisibility);
+
+ int coloringType = mgr->integerValue("SMESH", "distribution_coloring_type", 0);
+ myScalarBarActor->SetDistributionColoringType(coloringType);
+
+ QColor distributionColor = mgr->colorValue("SMESH", "distribution_color",
+ QColor(255, 255, 255));
+ double rgb[3];
+ rgb[0]= distributionColor.red()/255.;
+ rgb[1]= distributionColor.green()/255.;
+ rgb[2]= distributionColor.blue()/255.;
+ myScalarBarActor->SetDistributionColor(rgb);
+
+
+}
+
+void SMESH_ActorDef::UpdateDistribution()
+{
+ if(SMESH::Controls::NumericalFunctor* fun =
+ dynamic_cast<SMESH::Controls::NumericalFunctor*>(myFunctor.get()))
+ {
+ int nbIntervals = myScalarBarActor->GetMaximumNumberOfColors();
+ std::vector<int> nbEvents;
+ std::vector<double> funValues;
+ SMESH_VisualObjDef::TEntityList elems;
+ if ( dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get()))
+ dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get())->GetEntities( fun->GetType(), elems );
+ std::vector<int> elemIds; elemIds.reserve( elems.size() );
+ for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e)
+ elemIds.push_back( (*e)->GetID());
+ vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
+ double * range = lookupTable->GetRange();
+ bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10;
+ fun->GetHistogram(nbIntervals, nbEvents, funValues, elemIds, range, isLogarithmic);
+ myScalarBarActor->SetDistribution(nbEvents);
+ }
+}
+
+void SMESH_ActorDef::SetQuadratic2DRepresentation(EQuadratic2DRepresentation theMode)
+{
+ switch(theMode) {
+ case SMESH_Actor::eLines :
+ myHighlitableActor->SetQuadraticArcMode(false);
+ my2DActor->SetQuadraticArcMode(false);
+ my1DActor->SetQuadraticArcMode(false);
+ break;
+ case SMESH_Actor::eArcs :
+ myHighlitableActor->SetQuadraticArcMode(true);
+ if(GetRepresentation() != SMESH_Actor::ePoint) {
+ my2DActor->SetQuadraticArcMode(true);
+ my1DActor->SetQuadraticArcMode(true);
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+
+SMESH_Actor::EQuadratic2DRepresentation SMESH_ActorDef::GetQuadratic2DRepresentation()
+{
+ if(myHighlitableActor->GetQuadraticArcMode())
+ return SMESH_Actor::eArcs;
+ else
+ return SMESH_Actor::eLines;
+}
+
+void SMESH_ActorDef::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+{
+ SALOME_Actor::SetMarkerStd( theMarkerType, theMarkerScale );
+ myNodeActor->SetMarkerStd( theMarkerType, theMarkerScale );
+ myNodeExtActor->SetMarkerStd( theMarkerType, theMarkerScale );
+}
+
+void SMESH_ActorDef::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture )
+{
+ SALOME_Actor::SetMarkerTexture( theMarkerId, theMarkerTexture );
+ myNodeActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
+ myNodeExtActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
+ myMarkerTexture = theMarkerTexture; // for deferred update of myHighlightActor
+}
+
+void SMESH_ActorDef::UpdateFilter()
+{
+ unsigned int anObjectEntities = eAllEntity; // entities present in my object
+
+ if(!myVisualObj->GetNbEntities(SMDSAbs_0DElement)) {
+ anObjectEntities &= ~e0DElements;
+ }
+
+ if(!myVisualObj->GetNbEntities(SMDSAbs_Ball)) {
+ anObjectEntities &= ~eBallElem;
+ }
+
+ if(!myVisualObj->GetNbEntities(SMDSAbs_Edge)) {
+ anObjectEntities &= ~eEdges;
+ }
+
+ if(!myVisualObj->GetNbEntities(SMDSAbs_Face)) {
+ anObjectEntities &= ~eFaces;
+ }
+
+ if(!myVisualObj->GetNbEntities(SMDSAbs_Volume)) {
+ anObjectEntities &= ~eVolumes;
+ }
+
+ VTKViewer_ExtractUnstructuredGrid* aFilter = myBaseActor->GetExtractUnstructuredGrid();
+ VTKViewer_ExtractUnstructuredGrid* aHltFilter = myHighlitableActor->GetExtractUnstructuredGrid();
+ aFilter->ClearRegisteredCellsWithType();
+ aHltFilter->ClearRegisteredCellsWithType();
+
+ bool isPassAll = ( myEntityMode == anObjectEntities && myEntityMode );
+ if ( isPassAll )
+ {
+ aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::ePassAll);
+ aHltFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::ePassAll);
+ }
+ else
+ {
+ aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+ aHltFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+ if (myEntityMode & e0DElements) {
+ aFilter->RegisterCellsWithType(VTK_VERTEX);
+ aHltFilter->RegisterCellsWithType(VTK_VERTEX);
+ }
+
+ if (myEntityMode & eBallElem) {
+ aFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
+ }
+ if (myEntityMode & eEdges) {
+ aFilter->RegisterCellsWithType(VTK_LINE);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
+ aHltFilter->RegisterCellsWithType(VTK_LINE);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
+ }
+
+ if (myEntityMode & eFaces) {
+ aFilter->RegisterCellsWithType(VTK_TRIANGLE);
+ aFilter->RegisterCellsWithType(VTK_QUAD);
+ aFilter->RegisterCellsWithType(VTK_POLYGON);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_POLYGON);
+ aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
+ aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE);
+ aHltFilter->RegisterCellsWithType(VTK_TRIANGLE);
+ aHltFilter->RegisterCellsWithType(VTK_QUAD);
+ aHltFilter->RegisterCellsWithType(VTK_POLYGON);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_POLYGON);
+ aHltFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
+ aHltFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE);
+ }
+
+ if (myEntityMode & eVolumes) {
+ aFilter->RegisterCellsWithType(VTK_TETRA);
+ aFilter->RegisterCellsWithType(VTK_VOXEL);
+ aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
+ aFilter->RegisterCellsWithType(VTK_WEDGE);
+ aFilter->RegisterCellsWithType(VTK_PYRAMID);
+ aFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
+ aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
+ aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);
+ aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
+ aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
+ aHltFilter->RegisterCellsWithType(VTK_TETRA);
+ aHltFilter->RegisterCellsWithType(VTK_VOXEL);
+ aHltFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
+ aHltFilter->RegisterCellsWithType(VTK_WEDGE);
+ aHltFilter->RegisterCellsWithType(VTK_PYRAMID);
+ aHltFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
+ aHltFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
+ aHltFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
+ aHltFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
+ aHltFilter->RegisterCellsWithType(VTK_POLYHEDRON);
+ }
+ }
+ if ( GetVisibility() )
+ aFilter->Update();
+ if (MYDEBUG) MESSAGE(aFilter->GetOutput()->GetNumberOfCells());