]>
Commit | Line | Data |
---|---|---|
32e219c2 | 1 | // $Header$ |
2 | ||
3 | #include "NLTBases.h" | |
4 | #include "Reve/NLTPolygonSet.h" | |
5 | ||
6 | using namespace Reve; | |
7 | ||
8 | //______________________________________________________________________ | |
9 | // NLTProjectable | |
10 | // | |
11 | ||
12 | ClassImp(NLTProjectable) | |
13 | ||
14 | NLTProjectable::NLTProjectable() | |
15 | {} | |
16 | ||
17 | NLTProjectable::~NLTProjectable() | |
18 | { | |
19 | while ( ! fProjectedList.empty()) | |
20 | { | |
21 | fProjectedList.front()->UnRefProjectable(this); | |
22 | } | |
23 | } | |
24 | ||
32e219c2 | 25 | //______________________________________________________________________ |
26 | // NLTProjected | |
27 | // | |
28 | ||
29 | ClassImp(NLTProjected) | |
30 | ||
31 | NLTProjected::NLTProjected() : | |
32 | fProjector (0), | |
33 | fProjectable (0), | |
34 | fDepth (0) | |
35 | {} | |
36 | ||
37 | NLTProjected::~NLTProjected() | |
38 | { | |
39 | if (fProjectable) fProjectable->RemoveProjected(this); | |
40 | } | |
41 | ||
42 | void NLTProjected::SetProjection(NLTProjector* proj, NLTProjectable* model) | |
43 | { | |
44 | fProjector = proj; | |
45 | if (fProjectable) fProjectable->RemoveProjected(this); | |
46 | fProjectable = model; | |
47 | fProjectable->AddProjected(this); | |
48 | } | |
49 | ||
50 | void NLTProjected::UnRefProjectable(NLTProjectable* assumed_parent) | |
51 | { | |
52 | static const Exc_t eH("NLTProjected::UnRefProjectable "); | |
53 | ||
54 | if (fProjectable != assumed_parent) { | |
55 | Warning(eH, "mismatch between assumed and real model. This is a bug."); | |
56 | assumed_parent->RemoveProjected(this); | |
57 | return; | |
58 | } | |
59 | ||
60 | if (fProjectable) { | |
61 | fProjectable->RemoveProjected(this); | |
62 | fProjectable = 0; | |
712d9715 | 63 | } |
32e219c2 | 64 | } |