CRASH after calling "ApplyProperties()".
* 5) the field name is not the same;
* 6) the entity is not the same.
*/
- void ApplyProperties(in long theFieldNum, in ColoredPrs3d thePrs);
+ void ApplyProperties(in long theFieldNum, in ColoredPrs3d thePrs)
+ raises (SALOME::SALOME_Exception);
};
/*! \brief Interface %Result
using namespace std;
-static int isOnlyMesh = false;
+static int isOnlyMesh = true;
int main(int argc, char** argv){
try{
#include <vtkObjectFactory.h>
#include <vtkDataSetMapper.h>
#include <vtkUnstructuredGrid.h>
+#include <vtkPolyData.h>
vtkStandardNewMacro(VISU_MeshPL);
void VISU_MeshPL::Build()
{
+ //VTKViewer_GeometryFilter* aFilter = VTKViewer_GeometryFilter::New();
+ //aFilter->SetInput(GetClippedInput());
+ //myMapper->SetInput(aFilter->GetOutput());
myMapper->SetInput(GetClippedInput());
}
myBuildFieldsButton->setPaletteBackgroundColor( Qt::red );
connect( myBuildFieldsCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
+ myBuildMinMaxCheckBox = new QCheckBox( tr( "BUILD_MINMAX" ), myProgressBox );
+ myBuildMinMaxCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "build_min_max", true ) );
+ myBuildMinMaxButton = new QPushButton( myProgressBox );
+ myBuildMinMaxButton->setEnabled( false );
+ myBuildMinMaxButton->setFixedSize( 30, 30 );
+ myBuildMinMaxButton->setPaletteBackgroundColor( Qt::red );
+ connect( myBuildMinMaxCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
+
myBuildGroupsCheckBox = new QCheckBox( tr( "BUILD_GROUPS" ), myProgressBox );
myBuildGroupsCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "build_groups", true ) );
myBuildGroupsButton = new QPushButton( myProgressBox );
aProgressLayout->addWidget( myBuildEntitiesButton, 0, 1 );
aProgressLayout->addWidget( myBuildFieldsCheckBox, 1, 0 );
aProgressLayout->addWidget( myBuildFieldsButton, 1, 1 );
- aProgressLayout->addWidget( myBuildGroupsCheckBox, 2, 0 );
- aProgressLayout->addWidget( myBuildGroupsButton, 2, 1 );
+ aProgressLayout->addWidget( myBuildMinMaxCheckBox, 2, 0 );
+ aProgressLayout->addWidget( myBuildMinMaxButton, 2, 1 );
+ aProgressLayout->addWidget( myBuildGroupsCheckBox, 3, 0 );
+ aProgressLayout->addWidget( myBuildGroupsButton, 3, 1 );
// Time
myTimeBox = new QGroupBox( tr( "IMPORT_TIME" ), this );
tr("BUT_OK"));
onClose();
}else{
- myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), true );
+ myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), myBuildMinMaxCheckBox->isChecked() );
myResult->SetBuildGroups( myBuildGroupsCheckBox->isChecked() );
//setModal( false );
bool isGroupsDone = myResult->IsGroupsDone();
updateButton( myBuildEntitiesButton, isEntitiesDone );
- updateButton( myBuildFieldsButton, isFieldsDone && isMinMaxDone);
+ updateButton( myBuildFieldsButton, isFieldsDone );
+ updateButton( myBuildMinMaxButton, isMinMaxDone );
updateButton( myBuildGroupsButton, isGroupsDone );
}
else if( aCheckBox == myBuildFieldsCheckBox )
{
myBuildFieldsButton->setPaletteBackgroundColor( aColor );
+ if( !anIsChecked && myBuildMinMaxCheckBox->isChecked() )
+ myBuildMinMaxCheckBox->animateClick();
+ }
+ else if( aCheckBox == myBuildMinMaxCheckBox )
+ {
+ myBuildMinMaxButton->setPaletteBackgroundColor( aColor );
+ if( anIsChecked && !myBuildFieldsCheckBox->isChecked() )
+ myBuildFieldsCheckBox->animateClick();
}
else if( aCheckBox == myBuildGroupsCheckBox )
myBuildGroupsButton->setPaletteBackgroundColor( aColor );
QCheckBox* myBuildFieldsCheckBox;
QPushButton* myBuildFieldsButton;
+ QCheckBox* myBuildMinMaxCheckBox;
+ QPushButton* myBuildMinMaxButton;
+
QCheckBox* myBuildGroupsCheckBox;
QPushButton* myBuildGroupsButton;
namespace VISU
{
+ //---------------------------------------------------------------
+ inline
+ TMinMax
+ GetMinMax(VISU::Result_i* theResult,
+ VISU::PField theField,
+ vtkIdType theCompID)
+ {
+ if(!theResult->IsMinMaxDone())
+ theResult->GetInput()->BuildMinMax();
+
+ return theField->GetMinMax(theCompID);
+ }
+
//---------------------------------------------------------------
vtkFloatingPointType
TMinMaxController
//---------------------------------------------------------------
struct TSimpleMinMaxController: virtual TVTKMinMaxController
{
+ VISU::Result_i* myResult;
VISU::PField myField;
- TSimpleMinMaxController(VISU::PField theField)
- {
- myField = theField;
- }
+ TSimpleMinMaxController(VISU::ColoredPrs3d_i* theColoredPrs3d):
+ myResult(theColoredPrs3d->GetResult()),
+ myField(theColoredPrs3d->GetField())
+ {}
virtual
vtkFloatingPointType
GetComponentMin(vtkIdType theCompID)
{
if(myField){
- TMinMax aMinMax = myField->GetMinMax(theCompID);
+ TMinMax aMinMax = GetMinMax(myResult, myField, theCompID);
return aMinMax.first;
}
return TMinMaxController::GetComponentMin(theCompID);
GetComponentMax(vtkIdType theCompID)
{
if(myField){
- TMinMax aMinMax = myField->GetMinMax(theCompID);
+ TMinMax aMinMax = GetMinMax(myResult, myField, theCompID);
return aMinMax.second;
}
return TMinMaxController::GetComponentMax(theCompID);
PMinMaxController
CreateDefaultMinMaxController(VISU::ColoredPrs3d_i* theColoredPrs3d)
{
- PField aField = theColoredPrs3d->GetField();
- return PMinMaxController(new TSimpleMinMaxController(aField));
+ return PMinMaxController(new TSimpleMinMaxController(theColoredPrs3d));
}
if(PMinMaxController aMinMaxController = GetMinMaxController())
return aMinMaxController->GetComponentMin(theCompID);
- TMinMax aTMinMax = GetField()->GetMinMax(theCompID);
+ TMinMax aTMinMax = GetMinMax(GetResult(), GetField(), theCompID);
return aTMinMax.first;
}
if(PMinMaxController aMinMaxController = GetMinMaxController())
return aMinMaxController->GetComponentMax(theCompID);
- TMinMax aTMinMax = GetField()->GetMinMax(theCompID);
+ TMinMax aTMinMax = GetMinMax(GetResult(), GetField(), theCompID);
return aTMinMax.second;
}
#include <string>
-UNEXPECT_CATCH(SalomeException, SALOME::SALOME_Exception);
-
namespace VISU
{
class Result_i;
bool theAddToStudy = true)
throw (SALOME::SALOME_Exception)
{
- Unexpect aCatch(SalomeException);
+ Unexpect aCatch(SALOME_SalomeException);
typedef typename TPrs3d_i::TInterface TPrs3d;
typename TPrs3d::_var_type aPrs3d;
if(TPrs3d_i* aPrs3d = CreatePrs3d<TPrs3d_i>(theResult,theMeshName,theEntity,theFieldName,theIteration,theAddToStudy))
#include "SALOMEDSClient_AttributeString.hxx"
#include "SALOMEDSClient_AttributeName.hxx"
+#include "Utils_ExceptHandlers.hxx"
+
#include <qpixmap.h>
#include <qimage.h>
#include <qstrlist.h>
void VISU_TimeAnimation::ApplyProperties(CORBA::Long theFieldNum, VISU::ColoredPrs3d_ptr thePrs)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
+
VISU::ColoredPrs3d_i* aPrs_i = dynamic_cast<VISU::ColoredPrs3d_i*>(GetServant(thePrs).in());
if ( !aPrs_i )
- throw SALOME_Exception(LOCALIZED("Error : invalid dynamic cast of the given presentation to VISU::ColoredPrs3d_i"));
+ THROW_SALOME_CORBA_EXCEPTION("Error : invalid dynamic cast of the given presentation to VISU::ColoredPrs3d_i",
+ SALOME::INTERNAL_ERROR);
if ( myAnimationMode == 0 ) { // parallel animation mode
FieldData& aData = myFieldsLst[theFieldNum];
if ( aData.myPrs.empty() )
- throw SALOME_Exception(LOCALIZED("Error : presentations for the given field is not yet created!"));
+ THROW_SALOME_CORBA_EXCEPTION("Error : presentations for the given field is not yet created!",
+ SALOME::INTERNAL_ERROR);
if ( aPrs_i->GetResult() != aData.myPrs[0]->GetResult() )
- throw SALOME_Exception(LOCALIZED("Error : the MED file is not the same!"));
+ THROW_SALOME_CORBA_EXCEPTION("Error : the MED file is not the same!",
+ SALOME::INTERNAL_ERROR);
for (int i = 0; i < aData.myNbFrames; i++) {
bool anIsFixedRange = false;
FieldData& aData = myFieldsLst[f];
if ( aData.myPrs.empty() )
- throw SALOME_Exception(LOCALIZED("Error : presentations for the given field is not yet created!"));
+ THROW_SALOME_CORBA_EXCEPTION("Error : presentations for the given field is not yet created!",
+ SALOME::INTERNAL_ERROR);
for (int i = 0; i < aData.myNbFrames; i++) {
aData.myPrs[i]->SameAsParams(aPrs_i,