msgstr "1 (thin) and 10 (thick)"
-#: VisuGUI_CellsResultsDlg.cxx
-
-msgid "VisuGUI_CellsResultsDlg::&OK"
-msgstr ""
-
-msgid "VisuGUI_CellsResultsDlg::IdCell"
-msgstr ""
-
-msgid "VisuGUI_CellsResultsDlg::NbPoints"
-msgstr ""
-
-msgid "VisuGUI_CellsResultsDlg::Number of Points :"
-msgstr ""
-
-msgid "VisuGUI_CellsResultsDlg::Point"
-msgstr ""
-
-msgid "VisuGUI_CellsResultsDlg::Results on Cell"
-msgstr ""
-
-msgid "VisuGUI_CellsResultsDlg::Results on selected Cell"
-msgstr ""
-
-msgid "VisuGUI_CellsResultsDlg::Scalar Value"
-msgstr ""
-
-msgid "VisuGUI_CellsResultsDlg::Scalar result :"
-msgstr ""
-
-msgid "VisuGUI_CellsResultsDlg::Vector Txt"
-msgstr ""
-
-msgid "VisuGUI_CellsResultsDlg::Vector result :"
-msgstr ""
-
-msgid "VisuGUI_CellsResultsDlg::X"
-msgstr ""
-
-msgid "VisuGUI_CellsResultsDlg::Y"
-msgstr ""
-
-msgid "VisuGUI_CellsResultsDlg::Z"
-msgstr ""
-
-
#: VisuGUI_CursorDlg.cxx
msgid "VisuGUI_CursorDlg::&OK"
msgstr "Full loading for current file"
-#: VisuGUI_InitMeshDlg.cxx
-
-msgid "VisuGUI_InitMeshDlg::Visu_ARGUMENTS"
-msgstr "Arguments"
-
-msgid "VisuGUI_InitMeshDlg::BUT_APPLY"
-msgstr "Apply"
-
-msgid "VisuGUI_InitMeshDlg::Visu_INIT"
-msgstr "Initialise"
-
-msgid "VisuGUI_InitMeshDlg::Visu_INIT_MESH"
-msgstr "Initialise mesh"
-
-msgid "VisuGUI_InitMeshDlg::Visu_NAME"
-msgstr "Name"
-
-msgid "VisuGUI_InitMeshDlg::Visu_OBJECT_GEOM"
-msgstr "Geometrical object"
-
-
#: VisuGUI_IsoSurfacesDlg.cxx
msgid "VisuGUI_IsoSurfacesDlg::&OK"
msgstr "Z :"
-#: VisuGUI_PointsResultsDlg.cxx
-
-msgid "VisuGUI_PointsResultsDlg::&OK"
-msgstr ""
-
-msgid "VisuGUI_PointsResultsDlg::DLG_TITLE"
-msgstr "Results at selected point"
-
-msgid "VisuGUI_PointsResultsDlg::RESULTS_GRP"
-msgstr "Results at Point"
-
-msgid "VisuGUI_PointsResultsDlg::IdPoint"
-msgstr ""
-
-msgid "VisuGUI_PointsResultsDlg::LBL_X"
-msgstr "X:"
-
-msgid "VisuGUI_PointsResultsDlg::LBL_Y"
-msgstr "Y:"
-
-msgid "VisuGUI_PointsResultsDlg::LBL_Z"
-msgstr "Z:"
-
-msgid "VisuGUI_PointsResultsDlg::LBL_SCALAR_RESULT"
-msgstr "Scalar result :"
-
-msgid "VisuGUI_PointsResultsDlg::LBL_SCALAR_VALUE"
-msgstr "Scalar Value"
-
-msgid "VisuGUI_PointsResultsDlg::LBL_VECTOR_RESULT"
-msgstr "Vector result :"
-
-msgid "VisuGUI_PointsResultsDlg::LBL_VECTOR_TXT"
-msgstr "Vector Txt"
-
-
#: VisuGUI_ScalarBarDlg.cxx
msgid "VisuGUI_ScalarBarDlg::&OK"
template<class TPrs3d_i>
TPrs3d_i*
CreatePrs3d(SalomeApp_Module* theModule,
- SALOMEDS::SObject_var theTimeStamp,
+ _PTR(SObject) theTimeStamp,
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
int theTimeId)
{
VISU::Result_var aResult;
- if(CheckResult(theModule,theTimeStamp,aResult)){
+ if (CheckResult(theModule,theTimeStamp,aResult)){
QApplication::setOverrideCursor(Qt::waitCursor);
typedef typename TPrs3d_i::TInterface TPrs3d;
typename TPrs3d::_var_type aPrs3d =
GetVisuGen(theModule)->template Prs3dOnField<TPrs3d_i>
(aResult,theMeshName,theEntity,theFieldName,theTimeId);
QApplication::restoreOverrideCursor();
- if(!CORBA::is_nil(aPrs3d.in()))
+ if (!CORBA::is_nil(aPrs3d.in()))
return dynamic_cast<TPrs3d_i*>(VISU::GetServant(aPrs3d.in()).in());
}
SUIT_MessageBox::warn1(GetDesktop(theModule),
template<class TPrs3d_i, class TDlg, int IsDlgModal>
bool
CreatePrs3d(SalomeApp_Module* theModule,
- SALOMEDS::SObject_var theTimeStamp,
+ _PTR(SObject) theTimeStamp,
const Handle(SALOME_InteractiveObject)& theIO)
{
using namespace VISU;
void
CreatePrs3d(SalomeApp_Module* theModule)
{
- if(CheckLock(GetCStudy(GetAppStudy(theModule))))
+ if (CheckLock(GetCStudy(GetAppStudy(theModule))))
return;
- SALOMEDS::SObject_var aTimeStampSObj;
+ _PTR(SObject) aTimeStampSObj;
Handle(SALOME_InteractiveObject) anIO;
- if(!CheckTimeStamp(theModule,aTimeStampSObj,&anIO))
+ if (!CheckTimeStamp(theModule,aTimeStampSObj,&anIO))
return;
- if(!CreatePrs3d<TPrs3d_i,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO))
+ if (!CreatePrs3d<TPrs3d_i,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO))
return;
theModule->application()->putInfo(QObject::tr("INF_DONE"));
theModule->updateObjBrowser();
- if(SVTK_ViewWindow* aView = GetViewWindow(theModule))
+ if (SVTK_ViewWindow* aView = GetViewWindow(theModule))
aView->onFitAll();
}
return;
// Get selected SObject
- SALOMEDS::SObject_var aResultSObj;
Handle(SALOME_InteractiveObject) anIO;
CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
if (anIO.IsNull() || !anIO->hasEntry())
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
if (CheckLock(aCStudy))
return;
- SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
SALOME_ListIO aList;
SalomeApp_SelectionMgr* mgr = GetSelectionMgr(this);
if (nbSelected < 1) return;
// There is a transaction
- SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder();
aStudyBuilder->NewCommand();
for (i = 0; i < nbSelected; i++) {
- SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(entries[i]);
- if (!aSObject->_is_nil()) {
- DeleteSObject(this, aStudy, aSObject);
+ _PTR(SObject) aSObject = aCStudy->FindObjectID(entries[i]);
+ if (aSObject) {
+ DeleteSObject(this, aCStudy, aSObject);
}
}
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
if (CheckLock(aCStudy))
return;
- SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
Handle(SALOME_InteractiveObject) anIO;
CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
if (anIO.IsNull() || CORBA::is_nil(anObject))
VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aServant.in());
if (!aContainer) return;
- VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (GetDesktop(this));
+ //VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (GetDesktop(this));
+ VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (this);
aDlg->initFromPrsObject(aContainer);
if (aDlg->exec()) {
aDlg->storeToPrsObject(aContainer);
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
if (CheckLock(aCStudy))
return;
- SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
if (aViewMgr->getType() != SVTK_Viewer::Type())
VisuGUI_OffsetDlg* aDlg = new VisuGUI_OffsetDlg (this);
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
- SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
SALOME_ListIO aListIO;
for (; It.More(); It.Next()) {
Handle(SALOME_InteractiveObject)& anIO = It.Value();
if (anIO->hasEntry()) {
- SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(anIO->getEntry());
- if (!aSObject->_is_nil()) {
- CORBA::Object_var aCORBAObject = VISU::SObjectToObject(aSObject);
+ _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
+ if (aSObject) {
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
if (!CORBA::is_nil(aCORBAObject)) {
PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in())) {
{
SalomeApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
+ SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+ SALOME_ListIO aListIO;
+ aSelectionMgr->selectedObjects(aListIO);
+
+ if (aListIO.Extent() < 1) return;
+
+ _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
+
+ // Check if "Merge Scalar Range" can be applied
+ int nbPrs = 0;
+ SALOME_ListIteratorOfListIO It (aListIO);
+ for (; It.More(); It.Next()) {
+ Handle(SALOME_InteractiveObject)& anIO = It.Value();
+ /*std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
+ nbPrs += aPrsList.size();*/
+
+ if (!anIO.IsNull() && anIO->hasEntry()) {
+ _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
+ if (CORBA::is_nil(aCORBAObject)) {
+ _PTR(GenericAttribute) anAttr;
+ if (aSObject->FindAttribute(anAttr, "AttributeComment")) {
+ _PTR(AttributeComment) aComment (anAttr);
+ string aComm = aComment->Value();
+ QString strIn (aComm.c_str());
+ VISU::Storable::TRestoringMap pMap;
+ VISU::Storable::StrToMap(strIn, pMap);
+ bool isExist;
+ VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(pMap,"myType",&isExist).toInt();
+ if (isExist && aType == VISU::TTIMESTAMP) {
+ _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(aSObject);
+ _PTR(SObject) aPrs;
+ for (; anIter->More(); anIter->Next()) {
+ aPrs = anIter->Value();
+ if (!aPrs) continue;
+ std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(this, aPrs);
+ nbPrs += aSubList.size();
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (nbPrs > 1) {
+ theMenu->insertSeparator();
+ action( VISU_MERGE_SCALAR_BARS )->addTo(theMenu);
+ action( VISU_FREE_SCALAR_BARS )->addTo(theMenu);
+ }
+
+ theMenu->insertSeparator();
+
// Check if some (nb > 0) removable objects selected
if (IsRemovableSelected(this)) {
action( VISU_DELETE_OBJS )->addTo(theMenu);
}
// Check single selection
- SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
- SALOME_ListIO aListIO;
- aSelectionMgr->selectedObjects(aListIO);
if (aListIO.Extent() != 1) return;
Handle(SALOME_InteractiveObject) anIO;
VISU::Storable::TRestoringMap aMap;
CORBA::Object_var anObject = GetSelectedObj( this, &anIO, &aMap);
- _PTR(SObject) SO = GetCStudy(GetAppStudy(this))->FindObjectID(anIO->getEntry());
+ _PTR(SObject) SO = aCStudy->FindObjectID(anIO->getEntry());
bool isExist;
VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
#include "SalomeApp_Module.h"
-#include "SALOME_InteractiveObject.hxx"
-
-#include "VISUConfig.hh"
-
-#include "SALOMEconfig.h"
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(VISU_Gen)
-#include CORBA_SERVER_HEADER(MED_Gen)
-
-class SUIT_Desktop;
-
-namespace VISU {
- class Prs3d_i;
-}
-
class VisuGUI: public SalomeApp_Module
{
Q_OBJECT;
+
public:
VisuGUI();
void OnCreatePlot2dView();
void OnEditPrs();
- //void OnDeletePrs();
void OnDisplayPrs();
void OnDisplayOnlyPrs();
void OnShowTable();
void OnCreateTable();
- //void OnDeleteObject();
void OnDeleteObjects();
void OnPlotData();
void OnCurveProperties();
void OnSaveViewParams();
void OnRestoreViewParams();
- //void OnDeleteViewParams();
void OnRename();
void OnClippingPlanes();
+++ /dev/null
-// VISU VISUGUI : GUI of VISU component
-//
-// 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
-//
-//
-//
-// File : VisuGUI_CellsResultsDlg.cxx
-// Author : Laurent CORNABE & Hubert ROLLAND
-// Module : VISU
-// $Header$
-
-using namespace std;
-#include "VisuGUI_CellsResultsDlg.h"
-#include <qlayout.h>
-#include <qheader.h>
-
-/*!
- Constructor
-*/
-VisuGUI_CellsResultsDlg::VisuGUI_CellsResultsDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
- : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
-{
- if ( !name )
- setName( "VisuGUI_CellsResultsDlg" );
- setCaption( tr( "Results on selected Cell" ) );
- setSizeGripEnabled( TRUE );
-
- QGridLayout* TopLayout = new QGridLayout( this );
- TopLayout->setSpacing( 6 );
- TopLayout->setMargin( 11 );
-
- GroupLimit = new QGroupBox( this, "GroupLimit" );
- GroupLimit->setTitle( tr( "Results on Cell" ) );
- GroupLimit->setColumnLayout(0, Qt::Vertical );
- GroupLimit->layout()->setSpacing( 0 );
- GroupLimit->layout()->setMargin( 0 );
- QGridLayout* GroupLimitLayout = new QGridLayout( GroupLimit->layout() );
- GroupLimitLayout->setAlignment( Qt::AlignTop );
- GroupLimitLayout->setSpacing( 6 );
- GroupLimitLayout->setMargin( 11 );
-
- IdCell = new QLabel( tr( "IdCell" ), GroupLimit, "IdCell" );
- QFont IdCell_font = IdCell->font();
- IdCell_font.setBold( TRUE );
- IdCell->setFont( IdCell_font );
- IdCell->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight );
- IdCell->setFrameStyle( QLabel::Box | QLabel::Plain );
- IdCell->setMargin( 5 );
- QHBoxLayout* IdLayout = new QHBoxLayout;
-
- IdLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ));
- IdLayout->addWidget( IdCell );
- GroupLimitLayout->addMultiCellLayout( IdLayout, 0, 0, 0, 2);
-
- NbPoints = new QLabel( tr( "Number of Points :"), GroupLimit, "NbPoints" );
- GroupLimitLayout->addWidget( NbPoints, 1, 0 );
- NbPoint = new QLabel( tr( "NbPoints" ), GroupLimit, "NbPoint" );
- NbPoint->setAlignment( AlignLeft );
- GroupLimitLayout->addWidget( NbPoint, 1, 1 );
- GroupLimitLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 1, 2 );
-
- ListPoints = new QListView( GroupLimit, "ListPoints" );
- ListPoints->setMinimumSize( 300, 120 );
- ListPoints->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
- ListPoints->addColumn( tr( "Point" ) );
- ListPoints->addColumn( tr( "X" ) );
- ListPoints->addColumn( tr( "Y" ) );
- ListPoints->addColumn( tr( "Z" ) );
- ListPoints->setAllColumnsShowFocus( true );
- ListPoints->setShowToolTips( true );
- ListPoints->setSelectionMode( QListView::Single );
- ListPoints->header()->setStretchEnabled( true );
- ListPoints->header()->setStretchEnabled( true, 0 );
- ListPoints->header()->setStretchEnabled( true, 1 );
- ListPoints->header()->setStretchEnabled( true, 2 );
- ListPoints->header()->setStretchEnabled( true, 3 );
- GroupLimitLayout->addMultiCellWidget( ListPoints, 2, 2, 0, 2 );
-
- Scalar_Results = new QLabel( tr( "Scalar result :" ), GroupLimit, "Scalar_Results" );
- GroupLimitLayout->addWidget( Scalar_Results, 3, 0 );
- ScalValue = new QLabel( tr( "Scalar Value" ), GroupLimit, "ScalValue" );
- ScalValue->setAlignment( AlignLeft );
- GroupLimitLayout->addWidget( ScalValue, 3, 1 );
- GroupLimitLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 3, 2 );
-
- Vector_Results = new QLabel( tr( "Vector result :" ), GroupLimit, "Vector_Results" );
- GroupLimitLayout->addWidget( Vector_Results, 4, 0 );
- VectTxt = new QLabel( tr( "Vector Txt" ), GroupLimit, "VectTxt" );
- VectTxt->setAlignment( AlignLeft );
- GroupLimitLayout->addWidget( VectTxt, 4, 1 );
- GroupLimitLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 4, 2 );
-
- GroupButtons = new QGroupBox( this, "GroupButtons" );
- GroupButtons->setColumnLayout(0, Qt::Vertical );
- GroupButtons->layout()->setSpacing( 0 );
- GroupButtons->layout()->setMargin( 0 );
- QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
- GroupButtonsLayout->setAlignment( Qt::AlignTop );
- GroupButtonsLayout->setSpacing( 6 );
- GroupButtonsLayout->setMargin( 11 );
-
- buttonOk = new QPushButton( tr( "&OK" ), GroupButtons, "buttonOk" );
- buttonOk->setAutoDefault( TRUE );
- buttonOk->setDefault( TRUE );
- GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 0 );
- GroupButtonsLayout->addWidget( buttonOk, 0, 1 );
- GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 2 );
-
- TopLayout->addWidget( GroupLimit, 0, 0 );
- TopLayout->addWidget( GroupButtons, 1, 0 );
-
- // signals and slots connections
- connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
-}
-
-/*!
- Destructor
-*/
-VisuGUI_CellsResultsDlg::~VisuGUI_CellsResultsDlg()
-{
-}
+++ /dev/null
-// VISU VISUGUI : GUI of VISU component
-//
-// 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
-//
-//
-//
-// File : VisuGUI_CellsResultsDlg.h
-// Author : Laurent CORNABE & Hubert ROLLAND
-// Module : VISU
-// $Header$
-
-#ifndef VISUGUI_CELLSRESULTSDLG_H
-#define VISUGUI_CELLSRESULTSDLG_H
-
-#include <qdialog.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlistview.h>
-#include <qpushbutton.h>
-
-class VisuGUI_CellsResultsDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- VisuGUI_CellsResultsDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
- ~VisuGUI_CellsResultsDlg();
-
- QGroupBox* GroupLimit;
- QLabel* IdCell;
- QLabel* NbPoints;
- QLabel* NbPoint;
- QListView* ListPoints;
- QLabel* Scalar_Results;
- QLabel* ScalValue;
- QLabel* Vector_Results;
- QLabel* VectTxt;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
-};
-
-#endif // VISUGUI_CELLSRESULTSDLG_H
// VISU VISUGUI : GUI of VISU component
//
// 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
+// 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
//
//
//
// File : VisuGUI_CursorDlg.cxx
-// Author : Laurent CORNABE & Hubert ROLLAND
+// Author : Laurent CORNABE & Hubert ROLLAND
// Module : VISU
// $Header$
setCaption( name );
setSizeGripEnabled( TRUE );
- QGridLayout* TopLayout = new QGridLayout( this );
+ QGridLayout* TopLayout = new QGridLayout( this );
TopLayout->setSpacing( 6 );
TopLayout->setMargin( 11 );
-
+
TopGroupBox = new QGroupBox( this, "TopGroupBox" );
TopGroupBox->setColumnLayout(0, Qt::Vertical );
TopGroupBox->layout()->setSpacing( 0 );
SLayout->addWidget( SpinBox1 );
SLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
TopGroupBoxLayout->addLayout( SLayout, 2, 0 );
-
+
GroupButtons = new QGroupBox (this, "GroupButtons");
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
+ GroupButtons->setGeometry(QRect(10, 10, 281, 48));
GroupButtons->setColumnLayout(0, Qt::Vertical);
GroupButtons->layout()->setSpacing(0);
GroupButtons->layout()->setMargin(0);
buttonCancel = new QPushButton(tr("&Cancel") , GroupButtons, "buttonCancel");
buttonCancel->setAutoDefault(TRUE);
GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
-
+
TopLayout->addWidget(TopGroupBox, 0, 0);
TopLayout->addWidget(GroupButtons, 1, 0);
VisuGUI_CursorDlg::~VisuGUI_CursorDlg()
{
}
-
// VISU VISUGUI : GUI of VISU component
//
// 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
+// 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
//
//
//
// File : VisuGUI_CursorDlg.h
-// Author : Laurent CORNABE & Hubert ROLLAND
+// Author : Laurent CORNABE & Hubert ROLLAND
// Module : VISU
// $Header$
#include <qgroupbox.h>
class VisuGUI_CursorDlg : public QDialog
-{
+{
Q_OBJECT
public:
#include "VisuGUI_EditContainerDlg.h"
+
#include "VisuGUI.h"
+#include "VisuGUI_Tools.h"
+
#include "VISU_Table_i.hh"
#include "SalomeApp_Application.h"
#include <qpushbutton.h>
#include <qlabel.h>
-#include CORBA_SERVER_HEADER(VISU_Gen)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-//extern VisuGUI *visuGUI;
-
using namespace std;
static QPixmap MYRightPix(right_xpm);
-VisuGUI_EditContainerDlg::VisuGUI_EditContainerDlg (QWidget* parent, bool theIsModal)
- : QDialog(parent, "VisuGUI_EditContainerDlg", theIsModal, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+VisuGUI_EditContainerDlg::VisuGUI_EditContainerDlg (VisuGUI* theModule, bool theIsModal)
+ : QDialog(VISU::GetDesktop(theModule), "VisuGUI_EditContainerDlg", theIsModal,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+ myVisuGUI(theModule)
{
if (!theIsModal) {
setWFlags(getWFlags() | WDestructiveClose);
buttonOk->setAutoDefault(TRUE);
buttonOk->setDefault(TRUE);
GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- GroupButtonsLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
+ GroupButtonsLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding,
+ QSizePolicy::Minimum), 0, 1);
QPushButton* buttonCancel = new QPushButton(tr("&Cancel") , GroupButtons, "buttonCancel");
buttonCancel->setAutoDefault(TRUE);
void VisuGUI_EditContainerDlg::initFromPrsObject (VISU::Container_i* theContainer)
{
- SALOMEDS::Study_var aStudy = theContainer->GetStudyDocument();
- SALOMEDS::SComponent_var aVisuSO = aStudy->FindComponent("VISU");
- if (CORBA::is_nil(aVisuSO)) {
- return;
- }
- QValueList<CurveStruct> aStudyCurves;
- QValueList<CurveStruct> aContainerCurves;
- // Find curves in container
- for (int i = 1; i <= theContainer->GetNbCurves(); i++) {
- VISU::Curve_i* aCurve = theContainer->GetCurve(i);
- if (aCurve == NULL) continue;
- CurveStruct aEntry;
- aEntry.CurveName = aCurve->GetTitle();
- aEntry.CurveEntry = aCurve->GetEntry();
- SALOMEDS::SObject_var aTableSO = aStudy->FindObjectID(aCurve->GetTableID());
- if (CORBA::is_nil(aTableSO)) continue;
- aEntry.TableName = getSObjectName(aTableSO);
- aContainerCurves.append(aEntry);
- new QListViewItem(myContainerLst, aEntry.TableName, aEntry.CurveName, aEntry.CurveEntry);
- }
- // Find curves in study
- SALOMEDS::ChildIterator_var aIter = aStudy->NewChildIterator(aVisuSO);
- for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
- SALOMEDS::SObject_var aSObject = aIter->Value();
- CORBA::Object_var anObject = VISU::SObjectToObject(aSObject);
- VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
- if (!CORBA::is_nil(aVisuObj)) {
- if (aVisuObj->GetType() == VISU::TCURVE) {
- SALOMEDS::SObject_var aTableSO = aSObject->GetFather();
- CurveStruct aEntry;
- aEntry.TableName = getSObjectName(aTableSO);
- aEntry.CurveName = getSObjectName(aSObject);
- aEntry.CurveEntry = aSObject->GetID();
- aStudyCurves.append(aEntry);
- }
- }
- }
- //Show Curves which are not in Curve
- QValueList<CurveStruct>::iterator it;
- QValueList<CurveStruct>::iterator it2;
- bool isExist = false;
- for (it = aStudyCurves.begin(); it != aStudyCurves.end(); ++it) {
- for (it2 = aContainerCurves.begin(); it2 != aContainerCurves.end(); ++it2) {
- if (isExist = ((*it).CurveEntry == (*it2).CurveEntry))
- break;
- }
- if (!isExist)
- new QListViewItem(myStudyLst, (*it).TableName, (*it).CurveName, (*it).CurveEntry);
- }
-}
-
-/*void VisuGUI_EditContainerDlg::initFromPrsObject (VISU::Container_i* theContainer)
-{
- _PTR(Study) aStudy = theContainer->GetStudyDocument();
+ _PTR(Study) aStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI));
_PTR(SComponent) aVisuSO = aStudy->FindComponent("VISU");
if (!aVisuSO) {
return;
if (!isExist)
new QListViewItem(myStudyLst, (*it).TableName, (*it).CurveName, (*it).CurveEntry);
}
-}*/
-
-void VisuGUI_EditContainerDlg::storeToPrsObject (VISU::Container_i* theContainer)
-{
- theContainer->Clear();
-
- SALOMEDS::Study_var aStudy = theContainer->GetStudyDocument();
- QListViewItem* anItem = myContainerLst->firstChild();
- while (anItem) {
- SALOMEDS::SObject_var aCurveSO = aStudy->FindObjectID(anItem->text(2));
- if (!CORBA::is_nil(aCurveSO)) {
- CORBA::Object_var aObject = VISU::SObjectToObject(aCurveSO);
- if (!CORBA::is_nil(aObject)) {
- VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aObject).in());
- if (aCurve) theContainer->AddCurve(aCurve->_this());
- }
- }
- anItem = anItem->nextSibling();
- }
}
-/*void VisuGUI_EditContainerDlg::storeToPrsObject (VISU::Container_i* theContainer)
+void VisuGUI_EditContainerDlg::storeToPrsObject (VISU::Container_i* theContainer)
{
theContainer->Clear();
- _PTR(Study) aStudy = theContainer->GetStudyDocument();
+ _PTR(Study) aStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI));
QListViewItem* anItem = myContainerLst->firstChild();
while (anItem) {
_PTR(SObject) aCurveSO = aStudy->FindObjectID(anItem->text(2));
}
anItem = anItem->nextSibling();
}
-}*/
-
-QString VisuGUI_EditContainerDlg::getSObjectName (SALOMEDS::SObject_ptr theSObject)
-{
- if (CORBA::is_nil(theSObject)) return QString("");
-
- SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::AttributeName_var aName;
- if (theSObject->FindAttribute(anAttr, "AttributeName")) {
- aName = SALOMEDS::AttributeName::_narrow(anAttr);
- return QString(aName->Value());
- }
- return QString("");
}
-/*QString VisuGUI_EditContainerDlg::getSObjectName (_PTR(SObject) theSObject)
+QString VisuGUI_EditContainerDlg::getSObjectName (_PTR(SObject) theSObject)
{
if (!theSObject) return QString("");
return QString(aName->Value());
}
return QString("");
-}*/
+}
void VisuGUI_EditContainerDlg::onLeftClicked()
{
#include <qvaluevector.h>
#include <qtoolbutton.h>
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
+#include "SALOMEDSClient_SObject.hxx"
-
-class SALOMEDSClient_SObject;
+class VisuGUI;
namespace VISU {
class Container_i;
class VisuGUI_EditContainerDlg: public QDialog
{
- Q_OBJECT
+ Q_OBJECT;
-public:
- VisuGUI_EditContainerDlg (QWidget* parent, bool theIsModal = true);
- ~VisuGUI_EditContainerDlg() {};
+ public:
+ VisuGUI_EditContainerDlg (VisuGUI* theModule, bool theIsModal = true);
+ ~VisuGUI_EditContainerDlg() {};
- void initFromPrsObject (VISU::Container_i* theContainer);
- void storeToPrsObject (VISU::Container_i* theContainer);
+ void initFromPrsObject (VISU::Container_i* theContainer);
+ void storeToPrsObject (VISU::Container_i* theContainer);
-private slots:
+ private slots:
void onLeftClicked();
void onRightClicked();
void onLeftSelected();
void onRightSelected();
-private:
- //QString getSObjectName (_PTR(SObject) theSObject);
- QString getSObjectName (SALOMEDS::SObject_ptr theSObject);
+ private:
+ QString getSObjectName (_PTR(SObject) theSObject);
+
+ QListView* myStudyLst;
+ QListView* myContainerLst;
+ QToolButton* myLeftBtn;
+ QToolButton* myRightBtn;
- QListView* myStudyLst;
- QListView* myContainerLst;
- QToolButton* myLeftBtn;
- QToolButton* myRightBtn;
+ VisuGUI* myVisuGUI;
};
#endif // VISUGUI_EDITCONTAINER_H
+++ /dev/null
-z// VISU VISUGUI : GUI of VISU component
-//
-// 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
-//
-//
-//
-// File : VisuGUI_InitMeshDlg.cxx
-// Author : Nicolas REJNERI
-// Module : VISU
-// $Header$
-
-using namespace std;
-#include "VisuGUI_InitMeshDlg.h"
-#include "VisuGUI.h"
-
-#include "SUIT_Application.h"
-#include "SUIT_Desktop.h"
-#include "utilities.h"
-
-// QT Includes
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qlayout.h>
-#include <qvariant.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-#include <qimage.h>
-#include <qpixmap.h>
-
-
-//=================================================================================
-// class : VisuGUI_InitMeshDlg()
-// purpose : Constructs a VisuGUI_InitMeshDlg which is a child of 'parent', with the
-// name 'name' and widget flags set to 'f'.
-// The dialog will by default be modeless, unless you set 'modal' to
-// TRUE to construct a modal dialog.
-//=================================================================================
-VisuGUI_InitMeshDlg::VisuGUI_InitMeshDlg( QWidget* parent, const char* name, SALOME_Selection* Sel = 0, bool modal, WFlags fl )
- : QDialog( parent, name, modal, fl )
-{
- QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "VISU",tr("ICON_DLG_INIT_MESH")));
- QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "VISU",tr("ICON_SELECT")));
- if ( !name )
- setName( "VisuGUI_InitMeshDlg" );
- resize( 303, 175 );
- setCaption( tr( "Visu_INIT_MESH" ) );
- VisuGUI_InitMeshDlgLayout = new QGridLayout( this );
- VisuGUI_InitMeshDlgLayout->setSpacing( 6 );
- VisuGUI_InitMeshDlgLayout->setMargin( 11 );
-
- /***************************************************************/
- GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
- GroupConstructors->setTitle( tr( "Visu_INIT" ) );
- GroupConstructors->setExclusive( TRUE );
- GroupConstructors->setColumnLayout(0, Qt::Vertical );
- GroupConstructors->layout()->setSpacing( 0 );
- GroupConstructors->layout()->setMargin( 0 );
- GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
- GroupConstructorsLayout->setAlignment( Qt::AlignTop );
- GroupConstructorsLayout->setSpacing( 6 );
- GroupConstructorsLayout->setMargin( 11 );
- Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
- //Constructor1->setText( tr( "" ) );
- Constructor1->setPixmap( image1 );
- Constructor1->setChecked( TRUE );
- Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) );
- Constructor1->setMinimumSize( QSize( 50, 0 ) );
- GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
- GroupConstructorsLayout->addItem( spacer, 0, 1 );
- VisuGUI_InitMeshDlgLayout->addWidget( GroupConstructors, 0, 0 );
-
- /***************************************************************/
- GroupButtons = new QGroupBox (this, "GroupButtons");
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout (GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
-
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("BUT_CLOSE"));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
-
- buttonApply = new QPushButton (GroupButtons, "buttonApply");
- buttonApply->setText(tr("BUT_APPLY"));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
-
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
-
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("BUT_OK"));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
-
- VisuGUI_InitMeshDlgLayout->addWidget( GroupButtons, 2, 0 );
-
- /***************************************************************/
- GroupC1 = new QGroupBox( this, "GroupC1" );
- GroupC1->setTitle( tr( "Visu_ARGUMENTS" ) );
- GroupC1->setMinimumSize( QSize( 0, 0 ) );
- GroupC1->setFrameShape( QGroupBox::Box );
- GroupC1->setFrameShadow( QGroupBox::Sunken );
- GroupC1->setColumnLayout(0, Qt::Vertical );
- GroupC1->layout()->setSpacing( 0 );
- GroupC1->layout()->setMargin( 0 );
- GroupC1Layout = new QGridLayout( GroupC1->layout() );
- GroupC1Layout->setAlignment( Qt::AlignTop );
- GroupC1Layout->setSpacing( 6 );
- GroupC1Layout->setMargin( 11 );
-
- TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" );
- TextLabelC1A1->setText( tr( "Visu_OBJECT_GEOM" ) );
- TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) );
- TextLabelC1A1->setFrameShape( QLabel::NoFrame );
- TextLabelC1A1->setFrameShadow( QLabel::Plain );
- GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 );
- SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" );
- //SelectButtonC1A1->setText( tr( "" ) );
- SelectButtonC1A1->setPixmap( image0 );
- SelectButtonC1A1->setToggleButton( FALSE );
- GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 );
- LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" );
- GroupC1Layout->addWidget( LineEditC1A1, 0, 2 );
-
- TextLabel_NameMesh = new QLabel( GroupC1, "TextLabel_NameMesh" );
- TextLabel_NameMesh->setText( tr( "Visu_NAME" ) );
- GroupC1Layout->addWidget( TextLabel_NameMesh, 1, 0 );
- LineEdit_NameMesh = new QLineEdit( GroupC1, "LineEdit_NameMesh" );
- GroupC1Layout->addWidget( LineEdit_NameMesh, 1, 2 );
-
- VisuGUI_InitMeshDlgLayout->addWidget( GroupC1, 1, 0 );
- /***************************************************************/
-
- Init(Sel);
-}
-
-//=================================================================================
-// function : ~VisuGUI_InitMeshDlg()
-// purpose : Destroys the object and frees any allocated resources
-//=================================================================================
-VisuGUI_InitMeshDlg::~VisuGUI_InitMeshDlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-
-//=================================================================================
-// function : Init()
-// purpose :
-//=================================================================================
-void VisuGUI_InitMeshDlg::Init( SALOME_Selection* Sel )
-{
- GroupC1->show();
- myConstructorId = 0 ;
- Constructor1->setChecked( TRUE );
- myEditCurrentArgument = LineEditC1A1 ;
- mySelection = Sel;
- myVisuGUI = VisuGUI::GetVisuGUI() ;
- myVisuGUI->SetActiveDialogBox( (QDialog*)this ) ;
-
- myGeomFilter = new SALOME_TypeFilter( "GEOM" );
- mySelection->AddFilter( myGeomFilter );
-
- myNameMesh = "Mesh";
-
- /* signals and slots connections */
- connect( buttonOk, SIGNAL( pressed() ), this, SLOT( ClickOnOk() ) );
- connect( buttonApply, SIGNAL( pressed() ), this, SLOT(ClickOnApply() ) );
- connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( ClickOnCancel() ) ) ;
- connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );
-
- connect( SelectButtonC1A1, SIGNAL (pressed() ), this, SLOT( SetEditCurrentArgument() ) ) ;
- connect( LineEdit_NameMesh, SIGNAL (textChanged(const QString&) ), this, SLOT( TextChangedInLineEdit(const QString&) ) ) ;
-
- connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
- connect( myVisuGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
- connect( myVisuGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
-
-// int x, y ;
-// myVisuGUI->DefineDlgPosition( this, x, y ) ;
-// this->move( x, y ) ;
- this->show() ;
-
- return ;
-}
-
-
-//=================================================================================
-// function : ConstructorsClicked()
-// purpose : Radio button management
-//=================================================================================
-void VisuGUI_InitMeshDlg::ConstructorsClicked(int constructorId)
-{
- return ;
-}
-
-//=================================================================================
-// function : ClickOnOk()
-// purpose :
-//=================================================================================
-void VisuGUI_InitMeshDlg::ClickOnOk()
-{
- this->ClickOnApply() ;
- this->ClickOnCancel() ;
-
- return ;
-}
-
-//=================================================================================
-// function : ClickOnApply()
-// purpose :
-//=================================================================================
-void VisuGUI_InitMeshDlg::ClickOnApply()
-{
- switch(myConstructorId)
- {
- case 0 :
- {
- if ( !myNameMesh.isEmpty() && !myNameMesh.isNull() && !myGeomShape->_is_nil() )
- myVisuGUI->InitMesh( mySMeshMesh, myNameMesh ) ;
- break ;
- }
- }
-}
-
-
-//=================================================================================
-// function : ClickOnCancel()
-// purpose :
-//=================================================================================
-void VisuGUI_InitMeshDlg::ClickOnCancel()
-{
- mySelection->ClearFilters() ;
- disconnect( mySelection, 0, this, 0 );
- myVisuGUI->ResetState() ;
- reject() ;
- return ;
-}
-
-
-//=================================================================================
-// function : SelectionIntoArgument()
-// purpose : Called when selection as changed or other case
-//=================================================================================
-void VisuGUI_InitMeshDlg::SelectionIntoArgument()
-{
- myEditCurrentArgument->setText("") ;
- QString aString = "";
- myGeomShape = GEOM::GEOM_Shape::_nil();
-
- int nbSel = myVisuGUI->GetNameOfSelectedIObjects(mySelection, aString) ;
- if ( nbSel != 1 ) {
- return ;
- } else {
- Standard_Boolean testResult ;
- Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ;
- myGeomShape = myVisuGUI->ConvertIOinGEOMShape(IO, testResult) ;
- if( !testResult ) return ;
- }
-
- myEditCurrentArgument->setText(aString) ;
-}
-
-
-//=================================================================================
-// function : SetEditCurrentArgument()
-// purpose :
-//=================================================================================
-void VisuGUI_InitMeshDlg::SetEditCurrentArgument()
-{
- QPushButton* send = (QPushButton*)sender();
- switch (myConstructorId)
- {
- case 0: /* default constructor */
- {
- if(send == SelectButtonC1A1) {
- LineEditC1A1->setFocus() ;
- myEditCurrentArgument = LineEditC1A1;
- }
- SelectionIntoArgument() ;
- break;
- }
- }
- return ;
-}
-
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose :
-//=================================================================================
-void VisuGUI_InitMeshDlg::DeactivateActiveDialog()
-{
- if ( GroupConstructors->isEnabled() ) {
- disconnect( mySelection, 0, this, 0 );
- GroupConstructors->setEnabled(false) ;
- GroupC1->setEnabled(false) ;
- GroupButtons->setEnabled(false) ;
- }
-}
-
-
-//=================================================================================
-// function : ActivateThisDialog()
-// purpose :
-//=================================================================================
-void VisuGUI_InitMeshDlg::ActivateThisDialog()
-{
- myVisuGUI->EmitSignalDeactivateDialog() ;
- GroupConstructors->setEnabled(true) ;
- GroupC1->setEnabled(true) ;
- GroupButtons->setEnabled(true) ;
- connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
- return ;
-}
-
-
-//=================================================================================
-// function : enterEvent()
-// purpose :
-//=================================================================================
-void VisuGUI_InitMeshDlg::enterEvent(QEvent* e)
-{
- if ( GroupConstructors->isEnabled() )
- return ;
- ActivateThisDialog() ;
- return ;
-}
-
-
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void VisuGUI_InitMeshDlg::closeEvent( QCloseEvent* e )
-{
- this->ClickOnCancel() ;
- return ;
-}
-
-//=================================================================================
-// function : TextChangedInLineEdit()
-// purpose :
-//=================================================================================
-void VisuGUI_InitMeshDlg::TextChangedInLineEdit(const QString& newText)
-{
- QLineEdit* send = (QLineEdit*)sender();
-
- if (send == LineEdit_NameMesh) {
- myNameMesh = newText;
- }
- return ;
-}
+++ /dev/null
-// VISU VISUGUI : GUI of VISU component
-//
-// 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
-//
-//
-//
-// File : VisuGUI_InitMeshDlg.h
-// Author : Nicolas REJNERI
-// Module : VISU
-// $Header$
-
-#ifndef DIALOGBOX_INIT_MESH_H
-#define DIALOGBOX_INIT_MESH_H
-
-#include "SALOME_Selection.h"
-#include "SALOME_TypeFilter.hxx"
-
-// QT Includes
-#include <qvariant.h>
-#include <qdialog.h>
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(GEOM_Gen)
-//#include CORBA_SERVER_HEADER(GEOM_Shape)
-
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QButtonGroup;
-class QGroupBox;
-class QLabel;
-class QLineEdit;
-class QPushButton;
-class QRadioButton;
-class VisuGUI;
-class SalomeApp_SelectionMgr;
-
-//=================================================================================
-// class : VisuGUI_InitMeshDlg
-// purpose :
-//=================================================================================
-class VisuGUI_InitMeshDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- VisuGUI_InitMeshDlg( QWidget* parent = 0, const char* name = 0, SalomeApp_SelectionMgr* = 0, bool modal = FALSE, WFlags fl = 0 );
- ~VisuGUI_InitMeshDlg();
-
-private:
-
- void Init( SalomeApp_SelectionMgr* ) ;
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ) ;
-
- VisuGUI* myVisuGUI ;
- SalomeApp_SelectionMgr* myMgr ;
-
- GEOM::GEOM_Shape_var myGeomShape ;
- int myConstructorId ;
- QLineEdit* myEditCurrentArgument;
-
- QString myNameMesh ;
-
- Handle(SALOME_TypeFilter) myGeomFilter;
-
- QButtonGroup* GroupConstructors;
- QRadioButton* Constructor1;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QGroupBox* GroupC1;
- QLabel* TextLabel_NameMesh ;
- QLineEdit* LineEdit_NameMesh ;
- QLabel* TextLabelC1A1;
- QPushButton* SelectButtonC1A1;
- QLineEdit* LineEditC1A1;
-
-private slots:
-
- void ConstructorsClicked(int constructorId);
- void ClickOnOk();
- void ClickOnCancel();
- void ClickOnApply();
- void SetEditCurrentArgument() ;
- void SelectionIntoArgument() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
- void TextChangedInLineEdit(const QString& newText) ;
-
-protected:
- QGridLayout* VisuGUI_InitMeshDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupC1Layout;
-};
-
-#endif // DIALOGBOX_INIT_MESH_H
+++ /dev/null
-// VISU VISUGUI : GUI of VISU component
-//
-// 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
-//
-//
-//
-// File : VisuGUI_PointsResultsDlg.cxx
-// Author : Laurent CORNABE & Hubert ROLLAND
-// Module : VISU
-// $Header$
-
-using namespace std;
-#include "VisuGUI_PointsResultsDlg.h"
-#include <qlayout.h>
-
-/*!
- Constructor
-*/
-VisuGUI_PointsResultsDlg::VisuGUI_PointsResultsDlg (QWidget* parent, const char* name, bool modal, WFlags fl)
- : QDialog(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
-{
- if (!name)
- setName("VisuGUI_PointsResultsDlg");
- setCaption(tr("DLG_TITLE"));
- setSizeGripEnabled(TRUE);
-
- QGridLayout* TopLayout = new QGridLayout( this );
- TopLayout->setSpacing( 6 );
- TopLayout->setMargin( 11 );
-
- GroupLimit = new QGroupBox (this, "GroupLimit");
- GroupLimit->setTitle(tr("RESULTS_GRP"));
- GroupLimit->setColumnLayout(0, Qt::Vertical );
- GroupLimit->layout()->setSpacing( 0 );
- GroupLimit->layout()->setMargin( 0 );
- QGridLayout* GroupLimitLayout = new QGridLayout( GroupLimit->layout() );
- GroupLimitLayout->setAlignment( Qt::AlignTop );
- GroupLimitLayout->setSpacing( 6 );
- GroupLimitLayout->setMargin( 11 );
-
- IdPoint = new QLabel( tr( "IdPoint" ), GroupLimit, "IdPoint" );
- QFont IdPoint_font = IdPoint->font();
- IdPoint_font.setBold( TRUE );
- IdPoint->setFont( IdPoint_font );
- IdPoint->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight );
- IdPoint->setFrameStyle( QLabel::Box | QLabel::Plain );
- IdPoint->setMargin( 5 );
- QHBoxLayout* IdLayout = new QHBoxLayout;
- IdLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
- IdLayout->addWidget( IdPoint );
- GroupLimitLayout->addMultiCellLayout( IdLayout, 0, 0, 0, 2 );
-
- CoordPointX = new QLabel( tr( "LBL_X" ), GroupLimit, "CoordPointX" );
- CoordX = new QLineEdit( GroupLimit );
- CoordX->setReadOnly( true );
-
- CoordPointY = new QLabel( tr( "LBL_Y" ), GroupLimit, "CoordPointY" );
- CoordY = new QLineEdit( GroupLimit );
- CoordY->setReadOnly( true );
-
- CoordPointZ = new QLabel( tr( "LBL_Z" ), GroupLimit, "CoordPointZ" );
- CoordZ = new QLineEdit( GroupLimit );
- CoordZ->setReadOnly( true );
-
- QHBoxLayout* XYZLayout = new QHBoxLayout; XYZLayout->setMargin( 0 ); XYZLayout->setSpacing( 6 );
- XYZLayout->addWidget( CoordPointX );
- XYZLayout->addWidget( CoordX );
- XYZLayout->addWidget( CoordPointY );
- XYZLayout->addWidget( CoordY );
- XYZLayout->addWidget( CoordPointZ );
- XYZLayout->addWidget( CoordZ );
- GroupLimitLayout->addMultiCellLayout( XYZLayout, 1, 1, 0, 2 );
-
- GroupLimitLayout->addRowSpacing( 2, 10 );
-
- Scalar_Results = new QLabel (tr("LBL_SCALAR_RESULT"), GroupLimit, "Scalar_Results");
- GroupLimitLayout->addWidget( Scalar_Results, 3, 0 );
- ScalValue = new QLabel (tr("LBL_SCALAR_VALUE"), GroupLimit, "ScalValue");
- GroupLimitLayout->addWidget( ScalValue, 3, 1 );
- GroupLimitLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 3, 2 );
-
- Vector_Results = new QLabel (tr("LBL_VECTOR_RESULT"), GroupLimit, "Vector_Results");
- GroupLimitLayout->addWidget( Vector_Results, 4, 0 );
- VectTxt = new QLabel (tr("LBL_VECTOR_TXT"), GroupLimit, "VectTxt");
- GroupLimitLayout->addWidget( VectTxt, 4, 1 );
- GroupLimitLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 4, 2 );
-
- GroupButtons = new QGroupBox( this, "GroupButtons" );
- GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) );
- //GroupButtons->setTitle( tr( "" ) );
- GroupButtons->setColumnLayout(0, Qt::Vertical );
- GroupButtons->layout()->setSpacing( 0 );
- GroupButtons->layout()->setMargin( 0 );
- QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
- GroupButtonsLayout->setAlignment( Qt::AlignTop );
- GroupButtonsLayout->setSpacing( 6 );
- GroupButtonsLayout->setMargin( 11 );
-
- buttonOk = new QPushButton( tr( "&OK" ), GroupButtons, "buttonOk" );
- buttonOk->setAutoDefault( TRUE );
- buttonOk->setDefault( TRUE );
- GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 0 );
- GroupButtonsLayout->addWidget( buttonOk, 0, 1 );
- GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 2 );
-
- TopLayout->addWidget( GroupLimit, 0, 0 );
- TopLayout->addWidget( GroupButtons, 1, 0 );
-
- // signals and slots connections
- connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
-}
-
-/*!
- Destructor
-*/
-VisuGUI_PointsResultsDlg::~VisuGUI_PointsResultsDlg()
-{
-}
-
-
-
-
-
-
-
+++ /dev/null
-// VISU VISUGUI : GUI of VISU component
-//
-// 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
-//
-//
-//
-// File : VisuGUI_PointsResultsDlg.h
-// Author : Laurent CORNABE & Hubert ROLLAND
-// Module : VISU
-// $Header$
-
-#ifndef VISUGUI_POINTSRESULTSDLG_H
-#define VISUGUI_POINTSRESULTSDLG_H
-
-#include <qdialog.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-
-class VisuGUI_PointsResultsDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- VisuGUI_PointsResultsDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
- ~VisuGUI_PointsResultsDlg();
-
- QGroupBox* GroupLimit;
- QLabel* IdPoint;
- QLabel* Scalar_Results;
- QLabel* ScalValue;
- QLabel* Vector_Results;
- QLabel* VectTxt;
- QLabel* CoordPointX;
- QLabel* CoordPointY;
- QLabel* CoordPointZ;
- QLineEdit* CoordX;
- QLineEdit* CoordY;
- QLineEdit* CoordZ;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
-};
-
-#endif // VISUGUI_POINTSRESULTSDLG_H
#include <qlineedit.h>
#include <qvalidator.h>
#include <qtable.h>
-#include <qlistview.h>
// VTK Includes
#include <vtkDataSetMapper.h>
mySelectionDlg->close(true);
setCaption( "Data on elements" );
- setSizeGripEnabled( TRUE );
+ setSizeGripEnabled(TRUE);
- QGridLayout* TopLayout = new QGridLayout(this);
+ QGridLayout* TopLayout = new QGridLayout (this);
TopLayout->setSpacing(6);
TopLayout->setMargin(11);
TopLayout->setRowStretch(0, 0);
TopLayout->setRowStretch(2, 1);
TopLayout->setRowStretch(3, 0);
- QHButtonGroup* aTypeBox = new QHButtonGroup("Selection", this);
+ QHButtonGroup* aTypeBox = new QHButtonGroup ("Selection", this);
- QRadioButton* aPointBtn = new QRadioButton("Point", aTypeBox);
- QRadioButton* aCellBtn = new QRadioButton("Cell", aTypeBox);
- QRadioButton* aActorBtn = new QRadioButton("Actor", aTypeBox);
+ QRadioButton* aPointBtn =
+ new QRadioButton ("Point", aTypeBox);
+ new QRadioButton ("Cell" , aTypeBox);
+ new QRadioButton ("Actor", aTypeBox);
aPointBtn->setChecked(true);
connect(aTypeBox, SIGNAL(clicked(int)), this, SLOT(onSelectionChange(int)));
TopLayout->addWidget(aTypeBox, 0, 0);
- QWidget* aNamePane = new QWidget(this);
- QGridLayout* aNameLay = new QGridLayout(aNamePane);
+ QWidget* aNamePane = new QWidget (this);
+ QGridLayout* aNameLay = new QGridLayout (aNamePane);
- QLabel* aMeshLbl = new QLabel("Mesh name: ", aNamePane);
- myMeshName = new QLabel(aNamePane);
+ QLabel* aMeshLbl = new QLabel ("Mesh name: ", aNamePane);
+ myMeshName = new QLabel (aNamePane);
- QLabel* aFieldLbl = new QLabel("Field name: ", aNamePane);
- myFieldName = new QLabel(aNamePane);
+ QLabel* aFieldLbl = new QLabel ("Field name: ", aNamePane);
+ myFieldName = new QLabel (aNamePane);
aNameLay->addWidget(aMeshLbl, 0, 0);
aNameLay->addWidget(myMeshName, 0, 1);
TopLayout->addWidget(aNamePane, 1, 0);
- myWidgetStack = new QWidgetStack(this);
+ myWidgetStack = new QWidgetStack (this);
// Create Points pane
- myPointsPane = new QVBox(myWidgetStack);
+ myPointsPane = new QVBox (myWidgetStack);
myPointsPane->layout()->setSpacing(6);
- QGroupBox* aDataGrp = new QGroupBox(2, Qt::Horizontal, "Data of Point", myPointsPane);
+ QGroupBox* aDataGrp = new QGroupBox (2, Qt::Horizontal, "Data of Point", myPointsPane);
aDataGrp->layout()->setSpacing(6);
- QLabel* aIDLbl = new QLabel("ID:", aDataGrp);
- myIDValLbl = new QLineEdit("", aDataGrp);
- QIntValidator* aIntValidator = new QIntValidator(myIDValLbl);
+ new QLabel ("ID:", aDataGrp);
+ myIDValLbl = new QLineEdit ("", aDataGrp);
+ QIntValidator* aIntValidator = new QIntValidator (myIDValLbl);
aIntValidator->setBottom(0);
myIDValLbl->setValidator(aIntValidator);
connect(myIDValLbl, SIGNAL(textChanged(const QString&)), this, SLOT(onPointIdEdit(const QString&)));
- QLabel* aValueLbl = new QLabel("Scalar Value:", aDataGrp);
- myScalarValLbl = new QLabel("", aDataGrp);
- QLabel* aVectorLbl = new QLabel("Vector Value:", aDataGrp);
- myVectorValLbl = new QLabel("", aDataGrp);
+ new QLabel ("Scalar Value:", aDataGrp);
+ myScalarValLbl = new QLabel ("", aDataGrp);
+ new QLabel ("Vector Value:", aDataGrp);
+ myVectorValLbl = new QLabel ("", aDataGrp);
myVectorValLbl->setMinimumWidth(150);
- QGroupBox* aCoordGrp = new QGroupBox(2, Qt::Horizontal, "Coordinates", myPointsPane);
+ QGroupBox* aCoordGrp = new QGroupBox (2, Qt::Horizontal, "Coordinates", myPointsPane);
aCoordGrp->layout()->setSpacing(6);
- QLabel* aXLbl = new QLabel("X:", aCoordGrp);
- myXValLbl = new QLabel("", aCoordGrp);
- QLabel* aYLbl = new QLabel("Y:", aCoordGrp);
- myYValLbl = new QLabel("", aCoordGrp);
- QLabel* aZLbl = new QLabel("Z:",aCoordGrp );
- myZValLbl = new QLabel("", aCoordGrp);
+ new QLabel ("X:", aCoordGrp);
+ myXValLbl = new QLabel ("", aCoordGrp);
+ new QLabel ("Y:", aCoordGrp);
+ myYValLbl = new QLabel ("", aCoordGrp);
+ new QLabel ("Z:",aCoordGrp );
+ myZValLbl = new QLabel ("", aCoordGrp);
myWidgetStack->addWidget(myPointsPane, 0);
// Create Cells pane
- myCellsPane = new QWidget(myWidgetStack);
- QGridLayout* aCellLayout = new QGridLayout(myCellsPane);
+ myCellsPane = new QWidget (myWidgetStack);
+ QGridLayout* aCellLayout = new QGridLayout (myCellsPane);
aCellLayout->setSpacing(6);
aCellLayout->setRowStretch(0, 0);
aCellLayout->setRowStretch(1, 1);
QGroupBox* aCellGrp = new QGroupBox(2, Qt::Horizontal, "Data of Cell", myCellsPane);
- QLabel* aCellIDLbl = new QLabel("ID:", aCellGrp);
- myCellIDValLbl = new QLineEdit("", aCellGrp);
+ new QLabel ("ID:", aCellGrp);
+ myCellIDValLbl = new QLineEdit ("", aCellGrp);
myCellIDValLbl->setValidator(aIntValidator);
connect(myCellIDValLbl, SIGNAL(textChanged(const QString&)), this, SLOT(onCellIdEdit(const QString&)));
- QLabel* aCellValueLbl = new QLabel("Scalar Value:", aCellGrp);
- myCellScalarValLbl = new QLabel("", aCellGrp);
- QLabel* aCellVectorLbl = new QLabel("Vector Value:", aCellGrp);
- myCellVectorValLbl = new QLabel("", aCellGrp);
+ new QLabel ("Scalar Value:", aCellGrp);
+ myCellScalarValLbl = new QLabel ("", aCellGrp);
+ new QLabel ("Vector Value:", aCellGrp);
+ myCellVectorValLbl = new QLabel ("", aCellGrp);
aCellLayout->addWidget(aCellGrp, 0, 0);
- myListPoints = new QTable(myCellsPane);
+ myListPoints = new QTable (myCellsPane);
myListPoints->setReadOnly(true);
myListPoints->setNumCols(6);
myListPoints->setNumRows(0);
myWidgetStack->addWidget(myCellsPane, 1);
// Actor Pane
- myActorsPane = new QVBox(myWidgetStack);
+ myActorsPane = new QVBox (myWidgetStack);
myActorsPane->layout()->setSpacing(6);
- QGroupBox* aPosGrp = new QGroupBox(2, Qt::Horizontal, "Position", myActorsPane);
+ QGroupBox* aPosGrp = new QGroupBox (2, Qt::Horizontal, "Position", myActorsPane);
aPosGrp->layout()->setSpacing(6);
- QLabel* aXPosLbl = new QLabel("X:", aPosGrp);
- myXPosLbl = new QLabel("0", aPosGrp);
- QLabel* aYPosLbl = new QLabel("Y:", aPosGrp);
- myYPosLbl = new QLabel("0", aPosGrp);
- QLabel* aZPosLbl = new QLabel("Z:", aPosGrp);
- myZPosLbl = new QLabel("0", aPosGrp);
-
- QGroupBox* aSizeGrp = new QGroupBox(2, Qt::Horizontal, "Size", myActorsPane);
+ new QLabel ("X:", aPosGrp);
+ myXPosLbl = new QLabel ("0", aPosGrp);
+ new QLabel ("Y:", aPosGrp);
+ myYPosLbl = new QLabel ("0", aPosGrp);
+ new QLabel ("Z:", aPosGrp);
+ myZPosLbl = new QLabel ("0", aPosGrp);
+
+ QGroupBox* aSizeGrp = new QGroupBox (2, Qt::Horizontal, "Size", myActorsPane);
aSizeGrp->layout()->setSpacing(6);
- QLabel* aXSizeLbl = new QLabel("dX:", aSizeGrp);
- myDXLbl = new QLabel("0", aSizeGrp);
- QLabel* aYSizeLbl = new QLabel("dY:", aSizeGrp);
- myDYLbl = new QLabel("0", aSizeGrp);
- QLabel* aZSizeLbl = new QLabel("dZ:",aSizeGrp );
- myDZLbl = new QLabel("0", aSizeGrp);
+ new QLabel ("dX:", aSizeGrp);
+ myDXLbl = new QLabel ("0", aSizeGrp);
+ new QLabel ("dY:", aSizeGrp);
+ myDYLbl = new QLabel ("0", aSizeGrp);
+ new QLabel ("dZ:",aSizeGrp );
+ myDZLbl = new QLabel ("0", aSizeGrp);
myWidgetStack->addWidget(myActorsPane, 2);
TopLayout->addWidget(myWidgetStack, 2, 0);
// Create buttons group
- QHBox* aBtnBox = new QHBox(this);
+ QHBox* aBtnBox = new QHBox (this);
QHBoxLayout* aBtnLayout = (QHBoxLayout*)aBtnBox->layout();
aBtnLayout->addStretch();
- QPushButton* aCloseBtn = new QPushButton(tr("BUT_CLOSE"), aBtnBox);
+ QPushButton* aCloseBtn = new QPushButton (tr("BUT_CLOSE"), aBtnBox);
connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close()));
TopLayout->addWidget(aBtnBox, 3, 0);
myFl = false;
- SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
// Activate Points pane
+ SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
myWidgetStack->raiseWidget(myPointsPane);
if (aSVTKVW)
aSVTKVW->SetSelectionMode(NodeSelection);
float* aCoord;
vtkIdList *aPointList = aCell->GetPointIds();
- QListViewItem* anItem = NULL;
for (int i = 0; i < aNbOfPoints; i++) {
int idCurrent = aPointList->GetId(i);
#ifndef VisuGUI_Selection_HeaderFile
#define VisuGUI_Selection_HeaderFile
-#include "SALOMEconfig.h"
-#include "VISU_Actor.h"
-#include "SVTK_Selection.h"
-
-#include <vtkDataSet.h>
-
#include <qdialog.h>
class QLabel;
#include "SALOME_ListIO.hxx"
#include <SALOMEDSClient_SObject.hxx>
-#include <SALOMEDS_SObject.hxx>
#include <limits.h>
#include <qlayout.h>
#include <qcheckbox.h>
#include <qstringlist.h>
-#include "SALOMEconfig.h"
-#include CORBA_CLIENT_HEADER(VISU_Gen)
-
class SalomeApp_Module;
class QtxDblSpinBox;
-class SALOMEDSClient_SObject;
namespace VISU{
class StreamLines_i;
return theStudy->studyDS();
}
- SALOMEDS::StudyManager_var
- GetStudyManager()
- {
- static SALOMEDS::StudyManager_var aStudyManager;
- if(CORBA::is_nil(aStudyManager)){
- SALOME_NamingService *aNamingService = SalomeApp_Application::namingService();
- CORBA::Object_var anObject = aNamingService->Resolve("/myStudyManager");
- aStudyManager = SALOMEDS::StudyManager::_narrow(anObject);
- }
- return aStudyManager;
- }
-
bool
IsStudyLocked( _PTR(Study) theStudy )
{
return aGen;
}
- VISU::Storable::TRestoringMap
- getMapOfValue(SALOMEDS::SObject_var theSObject)
- {
- VISU::Storable::TRestoringMap aMap;
- if(!theSObject->_is_nil()){
- SALOMEDS::GenericAttribute_var anAttr;
- if (theSObject->FindAttribute(anAttr, "AttributeComment")) {
- SALOMEDS::AttributeComment_var aComment = SALOMEDS::AttributeComment::_narrow(anAttr);
- CORBA::String_var aValue = aComment->Value();
- QString aString(aValue.in());
- VISU::Storable::StrToMap(aString,aMap);
- }
- }
- return aMap;
- }
-
- QString
- getValue(SALOMEDS::SObject_var theSObject,
- QString theKey)
- {
- QString aStr("");
- VISU::Storable::TRestoringMap aMap = getMapOfValue(theSObject);
- if(!aMap.empty())
- aStr = VISU::Storable::FindValue(aMap,theKey.latin1());
- return aStr;
- }
VISU::Storable::TRestoringMap getMapOfValue (_PTR(SObject) theSObject)
{
const QString& theEntry,
VISU::Storable::TRestoringMap* theMap)
{
- if ( !theStudy || theEntry.isEmpty() )
+ if (!theStudy || theEntry.isEmpty())
return CORBA::Object::_nil();
- SALOMEDS::Study_var aStudy = GetDSStudy(GetCStudy( theStudy ));
- SALOMEDS::SObject_var aSObject = aStudy->FindObjectID( theEntry.latin1() );
- if(!aSObject->_is_nil()){
- SALOMEDS::GenericAttribute_var anAttr;
- if(theMap && aSObject->FindAttribute(anAttr,"AttributeComment")){
- SALOMEDS::AttributeComment_var aComment = SALOMEDS::AttributeComment::_narrow(anAttr);
+ _PTR(Study) aStudy = GetCStudy(theStudy);
+ _PTR(SObject) aSObject = aStudy->FindObjectID(theEntry.latin1());
+ if (aSObject) {
+ _PTR(GenericAttribute) anAttr;
+ if (theMap && aSObject->FindAttribute(anAttr,"AttributeComment")) {
+ _PTR(AttributeComment) aComment (anAttr);
std::string aValue = aComment->Value();
- QString aString(aValue.c_str());
- VISU::Storable::StrToMap(aString,*theMap);
+ QString aString (aValue.c_str());
+ VISU::Storable::StrToMap(aString, *theMap);
}
- return VISU::SObjectToObject(aSObject);
+ return VISU::ClientSObjectToObject(aSObject);
}
return CORBA::Object::_nil();
}
void
DeleteSObject (SalomeApp_Module* theModule,
- SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+ _PTR(Study) theStudy,
+ _PTR(SObject) theSObject)
{
- SALOMEDS::ChildIterator_var aChildIter = theStudy->NewChildIterator(theSObject);
+ _PTR(ChildIterator) aChildIter = theStudy->NewChildIterator(theSObject);
for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
- SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
- CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject);
+ _PTR(SObject) aChildSObject = aChildIter->Value();
+ CORBA::Object_var aChildObj = VISU::ClientSObjectToObject(aChildSObject);
ErasePrs(theModule, aChildObj);
}
- CORBA::Object_var anObj = VISU::SObjectToObject(theSObject);
+ CORBA::Object_var anObj = VISU::ClientSObjectToObject(theSObject);
if (!CORBA::is_nil(anObj)) {
VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObj);
if (!CORBA::is_nil(aRemovableObject)) {
VISU::Prs3d_i* thePrs,
const Handle(SALOME_InteractiveObject)& theIO)
{
- if(!thePrs)
+ if (!thePrs)
return;
- if(CheckLock(GetCStudy(GetAppStudy(theModule))))
+ if (CheckLock(GetCStudy(GetAppStudy(theModule))))
return;
SALOMEDS::SObject_var aSObject = thePrs->GetSObject();
CORBA::String_var anEntry = aSObject->GetID();
bool
CheckTimeStamp(const SalomeApp_Module* theModule,
- SALOMEDS::SObject_var& theSObject,
+ _PTR(SObject)& theSObject,
Handle(SALOME_InteractiveObject)* theIO)
{
Handle(SALOME_InteractiveObject) anIO;
- CORBA::Object_var anObject = GetSelectedObj(theModule,&anIO);
- if(theIO)
+ CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO);
+ if (theIO)
*theIO = anIO;
- if(!anIO.IsNull() && anIO->hasEntry()){
- SALOMEDS::Study_var aStudy = GetDSStudy(GetCStudy(GetAppStudy(theModule)));
+ if (!anIO.IsNull() && anIO->hasEntry()){
+ _PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule));
theSObject = aStudy->FindObjectID(anIO->getEntry());
QString aValue = getValue(theSObject,"myType");
- if(aValue.toInt() == int(VISU::TTIMESTAMP))
+ if (aValue.toInt() == int(VISU::TTIMESTAMP))
return true;
}
SUIT_MessageBox::warn1(GetDesktop(theModule),
return false;
}
-
VISU::Result_i*
CheckResult(const SalomeApp_Module* theModule,
- SALOMEDS::SObject_var theSource,
- VISU::Result_var& theResult)
+ _PTR(SObject) theSource,
+ VISU::Result_var& theResult)
{
- SALOMEDS::SObject_var aSObj;
-
- aSObj = theSource->GetFather();
- if (CORBA::is_nil(aSObj))
+ _PTR(SObject) aSObj = theSource->GetFather();
+ if (!aSObj)
return NULL;
aSObj = aSObj->GetFather();
- if (CORBA::is_nil(aSObj))
+ if (!aSObj)
return NULL;
aSObj = aSObj->GetFather();
- if (CORBA::is_nil(aSObj))
+ if (!aSObj)
return NULL;
- CORBA::Object_var anObject = VISU::SObjectToObject(aSObj);
+ CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObj);
if (CORBA::is_nil(anObject)) {
aSObj = aSObj->GetFather();
- if (CORBA::is_nil(aSObj))
+ if (!aSObj)
return NULL;
- anObject = VISU::SObjectToObject(aSObj);
+ anObject = VISU::ClientSObjectToObject(aSObj);
}
if (CORBA::is_nil(anObject))
theResult = VISU::Result::_narrow(anObject);
VISU::Result_i* pResult = dynamic_cast<VISU::Result_i*>(VISU::GetServant(anObject).in());
- if(pResult == NULL)
+ if (pResult == NULL)
SUIT_MessageBox::warn1(GetDesktop(theModule),
QObject::tr("WRN_VISU"),
QObject::tr("WRN_NO_AVAILABLE_DATA"),
// Others
void CreateMesh (const SalomeApp_Module* theModule,
- const Handle(SALOME_InteractiveObject)& theIO)
+ const Handle(SALOME_InteractiveObject)& theIO)
{
_PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule));
//if (CheckLock(aStudy))
// return;
- SALOMEDS::SObject_var aResultSObj =
- GetDSStudy(aStudy)->FindObjectID(theIO->getEntry());
+ _PTR(SObject) aResultSObj = aStudy->FindObjectID(theIO->getEntry());
// Get VISU::Result
VISU::Result_var aResult;
std::vector<VISU::Prs3d_i*> aList;
if (!theIO.IsNull() && theIO->hasEntry()) {
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
- SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
- SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(theIO->getEntry());
+ _PTR(SObject) aSObject = aCStudy->FindObjectID(theIO->getEntry());
aList = GetPrs3dList(theModule, aSObject);
}
return aList;
}
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
- SALOMEDS::SObject_ptr theObject)
+ _PTR(SObject) theObject)
{
+ std::vector<VISU::Prs3d_i*> aList; int k = 0;
+ if (!theObject)
+ return aList;
+
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
- SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
- std::vector<VISU::Prs3d_i*> aList; int k = 0;
- if (!theObject->_is_nil()) {
- CORBA::Object_var aCORBAObject = VISU::SObjectToObject(theObject);
- if (!CORBA::is_nil(aCORBAObject)) {
- VISU::Base_var aVisuObj = VISU::Base::_narrow(aCORBAObject);
- if (!CORBA::is_nil(aVisuObj)) {
- VISU::VISUType aType = aVisuObj->GetType();
- switch (aType) {
- case VISU::TSCALARMAP:
- case VISU::TISOSURFACE:
- case VISU::TDEFORMEDSHAPE:
- case VISU::TCUTPLANES:
- case VISU::TCUTLINES:
- case VISU::TVECTORS:
- case VISU::TSTREAMLINES:
- case VISU::TPLOT3D:
- {
- PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
- if (aServant.in()) {
- VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
- aList.resize(k+1); aList[k] = aPrsObject; k++;
- }
- }
- break;
- case VISU::TFIELD:
- {
- SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theObject);
- SALOMEDS::SObject_var aTimeStamp;
- anIter->Next(); // First is reference on support
- for(;anIter->More();anIter->Next()) {
- aTimeStamp = anIter->Value();
- if (aTimeStamp->_is_nil()) continue;
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(theObject);
+ if (!CORBA::is_nil(aCORBAObject)) {
+ VISU::Base_var aVisuObj = VISU::Base::_narrow(aCORBAObject);
+ if (!CORBA::is_nil(aVisuObj)) {
+ VISU::VISUType aType = aVisuObj->GetType();
+ switch (aType) {
+ case VISU::TSCALARMAP:
+ case VISU::TISOSURFACE:
+ case VISU::TDEFORMEDSHAPE:
+ case VISU::TCUTPLANES:
+ case VISU::TCUTLINES:
+ case VISU::TVECTORS:
+ case VISU::TSTREAMLINES:
+ case VISU::TPLOT3D:
+ {
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ if (aServant.in()) {
+ VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
+ aList.resize(k+1);
+ aList[k] = aPrsObject;
+ k++;
+ }
+ }
+ break;
+ case VISU::TFIELD:
+ {
+ _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(theObject);
+ _PTR(SObject) aTimeStamp;
+ anIter->Next(); // First is reference on support
+ for (; anIter->More(); anIter->Next()) {
+ aTimeStamp = anIter->Value();
+ if (!aTimeStamp) continue;
+ std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(theModule, aTimeStamp);
+ if (!aSubList.empty()) {
+ int n = aSubList.size();
+ aList.resize(k+n);
+ for (int i = 0; i < n; i++) {
+ aList[k] = aSubList[i];
+ k++;
+ }
+ }
+ }
+ }
+ break;
+ }
+ }
+ } else {
+ _PTR(GenericAttribute) anAttr;
+ if (theObject->FindAttribute(anAttr, "AttributeComment")) {
+ _PTR(AttributeComment) aComment (anAttr);
+ string aComm = aComment->Value();
+ QString strIn (aComm.c_str());
+ VISU::Storable::TRestoringMap pMap;
+ VISU::Storable::StrToMap(strIn, pMap);
+ bool isExist;
+ VISU::VISUType aType =
+ (VISU::VISUType)VISU::Storable::FindValue(pMap,"myType",&isExist).toInt();
+ if (isExist) {
+ switch (aType) {
+ case VISU::TFIELD:
+ {
+ _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(theObject);
+ _PTR(SObject) aTimeStamp;
+ anIter->Next(); // First is reference on support
+ for (; anIter->More(); anIter->Next()) {
+ aTimeStamp = anIter->Value();
+ if (!aTimeStamp) continue;
std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(theModule, aTimeStamp);
if (!aSubList.empty()) {
- int n = aSubList.size();
+ int n = aSubList.size();
aList.resize(k+n);
- for (int i = 0; i < n; i++)
- { aList[k] = aSubList[i]; k++; }
- }
- }
- }
- break;
- }
- }
- } else {
- SALOMEDS::GenericAttribute_var anAttr;
- if (theObject->FindAttribute(anAttr, "AttributeComment")) {
- SALOMEDS::AttributeComment_var aComment =
- SALOMEDS::AttributeComment::_narrow(anAttr);
- string aComm = aComment->Value();
- QString strIn( aComm.c_str() );
- VISU::Storable::TRestoringMap pMap;
- VISU::Storable::StrToMap( strIn, pMap );
- bool isExist;
- VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(pMap,"myType",&isExist).toInt();
- if (isExist) {
- switch (aType) {
- case VISU::TFIELD:
- {
- SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theObject);
- SALOMEDS::SObject_var aTimeStamp;
- anIter->Next(); // First is reference on support
- for (;anIter->More();anIter->Next()) {
- aTimeStamp = anIter->Value();
- if (aTimeStamp->_is_nil()) continue;
- std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(theModule, aTimeStamp);
- if (!aSubList.empty()) {
- int n = aSubList.size();
- aList.resize(k+n);
- for (int i = 0; i < n; i++)
- { aList[k] = aSubList[i]; k++; }
- }
- }
- }
- break;
- case VISU::TTIMESTAMP:
- {
- SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theObject);
- SALOMEDS::SObject_var aPrs;
- for (;anIter->More();anIter->Next()) {
- aPrs = anIter->Value();
- if (aPrs->_is_nil()) continue;
- std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(theModule, aPrs);
- if (!aSubList.empty()) {
- int n = aSubList.size();
- aList.resize(k+n);
- for (int i = 0; i < n; i++)
- { aList[k] = aSubList[i]; k++; }
- }
- }
- }
- break;
- }
- }
+ for (int i = 0; i < n; i++) {
+ aList[k] = aSubList[i];
+ k++;
+ }
+ }
+ }
+ }
+ break;
+ case VISU::TTIMESTAMP:
+ {
+ _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(theObject);
+ _PTR(SObject) aPrs;
+ for (; anIter->More(); anIter->Next()) {
+ aPrs = anIter->Value();
+ if (!aPrs) continue;
+ std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(theModule, aPrs);
+ if (!aSubList.empty()) {
+ int n = aSubList.size();
+ aList.resize(k+n);
+ for (int i = 0; i < n; i++) {
+ aList[k] = aSubList[i];
+ k++;
+ }
+ }
+ }
+ }
+ break;
+ }
}
}
}
#include "SALOMEDSClient_Study.hxx"
#include "SALOMEconfig.h"
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(VISU_Gen)
#include CORBA_SERVER_HEADER(MED_Gen)
class SUIT_Desktop;
SUIT_Desktop* GetDesktop(const CAM_Module* theModule);
SalomeApp_Study* GetAppStudy(const CAM_Module* theModule);
_PTR(Study) GetCStudy(const SalomeApp_Study* theStudy);
- SALOMEDS::StudyManager_var GetStudyManager();
bool IsStudyLocked( _PTR(Study) theStudy );
bool CheckLock( _PTR(Study) theStudy );
VISU_Gen_i* GetVisuGen(const CAM_Module* theModule);
SALOME_MED::MED_Gen_var GetMEDEngine();
- VISU::Storable::TRestoringMap getMapOfValue(SALOMEDS::SObject_var theSObject);
VISU::Storable::TRestoringMap getMapOfValue(_PTR(SObject) theSObject);
- QString getValue(SALOMEDS::SObject_var theSObject, QString theKey);
QString getValue(_PTR(SObject) theSObject, QString theKey);
// Selection
CORBA::Object_ptr theObject,
bool theUpdate = true);
void DeleteSObject(SalomeApp_Module* theModule,
- SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject);
+ _PTR(Study) theStudy,
+ _PTR(SObject) theSObject);
void DeletePrs3d(SalomeApp_Module* theModule,
VISU::Prs3d_i* thePrs,
const Handle(SALOME_InteractiveObject)& theIO);
// SObject type
bool CheckTimeStamp(const SalomeApp_Module* theModule,
- SALOMEDS::SObject_var& theSObject,
+ _PTR(SObject)& theSObject,
Handle(SALOME_InteractiveObject)* theIO = NULL);
VISU::Result_i* CheckResult(const SalomeApp_Module* theModule,
- SALOMEDS::SObject_var theSource,
+ _PTR(SObject) theSource,
VISU::Result_var& theResult);
inline bool IsSObjectTable(_PTR(SObject) theSObject);
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
const Handle(SALOME_InteractiveObject)& theIO);
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
- SALOMEDS::SObject_ptr theObject);
+ _PTR(SObject) theObject);
}
bool VISU::IsSObjectTable( _PTR(SObject) theSObject )
{
return SUIT_Session::session();
}
-
+
SUIT_ResourceMgr*
GetResourceMgr()
{
Base_i::~Base_i() {}
- char* Base_i::GetID(){
+ char* Base_i::GetID(){
if(myID == ""){
CORBA::Object_var anObject = _this();
CORBA::String_var anIOR = myOrb->object_to_string(anObject);
Mutex::Mutex(QMutex* theMutex): myMutex(&aMutex){
if(MYDEBUG) MESSAGE("Mutex::Mutex : "<<!mySCnt);
- if(!mySCnt++)
+ if(!mySCnt++)
myMutex->lock();
}
ToStream(strOut);
strOut<<ends;
if(MYDEBUG) MESSAGE("Storable::ToString - "<<strOut.str());
- return strOut.str();
+ return strOut.str();
}
void Storable::Registry(const char* theComment, TStorableEngine theEngine)
throw std::logic_error("Storable::Registry >> dupliacte registring !!!");
}
}
-
+
void Storable::StrToMap(const QString& theStr, VISU::Storable::TRestoringMap& theMap){
if(0 && MYDEBUG) MESSAGE("Storable::StrToMap : string="<<theStr);
QStringList strList = QStringList::split( ";", theStr, false );
aValue = "";
}
if ( !aName.isEmpty() )
- theMap.insert( TRestoringMap::value_type( aName.latin1(), aValue ) );
+ theMap.insert( TRestoringMap::value_type( aName.latin1(), aValue ) );
}
}
void Storable::DataToStream(ostringstream& theStr, const QString& theName, const QString& theVal) {
- QString output = ( !theName.isNull() ? theName : QString("") )
- + QString( "=" )
+ QString output = ( !theName.isNull() ? theName : QString("") )
+ + QString( "=" )
+ ( !theVal.isNull() ? theVal : QString("") );
theStr<<output.latin1()<<";";
}
void Storable::DataToStream(ostringstream& theStr, const QString& theName, const int theVal) {
- QString output = ( !theName.isNull() ? theName : QString("") )
- + QString( "=" )
+ QString output = ( !theName.isNull() ? theName : QString("") )
+ + QString( "=" )
+ QString::number( theVal );
theStr<<output.latin1()<<";";
}
void Storable::DataToStream(ostringstream& theStr, const QString& theName, const double theVal) {
- QString output = ( !theName.isNull() ? theName : QString("") )
- + QString( "=" )
+ QString output = ( !theName.isNull() ? theName : QString("") )
+ + QString( "=" )
+ QString::number( theVal );
theStr<<output.latin1()<<";";
}
Storable* Storable::Create(SALOMEDS::SObject_ptr theSObject,
- const string& thePrefix, const string& theLocalPersistentID)
+ const string& thePrefix, const string& theLocalPersistentID)
{
try{
QString strIn( theLocalPersistentID.c_str() );
- TRestoringMap aMap;
+ TRestoringMap aMap;
StrToMap(strIn,aMap);
bool isExist;
QString aComment = VISU::Storable::FindValue(aMap,"myComment",&isExist);
}
return NULL;
}
-
+
QString Storable::FindValue(const TRestoringMap& theMap, const string& theArg, bool* isFind)
{
TRestoringMap::const_iterator i = theMap.find(theArg);
if(isFind != NULL) *isFind = true;
return i->second;
}
-
+
//===========================================================================
PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject){
PortableServer::Servant aServant = aPOA->reference_to_servant(theObject);
return aServant;
} catch (...) {
- INFOS("GetServant - Unknown exception was occured!!!");
+ INFOS("GetServant - Unknown exception was occured!!!");
return NULL;
}
}
string FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument, const char* theStartEntry,
const char* theComment, int IsAllLevels)
{
- SALOMEDS::ChildIterator_var anIter =
+ SALOMEDS::ChildIterator_var anIter =
theStudyDocument->NewChildIterator(theStudyDocument->FindObjectID(theStartEntry));
anIter->InitEx(IsAllLevels);
SALOMEDS::SObject_var aFieldSO;
return "";
}
//===========================================================================
- string CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
+ string CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
const char* theFatherEntry, const char* theRefFatherEntry,
- const char* theIOR, const char* theName,
+ const char* theIOR, const char* theName,
const char* thePersistentRef, const char* theComment,
CORBA::Boolean theCreateNew)
{
if(strcmp(theIOR,"") != 0){
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- anIOR->SetValue(theIOR);
+ anIOR->SetValue(theIOR);
}
if(strcmp(theName,"") != 0){
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue(theName);
+ aName->SetValue(theName);
}
if(strcmp(thePersistentRef,"") != 0){
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePersistentRef");
SALOMEDS::AttributePersistentRef_var aPRef = SALOMEDS::AttributePersistentRef::_narrow(anAttr);
- aPRef->SetValue(thePersistentRef);
+ aPRef->SetValue(thePersistentRef);
}
if(strcmp(theComment,"") != 0){
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment");
}
CORBA::String_var anEntry = newObj->GetID();
string aRet(anEntry);
- if(MYDEBUG)
+ if(MYDEBUG)
INFOS("CreateAttributes - StudyId = "<<theStudyDocument->StudyId()<<"; anEntry = "<<aRet<<"; IOR = '"<<theIOR<<"'");
return aRet;
}
- string CreateAttributes(_PTR(Study) theStudyDocument,
+ string CreateAttributes(_PTR(Study) theStudyDocument,
const char* theFatherEntry, const char* theRefFatherEntry,
- const char* theIOR, const char* theName,
+ const char* theIOR, const char* theName,
const char* thePersistentRef, const char* theComment,
CORBA::Boolean theCreateNew)
{
if (strcmp(theIOR, "") != 0) {
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
_PTR(AttributeIOR) anIOR (anAttr);
- anIOR->SetValue(theIOR);
+ anIOR->SetValue(theIOR);
}
if (strcmp(theName, "") != 0) {
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
_PTR(AttributeName) aName (anAttr);
- aName->SetValue(theName);
+ aName->SetValue(theName);
}
if (strcmp(thePersistentRef, "") != 0) {
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePersistentRef");
_PTR(AttributePersistentRef) aPRef (anAttr);
- aPRef->SetValue(thePersistentRef);
+ aPRef->SetValue(thePersistentRef);
}
if (strcmp(theComment, "") != 0) {
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment");
aStudyBuilder->Addreference(anObj, newObj);
}
string aRet = newObj->GetID();
- if (MYDEBUG)
+ if (MYDEBUG)
INFOS("CreateAttributes - StudyId = " << theStudyDocument->StudyId()
<< "; anEntry = " << aRet << "; IOR = '" << theIOR << "'");
return aRet;
return study->FindObjectID( obj->GetID() );
}
+
+
+ void RemoveFromStudy (SALOMEDS::SObject_ptr theSObject,
+ bool theIsAttrOnly,
+ bool theDestroySubObjects)
+ {
+ if (theSObject->_is_nil()) return;
+
+ SALOMEDS::Study_var aStudyDocument = theSObject->GetStudy();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudyDocument->NewBuilder();
+ if (theIsAttrOnly) {
+ aStudyBuilder->RemoveAttribute(theSObject,"AttributeIOR");
+ return;
+ }
+
+ // Remove possible sub-objects
+ SALOMEDS::ChildIterator_var aChildIter = aStudyDocument->NewChildIterator(theSObject);
+ for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
+ SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
+ CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject);
+ if (CORBA::is_nil(aChildObj)) continue;
+
+ VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(aChildObj);
+ if (CORBA::is_nil(aRemovableObject)) continue;
+
+ aRemovableObject->RemoveFromStudy();
+
+ // Destroy
+ if (theDestroySubObjects) {
+ VISU::Prs3d_var aPrs3d = VISU::Prs3d::_narrow(aRemovableObject);
+ if (CORBA::is_nil(aPrs3d)) continue;
+ aPrs3d->Destroy();
+ }
+ }
+
+ // Remove the SObject itself
+ aStudyBuilder->RemoveObjectWithChildren(theSObject);
+ }
+
+ void RemoveFromStudy (_PTR(SObject) theSObject,
+ bool theIsAttrOnly,
+ bool theDestroySubObjects)
+ {
+ if (!theSObject) return;
+
+ _PTR(Study) aStudyDocument = theSObject->GetStudy();
+ _PTR(StudyBuilder) aStudyBuilder = aStudyDocument->NewBuilder();
+ if (theIsAttrOnly) {
+ aStudyBuilder->RemoveAttribute(theSObject,"AttributeIOR");
+ return;
+ }
+
+ // Remove possible sub-objects
+ _PTR(ChildIterator) aChildIter = aStudyDocument->NewChildIterator(theSObject);
+ for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
+ _PTR(SObject) aChildSObject = aChildIter->Value();
+ CORBA::Object_var aChildObj = VISU::ClientSObjectToObject(aChildSObject);
+ if (CORBA::is_nil(aChildObj)) continue;
+
+ VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(aChildObj);
+ if (CORBA::is_nil(aRemovableObject)) continue;
+
+ aRemovableObject->RemoveFromStudy();
+
+ // Destroy
+ if (theDestroySubObjects) {
+ VISU::Prs3d_var aPrs3d = VISU::Prs3d::_narrow(aRemovableObject);
+ if (CORBA::is_nil(aPrs3d)) continue;
+ aPrs3d->Destroy();
+ }
+ }
+
+ // Remove the SObject itself
+ aStudyBuilder->RemoveObjectWithChildren(theSObject);
+ }
}
#ifndef __VISU_CONFIG_H__
#define __VISU_CONFIG_H__
-// standard C++ headers
-#include <stdio.h>
-#include <iostream>
-
-#include <map>
-#include <string>
-
-#include <qstring.h>
-#include <qthread.h>
-#include <qfileinfo.h>
-#include <qapplication.h>
-
// IDL headers
#include "SALOMEconfig.h"
#include CORBA_SERVER_HEADER(VISU_Gen)
#include CORBA_SERVER_HEADER(MED)
#include CORBA_SERVER_HEADER(SALOMEDS)
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
+
#include "SALOME_NamingService.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
#include "Utils_CorbaException.hxx"
#include <SALOMEDSClient_SObject.hxx>
#include <SALOMEDSClient_Study.hxx>
-#include <stdexcept>
+// QT headers
+#include <qstring.h>
+#include <qthread.h>
+#include <qfileinfo.h>
+#include <qapplication.h>
+
+// standard C++ headers
+#include <stdio.h>
+
+// STL headers
+#include <map>
+#include <string>
#include <sstream>
+#include <iostream>
+#include <stdexcept>
class SUIT_Session;
class SUIT_ResourceMgr;
std::string FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument, const char* theStartEntry,
const char* theComment, int IsAllLevels = true);
- SALOMEDS::SObject_var GetSObject( _PTR(SObject) );
- _PTR(SObject) GetClientSObject( SALOMEDS::SObject_var, _PTR(Study) );
- SALOMEDS::Study_var GetDSStudy( _PTR(Study) );
+ SALOMEDS::SObject_var GetSObject(_PTR(SObject));
+ _PTR(SObject) GetClientSObject(SALOMEDS::SObject_var, _PTR(Study));
+
+ SALOMEDS::Study_var GetDSStudy(_PTR(Study));
+
+ void RemoveFromStudy(SALOMEDS::SObject_ptr theSObject,
+ bool theIsAttrOnly = true,
+ bool theDestroySubObjects = false);
+ void RemoveFromStudy(_PTR(SObject) theSObject,
+ bool theIsAttrOnly = true,
+ bool theDestroySubObjects = false);
}
#endif
return aResult;
}
-void VISU::RemoveFromStudy (SALOMEDS::SObject_ptr theSObject,
- bool theIsAttrOnly,
- bool theDestroySubObjects)
-{
- if (theSObject->_is_nil()) return;
-
- SALOMEDS::Study_var aStudyDocument = theSObject->GetStudy();
- SALOMEDS::StudyBuilder_var aStudyBuilder = aStudyDocument->NewBuilder();
- if (theIsAttrOnly) {
- aStudyBuilder->RemoveAttribute(theSObject,"AttributeIOR");
- return;
- }
-
- // Remove possible sub-objects
- SALOMEDS::ChildIterator_var aChildIter = aStudyDocument->NewChildIterator(theSObject);
- for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
- SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
- CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject);
- if (CORBA::is_nil(aChildObj)) continue;
-
- VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(aChildObj);
- if (CORBA::is_nil(aRemovableObject)) continue;
-
- aRemovableObject->RemoveFromStudy();
-
- // Destroy
- if (theDestroySubObjects) {
- VISU::Prs3d_var aPrs3d = VISU::Prs3d::_narrow(aRemovableObject);
- if (CORBA::is_nil(aPrs3d)) continue;
- aPrs3d->Destroy();
- }
- }
-
- // Remove the SObject itself
- aStudyBuilder->RemoveObjectWithChildren(theSObject);
-}
-
QString GenerateName(const char* theName){
typedef map<string,int> TNameMap;
static TNameMap aMap;
};
Result_var FindResult(SALOMEDS::SObject_ptr theSObject);
- void RemoveFromStudy(SALOMEDS::SObject_ptr theSObject,
- bool theIsAttrOnly = true,
- bool theDestroySubObjects = false);
}
#endif