1 /*****************************************************************************
2 * Virtual Mockup for Machine Vision
3 * Copyright (C) 2001-2003 Fabio R. de Miranda, João E. Kogler Jr.,
4 * Carlos S. Santos.
5 * Virtual Mockup for Machine Vision Project funded by SENAC-SP
6 *
7 * Permission is granted to redistribute and/or modify this
8 * software under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License (http://www.gnu.org/copyleft/lesser.html)
16 * for more details.
17 *
18 *****************************************************************************/
19
20 package camera3d.action;
21
22
23
24 import camera3d.GeometryBag;
25 import camera3d.J3DBase;
26
27 /***
28 * Action for clearing (erasing) geometry associated with GeometryBags.
29 * @author Carlos da Silva dos Santos e Fábio de Miranda
30 * @version 1.0
31 */
32
33 public class ClearGizmosAction extends GeometryBagAction {
34
35 public static final int LINES = 0;
36 public static final int POINTS = 1;
37 public static final int PLANES = 2;
38 public static final int ALL = 3;
39
40 private int clearRange;
41
42 public ClearGizmosAction(int clearRange) {
43 this.clearRange = clearRange;
44 }
45
46 public void doAction(ActionExecutor exec){
47 J3DBase base = exec.getJ3DBase();
48 if (geometryBag == null){
49 geometryBag = base.getDefaultGeometryBag();
50 }
51
52 switch (clearRange) {
53 case LINES:
54 geometryBag.clearLines();
55 break;
56 case POINTS:
57 geometryBag.clearPoints();
58 break;
59 case PLANES:
60 geometryBag.clearPlanes();
61 break;
62 case ALL:
63 geometryBag.clearAll();
64 break;
65 }
66
67
68 }
69 }
This page was automatically generated by Maven