VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule)
: VisuGUI_ScalarBarBaseDlg(theModule),
- myVisuGUI(theModule)
+ myVisuGUI(theModule),
+ myStatus(false)
{
setWindowTitle(tr("DLG_TITLE"));
setSizeGripEnabled(TRUE);
}
int VisuGUI_StreamLinesDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs)
-{
- if(!myInputPane->check() || !GetScalarPane()->check())
- return 0;
-
- int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
- anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
-
- if (anIsOk) {
- myPrsCopy->ShowColored(myUseScalar->isChecked());
- if (!myPrsCopy->IsColored()) {
- SALOMEDS::Color aColor;
- aColor.R = SelColor->color().red()/255.;
- aColor.G = SelColor->color().green()/255.;
- aColor.B = SelColor->color().blue()/255.;
- myPrsCopy->SetColor(aColor);
- }
-
- VISU::StreamLines::Direction aDirection = VISU::StreamLines::BOTH;
- switch (myDirCombo->currentIndex()) {
- case 0:
- aDirection = VISU::StreamLines::FORWARD;
- break;
- case 1:
- aDirection = VISU::StreamLines::BACKWARD;
- break;
- case 2:
- aDirection = VISU::StreamLines::BOTH;
- }
-
- VISU::Prs3d_var aPrs;
- int aSrcSelection = myUseSrcCombo->currentIndex();
- int aSrcItem = (mySrcCombo->count() > 0)? mySrcCombo->currentIndex() : -1;
- if ((aSrcSelection > 0) && (aSrcItem > -1)) {
- VISU::VISUType aType;
- QString aName;
- switch (aSrcSelection) {
- case 1: // Entity
- aPrs = myEntityList[aSrcItem];
- aType = VISU::TENTITY;
- aName = myEntitiesLst[aSrcItem];
- break;
- case 2: // Family
- aPrs = myFamilyList[aSrcItem];
- aType = VISU::TFAMILY;
- aName = myFamilisLst[aSrcItem];
- break;
- case 3: // Group
- aPrs = myGroupList[aSrcItem];
- aType = VISU::TGROUP;
- aName = myGroupsLst[aSrcItem];
- break;
- case 4: // Presentation
- aPrs = myPrsList[aSrcItem];
- break;
- }
- if (CORBA::is_nil(aPrs) && aSrcSelection != 4) {
- aPrs = createMesh(aType, aName);
- }
- }
- anIsOk &= myPrsCopy->SetParams(myIntegStepLen->value(),
- myPropTime->value(),
- myStepLen->value(),
- aPrs,
- myPntPercent->value(),
- aDirection);
- }
-
+{
VISU::TSameAsFactory<VISU::TSTREAMLINES>().Copy(myPrsCopy, thePrs);
-
- return anIsOk;
+ return myStatus;
}
/*!
}
+void VisuGUI_StreamLinesDlg::storeToPrsCopy() {
+
+ if(!myInputPane->check() || !GetScalarPane()->check()) {
+ myStatus = false;
+ return;
+ }
+
+ myStatus = myInputPane->storeToPrsObject( myPrsCopy );
+ myStatus &= GetScalarPane()->storeToPrsObject( myPrsCopy );
+
+ if (myStatus) {
+ myPrsCopy->ShowColored(myUseScalar->isChecked());
+ if (!myPrsCopy->IsColored()) {
+ SALOMEDS::Color aColor;
+ aColor.R = SelColor->color().red()/255.;
+ aColor.G = SelColor->color().green()/255.;
+ aColor.B = SelColor->color().blue()/255.;
+ myPrsCopy->SetColor(aColor);
+ }
+
+ VISU::StreamLines::Direction aDirection = VISU::StreamLines::BOTH;
+ switch (myDirCombo->currentIndex()) {
+ case 0:
+ aDirection = VISU::StreamLines::FORWARD;
+ break;
+ case 1:
+ aDirection = VISU::StreamLines::BACKWARD;
+ break;
+ case 2:
+ aDirection = VISU::StreamLines::BOTH;
+ }
+
+ VISU::Prs3d_var aPrs;
+ int aSrcSelection = myUseSrcCombo->currentIndex();
+ int aSrcItem = (mySrcCombo->count() > 0)? mySrcCombo->currentIndex() : -1;
+ if ((aSrcSelection > 0) && (aSrcItem > -1)) {
+ VISU::VISUType aType;
+ QString aName;
+ switch (aSrcSelection) {
+ case 1: // Entity
+ aPrs = myEntityList[aSrcItem];
+ aType = VISU::TENTITY;
+ aName = myEntitiesLst[aSrcItem];
+ break;
+ case 2: // Family
+ aPrs = myFamilyList[aSrcItem];
+ aType = VISU::TFAMILY;
+ aName = myFamilisLst[aSrcItem];
+ break;
+ case 3: // Group
+ aPrs = myGroupList[aSrcItem];
+ aType = VISU::TGROUP;
+ aName = myGroupsLst[aSrcItem];
+ break;
+ case 4: // Presentation
+ aPrs = myPrsList[aSrcItem];
+ break;
+ }
+ if (CORBA::is_nil(aPrs) && aSrcSelection != 4) {
+ aPrs = createMesh(aType, aName);
+ }
+ }
+ myStatus &= myPrsCopy->SetParams(myIntegStepLen->value(),
+ myPropTime->value(),
+ myStepLen->value(),
+ aPrs,
+ myPntPercent->value(),
+ aDirection);
+ }
+}
+
+
VISU::Mesh_ptr VisuGUI_StreamLinesDlg::createMesh (VISU::VISUType theType, QString theName)
{
return VISU::Mesh::_nil();
void VisuGUI_StreamLinesDlg::accept()
{
+
+ //rnv: To fix the IPAL21920: WinTC5.1.4: parameters of StreamLines are not taken in account.
+ //rnv: Show confirmation message in case if 'Used points' and 'Step length' were re-calculated.
+ //1. Store parameters to the myPrsCopy
+ storeToPrsCopy();
+
+ //2. Check 'Used points' and 'Step length' parameters
+ if( myStepLen->value() > myPrsCopy->GetStepLength() ||
+ myPntPercent->value() > myPrsCopy->GetUsedPoints() ) {
+ QString aWarning = tr("STREAM_MEMORY_ALERT");
+ if( SUIT_MessageBox::warning( this, tr( "WRN_VISU_WARNING" ), aWarning, tr( "BUT_OK" ), tr( "CANCEL" ) ) == 1 ) {
+ // Set re-calculated values
+ myStepLen->setValue(myPrsCopy->GetStepLength());
+ myPntPercent->setValue(myPrsCopy->GetUsedPoints());
+ return;
+ }
+ }
+
VisuGUI_ScalarBarBaseDlg::accept();
}