annotate run/bug_20041226_E.d @ 1559:ec5e144583ea

D1 -> D2 : 1/N
author thomask
date Sun, 19 Aug 2007 19:11:54 +0000
parents 6e4063f99377
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
219
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
1 // $HeadURL$
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
2 // $Date$
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
3 // $Author$
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
4
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
5 // @author@ h3r3tic <foo@bar.baz>
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
6 // @date@ 2004-12-26
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
7 // @uri@ news:cqmufn$26oj$1@digitaldaemon.com
1487
6e4063f99377 changed nntp: URLs to http: URLs
thomask
parents: 1383
diff changeset
8 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2606
219
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
9
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
10 module dstress.run.bug_20041226_E;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
11
678
f9e1d827a255 div. fixes
thomask
parents: 248
diff changeset
12 void dummy(...){
219
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
13 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
14
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
15 struct vec3{
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
16 vec3 opSub(vec3 a){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
17 vec3 x;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
18 return x;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
19 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
20 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
21
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
22 struct Face{
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
23 vec3 a;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
24 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
25
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
26 struct Mesh{
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
27 Face[] faces;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
28 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
29
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
30 struct GeomObject{
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
31 Mesh mesh;
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1487
diff changeset
32 string name;
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1487
diff changeset
33 vec3 xlate;
219
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
34 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
35
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
36 class AseLoader{
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
37 this(){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
38 GeomObject go;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
39 go.name = "NODE";
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
40 geomObjects ~= go;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
41 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
42
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
43 GeomObject[] geomObjects;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
44 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
45
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
46
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
47 void extractTriangles(GeomObject geomObj){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
48 void foobar(){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
49 try{
678
f9e1d827a255 div. fixes
thomask
parents: 248
diff changeset
50 dummy("name: ", geomObj.name);
219
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
51
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
52 return;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
53 }catch(Object err){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
54 throw err;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
55 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
56 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
57
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
58 foobar();
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
59 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
60
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
61 int main(){
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
62 try{
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
63 AseLoader al = new AseLoader;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
64
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
65 foreach(GeomObject go; al.geomObjects){
678
f9e1d827a255 div. fixes
thomask
parents: 248
diff changeset
66 dummy("processing ", go.name);
219
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
67 extractTriangles(go);
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
68 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
69 }catch(Object err){
678
f9e1d827a255 div. fixes
thomask
parents: 248
diff changeset
70 dummy("Exception caught:", err);
219
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
71 }
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
72
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
73 return 0;
249516e487f9 h3r3tic <foo@bar.baz>
thomask
parents:
diff changeset
74 }
678
f9e1d827a255 div. fixes
thomask
parents: 248
diff changeset
75