Back to index

salome-geom  6.5.0
Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes
EntityGUI_SubShapeDlg Class Reference

#include <EntityGUI_SubShapeDlg.h>

List of all members.

Public Member Functions

 EntityGUI_SubShapeDlg (GeometryGUI *, QWidget *=0, bool=false, Qt::WindowFlags=0)
 ~EntityGUI_SubShapeDlg ()

Protected Member Functions

virtual GEOM::GEOM_IOperations_ptr createOperation ()
virtual bool isValid (QString &)
virtual bool execute (ObjectList &)
virtual GEOM::GEOM_Object_ptr getFather (GEOM::GEOM_Object_ptr)
virtual QString getNewObjectName () const
void closeEvent (QCloseEvent *)

Private Slots

void ClickOnOk ()
bool ClickOnApply ()
void ActivateThisDialog ()
void LineEditReturnPressed ()
void SelectionIntoArgument ()
void SetEditCurrentArgument ()
void SubShapeToggled ()
void ComboTextChanged ()
void showOnlySelected ()

Private Member Functions

void Init ()
void enterEvent (QEvent *)
void ResetStateOfDialog ()
unsigned int NumberOfSubShapes (const TopoDS_Shape &, const int) const
void activateSelection ()
int getSelectedSubshapes (TColStd_IndexedMapOfInteger &theMapIndex)
void updateButtonState ()
bool isAllSubShapes () const
int shapeType () const

Private Attributes

TopoDS_Shape myShape
GEOM::GEOM_Object_var myObject
bool myWithShape
bool myIsHiddenMain
DlgRef_1Sel1List1Check3Btn * GroupPoints

Detailed Description

Definition at line 40 of file EntityGUI_SubShapeDlg.h.


Constructor & Destructor Documentation

EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg ( GeometryGUI *  theGeometryGUI,
QWidget *  parent = 0,
bool  modal = false,
Qt::WindowFlags  fl = 0 
)

Definition at line 65 of file EntityGUI_SubShapeDlg.cxx.

  : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
    myWithShape(true),
    myIsHiddenMain(false)
{
  QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_SUBSHAPE")));
  QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));

  setWindowTitle(tr("GEOM_SUBSHAPE_TITLE"));

  /***************************************************************/
  mainFrame()->GroupConstructors->setTitle(tr("GEOM_SUB_SHAPE"));
  mainFrame()->RadioButton1->setIcon(image0);
  mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose);
  mainFrame()->RadioButton2->close();
  mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
  mainFrame()->RadioButton3->close();

  GroupPoints = new DlgRef_1Sel1List1Check3Btn(centralWidget());

  GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
  GroupPoints->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
  GroupPoints->TextLabel2->setText(tr("GEOM_SUBSHAPE_TYPE"));
  GroupPoints->CheckButton1->setText(tr("GEOM_SUBSHAPE_SELECT"));
  GroupPoints->PushButton1->setIcon(image1);
  GroupPoints->PushButton2->setText(tr("SHOW_ONLY_SELECTED"));
  GroupPoints->PushButton3->setText(tr("HIDE_SELECTED"));
  GroupPoints->PushButton4->setText(tr("SHOW_ALL_SUB_SHAPES"));
  GroupPoints->LineEdit1->setReadOnly(true);

  QVBoxLayout* layout = new QVBoxLayout(centralWidget());
  layout->setMargin(0); layout->setSpacing(6);
  layout->addWidget(GroupPoints);
  /***************************************************************/

  setIsOptimizedBrowsing(true);

  setHelpFileName("create_explode_page.html");

  mainFrame()->GroupBoxName->hide();

  Init();
}

Here is the call graph for this function:

Definition at line 114 of file EntityGUI_SubShapeDlg.cxx.

{
  if (myIsHiddenMain) {
    GEOM_Displayer* aDisplayer = getDisplayer();
    aDisplayer->Display(myObject);
    myIsHiddenMain = false;
  }
}

Member Function Documentation

Definition at line 670 of file EntityGUI_SubShapeDlg.cxx.

{
  bool isApply = ((QPushButton*)sender() == buttonApply());
  
  if(!isApply)
    erasePreview(false);

  // local selection
  if (!myObject->_is_nil() && !isAllSubShapes())
  {
    GEOM_Displayer* aDisplayer = getDisplayer();

    // Mantis issue 0021421: do not hide main shape, if explode on VERTEX
    if ((TopAbs_ShapeEnum)shapeType() == TopAbs_VERTEX) {
      if (myIsHiddenMain)
        aDisplayer->Display(myObject);
    }
    else {
      SALOME_View* view = GEOM_Displayer::GetActiveView();
      if (view) {
        CORBA::String_var aMainEntry = myObject->GetStudyEntry();
        Handle(SALOME_InteractiveObject) io =
          new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO");
        if (view->isVisible(io)) {
          aDisplayer->Erase(myObject, false, false);
          myIsHiddenMain = true;
        }
      }
    }

    if(!isApply) {
      int prevDisplayMode = aDisplayer->SetDisplayMode(0);

      SUIT_ViewWindow* aViewWindow = 0;
      SUIT_Study* activeStudy = SUIT_Session::session()->activeApplication()->activeStudy();
      if (activeStudy)
        aViewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
      if (aViewWindow == 0) return;

      SUIT_ViewManager* aViewManager = aViewWindow->getViewManager();
      if (aViewManager->getType() != OCCViewer_Viewer::Type() &&
          aViewManager->getType() != SVTK_Viewer::Type())
        return;

      SUIT_ViewModel* aViewModel = aViewManager->getViewModel();
      SALOME_View* aView = dynamic_cast<SALOME_View*>(aViewModel);
      if (aView == 0) return;

      //TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myObject);

      TopTools_IndexedMapOfShape aSubShapesMap;
      TopExp::MapShapes(myShape, aSubShapesMap);
      CORBA::String_var aMainEntry = myObject->GetStudyEntry();
      QString anEntryBase = aMainEntry.in();

      TopExp_Explorer anExp (myShape, (TopAbs_ShapeEnum)shapeType());
      for (; anExp.More(); anExp.Next())
      {
        TopoDS_Shape aSubShape = anExp.Current();
        int index = aSubShapesMap.FindIndex(aSubShape);
        QString anEntry = anEntryBase + QString("_%1").arg(index);

        SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, aView);
        if (aPrs) {
          displayPreview(aPrs, true, false); // append, do not update
        }
      }
      aDisplayer->UpdateViewer();
      aDisplayer->SetDisplayMode(prevDisplayMode);
    }
  }

  globalSelection(GEOM_ALLSHAPES);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 188 of file EntityGUI_SubShapeDlg.cxx.

{
  GEOMBase_Skeleton::ActivateThisDialog();
  connect(myGeomGUI->getApp()->selectionMgr(),
           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
  SubShapeToggled();
  updateButtonState();
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool EntityGUI_SubShapeDlg::ClickOnApply ( ) [private, slot]

Definition at line 244 of file EntityGUI_SubShapeDlg.cxx.

{
  SUIT_Session::session()->activeApplication()->putInfo("");

  /* Explode all sub-shapes */
  if (isAllSubShapes()) {
    /* More than 30 sub-shapes : ask confirmation */
    unsigned int nb = NumberOfSubShapes(myShape, shapeType());
    if (nb > 30) {
      const QString caption = tr("GEOM_CONFIRM");
      const QString text = tr("GEOM_CONFIRM_INFO").arg(nb);
      const QString button0 = tr("GEOM_BUT_EXPLODE");
      const QString button1 = tr("GEOM_BUT_CANCEL");

      if (QMessageBox::warning(this, caption, text, button0, button1) != 0)
        return false;  /* aborted */
    }
  }
  
  setIsDisableBrowsing( true );
  bool isOk = onAccept( true, true, false );
  setIsDisableBrowsing( false );

  // restore selection, corresponding to current selection mode
  SubShapeToggled();

  return isOk;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void EntityGUI_SubShapeDlg::ClickOnOk ( ) [private, slot]

Definition at line 211 of file EntityGUI_SubShapeDlg.cxx.

{
  setIsApplyAndClose(true);

  SUIT_Session::session()->activeApplication()->putInfo("");

  /* Explode all sub-shapes */
  bool isOk = true;
  if (isAllSubShapes()) {
    /* More than 30 sub-shapes : ask confirmation */
    unsigned int nb = NumberOfSubShapes(myShape, shapeType());
    if (nb > 30) {
      const QString caption = tr("GEOM_CONFIRM");
      const QString text = tr("GEOM_CONFIRM_INFO").arg(nb);
      const QString button0 = tr("GEOM_BUT_EXPLODE");
      const QString button1 = tr("GEOM_BUT_CANCEL");

      if (QMessageBox::warning(this, caption, text, button0, button1) != 0)
        isOk = false;  /* aborted */
    }
  }

  if (isOk)
    isOk = onAccept();

  if (isOk)
    ClickOnCancel();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void EntityGUI_SubShapeDlg::closeEvent ( QCloseEvent *  e) [protected]

Definition at line 201 of file EntityGUI_SubShapeDlg.cxx.

{
  erasePreview(true);
  GEOMBase_Skeleton::closeEvent(e);
}
void EntityGUI_SubShapeDlg::ComboTextChanged ( ) [private, slot]

Definition at line 465 of file EntityGUI_SubShapeDlg.cxx.

{
  /* Select sub-shapes mode not checked */
  updateButtonState();
  SubShapeToggled();
}

Here is the call graph for this function:

Here is the caller graph for this function:

GEOM::GEOM_IOperations_ptr EntityGUI_SubShapeDlg::createOperation ( ) [protected, virtual]

Definition at line 749 of file EntityGUI_SubShapeDlg.cxx.

{
  return getGeomEngine()->GetIShapesOperations(getStudyId());
}
void EntityGUI_SubShapeDlg::enterEvent ( QEvent *  ) [private]

Definition at line 178 of file EntityGUI_SubShapeDlg.cxx.

{
  if (!mainFrame()->GroupConstructors->isEnabled())
    ActivateThisDialog();
}

Here is the call graph for this function:

bool EntityGUI_SubShapeDlg::execute ( ObjectList objects) [protected, virtual]

Definition at line 785 of file EntityGUI_SubShapeDlg.cxx.

{
  GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());

  if (!isAllSubShapes()) {
    // manual selection
    TColStd_IndexedMapOfInteger aMapIndex;
    int nbSel = getSelectedSubshapes(aMapIndex);

    if (nbSel > 0) {
      int i;

      GEOM::ListOfLong_var anArray = new GEOM::ListOfLong;
      anArray->length(nbSel);

      for (i = 1; i <= nbSel; i++)
        anArray[i - 1] = aMapIndex.FindKey(i);

      GEOM::ListOfGO_var aList = anOper->MakeSubShapes(myObject, anArray);
      int n = aList->length();
      for (i = 0; i < n; i++)
        objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
    }
  }
  else {
    GEOM::ListOfGO_var aList = anOper->ExtractSubShapes(myObject, shapeType(), true);
    if (!aList->length())
      return false;
    for (int i = 0, n = aList->length(); i < n; i++)
      objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
  }

  return objects.size();
}

Here is the call graph for this function:

GEOM::GEOM_Object_ptr EntityGUI_SubShapeDlg::getFather ( GEOM::GEOM_Object_ptr  ) [protected, virtual]

Definition at line 825 of file EntityGUI_SubShapeDlg.cxx.

{
  return myObject;
}
QString EntityGUI_SubShapeDlg::getNewObjectName ( ) const [protected, virtual]

Definition at line 834 of file EntityGUI_SubShapeDlg.cxx.

{
  return QString::null;
}
int EntityGUI_SubShapeDlg::getSelectedSubshapes ( TColStd_IndexedMapOfInteger &  theMapIndex) [private]

Definition at line 605 of file EntityGUI_SubShapeDlg.cxx.

{
  theMapIndex.Clear();

  SalomeApp_Application* app = myGeomGUI->getApp();
  if (!app || myObject->_is_nil())
    return 0;

  LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
  SALOME_ListIO aSelList;
  aSelMgr->selectedObjects(aSelList);

  // try to find out and process the global selection
  // (of not published objects and of published sub-shapes)
  {
    SALOME_ListIteratorOfListIO anIter (aSelList);
    for (int i = 0; anIter.More(); anIter.Next(), i++)
    {
      Handle(SALOME_InteractiveObject) anIObj = anIter.Value();
      QString anEntry = anIObj->getEntry();
      QString str = "_";
      int index = anEntry.lastIndexOf(str);
      if (index > 0) // selection among special preview
      {
        anEntry.remove(0, index+1);
        int anIndex = anEntry.toInt();
        if (anIndex)
          theMapIndex.Add(anIndex);
      }
      else // selection among published shapes
      {
        SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
        if (!appStudy) return 0;
        _PTR(Study) aStudy = appStudy->studyDS();

        _PTR(SObject) aSObj (aStudy->FindObjectID(anEntry.toLatin1().constData()));
        GEOM::GEOM_Object_var aGeomObj =
          GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aSObj));
        TopoDS_Shape aShape;
        if (GEOMBase::GetShape(aGeomObj, aShape)) {
          if (aGeomObj->GetType() == GEOM_GROUP || aShape.ShapeType() == (TopAbs_ShapeEnum)shapeType()) {
            TopTools_IndexedMapOfShape aMainMap;
            TopExp::MapShapes(myShape, aMainMap);

            TopExp_Explorer anExp (aShape, (TopAbs_ShapeEnum)shapeType());
            for (; anExp.More(); anExp.Next()) {
              TopoDS_Shape aSubShape = anExp.Current();
              int anIndex = aMainMap.FindIndex(aSubShape);
              if (anIndex >= 0) {
                theMapIndex.Add(anIndex);
              }
            }
          }
        }
      }
    } // for aSelList
  }

  return theMapIndex.Extent();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void EntityGUI_SubShapeDlg::Init ( ) [private]

Definition at line 127 of file EntityGUI_SubShapeDlg.cxx.

{
  /* init variables */
  myEditCurrentArgument = GroupPoints->LineEdit1;
  myObject = GEOM::GEOM_Object::_nil();

  myWithShape = true;

  /* type for sub-shape selection */
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Compound");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Compsolid");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Solid");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Shell");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Face");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Wire");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Edge");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Vertex");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Shape");

  if (SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType()
      != OCCViewer_Viewer::Type())
    GroupPoints->CheckButton1->setEnabled(false);

  /* signals and slots connections */
  connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));

  connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
  connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));

  connect(GroupPoints->PushButton1,  SIGNAL(clicked()),       this, SLOT(SetEditCurrentArgument()));
  connect(GroupPoints->LineEdit1,    SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));

  connect(GroupPoints->ComboBox1,    SIGNAL(activated(int)),    this, SLOT(ComboTextChanged()));
  connect(GroupPoints->CheckButton1, SIGNAL(stateChanged(int)), this, SLOT(SubShapeToggled()));

  connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(showOnlySelected()));
  connect(GroupPoints->PushButton3, SIGNAL(clicked()), this, SLOT(showOnlySelected()));
  connect(GroupPoints->PushButton4, SIGNAL(clicked()), this, SLOT(showOnlySelected()));

  connect(myGeomGUI->getApp()->selectionMgr(),
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));

  updateButtonState();
  resize(100,100);
  SelectionIntoArgument();
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool EntityGUI_SubShapeDlg::isAllSubShapes ( ) const [private]

Definition at line 531 of file EntityGUI_SubShapeDlg.cxx.

{
  return !GroupPoints->CheckButton1->isChecked() || !GroupPoints->CheckButton1->isEnabled();
}

Here is the caller graph for this function:

bool EntityGUI_SubShapeDlg::isValid ( QString &  msg) [protected, virtual]

Definition at line 758 of file EntityGUI_SubShapeDlg.cxx.

{
  bool isOk = false;

  if (myObject->_is_nil()) {
    updateButtonState();
    return isOk;
  }

  if (isAllSubShapes())
    isOk = true;
  else {
    TColStd_IndexedMapOfInteger aMapIndex;
    int nbSel = getSelectedSubshapes(aMapIndex);
    isOk = nbSel > 0;

    if (!isOk)
      msg += tr("NO_SUBSHAPES_SELECTED");
  }

  return isOk;
}

Here is the call graph for this function:

Definition at line 394 of file EntityGUI_SubShapeDlg.cxx.

{
  QLineEdit* send = (QLineEdit*)sender();
  if (send == GroupPoints->LineEdit1)
    SetEditCurrentArgument();
  else
    return;

  GEOMBase_Skeleton::LineEditReturnPressed();
}

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int EntityGUI_SubShapeDlg::NumberOfSubShapes ( const TopoDS_Shape &  S,
const int  shapeType 
) const [private]

Definition at line 476 of file EntityGUI_SubShapeDlg.cxx.

{
  if (S.IsNull())
    return 0;

  unsigned int index = 0;
  TopTools_MapOfShape M;

  if (S.ShapeType() == TopAbs_COMPOUND &&
       (TopAbs_ShapeEnum(shapeType) == TopAbs_SHAPE ||
         TopAbs_ShapeEnum(shapeType) == TopAbs_COMPSOLID ||
         TopAbs_ShapeEnum(shapeType) == TopAbs_COMPOUND)) {
    TopoDS_Iterator It(S, Standard_True, Standard_True);
    for (; It.More(); It.Next()) {
      if (M.Add(It.Value())) {
        if (TopAbs_ShapeEnum(shapeType) == TopAbs_SHAPE ||
             TopAbs_ShapeEnum(shapeType) == It.Value().ShapeType()) {
          index++;
        }
      }
    }
  }
  else {
    TopExp_Explorer Exp (S, TopAbs_ShapeEnum(shapeType));
    for (; Exp.More(); Exp.Next()) {
      if (M.Add(Exp.Current())) {
        index++;
      }
    }
  }

  M.Clear();
  return index;
}

Here is the caller graph for this function:

Definition at line 409 of file EntityGUI_SubShapeDlg.cxx.

{
  if (myIsHiddenMain) {
    GEOM_Displayer* aDisplayer = getDisplayer();
    aDisplayer->Display(myObject);
    myIsHiddenMain = false;
  }
  myObject = GEOM::GEOM_Object::_nil();
  myShape.Nullify();
  myEditCurrentArgument->setText("");

  int SelectedShapeType = GroupPoints->ComboBox1->currentIndex();
  int count = GroupPoints->ComboBox1->count();
  if (myWithShape)
    count = count - 1;

  /* type for sub-shape selection */
  GroupPoints->ComboBox1->clear();
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Compound");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Compsolid");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Solid");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Shell");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Face");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Wire");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Edge");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Vertex");
  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Shape");

  myWithShape = true;

  GroupPoints->ComboBox1->setCurrentIndex(8 - count + SelectedShapeType);

  // to avoid recursion: SelectionIntoArgument->ResetStateOfDialog->ComboTextChanged->SubShapeToggled->activateSelection->(currentSelectionChanged)->SelectionIntoArgument
  //ComboTextChanged();

  updateButtonState();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 277 of file EntityGUI_SubShapeDlg.cxx.

{
  if (!isAllSubShapes())
    return;

  ResetStateOfDialog();

  QString aString = ""; /* name of selection */

  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
  SALOME_ListIO aSelList;
  aSelMgr->selectedObjects(aSelList);

  int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
  if (nbSel != 1)
    return;

  Handle(SALOME_InteractiveObject) IO = aSelList.First();
  if (!IO->hasEntry()) {
    SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
    updateButtonState();
    return;
  }

  if (myIsHiddenMain) {
    GEOM_Displayer* aDisplayer = getDisplayer();
    aDisplayer->Display(myObject);
    myIsHiddenMain = false;
  }

  TopoDS_Shape S = GEOMBase::GetTopoFromSelection(aSelList);
  if (S.IsNull() || S.ShapeType() == TopAbs_VERTEX) {
    myObject = GEOM::GEOM_Object::_nil();
    updateButtonState();
    return;
  }

  myObject = GEOMBase::ConvertIOinGEOMObject(IO);
  if (myObject->_is_nil()) {
    updateButtonState();
    return;
  }

  myShape = S;
  GroupPoints->LineEdit1->setText(aString);

  int SelectedShapeType = GroupPoints->ComboBox1->currentIndex();
  int count = GroupPoints->ComboBox1->count();

  if (myWithShape)
    count = count - 1;

  int i = 0;
  // Solving PAL5590
  if (myShape.ShapeType() == TopAbs_COMPOUND) {
    unsigned int nb = NumberOfSubShapes(myShape, TopAbs_COMPOUND);
    if (nb > 0)
      i++;
  }
  while (i <= myShape.ShapeType()) {
    GroupPoints->ComboBox1->removeItem(0);
    i++;
  }

  if (myShape.ShapeType() == TopAbs_COMPOUND) {
    if (myWithShape == false) {
      GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Shape");
      myWithShape = true;
    }
  }
  else {
    if (myWithShape == true) {
      GroupPoints->ComboBox1->removeItem(GroupPoints->ComboBox1->count() - 1);
      myWithShape = false;
    }
  }

  int count1 = GroupPoints->ComboBox1->count();
  if (myWithShape)
    count1 = count1 - 1;

  if (SelectedShapeType > myShape.ShapeType()) {
    if (SelectedShapeType == 8) {
      if (myShape.ShapeType() != TopAbs_COMPOUND) {
        GroupPoints->ComboBox1->setCurrentIndex(0);
        ComboTextChanged();
      }
    }
    else
      GroupPoints->ComboBox1->setCurrentIndex(count1 - count + SelectedShapeType);
  }
  else {
    GroupPoints->ComboBox1->setCurrentIndex(0);
    ComboTextChanged();
  }

  updateButtonState();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 380 of file EntityGUI_SubShapeDlg.cxx.

{
  GroupPoints->LineEdit1->setFocus();
  myEditCurrentArgument = GroupPoints->LineEdit1;

  GroupPoints->CheckButton1->setChecked(false);
  SubShapeToggled();
  SelectionIntoArgument();
}

Here is the call graph for this function:

Here is the caller graph for this function:

int EntityGUI_SubShapeDlg::shapeType ( ) const [private]

Definition at line 540 of file EntityGUI_SubShapeDlg.cxx.

{
  int type = GroupPoints->ComboBox1->currentIndex();

  if (myObject->_is_nil())
    return type;

  // Solving PAL5590
  type += myShape.ShapeType() + 1;
  if (myShape.ShapeType() == TopAbs_COMPOUND &&
      NumberOfSubShapes(myShape, TopAbs_COMPOUND) > 0) {
    type--;
  }

  return type;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void EntityGUI_SubShapeDlg::showOnlySelected ( ) [private, slot]

Definition at line 561 of file EntityGUI_SubShapeDlg.cxx.

{
  if (CORBA::is_nil(myObject) || isAllSubShapes())
    return;

  QPushButton* send = (QPushButton*)sender();
  if (send == GroupPoints->PushButton4) {
    activateSelection();
    return;
  }

  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
  SALOME_ListIO aSelList;
  aSelMgr->selectedObjects(aSelList);

  GEOM_Displayer* aDisplayer = getDisplayer();

  if (send == GroupPoints->PushButton3) {
    aDisplayer->Erase(aSelList, /*forced=*/false, /*updateViewer=*/true);
  }
  else {
    // Mantis issue 0021421: do not hide main shape, if explode on VERTEX
    SALOME_View* view = GEOM_Displayer::GetActiveView();
    if (view) {
      CORBA::String_var aMainEntry = myObject->GetStudyEntry();
      Handle(SALOME_InteractiveObject) io =
        new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO");
      if (view->isVisible(io)) myIsHiddenMain = true;
    }

    aDisplayer->EraseAll(/*forced = false, updateViewer = true*/);
    aDisplayer->Display(aSelList, true);

    // Mantis issue 0021421: do not hide main shape, if explode on VERTEX
    if ((TopAbs_ShapeEnum)shapeType() == TopAbs_VERTEX && myIsHiddenMain) {
      aDisplayer->Display(myObject);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void EntityGUI_SubShapeDlg::SubShapeToggled ( ) [private, slot]

Definition at line 452 of file EntityGUI_SubShapeDlg.cxx.

{
  GroupPoints->PushButton2->setEnabled(!isAllSubShapes());
  GroupPoints->PushButton3->setEnabled(!isAllSubShapes());
  GroupPoints->PushButton4->setEnabled(!isAllSubShapes());

  activateSelection();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 516 of file EntityGUI_SubShapeDlg.cxx.

{
  if (SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType() != OCCViewer_Viewer::Type() ||
      myObject->_is_nil() || shapeType() == TopAbs_SHAPE || shapeType() == TopAbs_COMPOUND) {
    GroupPoints->CheckButton1->setChecked(false);
    GroupPoints->CheckButton1->setEnabled(false);
  }
  else
    GroupPoints->CheckButton1->setEnabled(true);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

DlgRef_1Sel1List1Check3Btn* EntityGUI_SubShapeDlg::GroupPoints [private]

Definition at line 93 of file EntityGUI_SubShapeDlg.h.

Definition at line 91 of file EntityGUI_SubShapeDlg.h.

GEOM::GEOM_Object_var EntityGUI_SubShapeDlg::myObject [private]

Definition at line 87 of file EntityGUI_SubShapeDlg.h.

TopoDS_Shape EntityGUI_SubShapeDlg::myShape [private]

Definition at line 86 of file EntityGUI_SubShapeDlg.h.

Definition at line 89 of file EntityGUI_SubShapeDlg.h.


The documentation for this class was generated from the following files: