Added flipping right/left for the lattices as part of the building process.
authorabokinsky <abokinsky@ba61647d-9d00-f842-95cd-605cb4296b96>
Mon, 12 Feb 2018 19:17:24 +0000 (19:17 +0000)
committerabokinsky <abokinsky@ba61647d-9d00-f842-95cd-605cb4296b96>
Mon, 12 Feb 2018 19:17:24 +0000 (19:17 +0000)
git-svn-id: https://citdcbmipav.cit.nih.gov/repos-pub/mipav/trunk@15372 ba61647d-9d00-f842-95cd-605cb4296b96

mipav/src/gov/nih/mipav/view/renderer/WildMagic/VOI/VOILatticeManagerInterface.java
mipav/src/gov/nih/mipav/view/renderer/WildMagic/WormUntwisting/LatticeModel.java
mipav/src/plugins/PlugInDialogVolumeRender.java

index df61bbe..e970615 100644 (file)
@@ -437,6 +437,12 @@ public class VOILatticeManagerInterface extends VOIManagerInterface
                        movingPickedPoint = false;\r
                }\r
        }\r
+       \r
+       public void flipLattice() {\r
+               if ( latticeModel != null ) {\r
+                       latticeModel.flipLattice();\r
+               }\r
+       }\r
 \r
        public boolean is3DMouseEnabled()\r
        {\r
index 4f4de84..21814c0 100644 (file)
@@ -854,6 +854,16 @@ public class LatticeModel {
                showSelectedVOI = null;\r
                showSelected = null;\r
        }\r
+       \r
+       public void flipLattice() {\r
+               Vector3f temp = new Vector3f();\r
+               for ( int i = 0; i < left.size(); i++ ) {\r
+                       temp.copy(left.elementAt(i));\r
+                       left.elementAt(i).copy(right.elementAt(i));\r
+                       right.elementAt(i).copy(temp);\r
+               }\r
+               updateLattice(true);\r
+       }\r
 \r
        public int getCurrentIndex()\r
        {\r
index 2389275..45330c1 100644 (file)
@@ -163,6 +163,7 @@ public class PlugInDialogVolumeRender extends JFrame implements ActionListener,
        private JPanel lutPanel;\r
 \r
        private JButton newLatticeButton; \r
+       private JButton flipLatticeButton; \r
        private JCheckBox displayModel;\r
 \r
        private JButton nextButton;\r
@@ -523,8 +524,18 @@ public class PlugInDialogVolumeRender extends JFrame implements ActionListener,
                                }\r
                                latticeSelectionPanel.removeAll();\r
                                latticeSelectionPanel.add(newLatticeButton);\r
+                               latticeSelectionPanel.add(flipLatticeButton);\r
+                               latticeSelectionPanel.add(displayModel);\r
+                               displayModel.setSelected(false);\r
                                this.validate();\r
                        }\r
+                       else if ( command.equals("flipLattice" ) )\r
+                       {\r
+                               if ( voiManager != null )\r
+                               {\r
+                                       voiManager.flipLattice();\r
+                               }                               \r
+                       }\r
                        else if ( command.equals("displayModel") )\r
                        {\r
                                if ( voiManager != null )\r
@@ -1154,6 +1165,7 @@ public class PlugInDialogVolumeRender extends JFrame implements ActionListener,
                                                }\r
                                        }\r
                                        latticeSelectionPanel.add(newLatticeButton);\r
+                                       latticeSelectionPanel.add(flipLatticeButton);\r
                                        latticeSelectionPanel.add(displayModel);\r
                                        displayModel.setSelected(false);\r
                                        latticeSelectionPanel.setVisible(true);\r
@@ -1766,8 +1778,14 @@ public class PlugInDialogVolumeRender extends JFrame implements ActionListener,
                newLatticeButton.setActionCommand("newLattice");\r
                newLatticeButton.setVisible(true);\r
                newLatticeButton.setEnabled(true);\r
-\r
                latticeSelectionPanel.add(newLatticeButton);\r
+\r
+               flipLatticeButton = gui.buildButton("flip lattice");\r
+               flipLatticeButton.addActionListener(this);\r
+               flipLatticeButton.setActionCommand("flipLattice");\r
+               flipLatticeButton.setVisible(true);\r
+               flipLatticeButton.setEnabled(true);\r
+               latticeSelectionPanel.add(flipLatticeButton);\r
                                \r
                displayModel = gui.buildCheckBox("Show Model", false);\r
                displayModel.addActionListener(this);\r