-// VISU OBJECT : interactive object for VISU entities implementation
+// 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
+//
+// 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.
//
-// Copyright (C) 2003 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 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
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// 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
//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// VISU OBJECT : interactive object for VISU entities implementation
// File :
// Author :
// Module :
-
+//
#include "VISU_GaussPoints_i.hh"
#include "VISU_ScalarMap_i.hh"
+#include "VISU_Prs3dUtils.hh"
#include "VISU_Result_i.hh"
#include "VISU_GaussPtsAct.h"
#include "VISU_GaussPointsPL.hxx"
-#include "VVTK_SegmentationCursorDlg.h"
+#include "VISU_GaussPtsDeviceActor.h"
#include "VISU_OpenGLPointSpriteMapper.hxx"
#include "VISU_ScalarBarCtrl.hxx"
+#include <VISU_ScalarBarActor.hxx>
+#include "VISU_LookupTable.hxx"
+#include "VISU_MedConvertor.hxx"
#include "SUIT_ResourceMgr.h"
+#include "VISU_PipeLineUtils.hxx"
+
#include <vtkImageData.h>
#include <vtkXMLImageDataReader.h>
-#include <vtkScalarBarActor.h>
#include <vtkTextProperty.h>
#include <vtkProperty.h>
-using namespace VISU;
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
static int MYDEBUG = 0;
#endif
+static int INCMEMORY = 10;
+
+using namespace std;
+
//----------------------------------------------------------------------------
-int
+size_t
VISU::GaussPoints_i
::IsPossible(Result_i* theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- int theIteration,
- int isMemoryCheck)
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck)
{
+ size_t aResult = 0;
+ if(theEntity == VISU::NODE)
+ return aResult;
try{
- if(theEntity != VISU::NODE)
- return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
- else
- return false;
+ bool anIsEstimated = true;
+ VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
+ if(!dynamic_cast<const VISU_MedConvertor*>(anInput.get()))
+ return aResult;
+ size_t aSize = anInput->GetTimeStampOnGaussPtsSize(theMeshName,
+ VISU::TEntity(theEntity),
+ theFieldName,
+ theTimeStampNumber,
+ anIsEstimated);
+ aResult = 1;
+ if(theIsMemoryCheck){
+ if(anIsEstimated)
+ aSize *= INCMEMORY;
+ aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+ if(MYDEBUG)
+ MESSAGE("GaussPoints_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+ }
}catch(std::exception& exc){
INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
INFOS("Unknown exception was occured!");
}
- return 0;
+ return aResult;
}
//----------------------------------------------------------------------------
}
-//----------------------------------------------------------------------------
-VISU::GaussPoints_i::
-GaussPoints_i(Result_i* theResult,
- bool theAddToStudy) :
- PrsObject_i(theResult->GetStudyDocument()),
- Prs3d_i(theResult,theAddToStudy),
- ColoredPrs3d_i(theResult,theAddToStudy),
- myGaussPointsPL(NULL),
- myIsColored(true),
- myColor(Qt::blue),
- myIsActiveLocalScalarBar(true),
- myIsDispGlobalScalarBar(true),
- mySpacing(0.01),
- myFaceLimit(50000)
+//---------------------------------------------------------------
+const char*
+VISU::GaussPoints_i
+::GetIconName()
{
- if(MYDEBUG) MESSAGE("GaussPoints_i::GaussPoints_i - this = "<<this);
-}
+ return "ICON_TREE_GAUSS_POINTS";
+}
//----------------------------------------------------------------------------
-VISU::GaussPoints_i::
-GaussPoints_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theResult->GetStudyDocument()),
- Prs3d_i(theResult,theSObject),
- ColoredPrs3d_i(theResult,theSObject),
+VISU::GaussPoints_i
+::GaussPoints_i(EPublishInStudyMode thePublishInStudyMode) :
+ ColoredPrs3d_i(thePublishInStudyMode),
myGaussPointsPL(NULL),
- myIsColored(true),
myColor(Qt::blue),
myIsActiveLocalScalarBar(true),
myIsDispGlobalScalarBar(true),
- myFaceLimit(50000)
+ mySpacing(0.01),
+ myFaceLimit(50000),
+ myShowBar(true)
{
if(MYDEBUG) MESSAGE("GaussPoints_i::GaussPoints_i - this = "<<this);
}
//----------------------------------------------------------------------------
VISU::Storable*
VISU::GaussPoints_i
-::Create(const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- int theIteration)
+::Create(const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber)
{
- TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
+ TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aBicolor = aResourceMgr->integerValue( "VISU", "scalar_bar_bicolor", GetBiColor() );
SetBiColor( aBicolor == 0 );
- float aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() );
+ double aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() );
SetSpacing( aSpacing );
- float aScaleFactor = aResourceMgr->doubleValue( "VISU", "deformed_shape_scale_factor", GetScaleFactor() );
+ double aScaleFactor = aResourceMgr->doubleValue( "VISU", "deformed_shape_scale_factor", GetScaleFactor() );
SetScaleFactor( aScaleFactor );
int aPrimitiveType = aResourceMgr->integerValue( "VISU", "point_sprite_primitive_type", GetPrimitiveType() );
- SetPrimitiveType( aPrimitiveType );
+ SetPrimitiveType( VISU::GaussPoints::PrimitiveType(aPrimitiveType) );
- float aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() );
+ double aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() );
SetClamp( aClamp );
int aMinSize = aResourceMgr->integerValue( "VISU", "point_sprite_min_size", ( int )( GetMinSize() * 100.0 ) );
int aMagnification = aResourceMgr->integerValue( "VISU", "point_sprite_magnification", ( int )( GetMagnification() * 100.0 ) );
SetMagnification( aMagnification / 100.0 );
- float anIncrement = aResourceMgr->doubleValue( "VISU", "point_sprite_increment", GetMagnificationIncrement() );
+ double anIncrement = aResourceMgr->doubleValue( "VISU", "point_sprite_increment", GetMagnificationIncrement() );
SetMagnificationIncrement( anIncrement );
bool isColored = aResourceMgr->booleanValue( "VISU", "point_sprite_results", GetIsColored() );
SetIsColored( isColored );
- QColor aColor = aResourceMgr->colorValue( "VISU", "point_sprite_color", GetColor() );
- SetColor( aColor );
+ QColor aColor = aResourceMgr->colorValue( "VISU", "point_sprite_color", GetQColor() );
+ SetQColor( aColor );
- float anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() );
+ double anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() );
SetAlphaThreshold( anAlphaThreshold );
int aResolution = aResourceMgr->integerValue( "VISU", "geom_sphere_resolution", GetResolution() );
int aFaceLimit = aResourceMgr->integerValue( "VISU", "geom_sphere_face_limit", GetFaceLimit() );
SetFaceLimit( aFaceLimit );
- QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp";
+ QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_texture.bmp";
aMainTexture = aResourceMgr->stringValue( "VISU", "point_sprite_main_texture", aMainTexture );
- QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp";
+ QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_alpha.bmp";
anAlphaTexture = aResourceMgr->stringValue( "VISU", "point_sprite_alpha_texture", anAlphaTexture );
- SetTextures( aMainTexture, anAlphaTexture );
+ SetTextures( aMainTexture.toLatin1().data(), anAlphaTexture.toLatin1().data() );
+
+ myShowBar = true;
return this;
}
+//---------------------------------------------------------------
+void
+VISU::GaussPoints_i
+::SameAs(const Prs3d_i* theOrigin)
+{
+ TSuperClass::SameAs(theOrigin);
+
+ if(const GaussPoints_i* aPrs3d = dynamic_cast<const GaussPoints_i*>(theOrigin)){
+ GaussPoints_i* anOrigin = const_cast<GaussPoints_i*>(aPrs3d);
+
+ SetIsActiveLocalScalarBar(anOrigin->GetIsActiveLocalScalarBar());
+ SetIsDispGlobalScalarBar(anOrigin->GetIsDispGlobalScalarBar());
+
+ SetSpacing(anOrigin->GetSpacing());
+
+ SetFaceLimit(anOrigin->GetFaceLimit());
+
+ SetColor(anOrigin->GetColor());
+
+ SetBarVisible(anOrigin->IsBarVisible());
+
+ SetTextures(anOrigin->GetMainTexture(), anOrigin->GetAlphaTexture());
+ }
+}
+
+//----------------------------------------------------------------------------
+CORBA::Float
+VISU::GaussPoints_i
+::GetMemorySize()
+{
+ return TSuperClass::GetMemorySize();
+}
+
//----------------------------------------------------------------------------
VISU::Storable*
VISU::GaussPoints_i
-::Restore(const Storable::TRestoringMap& theMap)
+::Restore(SALOMEDS::SObject_ptr theSObject,
+ const Storable::TRestoringMap& theMap)
{
- TSuperClass::Restore(theMap);
+ if(!TSuperClass::Restore(theSObject, theMap))
+ return NULL;
+
+ // Check if the icon needs to be updated, update if necessary
+ SALOMEDS::Study_var aStudy = theSObject->GetStudy();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::GenericAttribute_var anAttr =
+ aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributePixMap");
+ SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+
+ 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());
SetBiColor(Storable::FindValue(theMap,"myIsBiColor").toInt());
SetSpacing(Storable::FindValue(theMap,"mySpacing").toDouble());
- SetPrimitiveType(Storable::FindValue(theMap,"myPrimitiveType").toInt());
+ int aPrimitiveType = Storable::FindValue(theMap,"myPrimitiveType").toInt();
+ SetPrimitiveType(VISU::GaussPoints::PrimitiveType(aPrimitiveType));
SetClamp(Storable::FindValue(theMap,"myClamp").toDouble());
SetMinSize(Storable::FindValue(theMap,"myMinSize").toDouble());
SetMaxSize(Storable::FindValue(theMap,"myMaxSize").toDouble());
int aRed = Storable::FindValue(theMap,"myColor.R").toInt();
int aGreen = Storable::FindValue(theMap,"myColor.G").toInt();
int aBlue = Storable::FindValue(theMap,"myColor.B").toInt();
- SetColor( QColor(aRed,aGreen,aBlue) );
+ SetQColor( QColor(aRed, aGreen, aBlue) );
SetAlphaThreshold(Storable::FindValue(theMap,"myAlphaThreshold").toDouble());
- SetTextures( Storable::FindValue(theMap,"myMainTexture"),
- Storable::FindValue(theMap,"myAlphaTexture") );
+ SetTextures( Storable::FindValue(theMap,"myMainTexture").toLatin1().data(),
+ Storable::FindValue(theMap,"myAlphaTexture").toLatin1().data() );
SetResolution(Storable::FindValue(theMap,"myResolution").toInt());
Storable::DataToStream( theStr, "myFaceLimit", GetFaceLimit() );
Storable::DataToStream( theStr, "myIsColored", GetIsColored() );
- QColor aColor = GetColor();
+ QColor aColor = GetQColor();
Storable::DataToStream( theStr, "myColor.R", aColor.red() );
Storable::DataToStream( theStr, "myColor.G", aColor.green() );
Storable::DataToStream( theStr, "myColor.B", aColor.blue() );
Storable::DataToStream( theStr, "myAlphaThreshold", GetAlphaThreshold() );
- Storable::DataToStream( theStr, "myMainTexture", GetMainTexture() );
- Storable::DataToStream( theStr, "myAlphaTexture", GetAlphaTexture() );
+ Storable::DataToStream( theStr, "myMainTexture", GetQMainTexture() );
+ Storable::DataToStream( theStr, "myAlphaTexture", GetQAlphaTexture() );
Storable::DataToStream( theStr, "myResolution", GetResolution() );
+ Storable::DataToStream( theStr, "myShowBar", (IsBarVisible()? 1:0) );
}
//----------------------------------------------------------------------------
-VISU_GaussPointsPL*
+CORBA::Long
VISU::GaussPoints_i
-::GetGaussPointsPL()
-{
- return myGaussPointsPL;
+::GetFaceLimit()
+{
+ return myFaceLimit;
}
+//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::SetIsDeformed( bool theIsDeformed )
+::SetFaceLimit( CORBA::Long theFaceLimit )
{
+ if( myFaceLimit == theFaceLimit )
+ return;
+
+ VISU::TSetModified aModified(this);
+
+ myFaceLimit = theFaceLimit;
+ myParamsTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::GaussPoints_i
+::SetIsDeformed( CORBA::Boolean theIsDeformed )
+{
+ VISU::TSetModified aModified(this);
+
myGaussPointsPL->SetIsDeformed( theIsDeformed );
}
-bool
+CORBA::Boolean
VISU::GaussPoints_i
::GetIsDeformed()
{
return myGaussPointsPL->GetIsDeformed();
}
+//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::SetScaleFactor( float theScaleFactor )
+::SetScaleFactor( CORBA::Double theScaleFactor )
{
+ VISU::TSetModified aModified(this);
+
myGaussPointsPL->SetScale( theScaleFactor );
}
-float
+CORBA::Double
VISU::GaussPoints_i
::GetScaleFactor()
{
return myGaussPointsPL->GetScale();
}
+//----------------------------------------------------------------------------
+QColor
+VISU::GaussPoints_i
+::GetQColor()
+{
+ return myColor;
+}
+
+SALOMEDS::Color
+VISU::GaussPoints_i
+::GetColor()
+{
+ SALOMEDS::Color aColor;
+ aColor.R = myColor.red();
+ aColor.G = myColor.green();
+ aColor.B = myColor.blue();
+ return aColor;
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU::GaussPoints_i
+::SetQColor( const QColor& theColor )
+{
+ if(myColor == theColor)
+ return;
+
+ VISU::TSetModified aModified(this);
+
+ myColor = theColor;
+ myParamsTime.Modified();
+}
+
+void
+VISU::GaussPoints_i
+::SetColor( const SALOMEDS::Color& theColor )
+{
+ SetQColor(QColor(int(theColor.R), int(theColor.G), int(theColor.B)));
+}
+
+
+//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
::SetIsColored( bool theIsColored )
{
- myIsColored = theIsColored;
+ VISU::TSetModified aModified(this);
+
myGaussPointsPL->SetIsColored( theIsColored );
}
+bool
+VISU::GaussPoints_i
+::GetIsColored()
+{
+ return myGaussPointsPL->GetIsColored();
+}
+
+//----------------------------------------------------------------------------
bool
VISU::GaussPoints_i
::SetMainTexture( const QString& theMainTexture )
{
- bool update = myMainTexture != theMainTexture;
- myMainTexture = theMainTexture;
- return update;
+ if(myMainTexture != theMainTexture){
+ VISU::TSetModified aModified(this);
+
+ myMainTexture = theMainTexture;
+ myParamsTime.Modified();
+ return true;
+ }
+
+ return false;
}
-const QString&
+QString
VISU::GaussPoints_i
-::GetMainTexture()
+::GetQMainTexture()
{
return myMainTexture;
}
+char*
+VISU::GaussPoints_i
+::GetMainTexture()
+{
+ return CORBA::string_dup(myMainTexture.toLatin1().data());
+}
+
+
+//----------------------------------------------------------------------------
bool
VISU::GaussPoints_i
::SetAlphaTexture( const QString& theAlphaTexture )
{
- bool update = myAlphaTexture != theAlphaTexture;
- myAlphaTexture = theAlphaTexture;
- return update;
+ if(myAlphaTexture != theAlphaTexture){
+ VISU::TSetModified aModified(this);
+
+ myAlphaTexture = theAlphaTexture;
+ myParamsTime.Modified();
+ return true;
+ }
+
+ return false;
}
-const QString&
+QString
VISU::GaussPoints_i
-::GetAlphaTexture()
+::GetQAlphaTexture()
{
return myAlphaTexture;
}
+char*
+VISU::GaussPoints_i
+::GetAlphaTexture()
+{
+ return CORBA::string_dup(myAlphaTexture.toLatin1().data());
+}
+
+
+//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::SetAlphaThreshold( float theAlphaThreshold )
+::SetAlphaThreshold( CORBA::Double theAlphaThreshold )
{
+ VISU::TSetModified aModified(this);
+
myGaussPointsPL->SetAlphaThreshold( theAlphaThreshold );
}
-float
+CORBA::Double
VISU::GaussPoints_i
::GetAlphaThreshold()
{
return myGaussPointsPL->GetAlphaThreshold();
}
+//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::SetResolution( int theResolution )
+::SetResolution( CORBA::Long theResolution )
{
+ VISU::TSetModified aModified(this);
+
myGaussPointsPL->SetResolution( theResolution );
}
-int
+CORBA::Long
VISU::GaussPoints_i
::GetResolution()
{
return myGaussPointsPL->GetResolution();
}
+//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::SetPrimitiveType(int thePrimitiveType)
+::SetPrimitiveType(VISU::GaussPoints::PrimitiveType thePrimitiveType)
{
+ VISU::TSetModified aModified(this);
+
myGaussPointsPL->SetPrimitiveType( thePrimitiveType );
}
-int
+VISU::GaussPoints::PrimitiveType
VISU::GaussPoints_i
::GetPrimitiveType()
{
- return myGaussPointsPL->GetPrimitiveType();
+ int aPrimitiveType = myGaussPointsPL->GetPrimitiveType();
+
+ if(aPrimitiveType == VISU_OpenGLPointSpriteMapper::OpenGLPoint)
+ return VISU::GaussPoints::POINT;
+
+ if(aPrimitiveType == VISU_OpenGLPointSpriteMapper::GeomSphere)
+ return VISU::GaussPoints::SPHERE;
+
+ return VISU::GaussPoints::SPRITE;
}
-float
+//----------------------------------------------------------------------------
+double
VISU::GaussPoints_i
::GetMaximumSupportedSize()
{
return myGaussPointsPL->GetMaximumSupportedSize();
}
+//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::SetClamp(float theClamp)
+::SetClamp(CORBA::Double theClamp)
{
+ VISU::TSetModified aModified(this);
+
myGaussPointsPL->SetClamp( theClamp );
}
-float
+CORBA::Double
VISU::GaussPoints_i
::GetClamp()
{
return myGaussPointsPL->GetClamp();
}
+//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::SetGeomSize( float theGeomSize )
+::SetGeomSize( CORBA::Double theGeomSize )
{
+ VISU::TSetModified aModified(this);
+
myGaussPointsPL->SetSize( theGeomSize );
}
-float
+CORBA::Double
VISU::GaussPoints_i
::GetGeomSize()
{
return myGaussPointsPL->GetSize();
}
+//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::SetMinSize( float theMinSize )
+::SetMinSize( CORBA::Double theMinSize )
{
+ VISU::TSetModified aModified(this);
+
myGaussPointsPL->SetMinSize( theMinSize );
}
-float
+CORBA::Double
VISU::GaussPoints_i
::GetMinSize()
{
return myGaussPointsPL->GetMinSize();
}
+//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::SetMaxSize( float theMaxSize )
+::SetMaxSize( CORBA::Double theMaxSize )
{
+ VISU::TSetModified aModified(this);
+
myGaussPointsPL->SetMaxSize( theMaxSize );
}
-float
+CORBA::Double
VISU::GaussPoints_i
::GetMaxSize()
{
return myGaussPointsPL->GetMaxSize();
}
+//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::SetMagnification( float theMagnification )
+::SetMagnification( CORBA::Double theMagnification )
{
+ VISU::TSetModified aModified(this);
+
myGaussPointsPL->SetMagnification( theMagnification );
}
-float
+CORBA::Double
VISU::GaussPoints_i
::GetMagnification()
{
return myGaussPointsPL->GetMagnification();
}
+//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::SetMagnificationIncrement( float theIncrement )
+::SetMagnificationIncrement( CORBA::Double theIncrement )
{
+ VISU::TSetModified aModified(this);
+
myGaussPointsPL->SetMagnificationIncrement( theIncrement );
}
-float
+CORBA::Double
VISU::GaussPoints_i
::GetMagnificationIncrement()
{
//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::DoSetInput(Result_i* theResult)
+::SetSourceGeometry()
+{
+ int aNbGroups = myGroupNames.size();
+ if(aNbGroups != 0){
+ GetSpecificPL()->SetSourceGeometry();
+ myGroupNames.clear();
+ /*UpdateIcon();*/
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::GaussPoints_i
+::AddMeshOnGroup(const char* theGroupName)
{
- VISU::Result_i::TInput* anInput = theResult->GetInput();
+ VISU::Result_i::PInput anInput = GetCResult()->GetInput();
+ VISU::PUnstructuredGridIDMapper anIDMapper = anInput->GetMeshOnGroup(GetCMeshName(), theGroupName);
+ if(anIDMapper){
+ int aNbGroups = myGroupNames.size();
+ if(myGroupNames.find(theGroupName) == myGroupNames.end()){
+ 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();
+ }
+ }
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU::GaussPoints_i
+::RemoveAllGeom()
+{
+ int aNbGroups = myGroupNames.size();
+ GetSpecificPL()->ClearGeometry();
+ myGroupNames.clear();
+ /*
+ if(aNbGroups != 0)
+ UpdateIcon();
+ */
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::GaussPoints_i
+::DoSetInput(bool theIsInitilizePipe, bool theReInit)
+{
+ VISU::Result_i::PInput anInput = GetCResult()->GetInput(GetCMeshName(),
+ GetEntity(),
+ GetCFieldName(),
+ GetTimeStampNumber());
if(!anInput)
- throw std::runtime_error("Mesh_i::Build - theResult->GetInput() == NULL !!!");
+ throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
- myField = anInput->GetField(myMeshName,myEntity,myFieldName);
- if(!myField)
+ SetField(anInput->GetField(GetCMeshName(),
+ GetTEntity(),
+ GetCFieldName()));
+ if(!GetField())
throw std::runtime_error("There is no Field with the parameters !!!");
VISU::PGaussPtsIDMapper aGaussPtsIDMapper =
- anInput->GetTimeStampOnGaussPts(myMeshName,myEntity,myFieldName,myIteration);
-
+ anInput->GetTimeStampOnGaussPts(GetCMeshName(),
+ GetTEntity(),
+ GetCFieldName(),
+ GetTimeStampNumber());
if(!aGaussPtsIDMapper)
throw std::runtime_error("There is no TimeStamp with the parameters !!!");
- myGaussPointsPL->SetGaussPtsIDMapper(aGaussPtsIDMapper);
- myGaussPointsPL->Init();
- myGaussPointsPL->Build();
-
- theResult->MinMaxConnect(this);
+ GetSpecificPL()->SetGaussPtsIDMapper(aGaussPtsIDMapper);
}
//----------------------------------------------------------------------------
-void
+bool
VISU::GaussPoints_i
-::DoHook()
+::CheckIsPossible()
{
- if(!myPipeLine)
- myPipeLine = VISU_GaussPointsPL::New();
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
+}
- myGaussPointsPL = dynamic_cast<VISU_GaussPointsPL*>(myPipeLine);
+void VISU::GaussPoints_i::SetBarVisible(CORBA::Boolean theVisible)
+{
+ if (myShowBar == theVisible)
+ return;
+ VISU::TSetModified aModified(this);
+ myShowBar = theVisible;
+ myParamsTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::GaussPoints_i
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
+{
+ if(!thePipeLine){
+ myGaussPointsPL = VISU_GaussPointsPL::New();
+ }else
+ myGaussPointsPL = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
- TSuperClass::DoHook();
+ TSuperClass::CreatePipeLine(myGaussPointsPL);
}
//----------------------------------------------------------------------------
VISU_PipeLine*
VISU::GaussPoints_i
-::GetPipeLine()
+::GetActorPipeLine()
{
// We create a new PipeLine instance in order to provide
// different representations for different actors (basic and segmented)
VISU_GaussPointsPL* aPipeLine = VISU_GaussPointsPL::New();
- aPipeLine->SetGaussPtsIDMapper(myGaussPointsPL->GetGaussPtsIDMapper());
- aPipeLine->ShallowCopy(myPipeLine);
- aPipeLine->Update();
+ aPipeLine->ShallowCopy(GetPipeLine(), true);
return aPipeLine;
}
//----------------------------------------------------------------------------
bool
VISU::GaussPoints_i
-::OnCreateActor(VISU_GaussPtsAct* theActor,
- const Handle(SALOME_InteractiveObject)& theIO)
+::OnCreateActor(VISU_GaussPtsAct* theActor)
{
try{
- TSuperClass::CreateActor(theActor,theIO);
- theActor->GetPipeLine()->Delete();
+ TSuperClass::CreateActor(theActor);
UpdateActor(theActor);
return true;
}catch(...){
VISU_GaussPtsAct1*
VISU::GaussPoints_i
-::OnCreateActor1(const Handle(SALOME_InteractiveObject)& theIO)
+::OnCreateActor1()
{
VISU_GaussPtsAct1* anActor = VISU_GaussPtsAct1::New();
- if(OnCreateActor(anActor,theIO))
+ if(OnCreateActor(anActor))
return anActor;
return NULL;
}
VISU_GaussPtsAct2*
VISU::GaussPoints_i
-::OnCreateActor2(const Handle(SALOME_InteractiveObject)& theIO)
+::OnCreateActor2()
{
VISU_GaussPtsAct2* anActor = VISU_GaussPtsAct2::New();
- if(OnCreateActor(anActor,theIO))
+ if(OnCreateActor(anActor))
return anActor;
return NULL;
}
VISU_Actor*
VISU::GaussPoints_i
-::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+::CreateActor()
{
- return OnCreateActor1(theIO);
+ VISU_GaussPtsAct* anActor = VISU_GaussPtsAct::New();
+ anActor->SetBarVisibility(myShowBar);
+ if(OnCreateActor(anActor))
+ return anActor;
+ return NULL;
+ // return OnCreateActor1();
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::UpdateScalarBar(vtkScalarBarActor *theScalarBar,
- vtkLookupTable* theLookupTable)
+::UpdateScalarBar(VISU_ScalarBarActor *theScalarBar,
+ VISU_LookupTable* theLookupTable)
{
- theScalarBar->SetTitle(myTitle.c_str());
- theScalarBar->SetOrientation(myOrientation);
- theScalarBar->SetNumberOfLabels(myNumberOfLabels);
-
- vtkLookupTable* aLookupTable = myScalarMapPL->GetBarTable();
+ theScalarBar->SetTitle(GetScalarBarTitle().c_str());
+ theScalarBar->SetOrientation(GetBarOrientation());
+ theScalarBar->SetNumberOfLabels(GetLabels());
+ theScalarBar->SetRatios(GetTitleSize(), GetLabelSize(),
+ GetBarWidth(), GetBarHeight());
+ theScalarBar->SetLabelFormat(GetLabelsFormat());
+
+ VISU_LookupTable* aLookupTable = GetSpecificPL()->GetBarTable();
theLookupTable->SetNumberOfColors(aLookupTable->GetNumberOfColors());
theScalarBar->SetMaximumNumberOfColors(aLookupTable->GetNumberOfColors());
+ double anRGB[3];
+
vtkTextProperty* aTitleProp = theScalarBar->GetTitleTextProperty();
- aTitleProp->SetFontFamily(myTitFontType);
- aTitleProp->SetColor(myTitleColor);
- (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
- (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
- (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
+ aTitleProp->SetFontFamily(GetTitFontType());
+
+ GetTitleColor(anRGB[0],anRGB[1],anRGB[2]);
+ aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+
+ IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff();
+ IsItalicTitle()? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
+ IsShadowTitle()? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
vtkTextProperty* aLabelProp = theScalarBar->GetLabelTextProperty();
- aLabelProp->SetFontFamily(myLblFontType);
- aLabelProp->SetColor(myLabelColor);
- (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
- (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
- (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
+ aLabelProp->SetFontFamily(GetLblFontType());
+
+ GetLabelColor(anRGB[0],anRGB[1],anRGB[2]);
+ aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+
+ IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff();
+ IsItalicLabel()? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
+ IsShadowLabel()? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
theScalarBar->Modified();
}
//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::UpdateActor(VISU_Actor* theActor)
+::UpdateActor(VISU_ActorBase* theActor)
{
if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
VISU_ScalarBarCtrl *aScalarBarCtrl = anActor->GetScalarBarCtrl();
if(GetIsColored()){
- anActor->SetBarVisibility(true);
- myPipeLine->GetMapper()->SetScalarVisibility(1);
+ GetPipeLine()->GetMapper()->SetScalarVisibility(1);
+
+ if(IsRangeFixed()){
+ double* aRange = GetSpecificPL()->GetScalarRange();
+ aScalarBarCtrl->SetRangeLocal(aRange);
+ }else{
+ double aRange[2];
+ GetSpecificPL()->GetSourceRange(aRange);
+ aScalarBarCtrl->SetRangeLocal(aRange);
+ }
- float aRange[2];
- myScalarMapPL->GetSourceRange(aRange);
- aScalarBarCtrl->SetRangeLocal(aRange);
-
- TMinMax aTMinMax(-VTK_LARGE_FLOAT,VTK_LARGE_FLOAT);
bool anIsMinMaxDone = IsGlobalRangeDefined();
- if(anIsMinMaxDone)
- aTMinMax = myField->GetMinMax(GetScalarMode());
aScalarBarCtrl->SetGlobalRangeIsDefined(anIsMinMaxDone);
+
+ TMinMax aTMinMax( GetComponentMin( GetScalarMode() ),
+ GetComponentMax( GetScalarMode() ));
aScalarBarCtrl->SetRangeGlobal(aTMinMax.first, aTMinMax.second);
VISU_ScalarBarCtrl::EMode aScalarBarMode = VISU_ScalarBarCtrl::eGlobal;
}
if(aScalarBarMode == VISU_ScalarBarCtrl::eGlobal){
- float aRangeGlobal[2];
+ double aRangeGlobal[2];
//
aRangeGlobal[0] = aTMinMax.first;
aRangeGlobal[1] = aTMinMax.second;
- GetGaussPointsPL()->GetMapper()->SetScalarRange(aRangeGlobal);
+ GetSpecificPL()->GetMapper()->SetScalarRange(aRangeGlobal);
}
aScalarBarCtrl->SetMode(aScalarBarMode);
// Position
- aScalarBarCtrl->SetWidth(myWidth);
- aScalarBarCtrl->SetHeight(myHeight);
- aScalarBarCtrl->SetPosition(myPosition);
+ aScalarBarCtrl->SetWidth(GetWidth());
+ aScalarBarCtrl->SetHeight(GetHeight());
+
+ double aPosition[] = {GetPosX(), GetPosY()};
+ aScalarBarCtrl->SetPosition(aPosition);
aScalarBarCtrl->SetSpacing(mySpacing);
// Bicolor
- bool anIsBicolor = GetGaussPointsPL()->GetBicolor();
+ bool anIsBicolor = GetSpecificPL()->GetBicolor();
aScalarBarCtrl->SetBicolor(anIsBicolor);
UpdateScalarBar(aScalarBarCtrl->GetLocalBar(),
aScalarBarCtrl->Update();
}else{
- anActor->SetBarVisibility(false);
-
- myPipeLine->GetMapper()->SetScalarVisibility(0);
+ GetPipeLine()->GetMapper()->SetScalarVisibility(0);
anActor->GetProperty()->SetColor(myColor.red() / 255.0,
myColor.green() / 255.0,
myColor.blue() / 255.0);
}
+
+ anActor->SetBarVisibility(myShowBar && GetIsColored());
- if( GetGaussPointsPL()->GetPrimitiveType() != VISU_OpenGLPointSpriteMapper::GeomSphere )
+ if( GetSpecificPL()->GetPrimitiveType() != VISU_OpenGLPointSpriteMapper::GeomSphere )
theActor->SetRepresentation( VTK_POINTS );
else
theActor->SetRepresentation( VTK_SURFACE );
+
+ // Update values labels
+
+ vtkTextProperty* aProp = anActor->GetsValLabelsProps();
+ if ( aProp )
+ {
+ aProp->SetFontFamily( GetValLblFontType() );
+ aProp->SetFontSize( GetValLblFontSize() );
+ aProp->SetBold( IsBoldValLbl() );
+ aProp->SetItalic( IsItalicValLbl() );
+ aProp->SetShadow( IsShadowValLbl() );
+
+ double anRGB[ 3 ];
+ GetValLblFontColor( anRGB[ 0 ], anRGB[ 1 ], anRGB[ 2 ] );
+ aProp->SetColor( anRGB[ 0 ], anRGB[ 1 ], anRGB[ 2 ] );
+ }
}
+
TSuperClass::UpdateActor(theActor);
}
{
if(MYDEBUG) MESSAGE("GaussPoints_i::UpdateFromActor - this = "<<this);
myGaussPointsPL->ChangeMagnification(theActor->GetChangeMagnification());
+ myParamsTime.Modified();
UpdateActors();
}
//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::SetTextures( const QString& theMainTexture,
- const QString& theAlphaTexture )
+::SetQTextures( const QString& theMainTexture,
+ const QString& theAlphaTexture )
{
bool updateMainTexture = SetMainTexture( theMainTexture );
bool updateAlphaTexture = SetAlphaTexture( theAlphaTexture );
if( !updateMainTexture && !updateAlphaTexture )
return;
+ VISU::TSetModified aModified(this);
+
using namespace VISU;
- TTextureValue aTextureValue = GetTexture(theMainTexture,theAlphaTexture);
+ TTextureValue aTextureValue = GetTexture(theMainTexture.toLatin1().data(),
+ theAlphaTexture.toLatin1().data());
myGaussPointsPL->SetImageData( aTextureValue.GetPointer() );
}
+void
+VISU::GaussPoints_i
+::SetTextures( const char* theMainTexture,
+ const char* theAlphaTexture )
+{
+ SetQTextures(theMainTexture, theAlphaTexture);
+}
+
//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::SetIsActiveLocalScalarBar(const bool theFlag)
+::SetIsActiveLocalScalarBar(CORBA::Boolean theIsActiveLocalScalarBar)
{
- myIsActiveLocalScalarBar = theFlag;
+ if(myIsActiveLocalScalarBar == theIsActiveLocalScalarBar)
+ return;
+
+ VISU::TSetModified aModified(this);
+
+ myIsActiveLocalScalarBar = theIsActiveLocalScalarBar;
+
+ if ( !theIsActiveLocalScalarBar || !IsRangeFixed() )
+ SetSourceRange();
+
+ myParamsTime.Modified();
}
-bool
+CORBA::Boolean
VISU::GaussPoints_i
-::GetIsActiveLocalScalarBar() const
+::GetIsActiveLocalScalarBar()
{
return myIsActiveLocalScalarBar;
}
void
VISU::GaussPoints_i
-::SetIsDispGlobalScalarBar(const bool theFlag)
+::SetIsDispGlobalScalarBar(CORBA::Boolean theIsDispGlobalScalarBar)
{
- myIsDispGlobalScalarBar=theFlag;
+ if(myIsDispGlobalScalarBar == theIsDispGlobalScalarBar)
+ return;
+
+ VISU::TSetModified aModified(this);
+
+ myIsDispGlobalScalarBar = theIsDispGlobalScalarBar;
+ myParamsTime.Modified();
}
bool
VISU::GaussPoints_i
::IsGlobalRangeDefined() const
{
- return myResult->IsMinMaxDone();
+ return GetCResult()->IsMinMaxDone();
}
-bool
+//----------------------------------------------------------------------------
+void
VISU::GaussPoints_i
-::GetIsDispGlobalScalarBar() const
+::SetSourceRange()
+{
+ VISU::TSetModified aModified(this);
+
+ double aScalarRange[2] = {GetSourceMin(), GetSourceMax()};
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, double*>
+ (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
+
+ UseFixedRange(false);
+}
+
+
+//----------------------------------------------------------------------------
+struct TGetSourceMin: public SALOME_Event
+{
+ VISU::GaussPoints_i* myColoredPrs3d;
+
+ typedef CORBA::Double TResult;
+ TResult myResult;
+
+ TGetSourceMin( VISU::GaussPoints_i* theColoredPrs3d ):
+ myColoredPrs3d( theColoredPrs3d )
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ if ( myColoredPrs3d->IsTimeStampFixed() || myColoredPrs3d->GetIsActiveLocalScalarBar() ) {
+ double aRange[2];
+ myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
+ myResult = aRange[0];
+ }else{
+ VISU::TNames aGroupNames = myColoredPrs3d->GetSpecificPL()->GetGeometryNames();
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode(), aGroupNames );
+ myResult = aTMinMax.first;
+ }
+ }
+};
+
+
+//----------------------------------------------------------------------------
+CORBA::Double
+VISU::GaussPoints_i
+::GetSourceMin()
+{
+ return ProcessEvent( new TGetSourceMin( this ) );
+}
+
+
+//----------------------------------------------------------------------------
+struct TGetSourceMax: public SALOME_Event
+{
+ VISU::GaussPoints_i* myColoredPrs3d;
+
+ typedef CORBA::Double TResult;
+ TResult myResult;
+
+ TGetSourceMax( VISU::GaussPoints_i* theColoredPrs3d ):
+ myColoredPrs3d( theColoredPrs3d )
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ if ( myColoredPrs3d->IsTimeStampFixed() || myColoredPrs3d->GetIsActiveLocalScalarBar() ) {
+ double aRange[2];
+ myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
+ myResult = aRange[1];
+ }else{
+ VISU::TNames aGroupNames = myColoredPrs3d->GetSpecificPL()->GetGeometryNames();
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode(), aGroupNames );
+ myResult = aTMinMax.second;
+ }
+ }
+};
+
+
+//----------------------------------------------------------------------------
+CORBA::Double
+VISU::GaussPoints_i
+::GetSourceMax()
+{
+ return ProcessEvent( new TGetSourceMax( this ) );
+}
+
+
+//----------------------------------------------------------------------------
+CORBA::Boolean
+VISU::GaussPoints_i
+::GetIsDispGlobalScalarBar()
{
return myIsDispGlobalScalarBar;
}
+
void
VISU::GaussPoints_i
-::SetBiColor(bool theIsBiColor)
+::SetBiColor(CORBA::Boolean theIsBiColor)
{
- GetGaussPointsPL()->SetBicolor(theIsBiColor);
+ VISU::TSetModified aModified(this);
+
+ GetSpecificPL()->SetBicolor(theIsBiColor);
}
-bool
+CORBA::Boolean
VISU::GaussPoints_i
::GetBiColor()
{
- return GetGaussPointsPL()->GetBicolor();
+ return GetSpecificPL()->GetBicolor();
}
void
VISU::GaussPoints_i
-::SetSpacing(const float theSpacing)
+::SetSpacing(CORBA::Double theSpacing)
{
+ if(VISU::CheckIsSameValue(mySpacing, theSpacing))
+ return;
+
+ VISU::TSetModified aModified(this);
+
mySpacing = theSpacing;
+ myParamsTime.Modified();
}
-float
+CORBA::Double
VISU::GaussPoints_i
-::GetSpacing() const
+::GetSpacing()
{
return mySpacing;
}
//----------------------------------------------------------------------------
-void
+struct TGaussGetComponentMin: public SALOME_Event
+{
+ VISU::ColoredPrs3d_i* myColoredPrs3d;
+ vtkIdType myCompID;
+
+ typedef CORBA::Double TResult;
+ TResult myResult;
+
+ TGaussGetComponentMin( VISU::ColoredPrs3d_i* theColoredPrs3d,
+ vtkIdType theCompID ):
+ myColoredPrs3d( theColoredPrs3d ),
+ myCompID( theCompID )
+ {}
+
+ virtual
+ 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, aGroupNames );
+ myResult = aTMinMax.first;
+ }
+ }
+};
+
+
+//----------------------------------------------------------------------------
+double
VISU::GaussPoints_i
-::UpdateMinMax()
+::GetComponentMin(vtkIdType theCompID)
{
- MinMaxCunsomer::UpdateMinMax();
- UpdateActors();
+ return ProcessEvent( new TGaussGetComponentMin( this, theCompID ) );
+}
+
+//----------------------------------------------------------------------------
+struct TGaussGetComponentMax: public SALOME_Event
+{
+ VISU::ColoredPrs3d_i* myColoredPrs3d;
+ vtkIdType myCompID;
+
+ typedef CORBA::Double TResult;
+ TResult myResult;
+
+ TGaussGetComponentMax( VISU::ColoredPrs3d_i* theColoredPrs3d,
+ vtkIdType theCompID ):
+ myColoredPrs3d( theColoredPrs3d ),
+ myCompID( theCompID )
+ {}
+
+ virtual
+ 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, aGroupNames );
+ myResult = aTMinMax.second;
+ }
+ }
+};
+
+
+//----------------------------------------------------------------------------
+double
+VISU::GaussPoints_i
+::GetComponentMax(vtkIdType theCompID)
+{
+ return ProcessEvent( new TGaussGetComponentMax( this, theCompID ) );
}