]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Customise camera and selector action 92/3392/1
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Wed, 23 Oct 2019 07:42:56 +0000 (10:42 +0300)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Wed, 23 Oct 2019 07:42:56 +0000 (10:42 +0300)
gitlab #29

Change-Id: I5bc9d1511c3a3f714b38888a32861de712aa8a2e

org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/swt/vtkCameraAndSelectorAction.java
org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java

index 56255631f4c06918f0b58279f7e7a4ba1b09e632..7eb4cfc93d7d0df69ea3a6adc181b0360b693256 100644 (file)
@@ -194,8 +194,8 @@ public class vtkCameraAndSelectorAction extends vtkSwtAction implements ISelecti
                return true;
        }
 
-       private List<vtkProp> selectActors = new ArrayList<vtkProp>();
-       private List<vtkProp> hoverActor = new ArrayList<vtkProp>();
+       protected List<vtkProp> selectActors = new ArrayList<vtkProp>();
+       protected List<vtkProp> hoverActor = new ArrayList<vtkProp>();
 
        @Override
        public boolean mouseClicked(MouseEvent e) {
@@ -327,7 +327,7 @@ public class vtkCameraAndSelectorAction extends vtkSwtAction implements ISelecti
                        fireSelectionChanged();
        }
 
-       private void fireSelectionChanged() {
+       protected void fireSelectionChanged() {
                Display.getDefault().asyncExec(new Runnable() {
                        @Override
                        public void run() {
index 8387650bb68d5cf7410a53862a2963580d5885bc..82d592c4d4b8b8c0c95652b81b4d6819f72dd899 100644 (file)
@@ -132,7 +132,7 @@ public class Plant3DEditor extends ResourceEditorPart {
                
                new ContextMenuListener(panel, contextMenu);
                
-               cameraAction = new vtkCameraAndSelectorAction(panel);   
+               cameraAction = createCameraAction();
                panel.setDefaultAction(cameraAction);
                panel.useDefaultAction();
                panel.setPickType(4);
@@ -208,6 +208,10 @@ public class Plant3DEditor extends ResourceEditorPart {
                
        }
        
+       protected vtkCameraAndSelectorAction createCameraAction() {
+           return new vtkCameraAndSelectorAction(panel); 
+       }
+       
        protected void createActions() {
                translateAction = new TranslateAction(panel,nodeMap);
                translateInlineAction = new TranslateInlineAction(panel, nodeMap);