1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License as
4  * published by the Free Software Foundation; either version 2 of the
5  * License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful, but
8  * WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOUSE. See the GNU
10  * General Public License for more details.
11  *
12  * You should have recieved a copy of the GNU General Public License
13  * along with this program; if not write to the Free Software
14  * Foundation, inc., 59 Temple Place, Suite 330, Boston MA 02111-1307
15  * USA
16  */
17 package j3d;
18 import java.awt.event.KeyEvent;
19 import java.awt.geom.Rectangle2D;
20 import javax.swing.tree.*;
21 import javax.swing.*;
22 import gui.*;
23 /**
24  * Insert the type's description here.
25  *
26  * @author: Yuriy Mikhaylovskiy
27  */
28 
29 public abstract class _Object implements Cloneable{
30   public int master_type = Canvas3D.NONE;
31   public int geometry_type = Canvas3D.NONE;
32   protected String Id;
33   public boolean selected = false;
34   public boolean processed = false;
35   protected boolean add = false;
36   protected int input_pointer = 0;
37   protected boolean show = true;
38   protected PreProcessor PreP;
39   protected Canvas3D J3D;
40   protected Circle circle;
41 
42 // *******************************************************
43 
get_Array(Canvas3D j3d)44   public abstract Object[] get_Array(Canvas3D j3d);
45 
reset(boolean do_mesh)46   public abstract void reset(boolean do_mesh);
47 
get_Nodes()48   public abstract _Node[] get_Nodes();
49 
get_Elements()50   public abstract _Object[] get_Elements();
51 
replaceObjectWith(_Object o, _Object replacement)52   public abstract void replaceObjectWith(_Object o, _Object replacement);
53 
transform3D(Matrix3D trans)54   public abstract void transform3D(Matrix3D trans);
55 
mesh(int type, float size)56   public abstract void mesh(int type, float size);
57 
deselectRequiredObjects()58   public abstract void deselectRequiredObjects();
59 
isSelected()60   public abstract boolean isSelected();
61 
isPickPoint(int x, int y, boolean show, boolean openGL)62   public abstract boolean isPickPoint(int x, int y, boolean show, boolean openGL);
63 
isPickPoint(Rectangle2D r, boolean show, boolean openGL)64   public abstract boolean isPickPoint(Rectangle2D r, boolean show, boolean openGL);
65 
setSelected(boolean sel)66   public abstract void setSelected(boolean sel);
67 
get_Id()68   public String get_Id(){ return Id; }
69 
set_Id(String id)70   public void set_Id(String id){ Id=id; }
71 
get_TreeNode()72   public abstract MutableTreeNode get_TreeNode();
73 
getEditPanel(Canvas3D j3d, PreProcessor pp)74   public abstract JPanel getEditPanel(Canvas3D j3d, PreProcessor pp);
75 
duplicate(Canvas3D j3d, boolean add)76   public abstract _Object duplicate(Canvas3D j3d, boolean add);
77 
getMaster_type()78   public int getMaster_type() {
79       return master_type;
80   }
setMaster_type(int master_type)81   public void setMaster_type(int master_type) {
82       this.master_type = master_type;
83   }
getGeometryType()84   public int getGeometryType() {
85       return geometry_type;
86   }
setGeometryType(int type)87   public void setGeometryType(int type) {
88       this.geometry_type = type;
89   }
90 
getCenter()91   public Vector3D getCenter() {
92       return new Vector3D(0.0f,0.0f,0.0f);
93   }
94 
isProcessed()95   public boolean isProcessed() {
96       return processed;
97   }
setProcessed(boolean processed)98   public void setProcessed(boolean processed) {
99       this.processed = processed;
100   }
101 
requestFocus()102   public void requestFocus() {
103 
104   }
105 
requestAction()106   public void requestAction() {
107 
108   }
109 
setShow(boolean s)110   public void setShow(boolean s) {
111       show = s;
112   }
113 
isShow()114   public boolean isShow() {
115       return show;
116   }
117 
getBorderObjects()118   public _Object[] getBorderObjects() {
119       return null;
120   }
121 
checkDefaultKey(KeyEvent e)122   protected void checkDefaultKey(KeyEvent e) {
123 
124       if (e.getKeyCode() == KeyEvent.VK_ESCAPE) PreP.clearEditPanel();
125 
126   }
127 
setCircle(Circle c)128   public void setCircle(Circle c) {
129       circle = c;
130   }
131 
getCircle()132   public Circle getCircle() {
133       return circle;
134   }
135 
136 }