示例#1
0
 def __init__(self):
     ViewableMesh.__init__(self, palette)
     self.setSelectionType(Viewable.SelectionType.CELL)
示例#2
0
	def __init__(self):
		ViewableMesh.__init__(self, palette)
		self.setSelectionType(Viewable.SelectionType.CELL)
示例#3
0
文件: view.py 项目: GaneshPatil/jCAE
if (len(args) != 1):
	parser.print_usage()
	sys.exit(1)

xmlDir = args[0]

frame = JFrame("jCAE Demo")
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
canvas = View()
frame.add(canvas, BorderLayout.CENTER)

if (os.path.isdir(xmlDir)):
	if (os.path.exists(os.path.join(xmlDir, "jcae3d"))):
		reader = AmibeToMesh(xmlDir)
		viewable = ViewableMesh(Palette(32))
		viewable.addTriangles(reader.getTriangles())
		viewable.addBeams(reader.getBeams())
	elif (os.path.exists(os.path.join(xmlDir, "oemm"))):
		oemm = Storage.readOEMMStructure(xmlDir)
		viewable = ViewableOEMM(oemm)
	else:
		raise IOError, "Cannot find file"
elif (xmlDir.endswith(".unv")):
	viewable = ViewableMesh(UNVToMesh(xmlDir, Collections.EMPTY_LIST).getMesh())
else:
	viewable = ViewableCAD(xmlDir)
canvas.add(viewable)
frame.setSize(800,600)

class MyKeyListener(KeyListener):
示例#4
0
文件: view.py 项目: ikanaris/jCAE-1
if (len(args) != 1):
    parser.print_usage()
    sys.exit(1)

xmlDir = args[0]

frame = JFrame("jCAE Demo")
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
canvas = View()
frame.add(canvas, BorderLayout.CENTER)

if (os.path.isdir(xmlDir)):
    if (os.path.exists(os.path.join(xmlDir, "jcae3d"))):
        reader = AmibeToMesh(xmlDir)
        viewable = ViewableMesh(Palette(32))
        viewable.addTriangles(reader.getTriangles())
        viewable.addBeams(reader.getBeams())
    elif (os.path.exists(os.path.join(xmlDir, "oemm"))):
        oemm = Storage.readOEMMStructure(xmlDir)
        viewable = ViewableOEMM(oemm)
    else:
        raise IOError, "Cannot find file"
elif (xmlDir.endswith(".unv")):
    viewable = ViewableMesh(
        UNVToMesh(xmlDir, Collections.EMPTY_LIST).getMesh())
else:
    viewable = ViewableCAD(xmlDir)
canvas.add(viewable)
frame.setSize(800, 600)