#include "TEveGedEditor.h"
#include "TEveElement.h"
#include "TEveManager.h"
#include "TGedFrame.h"
#include "TGCanvas.h"
#include "TCanvas.h"
#include "TClass.h"
ClassImp(TEveGedEditor);
TEveGedEditor::TEveGedEditor(TCanvas* canvas, Int_t width, Int_t height) :
TGedEditor(canvas),
fElement (0),
fObject (0)
{
Resize(width, height);
TClass* amClass = TClass::GetClass("TAttMarker");
TClass* edClass = TClass::GetClass("TAttMarkerEditor");
TGWindow *exroot = (TGWindow*) fClient->GetRoot();
fClient->SetRoot(fTabContainer);
SetFrameCreator(this);
TGedFrame *frame = reinterpret_cast<TGedFrame*>(edClass->New());
frame->SetModelClass(amClass);
{
Int_t off = edClass->GetDataMemberOffset("fPriority");
if (off == 0)
Warning("TEveGedEditor::TEveGedEditor", "Can't fix priority for TAttMarkerEditor.\n");
else
* (Int_t*) (((char*)frame) + off) = 1;
}
SetFrameCreator(0);
fClient->SetRoot(exroot);
fFrameMap.Add(amClass, frame);
}
TEveElement* TEveGedEditor::GetEveElement() const
{
return (fModel == fObject) ? fElement : 0;
}
void TEveGedEditor::DisplayElement(TEveElement* re)
{
static const TEveException eh("TEveGedEditor::DisplayElement ");
fElement = re;
fObject = fElement ? fElement->GetEditorObject(eh) : 0;
TGedEditor::SetModel(fPad, fObject, kButton1Down);
}
void TEveGedEditor::DisplayObject(TObject* obj)
{
fElement = dynamic_cast<TEveElement*>(obj);
fObject = obj;
TGedEditor::SetModel(fPad, obj, kButton1Down);
}
void TEveGedEditor::SetModel(TVirtualPad* pad, TObject* obj, Int_t event)
{
fElement = dynamic_cast<TEveElement*>(obj);
fObject = obj;
TGedEditor::SetModel(pad, obj, event);
}
void TEveGedEditor::Update(TGedFrame* )
{
if (fElement) {
fElement->ElementChanged();
fElement->PropagateVizParamsToProjecteds();
}
gEve->Redraw3D();
}
Last change: Wed Jun 25 08:37:04 2008
Last generated: 2008-06-25 08:37
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.