using namespace std;
-//extern VisuGUI *visuGUI;
static VisuGUI_SelectionDlg* mySelectionDlg = NULL;
VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (QWidget* parent)
WStyle_Title | WStyle_SysMenu | WDestructiveClose),
mySelectionMgr(NULL)
{
- //MESSAGE("VisuGUI_SelectionDlg::VisuGUI_SelectionDlg()");
if (mySelectionDlg)
mySelectionDlg->close(true);
VisuGUI_SelectionDlg::~VisuGUI_SelectionDlg()
{
- //MESSAGE("VisuGUI_SelectionDlg::~VisuGUI_SelectionDlg()");
}
void VisuGUI_SelectionDlg::onSelectionChange (int theId)
{
- //MESSAGE("VisuGUI_SelectionDlg::onSelectionChange()");
SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
switch (theId) {
case 0: // Points
myWidgetStack->raiseWidget(myPointsPane);
- //mySelectionMgr->setSelectionModes(NodeSelection);
aSVTKVW->SetSelectionMode(NodeSelection);
onPointIdEdit(myIDValLbl->text());
break;
case 1: // Cells
myWidgetStack->raiseWidget(myCellsPane);
- //mySelectionMgr->setSelectionModes(CellSelection);
aSVTKVW->SetSelectionMode(CellSelection);
onCellIdEdit(myCellIDValLbl->text());
break;
case 2: // Actor
myWidgetStack->raiseWidget(myActorsPane);
- //mySelectionMgr->setSelectionModes(ActorSelection);
aSVTKVW->SetSelectionMode(ActorSelection);
onSelectionEvent();
}
void VisuGUI_SelectionDlg::closeEvent (QCloseEvent* theEvent)
{
- //MESSAGE("VisuGUI_SelectionDlg::closeEvent()");
SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
mySelectionDlg = NULL;
- //mySelectionMgr->setSelectionModes(ActorSelection);
aSVTKVW->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr,0,0,0);
QDialog::closeEvent(theEvent);
#define ABS(a) (a>=0)?a:-a
void VisuGUI_SelectionDlg::onSelectionEvent() {
- //MESSAGE("VisuGUI_SelectionDlg::onSelectionEvent()");
if (myFl) return;
myFl = true;
int aType = myWidgetStack->id(myWidgetStack->visibleWidget());
_PTR(SObject) aSObject;
Handle(SALOME_InteractiveObject) anIO;
- //SALOME_ListIO aListIO;
- //mySelectionMgr->selectedObjects(aListIO, SVTK_Viewer::Type());
+ SALOME_ListIO aListIO;
+ mySelectionMgr->selectedObjects(aListIO, SVTK_Viewer::Type());
- const SALOME_ListIO& aListIO = aSelector->StoredIObjects();
-
- //MESSAGE("aListIO.Extent() = " << aListIO.Extent());
if (aListIO.Extent() == 1) {
anIO = aListIO.First();
SalomeApp_Study* theStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy());
_PTR(Study) aStudy = theStudy->studyDS();
aSObject = aStudy->FindObjectID(anIO->getEntry());
- //MESSAGE("anIO->hasEntry(): " << anIO->getEntry());
if (aSObject) {
CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
void VisuGUI_SelectionDlg::clearFields() {
- //MESSAGE("VisuGUI_SelectionDlg::clearFields()");
int aType = myWidgetStack->id(myWidgetStack->visibleWidget());
switch (aType) {
case 0:
QString theValue,
QLabel* theFieldName)
{
- //MESSAGE("onIdEdit()");
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
(SUIT_Session::session()->activeApplication());
SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
VISU::Prs3d_i* aPrs3d = NULL;
Handle(SALOME_InteractiveObject) anIO;
- //SALOME_ListIO aListIO;
- //theSelectionMgr->selectedObjects(aListIO, SVTK_Viewer::Type());
-
- const SALOME_ListIO& aListIO = aSelector->StoredIObjects();
+ SALOME_ListIO aListIO;
+ theSelectionMgr->selectedObjects(aListIO, SVTK_Viewer::Type());
if (aListIO.Extent() == 1) {
anIO = aListIO.First();
if (anId < 0) anId = 0;
if (anId >= aMaxId) anId = aMaxId - 1;
- //SALOME_ListIO sel;
- //sel.Append(anIO);
- //theSelectionMgr->setSelectedObjects(sel);
-
TColStd_MapOfInteger newIndices;
newIndices.Add(anId);
aSelector->AddOrRemoveIndex(anIO, newIndices, false);
void VisuGUI_SelectionDlg::onPointIdEdit (const QString& theText)
{
- //MESSAGE("onPointIdEdit()");
if (myFl) return;
TDataSetMethod aMethod = &vtkDataSet::GetNumberOfPoints;
bool anIsSelected = onIdEdit(theText,aMethod,false,mySelectionMgr,
void VisuGUI_SelectionDlg::onCellIdEdit (const QString& theText)
{
- //MESSAGE("onCellIdEdit()");
if (myFl) return;
TDataSetMethod aMethod = &vtkDataSet::GetNumberOfCells;
bool anIsSelected = onIdEdit(theText,aMethod,true,mySelectionMgr,