vtkUnstructuredGrid* aGrid = myControlActor->GetUnstructuredGrid();
vtkIdType aNbCells = aGrid->GetNumberOfCells();
+ bool aShowOnlyScalarBarTitle = false;
if(aNbCells){
myControlMode = theMode;
switch(myControlMode){
case eFreeNodes:
case eCoincidentNodes:
myNodeExtActor->SetExtControlMode(myFunctor);
+ aShowOnlyScalarBarTitle = true;
break;
case eFreeEdges:
case eFreeBorders:
case eCoincidentElems1D:
my1DExtActor->SetExtControlMode(myFunctor);
+ aShowOnlyScalarBarTitle = true;
break;
case eFreeFaces:
case eBareBorderFace:
case eOverConstrainedFace:
case eCoincidentElems2D:
my2DExtActor->SetExtControlMode(myFunctor);
+ aShowOnlyScalarBarTitle = true;
break;
case eBareBorderVolume:
case eOverConstrainedVolume:
case eCoincidentElems3D:
my3DExtActor->SetExtControlMode(myFunctor);
+ aShowOnlyScalarBarTitle = true;
break;
case eLength2D:
case eMultiConnection2D:
myControlActor->SetControlMode(myFunctor,myScalarBarActor,myLookupTable);
UpdateDistribution();
}
+ myScalarBarActor->SetTitleOnlyVisibility(aShowOnlyScalarBarTitle);
}
if(theCheckEntityMode) {
SetEntityMode(eVolumes);
}
}
+ QString aTitle = QString(myScalarBarActor->GetTitle());
+ aTitle.replace(QRegExp("(:\\s).*"),"\\1"+ QString::number(GetNumberControlEntities()));
+ myScalarBarActor->SetTitle(aTitle.toLatin1().constData());
}
else {
Update();
}
+int
+SMESH_ActorDef::
+GetNumberControlEntities(){
+ SMESH_DeviceActor* anAct = NULL;
+ switch(myControlMode){
+ case eFreeNodes:
+ case eCoincidentNodes:
+ anAct = myNodeExtActor;
+ break;
+ case eFreeEdges:
+ case eFreeBorders:
+ case eCoincidentElems1D:
+ anAct = my1DExtActor;
+ break;
+ case eFreeFaces:
+ case eBareBorderFace:
+ case eOverConstrainedFace:
+ case eCoincidentElems2D:
+ anAct = my2DExtActor;
+ break;
+ case eBareBorderVolume:
+ case eOverConstrainedVolume:
+ case eCoincidentElems3D:
+ anAct = my3DExtActor;
+ break;
+ }
+ return (anAct) ? anAct->GetUnstructuredGrid()->GetNumberOfCells() : -1;
+}
void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer){
case eLength2D:
case eMultiConnection2D:
my1DExtActor->VisibilityOn();
- default:
- if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
- myScalarBarActor->VisibilityOn();
+ break;
}
+ if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
+ myScalarBarActor->VisibilityOn();
}
if(myRepresentation != ePoint)
virtual void SetControlMode(eControl theMode) = 0;
virtual eControl GetControlMode() = 0;
virtual SMESH::Controls::FunctorPtr GetFunctor() = 0;
+ virtual int GetNumberControlEntities() = 0;
virtual SMESH_ScalarBarActor* GetScalarBarActor() = 0;
virtual bool GetFacesOrientation3DVectors();
virtual void SetControlMode(eControl theMode);
+ virtual int GetNumberControlEntities();
virtual eControl GetControlMode(){ return myControlMode;}
virtual SMESH::Controls::FunctorPtr GetFunctor() { return myFunctor; }
// By default monocolor
myDistributionColoringType = SMESH_MONOCOLOR_TYPE;
+
+ // By default scalar map is shown
+ myTitleOnlyVisibility = false;
// rnv end
}
{
renderedSomething += this->TitleActor->RenderOverlay(viewport);
}
- this->ScalarBarActor->RenderOverlay(viewport);
- this->myDistributionActor->RenderOverlay(viewport);
- if( this->TextActors == NULL)
- {
- vtkWarningMacro(<<"Need a mapper to render a scalar bar");
- return renderedSomething;
- }
+ if (!myTitleOnlyVisibility) {
+ this->ScalarBarActor->RenderOverlay(viewport);
+ this->myDistributionActor->RenderOverlay(viewport);
+ if( this->TextActors == NULL)
+ {
+ vtkWarningMacro(<<"Need a mapper to render a scalar bar");
+ return renderedSomething;
+ }
- for (i=0; i<this->NumberOfLabels; i++)
- {
- renderedSomething += this->TextActors[i]->RenderOverlay(viewport);
- }
-
+ for (i=0; i<this->NumberOfLabels; i++)
+ {
+ renderedSomething += this->TextActors[i]->RenderOverlay(viewport);
+ }
+ }
renderedSomething = (renderedSomething > 0)?(1):(0);
return renderedSomething;
// rnv begin
// Customization of the vtkScalarBarActor to show distribution histogram.
- if(myNbValues[i] && myDistributionColoringType == SMESH_MULTICOLOR_TYPE && GetDistributionVisibility() && distrVisibility)
+ if(myDistributionColoringType == SMESH_MULTICOLOR_TYPE && GetDistributionVisibility() && distrVisibility)
{
rgb = distColors->GetPointer(3*dcCount); //write into array directly
rgb[0] = rgba[0];
void SMESH_ScalarBarActor::GetDistributionColor (double rgb[3]) {
myDistributionActor->GetProperty()->GetColor(rgb);
}
+
+void SMESH_ScalarBarActor::SetTitleOnlyVisibility( bool theTitleOnlyVisibility) {
+ myTitleOnlyVisibility = theTitleOnlyVisibility;
+}
+
+bool SMESH_ScalarBarActor::GetTitleOnlyVisibility() {
+ return myTitleOnlyVisibility;
+}
// Get Distribution Color
void GetDistributionColor (double rgb[3]);
+ // Description:
+ // Set visibility status of scalar map
+ void SetTitleOnlyVisibility( bool );
+ // Description:
+ // Get visibility status of scalar map
+ bool GetTitleOnlyVisibility();
protected:
SMESH_ScalarBarActor();
vtkPolyDataMapper2D* myDistributionMapper; //Distribution mapper
std::vector<int> myNbValues; //Nb values for the range
int myDistributionColoringType; //Distribution color type (monocolor or multicolor)
+ bool myTitleOnlyVisibility; //Show scalar map or not
private:
SMESH_ScalarBarActor(const SMESH_ScalarBarActor&); // Not implemented.
if ( anActor->GetControlMode() != aControl )
anActor->SetControlMode( aControl );
QString functorName = functorToString( anActor->GetFunctor() );
+ int anEntitiesCount = anActor->GetNumberControlEntities();
+ if (anEntitiesCount >= 0)
+ functorName = functorName + ": " + QString::number(anEntitiesCount);
anActor->GetScalarBarActor()->SetTitle( functorName.toLatin1().constData() );
SMESH::RepaintCurrentView();
#ifndef DISABLE_PLOT2DVIEWER
<source>AREA_ELEMENTS</source>
<translation>Area</translation>
</message>
+ <message>
+ <source>FREE_NODES</source>
+ <translation>Free nodes</translation>
+ </message>
+ <message>
+ <source>FREE_EDGES</source>
+ <translation>Free edges</translation>
+ </message>
+ <message>
+ <source>FREE_FACES</source>
+ <translation>Free faces</translation>
+ </message>
+ <message>
+ <source>BARE_BORDER_FACE</source>
+ <translation>Faces with bare border</translation>
+ </message>
+ <message>
+ <source>OVER_CONSTRAINED_FACE</source>
+ <translation>Over-constrained faces</translation>
+ </message>
+ <message>
+ <source>BARE_BORDER_VOLUME</source>
+ <translation>Volumes with bare border</translation>
+ </message>
+ <message>
+ <source>OVER_CONSTRAINED_VOLUME</source>
+ <translation>Over-constrained volumes</translation>
+ </message>
<message>
<source>MIN_DIAG_ELEMENTS</source>
<translation>Minimum diagonal</translation>