32 ClassImp(TEveProjectable);
37 TEveProjectable::TEveProjectable()
45 TEveProjectable::~TEveProjectable()
47 while ( ! fProjectedList.empty())
49 TEveProjected* p = fProjectedList.front();
50 p->UnRefProjectable(
this);
51 TEveElement* el = p->GetProjectedAsElement();
54 gEve->PreDeleteElement(el);
65 void TEveProjectable::AnnihilateProjecteds()
67 for (ProjList_i i=fProjectedList.begin(); i!=fProjectedList.end(); ++i)
69 (*i)->UnRefProjectable(
this, kFALSE);
70 (*i)->GetProjectedAsElement()->Annihilate();
72 fProjectedList.clear();
77 void TEveProjectable::ClearProjectedList()
79 fProjectedList.clear();
86 void TEveProjectable::AddProjectedsToSet(std::set<TEveElement*>& set)
88 for (ProjList_i i=fProjectedList.begin(); i!=fProjectedList.end(); ++i)
90 set.insert((*i)->GetProjectedAsElement());
99 void TEveProjectable::PropagateVizParams(TEveElement* el)
102 el =
dynamic_cast<TEveElement*
>(
this);
104 for (ProjList_i i=fProjectedList.begin(); i!=fProjectedList.end(); ++i)
106 (*i)->GetProjectedAsElement()->CopyVizParams(el);
113 void TEveProjectable::PropagateRenderState(Bool_t rnr_self, Bool_t rnr_children)
115 for (ProjList_i i=fProjectedList.begin(); i!=fProjectedList.end(); ++i)
117 if ((*i)->GetProjectedAsElement()->SetRnrSelfChildren(rnr_self, rnr_children))
118 (*i)->GetProjectedAsElement()->ElementChanged();
125 void TEveProjectable::PropagateMainColor(Color_t color, Color_t old_color)
127 for (ProjList_i i=fProjectedList.begin(); i!=fProjectedList.end(); ++i)
129 if ((*i)->GetProjectedAsElement()->GetMainColor() == old_color)
130 (*i)->GetProjectedAsElement()->SetMainColor(color);
138 void TEveProjectable::PropagateMainTransparency(Char_t t, Char_t old_t)
140 for (ProjList_i i=fProjectedList.begin(); i!=fProjectedList.end(); ++i)
142 if ((*i)->GetProjectedAsElement()->GetMainTransparency() == old_t)
143 (*i)->GetProjectedAsElement()->SetMainTransparency(t);
156 ClassImp(TEveProjected);
161 TEveProjected::TEveProjected() :
173 TEveProjected::~TEveProjected()
175 if (fProjectable) fProjectable->RemoveProjected(
this);
183 TEveElement* TEveProjected::GetProjectedAsElement()
185 return dynamic_cast<TEveElement*
>(
this);
193 void TEveProjected::SetProjection(TEveProjectionManager* mng, TEveProjectable* model)
196 if (fProjectable) fProjectable->RemoveProjected(
this);
197 fProjectable = model;
198 if (fProjectable) fProjectable->AddProjected(
this);
204 void TEveProjected::UnRefProjectable(TEveProjectable* assumed_parent,
bool notifyParent)
206 static const TEveException eH(
"TEveProjected::UnRefProjectable ");
208 R__ASSERT(fProjectable == assumed_parent);
210 if (notifyParent) fProjectable->RemoveProjected(
this);
219 void TEveProjected::SetDepth(Float_t d)
221 if (fManager->GetProjection()->Is2D())
236 void TEveProjected::SetDepthCommon(Float_t d, TEveElement* el, Float_t* bbox)
238 Float_t delta = d - fDepth;
243 el->StampTransBBox();
250 void TEveProjected::SetDepthLocal(Float_t d)