12 #include "TVolumeViewIter.h"
13 #include "TObjArray.h"
14 #include "TVolumeView.h"
15 #include "TDataSetIter.h"
16 #include "TGeometry.h"
47 if (fPositions) { fPositions->Delete();
delete fPositions; }
56 Int_t thisLevel = level;
57 if (!thisLevel) thisLevel = fDepth;
71 Error(
"operator[]",
" GetPosition: %d %d 0x%lx", level,fDepth, (Long_t)fPositions);
84 position = view->GetPosition();
95 UInt_t curPositionId = 0;
97 curNode = curPosition->GetNode();
98 curPositionId = curPosition->GetId();
100 Error(
"UpdateTempMatrix",
"No position has been defined");
105 const TRotMatrix *oldMatrix = 0;
106 oldPosition = fPositions ? (
TVolumePosition *)fPositions->At(fDepth-1):0;
107 Double_t oldTranslation[] = { 0, 0, 0 };
109 oldMatrix = oldPosition->GetMatrix();
110 oldTranslation[0] = oldPosition->GetX();
111 oldTranslation[1] = oldPosition->GetY();
112 oldTranslation[2] = oldPosition->GetZ();
116 const TRotMatrix *curMatrix = curPosition->GetMatrix();
119 Double_t newTranslation[3];
120 Double_t newMatrix[9];
123 TGeometry::UpdateTempMatrix(oldTranslation,((TRotMatrix *)oldMatrix)->GetMatrix()
124 ,curPosition->GetX(),curPosition->GetY(),curPosition->GetZ()
125 ,((TRotMatrix *)curMatrix)->GetMatrix()
126 ,newTranslation,newMatrix);
127 Int_t num = gGeometry->GetListOfMatrices()->GetSize();
129 snprintf(anum,100,
"%d",num+1);
131 ,newTranslation[0],newTranslation[1],newTranslation[2]
132 ,
new TRotMatrix(anum,
"NodeView",newMatrix));
133 newPosition->SetMatrixOwner();
135 newTranslation[0] = oldTranslation[0] + curPosition->GetX();
136 newTranslation[1] = oldTranslation[1] + curPosition->GetY();
137 newTranslation[2] = oldTranslation[2] + curPosition->GetZ();
138 newPosition =
SetPositionAt(curNode,newTranslation[0],newTranslation[1],newTranslation[2]);
145 if (newPosition) newPosition->SetId(curPositionId);
154 Int_t thisLevel = level;
155 if (!thisLevel) thisLevel = fDepth;
158 *thisPosition = *newPosition;
174 if (!fPositions) fPositions =
new TObjArray(100);
176 if (position) position->
Reset(node,x,y,z,matrix);
179 fPositions->AddAtAndExpand(position,fDepth);
189 if (!fPositions) fPositions =
new TObjArray(100);
191 if (position) *position = curPosition;
194 fPositions->AddAtAndExpand(position,fDepth);
TVolumePosition * UpdateTempMatrix(TVolumePosition *curPosition)
Pick the "old" position by pieces.
void ResetPosition(Int_t level=0, TVolumePosition *newPosition=0)
to be documented
~TVolumeViewIter()
to be documented
virtual void Reset(TDataSet *l=0, Int_t depth=0)
to be documented
virtual void Reset(TDataSet *l=0, Int_t depth=0)
virtual TVolumePosition * Reset(TVolume *node=0, Double_t x=0, Double_t y=0, Double_t z=0, TRotMatrix *matrix=0)
virtual const TVolumePosition * GetPosition(Int_t level=0) const
to be documented
virtual TDataSet * operator[](const Char_t *path)
TVolumeViewIter(TVolumeView *view, Int_t depth=1, Bool_t dir=kIterForward)
to be documented
virtual TVolumePosition * SetPositionAt(TVolume *node, Double_t x=0, Double_t y=0, Double_t z=0, TRotMatrix *matrix=0)
to be documented