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)
# ==============
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})
| | | |
| | |**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`. |
| | | |
| | | |
| | |**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`. |
| | | |
| | |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.
| | | |
| | |**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`. |
| | | |
| | | |
| | |**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`. |
| | | |
| | | |
| | |**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::
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.
+
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
//! 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;
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
_dragModifier=false;
setColumnCount(1);
+ setHeaderHidden( true );
addCatalog(_builtinCatalog, "Built In");
addCatalog(_sessionCatalog, "Current Session");
_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,
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)));
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 );
_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;
QAction *_zoomToBlocAct;
QAction *_centerOnNodeAct;
QAction *_shrinkExpand;
+ QAction *_shrinkExpandChildren;
+ QAction *_shrinkExpandElementaryRecursively;
QAction *_toggleStraightLinksAct;
QAction *_toggleAutomaticComputeLinkAct;
void onZoomToBloc();
void onCenterOnNode();
void onShrinkExpand();
+ void onShrinkExpandChildren();
+ void onShrinkExpandElementaryRecursively();
void onToggleStraightLinks(bool checked);
void onToggleAutomaticComputeLinks(bool checked);
void onToggleSimplifyLinks(bool checked);
/*!
* 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();
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();
}
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();
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);
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);
_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]);
};
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();
}
}
-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())
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();
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();
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();
}
}
-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(0, 0);
else
setPos(_expandedPos);
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;
}
-void SceneItem::shrinkExpandRecursive(bool isExpanding, bool fromHere)
+void SceneItem::shrinkExpandRecursive(bool isExpanding, bool fromHere, ShrinkMode theShrinkMode)
{
}
{
namespace HMI
{
+ typedef enum
+ {
+ CurrentNode,
+ ChildrenNodes,
+ ElementaryNodes
+ } ShrinkMode;
+
class Scene;
class RootSceneItem: public GuiObserver
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;
{
}
-void SceneNodeItem::reorganizeShrinkExpand()
+void SceneNodeItem::reorganizeShrinkExpand(ShrinkMode theShrinkMode)
{
}
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)
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();
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();
-}
-
QString label, Subject *subject);
virtual ~SceneProcItem();
virtual void popupMenu(QWidget *caller, const QPoint &globalPos);
- virtual void reorganizeShrinkExpand();
};
}
}
<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>
<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>
<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>
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,
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,
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,
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,
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;
}
}
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;
}
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;
}
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;
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;
}
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()
--- /dev/null
+# 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()
--- /dev/null
+
+# 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 ()