diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b55ccdb799bf9247d6b47f262201708ea0ae3ee8..748969aad77d3c41349584b60ad12157f0f5eb01 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,11 +2,7 @@ <project version="4"> <component name="ChangeListManager"> <list default="true" id="dd1d4179-bace-49d8-b3fd-a51317f8ae06" name="Default Changelist" comment=""> - <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__org_jogamp_jogl_jogl_all_2_0_rc11.xml" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/GUI/GUI.iml" beforeDir="false" afterPath="$PROJECT_DIR$/GUI/GUI.iml" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/GUI/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/GUI/pom.xml" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/GUI/src/main/java/cz/fidentis/analyst/gui/GeneralGLEventListener.java" beforeDir="false" afterPath="$PROJECT_DIR$/GUI/src/main/java/cz/fidentis/analyst/gui/GeneralGLEventListener.java" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/MeshModel/MeshModel.iml" beforeDir="false" afterPath="$PROJECT_DIR$/MeshModel/MeshModel.iml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> </list> <ignored path="$PROJECT_DIR$/target/" /> <ignored path="$PROJECT_DIR$/MeshModel/target/" /> @@ -38,7 +34,7 @@ <file pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTableRow.java"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="12"> + <state relative-caret-position="119"> <caret line="7" column="13" selection-start-line="7" selection-start-column="13" selection-end-line="7" selection-end-column="13" /> </state> </provider> @@ -47,7 +43,7 @@ <file pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="-872"> + <state relative-caret-position="153"> <caret line="9" column="13" selection-start-line="9" selection-start-column="13" selection-end-line="9" selection-end-column="13" /> </state> </provider> @@ -56,12 +52,10 @@ <file pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.java"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="-1820"> + <state relative-caret-position="3315"> <caret line="381" column="28" selection-start-line="381" selection-start-column="28" selection-end-line="381" selection-end-column="28" /> <folding> <element signature="imports" expanded="true" /> - <element signature="e#15781#15916#0" expanded="true" /> - <element signature="e#15915#15916#0" expanded="true" /> </folding> </state> </provider> @@ -70,7 +64,7 @@ <file pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/GUI/src/main/java/cz/fidentis/analyst/gui/GeneralGLEventListener.java"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="287"> + <state relative-caret-position="6426"> <caret line="406" column="44" selection-start-line="406" selection-start-column="44" selection-end-line="406" selection-end-column="44" /> <folding> <element signature="imports" expanded="true" /> @@ -82,12 +76,11 @@ <file pinned="false" current-in-tab="true"> <entry file="file://$PROJECT_DIR$/GUI/src/main/java/cz/fidentis/analyst/gui/Interface.java"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="54"> - <caret line="221" column="25" lean-forward="true" selection-start-line="221" selection-start-column="25" selection-end-line="221" selection-end-column="25" /> + <state relative-caret-position="-221"> + <caret line="14" column="32" lean-forward="true" selection-start-line="14" selection-start-column="32" selection-end-line="14" selection-end-column="32" /> <folding> <element signature="imports" expanded="true" /> - <element signature="e#11067#11244#0" expanded="true" /> - <element signature="e#11243#11244#0" expanded="true" /> + <element signature="e#4076#4165#0" expanded="true" /> </folding> </state> </provider> @@ -114,7 +107,7 @@ <file pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTable.java"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="-612"> + <state relative-caret-position="153"> <caret line="10" column="13" selection-start-line="10" selection-start-column="13" selection-end-line="10" selection-end-column="13" /> </state> </provider> @@ -184,8 +177,8 @@ <option name="delegateBuildToMaven" value="true" /> </component> <component name="ProjectFrameBounds" extendedState="6"> - <option name="x" value="-9" /> - <option name="y" value="-9" /> + <option name="x" value="-10" /> + <option name="y" value="-10" /> <option name="width" value="980" /> <option name="height" value="1050" /> </component> @@ -194,6 +187,7 @@ <foldersAlwaysOnTop value="true" /> </navigator> <panes> + <pane id="Scope" /> <pane id="ProjectPane"> <subPane> <expand> @@ -227,15 +221,6 @@ <item name="main" type="462c0819:PsiDirectoryNode" /> <item name="java" type="462c0819:PsiDirectoryNode" /> </path> - <path> - <item name="FIDENTIS-Analyst-parent" type="b2602c69:ProjectViewProjectNode" /> - <item name="analyst2" type="462c0819:PsiDirectoryNode" /> - <item name="GUI" type="462c0819:PsiDirectoryNode" /> - <item name="src" type="462c0819:PsiDirectoryNode" /> - <item name="main" type="462c0819:PsiDirectoryNode" /> - <item name="java" type="462c0819:PsiDirectoryNode" /> - <item name="gui" type="462c0819:PsiDirectoryNode" /> - </path> <path> <item name="FIDENTIS-Analyst-parent" type="b2602c69:ProjectViewProjectNode" /> <item name="analyst2" type="462c0819:PsiDirectoryNode" /> @@ -296,14 +281,13 @@ </subPane> </pane> <pane id="PackagesPane" /> - <pane id="Scope" /> </panes> </component> <component name="PropertiesComponent"> <property name="WebServerToolWindowFactoryState" value="false" /> <property name="aspect.path.notification.shown" value="true" /> - <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1583523876314" /> - <property name="last_opened_file_path" value="$PROJECT_DIR$" /> + <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1583613721619" /> + <property name="last_opened_file_path" value="$PROJECT_DIR$/../../J5" /> <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" /> <property name="nodejs_npm_path_reset_for_default_project" value="true" /> <property name="project.structure.last.edited" value="Global Libraries" /> @@ -359,18 +343,19 @@ <workItem from="1582807369146" duration="1114000" /> <workItem from="1582811692938" duration="1887000" /> <workItem from="1583409089486" duration="2462000" /> - <workItem from="1583521284239" duration="1204000" /> + <workItem from="1583521284239" duration="2331000" /> + <workItem from="1584477266625" duration="1814000" /> + <workItem from="1584557414142" duration="72000" /> </task> <servers /> </component> <component name="TimeTrackingManager"> - <option name="totallyTimeSpent" value="14619000" /> + <option name="totallyTimeSpent" value="17632000" /> </component> <component name="ToolWindowManager"> - <frame x="-7" y="-7" width="1550" height="838" extended-state="7" /> - <editor active="true" /> + <frame x="-7" y="-7" width="1550" height="838" extended-state="6" /> <layout> - <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.27114093" /> + <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.27919462" /> <window_info id="Structure" order="1" side_tool="true" weight="0.25" /> <window_info id="Image Layers" order="2" /> <window_info id="Designer" order="3" /> @@ -379,7 +364,7 @@ <window_info id="Favorites" order="6" side_tool="true" /> <window_info anchor="bottom" id="Message" order="0" /> <window_info anchor="bottom" id="Find" order="1" /> - <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.3286119" /> + <window_info anchor="bottom" id="Run" order="2" weight="0.3286119" /> <window_info anchor="bottom" id="Debug" order="3" weight="0.4" /> <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" /> <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" /> @@ -395,7 +380,7 @@ <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" /> <window_info anchor="right" id="Palette" order="3" /> <window_info anchor="right" id="Theme Preview" order="4" /> - <window_info anchor="right" id="Maven" order="5" visible="true" weight="0.2543624" /> + <window_info anchor="right" id="Maven" order="5" visible="true" weight="0.094630875" /> <window_info anchor="right" id="Capture Analysis" order="6" /> <window_info anchor="right" id="Palette	" order="7" /> <window_info anchor="right" id="Database" order="8" /> @@ -405,20 +390,6 @@ <option name="version" value="1" /> </component> <component name="editorHistoryManager"> - <entry file="file://$PROJECT_DIR$/application/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="289"> - <caret line="17" selection-start-line="17" selection-end-line="17" /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTable.java"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="-612"> - <caret line="10" column="13" selection-start-line="10" selection-start-column="13" selection-end-line="10" selection-end-column="13" /> - </state> - </provider> - </entry> <entry file="file://$PROJECT_DIR$/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshFacet.java"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="170"> @@ -432,21 +403,31 @@ </entry> <entry file="file://$PROJECT_DIR$/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTableRow.java"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="12"> + <state relative-caret-position="119"> <caret line="7" column="13" selection-start-line="7" selection-start-column="13" selection-end-line="7" selection-end-column="13" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="-872"> + <state relative-caret-position="153"> <caret line="9" column="13" selection-start-line="9" selection-start-column="13" selection-end-line="9" selection-end-column="13" /> </state> </provider> </entry> + <entry file="file://$PROJECT_DIR$/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.java"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="3315"> + <caret line="381" column="28" selection-start-line="381" selection-start-column="28" selection-end-line="381" selection-end-column="28" /> + <folding> + <element signature="imports" expanded="true" /> + </folding> + </state> + </provider> + </entry> <entry file="file://$PROJECT_DIR$/GUI/src/main/java/cz/fidentis/analyst/gui/GeneralGLEventListener.java"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="287"> + <state relative-caret-position="6426"> <caret line="406" column="44" selection-start-line="406" selection-start-column="44" selection-end-line="406" selection-end-column="44" /> <folding> <element signature="imports" expanded="true" /> @@ -454,6 +435,13 @@ </state> </provider> </entry> + <entry file="file://$PROJECT_DIR$/application/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="289"> + <caret line="17" selection-start-line="17" selection-end-line="17" /> + </state> + </provider> + </entry> <entry file="file://$PROJECT_DIR$/GUI/src/main/java/cz/fidentis/analyst/gui/ModelFileFilter.java"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="306"> @@ -461,26 +449,20 @@ </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.java"> + <entry file="file://$PROJECT_DIR$/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTable.java"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="-1820"> - <caret line="381" column="28" selection-start-line="381" selection-start-column="28" selection-end-line="381" selection-end-column="28" /> - <folding> - <element signature="imports" expanded="true" /> - <element signature="e#15781#15916#0" expanded="true" /> - <element signature="e#15915#15916#0" expanded="true" /> - </folding> + <state relative-caret-position="153"> + <caret line="10" column="13" selection-start-line="10" selection-start-column="13" selection-end-line="10" selection-end-column="13" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/GUI/src/main/java/cz/fidentis/analyst/gui/Interface.java"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="54"> - <caret line="221" column="25" lean-forward="true" selection-start-line="221" selection-start-column="25" selection-end-line="221" selection-end-column="25" /> + <state relative-caret-position="-221"> + <caret line="14" column="32" lean-forward="true" selection-start-line="14" selection-start-column="32" selection-end-line="14" selection-end-column="32" /> <folding> <element signature="imports" expanded="true" /> - <element signature="e#11067#11244#0" expanded="true" /> - <element signature="e#11243#11244#0" expanded="true" /> + <element signature="e#4076#4165#0" expanded="true" /> </folding> </state> </provider> diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.form b/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.form new file mode 100644 index 0000000000000000000000000000000000000000..f2b81b2656c7f8a6534ad2f1936842e410fd83f6 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.form @@ -0,0 +1,298 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.9" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="0" red="0" type="rgb"/> + </Property> + </Properties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,93,0,0,1,-79"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> + <SubComponents> + <Container class="javax.swing.JLayeredPane" name="jLayeredPane1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="28" green="28" red="28" type="rgb"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value=""/> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="componentResized" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="jLayeredPane1ComponentResized"/> + <EventHandler event="componentShown" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="jLayeredPane1ComponentShown"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> + <BorderConstraints direction="Center"/> + </Constraint> + </Constraints> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="true"/> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="resetButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/resetButton.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="resetButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="resetButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="resetButtonMouseExited"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="60" y="70" width="30" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="upNavigationButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/upButton.png"/> + </Property> + <Property name="borderPainted" type="boolean" value="false"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="upNavigationButtonMousePressed"/> + <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="upNavigationButtonMouseReleased"/> + </Events> + <AuxValues> + <AuxValue name="JLayeredPane.layer" type="java.lang.Integer" value="200"/> + </AuxValues> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="60" y="40" width="30" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="leftNavigationButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/leftButton.png"/> + </Property> + <Property name="borderPainted" type="boolean" value="false"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="leftNavigationButtonMousePressed"/> + <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="leftNavigationButtonMouseReleased"/> + </Events> + <AuxValues> + <AuxValue name="JLayeredPane.layer" type="java.lang.Integer" value="200"/> + </AuxValues> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="70" width="30" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="minusNavigationButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/minus.png"/> + </Property> + <Property name="borderPainted" type="boolean" value="false"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="minusNavigationButtonMousePressed"/> + <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="minusNavigationButtonMouseReleased"/> + </Events> + <AuxValues> + <AuxValue name="JLayeredPane.layer" type="java.lang.Integer" value="200"/> + </AuxValues> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="80" y="130" width="30" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="downNavigationButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/downButton.png"/> + </Property> + <Property name="borderPainted" type="boolean" value="false"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="downNavigationButtonMousePressed"/> + <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="downNavigationButtonMouseReleased"/> + </Events> + <AuxValues> + <AuxValue name="JLayeredPane.layer" type="java.lang.Integer" value="200"/> + </AuxValues> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="60" y="100" width="30" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="plusNavigationButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/plus.png"/> + </Property> + <Property name="borderPainted" type="boolean" value="false"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="plusNavigationButtonMousePressed"/> + <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="plusNavigationButtonMouseReleased"/> + </Events> + <AuxValues> + <AuxValue name="JLayeredPane.layer" type="java.lang.Integer" value="200"/> + </AuxValues> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="40" y="130" width="30" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/navigBackground.png"/> + </Property> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="40" width="90" height="90"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="loadModelButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/loadCanva.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="loadModelButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="loadModelButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="loadModelButtonMouseExited"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="200" y="100" width="210" height="220"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="rightNavigationButton1"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/rightButton.png"/> + </Property> + <Property name="borderPainted" type="boolean" value="false"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="rightNavigationButton1MousePressed"/> + <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="rightNavigationButton1MouseReleased"/> + </Events> + <AuxValues> + <AuxValue name="JLayeredPane.layer" type="java.lang.Integer" value="200"/> + </AuxValues> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="90" y="70" width="30" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="whiteBackroundButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/whiteBackroundCanvas.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="whiteBackroundButtonMouseClicked"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="50" y="170" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="blackBackroundButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/blackBackroundCanvas.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="blackBackroundButtonMouseClicked"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="50" y="240" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="0" red="0" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseWheelMoved" listener="java.awt.event.MouseWheelListener" parameters="java.awt.event.MouseWheelEvent" handler="jPanel1MouseWheelMoved"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="0" y="0" width="-1" height="-1"/> + </Constraint> + </Constraints> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> + </Container> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.java b/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.java index be3b9a8fb55183d3cfbfecd716907b90b2e23679..ed28c4df1471e631bb86af8a639fa5443f4cc8da 100644 --- a/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.java +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.java @@ -1,90 +1,84 @@ package cz.fidentis.analyst.gui; +import cz.fidentis.analyst.mesh.io.ModelFileFilter; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLProfile; import javax.media.opengl.awt.GLCanvas; import com.jogamp.opengl.util.FPSAnimator; import cz.fidentis.analyst.mesh.core.MeshModel; import cz.fidentis.analyst.mesh.io.MeshObjLoader; - import java.awt.Color; import java.awt.Cursor; import java.awt.Dimension; import java.io.File; import java.util.Timer; import java.util.TimerTask; +import javax.swing.ImageIcon; import javax.swing.JFileChooser; import javax.swing.JOptionPane; /** * - * @author Natalia Bebjakova - * + * @author Natalia Bebjakova + * * Canvas for displaying models containing GLCanvas and navigation. */ public class Canvas extends javax.swing.JPanel { protected GLCanvas glCanvas; protected long startClickTime = 0; - + protected TimerTask task; protected Timer timer; - + protected GeneralGLEventListener listener; - private static final int FPS = 60; // animator's target frames per second + /** + * animator's target frames per second + */ + private static final int FPS = 60; private final FPSAnimator animator; - - protected boolean drawWireModel; // decides if model is displayed as wire-frame + + /** + * decides if model is displayed as wire-frame + */ + protected boolean drawWireModel; + + /** + * original model that is loaded from file + */ + protected MeshModel loadedModel; /** - * Creates new form Canvas + * Creates new form Canva */ public Canvas() { initComponents(); - + // gl version 2 is used GLCapabilities capabilities = new GLCapabilities(GLProfile.get(GLProfile.GL2)); capabilities.setDoubleBuffered(true); - + // creates new glCanvas panel for displaying model glCanvas = new GLCanvas(capabilities); jPanel1.add(glCanvas); - glCanvas.setVisible(false); + glCanvas.setVisible(false); glCanvas.setBackground(Color.black); - + // enables glCanvas to react to events - glCanvas.requestFocusInWindow(); + glCanvas.requestFocusInWindow(); glCanvas.setSize(getWidth() - getInsets().left - getInsets().right, getHeight() - getInsets().top - getInsets().bottom); - - // enables animated transition + + // enables animated transition animator = new FPSAnimator(glCanvas, FPS, true); animator.start(); - - // listener enables to display and manipulate with the model listener = new GeneralGLEventListener(this); - // hand cursor when moving mouse on components - setCursorOnComponents(); - - this.validate(); + this.validate(); } - - /** - * Sets hand cursor when moving mouse on components - */ - private void setCursorOnComponents() { - loadModelButton.setLocation(this.getWidth() / 2, this.getHeight() / 2); - downNavigationButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - leftNavigationButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - upNavigationButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - plusNavigationButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - minusNavigationButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - loadModelButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - rightNavigationButton1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - } - + /** * Changing the size of glCanvas + * * @param d New size of glCanvas */ public void resizeCanvas(Dimension d) { @@ -94,7 +88,40 @@ public class Canvas extends javax.swing.JPanel { this.repaint(); loadModelButton.setLocation(this.getWidth() / 2 - 35, this.getHeight() / 2 - 40); } - + + /** + * + * @return Original model that is loaded from dile + */ + public MeshModel getLoadedModel() { + return loadedModel; + } + + /** + * Sets GLListener of the canvas + * + * @param listener GLListener for manipulation with model + */ + public void setListener(GeneralGLEventListener listener) { + this.listener = listener; + } + + + /** + * + * @param drawWire Decides if model is displayed as wife-frame + */ + public void setDrawWired(boolean drawWire) { + drawWireModel = drawWire; + } + /** + * + * @return Returns if model is displayed as wife-frame + */ + public boolean getDrawWired(){ + return drawWireModel; + } + /** * * @param v Decides if button for loading model is visible @@ -102,7 +129,7 @@ public class Canvas extends javax.swing.JPanel { public void setImportLabelVisible(Boolean v) { loadModelButton.setVisible(v); } - + /** * Loads model selected in file chooser by user */ @@ -110,27 +137,27 @@ public class Canvas extends javax.swing.JPanel { String[] extensions = new String[2]; extensions[0] = "obj"; extensions[1] = "OBJ"; - + //enables to shows just .obj files in file chooser ModelFileFilter filter = new ModelFileFilter(extensions, "*.obj"); JFileChooser jFileChooser1 = new JFileChooser(); jFileChooser1.setPreferredSize(new Dimension (800,500)); - - jFileChooser1.addChoosableFileFilter(filter); - + + jFileChooser1.addChoosableFileFilter(filter); + //file chooser will appear on top of glCanvas jFileChooser1.showOpenDialog(this); - jFileChooser1.setDialogTitle("Import obj file"); - + jFileChooser1.setDialogTitle("Import obj file"); + File[] fileArray = new File[1]; //saves selected file by user as first element in array fileArray[0] = jFileChooser1.getSelectedFile(); - + if (fileArray.length <= 0) { System.out.print("No file chosen."); } else { this.addModel(fileArray[0]); - } + } glCanvas.setVisible(true); } @@ -144,27 +171,50 @@ public class Canvas extends javax.swing.JPanel { try { //static class MeshObjLaoder reads .obj file into model MeshModel model = MeshObjLoader.read(new File (file.getPath())); + loadedModel = MeshObjLoader.read(new File (file.getPath())); if (model != null) { // listener enables to manipulate and interact with model - listener.setCameraPosition(0, 0, 300); - glCanvas.addGLEventListener(listener); - listener.setModels(model); + listener.setCameraPosition(0, 0, 300); + glCanvas.addGLEventListener(listener); + listener.setModel(model); + listener.rotationAndSizeRestart(); loadModelButton.setVisible(false); - } - } catch (Exception e) { - System.out.println(e.getMessage()); - JOptionPane pane = new JOptionPane(); - pane.showMessageDialog(this, "File doesn't contain any model"); - System.out.println ("File doesn't contain any model"); - - }; - + } + } catch (Exception e) { + System.out.println(e.getMessage()); + JOptionPane.showMessageDialog(this, "File doesn't contain any model", "Model is not loaded.", + 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/notLoadedModel.png"))); + System.out.println ("File doesn't contain any model"); + + }; + } - + + /** + * Changes the model to be displayed + * + * @param model New model that will be displayed on canvas + */ + public void changeModel(MeshModel model) { + MeshModel newModel = new MeshModel(model); + listener.setModel(newModel); + } + + /** + * Returns the model which is displayed on canvas + * + * @return Model that is displayed on canvas + */ + public MeshModel getModel() { + return listener.getModel(); + } + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. + * + * Generated code from NetBeans */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents @@ -180,12 +230,15 @@ public class Canvas extends javax.swing.JPanel { jLabel1 = new javax.swing.JLabel(); loadModelButton = new javax.swing.JLabel(); rightNavigationButton1 = new javax.swing.JButton(); + whiteBackroundButton = new javax.swing.JLabel(); + blackBackroundButton = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); setBackground(new java.awt.Color(0, 0, 0)); setLayout(new java.awt.BorderLayout()); - jLayeredPane1.setBackground(new java.awt.Color(0, 0, 0)); + jLayeredPane1.setBackground(new java.awt.Color(40, 40, 40)); + jLayeredPane1.setToolTipText(""); jLayeredPane1.setOpaque(true); jLayeredPane1.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent evt) { @@ -196,7 +249,8 @@ public class Canvas extends javax.swing.JPanel { } }); - resetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/resetButton.png"))); // NOI18N + resetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/resetButton.png"))); // NOI18N + resetButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); resetButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseMoved(java.awt.event.MouseEvent evt) { resetButtonMouseMoved(evt); @@ -211,11 +265,12 @@ public class Canvas extends javax.swing.JPanel { } }); jLayeredPane1.add(resetButton); - resetButton.setBounds(60, 70, 40, 30); + resetButton.setBounds(60, 70, 30, 30); - upNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/upButton.png"))); // NOI18N + upNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/upButton.png"))); // NOI18N upNavigationButton.setBorderPainted(false); upNavigationButton.setContentAreaFilled(false); + upNavigationButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); upNavigationButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { upNavigationButtonMousePressed(evt); @@ -228,9 +283,10 @@ public class Canvas extends javax.swing.JPanel { jLayeredPane1.add(upNavigationButton); upNavigationButton.setBounds(60, 40, 30, 30); - leftNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/leftButton.png"))); // NOI18N + leftNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/leftButton.png"))); // NOI18N leftNavigationButton.setBorderPainted(false); leftNavigationButton.setContentAreaFilled(false); + leftNavigationButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); leftNavigationButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { leftNavigationButtonMousePressed(evt); @@ -243,9 +299,10 @@ public class Canvas extends javax.swing.JPanel { jLayeredPane1.add(leftNavigationButton); leftNavigationButton.setBounds(30, 70, 30, 30); - minusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/minus.png"))); // NOI18N + minusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/minus.png"))); // NOI18N minusNavigationButton.setBorderPainted(false); minusNavigationButton.setContentAreaFilled(false); + minusNavigationButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); minusNavigationButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { minusNavigationButtonMousePressed(evt); @@ -258,9 +315,10 @@ public class Canvas extends javax.swing.JPanel { jLayeredPane1.add(minusNavigationButton); minusNavigationButton.setBounds(80, 130, 30, 30); - downNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/downButton.png"))); // NOI18N + downNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/downButton.png"))); // NOI18N downNavigationButton.setBorderPainted(false); downNavigationButton.setContentAreaFilled(false); + downNavigationButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); downNavigationButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { downNavigationButtonMousePressed(evt); @@ -273,9 +331,10 @@ public class Canvas extends javax.swing.JPanel { jLayeredPane1.add(downNavigationButton); downNavigationButton.setBounds(60, 100, 30, 30); - plusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/plus.png"))); // NOI18N + plusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/plus.png"))); // NOI18N plusNavigationButton.setBorderPainted(false); plusNavigationButton.setContentAreaFilled(false); + plusNavigationButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); plusNavigationButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { plusNavigationButtonMousePressed(evt); @@ -288,11 +347,12 @@ public class Canvas extends javax.swing.JPanel { jLayeredPane1.add(plusNavigationButton); plusNavigationButton.setBounds(40, 130, 30, 30); - jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/navigBackground.png"))); // NOI18N + jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/navigBackground.png"))); // NOI18N jLayeredPane1.add(jLabel1); jLabel1.setBounds(30, 40, 90, 90); - loadModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/loadCanva.png"))); // NOI18N + loadModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/loadCanva.png"))); // NOI18N + loadModelButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); loadModelButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseMoved(java.awt.event.MouseEvent evt) { loadModelButtonMouseMoved(evt); @@ -307,11 +367,12 @@ public class Canvas extends javax.swing.JPanel { } }); jLayeredPane1.add(loadModelButton); - loadModelButton.setBounds(190, 80, 210, 220); + loadModelButton.setBounds(200, 100, 210, 220); - rightNavigationButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/rightButton.png"))); // NOI18N + rightNavigationButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/rightButton.png"))); // NOI18N rightNavigationButton1.setBorderPainted(false); rightNavigationButton1.setContentAreaFilled(false); + rightNavigationButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); rightNavigationButton1.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { rightNavigationButton1MousePressed(evt); @@ -324,6 +385,26 @@ public class Canvas extends javax.swing.JPanel { jLayeredPane1.add(rightNavigationButton1); rightNavigationButton1.setBounds(90, 70, 30, 30); + whiteBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/whiteBackroundCanvas.png"))); // NOI18N + whiteBackroundButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + whiteBackroundButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + whiteBackroundButtonMouseClicked(evt); + } + }); + jLayeredPane1.add(whiteBackroundButton); + whiteBackroundButton.setBounds(50, 170, 0, 0); + + blackBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/blackBackroundCanvas.png"))); // NOI18N + blackBackroundButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + blackBackroundButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + blackBackroundButtonMouseClicked(evt); + } + }); + jLayeredPane1.add(blackBackroundButton); + blackBackroundButton.setBounds(50, 240, 0, 0); + jPanel1.setBackground(new java.awt.Color(0, 0, 0)); jPanel1.addMouseWheelListener(new java.awt.event.MouseWheelListener() { public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) { @@ -338,7 +419,7 @@ public class Canvas extends javax.swing.JPanel { }// </editor-fold>//GEN-END:initComponents /** - * + * * @param evt Resizing glCanvas cantaining components */ private void jLayeredPane1ComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_jLayeredPane1ComponentResized @@ -348,7 +429,7 @@ public class Canvas extends javax.swing.JPanel { }//GEN-LAST:event_jLayeredPane1ComponentResized /** - * + * * @param evt Showing glCanvas cantaining components */ private void jLayeredPane1ComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_jLayeredPane1ComponentShown @@ -358,7 +439,7 @@ public class Canvas extends javax.swing.JPanel { }//GEN-LAST:event_jLayeredPane1ComponentShown /** - * + * * @param evt Enables to rotate left the model when left navigation button is pressed */ private void leftNavigationButtonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_leftNavigationButtonMousePressed @@ -371,11 +452,11 @@ public class Canvas extends javax.swing.JPanel { } }; timer.schedule(task, 500, 100); - leftNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/leftButtonPressed.png"))); + leftNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/leftButtonPressed.png"))); }//GEN-LAST:event_leftNavigationButtonMousePressed /** - * + * * @param evt Enables to rotate up the model when up navigation button is pressed */ private void upNavigationButtonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_upNavigationButtonMousePressed @@ -388,11 +469,11 @@ public class Canvas extends javax.swing.JPanel { } }; timer.schedule(task, 500, 100); - upNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/upButtonPressed.png"))); + upNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/upButtonPressed.png"))); }//GEN-LAST:event_upNavigationButtonMousePressed /** - * + * * @param evt Enables to rotate down the model when down navigation button is pressed */ private void downNavigationButtonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_downNavigationButtonMousePressed @@ -405,11 +486,11 @@ public class Canvas extends javax.swing.JPanel { } }; timer.schedule(task, 500, 100); - downNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/downButtonPressed.png"))); + downNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/downButtonPressed.png"))); }//GEN-LAST:event_downNavigationButtonMousePressed /** - * + * * @param evt Enables to zoom in the model when plus navigation button is pressed */ private void plusNavigationButtonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_plusNavigationButtonMousePressed @@ -422,13 +503,13 @@ public class Canvas extends javax.swing.JPanel { } }; timer.schedule(task, 500, 100); - plusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/plusPressed.png"))); + plusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/plusPressed.png"))); }//GEN-LAST:event_plusNavigationButtonMousePressed - - /** - * - * @param evt Enables to zoom out the model when minus navigation button is pressed - */ + + /** + * + * @param evt Enables to zoom out the model when minus navigation button is pressed + */ private void minusNavigationButtonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_minusNavigationButtonMousePressed timer = new Timer(); startClickTime = System.currentTimeMillis(); @@ -439,11 +520,11 @@ public class Canvas extends javax.swing.JPanel { } }; timer.schedule(task, 500, 100); - minusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/minusPressed.png"))); + minusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/minusPressed.png"))); }//GEN-LAST:event_minusNavigationButtonMousePressed /** - * + * * @param evt Stops rotating left */ private void leftNavigationButtonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_leftNavigationButtonMouseReleased @@ -452,11 +533,11 @@ public class Canvas extends javax.swing.JPanel { listener.rotateLeft(22.5); } startClickTime = 0; - leftNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/leftButton.png"))); + leftNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/leftButton.png"))); }//GEN-LAST:event_leftNavigationButtonMouseReleased /** - * + * * @param evt Stops rotating up */ private void upNavigationButtonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_upNavigationButtonMouseReleased @@ -465,11 +546,11 @@ public class Canvas extends javax.swing.JPanel { listener.rotateUp(22.5); } startClickTime = 0; - upNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/upButton.png"))); + upNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/upButton.png"))); }//GEN-LAST:event_upNavigationButtonMouseReleased /** - * + * * @param evt Stops rotating down */ private void downNavigationButtonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_downNavigationButtonMouseReleased @@ -478,12 +559,12 @@ public class Canvas extends javax.swing.JPanel { listener.rotateDown(22.5); } startClickTime = 0; - downNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/downButton.png"))); + downNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/downButton.png"))); }//GEN-LAST:event_downNavigationButtonMouseReleased /** - * - * @param evt Stops zooming in + * + * @param evt Stops zooming in */ private void plusNavigationButtonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_plusNavigationButtonMouseReleased timer.cancel(); @@ -491,11 +572,11 @@ public class Canvas extends javax.swing.JPanel { listener.zoomIn(30); } startClickTime = 0; - plusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/plus.png"))); + plusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/plus.png"))); }//GEN-LAST:event_plusNavigationButtonMouseReleased /** - * + * * @param evt Stops zooming out */ private void minusNavigationButtonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_minusNavigationButtonMouseReleased @@ -504,19 +585,19 @@ public class Canvas extends javax.swing.JPanel { listener.zoomOut(30); } startClickTime = 0; - minusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/minus.png"))); + minusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/minus.png"))); }//GEN-LAST:event_minusNavigationButtonMouseReleased /** - * + * * @param evt Laoding the .obj file when button pressed */ private void loadModelButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loadModelButtonMouseClicked - loadModel(); + loadModel(); }//GEN-LAST:event_loadModelButtonMouseClicked /** - * + * * @param evt Enables to zoom in and out the model by mouse wheeling */ private void jPanel1MouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_jPanel1MouseWheelMoved @@ -528,23 +609,23 @@ public class Canvas extends javax.swing.JPanel { }//GEN-LAST:event_jPanel1MouseWheelMoved /** - * - * @param evt Design is reacting to mouse movement + * + * @param evt Design is reacting to mouse movement */ private void loadModelButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loadModelButtonMouseMoved - loadModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/loadCanvaClicked.png"))); + loadModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/loadCanvaClicked.png"))); }//GEN-LAST:event_loadModelButtonMouseMoved /** - * - * @param evt Design is reacting to mouse movement + * + * @param evt Design is reacting to mouse movement */ private void loadModelButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loadModelButtonMouseExited - loadModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/loadCanva.png"))); + loadModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/loadCanva.png"))); }//GEN-LAST:event_loadModelButtonMouseExited /** - * + * * @param evt Enables to rotate down the model when down navigation button is pressed */ private void rightNavigationButton1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_rightNavigationButton1MousePressed @@ -557,11 +638,11 @@ public class Canvas extends javax.swing.JPanel { } }; timer.schedule(task, 500, 100); - rightNavigationButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/rightButtonPressed.png"))); + rightNavigationButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/rightButtonPressed.png"))); }//GEN-LAST:event_rightNavigationButton1MousePressed /** - * + * * @param evt Stops rotating right */ private void rightNavigationButton1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_rightNavigationButton1MouseReleased @@ -570,11 +651,11 @@ public class Canvas extends javax.swing.JPanel { listener.rotateRight(22.5); } startClickTime = 0; - rightNavigationButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/rightButton.png"))); + rightNavigationButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/rightButton.png"))); }//GEN-LAST:event_rightNavigationButton1MouseReleased /** - * + * * @param evt Position of model on glCanvas is set to starting position */ private void resetButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_resetButtonMouseClicked @@ -582,38 +663,44 @@ public class Canvas extends javax.swing.JPanel { }//GEN-LAST:event_resetButtonMouseClicked /** - * - * @param evt Design is reacting to mouse movement + * + * @param evt Design is reacting to mouse movement */ private void resetButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_resetButtonMouseMoved - resetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/resetButtonPressed.png"))); + resetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/resetButtonPressed.png"))); resetButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); }//GEN-LAST:event_resetButtonMouseMoved /** - * - * @param evt Design is reacting to mouse movement + * + * @param evt Design is reacting to mouse movement */ private void resetButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_resetButtonMouseExited - resetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/resetButton.png"))); + resetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/resetButton.png"))); }//GEN-LAST:event_resetButtonMouseExited /** - * - * @param drawWire Decides if model is displayed as wife-frame + * + * @param evt Changes backround of the canvas into white color */ - public void setDrawWired(boolean drawWire) { - drawWireModel = drawWire; - } + private void whiteBackroundButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_whiteBackroundButtonMouseClicked + listener.setWhiteBackround(true); + whiteBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/whiteBackroundCanvasPressed.png"))); + blackBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/blackBackroundCanvas.png"))); + }//GEN-LAST:event_whiteBackroundButtonMouseClicked + /** - * - * @return Returns if model is displayed as wife-frame + * + * @param evt Changes backround of the canvas into dark color */ - public boolean getDrawWired(){ - return drawWireModel; - } + private void blackBackroundButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_blackBackroundButtonMouseClicked + listener.setWhiteBackround(false); + whiteBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/whiteBackroundCanvas.png"))); + blackBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/blackBackroundCanvasPressed.png"))); + }//GEN-LAST:event_blackBackroundButtonMouseClicked // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel blackBackroundButton; private javax.swing.JButton downNavigationButton; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; @@ -625,5 +712,6 @@ public class Canvas extends javax.swing.JPanel { private javax.swing.JLabel resetButton; private javax.swing.JButton rightNavigationButton1; private javax.swing.JButton upNavigationButton; + private javax.swing.JLabel whiteBackroundButton; // End of variables declaration//GEN-END:variables -} +} \ No newline at end of file diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/GeneralGLEventListener.java b/GUI/src/main/java/cz/fidentis/analyst/gui/GeneralGLEventListener.java index 356e67a94a8aec5dc19fd26dda47c580083a3f66..e115177da6f5eb31e3fbcd47e61265b7f9cdd835 100644 --- a/GUI/src/main/java/cz/fidentis/analyst/gui/GeneralGLEventListener.java +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/GeneralGLEventListener.java @@ -2,7 +2,6 @@ package cz.fidentis.analyst.gui; import cz.fidentis.analyst.mesh.core.MeshFacet; import cz.fidentis.analyst.mesh.core.MeshModel; -import java.util.ArrayList; import javax.media.opengl.GL; import static javax.media.opengl.GL.GL_DEPTH_TEST; import static javax.media.opengl.GL.GL_FRONT_AND_BACK; @@ -22,37 +21,35 @@ import javax.vecmath.Vector3f; * * @author Natalia Bebjakova */ -public class GeneralGLEventListener implements GLEventListener { +public class GeneralGLEventListener implements GLEventListener { /** - * Color behind the model is black + * MeshModel that is displayed */ - protected static float[] backgroundColor = {0.8f, 0.8f, 0.8f, 0.0f}; + private MeshModel model = new MeshModel(); /** - * array of models that are displayed (just one so far) + * GLCanvas which listener belongs to */ - private ArrayList<MeshModel> models = new ArrayList<>(); + protected Canvas glCanvas; /** - * GLCanvas which listener belongs to - */ - protected Canvas glCanvas; + * GLU object. + */ + protected GLU glu; /** - * GLU object. + * Usage of openGL version 2 */ - protected GLU glu; protected GL2 gl; - /** * The last viewport. */ protected int[] viewport = new int[4]; - /** + /** * The last model matrix. */ protected float[] modelViewMatrix = new float[16]; /** * The last projection matrix. */ - protected float[] projectionMatrix = new float[16]; + protected float[] projectionMatrix = new float[16]; /** * The X coordinate of the last known mouse position during the scene rotation. */ @@ -61,7 +58,7 @@ public class GeneralGLEventListener implements GLEventListener { * The Y coordinate of the last know mouse position during the scene rotation. */ int mouseY = 0; - + protected Vector3f defaultPosition = new Vector3f(0, 0, 300); protected Vector3f currentPosition = new Vector3f(0, 0, 300); @@ -76,15 +73,75 @@ public class GeneralGLEventListener implements GLEventListener { protected double zUpPosition = 0; protected double xUpPosition = 0; protected double yUpPosition = 1; - + /** * Decides if model is diplayed as wire-frame - */ + */ protected boolean wireModel = false; /** * Decides if model is diplayed with textures */ protected boolean drawTextures = false; + /** + * Decides if the backround will be white + */ + protected boolean whiteBackround = false; + + /** + * + * @return is backround white or not + */ + public boolean isWhiteBackround() { + return whiteBackround; + } + + /** + * + * @return Matrix for model view + */ + public float[] getModelViewMatrix() { + return modelViewMatrix; + } + + /** + * + * @return Matrix for projection + */ + public float[] getProjectionMatrix() { + return projectionMatrix; + } + + /** + * + * @return GlCanvas for displaying + */ + public Canvas getGlCanvas() { + return glCanvas; + } + + /** + * + * @param drawWire Decides if model is displayed as wire-frame + */ + public void setWireMode(boolean drawWire) { + wireModel = drawWire; + } + + /** + * + * @param drawTextures Decides if model is displayed with textures + */ + public void setDrawTextures(boolean drawTextures) { + this.drawTextures = drawTextures; + } + + /** + * + * @param whiteBackround Is backround white or not + */ + public void setWhiteBackround(boolean whiteBackround) { + this.whiteBackround = whiteBackround; + } /** * Creates new EventListener @@ -93,28 +150,46 @@ public class GeneralGLEventListener implements GLEventListener { public GeneralGLEventListener(Canvas canvas) { this.glCanvas = canvas; } + + /** + * + * @param model Set model to be displayed + */ + public void setModel(MeshModel model) { + this.model = model; + } + + /** + * + * @return Returns displayed model + */ + public MeshModel getModel() { + return model; + } + + /** * Invoked when main frame is created * @param glad Glad object */ @Override public void init(GLAutoDrawable glad) { - + this.gl = (GL2) glad.getGL(); glu = new GLU(); - + gl.setSwapInterval(1); gl.glEnable(GL2.GL_LIGHTING); gl.glEnable(GL2.GL_LIGHT0); gl.glEnable(GL2.GL_DEPTH_TEST); gl.glClearColor(0,0,0,0); // background for GLCanvas gl.glClear(GL2.GL_COLOR_BUFFER_BIT); - + gl.glShadeModel(GL2.GL_SMOOTH); // use smooth shading gl.glDepthFunc(GL2.GL_LESS); gl.glDepthRange(0.0, 1.0); - gl.glEnable(GL_DEPTH_TEST); + gl.glEnable(GL_DEPTH_TEST); gl.glEnable(GL2.GL_NORMALIZE); gl.glDisable(GL2.GL_CULL_FACE); @@ -127,8 +202,7 @@ public class GeneralGLEventListener implements GLEventListener { @Override public void dispose(GLAutoDrawable glad) { } - - + /** * Invoked every frame. * @param glad Glad object @@ -136,7 +210,12 @@ public class GeneralGLEventListener implements GLEventListener { @Override public void display(GLAutoDrawable glad) { wireModel = glCanvas.getDrawWired(); // is wire-frame or not - gl.glClearColor(0,0,0,0); // background for GLCanvas + if (whiteBackround) { + gl.glClearColor(0.9f,0.9f,0.9f,0); + } else { + gl.glClearColor(0.25f,0.25f,0.25f,0); + } + // background for GLCanvas gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); gl.glLoadIdentity(); @@ -147,65 +226,52 @@ public class GeneralGLEventListener implements GLEventListener { gl.glGetIntegerv(GL_VIEWPORT, viewport, 0); gl.glGetFloatv(GL_MODELVIEW_MATRIX, modelViewMatrix, 0); gl.glGetFloatv(GL_PROJECTION_MATRIX, projectionMatrix, 0); - - //if there is any model, draw - if (models.get(0) != null) { + + //if there is any model, draw + if (model != null) { if (wireModel) { - gl.glPolygonMode( GL_FRONT_AND_BACK, GL_LINE ); - drawWithoutTextures(models.get(0)); + gl.glPolygonMode( GL_FRONT_AND_BACK, GL_LINE ); //drawn as wire-frame + drawWithoutTextures(model); } else { - gl.glPolygonMode( GL_FRONT_AND_BACK, GL_FILL); - drawWithoutTextures(models.get(0)); + gl.glPolygonMode( GL_FRONT_AND_BACK, GL_FILL); // drawn as full traingles + drawWithoutTextures(model); } - } - + } gl.glPopMatrix(); gl.glFlush(); - - - /*if (drawTextures) { - gl.glCallList(modelDL); - } else { - gl.glCallList(modelDLwithoutTxt); - }*/ - } + + /** + * Loops through the facets and render each of them + * @param model model of the face + */ public void drawWithoutTextures(MeshModel model) { for (int i = 0; i < model.getFacets().size(); i++) { renderFacet(model.getFacets().get(i)); } } - private void renderFacet(MeshFacet facet) { + /** + * Loops through the facet and render all the vertices as they are stored in corner table + * @param facet facet of model + */ + public void renderFacet(MeshFacet facet) { gl.glBegin(GL2.GL_TRIANGLES); //vertices are rendered as triangles - // get the normal and tex coords indicies for face i - for (int v = 0; v < facet.getCornerTable().getSize(); v++) { - Vector3d norm = facet.getVertices().get(facet.getCornerTable().getRow(v).getVertexIndex()).getNormal(); // render the normals - gl.glNormal3d(norm.x, norm.y, norm.z); - - Vector3d vert = facet.getVertices().get(facet.getCornerTable().getRow(v).getVertexIndex()).getPosition(); // render the vertices + // get the normal and tex coords indicies for face i + for (int v = 0; v < facet.getCornerTable().getSize(); v++) { + // render the normals + Vector3d norm = facet.getVertices().get(facet.getCornerTable().getRow(v).getVertexIndex()).getNormal(); + if(norm != null) { + gl.glNormal3d(norm.x, norm.y, norm.z); + } + // render the vertices + Vector3d vert = facet.getVertices().get(facet.getCornerTable().getRow(v).getVertexIndex()).getPosition(); gl.glVertex3d(vert.x, vert.y, vert.z); } gl.glEnd(); } - /** - * Prepared for future textures - */ - /*public void reloadTextures() { - for (int i = 0; i < models.size(); i++) { - if (models.get(i) != null) { - if (models.get(i).getMatrials() != null) { - for (int j = 0; j < models.get(i).getMatrials().getMatrials().size(); j++) { - models.get(i).getMatrials().reloadTextures(gl); - } - } - } - } - - }*/ - /** * * @param glad Glad object @@ -234,37 +300,6 @@ public class GeneralGLEventListener implements GLEventListener { gl.glTranslatef(0.0f, 0.0f, -40.0f); } - /** - * - * @param model Set model to be displayed - */ - public void setModels(MeshModel model) { - models.add(0, model); - } - - /** - * - * @param models Set models to be displayed - */ - public void setModels(ArrayList<MeshModel> models) { - this.models = models; - } - - /** - * - * @return Returns displayed model - */ - public MeshModel getModel() { - return models.get(0); - } - - /** - * Removes all models - */ - public void removeModel() { - models.clear(); - } - /** * * @param x New x position @@ -279,8 +314,7 @@ public class GeneralGLEventListener implements GLEventListener { xCameraPosition = defaultPosition.x; yCameraPosition = defaultPosition.y; - } - + } /** * @@ -290,7 +324,6 @@ public class GeneralGLEventListener implements GLEventListener { xCameraPosition = position.x; yCameraPosition = position.y; zCameraPosition = position.z; - } /** @@ -298,9 +331,7 @@ public class GeneralGLEventListener implements GLEventListener { * @param degree degree of rotation */ public void rotateUp(double degree) { - rotate(-degree, 0); - } /** @@ -316,9 +347,7 @@ public class GeneralGLEventListener implements GLEventListener { * @param degree degree of rotation */ public void rotateLeft(double degree) { - rotate(0, degree); - } /** @@ -327,24 +356,33 @@ public class GeneralGLEventListener implements GLEventListener { */ public void rotateRight(double degree) { rotate(0, -degree); - } + /** + * + * @return X axis + */ private Vector3f getXaxis() { - Vector3f xAxis = new Vector3f((float) ((yCameraPosition - yCenter) * zUpPosition - (zCameraPosition - zCenter) * yUpPosition), + Vector3f xAxis = new Vector3f( + (float) ((yCameraPosition - yCenter) *zUpPosition - (zCameraPosition - zCenter) * yUpPosition), (float) ((zCameraPosition - zCenter) * xUpPosition - (xCameraPosition - xCenter) * zUpPosition), (float) ((xCameraPosition - xCenter) * yUpPosition - xUpPosition * (yCameraPosition - yCenter))); - - float length = (float) Math.sqrt(xAxis.x * xAxis.x + xAxis.y * xAxis.y + xAxis.z * xAxis.z); - xAxis.set(xAxis.x / length, xAxis.y / length, xAxis.z / length ); + + float length = (float) Math.sqrt(xAxis.x * xAxis.x + + xAxis.y * xAxis.y + xAxis.z * xAxis.z); + xAxis.set(xAxis.x / length, xAxis.y / length, xAxis.z / length); return xAxis; } + /** + * + * @return Y axis + */ private Vector3f getYaxis() { Vector3f yAxis = new Vector3f((float) xUpPosition, (float) yUpPosition, (float) zUpPosition); - - float length = (float) Math.sqrt(yAxis.x * yAxis.x + yAxis.y * yAxis.y + yAxis.z * yAxis.z); - yAxis.set(yAxis.x / length, yAxis.y / length, yAxis.z / length ); + float length = (float) Math.sqrt(yAxis.x * yAxis.x + + yAxis.y * yAxis.y + yAxis.z * yAxis.z); + yAxis.set((yAxis.x / length), (yAxis.y / length), (yAxis.z / length)); return yAxis; } @@ -360,7 +398,8 @@ public class GeneralGLEventListener implements GLEventListener { Vector3f xAxis = getXaxis(); Vector3f yAxis = getYaxis(); - Vector3f point = new Vector3f((float) xCameraPosition, (float) yCameraPosition, (float) zCameraPosition); + Vector3f point = new Vector3f((float) xCameraPosition, + (float) yCameraPosition, (float) zCameraPosition); Vector3f camera = rotateAroundAxe(point, xAxis, Math.toRadians(xAngle)); camera = rotateAroundAxe(camera, yAxis, Math.toRadians(yAngle)); @@ -377,18 +416,24 @@ public class GeneralGLEventListener implements GLEventListener { setNewCameraPosition(camera); } + /** + * + * @param xShift xShift + * @param yShift yShift + */ public void move(double xShift, double yShift) { Vector3f xAxis = getXaxis(); Vector3f yAxis = getYaxis(); - Vector3f shift = new Vector3f((float) (xAxis.x * xShift + yAxis.x * yShift), (float) (xAxis.y * xShift + yAxis.y * yShift), (float) (xAxis.z * xShift + yAxis.z * yShift)); - Vector3f camera = new Vector3f((float) xCameraPosition + shift.x, (float) yCameraPosition + shift.y, (float) zCameraPosition + shift.z); + Vector3f shift = new Vector3f((float) (xAxis.x * xShift + yAxis.x * yShift), + (float) (xAxis.y * xShift + yAxis.y * yShift), (float) (xAxis.z * xShift + yAxis.z * yShift)); + Vector3f camera = new Vector3f((float) xCameraPosition + shift.x, (float) yCameraPosition + shift.y, + (float) zCameraPosition + shift.z); xCenter += shift.x; yCenter += shift.y; zCenter += shift.z; setNewCameraPosition(camera); - } /** @@ -406,21 +451,19 @@ public class GeneralGLEventListener implements GLEventListener { + (u.x * u.z * (1 - Math.cos(angle)) + u.y * Math.sin(angle)) * point.z); float y = (float) ((u.x * u.y * (1 - Math.cos(angle)) + u.z * Math.sin(angle)) * point.x + (Math.cos(angle) + u.y * u.y * (1 - Math.cos(angle))) * point.y - + (u.y * u.z* (1 - Math.cos(angle)) - u.x * Math.sin(angle)) * point.z); + + (u.y * u.z * (1 - Math.cos(angle)) - u.x * Math.sin(angle)) * point.z); float z = (float) ((u.x * u.z * (1 - Math.cos(angle)) - u.y * Math.sin(angle)) * point.x - + (u.z * u.z * (1 - Math.cos(angle)) + u.x * Math.sin(angle)) * point.y + + (u.y * u.z * (1 - Math.cos(angle)) + u.x * Math.sin(angle)) * point.y + (Math.cos(angle) + u.z * u.z * (1 - Math.cos(angle))) * point.z); p = new Vector3f(x, y, z); return p; - } /** * Sets model to the starting position */ public void rotationAndSizeRestart() { - xUpPosition = 0; yUpPosition = 1; zUpPosition = 0; @@ -446,7 +489,6 @@ public class GeneralGLEventListener implements GLEventListener { yCameraPosition = yCenter + ((sqrt - distance) * y / sqrt); zCameraPosition = zCenter + ((sqrt - distance) * z / sqrt); } - } /** @@ -462,44 +504,8 @@ public class GeneralGLEventListener implements GLEventListener { if (sqrt == 0) { sqrt = 1; } - xCameraPosition = xCenter + ((sqrt + distance) * x / sqrt); yCameraPosition = yCenter + ((sqrt + distance) * y / sqrt); zCameraPosition = zCenter + ((sqrt + distance) * z / sqrt); } - - /** - * - * @return Returns backround color of the listener - */ - public static float[] getBackgroundColor() { - return backgroundColor; - } - - /** - * - * @param backgroundColor backround color of the listener - */ - public static void setBackgroundColor(float[] backgroundColor) { - GeneralGLEventListener.backgroundColor = backgroundColor; - } - - /** - * - * @param drawWire Decides if model is displayed as wire-frame - */ - public void setWireMode(boolean drawWire) { - wireModel = drawWire; - } - - - /** - * - * @param drawTextures Decides if model is displayed with textures - */ - public void setDrawTextures(boolean drawTextures) { - this.drawTextures = drawTextures; - } - -} - +} \ No newline at end of file diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/Interface.java b/GUI/src/main/java/cz/fidentis/analyst/gui/Interface.java deleted file mode 100644 index 2f5f4c4fbd750f971d66d439acadb38fc128690e..0000000000000000000000000000000000000000 --- a/GUI/src/main/java/cz/fidentis/analyst/gui/Interface.java +++ /dev/null @@ -1,1367 +0,0 @@ -package cz.fidentis.analyst.gui; - -import java.awt.Color; -import java.awt.Cursor; -import javax.swing.BorderFactory; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.UIManager; - -/** - * - * @author Natalia Bebjakova - * - * Main window of the applicaion - */ - -public class Interface extends javax.swing.JFrame { - boolean pressedNewProject = false; - boolean maximizePressed = false; - boolean wiredModelClicked = false; - private JPanel actualPanel; - - public static JFrame frameMain; //main frame of the application - int xMouse; - int yMouse; - - /** - * Creates new form Interface - */ - public Interface() { - //this.setUndecorated(true); - initComponents(); - topPanel.setVisible(false); - setCursorOnComponents(); - actualPanel = startingPanel; - } - /** - * Sets hand cursor when moving mouse on components - */ - private void setCursorOnComponents() { - newProject.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - texture.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - close.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - maximize.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - JLabel11.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - jLabel4.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - symetryMain.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - reloadModelButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - wiredModelButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - homeButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - viewerButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - reloadModelButton1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - } - - /** - * Enables to switch between panels - * @param panel New panel that will be visible - */ - private void switchPanelOnMainPanel(JPanel panel) { - actualPanel = panel; - jPanel2.removeAll(); - jPanel2.repaint(); - jPanel2.revalidate(); - jPanel2.add(panel); - jPanel2.repaint(); - jPanel2.revalidate(); - panel.add(jPanel1); - jPanel1.setVisible(true); - /*if(maximizePressed) { - frameMain.setExtendedState(this.getExtendedState() | JFrame.MAXIMIZED_BOTH); - }*/ - } - - /** - * Changes backround of labels to darker green color - * @param jl label of which backround changes - */ - public void setLabelBackround(JLabel jl) { - jl.setBackground(new Color(11,56,49)); - } - public void resetLabelBackround(JLabel jl) { - jl.setBackground(new Color(20,114,105)); - } - - /** - * Changes backround of panel to brighter color and adds border - * @param jp panel of which backround changes - */ - public void setPanelBackround(JPanel jp) { - jp.setBackground(new Color(11,56,49)); - jp.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 4, Color.WHITE)); - } - public void resetPanelBackround(JPanel jp) { - jp.setBackground(new Color(20,114,105)); - jp.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, Color.WHITE)); - } - - /** - * Changes backround of panel to darker color and adds border - * @param jp panel of which backround changes - */ - public void setPanelBackroundMain(JPanel jp) { - jp.setBackground(new Color(106,198,187)); - jp.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 4, Color.WHITE)); - } - public void resetPanelBackroundMain(JPanel jp) { - jp.setBackground(new Color(0,174,163)); - jp.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, Color.WHITE)); - } - - /** - * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. - */ - - - @SuppressWarnings("unchecked") - // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents - private void initComponents() { - - topPanel = new javax.swing.JPanel(); - compareTwo = new javax.swing.JPanel(); - jLabel1 = new javax.swing.JLabel(); - compareDB = new javax.swing.JPanel(); - jLabel2 = new javax.swing.JLabel(); - batchProcessing = new javax.swing.JPanel(); - jLabel3 = new javax.swing.JLabel(); - symetryEstimator = new javax.swing.JPanel(); - jLabel4 = new javax.swing.JLabel(); - jPanel1 = new javax.swing.JPanel(); - newProject = new javax.swing.JLabel(); - texture = new javax.swing.JLabel(); - close = new javax.swing.JLabel(); - maximize = new javax.swing.JLabel(); - wiredModelButton = new javax.swing.JLabel(); - homeButton = new javax.swing.JLabel(); - jPanel2 = new javax.swing.JPanel(); - startingPanel = new javax.swing.JPanel(); - javax.swing.JLabel logo = new javax.swing.JLabel(); - jPanel3 = new javax.swing.JPanel(); - compareTwoMain = new javax.swing.JPanel(); - JLabel8 = new javax.swing.JLabel(); - compareTwoMain1 = new javax.swing.JPanel(); - JLabel9 = new javax.swing.JLabel(); - batchMain = new javax.swing.JPanel(); - JLabel10 = new javax.swing.JLabel(); - symetryMain = new javax.swing.JPanel(); - JLabel11 = new javax.swing.JLabel(); - jLabel6 = new javax.swing.JLabel(); - viewerButton = new javax.swing.JLabel(); - symetryPanel = new javax.swing.JPanel(); - viewerPanel = new javax.swing.JPanel(); - canva1 = new cz.fidentis.analyst.gui.Canvas(); - reloadModelButton = new javax.swing.JLabel(); - symetrySpecificationPanel = new javax.swing.JPanel(); - curavatureSlider = new javax.swing.JSlider(); - angleCosineSlider = new javax.swing.JSlider(); - minCurvatio = new javax.swing.JLabel(); - minCurvatio2 = new javax.swing.JLabel(); - normalAngleSlider = new javax.swing.JSlider(); - minCurvatio3 = new javax.swing.JLabel(); - significantPointSlider = new javax.swing.JSlider(); - minCurvatio4 = new javax.swing.JLabel(); - relativeDistanceSlider = new javax.swing.JSlider(); - significantPointLabel = new javax.swing.JLabel(); - symetryButton = new javax.swing.JLabel(); - minCurvatio7 = new javax.swing.JLabel(); - averagingCheckBox = new javax.swing.JCheckBox(); - modelViewPanel = new javax.swing.JPanel(); - reloadModelButton1 = new javax.swing.JLabel(); - jPanel4 = new javax.swing.JPanel(); - canva2 = new cz.fidentis.analyst.gui.Canvas(); - - setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - setAlwaysOnTop(true); - setAutoRequestFocus(false); - setBackground(new java.awt.Color(20, 114, 105)); - setLocationByPlatform(true); - - topPanel.setBackground(new java.awt.Color(20, 114, 105)); - - compareTwo.setBackground(new java.awt.Color(20, 114, 105)); - compareTwo.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - compareTwoMouseMoved(evt); - } - }); - compareTwo.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseExited(java.awt.event.MouseEvent evt) { - compareTwoMouseExited(evt); - } - }); - - jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/compareTwo.png"))); // NOI18N - - javax.swing.GroupLayout compareTwoLayout = new javax.swing.GroupLayout(compareTwo); - compareTwo.setLayout(compareTwoLayout); - compareTwoLayout.setHorizontalGroup( - compareTwoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, compareTwoLayout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE) - .addContainerGap()) - ); - compareTwoLayout.setVerticalGroup( - compareTwoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, compareTwoLayout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap()) - ); - - compareDB.setBackground(new java.awt.Color(20, 114, 105)); - compareDB.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - compareDBMouseMoved(evt); - } - }); - compareDB.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseExited(java.awt.event.MouseEvent evt) { - compareDBMouseExited(evt); - } - }); - - jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/copareWithDatabase.png"))); // NOI18N - - javax.swing.GroupLayout compareDBLayout = new javax.swing.GroupLayout(compareDB); - compareDB.setLayout(compareDBLayout); - compareDBLayout.setHorizontalGroup( - compareDBLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(compareDBLayout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)) - ); - compareDBLayout.setVerticalGroup( - compareDBLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, compareDBLayout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jLabel2) - .addContainerGap()) - ); - - batchProcessing.setBackground(new java.awt.Color(20, 114, 105)); - batchProcessing.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - batchProcessingMouseMoved(evt); - } - }); - batchProcessing.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseExited(java.awt.event.MouseEvent evt) { - batchProcessingMouseExited(evt); - } - }); - - jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/batchProcessing.png"))); // NOI18N - - javax.swing.GroupLayout batchProcessingLayout = new javax.swing.GroupLayout(batchProcessing); - batchProcessing.setLayout(batchProcessingLayout); - batchProcessingLayout.setHorizontalGroup( - batchProcessingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(batchProcessingLayout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addContainerGap()) - ); - batchProcessingLayout.setVerticalGroup( - batchProcessingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, batchProcessingLayout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jLabel3) - .addContainerGap()) - ); - - symetryEstimator.setBackground(new java.awt.Color(20, 114, 105)); - symetryEstimator.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - symetryEstimatorMouseMoved(evt); - } - }); - symetryEstimator.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - symetryEstimatorMouseClicked(evt); - } - public void mouseExited(java.awt.event.MouseEvent evt) { - symetryEstimatorMouseExited(evt); - } - }); - - jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/symetry.png"))); // NOI18N - jLabel4.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - maximizeMouseMoved1(evt); - } - }); - jLabel4.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - jLabel4MouseClicked(evt); - } - }); - - javax.swing.GroupLayout symetryEstimatorLayout = new javax.swing.GroupLayout(symetryEstimator); - symetryEstimator.setLayout(symetryEstimatorLayout); - symetryEstimatorLayout.setHorizontalGroup( - symetryEstimatorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(symetryEstimatorLayout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - symetryEstimatorLayout.setVerticalGroup( - symetryEstimatorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetryEstimatorLayout.createSequentialGroup() - .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addContainerGap()) - ); - - javax.swing.GroupLayout topPanelLayout = new javax.swing.GroupLayout(topPanel); - topPanel.setLayout(topPanelLayout); - topPanelLayout.setHorizontalGroup( - topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(topPanelLayout.createSequentialGroup() - .addContainerGap(339, Short.MAX_VALUE) - .addComponent(compareTwo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(105, 105, 105) - .addComponent(compareDB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(86, 86, 86) - .addComponent(batchProcessing, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(97, 97, 97) - .addComponent(symetryEstimator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(338, Short.MAX_VALUE)) - ); - topPanelLayout.setVerticalGroup( - topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, topPanelLayout.createSequentialGroup() - .addContainerGap(94, Short.MAX_VALUE) - .addGroup(topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(symetryEstimator, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(compareDB, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(compareTwo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(batchProcessing, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) - ); - - jPanel1.setBackground(new java.awt.Color(20, 114, 105)); - jPanel1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseDragged(java.awt.event.MouseEvent evt) { - jPanel1MouseDragged(evt); - } - }); - jPanel1.addMouseListener(new java.awt.event.MouseAdapter() { - public void mousePressed(java.awt.event.MouseEvent evt) { - jPanel1MousePressed(evt); - } - }); - - newProject.setBackground(new java.awt.Color(20, 114, 105)); - newProject.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 18)); // NOI18N - newProject.setForeground(new java.awt.Color(255, 255, 255)); - newProject.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/new_project.png"))); // NOI18N - newProject.setOpaque(true); - newProject.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - newProjectMouseMoved(evt); - } - }); - newProject.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseExited(java.awt.event.MouseEvent evt) { - newProjectMouseExited(evt); - } - public void mousePressed(java.awt.event.MouseEvent evt) { - newProjectMousePressed(evt); - } - }); - - texture.setBackground(new java.awt.Color(20, 114, 105)); - texture.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/texture2.png"))); // NOI18N - texture.setOpaque(true); - texture.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - textureMouseMoved(evt); - } - }); - texture.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseExited(java.awt.event.MouseEvent evt) { - textureMouseExited(evt); - } - }); - - close.setBackground(new java.awt.Color(20, 114, 105)); - close.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/close.png"))); // NOI18N - close.setOpaque(true); - close.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - closeMouseMoved(evt); - } - }); - close.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseExited(java.awt.event.MouseEvent evt) { - closeMouseExited(evt); - } - public void mousePressed(java.awt.event.MouseEvent evt) { - closeMousePressed(evt); - } - }); - - maximize.setBackground(new java.awt.Color(20, 114, 105)); - maximize.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/maximize.png"))); // NOI18N - maximize.setOpaque(true); - maximize.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - maximizeMouseMoved(evt); - } - }); - maximize.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - maximizeMouseClicked(evt); - } - public void mouseExited(java.awt.event.MouseEvent evt) { - maximizeMouseExited(evt); - } - }); - - wiredModelButton.setBackground(new java.awt.Color(20, 114, 105)); - wiredModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/wireframe.png"))); // NOI18N - wiredModelButton.setOpaque(true); - wiredModelButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - wiredModelButtonMouseMoved(evt); - } - }); - wiredModelButton.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - wiredModelButtonMouseClicked(evt); - } - public void mouseExited(java.awt.event.MouseEvent evt) { - wiredModelButtonMouseExited(evt); - } - }); - - homeButton.setBackground(new java.awt.Color(20, 114, 105)); - homeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/home.png"))); // NOI18N - homeButton.setOpaque(true); - homeButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - homeButtonMouseMoved(evt); - } - }); - homeButton.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - homeButtonMouseClicked(evt); - } - public void mouseExited(java.awt.event.MouseEvent evt) { - homeButtonMouseExited(evt); - } - }); - - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addComponent(homeButton) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(newProject, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(texture) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(wiredModelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(maximize) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(close) - .addContainerGap()) - ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(texture, javax.swing.GroupLayout.DEFAULT_SIZE, 77, Short.MAX_VALUE) - .addComponent(newProject, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(close, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(wiredModelButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(maximize, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) - .addComponent(homeButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - ); - - jPanel2.setLayout(new java.awt.CardLayout()); - - startingPanel.setBackground(new java.awt.Color(0, 174, 163)); - startingPanel.setToolTipText(""); - - logo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/logo3.png"))); // NOI18N - - jPanel3.setBackground(new java.awt.Color(0, 174, 163)); - jPanel3.setToolTipText(""); - - compareTwoMain.setBackground(new java.awt.Color(0, 174, 163)); - compareTwoMain.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - compareTwoMainMouseMoved(evt); - } - }); - compareTwoMain.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseExited(java.awt.event.MouseEvent evt) { - compareTwoMainMouseExited(evt); - } - }); - - JLabel8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/compareTwoGreen.png"))); // NOI18N - - javax.swing.GroupLayout compareTwoMainLayout = new javax.swing.GroupLayout(compareTwoMain); - compareTwoMain.setLayout(compareTwoMainLayout); - compareTwoMainLayout.setHorizontalGroup( - compareTwoMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(compareTwoMainLayout.createSequentialGroup() - .addGap(15, 15, 15) - .addComponent(JLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE) - .addContainerGap()) - ); - compareTwoMainLayout.setVerticalGroup( - compareTwoMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, compareTwoMainLayout.createSequentialGroup() - .addGap(0, 28, Short.MAX_VALUE) - .addComponent(JLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)) - ); - - compareTwoMain1.setBackground(new java.awt.Color(0, 174, 163)); - compareTwoMain1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - compareTwoMain1MouseMoved(evt); - } - }); - compareTwoMain1.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseExited(java.awt.event.MouseEvent evt) { - compareTwoMain1MouseExited(evt); - } - }); - - JLabel9.setBackground(new java.awt.Color(0, 174, 163)); - JLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/copareWithDatabaseGreen.png"))); // NOI18N - - javax.swing.GroupLayout compareTwoMain1Layout = new javax.swing.GroupLayout(compareTwoMain1); - compareTwoMain1.setLayout(compareTwoMain1Layout); - compareTwoMain1Layout.setHorizontalGroup( - compareTwoMain1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, compareTwoMain1Layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(JLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap()) - ); - compareTwoMain1Layout.setVerticalGroup( - compareTwoMain1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, compareTwoMain1Layout.createSequentialGroup() - .addContainerGap() - .addComponent(JLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE)) - ); - - batchMain.setBackground(new java.awt.Color(0, 174, 163)); - batchMain.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - batchMainMouseMoved(evt); - } - }); - batchMain.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseExited(java.awt.event.MouseEvent evt) { - batchMainMouseExited(evt); - } - }); - - JLabel10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/batchProcessingGreen.png"))); // NOI18N - - javax.swing.GroupLayout batchMainLayout = new javax.swing.GroupLayout(batchMain); - batchMain.setLayout(batchMainLayout); - batchMainLayout.setHorizontalGroup( - batchMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, batchMainLayout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(JLabel10) - .addContainerGap()) - ); - batchMainLayout.setVerticalGroup( - batchMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, batchMainLayout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(JLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)) - ); - - symetryMain.setBackground(new java.awt.Color(0, 174, 163)); - symetryMain.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - symetryMainMouseMoved(evt); - } - }); - symetryMain.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseExited(java.awt.event.MouseEvent evt) { - symetryMainMouseExited(evt); - } - }); - - JLabel11.setBackground(new java.awt.Color(0, 174, 163)); - JLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/symetryGreen.png"))); // NOI18N - JLabel11.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - JLabel11MouseMoved(evt); - } - }); - JLabel11.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - JLabel11MouseClicked(evt); - } - public void mouseExited(java.awt.event.MouseEvent evt) { - JLabel11MouseExited(evt); - } - }); - - javax.swing.GroupLayout symetryMainLayout = new javax.swing.GroupLayout(symetryMain); - symetryMain.setLayout(symetryMainLayout); - symetryMainLayout.setHorizontalGroup( - symetryMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetryMainLayout.createSequentialGroup() - .addGap(0, 12, Short.MAX_VALUE) - .addComponent(JLabel11)) - ); - symetryMainLayout.setVerticalGroup( - symetryMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetryMainLayout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(JLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)) - ); - - jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/divide.png"))); // NOI18N - - viewerButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/modelView.png"))); // NOI18N - viewerButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - viewerButtonMouseMoved(evt); - } - }); - viewerButton.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - viewerButtonMouseClicked(evt); - } - public void mouseExited(java.awt.event.MouseEvent evt) { - viewerButtonMouseExited(evt); - } - }); - - javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); - jPanel3.setLayout(jPanel3Layout); - jPanel3Layout.setHorizontalGroup( - jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel3Layout.createSequentialGroup() - .addContainerGap(278, Short.MAX_VALUE) - .addComponent(viewerButton) - .addGap(227, 227, 227) - .addComponent(jLabel6) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel3Layout.createSequentialGroup() - .addGap(135, 135, 135) - .addComponent(compareTwoMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel3Layout.createSequentialGroup() - .addGap(130, 130, 130) - .addComponent(compareTwoMain1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGap(81, 81, 81) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(batchMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(jPanel3Layout.createSequentialGroup() - .addGap(12, 12, 12) - .addComponent(symetryMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGap(243, 243, 243)) - ); - jPanel3Layout.setVerticalGroup( - jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() - .addGap(27, 27, 27) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(jPanel3Layout.createSequentialGroup() - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(compareTwoMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(batchMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(symetryMain, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(compareTwoMain1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) - .addContainerGap()) - .addGroup(jPanel3Layout.createSequentialGroup() - .addGap(71, 71, 71) - .addComponent(viewerButton) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - - javax.swing.GroupLayout startingPanelLayout = new javax.swing.GroupLayout(startingPanel); - startingPanel.setLayout(startingPanelLayout); - startingPanelLayout.setHorizontalGroup( - startingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(startingPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addContainerGap()) - .addGroup(startingPanelLayout.createSequentialGroup() - .addGap(714, 714, 714) - .addComponent(logo, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - startingPanelLayout.setVerticalGroup( - startingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(startingPanelLayout.createSequentialGroup() - .addGap(198, 198, 198) - .addComponent(logo, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(135, 135, 135) - .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(200, 200, 200)) - ); - - jPanel2.add(startingPanel, "card3"); - - symetryPanel.setBackground(new java.awt.Color(0, 174, 163)); - - canva1.addMouseWheelListener(new java.awt.event.MouseWheelListener() { - public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) { - canva1MouseWheelMoved(evt); - } - }); - - javax.swing.GroupLayout viewerPanelLayout = new javax.swing.GroupLayout(viewerPanel); - viewerPanel.setLayout(viewerPanelLayout); - viewerPanelLayout.setHorizontalGroup( - viewerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(viewerPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(canva1, javax.swing.GroupLayout.DEFAULT_SIZE, 652, Short.MAX_VALUE) - .addContainerGap()) - ); - viewerPanelLayout.setVerticalGroup( - viewerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, viewerPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(canva1, javax.swing.GroupLayout.DEFAULT_SIZE, 858, Short.MAX_VALUE) - .addContainerGap()) - ); - - reloadModelButton.setBackground(new java.awt.Color(0, 174, 163)); - reloadModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/loadModel.png"))); // NOI18N - reloadModelButton.setOpaque(true); - reloadModelButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - reloadModelButtonMouseMoved(evt); - } - }); - reloadModelButton.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - reloadModelButtonMouseClicked(evt); - } - public void mouseExited(java.awt.event.MouseEvent evt) { - reloadModelButtonMouseExited(evt); - } - }); - - symetrySpecificationPanel.setBackground(new java.awt.Color(176, 230, 226)); - symetrySpecificationPanel.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - symetrySpecificationPanelMouseClicked(evt); - } - }); - - curavatureSlider.setBackground(new java.awt.Color(250, 250, 250)); - curavatureSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); - curavatureSlider.setOpaque(false); - - angleCosineSlider.setOpaque(false); - - minCurvatio.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 14)); // NOI18N - minCurvatio.setForeground(new java.awt.Color(20, 114, 105)); - minCurvatio.setText("Min. Curvature Ratio"); - - minCurvatio2.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 14)); // NOI18N - minCurvatio2.setForeground(new java.awt.Color(20, 114, 105)); - minCurvatio2.setText("Min. Angle Cosine"); - - normalAngleSlider.setOpaque(false); - - minCurvatio3.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 14)); // NOI18N - minCurvatio3.setForeground(new java.awt.Color(20, 114, 105)); - minCurvatio3.setText("Max. Relative Distance"); - - significantPointSlider.setOpaque(false); - - minCurvatio4.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 14)); // NOI18N - minCurvatio4.setForeground(new java.awt.Color(20, 114, 105)); - minCurvatio4.setText("Min. Normal Angle Cosine"); - - relativeDistanceSlider.setOpaque(false); - - significantPointLabel.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 14)); // NOI18N - significantPointLabel.setForeground(new java.awt.Color(20, 114, 105)); - significantPointLabel.setText("Significant Point Count"); - - symetryButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/symetryCount.png"))); // NOI18N - symetryButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - symetryButtonMouseMoved(evt); - } - }); - symetryButton.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseExited(java.awt.event.MouseEvent evt) { - symetryButtonMouseExited(evt); - } - }); - - minCurvatio7.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 14)); // NOI18N - minCurvatio7.setForeground(new java.awt.Color(20, 114, 105)); - minCurvatio7.setText("Averaging"); - - averagingCheckBox.setSelected(true); - averagingCheckBox.setOpaque(false); - - javax.swing.GroupLayout symetrySpecificationPanelLayout = new javax.swing.GroupLayout(symetrySpecificationPanel); - symetrySpecificationPanel.setLayout(symetrySpecificationPanelLayout); - symetrySpecificationPanelLayout.setHorizontalGroup( - symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetrySpecificationPanelLayout.createSequentialGroup() - .addContainerGap(80, Short.MAX_VALUE) - .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(minCurvatio) - .addComponent(minCurvatio2) - .addComponent(minCurvatio3) - .addComponent(minCurvatio4) - .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() - .addComponent(significantPointLabel) - .addGap(13, 13, 13)) - .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() - .addComponent(minCurvatio7) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(averagingCheckBox))) - .addGap(18, 18, 18) - .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(significantPointSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(normalAngleSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(angleCosineSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(curavatureSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(relativeDistanceSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(symetryButton, javax.swing.GroupLayout.Alignment.TRAILING)) - .addGap(133, 133, 133)) - ); - symetrySpecificationPanelLayout.setVerticalGroup( - symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() - .addGap(72, 72, 72) - .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(curavatureSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(minCurvatio, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(40, 40, 40) - .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(angleCosineSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(minCurvatio2, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(40, 40, 40) - .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(normalAngleSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(minCurvatio4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGap(38, 38, 38) - .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(minCurvatio3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(relativeDistanceSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGap(41, 41, 41) - .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() - .addComponent(significantPointLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 26, Short.MAX_VALUE) - .addGap(36, 36, 36)) - .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() - .addComponent(significantPointSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) - .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(symetryButton, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(averagingCheckBox) - .addComponent(minCurvatio7, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGap(102, 102, 102)) - ); - - javax.swing.GroupLayout symetryPanelLayout = new javax.swing.GroupLayout(symetryPanel); - symetryPanel.setLayout(symetryPanelLayout); - symetryPanelLayout.setHorizontalGroup( - symetryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(symetryPanelLayout.createSequentialGroup() - .addContainerGap(136, Short.MAX_VALUE) - .addComponent(viewerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 105, Short.MAX_VALUE) - .addGroup(symetryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(reloadModelButton) - .addComponent(symetrySpecificationPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(112, Short.MAX_VALUE)) - ); - symetryPanelLayout.setVerticalGroup( - symetryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetryPanelLayout.createSequentialGroup() - .addGap(118, 118, 118) - .addGroup(symetryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(symetryPanelLayout.createSequentialGroup() - .addComponent(symetrySpecificationPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 242, Short.MAX_VALUE) - .addComponent(reloadModelButton)) - .addComponent(viewerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGap(182, 182, 182)) - ); - - jPanel2.add(symetryPanel, "card3"); - - modelViewPanel.setBackground(new java.awt.Color(0, 174, 163)); - modelViewPanel.setToolTipText(""); - - reloadModelButton1.setBackground(new java.awt.Color(0, 174, 163)); - reloadModelButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/loadModel.png"))); // NOI18N - reloadModelButton1.setOpaque(true); - reloadModelButton1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { - public void mouseMoved(java.awt.event.MouseEvent evt) { - reloadModelButton1MouseMoved(evt); - } - }); - reloadModelButton1.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - reloadModelButton1MouseClicked(evt); - } - public void mouseExited(java.awt.event.MouseEvent evt) { - reloadModelButton1MouseExited(evt); - } - }); - - canva2.addMouseWheelListener(new java.awt.event.MouseWheelListener() { - public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) { - canva2MouseWheelMoved(evt); - } - }); - - javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); - jPanel4.setLayout(jPanel4Layout); - jPanel4Layout.setHorizontalGroup( - jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel4Layout.createSequentialGroup() - .addContainerGap() - .addComponent(canva2, javax.swing.GroupLayout.DEFAULT_SIZE, 1040, Short.MAX_VALUE) - .addContainerGap()) - ); - jPanel4Layout.setVerticalGroup( - jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(canva2, javax.swing.GroupLayout.PREFERRED_SIZE, 778, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap()) - ); - - javax.swing.GroupLayout modelViewPanelLayout = new javax.swing.GroupLayout(modelViewPanel); - modelViewPanel.setLayout(modelViewPanelLayout); - modelViewPanelLayout.setHorizontalGroup( - modelViewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(modelViewPanelLayout.createSequentialGroup() - .addContainerGap(141, Short.MAX_VALUE) - .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(35, 35, 35) - .addComponent(reloadModelButton1) - .addGap(244, 244, 244)) - ); - modelViewPanelLayout.setVerticalGroup( - modelViewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, modelViewPanelLayout.createSequentialGroup() - .addContainerGap(162, Short.MAX_VALUE) - .addGroup(modelViewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(reloadModelButton1) - .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(218, Short.MAX_VALUE)) - ); - - jPanel2.add(modelViewPanel, "card4"); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(topPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(topPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(835, Short.MAX_VALUE)) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - ); - - pack(); - setLocationRelativeTo(null); - }// </editor-fold>//GEN-END:initComponents - - private void newProjectMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_newProjectMouseMoved - setLabelBackround(newProject); - }//GEN-LAST:event_newProjectMouseMoved - - private void newProjectMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_newProjectMouseExited - if (!pressedNewProject) { - resetLabelBackround(newProject); - } - }//GEN-LAST:event_newProjectMouseExited - - private void textureMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_textureMouseMoved - setLabelBackround(texture); - }//GEN-LAST:event_textureMouseMoved - - private void textureMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_textureMouseExited - resetLabelBackround(texture); - }//GEN-LAST:event_textureMouseExited - - private void closeMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_closeMouseMoved - setLabelBackround(close); - }//GEN-LAST:event_closeMouseMoved - - private void closeMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_closeMouseExited - resetLabelBackround(close); - }//GEN-LAST:event_closeMouseExited - - private void closeMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_closeMousePressed - System.exit(0); - }//GEN-LAST:event_closeMousePressed - - private void compareTwoMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_compareTwoMouseMoved - setPanelBackround(compareTwo); - }//GEN-LAST:event_compareTwoMouseMoved - - private void compareTwoMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_compareTwoMouseExited - resetPanelBackround(compareTwo); - }//GEN-LAST:event_compareTwoMouseExited - - private void compareDBMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_compareDBMouseMoved - setPanelBackround(compareDB); - }//GEN-LAST:event_compareDBMouseMoved - - private void compareDBMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_compareDBMouseExited - resetPanelBackround(compareDB); - }//GEN-LAST:event_compareDBMouseExited - - private void batchProcessingMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_batchProcessingMouseMoved - setPanelBackround(batchProcessing); - }//GEN-LAST:event_batchProcessingMouseMoved - - private void batchProcessingMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_batchProcessingMouseExited - resetPanelBackround(batchProcessing); - }//GEN-LAST:event_batchProcessingMouseExited - - private void maximizeMouseMoved1(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_maximizeMouseMoved1 - - }//GEN-LAST:event_maximizeMouseMoved1 - - private void symetryEstimatorMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryEstimatorMouseExited - resetPanelBackround(symetryEstimator); - }//GEN-LAST:event_symetryEstimatorMouseExited - - private void newProjectMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_newProjectMousePressed - if(pressedNewProject) { - topPanel.setVisible(false); - pressedNewProject = false; - switchPanelOnMainPanel(actualPanel); - newProject.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/new_project.png"))); - }else{ - topPanel.setVisible(true); - topPanel.add(jPanel1); - pressedNewProject = true; - newProject.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/new_project_opened.png"))); - } - }//GEN-LAST:event_newProjectMousePressed - - private void maximizeMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_maximizeMouseMoved - setLabelBackround(maximize); - }//GEN-LAST:event_maximizeMouseMoved - - private void maximizeMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_maximizeMouseExited - resetLabelBackround(maximize); - }//GEN-LAST:event_maximizeMouseExited - - - private void maximizeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_maximizeMouseClicked - /*if(maximizePressed) { - frameMain.setExtendedState(JFrame.NORMAL); - maximizePressed = false; - } else { - frameMain.setExtendedState(this.getExtendedState() | JFrame.MAXIMIZED_BOTH); - maximizePressed = true; - }*/ - }//GEN-LAST:event_maximizeMouseClicked - - private void symetryEstimatorMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryEstimatorMouseMoved - setPanelBackround(symetryEstimator); - }//GEN-LAST:event_symetryEstimatorMouseMoved - - private void compareTwoMainMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_compareTwoMainMouseMoved - setPanelBackroundMain(compareTwoMain); - }//GEN-LAST:event_compareTwoMainMouseMoved - - private void compareTwoMainMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_compareTwoMainMouseExited - resetPanelBackroundMain(compareTwoMain); - }//GEN-LAST:event_compareTwoMainMouseExited - - private void compareTwoMain1MouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_compareTwoMain1MouseMoved - setPanelBackroundMain(compareTwoMain1); - }//GEN-LAST:event_compareTwoMain1MouseMoved - - private void compareTwoMain1MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_compareTwoMain1MouseExited - resetPanelBackroundMain(compareTwoMain1); - }//GEN-LAST:event_compareTwoMain1MouseExited - - private void batchMainMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_batchMainMouseMoved - setPanelBackroundMain(batchMain); - }//GEN-LAST:event_batchMainMouseMoved - - private void batchMainMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_batchMainMouseExited - resetPanelBackroundMain(batchMain); - }//GEN-LAST:event_batchMainMouseExited - - private void symetryMainMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryMainMouseMoved - setPanelBackroundMain(symetryMain); - }//GEN-LAST:event_symetryMainMouseMoved - - private void symetryMainMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryMainMouseExited - resetPanelBackroundMain(symetryMain); - }//GEN-LAST:event_symetryMainMouseExited - - private void JLabel11MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_JLabel11MouseClicked - switchPanelOnMainPanel(symetryPanel); - }//GEN-LAST:event_JLabel11MouseClicked - - private void symetryEstimatorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryEstimatorMouseClicked - switchPanelOnMainPanel(symetryPanel); - topPanel.setVisible(false); - newProject.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/new_project.png"))); - resetLabelBackround(newProject); - }//GEN-LAST:event_symetryEstimatorMouseClicked - - private void canva1MouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_canva1MouseWheelMoved -//to do to grab model - }//GEN-LAST:event_canva1MouseWheelMoved - - private void jPanel1MouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel1MouseDragged - int x = evt.getXOnScreen(); - int y = evt.getYOnScreen(); - frameMain.setLocation(x - xMouse, y - yMouse); - }//GEN-LAST:event_jPanel1MouseDragged - - private void jPanel1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel1MousePressed - xMouse = evt.getX(); - yMouse = evt.getY(); - }//GEN-LAST:event_jPanel1MousePressed - - private void reloadModelButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButtonMouseMoved - reloadModelButton.setBackground(new Color(176,230,226)); - }//GEN-LAST:event_reloadModelButtonMouseMoved - - private void reloadModelButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButtonMouseExited - reloadModelButton.setBackground(new Color(0,174,163)); - }//GEN-LAST:event_reloadModelButtonMouseExited - - private void symetryButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryButtonMouseMoved - symetryButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/symetryCountClicked.png"))); - symetryButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - }//GEN-LAST:event_symetryButtonMouseMoved - - private void symetryButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryButtonMouseExited - symetryButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/symetryCount.png"))); - }//GEN-LAST:event_symetryButtonMouseExited - - private void symetrySpecificationPanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetrySpecificationPanelMouseClicked - - }//GEN-LAST:event_symetrySpecificationPanelMouseClicked - - private void reloadModelButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButtonMouseClicked - canva1.loadModel(); - }//GEN-LAST:event_reloadModelButtonMouseClicked - - private void wiredModelButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_wiredModelButtonMouseMoved - - }//GEN-LAST:event_wiredModelButtonMouseMoved - - private void wiredModelButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_wiredModelButtonMouseExited - - }//GEN-LAST:event_wiredModelButtonMouseExited - - /** - * - * @param evt letting know GLCanva if model will be displayed as wire-frame - */ - private void wiredModelButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_wiredModelButtonMouseClicked - if (wiredModelClicked) { - resetLabelBackround(wiredModelButton); - wiredModelClicked = false; - canva1.setDrawWired(wiredModelClicked); - canva2.setDrawWired(wiredModelClicked); - } else { - setLabelBackround(wiredModelButton); - wiredModelClicked = true; - canva1.setDrawWired(wiredModelClicked); - canva2.setDrawWired(wiredModelClicked); - } - }//GEN-LAST:event_wiredModelButtonMouseClicked - - private void homeButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_homeButtonMouseMoved - setLabelBackround(homeButton); - }//GEN-LAST:event_homeButtonMouseMoved - - private void homeButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_homeButtonMouseExited - resetLabelBackround(homeButton); - }//GEN-LAST:event_homeButtonMouseExited - - private void homeButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_homeButtonMouseClicked - switchPanelOnMainPanel(startingPanel); - }//GEN-LAST:event_homeButtonMouseClicked - - private void reloadModelButton1MouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButton1MouseMoved - reloadModelButton1.setBackground(new Color(176,230,226)); - }//GEN-LAST:event_reloadModelButton1MouseMoved - - private void reloadModelButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButton1MouseClicked - canva2.loadModel(); - }//GEN-LAST:event_reloadModelButton1MouseClicked - - private void reloadModelButton1MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButton1MouseExited - reloadModelButton1.setBackground(new Color(0,174,163)); - }//GEN-LAST:event_reloadModelButton1MouseExited - - private void canva2MouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_canva2MouseWheelMoved - // TODO add your handling code here: - }//GEN-LAST:event_canva2MouseWheelMoved - - private void viewerButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_viewerButtonMouseClicked - switchPanelOnMainPanel(modelViewPanel); - }//GEN-LAST:event_viewerButtonMouseClicked - - - private void JLabel11MouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_JLabel11MouseMoved - - }//GEN-LAST:event_JLabel11MouseMoved - - private void viewerButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_viewerButtonMouseMoved - viewerButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/modelViewMoved.png"))); - }//GEN-LAST:event_viewerButtonMouseMoved - - private void viewerButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_viewerButtonMouseExited - viewerButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/modelView.png"))); - }//GEN-LAST:event_viewerButtonMouseExited - - private void JLabel11MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_JLabel11MouseExited - - }//GEN-LAST:event_JLabel11MouseExited - - private void jLabel4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel4MouseClicked - switchPanelOnMainPanel(symetryPanel); - topPanel.setVisible(false); - newProject.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/new_project.png"))); - resetLabelBackround(newProject); - }//GEN-LAST:event_jLabel4MouseClicked - - /** - * @param args the command line arguments - */ - public static void main(String args[]) { - try { - for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { - if ("Nimbus".equals(info.getName())) { - javax.swing.UIManager.setLookAndFeel(info.getClassName()); - break; - } - } - } catch (ClassNotFoundException ex) { - java.util.logging.Logger.getLogger(Interface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (InstantiationException ex) { - java.util.logging.Logger.getLogger(Interface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (IllegalAccessException ex) { - java.util.logging.Logger.getLogger(Interface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (javax.swing.UnsupportedLookAndFeelException ex) { - java.util.logging.Logger.getLogger(Interface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } - java.awt.EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - frameMain = new Interface(); - frameMain.setBackground(new Color(49,165,154)); - frameMain.pack(); - frameMain.setVisible(true); - - //enables to use design of operating system - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - }catch(Exception ex) { - ex.printStackTrace(); - } - } - }); - } - - - - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JLabel JLabel10; - private javax.swing.JLabel JLabel11; - private javax.swing.JLabel JLabel8; - private javax.swing.JLabel JLabel9; - private javax.swing.JSlider angleCosineSlider; - private javax.swing.JCheckBox averagingCheckBox; - private javax.swing.JPanel batchMain; - private javax.swing.JPanel batchProcessing; - private cz.fidentis.analyst.gui.Canvas canva1; - private cz.fidentis.analyst.gui.Canvas canva2; - private javax.swing.JLabel close; - private javax.swing.JPanel compareDB; - private javax.swing.JPanel compareTwo; - private javax.swing.JPanel compareTwoMain; - private javax.swing.JPanel compareTwoMain1; - private javax.swing.JSlider curavatureSlider; - private javax.swing.JLabel homeButton; - private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel3; - private javax.swing.JLabel jLabel4; - private javax.swing.JLabel jLabel6; - private javax.swing.JPanel jPanel1; - private javax.swing.JPanel jPanel2; - private javax.swing.JPanel jPanel3; - private javax.swing.JPanel jPanel4; - private javax.swing.JLabel maximize; - private javax.swing.JLabel minCurvatio; - private javax.swing.JLabel minCurvatio2; - private javax.swing.JLabel minCurvatio3; - private javax.swing.JLabel minCurvatio4; - private javax.swing.JLabel minCurvatio7; - private javax.swing.JPanel modelViewPanel; - private javax.swing.JLabel newProject; - private javax.swing.JSlider normalAngleSlider; - private javax.swing.JSlider relativeDistanceSlider; - private javax.swing.JLabel reloadModelButton; - private javax.swing.JLabel reloadModelButton1; - private javax.swing.JLabel significantPointLabel; - private javax.swing.JSlider significantPointSlider; - private javax.swing.JPanel startingPanel; - private javax.swing.JLabel symetryButton; - private javax.swing.JPanel symetryEstimator; - private javax.swing.JPanel symetryMain; - private javax.swing.JPanel symetryPanel; - private javax.swing.JPanel symetrySpecificationPanel; - private javax.swing.JLabel texture; - private javax.swing.JPanel topPanel; - private javax.swing.JLabel viewerButton; - private javax.swing.JPanel viewerPanel; - private javax.swing.JLabel wiredModelButton; - // End of variables declaration//GEN-END:variables -} diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.form b/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.form new file mode 100644 index 0000000000000000000000000000000000000000..192c40b31cbf9ddb607b37bcce3cb061496060a6 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.form @@ -0,0 +1,427 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="580" max="32767" attributes="0"/> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="symetrySpecificationPanel" min="-2" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="554" max="32767" attributes="0"/> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Component id="symetrySpecificationPanel" alignment="0" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="symetrySpecificationPanel"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e2" green="e6" red="b0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="17" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="normalAngleSlider" min="-2" pref="200" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="normalTextField" min="-2" pref="46" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="significantPointSlider" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="textFieldMinCos" pref="46" max="32767" attributes="0"/> + <Component id="textFieldCurvature" max="32767" attributes="0"/> + <Component id="distanceTextField" max="32767" attributes="0"/> + <Component id="significantTextField" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="63" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="minCurvatio" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="minCurvatio2" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="minCurvatio4" alignment="1" min="-2" max="-2" attributes="0"/> + <Group type="103" alignment="1" groupAlignment="0" attributes="0"> + <Component id="significantPointLabel" min="-2" max="-2" attributes="0"/> + <Component id="minCurvatio3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="80" max="-2" attributes="0"/> + <Component id="minCurvatio8" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="averagingCheckBox" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <Component id="showPlaneLabel" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="9" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="symetryButton" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="originalModelButton" alignment="1" min="-2" pref="181" max="-2" attributes="0"/> + <Component id="defaultValues" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="63" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="56" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="angleCosineSlider" alignment="1" min="-2" pref="200" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="relativeDistanceSlider" alignment="0" min="-2" pref="200" max="-2" attributes="0"/> + <Component id="curavatureSlider" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="0" pref="122" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="72" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" alignment="0" groupAlignment="0" attributes="0"> + <Component id="minCurvatio" alignment="0" min="-2" pref="26" max="-2" attributes="0"/> + <Component id="textFieldCurvature" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="4" max="-2" attributes="0"/> + <Component id="curavatureSlider" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="36" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="angleCosineSlider" min="-2" max="-2" attributes="0"/> + <Component id="minCurvatio2" min="-2" pref="26" max="-2" attributes="0"/> + </Group> + </Group> + <Component id="textFieldMinCos" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="minCurvatio4" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="22" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="34" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="normalTextField" min="-2" max="-2" attributes="0"/> + <Component id="normalAngleSlider" min="-2" pref="30" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="34" max="32767" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="minCurvatio3" min="-2" pref="26" max="-2" attributes="0"/> + <Group type="103" alignment="1" groupAlignment="0" max="-2" attributes="0"> + <Component id="relativeDistanceSlider" alignment="1" pref="0" max="32767" attributes="0"/> + <Component id="distanceTextField" alignment="1" max="32767" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="31" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="significantTextField" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="significantPointLabel" alignment="1" min="-2" pref="14" max="-2" attributes="0"/> + <Component id="significantPointSlider" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="14" max="-2" attributes="0"/> + <Component id="defaultValues" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="averagingCheckBox" min="-2" max="-2" attributes="0"/> + <Component id="minCurvatio8" min="-2" pref="28" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="65" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="showPlaneLabel" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="3" max="-2" attributes="0"/> + <Component id="symetryButton" min="-2" pref="75" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="originalModelButton" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="32" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JSlider" name="curavatureSlider"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="fa" green="fa" red="fa" type="rgb"/> + </Property> + <Property name="majorTickSpacing" type="int" value="1"/> + <Property name="minimum" type="int" value="50"/> + <Property name="snapToTicks" type="boolean" value="true"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JSlider" name="angleCosineSlider"> + <Properties> + <Property name="minimum" type="int" value="80"/> + <Property name="snapToTicks" type="boolean" value="true"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="minCurvatio"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Neue Haas Unica Pro" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Min. Curvature Ratio"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="minCurvatio2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Neue Haas Unica Pro" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Min. Angle Cosine"/> + </Properties> + </Component> + <Component class="javax.swing.JSlider" name="normalAngleSlider"> + <Properties> + <Property name="minimum" type="int" value="80"/> + <Property name="snapToTicks" type="boolean" value="true"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="minCurvatio3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Neue Haas Unica Pro" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Max. Relative Distance"/> + </Properties> + </Component> + <Component class="javax.swing.JSlider" name="significantPointSlider"> + <Properties> + <Property name="majorTickSpacing" type="int" value="100"/> + <Property name="maximum" type="int" value="300"/> + <Property name="snapToTicks" type="boolean" value="true"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="minCurvatio4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Neue Haas Unica Pro" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Min. Normal Angle Cosine"/> + </Properties> + </Component> + <Component class="javax.swing.JSlider" name="relativeDistanceSlider"> + <Properties> + <Property name="maximum" type="int" value="5"/> + <Property name="snapToTicks" type="boolean" value="true"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="significantPointLabel"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Neue Haas Unica Pro" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Significant Point Count"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="symetryButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/symetryCount.png"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="symetryButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="symetryButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="symetryButtonMouseExited"/> + </Events> + </Component> + <Component class="javax.swing.JCheckBox" name="averagingCheckBox"> + <Properties> + <Property name="selected" type="boolean" value="true"/> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="averagingCheckBoxMouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="textFieldCurvature"> + <Properties> + <Property name="text" type="java.lang.String" value="0.8"/> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="textFieldMinCos"> + <Properties> + <Property name="text" type="java.lang.String" value="0.985"/> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="normalTextField"> + <Properties> + <Property name="text" type="java.lang.String" value="0.985"/> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="distanceTextField"> + <Properties> + <Property name="text" type="java.lang.String" value="0.01"/> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="significantTextField"> + <Properties> + <Property name="text" type="java.lang.String" value="200"/> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="minCurvatio8"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Neue Haas Unica Pro" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Averaging"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + </Component> + <Component class="javax.swing.JLabel" name="originalModelButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/originalModel.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="originalModelButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="originalModelButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="originalModelButtonMouseExited"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="showPlaneLabel"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/showPlane.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="doubleBuffered" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="showPlaneLabelMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="showPlaneLabelMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="showPlaneLabelMouseExited"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="defaultValues"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Neue Haas Unica Pro" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Default values"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="defaultValuesMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.java b/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.java new file mode 100644 index 0000000000000000000000000000000000000000..a276ad3cb4f3a9a1cf2c3ea38b9d6a6a2c0f1c0b --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.java @@ -0,0 +1,604 @@ +package cz.fidentis.analyst.gui; + +import static cz.fidentis.analyst.gui.UserInterface.frameMain; +import cz.fidentis.analyst.mesh.core.MeshModel; +import cz.fidentis.analyst.symmetry.Config; +import cz.fidentis.analyst.symmetry.Plane; +import cz.fidentis.analyst.symmetry.SymmetryCounter; +import java.awt.Cursor; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JSlider; +import javax.swing.JTextField; +import javax.swing.event.ChangeEvent; + +/** + * + * @author Natália Bebjaková + * + * Panel for estimating approximate symmetry of the model + */ +public final class SymmetryPanel extends javax.swing.JPanel { + /** + * Configuration with default values + */ + private Config config; + /** + * GL Canvas on which model is displayed + */ + private Canvas canvas; + /** + * Class that is responsible for computing the symmetry + */ + private SymmetryCounter symCounter; + /** + * Computed approximate plane of the symmetry + */ + private Plane finalPlane; + + /** + * + * @return GL Canvas + */ + public Canvas getCanvas() { + return canvas; + } + + /** + * + * @param canvas GL Canvas + */ + public void setCanvas(Canvas canvas) { + this.canvas = canvas; + } + + /** + * + * @return Configuration for computing symmetry + */ + public Config getConfig() { + return config; + } + + /** + * + * @param config Configuration for computing symmetry + */ + public void setConfig(Config config) { + this.config = config; + } + + /** + * + * @return Button for returning original model from loaded file + */ + public JLabel getOriginalModelButton() { + return originalModelButton; + } + + /** + * + * @return Label for showing final plane of symmetry + */ + public JLabel getShowPlaneLabel() { + return showPlaneLabel; + } + + /** + * Sets configuration values according to text fields on panel + * User can change this text fields + */ + public void setConfigParams() { + config.setMaxRelDistance(Double.parseDouble(distanceTextField.getText())); + config.setMinAngleCos(Double.parseDouble(textFieldMinCos.getText())); + config.setMinCurvRatio(Double.parseDouble(textFieldCurvature.getText())); + config.setMinNormAngleCos(Double.parseDouble(normalTextField.getText())); + config.setSignificantPointCount(Integer.parseInt(significantTextField.getText())); + } + + /** + * Sets values in text field according to configuration + */ + public void setTextFieldsDueToConfig() { + distanceTextField.setText(Double.toString(config.getMaxRelDistance())); + textFieldMinCos.setText(Double.toString(config.getMinAngleCos())); + textFieldCurvature.setText(Double.toString(config.getMinCurvRatio())); + normalTextField.setText(Double.toString(config.getMinNormAngleCos())); + significantTextField.setText(Integer.toString(config.getSignificantPointCount())); + } + + /** + * + * @param slider Slider + * @param field text field which belongs to slider + */ + public void setSlider(JSlider slider, JTextField field) { + slider.setValue((int) (Double.parseDouble(field.getText()) * 100)); + + slider.addChangeListener((ChangeEvent ce) -> { + field.setText(""+slider.getValue()/100.0); + defaultValues.setVisible(true); + }); + + } + + /** + * Creates new form symmetryPanel + */ + public SymmetryPanel() { + initComponents(); + config = Config.getDefault(); + + setSlider(relativeDistanceSlider, distanceTextField); + setSlider(curavatureSlider, textFieldCurvature); + setSlider(angleCosineSlider, textFieldMinCos); + setSlider(normalAngleSlider, normalTextField); + + significantPointSlider.setValue((int) (Double.parseDouble(significantTextField.getText()))); + significantPointSlider.addChangeListener((ChangeEvent ce) -> { + significantTextField.setText("" + significantPointSlider.getValue()); + }); + originalModelButton.setVisible(false); + showPlaneLabel.setVisible(false); + } + + + /** + * Calculate approxy symmetry of the model + * Accuracy of the symmetry plane is influenced by configuration + * + * @throws InterruptedException exception can be thrown beacause of progress monitor + */ + private void countSymmetry() throws InterruptedException { + MeshModel model = new MeshModel(); + symCounter = new SymmetryCounter(canvas.getModel().getFacets().get(0)); + symCounter.init(); + symCounter.setPanel(this); + finalPlane = symCounter.getAproxSymmetryPlane(config); + SymmetryCounter counted = symCounter.mergeWithPlane(finalPlane); + model.addFacet(counted.getFacet()); + this.canvas.changeModel(model); + } + + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + * + * Code generated by NetBeans + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + symetrySpecificationPanel = new javax.swing.JPanel(); + curavatureSlider = new javax.swing.JSlider(); + angleCosineSlider = new javax.swing.JSlider(); + minCurvatio = new javax.swing.JLabel(); + minCurvatio2 = new javax.swing.JLabel(); + normalAngleSlider = new javax.swing.JSlider(); + minCurvatio3 = new javax.swing.JLabel(); + significantPointSlider = new javax.swing.JSlider(); + minCurvatio4 = new javax.swing.JLabel(); + relativeDistanceSlider = new javax.swing.JSlider(); + significantPointLabel = new javax.swing.JLabel(); + symetryButton = new javax.swing.JLabel(); + averagingCheckBox = new javax.swing.JCheckBox(); + textFieldCurvature = new javax.swing.JTextField(); + textFieldMinCos = new javax.swing.JTextField(); + normalTextField = new javax.swing.JTextField(); + distanceTextField = new javax.swing.JTextField(); + significantTextField = new javax.swing.JTextField(); + minCurvatio8 = new javax.swing.JLabel(); + jLabel1 = new javax.swing.JLabel(); + originalModelButton = new javax.swing.JLabel(); + showPlaneLabel = new javax.swing.JLabel(); + defaultValues = new javax.swing.JLabel(); + + symetrySpecificationPanel.setBackground(new java.awt.Color(176, 230, 226)); + + curavatureSlider.setBackground(new java.awt.Color(250, 250, 250)); + curavatureSlider.setMajorTickSpacing(1); + curavatureSlider.setMinimum(50); + curavatureSlider.setSnapToTicks(true); + curavatureSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + curavatureSlider.setOpaque(false); + + angleCosineSlider.setMinimum(80); + angleCosineSlider.setSnapToTicks(true); + angleCosineSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + angleCosineSlider.setOpaque(false); + + minCurvatio.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 14)); // NOI18N + minCurvatio.setForeground(new java.awt.Color(20, 114, 105)); + minCurvatio.setText("Min. Curvature Ratio"); + + minCurvatio2.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 14)); // NOI18N + minCurvatio2.setForeground(new java.awt.Color(20, 114, 105)); + minCurvatio2.setText("Min. Angle Cosine"); + + normalAngleSlider.setMinimum(80); + normalAngleSlider.setSnapToTicks(true); + normalAngleSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + normalAngleSlider.setOpaque(false); + + minCurvatio3.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 14)); // NOI18N + minCurvatio3.setForeground(new java.awt.Color(20, 114, 105)); + minCurvatio3.setText("Max. Relative Distance"); + + significantPointSlider.setMajorTickSpacing(100); + significantPointSlider.setMaximum(300); + significantPointSlider.setSnapToTicks(true); + significantPointSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + significantPointSlider.setOpaque(false); + + minCurvatio4.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 14)); // NOI18N + minCurvatio4.setForeground(new java.awt.Color(20, 114, 105)); + minCurvatio4.setText("Min. Normal Angle Cosine"); + + relativeDistanceSlider.setMaximum(5); + relativeDistanceSlider.setSnapToTicks(true); + relativeDistanceSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + relativeDistanceSlider.setOpaque(false); + + significantPointLabel.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 14)); // NOI18N + significantPointLabel.setForeground(new java.awt.Color(20, 114, 105)); + significantPointLabel.setText("Significant Point Count"); + + symetryButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryCount.png"))); // NOI18N + symetryButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + symetryButtonMouseMoved(evt); + } + }); + symetryButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + symetryButtonMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + symetryButtonMouseExited(evt); + } + }); + + averagingCheckBox.setSelected(true); + averagingCheckBox.setOpaque(false); + averagingCheckBox.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + averagingCheckBoxMouseClicked(evt); + } + }); + + textFieldCurvature.setText("0.8"); + textFieldCurvature.setToolTipText(""); + + textFieldMinCos.setText("0.985"); + textFieldMinCos.setToolTipText(""); + + normalTextField.setText("0.985"); + normalTextField.setToolTipText(""); + + distanceTextField.setText("0.01"); + distanceTextField.setToolTipText(""); + + significantTextField.setText("200"); + significantTextField.setToolTipText(""); + + minCurvatio8.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 14)); // NOI18N + minCurvatio8.setForeground(new java.awt.Color(20, 114, 105)); + minCurvatio8.setText("Averaging"); + + originalModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/originalModel.png"))); // NOI18N + originalModelButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + originalModelButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + originalModelButtonMouseMoved(evt); + } + }); + originalModelButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + originalModelButtonMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + originalModelButtonMouseExited(evt); + } + }); + + showPlaneLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/showPlane.png"))); // NOI18N + showPlaneLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + showPlaneLabel.setDoubleBuffered(true); + showPlaneLabel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + showPlaneLabelMouseMoved(evt); + } + }); + showPlaneLabel.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + showPlaneLabelMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + showPlaneLabelMouseExited(evt); + } + }); + + defaultValues.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 14)); // NOI18N + defaultValues.setForeground(new java.awt.Color(20, 114, 105)); + defaultValues.setText("Default values"); + defaultValues.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + defaultValues.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + defaultValuesMouseClicked(evt); + } + }); + + javax.swing.GroupLayout symetrySpecificationPanelLayout = new javax.swing.GroupLayout(symetrySpecificationPanel); + symetrySpecificationPanel.setLayout(symetrySpecificationPanelLayout); + symetrySpecificationPanelLayout.setHorizontalGroup( + symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGap(17, 17, 17) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addComponent(normalAngleSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(normalTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addComponent(significantPointSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(textFieldMinCos, javax.swing.GroupLayout.DEFAULT_SIZE, 46, Short.MAX_VALUE) + .addComponent(textFieldCurvature) + .addComponent(distanceTextField) + .addComponent(significantTextField)))) + .addGap(63, 63, 63)) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(minCurvatio, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(minCurvatio2, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(minCurvatio4, javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(significantPointLabel) + .addComponent(minCurvatio3)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetrySpecificationPanelLayout.createSequentialGroup() + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGap(80, 80, 80) + .addComponent(minCurvatio8) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(averagingCheckBox))) + .addComponent(showPlaneLabel)) + .addGap(9, 9, 9))) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetrySpecificationPanelLayout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(symetryButton, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(originalModelButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(defaultValues, javax.swing.GroupLayout.Alignment.TRAILING)) + .addGap(63, 63, 63)) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGap(56, 56, 56) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(angleCosineSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(relativeDistanceSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(curavatureSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(0, 122, Short.MAX_VALUE)))))) + ); + symetrySpecificationPanelLayout.setVerticalGroup( + symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGap(72, 72, 72) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(minCurvatio, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(textFieldCurvature, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGap(4, 4, 4) + .addComponent(curavatureSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(36, 36, 36) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(angleCosineSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(minCurvatio2, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(textFieldMinCos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGap(18, 18, 18) + .addComponent(minCurvatio4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGap(22, 22, 22)) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGap(34, 34, 34) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(normalTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(normalAngleSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE))) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(minCurvatio3, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(relativeDistanceSlider, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) + .addComponent(distanceTextField, javax.swing.GroupLayout.Alignment.TRAILING))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(significantTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(significantPointLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(significantPointSlider, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(14, 14, 14) + .addComponent(defaultValues) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(averagingCheckBox) + .addComponent(minCurvatio8, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(65, 65, 65) + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(showPlaneLabel)) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGap(3, 3, 3) + .addComponent(symetryButton, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(originalModelButton))) + .addContainerGap(32, Short.MAX_VALUE)) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 580, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(symetrySpecificationPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE))) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 554, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(symetrySpecificationPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + }// </editor-fold>//GEN-END:initComponents + + /** + * + * @param evt Decides if averaging is ON or OFF + */ + private void averagingCheckBoxMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_averagingCheckBoxMouseClicked + if(config.isAveraging()) { + config.setAveraging(false); + } else { + config.setAveraging(true); + } + }//GEN-LAST:event_averagingCheckBoxMouseClicked + + private void symetryButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryButtonMouseExited + symetryButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryCount.png"))); + }//GEN-LAST:event_symetryButtonMouseExited + + /** + * + * @param evt Symmetry is estimated. If model is not loaded, user is warned + */ + private void symetryButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryButtonMouseClicked + setConfigParams(); + if (canvas.getModel().getFacets().isEmpty()){ + JOptionPane.showMessageDialog(frameMain, "You have to load the model.", "Model not loaded", + 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/notLoadedModel.png"))); + } else { + try { + countSymmetry(); + } catch (InterruptedException ex) { + Logger.getLogger(SymmetryPanel.class.getName()).log(Level.SEVERE, null, ex); + } + originalModelButton.setVisible(true); + showPlaneLabel.setVisible(true); + } + }//GEN-LAST:event_symetryButtonMouseClicked + + /** + * + * @param evt Changes button + */ + private void symetryButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryButtonMouseMoved + symetryButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryCountClicked.png"))); + symetryButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + }//GEN-LAST:event_symetryButtonMouseMoved + + /** + * + * @param Changes button + */ + private void originalModelButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_originalModelButtonMouseMoved + originalModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/originalModelPressed.png"))); + }//GEN-LAST:event_originalModelButtonMouseMoved + + /** + * + * @param evt Changes button + */ + private void originalModelButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_originalModelButtonMouseExited + originalModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/originalModel.png"))); + }//GEN-LAST:event_originalModelButtonMouseExited + + /** + * + * @param evt Original model (without plane) is displayed + */ + private void originalModelButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_originalModelButtonMouseClicked + canvas.changeModel(canvas.getLoadedModel()); + originalModelButton.setVisible(false); + showPlaneLabel.setVisible(false); + }//GEN-LAST:event_originalModelButtonMouseClicked + + /** + * + * @param evt Changes button + */ + private void showPlaneLabelMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_showPlaneLabelMouseMoved + showPlaneLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/showPlanePressed.png"))); + }//GEN-LAST:event_showPlaneLabelMouseMoved + + /** + * + * @param evt Final computed plane is shown to user + */ + private void showPlaneLabelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_showPlaneLabelMouseClicked + JOptionPane.showMessageDialog(frameMain, "Approximate plane of symmetry: \n" + finalPlane.a + "\n" + finalPlane.b + "\n" + finalPlane.c + "\n" + + finalPlane.d + "\n", "Final plane.", 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/showPlanePane.png"))); + }//GEN-LAST:event_showPlaneLabelMouseClicked + + /** + * + * @param evt Changes button + */ + private void showPlaneLabelMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_showPlaneLabelMouseExited + showPlaneLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/showPlane.png"))); + }//GEN-LAST:event_showPlaneLabelMouseExited + + /** + * + * @param evt values of configuration back to deafult + */ + private void defaultValuesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_defaultValuesMouseClicked + config = Config.getDefault(); + setTextFieldsDueToConfig(); + }//GEN-LAST:event_defaultValuesMouseClicked + + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JSlider angleCosineSlider; + private javax.swing.JCheckBox averagingCheckBox; + private javax.swing.JSlider curavatureSlider; + private javax.swing.JLabel defaultValues; + private javax.swing.JTextField distanceTextField; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel minCurvatio; + private javax.swing.JLabel minCurvatio2; + private javax.swing.JLabel minCurvatio3; + private javax.swing.JLabel minCurvatio4; + private javax.swing.JLabel minCurvatio8; + private javax.swing.JSlider normalAngleSlider; + private javax.swing.JTextField normalTextField; + private javax.swing.JLabel originalModelButton; + private javax.swing.JSlider relativeDistanceSlider; + private javax.swing.JLabel showPlaneLabel; + private javax.swing.JLabel significantPointLabel; + private javax.swing.JSlider significantPointSlider; + private javax.swing.JTextField significantTextField; + private javax.swing.JLabel symetryButton; + private javax.swing.JPanel symetrySpecificationPanel; + private javax.swing.JTextField textFieldCurvature; + private javax.swing.JTextField textFieldMinCos; + // End of variables declaration//GEN-END:variables +} \ No newline at end of file diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.form b/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.form new file mode 100644 index 0000000000000000000000000000000000000000..eb13ba9749e283166e76b1d283ab6fb93067e422 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.form @@ -0,0 +1,933 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + <Property name="alwaysOnTop" type="boolean" value="true"/> + <Property name="autoRequestFocus" type="boolean" value="false"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="locationByPlatform" type="boolean" value="true"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="true"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="topPanel" max="32767" attributes="0"/> + <Component id="jPanel1" alignment="0" max="32767" attributes="0"/> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Component id="jPanel2" alignment="0" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="topPanel" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="847" max="32767" attributes="0"/> + </Group> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Component id="jPanel2" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="topPanel"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace pref="272" max="32767" attributes="0"/> + <Component id="compareTwo" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="105" max="-2" attributes="0"/> + <Component id="compareDB" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="86" max="-2" attributes="0"/> + <Component id="batchProcessing" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="97" max="-2" attributes="0"/> + <Component id="symetryEstimator" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="272" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="94" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="symetryEstimator" alignment="1" max="32767" attributes="0"/> + <Component id="compareDB" alignment="1" max="32767" attributes="0"/> + <Component id="compareTwo" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="batchProcessing" alignment="1" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="compareTwo"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel1" pref="154" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel1" pref="152" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="horizontalAlignment" type="int" value="0"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/compareTwoStart.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Default Cursor"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="compareDB"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel2" alignment="1" pref="192" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="horizontalAlignment" type="int" value="0"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/copareWithDatabaseStart.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Default Cursor"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="batchProcessing"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel3" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel3" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="horizontalAlignment" type="int" value="0"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/batchProcessingStart.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Default Cursor"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="symetryEstimator"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="symetryEstimatorMouseClicked"/> + </Events> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel4" max="32767" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="jLabel4" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="horizontalAlignment" type="int" value="0"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/symetryStartP.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="jLabel4MouseMoved1"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLabel4MouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLabel4MouseExited"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseDragged" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="jPanel1MouseDragged"/> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jPanel1MousePressed"/> + </Events> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="homeButton" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="newProject" min="-2" pref="198" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="wiredModelButton" min="-2" pref="187" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="minimize" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="close" min="-2" pref="46" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="homeButton" alignment="1" max="32767" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="newProject" max="32767" attributes="0"/> + <Component id="close" max="32767" attributes="0"/> + <Component id="wiredModelButton" pref="77" max="32767" attributes="0"/> + <Component id="minimize" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="newProject"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Neue Haas Unica Pro" size="18" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/new_project.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="newProjectMouseMoved"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="newProjectMouseExited"/> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="newProjectMousePressed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="close"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/close.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="closeMouseMoved"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="closeMouseExited"/> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="closeMousePressed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="wiredModelButton"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/wireframe.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="wiredModelButtonMouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="homeButton"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/home.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="homeButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="homeButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="homeButtonMouseExited"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="minimize"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/minimize.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="minimizeMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="minimizeMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="minimizeMouseExited"/> + </Events> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel2"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignCardLayout"/> + <SubComponents> + <Container class="javax.swing.JPanel" name="startingPanel"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignCardLayout" value="org.netbeans.modules.form.compat2.layouts.DesignCardLayout$CardConstraintsDescription"> + <CardConstraints cardName="card3"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel3" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="643" max="-2" attributes="0"/> + <Component id="logo" min="-2" pref="218" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="205" max="-2" attributes="0"/> + <Component id="logo" min="-2" pref="124" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="128" max="-2" attributes="0"/> + <Component id="jPanel3" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="200" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="logo"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/logo3.png"/> + </Property> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/> + <AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/> + </AuxValues> + </Component> + <Container class="javax.swing.JPanel" name="jPanel3"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="169" max="-2" attributes="0"/> + <Component id="viewerButton" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="237" max="32767" attributes="0"/> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="135" max="-2" attributes="0"/> + <Component id="compareTwoMain" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="130" max="-2" attributes="0"/> + <Component id="compareTwoMain1" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="81" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="batchMain" min="-2" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <EmptySpace min="12" pref="12" max="-2" attributes="0"/> + <Component id="symetryMain" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="170" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel6" alignment="0" max="32767" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="compareTwoMain" min="-2" max="-2" attributes="0"/> + <Component id="batchMain" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="compareTwoMain1" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="symetryMain" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="viewerButton" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="70" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="compareTwoMain"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="15" max="-2" attributes="0"/> + <Component id="JLabel8" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="28" max="32767" attributes="0"/> + <Component id="JLabel8" min="-2" pref="142" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="JLabel8"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/compareTwoStart.png"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="compareTwoMain1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="JLabel9" min="-2" pref="196" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="JLabel9" pref="156" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="JLabel9"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/copareWithDatabaseStart.png"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="batchMain"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="JLabel10" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Component id="JLabel10" min="-2" pref="157" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="JLabel10"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/batchProcessingStart.png"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="symetryMain"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="JLabel11" alignment="1" pref="189" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="JLabel11" pref="167" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="JLabel11"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/symetryStart.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="JLabel11MouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="JLabel11MouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="JLabel11MouseExited"/> + </Events> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/divide.png"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="viewerButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/modelView.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="viewerButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="viewerButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="viewerButtonMouseExited"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="symetryPanel"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignCardLayout" value="org.netbeans.modules.form.compat2.layouts.DesignCardLayout$CardConstraintsDescription"> + <CardConstraints cardName="card3"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace pref="125" max="32767" attributes="0"/> + <Component id="viewerPanel" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="94" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="symmetryPanel1" min="-2" pref="580" max="-2" attributes="0"/> + <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0"> + <Component id="reloadModelButton" alignment="0" max="32767" attributes="0"/> + <Component id="exportModelButton" max="32767" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="81" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="118" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" attributes="0"> + <Component id="symmetryPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="189" max="32767" attributes="0"/> + <Component id="exportModelButton" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="reloadModelButton" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="viewerPanel" max="32767" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="182" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="viewerPanel"> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="canva1" pref="652" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="canva1" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="cz.fidentis.analyst.gui.Canvas" name="canva1"> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="reloadModelButton"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/loadModel.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="reloadModelButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="reloadModelButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="reloadModelButtonMouseExited"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="exportModelButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/exportModel.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="exportModelButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="exportModelButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="exportModelButtonMouseExited"/> + </Events> + </Component> + <Component class="cz.fidentis.analyst.gui.SymmetryPanel" name="symmetryPanel1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e2" green="e6" red="b0" type="rgb"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="modelViewPanel"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignCardLayout" value="org.netbeans.modules.form.compat2.layouts.DesignCardLayout$CardConstraintsDescription"> + <CardConstraints cardName="card4"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace pref="156" max="32767" attributes="0"/> + <Component id="jPanel4" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="60" max="-2" attributes="0"/> + <Component id="reloadModelButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="95" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="169" max="32767" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="reloadModelButton1" min="-2" max="-2" attributes="0"/> + <Component id="jPanel4" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="224" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="reloadModelButton1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/loadModel.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="reloadModelButton1MouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="reloadModelButton1MouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="reloadModelButton1MouseExited"/> + </Events> + </Component> + <Container class="javax.swing.JPanel" name="jPanel4"> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="canva2" pref="1040" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="canva2" min="-2" pref="778" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="cz.fidentis.analyst.gui.Canvas" name="canva2"> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.java b/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.java new file mode 100644 index 0000000000000000000000000000000000000000..0c926049396d9ad453c5439478a1fafed85fa017 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.java @@ -0,0 +1,1177 @@ +package cz.fidentis.analyst.gui; + +import cz.fidentis.analyst.mesh.io.MeshModelExporter; +import java.awt.Color; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.ImageIcon; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + +/** + * + * @author Natalia Bebjakova + * + * Main window of the applicaion + */ + +public class UserInterface extends javax.swing.JFrame { + /** + * Flag for backround color of the new project button + */ + boolean pressedNewProject = false; + /** + * Flag for whether model should be displayed as wire-frame + */ + boolean wiredModelClicked = false; + /** + * Panel that is actualy displayed on the window + */ + private JPanel actualPanel; + /** + * Main frame of the application + */ + public static JFrame frameMain; + /** + * x coordinate of the mouse + */ + int xMouse; + /** + * y coordinate of the mouse + */ + int yMouse; + + /** + * Creates new form Interface + */ + public UserInterface() { + initComponents(); + topPanel.setVisible(false); + actualPanel = startingPanel; + symmetryPanel1.setCanvas(canva1); + } + + /** + * + * @return JPanel for estimating symmetry of the model + */ + public SymmetryPanel getSymmetryPanel1() { + return symmetryPanel1; + } + + /** + * Enables to switch between panels + * @param panel New panel that will be visible + */ + private void switchPanelOnMainPanel(JPanel panel) { + actualPanel = panel; + jPanel2.removeAll(); + jPanel2.repaint(); + jPanel2.revalidate(); + jPanel2.add(panel); + jPanel2.repaint(); + jPanel2.revalidate(); + panel.add(jPanel1); + jPanel1.setVisible(true); + } + + /** + * Changes backround of labels to darker green color + * @param jl label of which backround changes + */ + public void setLabelBackround(JLabel jl) { + jl.setBackground(new Color(11,56,49)); + } + + /** + * Changes backround of the label back to original + * @param jl label of which backround is return to original + */ + public void resetLabelBackround(JLabel jl) { + jl.setBackground(new Color(20,114,105)); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + * + * Code generated by NetBeans + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + topPanel = new javax.swing.JPanel(); + compareTwo = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + compareDB = new javax.swing.JPanel(); + jLabel2 = new javax.swing.JLabel(); + batchProcessing = new javax.swing.JPanel(); + jLabel3 = new javax.swing.JLabel(); + symetryEstimator = new javax.swing.JPanel(); + jLabel4 = new javax.swing.JLabel(); + jPanel1 = new javax.swing.JPanel(); + newProject = new javax.swing.JLabel(); + close = new javax.swing.JLabel(); + wiredModelButton = new javax.swing.JLabel(); + homeButton = new javax.swing.JLabel(); + minimize = new javax.swing.JLabel(); + jPanel2 = new javax.swing.JPanel(); + startingPanel = new javax.swing.JPanel(); + javax.swing.JLabel logo = new javax.swing.JLabel(); + jPanel3 = new javax.swing.JPanel(); + compareTwoMain = new javax.swing.JPanel(); + JLabel8 = new javax.swing.JLabel(); + compareTwoMain1 = new javax.swing.JPanel(); + JLabel9 = new javax.swing.JLabel(); + batchMain = new javax.swing.JPanel(); + JLabel10 = new javax.swing.JLabel(); + symetryMain = new javax.swing.JPanel(); + JLabel11 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + viewerButton = new javax.swing.JLabel(); + symetryPanel = new javax.swing.JPanel(); + viewerPanel = new javax.swing.JPanel(); + canva1 = new cz.fidentis.analyst.gui.Canvas(); + reloadModelButton = new javax.swing.JLabel(); + exportModelButton = new javax.swing.JLabel(); + symmetryPanel1 = new cz.fidentis.analyst.gui.SymmetryPanel(); + modelViewPanel = new javax.swing.JPanel(); + reloadModelButton1 = new javax.swing.JLabel(); + jPanel4 = new javax.swing.JPanel(); + canva2 = new cz.fidentis.analyst.gui.Canvas(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setAlwaysOnTop(true); + setAutoRequestFocus(false); + setBackground(new java.awt.Color(20, 114, 105)); + setLocationByPlatform(true); + + topPanel.setBackground(new java.awt.Color(20, 114, 105)); + + compareTwo.setBackground(new java.awt.Color(20, 114, 105)); + compareTwo.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/compareTwoStart.png"))); // NOI18N + jLabel1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); + + javax.swing.GroupLayout compareTwoLayout = new javax.swing.GroupLayout(compareTwo); + compareTwo.setLayout(compareTwoLayout); + compareTwoLayout.setHorizontalGroup( + compareTwoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(compareTwoLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE) + .addContainerGap()) + ); + compareTwoLayout.setVerticalGroup( + compareTwoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(compareTwoLayout.createSequentialGroup() + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE) + .addContainerGap()) + ); + + compareDB.setBackground(new java.awt.Color(20, 114, 105)); + compareDB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + + jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/copareWithDatabaseStart.png"))); // NOI18N + jLabel2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); + + javax.swing.GroupLayout compareDBLayout = new javax.swing.GroupLayout(compareDB); + compareDB.setLayout(compareDBLayout); + compareDBLayout.setHorizontalGroup( + compareDBLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE) + ); + compareDBLayout.setVerticalGroup( + compareDBLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(compareDBLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel2) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + batchProcessing.setBackground(new java.awt.Color(20, 114, 105)); + batchProcessing.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + + jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/batchProcessingStart.png"))); // NOI18N + jLabel3.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); + + javax.swing.GroupLayout batchProcessingLayout = new javax.swing.GroupLayout(batchProcessing); + batchProcessing.setLayout(batchProcessingLayout); + batchProcessingLayout.setHorizontalGroup( + batchProcessingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(batchProcessingLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + batchProcessingLayout.setVerticalGroup( + batchProcessingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(batchProcessingLayout.createSequentialGroup() + .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + + symetryEstimator.setBackground(new java.awt.Color(20, 114, 105)); + symetryEstimator.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + symetryEstimator.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + symetryEstimatorMouseClicked(evt); + } + }); + + jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryStartP.png"))); // NOI18N + jLabel4.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jLabel4.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + jLabel4MouseMoved1(evt); + } + }); + jLabel4.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jLabel4MouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jLabel4MouseExited(evt); + } + }); + + javax.swing.GroupLayout symetryEstimatorLayout = new javax.swing.GroupLayout(symetryEstimator); + symetryEstimator.setLayout(symetryEstimatorLayout); + symetryEstimatorLayout.setHorizontalGroup( + symetryEstimatorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetryEstimatorLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + symetryEstimatorLayout.setVerticalGroup( + symetryEstimatorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetryEstimatorLayout.createSequentialGroup() + .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + + javax.swing.GroupLayout topPanelLayout = new javax.swing.GroupLayout(topPanel); + topPanel.setLayout(topPanelLayout); + topPanelLayout.setHorizontalGroup( + topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(topPanelLayout.createSequentialGroup() + .addContainerGap(272, Short.MAX_VALUE) + .addComponent(compareTwo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(105, 105, 105) + .addComponent(compareDB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(86, 86, 86) + .addComponent(batchProcessing, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(97, 97, 97) + .addComponent(symetryEstimator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(272, Short.MAX_VALUE)) + ); + topPanelLayout.setVerticalGroup( + topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, topPanelLayout.createSequentialGroup() + .addContainerGap(94, Short.MAX_VALUE) + .addGroup(topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(symetryEstimator, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(compareDB, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(compareTwo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(batchProcessing, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + ); + + jPanel1.setBackground(new java.awt.Color(20, 114, 105)); + jPanel1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + jPanel1MouseDragged(evt); + } + }); + jPanel1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mousePressed(java.awt.event.MouseEvent evt) { + jPanel1MousePressed(evt); + } + }); + + newProject.setBackground(new java.awt.Color(20, 114, 105)); + newProject.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 18)); // NOI18N + newProject.setForeground(new java.awt.Color(255, 255, 255)); + newProject.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/new_project.png"))); // NOI18N + newProject.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + newProject.setOpaque(true); + newProject.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + newProjectMouseMoved(evt); + } + }); + newProject.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseExited(java.awt.event.MouseEvent evt) { + newProjectMouseExited(evt); + } + public void mousePressed(java.awt.event.MouseEvent evt) { + newProjectMousePressed(evt); + } + }); + + close.setBackground(new java.awt.Color(20, 114, 105)); + close.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/close.png"))); // NOI18N + close.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + close.setOpaque(true); + close.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + closeMouseMoved(evt); + } + }); + close.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseExited(java.awt.event.MouseEvent evt) { + closeMouseExited(evt); + } + public void mousePressed(java.awt.event.MouseEvent evt) { + closeMousePressed(evt); + } + }); + + wiredModelButton.setBackground(new java.awt.Color(20, 114, 105)); + wiredModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/wireframe.png"))); // NOI18N + wiredModelButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + wiredModelButton.setOpaque(true); + wiredModelButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + wiredModelButtonMouseClicked(evt); + } + }); + + homeButton.setBackground(new java.awt.Color(20, 114, 105)); + homeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/home.png"))); // NOI18N + homeButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + homeButton.setOpaque(true); + homeButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + homeButtonMouseMoved(evt); + } + }); + homeButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + homeButtonMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + homeButtonMouseExited(evt); + } + }); + + minimize.setBackground(new java.awt.Color(20, 114, 105)); + minimize.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/minimize.png"))); // NOI18N + minimize.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + minimize.setOpaque(true); + minimize.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + minimizeMouseMoved(evt); + } + }); + minimize.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + minimizeMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + minimizeMouseExited(evt); + } + }); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(homeButton) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(newProject, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(wiredModelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(minimize) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(close, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(homeButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(newProject, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(close, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(wiredModelButton, javax.swing.GroupLayout.DEFAULT_SIZE, 77, Short.MAX_VALUE) + .addComponent(minimize, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + ); + + jPanel2.setLayout(new java.awt.CardLayout()); + + startingPanel.setBackground(new java.awt.Color(0, 174, 163)); + startingPanel.setToolTipText(""); + + logo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/logo3.png"))); // NOI18N + + jPanel3.setBackground(new java.awt.Color(0, 174, 163)); + jPanel3.setToolTipText(""); + + compareTwoMain.setBackground(new java.awt.Color(0, 174, 163)); + + JLabel8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/compareTwoStart.png"))); // NOI18N + + javax.swing.GroupLayout compareTwoMainLayout = new javax.swing.GroupLayout(compareTwoMain); + compareTwoMain.setLayout(compareTwoMainLayout); + compareTwoMainLayout.setHorizontalGroup( + compareTwoMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(compareTwoMainLayout.createSequentialGroup() + .addGap(15, 15, 15) + .addComponent(JLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + compareTwoMainLayout.setVerticalGroup( + compareTwoMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, compareTwoMainLayout.createSequentialGroup() + .addGap(0, 28, Short.MAX_VALUE) + .addComponent(JLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + + compareTwoMain1.setBackground(new java.awt.Color(0, 174, 163)); + + JLabel9.setBackground(new java.awt.Color(0, 174, 163)); + JLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/copareWithDatabaseStart.png"))); // NOI18N + + javax.swing.GroupLayout compareTwoMain1Layout = new javax.swing.GroupLayout(compareTwoMain1); + compareTwoMain1.setLayout(compareTwoMain1Layout); + compareTwoMain1Layout.setHorizontalGroup( + compareTwoMain1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, compareTwoMain1Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(JLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + compareTwoMain1Layout.setVerticalGroup( + compareTwoMain1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, compareTwoMain1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(JLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE)) + ); + + batchMain.setBackground(new java.awt.Color(0, 174, 163)); + + JLabel10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/batchProcessingStart.png"))); // NOI18N + + javax.swing.GroupLayout batchMainLayout = new javax.swing.GroupLayout(batchMain); + batchMain.setLayout(batchMainLayout); + batchMainLayout.setHorizontalGroup( + batchMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, batchMainLayout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(JLabel10) + .addContainerGap()) + ); + batchMainLayout.setVerticalGroup( + batchMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, batchMainLayout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(JLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + + symetryMain.setBackground(new java.awt.Color(0, 174, 163)); + + JLabel11.setBackground(new java.awt.Color(0, 174, 163)); + JLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryStart.png"))); // NOI18N + JLabel11.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + JLabel11.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + JLabel11MouseMoved(evt); + } + }); + JLabel11.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + JLabel11MouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + JLabel11MouseExited(evt); + } + }); + + javax.swing.GroupLayout symetryMainLayout = new javax.swing.GroupLayout(symetryMain); + symetryMain.setLayout(symetryMainLayout); + symetryMainLayout.setHorizontalGroup( + symetryMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(JLabel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE) + ); + symetryMainLayout.setVerticalGroup( + symetryMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetryMainLayout.createSequentialGroup() + .addContainerGap() + .addComponent(JLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE)) + ); + + jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/divide.png"))); // NOI18N + + viewerButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/modelView.png"))); // NOI18N + viewerButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + viewerButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + viewerButtonMouseMoved(evt); + } + }); + viewerButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + viewerButtonMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + viewerButtonMouseExited(evt); + } + }); + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(169, 169, 169) + .addComponent(viewerButton) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 237, Short.MAX_VALUE) + .addComponent(jLabel6) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(135, 135, 135) + .addComponent(compareTwoMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(130, 130, 130) + .addComponent(compareTwoMain1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(81, 81, 81) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(batchMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(12, 12, 12) + .addComponent(symetryMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(170, 170, 170)) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addGap(27, 27, 27) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(compareTwoMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(batchMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(compareTwoMain1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(symetryMain, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addContainerGap()) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(viewerButton) + .addGap(70, 70, 70)) + ); + + javax.swing.GroupLayout startingPanelLayout = new javax.swing.GroupLayout(startingPanel); + startingPanel.setLayout(startingPanelLayout); + startingPanelLayout.setHorizontalGroup( + startingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(startingPanelLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + .addGroup(startingPanelLayout.createSequentialGroup() + .addGap(643, 643, 643) + .addComponent(logo, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + startingPanelLayout.setVerticalGroup( + startingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(startingPanelLayout.createSequentialGroup() + .addGap(205, 205, 205) + .addComponent(logo, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(128, 128, 128) + .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(200, 200, 200)) + ); + + jPanel2.add(startingPanel, "card3"); + + symetryPanel.setBackground(new java.awt.Color(0, 174, 163)); + + javax.swing.GroupLayout viewerPanelLayout = new javax.swing.GroupLayout(viewerPanel); + viewerPanel.setLayout(viewerPanelLayout); + viewerPanelLayout.setHorizontalGroup( + viewerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(viewerPanelLayout.createSequentialGroup() + .addContainerGap() + .addComponent(canva1, javax.swing.GroupLayout.DEFAULT_SIZE, 652, Short.MAX_VALUE) + .addContainerGap()) + ); + viewerPanelLayout.setVerticalGroup( + viewerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(viewerPanelLayout.createSequentialGroup() + .addContainerGap() + .addComponent(canva1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + + reloadModelButton.setBackground(new java.awt.Color(0, 174, 163)); + reloadModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/loadModel.png"))); // NOI18N + reloadModelButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + reloadModelButton.setOpaque(true); + reloadModelButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + reloadModelButtonMouseMoved(evt); + } + }); + reloadModelButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + reloadModelButtonMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + reloadModelButtonMouseExited(evt); + } + }); + + exportModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/exportModel.png"))); // NOI18N + exportModelButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + exportModelButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + exportModelButtonMouseMoved(evt); + } + }); + exportModelButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + exportModelButtonMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + exportModelButtonMouseExited(evt); + } + }); + + symmetryPanel1.setBackground(new java.awt.Color(176, 230, 226)); + + javax.swing.GroupLayout symetryPanelLayout = new javax.swing.GroupLayout(symetryPanel); + symetryPanel.setLayout(symetryPanelLayout); + symetryPanelLayout.setHorizontalGroup( + symetryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetryPanelLayout.createSequentialGroup() + .addContainerGap(125, Short.MAX_VALUE) + .addComponent(viewerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 94, Short.MAX_VALUE) + .addGroup(symetryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(symmetryPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 580, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(symetryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(reloadModelButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(exportModelButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addContainerGap(81, Short.MAX_VALUE)) + ); + symetryPanelLayout.setVerticalGroup( + symetryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetryPanelLayout.createSequentialGroup() + .addGap(118, 118, 118) + .addGroup(symetryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(symetryPanelLayout.createSequentialGroup() + .addComponent(symmetryPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 189, Short.MAX_VALUE) + .addComponent(exportModelButton) + .addGap(18, 18, 18) + .addComponent(reloadModelButton)) + .addComponent(viewerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(182, 182, 182)) + ); + + jPanel2.add(symetryPanel, "card3"); + + modelViewPanel.setBackground(new java.awt.Color(0, 174, 163)); + modelViewPanel.setToolTipText(""); + + reloadModelButton1.setBackground(new java.awt.Color(0, 174, 163)); + reloadModelButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/loadModel.png"))); // NOI18N + reloadModelButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + reloadModelButton1.setOpaque(true); + reloadModelButton1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + reloadModelButton1MouseMoved(evt); + } + }); + reloadModelButton1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + reloadModelButton1MouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + reloadModelButton1MouseExited(evt); + } + }); + + javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); + jPanel4.setLayout(jPanel4Layout); + jPanel4Layout.setHorizontalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addContainerGap() + .addComponent(canva2, javax.swing.GroupLayout.DEFAULT_SIZE, 1040, Short.MAX_VALUE) + .addContainerGap()) + ); + jPanel4Layout.setVerticalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addContainerGap() + .addComponent(canva2, javax.swing.GroupLayout.PREFERRED_SIZE, 778, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + javax.swing.GroupLayout modelViewPanelLayout = new javax.swing.GroupLayout(modelViewPanel); + modelViewPanel.setLayout(modelViewPanelLayout); + modelViewPanelLayout.setHorizontalGroup( + modelViewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(modelViewPanelLayout.createSequentialGroup() + .addContainerGap(156, Short.MAX_VALUE) + .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(60, 60, 60) + .addComponent(reloadModelButton1) + .addGap(95, 95, 95)) + ); + modelViewPanelLayout.setVerticalGroup( + modelViewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, modelViewPanelLayout.createSequentialGroup() + .addContainerGap(169, Short.MAX_VALUE) + .addGroup(modelViewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(reloadModelButton1) + .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(224, Short.MAX_VALUE)) + ); + + jPanel2.add(modelViewPanel, "card4"); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(topPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(topPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(847, Short.MAX_VALUE)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + ); + + pack(); + setLocationRelativeTo(null); + }// </editor-fold>//GEN-END:initComponents + + /** + * + * @param evt Changes the backround of the new project button + */ + private void newProjectMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_newProjectMouseMoved + setLabelBackround(newProject); + }//GEN-LAST:event_newProjectMouseMoved + + /** + * + * @param evt Changes back the backround of the new project button + */ + private void newProjectMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_newProjectMouseExited + if (!pressedNewProject) { + resetLabelBackround(newProject); + } + }//GEN-LAST:event_newProjectMouseExited + + /** + * + * @param evt Changes back the backround of the close button + */ + private void closeMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_closeMouseMoved + setLabelBackround(close); + }//GEN-LAST:event_closeMouseMoved + + /** + * + * @param evt Changes back the backround of the close button + */ + private void closeMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_closeMouseExited + resetLabelBackround(close); + }//GEN-LAST:event_closeMouseExited + + /** + * + * @param evt Close the application + */ + private void closeMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_closeMousePressed + System.exit(0); + }//GEN-LAST:event_closeMousePressed + + /** + * + * @param evt While moved with mouse, symmetry label changes + */ + private void jLabel4MouseMoved1(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel4MouseMoved1 + jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryStartPanel.png"))); + }//GEN-LAST:event_jLabel4MouseMoved1 + + /** + * + * @param evt Shows menu with icons for programs of the app + */ + private void newProjectMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_newProjectMousePressed + if(pressedNewProject) { + topPanel.setVisible(false); + pressedNewProject = false; + switchPanelOnMainPanel(actualPanel); + newProject.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/new_project.png"))); + }else{ + topPanel.setVisible(true); + topPanel.add(jPanel1); + pressedNewProject = true; + newProject.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/new_project_opened.png"))); + } + }//GEN-LAST:event_newProjectMousePressed + + + /** + * + * @param evt Switch to symmetry panel + */ + private void JLabel11MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_JLabel11MouseClicked + switchPanelOnMainPanel(symetryPanel); + }//GEN-LAST:event_JLabel11MouseClicked + + /** + * + * @param evt Switch to symmetry panel + */ + private void symetryEstimatorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryEstimatorMouseClicked + switchPanelOnMainPanel(symetryPanel); + topPanel.setVisible(false); + newProject.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/new_project.png"))); + resetLabelBackround(newProject); + }//GEN-LAST:event_symetryEstimatorMouseClicked + + /** + * + * @param evt Enables to move with the window of the app + */ + private void jPanel1MouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel1MouseDragged + int x = evt.getXOnScreen(); + int y = evt.getYOnScreen(); + frameMain.setLocation(x - xMouse, y - yMouse); + }//GEN-LAST:event_jPanel1MouseDragged + + /** + * + * @param evt Enables to move with the window of the app + */ + private void jPanel1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel1MousePressed + xMouse = evt.getX(); + yMouse = evt.getY(); + }//GEN-LAST:event_jPanel1MousePressed + + /** + * + * @param evt Changes the backround of the reload button + */ + private void reloadModelButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButtonMouseMoved + reloadModelButton.setBackground(new Color(176,230,226)); + }//GEN-LAST:event_reloadModelButtonMouseMoved + + /** + * + * @param evt Changes the backround of the reload button + */ + private void reloadModelButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButtonMouseExited + reloadModelButton.setBackground(new Color(0,174,163)); + }//GEN-LAST:event_reloadModelButtonMouseExited + + /** + * + * @param evt Loads the model that will be displayed + */ + private void reloadModelButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButtonMouseClicked + canva1.loadModel(); + symmetryPanel1.getOriginalModelButton().setVisible(false); + symmetryPanel1.getShowPlaneLabel().setVisible(false); + }//GEN-LAST:event_reloadModelButtonMouseClicked + + /** + * letting know GLCanva if model will be displayed as wire-frame + */ + private void wiredModelButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_wiredModelButtonMouseClicked + if (wiredModelClicked) { + resetLabelBackround(wiredModelButton); + wiredModelClicked = false; + canva1.setDrawWired(wiredModelClicked); + canva2.setDrawWired(wiredModelClicked); + } else { + setLabelBackround(wiredModelButton); + wiredModelClicked = true; + canva1.setDrawWired(wiredModelClicked); + canva2.setDrawWired(wiredModelClicked); + } + }//GEN-LAST:event_wiredModelButtonMouseClicked + + /** + * + * @param evt Changes the backround of the home button + */ + private void homeButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_homeButtonMouseMoved + setLabelBackround(homeButton); + }//GEN-LAST:event_homeButtonMouseMoved + + /** + * + * @param evt Changes the backround of the home button + */ + private void homeButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_homeButtonMouseExited + resetLabelBackround(homeButton); + }//GEN-LAST:event_homeButtonMouseExited + + /** + * + * @param evt Returns to home panel of the app + */ + private void homeButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_homeButtonMouseClicked + switchPanelOnMainPanel(startingPanel); + }//GEN-LAST:event_homeButtonMouseClicked + + /** + * + * @param evt Changes the backround of the reload button + */ + private void reloadModelButton1MouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButton1MouseMoved + reloadModelButton1.setBackground(new Color(176,230,226)); + }//GEN-LAST:event_reloadModelButton1MouseMoved + + /** + * + * @param evt Loads the model that will be displayed + */ + private void reloadModelButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButton1MouseClicked + canva2.loadModel(); + }//GEN-LAST:event_reloadModelButton1MouseClicked + + /** + * + * @param evt Changes the backround of the reload button + */ + private void reloadModelButton1MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButton1MouseExited + reloadModelButton1.setBackground(new Color(0,174,163)); + }//GEN-LAST:event_reloadModelButton1MouseExited + + /** + * + * @param evt Switch to panel for viewing the model + */ + private void viewerButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_viewerButtonMouseClicked + switchPanelOnMainPanel(modelViewPanel); + }//GEN-LAST:event_viewerButtonMouseClicked + + /** + * + * @param evt Changes the backround of the symmetry button + */ + private void JLabel11MouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_JLabel11MouseMoved + JLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryStartMoved.png"))); + }//GEN-LAST:event_JLabel11MouseMoved + + /** + * + * @param evt Changes the backround of the viewer panel button + */ + private void viewerButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_viewerButtonMouseMoved + viewerButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/modelViewMoved.png"))); + }//GEN-LAST:event_viewerButtonMouseMoved + + /** + * + * @param evt Changes the backround of the viewer panel button + */ + private void viewerButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_viewerButtonMouseExited + viewerButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/modelView.png"))); + }//GEN-LAST:event_viewerButtonMouseExited + + /** + * + * @param evt Changes the backround of the symmetry button + */ + private void JLabel11MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_JLabel11MouseExited + JLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryStart.png"))); + }//GEN-LAST:event_JLabel11MouseExited + + /** + * + * @param evt Switch to panel for symmetry + */ + private void jLabel4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel4MouseClicked + switchPanelOnMainPanel(symetryPanel); + topPanel.setVisible(false); + newProject.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/new_project.png"))); + resetLabelBackround(newProject); + }//GEN-LAST:event_jLabel4MouseClicked + + /** + * + * @param evt Changes the backround of the export button + */ + private void exportModelButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_exportModelButtonMouseMoved + exportModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/exportModelPressed.png"))); + }//GEN-LAST:event_exportModelButtonMouseMoved + + /** + * + * @param evt Changes the backround of the export button + */ + private void exportModelButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_exportModelButtonMouseExited + exportModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/exportModel.png"))); + }//GEN-LAST:event_exportModelButtonMouseExited + + /** + * When export button pressed, new directory is created and model is exported to it + * If there is not loaded model, user is warned + */ + private void exportModelButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_exportModelButtonMouseClicked + if (canva1.getModel().getFacets().isEmpty()){ + JOptionPane.showMessageDialog(frameMain, "You have to load the model.", "Model not loaded", + 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/notLoadedModel.png"))); + } else { + JFileChooser chooser = new JFileChooser(); + chooser.showSaveDialog(symetryPanel); + + MeshModelExporter exporter = new MeshModelExporter(canva1.getModel()); + try { + if (chooser.getSelectedFile() != null) { + exporter.exportModelToObj(chooser.getSelectedFile()); + JOptionPane.showMessageDialog(frameMain, "Model exported into: " + + chooser.getCurrentDirectory().toString() + "\\" + chooser.getSelectedFile().getName(), "Model exported", + 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/exportedModel.png"))); + } + } catch (IOException ex) { + Logger.getLogger(UserInterface.class.getName()).log(Level.SEVERE, null, ex); + } + } + }//GEN-LAST:event_exportModelButtonMouseClicked + + /** + * + * @param evt Changes the backround of the symmetry button + */ + private void jLabel4MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel4MouseExited + jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryStartP.png"))); + }//GEN-LAST:event_jLabel4MouseExited + + /** + * + * @param evt Changes the backround of the minimize button + */ + private void minimizeMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_minimizeMouseMoved + setLabelBackround(minimize); + }//GEN-LAST:event_minimizeMouseMoved + + /** + * + * @param evt Changes the backround of the minimize button + */ + private void minimizeMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_minimizeMouseExited + resetLabelBackround(minimize); + }//GEN-LAST:event_minimizeMouseExited + + /** + * + * @param evt Minimize the window of the app + */ + private void minimizeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_minimizeMouseClicked + frameMain.setExtendedState(JFrame.ICONIFIED); + }//GEN-LAST:event_minimizeMouseClicked + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(UserInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + java.awt.EventQueue.invokeLater(() -> { + frameMain = new UserInterface(); + frameMain.setBackground(new Color(49,165,154)); + frameMain.pack(); + frameMain.setVisible(true); + + //enables to use design of operating system + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + }catch(ClassNotFoundException | IllegalAccessException | InstantiationException | UnsupportedLookAndFeelException ex) { + } + }); + } + + + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel JLabel10; + private javax.swing.JLabel JLabel11; + private javax.swing.JLabel JLabel8; + private javax.swing.JLabel JLabel9; + private javax.swing.JPanel batchMain; + private javax.swing.JPanel batchProcessing; + private cz.fidentis.analyst.gui.Canvas canva1; + private cz.fidentis.analyst.gui.Canvas canva2; + private javax.swing.JLabel close; + private javax.swing.JPanel compareDB; + private javax.swing.JPanel compareTwo; + private javax.swing.JPanel compareTwoMain; + private javax.swing.JPanel compareTwoMain1; + private javax.swing.JLabel exportModelButton; + private javax.swing.JLabel homeButton; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel6; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; + private javax.swing.JPanel jPanel4; + private javax.swing.JLabel minimize; + private javax.swing.JPanel modelViewPanel; + private javax.swing.JLabel newProject; + private javax.swing.JLabel reloadModelButton; + private javax.swing.JLabel reloadModelButton1; + private javax.swing.JPanel startingPanel; + private javax.swing.JPanel symetryEstimator; + private javax.swing.JPanel symetryMain; + private javax.swing.JPanel symetryPanel; + private cz.fidentis.analyst.gui.SymmetryPanel symmetryPanel1; + private javax.swing.JPanel topPanel; + private javax.swing.JLabel viewerButton; + private javax.swing.JPanel viewerPanel; + private javax.swing.JLabel wiredModelButton; + // End of variables declaration//GEN-END:variables +} diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/backround.jpg b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/backround.jpg similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/backround.jpg rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/backround.jpg diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/batchProcessing.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessing.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/batchProcessing.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessing.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/batchProcessingGreen.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessingGreen.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/batchProcessingGreen.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessingGreen.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessingStart.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessingStart.png new file mode 100644 index 0000000000000000000000000000000000000000..9c2512d3525259ce784a8ff845ceb5c25d746b1b Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessingStart.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/blackBackroundCanvas.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/blackBackroundCanvas.png new file mode 100644 index 0000000000000000000000000000000000000000..1ecd6e228c45a7335b0ce7115cbb31316c29ba7c Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/blackBackroundCanvas.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/blackBackroundCanvasPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/blackBackroundCanvasPressed.png new file mode 100644 index 0000000000000000000000000000000000000000..79e8e34a2815e9bc38a1dc591033a55435b61671 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/blackBackroundCanvasPressed.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/bottom.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/bottom.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/bottom.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/bottom.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/close.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/close.png new file mode 100644 index 0000000000000000000000000000000000000000..a01fdd3aad41bcc3cdf66278c65a43a61286d22d Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/close.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/compareTwo.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwo.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/compareTwo.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwo.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/compareTwoGreen.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwoGreen.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/compareTwoGreen.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwoGreen.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwoStart.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwoStart.png new file mode 100644 index 0000000000000000000000000000000000000000..2b7641dc84f2e5f877cef99e298e26dd4da31599 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwoStart.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/copareWithDatabase.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabase.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/copareWithDatabase.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabase.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/copareWithDatabaseGreen.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabaseGreen.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/copareWithDatabaseGreen.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabaseGreen.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabaseStart.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabaseStart.png new file mode 100644 index 0000000000000000000000000000000000000000..9a287fd89a0de0f45d2f749a487571b0509f0e63 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabaseStart.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/divide.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/divide.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/divide.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/divide.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/downButton.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/downButton.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/downButton.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/downButton.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/downButtonPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/downButtonPressed.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/downButtonPressed.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/downButtonPressed.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/exportModel.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportModel.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/exportModel.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportModel.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/exportModelPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportModelPressed.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/exportModelPressed.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportModelPressed.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportedModel.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportedModel.png new file mode 100644 index 0000000000000000000000000000000000000000..205cc3f16bac17d7dd719768f0585c2ab03a77ae Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportedModel.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/home.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/home.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/home.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/home.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/leftButton.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/leftButton.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/leftButton.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/leftButton.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/leftButtonPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/leftButtonPressed.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/leftButtonPressed.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/leftButtonPressed.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadCanva.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadCanva.png new file mode 100644 index 0000000000000000000000000000000000000000..d360ac7701f606fc431474c05b541e6b69c9bbd0 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadCanva.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadCanvaClicked.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadCanvaClicked.png new file mode 100644 index 0000000000000000000000000000000000000000..aa11ab847494e7d262017e620c817beec68adb05 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadCanvaClicked.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadModel.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadModel.png new file mode 100644 index 0000000000000000000000000000000000000000..1addcde3aefcf68f39a421c712e600566701577c Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadModel.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadModelPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadModelPressed.png new file mode 100644 index 0000000000000000000000000000000000000000..fee6376e20ed3e23b62da7822fb499253891df80 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadModelPressed.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/logo.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/logo.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/logo2.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo2.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/logo2.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo2.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/logo3.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo3.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/logo3.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo3.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/maximize.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/maximize.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/maximize.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/maximize.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minimize.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minimize.png new file mode 100644 index 0000000000000000000000000000000000000000..f755ee7b36e01865fd48853e9de991ad6ef1ab2b Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minimize.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/minus.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minus.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/minus.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/minus.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/minusPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minusPressed.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/minusPressed.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/minusPressed.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/modelView.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/modelView.png new file mode 100644 index 0000000000000000000000000000000000000000..1b86c272720c301cfc948a613429c1895150a211 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/modelView.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/modelViewMoved.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/modelViewMoved.png new file mode 100644 index 0000000000000000000000000000000000000000..778ecff09f0e3310bb2389126bff3fd3af804d1b Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/modelViewMoved.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/n.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/n.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/n.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/n.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/navigBackground.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/navigBackground.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/navigBackground.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/navigBackground.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/navigationBackground.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/navigationBackground.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/navigationBackground.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/navigationBackground.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/new_project.jpg b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project.jpg similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/new_project.jpg rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project.jpg diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/new_project.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/new_project.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/new_project_opened.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project_opened.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/new_project_opened.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project_opened.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/notLoadedModel.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/notLoadedModel.png new file mode 100644 index 0000000000000000000000000000000000000000..ea10626859ce6772f5a5b5ec82c702662586701a Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/notLoadedModel.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/originalModel.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/originalModel.png new file mode 100644 index 0000000000000000000000000000000000000000..125fd6fea4dafa1ccf428eec9f45a57e38ba0460 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/originalModel.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/originalModelPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/originalModelPressed.png new file mode 100644 index 0000000000000000000000000000000000000000..b9e7ca9a2c00e9ecb776df2d99948284923052b3 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/originalModelPressed.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/plus.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/plus.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/plus.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/plus.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/plusPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/plusPressed.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/plusPressed.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/plusPressed.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/resetButton.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/resetButton.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/resetButton.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/resetButton.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/resetButtonPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/resetButtonPressed.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/resetButtonPressed.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/resetButtonPressed.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/rightBottom.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightBottom.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/rightBottom.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightBottom.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/rightButton.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightButton.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/rightButton.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightButton.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/rightButtonPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightButtonPressed.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/rightButtonPressed.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightButtonPressed.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/selectPoints.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/selectPoints.png new file mode 100644 index 0000000000000000000000000000000000000000..f4e6c251c13fee841185bb1d6005015ae3e20a39 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/selectPoints.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlane.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlane.png new file mode 100644 index 0000000000000000000000000000000000000000..bb223da1ae986d266950254055cad86d5fb96222 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlane.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlanePane.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlanePane.png new file mode 100644 index 0000000000000000000000000000000000000000..5b233935c9cd88b33810b0fab32abb82b338a323 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlanePane.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlanePressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlanePressed.png new file mode 100644 index 0000000000000000000000000000000000000000..c92818e64874dd61c0170c19d1be4adab470c486 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlanePressed.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/symetry.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetry.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/symetry.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetry.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryCount.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryCount.png new file mode 100644 index 0000000000000000000000000000000000000000..58864d8fa5b9ab740c3bf9d5c1e77a9bbf76f820 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryCount.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryCountClicked.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryCountClicked.png new file mode 100644 index 0000000000000000000000000000000000000000..8d4a9d0303d94c7731a6f5a45d5c31afa0b783b7 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryCountClicked.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/symetryGreen.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryGreen.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/symetryGreen.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryGreen.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStart.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStart.png new file mode 100644 index 0000000000000000000000000000000000000000..9423bccd70b3d9bd3002e620851aa3b7973f8dff Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStart.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartMoved.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartMoved.png new file mode 100644 index 0000000000000000000000000000000000000000..182a20e18874970e67893f21607c840cf3587af7 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartMoved.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartP.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartP.png new file mode 100644 index 0000000000000000000000000000000000000000..5c6b58dd1f579b11290a69a26628ab08a228353e Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartP.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartPanel.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartPanel.png new file mode 100644 index 0000000000000000000000000000000000000000..39658d54cc1a8267ef87ab6374eacc82ae4e292a Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartPanel.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/texture.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/texture.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/texture.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/texture.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/texture2.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/texture2.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/texture2.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/texture2.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/upButton.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/upButton.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/upButton.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/upButton.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/upButtonPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/upButtonPressed.png similarity index 100% rename from GUI/src/main/java/cz/fidentis/analyst/resources/upButtonPressed.png rename to GUI/src/main/java/cz/fidentis/analyst/gui/resources/upButtonPressed.png diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/whiteBackroundCanvas.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/whiteBackroundCanvas.png new file mode 100644 index 0000000000000000000000000000000000000000..2392d79948755cb2681db19304b6fc23faf15392 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/whiteBackroundCanvas.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/whiteBackroundCanvasPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/whiteBackroundCanvasPressed.png new file mode 100644 index 0000000000000000000000000000000000000000..cbf866bba082635034362ab1345cd33d07ffcc2d Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/whiteBackroundCanvasPressed.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/wireframe.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/wireframe.png new file mode 100644 index 0000000000000000000000000000000000000000..28efd055ab3380bf32718c9a8392a08367b32945 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/wireframe.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/close.png b/GUI/src/main/java/cz/fidentis/analyst/resources/close.png deleted file mode 100644 index 39524575cd12b20d0f3745dd77762df8b4512c8f..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/resources/close.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/loadCanva.png b/GUI/src/main/java/cz/fidentis/analyst/resources/loadCanva.png deleted file mode 100644 index 665b6d4ebf2858ff5aa70217759209eaa66b6c91..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/resources/loadCanva.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/loadCanvaClicked.png b/GUI/src/main/java/cz/fidentis/analyst/resources/loadCanvaClicked.png deleted file mode 100644 index 8648dfe9fd3a26ef901cbbe408143720d2fefdd2..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/resources/loadCanvaClicked.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/loadModel.png b/GUI/src/main/java/cz/fidentis/analyst/resources/loadModel.png deleted file mode 100644 index 53d92580986073567672051e38e6134bf31ecc06..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/resources/loadModel.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/loadModelPressed.png b/GUI/src/main/java/cz/fidentis/analyst/resources/loadModelPressed.png deleted file mode 100644 index 39184cb44fee42d05a9646ff27ae9f76ba913949..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/resources/loadModelPressed.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/modelView.png b/GUI/src/main/java/cz/fidentis/analyst/resources/modelView.png deleted file mode 100644 index b221b1d41c09de2d8983df6ec7869e9f2cc8b444..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/resources/modelView.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/modelViewMoved.png b/GUI/src/main/java/cz/fidentis/analyst/resources/modelViewMoved.png deleted file mode 100644 index a757a2e8e8cdf13eb49632995b882207653151a6..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/resources/modelViewMoved.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/symetryCount.png b/GUI/src/main/java/cz/fidentis/analyst/resources/symetryCount.png deleted file mode 100644 index 23258b99ccf99d67df91f23d777c7ce8c76a24e9..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/resources/symetryCount.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/symetryCountClicked.png b/GUI/src/main/java/cz/fidentis/analyst/resources/symetryCountClicked.png deleted file mode 100644 index 2b4a69b0ce341c75a889905b96e078b121a4d45a..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/resources/symetryCountClicked.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/resources/wireframe.png b/GUI/src/main/java/cz/fidentis/analyst/resources/wireframe.png deleted file mode 100644 index 69247e62b2f9d898888cd7e2c3a6467b99836c7c..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/resources/wireframe.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/symmetry/AproxSymmetryPlane.java b/GUI/src/main/java/cz/fidentis/analyst/symmetry/AproxSymmetryPlane.java new file mode 100644 index 0000000000000000000000000000000000000000..6ddae7b0d4dcbd1e3e1bdfefb2495105dc732ed2 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/symmetry/AproxSymmetryPlane.java @@ -0,0 +1,42 @@ +package cz.fidentis.analyst.symmetry; + +/** + * + * @author Natália Bebjaková + * + * Respresents plane with added atribute - votes, that play role + * in decision about symmetry estimate of the 3D model + */ +public class AproxSymmetryPlane extends Plane implements Comparable<AproxSymmetryPlane> { + public Integer votes; + + /** + * returns number of votes that were given to plane while computing the symmetry + * + * @return Number of votes + */ + public Integer getVotes() { + return votes; + } + + /** + * + * @param plane Original plane without votes + * @param votes number of votes given to the plane + */ + public AproxSymmetryPlane(Plane plane, int votes) { + super(plane.a, plane.b, plane.c, plane.d); + this.votes = votes; + } + + /** + * Enables to compare two approximate planes due to number of votes + * + * @param other plane to be compared + * @return number that decides which plane has more votes + */ + @Override + public int compareTo(AproxSymmetryPlane other) { + return this.votes.compareTo(other.votes); + } +} diff --git a/GUI/src/main/java/cz/fidentis/analyst/symmetry/BoundingBox.java b/GUI/src/main/java/cz/fidentis/analyst/symmetry/BoundingBox.java new file mode 100644 index 0000000000000000000000000000000000000000..0a1f577dc38a2adf4545d655709f028c2fd3a49f --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/symmetry/BoundingBox.java @@ -0,0 +1,147 @@ +package cz.fidentis.analyst.symmetry; + +import cz.fidentis.analyst.mesh.core.MeshPoint; +import java.util.List; +import javax.vecmath.Vector3d; + +/** + * @author Natália Bebjaková + * + * Represent min-max box. + * It is automatically maintained by given point array. + * + */ + +public class BoundingBox { + private boolean isMinMaxValid; + private MeshPoint maxPoint; + private MeshPoint minPoint; + private MeshPoint midPoint; + private double maxDiag; + private final List<MeshPoint> points; + + /** + * + * @return max point of the bounding box + */ + public MeshPoint getMaxPoint() { + return maxPoint; + } + + /** + * + * @param point new max point of the bounding box + */ + public void setMaxPoint(MeshPoint point) { + this.maxPoint = point; + } + + /** + * + * @return middle point of the bounding box + */ + public MeshPoint getMidPoint() { + return midPoint; + } + + /** + * + * @param point new middle point of the bounding box + */ + public void setMidPoint(MeshPoint point) { + this.midPoint = point; + } + + /** + * + * @return min point of the bounding box + */ + public MeshPoint getMinPoint() { + return minPoint; + } + + /** + * + * @param point new min point of the bounding box + */ + public void setMinPoint(MeshPoint point) { + this.minPoint = point; + } + + /** + * Creates bounding box that is automatically maintained with respect to given array. + * @param points array of points + */ + public BoundingBox(List<MeshPoint> points) { + this.points = points; + this.ValidateMinMax(); + this.ValidateMidDiag(); + } + + /** + * @return point array that is managed by curent bounding box. + */ + public List<MeshPoint> getPoints() { + return points; + } + + /** + * Recomputes the BoundingBox from all points + */ + private void ValidateMinMax() { + minPoint = new MeshPoint(new Vector3d(Double.MAX_VALUE,Double.MAX_VALUE,Double.MAX_VALUE), null, null); + maxPoint = new MeshPoint(new Vector3d(Double.MIN_VALUE,Double.MIN_VALUE,Double.MIN_VALUE), null, null); + + for (int i = 0; i < points.size(); i++) { + MeshPoint point = points.get(i); + + minPoint.getPosition().x = Math.min(minPoint.getPosition().x, point.getPosition().x); + minPoint.getPosition().y = Math.min(minPoint.getPosition().y, point.getPosition().y); + minPoint.getPosition().z = Math.min(minPoint.getPosition().z, point.getPosition().z); + + maxPoint.getPosition().x = Math.max(maxPoint.getPosition().x, point.getPosition().x); + maxPoint.getPosition().y = Math.max(maxPoint.getPosition().y, point.getPosition().y); + maxPoint.getPosition().z = Math.max(maxPoint.getPosition().z, point.getPosition().z); + } + isMinMaxValid = true; + this.ValidateMidDiag(); + } + + /** + * Recompute mid-point and max diagonal length. + */ + private void ValidateMidDiag() { + midPoint = (minPoint.addPosition(maxPoint)).multiplyPosition(0.5); + MeshPoint diag = maxPoint.subtractPosition(minPoint); + this.maxDiag = diag.abs(); + } + + /** + * Return volume diagonal of the bounding box. + * @return maximal diagonal of bounding box + */ + public double getMaxDiag() { + if (!isMinMaxValid) { + this.ValidateMinMax(); + } + return maxDiag; + } + + /** + * Returns description of BoundignBox. + * @return String representation of the bounding box + */ + @Override + public String toString() { + String str = "BoundingBox: "; + if (this.minPoint == null || this.maxPoint == null || this.midPoint == null) { + return str += "undefined (there are no points)"; + } + str += "\n"; + str += "\t" + "- min point : " + this.minPoint + "\n"; + str += "\t" + "- max point : " + this.maxPoint + "\n"; + str += "\t" + "- mid point : " + this.midPoint + "\n"; + str += "\t" + "- max diag : " + this.maxDiag + "\n"; + return str; + } +} \ No newline at end of file diff --git a/GUI/src/main/java/cz/fidentis/analyst/symmetry/Config.java b/GUI/src/main/java/cz/fidentis/analyst/symmetry/Config.java new file mode 100644 index 0000000000000000000000000000000000000000..63ce184e74e9b9a429903a7aff2d21090a6abb53 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/symmetry/Config.java @@ -0,0 +1,157 @@ +package cz.fidentis.analyst.symmetry; + +/** + * + * @author Natalia Bebjakova + * + * Representation of configuration for symmetry estimate. + * Default numbers are given due to the best results on tested data. + * On many different 3D models, it exists other values of config that will have + * better impact on results in estimate of symmetry. + */ +public class Config { + private static final double DEFAULT_MIN_CURV_RATIO = 0.8; + private static final double DEFAULT_MIN_ANGLE_COS = 0.985; + private static final double DEFAULT_MIN_NORM_ANGLE_COS = 0.985; + private static final double DEFAULT_MAX_REL_DISTANCE = 1.0 / 100.0; + private static final int DEFAULT_SIGNIFICANT_POINT_COUNT = 200; + private static final boolean DEFAULT_AVERAGING = true; + + private double minCurvRatio; + private double minAngleCos; + private double minNormAngleCos; + private double maxRelDistance; + private int significantPointCount; + private boolean averaging; + + /** + * Parameter which denotes how similar the Gaussian curvatures in the two vertices + * must be for this criteria to be satisfied. + * The higher the value is the more similar they must be. + * + * @return minimal similarity of curvatures to satisfy the criteria + */ + public double getMinCurvRatio() { + return minCurvRatio; + } + + /** + * + * @param minCurvRatio new minimal similarity of curvatures to satisfy the criteria + */ + public void setMinCurvRatio(double minCurvRatio) { + this.minCurvRatio = minCurvRatio; + } + + /** + * MinAngleCos ∈ (0,1) + * It is the angle between the vector (xk − xl) and the normal vector nij of the plane Ïij + * (which is the vector (xi −xj)) + * Returns parameter which denotes how large the angle αij can be for this criteria to be satisfied. + * + * @return minimal angle satisfy criteria + */ + public double getMinAngleCos() { + return minAngleCos; + } + + /** + * + * @param minAngleCos new minimal angle to satisfy the criteria + */ + public void setMinAngleCos(double minAngleCos) { + this.minAngleCos = minAngleCos; + } + + /** + * MinNormAngleCos ∈ (0,1) + * It is angle between vectors (xi − xj) and (ni − nj), where xi, xj are vertices and ni, nj its normals + * Returns parameter which denotes how large the angle αij can be for this criteria to be satisfied. + * + * @return minimal angle to satisfy criteria + */ + public double getMinNormAngleCos() { + return minNormAngleCos; + } + + /** + * + * @param minNormAngleCos new minimal angle to satisfy the criteria + */ + public void setMinNormAngleCos(double minNormAngleCos) { + this.minNormAngleCos = minNormAngleCos; + } + + /** + * Parameter which denotes how far (relatively to the length of the bounding box diagonal) + * the middle point of the two vertices can be from the plane in order to satisfy this criteria. + * + * @return relative distance + */ + public double getMaxRelDistance() { + return maxRelDistance; + } + + /** + * + * @param maxRelDistance new relative distance + */ + public void setMaxRelDistance(double maxRelDistance) { + this.maxRelDistance = maxRelDistance; + } + + /** + * Returns number of vertices with the highest Gaussian curvature. + * It is optional parameter. + * + * @return number of significant points for computing the symmetry + */ + public int getSignificantPointCount() { + return significantPointCount; + } + + /** + * + * @param significantPointCount new number of significant points for computing the symmetry + */ + public void setSignificantPointCount(int significantPointCount) { + this.significantPointCount = significantPointCount; + } + + /** + * If there are more planes with the same highest number of votes while computing symmetry, + * we can average them all together. + * Returns parameter that decides whether to average them or not. + * + * @return true if planes will be averaged + */ + public boolean isAveraging() { + return averaging; + } + + /** + * + * @param averaging new averaging flag + */ + public void setAveraging(boolean averaging) { + this.averaging = averaging; + } + + /** + * Gives default values of configuration. + * + * @return configuration with default values + */ + public static Config getDefault() { + Config conf = new Config(); + + conf.minCurvRatio = DEFAULT_MIN_CURV_RATIO; + conf.minAngleCos = DEFAULT_MIN_ANGLE_COS; + conf.minNormAngleCos = DEFAULT_MIN_NORM_ANGLE_COS; + conf.maxRelDistance = DEFAULT_MAX_REL_DISTANCE; + conf.significantPointCount = DEFAULT_SIGNIFICANT_POINT_COUNT; + conf.averaging = DEFAULT_AVERAGING; + + return conf; + } +} \ No newline at end of file diff --git a/GUI/src/main/java/cz/fidentis/analyst/symmetry/Plane.java b/GUI/src/main/java/cz/fidentis/analyst/symmetry/Plane.java new file mode 100644 index 0000000000000000000000000000000000000000..b4a3032312e620f2fc76316ed719ed1397318eed --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/symmetry/Plane.java @@ -0,0 +1,88 @@ +package cz.fidentis.analyst.symmetry; + +import cz.fidentis.analyst.mesh.core.MeshFacet; +import cz.fidentis.analyst.mesh.core.MeshPoint; + +/** + * + * @author Natália Bebjaková + * + * Representation of the plane + */ +public class Plane { + public double a; + public double b; + public double c; + public double d; + private static MeshFacet facet; + + /** + * Creates new plane + * + * @param a a coordinate + * @param b b coordinate + * @param c c coordinate + * @param d d coordinate + */ + public Plane(double a, double b, double c, double d) { + this.a = a; + this.b = b; + this.c = c; + this.d = d; + } + + /** + * Normalize the plane + */ + public void normalize() { + double normalLength = Math.sqrt(a * a + b * b + c * c); + + a /= normalLength; + b /= normalLength; + c /= normalLength; + d /= normalLength; + } + + /** + * Returns plane that is represented by mesh which can be merged with model + * + * @param centroid middle point of the plane + * @param a a coordinate + * @param b b coordinate + * @param scale distance of points given by bounding box + * @return plane represented as mesh + */ + public static SymmetryCounter createPlaneMesh(MeshPoint centroid, MeshPoint a, MeshPoint b, double scale) { + facet = new MeshFacet(); + SymmetryCounter planeMesh = new SymmetryCounter(facet); + + MeshPoint[] points = new MeshPoint[4]; + + points[0] = centroid.subtractPosition(a.multiplyPosition(scale)).subtractPosition(b.multiplyPosition(scale)); + points[1] = centroid.subtractPosition(a.multiplyPosition(scale)).addPosition(b.multiplyPosition(scale)); + points[2] = centroid.addPosition(a.multiplyPosition(scale)).addPosition(b.multiplyPosition(scale)); + points[3] = centroid.addPosition(a.multiplyPosition(scale)).subtractPosition(b.multiplyPosition(scale)); + + for (MeshPoint point : points) { + facet.addVertex(point); + } + + Triangle[] triangles = new Triangle[4]; + + triangles[0] = new Triangle(0, 1, 2); + triangles[1] = new Triangle(0, 2, 3); + triangles[2] = new Triangle(0, 2, 1); + triangles[3] = new Triangle(0, 3, 2); + planeMesh.setTriangles(triangles); + + MeshPoint[] normals = planeMesh.CalculateNormals(); + + facet.getVertices().clear(); + + for (int i = 0; i < points.length; i++) { + facet.addVertex(new MeshPoint(points[i].getPosition(),normals[i].getPosition(),null)); + } + return planeMesh; + } + +} diff --git a/GUI/src/main/java/cz/fidentis/analyst/symmetry/SymmetryCounter.java b/GUI/src/main/java/cz/fidentis/analyst/symmetry/SymmetryCounter.java new file mode 100644 index 0000000000000000000000000000000000000000..19fbd5482b1a92138278b9c104b278b68bd4a828 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/symmetry/SymmetryCounter.java @@ -0,0 +1,812 @@ +package cz.fidentis.analyst.symmetry; + +import static cz.fidentis.analyst.gui.UserInterface.frameMain; +import cz.fidentis.analyst.mesh.core.CornerTableRow; +import cz.fidentis.analyst.mesh.core.MeshFacet; +import cz.fidentis.analyst.mesh.core.MeshPoint; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.ProgressMonitor; +import javax.swing.UIManager; +import javax.vecmath.Vector3d; + +/** + * + * @author Natália Bebjaková + * + * Main class for computing approximate plane of symmetry of the 3D model. + * Default values of the configuration are given due to the best results on tested objects. + * On many different 3D models, it exists other values of config that will have better impact on result. + * + */ +public class SymmetryCounter { + /** + * Facet of the model on which symmetry is computed + */ + private final MeshFacet facet; + /** + * Representation for areas of Voronoi region of triangles + */ + private TriangleVertexAreas[] areas; + /** + * Represent min-max box. It is automatically maintained by given point array. + */ + private BoundingBox boundingBox; + /** + * Helping array of triangles computed from corner table + */ + protected Triangle[] triangles; + /** + * panel for configuration of symmetry counting + */ + private JPanel panel; + + /** + * + * @return panel for configuration of symmetry counting + */ + public JPanel getPanel() { + return panel; + } + + /** + * + * @param panel new panel for configuration of symmetry counting + */ + public void setPanel(JPanel panel) { + this.panel = panel; + } + + + /** + * + * @return Facet of the model on which symmetry is computed + */ + public MeshFacet getFacet() { + return facet; + } + + /** + * Creates new class for computing symmetry + * + * @param f facet on which symmetry will be computed + */ + public SymmetryCounter(MeshFacet f) { + this.facet = f; + } + + /** + * If bounding box is not created yet, it creates new one. + * + * @return Represent min-max box of the boundries of the model. + */ + public BoundingBox getBoundingBox() { + if (boundingBox == null) { + boundingBox = new BoundingBox(facet.getVertices()); + } + return boundingBox; + } + + /** + * + * @param boundingBox new min-max box of the boundries of the model. + */ + public void setBoundingBox(BoundingBox boundingBox) { + this.boundingBox = boundingBox; + } + + /** + * + * @return array of triangles + */ + public Triangle[] getTriangles() { + return triangles; + } + + /** + * + * @param triangles new array of triangles + */ + public void setTriangles(Triangle[] triangles) { + this.triangles = triangles; + } + + /** + * Representation of areas of Voronoi region of triangles + * used for computing Gaussian curvature + */ + private class TriangleVertexAreas { + public double v1Area; + public double v2Area; + public double v3Area; + } + + /** + * Initialize values necessary for computing + */ + public void init() { + initTriangles(); + initArrayOfTriangleVertexAreas(); + boundingBox = new BoundingBox(facet.getVertices()); + } + + /** + * Computes triangles of facet from corner table + */ + public void initTriangles() { + triangles = new Triangle[facet.getCornerTable().getSize() / 3]; + for (int i = 0; i < facet.getCornerTable().getSize(); i += 3) { + Triangle t = new Triangle(facet.getCornerTable().getRow(i).getVertexIndex(), + facet.getCornerTable().getRow(i + 1).getVertexIndex(), + facet.getCornerTable().getRow(i + 2).getVertexIndex()); + triangles[(i / 3)] = t; + } + } + + /** + * Calculates new normals of the points + * + * @return new normals represented as mesh points so that math operations can be done + */ + public MeshPoint[] CalculateNormals() { + MeshPoint[] newNormals = new MeshPoint[facet.getNumberOfVertices()]; + for (int i = 0; i < facet.getNumberOfVertices(); i++) + newNormals[i] = new MeshPoint(new Vector3d(0, 0, 0), null, null); + for (Triangle t : triangles) { + MeshPoint triangleNormal = (facet.getVertices().get(t.vertex3).subtractPosition + (facet.getVertices().get(t.vertex1))).crossProduct(facet.getVertices().get(t.vertex2).subtractPosition(facet.getVertices().get(t.vertex1))); + newNormals[t.vertex1] = newNormals[t.vertex1].addPosition(new MeshPoint(triangleNormal.getPosition(), null, null)); + newNormals[t.vertex2] = newNormals[t.vertex2].addPosition(new MeshPoint(triangleNormal.getPosition(), null, null)); + newNormals[t.vertex3] = newNormals[t.vertex3].addPosition(new MeshPoint(triangleNormal.getPosition(), null, null)); + } + for (int i = 0; i < newNormals.length; i++){ + if (newNormals[i].getPosition().x != 0 && newNormals[i].getPosition().y != 0 && newNormals[i].getPosition().z != 0) { + newNormals[i] = newNormals[i].dividePosition(newNormals[i].abs()); + } + } + return newNormals; + } + + /** + * + * @param pointIndex index of point for which we are searching traingles in its neighborhood + * @return triangle neighbours of given index of vertex + */ + public List<Integer> getNeighbours(int pointIndex) { + return facet.getCornerTable().getTriangleIndexesByVertexIndex(pointIndex); + } + + /** + * Return area of Voronoi region of triangle + * + * @param t triangle of which area is computed + * @return area of Voronoi region + */ + private TriangleVertexAreas computeTriangleVertexAreas(Triangle t) { + MeshPoint circumcenter; + + MeshPoint tVertex1 = facet.getVertices().get(t.vertex1); + MeshPoint tVertex2 = facet.getVertices().get(t.vertex2); + MeshPoint tVertex3 = facet.getVertices().get(t.vertex3); + + double a = (tVertex2.subtractPosition(tVertex3)).abs(); + double b = (tVertex3.subtractPosition(tVertex1)).abs(); + double c = (tVertex2.subtractPosition(tVertex1)).abs(); + + double d1 = a * a * (b * b + c * c - a * a); + double d2 = b * b * (c * c + a * a - b * b); + double d3 = c * c * (a * a + b * b - c * c); + double dSum = d1 + d2 + d3; + + d1 /= dSum; + d2 /= dSum; + d3 /= dSum; + + MeshPoint v1Half = (tVertex2.addPosition(tVertex3)).dividePosition(2); + MeshPoint v2Half = (tVertex1.addPosition(tVertex3)).dividePosition(2); + MeshPoint v3Half = (tVertex2.addPosition(tVertex1)).dividePosition(2); + + + TriangleVertexAreas area = new TriangleVertexAreas(); + + if (d1 < 0) { + area.v3Area = ((v2Half.subtractPosition(tVertex3)).crossProduct(v1Half.subtractPosition(tVertex3))).abs() / 2; + area.v2Area = ((v3Half.subtractPosition(tVertex2)).crossProduct(v1Half.subtractPosition(tVertex2))).abs() / 2; + area.v1Area = (((v1Half.subtractPosition(tVertex1)).crossProduct(v3Half.subtractPosition(tVertex1))).abs() / 2) + + (((v1Half.subtractPosition(tVertex1)).crossProduct(v2Half.subtractPosition(tVertex1))).abs() / 2); + return area; + } + if (d2 < 0) { + area.v3Area = ((v3Half.subtractPosition(tVertex1)).crossProduct(v2Half.subtractPosition(tVertex1))).abs() / 2; + area.v2Area = ((v1Half.subtractPosition(tVertex3)).crossProduct(v2Half.subtractPosition(tVertex3))).abs() / 2; + area.v1Area = (((v2Half.subtractPosition(tVertex2)).crossProduct(v1Half.subtractPosition(tVertex2))).abs() / 2) + + (((v2Half.subtractPosition(tVertex2)).crossProduct(v3Half.subtractPosition(tVertex2))).abs() / 2); + return area; + } + if (d3 < 0) { + area.v2Area = ((v1Half.subtractPosition(tVertex2)).crossProduct(v3Half.subtractPosition(tVertex2))).abs() / 2; + area.v1Area = ((v2Half.subtractPosition(tVertex1)).crossProduct(v3Half.subtractPosition(tVertex1))).abs() / 2; + area.v3Area = (((v3Half.subtractPosition(tVertex3)).crossProduct(v2Half.subtractPosition(tVertex3))).abs() / 2) + + (((v3Half.subtractPosition(tVertex3)).crossProduct(v1Half.subtractPosition(tVertex3))).abs() / 2); + return area; + } + + circumcenter = tVertex1.multiplyPosition(d1).addPosition(tVertex2.multiplyPosition(d2).addPosition(tVertex3.multiplyPosition(d3))); + + area.v1Area = (((v2Half.subtractPosition(tVertex1)).crossProduct(circumcenter.subtractPosition(tVertex1))).abs() / 2) + + (((v3Half.subtractPosition(tVertex1)).crossProduct(circumcenter.subtractPosition(tVertex1))).abs() / 2); + + area.v2Area = (((v3Half.subtractPosition(tVertex2)).crossProduct(circumcenter.subtractPosition(tVertex2))).abs() / 2) + + (((v1Half.subtractPosition(tVertex2)).crossProduct(circumcenter.subtractPosition(tVertex2))).abs() / 2); + + area.v3Area = (((v1Half.subtractPosition(tVertex3)).crossProduct(circumcenter.subtractPosition(tVertex3))).abs() / 2) + + (((v2Half.subtractPosition(tVertex3)).crossProduct(circumcenter.subtractPosition(tVertex3))).abs() / 2); + return area; + } + + /** + * Computes area of Voronoi region for all triangles + */ + private void initArrayOfTriangleVertexAreas() { + areas = new TriangleVertexAreas[triangles.length]; + for (int i = 0; i < areas.length; i++) { + areas[i] = computeTriangleVertexAreas(triangles[i]); + } + } + + /** + * Calculates angle of the triangle according to centerIndex + * + * @param centerIndex centerIndex + * @param t triangle + * @return angle + */ + private double calculateTriangleAlfa(int centerIndex, Triangle t) { + MeshPoint tVertex1 = facet.getVertices().get(t.vertex1); + MeshPoint tVertex2 = facet.getVertices().get(t.vertex2); + MeshPoint tVertex3 = facet.getVertices().get(t.vertex3); + + double alfaCos = 0; + + if (t.vertex1 == centerIndex) { + MeshPoint e1 = tVertex1.subtractPosition(tVertex3); + e1 = e1.dividePosition(e1.abs()); + + MeshPoint e2 = tVertex2.subtractPosition(tVertex3); + e2 = e2.dividePosition(e2.abs()); + + alfaCos = e1.dotProduct(e2); + } + else if (t.vertex2 == centerIndex) { + + MeshPoint e1 = tVertex2.subtractPosition(tVertex1); + e1 = e1.dividePosition(e1.abs()); + + MeshPoint e2 = tVertex3.subtractPosition(tVertex1); + e2 = e2.dividePosition(e2.abs()); + + alfaCos = e1.dotProduct(e2); + } + else if (t.vertex3 == centerIndex){ + MeshPoint e1 = tVertex3.subtractPosition(tVertex2); + e1 = e1.dividePosition(e1.abs()); + + MeshPoint e2 = tVertex1.subtractPosition(tVertex2); + e2 = e2.dividePosition(e2.abs()); + + alfaCos = e1.dotProduct(e2); + } + double alfa = Math.acos(alfaCos); + return 1 / Math.tan(alfa); + } + + /** + * Calculates angle of the triangle according to centerIndex + * + * @param centerIndex centerIndex + * @param t triangle + * @return angle + */ + private double calculateTriangleBeta(int centerIndex, Triangle t) { + MeshPoint tVertex1 = facet.getVertices().get(t.vertex1); + MeshPoint tVertex2 = facet.getVertices().get(t.vertex2); + MeshPoint tVertex3 = facet.getVertices().get(t.vertex3); + + double betaCos = 0; + + if (t.vertex1 == centerIndex) { + MeshPoint e1 = tVertex1.subtractPosition(tVertex2); + e1 = e1.dividePosition(e1.abs()); + + MeshPoint e2 = tVertex3.subtractPosition(tVertex2); + e2 = e2.dividePosition(e2.abs()); + + betaCos = e1.dotProduct(e2); + } + else if (t.vertex2 == centerIndex) { + + MeshPoint e1 = tVertex2.subtractPosition(tVertex3); + e1 = e1.dividePosition(e1.abs()); + + MeshPoint e2 = tVertex1.subtractPosition(tVertex3); + e2 = e2.dividePosition(e2.abs()); + + betaCos = e1.dotProduct(e2); + } + else if (t.vertex3 == centerIndex){ + MeshPoint e1 = tVertex3.subtractPosition(tVertex1); + e1 = e1.dividePosition(e1.abs()); + + MeshPoint e2 = tVertex2.subtractPosition(tVertex1); + e2 = e2.dividePosition(e2.abs()); + + betaCos = e1.dotProduct(e2); + } + double beta = Math.acos(betaCos); + return 1 / Math.tan(beta); + } + + /** + * Calculates Laplacian + * + * @param centerIndex centerIndex + * @return laplacian + */ + private MeshPoint calculateLaplacian(int centerIndex) { + List<Integer> trianglesNeighbours = getNeighbours(centerIndex); + + if (trianglesNeighbours.isEmpty()) { + return new MeshPoint(new Vector3d(), new Vector3d(), new Vector3d()); + } + double areaSum = 0; + MeshPoint pointSum = new MeshPoint((new Vector3d(0.0, 0.0, 0.0)), null, null); + for (int i = 0; i < trianglesNeighbours.size(); i++) { + Triangle t = triangles[trianglesNeighbours.get(i)]; + Triangle tNext = triangles[trianglesNeighbours.get((i + 1) % trianglesNeighbours.size())]; + double area = 0; + + MeshPoint tVertex1 = facet.getVertices().get(t.vertex1); + MeshPoint tVertex2 = facet.getVertices().get(t.vertex2); + MeshPoint tVertex3 = facet.getVertices().get(t.vertex3); + MeshPoint centerPoint = facet.getVertices().get(centerIndex); + + if (t.vertex1 == centerIndex) { + area = areas[trianglesNeighbours.get(i)].v1Area; + pointSum = pointSum.addPosition((tVertex2.subtractPosition(centerPoint)).multiplyPosition((calculateTriangleAlfa(centerIndex, t) + + calculateTriangleBeta(centerIndex, tNext)) / 2)); + + } + else if (t.vertex2 == centerIndex) { + area = areas[trianglesNeighbours.get(i)].v2Area; + pointSum = pointSum.addPosition((tVertex3.subtractPosition(centerPoint)).multiplyPosition((calculateTriangleAlfa(centerIndex, t) + + calculateTriangleBeta(centerIndex, tNext)) / 2)); + } + else if (t.vertex3 == centerIndex) { + area = areas[trianglesNeighbours.get(i)].v3Area; + pointSum = pointSum.addPosition((tVertex1.subtractPosition(centerPoint)).multiplyPosition((calculateTriangleAlfa(centerIndex, t) + + calculateTriangleBeta(centerIndex, tNext)) / 2)); + } + areaSum += area; + } + return pointSum.multiplyPosition(1 / areaSum); + } + + /** + * Gaussian curvature in a vertex of a triangle mesh. + * It can only be estimated beacuse triangle mesh is not a continuous + * but discrete representation of surface. + * + * @param centerIndex index of vertex in which gaussian curvature is computed + * @return Gaussian curvature in given vertex + */ + private double getGaussianCurvature(int centerIndex) { + + List<Integer> triangleNeighbours = this.getNeighbours(centerIndex); + + if (triangleNeighbours.isEmpty()) { + return Double.NaN; + } + + double sum = 2 * Math.PI; + double areaSum = 0; + + for (int i = 0; i < triangleNeighbours.size(); i++) { + MeshPoint v1 = new MeshPoint(new Vector3d(), null, null); + MeshPoint v2 = new MeshPoint(new Vector3d(), null, null); + Triangle t = triangles[triangleNeighbours.get(i)]; + + MeshPoint tVertex1 = facet.getVertices().get(t.vertex1); + MeshPoint tVertex2 = facet.getVertices().get(t.vertex2); + MeshPoint tVertex3 = facet.getVertices().get(t.vertex3); + + double area = 0; + if (t.vertex1 == centerIndex) { + v1 = tVertex2.subtractPosition(tVertex1); + v2 = tVertex3.subtractPosition(tVertex1); + + area = areas[triangleNeighbours.get(i)].v1Area; + } + else if (t.vertex2 == centerIndex) { + v1 = tVertex1.subtractPosition(tVertex2); + v2 = tVertex3.subtractPosition(tVertex2); + + area = areas[triangleNeighbours.get(i)].v2Area; + } + else if (t.vertex3 == centerIndex) { + v1 = tVertex2.subtractPosition(tVertex3); + v2 = tVertex1.subtractPosition(tVertex3); + + area = areas[triangleNeighbours.get(i)].v3Area; + } + + areaSum += area; + v1 = v1.dividePosition(v1.abs()); + v2 = v2.dividePosition(v2.abs()); + + sum -= Math.acos(v1.dotProduct(v2)); + } + return sum * (1.0 / areaSum); + + } + + /** + * + * @param centerIndex center index + * @return mean curvature + */ + private double getMeanCurvature(int centerIndex) { + return calculateLaplacian(centerIndex).abs(); + } + + /** + * + * @param centerIndex center index + * @return max curvature + */ + private double getMaxCurvature(int centerIndex) { + double gaussianCurvature = getGaussianCurvature(centerIndex); + if (Double.isNaN(gaussianCurvature)) { + return Double.NaN; + } + double meanCurvature = getMeanCurvature(centerIndex); + double meanCurvatureSqr = meanCurvature * meanCurvature; + if (meanCurvatureSqr <= gaussianCurvature) { + return meanCurvature; + } + return meanCurvature + Math.sqrt(meanCurvatureSqr - gaussianCurvature); + } + + /** + * Computes votes for given plane + * + * @param plane Plane for which votes are computed + * @param curvatures significant curvatures chosen for computing + * @param points significant point chosen for computing + * @param minCurvRatio optional parameter from configuration + * @param minAngleCos optional parameter from configuration + * @param minNormAngleCos optional parameter from configuration + * @param maxDist optional parameter from configuration + * @return total votes given to plane while computing the symmetry + */ + private int GetVotes(Plane plane, + ArrayList<Double> curvatures, + ArrayList<Integer> points, + double minCurvRatio, + double minAngleCos, + double minNormAngleCos, + double maxDist) { + + plane.normalize(); + + MeshPoint normal = new MeshPoint((new Vector3d(plane.a, plane.b, plane.c)),null, null); + double d = plane.d; + double maxCurvRatio = 1.0 / minCurvRatio; + int votes = 0; + MeshPoint[] normals = CalculateNormals(); + + for (int i = 0; i < curvatures.size(); i++) { + for (int j = 0; j < curvatures.size(); j++) { + if (i != j && (curvatures.get(i) / curvatures.get(j) >= minCurvRatio + && curvatures.get(i) / curvatures.get(j) <= maxCurvRatio)) { + + MeshPoint vec = facet.getVertices().get(points.get(i)).subtractPosition(facet.getVertices().get(points.get(j))); + vec = vec.dividePosition(vec.abs()); + double cos = vec.dotProduct(normal); + + MeshPoint ni; + + /*if (facet.getVertices().get(points.get(i)).getNormal() != null) { + ni = new MeshPoint(new Vector3d(facet.getVertices().get(points.get(i)).getNormal().x, + facet.getVertices().get(points.get(i)).getNormal().y, + facet.getVertices().get(points.get(i)).getNormal().z), null, null); + } else { + ni = new MeshPoint (new Vector3d(normals[points.get(i)].getPosition().x,normals[points.get(i)].getPosition().y, + normals[points.get(i)].getPosition().z), null, null); + } + + ni = ni.divide(ni.abs()); + + MeshPoint nj; + if (facet.getVertices().get(points.get(j)).getNormal() != null) { + nj = new MeshPoint(new Vector3d(facet.getVertices().get(points.get(j)).getNormal().x, + facet.getVertices().get(points.get(j)).getNormal().y, + facet.getVertices().get(points.get(j)).getNormal().z), null, null); + } else { + nj = new MeshPoint (new Vector3d(normals[points.get(j)].getPosition().x,normals[points.get(j)].getPosition().y, + normals[points.get(j)].getPosition().z), null, null); + }*/ + + + ni = new MeshPoint (new Vector3d(normals[points.get(i)].getPosition().x,normals[points.get(i)].getPosition().y, + normals[points.get(i)].getPosition().z), null, null); + + ni = ni.dividePosition(ni.abs()); + + MeshPoint nj; + nj = new MeshPoint (new Vector3d(normals[points.get(j)].getPosition().x,normals[points.get(j)].getPosition().y, + normals[points.get(j)].getPosition().z), null, null); + nj = nj.dividePosition(nj.abs()); + + MeshPoint normVec = ni.subtractPosition(nj); + normVec = normVec.dividePosition(normVec.abs()); + double normCos = normVec.dotProduct(normal); + + if (Math.abs(cos) >= minAngleCos && Math.abs(normCos) >= minNormAngleCos) { + MeshPoint avrg = (facet.getVertices().get(points.get(i)).addPosition(facet.getVertices().get(points.get(j)))).dividePosition(2.0); + + double dist = normal.getPosition().x * avrg.getPosition().x + + normal.getPosition().y * avrg.getPosition().y + normal.getPosition().z * avrg.getPosition().z + d; + + dist = Math.abs(dist); + + if (dist <= maxDist) { + votes++; + } + } + } + } + } + return votes; + } + + /** + * + * @param conf Configuration for computing + * @return approximate plane of symmtetry + */ + public Plane getAproxSymmetryPlane(Config conf) { + UIManager.put("ProgressMonitor.progressText", "Counting symmetry..."); + + ArrayList<AproxSymmetryPlane> planes = new ArrayList<>(); + MeshPoint[] normals = CalculateNormals(); + double[] curvatures = new double[facet.getNumberOfVertices()]; + for (int i = 0; i < facet.getNumberOfVertices(); i++) { + if (facet.getNumberOfVertices() > 2000) { + curvatures[i] = this.getMaxCurvature(i); + } else { + curvatures[i] = this.getGaussianCurvature(i); + } + if (Double.isNaN(curvatures[i])){ + curvatures[i] = Double.MIN_VALUE; + } + } + ArrayList<Double> sortedCurvatures = new ArrayList<>(); + for (int i = 0; i < curvatures.length; i++) { + sortedCurvatures.add(curvatures[i]); + } + Collections.sort(sortedCurvatures); + + if(conf.getSignificantPointCount() > facet.getNumberOfVertices()) { + conf.setSignificantPointCount((facet.getNumberOfVertices()) - 1); + } + double bottomCurvature = sortedCurvatures.get(sortedCurvatures.size() - 1 - conf.getSignificantPointCount()); + + ArrayList<Integer> significantPoints = new ArrayList<>(); + ArrayList<Double> significantCurvatures = new ArrayList<>(); + + for (int i = 0; i < facet.getNumberOfVertices(); i++) { + if (curvatures[i] >= bottomCurvature) { + significantCurvatures.add(curvatures[i]); + significantPoints.add(i); + } + } + + Plane plane = new Plane(0, 0, 0, 0); + int lastVotes = 0; + + ProgressMonitor progressMonitor; + progressMonitor = new ProgressMonitor(panel, "Cunting...", + "Steps", 0, significantPoints.size()); + + double onePercent = significantCurvatures.size() / 100.0; + double percentsPerStep = 1 / onePercent; + for (int i = 0; i < significantPoints.size(); i++) { + for (int j = 0; j < significantPoints.size(); j++) { + if (i != j) { + double minRatio = conf.getMinCurvRatio(); + double maxRatio = 1.0 / minRatio; + if (significantCurvatures.get(i) / significantCurvatures.get(j) >= minRatio && significantCurvatures.get(i) / + significantCurvatures.get(j) <= maxRatio) { + + MeshPoint p1 = facet.getVertex(significantPoints.get(i)); + MeshPoint p2 = facet.getVertex(significantPoints.get(j)); + MeshPoint avrg = (p1.addPosition(p2)).dividePosition(2.0); + MeshPoint normal = (p1.subtractPosition(p2)); + + normal = normal.dividePosition(normal.abs()); + double d = -(normal.getPosition().x * avrg.getPosition().x) - + (normal.getPosition().y * avrg.getPosition().y) - (normal.getPosition().z * avrg.getPosition().z); + + MeshPoint ni; + /*if (facet.getVertex(significantPoints.get(i)).getNormal() != null) { + ni = new MeshPoint(new Vector3d(facet.getVertex(significantPoints.get(i)).getNormal().x, + facet.getVertex(significantPoints.get(i)).getNormal().y, + facet.getVertex(significantPoints.get(i)).getNormal().z),null, null); + } else { + ni = new MeshPoint (new Vector3d(normals[significantPoints.get(i)].getPosition().x,normals[significantPoints.get(i)].getPosition().y, + normals[significantPoints.get(i)].getPosition().z), null, null); + } + ni = ni.divide(ni.abs()); + + MeshPoint nj; + if(facet.getVertex(significantPoints.get(j)).getNormal() != null) { + nj = new MeshPoint(new Vector3d(facet.getVertex(significantPoints.get(j)).getNormal().x, + facet.getVertex(significantPoints.get(j)).getNormal().y, + facet.getVertex(significantPoints.get(j)).getNormal().z),null, null); + } else { + nj = new MeshPoint (new Vector3d(normals[significantPoints.get(j)].getPosition().x,normals[significantPoints.get(j)].getPosition().y, + normals[significantPoints.get(j)].getPosition().z), null, null); + } + + nj = nj.divide(nj.abs());*/ + + ni = new MeshPoint (new Vector3d(normals[significantPoints.get(i)].getPosition().x,normals[significantPoints.get(i)].getPosition().y, + normals[significantPoints.get(i)].getPosition().z), null, null); + + ni = ni.dividePosition(ni.abs()); + + MeshPoint nj; + nj = new MeshPoint (new Vector3d(normals[significantPoints.get(j)].getPosition().x,normals[significantPoints.get(j)].getPosition().y, + normals[significantPoints.get(j)].getPosition().z), null, null); + + nj = nj.dividePosition(nj.abs()); + + MeshPoint normVec = ni.subtractPosition(nj); + normVec = normVec.dividePosition(normVec.abs()); + double normCos = normVec.dotProduct(normal); + + if (Math.abs(normCos) >= conf.getMinNormAngleCos()) { + + Plane newPlane = new Plane(normal.getPosition().x, normal.getPosition().y, normal.getPosition().z, d); + int currentVotes = GetVotes( + newPlane, + significantCurvatures, + significantPoints, + 0.5, + conf.getMinAngleCos(), + conf.getMinNormAngleCos(), + boundingBox.getMaxDiag() * conf.getMaxRelDistance()); + + + planes.add(new AproxSymmetryPlane(newPlane, currentVotes)); + + if (currentVotes > lastVotes) { + lastVotes = currentVotes; + plane = newPlane; + } + } + + } + } + } + progressMonitor.setNote("Task step: " + (int) ((i + 1) * percentsPerStep)); + progressMonitor.setProgress(i); + }; + + Collections.sort(planes); + ArrayList<AproxSymmetryPlane> finalPlanes = new ArrayList<>(); + for (int i = 0; i < planes.size(); i++) { + if (planes.get(i).votes == lastVotes){ + finalPlanes.add(planes.get(i)); + } + } + Plane finalPlane = new Plane(0, 0, 0, 0); + //v plane nic neni + MeshPoint refDir = new MeshPoint(new Vector3d(finalPlanes.get(0).a, finalPlanes.get(0).b, finalPlanes.get(0).c), null, null); + for (int i = 0; i < finalPlanes.size(); i++) { + MeshPoint normDir = new MeshPoint(new Vector3d(finalPlanes.get(i).a, finalPlanes.get(i).b, finalPlanes.get(i).c), null, null); + if (normDir.dotProduct(refDir) < 0) { + finalPlane.a -= finalPlanes.get(i).a; + finalPlane.b -= finalPlanes.get(i).b; + finalPlane.c -= finalPlanes.get(i).c; + finalPlane.d -= finalPlanes.get(i).d; + } + else { + finalPlane.a += finalPlanes.get(i).a; + finalPlane.b += finalPlanes.get(i).b; + finalPlane.c += finalPlanes.get(i).c; + finalPlane.d += finalPlanes.get(i).d; + } + } + finalPlane.normalize(); + if (conf.isAveraging()){ + plane = finalPlane; + } + JOptionPane.showMessageDialog(frameMain, "Final plane: " + plane.a + " " + plane.b + " " + plane.c + " " + + plane.d + "\n" + "Votes: " + lastVotes, "Symmetry estimate done.", 0, + new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/exportedModel.png"))); + + progressMonitor.close(); + return plane; + } + + /** + * + * @param plane Plane computed as symmetry plane + * @return mesh that represents facet with computed plane of approximate symmetry + */ + public SymmetryCounter mergeWithPlane(Plane plane) { + MeshPoint normal = new MeshPoint(new Vector3d(plane.a, plane.b, plane.c), null, null); + MeshPoint midPoint = boundingBox.getMidPoint(); + + double alpha = -((plane.a * midPoint.getPosition().x) + + (plane.b * midPoint.getPosition().y) + (plane.c * midPoint.getPosition().z) + + plane.d) / (normal.dotProduct(normal)); + + MeshPoint midPointOnPlane = midPoint.addPosition(normal.multiplyPosition(alpha)); + + double val = plane.a * midPointOnPlane.getPosition().x + plane.b * + midPointOnPlane.getPosition().y + plane.c * + midPointOnPlane.getPosition().z + plane.d; + + MeshPoint a; + if (Math.abs(normal.dotProduct(new MeshPoint(new Vector3d(0.0, 1.0, 0.0), null, null))) + > Math.abs(normal.dotProduct(new MeshPoint(new Vector3d (1.0, 0.0, 0.0), null, null)))) { + a = normal.crossProduct(new MeshPoint(new Vector3d(1.0, 0.0, 0.0), null, null)); + } + else { + a = normal.crossProduct(new MeshPoint(new Vector3d(0.0, 1.0, 0.0), null, null)); + } + a = a.dividePosition(a.abs()); + + MeshPoint b = normal.crossProduct(a); + b = b.dividePosition(b.abs()); + + + SymmetryCounter planeMesh = Plane.createPlaneMesh(midPointOnPlane, a, b, + (boundingBox.getMaxPoint().subtractPosition(boundingBox.getMinPoint())).getPosition().x); + + + return mergeMeshWith(planeMesh); + } + + /** + * + * @param s mesh that will be merged + * @return mesh with merged vertices from both meshes + */ + public SymmetryCounter mergeMeshWith(SymmetryCounter s) { + CornerTableRow row1 = new CornerTableRow(facet.getNumberOfVertices(), -1); + CornerTableRow row2 = new CornerTableRow(facet.getNumberOfVertices() + 1, facet.getNumberOfVertices() + 3); + CornerTableRow row3 = new CornerTableRow(facet.getNumberOfVertices() + 2, -1); + CornerTableRow row4 = new CornerTableRow(facet.getNumberOfVertices() + 2, -1); + CornerTableRow row5 = new CornerTableRow(facet.getNumberOfVertices() + 3, facet.getNumberOfVertices() + 1); + CornerTableRow row6 = new CornerTableRow(facet.getNumberOfVertices(), -1); + + facet.getCornerTable().addRow(row1); + facet.getCornerTable().addRow(row2); + facet.getCornerTable().addRow(row3); + facet.getCornerTable().addRow(row4); + facet.getCornerTable().addRow(row5); + facet.getCornerTable().addRow(row6); + + for(int n = 0; n < 4; n++) { + facet.addVertex(s.getFacet().getVertices().get(n)); + } + return this; + } +} diff --git a/GUI/src/main/java/cz/fidentis/analyst/symmetry/Triangle.java b/GUI/src/main/java/cz/fidentis/analyst/symmetry/Triangle.java new file mode 100644 index 0000000000000000000000000000000000000000..6a7df8ba36aebd0b965f3b0a9d957c9cec89cc98 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/symmetry/Triangle.java @@ -0,0 +1,101 @@ +package cz.fidentis.analyst.symmetry; + +/** + * + * @author Natália Bebjaková + * + * Helping representation of triangle in symmetry estimate + */ + +public class Triangle { + protected int vertex1; + protected int vertex2; + protected int vertex3; + + /** + * Creates new triangle + * + * @param v1 first vertex + * @param v2 second vertex + * @param v3 third vertex + */ + public Triangle(int v1, int v2, int v3) { + this.vertex1 = v1; + this.vertex2 = v2; + this.vertex3 = v3; + } + /** + * + * @return first vertex of triangle + */ + public int getVertex1() { + return vertex1; + } + + /** + * + * @param vertex1 new vertex + */ + public void setVertex1(int vertex1) { + this.vertex1 = vertex1; + } + + /** + * + * @return second vertex of triangle + */ + public int getVertex2() { + return vertex2; + } + + /** + * + * @param vertex2 new vertex + */ + public void setVertex2(int vertex2) { + this.vertex2 = vertex2; + } + + /** + * + * @return third vertex of triangle + */ + public int getVertex3() { + return vertex3; + } + + /** + * + * @param vertex3 new vertex + */ + public void setVertex3(int vertex3) { + this.vertex3 = vertex3; + } + + /** + * Triangles are same if they have same vertices + * + * @param obj other triangle + * @return true if two triangles are same + */ + @Override + public boolean equals(Object obj) { + if (obj instanceof Triangle) { + Triangle t = (Triangle)obj; + if (((this.vertex1 == t.vertex1) || (this.vertex1 == t.vertex2) || (this.vertex1 == t.vertex3)) && + ((this.vertex2 == t.vertex1) || (this.vertex2 == t.vertex2) || (this.vertex2 == t.vertex3)) && + ((this.vertex3 == t.vertex1) || (this.vertex3 == t.vertex2) || (this.vertex3 == t.vertex3))) + return (true); + } + return (false); + } + + /** + * + * @return hascode of the triangle + */ + @Override + public int hashCode() { + return (this.vertex1 * 100 ^ this.vertex2 * 100 ^ this.vertex3); + } +} diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTable.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTable.java index 1f2d0f65b816e631350158b6b83ecbaf5f2dfaec..a16d64f0c06675d7d1c85cb922e87e2539e6888f 100644 --- a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTable.java +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTable.java @@ -1,8 +1,11 @@ package cz.fidentis.analyst.mesh.core; - import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; +/** + * Representation of mesh in memory + */ /** * Representation of mesh in memory using corner table * @@ -11,6 +14,25 @@ import java.util.List; public class CornerTable { private List<CornerTableRow> rows = new ArrayList<>(); + + /** + * Constructor of CornerTable + */ + public CornerTable() { + + } + + /** + * Copy constructor of CornerTable + * + * @param cornerTable copied CornerTable + */ + public CornerTable(CornerTable cornerTable) { + cornerTable.rows.forEach((row) -> { + rows.add(new CornerTableRow(row)); + }); + } + /** * returns index of face that contains corner. @@ -111,8 +133,8 @@ public class CornerTable { if (index < 0 || index > rows.size()) { return -2; } - int tipLeftCornerIndex=getIndexOfTipCornerOnLeft(index); - if (tipLeftCornerIndex==-1){ + int tipLeftCornerIndex = getIndexOfTipCornerOnLeft(index); + if (tipLeftCornerIndex == -1) { return -1; } @@ -156,4 +178,46 @@ public class CornerTable { public CornerTableRow getRow(int index) { return rows.get(index); } + + /** + * returns corners of specific vertex + * + * @param vertexIndex index of vertex + * @return list of rows of corner table + */ + public List<CornerTableRow> getCornersByVertexIndex(int vertexIndex) { + return rows.stream() + .filter(corner -> corner.getVertexIndex() == vertexIndex) + .collect(Collectors.toList()); + } + + /** + * returns list of indexes of faces that have a corner at specific vertex + * + * @param vertexIndex index of vertex + * @return list of indexes of faces + */ + public List<Integer> getTriangleIndexesByVertexIndex(int vertexIndex) { + return rows.stream() + .filter(corner -> corner.getVertexIndex() == vertexIndex) + .map(corner -> getIndexOfFace(rows.indexOf(corner))) + .collect(Collectors.toList()); + } + + /** + * returns indexes of vertices of triangle + * @param triangleIndex index of triangle + * @return list of indexes + */ + public List<Integer> getIndexesOfVerticesByTriangleIndex(int triangleIndex) { + List<Integer> indexes = new ArrayList<>(); + for (int i = 0; i < 3; i++) { + CornerTableRow row = getRow(triangleIndex + i); + indexes.add(row.getVertexIndex()); + } + return indexes; + } + } + + diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTableRow.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTableRow.java index 07deb873ae87123981d7e42c62b31e92f6a6427d..5eb7514f78092860847e2e9cd89040bae14a1aa5 100644 --- a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTableRow.java +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTableRow.java @@ -1,23 +1,27 @@ package cz.fidentis.analyst.mesh.core; /** - * single row in corner table * - * @author Matej Lukes + * @author Matej LukeÅ¡ */ public class CornerTableRow { private int oppositeCornerIndex; private int vertexIndex; - /** - * Constructor of a row in corner - * @param vertexIndex index of associated vertex in MashFacet - * @param oppositeCornerIndex index of the opposite corner, -1 if there is no opposite corner - */ public CornerTableRow(int vertexIndex, int oppositeCornerIndex) { this.vertexIndex = vertexIndex; this.oppositeCornerIndex = oppositeCornerIndex; } + /** + * Copy constructor of a row in corner + * + * @param cornerTableRow copied row + */ + public CornerTableRow(CornerTableRow cornerTableRow) { + this.vertexIndex = cornerTableRow.getVertexIndex(); + this.oppositeCornerIndex = cornerTableRow.getOppositeCornerIndex(); + } + /** * returns vertex of corner @@ -35,10 +39,6 @@ public class CornerTableRow { return oppositeCornerIndex; } - /** - * sets index of the opposite corner - * @param index index of the opposite corner in corner table - */ public void setOppositeCornerIndex(int index) { this.oppositeCornerIndex = index; } diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshFacet.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshFacet.java index 74328019275457694749933698830ba5fe6055aa..285d0dd06fd8465818e7c1bd190dbb4cd06a203a 100644 --- a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshFacet.java +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshFacet.java @@ -2,55 +2,54 @@ package cz.fidentis.analyst.mesh.core; import java.util.ArrayList; import java.util.List; - /** - * MashFacet - * - * @author Matej Lukes + * + * @author Matej LukeÅ¡ */ + public class MeshFacet { private List<MeshPoint> vertices = new ArrayList<>(); private CornerTable cornerTable = new CornerTable(); /** - * returns vertex of specified index - * @param index index of vertex - * @return vertex + * Constructor of MeshFacet */ - public MeshPoint getVertex(int index) { - return vertices.get(index); + public MeshFacet() { + cornerTable = new CornerTable(); } /** - * adds vertex to MeshFacet - * @param point new vertex + * Copy constructor of MeshFacet + * + * @param facet copied MeshFacet */ + public MeshFacet(MeshFacet facet) { + for (MeshPoint vertex : + facet.vertices) { + vertices.add(new MeshPoint(vertex)); + } + cornerTable = new CornerTable(facet.cornerTable); + } + + + public MeshPoint getVertex(int c) { + return vertices.get(c); + } // vertex of c + public void addVertex(MeshPoint point){ vertices.add(point); } - /** - * returns number of vertices in MeshFacet - * @return number of vertices - */ public int getNumberOfVertices() { return vertices.size(); } - /** - * returns list of vertices in MeshFacet - * @return list if vertices - */ - public List<MeshPoint> getVertices() { - return vertices; - } - - /** - * returns Corner Table representing MeshFacet - * @return corner table - */ public CornerTable getCornerTable() { return cornerTable; } + + public List<MeshPoint> getVertices(){ + return vertices; + } + } - diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshModel.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshModel.java index 7966434fa301c4163ff8840eb94cc3364dec64bb..9d389325874596ddb1299b925c2ec8fca8860e1f 100644 --- a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshModel.java +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshModel.java @@ -4,26 +4,31 @@ import java.util.ArrayList; import java.util.List; /** - * MeshModel is a root node of the hierarchy * - * @author Matej Lukes + * @author Metej LukeÅ¡ */ public class MeshModel { + public MeshModel() {} + private List<MeshFacet> facets = new ArrayList<>(); - /** - * returns list of MeshFacets - * @return list of MeshFacets - */ public List<MeshFacet> getFacets() { return facets; } /** - * adds new MeshFacet to the model - * @param facet new MeshFacet + * Copy constructor of MeshModel + * + * @param meshModel copied MeshModel */ + public MeshModel(MeshModel meshModel) { + meshModel.facets.forEach((facet) -> { + facets.add(new MeshFacet(facet)); + }); + } + public void addFacet(MeshFacet facet) { facets.add(facet); } + } diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java index 159f1ea54d12c44558c51c13f8d89867460de955..73d74d4b011cdff855eef9d832e8b1550c866f4c 100644 --- a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java @@ -1,26 +1,17 @@ package cz.fidentis.analyst.mesh.core; - import javax.vecmath.Vector3d; /** - * MeshPoint represents a point with position, normal, and texture coordinates * - * @author Matej Lukes + * @author Matej LukeÅ¡ */ +//prerobenee public class MeshPoint { - private final Vector3d position, normal, texCoord; + protected Vector3d position, normal, texCoord; - /** - * constructor of meshPoint - * - * @param position position of MeshPoint - * @param normal normal of MeshPoint - * @param texCoord coordinates in texture - */ - public MeshPoint(Vector3d position, Vector3d normal, Vector3d texCoord) { - if (position == null) { + public MeshPoint(Vector3d position, Vector3d normal , Vector3d texCoord) { + if (position == null) throw new NullPointerException("position cannot be null"); - } this.position = position; this.normal = normal; @@ -47,7 +38,40 @@ public class MeshPoint { public Vector3d getTexCoord() { return texCoord; } + + /** + * copy constructor of meshPoint + * @param meshPoint copied meshPoint + */ + public MeshPoint(MeshPoint meshPoint) { + this.position = new Vector3d(meshPoint.position); + if (meshPoint.normal != null) { + this.normal = new Vector3d(meshPoint.normal); + } + if (meshPoint.texCoord != null) { + this.texCoord = new Vector3d(meshPoint.texCoord); + } + } + + + /** + * @param obj compared object + * @return true if positions, normals and texture coordinates are equal, false otherwise + */ + @Override + public boolean equals(Object obj) { + if (!(obj instanceof MeshPoint)) + return false; + + MeshPoint meshPointObj = (MeshPoint) obj; + return this.position.equals(meshPointObj.position); + } + @Override + public int hashCode() { + return position.hashCode(); + } + /** * returns new instance of MeshPoint with subtracted position * @@ -55,7 +79,7 @@ public class MeshPoint { * @return subtracted MeshPoint */ public MeshPoint subtractPosition(MeshPoint subtrahend) { - return subtractPosition(subtrahend.position); + return MeshPoint.this.subtractPosition(subtrahend.position); } /** @@ -67,7 +91,13 @@ public class MeshPoint { public MeshPoint subtractPosition(Vector3d subtrahend) { Vector3d newPosition = new Vector3d(position); newPosition.sub(subtrahend); - return new MeshPoint(new Vector3d(newPosition), normal, new Vector3d(texCoord)); + if (normal != null) { + if (texCoord != null) + return new MeshPoint(new Vector3d(newPosition), new Vector3d(normal), new Vector3d(texCoord)); + else + return new MeshPoint(new Vector3d(newPosition), new Vector3d(normal), null); + } + return new MeshPoint(new Vector3d(newPosition), null, null); } /** @@ -77,7 +107,7 @@ public class MeshPoint { * @return added MeshPoint */ public MeshPoint addPosition(MeshPoint addend) { - return addPosition(addend.position); + return MeshPoint.this.addPosition(addend.position); } /** @@ -89,78 +119,90 @@ public class MeshPoint { public MeshPoint addPosition(Vector3d addend) { Vector3d newPosition = new Vector3d(position); newPosition.add(addend); - return new MeshPoint(new Vector3d(newPosition), normal, new Vector3d(texCoord)); - } - - /** - * returns new instance of MeshPoint with subtracted normal - * - * @param subtrahend normal to be subtracted - * @return subtracted MeshPoint - */ - public MeshPoint subtractNormal(MeshPoint subtrahend) { - return subtractNormal(subtrahend.normal); - } - - /** - * returns new instance of MeshPoint with subtracted normal - * - * @param subtrahend normal to be subtracted - * @return subtracted MeshPoint - */ - public MeshPoint subtractNormal(Vector3d subtrahend) { - Vector3d newNormal = new Vector3d(normal); - newNormal.sub(subtrahend); - newNormal.normalize(); - return new MeshPoint(new Vector3d(position), newNormal, new Vector3d(texCoord)); + if (normal != null) { + if (texCoord != null) + return new MeshPoint(new Vector3d(newPosition), new Vector3d(normal), new Vector3d(texCoord)); + else + return new MeshPoint(new Vector3d(newPosition), new Vector3d(normal), null); + } + return new MeshPoint(new Vector3d(newPosition), null, null); } - /** - * returns new instance of MeshPoint with added normal - * - * @param addend normal to be added - * @return added MeshPoint - */ - public MeshPoint addNormal(MeshPoint addend) { - return addNormal(addend.normal); + /*public MeshPoint addPosition(MeshPoint b) { + return (new MeshPoint(new Vector3d(this.getPosition().x + b.getPosition().x, + this.getPosition().y + b.getPosition().y, this.getPosition().z + b.getPosition().z), + null, null)); + }*/ + + /* public MeshPoint subtractPosition(MeshPoint b) { + return (new MeshPoint(new Vector3d(this.getPosition().x - b.getPosition().x, + this.getPosition().y - b.getPosition().y, this.getPosition().z - b.getPosition().z), + null, null)); + }*/ + + public MeshPoint multiplyPosition(double number) { + if (normal != null) { + if (texCoord != null) + return new MeshPoint(new Vector3d(this.getPosition().x * number, + this.getPosition().y * number, this.getPosition().z * number), + new Vector3d(normal), new Vector3d(texCoord)); + else + return new MeshPoint(new Vector3d(this.getPosition().x * number, + this.getPosition().y * number, this.getPosition().z * number), + new Vector3d(normal), null); + } + return new MeshPoint(new Vector3d(this.getPosition().x * number, + this.getPosition().y * number, this.getPosition().z * number), + null, null); } - - /** - * returns new instance of MeshPoint with added normal - * - * @param addend normal to be added - * @return added MeshPoint - */ - public MeshPoint addNormal(Vector3d addend) { - Vector3d newNormal = new Vector3d(normal); - newNormal.add(addend); - newNormal.normalize(); - return new MeshPoint(new Vector3d(position), newNormal, new Vector3d(texCoord)); + + public MeshPoint dividePosition(double number) { + if (normal != null) { + if (texCoord != null) + return new MeshPoint(new Vector3d(this.getPosition().x / number, this.getPosition().y / number, + this.getPosition().z / number), new Vector3d(normal), new Vector3d(texCoord)); + else + return new MeshPoint(new Vector3d(this.getPosition().x / number, this.getPosition().y / number, + this.getPosition().z / number), new Vector3d(normal), null); + } + return new MeshPoint(new Vector3d(this.getPosition().x / number, this.getPosition().y / number, + this.getPosition().z / number), null, null); } - - /** - * @param obj compared object - * @return true if positions, normals and texture coordinates are equal, false otherwise + + /** + * Returns the cross product of two points. + @param meshPoint Second argument of the cross product operation. + * @return + @returns Point3D representing the resulting vector. */ - @Override - public boolean equals(Object obj) { - if (!(obj instanceof MeshPoint)) { - return false; + public MeshPoint crossProduct(MeshPoint meshPoint) { + if (normal != null) { + if (texCoord != null) + return new MeshPoint(new Vector3d + (this.position.y * meshPoint.position.z - this.position.z * meshPoint.position.y, + this.position.z * meshPoint.position.x - this.position.x * meshPoint.position.z, + this.position.x * meshPoint.position.y - this.position.y * meshPoint.position.x), + new Vector3d(normal), new Vector3d(texCoord)); + else + return new MeshPoint(new Vector3d + (this.position.y * meshPoint.position.z - this.position.z * meshPoint.position.y, + this.position.z * meshPoint.position.x - this.position.x * meshPoint.position.z, + this.position.x * meshPoint.position.y - this.position.y * meshPoint.position.x), + new Vector3d(normal), null); } - - MeshPoint meshPointObj = (MeshPoint) obj; - return this.position.equals(meshPointObj.position) - && this.normal.equals(meshPointObj.normal) - && this.texCoord.equals(meshPointObj.texCoord); + return new MeshPoint(new Vector3d + (this.position.y * meshPoint.position.z - this.position.z * meshPoint.position.y, + this.position.z * meshPoint.position.x - this.position.x * meshPoint.position.z, + this.position.x * meshPoint.position.y - this.position.y * meshPoint.position.x), + null, null); } - /** - * returns hash of MeshPoint - * - * @return hash - */ - @Override - public int hashCode() { - return position.hashCode() + normal.hashCode() + texCoord.hashCode(); + public double dotProduct(MeshPoint meshPoint) { + return (this.position.x * meshPoint.position.x + this.position.y * meshPoint.position.y + this.position.z * meshPoint.position.z); + } + + public double abs() { + return Math.sqrt(this.getPosition().x * this.getPosition().x + + this.getPosition().y * this.getPosition().y + this.getPosition().z * this.getPosition().z); } } diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshModelExporter.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshModelExporter.java new file mode 100644 index 0000000000000000000000000000000000000000..c91805e2e906da04f1afa1cc3648ab0e23e8e2c1 --- /dev/null +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshModelExporter.java @@ -0,0 +1,221 @@ +package cz.fidentis.analyst.mesh.io; +/** + * + * @author Natália Bebjaková + * + * Creates new directory and exports model to .obj file in this created directory + * Exports model's vertices and normals, if there are some + */ +import cz.fidentis.analyst.mesh.core.MeshFacet; +import cz.fidentis.analyst.mesh.core.MeshModel; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Locale; + +/** + * + * @author Natalia Bebjakova + */ +public class MeshModelExporter { + /** + * Helping representation of triangle in symmetry estimate + */ + private class Triangle { + protected int vertex1; + protected int vertex2; + protected int vertex3; + + /** + * Creates new triangle + * + * @param v1 first vertex + * @param v2 second vertex + * @param v3 third vertex + */ + public Triangle(int v1, int v2, int v3) { + this.vertex1 = v1; + this.vertex2 = v2; + this.vertex3 = v3; + } + /** + * + * @return first vertex of triangle + */ + public int getVertex1() { + return vertex1; + } + + /** + * + * @param vertex1 new vertex + */ + public void setVertex1(int vertex1) { + this.vertex1 = vertex1; + } + + /** + * + * @return second vertex of triangle + */ + public int getVertex2() { + return vertex2; + } + + /** + * + * @param vertex2 new vertex + */ + public void setVertex2(int vertex2) { + this.vertex2 = vertex2; + } + + /** + * + * @return third vertex of triangle + */ + public int getVertex3() { + return vertex3; + } + + /** + * + * @param vertex3 new vertex + */ + public void setVertex3(int vertex3) { + this.vertex3 = vertex3; + } + + /** + * Triangles are same if they have same vertices + * + * @param obj other triangle + * @return true if two triangles are same + */ + @Override + public boolean equals(Object obj) { + if (obj instanceof Triangle) { + Triangle t = (Triangle)obj; + if (((this.vertex1 == t.vertex1) || (this.vertex1 == t.vertex2) || (this.vertex1 == t.vertex3)) && + ((this.vertex2 == t.vertex1) || (this.vertex2 == t.vertex2) || (this.vertex2 == t.vertex3)) && + ((this.vertex3 == t.vertex1) || (this.vertex3 == t.vertex2) || (this.vertex3 == t.vertex3))) + return (true); + } + return (false); + } + + /** + * + * @return hascode of the triangle + */ + @Override + public int hashCode() { + return (this.vertex1 * 100 ^ this.vertex2 * 100 ^ this.vertex3); + } + } + + /** + * Model to be exported + */ + MeshModel model; + + /** + * + * @param model model to be exported. + */ + public MeshModelExporter(MeshModel model) { + this.model = model; + } + + /** + * + * @param exportFile + * @throws IOException + */ + public void exportModelToObj(File exportFile) throws IOException { + for(MeshFacet facet : model.getFacets()) { + exportFacetToObj(facet, exportFile); + } + } + + /** + * Export model to OBJ file. + * @param facet Facet of the model to be exported, so far every model has one + * @param exportFile file for exporting. + * @throws java.io.IOException + */ + public void exportFacetToObj(MeshFacet facet, File exportFile) throws IOException { + int formatIndex = exportFile.getName().lastIndexOf("."); + String fileName; //name that is writen to file + + if (formatIndex < 0) { + fileName = exportFile.getName(); + } else { + fileName = exportFile.getName().substring(0, formatIndex); + } + + File exportDirectory = new File(exportFile.getParent() + File.separator + fileName); //directory for export + exportDirectory.mkdir(); //creates new directory + + exportFile = new File(exportDirectory + File.separator + fileName + ".obj"); + + try (FileWriter fstream = new FileWriter(exportFile); + BufferedWriter out = new BufferedWriter(fstream);) { + + out.write("mtllib " + fileName + ".mtl" + "\n"); + + DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(Locale.getDefault()); + otherSymbols.setDecimalSeparator('.'); //dot as separator for decimal numbers + DecimalFormat df = new DecimalFormat("#.####", otherSymbols); + + //writes vertices of the facet to file + for (int j = 0; j < facet.getNumberOfVertices(); j++) { + out.write("v " + df.format(facet.getVertices().get(j).getPosition().x) + " " + + df.format(facet.getVertices().get(j).getPosition().y) + " " + + df.format(facet.getVertices().get(j).getPosition().z) + "\n"); + } + out.write("#" + facet.getNumberOfVertices() + " vertices" + "\n"); + + //detects if first vertex has normal + boolean hasAllNormals = facet.getVertices().get(0).getNormal() != null; + + //writes normals if there are any + for (int i = 0; i < facet.getNumberOfVertices(); i++) { + if(facet.getVertex(i).getNormal() != null) { + out.write("vn " + df.format(facet.getVertices().get(i).getNormal().x) + " " + + df.format(facet.getVertices().get(i).getNormal().y) + " " + + df.format(facet.getVertices().get(i).getNormal().z) + "\n"); + } + } + + //computes triangles of facet + Triangle[] triangles = new Triangle[facet.getCornerTable().getSize() / 3]; + for (int i = 0; i < facet.getCornerTable().getSize(); i += 3) { + Triangle t = new Triangle(facet.getCornerTable().getRow(i).getVertexIndex(), + facet.getCornerTable().getRow(i + 1).getVertexIndex(), + facet.getCornerTable().getRow(i + 2).getVertexIndex()); + triangles[(i / 3)] = t; + } + + //writes triangles of facet + for (Triangle triangle : triangles) { + out.write("f "); + if (facet.getVertex(triangle.getVertex1()).getNormal() != null && hasAllNormals) { + out.write((triangle.getVertex1() + 1) + "//" + (triangle.getVertex1() + 1) + " " + + (triangle.getVertex2() + 1) + "//" + (triangle.getVertex2() + 1) + " " + + (triangle.getVertex3() + 1) + "//" + (triangle.getVertex3() + 1) + "\n"); + } else { + out.write((triangle.getVertex1() + 1) + " " + (triangle.getVertex2() + 1) + + " " + (triangle.getVertex3() + 1) + "\n"); + } + } + out.write("\n"); + out.close(); + fstream.close(); + } + } +} + diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/ModelFileFilter.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/ModelFileFilter.java similarity index 50% rename from GUI/src/main/java/cz/fidentis/analyst/gui/ModelFileFilter.java rename to MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/ModelFileFilter.java index 7fc0b83cd3c632480d7e81ccc1452f9030d0acd4..f87113270dfc3fb4ad4459e12d2c30f76643e8f6 100644 --- a/GUI/src/main/java/cz/fidentis/analyst/gui/ModelFileFilter.java +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/ModelFileFilter.java @@ -1,39 +1,50 @@ -package cz.fidentis.analyst.gui; +package cz.fidentis.analyst.mesh.io; import java.io.File; import javax.swing.filechooser.FileFilter; /** - * * @author Natalia Bebjakova + * + * Enables to choose just extensions we want in the filechooser */ public class ModelFileFilter extends FileFilter { - private String[] extension; - private String description; - + private final String[] extension; + private final String description; + + /** + * + * @param extension Extentions of files + * @param description Description + */ public ModelFileFilter(String[] extension, String description) { this.extension = extension; this.description = description; } + /** + * + * @param f File + * @return Whether file has chosen extension or not + */ @Override public boolean accept(File f) { boolean accepted = false; - for (int i=0; i<extension.length;i++) { - if(f.isDirectory() || f.getName().endsWith(extension[i])) { + for (int i = 0; i< extension.length; i++) { + if(f.isDirectory() || f.getName().endsWith(extension[i])) { accepted = true; } } return accepted; } - - /* - * @see javax.swing.filechooser.FileFilter + + /** + * + * @return description */ - @Override public String getDescription() { return description;