-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File :
// Author :
myIsActiveLocalScalarBar(true),
myIsDispGlobalScalarBar(true),
mySpacing(0.01),
- myFaceLimit(50000)
+ myFaceLimit(50000),
+ myShowBar(true)
{
if(MYDEBUG) MESSAGE("GaussPoints_i::GaussPoints_i - this = "<<this);
}
anAlphaTexture = aResourceMgr->stringValue( "VISU", "point_sprite_alpha_texture", anAlphaTexture );
SetTextures( aMainTexture.toLatin1().data(), anAlphaTexture.toLatin1().data() );
+
+ myShowBar = true;
return this;
}
SetColor(anOrigin->GetColor());
+ SetBarVisible(anOrigin->IsBarVisible());
+
SetTextures(anOrigin->GetMainTexture(), anOrigin->GetAlphaTexture());
}
}
CORBA::String_var aPixMapName = aPixmap->GetPixMap();
if(strcmp(GetIconName(), aPixMapName.in()) != 0)
aPixmap->SetPixMap(GetIconName());
+
+ QString aVal = VISU::Storable::FindValue(theMap,"myShowBar", "1");
+ SetBarVisible((aVal.toInt() == 1)? true : false);
SetIsActiveLocalScalarBar(Storable::FindValue(theMap,"myIsActiveLocalScalarBar").toInt());
SetIsDispGlobalScalarBar(Storable::FindValue(theMap,"myIsDispGlobalScalarBar").toInt());
Storable::DataToStream( theStr, "myAlphaTexture", GetQAlphaTexture() );
Storable::DataToStream( theStr, "myResolution", GetResolution() );
+ Storable::DataToStream( theStr, "myShowBar", (IsBarVisible()? 1:0) );
}
if(anIDMapper){
int aNbGroups = myGroupNames.size();
if(myGroupNames.find(theGroupName) == myGroupNames.end()){
- GetSpecificPL()->AddGeometry(anIDMapper->GetOutput());
+ GetSpecificPL()->AddGeometry(anIDMapper->GetOutput(), theGroupName);
myGroupNames.insert(theGroupName);
/*
if(aNbGroups == 0)
UpdateIcon();
*/
+ // To update scalar range according to the new input (IPAL21305)
+ if(!IsRangeFixed())
+ SetSourceRange();
}
}
}
return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
}
-
+void VISU::GaussPoints_i::SetBarVisible(CORBA::Boolean theVisible)
+{
+ if (myShowBar == theVisible)
+ return;
+ VISU::TSetModified aModified(this);
+ myShowBar = theVisible;
+ myParamsTime.Modified();
+}
+
//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
::CreateActor()
{
VISU_GaussPtsAct* anActor = VISU_GaussPtsAct::New();
+ anActor->SetBarVisibility(myShowBar);
if(OnCreateActor(anActor))
return anActor;
return NULL;
if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
VISU_ScalarBarCtrl *aScalarBarCtrl = anActor->GetScalarBarCtrl();
if(GetIsColored()){
- anActor->SetBarVisibility(true);
GetPipeLine()->GetMapper()->SetScalarVisibility(1);
if(IsRangeFixed()){
aScalarBarCtrl->Update();
}else{
- anActor->SetBarVisibility(false);
-
GetPipeLine()->GetMapper()->SetScalarVisibility(0);
anActor->GetProperty()->SetColor(myColor.red() / 255.0,
myColor.green() / 255.0,
myColor.blue() / 255.0);
}
+
+ anActor->SetBarVisibility(myShowBar && GetIsColored());
if( GetSpecificPL()->GetPrimitiveType() != VISU_OpenGLPointSpriteMapper::GeomSphere )
theActor->SetRepresentation( VTK_POINTS );
myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
myResult = aRange[0];
}else{
- VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode() );
+ VISU::TNames aGroupNames = myColoredPrs3d->GetSpecificPL()->GetGeometryNames();
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode(), aGroupNames );
myResult = aTMinMax.first;
}
}
myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
myResult = aRange[1];
}else{
- VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode() );
+ VISU::TNames aGroupNames = myColoredPrs3d->GetSpecificPL()->GetGeometryNames();
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode(), aGroupNames );
myResult = aTMinMax.second;
}
}
}
//----------------------------------------------------------------------------
-struct TGetComponentMin: public SALOME_Event
+struct TGaussGetComponentMin: public SALOME_Event
{
VISU::ColoredPrs3d_i* myColoredPrs3d;
vtkIdType myCompID;
typedef CORBA::Double TResult;
TResult myResult;
- TGetComponentMin( VISU::ColoredPrs3d_i* theColoredPrs3d,
- vtkIdType theCompID ):
+ TGaussGetComponentMin( VISU::ColoredPrs3d_i* theColoredPrs3d,
+ vtkIdType theCompID ):
myColoredPrs3d( theColoredPrs3d ),
myCompID( theCompID )
{}
void
Execute()
{
+ VISU::TNames aGroupNames;
+ if(VISU::GaussPoints_i* aPrs3d = dynamic_cast<VISU::GaussPoints_i*>(myColoredPrs3d))
+ aGroupNames = aPrs3d->GetSpecificPL()->GetGeometryNames();
+
VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
if ( aMinMaxController ) {
myResult = aMinMaxController->GetComponentMin( myCompID );
} else {
- VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID );
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID, aGroupNames );
myResult = aTMinMax.first;
}
}
VISU::GaussPoints_i
::GetComponentMin(vtkIdType theCompID)
{
- return ProcessEvent( new TGetComponentMin( this, theCompID ) );
+ return ProcessEvent( new TGaussGetComponentMin( this, theCompID ) );
}
//----------------------------------------------------------------------------
-struct TGetComponentMax: public SALOME_Event
+struct TGaussGetComponentMax: public SALOME_Event
{
VISU::ColoredPrs3d_i* myColoredPrs3d;
vtkIdType myCompID;
typedef CORBA::Double TResult;
TResult myResult;
- TGetComponentMax( VISU::ColoredPrs3d_i* theColoredPrs3d,
- vtkIdType theCompID ):
+ TGaussGetComponentMax( VISU::ColoredPrs3d_i* theColoredPrs3d,
+ vtkIdType theCompID ):
myColoredPrs3d( theColoredPrs3d ),
myCompID( theCompID )
{}
void
Execute()
{
+ VISU::TNames aGroupNames;
+ if(VISU::GaussPoints_i* aPrs3d = dynamic_cast<VISU::GaussPoints_i*>(myColoredPrs3d))
+ aGroupNames = aPrs3d->GetSpecificPL()->GetGeometryNames();
+
VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
if ( aMinMaxController ) {
myResult = aMinMaxController->GetComponentMax( myCompID );
} else {
- VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID );
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID, aGroupNames );
myResult = aTMinMax.second;
}
}
VISU::GaussPoints_i
::GetComponentMax(vtkIdType theCompID)
{
- return ProcessEvent( new TGetComponentMax( this, theCompID ) );
+ return ProcessEvent( new TGaussGetComponentMax( this, theCompID ) );
}