18 #include "TEveTrans.h"
19 #include "TEveManager.h"
24 #include "TBuffer3D.h"
25 #include "TBuffer3DTypes.h"
26 #include "TVirtualViewer3D.h"
29 #include "TGeoShape.h"
30 #include "TGeoVolume.h"
32 #include "TGeoShapeAssembly.h"
33 #include "TGeoCompositeShape.h"
34 #include "TGeoBoolNode.h"
35 #include "TGeoManager.h"
36 #include "TGeoMatrix.h"
37 #include "TVirtualGeoPainter.h"
60 const Double_t *
r = mat.GetRotationMatrix();
61 const Double_t *
t = mat.GetTranslation();
62 const Double_t *
s = mat.GetScale();
63 Double_t *
m = buff.fLocalMaster;
64 m[0] = r[0]*s[0]; m[1] = r[1]*s[1]; m[2] = r[2]*s[2]; m[3] = 0;
65 m[4] = r[3]*s[0]; m[5] = r[4]*s[1]; m[6] = r[5]*s[2]; m[7] = 0;
66 m[8] = r[6]*s[0]; m[9] = r[7]*s[1]; m[10] = r[8]*s[2]; m[11] = 0;
67 m[12] = t[0]; m[13] = t[1]; m[15] = t[2]; m[15] = 1;
69 buff.fLocalFrame = kTRUE;
87 std::advance(sit, topIdx);
106 TGeoNode* parentNode = pIt->m_node;
107 int nD = parentNode->GetNdaughters();
113 for (
int n = 0;
n != nD; ++
n)
116 std::advance(it,
n + dOff);
118 TGeoHMatrix nm = parentMtx;
119 nm.Multiply(it->m_node->GetMatrix());
149 static const TEveException eh(
"FWGeoTopNode::paintShape ");
152 TGeoShape* shape = data.
m_node->GetVolume()->GetShape();
153 TGeoCompositeShape* compositeShape =
dynamic_cast<TGeoCompositeShape*
>(shape);
157 Double_t halfLengths[3] = { compositeShape->GetDX(), compositeShape->GetDY(), compositeShape->GetDZ() };
159 TBuffer3D buff(TBuffer3DTypes::kComposite);
160 buff.fID = data.
m_node->GetVolume();
163 buff.fTransparency = data.
m_node->GetVolume()->GetTransparency();
165 nm.GetHomogenousMatrix(buff.fLocalMaster);
167 buff.fLocalFrame = kTRUE;
168 buff.SetAABoundingBox(compositeShape->GetOrigin(), halfLengths);
169 buff.SetSectionsValid(TBuffer3D::kCore|TBuffer3D::kBoundingBox);
171 Bool_t paintComponents = kTRUE;
174 if (TBuffer3D::GetCSLevel() == 0)
175 paintComponents = gPad->GetViewer3D()->OpenComposite(buff);
177 TBuffer3D::IncCSLevel();
182 TGeoShape::SetTransform(&xxx);
183 if (paintComponents) compositeShape->GetBoolNode()->Paint(
"");
184 TGeoShape::SetTransform(gst);
186 if (TBuffer3D::DecCSLevel() == 0)
187 gPad->GetViewer3D()->CloseComposite();
192 TBuffer3D& buff = (TBuffer3D&) shape->GetBuffer3D (TBuffer3D::kCore, kFALSE);
194 buff.fID = data.
m_node->GetVolume();
196 buff.fTransparency = data.
m_node->GetVolume()->GetTransparency();
198 nm.GetHomogenousMatrix(buff.fLocalMaster);
199 buff.fLocalFrame = kTRUE;
201 Int_t sections = TBuffer3D::kBoundingBox | TBuffer3D::kShapeSpecific;
202 shape->GetBuffer3D(sections, kTRUE);
205 Int_t reqSec = gPad->GetViewer3D()->AddObject(buff);
209 if (reqSec & TBuffer3D::kCore)
210 Warning(eh,
"Core section required again for shape='%s'. This shouldn't happen.", GetName());
211 shape->GetBuffer3D(reqSec, kTRUE);
212 reqSec = gPad->GetViewer3D()->AddObject(buff);
216 Warning(eh,
"Extra section required: reqSec=%d, shape=%s.", reqSec, GetName());
void paintChildNodesRecurse(FWGeometryTableManager::Entries_i pIt, const TGeoHMatrix &mtx)
bool getVisibilityChld(const NodeInfo &nodeInfo) const
std::string getFilter() const
virtual void Paint(Option_t *option="")
FWGeometryTableManager * getTableManager()
static const G4AffineTransform & GetTransform(const G4TouchableHistory *touchable, int depth)
void paintShape(FWGeometryTableManager::NodeInfo &nodeInfo, const TGeoHMatrix &nm)
int getLevelOffset() const
bool getIgnoreVisLevelWhenFilter() const
FWGeoTopNode(FWGeometryTableView *)
FWGeometryTableManager::Entries_v * m_entries
bool getVisibility(const NodeInfo &nodeInfo) const
static TGeoManager * getGeoMangeur()
void assertNodeFilterCache(NodeInfo &data)
FWGeometryTableView * m_browser
void getNodeMatrix(const NodeInfo &nodeInfo, TGeoHMatrix &mat) const
static void getNNodesTotal(TGeoNode *geoNode, int &off)
Entries_v::iterator Entries_i
bool getVolumeMode() const
void setupBuffMtx(TBuffer3D &buff, const TGeoHMatrix &mat)
int getTopNodeIdx() const