Index: GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/GUILayout.xsd
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/GUILayout.xsd	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/GUILayout.xsd	(revision 774)
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+	<xsd:element name="GUILayout" type="GUILayoutType"/>
+	
+	<xsd:complexType name="GUILayoutType">
+		<xsd:sequence>
+			<xsd:element name="Window" type="WindowType" />
+		</xsd:sequence>
+		<xsd:attribute name="Parent" type="xsd:string" use="optional" default=""/>
+	</xsd:complexType>
+	
+	<xsd:complexType name="WindowType">
+		<xsd:sequence>
+			<xsd:element name="LayoutImport" type="LayoutImportType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Event" type="EventType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Window" type="WindowType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="Type" type="xsd:string" use="required"/>
+		<xsd:attribute name="Name" type="xsd:string" use="required"/>
+	</xsd:complexType>
+
+	<xsd:complexType name="PropertyType">
+		<xsd:attribute name="Name" type="xsd:string" use="required"/>
+		<xsd:attribute name="Value" type="xsd:string" use="required"/>
+	</xsd:complexType>
+
+	<xsd:complexType name="LayoutImportType">
+		<xsd:attribute name="Filename" type="xsd:string" use="required"/>
+		<xsd:attribute name="Prefix" type="xsd:string" use="optional" default="" />
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+	</xsd:complexType>
+
+	<xsd:complexType name="EventType">
+		<xsd:attribute name="Name" type="xsd:string" use="required"/>
+		<xsd:attribute name="Function" type="xsd:string" use="required"/>
+	</xsd:complexType>
+
+</xsd:schema>
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/TaharezLook.imageset
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/TaharezLook.imageset	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/TaharezLook.imageset	(revision 774)
@@ -0,0 +1,200 @@
+<?xml version="1.0" ?>
+<Imageset Name="TaharezLook" Imagefile="TaharezLook.tga" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true">
+	<Image Name="ClientBrush" XPos="2" YPos="2" Width="64" Height="64" />
+	<Image Name="WindowLeftEdge" XPos="6" YPos="95" Width="1" Height="22" XOffset="4" />
+	<Image Name="WindowRightEdge" XPos="34" YPos="95" Width="1" Height="22" XOffset="-5" />
+	<Image Name="WindowTopEdge" XPos="9" YPos="68" Width="23" Height="1" />
+	<Image Name="WindowBottomEdge" XPos="9" YPos="143" Width="23" Height="1" />
+	<Image Name="WindowTopLeft" XPos="2" YPos="68" Width="5" Height="24" />
+	<Image Name="WindowTopRight" XPos="34" YPos="68" Width="5" Height="24" />
+	<Image Name="WindowBottomLeft" XPos="2" YPos="120" Width="5" Height="24" />
+	<Image Name="WindowBottomRight" XPos="34" YPos="120" Width="5" Height="24" />
+	<Image Name="ButtonLeftNormal" XPos="68" YPos="20" Width="12" Height="16" />
+	<Image Name="ButtonMiddleNormal" XPos="82" YPos="20" Width="12" Height="16" />
+	<Image Name="ButtonRightNormal" XPos="96" YPos="20" Width="12" Height="16" />
+	<Image Name="ButtonLeftPushed" XPos="68" YPos="38" Width="12" Height="16" />
+	<Image Name="ButtonMiddlePushed" XPos="82" YPos="38" Width="12" Height="16" />
+	<Image Name="ButtonRightPushed" XPos="96" YPos="38" Width="12" Height="16" />
+	<Image Name="ButtonLeftHighlight" XPos="68" YPos="56" Width="12" Height="16" />
+	<Image Name="ButtonMiddleHighlight" XPos="82" YPos="56" Width="12" Height="16" />
+	<Image Name="ButtonRightHighlight" XPos="96" YPos="56" Width="12" Height="16" />
+	<Image Name="CheckboxNormal" XPos="110" YPos="2" Width="12" Height="12" />
+	<Image Name="CheckboxHover" XPos="110" YPos="30" Width="12" Height="12" />
+	<Image Name="CheckboxMark" XPos="110" YPos="16" Width="12" Height="12" />
+	<Image Name="RadioButtonNormal" XPos="124" YPos="2" Width="12" Height="12" />
+	<Image Name="RadioButtonHover" XPos="124" YPos="30" Width="12" Height="12" />
+	<Image Name="RadioButtonMark" XPos="124" YPos="16" Width="12" Height="12" />
+	<Image Name="TitlebarLeft" XPos="68" YPos="2" Width="8" Height="16" />
+	<Image Name="TitlebarMiddle" XPos="78" YPos="2" Width="8" Height="16" />
+	<Image Name="TitlebarRight" XPos="88" YPos="2" Width="8" Height="16" />
+	<Image Name="NewTitlebarLeft" XPos="61" YPos="127" Width="13" Height="16" />
+	<Image Name="NewTitlebarMiddle" XPos="77" YPos="127" Width="12" Height="16" />
+	<Image Name="NewTitlebarRight" XPos="92" YPos="127" Width="12" Height="16" />
+	<Image Name="SysAreaMiddle" XPos="107" YPos="127" Width="12" Height="16" />
+	<Image Name="SysAreaRight" XPos="122" YPos="127" Width="13" Height="16" />
+	<Image Name="StaticLeft" XPos="41" YPos="89" Width="6" Height="6" />
+	<Image Name="StaticRight" XPos="63" YPos="89" Width="6" Height="6" />
+	<Image Name="StaticTop" XPos="52" YPos="78" Width="6" Height="6" />
+	<Image Name="StaticBottom" XPos="52" YPos="100" Width="6" Height="6" />
+	<Image Name="StaticTopLeft" XPos="41" YPos="78" Width="6" Height="6" />
+	<Image Name="StaticTopRight" XPos="63" YPos="78" Width="6" Height="6" />
+	<Image Name="StaticBottomLeft" XPos="41" YPos="100" Width="6" Height="6" />
+	<Image Name="StaticBottomRight" XPos="63" YPos="100" Width="6" Height="6" />
+	<Image Name="StaticBackdrop" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="ProgressBarLeft" XPos="71" YPos="74" Width="7" Height="12" />
+	<Image Name="ProgressBarMiddle" XPos="80" YPos="74" Width="6" Height="12" />
+	<Image Name="ProgressBarRight" XPos="88" YPos="74" Width="6" Height="12" />
+	<Image Name="ProgressBarDimSegment" XPos="96" YPos="74" Width="8" Height="12" />
+	<Image Name="ProgressBarLitSegment" XPos="106" YPos="74" Width="8" Height="12" />
+	<Image Name="EditBoxLeft" XPos="41" YPos="108" Width="4" Height="18" />
+	<Image Name="EditBoxMiddle" XPos="47" YPos="108" Width="4" Height="18" />
+	<Image Name="EditBoxRight" XPos="53" YPos="108" Width="4" Height="18" />
+	<Image Name="EditBoxCarat" XPos="60" YPos="108" Width="4" Height="18" />
+	<Image Name="TextSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" />
+	<Image Name="VertScrollTop" XPos="182" YPos="2" Width="20" Height="8" />
+	<Image Name="VertScrollMiddle" XPos="182" YPos="12" Width="20" Height="8" />
+	<Image Name="VertScrollBottom" XPos="182" YPos="22" Width="20" Height="8" />
+	<Image Name="VertScrollBarSegment" XPos="206" YPos="2" Width="4" Height="10" />
+	<Image Name="VertScrollThumbNormal" XPos="214" YPos="2" Width="8" Height="24" />
+	<Image Name="VertScrollThumbHover" XPos="224" YPos="2" Width="8" Height="24" />
+	<Image Name="VertScrollUpNormal" XPos="196" YPos="32" Width="12" Height="12" />
+	<Image Name="VertScrollDownNormal" XPos="182" YPos="32" Width="12" Height="12" />
+	<Image Name="VertScrollUpHover" XPos="196" YPos="46" Width="12" Height="12" />
+	<Image Name="VertScrollDownHover" XPos="182" YPos="46" Width="12" Height="12" />
+	<Image Name="MiniVertScrollBarSegment" XPos="207" YPos="60" Width="4" Height="10" />
+	<Image Name="MiniVertScrollThumbNormal" XPos="214" YPos="59" Width="7" Height="22" />
+	<Image Name="MiniVertScrollThumbTopNormal" XPos="214" YPos="59" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbMiddleNormal" XPos="214" YPos="65" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbBottomNormal" XPos="214" YPos="76" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbTopHover" XPos="223" YPos="59" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbMiddleHover" XPos="223" YPos="65" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbBottomHover" XPos="223" YPos="76" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbHover" XPos="223" YPos="59" Width="7" Height="22" />
+	<Image Name="MiniVertScrollUpNormal" XPos="194" YPos="60" Width="10" Height="9" />
+	<Image Name="MiniVertScrollDownNormal" XPos="182" YPos="59" Width="10" Height="9" />
+	<Image Name="MiniVertScrollUpHover" XPos="194" YPos="70" Width="10" Height="9" />
+	<Image Name="MiniVertScrollDownHover" XPos="182" YPos="69" Width="10" Height="9" />
+	<Image Name="VertSliderBody" XPos="234" YPos="2" Width="9" Height="48" />
+	<Image Name="VertSliderThumbNormal" XPos="217" YPos="28" Width="15" Height="6" />
+	<Image Name="VertSliderThumbHover" XPos="217" YPos="36" Width="15" Height="6" />
+	<Image Name="MiniHorzScrollBarSegment" XPos="244" YPos="80" Width="10" Height="4" />
+	<Image Name="MiniHorzScrollThumbNormal" XPos="233" YPos="87" Width="22" Height="7" />
+	<Image Name="MiniHorzScrollThumbLeftNormal" XPos="233" YPos="87" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbMiddleNormal" XPos="239" YPos="87" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbRightNormal" XPos="250" YPos="87" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbHover" XPos="233" YPos="96" Width="22" Height="7" />
+	<Image Name="MiniHorzScrollThumbLeftHover" XPos="233" YPos="96" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbMiddleHover" XPos="239" YPos="96" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbRightHover" XPos="250" YPos="96" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollLeftNormal" XPos="246" YPos="55" Width="9" Height="10" />
+	<Image Name="MiniHorzScrollRightNormal" XPos="245" YPos="67" Width="9" Height="10" />
+	<Image Name="MiniHorzScrollLeftHover" XPos="236" YPos="55" Width="9" Height="10" />
+	<Image Name="MiniHorzScrollRightHover" XPos="235" YPos="67" Width="9" Height="10" />
+	<Image Name="ListboxLeft" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="ListboxRight" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="ListboxTop" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="ListboxBottom" XPos="52" YPos="99" Width="6" Height="7" />
+	<Image Name="ListboxTopLeft" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="ListboxTopRight" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="ListboxBottomLeft" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="ListboxBottomRight" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="ListboxBackdrop" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="ListboxSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" />
+	<Image Name="ComboboxEditLeft" XPos="138" YPos="2" Width="8" Height="16" />
+	<Image Name="ComboboxEditMiddle" XPos="148" YPos="2" Width="8" Height="16" />
+	<Image Name="ComboboxListButtonNormal" XPos="158" YPos="2" Width="16" Height="16" />
+	<Image Name="ComboboxListButtonHover" XPos="158" YPos="20" Width="16" Height="16" />
+	<Image Name="ComboboxListLeft" XPos="138" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxListRight" XPos="158" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxListTop" XPos="148" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxListBottom" XPos="148" YPos="58" Width="8" Height="8" />
+	<Image Name="ComboboxListTopLeft" XPos="138" YPos="38" Width="8" Height="8" />
+	<Image Name="ComboboxListTopRight" XPos="158" YPos="38" Width="8" Height="8" />
+	<Image Name="ComboboxListBottomLeft" XPos="138" YPos="58" Width="8" Height="8" />
+	<Image Name="ComboboxListBottomRight" XPos="158" YPos="58" Width="8" Height="8" />
+	<Image Name="ComboboxListBackdrop" XPos="148" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" />
+	<Image Name="ComboboxDividerLeft" XPos="138" YPos="68" Width="14" Height="1" />
+	<Image Name="ComboboxDividerMiddle" XPos="154" YPos="68" Width="8" Height="1" />
+	<Image Name="ComboboxDividerRight" XPos="164" YPos="68" Width="14" Height="1" />
+	<Image Name="HeaderBarBackdropNormal" XPos="230" YPos="163" Width="10" Height="12" />
+	<Image Name="HeaderBarBackdropHover" XPos="230" YPos="163" Width="10" Height="12" />
+	<Image Name="HeaderBarSplitterNormal" XPos="225" YPos="92" Width="3" Height="16" />
+	<Image Name="HeaderBarSplitterHover" XPos="200" YPos="92" Width="3" Height="16" />
+	<Image Name="HeaderBarSortUp" XPos="233" YPos="178" Width="8" Height="8" />
+	<Image Name="HeaderBarSortDown" XPos="244" YPos="178" Width="8" Height="8" />
+	<Image Name="MultiListLeft" XPos="170" YPos="92" Width="7" Height="6" />
+	<Image Name="MultiListRight" XPos="191" YPos="92" Width="7" Height="6" />
+	<Image Name="MultiListTop" XPos="181" YPos="81" Width="6" Height="7" />
+	<Image Name="MultiListBottom" XPos="181" YPos="102" Width="6" Height="7" />
+	<Image Name="MultiListTopLeft" XPos="170" YPos="81" Width="7" Height="7" />
+	<Image Name="MultiListTopRight" XPos="191" YPos="81" Width="7" Height="7" />
+	<Image Name="MultiListBottomLeft" XPos="170" YPos="102" Width="7" Height="7" />
+	<Image Name="MultiListBottomRight" XPos="191" YPos="102" Width="7" Height="7" />
+	<Image Name="MultiListBackdrop" XPos="181" YPos="92" Width="6" Height="6" />
+	<Image Name="MultiListSelectionBrush" XPos="9" YPos="71" Width="14" Height="14" />
+	<Image Name="AltProgressLeft" XPos="71" YPos="88" Width="8" Height="12" />
+	<Image Name="AltProgressMiddle" XPos="81" YPos="88" Width="8" Height="12" />
+	<Image Name="AltProgressRight" XPos="91" YPos="88" Width="8" Height="12" />
+	<Image Name="AltProgressQuarter" XPos="102" YPos="89" Width="3" Height="4" />
+	<Image Name="AltProgressHalf" XPos="109" YPos="89" Width="4" Height="5" />
+	<Image Name="AltProgressLight1" XPos="100" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight2" XPos="106" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight3" XPos="112" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight4" XPos="118" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight5" XPos="124" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight6" XPos="130" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight7" XPos="136" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight8" XPos="142" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight9" XPos="148" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight10" XPos="154" YPos="97" Width="4" Height="8" />
+	<Image Name="CloseButtonNormal" XPos="41" YPos="128" Width="16" Height="16" />
+	<Image Name="CloseButtonHover" XPos="41" YPos="146" Width="16" Height="16" />
+	<Image Name="CloseButtonPressed" XPos="41" YPos="164" Width="16" Height="16" />
+	<Image Name="NewCloseButtonNormal" XPos="90" YPos="146" Width="10" Height="10" />
+	<Image Name="NewCloseButtonHover" XPos="90" YPos="146" Width="10" Height="10" />
+	<Image Name="NewCloseButtonPressed" XPos="90" YPos="146" Width="10" Height="10" />
+	<Image Name="MultiLineEditboxLeft" XPos="41" YPos="89" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxRight" XPos="63" YPos="89" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxTop" XPos="52" YPos="78" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBottom" XPos="52" YPos="100" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxTopLeft" XPos="41" YPos="78" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxTopRight" XPos="63" YPos="78" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBottomLeft" XPos="41" YPos="100" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBottomRight" XPos="63" YPos="100" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBackdrop" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxSelectionBrush" XPos="9" YPos="71" Width="14" Height="14" />
+	<Image Name="MouseTarget" XPos="182" YPos="127" Width="17" Height="17" XOffset="-8" YOffset="-8" />
+	<Image Name="MouseArrow" XPos="138" YPos="127" Width="31" Height="25" XOffset="0" YOffset="0" />
+	<Image Name="MouseMoveCursor" XPos="201" YPos="127" Width="18" Height="18" XOffset="-8" YOffset="-8" />
+	<Image Name="MouseNoSoCursor" XPos="221" YPos="127" Width="8" Height="18" XOffset="-3" YOffset="-8" />
+	<Image Name="MouseEsWeCursor" XPos="182" YPos="150" Width="18" Height="8" XOffset="-8" YOffset="-3" />
+	<Image Name="MouseNeSwCursor" XPos="201" YPos="147" Width="14" Height="14" XOffset="-7" YOffset="-7" />
+	<Image Name="MouseNwSeCursor" XPos="230" YPos="126" Width="14" Height="14" XOffset="-7" YOffset="-7" />
+	<Image Name="MouseTextBar" XPos="173" YPos="127" Width="7" Height="18" XOffset="-2" YOffset="-9" />
+	<Image Name="TabControlButtonPaneFiller" XPos="197" YPos="201" Width="7" Height="1" />
+	<Image Name="TabPaneLeft" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="TabPaneRight" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="TabPaneLower" XPos="52" YPos="99" Width="6" Height="7" />
+	<Image Name="TabPaneLowerLeft" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="TabPaneLowerRight" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="TabPaneMiddle" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TabButtonLeftNormal" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonRightNormal" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonUpperNormal" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="TabButtonLowerNormal" XPos="52" YPos="99" Width="6" Height="7" />
+	<Image Name="TabButtonUpperLeftNormal" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonUpperRightNormal" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonLowerLeftNormal" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonLowerRightNormal" XPos="187" YPos="195" Width="7" Height="7" />
+	<Image Name="TabButtonMiddleNormal" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TabButtonLeftSelected" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonRightSelected" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonUpperSelected" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="TabButtonLowerSelected" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TabButtonUpperLeftSelected" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonUpperRightSelected" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonLowerLeftSelected" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonLowerRightSelected" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonMiddleSelected" XPos="52" YPos="89" Width="6" Height="6" />
+</Imageset>
Index: GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/cegui8.layout
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/cegui8.layout	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/cegui8.layout	(revision 774)
@@ -0,0 +1,130 @@
+<?xml version="1.0" ?>
+<!-- Layout file from CEGUI Demo8 -->
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="demo_root">
+
+	<Window Type="DefaultGUISheet" Name="Demo8">
+
+		<Property Name="RelativeMaxSize" Value="w:1 h:2" />
+		<Property Name="Size" Value="w:1 h:2" />
+
+		<Window Type="TaharezLook/VerticalScrollbar" Name="Demo8/ViewScroll">
+			<Property Name="Position" Value="x:0.0 y:0.0" />
+			<Property Name="Size" Value="w:0.03 h:0.75" />
+			<Property Name="DocumentSize" Value="2" />
+			<Property Name="PageSize" Value="1" />
+			<Property Name="StepSize" Value="0.01" />
+			<Property Name="OverlapSize" Value="0.5" />
+		</Window>
+
+        <Window Type="TaharezLook/FrameWindow" Name="Demo8/Window1">
+			<Property Name="Position" Value="x:0.05 y:0.1" />
+			<Property Name="RelativeMaxSize" Value="w:0.5 h:1" />
+			<Property Name="AbsoluteMinSize" Value="w:128 h:128" />
+			<Property Name="Size" Value="w:0.4 h:0.35" />
+			<Property Name="Text" Value="Demo 8 - Listbox Demo" />
+
+			<Window Type="TaharezLook/Listbox" Name="Demo8/Window1/Listbox">
+				<Property Name="Position" Value="x:0.05 y:0.1" />
+				<Property Name="RelativeMaxSize" Value="w:1 h:1" />
+				<Property Name="Size" Value="w:0.9 h:0.33" />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="Demo8/Window1/Controls">
+				<Property Name="Position" Value="x:0.05 y:0.45" />
+				<Property Name="RelativeMaxSize" Value="w:1 h:1" />
+				<Property Name="Size" Value="w:0.9 h:0.5" />
+
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Demo8/Window1/Controls/Red">
+					<Property Name="Position" Value="x:0.05 y:0.05" />
+					<Property Name="RelativeMaxSize" Value="w:1 h:1" />
+					<Property Name="Size" Value="w:0.9 h:0.06" />
+					<Property Name="DocumentSize" Value="255" />
+					<Property Name="PageSize" Value="16" />
+					<Property Name="StepSize" Value="1" />
+					<Property Name="OverlapSize" Value="1" />
+				</Window>
+
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Demo8/Window1/Controls/Green">
+					<Property Name="Position" Value="x:0.05 y:0.12" />
+					<Property Name="RelativeMaxSize" Value="w:1 h:1" />
+					<Property Name="Size" Value="w:0.9 h:0.06" />
+					<Property Name="DocumentSize" Value="256" />
+					<Property Name="PageSize" Value="16" />
+					<Property Name="StepSize" Value="1" />
+					<Property Name="OverlapSize" Value="1" />
+				</Window>
+
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Demo8/Window1/Controls/Blue">
+					<Property Name="Position" Value="x:0.05 y:0.19" />
+					<Property Name="RelativeMaxSize" Value="w:1 h:1" />
+					<Property Name="Size" Value="w:0.9 h:0.06" />
+					<Property Name="DocumentSize" Value="255" />
+					<Property Name="PageSize" Value="16" />
+					<Property Name="StepSize" Value="1" />
+					<Property Name="OverlapSize" Value="1" />
+				</Window>
+
+				<Window Type="TaharezLook/StaticImage" Name="Demo8/Window1/Controls/ColourSample">
+					<Property Name="Position" Value="x:0.05 y:0.26" />
+					<Property Name="RelativeMaxSize" Value="w:1 h:1" />
+					<Property Name="Size" Value="w:0.9 h:0.1" />
+					<Property Name="Image" Value="set:TaharezLook image:ListboxSelectionBrush" />
+					<Property Name="ImageColours" Value="tl:0 tr:0 bl:0 br:0" />
+				</Window>
+
+				<Window Type="TaharezLook/Editbox" Name="Demo8/Window1/Controls/Editbox">
+					<Property Name="Position" Value="x:0.05 y:0.38" />
+					<Property Name="RelativeMaxSize" Value="w:1 h:1" />
+					<Property Name="Size" Value="w:0.6 h:0.15" />
+				</Window>
+
+                <Window Type="TaharezLook/Button" Name="Demo8/Window1/Controls/Add">
+					<Property Name="Position" Value="x:0.68 y:0.38" />
+					<Property Name="RelativeMaxSize" Value="w:1 h:1" />
+					<Property Name="Size" Value="w:0.3 h:0.15" />
+					<Property Name="Text" Value="Add" />
+				</Window>
+
+                <Window Type="TaharezLook/StaticText" Name="Demo8/Window1/Controls/ins1">
+					<Property Name="Position" Value="x:0.05 y:0.55" />
+					<Property Name="RelativeMaxSize" Value="w:1 h:1" />
+					<Property Name="Size" Value="w:0.9 h:0.4" />
+					<Property Name="HorzFormatting" Value="WordWrapCentred" />
+					<Property Name="Text" Value="Use this panel to add items.  The scrollbars change the selection colour." />
+				</Window>
+
+			</Window>
+			
+		</Window>
+
+        <Window Type="TaharezLook/FrameWindow" Name="Demo8/Window2">
+			<Property Name="Position" Value="x:0.55 y:0.1" />
+			<Property Name="RelativeMaxSize" Value="w:0.5 h:1" />
+			<Property Name="AbsoluteMinSize" Value="w:128 h:128" />
+			<Property Name="Size" Value="w:0.4 h:0.3" />
+			<Property Name="Text" Value="Demo 8 - Information Window" />
+
+            <Window Type="TaharezLook/StaticText" Name="Demo8/Window2/Info">
+				<Property Name="Position" Value="x:0.05 y:0.1" />
+				<Property Name="RelativeMaxSize" Value="w:1 h:1" />
+				<Property Name="Size" Value="w:0.9 h:0.3" />
+				<Property Name="HorzFormatting" Value="WordWrapCentred" />
+				<Property Name="Text" Value="The panel below gives some information about the item under the mouse." />
+			</Window>
+	
+            <Window Type="TaharezLook/StaticText" Name="Demo8/Window2/Tips">
+				<Property Name="Position" Value="x:0.05 y:0.5" />
+				<Property Name="RelativeMaxSize" Value="w:1 h:1" />
+				<Property Name="Size" Value="w:0.9 h:0.4" />
+				<Property Name="HorzFormatting" Value="WordWrapCentred" />
+			</Window>
+
+		</Window>
+
+
+	</Window>
+
+</Window>
+
+</GUILayout>
Index: GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/Font.xsd
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/Font.xsd	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/Font.xsd	(revision 774)
@@ -0,0 +1,49 @@
+<?xml version="1.0" ?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+	<xsd:element name="Font" type="FontType" />
+
+	<xsd:complexType name="FontType">
+		<xsd:sequence>
+			<xsd:element name="Mapping" type="MapType" maxOccurs="unbounded" minOccurs="0" />
+			<xsd:element name="GlyphSet" type="GlyphSetType" maxOccurs="unbounded" minOccurs="0" />
+			<xsd:element name="GlyphRange" type="GlyphRangeType" maxOccurs="unbounded" minOccurs="0" />
+			<xsd:element name="Glyph" type="GlyphType" maxOccurs="unbounded" minOccurs="0" />
+		</xsd:sequence>
+		<xsd:attributeGroup ref="FontAttrs" />
+	</xsd:complexType>
+	<xsd:complexType name="MapType">
+		<xsd:attribute name="Codepoint" type="xsd:nonNegativeInteger" use="required" />
+		<xsd:attribute name="Image" type="xsd:string" use="required" />
+		<xsd:attribute name="HorzAdvance" type="xsd:integer" use="optional" default="-1" />
+	</xsd:complexType>
+	<xsd:complexType name="GlyphType">
+		<xsd:attribute name="Codepoint" type="xsd:nonNegativeInteger" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="GlyphRangeType">
+		<xsd:attribute name="StartCodepoint" type="xsd:nonNegativeInteger" use="required" />
+		<xsd:attribute name="EndCodepoint" type="xsd:nonNegativeInteger" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="GlyphSetType">
+		<xsd:attribute name="Glyphs" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:attributeGroup name="FontAttrs">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+		<xsd:attribute name="Type" use="required">
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:string">
+					<xsd:enumeration value="Dynamic" />
+					<xsd:enumeration value="Static" />
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="Size" type="xsd:nonNegativeInteger" use="optional" default="12" />
+		<xsd:attribute name="FirstCodepoint" type="xsd:nonNegativeInteger" use="optional" default="32" />
+		<xsd:attribute name="LastCodepoint" type="xsd:nonNegativeInteger" use="optional" default="127" />
+		<xsd:attribute name="NativeHorzRes" type="xsd:nonNegativeInteger" use="optional" default="640" />
+		<xsd:attribute name="NativeVertRes" type="xsd:nonNegativeInteger" use="optional" default="480" />
+		<xsd:attribute name="AutoScaled" type="xsd:boolean" use="optional" default="false" />
+		<xsd:attribute name="AntiAlias" type="xsd:boolean" use="optional" default="true" />
+	</xsd:attributeGroup>
+</xsd:schema>
Index: GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/GUIScheme.xsd
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/GUIScheme.xsd	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/GUIScheme.xsd	(revision 774)
@@ -0,0 +1,31 @@
+<?xml version="1.0" ?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+	<xsd:element name="GUIScheme" type="SchemeType" />
+	<xsd:complexType name="SchemeType">
+		<xsd:sequence>
+			<xsd:element name="Imageset" type="NamedDataType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Font" type="NamedDataType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="WindowSet" type="WindowSetType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="WindowAlias" type="WindowAliasType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowSetType">
+		<xsd:sequence>
+			<xsd:element name="WindowFactory" type="WindowFactoryType" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="NamedDataType">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowFactoryType">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowAliasType">
+		<xsd:attribute name="Alias" type="xsd:string" use="required" />
+		<xsd:attribute name="Target" type="xsd:string" use="required" />
+	</xsd:complexType>
+</xsd:schema>
Index: GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/TaharezLook.scheme
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/TaharezLook.scheme	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/TaharezLook.scheme	(revision 774)
@@ -0,0 +1,38 @@
+<?xml version="1.0" ?>
+<GUIScheme Name="TaharezLook">
+	<Imageset Name="TaharezLook" Filename="TaharezLook.imageset" />
+	<Font Name="Tahoma-12" Filename="tahoma-12.font" />
+	<WindowSet Filename="CEGUITaharezLook">
+		<WindowFactory Name="TaharezLook/AlternateProgressBar" />
+		<WindowFactory Name="TaharezLook/Button" />
+		<WindowFactory Name="TaharezLook/Checkbox" />
+		<WindowFactory Name="TaharezLook/CloseButton" />
+		<WindowFactory Name="TaharezLook/Combobox" />
+		<WindowFactory Name="TaharezLook/ComboDropList" />
+		<WindowFactory Name="TaharezLook/ComboEditbox" />
+		<WindowFactory Name="TaharezLook/Editbox" />
+		<WindowFactory Name="TaharezLook/FrameWindow" />
+		<WindowFactory Name="TaharezLook/LargeVerticalScrollbar" />
+		<WindowFactory Name="TaharezLook/LargeVerticalScrollbarThumb" />
+		<WindowFactory Name="TaharezLook/Listbox" />
+		<WindowFactory Name="TaharezLook/ListHeader" />
+		<WindowFactory Name="TaharezLook/ListHeaderSegment" />
+		<WindowFactory Name="TaharezLook/HorizontalScrollbar" />
+		<WindowFactory Name="TaharezLook/HorizontalScrollbarThumb" />
+		<WindowFactory Name="TaharezLook/MultiColumnList" />
+		<WindowFactory Name="TaharezLook/MultiLineEditbox" />
+		<WindowFactory Name="TaharezLook/ProgressBar" />
+		<WindowFactory Name="TaharezLook/RadioButton" />
+		<WindowFactory Name="TaharezLook/Slider" />
+		<WindowFactory Name="TaharezLook/SliderThumb" />
+		<WindowFactory Name="TaharezLook/StaticImage" />
+		<WindowFactory Name="TaharezLook/StaticText" />
+		<WindowFactory Name="TaharezLook/TabButton" />
+		<WindowFactory Name="TaharezLook/TabControl" />
+		<WindowFactory Name="TaharezLook/TabPane" />
+		<WindowFactory Name="TaharezLook/Titlebar" />
+		<WindowFactory Name="TaharezLook/VerticalScrollbar" />
+		<WindowFactory Name="TaharezLook/VerticalScrollbarThumb" />
+		<WindowFactory Name="TaharezLook/VUMeter" />
+	</WindowSet>
+</GUIScheme>
Index: GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/Imageset.xsd
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/Imageset.xsd	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/Imageset.xsd	(revision 774)
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+	<xsd:element name="Imageset" type="ImagesetType"/>
+	
+	<xsd:complexType name="ImagesetType">
+		<xsd:sequence>
+			<xsd:element name="Image" type="ImageType" maxOccurs="unbounded"/>
+		</xsd:sequence>
+		<xsd:attribute name="Imagefile" type="xsd:string" use="required"/>
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+		<xsd:attribute name="Name" type="xsd:string" use="required"/>
+		<xsd:attribute name="NativeHorzRes" type="xsd:nonNegativeInteger" use="optional" default="640" />
+		<xsd:attribute name="NativeVertRes" type="xsd:nonNegativeInteger" use="optional" default="480" />
+		<xsd:attribute name="AutoScaled" type="xsd:boolean" use="optional" default="false" />
+	</xsd:complexType>
+	
+	<xsd:complexType name="ImageType">
+		<xsd:attribute name="Name" type="xsd:string" use="required"/>
+		<xsd:attribute name="XPos" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="YPos" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="Width" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="Height" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="XOffset" type="xsd:integer" use="optional" default="0"/>
+		<xsd:attribute name="YOffset" type="xsd:integer" use="optional" default="0"/>						
+	</xsd:complexType>
+
+</xsd:schema>
Index: GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/ogregui.layout
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/ogregui.layout	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/ogregui.layout	(revision 774)
@@ -0,0 +1,79 @@
+<?xml version="1.0" ?>
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="root">
+    <Window Type="DefaultGUISheet" Name="OgreGuiDemo">
+		<Property Name="Size" Value="w:0.25 h:1" />
+
+        <Window Type="TaharezLook/TabControl" Name="OgreGuiDemo/TabCtrl">
+            <Property Name="Position" Value="x:0.0 y:0.0" />
+            <Property Name="Size" Value="w:1 h:0.5" />
+
+            <Window Type="DefaultGUISheet" Name="OgreGuiDemo/TabCtrl/Page1">
+                <Property Name="Text" Value="File" />
+                <Window Type="TaharezLook/Button" Name="OgreGuiDemo/TabCtrl/Page1/NewButton">
+                    <Property Name="Position" Value="x:0.1 y:0.1" />
+                    <Property Name="Size" Value="w:0.8 h:0.07" />
+                    <Property Name="Text" Value="New" />
+                </Window>
+                <Window Type="TaharezLook/Button" Name="OgreGuiDemo/TabCtrl/Page1/LoadButton">
+                    <Property Name="Position" Value="x:0.1 y:0.2" />
+                    <Property Name="Size" Value="w:0.8 h:0.07" />
+                    <Property Name="Text" Value="Load Test Layout" />
+                </Window>
+                <Window Type="TaharezLook/Button" Name="OgreGuiDemo/TabCtrl/Page1/QuitButton">
+                    <Property Name="Position" Value="x:0.1 y:0.3" />
+                    <Property Name="Size" Value="w:0.8 h:0.07" />
+                    <Property Name="Text" Value="Quit" />
+                </Window>
+            </Window>
+            <Window Type="DefaultGUISheet" Name="OgreGuiDemo/TabCtrl/Page2">
+                <Property Name="Text" Value="Objects" />
+                <Window Type="TaharezLook/Combobox" Name="OgreGuiDemo/TabCtrl/Page2/ObjectTypeList">
+                    <Property Name="Position" Value="x:0.1 y:0.1" />
+                    <Property Name="Size" Value="w:0.8 h:0.5" />
+                    <Property Name="Text" Value="Select Type" />
+                    <Property Name="ClippedByParent" Value="false" />
+                    <Property Name="ReadOnly" Value="true" />
+                </Window>
+            </Window>
+        </Window>
+        <!--<Window Type="TaharezLook/FrameWindow" Name="OgreGuiDemo/WindowPropertiesWindow">
+            <Property Name="Size" Value="w:1 h:0.3" />
+            <Property Name="Position" Value="x:0 y:0.52" />
+            <Property Name="TitlebarEnabled" Value="false" />
+            <Property Name="CloseButtonEnabled" Value="false" />
+            <Property Name="Visible" Value="false" />
+            <Property Name="Text" Value="Editor Window" />
+            <Window Type="TaharezLook/StaticText" Name="OgreGuiDemo/WindowProperties/NameText">
+                <Property Name="Position" Value="x:0.05 y:0.2" />
+                <Property Name="Size" Value="w:0.9 h:0.4" />
+                <Property Name="Text" Value="Name:" />
+            </Window>
+
+            <Window Type="TaharezLook/Button" Name="OgreGuiDemo/WindowPropertiesWindow/OKButton">
+                <Property Name="Position" Value="x:0.15 y:0.8" />
+                <Property Name="Size" Value="w:0.3 h:0.1" />
+                <Property Name="Text" Value="OK" />
+            </Window>
+            <Window Type="TaharezLook/Button" Name="OgreGuiDemo/WindowPropertiesWindow/CancelButton">
+                <Property Name="Position" Value="x:0.55 y:0.8" />
+                <Property Name="Size" Value="w:0.3 h:0.1" />
+                <Property Name="Text" Value="Cancel" />
+            </Window>
+        </Window>-->
+	</Window>
+    <Window Type="DefaultGUISheet" Name="OgreGuiDemo2">
+		<Property Name="Size" Value="w:0.75 h:1" />
+		<Property Name="Position" Value="x:0.25 y:0" />
+        <Window Type="TaharezLook/FrameWindow" Name="OgreGuiDemo2/MainWindow">
+            <Property Name="Size" Value="w:1 h:1" />
+            <Property Name="Position" Value="x:0 y:0" />
+            <Property Name="DragMovingEnabled" Value="false" />
+            <Property Name="RollUpEnabled" Value="false" />
+            <Property Name="CloseButtonEnabled" Value="false" />
+            <Property Name="Text" Value="Editor Window" />
+        </Window>
+    </Window>
+</Window>
+
+</GUILayout>
Index: GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/tahoma-12.font
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/tahoma-12.font	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/media/gui/tahoma-12.font	(revision 774)
@@ -0,0 +1,2 @@
+<?xml version="1.0" ?>
+<Font Name="Tahoma-12" Filename="tahoma.ttf" Type="Dynamic" Size="12" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true"/>
Index: GTP/trunk/Lib/Geom/shared/GeoTool/media/fonts/sample.fontdef
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/media/fonts/sample.fontdef	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/media/fonts/sample.fontdef	(revision 774)
@@ -0,0 +1,121 @@
+IronMaiden
+{
+	// Blame cearny for this one!
+	type 		truetype
+	source 		maiden.ttf
+	size 		48
+	resolution 	96
+}
+
+StarWars
+{
+	// Now this one I agree with ;)
+	// A Star Wars font :)
+	type 		truetype
+	source 		solo5.ttf
+	size 		16
+	resolution 	96
+}
+
+Ogre
+{
+	type	image
+	source 	font_matisse_itc.png
+
+glyph	!	0.0898438	0.125	0.0976563	0.1875
+glyph	 	0.152344	0.125	0.160156	0.1875
+glyph	#	0.205078	0.125	0.232422	0.1875
+glyph	$	0.273438	0.125	0.289063	0.1875
+glyph	%	0.330078	0.125	0.357422	0.1875
+glyph	&	0.396484	0.125	0.416016	0.1875
+glyph	'	0.464844	0.125	0.472656	0.1875
+glyph	(	0.523438	0.125	0.539063	0.1875
+glyph	)	0.585938	0.125	0.601563	0.1875
+glyph	*	0.650391	0.125	0.662109	0.1875
+glyph	+	0.705078	0.125	0.732422	0.1875
+glyph	,	0.777344	0.125	0.785156	0.1875
+glyph	-	0.835938	0.125	0.851563	0.1875
+glyph	.	0.902344	0.125	0.910156	0.1875
+glyph	/	0.957031	0.125	0.980469	0.1875
+glyph	0	0.0195313	0.1875	0.0429688	0.25
+glyph	1	0.0859375	0.1875	0.101563	0.25
+glyph	2	0.146484	0.1875	0.166016	0.25
+glyph	3	0.210938	0.1875	0.226563	0.25
+glyph	4	0.271484	0.1875	0.291016	0.25
+glyph	5	0.333984	0.1875	0.353516	0.25
+glyph	6	0.396484	0.1875	0.416016	0.25
+glyph	7	0.458984	0.1875	0.478516	0.25
+glyph	8	0.521484	0.1875	0.541016	0.25
+glyph	9	0.583984	0.1875	0.603516	0.25
+glyph	:	0.652344	0.1875	0.660156	0.25
+glyph	;	0.714844	0.1875	0.722656	0.25
+glyph	<	0.771484	0.1875	0.791016	0.25
+glyph	=	0.832031	0.1875	0.855469	0.25
+glyph	>	0.896484	0.1875	0.916016	0.25
+glyph	?	0.960938	0.1875	0.976563	0.25
+glyph	@	0.0195313	0.25	0.0429688	0.3125
+glyph	A	0.0839844	0.25	0.103516	0.3125
+glyph	B	0.146484	0.25	0.166016	0.3125
+glyph	C	0.210938	0.25	0.226563	0.3125
+glyph	D	0.271484	0.25	0.291016	0.3125
+glyph	E	0.335938	0.25	0.351563	0.3125
+glyph	F	0.396484	0.25	0.416016	0.3125
+glyph	G	0.458984	0.25	0.478516	0.3125
+glyph	H	0.521484	0.25	0.541016	0.3125
+glyph	I	0.589844	0.25	0.597656	0.3125
+glyph	J	0.646484	0.25	0.666016	0.3125
+glyph	K	0.705078	0.25	0.732422	0.3125
+glyph	L	0.771484	0.25	0.791016	0.3125
+glyph	M	0.824219	0.25	0.863281	0.3125
+glyph	N	0.892578	0.25	0.919922	0.3125
+glyph	O	0.958984	0.25	0.978516	0.3125
+glyph	P	0.0195313	0.3125	0.0429688	0.375
+glyph	Q	0.0820313	0.3125	0.105469	0.375
+glyph	R	0.144531	0.3125	0.167969	0.375
+glyph	S	0.210938	0.3125	0.226563	0.375
+glyph	T	0.269531	0.3125	0.292969	0.375
+glyph	U	0.333984	0.3125	0.353516	0.375
+glyph	V	0.396484	0.3125	0.416016	0.375
+glyph	W	0.453125	0.3125	0.484375	0.375
+glyph	X	0.517578	0.3125	0.544922	0.375
+glyph	Y	0.576172	0.3125	0.611328	0.375
+glyph	Z	0.646484	0.3125	0.666016	0.375
+glyph	[	0.708984	0.3125	0.728516	0.375
+glyph	\	0.767578	0.3125	0.794922	0.375
+glyph	]	0.833984	0.3125	0.853516	0.375
+glyph	^	0.896484	0.3125	0.916016	0.375
+glyph	_	0.957031	0.3125	0.980469	0.375
+glyph	`	0.0195313	0.375	0.0429688	0.4375
+glyph	a	0.0839844	0.375	0.103516	0.4375
+glyph	b	0.146484	0.375	0.166016	0.4375
+glyph	c	0.207031	0.375	0.230469	0.4375
+glyph	d	0.273438	0.375	0.289063	0.4375
+glyph	e	0.333984	0.375	0.353516	0.4375
+glyph	f	0.396484	0.375	0.416016	0.4375
+glyph	g	0.458984	0.375	0.478516	0.4375
+glyph	h	0.521484	0.375	0.541016	0.4375
+glyph	i	0.587891	0.375	0.599609	0.4375
+glyph	j	0.646484	0.375	0.666016	0.4375
+glyph	k	0.705078	0.375	0.732422	0.4375
+glyph	l	0.771484	0.375	0.791016	0.4375
+glyph	m	0.816406	0.375	0.871094	0.4375
+glyph	n	0.888672	0.375	0.923828	0.4375
+glyph	o	0.958984	0.375	0.978516	0.4375
+glyph	p	0.0195313	0.4375	0.0429688	0.5
+glyph	q	0.0839844	0.4375	0.103516	0.5
+glyph	r	0.146484	0.4375	0.166016	0.5
+glyph	s	0.208984	0.4375	0.228516	0.5
+glyph	t	0.271484	0.4375	0.291016	0.5
+glyph	u	0.332031	0.4375	0.355469	0.5
+glyph	v	0.386719	0.4375	0.425781	0.5
+glyph	w	0.445313	0.4375	0.492188	0.5
+glyph	x	0.521484	0.4375	0.541016	0.5
+glyph	y	0.583984	0.4375	0.603516	0.5
+glyph	z	0.646484	0.4375	0.666016	0.5
+glyph	{	0.710938	0.4375	0.726563	0.5
+glyph	|	0.773438	0.4375	0.789063	0.5
+glyph	}	0.835938	0.4375	0.851563	0.5
+glyph	~	0.884766	0.4375	0.927734	0.5
+
+}
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/GeoTool.sln
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/GeoTool.sln	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/GeoTool.sln	(revision 774)
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GeoTool", "GeoTool.vcproj", "{31522E11-420C-4DD6-8922-AF96B93E2207}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{31522E11-420C-4DD6-8922-AF96B93E2207}.Debug.ActiveCfg = Debug|Win32
+		{31522E11-420C-4DD6-8922-AF96B93E2207}.Debug.Build.0 = Debug|Win32
+		{31522E11-420C-4DD6-8922-AF96B93E2207}.Release.ActiveCfg = Release|Win32
+		{31522E11-420C-4DD6-8922-AF96B93E2207}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
Index: GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshLoader.h
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshLoader.h	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshLoader.h	(revision 774)
@@ -0,0 +1,186 @@
+/*	==========================================================================
+ *	(C) 2005 Universitat Jaume I
+ *	==========================================================================
+ *	PROYECT:	GAME TOOLS
+ *	=========================================================================*/
+/**	CONTENT:	
+	*
+	*
+	*	@file	GeoMeshLoader.h
+/*===========================================================================*/
+#ifndef __GEO_MESH_LOADER__
+#define __GEO_MESH_LOADER__
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string>
+#include <vector>
+#include <memory.h>
+#include <time.h>
+#include <iostream>
+#include <iomanip>
+#include "GeoBase.h"
+#include "GeoMesh.h"
+
+namespace Geometry 
+{
+	const	unsigned	short	CHUNK_OVERHEAD_SIZE	= sizeof(unsigned short)
+																							+
+																							sizeof(unsigned long);
+
+	const unsigned	short M_HEADER											= 0x1000;
+	const unsigned	short M_MESH												= 0x3000;
+	const unsigned	short M_SUBMESH											= 0x4000; 
+	const unsigned	short M_SUBMESH_OPERATION						= 0x4010;
+	const unsigned	short M_SUBMESH_BONE_ASSIGNMENT			= 0x4100;
+	const unsigned	short M_GEOMETRY										= 0x5000;
+	const unsigned	short M_GEOMETRY_VERTEX_DECLARATION = 0x5100;
+	const unsigned	short M_GEOMETRY_VERTEX_ELEMENT			= 0x5110;
+	const unsigned	short M_GEOMETRY_VERTEX_BUFFER			= 0x5200;
+	const unsigned	short M_GEOMETRY_VERTEX_BUFFER_DATA = 0x5210;
+	const unsigned	short M_MESH_SKELETON_LINK					= 0x6000;
+	const unsigned	short M_MESH_BONE_ASSIGNMENT				= 0x7000;
+	const unsigned	short M_MESH_LOD										=	0x8000;
+	const unsigned	short M_MESH_LOD_USAGE							=	0x8100;
+	const unsigned	short M_MESH_LOD_MANUAL							=	0x8110;
+	const unsigned	short M_MESH_LOD_GENERATED					=	0x8120;
+	const unsigned	short M_MESH_BOUNDS									=	0x9000;
+	const unsigned	short M_SUBMESH_NAME_TABLE					=	0xA000;
+	const unsigned	short	M_SUBMESH_NAME_TABLE_ELEMENT	=	0xA100;
+	const unsigned	short M_EDGE_LISTS									=	0xB000;
+	const unsigned	short M_EDGE_LIST_LOD								=	0xB100;
+	const unsigned	short M_EDGE_GROUP									= 0xB110;
+	const	unsigned	short	SUBMESH_COUNT									=	0;
+	const	unsigned	short	GEOMESH_BUILD									=	1;
+	
+	enum VertexElementType
+	{
+		VET_FLOAT1,
+		VET_FLOAT2,
+		VET_FLOAT3,
+		VET_FLOAT4,
+		VET_COLOUR,
+		VET_SHORT1,
+		VET_SHORT2,
+		VET_SHORT3,
+		VET_SHORT4, 
+		VET_UBYTE4
+	};
+
+	enum VertexElementSemantic
+	{
+		/// Position, 3 reals per vertex
+		VES_POSITION = 1,
+		/// Blending weights
+		VES_BLEND_WEIGHTS = 2,
+		/// Blending indices
+		VES_BLEND_INDICES = 3,
+		/// Normal, 3 reals per vertex
+		VES_NORMAL = 4,
+		/// Diffuse colours
+		VES_DIFFUSE = 5,
+		/// Specular colours
+		VES_SPECULAR = 6,
+		/// Texture coordinates
+		VES_TEXTURE_COORDINATES = 7,
+		/// Binormal (Y axis if normal is Z)
+		VES_BINORMAL = 8,
+		/// Tangent (X axis if normal is Z)
+		VES_TANGENT = 9
+	};
+
+	//	Bounding Box data.
+	struct	GeometryBounds
+	{
+		float	minx;
+		float	miny;
+		float	minz;
+		float	maxx;
+		float	maxy;
+		float	maxz;
+		float	radius;
+	};
+	
+	/// Mesh class interface
+	class GeoMeshLoader
+	{
+		private:
+			
+			Mesh						*geoMesh;
+			size_t					mFileSize;
+			unsigned	int		numVertices;
+			unsigned	long	long_actual;
+			char						*nom_salida;
+			size_t					currentSubMesh;
+
+			struct GeometryElement
+			{
+				unsigned short offset;
+				unsigned short semantic;
+				unsigned short type;
+				unsigned short index;
+			};
+
+			struct GT
+			{
+				unsigned short source; //bindIndex
+				std::vector <GeometryElement> list;
+			};
+
+			std::vector <GT> list;
+
+			//	Jump a chunk.
+			void jumpChunk(FILE	*f);
+
+			//	Read a chunk.
+			unsigned short readChunk(FILE	*f);
+
+			//	Read geometry vertex element.
+			void readGeometryVertexElement(FILE	*f, Mesh	*geoMesh);
+
+			//	Read geometry vertex declaration.
+			void readGeometryVertexDeclaration(FILE	*f, Mesh	*geoMesh);
+
+			//	Read geometry vertex buffer.
+			void readGeometryVertexBuffer(FILE		*f,
+																		Mesh		*geoMesh,
+																		int 		option);
+
+			//	Read geometry.
+			void readGeometry(FILE	*f, Mesh	*geoMesh, int option);
+
+			//	Read a submesh operation.
+			void readSubMeshOperation(FILE	*f, Mesh	*geoMesh, int option);
+
+			//	Read a submesh.
+			void readSubMesh(FILE	*f, Mesh	*geoMesh, int option);
+
+			//	Read a mesh lod information.
+			void readMeshLodInfo(FILE	*f, Mesh	*geoMesh);
+
+			//	Read a submesh name table.
+			void readSubMeshNameTable(FILE	*f, Mesh	*geoMesh);
+
+			//	Read a mesh file.
+			void readMesh(FILE	*f, Mesh	*geoMesh, int option);
+
+			//	Writes the strips list.
+			Mesh* GeoMeshLoader::BuildStripsGeoSubMesh(Mesh* geoMesh);
+			
+		public:
+
+			//	Constructor.
+			GeoMeshLoader();
+
+			//	Destroyer.
+			~GeoMeshLoader();
+
+			//	Loads a Mesh file.
+			Mesh* load(char	*fileNameMesh);
+
+			//	Get the size in bytes of the file.
+			size_t	getFileSize();
+	};
+}
+#endif
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshViewUI.h
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshViewUI.h	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshViewUI.h	(revision 774)
@@ -0,0 +1,350 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0100
+#ifndef GeoMeshViewUI_h
+#define GeoMeshViewUI_h
+#include	<stdio.h>
+#include	<stdlib.h>
+#include	<string.h>
+#include	<fltk/run.h>
+#include	<fltk/Group.h>
+#include	<fltk/Window.h>
+#include	<fltk/ask.h>
+#include	<fltk/file_chooser.h>
+#include	<fltk/FileChooser.h>
+#include	<fltk/MenuBar.h>
+#include	<fltk/Input.h>
+#include	<fltk/Button.h>
+#include	<fltk/ReturnButton.h>
+#include	<fltk/TextBuffer.h>
+#include	<fltk/TextEditor.h>
+#include	<fltk/Input.h>
+#include	<fltk/events.h>
+#include	<fltk/InvisibleBox.h>
+#include	<fltk/ItemGroup.h>
+#include	<fltk/Item.h>
+#include	<fltk/Divider.h>
+#include	<fltk/Output.h>
+#include	<fltk/Button.h>
+#include	<fltk/ProgressBar.h>
+#include	<fltk/CheckButton.h>
+#include	<fltk/RadioButton.h>
+#include	<fltk/FloatInput.h>
+#include	<fltk/Browser.h>
+#include	<fltk/Image.h>
+#include	<fltk/SharedImage.h>
+#include	<fltk/Slider.h>
+#include	<GeoMesh.h>
+#include	<GeoLodStripsLibrary.h>
+#include	<GeoMeshView.h>
+#include	<GeoMeshSaver.h>
+#include	<GeoMeshStripifier.h>
+#include	<GeoMeshSimplifier.h>
+#include	<GeoTreeSimplifier.h>
+#include	"GeoTreeSimpSequence.h"
+#include	"GeoLodStripsConstructor.h"
+
+//	About Dialog.
+#include "GTAboutDialog.h"
+#include	"../resource.h"
+
+//	State of the button process.
+enum	ProcessState
+{
+	NONE,
+	STRIPIFY,
+	EDGE_COLLAPSE,
+	LEAVES_COLLAPSE,
+	LODSTRIPS,
+	LODSTRIPS_AUTO,
+	LODTREES,
+	SELECT_LEAVES,
+	VISUALIZE_LODSTRIPS
+};
+
+// Simplification types
+enum	SimplificationType
+{
+	QSLIM,
+	HOJAS
+};
+
+enum	ProgressBarType
+{
+	PROCESS,
+	BUILD
+};
+
+using	namespace	Geometry;
+
+class GeoMeshViewUI
+{
+	friend	class	GeoMeshView;
+
+	private:
+
+	//	File name Selected.
+	char	*mFileName;
+
+	//	The state of the application menus.
+	ProcessState	mApplicationState;
+
+	//	Mesh object(Model).
+	Mesh	*mGeoMesh;
+
+	//	Mesh for undo operation.
+	Mesh	*mUndoMesh;
+
+	//	Lod strips object.
+	LodStripsLibrary	*lodStripsLib;
+	
+	//	Mesh Bounds.
+	GeometryBounds			mMeshBounds;
+
+	MeshSimplifier 			*ms;
+	TreeSimplifier			*mts;
+	char								*nombremesh;
+	SimplificationType	simplificacionState;
+	ProgressBarType			progressBarType;
+
+	MeshSimplificationSequence	*oMeshSimpSequence;
+	LodStripsConstructor				*oLodStrip;
+	GeoMeshLoader								*geoMeshLoader;
+
+	inline void cb_menuFileOpen_i(fltk::Item*, void*);
+	static void cb_menuFileOpen(fltk::Item*, void*);
+	inline void cb_menuFileSave_i(fltk::Item*, void*);
+	static void cb_menuFileSave(fltk::Item*, void*);
+	inline void cb_menuOpenSaveAs_i(fltk::Item*, void*);
+	static void cb_menuOpenSaveAs(fltk::Item*, void*);
+
+	inline void cb_menuMeshInfo_i(fltk::Item*, void*);
+	static void cb_menuMeshInfo(fltk::Item*, void*);
+	inline void cb_menuMeshExportOBJ_i(fltk::Item*, void*);
+	static void cb_menuMeshExportOBJ(fltk::Item*, void*);
+	inline void cb_menuTransformSharedVertex_i(fltk::Item*, void*);
+	static void	cb_menuFileTransformSharedVertex(fltk::Item* o, void* v);
+
+	inline void cb_menuOpenQuit_i(fltk::Item*, void*);
+	static void cb_menuOpenQuit(fltk::Item*, void*);
+	inline void cb_menuEditUndo_i(fltk::Item*, void*);
+	static void cb_menuEditUndo(fltk::Item*, void*);
+	inline void cb_menuEditFit_i(fltk::Item*, void*);
+	static void cb_menuEditFit(fltk::Item*, void*);
+	inline void cb_menuEditRotate_i(fltk::Item*, void*);
+	static void cb_menuEditRotate(fltk::Item*, void*);
+	inline void cb_menuEditPan_i(fltk::Item*, void*);
+	static void cb_menuEditPan(fltk::Item*, void*);
+	inline void cb_menuEditZoom_i(fltk::Item*, void*);
+	static void cb_menuEditZoom(fltk::Item*, void*);
+	inline void cb_menuRenderWire_i(fltk::Item*, void*);
+	static void cb_menuRenderWire(fltk::Item*, void*);
+	inline void cb_menuRenderSolid_i(fltk::Item*, void*);
+	static void cb_menuRenderSolid(fltk::Item*, void*);
+	inline void cb_menuRenderCW_i(fltk::Item*, void*);
+	static void cb_menuRenderCW(fltk::Item*, void*);
+	inline void cb_menuRenderCCW_i(fltk::Item*, void*);
+	static void cb_menuRenderCCW(fltk::Item*, void*);
+	inline void cb_menuRenderFlat_i(fltk::Item*, void*);
+	static void cb_menuRenderFlat(fltk::Item*, void*);
+	inline void cb_menuRenderSmooth_i(fltk::Item*, void*);
+	static void cb_menuRenderSmooth(fltk::Item*, void*);
+	inline void cb_menuRenderTextures_i(fltk::Item*, void*);
+	static void cb_menuRenderTextures(fltk::Item*, void*);
+	inline void cb_menuStripify_i(fltk::Item*, void*);
+	static void cb_menuStripify(fltk::Item*, void*);
+	inline void cb_menuSimplify_i(fltk::ItemGroup*, void*);
+	static void cb_menuSimplify(fltk::ItemGroup*, void*);
+	inline void cb_menuSimplifyEdgeCollapse_i(fltk::Item*, void*);
+	static void cb_menuSimplifyEdgeCollapse(fltk::Item*, void*);
+	inline void cb_menuSimplifyLeavesCollapse_i(fltk::Item*, void*);
+	static void cb_menuSimplifyLeavesCollapse(fltk::Item*, void*);
+
+	inline void cb_menuLodStripsGenerate_i(fltk::Item*, void*);
+	static void cb_menuLodStripsGenerate(fltk::Item*, void*);
+	inline void cb_menuLodStripsVisualize_i(fltk::Item*, void*);
+	static void cb_menuLodStripsVisualize(fltk::Item*, void*);
+
+	inline void cb_menuSelectLeaves_i(fltk::Item*, void*);
+	static void cb_menuSelectLeaves(fltk::Item*, void*);
+	inline void cb_menuLodTreesOpenLodStripTrunk_i(fltk::Item*, void*);
+	static void cb_menuLodTreesOpenLodStripTrunk(fltk::Item*, void*);
+	inline void cb_menuLodTreesOpenLeavesSimplification_i(fltk::Item*, void*);
+	static void cb_menuLodTreesOpenLeavesSimplification(fltk::Item*, void*);
+	inline void cb_menuHelpAbout_i(fltk::Item*, void*);
+	static void cb_menuHelpAbout(fltk::Item*, void*);
+
+	inline void cb_mButtonProcess_i(fltk::Button*, void*);
+	static void cb_mButtonProcess(fltk::Button*, void*);
+	inline void cb_mButtonSort_i(fltk::Button*, void*);
+	static void cb_mButtonSort(fltk::Button*, void*);
+	inline void cb_mButtonBuild_i(fltk::Button*, void*);
+	static void cb_mButtonBuild(fltk::Button*, void*);
+	inline void cb_mMeshInfo_i(fltk::Browser*, void*);
+	static void cb_mMeshInfo(fltk::Browser*, void*);
+	inline void cb_mLodSlider_i(fltk::Slider*, void*);
+	static void cb_mLodSlider(fltk::Slider*, void*);
+
+	//	Logo's callback.
+	inline void cb_mLogo_i(fltk::InvisibleBox*, void*);
+	static void cb_mLogo(fltk::InvisibleBox*, void*);
+
+	//	Shows the stripify panel.
+	void	showStripify();
+
+	//	Shows the simplify panels.
+	void	showEdgeCollapse();
+	void	showLeavesCollapse();
+
+	//	Shows the LodStrips panels.
+	void	showOpenMeshSimplification();
+	void	showAutoGenerateLodStrips();
+
+	//	Shows the LodTrees panel.
+	void	showOpenLeavesSimplification();
+
+	//	Show the mesh info browser.
+	void	showMeshInfo();
+	
+	//	Show the LodStrips visulization panel.
+	void	showVisualizeLodStrips();
+
+	void	hideStripify();
+	void	hideEdgeCollapse();
+	void	hideLeavesCollapse();
+	void	hideOpenMeshSimplification();
+	void	hideOpenLeavesSimplification();
+	void	hideRightPanel();
+	//	Hide the mesh info browser.
+	void	hideMeshInfo();
+
+	//	Hide the LodStrips visualization panel.
+	void	hideVisualizeLodStrips();
+	
+	//	Get the number of vertices.
+	size_t	getVertexCount(Mesh	*geoMesh);
+
+	//	Get the number of triangles.
+	size_t	getTriangleCount(Mesh	*geoMesh);
+
+	//	Get the number of strips.
+	size_t	getStripCount(Mesh	*geoMesh);
+
+	int		paintMesh();
+
+	//	Simplify the mesh object.
+	void	simplifyEdgeCollapse();
+
+	//	Simplify the mesh object.
+	void	simplifyLeavesCollapse();
+
+	//	Create a siplification sequence of the QSLIM sequence.
+	void	createQslimSequence();
+
+	//	Stripify the mesh object.
+	void	stripify();
+
+	//	Method that undo then mesh changes.
+	void	undo();
+
+	//	Refresh number of vertices, triangles, strips, ...
+	void	refreshApplicationBar();
+
+	//	Open a mesh file.
+	void	openMeshFile();
+
+	public:
+
+	GeoMeshView					*geoMeshView;
+	fltk::Window				*mMainWindow;
+	fltk::Group					*MainView;
+	fltk::InvisibleBox	*cframe;
+	fltk::MenuBar				*menuBar;
+	fltk::ItemGroup			*menuFile;
+	fltk::Item					*menuFileOpen;
+	fltk::Item					*menuFileSave;
+	fltk::Item					*menuOpenSaveAs;
+	fltk::Item					*menuMeshInfo;
+	fltk::Item					*menuMeshExportOBJ;
+	fltk::Item					*menuFileTransformSharedVertex;
+
+	fltk::Item					*menuOpenQuit;
+	fltk::ItemGroup			*menuEdit;
+	fltk::Item					*menuEditUndo;
+	fltk::Item					*menuEditFit;
+	fltk::Item					*menuEditRotate;
+	fltk::Item					*menuEditPan;
+	fltk::Item					*menuEditZoom;
+	fltk::ItemGroup			*menuRender;
+	fltk::Item					*menuRenderWire;
+	fltk::Item					*menuRenderSolid;
+	fltk::Item					*menuRenderCW;
+	fltk::Item					*menuRenderCCW;
+	fltk::Item					*menuRenderFlat;
+	fltk::Item					*menuRenderSmooth;
+	fltk::Item					*menuRenderTextures;
+	fltk::Item					*menuStripify;
+	fltk::ItemGroup			*menuSimplify;
+	fltk::Item					*menuSimplifyEdgeCollapse;
+	fltk::Item					*menuSimplifyLeavesCollapse;
+	fltk::Item					*menuSimplifySaveSequence;
+
+	fltk::ItemGroup			*menuLodStrips;
+	fltk::Item					*menuLodStripsGenerate;
+	fltk::Item					*menuLodStripsVisualize;
+	fltk::ItemGroup			*menuLodTrees;
+
+	fltk::Item					*menuSelectLeaves;
+	fltk::Item					*menuLodTreesOpenLodStripTrunk;
+	fltk::Item					*menuLodTreesOpenLeavesSimplification;
+	fltk::Item					*menuHelpAbout;
+	fltk::InvisibleBox	*mLogo;
+	fltk::Group					*ApplicationBar;
+	fltk::Widget				*mFPS;
+	fltk::Widget				*mVertices;
+	fltk::Widget				*mTriangles;
+	fltk::Widget				*mStrips;
+	fltk::Widget				*mQuads;
+	fltk::Widget				*mMB;
+	fltk::Button				*mButtonProcess;
+	fltk::ProgressBar		*mProcessBar;
+	fltk::Button				*mButtonSort;
+	fltk::ProgressBar		*mSortBar;
+	fltk::Button				*mButtonBuild;
+	fltk::ProgressBar		*mBuildBar;
+	fltk::Slider				*mLodSlider;
+	fltk::CheckButton		*mGeometryBased;
+	fltk::CheckButton		*mImageBased;
+	fltk::CheckButton		*mChangeVertices;
+	fltk::CheckButton		*mChangeTexture;
+	fltk::CheckButton		*mPercent;
+	fltk::CheckButton		*mVerticesNumber;
+	fltk::CheckButton		*mOneCacheStrip;
+	fltk::CheckButton		*mQualityStrips;
+	fltk::FloatInput		*mMeshReduction;
+	fltk::Widget				*mProcessTitle;
+	fltk::Output				*mMetricLabel;
+	fltk::Output				*mTypeLabel;
+	fltk::Output				*mMeshReductionLabel;
+	fltk::Browser				*mMeshInfo;
+	fltk::ItemGroup			*ogeometry;
+
+	//	Repaint the FPS label.
+	void	refreshFPS(int fps);
+
+	//	Initialize the lodstripslibrary for visualization.
+	void	setLodStripsLibrary(std::string lodfile, Mesh	*geomesh);
+
+	// 26-12-2005
+	// Indentify the mesh of leaves.
+	unsigned	short			idMeshLeaves;
+
+	GeoMeshViewUI(TIPOFUNC fun=NULL);
+	~GeoMeshViewUI();
+	void show();
+
+	TIPOFUNC progress_function;
+	float updateProgressBar(float);
+
+};
+
+#endif
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshView.h
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshView.h	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshView.h	(revision 774)
@@ -0,0 +1,245 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0100
+#ifndef GeoMeshView_h
+#define GeoMeshView_h
+
+#include	<fltk/events.h>
+#include	<stdlib.h>
+#include	<time.h>
+#include	<iostream>
+#include	<GL/glut.h>
+#include	<fltk/GlWindow.h>
+#include	<GeoVertexBuffer.h>
+#include	<GeoMesh.h>
+//#ifndef	GeoMeshViewUI_h
+#include	<GeoMeshSaver.h>
+#include	<GeoMeshViewUI.h>
+//#include	<GeoLodStripsLibrary.h>
+//#endif
+
+class GeoMeshView : public fltk::GlWindow
+{
+	friend	class	GeoMeshViewUI;
+
+	public:
+
+	// this value determines the scaling factor used to draw the cube.
+	double	size;
+	double	mScaleFactor;
+	bool		mWire;
+	bool		mSolid;
+	bool		mCW;
+	bool		mCCW;
+	bool		mPan;
+	bool		mRotate;
+	bool		mLodStrip;
+
+	GeoMeshView(int 					x,
+			int						y,
+			int						w,
+			int						h,
+			const	char		*l							=	0,
+			GeoMeshViewUI	*geoMeshViewUI	=	0);
+
+	/*	This function is callalled by the zoom slider
+	 *	
+	 */
+	void scale(double factor){size	=	factor;};
+
+	/* Set the rotation about the vertical (y ) axis.
+	 *
+	 * This function is called by the horizontal roller in GeoMeshViewUI
+	 * and the initialize button in GeoMeshViewUI.
+	 */
+	void v_angle(float angle){vAng=angle;};
+	
+	// Return the rotation about the vertical (y ) axis.
+	float v_angle(){return vAng;};
+	
+	/* Set the rotation about the horizontal (x ) axis.
+	 *
+	 * This function is called by the vertical roller in GeoMeshViewUI
+	 and the
+	 * initialize button in GeoMeshViewUI.
+	 */
+	void h_angle(float angle){hAng=angle;};
+	
+	// the rotation about the horizontal (x ) axis.
+	float h_angle(){return hAng;};
+	
+	/* Sets the x shift of the cube view camera.
+	 *
+	 * This function is called by the slider in GeoMeshViewUI and the
+	 * initialize button in GeoMeshViewUI.
+	 */
+	void panx(float x){xshift=x;};
+	
+	/* Sets the y shift of the cube view camera.
+	 *
+	 * This function is called by the slider in GeoMeshViewUI and the
+	 * initialize button in GeoMeshViewUI.
+	 */
+	void pany(float y){yshift=y;};
+
+	//	Wire model.
+	void	activeWire(){mWire	=	true;};
+	void	deactiveWire(){mWire	=	false;};
+
+	//	Solid model.
+	void	activeSolid(){mSolid	=	true;};
+	void	deactiveSolid(){mSolid	=	false;};
+
+	//	Clockwise mode.
+	void	activeCW(){mCW	=	true;};
+	void	deactiveCW(){mCW	=	false;};
+
+	//	Counter Clockwise mode.
+	void	activeCCW(){mCCW	=	true;};
+	void	deactiveCCW(){mCCW	=	false;};
+
+	//	Pan mode.
+	void	activePan(){mPan	=	true;};
+	void	deactivePan(){mPan	=	false;};
+
+	//	Rotate mode.
+	void	activeRotate(){mRotate	=	true;};
+	void	deactiveRotate(){mRotate	=	false;};
+
+	//	LodStrip mode.
+	void	activeLodStrip(){mLodStrip	=	true;};
+	void	deactiveLodStrip(){mLodStrip	=	false;};
+
+	//	Ilumination modes.
+	void	flat(){glShadeModel(GL_FLAT);};
+	void	smooth(){glShadeModel(GL_SMOOTH);};
+
+	//	Fits the object in the window view.
+	void	fit()
+	{
+		vAng		= 0.0;
+		hAng		=	0.0;
+		size		=	0.0;
+		xshift	=	0.0;
+		yshift	=	0.0;
+	};
+
+	/* Sets the Mesh to display.
+	*/
+	void	setMesh(Geometry::Mesh	*geomesh);
+
+	/* The widget class draw() override.
+	 * The draw() function initialize Gl for another round of
+	 * drawing then calls specialized functions for drawing each
+	 * of the entities displayed in the cube view.
+	 */
+	void draw();
+
+	//	Gets the bounding box.
+	Geometry::GeometryBounds	getBoundingBox();
+
+	//	Store one random color to each strip.
+	void	setStripColors();
+
+	//	Get the number of frames per second.
+	size_t	getFPS();
+
+	//	JGA
+	//	Sets the colorsubmeshi variable
+	void	setColorSubmeshi(int submeshIndex);
+
+	//	Sets the leaves submesh index.
+	void	setLeavesSubmesh(int submeshIndex);
+
+	//	Gets the leaves submesh index.
+	int	getLeavesSubmesh();
+
+	//	Gets the triangle count of the current lod.
+	size_t	getLodStripsTriangleCount();
+	
+	//	Sets the lodstripslibrary object.
+	void	setLodStripsLibrary(Geometry::LodStripsLibrary *lodstrips);
+
+	//	Change de Level of detail of the object.
+	void	GoToLod(unsigned int lod);
+
+	private:
+	/* Draw the cube boundaries
+	 * Draw the faces of the cube using the boxv[] vertices, using
+	 * GL_LINE_LOOP for the faces. The color is #defined by
+	 * CUBECOLOR.
+	 */
+
+	//	GeoMeshViewUI.
+	GeoMeshViewUI	*mGeoMeshViewUI;
+
+	//	LodStrips library object.
+	Geometry::LodStripsLibrary	*lodStripsLib;
+	
+	//	Flag tha activate / deactivate the color strips.
+	bool	colorStripsFlag;
+
+	// Stores the index of the mesh to paint of red color.
+	int		colorsubmeshi;
+
+	//	Frames per second.
+	size_t	mFPS;
+
+	//	StartTime for FPS.
+	clock_t	mStartTime;
+
+	float		xMed;
+	float		yMed;
+	float		zMed;
+
+	int			leavesSubmesh;
+	
+	//	Submesh count.
+	int			mSubMeshCount;
+
+	//	Mesh to show.
+	Geometry::Mesh	*geoMesh;
+
+	virtual	int	handle(int event);
+
+	//	Paint the mesh object.
+	void	drawGeoMesh(int selectedMesh);
+	void	drawTriangleList(int selectedMesh);
+	void	drawTriangleStrip();
+	void	drawLodStrip();
+	void	enableColorStrips();
+	void	disableColorStrips();
+	bool	getColorStrips();
+
+	//	Calculate the number of frames per second.
+	void	calcFPS();
+
+	//	Copy the mesh vertices to the vertex array.
+	void	refreshVertices(Geometry::Mesh	*geomesh);
+
+	float 	vAng;
+	float 	hAng;
+	float 	xshift;
+	float 	yshift;
+	int			mMouseX;
+	int			mMouseY;
+	int			mSizeY;
+	GLfloat	**mPosArray;
+	GLfloat	**mNorArray;
+	GLfloat	*mSharedPosArray;
+	GLfloat	*mSharedNorArray;
+	GLuint	**mIndexArray;
+
+	struct	ColorElement
+	{
+		float	r;
+		float	g;
+		float	b;
+	};
+
+	ColorElement	*mStripColors;
+
+	//	Idetifier of Visualization List.
+	GLuint	mIdVisualList;
+};
+
+#endif
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/include/GTAboutDialog.h
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/include/GTAboutDialog.h	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/include/GTAboutDialog.h	(revision 774)
@@ -0,0 +1,25 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0100
+
+#ifndef AboutDialog_h
+#define AboutDialog_h
+#include	<string.h>
+#include <fltk/Window.h>
+#include <fltk/Group.h>
+#include <fltk/MultiLineOutput.h>
+#include <fltk/InvisibleBox.h>
+#include <fltk/Button.h>
+#include	<fltk/Image.h>
+#include	<fltk/SharedImage.h>
+
+class GTAboutDialog  {
+public:
+  GTAboutDialog();
+  fltk::Window *mMainWindow;
+      fltk::MultiLineOutput *mText;
+      fltk::InvisibleBox *mLogo;
+      fltk::Button *mOK;
+private:
+      inline void cb_mOK_i(fltk::Button*, void*);
+      static void cb_mOK(fltk::Button*, void*);
+};
+#endif
Index: GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshSaver.h
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshSaver.h	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshSaver.h	(revision 774)
@@ -0,0 +1,111 @@
+/*	==========================================================================
+ *	(C) 2005 Universitat Jaume I
+ *	==========================================================================
+ *	PROYECT:	GAME TOOLS
+ *	=========================================================================*/
+/**	CONTENT:	
+	*
+	*
+	*	@file	GeoMeshSaver.h
+/*===========================================================================*/
+#ifndef	__GEO_MESH_SAVER__
+#define	__GEO_MESH_SAVER__
+
+#include	<GeoMeshLoader.h>
+
+namespace Geometry 
+{
+	//	Saves a Mesh.
+	class	GeoMeshSaver
+	{
+		private:
+			//	The mesh to write.
+			Mesh	*mGeoMesh;
+			
+			//	Mesh Bounds.
+			GeometryBounds	mMeshBounds;
+			
+			//	Write in the file.
+			Serializer	*mSerializer;
+
+			//	Flag that indicate if the mesh 
+			//	is skeletally animated or not.
+			bool	mSkeletallyAnimated;
+			
+			//	Material of the mesh.
+			String	mMaterialName;
+			
+			//	Write the main mesh.
+			void	writeMesh(Mesh	*geoMesh);
+
+			//	Write a submesh.
+			void	writeSubMesh(SubMesh	*geoSubMesh);
+
+			// Operation type
+			void	writeSubMeshOperation(const	SubMesh	*geoSubMesh);
+			
+			//	Write geometry.
+			void	writeGeometry(VertexBuffer	*vertexBuffer);
+
+			//	TODO: Write Mesh Bounds.
+			void	writeMeshBounds(GeometryBounds bounds);
+			
+			//	Calc the mesh size in bytes.
+			size_t	calcMeshSize(const Mesh	*geoMesh);
+
+			//	Calc the size in bytes for the submesh.
+			size_t	calcSubMeshSize(const SubMesh	*geoSubMesh);
+
+			//	Calc the geometry size in bytes.
+			size_t	calcGeometrySize(const VertexBuffer* vertexBuffer);
+
+			//	Write the file header.
+			void	writeFileHeader(void);
+
+			//	Write a header chunk given.
+			void	writeChunkHeader(	unsigned short	id,
+															unsigned long		count);
+
+			//	Write integers into the file.
+			void	writeInts(unsigned long	id,
+											unsigned long	size);
+
+			//	Write shorts into the file
+			void	writeShorts(unsigned short	id,
+												unsigned long		count);
+
+			//	Write float into the file.
+			void	writeFloats(float						id,
+												unsigned long		count);
+
+			//	Write a string into the file.
+			void	writeString(const	String	&string);
+
+			//	Write booleans into the file.
+			void	writeBools(	const bool id,
+												unsigned	long		count);
+		public:
+
+			//	Constructors.
+			GeoMeshSaver();
+
+			GeoMeshSaver(GeometryBounds bounds);
+
+			//	Destroyer.
+			~GeoMeshSaver();
+
+			//	Sets the material of the mesh.
+			void	setMaterialName(String	materialName);
+
+			//	Gets the material of the mesh.
+			String	getMaterialName();
+
+			//	Set Mesh Bounds.
+			void	setMeshBounds(GeometryBounds	bounds);
+
+			//	Saves a Mesh into a file.
+			int	save(Mesh	*geoMesh,	const	char	*fileNameMesh);
+	};
+}
+#endif
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshLoader.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshLoader.cpp	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshLoader.cpp	(revision 774)
@@ -0,0 +1,1001 @@
+/*	==========================================================================
+ *	(C) 2005 Universitat Jaume I
+ *	==========================================================================
+ *	PROYECT:	GAME TOOLS
+ *	==========================================================================*/
+/**	CONTENT:	
+	*
+	*
+	*	@file	GeoMeshLoader.cpp
+/*===========================================================================*/
+#include	"GeoMeshLoader.h"
+
+using namespace Geometry;
+using	namespace	std;
+
+//	Jump a chunk.
+void GeoMeshLoader::jumpChunk(FILE	*f)
+{
+	fseek(f,-(long)CHUNK_OVERHEAD_SIZE,1);
+
+	//	Return to the begin of the chunk.
+	fseek(f,long_actual,SEEK_CUR);
+}
+
+//	Read a chunk.
+unsigned short GeoMeshLoader::readChunk(FILE	*f)
+{
+	unsigned	short	id;
+
+	fread(&id,sizeof(unsigned short),1,f);
+	fread(&long_actual,sizeof(unsigned long),1,f);
+									
+	return id;
+}
+
+//	Read geometry vertex element.
+void GeoMeshLoader::readGeometryVertexElement(FILE	*f, Mesh	*geoMesh)
+{
+	unsigned	short		source;
+	GeometryElement		aux;
+	int								i;
+	bool							encontrado;
+	VertexElementType	vType;
+
+	i						=	0;
+	encontrado	=	false;
+
+	//		VertexElementSemantic vSemantic;
+	// unsigned short source;  	// buffer bind source
+	fread(&source,sizeof(unsigned short),1,f);
+
+	// unsigned short type;    	// VertexElementType
+	fread(&aux.type,sizeof(unsigned short),1,f);
+
+	vType	=	static_cast<VertexElementType>(aux.type);
+
+	if (vType == VET_FLOAT3)
+	{
+		printf("%u es float3 ",aux.type);
+	}
+
+	if (vType == VET_FLOAT4)
+	{
+		printf("%u es float4 ",aux.type);
+	}
+
+	if (vType == VET_FLOAT2)
+	{
+		printf("%u es float2 ",aux.type);
+	}
+
+	// unsigned short semantic; // VertexElementSemantic
+	fread(&aux.semantic,sizeof(unsigned short),1,f);
+
+	//	vSemantic = static_cast<VertexElementSemantic>(tmp);
+	//	unsigned short offset;	// start offset in buffer in bytes
+	fread(&aux.offset,sizeof(unsigned short),1,f);
+
+	// unsigned short index;	// index of the semantic
+	/*
+	VES_POSITION  Position, 3 reals per vertex.  
+	VES_BLEND_WEIGHTS  Blending weights.  
+	VES_BLEND_INDICES  Blending indices.  
+	VES_NORMAL  Normal, 3 reals per vertex.  
+	VES_DIFFUSE  Diffuse colours.  
+	VES_SPECULAR  Specular colours.  
+	VES_TEXTURE_COORDINATES  Texture coordinates.  
+	VES_BINORMAL  Binormal (Y axis if normal is Z).  
+	VES_TANGENT  Tangent (X axis if normal is Z).  
+	*/
+	fread(&aux.index,sizeof(unsigned short),1,f);
+
+	while ((i < list.size()) && (!encontrado))
+	{
+		if (list[i].source==source)
+		{
+			encontrado	=	true;
+		}
+		else
+		{
+			i++;
+		}
+	}
+
+	if (encontrado)
+	{
+		list[i].list.push_back(aux);
+	}
+	else
+	{
+		GT	aux2;
+		
+		aux2.source	=	source;
+		aux2.list.push_back(aux);
+		list.push_back(aux2);
+	}
+	
+	//	Debug.
+	cout	<<	"Finish Vertex Element"	<<	endl;
+}
+
+//	Read geometry vertex declaration.
+void GeoMeshLoader::readGeometryVertexDeclaration(FILE	*f, Mesh	*geoMesh)
+{
+	unsigned short chunkID;
+  // Find optional geometry chunks
+  if (!feof(f))
+  {
+    chunkID	=	readChunk(f);
+
+    while(!feof(f) && (chunkID == M_GEOMETRY_VERTEX_ELEMENT ))
+    {
+      switch (chunkID)
+      {
+				case M_GEOMETRY_VERTEX_ELEMENT:
+					cout	<<	"M_GEOMETRY_VERTEX_ELEMENT"	<<	endl;
+          readGeometryVertexElement(f, geoMesh);
+          break;
+      }
+
+      // Get next chunk
+      if (!feof(f))
+      {
+				chunkID = readChunk(f);
+      }
+    }//	End while.
+
+    if (!feof(f))
+    {
+			// Backpedal back to start of non-submesh chunk
+			fseek(f,-(long)CHUNK_OVERHEAD_SIZE,1);
+    }
+
+  }//	End if (!feof(f))
+}
+
+//	Read geometry vertex buffer.
+void GeoMeshLoader::readGeometryVertexBuffer(FILE	*f, Mesh	*geoMesh, int option)
+{
+	unsigned	short	bindIndex;
+	unsigned	short	vertexSize;
+	unsigned	short	headerID;
+	int							i;
+	float						aux;
+	int							k;
+	bool						encontrado;
+	float						x,y,z;
+	SubMesh					*geoSubMesh;
+	VertexBuffer		*vertex_buffer;
+
+	i						=	0;
+	k						=	0;
+	encontrado	=	false;
+
+	
+	if (option == GEOMESH_BUILD)
+	{
+		//	If is the main mesh.
+		if (currentSubMesh == -1)
+		{
+			vertex_buffer	=	geoMesh->mVertexBuffer;
+		}
+		//	If is a submesh.
+		else
+		{
+			//	Gets the current submesh
+			geoSubMesh		=	&geoMesh->mSubMesh[currentSubMesh];
+			vertex_buffer	=	geoSubMesh->mVertexBuffer;
+		}
+	}
+	
+	// Index to bind this buffer to
+	fread(&bindIndex,sizeof(unsigned short),1,f);
+
+	// Per-vertex size, must agree with declaration at this index
+	fread(&vertexSize,sizeof(unsigned short),1,f);
+
+	//	Debug.
+	cout	<<	"Per-vertex size: "
+				<<	vertexSize
+				<<	endl;
+	
+	// Check for vertex data header
+	headerID	=	readChunk(f);
+
+	if (headerID != M_GEOMETRY_VERTEX_BUFFER_DATA)
+	{
+		cout	<<	"Can't find vertex buffer data area"
+					<<	endl;
+	}
+	else
+	{
+		cout	<<	"M_GEOMETRY_VERTEX_BUFFER_DATA"	<<	endl;
+	}
+
+	while ((i<list.size())&&(!encontrado))
+	{
+		if (list[i].source	==	bindIndex)
+		{
+			encontrado	=	true;
+		}
+		else
+		{
+			i++;
+		}
+	}
+
+	//	Considero q los van por grupitos de vertices+normales+...
+	//	para cada uno de los vertices
+	if (encontrado)
+	{
+		FILE * salida;
+		salida=fopen(nom_salida,"a");
+		cout	<<	"----->Leo los vertices"
+					<<	endl;
+
+		for (k=0;k<numVertices;k++)
+		{
+			//Para cada uno de los elementos de ese source.
+			for(int j=0;j<list[i].list.size();j++)
+			{
+				//	Son posiciones, vertices
+				if (list[i].list[j].semantic==1)
+				{
+					fread(&x,sizeof(float),1,f);
+					fread(&y,sizeof(float),1,f);
+					fread(&z,sizeof(float),1,f);
+
+					if (option == GEOMESH_BUILD)
+					{
+						vertex_buffer->mVertexInfo		|=	VERTEX_POSITION;
+						vertex_buffer->mPosition[k].x	=		x;
+						vertex_buffer->mPosition[k].y	=		y;
+						vertex_buffer->mPosition[k].z	=		z;
+					}
+				}
+				//	si no son vertices no lo quiero
+				else 
+				{
+					//Se tendría que hacer con un fseek
+					if (list[i].list[j].type==2) //Son 3 floats
+					{
+						fread(&x,sizeof(float),1,f);
+						fread(&y,sizeof(float),1,f);
+						fread(&z,sizeof(float),1,f);
+
+						if (option == GEOMESH_BUILD)
+						{
+							vertex_buffer->mVertexInfo	|=	VERTEX_NORMAL;
+							vertex_buffer->mNormal[k].x	=		x;
+							vertex_buffer->mNormal[k].y	=		y;
+							vertex_buffer->mNormal[k].z	=		z;
+						}
+					}
+					if (list[i].list[j].type==1) //Son 2 floats
+					{
+						fread(&x,sizeof(float),1,f);
+						fread(&y,sizeof(float),1,f);
+						
+						if (option == GEOMESH_BUILD)
+						{
+							vertex_buffer->mVertexInfo			|=	VERTEX_TEXCOORDS;
+							vertex_buffer->mTexCoords[k].x	=		x;
+							vertex_buffer->mTexCoords[k].y	=		y;
+						}
+					}
+				}
+			}
+		}
+		fclose(salida);
+	}
+	else
+	{
+		cout	<<	"Error"
+					<<	endl;
+	}
+
+}
+
+//	Read geometry.
+void GeoMeshLoader::readGeometry(FILE	*f, Mesh	*geoMesh, int option)
+{
+	SubMesh				*geoSubMesh;
+	VertexBuffer	*vertex_buffer;
+	
+	fread(&numVertices,sizeof(unsigned int),1,f);
+
+	if (option == GEOMESH_BUILD)
+	{
+		if (currentSubMesh == -1)
+		{
+			//	Get the current vertex buffer.
+			vertex_buffer	=	geoMesh->mVertexBuffer;
+		}
+		else
+		{
+			//	Get the current submesh.
+			geoSubMesh		=	&geoMesh->mSubMesh[currentSubMesh];
+
+			//	Create the VertexBuffer of the submesh.
+			geoSubMesh->mVertexBuffer	=	new VertexBuffer();
+
+			//	Get the current vertex buffer.
+			vertex_buffer	=	geoSubMesh->mVertexBuffer;
+		}
+
+		//	Initialize the VertexBuffer of the current submesh.
+		vertex_buffer->mVertexCount	=	numVertices;
+
+		//	Initialize the position array.
+		vertex_buffer->mPosition	=	new Vector3[numVertices];
+
+		//	Initialize the normal array.
+		vertex_buffer->mNormal		=	new Vector3[numVertices];
+
+		//	Initialize the texture coords array.
+		vertex_buffer->mTexCoords	=	new Vector2[numVertices];
+	}
+
+	// Find optional geometry chunks
+	if (!feof(f))
+	{
+		unsigned short chunkID = readChunk(f);
+	
+		while(!feof(f) && 
+					(chunkID == M_GEOMETRY_VERTEX_DECLARATION || 
+					chunkID == M_GEOMETRY_VERTEX_BUFFER ))
+		{
+			switch (chunkID)
+			{
+				case M_GEOMETRY_VERTEX_DECLARATION:
+					cout<<"M_GEOMETRY_VERTEX_DECLARATION\n";
+					readGeometryVertexDeclaration(f, geoMesh);
+					break;
+				case M_GEOMETRY_VERTEX_BUFFER:
+					cout<<"M_GEOMETRY_VERTEX_BUFFER\n";
+					readGeometryVertexBuffer(f, geoMesh,option);
+					break;
+			}
+		
+			// Get next chunk.
+			if (!feof(f))
+			{
+				chunkID = readChunk(f);
+			}
+		}
+		if (!feof(f))
+		{
+			// Backpedal back to start of non-submesh chunk.
+			fseek(f,-(long)CHUNK_OVERHEAD_SIZE,1);
+		}
+	}
+}
+
+//	Read a submesh operation.
+void GeoMeshLoader::readSubMeshOperation(FILE	*f, Mesh	*geoMesh, int option)
+{
+	unsigned	short	opType;
+	fread(&opType,sizeof(unsigned short),1,f);
+	printf("\tLa render operation es %d\n",opType);
+
+	if (option == GEOMESH_BUILD)
+	{
+		if (opType == 5)
+		{
+			geoMesh->mType	=	GEO_TRIANGLE_STRIPS;
+		}
+		else
+		{
+			geoMesh->mType	=	GEO_TRIANGLE_LIST;
+		}
+	}
+}
+
+//	Read a submesh.
+void GeoMeshLoader::readSubMesh(FILE	*f, Mesh	*geoMesh, int option)
+{
+	SubMesh					*geoSubMesh;
+	unsigned	short	chunkID;
+	char						materialName[255];
+	bool						useSharedVertices;
+	unsigned	int		numIndices;
+	bool						idx32bit;
+	FILE						*salida;
+
+	switch	(option)
+	{
+		case	SUBMESH_COUNT:
+			geoMesh->mSubMeshCount++;
+			break;
+		case	GEOMESH_BUILD:
+
+			//	Debug.
+			cout	<<	"Build GEOMESH"	<<	endl;
+
+			//	Initialize the new subMesh.
+			geoSubMesh	=	&geoMesh->mSubMesh[currentSubMesh];
+
+			cout	<<	"Current SubMesh: "
+						<<	currentSubMesh
+						<<	endl;
+	}
+	
+	//La vacio antes de leer el mesh
+	list.clear(); 
+
+	fgets(materialName,255,f);
+	printf("\tmaterialName: %s",materialName);
+
+	fread(&useSharedVertices,sizeof(bool),1,f);
+	
+	if (option	==	GEOMESH_BUILD)
+	{
+		//	Obtain the flag of vertex shared.
+		geoSubMesh->mSharedVertexBuffer	=	useSharedVertices;
+		
+		if (useSharedVertices)
+		{
+			//	The VB of the submesh points to the VB of the mesh.
+			geoSubMesh->mVertexBuffer	=	geoMesh->mVertexBuffer;
+			
+			cout	<<	"\tUse Shared Vertices"
+						<<	endl;
+
+		}
+	}
+
+	fread(&numIndices,sizeof(unsigned int),1,f);
+	printf("\tnumIndices: %u\n",numIndices);
+	printf("\tnumTriangles: %u\n",numIndices/3);
+	fread(&idx32bit,sizeof(bool),1,f);
+	
+	if (option == GEOMESH_BUILD)
+	{
+			//	Sets the index count of the submesh.
+			geoSubMesh->mIndexCount	=	numIndices;
+	
+			//	Create the index arrar for this submesh.
+			geoSubMesh->mIndex	=	new Index[numIndices];
+	}
+	
+	if (idx32bit)
+	{
+		printf("\tSon 32 bits por indice\n");
+	}
+	else
+	{
+		printf("\tSon 16 bits por indice\n");
+	}
+
+	salida	=	fopen(nom_salida,"a");
+
+	fprintf(salida,"\n#----->Leo un subMesh:");
+	
+	if (useSharedVertices)
+	{
+		fprintf(salida," shared vertices");
+	}
+	else
+	{
+		fprintf(salida,
+						" no shared vertices %d triangles",
+						numIndices/3);
+	}
+
+	fprintf(salida,"\n# Indexes:");
+	
+	//Sumo uno a los vertices porque en el obj no puede hacer un vertice 0
+	if (idx32bit)
+	{
+		unsigned int aux;
+
+		for (int i = 0; i < numIndices; i++)
+		{
+			fread(&aux,sizeof(unsigned int),1,f);
+
+			if (option == GEOMESH_BUILD)
+			{
+					geoSubMesh->mIndex[i]	=	aux;
+			}
+		}
+	}
+	else
+	{
+		unsigned short aux;
+
+		for (int i = 0; i < numIndices; i++)
+		{
+			fread(&aux,sizeof(unsigned short),1,f);
+			
+			if (option == GEOMESH_BUILD)
+			{
+				geoSubMesh->mIndex[i]	=	aux;
+			}
+		}
+	}
+
+	fclose(salida);
+
+  // M_GEOMETRY chunk 
+	// (Optional: present only if useSharedVertices = false)
+  if (!useSharedVertices)
+	{
+		chunkID = readChunk(f);
+		
+		if (chunkID != M_GEOMETRY)
+		{
+			printf("Missing geometry data in mesh file\n"); //Error
+		}
+		
+		readGeometry(f, geoMesh, option);
+	}
+
+	// Find all bone assignments (if present) 
+	if (!feof(f))
+	{
+		chunkID = readChunk(f);
+		while(!feof(f) &&
+					(chunkID == M_SUBMESH_BONE_ASSIGNMENT ||
+					chunkID == M_SUBMESH_OPERATION))
+		{
+			switch(chunkID)
+			{
+				case M_SUBMESH_OPERATION:
+								
+					cout<<"M_SUBMESH_OPERATION\n";
+					readSubMeshOperation(f, geoMesh, option);
+					break;
+				case M_SUBMESH_BONE_ASSIGNMENT:
+					jumpChunk(f);
+					break;
+			}
+
+			if (!feof(f))
+			{
+				chunkID	=	readChunk(f);
+			}
+
+		}
+		if (!feof(f))
+		{
+			// Backpedal back to start of chunk
+			fseek(f,-(long)CHUNK_OVERHEAD_SIZE,1);
+		}
+	}
+
+}
+
+//	Read a mesh lod information.
+void GeoMeshLoader::readMeshLodInfo(FILE	*f, Mesh	*geoMesh)
+{
+	unsigned	short	chunkID;
+	unsigned	short	i;
+	unsigned	short	aux;
+	bool						aux2;
+
+  // unsigned short numLevels;
+	fread(&aux,sizeof(unsigned short),1,f);
+	// bool manual;
+	// (true for manual alternate meshes, false for generated)
+	fread(&aux2,sizeof(bool),1,f);
+
+	// Loop from 1 rather than 0 (full detail index is not in file)
+	for (i = 1; i < aux; ++i)
+	{
+		chunkID = readChunk(f);
+		if (chunkID != M_MESH_LOD_USAGE)
+		{
+			printf("Missing M_MESH_LOD_USAGE chunk\n"); //Error
+		}
+		else printf("\tM_MESH_LOD_USAGE (%d bytes) ",long_actual);
+		jumpChunk(f);
+
+	}
+}
+
+//	Read a submesh name table.
+void GeoMeshLoader::readSubMeshNameTable(FILE	*f, Mesh	*geoMesh)
+{
+		unsigned	short	chunkID;
+		unsigned	short	subMeshIndex;
+		char						string[255];
+
+		if (!feof(f))
+		{
+			chunkID	=	readChunk(f);
+			
+			while	(!feof(f) && (chunkID == M_SUBMESH_NAME_TABLE_ELEMENT ))
+			{
+				printf("M_SUBMESH_NAME_TABLE_ELEMENT %d bytes\n",long_actual);
+				
+				// Read in the index of the submesh.
+				fread(&subMeshIndex,sizeof(unsigned short),1,f);
+				
+				// Read in the String and map it to its index.
+				fgets(string,255,f);
+				printf("index %u name %s\n",subMeshIndex,string);
+
+				// If we're not end of file get the next chunk ID
+				if (!feof(f))
+				{
+					chunkID = readChunk(f);
+				}
+			}
+			if (!feof(f))
+			{
+				// Backpedal back to start of chunk
+				fseek(f,-(long)CHUNK_OVERHEAD_SIZE,1);
+			}
+		}
+}
+
+//	Read a mesh file.
+void GeoMeshLoader::readMesh(FILE	*f, Mesh	*geoMesh, int option)
+{
+	unsigned	short	chunkID;
+	bool						nada;
+
+	//	Debug.
+	cout	<<	"Read Mesh"
+				<<	endl;
+	
+	//	Create the VertexBuffer of the mesh.
+	geoMesh->mVertexBuffer	=	new	VertexBuffer();
+	geoMesh->mVertexBuffer->mVertexCount	=	0;
+
+	//La vacio antes de leer el mesh
+	list.clear();
+
+	// bool skeletallyAnimated
+	fread(&nada,sizeof(bool),1,f);
+
+  // Find all subchunks 
+	if (!feof(f))
+	{
+		chunkID	=	readChunk(f);
+
+		while(!feof(f) &&
+				(chunkID == M_GEOMETRY ||
+				 chunkID == M_SUBMESH ||
+				 chunkID == M_MESH_SKELETON_LINK ||
+				 chunkID == M_MESH_BONE_ASSIGNMENT ||
+				 chunkID == M_MESH_LOD ||
+				 chunkID == M_MESH_BOUNDS ||
+				 chunkID == M_SUBMESH_NAME_TABLE ||
+				 chunkID == M_EDGE_LISTS))
+		{
+			switch(chunkID)
+			{
+				case M_GEOMETRY:
+
+					//	Debug.
+					cout	<<	"Geometry"	<<	endl;
+
+					readGeometry(f, geoMesh, option);
+					break;
+
+				case M_SUBMESH:
+
+					cout	<<	"SubMesh"	<<	endl;
+
+					if (option == GEOMESH_BUILD)
+					{
+						//	Increments the current submesh.
+						currentSubMesh++;
+					}
+
+					readSubMesh(f, geoMesh, option);
+
+					break;
+
+				case M_MESH_SKELETON_LINK:
+
+					cout	<<	"M_MESH_SKELETON_LINK  "
+						<<	long_actual
+						<<	" bytes\n";
+
+					jumpChunk(f);
+					break;
+
+				case M_MESH_BONE_ASSIGNMENT:
+
+					cout	<<	"M_MESH_BONE_ASSIGNMENT  "
+						<<	long_actual
+						<<	" bytes\n";
+
+					break;
+
+				case M_MESH_LOD:
+
+					cout	<<	"M_MESH_LOD\n";
+					readMeshLodInfo(f, geoMesh);
+					break;
+
+				case M_MESH_BOUNDS:
+
+					cout	<<	"M_MESH_BOUNDS "
+						<<	long_actual
+						<<	" bytes\n";
+
+					jumpChunk(f);
+					break;
+
+				case M_SUBMESH_NAME_TABLE:
+
+					cout	<<	"M_SUBMESH_NAME_TABLE "
+						<<	long_actual
+						<<	" bytes\n";
+
+					readSubMeshNameTable(f,	geoMesh);
+					break;
+
+				case M_EDGE_LISTS:
+
+					cout	<<	"M_EDGE_LISTS "
+						<<	long_actual
+						<<	" bytes\n";
+
+					jumpChunk(f);
+					break;
+			}
+
+			if (!feof(f))
+			{
+				chunkID	=	readChunk(f);
+			}
+
+		}
+
+		if (!feof(f))
+		{
+			// Backpedal back to start of chunk
+			fseek(f,-(long)CHUNK_OVERHEAD_SIZE,1);
+			printf("Malo\n");
+		}
+	}
+
+}
+
+/*
+		Allocate memory to the array of strips
+*/
+Mesh* GeoMeshLoader::BuildStripsGeoSubMesh(Mesh* geoMesh)
+{
+	bool		head_found;
+	bool		tail_found;
+	int			strip_count;
+	int			tailIndex;
+	size_t	tail;
+	SubMesh	*geoSubMesh;
+
+	//	For each submesh.
+	for (int submesh	=	0; submesh < geoMesh->mSubMeshCount; submesh++)
+	{
+		//	Gets the actual submesh.
+		geoSubMesh	=	&geoMesh->mSubMesh[submesh];
+		
+		head_found							=	false;
+		tail_found							=	false;
+		geoSubMesh->mStripCount	=	1;
+	
+		//	Foreachone of the indices.
+		//	Obtains the number of triangle strips.
+		for (int i = 0; i < (geoSubMesh->mIndexCount - 1); i++)
+		{
+			if (geoSubMesh->mIndex[i] == geoSubMesh->mIndex[i+1])
+			{
+				if (head_found)
+				  {
+					tail_found	=	true;
+				}
+				else
+				{
+					head_found	=	true;
+				}
+
+				//	Jump one index.
+				i++;
+			}
+			else
+			{
+				//	Increments the number of triangle strips.
+				if (tail_found)
+				{
+					geoSubMesh->mStripCount++;
+				}
+
+				head_found	=	false;
+				tail_found	=	false;
+			}
+		}
+
+		geoSubMesh->mStrip		=	(Index**) malloc(	sizeof(Index*)
+																							*
+																							geoSubMesh->mStripCount);
+
+		//	Number of strips. Initially there is one triangle strip.
+		strip_count	=	1;
+
+		head_found						=	false;
+		tail_found						=	false;
+
+		//	Initialize the fist triangle strip.
+		geoSubMesh->mStrip[0]	=	&geoSubMesh->mIndex[0];
+
+		//	Foreachone of the indices.
+		//	Assigns the beginning of the triangle strips.
+		for(int i = 0;i < (geoSubMesh->mIndexCount - 1); i++)
+		{
+			if(geoSubMesh->mIndex[i] == geoSubMesh->mIndex[i+1])
+			{
+				if(head_found)
+				{
+					if (!tail_found)
+					{
+						tailIndex		=	i;
+					}
+
+					tail_found	=	true;
+				}
+				else
+				{
+					head_found	=	true;
+				}
+
+				//	Jump one index.
+				i++;
+			}
+			else
+			{
+				//	Increments the number of triangle strips.
+				if(tail_found)
+				{
+					geoSubMesh->mStrip[strip_count++]	=	&geoSubMesh->mIndex[tailIndex];
+				}
+
+				head_found	=	false;
+				tail_found	=	false;
+			}
+		}
+	}
+
+	return	geoMesh;
+}
+
+//	Loads a mesh.
+Mesh* GeoMeshLoader::load(char	*nameFileMesh) 
+{
+	unsigned	short	uno;
+  unsigned	short	chunkID;
+	char						version[255];
+	char						kk;
+	FILE						*salida;
+	FILE						*pFile;
+
+	//	Initialize the current submesh;
+	currentSubMesh	=	-1;
+	
+	std::cout	<<	"Load a new Mesh"
+						<<	std::endl;
+
+	//	Initialize the return value.
+	geoMesh	=	new	Mesh();
+
+	//	Open the mesh file.
+	pFile	=	fopen( nameFileMesh, "rb" );
+
+  if (!pFile)
+  {
+		printf("No he encontrado el fichero\n");
+		exit(0);
+  }
+
+	//	Count the submeshes
+	//	and next build the geomesh.
+	for (int option = 0; option < 2;option++)
+	{
+		fread(&uno,sizeof(unsigned short),1,pFile);
+
+		if (uno != M_HEADER)
+		{
+			cout	<<	"no se ha encontrado el header"
+						<<	endl;
+		}
+
+		// Read version.
+		fgets(version,255,pFile);
+
+		cout	<<	version	<<	endl;
+
+		if (strcmp(version,"[MeshSerializer_v1.30]\n"))
+		{
+			cout	<<
+						"No se puede trabajar con versiones de"
+						<<
+						" .mesh diferentes de la 1.3"
+						<<
+						endl;
+		}
+
+		salida	=	fopen(nom_salida,"w");
+
+		fprintf(salida,"# Empiezo el fichero:");
+
+		fclose(salida);
+
+		while(!feof(pFile))
+		{
+			chunkID = readChunk(pFile);
+
+			switch (chunkID)
+			{
+				case M_MESH:
+					readMesh(pFile, geoMesh, option);
+					break;
+			}
+		}
+
+		//	Create the submesh array
+		if (option == SUBMESH_COUNT)
+		{		
+			cout	<<	"---------------"
+						<<	endl;
+
+			cout	<<	"SubMesh Count: "
+						<<	geoMesh->mSubMeshCount
+						<<	endl;
+
+			geoMesh->mSubMesh	= new SubMesh[geoMesh->mSubMeshCount];
+		}
+							
+		if (feof(pFile))
+		{
+			cout	<<	"------->Hemos llegado al final del fichero"
+						<<	endl;
+		}
+
+		//cout	<<	"Press enter to exit\n";
+
+		//	Move the curso to the begining of the file.
+		fseek(pFile,0,SEEK_SET);
+	}
+
+	//	Goes to the end of the file.
+	fseek(pFile,0,SEEK_END);
+
+	//	Gets the size of the file.
+	mFileSize	=	ftell(pFile);
+	
+	// Close the mesh file.
+	fclose(pFile);
+	
+	if (geoMesh->mType == Geometry::GEO_TRIANGLE_STRIPS)
+	{
+		//	Fill the strips list.
+		geoMesh	=	BuildStripsGeoSubMesh(geoMesh);
+	}
+	
+	return	geoMesh;
+}
+
+//	Get the size in bytes of the file.
+size_t	GeoMeshLoader::getFileSize()
+{
+	return	mFileSize;
+}
+
+//	Constructor
+GeoMeshLoader::GeoMeshLoader()
+{
+	nom_salida	=	"salida22.obj";
+	geoMesh			=	NULL;
+	mFileSize		=	0;
+}
+
+//	Destroyer.
+GeoMeshLoader::~GeoMeshLoader()
+{
+	delete	geoMesh;
+}
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp	(revision 774)
@@ -0,0 +1,2577 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0100
+
+#include "GeoMeshViewUI.h"
+#include "resource.h"
+
+using	namespace	Geometry;
+using	namespace	std;
+
+//---------------------------------------------------------------------------
+//	Menu File Open Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuFileOpen_i(fltk::Item*, void*)
+{
+	//	Sets menus application state to NONE.
+	mApplicationState	=	NONE;
+
+	//	Loads a mesh file.
+	openMeshFile();
+	
+	//	Debug.
+	cout	<<	"Vertex Count SubMesh 0:	"
+				<<	mGeoMesh->mSubMesh[0].mVertexBuffer->mVertexCount
+				<<	endl;
+	//----------------------------------------------------------
+	
+	//	Deactive Lod strip visualization.
+	geoMeshView->deactiveLodStrip();
+
+	//	Repaint the window.
+	mMainWindow->redraw();
+}
+
+//---------------------------------------------------------------------------
+//	Repaint the FPS label.
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::refreshFPS(int fps)
+{
+	static char	char_value[10];
+	
+	//	Translate the FPS count to a char value.
+	sprintf(char_value,"FPS %d",fps);
+
+	mFPS->label(char_value);
+
+	//	Repaint the window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuFileOpen(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuFileOpen_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Save callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuFileSave_i(fltk::Item*, void*)
+{
+	GeoMeshSaver	*mesh_saver;
+
+	//	If there is a mesh object created.
+	if (mGeoMesh	!= NULL)
+	{
+		//	Create a mesh saver with mesh bounds.
+		mesh_saver	=	new	GeoMeshSaver(mMeshBounds);
+
+		//	Save the file mesh.
+		mesh_saver->save(	mGeoMesh,
+				mFileName);
+
+		//	Free memory.
+		delete	mesh_saver;
+	}
+}
+
+void GeoMeshViewUI::cb_menuFileSave(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuFileSave_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Save As Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuOpenSaveAs_i(fltk::Item*, void*)
+{
+	fltk::FileChooser *fcho;
+	GeoMeshSaver			*mesh_saver;
+	
+	if (mGeoMesh != NULL)
+	{
+		fcho	=	new fltk::FileChooser("",
+				"*.mesh",
+				fltk::FileChooser::CREATE,
+				"Save Mesh as");
+
+		fcho->exec();
+
+		if (fcho->value())
+		{
+			mesh_saver	=	new	GeoMeshSaver(mMeshBounds);
+
+			mesh_saver->save(	mGeoMesh,
+					filename_name(fcho->value()));
+
+			delete	mesh_saver;
+		}
+
+		//	Repaint the window.
+		mMainWindow->redraw();
+
+		delete	fcho;
+	}
+}
+
+void GeoMeshViewUI::cb_menuOpenSaveAs(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuOpenSaveAs_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Mesh info callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuMeshInfo_i(fltk::Item*, void*)
+{
+	//	Show title.
+	mProcessTitle->label("Mesh Info");
+
+	showMeshInfo();
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuMeshInfo(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuMeshInfo_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Mesh Export to OBJ callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuMeshExportOBJ_i(fltk::Item*, void*)
+{
+	char *p;
+  	
+	//	Sets menus application state to NONE.
+	mApplicationState	=	NONE;
+  
+	//	Open file chooser dialog.
+	p	=	fltk::file_chooser(	"Export to OBJ",
+													"*.obj",
+													"");
+	if (p && mGeoMesh)
+	{
+		mGeoMesh->exportToOBJ(p);
+	}
+}
+
+void GeoMeshViewUI::cb_menuMeshExportOBJ(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuMeshExportOBJ_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Transform to Shared Vertex callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuTransformSharedVertex_i(fltk::Item*, void*)
+{
+	Mesh	*mesh_aux;
+	
+	//	if the undo mesh is not initialized.
+	if	(mGeoMesh != NULL)
+	{
+		//	Deletes the actual mesh.
+		delete	mUndoMesh;
+
+		mUndoMesh	=	new Mesh();
+
+		//	Restore the previous mesh.
+		*mUndoMesh	=	*mGeoMesh;
+
+		//	Transform NoSV Mesh to a SV Mesh.
+		mesh_aux	=	mGeoMesh->toSharedVertex();
+
+		//	Deletes the mesh No Shared Vertex.
+		delete	mGeoMesh;
+
+		//	Gets the mesh Shared Vertex.
+		mGeoMesh	=	mesh_aux;
+
+		//	Visualize the mesh stripified.
+		geoMeshView->setMesh(mGeoMesh);
+
+		//	Refresh mesh information.
+		showMeshInfo();
+		
+		//	Repaint the window.
+		mMainWindow->redraw();
+	}
+}
+
+void GeoMeshViewUI::cb_menuFileTransformSharedVertex(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuTransformSharedVertex_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Quit Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuOpenQuit_i(fltk::Item*, void*)
+{
+	delete	this;
+}
+
+void GeoMeshViewUI::cb_menuOpenQuit(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuOpenQuit_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Undo Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuEditUndo_i(fltk::Item*, void*)
+{
+	//	Undo the mesh changes.
+	undo();
+}
+
+void GeoMeshViewUI::cb_menuEditUndo(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuEditUndo_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Fit Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuEditFit_i(fltk::Item*, void*)
+{
+	geoMeshView->fit();
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuEditFit(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuEditFit_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Rotate Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuEditRotate_i(fltk::Item	*item, void*)
+{	
+	//	If the item is activated.
+	if (item->value())
+	{
+		menuEditPan->clear_value();
+		geoMeshView->deactivePan();
+		
+		geoMeshView->activeRotate();
+	}
+	else
+	{
+		menuEditPan->set_value();
+		geoMeshView->activePan();
+
+		geoMeshView->deactiveRotate();
+	}
+
+	//	Repaint the main window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuEditRotate(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuEditRotate_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Pan Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuEditPan_i(fltk::Item	*item, void*)
+{	
+	//	If the item is activated.
+	if (item->value())
+	{
+		geoMeshView->activePan();
+		
+		menuEditRotate->clear_value();
+		geoMeshView->deactiveRotate();
+	}
+	else
+	{
+		geoMeshView->deactivePan();
+		
+		menuEditRotate->set_value();
+		geoMeshView->activeRotate();
+	}
+
+	//	Repaint the main window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuEditPan(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuEditPan_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Zoom Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuEditZoom_i(fltk::Item*, void*)
+{
+}
+
+void GeoMeshViewUI::cb_menuEditZoom(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuEditZoom_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Wire Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuRenderWire_i(fltk::Item *item, void*)
+{
+	if (item->value())
+	{
+		geoMeshView->activeWire();
+	}
+	else
+	{
+		geoMeshView->deactiveWire();
+	}
+
+	//	Repaint the canvas.
+	//geoMeshView->redraw();
+
+	//	Repaint the main window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuRenderWire(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuRenderWire_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Solid Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuRenderSolid_i(fltk::Item	*item, void*)
+{
+	if (item->value())
+	{
+		geoMeshView->activeSolid();
+	}
+	else
+	{
+		geoMeshView->deactiveSolid();
+	}
+									
+	//	Repaint the canvas.
+	//geoMeshView->redraw();
+	
+	//	Repaint the main window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuRenderSolid(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuRenderSolid_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	CW callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuRenderCW_i(fltk::Item	*item, void*)
+{
+	//	Clear the CCW state.
+	menuRenderCCW->clear_value();
+	geoMeshView->deactiveCCW();
+	
+	//	If the item is activated.
+	if (item->value())
+	{
+		geoMeshView->activeCW();
+	}
+	else
+	{
+		geoMeshView->deactiveCW();
+	}
+
+	//	Repaint the main window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuRenderCW(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuRenderCW_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	CCW callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuRenderCCW_i(fltk::Item	*item, void*)
+{
+	//	Clear the CW state.
+	menuRenderCW->clear_value();
+	geoMeshView->deactiveCW();
+	
+	//	If the item is activated.
+	if (item->value())
+	{
+		geoMeshView->activeCCW();
+	}
+	else
+	{
+		geoMeshView->deactiveCCW();
+	}
+
+	//	Repaint the main window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuRenderCCW(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuRenderCCW_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Flat callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuRenderFlat_i(fltk::Item*, void*)
+{
+	//	Deactive smooth flag.
+	menuRenderSmooth->clear_value();
+	
+	//	Sets flat lighting.
+	geoMeshView->flat();
+
+	//	Repaint the main window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuRenderFlat(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuRenderFlat_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Smooth Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuRenderSmooth_i(fltk::Item*, void*)
+{
+	//	Deactive flat flag.
+	menuRenderFlat->clear_value();
+
+	//	Sets smooth lighting.
+	geoMeshView->smooth();
+
+	//	Repaint the main window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuRenderSmooth(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuRenderSmooth_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Textures callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuRenderTextures_i(fltk::Item*, void*)
+{
+	//	Repaint the main window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuRenderTextures(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuRenderTextures_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Stripify Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuStripify_i(fltk::Item*, void*)
+{
+	//	Show title.
+	mProcessTitle->label("Stripify");
+	mProcessBar->position(0);
+
+	//	Hide the right panel.
+	hideRightPanel();
+
+	//	Show the stripify panel.
+	showStripify();
+	
+	//	Sets menus application state to STRIPIFY.
+	mApplicationState	=	STRIPIFY;
+
+	//	Repaint the window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuStripify(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->user_data()))
+										->
+										cb_menuStripify_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Simplify Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuSimplify_i(fltk::ItemGroup*, void*)
+{
+}
+
+void GeoMeshViewUI::cb_menuSimplify(fltk::ItemGroup* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->user_data()))
+										->
+										cb_menuSimplify_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Edge collapse Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuSimplifyEdgeCollapse_i(fltk::Item*, void*)
+{
+	//	Show title.
+	mProcessTitle->label("Mesh Simplification");
+	mProcessBar->position(0);
+
+	//	Hide the right panel.
+	hideRightPanel();
+
+	//	Show the edge collapse panel.
+	showEdgeCollapse();
+	
+	//	Sets menus application state to EDGE_COLLAPSE.
+	mApplicationState	=	EDGE_COLLAPSE;
+
+	//	Repaint the window.
+	mMainWindow->redraw();
+
+}
+
+void GeoMeshViewUI::cb_menuSimplifyEdgeCollapse(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuSimplifyEdgeCollapse_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Leaves collapse Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuSimplifyLeavesCollapse_i(fltk::Item*, void*)
+{
+	//	Show title.
+	mProcessTitle->label("Leaves Simplification");
+	mProcessBar->position(0);
+
+	//	Hide the right panel.
+	hideRightPanel();
+
+	//	Show the leaves collapse panel.
+	showLeavesCollapse();
+	
+	//	Sets menus application state to LEAVES_COLLAPSE.
+	mApplicationState	=	LEAVES_COLLAPSE;
+
+	//	Repaint the window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuSimplifyLeavesCollapse(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuSimplifyLeavesCollapse_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Tree select leaves simplification Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuSelectLeaves_i(fltk::Item*, void*)
+{
+	//	Show title.
+	mProcessTitle->label("Select Leaves");
+
+	showMeshInfo();
+	mButtonProcess->show();
+	mButtonProcess->activate();
+	mApplicationState	=	SELECT_LEAVES;
+}
+
+void GeoMeshViewUI::cb_menuSelectLeaves(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuSelectLeaves_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Auto Generate LodStrips Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuLodStripsGenerate_i(fltk::Item*, void*)
+{
+	//	Show title.
+	mProcessTitle->label("Generate LodStrips");
+	mProcessBar->position(0);
+	mBuildBar->position(0);
+
+	//	Hide the right panel.
+	hideRightPanel();
+
+	//	Show the LodStrips panel.
+	showAutoGenerateLodStrips();
+	
+	//	Sets menus application state to LODSTRIPS_AUTO.
+	mApplicationState	=	LODSTRIPS_AUTO;
+
+	//	Repaint the window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuLodStripsGenerate(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuLodStripsGenerate_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Visualize LodStrips Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuLodStripsVisualize_i(fltk::Item*, void*)
+{
+	fltk::FileChooser *fcho;
+	const	char				*lod_file;
+	
+	//	Sets menus application state to NONE.
+	mApplicationState	=	NONE;
+
+	//	Deactive Lod strip visualization.
+	geoMeshView->deactiveLodStrip();
+
+	//	Loads a mesh file.
+	openMeshFile();
+	
+	//	Show title.
+	mProcessTitle->label("Visualize LodStrips");
+
+	//	If an object is loaded.
+	if (mGeoMesh != NULL)
+	{
+		fcho	=	new fltk::FileChooser("",
+				"*.lod",
+				fltk::FileChooser::CREATE,
+				"Open Lod file");
+
+		fcho->exec();
+
+		//	If a file was selected.
+		if (fcho->value())
+		{
+			//	Build lod strips library.
+			setLodStripsLibrary(string(fcho->value()), mGeoMesh);
+
+			//	Sets the aplication mode.
+			mApplicationState	=	VISUALIZE_LODSTRIPS;
+		}
+
+		//	Free memory.
+		delete	fcho;
+	}
+
+	//	Hide the right panel.
+	hideRightPanel();
+
+	//	Show the Visulize LodStrips panel.
+	showVisualizeLodStrips();
+	
+	//	Repaint the window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuLodStripsVisualize(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuLodStripsVisualize_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Open LodStrip trunk Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuLodTreesOpenLodStripTrunk_i(fltk::Item*, void*)
+{
+}
+
+void GeoMeshViewUI::cb_menuLodTreesOpenLodStripTrunk(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuLodTreesOpenLodStripTrunk_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Open leaves simplification Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuLodTreesOpenLeavesSimplification_i(fltk::Item*, void*)
+{
+	//	Hide the right panel.
+	hideRightPanel();
+
+	//	Show the LodTrees panel.
+	showOpenLeavesSimplification();
+
+	//	Sets menus application state to LODTREES.
+	mApplicationState	=	LODTREES;
+
+	//	Repaint the window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_menuLodTreesOpenLeavesSimplification(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuLodTreesOpenLeavesSimplification_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	About Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_menuHelpAbout_i(fltk::Item*, void*)
+{
+	new	GTAboutDialog();
+}
+
+void GeoMeshViewUI::cb_menuHelpAbout(fltk::Item* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_menuHelpAbout_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Button Process Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_mButtonProcess_i(fltk::Button*, void*)
+{
+	Mesh	*mesh_aux;
+	
+	//	Sets the progress bar to process bar.
+	progressBarType	=	PROCESS;
+	mProcessBar->position(0);
+
+	//	If there is a mesh object.
+	if (mGeoMesh != NULL)
+	{
+		//	Choose between aplication state.
+		switch(mApplicationState)
+		{
+			//	Stripify state.
+			case	STRIPIFY:
+
+				//	Stripify the mesh object.
+				stripify();
+
+				break;
+
+				//	Simplify edge collapse state.
+			case	EDGE_COLLAPSE:
+
+				//	if the mesh is stripified.
+				if (mGeoMesh->mType == GEO_TRIANGLE_STRIPS)
+				{
+					fltk::alert("Can't simplify a mesh in triagle strips.");
+				}
+				else
+				{
+
+					//	Simplify the mesh object.
+					simplifyEdgeCollapse();
+				}
+				break;
+
+				// Simplify leaves
+			case	LEAVES_COLLAPSE:
+
+				//	Simplify the mesh object.
+				simplifyLeavesCollapse();
+
+				break;
+
+				//	Simplify and generate simplification sequence.
+			case	LODSTRIPS_AUTO:
+
+				//	if the mesh is stripified.
+				if (mGeoMesh->mType == GEO_TRIANGLE_STRIPS)
+				{
+					fltk::alert("Can't simplify a mesh in triagle strips.");
+				}
+				else
+				{
+
+					//	Transform NoSV Mesh to a SV Mesh.
+					mesh_aux	=	mGeoMesh->toSharedVertex();
+
+					//	Deletes the mesh No Shared Vertex.
+					delete	mGeoMesh;
+
+					//	Gets the mesh Shared Vertex.
+					mGeoMesh	=	mesh_aux;
+
+					//	Simplify the mesh object.
+					simplifyEdgeCollapse();
+
+					//	Create the qslim simplification sequence.
+					createQslimSequence();
+				}
+
+				break;
+
+				// Añadido 23-12-2005
+			case	SELECT_LEAVES:
+
+				idMeshLeaves	=	paintMesh();
+
+				//	Set the leaves submesh.
+				geoMeshView->setLeavesSubmesh(idMeshLeaves);
+
+				//	Refresh mesh info.
+				showMeshInfo();
+
+				break;
+		}
+
+		//	Refresh geometry attributes.
+		refreshApplicationBar();
+	}
+	
+	//	Repaint the GL Window.
+	mMainWindow->redraw();
+}
+
+void GeoMeshViewUI::cb_mButtonProcess(fltk::Button* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_mButtonProcess_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Button Sort Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_mButtonSort_i(fltk::Button*, void*)
+{
+}
+
+void GeoMeshViewUI::cb_mButtonSort(fltk::Button* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_mButtonSort_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Button Build Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_mButtonBuild_i(fltk::Button*, void*)
+{
+	char					*file_name;
+	GeoMeshSaver	*mesh_saver;
+	Serializer		*oSerializer;
+	
+	//	Sets the progress bar to process bar.
+	progressBarType	=	BUILD;
+
+	//	Reset the build bar.
+	mBuildBar->position(0);
+
+	//	If there is a mesh object.
+	if (mGeoMesh != NULL)
+	{
+		//	Choose between aplication state.
+		switch(mApplicationState)
+		{
+			//	Build the LOD file.
+			case	LODSTRIPS_AUTO:
+
+				// Builder
+
+				//	Open file chooser dialog.
+				file_name	=	fltk::file_chooser(	"Build LOD",
+						"*",
+						"");
+
+				//	If a file was selected.
+				if (file_name)
+				{
+					//	Undo the simplification changes.
+					undo();
+
+					//	Stripify the mesh object.
+					stripify();
+
+					//	Reset the build bar.
+					mBuildBar->position(0);
+
+					//	Simplification sequence.
+					oMeshSimpSequence = new MeshSimplificationSequence();
+
+					//	Loads a simplification sequence file.
+					oMeshSimpSequence->Load(Serializer(	"mqslimSequence.txt",
+								Serializer::READ));
+
+					//	If the simplification sequence and the mesh exist.
+					if (oMeshSimpSequence && mGeoMesh)
+					{
+						oLodStrip		=	new LodStripsConstructor(	mGeoMesh,
+								oMeshSimpSequence,
+								progress_function);
+
+						oSerializer	=	new Serializer(	strcat(file_name,".lod"),
+								Serializer::Mode::WRITE);
+
+						oLodStrip->LodStripsConstructor::Save(*oSerializer);
+
+						//	Close file.
+						delete	oSerializer;
+
+						//	Deletes the previous mesh.
+						delete mUndoMesh;
+
+						mUndoMesh	=	new Mesh();
+
+						//	Sets the undo mesh.
+						*mUndoMesh	=	*mGeoMesh;
+
+						delete	mGeoMesh;
+
+						mGeoMesh	=	oLodStrip->GetMesh();
+
+						geoMeshView->setMesh(mGeoMesh);
+
+						mesh_saver	=	new	GeoMeshSaver(mMeshBounds);
+						file_name[strlen(file_name) - 4]	=	'\0';
+						mesh_saver->save(	mGeoMesh,
+								strcat(file_name,".mesh"));
+						delete	mesh_saver;
+
+					}
+					else
+					{
+						//	Error message.
+						fltk::alert("There is no simplification sequence.");
+					}
+
+					//	Deletes the siplification sequence object.
+					delete	oMeshSimpSequence;
+				}
+				break;
+		}
+		//	Refresh data aplication.
+		refreshApplicationBar();
+	}	
+}
+
+void GeoMeshViewUI::cb_mButtonBuild(fltk::Button	*o, void	*v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_mButtonBuild_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Lod Slider Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_mLodSlider_i(fltk::Slider	*o, void	*)
+{
+	//	Change the lod.
+	geoMeshView->GoToLod((unsigned int)o->value());
+
+	//	Refresh data aplication.
+	refreshApplicationBar();
+		
+	mMainWindow->flush();
+}
+
+void GeoMeshViewUI::cb_mLodSlider(fltk::Slider	*o, void	*v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_mLodSlider_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Mesh Info Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_mMeshInfo_i(fltk::Browser	*, void	*)
+{	
+	paintMesh();
+}
+
+void GeoMeshViewUI::cb_mMeshInfo(fltk::Browser* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->parent()->user_data()))
+										->
+										cb_mMeshInfo_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Logo Callback
+//---------------------------------------------------------------------------
+inline void GeoMeshViewUI::cb_mLogo_i(fltk::InvisibleBox*, void*)
+{
+}
+
+void GeoMeshViewUI::cb_mLogo(fltk::InvisibleBox* o, void* v)
+{
+  ((GeoMeshViewUI*)	(o->parent()->parent()->user_data()))
+										->
+										cb_mLogo_i(o,v);
+}
+
+//---------------------------------------------------------------------------
+//	Show the stripify panel
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::showStripify()
+{
+	/*
+	mTypeLabel->set_visible();
+	mTypeLabel->activate();
+
+	mOneCacheStrip->set_visible();
+	mOneCacheStrip->activate();
+
+	mQualityStrips->set_visible();
+	mQualityStrips->activate();
+	*/
+
+	mButtonProcess->set_visible();
+	mButtonProcess->activate();
+
+	mProcessBar->set_visible();
+	mProcessBar->activate();
+}
+
+//---------------------------------------------------------------------------
+//	Hide the stripify panel
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::hideStripify()
+{
+	/*
+	mTypeLabel->hide();
+	mTypeLabel->deactivate();
+	*/
+	
+	mOneCacheStrip->hide();
+	mOneCacheStrip->deactivate();
+
+	mQualityStrips->hide();
+	mQualityStrips->deactivate();
+
+	mButtonProcess->hide();
+	mButtonProcess->deactivate();
+
+	mProcessBar->hide();
+	mProcessBar->deactivate();
+}
+
+//---------------------------------------------------------------------------
+//	Show the Simplify Edge Collapse panel
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::showEdgeCollapse()
+{
+	mMetricLabel->set_visible();
+	mMetricLabel->activate();
+
+	mGeometryBased->set_visible();
+	mGeometryBased->activate();
+	mGeometryBased->set();
+
+	mImageBased->set_visible();
+	mImageBased->activate();
+
+	/*
+	mTypeLabel->set_visible();
+	mTypeLabel->activate();
+
+	mChangeVertices->set_visible();
+	mChangeVertices->activate();
+	*/
+	
+	mMeshReductionLabel->set_visible();
+	mMeshReductionLabel->activate();
+
+	mPercent->set_visible();
+	mPercent->activate();
+	mPercent->set();
+
+	mVerticesNumber->set_visible();
+	mVerticesNumber->activate();
+
+	mMeshReduction->set_visible();
+
+	// JGA
+	// Allows floating point.
+	mMeshReduction->type(fltk::FloatInput::FLOAT);
+
+	mMeshReduction->activate();
+
+	mButtonProcess->set_visible();
+	mButtonProcess->activate();
+
+	mProcessBar->set_visible();
+	mProcessBar->activate();
+}
+
+//---------------------------------------------------------------------------
+//	Hide the Simplify Edge Collapse
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::hideEdgeCollapse()
+{
+	mMetricLabel->hide();
+	mMetricLabel->deactivate();
+
+	mGeometryBased->hide();
+	mGeometryBased->deactivate();
+
+	mImageBased->hide();
+	mImageBased->deactivate();
+
+	/*
+	mTypeLabel->hide();
+	mTypeLabel->deactivate();
+
+	mChangeVertices->hide();
+	mChangeVertices->deactivate();
+	*/
+	
+	mMeshReductionLabel->hide();
+	mMeshReductionLabel->deactivate();
+
+	mPercent->hide();
+	mPercent->deactivate();
+
+	mVerticesNumber->hide();
+	mVerticesNumber->deactivate();
+
+	mMeshReduction->hide();
+	mMeshReduction->deactivate();
+	
+	mButtonProcess->hide();
+	mButtonProcess->deactivate();
+
+	mProcessBar->hide();
+	mProcessBar->deactivate();
+}
+
+//---------------------------------------------------------------------------
+//	Show the Simlify Leaves Collapse
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::showLeavesCollapse()
+{
+	mMetricLabel->set_visible();
+	mMetricLabel->activate();
+
+	mGeometryBased->set_visible();
+	mGeometryBased->activate();
+	mGeometryBased->set();
+
+	mImageBased->set_visible();
+	mImageBased->activate();
+
+	/*
+	mTypeLabel->set_visible();
+	mTypeLabel->activate();
+
+	mChangeTexture->set_visible();
+	mChangeTexture->activate();
+	*/
+
+	mMeshReductionLabel->set_visible();
+	mMeshReductionLabel->activate();
+
+	mPercent->set_visible();
+	mPercent->activate();
+	mPercent->set();
+
+	mVerticesNumber->set_visible();
+	mVerticesNumber->activate();
+
+	mMeshReduction->set_visible();
+	mMeshReduction->type(fltk::FloatInput::FLOAT);
+	mMeshReduction->activate();
+
+	mButtonProcess->set_visible();
+	mButtonProcess->activate();
+
+	mProcessBar->set_visible();
+	mProcessBar->activate();
+}
+
+//---------------------------------------------------------------------------
+//	Hide the Simplify Leaves Collapse
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::hideLeavesCollapse()
+{
+	mMetricLabel->hide();
+	mMetricLabel->deactivate();
+
+	mGeometryBased->hide();
+	mGeometryBased->deactivate();
+
+	mImageBased->hide();
+	mImageBased->deactivate();
+
+	/*
+	mTypeLabel->hide();
+	mTypeLabel->deactivate();
+
+	mChangeTexture->hide();
+	mChangeTexture->deactivate();
+	*/
+	
+	mMeshReductionLabel->hide();
+	mMeshReductionLabel->deactivate();
+
+	mPercent->hide();
+	mPercent->deactivate();
+
+	mVerticesNumber->hide();
+	mVerticesNumber->deactivate();
+
+	mMeshReduction->hide();
+	mMeshReduction->deactivate();
+
+	mButtonProcess->hide();
+	mButtonProcess->deactivate();
+
+	mProcessBar->hide();
+	mProcessBar->deactivate();
+}
+
+//---------------------------------------------------------------------------
+//	Show the LodStrips Panel
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::showOpenMeshSimplification()
+{
+	mButtonProcess->set_visible();
+	mButtonProcess->activate();
+
+	mProcessBar->set_visible();
+	mProcessBar->activate();
+
+	mButtonBuild->set_visible();
+	mButtonBuild->activate();
+
+	mBuildBar->set_visible();
+	mBuildBar->activate();
+}
+
+//---------------------------------------------------------------------------
+//	Hide the LodStrips Panel
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::hideOpenMeshSimplification()
+{
+	mButtonProcess->hide();
+	mButtonProcess->deactivate();
+
+	mProcessBar->hide();
+	mProcessBar->deactivate();
+
+	mButtonBuild->hide();
+	mButtonBuild->deactivate();
+
+	mBuildBar->hide();
+	mBuildBar->deactivate();
+}
+
+//---------------------------------------------------------------------------
+//	Shows the auto generate LodStrips panel
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::showAutoGenerateLodStrips()
+{
+	//	Shows the simplify panel.
+	showEdgeCollapse();
+
+	mButtonBuild->set_visible();
+	mButtonBuild->activate();
+
+	mBuildBar->set_visible();
+	mBuildBar->activate();
+}
+
+//---------------------------------------------------------------------------
+//	Show the LodStrips visulization panel
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::showVisualizeLodStrips()
+{
+	mLodSlider->set_visible();
+	mLodSlider->activate();
+}
+
+//---------------------------------------------------------------------------
+//	Hide the LodStrips visualization panel
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::hideVisualizeLodStrips()
+{
+	mLodSlider->hide();
+	mLodSlider->deactivate();
+}
+
+//---------------------------------------------------------------------------
+//	Show the LodTrees Panel
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::showOpenLeavesSimplification()
+{
+	mButtonBuild->set_visible();
+	mButtonBuild->activate();
+
+	mBuildBar->set_visible();
+	mBuildBar->activate();
+}
+
+//---------------------------------------------------------------------------
+//	Hide the LodTrees Panel
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::hideOpenLeavesSimplification()
+{
+	mButtonBuild->hide();
+	mButtonBuild->deactivate();
+
+	mBuildBar->hide();
+	mBuildBar->deactivate();
+}
+
+//---------------------------------------------------------------------------
+//	Show the mesh info browser
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::showMeshInfo()
+{
+	char	type[10];
+	
+	if (mGeoMesh)
+	{
+		// Remove previous mesh information
+		this->mMeshInfo->remove_all();
+		ogeometry = new fltk::ItemGroup("Geometry");
+		ogeometry->begin();
+
+		fltk::ItemGroup **oprueba;
+		oprueba=new fltk::ItemGroup*[mGeoMesh->mSubMeshCount];
+		for(int i=0; i<mGeoMesh->mSubMeshCount;i++)
+		{
+			char *cadena=new char[12];
+
+			if (geoMeshView->getLeavesSubmesh() >= 0)
+			{
+				if (geoMeshView->getLeavesSubmesh() == i)
+				{
+					strcpy(type,"(Leaves)");
+				}
+				else
+				{
+					strcpy(type,"(Trunc)");
+				}
+			}
+			else
+			{
+				strcpy(type,"");
+			}
+
+			//	Submesh identifier.
+			sprintf(cadena,"SubMesh %d %s",i,type);
+			
+			oprueba[i] = new fltk::ItemGroup(cadena);
+			oprueba[i]->begin();
+			fltk::Item *sharedGeometry;
+			if (mGeoMesh->mSubMesh[i].mSharedVertexBuffer)
+			{
+				sharedGeometry = new fltk::Item("Shared Geometry: Yes");
+			}
+			else
+			{
+				sharedGeometry = new fltk::Item("Shared Geometry: No");
+			}
+
+			char *cadena2=new char[30];
+			sprintf(cadena2, "Number of indexes: %d",mGeoMesh->mSubMesh[i].mIndexCount);
+			fltk::Item *numberIndex = new fltk::Item(cadena2);
+			if (mGeoMesh->mType==Geometry::GEO_TRIANGLE_LIST)
+			{
+				fltk::Item *type = new fltk::Item("Triangle list");
+			}
+			else
+			{
+				fltk::Item *type = new fltk::Item("Triangle strips");
+			}
+
+			char *cadenavertex=new char[30];
+			sprintf(cadenavertex, "Number of vertices: %d",mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexCount);
+			fltk::Item *numberVertex = new fltk::Item(cadenavertex);
+
+			if (mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexInfo & Geometry::VERTEX_NORMAL)
+			{
+				fltk::Item *normals = new fltk::Item("Normals: Yes");
+			}
+			else
+			{
+				fltk::Item *normals = new fltk::Item("Normals: No");
+			}
+
+			if (mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexInfo & Geometry::VERTEX_TEXCOORDS)
+			{
+				fltk::Item *textures = new fltk::Item("Textures: Yes");
+			}
+			else
+			{
+				fltk::Item *textures = new fltk::Item("Textures: No");
+			}
+
+
+			oprueba[i]->end();
+		}
+		ogeometry->end();
+		this->mMeshInfo->add(ogeometry);
+	}
+
+	//	Hide the right panel.
+	hideRightPanel();
+	
+	mMeshInfo->set_visible();
+	mMeshInfo->activate();
+}
+
+//---------------------------------------------------------------------------
+//	Hide the mesh info browser
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::hideMeshInfo()
+{
+	mMeshInfo->hide();
+	mMeshInfo->deactivate();
+}
+
+//---------------------------------------------------------------------------
+//	Hide the right panel
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::hideRightPanel()
+{
+	hideStripify();
+	hideEdgeCollapse();
+	hideLeavesCollapse();
+	hideOpenMeshSimplification();
+	hideOpenLeavesSimplification();
+	hideVisualizeLodStrips();
+	hideMeshInfo();
+}
+
+//---------------------------------------------------------------------------
+//	Get the number of vertices
+//---------------------------------------------------------------------------
+size_t	GeoMeshViewUI::getVertexCount(Mesh	*geoMesh)
+{
+	size_t	vertex_count;
+	SubMesh	*geoSubMesh;
+
+	vertex_count	=	geoMesh->mVertexBuffer->mVertexCount;
+
+	//	For each submesh.
+	for (int submesh	=	0; submesh < geoMesh->mSubMeshCount; submesh++)
+	{
+		//	Gets the actual submesh.
+		geoSubMesh	=	&geoMesh->mSubMesh[submesh];
+
+		//	If the mesh does not have shared vertex.
+		if (!geoSubMesh->mSharedVertexBuffer)
+		{			
+			//	Adds the vertex of the submesh to the total count.
+			vertex_count	+=	geoSubMesh->mVertexBuffer->mVertexCount;
+		}
+	}
+
+	return	vertex_count;
+}
+
+//---------------------------------------------------------------------------
+//	Get the number of triangles
+//---------------------------------------------------------------------------
+size_t	GeoMeshViewUI::getTriangleCount(Geometry::Mesh	*geoMesh)
+{
+	size_t	triangle_count;
+	SubMesh	*geoSubMesh;
+
+	//	Initialize the triangle count.
+	triangle_count	=	0;
+	
+	//	If the application is in visualize lodstrips mode.
+	if (mApplicationState == VISUALIZE_LODSTRIPS)
+	{
+		triangle_count	=	geoMeshView->getLodStripsTriangleCount();
+	}
+	else
+	{
+		//	For each submesh.
+		for (int submesh	=	0; submesh < geoMesh->mSubMeshCount; submesh++)
+		{
+			//	Gets the actual submesh.
+			geoSubMesh	=	&geoMesh->mSubMesh[submesh];
+
+			switch (geoMesh->mType)
+			{
+				case	GEO_TRIANGLE_LIST:
+					triangle_count	+=	geoSubMesh->mIndexCount / 3;
+					break;
+				case	GEO_TRIANGLE_STRIPS:
+					triangle_count	+=	geoSubMesh->mIndexCount - 2;
+					break;
+			}
+		}
+	}
+
+	return	triangle_count;
+}
+
+//---------------------------------------------------------------------------
+//	Get the number of strips
+//---------------------------------------------------------------------------
+size_t	GeoMeshViewUI::getStripCount(Geometry::Mesh	*geoMesh)
+{
+	size_t	strip_count;
+	SubMesh	*geoSubMesh;
+
+	//	Initialize the triangle count.
+	strip_count	=	0;
+	
+	if (geoMesh->mType == GEO_TRIANGLE_STRIPS)
+	{
+		//	For each submesh.
+		for (int submesh	=	0; submesh < geoMesh->mSubMeshCount; submesh++)
+		{
+			//	Gets the actual submesh.
+			geoSubMesh	=	&geoMesh->mSubMesh[submesh];
+
+			strip_count	+=	geoSubMesh->mStripCount;
+		}	
+	}
+	return	strip_count;
+}
+
+//---------------------------------------------------------------------------
+//	It paints the submesh selected by the mMeshInfo tree
+//	Trate the mMeshInfo event	
+//---------------------------------------------------------------------------
+int GeoMeshViewUI::paintMesh(void)
+{
+	char selectedTag[100];
+	char *pch;
+	char *p;
+	int meshNumber;
+
+	//	Initializa mesh to not selected.
+	meshNumber	=	-1;
+
+	// Shows the selected object label
+	strcpy(selectedTag,mMeshInfo->goto_focus()->label());
+	
+	p=strstr(selectedTag,"SubMesh ");
+
+	// If the item begins with string "SubMesh"
+	if (p!=NULL)
+	{
+		pch = strtok (selectedTag," ");
+		pch = strtok (NULL, " ");
+		sscanf(pch,"%d",&meshNumber);
+	}
+	
+	geoMeshView->setColorSubmeshi(meshNumber);
+	geoMeshView->redraw();
+	
+	return meshNumber;
+}
+
+//---------------------------------------------------------------------------
+//	Simplify the mesh object.
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::simplifyEdgeCollapse()
+{
+	Real	percent;
+
+	simplificacionState	=	QSLIM;
+
+	ms = new ImageBasedSimplifier(mGeoMesh,	progress_function);
+
+	ms->setMeshLeaves(idMeshLeaves);
+
+	if (mPercent->value() == true)
+	{
+		// Simplificación por porcentaje
+		if (mMeshReduction->fvalue() <= 100.0 && mMeshReduction->fvalue()>0.0)
+		{
+			percent	= mMeshReduction->fvalue();
+			percent	=	percent	/ 100.0;
+
+			// Simplifica el geomesh -> Parámetro es un factor LOD [0,1].
+			ms->Simplify(percent);
+
+			//	Deletes the previous mesh.
+			delete mUndoMesh;
+
+			mUndoMesh	=	new Mesh();
+
+			//	Sets the undo mesh.
+			*mUndoMesh	=	*mGeoMesh;
+
+			delete	mGeoMesh;
+
+			mGeoMesh	=	ms->GetMesh();
+
+			//	Visualize mesh.
+			geoMeshView->setMesh(mGeoMesh);
+		}
+		else
+		{
+			fltk::alert("Wrong value for simplification.\n"
+					"Valid values [0..100]");
+		}
+	}
+	else
+	{
+		// Simplificar hasta un número de vértices.
+		uint32 v	=	(uint32)mMeshReduction->fvalue();
+
+		// Simplifica el geomesh -> Parámetro es un factor LOD [0,1].
+		ms->Simplify(v);
+
+		//	Deletes the previous mesh.
+		delete mUndoMesh;
+
+		mUndoMesh	=	new Mesh();
+
+		//	Sets the undo mesh.
+		*mUndoMesh	=	*mGeoMesh;
+
+		delete	mGeoMesh;
+
+		mGeoMesh	=	ms->GetMesh();
+
+		//	Visualize the mesh.
+		geoMeshView->setMesh(mGeoMesh);
+	}
+}
+
+//---------------------------------------------------------------------------
+//	Simplify the mesh object.
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::simplifyLeavesCollapse()
+{
+	uint32						vi;
+
+	//	if the mesh is stripified.
+	if (mGeoMesh->mType == GEO_TRIANGLE_STRIPS)
+	{
+		fltk::alert("Can't simplify a tree in triagle strips.");
+	}
+	//	if the mesh is in triangle list.
+	else
+	{			
+		simplificacionState	=	HOJAS;
+		
+		mts	=	new TreeSimplifier(mGeoMesh, progress_function);
+		vi	=	(uint32)mMeshReduction->fvalue();
+
+		// Simplify
+		if(idMeshLeaves	!=	(unsigned short)-1)
+		{
+			// Simplify
+			mts->Simplify(vi, idMeshLeaves);
+
+			//	Deletes the previous mesh.
+			delete mUndoMesh;
+
+			mUndoMesh	=	new Mesh();
+			
+			//	Sets the undo mesh.
+			*mUndoMesh	=	*mGeoMesh;
+
+			delete	mGeoMesh;
+
+			mGeoMesh	=	mts->GetMesh();
+			
+			geoMeshView->setMesh(mGeoMesh);
+		}
+		else
+		{
+			fltk::alert("You must select the mesh that contains the leaves.");
+		}
+	}
+}
+
+//---------------------------------------------------------------------------
+//	Create a simplification sequence of the QSLIM method.
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::createQslimSequence()
+{
+	MeshSimplificationSequence	*secsimpl;
+	
+	secsimpl	=	ms->GetSimplificationSequence();
+	
+	secsimpl->putMeshName(nombremesh); // Nombre del mesh para guardar la secuencia de simplificación
+	secsimpl->Save(Geometry::Serializer("mqslimSequence.txt",Serializer::WRITE));
+
+	delete	secsimpl;
+}
+
+//---------------------------------------------------------------------------
+//	Stripify the mesh object.
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::stripify()
+{	
+	char							char_value[10];
+	CustomStripifier	*geoStripifier;
+
+	//	if the mesh is stripified.
+	if (mGeoMesh->mType == GEO_TRIANGLE_STRIPS)
+	{
+		fltk::alert("The mesh is already in strips.");
+	}
+	//	if the mesh is in triangle list.
+	else
+	{
+		//Stripify.
+		geoStripifier	=	new CustomStripifier(mGeoMesh);
+
+		//	Set the progress bar function.	
+		geoStripifier->SetProgressFunc(progress_function);
+		
+		if (geoStripifier->Stripify())
+		{
+			//	Deletes the mesh object.
+			delete	mUndoMesh;
+
+			mUndoMesh	=	new Mesh();
+
+			*mUndoMesh	=	*mGeoMesh;
+
+			delete	mGeoMesh;
+
+			//	Gets the mesh stripified.
+			mGeoMesh	=	geoStripifier->GetMesh();
+
+			//	Visualize the mesh stripified.
+			geoMeshView->setMesh(mGeoMesh);
+
+			//	Store the color of the strips.
+			geoMeshView->setStripColors();
+		}
+		else
+		{
+			//	Error message.
+			fltk::alert("Impossible to stripify. The mesh is not manifold");
+		}
+
+		//	Deletes the stripifier object.
+		delete	geoStripifier;
+	}
+}
+
+//---------------------------------------------------------------------------
+//	Method that undo then mesh changes.
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::undo()
+{
+	//	if the undo mesh is not initialized.
+	if	(mUndoMesh != NULL)
+	{
+		//	Deletes the actual mesh.
+		delete	mGeoMesh;
+
+		mGeoMesh	=	new Mesh();
+
+		//	Restore the previous mesh.
+		*mGeoMesh	=	*mUndoMesh;
+
+		//	Visualize the mesh.
+		geoMeshView->setMesh(mGeoMesh);
+
+		//	Refresh geometry attributes.
+		refreshApplicationBar();
+
+		//	Repaint the window.
+		mMainWindow->redraw();
+	}
+}
+
+//---------------------------------------------------------------------------
+//	Refresh number of vertices, triangles, strips, ...
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::refreshApplicationBar()
+{
+	static char	vertices_value[50];
+	static char	triangles_value[50];
+	static char	strips_value[50];
+	
+	//	Translate the vertex count to a char value.
+	sprintf(vertices_value,"Vertices %d",getVertexCount(mGeoMesh));
+
+	mVertices->label(vertices_value);
+
+	//	Translate the triangle count to a char value.
+	sprintf(triangles_value,"Triangles %d",getTriangleCount(mGeoMesh));
+
+	mTriangles->label(triangles_value);
+
+	//	Translate the triangle count to a char value.
+	sprintf(strips_value,"Strips %d",getStripCount(mGeoMesh));
+
+	mStrips->label(strips_value);
+}
+
+//	Method that updates the porgress bar.
+float GeoMeshViewUI::updateProgressBar(float v)
+{
+	fltk::ProgressBar		*progressBar;
+	
+	//	Choose progress bar to update.
+	switch(progressBarType)
+	{
+		case	PROCESS:
+			progressBar	=	mProcessBar;
+			break;
+		case	BUILD:
+			progressBar	=	mBuildBar;
+			break;
+	}
+	
+	//	Update progress bar.
+	progressBar->step(v);
+	progressBar->step();
+	mMainWindow->flush();
+	//mMainWindow->redraw();
+	
+	return 0;
+}
+
+//---------------------------------------------------------------------------
+//	Initialize the lodstripslibrary for visualization.
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::setLodStripsLibrary(std::string lodfile, Mesh	*geomesh)
+{
+	//	If there is no lod strips object.
+	if (lodStripsLib)
+	{
+		delete	lodStripsLib;
+	}
+
+	//	New lod strips object.
+	lodStripsLib	=	new	LodStripsLibrary(lodfile, geomesh);
+
+	//	Sets the slider range.
+	mLodSlider->range(lodStripsLib->MaxLod(),
+										lodStripsLib->MinLod());
+
+	//	Pass to geomeshview the lod strips object.
+	geoMeshView->setLodStripsLibrary(lodStripsLib);
+	
+	//	Puts the slider in the max position.
+	mLodSlider->value(lodStripsLib->MinLod());
+}
+
+//---------------------------------------------------------------------------
+//	Open a mesh file.
+//---------------------------------------------------------------------------
+void	GeoMeshViewUI::openMeshFile()
+{
+	fltk::FileChooser	*fcho;
+	static	char			char_value[10];
+	static	char			title[256];
+
+	fcho	=	new fltk::FileChooser("",
+																"*.mesh",
+																fltk::FileChooser::CREATE,
+																"Open mesh file");
+
+	fcho->exec();
+
+	//	File name.
+	mFileName	=	(char *)fcho->value();
+
+	if (mFileName)
+	{
+		//	Set Window Title.
+		strcpy(title,mFileName);
+		mMainWindow->label(strcat(title," - GeoTool"));
+
+		//	Identify the mesh that stores the leaves
+		idMeshLeaves	=	-1;
+
+		//	Stores the name of the mesh.
+		nombremesh	=	new char[255];
+		strcpy(nombremesh,mFileName);
+
+		//	Delete	the current mesh.
+		delete	mGeoMesh;
+		delete	mUndoMesh;
+
+		//	Loads a new mesh.
+		mGeoMesh		=	geoMeshLoader->load(mFileName);
+
+		//	Reset the undo mesh.
+		mUndoMesh		=	new Mesh();
+		*mUndoMesh	=	*mGeoMesh;
+
+		//	Translate the MB count to a char value.
+		sprintf(char_value,
+				"MB %.3f",
+				(float)geoMeshLoader->getFileSize()/1024/1024);
+
+		mMB->label(char_value);
+
+		//	Visualize mesh.
+		geoMeshView->setMesh(mGeoMesh);
+
+		//	Get the mesh bounds.
+		mMeshBounds	=	geoMeshView->getBoundingBox();
+
+		//	Hide right panel.
+		hideRightPanel();
+
+		//	Quit culling.
+		menuRenderCW->clear_value();
+		menuRenderCCW->clear_value();
+		geoMeshView->deactiveCW();
+		geoMeshView->deactiveCCW();
+
+		//	Deactive solid mode and wire.
+		menuRenderSolid->clear_value();
+		menuRenderWire->clear_value();
+		geoMeshView->deactiveSolid();
+		geoMeshView->deactiveWire();
+
+		//	Fit model in midle.
+		geoMeshView->fit();
+
+		//	Lighting smooth.
+		menuRenderFlat->clear_value();
+		menuRenderSmooth->set_value();
+		geoMeshView->smooth();
+
+		//	Show title.
+		mProcessTitle->label("Mesh Info");
+
+		//	Shows the mesh info.
+		showMeshInfo();
+
+		//	if the mesh is stripified.
+		if (mGeoMesh->mType == GEO_TRIANGLE_STRIPS)
+		{
+			geoMeshView->setStripColors();
+		}
+
+		//	Refresh geometry attributes.
+		refreshApplicationBar();
+	}
+	
+	//	Free memory.
+	delete	fcho;
+}
+
+/******************/
+/*	Constructor		*/
+/******************/
+GeoMeshViewUI::GeoMeshViewUI(TIPOFUNC fun)
+{
+	progress_function	=	fun;
+	fltk::gifImage	*logo;
+	
+	//	Initialize the file name.
+	mFileName	=	NULL;
+
+	//	Initialize the 3D object.
+	mGeoMesh	=	NULL;
+	mUndoMesh	=	NULL;
+
+	//	Initialize the lod strip object.
+	lodStripsLib	=	NULL;
+
+	//	Identify the mesh that stores the leaves
+	idMeshLeaves	=	-1;
+
+	//	Initialize the loader of meshes.
+	geoMeshLoader	=	new	GeoMeshLoader();
+
+	//	Initialize the menus application state.
+	mApplicationState	=	NONE;
+	
+	{
+		fltk::Window*	o	=	new fltk::Window(800, 600,"GeoTool");
+
+		mMainWindow	=	o;
+
+		//	Program Icon for Win32.
+		mMainWindow->icon((char *)LoadIcon(	GetModuleHandle(0),
+					MAKEINTRESOURCE(GEOICON)));
+
+		//	Double buffer.
+		mMainWindow->set_double_buffer();
+
+		o->user_data((void*)(this));
+		o->begin();
+
+		{
+			fltk::Group* o = new fltk::Group(0, 27, 806, 559);
+			o->begin();
+
+			{
+				fltk::Group* o;
+				o = MainView = new fltk::Group(0, 0, 600, 500);
+				o->begin();
+
+				{
+					fltk::InvisibleBox* o;
+					o = cframe = new fltk::InvisibleBox(0, 0, 600, 500);
+					o->box(fltk::FLAT_BOX);
+					o->color((fltk::Color)0xffffff00);
+					//fltk::Group::current()->resizable(o);
+				}
+
+				{
+					GeoMeshView* o;
+					o = geoMeshView = new GeoMeshView(	0,0,600,500,0,this);
+				}
+
+				o->end();
+
+				fltk::Group::current()->resizable(o);
+
+			}
+
+			{
+				fltk::Group* o;
+				o = MainView = new fltk::Group(600, 0, 200, 500);
+				o->begin();
+
+				{
+					fltk::Button* o;
+					//o = mButtonProcess = new fltk::Button(665, 410, 73, 25, "Process");
+					o = mButtonProcess = new fltk::Button(65, 410, 73, 25, "Process");
+					o->callback((fltk::Callback*)cb_mButtonProcess);
+					o->hide();
+					o->deactivate();
+				}
+
+				{
+					fltk::ProgressBar* o;
+					//o = mProcessBar = new fltk::ProgressBar(616, 435, 175, 18);
+					o = mProcessBar = new fltk::ProgressBar(16, 435, 175, 18);
+					o->hide();
+					o->deactivate();
+				}
+
+				{
+					fltk::Button* o;
+					o = mButtonSort = new fltk::Button(65, 375, 73, 25, "Sort");
+					o->callback((fltk::Callback*)cb_mButtonSort);
+					o->hide();
+					o->deactivate();
+				}
+
+				{
+					fltk::ProgressBar* o;
+					o = mSortBar = new fltk::ProgressBar(16, 390, 175, 18);
+					o->hide();
+					o->deactivate();
+				}
+
+				{
+					fltk::Button* o;
+					o = mButtonBuild = new fltk::Button(65, 455, 73, 25, "Build");
+					o->callback((fltk::Callback*)cb_mButtonBuild);
+					o->hide();
+					o->deactivate();
+				}
+
+				{
+					fltk::ProgressBar* o;
+					o = mBuildBar = new fltk::ProgressBar(16, 480, 175, 18);
+					o->hide();
+					o->deactivate();
+				}
+
+				{
+					fltk::Slider* o;
+					o = mLodSlider = new fltk::Slider(16, 50, 30, 450);
+					o->type(fltk::Slider::TICK_BELOW);
+					o->set_vertical();
+					o->callback((fltk::Callback*)cb_mLodSlider);
+					o->hide();
+					o->deactivate();
+				}
+
+				{
+					mMetricLabel	= new fltk::Output(26, 28, 5, 25, "Metric");
+					fltk::Output* o	=	mMetricLabel;
+					o->set_vertical();
+					o->box(fltk::NO_BOX);
+					o->labelfont(fltk::HELVETICA_BOLD);
+					o->color((fltk::Color)0xe0dfe300);
+					o->align(fltk::ALIGN_RIGHT);
+				}
+
+				{
+					fltk::Group* o;
+					o = MainView = new fltk::Group(30, 40, 30, 60);
+					o->begin();
+					{
+						mGeometryBased = new fltk::RadioButton(0, 8, 25, 25, "Geometry based");
+						mImageBased = new fltk::RadioButton(0, 23, 25, 25, "Image based");
+					}
+					o->end();
+				}
+
+				//mChangeVertices = new fltk::CheckButton(30, 104, 25, 25, "Change vertices");
+
+				{
+					mProcessTitle		= new fltk::Widget(0, 0, 200, 25, "");
+					fltk::Widget* o	=	mProcessTitle;
+					o->set_vertical();
+					o->box(fltk::NO_BOX);
+					o->labelfont(fltk::HELVETICA_BOLD);
+					o->labelsize(15.0);
+					o->color((fltk::Color)0xe0dfe300);
+					o->align(fltk::ALIGN_CENTER);
+				}
+
+				/*
+					 {
+					 mTypeLabel			= new fltk::Output(26, 82, 5, 25, "Type");
+					 fltk::Output* o	=	mTypeLabel;
+					 o->set_vertical();
+					 o->box(fltk::NO_BOX);
+					 o->labelfont(fltk::HELVETICA_BOLD);
+					 o->color((fltk::Color)0xe0dfe300);
+					 o->align(fltk::ALIGN_RIGHT);
+					 }
+					 */
+
+				{
+					mMeshReductionLabel	= new fltk::Output(26, 124, 5, 25, "Mesh Reduction");
+					fltk::Output* o	=	mMeshReductionLabel;
+					o->set_vertical();
+					o->box(fltk::NO_BOX);
+					o->labelfont(fltk::HELVETICA_BOLD);
+					o->color((fltk::Color)0xe0dfe300);
+					o->align(fltk::ALIGN_RIGHT);
+				}
+
+				//mChangeTexture = new fltk::CheckButton(30, 104, 25, 25, "Change texture");
+
+				{
+					fltk::Group* o;
+					o = MainView = new fltk::Group(30, 140, 30, 60);
+					o->begin();
+
+					{
+						mPercent = new fltk::RadioButton(0, 5, 25, 25, "%");
+						mVerticesNumber = new fltk::RadioButton(0, 20, 25, 25, "Vertices number");
+					}
+					o->end();
+				}
+
+				{
+					mMeshReduction = new fltk::FloatInput(75, 181, 75, 21, "Value:");
+					fltk::FloatInput* o = mMeshReduction;
+					o->type(1);
+				}
+
+				{
+					fltk::Group* o;
+					o = MainView = new fltk::Group(30, 100, 30, 60);
+					o->begin();
+
+					{
+						mOneCacheStrip = new fltk::RadioButton(0, 4, 25, 25, "One cache strip");
+						mQualityStrips = new fltk::RadioButton(0, 23, 25, 25, "Quality strips");
+					}
+					o->end();
+				}
+
+				{
+					fltk::Browser* o = mMeshInfo = new fltk::Browser(0, 20, 200, 380);
+					o->set_vertical();
+					o->callback((fltk::Callback*)cb_mMeshInfo);
+				}
+				o->end();
+			}	
+
+			o->end();
+
+			fltk::Group::current()->resizable(o);
+		}
+
+		{
+			fltk::MenuBar* o = menuBar = new fltk::MenuBar(1, 2, 801, 21);
+			o->begin();
+
+			//	Menu File.
+			{
+				fltk::ItemGroup* o = menuFile = new fltk::ItemGroup("File");
+				o->begin();
+
+				{
+					fltk::Item* o = menuFileOpen = new fltk::Item("Open");
+					o->callback((fltk::Callback*)cb_menuFileOpen);
+				}
+
+				{
+					fltk::Item* o = menuFileSave = new fltk::Item("Save");
+					o->callback((fltk::Callback*)cb_menuFileSave);
+				}
+
+				{
+					fltk::Item* o = menuOpenSaveAs = new fltk::Item("Save As");
+					o->callback((fltk::Callback*)cb_menuOpenSaveAs);
+				}
+
+				//{
+				//	fltk::Item* o = menuMeshExportOBJ = new fltk::Item("Export to OBJ");
+				//	o->callback((fltk::Callback*)cb_menuMeshExportOBJ);
+				//}
+
+				//{
+				//	fltk::Item* o = menuFileTransformSharedVertex = new fltk::Item("Transform to Shared Vertex");
+				//	o->callback((fltk::Callback*)cb_menuFileTransformSharedVertex);
+				//}
+
+				{
+					fltk::Item* o = menuOpenQuit = new fltk::Item("Quit");
+					o->callback((fltk::Callback*)cb_menuOpenQuit);
+				}
+
+				o->end();
+			}
+
+			//	Menu Edit.
+			{
+				fltk::ItemGroup* o = menuEdit = new fltk::ItemGroup("Edit");
+				o->begin();
+
+				{
+					fltk::Item* o = menuEditUndo = new fltk::Item("Undo");
+					o->callback((fltk::Callback*)cb_menuEditUndo);
+				}
+
+				{
+					fltk::Item* o = menuEditFit = new fltk::Item("Fit");
+					o->callback((fltk::Callback*)cb_menuEditFit);
+
+				}
+
+				{
+					fltk::Item* o = menuEditRotate = new fltk::Item("Rotate");
+					o->type(fltk::Item::RADIO);
+					o->set_value();
+					o->callback((fltk::Callback*)cb_menuEditRotate);
+				}
+
+				{
+					fltk::Item* o = menuEditPan = new fltk::Item("Pan");
+					o->type(fltk::Item::RADIO);
+					o->callback((fltk::Callback*)cb_menuEditPan);
+				}
+
+				//{
+				//	fltk::Item* o = menuEditZoom = new fltk::Item("Zoom");
+				//	o->callback((fltk::Callback*)cb_menuEditZoom);
+				//}
+
+				new fltk::Divider();
+
+				{
+					fltk::Item* o = menuMeshInfo = new fltk::Item("Mesh info");
+					o->callback((fltk::Callback*)cb_menuMeshInfo);
+				}
+
+				//{
+				//	fltk::Item* o;
+				//	o = menuSelectLeaves = new fltk::Item("Select leaves");
+				//	o->callback((fltk::Callback*)cb_menuSelectLeaves);
+				//}
+
+				o->end();
+			}
+
+			//	Menu Render.
+			{
+				fltk::ItemGroup* o = menuRender = new fltk::ItemGroup("Render");
+				o->begin();
+
+				{
+					fltk::Item* o = menuRenderWire = new fltk::Item("Wire");
+					o->type(fltk::Item::RADIO);
+					o->callback((fltk::Callback*)cb_menuRenderWire);
+				}
+
+				{
+					fltk::Item* o = menuRenderSolid = new fltk::Item("Solid");
+					o->type(fltk::Item::RADIO);
+					o->callback((fltk::Callback*)cb_menuRenderSolid);
+				}
+
+				//new fltk::Divider();
+
+				{
+					fltk::Item* o = menuRenderCW = new fltk::Item("CW");
+					o->type(fltk::Item::RADIO);
+					o->callback((fltk::Callback*)cb_menuRenderCW);
+
+					o->hide();
+				}
+
+				{
+					fltk::Item* o = menuRenderCCW = new fltk::Item("CCW");
+					o->type(fltk::Item::RADIO);
+					o->set_value();
+					o->callback((fltk::Callback*)cb_menuRenderCCW);
+
+					o->hide();
+				}
+
+				new fltk::Divider();
+
+				{
+					fltk::Item* o = menuRenderFlat = new fltk::Item("Flat");
+					o->type(fltk::Item::RADIO);
+					o->clear_value();
+					o->callback((fltk::Callback*)cb_menuRenderFlat);
+				}
+
+				{
+					fltk::Item* o = menuRenderSmooth = new fltk::Item("Smooth");
+					o->type(fltk::Item::RADIO);
+					o->set_value();
+					o->callback((fltk::Callback*)cb_menuRenderSmooth);
+				}
+
+				//new fltk::Divider();
+
+				//{
+				//	fltk::Item* o = menuRenderTextures = new fltk::Item("Textures");
+				//	o->callback((fltk::Callback*)cb_menuRenderTextures);
+				//}
+
+				o->end();
+			}
+
+			//	Menu Stripify.
+			{
+				fltk::Item* o = menuStripify = new fltk::Item("Stripify");
+				o->callback((fltk::Callback*)cb_menuStripify);
+			}
+
+			//	Menu Simplify.
+			{
+				fltk::ItemGroup* o = menuSimplify = new fltk::ItemGroup("Simplify");
+				o->callback((fltk::Callback*)cb_menuSimplify);
+				o->begin();
+
+				{
+					fltk::Item* o;
+					o = menuSimplifyEdgeCollapse = new fltk::Item("Mesh Simplification");
+					o->callback((fltk::Callback*)cb_menuSimplifyEdgeCollapse);
+				}
+
+				//{
+				//	fltk::Item* o;
+				//	o = menuSimplifyLeavesCollapse = new fltk::Item("Leaves Simplification");
+				//	o->callback((fltk::Callback*)cb_menuSimplifyLeavesCollapse);
+				//}
+
+				o->end();
+			}
+
+			//	Menu LodStrips.
+			{
+				fltk::ItemGroup* o;
+				o = menuLodStrips = new fltk::ItemGroup("LodStrips");
+				o->begin();
+
+				{
+					fltk::Item* o;
+					o = menuLodStripsGenerate	= new fltk::Item("Generate");
+					o->callback((fltk::Callback*)cb_menuLodStripsGenerate);
+				}
+
+				{
+					fltk::Item* o;
+					o = menuLodStripsVisualize	= new fltk::Item("Visualize");
+					o->callback((fltk::Callback*)cb_menuLodStripsVisualize);
+				}
+
+				o->end();
+			}
+
+			//	Menu LodTrees.
+			/*
+			{
+				fltk::ItemGroup* o;
+				o = menuLodTrees = new fltk::ItemGroup("LodTrees");
+				o->begin();
+
+				{
+					fltk::Item* o;
+					o = menuLodTreesOpenLodStripTrunk = new fltk::Item("Open LodStrip trunk");
+					o->callback((fltk::Callback*)cb_menuLodTreesOpenLodStripTrunk);
+				}
+
+				{
+					fltk::Item* o;
+					o = menuLodTreesOpenLeavesSimplification = new fltk::Item("Open leaves simplification");
+					o->callback((fltk::Callback*)cb_menuLodTreesOpenLeavesSimplification);
+				}
+				o->end();
+			}
+			*/
+			
+			{
+				fltk::ItemGroup* o = new fltk::ItemGroup("?");
+				o->begin();
+
+				{
+					fltk::Item* o = menuHelpAbout = new fltk::Item("About");
+					o->callback((fltk::Callback*)cb_menuHelpAbout);
+				}	
+
+				o->end();
+			}
+
+			{
+				fltk::SharedImage *gifLogo = logo->get("media\\logos\\logo.gif");
+				
+				//o->callback((fltk::Callback*)cb_mLogo);
+				
+				mLogo	=	new fltk::InvisibleBox(406, 1, 43, 13);				
+				mLogo->image(gifLogo);
+			}
+
+			o->end();
+		}
+
+		{
+			fltk::Group* o;
+			o = ApplicationBar = new fltk::Group(0, 570, 807, 28);
+			o->box(fltk::BORDER_BOX);
+			o->begin();
+
+			{
+				fltk::Widget* o;
+				o = mFPS = new fltk::Widget(10, 4, 30, 15, "FPS ");
+				o->box(fltk::NO_BOX);
+				o->labelfont(fltk::HELVETICA_BOLD);
+				o->color((fltk::Color)0xe0dfe300);
+			}
+
+			{
+				fltk::Widget* o;
+				o = mVertices = new fltk::Widget(154, 4, 40, 15, "Vertices");
+				o->box(fltk::NO_BOX);
+				o->labelfont(fltk::HELVETICA_BOLD);
+				o->color((fltk::Color)0xe0dfe300);
+			}
+
+			{
+				fltk::Widget* o;
+				o = mTriangles = new fltk::Widget(254, 3, 40, 15, "Triangles");
+				o->box(fltk::NO_BOX);
+				o->labelfont(fltk::HELVETICA_BOLD);
+				o->color((fltk::Color)0xe0dfe300);
+
+				//	Hide triangle count.
+				o->hide();
+			}
+
+			{
+				fltk::Widget* o;
+				o = mStrips = new fltk::Widget(354, 3, 30, 15, "Strips");
+				o->box(fltk::NO_BOX);
+				o->labelfont(fltk::HELVETICA_BOLD);
+				o->color((fltk::Color)0xe0dfe300);
+			}
+
+			//{
+			//	fltk::Widget* o;
+			//	o = mQuads = new fltk::Widget(454, 4, 40, 15, "Quads");
+			//	o->box(fltk::NO_BOX);
+			//	o->labelfont(fltk::HELVETICA_BOLD);
+			//	o->color((fltk::Color)0xe0dfe300);
+			//}
+
+			{
+				fltk::Widget* o;
+				o = mMB = new fltk::Widget(740, 3, 30, 15, "MB");
+				o->box(fltk::NO_BOX);
+				o->labelfont(fltk::HELVETICA_BOLD);
+				o->color((fltk::Color)0xe0dfe300);
+			}
+			o->end();
+		}
+
+
+		o->end();
+	}
+	
+	fltk::focus(geoMeshView);
+	
+
+	/*Hide Right Panel*/
+	hideRightPanel();
+	
+	mMainWindow->show();
+}
+
+/****************/
+/*	Destroyer		*/
+/****************/
+GeoMeshViewUI::~GeoMeshViewUI()
+{
+	delete	geoMeshLoader;
+	mMainWindow->destroy();
+}
+
+//	Shows the main window.
+void GeoMeshViewUI::show()
+{
+}
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshView.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshView.cpp	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshView.cpp	(revision 774)
@@ -0,0 +1,982 @@
+#include "GeoMeshView.h"
+
+using	namespace	Geometry;
+using	namespace	std;
+
+//---------------------------------------------------------------------------
+//	Hanle events.
+//---------------------------------------------------------------------------
+int	GeoMeshView::handle(int event)
+{
+	int key;
+	int	button;
+	int	x;
+	int	y;
+	
+	if (geoMesh != NULL)
+	{
+		draw();
+	}
+
+	switch(event)
+	{
+		case	fltk::KEY:
+		case	fltk::PUSH:
+			
+			button	=	fltk::event_key();
+			mMouseX	=	fltk::event_x();
+			mMouseY	=	fltk::event_y();
+			
+			return	1;
+
+		case	fltk::DRAG:
+			
+			button	=	fltk::event_state();
+			x				=	fltk::event_x();
+			y				=	fltk::event_y();
+			
+			switch (button)
+			{
+				//	Button 1 Pushed.
+				case	0x01100000:
+			
+					if (x > mMouseX)
+					{
+						if (mPan)
+						{
+							xshift	=	xshift	+	(x	-	mMouseX);
+						}
+						else
+						{
+							hAng	=	hAng	+	(x - mMouseX);
+						}
+					}
+					else
+					{
+						if (x < mMouseX)
+						{
+							if (mPan)
+							{
+								xshift	=	xshift	-	(mMouseX	-	x);
+							}
+							else
+							{
+								hAng	=	hAng	- (mMouseX - x);
+							}
+						}
+					}
+
+					if (y > mMouseY)
+					{
+						if (mPan)
+						{
+							yshift	=	yshift	-	(y - mMouseY);
+						}
+						else
+						{
+							vAng	=	vAng	+	(y - mMouseY);
+						}
+					}
+					else
+					{
+						if (y < mMouseY)
+						{
+							if (mPan)
+							{
+								yshift	=	yshift	+	(mMouseY	-	y);
+							}
+							else
+							{
+								vAng	=	vAng	-	(mMouseY	-	y);
+							}
+						}
+					}
+
+					hAng	=	float(int(hAng)	%	360);
+					vAng	=	float(int(vAng)	%	360);
+					
+					mMouseX	=	x;
+					mMouseY	=	y;
+					
+					draw();
+					
+					return	1;
+				
+				case	0x04100000:
+
+					if (y	> mSizeY)
+					{
+						size++;
+					}
+					else
+					{
+						if (y < mSizeY)
+						{
+							size--;
+						}
+					}
+					
+					mSizeY	=	y;
+					
+					draw();
+
+					return 1;
+
+			}			
+			
+		case	fltk::MOUSEWHEEL:
+
+			size	=	size + fltk::event_dy();
+			draw();
+			return	1;
+	}
+	
+	return	fltk::GlWindow::handle(event);
+}
+
+//---------------------------------------------------------------------------
+//	Get the number of frames per second.
+//---------------------------------------------------------------------------
+size_t	GeoMeshView::getFPS()
+{
+	return	mFPS;
+}
+
+//---------------------------------------------------------------------------
+//	Calculate the number of frames per second.
+//---------------------------------------------------------------------------
+void	GeoMeshView::calcFPS()
+{
+	double	duration;
+	clock_t	finish_time;
+
+	//	Gets the time.
+	finish_time	=	clock();
+
+	//	Calc the duration respect the start time.
+	duration	=	(double)((finish_time - mStartTime) / CLOCKS_PER_SEC);
+	
+	//	Increments the number of frames per second.
+	mFPS++;
+	
+	//	If a second have passed.
+	if (duration >= 1.0)
+	{
+		//	Repaint the FPS.
+		mGeoMeshViewUI->refreshFPS(mFPS);
+		
+		mFPS				=	0;
+		mStartTime	=	clock();
+	}
+}
+
+//---------------------------------------------------------------------------
+//	Enable color strips.
+//---------------------------------------------------------------------------
+void	GeoMeshView::enableColorStrips()
+{
+	colorStripsFlag	=	true;
+}
+
+//---------------------------------------------------------------------------
+//	Disable color strips.
+//---------------------------------------------------------------------------
+void	GeoMeshView::disableColorStrips()
+{
+	colorStripsFlag	=	false;
+}
+
+//---------------------------------------------------------------------------
+//	Gets the color strips state.
+//---------------------------------------------------------------------------
+bool	GeoMeshView::getColorStrips()
+{
+	return	colorStripsFlag;
+}
+
+//---------------------------------------------------------------------------
+// JGA
+//	Set the color to the submesh sumbmeshIndex
+//---------------------------------------------------------------------------
+void	GeoMeshView::setColorSubmeshi(int submeshIndex)
+{
+	colorsubmeshi	=	submeshIndex;
+}
+
+//---------------------------------------------------------------------------
+//	Sets the leaves submesh index.
+//---------------------------------------------------------------------------
+void	GeoMeshView::setLeavesSubmesh(int submeshIndex)
+{
+	leavesSubmesh	=	submeshIndex;
+}
+
+//---------------------------------------------------------------------------
+//	Gets the leaves submesh index.
+//---------------------------------------------------------------------------
+int	GeoMeshView::getLeavesSubmesh()
+{
+	return	leavesSubmesh;
+}
+
+//---------------------------------------------------------------------------
+//	Set the list of strip colors.
+//---------------------------------------------------------------------------
+void	GeoMeshView::setStripColors()
+{
+	int	total_strips;
+
+	total_strips	=	0;
+	
+	//	Delete previous color strips.
+	delete	[]mStripColors;
+
+	//	Count the total number of strips y the submeshes.
+	for (int i = 0; i < geoMesh->mSubMeshCount; i++)
+	{
+		total_strips	=	total_strips + geoMesh->mSubMesh[i].mStripCount;
+	}
+
+	//	Initialize the Colors array.
+	mStripColors	=	new	ColorElement[total_strips];
+	
+	//	Sets random colors to each strip.
+	for (int i	= 0; i < total_strips; i++)
+	{
+		mStripColors[i].r	=	rand()/((float)RAND_MAX);
+		mStripColors[i].g	=	rand()/((float)RAND_MAX);
+		mStripColors[i].b	=	rand()/((float)RAND_MAX);
+	}
+}
+
+//---------------------------------------------------------------------------
+//	Get the bounding box of the object.
+//---------------------------------------------------------------------------
+GeometryBounds	GeoMeshView::getBoundingBox()
+{
+	SubMesh					*geosubmesh;
+	Index						position;
+	Vector3					vector3;
+	GeometryBounds	bounds;
+	float						x,y,z;
+	float						xMin,yMin,zMin;
+	float						xMax,yMax,zMax;
+		
+	//	For each submesh.
+	for (int submesh = 0; submesh < geoMesh->mSubMeshCount; submesh++)
+	{
+		//	Gets the actual submesh.
+		geosubmesh	=	&geoMesh->mSubMesh[submesh];
+
+		//	For each index of the strip.
+		for (int index = 0; index < geosubmesh->mIndexCount; index++)
+		{
+			position	=	geosubmesh->mIndex[index];
+
+			//	Gets the vertex coordinates.
+			vector3	=	geosubmesh->mVertexBuffer->mPosition[position];
+				
+			x					=	vector3[0];
+			y					=	vector3[1];
+			z					=	vector3[2];
+				
+			//	If is the first iteation.
+			if ((submesh	== 0)	&&	(index	==	0))
+			{
+				xMin	=	xMax	=	x;
+				yMin	=	yMax	=	y;
+				zMin	=	zMax	=	z;
+			}
+			else
+			{
+				if (x < xMin)
+				{
+					xMin	=	x;
+				}
+				else if (x > xMax)
+				{
+					xMax	=	x;
+				}
+
+				if (y < yMin)
+				{
+					yMin	=	y;
+				}
+				else if (y > yMax)
+				{
+					yMax	=	y;
+				}
+
+				if (z < zMin)
+				{
+					zMin	=	z;
+				}
+				else if (z > zMax)
+				{
+					zMax	=	z;
+				}
+			}
+		}
+	}
+
+	xMed	=	(xMax + xMin)	/	2;
+	yMed	=	(yMax + yMin)	/	2;
+	zMed	=	(zMax + zMin)	/	2;
+
+
+	if ((xMax - xMin) > (yMax - yMin))
+	{
+		if ((xMax - xMin) > (zMax - zMin))
+		{
+			mScaleFactor	=	xMax - xMin;
+		}
+		else
+		{
+			mScaleFactor	=	zMax - zMin;
+		}
+	}
+	else
+	{
+		if ((yMax - yMin) > (zMax - zMin))
+		{
+			mScaleFactor	=	yMax - yMin;
+		}
+		else
+		{
+			mScaleFactor	=	zMax - zMin;
+		}
+	}
+
+	//	Set the bounds.
+	bounds.minx		=	xMin;
+	bounds.miny		=	yMin;
+	bounds.minz		=	zMin;
+	bounds.maxx		=	xMax;
+	bounds.maxy		=	yMax;
+	bounds.maxz		=	zMax;
+	bounds.radius	=	mScaleFactor;
+
+	return	bounds;
+}
+
+//---------------------------------------------------------------------------
+//	Constructor.
+//---------------------------------------------------------------------------
+GeoMeshView::GeoMeshView(	int						x,
+													int						y,
+													int						w,
+													int						h,
+													const char		*l,
+													GeoMeshViewUI	*geoMeshViewUI)
+            : fltk::GlWindow(x,y,w,h,l)
+{
+		mStripColors		=	NULL;
+		mSharedPosArray	=	NULL;
+		mSharedNorArray	=	NULL;
+		mPosArray				=	NULL;
+		mNorArray				=	NULL;
+		mIndexArray			=	NULL;
+    vAng						= 0.0;
+		hAng						=	0.0;
+		size						=	0.0;
+		mSizeY					=	0;
+		xshift					=	0.0;
+		yshift					=	0.0;
+		geoMesh					=	0;
+		mRotate					=	true;
+		mPan						=	false;
+		mLodStrip				=	false;
+		mIdVisualList		=	0;
+		mSubMeshCount		=	0;
+		
+		//	Initialize the model view.
+		deactiveWire();
+		deactiveSolid();
+		activeRotate();
+		deactiveCW();
+		activeCCW();
+		
+		//	Init start time for FPS.
+		mStartTime	=	clock();
+
+		//	Cross Reference.
+		mGeoMeshViewUI	=	geoMeshViewUI;
+}
+
+// The color used for the edges of the bounding cube.
+#define CUBECOLOR 255,255,255,255
+
+/* Draw a colored cube */
+#define ALPHA 0.5
+
+//---------------------------------------------------------------------------
+//	Sets the Mesh to display.
+//---------------------------------------------------------------------------
+void GeoMeshView::setMesh(Mesh	*geomesh)
+{
+	GLfloat color_blanco[]	=	{1.0f,1.0f,1.0f,1.0f};
+
+	this->geoMesh	=	geomesh;
+	colorsubmeshi	=	-1;
+	leavesSubmesh	=	-1;
+	
+	//	Refresh vertices to the vertex array.
+	refreshVertices(geomesh);
+	
+	glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_blanco);
+}
+
+//---------------------------------------------------------------------------
+//	 Refresh vertices to the vertex array.
+//---------------------------------------------------------------------------
+void	GeoMeshView::refreshVertices(Mesh	*geomesh)
+{
+	SubMesh				*geosubmesh;
+	VertexBuffer	*vertex_buffer;
+
+	//	If the vertex array exists.
+	if (mSubMeshCount > 0)
+	{
+		for (int submesh = 0; submesh < mSubMeshCount; submesh++)
+		{
+			delete	[]	mPosArray[submesh];
+			delete	[]	mNorArray[submesh];
+			delete	[]	mIndexArray[submesh];
+		}
+		
+		delete	[]	mSharedPosArray;
+		delete	[]	mSharedNorArray;
+		delete	[]	mPosArray;
+		delete	[]	mNorArray;
+		delete	[]	mIndexArray;
+	}
+
+	//	If there is shared vertex.
+	if (geomesh->mVertexBuffer != NULL)
+	{
+		vertex_buffer	=	geomesh->mVertexBuffer;
+
+		//	Allocate memory.
+		mSharedPosArray	=	new GLfloat[vertex_buffer->mVertexCount * 3];
+		mSharedNorArray	=	new GLfloat[vertex_buffer->mVertexCount * 3];
+
+		for (int vertex = 0; vertex < vertex_buffer->mVertexCount; vertex++)
+		{
+			mSharedPosArray[3 * vertex]				=	vertex_buffer->mPosition[vertex].x;
+			mSharedPosArray[(3 * vertex) + 1]	=	vertex_buffer->mPosition[vertex].y;
+			mSharedPosArray[(3 * vertex) + 2]	=	vertex_buffer->mPosition[vertex].z;
+
+			mSharedNorArray[3 * vertex]				=	vertex_buffer->mNormal[vertex].x;
+			mSharedNorArray[(3 * vertex) + 1]	=	vertex_buffer->mNormal[vertex].y;
+			mSharedNorArray[(3 * vertex) + 2]	=	vertex_buffer->mNormal[vertex].z;
+		}
+	}
+	
+	//	Build the arrays of vertices and indices.
+	mPosArray		=	new GLfloat*[geomesh->mSubMeshCount];
+	mNorArray		=	new GLfloat*[geomesh->mSubMeshCount];
+	mIndexArray	=	new GLuint*[geomesh->mSubMeshCount];
+
+	//	For each submesh.
+	for (int submesh = 0; submesh < geomesh->mSubMeshCount; submesh++)
+	{
+		//	Gets the actual submesh.
+		geosubmesh	=	&geomesh->mSubMesh[submesh];
+		
+		//	Allocate memory for index array of the actual submesh.
+		mIndexArray[submesh]	=	new GLuint[geosubmesh->mIndexCount];
+
+		//	Gets the indices of the actual submesh.
+		for (int index = 0; index < geosubmesh->mIndexCount; index++)
+		{
+			mIndexArray[submesh][index]	=	geosubmesh->mIndex[index];
+		}
+		
+		//	If the submesh is NOT shared vertex.
+		if (!geosubmesh->mSharedVertexBuffer)
+		{
+			vertex_buffer	=	geosubmesh->mVertexBuffer;
+
+			//	Allocate memory for vertices of the actual submesh.
+			mPosArray[submesh]	=	new GLfloat[vertex_buffer->mVertexCount * 3];
+			mNorArray[submesh]	=	new GLfloat[vertex_buffer->mVertexCount * 3];
+
+			//	For each one of the vertex.
+			for (int vertex = 0; vertex < vertex_buffer->mVertexCount; vertex++)
+			{
+				mPosArray[submesh][3 * vertex]				=	vertex_buffer->mPosition[vertex].x;
+				mPosArray[submesh][(3 * vertex) + 1]	=	vertex_buffer->mPosition[vertex].y;
+				mPosArray[submesh][(3 * vertex) + 2]	=	vertex_buffer->mPosition[vertex].z;
+
+				mNorArray[submesh][3 * vertex]				=	vertex_buffer->mNormal[vertex].x;
+				mNorArray[submesh][(3 * vertex) + 1]	=	vertex_buffer->mNormal[vertex].y;
+				mNorArray[submesh][(3 * vertex) + 2]	=	vertex_buffer->mNormal[vertex].z;
+			}//	End for each vertex.
+		}
+		//	If the submesh is shared vertex.
+		else
+		{
+			mPosArray[submesh]	=	NULL;
+			mNorArray[submesh]	=	NULL;
+		}
+
+	}//	End for each submesh.
+	
+}
+
+//---------------------------------------------------------------------------
+//	Gets the triangle count of the current lod.
+//---------------------------------------------------------------------------
+size_t	GeoMeshView::getLodStripsTriangleCount()
+{
+	size_t	triangle_count;
+
+	//	Initialize triangle count.
+	triangle_count	=	0;
+		
+	//	For each strip.
+	for (int strip	=	0; strip < lodStripsLib->GetStripCount(); strip++)
+	{
+		triangle_count	+=	lodStripsLib->mStrips[strip].size() - 2;
+	}
+
+	return	triangle_count;
+}
+
+//---------------------------------------------------------------------------
+//	Repaint the Mesh.
+//---------------------------------------------------------------------------
+void GeoMeshView::drawGeoMesh(int selectedMesh)
+{
+	if (geoMesh)
+	{
+		if (mLodStrip)
+		{
+			drawLodStrip();
+		}
+		//	Choose the render operation.
+		else if (geoMesh->mType == GEO_TRIANGLE_LIST)
+		{
+			//	Paint vertices.
+			drawTriangleList(selectedMesh);
+		}
+		else
+		{
+			//	Paint vertices.
+			drawTriangleStrip();
+		}
+	}
+}//	End drawGeoMesh.
+
+//---------------------------------------------------------------------------
+//	Paint eah strip separately.
+//---------------------------------------------------------------------------
+void GeoMeshView::drawTriangleStrip()
+{
+	SubMesh				*geosubmesh;
+	Index					position;
+	Vector3				vector3;
+	float					x,y,z;
+	float					r,g,b;
+	Index					*index;
+	Index					*indexBegin;
+	Index					*indexEnd;
+	int						color_index;
+
+	color_index	=	0;
+
+	//	For each submesh.
+	for (int submesh = 0; submesh < geoMesh->mSubMeshCount; submesh++)
+	{
+		//	Gets the actual submesh.
+		geosubmesh	=	&geoMesh->mSubMesh[submesh];
+
+		//	For each one of the strips.
+		for (int strip = 0; strip < geosubmesh->mStripCount; strip++)
+		{
+			//	Paint the current strip.
+			glBegin(GL_TRIANGLE_STRIP);
+			
+			//	First index of the strip.
+			indexBegin	=	geosubmesh->mStrip[strip];
+
+			//	If the strips is not the first.
+			//if (strip != 0)
+			//{
+			//	indexBegin++;
+			//}
+
+			//	If is the final strip
+			if (strip	== (geosubmesh->mStripCount - 1))
+			{
+				//	The end of the index array.
+				indexEnd	= &geosubmesh->mIndex[geosubmesh->mIndexCount];
+			}
+			else
+			{
+				//	The beginning of the next strip.
+				indexEnd	= geosubmesh->mStrip[strip + 1];
+
+				//	Remove degenerated
+				//indexEnd--;
+			}
+			
+			int i;
+			i	= 0;
+
+			if (getColorStrips())
+			{
+				//	Gets the color of the strip.
+				r	=	mStripColors[color_index].r;
+				g	=	mStripColors[color_index].g;
+				b	=	mStripColors[color_index].b;
+			
+				//	Change to the next color.
+				color_index++;
+			
+				//	Paint a new color.
+				glColor3f(r,g,b);
+			}
+
+			//	For each index of the strip.
+			for (index = indexBegin; index < indexEnd; index++)
+			{
+				position	=	indexBegin[i];
+
+				//	Gets the vertex normal.
+				vector3	=	geosubmesh->mVertexBuffer->mNormal[position];
+
+				x				=	vector3[0];
+				y				=	vector3[1];
+				z				=	vector3[2];
+				
+				//	Sets the vertex normal.
+				glNormal3f(x,y,z);
+				
+				//	Gets the vertex coordinates.
+				vector3	=	geosubmesh->mVertexBuffer->mPosition[position];
+				
+				x				=	vector3[0];
+				y				=	vector3[1];
+				z				=	vector3[2];
+				
+
+				//	Sets the vertex position.
+				glVertex3f(x,y,z);
+				
+				//	Increments i.
+				i++;
+			}
+			
+			glEnd();
+
+		}
+	}
+	
+}//End drawTriangleStrip.
+
+//---------------------------------------------------------------------------
+//	Paint the array of idices.
+//---------------------------------------------------------------------------
+void GeoMeshView::drawTriangleList(int selectedMesh)
+{
+	SubMesh	*geosubmesh;
+	Index		position;
+	Vector3	vector3;
+	float		x,y,z;
+	int			idx_offset;
+	int			vrt_offset;
+
+	//	Index offset.
+	idx_offset	=	0;
+
+	//	Vertex offset.
+	vrt_offset	=	0;
+	
+	//	For each submesh.
+	for (int submesh = 0; submesh < geoMesh->mSubMeshCount; submesh++)
+	{
+		//	Gets the actual submesh.
+		geosubmesh	=	&geoMesh->mSubMesh[submesh];
+
+		//	If a mesh is selected.
+		if (selectedMesh >= 0)
+		{
+			//	If is a tree.
+			if (leavesSubmesh >= 0)
+			{
+				glColor3d(1.0, 0.5, 0.5);
+				GLfloat color_blanco[]	=	{1.0f,0.5f,0.5f,1.0f};
+				glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_blanco);
+
+				//	For each index of the strip.
+				if (submesh == leavesSubmesh)
+				{
+					glColor3d(0.0,1.0,0.0);
+					GLfloat color_rojo[]	=	{0.0f,1.0f,0.0f,1.0f};
+					glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_rojo);
+				}
+			}
+			//	If is NOT a tree.
+			else
+			{
+				//	Set white color to the object.
+				glColor3d(1.0, 1.0, 1.0);
+				GLfloat color_blanco[]	=	{1.0f,1.0f,1.0f,1.0f};
+				glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_blanco);
+			}
+
+			//	For each index of the strip.
+			if (submesh == selectedMesh)
+			{
+				glColor3d(1.0,0.0,0.0);
+				GLfloat color_rojo[]	=	{1.0f,0.0f,0.0f,1.0f};
+				glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_rojo);
+			}
+		}
+		else
+		{
+			//	If is a tree.
+			if (leavesSubmesh >= 0)
+			{
+				glColor3d(1.0, 0.5, 0.5);
+				GLfloat color_blanco[]	=	{1.0f,0.5f,0.5f,1.0f};
+				glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_blanco);
+
+				//	For each index of the strip.
+				if (submesh == leavesSubmesh)
+				{
+					glColor3d(0.0,1.0,0.0);
+					GLfloat color_rojo[]	=	{0.0f,1.0f,0.0f,1.0f};
+					glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_rojo);
+				}
+			}
+		}
+		
+		//	Enable arrays.
+		glEnableClientState(GL_VERTEX_ARRAY);
+		glEnableClientState(GL_NORMAL_ARRAY);
+
+		//	If the submesh is shared vertex.
+		if (geosubmesh->mSharedVertexBuffer)
+		{
+			glVertexPointer(3, GL_FLOAT, 0, mSharedPosArray);
+			glNormalPointer(GL_FLOAT, 0, mSharedNorArray);
+		}
+		else
+		{
+			glVertexPointer(3, GL_FLOAT, 0, mPosArray[submesh]);
+			glNormalPointer(GL_FLOAT, 0, mNorArray[submesh]);
+		}
+
+		glDrawElements(	GL_TRIANGLES,
+										geosubmesh->mIndexCount,
+										GL_UNSIGNED_INT,
+										mIndexArray[submesh]);
+	}
+
+}//End drawTriangleList
+
+//---------------------------------------------------------------------------
+//	Paint lodstrip object.
+//---------------------------------------------------------------------------
+void GeoMeshView::drawLodStrip()
+{
+	SubMesh				*geosubmesh;
+	Index					position;
+	Vector3				vector3;
+	float					x,y,z;
+	float					r,g,b;
+	int						color_index;
+	int						current_strip;
+
+	color_index	=	0;
+
+	//	Initialize current strip.
+	current_strip	=	0;
+		
+	//	For each submesh.
+	for (int submesh = 0; submesh < geoMesh->mSubMeshCount; submesh++)
+	{
+		//	Gets the actual submesh.
+		geosubmesh	=	&geoMesh->mSubMesh[submesh];
+
+		//	For each one of the strips.
+		for (int strip = 0; strip < geosubmesh->mStripCount; strip++)
+		{
+			//	Paint the current strip.
+			glBegin(GL_TRIANGLE_STRIP);
+						
+			if (getColorStrips())
+			{
+				//	Gets the color of the strip.
+				r	=	mStripColors[color_index].r;
+				g	=	mStripColors[color_index].g;
+				b	=	mStripColors[color_index].b;
+			
+				//	Change to the next color.
+				color_index++;
+			
+				//	Paint a new color.
+				glColor3f(r,g,b);
+			}
+
+			//	For each index of the strip.
+			for (int index = 0; index < lodStripsLib->mStrips[current_strip].size(); index++)
+			{
+				position	=	lodStripsLib->mStrips[current_strip][index];
+
+				//	Gets the vertex normal.
+				vector3	=	geosubmesh->mVertexBuffer->mNormal[position];
+
+				x				=	vector3[0];
+				y				=	vector3[1];
+				z				=	vector3[2];
+				
+				//	Sets the vertex normal.
+				glNormal3f(x,y,z);
+				
+				//	Gets the vertex coordinates.
+				vector3	=	geosubmesh->mVertexBuffer->mPosition[position];
+				
+				x				=	vector3[0];
+				y				=	vector3[1];
+				z				=	vector3[2];
+
+				//	Sets the vertex position.
+				glVertex3f(x,y,z);
+			}
+			
+			//	Increments current strip.
+			current_strip++;
+
+			//	A strip is generated.
+			glEnd();
+
+		}
+	}
+	
+}//End drawTriangleStrip.
+
+//---------------------------------------------------------------------------
+//	Sets the lodstripslibrary object.
+//---------------------------------------------------------------------------
+void	GeoMeshView::setLodStripsLibrary(LodStripsLibrary *lodstrips)
+{
+	lodStripsLib	=	lodstrips;
+	activeLodStrip();
+}
+
+//---------------------------------------------------------------------------
+//	Change de Level of detail of the object.
+//---------------------------------------------------------------------------
+void	GeoMeshView::GoToLod(unsigned int	lod)
+{
+	lodStripsLib->GoToLod(lod);
+	draw();
+}
+//---------------------------------------------------------------------------
+//	Draw the object in the window.
+//---------------------------------------------------------------------------
+void GeoMeshView::draw()
+{
+	glMatrixMode(GL_PROJECTION);
+	glLoadIdentity();
+
+	glEnable(GL_LIGHTING);
+
+	//	Frustrum.
+	glViewport(0,0,w(),h());
+	gluPerspective(60,1,0.1,1000);
+
+	glMatrixMode(GL_MODELVIEW);
+	glLoadIdentity();
+
+	glEnable(GL_BLEND);
+	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+	GLfloat	light_ambient[]	=	{0.3,0.3,0.3,1.0};
+	GLfloat	luzpos[]				=	{0.0,0.0,1.0,0.0};
+	GLfloat	luzcolor[]			=	{1.0,1.0,1.0,1.0};
+
+	//	glLightModelfv(GL_LIGHT_MODEL_AMBIENT, light_ambient);
+	glEnable(GL_LIGHT0);
+	glLightfv(GL_LIGHT0, GL_POSITION, luzpos);
+	glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
+	glLightfv(GL_LIGHT0, GL_DIFFUSE, luzcolor);
+	glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 1);
+	glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0);
+	glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0);
+
+	glEnable (GL_POLYGON_OFFSET_LINE);
+	glPolygonOffset(-1,-1);
+	glEnable(GL_DEPTH_TEST);
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+	gluLookAt(0,0,mScaleFactor*2+size, 0,0,0, 0,1,0);
+
+	glTranslatef(xshift,yshift,0);
+	glRotatef(hAng,0,1,0);
+	glRotatef(vAng,1,0,0);
+	glTranslatef(-xMed,-yMed,-zMed);
+
+	//	Set white color to the object.
+	glColor3d(1.0, 1.0, 1.0);
+	GLfloat color_blanco[]	=	{1.0f,1.0f,1.0f,1.0f};
+	glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color_blanco);
+
+	if (mCW)
+	{
+		glFrontFace(GL_CW);
+		glEnable(GL_CULL_FACE);
+	}
+	else
+	{
+		if (mCCW)
+		{
+			glFrontFace(GL_CCW);
+			glEnable(GL_CULL_FACE);
+		}
+		else
+		{
+			glDisable(GL_CULL_FACE);
+		}
+	}
+
+	if (mSolid)
+	{
+		enableColorStrips();
+		glDisable(GL_LIGHTING);
+		glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
+		drawGeoMesh(colorsubmeshi);
+	}
+	else
+	{
+		glEnable(GL_LIGHTING);
+	}
+
+	if (mWire)
+	{
+		disableColorStrips();
+		glDisable(GL_LIGHTING);
+		glColor3d(0.0, 0.0, 1.0);
+		glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
+		drawGeoMesh(-1);
+	}
+	else
+	{
+		if (!mSolid)
+		{
+			enableColorStrips();
+			glEnable(GL_LIGHTING);
+			glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+			drawGeoMesh(colorsubmeshi);
+		}
+	}
+
+	swap_buffers();
+
+	//	Calculate the FPS.
+	calcFPS();
+}
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/src/GTAboutDialog.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/src/GTAboutDialog.cpp	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/src/GTAboutDialog.cpp	(revision 774)
@@ -0,0 +1,62 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0100
+
+#include "GTAboutDialog.h"
+#include	<fltk/ask.h>
+
+
+/*OK Callback*/
+inline void GTAboutDialog::cb_mOK_i(fltk::Button*, void*)
+{
+	delete	mMainWindow;
+}
+
+void GTAboutDialog::cb_mOK(fltk::Button* o, void* v) {
+  ((GTAboutDialog*)(o->parent()->parent()->user_data()))->cb_mOK_i(o,v);
+}
+
+GTAboutDialog::GTAboutDialog()
+{
+	fltk::gifImage	*logo;
+	fltk::Window		*w;
+	
+	const char	credits[1000]	=	"Benito Córcoles Almela\n"
+						"Jesús Galindo Álvaro\n"
+						"Gustavo Puche Rodríguez";
+	{
+		fltk::Window* o = mMainWindow = new fltk::Window(289, 319, "About");
+		w = o;
+		o->user_data((void*)(this));
+		o->begin();
+		{fltk::Group* o = new fltk::Group(0, 0, 289, 318);
+			o->set_vertical();
+			o->begin();
+			
+			{
+				fltk::MultiLineOutput* o = mText = new fltk::MultiLineOutput(15, 135, 260, 140);
+				mText->value(credits,strlen(credits));
+				o->type(4);
+				o->box(fltk::NO_BOX);
+				o->color((fltk::Color)0xe0dfe300);
+			}
+			
+			{
+				fltk::SharedImage *gifLogo = logo->get("media\\logos\\GameTools.gif");				
+
+				fltk::InvisibleBox* o = mLogo = new fltk::InvisibleBox(100, 25, 95, 100);
+				mLogo->image(gifLogo);
+				o->set_vertical();
+				o->color((fltk::Color)0xe0dfe300);
+			}
+			
+			{
+				fltk::Button* o = mOK = new fltk::Button(105, 285, 89, 25, "OK");
+				o->callback((fltk::Callback*)cb_mOK);
+			}
+			o->end();
+		}
+		o->end();
+	}
+
+	mMainWindow->show();
+}
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshSaver.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshSaver.cpp	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshSaver.cpp	(revision 774)
@@ -0,0 +1,698 @@
+/*	==========================================================================
+ *	(C) 2005 Universitat Jaume I
+ *	==========================================================================
+ *	PROYECT:	GAME TOOLS
+ *	==========================================================================*/
+/**	CONTENT:	
+	*
+	*
+	*	@file	GeoMeshSaver.cpp
+/*===========================================================================*/
+#include	<GeoMeshSaver.h>
+
+using	namespace	Geometry;
+using	namespace	std;
+
+//------------------------------------------
+//		Public:
+//------------------------------------------
+
+////////////////////
+//	Constructors.	//
+////////////////////
+GeoMeshSaver::GeoMeshSaver()
+{
+	mMaterialName				=	"";
+	mSkeletallyAnimated	=	false;
+
+	//	Initializa the mesh bounds.
+	mMeshBounds.minx			=	0.0;
+	mMeshBounds.miny			=	0.0;
+	mMeshBounds.minz			=	0.0;
+	mMeshBounds.maxx			=	0.0;
+	mMeshBounds.maxy			=	0.0;
+	mMeshBounds.maxz			=	0.0;
+	mMeshBounds.radius		=	0.0;
+}
+
+GeoMeshSaver::GeoMeshSaver(GeometryBounds bounds)
+{
+	mMaterialName				=	"";
+	mSkeletallyAnimated	=	false;
+
+	//	Initializa the mesh bounds.
+	mMeshBounds.minx			=	bounds.minx;
+	mMeshBounds.miny			=	bounds.miny;
+	mMeshBounds.minz			=	bounds.minz;
+	mMeshBounds.maxx			=	bounds.maxx;
+	mMeshBounds.maxy			=	bounds.maxy;
+	mMeshBounds.maxz			=	bounds.maxz;
+	mMeshBounds.radius		=	bounds.radius;
+}
+
+//////////////////
+//	Destroyer.	//
+//////////////////
+GeoMeshSaver::~GeoMeshSaver()
+{
+}
+
+//	Saves a Mesh into a file.
+int	GeoMeshSaver::save(Mesh	*geoMesh,	const	char	*fileNameMesh)
+{
+	int			size;
+	String	name(fileNameMesh);
+	
+	//	Open the file.
+	mSerializer	=	new	Serializer(	name,
+																Serializer::WRITE);
+
+	//	Set the mesh.
+	mGeoMesh	=	geoMesh;
+
+	//	Write the file header.
+	writeFileHeader();
+
+	//	Write the mesh data.
+	writeMesh(geoMesh);
+
+	//	Debug.
+	cout	<<	"Write mesh finish"
+				<<	endl;
+	
+	size	=	mSerializer->GetSize();
+	
+	//	Close the file.
+	delete	mSerializer;
+	
+	//	Return the number of bytes written.
+	return	size;
+}
+
+//------------------------------------------
+//		Private:
+//------------------------------------------
+
+//	Write the main mesh.
+void	GeoMeshSaver::writeMesh(Mesh	*geoMesh)
+{
+	//	Debug.
+	cout	<<	"Write the chunk header"
+				<<	endl;
+	
+	// Header
+	writeChunkHeader(M_MESH, calcMeshSize(geoMesh));
+
+	//	Write the skeletally animated flag.
+	writeBools(mSkeletallyAnimated,1);
+	
+	cout	<<	"1 - VertexCount: "
+				<<	geoMesh->mVertexBuffer->mVertexCount
+				<<	endl;
+
+	//	Write shared geometry.
+	if (geoMesh->mVertexBuffer->mVertexCount > 0)
+	{
+		//	Debug.
+		cout	<<	"Write the shared vertex buffer"
+					<<	endl;
+		
+		writeGeometry(geoMesh->mVertexBuffer);
+	}
+
+	//	Write submeshes.
+	for (int i = 0;	i < geoMesh->mSubMeshCount;	i++)
+	{
+		//	Debug.
+		cout	<<	"Write the submesh "
+					<<	i
+					<<	endl;
+		
+		writeSubMesh(&geoMesh->mSubMesh[i]);
+	}
+
+	//	Write the mesh bounds.
+	writeMeshBounds(mMeshBounds);
+	
+	/*
+	// Write skeleton info if required
+	if (pMesh->hasSkeleton())
+	{
+	LogManager::getSingleton().logMessage("Exporting skeleton link...");
+	// Write skeleton link
+	writeSkeletonLink(pMesh->getSkeletonName());
+	LogManager::getSingleton().logMessage("Skeleton link exported.");
+
+	// Write bone assignments
+	if (!pMesh->mBoneAssignments.empty())
+	{
+	LogManager::getSingleton().logMessage("Exporting shared geometry bone assignments...");
+
+	Mesh::VertexBoneAssignmentList::const_iterator vi;
+	for (vi = pMesh->mBoneAssignments.begin(); 
+	vi != pMesh->mBoneAssignments.end(); ++vi)
+	{
+	writeMeshBoneAssignment(vi->second);
+	}
+
+	LogManager::getSingleton().logMessage("Shared geometry bone assignments exported.");
+	}
+	}
+
+	// Write LOD data if any
+	if (pMesh->getNumLodLevels() > 1)
+	{
+	LogManager::getSingleton().logMessage("Exporting LOD information....");
+	writeLodInfo(pMesh);
+	LogManager::getSingleton().logMessage("LOD information exported.");
+
+	}
+	// Write bounds information
+	LogManager::getSingleton().logMessage("Exporting bounds information....");
+	writeBoundsInfo(pMesh);
+	LogManager::getSingleton().logMessage("Bounds information exported.");
+
+	// Write submesh name table
+	LogManager::getSingleton().logMessage("Exporting submesh name table...");
+	writeSubMeshNameTable(pMesh);
+	LogManager::getSingleton().logMessage("Submesh name table exported.");
+
+	// Write edge lists
+	if (pMesh->isEdgeListBuilt())
+	{
+	LogManager::getSingleton().logMessage("Exporting edge lists...");
+	writeEdgeList(pMesh);
+	LogManager::getSingleton().logMessage("Edge lists exported");
+	}
+	*/
+}
+
+//	Write a submesh.
+void	GeoMeshSaver::writeSubMesh(SubMesh	*geoSubMesh)
+{
+	bool						idx32bit;
+	unsigned	long	indexCount;
+	String					materialName;
+	
+	//	Debug.
+	cout	<<	"Write the submesh chunk header"
+				<<	endl;
+	
+	// Header.
+	writeChunkHeader(M_SUBMESH, calcSubMeshSize(geoSubMesh));
+
+	//	Debug.
+	cout	<<	"Write the material name"
+				<<	endl;
+
+	// Material Name.
+	materialName	=	getMaterialName();
+	writeString(materialName);
+
+	//	Debug.
+	cout	<<	"Write the shared vertex buffer flag: "
+				<<	endl;
+
+	// bool useSharedVertices
+	writeBools(geoSubMesh->mSharedVertexBuffer, 1);
+
+	indexCount	=	geoSubMesh->mIndexCount;
+
+	writeInts(indexCount, 1);
+
+	// bool indexes32Bit
+	idx32bit	=	true;
+	writeBools(idx32bit, 1);
+
+	//	Debug.
+	cout	<<	"Write the mIndex array"
+				<<	endl;
+
+	//	Write the index array.
+	for (int i = 0; i < geoSubMesh->mIndexCount; i++)
+	{
+		writeInts(geoSubMesh->mIndex[i], 1);
+	}
+
+	// M_GEOMETRY stream (Optional: present only if useSharedVertices = false)
+	if (!geoSubMesh->mSharedVertexBuffer)
+	{
+		//	Debug.
+		cout	<<	"Write the geometry of the submesh"
+					<<	endl;
+
+		writeGeometry(geoSubMesh->mVertexBuffer);
+	}
+
+	//	Debug.
+	cout	<<	"mIndex array written"
+				<<	endl;
+
+	// Operation type
+	writeSubMeshOperation(geoSubMesh);
+
+	//TODO:Bones.
+	/*
+	// Bone assignments
+	if (!s->mBoneAssignments.empty())
+	{
+		LogManager::getSingleton().logMessage("Exporting dedicated geometry bone assignments...");
+
+		SubMesh::VertexBoneAssignmentList::const_iterator vi;
+
+		for (vi = s->mBoneAssignments.begin(); 
+				vi != s->mBoneAssignments.end(); ++vi)
+		{
+			writeSubMeshBoneAssignment(vi->second);
+		}
+
+		LogManager::getSingleton().logMessage("Dedicated geometry bone assignments exported.");
+	}
+	*/
+}
+
+//	Write the submesh operation chunk and data.
+void GeoMeshSaver::writeSubMeshOperation(const	SubMesh	*geoSubMesh)
+{
+	unsigned 	short opType;
+	unsigned	long	size;
+
+	//	Debug.
+	cout	<<	"Write submesh operation"
+				<<	endl;
+	
+	size	=	CHUNK_OVERHEAD_SIZE	+	sizeof(unsigned	short);
+	
+	// Header
+	writeChunkHeader(M_SUBMESH_OPERATION, size);
+
+	//	If the mesh is in triangle strips.
+	if (mGeoMesh->mType	==	GEO_TRIANGLE_STRIPS)
+	{
+		opType	=	5;
+	}
+	//	If the mesh is in triangle list.
+	else
+	{
+		opType	=	4;
+	}
+	
+	writeShorts(opType, 1);
+
+	//	Debug.
+	cout	<<	"Submesh operation Written"
+				<<	endl;
+}
+
+//	Write geometry.
+void	GeoMeshSaver::writeGeometry(VertexBuffer	*vertexBuffer)
+{
+	unsigned	short	element;
+	unsigned	long	size;
+	unsigned	short	buffer_count;
+
+	buffer_count	=	3;
+
+	
+	//	Calc the size in bytes of the geometry chunk.
+	size	=	calcGeometrySize(vertexBuffer);
+		
+	//	Header.
+	//
+	//	Write the M_GEOMETRY header.
+	writeChunkHeader(M_GEOMETRY, size);
+
+	writeInts(vertexBuffer->mVertexCount,1);
+
+	//	Vertex declaration.
+	//	Calculate the size of vertex declaration.
+	size	=	CHUNK_OVERHEAD_SIZE
+					+
+					buffer_count
+					*
+					(CHUNK_OVERHEAD_SIZE	+	(sizeof(unsigned short)	*	5));
+
+	//	Write the vertex declaration header.
+	writeChunkHeader(	M_GEOMETRY_VERTEX_DECLARATION,size);
+
+	//	Obtain the size of the vertex element chunk.
+	size	=	CHUNK_OVERHEAD_SIZE	+	(sizeof(unsigned short)	*	5);
+
+	//	Positions.
+	//	Write the vertex element header for position.
+	writeChunkHeader(	M_GEOMETRY_VERTEX_ELEMENT,size);
+
+	element	=	0;
+	writeShorts(element,1);
+
+	element	=	VET_FLOAT3;
+	writeShorts(element,1);
+	
+	element	=	VES_POSITION;
+	writeShorts(element,1);
+	
+	element	=	0;
+	writeShorts(element,1);
+	
+	element	=	0;
+	writeShorts(element,1);
+
+	//	Normals.
+	//	Write the vertex element header for position.
+	writeChunkHeader(	M_GEOMETRY_VERTEX_ELEMENT,size);
+	
+	element	=	1;
+	writeShorts(element,1);
+	
+	element	=	VET_FLOAT3;
+	writeShorts(element,1);
+	
+	element	=	VES_NORMAL;
+	writeShorts(element,1);
+	
+	element	=	0;
+	writeShorts(element,1);
+	
+	element	=	0;
+	writeShorts(element,1);
+
+	//	Textures.
+	//	Write the vertex element header for position.
+	writeChunkHeader(M_GEOMETRY_VERTEX_ELEMENT,size);
+	
+	element	=	2;
+	writeShorts(element,1);
+	
+	element	=	VET_FLOAT2;
+	writeShorts(element,1);
+	
+	element	=	VES_TEXTURE_COORDINATES;
+	writeShorts(element,1);
+	
+	element	=	0;
+	writeShorts(element,1);
+	
+	element	=	0;
+	writeShorts(element,1);
+
+	//	Obtain the size for vertex buffer header for positons.
+	size	=	(2	*	CHUNK_OVERHEAD_SIZE)	+	(2	*	sizeof(unsigned short));
+
+	//	Write the vertex buffer header for positions.
+	writeChunkHeader(M_GEOMETRY_VERTEX_BUFFER,	size);
+
+	element	=	0;
+	writeShorts(element,1);
+	
+	element	=	12;
+	writeShorts(element,1);
+
+	//	Obtain the size for the vertex buffer data header for positions.
+	size	=	CHUNK_OVERHEAD_SIZE
+					+
+					((sizeof(float)	*	3)	*	vertexBuffer->mVertexCount);
+
+	//	Write the vertex buffer data header for positions.
+	writeChunkHeader(M_GEOMETRY_VERTEX_BUFFER_DATA,	size);
+
+	//	Write all the positions coords.
+	mSerializer->WriteArray(vertexBuffer->mPosition,
+													vertexBuffer->mVertexCount);
+
+	//	Obtain the size for vertex buffer header for normals.
+	size	=	(2	*	CHUNK_OVERHEAD_SIZE)	+	(2	*	sizeof(unsigned short));
+
+	//	Write the vertex buffer header.
+	writeChunkHeader(	M_GEOMETRY_VERTEX_BUFFER,	size);
+
+	element	=	1;
+	writeShorts(element,1);
+	
+	element	=	12;
+	writeShorts(element,1);
+
+	//	Obtain the size for the vertex buffer data header for normals.
+	size	=	CHUNK_OVERHEAD_SIZE
+					+
+					((sizeof(float)	*	3)	*	vertexBuffer->mVertexCount);
+
+	//	Write the vertex buffer data header for normals.
+	writeChunkHeader(M_GEOMETRY_VERTEX_BUFFER_DATA,	size);
+
+	//	Write all the normals coords.
+	mSerializer->WriteArray(vertexBuffer->mNormal,
+													vertexBuffer->mVertexCount);
+
+	//	Obtain the size for vertex buffer header for textures.
+	size	=	(2	*	CHUNK_OVERHEAD_SIZE)	+	(2	*	sizeof(unsigned short));
+
+	//	Write the vertex buffer header for textures.
+	writeChunkHeader(M_GEOMETRY_VERTEX_BUFFER,	size);
+
+	element	=	2;
+	writeShorts(element,1);
+	
+	element	=	8;
+	writeShorts(element,1);
+
+	//	Obtain the size for the vertex buffer data header for textures.
+	size	=	CHUNK_OVERHEAD_SIZE
+					+
+					((sizeof(float)	*	2)	*	vertexBuffer->mVertexCount);
+
+	//	Write the vertex buffer data header for textures.
+	writeChunkHeader(M_GEOMETRY_VERTEX_BUFFER_DATA,	size);
+
+	//	Debug.
+	cout	<<	"-7-"	<<	endl;
+
+	//	Write all the texture coords.
+	mSerializer->WriteArray(vertexBuffer->mTexCoords,
+													vertexBuffer->mVertexCount);
+
+	//	Debug.
+	cout	<<	"-8-"	<<	endl;
+
+}
+
+//	TODO: Write Mesh Bounds.
+void	GeoMeshSaver::writeMeshBounds(GeometryBounds bounds)
+{
+	size_t	size;
+
+	size	=	CHUNK_OVERHEAD_SIZE
+					+
+					(sizeof(float)	*	7);
+
+	writeChunkHeader(M_MESH_BOUNDS,	size);
+
+	writeFloats(bounds.minx,1);
+	writeFloats(bounds.miny,1);
+	writeFloats(bounds.minz,1);
+	writeFloats(bounds.maxx,1);
+	writeFloats(bounds.maxy,1);
+	writeFloats(bounds.maxz,1);
+	writeFloats(bounds.radius,1);
+}
+
+//	Calc the mesh size in bytes.
+size_t GeoMeshSaver::calcMeshSize(const Mesh	*geoMesh)
+{
+	size_t size = CHUNK_OVERHEAD_SIZE;
+
+	//	Debug.
+	cout	<<	"Calc the size of the mesh"
+				<<	endl;
+	
+	// Num shared vertices
+	size += sizeof(uint32);
+
+	//	Debug.
+	cout	<<	"VertexCount: "
+				<<	geoMesh->mVertexBuffer->mVertexCount
+				<<	endl;
+
+	// Geometry
+	if (geoMesh->mVertexBuffer->mVertexCount > 0)
+	{
+		//	Debug.
+		cout	<<	"Calc the size of the shared vertex buffer"
+					<<	endl;
+		
+		size += calcGeometrySize(geoMesh->mVertexBuffer);
+	}
+
+	// Submeshes
+	for (unsigned short i = 0; i < geoMesh->mSubMeshCount; ++i)
+	{
+		//	Debug.
+		cout	<<	"Calc the size of the submesh "
+					<<	i
+					<<	endl;
+
+		size += calcSubMeshSize(&geoMesh->mSubMesh[i]);
+	}
+
+	//	Mesh Bounds size added.
+	size	+=	CHUNK_OVERHEAD_SIZE
+						+
+						(sizeof(float)	*	7);
+
+	/*
+	// Skeleton link
+	if (geoMesh->hasSkeleton())
+	{
+		size += calcSkeletonLinkSize(geoMesh->getSkeletonName());
+	}
+	*/
+
+	/*
+	// Submesh name table
+	size += calcSubMeshNameTableSize(geoMesh);
+
+	// Edge list
+	if (geoMesh->isEdgeListBuilt())
+	{
+		size += calcEdgeListSize(geoMesh);
+	}
+	*/
+	
+	return size;
+}
+
+//	Calc the size in bytes for the submesh.
+size_t GeoMeshSaver::calcSubMeshSize(const SubMesh	*geoSubMesh)
+{
+	size_t size = CHUNK_OVERHEAD_SIZE;
+
+	// Material name
+	size += getMaterialName().length() + 1;
+
+	// bool useSharedVertices
+	size += sizeof(bool);
+	// unsigned int indexCount
+	size += sizeof(unsigned int);
+	// bool indexes32bit
+	size += sizeof(bool);
+
+	// unsigned int* faceVertexIndices 
+	size += sizeof(unsigned int) * geoSubMesh->mIndexCount;
+
+	// Geometry
+	if (!geoSubMesh->mSharedVertexBuffer)
+	{
+		size += calcGeometrySize(geoSubMesh->mVertexBuffer);
+	}
+
+	return size;
+}
+
+//	Calc the geometry size in bytes.
+size_t GeoMeshSaver::calcGeometrySize(const VertexBuffer* vertexBuffer)
+{
+	unsigned	long		size;
+	unsigned	long		buffer_count;
+
+	//	and another for normals.
+	buffer_count	=	3;
+
+	//	Calculate the size of the Geometry chunk.
+	size	=	CHUNK_OVERHEAD_SIZE	+	sizeof(unsigned int);
+	size	=	size
+					+
+					CHUNK_OVERHEAD_SIZE
+					+
+					buffer_count
+					*
+					(CHUNK_OVERHEAD_SIZE	+	(sizeof(unsigned short)	*	5));
+	size	=	size
+					+
+					buffer_count
+					*
+					(	(CHUNK_OVERHEAD_SIZE		*	2)
+						+
+						(sizeof(unsigned short)	*	2)
+						+
+						vertexBuffer->mVertexCount
+					);
+
+	return size;
+}
+
+//	Write the file header.
+void GeoMeshSaver::writeFileHeader(void)
+{
+	String	mesh_version("[MeshSerializer_v1.30]");
+	
+	writeShorts(M_HEADER, 1);
+
+	writeString(mesh_version);
+
+}
+
+//	Write a header chunk given.
+void GeoMeshSaver::writeChunkHeader(unsigned short	id,
+																		unsigned long		size)
+{
+	mSerializer->WriteData(&id,sizeof(unsigned short),1);
+	mSerializer->WriteData(&size,sizeof(unsigned long),1);
+}
+
+//	Write integers into the file.
+void	GeoMeshSaver::writeInts(unsigned long	id,
+															unsigned long	count)
+{
+	mSerializer->WriteData(&id,sizeof(id),count);
+}
+
+//	Write shorts into the file
+void	GeoMeshSaver::writeShorts(unsigned short	id,
+																unsigned long		count)
+{
+	mSerializer->WriteData(&id,sizeof(id),count);
+}
+
+//	Write float into the file.
+void	GeoMeshSaver::writeFloats(float						id,
+																unsigned long		count)
+{
+	mSerializer->WriteData(&id,sizeof(id),count);
+}
+
+//	Write a string into the file.
+void GeoMeshSaver::writeString(const	String	&string)
+{
+	mSerializer->WriteData(string);
+}
+
+//	Write booleans into the file.
+void	GeoMeshSaver::writeBools(	const bool id,
+																unsigned	long		count)
+{
+	mSerializer->WriteData(&id,sizeof(bool),count);
+}
+
+//	Sets the material of the mesh.
+void	GeoMeshSaver::setMaterialName(String	materialName)
+{
+	mMaterialName	=	materialName;
+}
+
+//	Gets the material of the mesh.
+String	GeoMeshSaver::getMaterialName()
+{
+	return	mMaterialName;
+}
+
+//	Set Mesh Bounds.
+void	GeoMeshSaver::setMeshBounds(GeometryBounds	bounds)
+{
+	mMeshBounds.minx		=	bounds.minx;
+	mMeshBounds.miny		=	bounds.miny;
+	mMeshBounds.minz		=	bounds.minz;
+	mMeshBounds.maxx		=	bounds.maxx;
+	mMeshBounds.maxy		=	bounds.maxy;
+	mMeshBounds.maxz		=	bounds.maxz;
+	mMeshBounds.radius	=	bounds.radius;
+}
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoTool.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoTool.cpp	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoTool.cpp	(revision 774)
@@ -0,0 +1,18 @@
+#include "GeoMeshViewUI.h"
+
+using namespace fltk;
+
+GeoMeshViewUI	*interface;
+
+float incrementa(float i) { return interface->updateProgressBar(i);  }
+
+
+int main(int argc, char **argv)
+{
+	interface	=	new GeoMeshViewUI(incrementa);
+	
+	interface->show();
+
+  return run();
+}
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoTool.rc
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoTool.rc	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoTool.rc	(revision 774)
@@ -0,0 +1,72 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Español resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ESN)
+#ifdef _WIN32
+LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+GEOICON                 ICON                    ".\media\logos\GeoIcon.ico"
+#endif    // Español resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/src/resource.h
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/src/resource.h	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/src/resource.h	(revision 774)
@@ -0,0 +1,16 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by test_MainForm2.rc
+//
+#define GEOICON                         101
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        102
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1001
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
Index: GTP/trunk/Lib/Geom/shared/GeoTool/GeoTool.vcproj
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/GeoTool.vcproj	(revision 774)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/GeoTool.vcproj	(revision 774)
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="GeoTool"
+	ProjectGUID="{31522E11-420C-4DD6-8922-AF96B93E2207}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="build\$(ConfigurationName)"
+			IntermediateDirectory="build\Debug"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".\include;..\include;..\..\..\..\..\..\NonGTP\FLTK\include;..\GTGeometry\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WIN32_LEAN_AND_MEAN;VC_EXTRA_LEAN;WIN32_EXTRA_LEAN"
+				MinimalRebuild="FALSE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				BufferSecurityCheck="TRUE"
+				DisableLanguageExtensions="FALSE"
+				UsePrecompiledHeader="0"
+				WarningLevel="1"
+				SuppressStartupBanner="TRUE"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="4"
+				CompileAs="2"
+				ShowIncludes="FALSE"
+				UndefineAllPreprocessorDefinitions="FALSE"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="fltkd.lib comctl32.lib wsock32.lib GTGeometry_d.lib glu32.lib opengl32.lib glaux.lib fltk_opengl.lib"
+				OutputFile="$(OutDir)/GeoTool.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="..\..\..\..\..\..\NonGTP\FLTK\lib;..\GTGeometry\build\$(ConfigurationName)"
+				IgnoreDefaultLibraryNames="LIBCD"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/GeoTool.pdb"
+				SubSystem="2"
+				OptimizeReferences="0"
+				EnableCOMDATFolding="0"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="build\$(ConfigurationName)"
+			IntermediateDirectory="build\Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".\include;..\include;..\..\..\..\..\..\NonGTP\FLTK\include;..\GTGeometry\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WIN32_LEAN_AND_MEAN;VC_EXTRA_LEAN;WIN32_EXTRA_LEAN"
+				RuntimeLibrary="4"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="FALSE"
+				DebugInformationFormat="0"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="GTGeometry.lib fltk.lib comctl32.lib wsock32.lib glu32.lib opengl32.lib glaux.lib fltk_opengl.lib"
+				OutputFile="$(OutDir)/GeoTool.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="..\..\..\..\..\..\NonGTP\FLTK\lib;..\GTGeometry\build\$(ConfigurationName)"
+				IgnoreDefaultLibraryNames="LIBCMT;LIBCMTD"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="0"
+				EnableCOMDATFolding="0"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\src\GeoMeshLoader.cpp">
+			</File>
+			<File
+				RelativePath=".\src\GeoMeshSaver.cpp">
+			</File>
+			<File
+				RelativePath=".\src\GeoMeshView.cpp">
+			</File>
+			<File
+				RelativePath=".\src\GeoMeshViewUI.cpp">
+			</File>
+			<File
+				RelativePath=".\src\GeoTool.cpp">
+			</File>
+			<File
+				RelativePath=".\src\GTAboutDialog.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+			<File
+				RelativePath=".\include\GeoMeshLoader.h">
+			</File>
+			<File
+				RelativePath=".\include\GeoMeshSaver.h">
+			</File>
+			<File
+				RelativePath=".\include\GeoMeshView.h">
+			</File>
+			<File
+				RelativePath=".\include\GeoMeshViewUI.h">
+			</File>
+			<File
+				RelativePath=".\include\GTAboutDialog.h">
+			</File>
+			<File
+				RelativePath=".\src\resource.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+			<File
+				RelativePath=".\media\logos\GeoIcon.ico">
+			</File>
+			<File
+				RelativePath=".\src\GeoTool.rc">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
