ROOT logo
// $Id: ZGeoNode.h 2088 2008-11-23 20:26:46Z matevz $

// Copyright (C) 1999-2008, Matevz Tadel. All rights reserved.
// This file is part of GLED, released under GNU General Public License version 2.
// For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.

#ifndef RootGeo_ZGeoNode_H
#define RootGeo_ZGeoNode_H

#include <Glasses/ZNode.h>
#include <Stones/ZColor.h>
#include <Stones/GeoUserData.h>


#include <TObject.h>
#include <TGeoNode.h>
#include <TGeoManager.h>
#include <TRegexp.h>

class TGeoMatrix;

class ZGeoNode : public ZNode
{
  // 7777 RnrCtrl(RnrBits(2,4,6,0, 0,0,0,3))
  MAC_RNR_FRIENDS(ZGeoNode);
  friend class ZGeoOvlMgr;

private:
  void _init();
  void _assert_tnode(const Exc_t& _eh, bool ggeo_fallbackp=false);

protected:
  TGeoNode	       *mTNode;     //! X{g}
  // only restored reference to TGeoNode is its name
  TString               mTNodeName; // X{GS}
  Int_t			mNNodes;    // X{G}   7 ValOut(-join=>1);
  Float_t		mNodeAlpha; // X{GS}  7 Value(-range=>[0,1,1,1000])
  TString               mMaterial;  // X{GS}  7 Textor(-join=>1)
  ZColor		mColor;     // X{GSP} 7 ColorButt()
  TString		mDefFile;   // X{GS} 7 Filor()

  void setup_ztrans(ZNode* zn, const TGeoMatrix* gm);
  void setup_color(Float_t alpha);

  ZGeoNode* insert_node(TGeoNode* geon, ZNode* holder, const Text_t* name);
  TGeoNode* get_tnode_search_point();
  ZGeoNode* set_holder(lStr_t& node_names);
  Bool_t    locate_tnode(ZGeoNode* zn, TGeoNode* cur_node);

public:
  ZGeoNode(const Text_t* n="ZGeoNode", const Text_t* t=0) : ZNode(n,t) { _init(); }

  void AssertUserData();    // X{E}
  void AssignGGeoTopNode(); // X{E} 7 MButt()

  // Top-level imports from gGeoManager.
  void ImportByRegExp(const Text_t* target, TRegexp filter);
  void ImportByRegExp(const Text_t* target, const Text_t* filter); // X{E} 7 MCWButt()
  void ImportUnimported(const Text_t* target="TheRest");           // X{E}

  // Daughter management.
  void ImportNodes();                      // X{Ed} 7 MButt(-join=>1)
  void Collapse();                         // X{Ed} 7 MButt()
  void ImportNodesWCollect();              // X{Ed} 7 MButt()
  void ImportNodesRec(Int_t depth=2);      // X{Ed} 7 MCWButt()

  // Persistence.
  void SaveToFile(Bool_t as_top_level, Bool_t save_links=true,
		  const Text_t* file=0);   // X{E}  7 MCWButt(-join=>1)
  void LoadFromFile(const Text_t* file=0); // X{Ed} 7 MCWButt()
  virtual void Restore();                  // X{Ed} 7 MButt()

  //--------------------------------

  // Manual Get/Set-methods
  void SetTNode(TGeoNode* n);

  TGeoVolume* GetVolume()
  { return mTNode ? mTNode->GetVolume() : 0; }
  TObject* GetVolumeField()
  { return mTNode && mTNode->GetVolume() ? mTNode->GetVolume()->GetField() : 0; }

#include "ZGeoNode.h7"
  ClassDef(ZGeoNode, 1);
}; // endclass ZGeoNode


#endif
 ZGeoNode.h:1
 ZGeoNode.h:2
 ZGeoNode.h:3
 ZGeoNode.h:4
 ZGeoNode.h:5
 ZGeoNode.h:6
 ZGeoNode.h:7
 ZGeoNode.h:8
 ZGeoNode.h:9
 ZGeoNode.h:10
 ZGeoNode.h:11
 ZGeoNode.h:12
 ZGeoNode.h:13
 ZGeoNode.h:14
 ZGeoNode.h:15
 ZGeoNode.h:16
 ZGeoNode.h:17
 ZGeoNode.h:18
 ZGeoNode.h:19
 ZGeoNode.h:20
 ZGeoNode.h:21
 ZGeoNode.h:22
 ZGeoNode.h:23
 ZGeoNode.h:24
 ZGeoNode.h:25
 ZGeoNode.h:26
 ZGeoNode.h:27
 ZGeoNode.h:28
 ZGeoNode.h:29
 ZGeoNode.h:30
 ZGeoNode.h:31
 ZGeoNode.h:32
 ZGeoNode.h:33
 ZGeoNode.h:34
 ZGeoNode.h:35
 ZGeoNode.h:36
 ZGeoNode.h:37
 ZGeoNode.h:38
 ZGeoNode.h:39
 ZGeoNode.h:40
 ZGeoNode.h:41
 ZGeoNode.h:42
 ZGeoNode.h:43
 ZGeoNode.h:44
 ZGeoNode.h:45
 ZGeoNode.h:46
 ZGeoNode.h:47
 ZGeoNode.h:48
 ZGeoNode.h:49
 ZGeoNode.h:50
 ZGeoNode.h:51
 ZGeoNode.h:52
 ZGeoNode.h:53
 ZGeoNode.h:54
 ZGeoNode.h:55
 ZGeoNode.h:56
 ZGeoNode.h:57
 ZGeoNode.h:58
 ZGeoNode.h:59
 ZGeoNode.h:60
 ZGeoNode.h:61
 ZGeoNode.h:62
 ZGeoNode.h:63
 ZGeoNode.h:64
 ZGeoNode.h:65
 ZGeoNode.h:66
 ZGeoNode.h:67
 ZGeoNode.h:68
 ZGeoNode.h:69
 ZGeoNode.h:70
 ZGeoNode.h:71
 ZGeoNode.h:72
 ZGeoNode.h:73
 ZGeoNode.h:74
 ZGeoNode.h:75
 ZGeoNode.h:76
 ZGeoNode.h:77
 ZGeoNode.h:78
 ZGeoNode.h:79
 ZGeoNode.h:80
 ZGeoNode.h:81
 ZGeoNode.h:82
 ZGeoNode.h:83
 ZGeoNode.h:84
 ZGeoNode.h:85
 ZGeoNode.h:86
 ZGeoNode.h:87
 ZGeoNode.h:88