-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : VisuGUI_StreamLinesDlg.cxx
// Author : Vitaly SMETANNIKOV
// Module : VISU
#include "VISU_StreamLinesPL.hxx"
#include "VISU_Actor.h"
+#include <SalomeApp_DoubleSpinBox.h>
#include "SalomeApp_Application.h"
#include "LightApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include <SALOMEDSClient_SObject.hxx>
-#include <QtxDoubleSpinBox.h>
#include <QtxColorButton.h>
-#include <limits.h>
+#include <limits>
#include <QLayout>
#include <QLabel>
#include <QFrame>
-using namespace std;
-
VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule)
: VisuGUI_ScalarBarBaseDlg(theModule),
myVisuGUI(theModule)
VISU::VISUType aType = VISU::Storable::SObject2Type(aSObject);
switch (aType) {
case VISU::TTIMESTAMP: {
- aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
- break;
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+ break;
}
case VISU::TFIELD: {
- _PTR(SObject) newSObject;
- if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
- aSObject = aSObject->GetFather();
- break;
+ _PTR(SObject) newSObject;
+ if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
+ aSObject = aSObject->GetFather();
+ break;
}
case VISU::TANIMATION: {
- _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
- for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
- _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
- _PTR(SObject) newSObject;
- if(aTmpChildSObj->ReferencedObject(newSObject)){
- aSObject = newSObject;
- aSObject->GetFather();
- break;
- }
- }
- break;
+ _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
+ for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
+ _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
+ _PTR(SObject) newSObject;
+ if(aTmpChildSObj->ReferencedObject(newSObject)){
+ aSObject = newSObject;
+ aSObject->GetFather();
+ break;
+ }
+ }
+ break;
}}
aSObject = aSObject->GetFather();
mySelectionObj = aSObject;
CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
if (CORBA::is_nil(anObject)) {
- mySelectionObj = mySelectionObj->GetFather();
+ mySelectionObj = mySelectionObj->GetFather();
}
}
}
VISU::VISUType aType = VISU::Storable::SObject2Type(aChildSObj);
if ((aType == VISU::TFAMILY) || (aType == VISU::TGROUP) || (aType == VISU::TENTITY)) {
- _PTR(GenericAttribute) aNameAttr;
- if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
- _PTR(AttributeName) aName (aNameAttr);
- VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
- switch (aType) {
- case VISU::TFAMILY:
- myFamilisLst += QString(aName->Value().c_str());
- myFamilyList.append(aPrsObj);
- break;
- case VISU::TGROUP:
- myGroupsLst += QString(aName->Value().c_str());
- myGroupList.append(aPrsObj);
- break;
- case VISU::TENTITY:
- myEntitiesLst += QString(aName->Value().c_str());
- myEntityList.append(aPrsObj);
- break;
+ _PTR(GenericAttribute) aNameAttr;
+ if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
+ _PTR(AttributeName) aName (aNameAttr);
+ VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
+ switch (aType) {
+ case VISU::TFAMILY:
+ myFamilisLst += QString(aName->Value().c_str());
+ myFamilyList.append(aPrsObj);
+ break;
+ case VISU::TGROUP:
+ myGroupsLst += QString(aName->Value().c_str());
+ myGroupList.append(aPrsObj);
+ break;
+ case VISU::TENTITY:
+ myEntitiesLst += QString(aName->Value().c_str());
+ myEntityList.append(aPrsObj);
+ break;
}
}
}
QLabel* aPercentLbl = new QLabel (tr("LBL_USED_POINTS"), aSourceBox);
aSrcLayout->addWidget(aPercentLbl, 2, 0);
- myPntPercent = new QtxDoubleSpinBox( aSourceBox );
- VISU::initSpinBox(myPntPercent, 0, 1);
+ myPntPercent = new SalomeApp_DoubleSpinBox( aSourceBox );
+ VISU::initSpinBox( myPntPercent, 0., 1., .1, "parametric_precision" );
aSrcLayout->addWidget(myPntPercent, 2, 1);
TopLayout->addWidget(aSourceBox, 0, 0, 1, 2);
QLabel* aStepLenLbl = new QLabel (tr("LBL_STEP_LENGTH"), aTopBox);
TopLayout->addWidget(aStepLenLbl, 1, 0);
- myStepLen = new QtxDoubleSpinBox( aTopBox );
- VISU::initSpinBox(myStepLen, DBL_MIN, DBL_MAX);
+ myStepLen = new SalomeApp_DoubleSpinBox( aTopBox );
+ VISU::initSpinBox( myStepLen,
+ std::numeric_limits<double>::min(),
+ std::numeric_limits<double>::max(),
+ .1,
+ "parametrc_precision" );
myStepLen->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
TopLayout->addWidget(myStepLen, 1, 1);
connect(myStepLen, SIGNAL(valueChanged(double)), this, SLOT(StepLengthChanged(double)));
QLabel* aIntegStepLenLbl = new QLabel (tr("LBL_INTEGRATION_STEP"), aTopBox);
TopLayout->addWidget(aIntegStepLenLbl, 2, 0);
- myIntegStepLen = new QtxDoubleSpinBox( aTopBox );
- VISU::initSpinBox(myIntegStepLen, DBL_MIN, DBL_MAX);
+ myIntegStepLen = new SalomeApp_DoubleSpinBox( aTopBox );
+ VISU::initSpinBox( myIntegStepLen,
+ std::numeric_limits<double>::min(),
+ std::numeric_limits<double>::max(),
+ .1,
+ "parametrc_precision" );
myIntegStepLen->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
TopLayout->addWidget(myIntegStepLen, 2, 1);
connect(myIntegStepLen, SIGNAL(valueChanged(double)), this, SLOT(IntegrationStepChanged(double)));
QLabel* aPropagationLbl = new QLabel (tr("LBL_PROPAGATION_TIME"), aTopBox);
TopLayout->addWidget(aPropagationLbl, 3, 0);
- myPropTime = new QtxDoubleSpinBox( aTopBox );
- VISU::initSpinBox(myPropTime, DBL_MIN, DBL_MAX);
+ myPropTime = new SalomeApp_DoubleSpinBox( aTopBox );
+ VISU::initSpinBox( myPropTime,
+ std::numeric_limits<double>::min(),
+ std::numeric_limits<double>::max(),
+ .1,
+ "parametrc_precision" );
myPropTime->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
TopLayout->addWidget(myPropTime, 3, 1);
connect(myPropTime, SIGNAL(valueChanged(double)), this, SLOT(PropagationTimeChanged(double)));
{}
void VisuGUI_StreamLinesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TSTREAMLINES>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
if (aPrs == NULL) continue; \
if (aSrcEntry == aPrs->GetEntry().c_str()) { \
onSourceTypeChange(PRSNUM); \
- myUseSrcCombo->setCurrentIndex(PRSNUM); \
- mySrcCombo->setEnabled(true); \
- mySrcCombo->setCurrentIndex(i); \
- return; \
+ myUseSrcCombo->setCurrentIndex(PRSNUM); \
+ mySrcCombo->setEnabled(true); \
+ mySrcCombo->setCurrentIndex(i); \
+ return; \
} \
}
QString aName;
switch (aSrcSelection) {
case 1: // Entity
- aPrs = myEntityList[aSrcItem];
- aType = VISU::TENTITY;
- aName = myEntitiesLst[aSrcItem];
- break;
+ aPrs = myEntityList[aSrcItem];
+ aType = VISU::TENTITY;
+ aName = myEntitiesLst[aSrcItem];
+ break;
case 2: // Family
- aPrs = myFamilyList[aSrcItem];
- aType = VISU::TFAMILY;
- aName = myFamilisLst[aSrcItem];
- break;
+ aPrs = myFamilyList[aSrcItem];
+ aType = VISU::TFAMILY;
+ aName = myFamilisLst[aSrcItem];
+ break;
case 3: // Group
- aPrs = myGroupList[aSrcItem];
- aType = VISU::TGROUP;
- aName = myGroupsLst[aSrcItem];
- break;
+ aPrs = myGroupList[aSrcItem];
+ aType = VISU::TGROUP;
+ aName = myGroupsLst[aSrcItem];
+ break;
case 4: // Presentation
- aPrs = myPrsList[aSrcItem];
- break;
+ aPrs = myPrsList[aSrcItem];
+ break;
}
if (CORBA::is_nil(aPrs) && aSrcSelection != 4) {
- aPrs = createMesh(aType, aName);
+ aPrs = createMesh(aType, aName);
}
}
anIsOk &= myPrsCopy->SetParams(myIntegStepLen->value(),
- myPropTime->value(),
- myStepLen->value(),
- aPrs,
- myPntPercent->value(),
- aDirection);
+ myPropTime->value(),
+ myStepLen->value(),
+ aPrs,
+ myPntPercent->value(),
+ aDirection);
}
VISU::TSameAsFactory<VISU::TSTREAMLINES>().Copy(myPrsCopy, thePrs);