aMainLayout->addWidget(aBtnBox);
- myCutLines = NULL;
-
// signals and slots connections
connect(mySelPlane , SIGNAL(clicked(int)) , this, SLOT(onPlaneSelect(int)));
connect(myCBSetDef , SIGNAL(toggled(bool)) , this, SLOT(setBaseDefault()));
connect(aOkBtn, SIGNAL(clicked()), this, SLOT(accept()));
connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(reject()));
connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
- //connect(myMgr, SIGNAL(closeAllViews()), this, SLOT(reject()));
- //connect(VisuGUI::application()->desktop(),
- // SIGNAL(windowActivated(SUIT_ViewWindow*)),
- // this, SLOT(onWindowActivated(SUIT_ViewWindow*)));
}
/*!
*/
VisuGUI_CutLinesDlg::~VisuGUI_CutLinesDlg()
{
- cout<<"### VisuGUI_CutLinesDlg::~VisuGUI_CutLinesDlg"<<endl;
deletePlanes();
- if (myCutLines) //delete myCutLines;
- myCutLines->Destroy();
if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
vf->Repaint();
}
hasInit = true;
myCutLines = VISU::TSameAsFactory<VISU::TCUTLINES>().Create(myPrsCopy, VISU::ColoredPrs3d_i::EDoNotPublish);
myCutLines->CopyCurvesInverted(myPrsCopy->GetCurvesInverted());
- if (myCutLines->IsAllCurvesInverted()) myAllCurvesInvertedCheck->setChecked(true);
+ if (myCutLines->IsAllCurvesInverted())
+ myAllCurvesInvertedCheck->setChecked(true);
myBasePlanePos->setText( QString::number(myCutLines->GetBasePlanePosition()) );
myCBSetDef->setChecked(myPrsCopy->IsDefault());
DrawTable();
{
SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView == NULL) return;
- if (myCutLines == NULL) return;
+ if (!myCutLines) return;
if (myPreviewActor != 0) return;
storeToPrsObject(myCutLines);
}
SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
- if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
- /*myCutLines->SetOrientation2(getOrientaion(false),
- myRotXSpn2->value()*PI/180.,
- myRotYSpn2->value()*PI/180.);
- myCutLines->SetDisplacement2(myPosSpn2->value());*/
- //myCutLines->GetPipeLine()->Update();
+ if (theUpdate && myPreviewCheck->isChecked() && myCutLines) {
deletePlanes();
createPlanes();
- //aView->Repaint();
}
}
}
if (myCBSetDef->isChecked()) {
if (!myCutLines->IsDefault()) myCutLines->SetDefault();
- /*myCutLines->SetOrientation(getOrientaion(),
- myRotXSpn->value()*PI/180.,
- myRotYSpn->value()*PI/180.);
- myCutLines->SetDisplacement(myPosSpn->value());*/
- /* float aPos = myCutLines->GetBasePlanePosition();
- myBasePlanePos->setText( QString::number(aPos) );
- myBasePlanePos->setEnabled(false);*/
myCutLines->SetDisplacement(myPosSpn->value());
SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
- if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
- //myCutLines->SetBasePlanePosition(aPos);
- // myCutLines->GetPipeLine()->Update();
+ if (theUpdate && myPreviewCheck->isChecked() && myCutLines) {
deletePlanes();
createPlanes();
- //aView->Repaint();
}
}
vtkFloatingPointType aPos = myCutLines->GetBasePlanePosition();
SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
- // myCutLines->GetPipeLine()->Update();
deletePlanes();
createPlanes();
- //aView->Repaint();
}
}
}
SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
- //Update Preview
- //myCutLines->SetLinePosition( theRow, aTxt.toDouble());
- // myCutLines->GetPipeLine()->Update();
deletePlanes();
createPlanes();
- //aView->Repaint();
}
}
} else if (theCol == 1){
bool isDefault = ((QCheckTableItem*)myPosTable->item(theRow, theCol))->isChecked();
if (isDefault) {
- //myCutLines->SetDefaultPosition(theRow);
- // myPosTable->setText(theRow, 0, QString::number(myCutLines->GetLinePosition(theRow)));
SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
- //Update Preview
- // myCutLines->GetPipeLine()->Update();
deletePlanes();
createPlanes();
- //aView->Repaint();
}
}
myPosTable->setText(theRow, 0, QString::number(myCutLines->GetLinePosition(theRow)));
void VisuGUI_CutLinesDlg::accept()
{
- //if ( !VisuGUI::CheckActiveStudyLock() ) {
- // reject();
- // return;
- //}
- // if (myScalarPane->check()) {
- /*jfa tmp:((QWidget*)sender())->setDisabled(true);
- storeToPrsObject(myPrsCopy);
- if (myIsCreation) {
- if (isGenerateTable()) {
- visuGUI->GetVisuGen()->CreateTable(myPrsCopy->GetEntry());
- if (isGenerateCurves()) {
- SALOMEDSClient_Study* aStudy = study()->studyDS();
- SALOMEDSClient_SObject* aSObject = aStudy->FindObjectID(myPrsCopy->GetEntry());
- if( aSObject ) {
- SALOMEDSClient_ChildIterator* aIter = aStudy->NewChildIterator( aSObject );
- SALOMEDSClient_StudyBuilder* aBuilder = aStudy->NewBuilder();
- for ( ;aIter->More(); aIter->Next()) {
- SALOMEDSClient_SObject* aTblObj = aIter->Value();
- if ( aTblObj ) {
- SALOMEDSClient_GenericAttribute* anAttr;
- if (aTblObj->FindAttribute(anAttr, "AttributeName")) {
- visuGUI->CreatePlot(aTblObj);
- }
- }
- }
- }
- }
- }
- if (GET_VTK_VIEWWINDOW(myMgr)) {
- try {
- visuGUI->CreateActor(myPrsCopy);
- } catch (...) {
- reject();
- return;
- }
- GET_VTK_VIEWWINDOW(myMgr)->onFitAll();
- }
- } else {
- visuGUI->RecreateActor(myPrsCopy);
- if (VTKViewer_ViewWindow* vf = GET_VTK_VIEWWINDOW(myMgr)) {
- if (vf->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
- vf->getRenderer()->ResetCameraClippingRange();
- vf->Repaint();
- }
- }
- // Remove old Table
- SALOMEDSClient_Study* aStudy = study()->studyDS();
- SALOMEDSClient_SObject* aSObject = aStudy->FindObjectID(myPrsCopy->GetEntry());
- if( aSObject ) {
- SALOMEDSClient_ChildIterator* aIter = aStudy->NewChildIterator( aSObject );
- SALOMEDSClient_StudyBuilder* aBuilder = aStudy->NewBuilder();
- for ( ;aIter->More(); aIter->Next()) {
- SALOMEDSClient_SObject* aTblObj = aIter->Value();
- if ( aTblObj ) {
- SALOMEDSClient_GenericAttribute* anAttr;
- if (aTblObj->FindAttribute(anAttr, "AttributeName")) {
- aBuilder->RemoveObjectWithChildren(aIter->Value()); // We should have only one child
- break;
- }
- }
- }
- if (isGenerateTable()) {
- visuGUI->GetVisuGen()->CreateTable(aSObject->GetID().c_str());
- if (isGenerateCurves()) {
- SALOMEDSClient_Study* aStudy = study()->studyDS();
- SALOMEDSClient_ChildIterator* aIter = aStudy->NewChildIterator( aSObject );
- SALOMEDSClient_StudyBuilder* aBuilder = aStudy->NewBuilder();
- for ( ;aIter->More(); aIter->Next()) {
- SALOMEDSClient_SObject* aTblObj = aIter->Value();
- if ( aTblObj ) {
- SALOMEDSClient_GenericAttribute* anAttr;
- if (aTblObj->FindAttribute(anAttr, "AttributeName")) {
- visuGUI->CreatePlot(aTblObj);
- }
- }
- }
- }
- }
- }
- }
- VisuGUI::application()->objectBrowser()->updateTree();*/
myScalarPane->deletePreview();
deletePlanes();
QDialog::accept();
void VisuGUI_CutLinesDlg::reject()
{
- /*jfa tmp:if (myIsCreation) {
- myPrsCopy->RemoveFromStudy();
- VisuGUI::application()->objectBrowser()->updateTree();
- }*/
myScalarPane->deletePreview();
deletePlanes();
QDialog::reject();
{
if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
if (thePreview) {
- //storeToPrsObject(myCutLines);
- // myCutLines->GetPipeLine()->Update();
createPlanes();
- //vf->onFitAll();
} else {
deletePlanes();
vf->Repaint();
void VisuGUI_CutLinesDlg::onRotation (double theValue)
{
- if (myCutLines == NULL) return;
+ if (!myCutLines) return;
SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
-
- /*myCutLines->SetOrientation(getOrientaion(),
- myRotXSpn->value()*PI/180.,
- myRotYSpn->value()*PI/180.);
- myCutLines->SetOrientation2(getOrientaion(false),
- myRotXSpn2->value()*PI/180.,
- myRotYSpn2->value()*PI/180.);*/
- // myCutLines->GetPipeLine()->Update();
deletePlanes();
createPlanes();
- //aView->Repaint();
}
}
}
void VisuGUI_CutLinesDlg::onPlanePos (const QString& theValue)
{
- if (myCutLines == NULL) return;
+ if (!myCutLines) return;
SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView) {
if (myPreviewCheck->isChecked()) {
- //myCutLines->SetBasePlanePosition(theValue.toDouble());
- // myCutLines->GetPipeLine()->Update();
deletePlanes();
createPlanes();
- //aView->Repaint();
}
}
}