Also update the URL to the CeCILL license. Thanks to Paul for noticing that
[scilab.git] / scilab / modules / renderer / src / java / org / scilab / modules / renderer / JoGLView / interaction / TwoPointsRubberBox.java
1 /*
2  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  * Copyright (C) 2012 - Scilab Enterprises - Bruno JOFRET
4  *
5  * This file must be used under the terms of the CeCILL.
6  * This source file is licensed as described in the file COPYING, which
7  * you should have received as part of this distribution.  The terms
8  * are also available at
9  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
10  */
11
12 package org.scilab.modules.renderer.JoGLView.interaction;
13
14 import java.awt.Point;
15
16 import org.scilab.forge.scirenderer.tranformations.Vector3d;
17 import org.scilab.modules.renderer.JoGLView.DrawerVisitor;
18
19 /**
20  * @author Bruno JOFRET
21  */
22 public class TwoPointsRubberBox extends RubberBox implements PointRubberBox {
23
24     /**
25      * Default constructor.
26      *
27      * @param drawerVisitor parent drawer visitor.
28      */
29     public TwoPointsRubberBox(DrawerVisitor drawerVisitor) {
30         super(drawerVisitor);
31     }
32
33     public double[] getResults() {
34         double result[] = {
35             mouseButton - 1,
36             Math.min(firstPoint.getX(), secondPoint.getX()),
37             Math.max(firstPoint.getY(), secondPoint.getY()),
38             Math.max(firstPoint.getZ(), secondPoint.getZ()),
39             Math.abs(firstPoint.getX() - secondPoint.getX()),
40             Math.abs(firstPoint.getY() - secondPoint.getY()),
41             Math.abs(firstPoint.getZ() - secondPoint.getZ())
42         };
43
44         return result;
45     }
46 }