<?xml version="1.0" encoding="UTF-8"?>
<fib_object
			  xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"
			  xmlns="http://www.fib-development.org/"
			  xsd:schemaLocation="http://www.fib-development.org/fib.xsd">
	<root>
		<multimedia_info fib_version="3" db_version="5"/>
		<optionalpart>
			<pair key="name" value="triangle"/>
			<pair key="description" value="This object represents a filled triangle between three points (x_1, y_1), (x_2, y_2) and (x_3, y_3)."/>
			<pair key="inVar1::description" value="position of the first point in dimension 1 (x_1)"/>
			<pair key="inVar2::description" value="position of the first point in dimension 2 (y_1)"/>
			<pair key="inVar3::description" value="position of the second point in dimension 1 (x_2)"/>
			<pair key="inVar4::description" value="position of the second point in dimension 2 (y_2)"/>
			<pair key="inVar5::description" value="position of the 3. point in dimension 1 (x_3)"/>
			<pair key="inVar6::description" value="position of the 3. point in dimension 2 (y_3)"/>
			
			<pair key="author" value="Betti Oesterholz"/>
			<pair key="author::email" value="Oesterholz@Fib-Development.org"/>
			<pair key="copyright" value="LGPL3"/>
			
			<pair key="isPointElement" value=""/>
			<pair key="DbObject::isPointSubObject" value="-35"/>
			<pair key="isNotAntialiased" value=""/>
		</optionalpart>
		<input_variables>
			<variable number="1" default="0"/>
			<variable number="2" default="0"/>
			<variable number="3" default="0"/>
			<variable number="4" default="0"/>
			<variable number="5" default="0"/>
			<variable number="6" default="0"/>
		</input_variables>
		<domains>
			<inVar number="1">
				<domainReference subdomain="1">
					<dim count="2">
						<dimension number="1" direction="anywhere"/>
						<dimension number="2" direction="anywhere"/>
					</dim>
				</domainReference>
			</inVar>
			<inVar number="2">
				<domainReference subdomain="2">
					<dim count="2">
						<dimension number="1" direction="anywhere"/>
						<dimension number="2" direction="anywhere"/>
					</dim>
				</domainReference>
			</inVar>
			<inVar number="3">
				<domainReference subdomain="1">
					<dim count="2">
						<dimension number="1" direction="anywhere"/>
						<dimension number="2" direction="anywhere"/>
					</dim>
				</domainReference>
			</inVar>
			<inVar number="4">
				<domainReference subdomain="2">
					<dim count="2">
						<dimension number="1" direction="anywhere"/>
						<dimension number="2" direction="anywhere"/>
					</dim>
				</domainReference>
			</inVar>
			<inVar number="5">
				<domainReference subdomain="1">
					<dim count="2">
						<dimension number="1" direction="anywhere"/>
						<dimension number="2" direction="anywhere"/>
					</dim>
				</domainReference>
			</inVar>
			<inVar number="6">
				<domainReference subdomain="2">
					<dim count="2">
						<dimension number="1" direction="anywhere"/>
						<dimension number="2" direction="anywhere"/>
					</dim>
				</domainReference>
			</inVar>
			<externObject>
				<vector elements="4">
					<integer min="1" max="1" /><!--Identifier-->
					<integer min="8" max="8" /><!--number input values-->
					<naturalNumber max="0" /><!--number subobjects-->
					<naturalNumber max="0" /><!--number output values-->
				</vector>
			</externObject>
			<externObjectInput identifier="1">
				<vector elements="6">
					<naturalNumber max="0" />
					<naturalNumber max="0" />
					<naturalNumber max="0" />
					<naturalNumber max="0" />
					<naturalNumber max="0" />
					<naturalNumber max="0" />
				</vector>
			</externObjectInput>
		</domains>
		<database_identifiers>
			<identifier>-424</identifier>
			<identifier>-210</identifier>
		</database_identifiers>
		<main_fib_object>
			<!-- draw two triangles with subobject id -424;
				one from the left most point and one from the
				right most point;
				if the trangle is drawn from the right most point exlude first
				line of trangle, so the line is not drawn double;
				step 1: sort points in dimension 1 (x)
				step 2: draw triangles
				-->
			<!-- sort points -->
			<if>
				<condition><!-- if ( (x_1 < x_2) and (x_1 < x_3) ) -->
					<and>
						<lo>
							<variable>1</variable>
							<variable>3</variable>
						</lo>
						<lo>
							<variable>1</variable>
							<variable>5</variable>
						</lo>
					</and>
				</condition>
				<!-- point (x_1, y_1) is smallest point -->
				<if>
					<condition><!-- if (x_2 < x_3) -->
						<lo>
							<variable>3</variable>
							<variable>5</variable>
						</lo>
					</condition>
					<!-- point (x_2, y_2) is middle and point (x_3, y_3) the biggest point -->
					<obj identifier="1">
						<vector type="externObjectInput">
							<variable>1</variable>
							<variable>2</variable>
							<variable>3</variable>
							<variable>4</variable>
							<variable>5</variable>
							<variable>6</variable>
						</vector>
					</obj>
					<!-- else point (x_3, y_3) is middle and point (x_2, y_2) the biggest point -->
					<obj identifier="1">
						<vector type="externObjectInput">
							<variable>1</variable>
							<variable>2</variable>
							<variable>5</variable>
							<variable>6</variable>
							<variable>3</variable>
							<variable>4</variable>
						</vector>
					</obj>
				</if>
				<!-- point (x_1, y_1) is not the smallest point -->
				<if>
					<condition><!-- if (x_1 < x_2) -->
						<lo>
							<variable>1</variable>
							<variable>3</variable>
						</lo>
					</condition>
					<!-- point (x_1, y_1) is the middle and (x_2, y_2) the biggest point;
						-> point (x_3, y_3) is the smaales point, because one point have to be smaller than (x_1, y_1) (first if)  -->
					<obj identifier="1">
						<vector type="externObjectInput">
							<variable>5</variable>
							<variable>6</variable>
							<variable>1</variable>
							<variable>2</variable>
							<variable>3</variable>
							<variable>4</variable>
						</vector>
					</obj>
					<!-- else point (x_2, y_2) is smaaler as point (x_1, y_1)-->
					<if>
						<condition><!-- if (x_1 < x_3) -->
							<lo>
								<variable>1</variable>
								<variable>5</variable>
							</lo>
						</condition>
						<!-- point (x_1, y_1) is the middle and (x_3, y_3) the biggest point;
						-> point (x_2, y_2) is the smaales point, because one point have to be smaller than (x_1, y_1) (first if)  -->
						<obj identifier="1">
							<vector type="externObjectInput">
								<variable>3</variable>
								<variable>4</variable>
								<variable>1</variable>
								<variable>2</variable>
								<variable>5</variable>
								<variable>6</variable>
							</vector>
						</obj>
						<!-- else point (x_2, y_2) and  point (x_3, y_3) is smaaler as point (x_1, y_1)
							  -> point point (x_1, y_1) biggest point -->
						<if>
							<condition><!-- if (x_2 < x_3) -->
								<lo>
									<variable>3</variable>
									<variable>5</variable>
								</lo>
							</condition>
							<!-- point (x_2, y_2) is the smallest and (x_3, y_3) the middle point;  -->
							<obj identifier="1">
								<vector type="externObjectInput">
									<variable>3</variable>
									<variable>4</variable>
									<variable>5</variable>
									<variable>6</variable>
									<variable>1</variable>
									<variable>2</variable>
								</vector>
							</obj>
							<!-- else point (x_3, y_3) is the smallest and (x_2, y_2) the middle point;  -->
							<obj identifier="1">
								<vector type="externObjectInput">
									<variable>5</variable>
									<variable>6</variable>
									<variable>3</variable>
									<variable>4</variable>
									<variable>1</variable>
									<variable>2</variable>
								</vector>
							</obj>
						</if>
					</if>
				</if>
			</if>
		</main_fib_object>
		<sub_roots>
			<sub_root identifier="1">
				<root>
					<optionalpart>
						<pair key="name" value="triangle"/>
						<pair key="description" value="This object represents a filled triangle between three sorted points (x_1, y_1), (x_2, y_2) and (x_3, y_3). It is a helper object for the to most root object. For this object the points are sorted in x dimension."/>
						<pair key="inVar1::description" value="position of the smallest (in dimension 1) point in dimension 1 (x_1)"/>
						<pair key="inVar2::description" value="position of the smallest (in dimension 1) point in dimension 2 (y_1)"/>
						<pair key="inVar3::description" value="position of the middle (in dimension 1) point in dimension 1 (x_2)"/>
						<pair key="inVar4::description" value="position of the middle (in dimension 1) point in dimension 2 (y_2)"/>
						<pair key="inVar5::description" value="position of the biggest (in dimension 1) point in dimension 1 (x_3)"/>
						<pair key="inVar6::description" value="position of the biggest (in dimension 1) point in dimension 2 (y_3)"/>
					</optionalpart>
					<input_variables>
						<variable number="1" default="0"/>
						<variable number="2" default="0"/>
						<variable number="3" default="0"/>
						<variable number="4" default="0"/>
						<variable number="5" default="0"/>
						<variable number="6" default="0"/>
					</input_variables>
					<domains>
						<inVar number="1">
							<domainReference subdomain="1">
								<dim count="2">
									<dimension number="1" direction="anywhere"/>
									<dimension number="2" direction="anywhere"/>
								</dim>
							</domainReference>
						</inVar>
						<inVar number="2">
							<domainReference subdomain="2">
								<dim count="2">
									<dimension number="1" direction="anywhere"/>
									<dimension number="2" direction="anywhere"/>
								</dim>
							</domainReference>
						</inVar>
						<inVar number="3">
							<domainReference subdomain="1">
								<dim count="2">
									<dimension number="1" direction="anywhere"/>
									<dimension number="2" direction="anywhere"/>
								</dim>
							</domainReference>
						</inVar>
						<inVar number="4">
							<domainReference subdomain="2">
								<dim count="2">
									<dimension number="1" direction="anywhere"/>
									<dimension number="2" direction="anywhere"/>
								</dim>
							</domainReference>
						</inVar>
						<inVar number="5">
							<domainReference subdomain="1">
								<dim count="2">
									<dimension number="1" direction="anywhere"/>
									<dimension number="2" direction="anywhere"/>
								</dim>
							</domainReference>
						</inVar>
						<inVar number="6">
							<domainReference subdomain="2">
								<dim count="2">
									<dimension number="1" direction="anywhere"/>
									<dimension number="2" direction="anywhere"/>
								</dim>
							</domainReference>
						</inVar>
						<externObject>
							<vector elements="4">
								<integer min="-424" max="-210" /><!--Identifier-->
								<integer min="10" max="10" /><!--number input values-->
								<naturalNumber max="0" /><!--number subobjects-->
								<naturalNumber max="0" /><!--number output values-->
							</vector>
						</externObject>
						<externObjectInput identifier="-210">
							<vector elements="10">
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<naturalNumber max="0" />
							</vector>
						</externObjectInput>
						<externObjectInput identifier="-424">
							<vector elements="10">
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<naturalNumber max="0" />
								<integer min="0" max="1" />
								<integer min="-1" max="0" />
							</vector>
						</externObjectInput>
					</domains>
					<main_fib_object>
						<!-- draw two triangles with subobject id -424;
							one from the left most point and one from the
							right most point;
							if the trangle is drawn from the right most point exlude first
							line of trangle, so the line is not drawn double;
							step 2: draw triangles
							-->
						<list>
							<!-- point (x_1, y_1) is smallest point -> draw triangle from it -->
							<obj identifier="-424">
								<vector type="externObjectInput">
									<variable>1</variable>
									<variable>2</variable>
									<variable>3</variable>
									<variable>4</variable>
									<variable>1</variable>
									<variable>2</variable>
									<variable>5</variable>
									<variable>6</variable>
									<value>0</value>
									<value>-1</value>
								</vector>
							</obj>
							<!-- draw middle line -->
							<obj identifier="-210">
								<vector type="externObjectInput">
									<variable>3</variable>
									<variable>4</variable>
									<variable>1</variable>
									<variable>2</variable>
									<variable>5</variable>
									<variable>6</variable>
									<variable>1</variable>
									<variable>2</variable>
									<variable>5</variable>
									<variable>6</variable>
								</vector>
							</obj>
							<!-- point (x_3, y_3) is biggest point -> draw triangle from it -->
							<obj identifier="-424">
								<vector type="externObjectInput">
									<variable>1</variable>
									<variable>2</variable>
									<variable>5</variable>
									<variable>6</variable>
									<variable>3</variable>
									<variable>4</variable>
									<variable>5</variable>
									<variable>6</variable>
									<value>1</value>
									<value>0</value>
								</vector>
							</obj>
						</list>
					</main_fib_object>
				</root>
			</sub_root>
		</sub_roots>
	</root>
</fib_object>