Salome HOME
optparse => argparse
[modules/hexablock.git] / doc / tui_edge.rst
1 :tocdepth: 3
2
3
4 .. _tuiedge:
5
6 =====
7 Edges
8 =====
9
10 Manage the edges of the document.
11
12 Add an edge, defined by two vertices, in the document::
13
14     edge_12 = doc.addEdge(vertex_1, vertex_2)
15
16 Add an edge, defined by one vertex and one vector, in the document::
17
18     edge_12 = doc.addEdgeVector(vertex, vector)
19     
20 Get the number of all edges in the document::
21
22     sum_a = doc.countEdge()
23
24 Get the number of edges used only in the model of blocks::
25
26     sum_u = doc.countUsedEdge()
27     
28 Get the edges used by the model of blocks
29
30 .. literalinclude:: test_doc/edge/edge.py
31
32 Get an edge of the document::
33
34     edge_i = doc.getEdge(i)
35
36 Get the vertices of an edge::
37
38     vertex_a = edge_i.getVertex(0)
39     vertex_b = edge_i.getVertex(1)
40
41 Find an edge in the document::
42
43     edge_f = doc.findEdge(vertex_1, vertex_2)
44
45 More operations: *Edge* inherits :ref:`Element <tuielement>`.
46
47 GUI command: :ref:`guiedge`