forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TViewerX3D.cxx
690 lines (569 loc) · 20.9 KB
/
TViewerX3D.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
// @(#)root/x3d:$Id$
// Author: Rene Brun 05/09/99
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
//////////////////////////////////////////////////////////////////////////
// //
// TViewerX3D //
// //
// C++ interface to the X3D viewer //
// //
//////////////////////////////////////////////////////////////////////////
#include "TViewerX3D.h"
#include "X3DBuffer.h"
#include "TVirtualPad.h"
#include "TView.h"
#include "TMath.h"
#include "TROOT.h"
#include "TRootHelpDialog.h"
#include "TGClient.h"
#include "TGCanvas.h"
#include "TGMenu.h"
#include "TGWidget.h"
#include "TGMsgBox.h"
#include "TVirtualX.h"
#include "TBuffer3D.h"
#include "TBuffer3DTypes.h"
#include "HelpText.h"
#include <assert.h>
const char gHelpX3DViewer[] = "\
PRESS \n\
\tw\t--- wireframe mode\n\
\te\t--- hidden line mode\n\
\tr\t--- hidden surface mode\n\
\tu\t--- move object down\n\
\ti\t--- move object up\n\
\to\t--- toggle controls style\n\
\ts\t--- toggle stereo display\n\
\td\t--- toggle blue stereo view\n\
\tf\t--- toggle double buffer\n\
\th\t--- move object right\n\
\tj\t--- move object forward\n\
\tk\t--- move object backward\n\
\tl\t--- move object left\n\
\tx a\t--- rotate about x\n\
\ty b\t--- rotate about y\n\
\tz c\t--- rotate about z\n\
\t1 2 3\t--- autorotate about x\n\
\t4 5 6\t--- autorotate about y\n\
\t7 8 9\t--- autorotate about z\n\
\t[ ] { }\t--- adjust focus\n\n\
HOLD the left mouse button and MOVE mouse to ROTATE object\n\n\
";
extern "C" {
Window_t x3d_main(Float_t *longitude, Float_t *latitude, Float_t *psi,
Option_t *option, Window_t parent);
void x3d_set_display(Display_t display);
int x3d_dispatch_event(Handle_t event);
void x3d_update();
void x3d_get_position(Float_t *longitude, Float_t *latitude, Float_t *psi);
int x3d_exec_command(int px, int py, char command);
void x3d_terminate();
}
// Canvas menu command ids
enum EX3DViewerCommands {
kFileNewViewer,
kFileSave,
kFileSaveAs,
kFilePrint,
kFileCloseViewer,
kHelpAbout,
kHelpOnViewer
};
Bool_t TViewerX3D::fgCreated = kFALSE;
//////////////////////////////////////////////////////////////////////////
// //
// TX3DContainer //
// //
// Utility class used by TViewerX3D. The TX3DContainer is the frame //
// embedded in the TGCanvas widget. The X3D graphics goes into this //
// frame. This class is used to enable input events on this graphics //
// frame and forward the events to X3D. //
// //
//////////////////////////////////////////////////////////////////////////
class TX3DContainer : public TGCompositeFrame {
private:
TViewerX3D *fViewer; // pointer back to viewer imp
public:
TX3DContainer(TViewerX3D *c, Window_t id, const TGWindow *parent);
Bool_t HandleButton(Event_t *ev)
{ x3d_dispatch_event(gVirtualX->GetNativeEvent());
return fViewer->HandleContainerButton(ev); }
Bool_t HandleConfigureNotify(Event_t *ev)
{ TGFrame::HandleConfigureNotify(ev);
return x3d_dispatch_event(gVirtualX->GetNativeEvent()); }
Bool_t HandleKey(Event_t *)
{ return x3d_dispatch_event(gVirtualX->GetNativeEvent()); }
Bool_t HandleMotion(Event_t *)
{ return x3d_dispatch_event(gVirtualX->GetNativeEvent()); }
Bool_t HandleExpose(Event_t *)
{ return x3d_dispatch_event(gVirtualX->GetNativeEvent()); }
Bool_t HandleColormapChange(Event_t *)
{ return x3d_dispatch_event(gVirtualX->GetNativeEvent()); }
};
////////////////////////////////////////////////////////////////////////////////
/// Create a canvas container.
TX3DContainer::TX3DContainer(TViewerX3D *c, Window_t id, const TGWindow *p)
: TGCompositeFrame(gClient, id, p)
{
fViewer = c;
}
ClassImp(TViewerX3D)
////////////////////////////////////////////////////////////////////////////////
/// Create ROOT X3D viewer.
TViewerX3D::TViewerX3D(TVirtualPad *pad)
: TVirtualViewer3D(),
fCanvas(0), fContainer(0), fMenuBar(0), fFileMenu(0),
fHelpMenu(0), fMenuBarLayout(0), fMenuBarItemLayout(0),
fMenuBarHelpLayout(0), fCanvasLayout(0),
fPad(pad), fBuildingScene(kFALSE), fPass(kSize)
{
fMainFrame = new TX3DFrame(*this, gClient->GetRoot(), 800, 600);
fOption = "x3d";
fX3DWin = 0;
fWidth = 800;
fHeight = 600;
fXPos = 0;
fYPos = 0;
fTitle = "x3d";
}
////////////////////////////////////////////////////////////////////////////////
/// Create ROOT X3D viewer.
TViewerX3D::TViewerX3D(TVirtualPad *pad, Option_t *option, const char *title,
UInt_t width, UInt_t height)
: TVirtualViewer3D(),
fCanvas(0), fContainer(0), fMenuBar(0), fFileMenu(0),
fHelpMenu(0), fMenuBarLayout(0), fMenuBarItemLayout(0),
fMenuBarHelpLayout(0), fCanvasLayout(0),
fPad(pad), fBuildingScene(kFALSE), fPass(kSize)
{
fMainFrame = new TX3DFrame(*this, gClient->GetRoot(), 800, 600);
fOption = option;
fX3DWin = 0;
fWidth = width;
fHeight = height;
fXPos = 0;
fYPos = 0;
fTitle = title;
}
////////////////////////////////////////////////////////////////////////////////
/// Create ROOT X3D viewer.
TViewerX3D::TViewerX3D(TVirtualPad *pad, Option_t *option, const char *title,
Int_t x, Int_t y, UInt_t width, UInt_t height)
: TVirtualViewer3D(),
fCanvas(0), fContainer(0), fMenuBar(0), fFileMenu(0),
fHelpMenu(0), fMenuBarLayout(0), fMenuBarItemLayout(0),
fMenuBarHelpLayout(0), fCanvasLayout(0),
fPad(pad), fBuildingScene(kFALSE), fPass(kSize)
{
fMainFrame = new TX3DFrame(*this, gClient->GetRoot(), 800, 600);
fOption = option;
fX3DWin = 0;
fWidth = width;
fHeight = height;
fXPos = x;
fYPos = y;
fTitle = title;
}
////////////////////////////////////////////////////////////////////////////////
/// Delete ROOT X3D viewer.
TViewerX3D::~TViewerX3D()
{
if (!fPad) return;
if (fgCreated) {
DeleteX3DWindow();
}
delete fCanvasLayout;
delete fMenuBarHelpLayout;
delete fMenuBarItemLayout;
delete fMenuBarLayout;
delete fHelpMenu;
delete fFileMenu;
delete fMenuBar;
delete fContainer;
delete fCanvas;
delete fMainFrame;
fgCreated = kFALSE;
}
////////////////////////////////////////////////////////////////////////////////
/// Close X3D Viewer
void TViewerX3D::Close()
{
assert(!fBuildingScene);
fPad->ReleaseViewer3D();
delete this;
}
////////////////////////////////////////////////////////////////////////////////
/// Create the actual canvas.
void TViewerX3D::CreateViewer(const char *name)
{
// Create menus
fFileMenu = new TGPopupMenu(fMainFrame->GetClient()->GetRoot());
fFileMenu->AddEntry("&New Viewer", kFileNewViewer);
fFileMenu->AddSeparator();
fFileMenu->AddEntry("Save", kFileSave);
fFileMenu->AddEntry("Save As...", kFileSaveAs);
fFileMenu->AddSeparator();
fFileMenu->AddEntry("&Print...", kFilePrint);
fFileMenu->AddSeparator();
fFileMenu->AddEntry("&Close Viewer", kFileCloseViewer);
//fFileMenu->DefaultEntry(kFileNewViewer);
fFileMenu->DisableEntry(kFileNewViewer);
fFileMenu->DisableEntry(kFileSave);
fFileMenu->DisableEntry(kFileSaveAs);
fFileMenu->DisableEntry(kFilePrint);
fHelpMenu = new TGPopupMenu(fMainFrame->GetClient()->GetRoot());
fHelpMenu->AddEntry("&About ROOT...", kHelpAbout);
fHelpMenu->AddSeparator();
fHelpMenu->AddEntry("Help On X3D Viewer...", kHelpOnViewer);
// This main frame will process the menu commands
fFileMenu->Associate(fMainFrame);
fHelpMenu->Associate(fMainFrame);
// Create menubar layout hints
fMenuBarLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 0, 0, 1, 1);
fMenuBarItemLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
fMenuBarHelpLayout = new TGLayoutHints(kLHintsTop | kLHintsRight);
// Create menubar
fMenuBar = new TGMenuBar(fMainFrame, 1, 1, kHorizontalFrame);
fMenuBar->AddPopup("&File", fFileMenu, fMenuBarItemLayout);
fMenuBar->AddPopup("&Help", fHelpMenu, fMenuBarHelpLayout);
fMainFrame->AddFrame(fMenuBar, fMenuBarLayout);
// Create canvas and canvas container that will host the ROOT graphics
fCanvas = new TGCanvas(fMainFrame, fMainFrame->GetWidth()+4, fMainFrame->GetHeight()+4,
kSunkenFrame | kDoubleBorder);
InitX3DWindow();
if (!fX3DWin) {
fContainer = 0;
fCanvasLayout = 0;
return;
}
fContainer = new TX3DContainer(this, fX3DWin, fCanvas->GetViewPort());
fCanvas->SetContainer(fContainer);
fCanvasLayout = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY);
fMainFrame->AddFrame(fCanvas, fCanvasLayout);
// Misc
fMainFrame->SetWindowName(name);
fMainFrame->SetIconName(name);
fMainFrame->SetClassHints("X3DViewer", "X3DViewer");
fMainFrame->SetMWMHints(kMWMDecorAll, kMWMFuncAll, kMWMInputModeless);
fMainFrame->MapSubwindows();
// we need to use GetDefaultSize() to initialize the layout algorithm...
fMainFrame->Resize(fMainFrame->GetDefaultSize());
fMainFrame->MoveResize(fXPos, fYPos, fWidth, fHeight);
fMainFrame->SetWMPosition(fXPos, fYPos);
fgCreated = kTRUE;
}
////////////////////////////////////////////////////////////////////////////////
/// Setup geometry and initialize X3D.
void TViewerX3D::InitX3DWindow()
{
TView *view = fPad->GetView();
if (!view) {
Error("InitX3DWindow", "view is not set");
return;
}
const Float_t kPI = Float_t (TMath::Pi());
Float_t longitude_rad = ( 90 + view->GetLongitude()) * kPI/180.0;
Float_t latitude_rad = (-90 + view->GetLatitude() ) * kPI/180.0;
Float_t psi_rad = ( view->GetPsi() ) * kPI/180.0;
// Call 'x3d' package
x3d_set_display(gVirtualX->GetDisplay());
fX3DWin = (Window_t) x3d_main(&longitude_rad, &latitude_rad, &psi_rad,
fOption.Data(), fCanvas->GetViewPort()->GetId());
}
////////////////////////////////////////////////////////////////////////////////
/// The x3d viewer cannot rebuild a scene once created
void TViewerX3D::BeginScene()
{
if (fgCreated) {
return;
}
fBuildingScene = kTRUE;
if (fPass == kSize) {
gSize3D.numPoints = 0;
gSize3D.numSegs = 0;
gSize3D.numPolys = 0;
}
}
////////////////////////////////////////////////////////////////////////////////
/// The x3d viewer cannot rebuild a scene once created
void TViewerX3D::EndScene()
{
if (fgCreated) {
return;
}
fBuildingScene = kFALSE;
// Size pass done - and some points actually added
if (gSize3D.numPoints != 0) {
if (fPass == kSize) {
// Allocate the X3D viewer buffer with sizes if any
if (!AllocateX3DBuffer()) {
Error("InitX3DWindow", "x3d buffer allocation failure");
return;
}
// Enter draw pass and invoke another paint
fPass = kDraw;
fPad->Paint();
fPass = kSize;
CreateViewer(fTitle);
Show();
}
} else {
Int_t retval;
new TGMsgBox(gClient->GetRoot(), gClient->GetRoot(),
"X3D Viewer", "Cannot display this content in the X3D viewer",
kMBIconExclamation, kMBOk, &retval);
Close();
}
}
////////////////////////////////////////////////////////////////////////////////
/// The x3d viewer cannot rebuild a scene once created
Int_t TViewerX3D::AddObject(const TBuffer3D & buffer, Bool_t * addChildren)
{
if (fgCreated) {
if (addChildren) {
*addChildren = kFALSE;
}
return TBuffer3D::kNone;
}
else if (addChildren) {
*addChildren = kTRUE;
}
// Ensure we have the required sections
UInt_t reqSections = TBuffer3D::kCore|TBuffer3D::kRawSizes;
// Sizing does not require actual raw tesselation information
if (fPass == kDraw) {
reqSections |= TBuffer3D::kRaw;
}
if (!buffer.SectionsValid(reqSections)) {
return reqSections;
}
if (buffer.Type() == TBuffer3DTypes::kMarker) {
PaintPolyMarker(buffer);
return TBuffer3D::kNone;
}
switch(fPass) {
case(kSize): {
gSize3D.numPoints += buffer.NbPnts();
gSize3D.numSegs += buffer.NbSegs();
gSize3D.numPolys += buffer.NbPols();
break;
}
case (kDraw): {
X3DBuffer *x3dBuff = new X3DBuffer;
x3dBuff->numPoints = buffer.NbPnts();
x3dBuff->numSegs = buffer.NbSegs();
x3dBuff->numPolys = buffer.NbPols();
x3dBuff->points = new Float_t[3*buffer.NbPnts()];
for (UInt_t i=0; i<3*buffer.NbPnts();i++)
x3dBuff->points[i] = (Float_t)buffer.fPnts[i];
x3dBuff->segs = buffer.fSegs;
x3dBuff->polys = buffer.fPols;
FillX3DBuffer(x3dBuff);
delete [] x3dBuff->points;
delete x3dBuff;
break;
}
default: {
assert(kFALSE);
break;
}
}
return TBuffer3D::kNone;
}
////////////////////////////////////////////////////////////////////////////////
/// We don't support placed IDs - discard
Int_t TViewerX3D::AddObject(UInt_t /* placedID */, const TBuffer3D & buffer, Bool_t * addChildren)
{
return AddObject(buffer,addChildren);
}
////////////////////////////////////////////////////////////////////////////////
/// Paint 3D PolyMarker
void TViewerX3D::PaintPolyMarker(const TBuffer3D & buffer) const
{
if (fgCreated) {
return;
}
UInt_t mode;
if (buffer.NbPnts() > 10000) mode = 1; // One line marker '-'
else if (buffer.NbPnts() > 3000) mode = 2; // Two lines marker '+'
else mode = 3; // Three lines marker '*'
switch(fPass) {
case(kSize): {
gSize3D.numPoints += 2*mode*buffer.NbPnts();
gSize3D.numSegs += mode*buffer.NbPnts();
break;
}
case (kDraw): {
X3DBuffer *x3dBuff = new X3DBuffer;
x3dBuff->numPoints = 2*mode*buffer.NbPnts();
x3dBuff->numSegs = mode*buffer.NbPnts();
x3dBuff->numPolys = 0;
x3dBuff->points = new Float_t[3*x3dBuff->numPoints];
x3dBuff->segs = new Int_t[3*x3dBuff->numSegs];
x3dBuff->polys = 0;
Double_t delta = 0.002;
for (UInt_t i = 0; i < buffer.NbPnts(); i++) {
for (UInt_t j = 0; j < mode; j++) {
for (UInt_t k = 0; k < 2; k++) {
delta *= -1;
for (UInt_t n = 0; n < 3; n++) {
x3dBuff->points[mode*6*i+6*j+3*k+n] =
buffer.fPnts[3*i+n] * (1 + (j == n ? delta : 0));
}
}
}
}
for (Int_t i=0; i<x3dBuff->numSegs; i++) {
x3dBuff->segs[3*i ] = buffer.fSegs[0];
x3dBuff->segs[3*i+1] = 2*i;
x3dBuff->segs[3*i+2] = 2*i+1;
}
FillX3DBuffer(x3dBuff);
delete [] x3dBuff->points;
delete [] x3dBuff->segs;
delete x3dBuff;
break;
}
}
}
////////////////////////////////////////////////////////////////////////////////
/// This function may be called from a script to animate an X3D picture
/// px, py mouse position
///command = 0 --- move to px,py
/// = w --- wireframe mode
/// = e --- hidden line mode
/// = r --- hidden surface mode
/// = u --- move object down
/// = i --- move object up
/// = o --- toggle controls style
/// = s --- toggle stereo display
/// = d --- toggle blue stereo view
/// = f --- toggle double buffer
/// = h --- move object right
/// = j --- move object forward
/// = k --- move object backward
/// = l --- move object left
/// = x a --- rotate about x
/// = y b --- rotate about y
/// = z c --- rotate about z
/// = 1 2 3 --- autorotate about x
/// = 4 5 6 --- autorotate about y
/// = 7 8 9 --- autorotate about z
/// = [ ] { } --- adjust focus
/// Example:
Int_t TViewerX3D::ExecCommand(Int_t px, Int_t py, char command)
{
/*
{
gSystem->Load("libX3d");
TCanvas *c1 = new TCanvas("c1");
TFile *f = new TFile("hsimple.root");
TTree *ntuple = (TTree*)f->Get("ntuple");
ntuple->SetMarkerColor(kYellow);
ntuple->Draw("px:py:pz");
TViewerX3D *x3d = new TViewerX3D(c1,"");
for (Int_t i=0;i<500;i++) {
Int_t px = i%500;
Int_t py = (2*i)%200;
x3d->ExecCommand(px,py,0); //rotate
if (i%20 >10) x3d->ExecCommand(px,py,'j'); //zoom
if (i%20 <10) x3d->ExecCommand(px,py,'k'); //unzoom
}
}
*/
return x3d_exec_command(px,py,command);
}
////////////////////////////////////////////////////////////////////////////////
/// Get position
void TViewerX3D::GetPosition(Float_t &longitude, Float_t &latitude, Float_t &psi)
{
x3d_get_position(&longitude, &latitude, &psi);
}
////////////////////////////////////////////////////////////////////////////////
/// Close X3D window.
void TViewerX3D::DeleteX3DWindow()
{
x3d_terminate();
}
////////////////////////////////////////////////////////////////////////////////
/// Update X3D viewer.
void TViewerX3D::Update()
{
x3d_update();
}
////////////////////////////////////////////////////////////////////////////////
/// Handle menu and other command generated by the user.
Bool_t TViewerX3D::ProcessFrameMessage(Long_t msg, Long_t parm1, Long_t)
{
TRootHelpDialog *hd;
switch (GET_MSG(msg)) {
case kC_COMMAND:
switch (GET_SUBMSG(msg)) {
case kCM_BUTTON:
case kCM_MENU:
switch (parm1) {
// Handle File menu items...
case kFileNewViewer:
if (fPad) fPad->GetViewer3D("x3d");
break;
case kFileSave:
case kFileSaveAs:
case kFilePrint:
break;
case kFileCloseViewer:
fMainFrame->SendCloseMessage();
break;
// Handle Help menu items...
case kHelpAbout:
{
char str[32];
snprintf(str,32, "About ROOT %s...", gROOT->GetVersion());
hd = new TRootHelpDialog(fMainFrame, str, 600, 400);
hd->SetText(gHelpAbout);
hd->Popup();
}
break;
case kHelpOnViewer:
hd = new TRootHelpDialog(fMainFrame, "Help on X3D Viewer...", 600, 400);
hd->SetText(gHelpX3DViewer);
hd->Popup();
break;
}
default:
break;
}
default:
break;
}
return kTRUE;
}
////////////////////////////////////////////////////////////////////////////////
/// After button release get current position and update associated pad.
Bool_t TViewerX3D::HandleContainerButton(Event_t * /*ev */ )
{
// Currently disabled as only drawing into one view at a time
// Re-enalbe when multiple viewer implemented on pad
/*if (ev->fType == kButtonRelease) {
Float_t longitude_rad;
Float_t latitude_rad;
Float_t psi_rad;
const Float_t kPI = Float_t (TMath::Pi());
x3d_get_position(&longitude_rad, &latitude_rad, &psi_rad);
Int_t irep;
Float_t longitude_deg = longitude_rad * 180.0/kPI - 90;
Float_t latitude_deg = latitude_rad * 180.0/kPI + 90;
Float_t psi_deg = psi_rad * 180.0/kPI;
fPad->GetView()->SetView(longitude_deg, latitude_deg, psi_deg, irep);
fPad->SetPhi(-90 - longitude_deg);
fPad->SetTheta(90 - latitude_deg);
fPad->Modified(kTRUE);
fPad->Update();
}*/
return kTRUE;
}