]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
Merge branch 'omu/update_doc'
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Fri, 5 Sep 2014 14:11:54 +0000 (16:11 +0200)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Fri, 5 Sep 2014 14:11:54 +0000 (16:11 +0200)
* omu/update_doc:
  Update YACSGEN doc in order to consider the new cmake support.
  More documentation about the OptimizerLoop.
  New complete example of OptimizerLoop plugin.
  Clarify the differencies between edAddLink and edAddDFLink
  Bugfix in the documentation example to creat a YACS schema with the python API.
  Documentation about loading the module catalog.
  Documentation about loading the module catalog.

33 files changed:
CMakeLists.txt
doc/operations.rst
doc/representation.rst
src/engine/DynParaLoop.cxx
src/engine/DynParaLoop.hxx
src/engine/ForEachLoop.cxx
src/genericgui/CatalogWidget.cxx
src/genericgui/GenericGui.cxx
src/genericgui/GenericGui.hxx
src/genericgui/GuiEditor.cxx
src/genericgui/GuiEditor.hxx
src/genericgui/Menus.cxx
src/genericgui/SceneComposedNodeItem.cxx
src/genericgui/SceneComposedNodeItem.hxx
src/genericgui/SceneElementaryNodeItem.cxx
src/genericgui/SceneElementaryNodeItem.hxx
src/genericgui/SceneItem.cxx
src/genericgui/SceneItem.hxx
src/genericgui/SceneNodeItem.cxx
src/genericgui/SceneNodeItem.hxx
src/genericgui/SceneProcItem.cxx
src/genericgui/SceneProcItem.hxx
src/salomegui/resources/SalomeApp.xml.in
src/salomegui/resources/YACS_msg_fr.ts
src/salomegui/resources/YACS_msg_ja.ts
src/salomewrap/SalomeWrap_Module.cxx
src/salomewrap/SalomeWrap_Module.hxx
src/salomewrap/SuitWrapper.cxx
src/salomewrap/SuitWrapper.hxx
src/yacsloader/loopParsers.hxx
src/yacsloader_swig/Test/CMakeLists.txt
src/yacsloader_swig/Test/StdAloneYacsLoaderTest1.py [new file with mode: 0755]
tmp_dump.py [new file with mode: 0644]

index 62e4672b7d7c9708bacdb54eb4d49fcc5a4aecba..1327b21afda3a69d8aa6d42efa7572e77ff5e4ea 100644 (file)
@@ -31,10 +31,10 @@ STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
 
 SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
 SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
-SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
+SET(${PROJECT_NAME_UC}_PATCH_VERSION 1)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
+SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
 
 # Find KERNEL (optional)
 # ==============
@@ -67,7 +67,8 @@ IF(SALOME_BUILD_GUI)
   IF(EXISTS ${GUI_ROOT_DIR})
     LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
     FIND_PACKAGE(SalomeGUI)
-    FULL_GUI(TRUE) # check whether GUI builded in full mode and with CORBA
+    SALOME_GUI_WITH_CORBA() # check whether GUI builded with CORBA
+    SALOME_GUI_MODE(SALOME_USE_QXGRAPHVIEWER) # check whether GUI is built with the QxGraphViewer
   ELSE(EXISTS ${GUI_ROOT_DIR})
     MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR or turn option SALOME_BUILD_GUI to OFF !")
   ENDIF(EXISTS ${GUI_ROOT_DIR})
index 86dd773f1802de3c897210f7155193c1f34b19fa..9b5ba35ededff5d211bc547d9ce9955c6373e532 100644 (file)
@@ -274,6 +274,14 @@ Specific operations available in the **edition mode** for each type of objects s
 |                                |             |                                                                                     |
 |                                |             |**Center on Node** - Center the 2D view on selected Node, without resizing.          |
 |                                |             |                                                                                     |
+|                                |             |**Shrink/Expand** - Fold/Unfold the selected Node. See :ref:`shrink_expand_nodes`.   |
+|                                |             |                                                                                     |
+|                                |             |**Shrink/Expand Children** - Fold/Unfold all direct Children Nodes of selected Node. |
+|                                |             |See :ref:`shrink_expand_nodes`.                                                      |
+|                                |             |                                                                                     |
+|                                |             |**Shrink/Expand Elementary** - Fold/Unfold all Elementary Nodes of selected Node     |
+|                                |             |recursively. See :ref:`shrink_expand_nodes`.                                         |
+|                                |             |                                                                                     |
 |                                |             |**Compute Links** - Recompute links, useful for large schemas, when automatic link   |
 |                                |             |calculation have been deactivated, see :ref:`edition_toolbar`.                       |
 |                                |             |                                                                                     |
@@ -324,6 +332,14 @@ Node objects.
 |                                |             |                                                                                     |
 |                                |             |**Center on Node** - Center the 2D view on selected Node, without resizing.          |
 |                                |             |                                                                                     |
+|                                |             |**Shrink/Expand** - Fold/Unfold the selected Node. See :ref:`shrink_expand_nodes`.   |
+|                                |             |                                                                                     |
+|                                |             |**Shrink/Expand Children** - Fold/Unfold all direct Children Nodes of selected Node. |
+|                                |             |See :ref:`shrink_expand_nodes`.                                                      |
+|                                |             |                                                                                     |
+|                                |             |**Shrink/Expand Elementary** - Fold/Unfold all Elementary Nodes of selected Node     |
+|                                |             |recursively. See :ref:`shrink_expand_nodes`.                                         |
+|                                |             |                                                                                     |
 |                                |             |**Compute Links** - Recompute links, useful for large schemas, when automatic link   |
 |                                |             |calculation have been deactivated, see :ref:`edition_toolbar`.                       |
 |                                |             |                                                                                     |
@@ -355,6 +371,9 @@ Node objects.
 |                                |             |the screen                                                                           |
 |                                |             |                                                                                     |
 |                                |             |**Center on Node** - Center the 2D view on selected Node, without resizing.          |
+|                                |             |                                                                                     |
+|                                |             |**Shrink/Expand** - Fold/Unfold the selected Node. See :ref:`shrink_expand_nodes`.   |
+|                                |             |                                                                                     |
 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
 
 Port and link objects.
@@ -404,6 +423,14 @@ The popup menus available on the objects selected in the Tree View or 2D View of
 |                                |             |                                                                                     |
 |                                |             |**Center on Node** - Center the 2D view on selected Node, without resizing.          |
 |                                |             |                                                                                     |
+|                                |             |**Shrink/Expand** - Fold/Unfold the selected Node. See :ref:`shrink_expand_nodes`.   |
+|                                |             |                                                                                     |
+|                                |             |**Shrink/Expand Children** - Fold/Unfold all direct Children Nodes of selected Node. |
+|                                |             |See :ref:`shrink_expand_nodes`.                                                      |
+|                                |             |                                                                                     |
+|                                |             |**Shrink/Expand Elementary** - Fold/Unfold all Elementary Nodes of selected Node     |
+|                                |             |recursively. See :ref:`shrink_expand_nodes`.                                         |
+|                                |             |                                                                                     |
 |                                |             |**Compute Links** - Recompute links, useful for large schemas, when automatic link   |
 |                                |             |calculation have been deactivated, see :ref:`edition_toolbar`.                       |
 |                                |             |                                                                                     |
@@ -425,6 +452,14 @@ The popup menus available on the objects selected in the Tree View or 2D View of
 |                                |             |                                                                                     |
 |                                |             |**Center on Node** - Center the 2D view on selected Node, without resizing.          |
 |                                |             |                                                                                     |
+|                                |             |**Shrink/Expand** - Fold/Unfold the selected Node. See :ref:`shrink_expand_nodes`.   |
+|                                |             |                                                                                     |
+|                                |             |**Shrink/Expand Children** - Fold/Unfold all direct Children Nodes of selected Node. |
+|                                |             |See :ref:`shrink_expand_nodes`.                                                      |
+|                                |             |                                                                                     |
+|                                |             |**Shrink/Expand Elementary** - Fold/Unfold all Elementary Nodes of selected Node     |
+|                                |             |recursively. See :ref:`shrink_expand_nodes`.                                         |
+|                                |             |                                                                                     |
 |                                |             |**Compute Links** - Recompute links, useful for large schemas, when automatic link   |
 |                                |             |calculation have been deactivated, see :ref:`edition_toolbar`.                       |
 |                                |             |                                                                                     |
@@ -442,6 +477,8 @@ The popup menus available on the objects selected in the Tree View or 2D View of
 |                                |             |                                                                                     |
 |                                |             |**Center on Node** - Center the 2D view on selected Node, without resizing.          |
 |                                |             |                                                                                     |
+|                                |             |**Shrink/Expand** - Fold/Unfold the selected Node. See :ref:`shrink_expand_nodes`.   |
+|                                |             |                                                                                     |
 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
 
 .. centered::
index c7a2226ec2714f0541384b50fbb862a4ae50a149..2fa6b257d62ffdfb428080791b6b154aca49d7a2 100644 (file)
@@ -68,3 +68,18 @@ in the toolbar :ref:`edition_toolbar`. To force links computation, use the **com
 The user can change the links representation with the options **simplify links** which tries to make the links as direct as possible with
 a slight CPU cost and **separate links** which tries to avoid links superposition with again a CPU cost.
 
+.. _shrink_expand_nodes:
+
+Shrink/Expand nodes
+-------------------
+This functionality allows folding/unfolding any node(s) in order to decrease the schema size. 
+It can be useful if user deals with a large schema that contains a lot of number of nodes.
+
+There are 3 possible ways to make the schema more compact:
+
++ call **shrink/expand** context menu or **double mouse click** on any node to fold/unfold this node;
+
++ call **shrink/expand children** context menu or  **Ctrl + double mouse click** on any composed node to fold/unfold all direct children nodes of selected node;
+
++ call **shrink/expand elementary** context menu or  **Ctrl + Shift + double mouse click** on any composed node to fold/unfold all elementary nodes of selected node recursively.
+
index 2371afada293f9a81f6da1b8013cc10b41a0aba0..582ca5680706d18cd57f5bfc45e6a5596fd9d3ab 100644 (file)
@@ -226,9 +226,9 @@ void DynParaLoop::edRemoveChild(Node *node) throw(YACS::Exception)
   modified();
 }
 
-bool DynParaLoop::edAddChild(Node *node) throw(YACS::Exception)
+bool DynParaLoop::edAddChild(Node *DISOWNnode) throw(YACS::Exception)
 {
-  return edSetNode(node);
+  return edSetNode(DISOWNnode);
 }
 
 std::list<Node *> DynParaLoop::edGetDirectDescendants() const
index 902d86eb38ac7f0812a524daa2b76f94732146f3..2ce21b66c89571d717c151fbcb2082a12cbd5a26 100644 (file)
@@ -87,7 +87,7 @@ namespace YACS
       //! For the moment false is returned : impovement about it coming soon.
       bool isPlacementPredictableB4Run() const;
       void edRemoveChild(Node *node) throw(Exception);
-      virtual bool edAddChild(Node *node) throw(Exception);
+      virtual bool edAddChild(Node *DISOWNnode) throw(Exception);
       std::list<Node *> edGetDirectDescendants() const;
       std::list<InputPort *> getSetOfInputPort() const;
       std::list<InputPort *> getLocalInputPorts() const;
index 0a5f6fe0f278f7124fd6b44a3162f3ab448eb9a1..1dc70d97e8421ef8467807a75868c9c7a62cf46c 100644 (file)
@@ -656,12 +656,15 @@ void ForEachLoop::buildDelegateOf(std::pair<OutPort *, OutPort *>& port, InPort
       vector<AnySplitOutputPort *>::iterator iter=_outGoingPorts.begin();
       int i=0;
       for(;iter!=_outGoingPorts.end();iter++,i++)
-        if((*iter)->getRepr()==port.first)
+        if((*iter)->getRepr()==port.first || *iter==port.first)
           break;
       if(iter!=_outGoingPorts.end())
         {
-          (*iter)->incrRef();
-          (*iter)->addRepr(port.first,_intecptrsForOutGoingPorts[i]);
+          if(*iter!=port.first)
+            {
+              (*iter)->incrRef();
+              (*iter)->addRepr(port.first,_intecptrsForOutGoingPorts[i]);
+            }
           port.first=*iter;
         }
       else
index a206af2fc58b011a67424decb2e2c635b55c4b37..63016deb7a22d78c84a39ab03eec28c85254ed5a 100644 (file)
@@ -59,6 +59,7 @@ CatalogWidget::CatalogWidget(QWidget *parent,
   _dragModifier=false;
 
   setColumnCount(1);
+  setHeaderHidden( true );
 
   addCatalog(_builtinCatalog, "Built In");
   addCatalog(_sessionCatalog, "Current Session");
index 5094c4b68c4be8443c7ca159953ae84eb93204dc..16d08646d96d66c6e6430e8d03481e9cdbd2f323 100644 (file)
@@ -153,18 +153,18 @@ GenericGui::GenericGui(YACS::HMI::SuitWrapper* wrapper, QMainWindow *parent)
   _dwTree = new QDockWidget(_parent);
   _dwTree->setVisible(false);
   _dwTree->setWindowTitle("Tree View: edition mode");
-  _dwTree->setObjectName("Tree View");
+  _dwTree->setObjectName("yacsTreeViewDock");
   _parent->addDockWidget(Qt::LeftDockWidgetArea, _dwTree);
   _dwStacked = new QDockWidget(_parent);
   _dwStacked->setVisible(false);
   _dwStacked->setWindowTitle("Input Panel");
-  _dwStacked->setObjectName("Input Panel");
+  _dwStacked->setObjectName("yacsInputPanelDock");
   _dwStacked->setMinimumWidth(270); // --- force a minimum until display
   _parent->addDockWidget(Qt::RightDockWidgetArea, _dwStacked);
   _dwCatalogs = new QDockWidget(_parent);
   _dwCatalogs->setVisible(false);
   _dwCatalogs->setWindowTitle("Catalogs");
-  _dwCatalogs->setObjectName("Catalogs");
+  _dwCatalogs->setObjectName("yacsCatalogsDock");
   _parent->addDockWidget(Qt::RightDockWidgetArea, _dwCatalogs);
   _catalogsWidget = new CatalogWidget(_dwCatalogs,
                                       _builtinCatalog,
@@ -460,6 +460,14 @@ void GenericGui::createActions()
                                             tr("shrink/expand"), tr("shrink or expand the selected node"),
                                             0, _parent, false, this,  SLOT(onShrinkExpand()));
 
+  _shrinkExpandChildren = _wrapper->createAction(getMenuId(), tr("shrink or expand direct children of the selected node"), QIcon("icons:shrinkExpand.png"),
+                                            tr("shrink/expand children"), tr("shrink or expand direct children of the selected node"),
+                                            0, _parent, false, this,  SLOT(onShrinkExpandChildren()));
+
+  _shrinkExpandElementaryRecursively = _wrapper->createAction(getMenuId(), tr("shrink or expand elementary nodes of the selected node recursively"), QIcon("icons:shrinkExpand.png"),
+                                            tr("shrink/expand elementary"), tr("shrink or expand elementary nodes of the selected node recursively"),
+                                            0, _parent, false, this,  SLOT(onShrinkExpandElementaryRecursively()));
+
   _toggleStraightLinksAct = _wrapper->createAction(getMenuId(), tr("draw straight or orthogonal links"), QIcon("icons:straightLink.png"),
                                                    tr("straight/orthogonal"), tr("draw straight or orthogonal links"),
                                                    0, _parent, true, this,  SLOT(onToggleStraightLinks(bool)));
@@ -670,7 +678,7 @@ void GenericGui::createMenus()
 
 void GenericGui::createTools()
 {
-  int aToolId = _wrapper->createTool ( tr( "YACS Toolbar" ) );
+  int aToolId = _wrapper->createTool ( tr( "YACS Toolbar" ), QString( "YACSToolbar" ) );
   _wrapper->createTool( _newSchemaAct, aToolId );
   _wrapper->createTool( _importSchemaAct, aToolId );
   _wrapper->createTool( _wrapper->separator(), aToolId );
@@ -2182,6 +2190,16 @@ void GenericGui::onShrinkExpand() {
   _guiEditor->shrinkExpand();
 }
 
+void GenericGui::onShrinkExpandChildren() {
+  DEBTRACE("GenericGui::onShrinkExpandChildren");
+  _guiEditor->shrinkExpand(Qt::ControlModifier|Qt::ShiftModifier);
+}
+
+void GenericGui::onShrinkExpandElementaryRecursively() {
+  DEBTRACE("GenericGui::onShrinkExpandElementaryRecursively");
+  _guiEditor->shrinkExpand(Qt::ControlModifier);
+}
+
 void GenericGui::onToggleStraightLinks(bool checked)
 {
   Scene::_straightLinks = checked;
index b3c9db94acc3310ea59ae5afc29631f2b3688b6c..92767e1c24c3526db6d2f890f37e2f3bc6cc317a 100644 (file)
@@ -161,6 +161,8 @@ namespace YACS
       QAction *_zoomToBlocAct;
       QAction *_centerOnNodeAct;
       QAction *_shrinkExpand;
+      QAction *_shrinkExpandChildren;
+      QAction *_shrinkExpandElementaryRecursively;
 
       QAction *_toggleStraightLinksAct;
       QAction *_toggleAutomaticComputeLinkAct;
@@ -300,6 +302,8 @@ namespace YACS
       void onZoomToBloc();
       void onCenterOnNode();
       void onShrinkExpand();
+      void onShrinkExpandChildren();
+      void onShrinkExpandElementaryRecursively();
       void onToggleStraightLinks(bool checked);
       void onToggleAutomaticComputeLinks(bool checked);
       void onToggleSimplifyLinks(bool checked);
index 45dc0e33b13bfe305a1d17a7fd5a40f000ebfb43..c50a41dda7e654fa9519e829a813650acd5e2086 100644 (file)
@@ -372,7 +372,7 @@ SubjectDataPort*  GuiEditor::CreateOutputPort(SubjectElementaryNode* seNode,
 /*!
  * Subject shrink or expand, command from popup menu: needs a valid selection
  */
-void GuiEditor::shrinkExpand() {
+void GuiEditor::shrinkExpand(Qt::KeyboardModifiers kbModifiers) {
   DEBTRACE("GuiEditor::shrinkExpand");
 
   Subject* sub = QtGuiContext::getQtCurrent()->getSelectedSubject();
@@ -393,12 +393,14 @@ void GuiEditor::shrinkExpand() {
     return;
   };
 
-  if (sni->isExpanded()) {
-    sni->setExpanded(false);
-  } else {
-    sni->setExpanded(true);
-  };
-  sni->reorganizeShrinkExpand();
+  ShrinkMode aShrinkMode = CurrentNode;
+  if (kbModifiers == Qt::ControlModifier) {
+    aShrinkMode = ElementaryNodes;
+  } else if (kbModifiers == (Qt::ShiftModifier|Qt::ControlModifier)) {
+    aShrinkMode = ChildrenNodes;
+  }
+
+  sni->reorganizeShrinkExpand(aShrinkMode);
   sni->showOutScopeLinks();
   sni->updateLinks();
 }
index 627993b8165654a90e38244f9c0fa1de2b55a1cc..7940b744320c491ebc22abc17d45a7f4d87908df 100644 (file)
@@ -82,7 +82,7 @@ namespace YACS
       void PutSubjectInBloc();
       std::string PutGraphInBloc();
       void PutGraphInNode(std::string typeNode);
-      void shrinkExpand();
+      void shrinkExpand(Qt::KeyboardModifiers kbModifiers = Qt::NoModifier);
       void rebuildLinks();
       void arrangeNodes(bool isRecursive);
       void arrangeProc();
index 49c996f05bfaadb53d7f19d474ead490fd14f4fa..8cbc6bc0d19fea60eb14787f096515dbb49b6e22 100644 (file)
@@ -170,6 +170,8 @@ void ComposedNodeMenu::popupMenu(QWidget *caller, const QPoint &globalPos, const
   menu.addAction(gmain->_zoomToBlocAct);
   menu.addAction(gmain->_centerOnNodeAct);
   menu.addAction(gmain->_shrinkExpand);
+  menu.addAction(gmain->_shrinkExpandChildren);
+  menu.addAction(gmain->_shrinkExpandElementaryRecursively);
   menu.addAction(gmain->_computeLinkAct);
 //   menu.addAction(gmain->_toggleAutomaticComputeLinkAct);
 //   menu.addAction(gmain->_toggleSimplifyLinkAct);
@@ -272,6 +274,8 @@ void ProcMenu::popupMenu(QWidget *caller, const QPoint &globalPos, const QString
   menu.addAction(gmain->_zoomToBlocAct);
   menu.addAction(gmain->_centerOnNodeAct);
   menu.addAction(gmain->_shrinkExpand);
+  menu.addAction(gmain->_shrinkExpandChildren);
+  menu.addAction(gmain->_shrinkExpandElementaryRecursively);
   menu.addAction(gmain->_computeLinkAct);
 //   menu.addAction(gmain->_toggleAutomaticComputeLinkAct);
 //   menu.addAction(gmain->_toggleSimplifyLinkAct);
index ddd78059592241b8441ff0e709d0b39d84f918f1..6c18f9fe4f6f0e1861cc8935d38a1b3353758bcc 100644 (file)
@@ -391,12 +391,10 @@ void SceneComposedNodeItem::removeChildFromList(AbstractSceneItem* child)
   _children.remove(child);
 }
 
-void SceneComposedNodeItem::reorganizeShrinkExpand() {
-  DEBTRACE("SceneComposedNodeItem::reorganizeShrinkExpand " << _expanded << " " << _label.toStdString());
-  bool isExpanding = isExpanded();
-
+void SceneComposedNodeItem::updateControlLinks(bool toExpand)
+{
   //update control links
-  std::list<SubjectControlLink*> lscl=dynamic_cast<SubjectNode*>(_subject)->getSubjectControlLinks();
+  std::list<SubjectControlLink*> lscl=dynamic_cast<SubjectNode*>(getSubject())->getSubjectControlLinks();
   for (std::list<SubjectControlLink*>::const_iterator it = lscl.begin(); it != lscl.end(); ++it) {
     SceneLinkItem* lk = dynamic_cast<SceneLinkItem*>(QtGuiContext::getQtCurrent()->_mapOfSceneItem[*it]);
 
@@ -419,15 +417,44 @@ void SceneComposedNodeItem::reorganizeShrinkExpand() {
     };
 
     if (b1 && b2) {
-      if (isExpanding) {
+      if (toExpand) {
         lk->show();
       } else {
         lk->hide();
       };
     };
   };
+}
+
+void SceneComposedNodeItem::reorganizeShrinkExpand(ShrinkMode theShrinkMode) {
+  DEBTRACE("SceneComposedNodeItem::reorganizeShrinkExpand " << _expanded << " " << _label.toStdString());
+
+  bool toExpand = true;
+  if (theShrinkMode == CurrentNode) {
+    // shrink/expand current node only
+    toExpand = !isExpanded();
+
+    updateControlLinks(toExpand);
+    shrinkExpandRecursive(toExpand, true, theShrinkMode);
+
+  } else {
+    if (!isExpanded())
+      return;
+    // shrink/expand child nodes
+    toExpand = !hasExpandedChildren(theShrinkMode == ElementaryNodes);
+    for (list<AbstractSceneItem*>::const_iterator it=_children.begin(); it!=_children.end(); ++it) {
+      SceneItem* item = dynamic_cast<SceneItem*>(*it);
+      SceneNodeItem *sni = dynamic_cast<SceneNodeItem*>(item);
+      item->shrinkExpandRecursive(toExpand, true, theShrinkMode);
+    }
+    _ancestorShrinked = !toExpand;
+    _width = _expandedWidth;
+    _height = _expandedHeight;
+    _shownState = expandShown;
+    adjustHeader();
+    rebuildLinks();
+  }
 
-  shrinkExpandRecursive(isExpanding, true);
   if (Scene::_autoComputeLinks)
     {
       SubjectProc* subproc = QtGuiContext::getQtCurrent()->getSubjectProc();
@@ -437,70 +464,116 @@ void SceneComposedNodeItem::reorganizeShrinkExpand() {
     }
 }
 
-void SceneComposedNodeItem::shrinkExpandRecursive(bool isExpanding, bool fromHere)
+bool SceneComposedNodeItem::hasExpandedChildren(bool recursively)
+{
+  bool res = false;
+  for (list<AbstractSceneItem*>::const_iterator it=_children.begin(); it!=_children.end() && !res; ++it) {
+    SceneItem* item = dynamic_cast<SceneItem*>(*it);
+    SceneNodeItem *sni = dynamic_cast<SceneNodeItem*>(item);
+    if (sni->isExpanded()) {
+      res = true;
+      if (recursively)
+        if (SceneComposedNodeItem *scni = dynamic_cast<SceneComposedNodeItem*>(sni))
+          res = scni->hasExpandedChildren(recursively);
+    }
+  }
+  return res;
+}
+
+void SceneComposedNodeItem::shrinkExpandRecursive(bool toExpand, bool fromHere, ShrinkMode theShrinkMode)
 {
   DEBTRACE("SceneComposedNodeItem::shrinkExpandRecursive " << isExpanding << " " << fromHere << " " << isExpanded() << " " << _label.toStdString());
   
-  if (!isExpanding)
+  bool toChangeShrinkState = false;
+  switch (theShrinkMode) {
+  case CurrentNode:
+    if (fromHere)
+      toChangeShrinkState = true;
+    break;
+  case ChildrenNodes:
+    if (fromHere)
+      toChangeShrinkState = true;
+    break;
+  case ElementaryNodes:
+    toChangeShrinkState = false;
+    break;
+  }
+  if (toChangeShrinkState) {
+    if (toExpand != isExpanded())
+      setExpanded(toExpand);
+  } else if (!isExpanded() && theShrinkMode == ElementaryNodes) {
+    return;
+  }
+
+  updateControlLinks(toExpand);
+
+  if (!toExpand)
     { // ---collapsing: hide first children , then resize
       for (list<AbstractSceneItem*>::const_iterator it=_children.begin(); it!=_children.end(); ++it)
         {
           SceneItem* item = dynamic_cast<SceneItem*>(*it);
-          item->shrinkExpandRecursive(false, false);
-          item->hide();  
-          DEBTRACE("------------------------------- Hide " << item->getLabel().toStdString());
-          item->shrinkExpandLink(false);  
+          item->shrinkExpandRecursive(toExpand, false, theShrinkMode);
+          if (theShrinkMode != ElementaryNodes) {
+            item->hide();  
+            DEBTRACE("------------------------------- Hide " << item->getLabel().toStdString());
+            item->shrinkExpandLink(false);  
+          }
         }
 
-      if (_shownState == expandShown)
-        {
-           _expandedWidth = _width;
-           _expandedHeight = _height;
-        }
+      if (toChangeShrinkState || theShrinkMode != ElementaryNodes) {
+        if (_shownState == expandShown)
+          {
+             _expandedWidth = _width;
+             _expandedHeight = _height;
+          }
 
-      if (fromHere)
-        {
-          _shownState = shrinkShown;
-        }
-      else
-        {
-          _ancestorShrinked = true;
-          _shownState = shrinkHidden;
-        }
+        if (fromHere)
+          {
+            _shownState = shrinkShown;
+          }
+        else
+          {
+            _ancestorShrinked = true;
+            _shownState = shrinkHidden;
+          }
 
-      _width  = 2*Resource::Corner_Margin + 2*Resource::DataPort_Width + Resource::Space_Margin;
-      if (_shownState == shrinkShown)
-        _height = getHeaderBottom() + Resource::Corner_Margin;
-      else
-        _height = Resource::Header_Height + Resource::Corner_Margin;
+        _width  = 2*Resource::Corner_Margin + 2*Resource::DataPort_Width + Resource::Space_Margin;
+        if (_shownState == shrinkShown)
+          _height = getHeaderBottom() + Resource::Corner_Margin;
+        else
+          _height = Resource::Header_Height + Resource::Corner_Margin;
       
-      if (_shownState == shrinkHidden) // shrink of ancestor
-        setPos(0 ,0);
-      else
-        setPos(_expandedPos);
-      adjustHeader();
-      if (_progressItem)
-        _progressItem->adjustGeometry();
+        if (_shownState == shrinkHidden) // shrink of ancestor
+          setPos(0 ,0);
+        else
+          setPos(_expandedPos);
+        adjustHeader();
+        if (_progressItem)
+          _progressItem->adjustGeometry();
+      }
     }
   else
     { // --- expanding: resize, then show children
-      _ancestorShrinked = false;
+      if (toChangeShrinkState)
+        _ancestorShrinked = false;
 
       for (list<AbstractSceneItem*>::const_iterator it=_children.begin(); it!=_children.end(); ++it)
         {
           SceneItem* item = dynamic_cast<SceneItem*>(*it);
-          item->shrinkExpandRecursive(isExpanded(), false); 
-          if (isExpanded())
-            {
-              item->show();  
-              DEBTRACE("------------------------------- Show " << item->getLabel().toStdString());
-            }
-          else
-            {
-              item->hide();  
-              DEBTRACE("------------------------------- Hide " << item->getLabel().toStdString());
-            }
-          item->shrinkExpandLink(fromHere);  
+          item->shrinkExpandRecursive(isExpanded(), false, theShrinkMode); 
+          if (theShrinkMode != ElementaryNodes) {
+            if (isExpanded())
+              {
+                item->show();  
+                DEBTRACE("------------------------------- Show " << item->getLabel().toStdString());
+              }
+            else
+              {
+                item->hide();  
+                DEBTRACE("------------------------------- Hide " << item->getLabel().toStdString());
+              }
+            item->shrinkExpandLink(fromHere);  
+          }
         }
 
       if (isExpanded())
index 37e55d264fa3e534738321291d8a051a6c5bdd86..639cf0c86d65d13d08f28ab2be6f5d9b852799e7 100644 (file)
@@ -45,8 +45,8 @@ namespace YACS
       virtual std::list<AbstractSceneItem*> getChildren();
       virtual void removeChildFromList(AbstractSceneItem* child);
       virtual void reorganize();
-      virtual void reorganizeShrinkExpand();
-      virtual void shrinkExpandRecursive(bool isExpanding, bool fromHere);
+      virtual void reorganizeShrinkExpand(ShrinkMode theShrinkMode);
+      virtual void shrinkExpandRecursive(bool isExpanding, bool fromHere, ShrinkMode theShrinkMode);
       virtual void shrinkExpandLink(bool se);
       virtual void collisionResolv(SceneItem* child, QPointF oldPos);
       virtual void rebuildLinks();
@@ -55,10 +55,12 @@ namespace YACS
       virtual void arrangeChildNodes();
       virtual void adjustColors();
       virtual void setShownState(shownState ss);
+      virtual bool hasExpandedChildren(bool recursively);
     protected:
       void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
       void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
       void dropEvent(QGraphicsSceneDragDropEvent *event);
+      void updateControlLinks(bool toExpand);
       virtual QColor getPenColor();
       virtual QColor getBrushColor();
 
index 40d4b4d339f1672db1b019c909eb0db04e4cb317..9396fe049b75bca9cf49047b5b8997949fefb85e 100644 (file)
@@ -187,10 +187,12 @@ void SceneElementaryNodeItem::popupMenu(QWidget *caller, const QPoint &globalPos
   m.popupMenu(caller, globalPos);
 }
 
-void SceneElementaryNodeItem::reorganizeShrinkExpand()
+void SceneElementaryNodeItem::reorganizeShrinkExpand(ShrinkMode theShrinkMode)
 {
   DEBTRACE("SceneElementaryNodeItem::reorganizeShrinkExpand " << isExpanded() << " "  << _label.toStdString());
-  shrinkExpandRecursive(isExpanded(), true);
+  if (theShrinkMode != CurrentNode)
+    return;
+  shrinkExpandRecursive(!isExpanded(), true, theShrinkMode);
   if (Scene::_autoComputeLinks)
     {
       SubjectProc* subproc = QtGuiContext::getQtCurrent()->getSubjectProc();
@@ -200,30 +202,48 @@ void SceneElementaryNodeItem::reorganizeShrinkExpand()
     }
 }
 
-void SceneElementaryNodeItem::shrinkExpandRecursive(bool isExpanding, bool fromHere)
+void SceneElementaryNodeItem::shrinkExpandRecursive(bool toExpand, bool fromHere, ShrinkMode theShrinkMode)
 {
-  DEBTRACE("SceneElementaryNodeItem::shrinkExpandRecursive " << isExpanding << " " << fromHere << " "  << isExpanded() << " " << _label.toStdString());
-  if (isExpanding)
-    {
+  DEBTRACE("SceneElementaryNodeItem::shrinkExpandRecursive " << toExpand << " " << fromHere << " "  << isExpanded() << " " << _label.toStdString());
+  
+  bool toChangeShrinkState = false;
+  switch (theShrinkMode) {
+  case CurrentNode:
+    if (fromHere)
+      toChangeShrinkState = true;
+    break;
+  case ChildrenNodes:
+    if (fromHere)
+      toChangeShrinkState = true;
+    break;
+  case ElementaryNodes:
+    toChangeShrinkState = true;
+    break;
+  }
+  if (toChangeShrinkState && toExpand != isExpanded())
+    setExpanded(toExpand);
+
+  if (toExpand) {
+    if (toChangeShrinkState) {
       _ancestorShrinked = false;
+      _shownState = expandShown;
+    } else {
       if (isExpanded())
         _shownState = expandShown;
       else
         _shownState = shrinkShown;
     }
-  else
-    {
-      if (fromHere)
-        _shownState = shrinkShown;
-      else
-        {
-          _ancestorShrinked = true;
-          _shownState = shrinkHidden;
-        }
+  } else {
+    if (fromHere || theShrinkMode==ElementaryNodes) {
+      _shownState = shrinkShown;
+    } else {
+      _ancestorShrinked = true;
+      _shownState = shrinkHidden;
     }
+  }
 
   if (_shownState == shrinkHidden) // shrink of ancestor
-    setPos(0 ,0);
+    setPos(00);
   else
     setPos(_expandedPos);
 
index 66ecbe387225135e72f4aaf33b334dc85cee5cff..fdc2f16ae151014a9941cc2e0b8a778230aa688f 100644 (file)
@@ -42,8 +42,8 @@ namespace YACS
       virtual void popupMenu(QWidget *caller, const QPoint &globalPos);
       virtual void autoPosNewPort(AbstractSceneItem *item, int nbPorts);
       virtual void reorganize();
-      virtual void reorganizeShrinkExpand();
-      virtual void shrinkExpandRecursive(bool isExpanding, bool fromHere);
+      virtual void reorganizeShrinkExpand(ShrinkMode theShrinkMode);
+      virtual void shrinkExpandRecursive(bool isExpanding, bool fromHere, ShrinkMode theShrinkMode);
       virtual void setShownState(shownState ss);
     protected:
       int _maxPorts;
index 35fb5f077f4520e01c61cbedb5cfbb0bcd0704f7..d097bb19b80c62a057d998c2bc8cbd7a7cf99739 100644 (file)
@@ -436,7 +436,7 @@ void SceneItem::shrinkExpandLink(bool se)
 }
 
 
-void SceneItem::shrinkExpandRecursive(bool isExpanding, bool fromHere)
+void SceneItem::shrinkExpandRecursive(bool isExpanding, bool fromHere, ShrinkMode theShrinkMode)
 {
 }
 
index 06cf276a351886d44a6a24b3948d1ce840289511..a04e6dba1eaa3899a0fc3465956042f1c332b64e 100644 (file)
@@ -33,6 +33,13 @@ namespace YACS
 {
   namespace HMI
   {
+    typedef enum
+      {
+        CurrentNode,
+        ChildrenNodes,
+        ElementaryNodes
+      } ShrinkMode;
+    
     class Scene;
 
     class RootSceneItem: public GuiObserver
@@ -131,7 +138,7 @@ namespace YACS
       virtual void updateChildItems();
       virtual void updateLinks();
       virtual void shrinkExpandLink(bool se);
-      virtual void shrinkExpandRecursive(bool isExpanding, bool fromHere);
+      virtual void shrinkExpandRecursive(bool isExpanding, bool fromHere, ShrinkMode theShrinkMode);
       bool isAncestorShrinked() { return _ancestorShrinked; };
       bool _blocX;
       bool _blocY;
index fdff648d0804d06460e83d42bc914ed71ea4db4a..8c7ee43ab177c80850df64de01474eb43679ca36 100644 (file)
@@ -179,7 +179,7 @@ void SceneNodeItem::arrangeChildNodes()
 {
 }
 
-void SceneNodeItem::reorganizeShrinkExpand()
+void SceneNodeItem::reorganizeShrinkExpand(ShrinkMode theShrinkMode)
 {
 }
 
@@ -310,7 +310,7 @@ void SceneNodeItem::mouseMoveEvent(QGraphicsSceneMouseEvent * event)
 void SceneNodeItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
 {
   DEBTRACE("SceneNodeItem::mouseDoubleClickEvent");
-  QtGuiContext::getQtCurrent()->getGMain()->_guiEditor->shrinkExpand();
+  QtGuiContext::getQtCurrent()->getGMain()->_guiEditor->shrinkExpand(QApplication::keyboardModifiers());
 }
 
 void SceneNodeItem::setTopLeft(QPointF topLeft)
index 5205a49383a0627377f08009762e28de7ba465cd..292c31d775179494d34eb81d8703cb02f9d988a6 100644 (file)
@@ -72,7 +72,7 @@ namespace YACS
       virtual void updateName();
       virtual void arrangeNodes(bool isRecursive);
       virtual void arrangeChildNodes();
-      virtual void reorganizeShrinkExpand();
+      virtual void reorganizeShrinkExpand(ShrinkMode theShrinkMode);
       virtual void updateChildItems();
       virtual void shrinkExpandLink(bool se);
       virtual void showOutScopeLinks();
index 14ec4befe06571e9f7a043611676e8ea93cbae0c..919d9510d044ee8f22ac57a206e1d832d0733c58 100644 (file)
@@ -52,41 +52,3 @@ void SceneProcItem::popupMenu(QWidget *caller, const QPoint &globalPos)
   m.popupMenu(caller, globalPos);
 }
 
-void SceneProcItem::reorganizeShrinkExpand() {
-  if (_children.size() == 0)
-    return;
-  bool isExpanding = true;
-  DEBTRACE("SceneProcItem::reorganizeShrinkExpand " << _expanded << " " << _label.toStdString());
-  for (list<AbstractSceneItem*>::const_iterator it=_children.begin(); it!=_children.end(); ++it)
-    {
-      SceneItem* item = dynamic_cast<SceneItem*>(*it);
-      SceneNodeItem *sni = dynamic_cast<SceneNodeItem*>(item);
-      if (sni->isExpanded()) {
-         isExpanding = false;
-         break;
-      }
-    }
-  for (list<AbstractSceneItem*>::const_iterator it=_children.begin(); it!=_children.end(); ++it)
-    {
-      SceneItem* item = dynamic_cast<SceneItem*>(*it);
-      SceneNodeItem *sni = dynamic_cast<SceneNodeItem*>(item);
-      if (!isExpanding && sni->isExpanded()) {
-       sni->setExpanded(false);
-       item->shrinkExpandRecursive(false, true);
-       DEBTRACE("------------------------------- Hide " << item->getLabel().toStdString());
-      }
-      if (isExpanding && !sni->isExpanded()) {
-       sni->setExpanded(true);
-       item->shrinkExpandRecursive(true, false);
-       DEBTRACE("------------------------------- Show " << item->getLabel().toStdString());
-      }
-      item->shrinkExpandLink(isExpanding);
-    }
-  _ancestorShrinked = !isExpanding;
-  _width = _expandedWidth;
-  _height = _expandedHeight;
-  _shownState = expandShown;
-  adjustHeader();
-  rebuildLinks();
-}
-
index 8e4ce68f00677753f2ea9a3562aa4a27f4210f8f..725accab3fd56dce23d61563c44874ab631c050b 100644 (file)
@@ -33,7 +33,6 @@ namespace YACS
                     QString label, Subject *subject);
       virtual ~SceneProcItem();
       virtual void popupMenu(QWidget *caller, const QPoint &globalPos);
-      virtual void reorganizeShrinkExpand();
     };
   }
 }
index 01b877b43e628a8101f602ef26e85676ad32964b..66b175c07105547b35e21bf12c0093968f388bdc 100644 (file)
     <parameter name="DataPort_Width"  value="100" />
     <parameter name="DataPort_Height" value="25"  />
   </section>
+ <section name="windows_geometry">
+  <parameter name="YACS" value="#00 #00 #00 #FF #00 #00 #00 #00 #FD #00 #00 #00 #03 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #02 #6B #FC #02 #00 #00 #00 #01 #FC #00 #00 #00 #59 #00 #00 #02 #6B #00 #00 #00 #68 #01 #00 #00 #14 #FA #00 #00 #00 #01 #02 #00 #00 #00 #02 #FB #00 #00 #00 #20 #00 #79 #00 #61 #00 #63 #00 #73 #00 #54 #00 #72 #00 #65 #00 #65 #00 #56 #00 #69 #00 #65 #00 #77 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #16 #00 #FF #FF #FF #FB #00 #00 #00 #22 #00 #6F #00 #62 #00 #6A #00 #65 #00 #63 #00 #74 #00 #42 #00 #72 #00 #6F #00 #77 #00 #73 #00 #65 #00 #72 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #53 #00 #FF #FF #FF #00 #00 #00 #01 #00 #00 #01 #0E #00 #00 #02 #6B #FC #02 #00 #00 #00 #01 #FC #00 #00 #00 #59 #00 #00 #02 #6B #00 #00 #00 #68 #01 #00 #00 #14 #FA #00 #00 #00 #01 #02 #00 #00 #00 #02 #FB #00 #00 #00 #24 #00 #79 #00 #61 #00 #63 #00 #73 #00 #49 #00 #6E #00 #70 #00 #75 #00 #74 #00 #50 #00 #61 #00 #6E #00 #65 #00 #6C #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #16 #00 #FF #FF #FF #FB #00 #00 #00 #20 #00 #79 #00 #61 #00 #63 #00 #73 #00 #43 #00 #61 #00 #74 #00 #61 #00 #6C #00 #6F #00 #67 #00 #73 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #53 #00 #FF #FF #FF #00 #00 #00 #03 #00 #00 #05 #40 #00 #00 #00 #53 #FC #01 #00 #00 #00 #01 #FB #00 #00 #00 #22 #00 #70 #00 #79 #00 #74 #00 #68 #00 #6F #00 #6E #00 #43 #00 #6F #00 #6E #00 #73 #00 #6F #00 #6C #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #00 #00 #00 #05 #40 #00 #00 #00 #46 #00 #FF #FF #FF #00 #00 #03 #22 #00 #00 #02 #6B #00 #00 #00 #04 #00 #00 #00 #04 #00 #00 #00 #08 #00 #00 #00 #08 #FC #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #1C #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1A #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #CE #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #01 #00 #00 #00 #16 #00 #59 #00 #41 #00 #43 #00 #53 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00"/>
+ </section>
+ <section name="windows_visibility">
+  <parameter name="YACS" value="#00 #00 #00 #00 #08 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #2A #00 #51 #00 #78 #00 #53 #00 #63 #00 #65 #00 #6E #00 #65 #00 #56 #00 #69 #00 #65 #00 #77 #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #1A #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #1C #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #1E #00 #56 #00 #69 #00 #65 #00 #77 #00 #20 #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #18 #00 #59 #00 #41 #00 #43 #00 #53 #00 #20 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #00 #00 #00 #16 #00 #59 #00 #41 #00 #43 #00 #53 #00 #54 #00 #6F #00 #6F #00 #6C #00 #62 #00 #61 #00 #72 #01 #01 #00 #00 #00 #05 #00 #00 #00 #22 #00 #6F #00 #62 #00 #6A #00 #65 #00 #63 #00 #74 #00 #42 #00 #72 #00 #6F #00 #77 #00 #73 #00 #65 #00 #72 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #22 #00 #70 #00 #79 #00 #74 #00 #68 #00 #6F #00 #6E #00 #43 #00 #6F #00 #6E #00 #73 #00 #6F #00 #6C #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #20 #00 #79 #00 #61 #00 #63 #00 #73 #00 #43 #00 #61 #00 #74 #00 #61 #00 #6C #00 #6F #00 #67 #00 #73 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #24 #00 #79 #00 #61 #00 #63 #00 #73 #00 #49 #00 #6E #00 #70 #00 #75 #00 #74 #00 #50 #00 #61 #00 #6E #00 #65 #00 #6C #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #20 #00 #79 #00 #61 #00 #63 #00 #73 #00 #54 #00 #72 #00 #65 #00 #65 #00 #56 #00 #69 #00 #65 #00 #77 #00 #44 #00 #6F #00 #63 #00 #6B #01"/>
+ </section>
 </document>
index acc337c8af78c7b39b5012c75ffefc43f0e00b15..ae221267b3e4b1e9cb012fc7b51ae3650c2d052d 100644 (file)
         <source>shrink or expand the selected node</source>
         <translation>contracter ou étendre le noeud choisi</translation>
     </message>
+    <message>
+        <source>shrink or expand direct children of the selected node</source>
+        <translation type="unfinished">contracter ou étendre le noeud choisi</translation>
+    </message>
+    <message>
+        <source>shrink or expand elementary nodes of the selected node recursively</source>
+        <translation type="unfinished">contracter ou étendre le noeud choisi</translation>
+    </message>
     <message>
         <source>shrink/expand</source>
         <translation>contracter/étendre</translation>
     </message>
+    <message>
+        <source>shrink/expand children</source>
+        <translation type="unfinished">contracter/étendre</translation>
+    </message>
+    <message>
+        <source>shrink/expand elementary</source>
+        <translation type="unfinished">contracter/étendre</translation>
+    </message>
     <message>
         <source>draw straight or orthogonal links</source>
         <translation>Créer les liens droits ou orthogonaux</translation>
index f30cce995b9c691f33c59978c35a732230966951..a8508990e3a372a236dd16a603c4394096e328e9 100644 (file)
       <source>shrink or expand the selected node</source>
       <translation>選択中のノードを展開または縮小</translation>
     </message>
+    <message>
+      <source>shrink or expand direct children of the selected node</source>
+      <translation type="unfinished">選択中のノードを展開または縮小</translation>
+    </message>
+    <message>
+      <source>shrink or expand elementary nodes of the selected node recursively</source>
+      <translation type="unfinished">選択中のノードを展開または縮小</translation>
+    </message>
     <message>
       <source>shrink/expand</source>
       <translation>展開/縮小</translation>
     </message>
+    <message>
+      <source>shrink/expand children</source>
+      <translation type="unfinished">展開/縮小</translation>
+    </message>
+    <message>
+      <source>shrink/expand elementary</source>
+      <translation type="unfinished">展開/縮小</translation>
+    </message>
     <message>
       <source>draw straight or orthogonal links</source>
       <translation>直線または直交リンクを描画</translation>
index ecf25ea149d943800c67c46aa273fc5f2240ec47..70a9e5af62dcee8259407de20cae763720f00a61 100644 (file)
@@ -169,9 +169,9 @@ int SalomeWrap_Module::wCreateMenu(QAction* action,
   return createMenu(action, menu, actionId, groupId, index);
 }
 
-int SalomeWrap_Module::wCreateTool(const QString& name)
+int SalomeWrap_Module::wCreateTool(const QString& title, const QString& name)
 {
-  return createTool(name);
+  return createTool(title, name);
 }
 
 int SalomeWrap_Module::wCreateTool(const int actionId,
index 66ffcbb3beba5303b76199442953f8735b8188cd..1dab9272bf8d7f0967e600174dcc94682041929d 100644 (file)
@@ -97,7 +97,8 @@ public:
                   const int groupId = -1,
                   const int index = -1);
 
-  int wCreateTool(const QString& name);
+  int wCreateTool(const QString& title,
+                 const QString& name = QString());
 
   int wCreateTool(const int actionId,
                   const int toolbarId, 
index 0ef735cfbe964908e22db663da6f504ba2c1129a..15f87eaa650b5172088945aed5338e107554293f 100644 (file)
@@ -201,10 +201,10 @@ int SuitWrapper::createMenu(QAction* action,
   return module->wCreateMenu(action, menu, actionId, groupId, index);
 }
 
-int SuitWrapper::createTool(const QString& name)
+int SuitWrapper::createTool(const QString& title, const QString& name)
 {
   SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
-  return module->wCreateTool(name);
+  return module->wCreateTool(title, name);
 }
 
 int SuitWrapper::createTool(const int actionId,
index 6f405657a6817b08de157851db0cbb4f81eeccb2..e74af95ecfda18d373864b349053a02ad4059a37 100644 (file)
@@ -96,7 +96,8 @@ namespace YACS
                      const int groupId = -1,
                      const int index = -1);
 
-      int createTool(const QString& name);
+      int createTool(const QString& title,
+                    const QString& name = QString());
 
       int createTool(const int actionId,
                      const int toolbarId, 
index 2d38fc841772a27b96b9016f2cafa0ad91c286c2..8ece73119f3c8082e809c561233dd301a3f64e11 100644 (file)
@@ -308,7 +308,7 @@ T whilelooptypeParser<T>::post()
       T b=this->_cnode;
       this->_cnodes.pop_back();
       currentProc->names.pop_back();
-      this->_cnode=this->_cnodes.back();
+      this->_cnode=this->_cnodes.empty() ? 0 : this->_cnodes.back();
       return b;
     }
 }
@@ -374,7 +374,7 @@ template <class T>
       T b=this->_cnode;
       this->_cnodes.pop_back();
       currentProc->names.pop_back();
-      this->_cnode=this->_cnodes.back();
+      this->_cnode=this->_cnodes.empty() ? 0 : this->_cnodes.back();
       return b;
     }
 
@@ -414,10 +414,7 @@ struct pseudocomposednodetypeParser:looptypeParser<T>
       DEBTRACE("pseudocomposednode_post" << this->_cnode->getNode()->getName())
       T b = this->_cnode;
       this->_cnodes.pop_back();
-      if(this->_cnodes.size() == 0)
-        this->_cnode = 0;
-      else
-        this->_cnode = this->_cnodes.back();
+      this->_cnode=this->_cnodes.empty() ? 0 : this->_cnodes.back();
       return b;
     }
 
@@ -558,10 +555,7 @@ struct foreachlooptypeParser:dynparalooptypeParser<T>
       T b=this->_cnode;
       this->_cnodes.pop_back();
       currentProc->names.pop_back();
-      if(this->_cnodes.size() == 0)
-        this->_cnode=0;
-      else
-        this->_cnode=this->_cnodes.back();
+      this->_cnode=this->_cnodes.empty() ? 0 : this->_cnodes.back();
       return b;
     }
   int _nbranch;
@@ -641,10 +635,7 @@ struct optimizerlooptypeParser:dynparalooptypeParser<T>
       T b=this->_cnode;
       this->_cnodes.pop_back();
       currentProc->names.pop_back();
-      if(this->_cnodes.size() == 0)
-        this->_cnode=0;
-      else
-        this->_cnode=this->_cnodes.back();
+      this->_cnode=this->_cnodes.empty() ? 0 : this->_cnodes.back();
       return b;
     }
 
index 70fcaba45d5ccbd9186c97a742f67a528f768106..b7c39fd5e7556d2a8f048d689334683a1056b399 100644 (file)
@@ -25,4 +25,8 @@ IF(NOT WIN32)
   CONFIGURE_FILE(YacsLoaderTest.sh.in YacsLoaderTest.sh)
   CONFIGURE_FILE(YacsLoaderInSessionTest.sh.in YacsLoaderInSessionTest.sh)
   ADD_TEST(NAME YacsLoaderTest_swig COMMAND ${SHELL} ${CMAKE_CURRENT_BINARY_DIR}/YacsLoaderTest.sh)
+
+  SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+  ADD_TEST(NAME StdAloneYacsLoaderTest1 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/StdAloneYacsLoaderTest1.py)
+  SET_TESTS_PROPERTIES(StdAloneYacsLoaderTest1 PROPERTIES ENVIRONMENT "${tests_env}")
 ENDIF() 
diff --git a/src/yacsloader_swig/Test/StdAloneYacsLoaderTest1.py b/src/yacsloader_swig/Test/StdAloneYacsLoaderTest1.py
new file mode 100755 (executable)
index 0000000..1059186
--- /dev/null
@@ -0,0 +1,94 @@
+# Copyright (C) 2006-2014  CEA/DEN, EDF R&D
+#
+# 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, or (at your option) any later version.
+#
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+import pilot
+import SALOMERuntime
+import loader
+import unittest
+
+class StdAloneYacsLoaderTest1(unittest.TestCase):
+
+  def setUp(self):
+    SALOMERuntime.RuntimeSALOME_setRuntime()
+    self.r = pilot.getRuntime()
+    self.l = loader.YACSLoader()# self.l.load("foreachImbr_tmp.xml")
+    pass
+
+  def test1(self):
+    """tests imbrication od"""
+    SALOMERuntime.RuntimeSALOME_setRuntime()
+    l=loader.YACSLoader()
+    ex=pilot.ExecutorSwig()
+    p=self.r.createProc("pr")
+    td=p.createType("double","double")
+    td2=p.createSequenceTc("seqdbl","seqdbl",td)
+    td3=p.createSequenceTc("seqdblvec","seqdblvec",td2)
+    td4=p.createSequenceTc("seqseqdblvec","seqseqdblvec",td3)
+    node1=self.r.createScriptNode("","node1")
+    node1.setScript("o1=[([1,1],[2,2,2]),([10],[11,11],[12,12,12]),([20],[21,21],[22,22,22],[23,23,23,23])]")
+    o1=node1.edAddOutputPort("o1",td4)
+    p.edAddChild(node1)
+    node2=self.r.createForEachLoop("node2",td3)
+    p.edAddChild(node2)
+    p.edAddCFLink(node1,node2)
+    p.edAddLink(o1,node2.edGetSeqOfSamplesPort())
+    node2.edGetNbOfBranchesPort().edInitInt(2)
+    #
+    node20=self.r.createBloc("node20")
+    node2.edAddChild(node20)
+    node200=self.r.createForEachLoop("node200",td2)
+    node20.edAddChild(node200)
+    node200.edGetNbOfBranchesPort().edInitInt(2)
+    p.edAddLink(node2.edGetSamplePort(),node200.edGetSeqOfSamplesPort())
+    node2000=self.r.createForEachLoop("node2000",td)
+    node2000.edGetNbOfBranchesPort().edInitInt(2)
+    node200.edAddChild(node2000)
+    p.edAddLink(node200.edGetSamplePort(),node2000.edGetSeqOfSamplesPort())
+    node20000=self.r.createScriptNode("","node20000")
+    node2000.edAddChild(node20000)
+    i1=node20000.edAddInputPort("i1",td)
+    o2=node20000.edAddOutputPort("o2",td)
+    node20000.setScript("o2=i1+2")
+    p.edAddLink(node2000.edGetSamplePort(),i1)
+    #
+    node3=self.r.createScriptNode("","node3")
+    node3.setScript("o3=i2")
+    p.edAddChild(node3)
+    i2=node3.edAddInputPort("i2",td4)
+    o3=node3.edAddOutputPort("o3",td4)
+    p.edAddCFLink(node2,node3)
+    p.edAddLink(o2,i2)
+    ex = pilot.ExecutorSwig()
+    self.assertEqual(p.getState(),pilot.READY)
+    ex.RunW(p,0)
+    self.assertEqual(p.getState(),pilot.DONE)
+    zeResu=node3.getOutputPort("o3").get()
+    self.assertEqual(zeResu,[[[3.,3.],[4.,4.,4.]],[[12.],[13.,13.],[14.,14.,14.]],[[22.],[23.,23.],[24.,24.,24.],[25.,25.,25.,25.]]])
+    p.saveSchema("foreachImbrBuildFS.xml")
+    pass
+
+  def tearDown(self):
+    del self.r
+    del self.l
+    pass
+
+  pass
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/tmp_dump.py b/tmp_dump.py
new file mode 100644 (file)
index 0000000..eb42c95
--- /dev/null
@@ -0,0 +1,19 @@
+
+# Dump generated by HEXABLOCK at 2014/08/12 17:27:07
+
+import hexablock
+
+doc = hexablock.addDocument ('default')
+rep001 = doc.countVertex ()
+rep002 = doc.countVertex ()
+rep003 = doc.countEdge ()
+rep004 = doc.countQuad ()
+rep005 = doc.countHexa ()
+rep006 = doc.countVertex ()
+law0 = doc.getLaw (0)
+rep007 = doc.countVertex ()
+rep008 = doc.countVertex ()
+rep009 = doc.countEdge ()
+rep010 = doc.countQuad ()
+rep011 = doc.countHexa ()
+rep012 = doc.countVertex ()