Line | |
---|
1 | #ifndef _LWOBJECT_H_ |
---|
2 | #define _LWOBJECT_H_ |
---|
3 | |
---|
4 | #include "lwo.h" |
---|
5 | #include "lwEnvelope.h" |
---|
6 | #include "lwClip.h" |
---|
7 | #include "lwLayer.h" |
---|
8 | |
---|
9 | class lwObject |
---|
10 | { |
---|
11 | public: |
---|
12 | lwObject() |
---|
13 | { |
---|
14 | tagsoffset = 0; |
---|
15 | } |
---|
16 | |
---|
17 | ~lwObject() |
---|
18 | { |
---|
19 | unsigned int i; |
---|
20 | |
---|
21 | for (i=0; i < layers.size(); delete layers[i++]); |
---|
22 | for (i=0; i < envelopes.size(); delete envelopes[i++]); |
---|
23 | for (i=0; i < clips.size(); delete clips[i++]); |
---|
24 | for (i=0; i < surfaces.size(); i++) |
---|
25 | { |
---|
26 | lwSurface *s = surfaces[i]; |
---|
27 | if(s) |
---|
28 | { |
---|
29 | for (unsigned int j = i+1; j < surfaces.size(); j++) |
---|
30 | if (s == surfaces[j]) surfaces[j] = 0; |
---|
31 | delete s; |
---|
32 | } |
---|
33 | } |
---|
34 | for (i=0; i < tags.size(); free(tags[i++])); |
---|
35 | } |
---|
36 | |
---|
37 | lwClip *lwFindClip( int index ) |
---|
38 | { |
---|
39 | for (unsigned int i = 0; i < clips.size(); i++) |
---|
40 | if (clips[i]->index == index) |
---|
41 | return clips[i]; |
---|
42 | return 0; |
---|
43 | } |
---|
44 | |
---|
45 | lwEnvelope *lwFindEnvelope( int index ) |
---|
46 | { |
---|
47 | for (unsigned int i = 0; i < envelopes.size(); i++) |
---|
48 | if (envelopes[i]->index == index) |
---|
49 | return envelopes[i]; |
---|
50 | return 0; |
---|
51 | } |
---|
52 | |
---|
53 | vlayers layers; /* linked list of layers */ |
---|
54 | venvelopes envelopes; /* linked list of envelopes */ |
---|
55 | vclips clips; /* linked list of clips */ |
---|
56 | vsurfaces surfaces; /* linked list of surfaces */ |
---|
57 | int tagsoffset; |
---|
58 | vtags tags; /* array of strings */ |
---|
59 | }; |
---|
60 | |
---|
61 | typedef vector<lwObject*> vobjects; |
---|
62 | |
---|
63 | #endif // _LWOBJECT_H_ |
---|
64 | |
---|
Note: See
TracBrowser
for help on using the repository browser.