Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TEveTriangleSetEditor.cxx
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #include "TEveTriangleSetEditor.h"
13 #include "TEveTriangleSet.h"
14 
15 #include "TGWidget.h"
16 #include "TGLabel.h"
17 
18 /** \class TEveTriangleSetEditor
19 \ingroup TEve
20 Editor for TEveTriangleSet class.
21 */
22 
23 ClassImp(TEveTriangleSetEditor);
24 
25 ////////////////////////////////////////////////////////////////////////////////
26 /// Constructor.
27 
28 TEveTriangleSetEditor::TEveTriangleSetEditor(const TGWindow *p, Int_t width, Int_t height,
29  UInt_t options, Pixel_t back) :
30  TGedFrame(p, width, height, options | kVerticalFrame, back),
31  fM (0),
32  fInfo (0)
33 {
34  MakeTitle("TEveTriangleSet");
35 
36  fInfo = new TGLabel(this);
37  fInfo->SetTextJustify(kTextLeft);
38  AddFrame(fInfo, new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 8, 0, 2, 0));
39 }
40 
41 ////////////////////////////////////////////////////////////////////////////////
42 /// Set model object.
43 
44 void TEveTriangleSetEditor::SetModel(TObject* obj)
45 {
46  fM = dynamic_cast<TEveTriangleSet*>(obj);
47 
48  fInfo->SetText(Form("Vertices: %d, Triangles: %d", fM->GetNVerts(), fM->GetNTrings()));
49 }