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 18 package j3d; 19 20 import java.awt.Color; 21 import java.awt.Dimension; 22 23 import javax.swing.tree.DefaultTreeModel; 24 25 /** 26 * @author pc58410 27 * 28 */ 29 public interface Canvas3D { 30 31 public static final byte GRAPHICSMODE_WIREFRAME=0; 32 public static final byte GRAPHICSMODE_SURFACE=1; 33 public static final byte GRAPHICSMODE_SOLID=2; 34 public static final byte GRAPHICSMODE_NADA=-1; 35 public static final byte RENDERMODE_HIDE=0; 36 public static final byte RENDERMODE_SHADE=1; 37 public static final byte RENDERMODE_RENDER=2; 38 public static final Color SELECTCOLOR=Color.red; 39 //public static float GRADIENTCONTRAST=0.2f; 40 //public static int GRADIENTCOLOR=50; 41 public static final byte GRIDPLANE_XY=0; 42 public static final byte GRIDPLANE_YZ=1; 43 public static final byte GRIDPLANE_XZ=2; 44 public static final int MESH_Dummy_2=0; 45 public static final int MESH_Rod_2=1; 46 public static final int MESH_Beam_2=2; 47 public static final int MESH_Beam_Spring_2=3; 48 public static final int MESH_Contact_Line=4; 49 public static final int MESH_Contact_Triangle=5; 50 public static final int MESH_Dummy_4=6; 51 public static final int MESH_Shell_C0_3=7; 52 public static final int MESH_Shell_BT_4=8; 53 public static final int MESH_Solid_Iso_6=9; 54 public static final int MESH_Shell_Opt_3_or_4=10; 55 public static final int MESH_Solid_Iso_4=11; 56 57 // Codes for handling of geometry 58 public static final int NONE = 0; 59 public static final int CURVE = 1; 60 public static final int SURFACE = 2; 61 public static final int VOLUME = 3; 62 public static final double PICKDISTANCE = 50; // Picking sensing distance squared (d*d) 63 public static final double MINMESHANGLE = 2; // Minimum value of B for acceptable mesh 64 65 view_top()66 public void view_top(); 67 view_sw()68 public void view_sw(); 69 view_se()70 public void view_se(); 71 view_scale(float f)72 public void view_scale(float f); 73 view_right()74 public void view_right(); 75 view_reset()76 public void view_reset(); 77 view_repaint()78 public void view_repaint(); 79 view_nw()80 public void view_nw(); 81 view_ne()82 public void view_ne(); 83 view_left()84 public void view_left(); 85 view_front()86 public void view_front(); 87 view_bottom()88 public void view_bottom(); 89 view_back()90 public void view_back(); 91 view_all()92 public void view_all(); 93 tree_reset()94 public void tree_reset(); 95 transform3D(Matrix3D m)96 public void transform3D(Matrix3D m); 97 showhide()98 public boolean showhide(); 99 setSize(Dimension dimension)100 public void setSize(Dimension dimension); 101 setCenterOfRotation()102 public void setCenterOfRotation(); 103 setBackground(Color white)104 public void setBackground(Color white); 105 save_Image(String st)106 public void save_Image(String st); 107 repaint()108 public void repaint(); 109 removeSelectedObjects3D()110 public void removeSelectedObjects3D(); 111 clearSelectOnAllObjects3D()112 public void clearSelectOnAllObjects3D(); 113 remove_all()114 public void remove_all(); 115 rebuild()116 public void rebuild(); 117 projectObjects()118 public void projectObjects(); 119 intersectObjects()120 public void intersectObjects(); 121 breakObjects()122 public void breakObjects(); 123 getSelectedObjects3D()124 public _Object[] getSelectedObjects3D(); 125 getSelectedObject3D()126 public _Object getSelectedObject3D(); 127 getAllObjects3D()128 public _Object[] getAllObjects3D(); 129 getAllNodes3D()130 public _Node[] getAllNodes3D(); 131 getAllElements3D()132 public _Object[] getAllElements3D(); 133 getAllGeometry3D()134 public _Geometry[] getAllGeometry3D(); 135 getAllGroups3D()136 public _Group[] getAllGroups3D(); 137 duplicate()138 public void duplicate(); 139 addBorderObjects()140 public void addBorderObjects(); 141 add3D(Object obj)142 public int add3D(Object obj); 143 getSHOW_ID_NODE()144 public boolean getSHOW_ID_NODE(); 145 setSHOW_ID_NODE(boolean show_id_node)146 public void setSHOW_ID_NODE(boolean show_id_node); 147 getBGCOLOR()148 public Color getBGCOLOR(); 149 setBGCOLOR(Color bgcolor)150 public void setBGCOLOR(Color bgcolor); 151 getDRAFTMODE()152 public boolean getDRAFTMODE(); 153 setDRAFTMODE(boolean draftmode)154 public void setDRAFTMODE(boolean draftmode); 155 getGRAPHICSMODE()156 public byte getGRAPHICSMODE(); 157 setGRAPHICSMODE(byte graphicsmode)158 public void setGRAPHICSMODE(byte graphicsmode); 159 getGRIDCOLOR()160 public Color getGRIDCOLOR(); 161 setGRIDCOLOR(Color gridcolor)162 public void setGRIDCOLOR(Color gridcolor); 163 getGRIDLEVEL()164 public float getGRIDLEVEL(); 165 setGRIDLEVEL(float gridlevel)166 public void setGRIDLEVEL(float gridlevel); 167 getGRIDMODE()168 public boolean getGRIDMODE(); 169 setGRIDMODE(boolean gridmode)170 public void setGRIDMODE(boolean gridmode); 171 getGRIDPLANE()172 public byte getGRIDPLANE(); 173 setGRIDPLANE(byte gridplane)174 public void setGRIDPLANE(byte gridplane); 175 getGRIDSIZE()176 public float getGRIDSIZE(); 177 setGRIDSIZE(float gridsize)178 public void setGRIDSIZE(float gridsize); 179 getLIMITS()180 public float[] getLIMITS(); 181 setLIMITS(float[] limits)182 public void setLIMITS(float[] limits); 183 getNODE_MERGE_TOLERANCE()184 public float getNODE_MERGE_TOLERANCE(); 185 setNODE_MERGE_TOLERANCE(float node_merge_tolerance)186 public void setNODE_MERGE_TOLERANCE(float node_merge_tolerance); 187 getNODESIZE()188 public int getNODESIZE(); 189 setNODESIZE(int nodesize)190 public void setNODESIZE(int nodesize); 191 getPOINTSIZE()192 public int getPOINTSIZE(); 193 setPOINTSIZE(int pointsize)194 public void setPOINTSIZE(int pointsize); 195 getRENDERMODE()196 public byte getRENDERMODE(); 197 setRENDERMODE(byte rendermode)198 public void setRENDERMODE(byte rendermode); 199 getSHOW_ID_CONSTRAINTS()200 public boolean getSHOW_ID_CONSTRAINTS(); 201 setSHOW_ID_CONSTRAINTS(boolean show_id_constraints)202 public void setSHOW_ID_CONSTRAINTS(boolean show_id_constraints); 203 getSHOW_ID_ELEMENT()204 public boolean getSHOW_ID_ELEMENT(); 205 setSHOW_ID_ELEMENT(boolean show_id_element)206 public void setSHOW_ID_ELEMENT(boolean show_id_element); 207 getSHOW_ID_LOADS()208 public boolean getSHOW_ID_LOADS(); 209 setSHOW_ID_LOADS(boolean show_id_loads)210 public void setSHOW_ID_LOADS(boolean show_id_loads); 211 getSHOW_ID_MATERIALS()212 public boolean getSHOW_ID_MATERIALS(); 213 setSHOW_ID_MATERIALS(boolean show_id_materials)214 public void setSHOW_ID_MATERIALS(boolean show_id_materials); 215 getSHOW_ID_TRACKERS()216 public boolean getSHOW_ID_TRACKERS(); 217 setSHOW_ID_TRACKERS(boolean show_id_trackers)218 public void setSHOW_ID_TRACKERS(boolean show_id_trackers); 219 getSTLCOLOR()220 public Color getSTLCOLOR(); 221 setSTLCOLOR(Color stlcolor)222 public void setSTLCOLOR(Color stlcolor); 223 getVMatrix3D()224 public Matrix3D getVMatrix3D(); 225 setVMatrix3D(Matrix3D matrix3D)226 public void setVMatrix3D(Matrix3D matrix3D); 227 getTree3d()228 public DefaultTreeModel getTree3d(); 229 getGeometricTolerance()230 public float getGeometricTolerance(); 231 setGeometricTolerance(float geometricTolerance)232 public void setGeometricTolerance(float geometricTolerance); 233 setVisible(boolean v)234 public void setVisible(boolean v); 235 replaceAllInstancesOf(_Object o, _Object replacement)236 public void replaceAllInstancesOf(_Object o, _Object replacement); 237 238 } 239