.. _choregraphe-reference-box-type-flow-diagram: Flow diagram box ================ What is a Flow diagram box --------------------------- .. image:: /medias/desktop/choregraphe/chore_ref_flow_diagram_box.png A flow diagram box is a :ref:`box ` which includes a :ref:`script ` and a :ref:`flow diagram `. Thanks to its flow diagram, a flow diagram box may contain boxes which in turn may also contain boxes if they are flow diagram boxes. And all these boxes can be connected to each other, thus creating a complex and structured behavior. This enables you to easily organize your behavior with **several levels of flow diagram**, each level corresponding to the diagram of a box. .. _choregraphe-howto-create-flow-diagram-box: How to create a flow diagram box -------------------------------- Creating a flow diagram box can be useful to encapsulate other boxes into a unique behavior. To create flow diagram box: #. Right click on your diagram wherever you want to create the box. #. Click on **Add a new Box** in the context menu. The **Create a new box** menu is displayed. .. image:: /medias/desktop/choregraphe/chore_create_new_box.jpg #. Add a name and a tooltip for your box. #. **Optional**: set the picture to recognize it among other boxes in your diagram. #. **Optional**: set parameters, inputs and outputs that can be manipulated by the box. For further details about parameters, see :ref:`How to add/remove inputs, outputs, parameters in a box ` section. #. In the box type part, select **Flow diagram**. #. Click on **Ok**. The created Flow box is displayed on the diagram. If you double click on your box to get into it you will see another diagram. .. image:: /medias/desktop/choregraphe/create_flow_diagram.png What is ... ----------- .. _choregraphe-reference-box-flow-diagram: Flow diagram of a box (or a behavior) +++++++++++++++++++++++++++++++++++++ .. image:: /medias/desktop/choregraphe/chore_setVolume.png A flow diagram is a diagram containing boxes linked to each other. In a flow diagram, you can access to most :abbr:`I/O (inputs/outputs)` of the box (or the behavior). Accessible inputs are at top-left of the flow diagram and outputs are at top-right. To see which natures of :abbr:`I/O (inputs/outputs)` are accessible, see the sections: :ref:`choregraphe-reference-box-input` and :ref:`choregraphe-reference-box-output`. .. _choregraphe-reference-box-parent: .. _choregraphe-reference-box-child: Parent box and child box (or sub-box) +++++++++++++++++++++++++++++++++++++ **The parent box** of a box is the box which :ref:`flow diagram ` directly contains this other box. A **child box** (or a sub-box) of an other box is then a box which is contained in the :ref:`flow diagram ` of this other box. For example we have two boxes: A and B. A is a flow diagram box. B is one of the boxes contained in the diagram of A. Then A is B's parent box. And B is one of A's child boxes (or sub-boxes) .. image:: /medias/desktop/choregraphe/chore_ref_parent_child_box.png .. note:: In this case B is one of A's :ref:`child boxes `. You can also say that a box is **a parent box** of another if it is its indirect parent (for example if it is the parent of its parent box or the parent of the parent of its parent box).