27 ClassImp(TViewer3DPad);
33 Bool_t TViewer3DPad::PreferLocalFrame()
const
41 void TViewer3DPad::BeginScene()
46 TView *view = fPad.GetView();
48 view = TView::CreateView(1,0,0);
56 view->SetAutoRange(kTRUE);
65 void TViewer3DPad::EndScene()
70 TView *view = fPad.GetView();
72 if (view->GetAutoRange()) {
73 view->SetAutoRange(kFALSE);
88 Int_t TViewer3DPad::AddObject(
const TBuffer3D & buffer, Bool_t * addChildren)
95 TView * view = fPad.GetView();
98 return TBuffer3D::kNone;
101 UInt_t reqSections = TBuffer3D::kCore|TBuffer3D::kRawSizes|TBuffer3D::kRaw;
102 if (!buffer.SectionsValid(reqSections)) {
110 if (view->GetAutoRange()) {
111 Double_t x0, y0, z0, x1, y1, z1;
113 x0 = x1 = buffer.fPnts[0];
114 y0 = y1 = buffer.fPnts[1];
115 z0 = z1 = buffer.fPnts[2];
116 for (i=1; i<buffer.NbPnts(); i++) {
117 i0 = 3*i; i1 = i0+1; i2 = i0+2;
118 x0 = buffer.fPnts[i0] < x0 ? buffer.fPnts[i0] : x0;
119 y0 = buffer.fPnts[i1] < y0 ? buffer.fPnts[i1] : y0;
120 z0 = buffer.fPnts[i2] < z0 ? buffer.fPnts[i2] : z0;
121 x1 = buffer.fPnts[i0] > x1 ? buffer.fPnts[i0] : x1;
122 y1 = buffer.fPnts[i1] > y1 ? buffer.fPnts[i1] : y1;
123 z1 = buffer.fPnts[i2] > z1 ? buffer.fPnts[i2] : z1;
125 view->SetRange(x0,y0,z0,x1,y1,z1,2);
130 if (buffer.fTransparency > 50) {
131 return TBuffer3D::kNone;
133 if (buffer.Type()== TBuffer3DTypes::kMarker ) {
134 Double_t pndc[3], temp[3];
135 for (i=0; i<buffer.NbPnts(); i++) {
136 for ( i0=0; i0<3; i0++ ) temp[i0] = buffer.fPnts[3*i+i0];
137 view->WCtoNDC(temp, pndc);
138 fPad.PaintPolyMarker(1, &pndc[0], &pndc[1]);
141 for (i=0; i<buffer.NbSegs(); i++) {
142 i0 = 3*buffer.fSegs[3*i+1];
143 Double_t *ptpoints_0 = &(buffer.fPnts[i0]);
144 i0 = 3*buffer.fSegs[3*i+2];
145 Double_t *ptpoints_3 = &(buffer.fPnts[i0]);
146 fPad.PaintLine3D(ptpoints_0, ptpoints_3);
151 return TBuffer3D::kNone;
157 Int_t TViewer3DPad::AddObject(UInt_t ,
const TBuffer3D & buffer, Bool_t * addChildren)
159 return AddObject(buffer,addChildren);
166 Bool_t TViewer3DPad::OpenComposite(
const TBuffer3D & , Bool_t * )
173 void TViewer3DPad::CloseComposite()
178 void TViewer3DPad::AddCompositeOp(UInt_t )