193 (*p)->RemoveElementLocal(
this);
194 (*p)->fChildren.remove(
this);
195 --((*p)->fNumChildren);
202 i->fTree->DeleteItem(i->fItem);
215 gEve->PreDeleteElement(
this);
251 dest->
AddElement((*i)->CloneElementRecurse(level));
265 static const TEveException eh(
"TEveElement::GetElementName ");
268 return named ? named->
GetName() :
"<no-name>";
278 static const TEveException eh(
"TEveElement::GetElementTitle ");
281 return named ? named->
GetTitle() :
"<no-title>";
292 static const TEveException eh(
"TEveElement::SetElementName ");
309 static const TEveException eh(
"TEveElement::SetElementTitle ");
326 static const TEveException eh(
"TEveElement::SetElementNameTitle ");
403 if ( ! fallback_tag.
IsNull())
412 Warning(
"TEveElement::ApplyVizTag",
"entry for tag '%s' not found in VizDB.", tag.
Data());
448 (*i)->CopyVizParams(el);
481 Warning(
"TEveElement::CopyVizParamsFromDB",
"VizModel has not been set.");
501 TString intro =
" TAG='" + tag +
"', CLASS='" + cls +
"'";
502 out <<
" //" << intro <<
"\n";
504 out << t << cls <<
"* " << var <<
" = new " << cls <<
";\n";
508 out << t <<
"gEve->InsertVizDBEntry(\"" << tag <<
"\", "<< var <<
");\n";
575 Warning(
"VizDB_UpdateModel",
"VizModel has not been set.");
591 Error(
"VizDB_Insert",
"Creation of replica failed.");
622 return (*i)->GetMaster();
665 if (
gEve->GetUseOrphanage())
671 gEve->GetOrphanage()->AddElement(
this);
693 (*p)->CollectSceneParents(scenes);
708 if (*p != parent) (*p)->CollectSceneParents(scenes);
713 (*c)->CollectSceneParentsFromChildren(scenes,
this);
733 (*i)->AddIntoListTree(ltree, parent);
760 static const TEveException eh(
"TEveElement::AddIntoListTree ");
763 ltree->
AddItem(parent_lti, item);
766 if (parent_lti ==
nullptr)
771 (*i)->AddIntoListTree(ltree, item);
788 if (parent ==
nullptr) {
793 if (i->fTree == ltree)
824 static const TEveException eh(
"TEveElement::RemoveFromListTree ");
832 if (parent_lti ==
nullptr) {
848 static const TEveException eh(
"TEveElement::RemoveFromListTrees ");
858 (plti ==
nullptr && parent ==
nullptr))
861 j->fTree->DeleteItem(j->fItem);
862 j->fTree->ClearViewPort();
864 if (parent ==
nullptr)
870 if (parent ==
nullptr && count > 0)
884 if (i->fTree == ltree)
897 if (i->fTree == ltree && i->fItem->
GetParent() == parent_lti)
910 if (i->fTree == ltree)
923 if (i->fTree == ltree && i->fItem->
GetParent() == parent_lti)
939 throw(eh +
"not a TObject.");
940 return const_cast<TObject*
>(obj);
949 gEve->EditElement(
this);
958 gROOT->ProcessLine(
TString::Format(
"%s* %s = (%s*)0x%zx;", cname, var_name, cname, (
size_t)
this));
967 static const TEveException eh(
"TEveElement::DumpSourceObject ");
971 throw eh +
"source-object not set.";
982 static const TEveException eh(
"TEveElement::PrintSourceObject ");
986 throw eh +
"source-object not set.";
997 static const TEveException eh(
"TEveElement::ExportSourceObjectToCINT ");
1001 throw eh +
"source-object not set.";
1003 const char* cname =
so->IsA()->GetName();
1021 (*i)->PadPaint(option);
1034 static const TEveException eh(
"TEveElement::PaintStandard ");
1046 Int_t reqSections =
gPad->GetViewer3D()->AddObject(buff);
1049 Warning(eh,
"IsA='%s'. Viewer3D requires more sections (%d). Only direct-rendering supported.",
1050 id->ClassName(), reqSections);
1213 if (t > 100) t = 100;
1226 if (alpha < 0) alpha = 0;
1227 if (alpha > 1) alpha = 1;
1327 throw(eh +
Form(
"parent '%s' rejects '%s'.",
1377 (*i)->RemoveParent(
this);
1482 if (
name.CompareTo((*i)->GetElementName()) == 0)
1501 if (regexp.
MatchB((*i)->GetElementName()))
1522 if (
name.CompareTo((*i)->GetElementName()) == 0)
1526 matches.push_back(*i);
1546 if (regexp.
MatchB((*i)->GetElementName()))
1550 matches.push_back(*i);
1582 (*i)->SetRnrSelf(rnr_self);
1583 (*i)->SetRnrChildren(rnr_children);
1600 (*i)->SetRnrSelf(rnr_self);
1601 (*i)->SetRnrChildren(rnr_children);
1612 static const TEveException eh(
"TEveElement::AnnihilateRecursively ");
1629 (*i)->AnnihilateRecursively();
1653 Warning(eh,
"More than one parent for '%s': %d. Refusing to delete.",
1670 fParents.front()->RemoveElement(
this);
1703 throw eh +
TString::Format(
"element '%s' (%s*) 0x%zx is protected against destruction.",
1716 static const TEveException eh(
"TEveElement::DestroyOrWarn ");
1733 static const TEveException eh(
"TEveElement::DestroyElements ");
1738 if (
c->fDenyDestroy <= 0)
1744 Warning(eh,
"element destruction failed: '%s'.", exc.
Data());
1751 Info(eh,
"element '%s' is protected agains destruction, removing locally.",
c->GetElementName());
1842 gEve->AddElement(el,
this);
1852 gEve->ElementChanged(
this, update_scenes, redraw);
1863 (*i)->SetPickableRecursively(p);
2021 gEve->GetSelection()->RecheckImpliedSetForElement(
this);
2024 gEve->GetHighlight()->RecheckImpliedSetForElement(
this);
2067 return b ?
"kTRUE" :
"kFALSE";
ULong_t Pixel_t
Pixel value.
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
int Int_t
Signed integer 4 bytes (int).
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char).
char Char_t
Character 1 byte (char).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
short Color_t
Color number (short).
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Generic 3D primitive description class.
void SetSectionsValid(UInt_t mask)
TClass instances represent classes, structs and namespaces in the ROOT type system.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
TClass * IsA() const override
static Int_t GetColor(const char *hexcolor)
Description of TEveCompound.
void UpdateProjection() override
This is abstract method from base-class TEveProjected.
TEveElementListProjected()
Constructor.
TEveElementList(const char *n="TEveElementList", const char *t="", Bool_t doColor=kFALSE, Bool_t doTransparency=kFALSE)
Constructor.
TClass * ProjectedClass(const TEveProjection *p) const override
Virtual from TEveProjectable, returns TEveCompoundProjected class.
Bool_t AcceptElement(TEveElement *el) override
Check if TEveElement el is inherited from fChildClass.
TEveElementList * CloneElement() const override
Clone the element via copy constructor.
Structure holding information about TGListTree and TGListTreeItem that represents given TEveElement.
virtual void AnnihilateRecursively()
Protected member function called from TEveElement::Annihilate().
virtual void ExportToCINT(char *var_name)
Export render-element to Cling with variable name var_name.
virtual void AddStamp(UChar_t bits)
Add (bitwise or) given stamps to fChangeBits.
virtual TEveTrans * PtrMainTrans(Bool_t create=kTRUE)
Return pointer to main transformation.
virtual Bool_t SingleRnrState() const
void SaveVizParams(std::ostream &out, const TString &tag, const TString &var)
Save visualization parameters for this element with given tag.
virtual void SelectElement(Bool_t state)
Set element's selection state. Stamp appropriately.
virtual void InitMainTrans(Bool_t can_edit=kTRUE)
Initialize the main transformation to identity matrix.
virtual void AddElement(TEveElement *el)
Add el to the list of children.
void SetMainColorPixel(Pixel_t pixel)
Convert pixel to Color_t and call SetMainColor().
virtual Bool_t SetRnrSelfChildren(Bool_t rnr_self, Bool_t rnr_children)
Set state for rendering of this element and its children.
virtual void FillImpliedSelectedSet(Set_t &impSelSet)
Populate set impSelSet with derived / dependant elements.
void DumpSourceObject() const
Call Dump() on source object.
Bool_t TestCSCBits(UChar_t f) const
virtual void CloneChildrenRecurse(TEveElement *dest, Int_t level=0) const
Clone children and attach them to the dest element.
virtual void ProjectAllChildren(Bool_t same_depth=kTRUE)
If this is a projectable, loop over all projected replicas and add the projected image of all childre...
virtual void SetElementNameTitle(const char *name, const char *title)
Virtual function for setting of name and title of render element.
virtual TEveElement * ForwardSelection()
Returns element to be selected on click.
virtual TGListTreeItem * AddIntoListTrees(TEveElement *parent)
Add this render element into all list-trees and all items belonging to parent.
virtual void SetMainTransparency(Char_t t)
Set main-transparency.
virtual void PropagateVizParamsToElements(TEveElement *el=nullptr)
Propagate visualization parameters from element el (defaulting to this) to all elements (children).
Bool_t fDestroyOnZeroRefCnt
void StampColorSelection()
void SpawnEditor()
Show GUI editor for this object.
static const TGPicture * fgRnrIcons[4]
virtual UChar_t GetSelectedLevel() const
Get selection level, needed for rendering selection and highlight feedback.
virtual sLTI_i FindItem(TGListTree *ltree)
Find any list-tree-item of this element in list-tree 'ltree'.
virtual void HighlightElement(Bool_t state)
Set element's highlight state. Stamp appropriately.
virtual void NameTitleChanged()
Virtual function called when a name or title of the element has been changed.
virtual void DestroyMainTrans()
Destroy the main transformation matrix, it will always be taken as identity.
virtual void DestroyListSubTree(TGListTree *ltree, TGListTreeItem *parent)
Destroy sub-tree under item 'parent' in list-tree 'ltree'.
Int_t fParentIgnoreCnt
! Counter for parents that are ignored in ref-counting.
virtual TClass * IsA() const
void VizDB_UpdateModel(Bool_t update=kTRUE)
Copy visual parameters from this element to viz-db model.
virtual void ProjectChild(TEveElement *el, Bool_t same_depth=kTRUE)
If this is a projectable, loop over all projected replicas and add the projected image of child 'el' ...
sLTI_t fItems
! Set of list-tree-items.
void VizDB_Insert(const char *tag, Bool_t replace=kTRUE, Bool_t update=kTRUE)
Create a replica of element and insert it into VizDB with given tag.
void * fUserData
! Externally assigned and controlled user data.
virtual void CheckReferenceCount(const TEveException &eh="TEveElement::CheckReferenceCount ")
Check external references to this and eventually auto-destruct the render-element.
TEveElement * FirstChild() const
Returns the first child element or 0 if the list is empty.
void DecDenyDestroy()
Decreases the deny-destroy count of the element.
Bool_t GetDestroyOnZeroRefCnt() const
Returns state of flag determining if the element will be destroyed when reference count reaches zero.
virtual TEveTrans & RefMainTrans()
Return reference to main transformation.
void VizDB_Reapply()
Reset visual parameters for this object from VizDB.
virtual void RemoveElements()
Remove all elements.
void PrintSourceObject() const
Call Print() on source object.
void ExportSourceObjectToCINT(char *var_name) const
Export source object to Cling with given name for the variable.
Bool_t fCanEditMainTransparency
virtual void RemoveParent(TEveElement *re)
Remove re from the list of parents.
virtual TEveElement * CloneElement() const
Clone the element via copy constructor.
virtual void IncImpliedHighlighted()
Increase element's implied-highlight count. Stamp appropriately.
Bool_t HasChildren() const
Short_t fImpliedHighlighted
!
Bool_t ApplyVizTag(const TString &tag, const TString &fallback_tag="")
Set the VizTag, find model-element from the VizDB and copy visualization-parameters from it.
virtual void ExpandIntoListTree(TGListTree *ltree, TGListTreeItem *parent)
Populates parent with elements.
virtual void PropagateVizParamsToProjecteds()
Propagate visualization parameters to dependent elements.
virtual TGListTreeItem * FindListTreeItem(TGListTree *ltree)
Find any list-tree-item of this element in list-tree 'ltree'.
virtual void CollectSceneParents(List_t &scenes)
Collect all parents of class TEveScene.
std::list< TEveElement * > List_t
virtual void SetMainColor(Color_t color)
Set main color of the element.
void IncDenyDestroy()
Increases the deny-destroy count of the element.
TEveElement * GetMaster()
Returns the master element - that is:
@ kCSCBTakeAnyParentAsMaster
virtual const char * GetElementTitle() const
Virtual function for retrieving title of the render-element.
virtual TEveElement * CloneElementRecurse(Int_t level=0) const
Clone elements and recurse 'level' deep over children.
virtual void SetElementTitle(const char *title)
Virtual function for setting of title of an element.
void DecParentIgnoreCnt()
Decrease number of parents ignored in reference-counting.
virtual void DecImpliedHighlighted()
Decrease element's implied-highlight count. Stamp appropriately.
virtual Int_t RemoveFromListTrees(TEveElement *parent)
Remove element from all list-trees where 'parent' is the user-data of the parent list-tree-item.
virtual Bool_t SetRnrChildren(Bool_t rnr)
Set render state of this element's children, i.e.
void SetMainColorRGB(UChar_t r, UChar_t g, UChar_t b)
Convert RGB values to Color_t and call SetMainColor.
Bool_t FindVizModel()
Find model element in VizDB that corresponds to previously assigned fVizTag and set fVizModel accordi...
TEveElement * FindChild(const TString &name, const TClass *cls=nullptr)
Find the first child with given name.
virtual ~TEveElement()
Destructor.
void SetPickableRecursively(Bool_t p)
Set pickable state on the element and all its children.
virtual void RemoveElementsInternal()
Remove all elements.
Short_t fImpliedSelected
!
void DisableListElements(Bool_t rnr_self=kFALSE, Bool_t rnr_children=kFALSE)
Disable rendering of children and their list contents.
void VizDB_Apply(const char *tag)
Set visual parameters for this object for given tag.
virtual void Destroy()
Destroy this element.
virtual void PreDeleteElement()
Called before the element is deleted, thus offering the last chance to detach from acquired resources...
virtual void SetElementName(const char *name)
Virtual function for setting of name of an element.
Int_t GetDenyDestroy() const
Returns the number of times deny-destroy has been requested on the element.
void RecheckImpliedSelections()
Call this if it is possible that implied-selection or highlight has changed for this element or for i...
virtual void DestroyElements()
Destroy all children of this element.
std::set< TEveElement * > Set_t
void SetVizTag(const TString &tag)
virtual void PropagateMainColorToProjecteds(Color_t color, Color_t old_color)
Propagate color to projected elements.
virtual void UnHighlighted()
Virtual function called when both fHighlighted is false and fImpliedHighlighted is 0.
void SetMainAlpha(Float_t alpha)
Set main-transparency via float alpha variable.
virtual Color_t GetMainColor() const
virtual void SetTransMatrix(Double_t *carr)
Set transformation matrix from column-major array.
void SetMainColorPtr(Color_t *color)
TEveElement * fVizModel
! Element used as model from VizDB.
Int_t fTopItemCnt
! Counter for top-level list-tree items that prevent automatic destruction.
virtual TObject * GetRenderObject(const TEveException &eh) const
virtual Bool_t SetRnrState(Bool_t rnr)
Set render state of this element and of its children to the same value.
virtual void ElementChanged(Bool_t update_scenes=kTRUE, Bool_t redraw=kFALSE)
Call this after an element has been changed so that the state can be propagated around the framework.
List_t::const_iterator List_ci
virtual TGListTreeItem * AddIntoListTree(TGListTree *ltree, TGListTreeItem *parent_lti)
Add this element into ltree to an already existing item parent_lti.
virtual void Annihilate()
Optimized destruction without check of reference-count.
TObject * GetSourceObject() const
void SetVizModel(TEveElement *model)
Set visualization-parameter model element.
virtual void RemoveElement(TEveElement *el)
Remove el from the list of children.
virtual Bool_t GetRnrChildren() const
virtual Bool_t HandleElementPaste(TEveElement *el)
React to element being pasted or dnd-ed.
virtual void DecImpliedSelected()
Decrease element's implied-selection count. Stamp appropriately.
virtual void CollectSceneParentsFromChildren(List_t &scenes, TEveElement *parent)
Collect scene-parents from all children.
virtual const char * GetElementName() const
Virtual function for retrieving name of the element.
TEveElement()
Default constructor.
Int_t GetParentIgnoreCnt() const
Get number of parents that should be ignored in doing reference-counting.
virtual Bool_t AcceptElement(TEveElement *el)
Check if el can be added to this element.
Bool_t HasChild(TEveElement *el)
Check if element el is a child of this element.
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
static const char * ToString(Bool_t b)
Convert Bool_t to string - kTRUE or kFALSE.
virtual void PropagateRnrStateToProjecteds()
Propagate render state to the projected replicas of this element.
virtual void PadPaint(Option_t *option)
Paint self and/or children into currently active pad.
virtual void RemoveElementLocal(TEveElement *el)
Perform additional local removal of el.
virtual void PropagateMainTransparencyToProjecteds(Char_t t, Char_t old_t)
Propagate transparency to projected elements.
static const TGPicture * fgListTreeIcons[9]
virtual Char_t GetMainTransparency() const
virtual void DestroyOrWarn()
Destroy this element. Prints a warning if deny-destroy is in force.
virtual void IncImpliedSelected()
Increase element's implied-selection count. Stamp appropriately.
virtual void AnnihilateElements()
Annihilate elements.
virtual Bool_t GetRnrSelf() const
Int_t FindChildren(List_t &matches, const TString &name, const TClass *cls=nullptr)
Find all children with given name and append them to matches list.
virtual const TGPicture * GetListTreeCheckBoxIcon()
Returns list-tree-item check-box picture appropriate for given rendering state.
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write-out visual parameters for this object.
virtual void CopyVizParamsFromDB()
Copy visualization parameters from the model-element fVizModel.
void SetDestroyOnZeroRefCnt(Bool_t d)
Sets the state of flag determining if the element will be destroyed when reference count reaches zero...
sLTI_t::reverse_iterator sLTI_ri
virtual TObject * GetObject(const TEveException &eh) const
Get a TObject associated with this render-element.
virtual const TGPicture * GetListTreeIcon(Bool_t open=kFALSE)
Returns pointer to first listtreeicon.
Int_t fDenyDestroy
! Deny-destroy count.
virtual Bool_t RemoveFromListTree(TGListTree *ltree, TGListTreeItem *parent_lti)
Remove element from list-tree 'ltree' where its parent item is 'parent_lti'.
TEveElement * LastChild() const
Returns the last child element or 0 if the list is empty.
virtual void RemoveElementsLocal()
Perform additional local removal of all elements.
void IncParentIgnoreCnt()
Increase number of parents ignored in reference-counting.
virtual TEveElement * ForwardEdit()
Returns element to be displayed in GUI editor on click.
virtual void PaintStandard(TObject *id)
Paint object – a generic implementation for EVE elements.
virtual Bool_t SetRnrSelf(Bool_t rnr)
Set render state of this element, i.e.
void EnableListElements(Bool_t rnr_self=kTRUE, Bool_t rnr_children=kTRUE)
Enable rendering of children and their list contents.
virtual void AddParent(TEveElement *re)
Add re into the list parents.
virtual void UnSelected()
Virtual function called when both fSelected is false and fImpliedSelected is 0.
virtual Bool_t HasMainTrans() const
Exception class thrown by TEve classes and macros.
Special list-tree-item for Eve.
Abstract base-class for non-linear projectable objects.
virtual void ClearProjectedList()
virtual void PropagateVizParams(TEveElement *el=nullptr)
Set visualization parameters of projecteds.
virtual void PropagateMainTransparency(Char_t t, Char_t old_t)
Set main transparency of projecteds if their transparency is the same as the old one.
virtual void AddProjectedsToSet(std::set< TEveElement * > &set)
Add the projected elements to the set, dyn-casting them to TEveElement.
virtual void PropagateRenderState(Bool_t rnr_self, Bool_t rnr_children)
Set render state of projecteds.
ProjList_i EndProjecteds()
ProjList_i BeginProjecteds()
virtual Bool_t HasProjecteds() const
TEveProjectable(const TEveProjectable &)
virtual void AnnihilateProjecteds()
Optimized destroy of projected elements with condition there is only one parent for projected element...
virtual void PropagateMainColor(Color_t color, Color_t old_color)
Set main color of projecteds if their color is the same as old_color.
std::list< TEveProjected * >::iterator ProjList_i
Abstract base class for classes that hold results of a non-linear projection transformation.
TEveProjectable * GetProjectable() const
Manager class for steering of projections and managing projected objects.
virtual Int_t SubImportChildren(TEveElement *el, TEveElement *proj_parent)
Recursively import children elements of el and apply projection to the newly imported objects.
virtual TEveElement * SubImportElements(TEveElement *el, TEveElement *proj_parent)
Recursively import elements and apply projection to the newly imported objects.
void SetCurrentDepth(Float_t d)
Float_t GetCurrentDepth() const
Base-class for non-linear projections.
TEveTrans is a 4x4 transformation matrix for homogeneous coordinates stored internally in a column-ma...
void SetBuffer3D(TBuffer3D &buff)
Fill transformation part TBuffer3D core section.
void SetFrom(Double_t *carr)
virtual void ClearViewPort()
Clear view port and redraw full content.
TGListTreeItem * GetFirstChild() const
TGListTreeItem * GetNextSibling() const
virtual void * GetUserData() const =0
A list tree is a widget that can contain a number of items arranged in a tree structure.
void AddItem(TGListTreeItem *parent, TGListTreeItem *item)
Add given item to list tree.
Int_t DeleteItem(TGListTreeItem *item)
Delete item from list tree.
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
const TGWindow * GetParent() const
Geometrical transformation package.
The TNamed class is the base class for all named ROOT classes.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Mother of all ROOT objects.
virtual TClass * IsA() const
virtual void Paint(Option_t *option="")
This method must be overridden if a class wants to paint itself.
Bool_t MatchB(const TString &s, const TString &mods="", Int_t start=0, Int_t nMaxMatch=10)
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.