<?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="2"/>
		<optionalpart>
			<pair key="name" value="triangle with antialising"/>
			<pair key="description" value="This object represents a filled triangle between tree points (x_1, y_1), (x_2, y_2) and (x_3, y_3) with antialising. The points of the triangle are given back as variables of the subobject."/>
			<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="subObj1::description" value="The points of the triangle. The subobject is called for every point on the triangle."/>
			
			<pair key="subObj1::outVar1::description" value="the position of the triangle point in dimension 1 (x)"/>
			<pair key="subObj1::outVar2::description" value="the position of the triangle point in dimension 2 (y)"/>
			<pair key="subObj1::outVar3::description" value="the antialising factor (1 is full transparent and 0 full opaque)"/>
			
			<pair key="author" value="Betti Oesterholz"/>
			<pair key="author::email" value="Oesterholz@Fib-Development.org"/>
			<pair key="copyright" value="LGPL3"/>
			
			<pair key="isPointSubObject" value=""/>
			<pair key="isAntialiased" value=""/>
			<pair key="DbObject::isNotAntialiased" value="-35"/>
		</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>
			<externSubobject number="1">
				<vector elements="3">
					<!-- actually any numbers are possible;
						the next lines are just a space holder -->
					<naturalNumberB bit="0" />
					<naturalNumberB bit="0" />
					<naturalNumberB bit="0" />
				</vector>
			</externSubobject>
			<externObject>
				<vector elements="4">
					<integer min="-475" max="-475" /><!--Identifier-->
					<integer min="8" max="8" /><!--number input values-->
					<naturalNumber max="1" /><!--number subobjects-->
					<naturalNumber max="3" /><!--number output values-->
				</vector>
			</externObject>
			<externObjectInput identifier="-475">
				<vector elements="8">
					<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>
		</domains>
		<database_identifiers>
			<identifier>-475</identifier>
		</database_identifiers>
		<main_fib_object>
			<!-- draw two triangles with subobject id -475;
				one from the leftmost point and one from the
				rightmost point-->
			<list>
				<if><!--draw triangle from (x_1, y_1), if it is not the middle point-->
					<condition>
						<!--if not( (x_2 < x_1) and (x_1 < x3) ) or not( (x_3 < x_1) and (x_1 < x_2) )-->
						<or>
							<not>
								<and>
									<lo>
										<variable>3</variable>
										<variable>1</variable>
									</lo>
									<lo>
										<variable>1</variable>
										<variable>5</variable>
									</lo>
								</and>
							</not>
							<not>
								<and>
									<lo>
										<variable>5</variable>
										<variable>1</variable>
									</lo>
									<lo>
										<variable>1</variable>
										<variable>3</variable>
									</lo>
								</and>
							</not>
						</or>
					</condition>
					<!--point (x_1, y_1) is extremal point -> draw triangle from it-->
					<obj identifier="-475">
						<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>
						</vector>
						<subobject>
							<output_variables>
								<variable>7</variable>
								<variable>8</variable>
								<variable>9</variable>
							</output_variables>
							<subobject number="1">
								<vector type="externSubobject">
									<variable>7</variable>
									<variable>8</variable>
									<variable>9</variable>
								</vector>
							</subobject>
						</subobject>
					</obj>
					<!--else draw nothing-->
					<point/>
				</if>
				
				<if><!--draw triangle from (x_2, y_2), if it is not the middle point-->
					<condition>
						<!--if not( (x_1 < x_2) and (x_2 < x3) ) or not( (x_3 < x_2) and (x_2 < x_1) )-->
						<or>
							<not>
								<and>
									<lo>
										<variable>1</variable>
										<variable>3</variable>
									</lo>
									<lo>
										<variable>3</variable>
										<variable>5</variable>
									</lo>
								</and>
							</not>
							<not>
								<and>
									<lo>
										<variable>5</variable>
										<variable>3</variable>
									</lo>
									<lo>
										<variable>3</variable>
										<variable>1</variable>
									</lo>
								</and>
							</not>
						</or>
					</condition>
					<!--point (x_1, y_1) is extremal point -> draw triangle from it-->
					<obj identifier="-475">
						<vector type="externObjectInput">
							<variable>3</variable>
							<variable>4</variable>
							<variable>1</variable>
							<variable>2</variable>
							<variable>3</variable>
							<variable>4</variable>
							<variable>5</variable>
							<variable>6</variable>
						</vector>
						<subobject>
							<output_variables>
								<variable>7</variable>
								<variable>8</variable>
								<variable>9</variable>
							</output_variables>
							<subobject number="1">
								<vector type="externSubobject">
									<variable>7</variable>
									<variable>8</variable>
									<variable>9</variable>
								</vector>
							</subobject>
						</subobject>
					</obj>
					<!--else draw nothing-->
					<point/>
				</if>
				
				<if><!--draw triangle from (x_3, y_3), if it is not the middle point-->
					<condition>
						<!--if not( (x_2 < x_3) and (x_3 < x1) ) or not( (x_1 < x_3) and (x_3 < x_2) )-->
						<or>
							<not>
								<and>
									<lo>
										<variable>3</variable>
										<variable>5</variable>
									</lo>
									<lo>
										<variable>5</variable>
										<variable>1</variable>
									</lo>
								</and>
							</not>
							<not>
								<and>
									<lo>
										<variable>1</variable>
										<variable>5</variable>
									</lo>
									<lo>
										<variable>5</variable>
										<variable>3</variable>
									</lo>
								</and>
							</not>
						</or>
					</condition>
					<!--point (x_1, y_1) is extremal point -> draw triangle from it-->
					<obj identifier="-475">
						<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>
						</vector>
						<subobject>
							<output_variables>
								<variable>7</variable>
								<variable>8</variable>
								<variable>9</variable>
							</output_variables>
							<subobject number="1">
								<vector type="externSubobject">
									<variable>7</variable>
									<variable>8</variable>
									<variable>9</variable>
								</vector>
							</subobject>
						</subobject>
					</obj>
					<!--else draw nothing-->
					<point/>
				</if>
				
			</list>
		</main_fib_object>
	</root>
</fib_object>