File: graph_format.docbook

package info (click to toggle)
tulip 3.7.0dfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 39,428 kB
  • sloc: cpp: 231,403; php: 11,023; python: 1,128; sh: 671; yacc: 522; makefile: 315; xml: 63; lex: 55
file content (201 lines) | stat: -rwxr-xr-x 8,047 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<chapter id="graph-format"><title>Tulip graph format</title>
    <sect1 id="nodes-def"><title>Nodes</title>
        <para>The nodes are stored with a list of indices. The indices must be non negative integers.</para>
        <para>Syntax<programlisting>(nodes id_node1 id_node2 ...)</programlisting>
           Sample :<programlisting>(nodes 0 1 2 3 4 5 )</programlisting>
        </para>
    </sect1>
    <sect1 id="edges-def"><title>Edges</title>
        <para>An edge is defined by providing three non negative integers. The first is the id of the edge, the second is the id of source node of the edge and the third is the id of target node of the edge.</para>
        <para>Syntax<programlisting>(edge id id_source id_target)</programlisting>
        Sample<programlisting>(edge 2 2 1)</programlisting>It defines one edge with the node that has the id 2 as source and the node that has the id 1 as target.
        </para>
    </sect1>
    <sect1 id="clusters-def"><title>Clusters</title>
        <para>A cluster is defined by an integer which represent the cluster id, one string which is the name of the cluster(Two clusters can have the same name). Then it is define with a list of nodes and a list of edges. To define a subcluster we use the same method. One important point is that the id zero is reserved for the root graph (thus it cannot be used).</para>
        <para>Syntax<programlisting>
(cluster id name
  (nodes id_node1 id_node2 ...)
  (edges id_edge1 id_edge2 ...)
  (cluster id name
    (nodes id_node1 id_node2 ...)
    (edges id_edge1 id_edge2 ...)
  )
)
            </programlisting>Sample<programlisting>
(cluster 3 "cluster"
  (nodes 1 2 3 )
  (edges 2 8 )
  (cluster 4 "Sub Cluster"
    (nodes 1 2 )
    (edges 2 )
  )
)       </programlisting>
        </para>
    </sect1>
    <sect1 id="pro-def"><title>Definitions of properties</title>
        <para>The definition of properties is the following:</para>
        <para>Syntax <programlisting>
(property cluster_id property_type "property_name"
  (default "default_node_value" "default_edge_value" )
  (node id value)
  ...
  (edge id value)
  ...
)        
</programlisting>Sample<programlisting>
(property  0 bool "viewSelection"
  (default "false" "false" )
  (node 1 "true")
  (node 2 "true")
  (node 3 "true")
  (edge 2 "true")
  (edge 8 "true")
)
</programlisting>
        </para>
        <sect2 id="type-pro"><title>Property Type</title>
        <para>  
        <itemizedlist>
            <listitem><para>layout : This type enables to store nodes position in 3D. The position of nodes is defined by a set of 3 doubles <code>(x_coord,y_coord,z_coord)</code>. The position of edges is a list of 3D points. These points are the bends of edges. <code>((x_coord1,y_coord1,z_coord1)(x_coord2,y_coord2,z_coord2))</code></para></listitem>
            <listitem><para>size : This type enables to store the size of elements. The size is defined with a sequence of three double. <code>(width,heigth,depth)</code></para></listitem>
            <listitem><para>color : This type enables to store the color of elements. The color is defined with a sequence of four integer from 0 to 255. <code>(red,green,blue,alpha)</code></para></listitem>
            <listitem><para>string : This enables to store text on elements.</para></listitem>
            <listitem><para>metric : This enables to store real on elements.</para></listitem>
            <listitem><para>bool : This type enables to store boolean on elements.</para></listitem>
            <listitem><para>int : This type enables to store integers on elements.</para></listitem>  
        </itemizedlist>
        </para>
        </sect2>
    </sect1>
    <sect1 id="pro-tlp"><title>Properties of Tulip</title>
        <para>
        <variablelist>
            <varlistentry>
                <term><code>viewSelection</code></term>
                <listitem><para>type : bool, this property is the one used for selected elements in Tulip.<programlisting>
(property  0 bool "viewSelection"
  (default "false" "false" )
  (node 1 "true")
  (node 2 "true")
  (node 3 "true")
  (edge 2 "true")
  (edge 8 "true")
)
</programlisting></para></listitem>
            </varlistentry>
            <varlistentry>
                <term><code>viewLayout</code></term>
                <listitem><para>type : layout, this property is the one used for displaying graph in Tulip.<programlisting>
(property  0 layout "viewLayout"
  (default "(0,0,0)" "()" )
  (node 1 "(10,10,10)")
  (node 2 "(20,20,20)")
  (edge 1 "(15,15,15)(25,25,25)")
)
</programlisting></para></listitem>
            </varlistentry>
            <varlistentry>
                <term><code>viewColor</code></term>
                <listitem><para>type : color, this property is the one used for coloring graphs in Tulip.<programlisting>
(property  0 color "viewColor"
  (default "(235,0,23,255)" "(0,0,0,0)" )
  (node 1 "(200,0,200,255)")
  (node 2 "(100,100,0,255)")
  (node 3 "(100,100,0,255)")
  (edge 2 "(200,100,100)")
)
</programlisting></para></listitem>
            </varlistentry>
            <varlistentry>
                <term><code>viewLabel</code></term>
                <listitem><para>type : string, this property is the one used for labeling the graphs in Tulip(in label mode).<programlisting>
(property  0 string "viewLabel"
  (default "" "" )
  (node 1 "Hello")
  (node 2 "Bonjour")
  (node 3 "Bye")
  (edge 2 "Aurevoir")
)
</programlisting></para></listitem>
            </varlistentry>
            <varlistentry>
                <term><code>viewSize</code></term>
                <listitem><para>type : size, this property is the one used for the size of elements displayed.<programlisting>
(property  0 size "viewSize"
  (default "(0,0,0)" "(1,1,1)" )
  (node 1 "(10,10,10)")
  (node 2 "(20,20,20)")
)
</programlisting></para></listitem>
            </varlistentry>
            <varlistentry>
                <term><code>viewShape</code></term>
                <listitem><para>type : int, this property is used for defining the shape of elements.<programlisting>
(property  0 int "viewShape"
  (default "0" "0" )
  (node 1 "1")
  (node 2 "2")
)
</programlisting></para></listitem>
            </varlistentry>
            <varlistentry>
                <term><code>viewTexture</code></term>
                <listitem><para></para></listitem>
            </varlistentry>
            <varlistentry>
                <term><code>viewMetaGraph</code></term>
                <listitem><para></para></listitem>
            </varlistentry>
            <varlistentry>
                <term><code>viewRotation</code></term>
                <listitem><para></para></listitem>
            </varlistentry>
        </variablelist>
        </para>
    </sect1>
    <sect1 id="glscene-def"><title>GlScene</title>
        <para>Scene structure are stored with a xml structure.</para>
	<para>First, scene's data (viewport and background color) are store in data element</para>
	<para>Syntax<programlisting>
&lt;data&gt;
  &lt;viewport&gt;(x,y,width,height)&lt;/viewport&gt;
  &lt;background&gt;(red,green,blue,alpha)&lt;/background&gt;
&lt;/data&gt;
	</programlisting></para>
	<para>After, scene children are store in children element</para>
	<para>GlLayer and GlComposite have two elements : data and children</para>
	<para>All others glEntities have one element : data</para>
	<para>The scheme of glScene xml are (for example) : </para>
	<programlisting>
&lt;scene&gt;
  &lt;data&gt;
    ...
  &lt;/data&gt;
  &lt;children&gt;
    &lt;LayerName1 type="GlLayer"&gt;
      &lt;data&gt;
	...
      &lt;/data&gt;
      &lt;children&gt;
	...
      &lt;/children&gt;
    &lt;/LayerName&gt;
    &lt;LayerName2 type="GlLayer"&gt;
      &lt;data&gt;
	...
      &lt;/data&gt;
      &lt;children&gt;
	&lt;EntityName type="EntityType"&gt;
	  &lt;data&gt;
	    ...
	  &lt;/data&gt;
	&lt;/EntityName3&gt;
      &lt;/children&gt;
    &lt;/LayerName2&gt;
  &lt;/children&gt;
&lt;/scene&gt;
	</programlisting>	
	<para>For glEntities data see .cpp file</para>
    </sect1>
</chapter>