示例#1
0
//_______________________________________________________________________________________
static void RotateView(Float_t phi, Float_t theta, TVirtualPad *pad=0)
{
  TVirtualPad *thisPad = pad;
  if (!thisPad) thisPad = qPad();
  if (thisPad) {
    TView *view = thisPad->GetView(); 
    if (view) {
      Int_t iret;
      Float_t p = phi;
      Float_t t = theta;
      view->SetView(p, t, 0, iret);
      thisPad->SetPhi(-90-p);
      thisPad->SetTheta(90-t);
      thisPad->Modified();
      thisPad->Update();
    }
  }
}
示例#2
0
void RootWImage::setCanvas(TCanvas* myCanvas) {
  if (myCanvas_) delete myCanvas_;
  myCanvas_ = (TCanvas*)myCanvas->DrawClone();
  std::ostringstream canvasName("");
  //int myNumber = imageNameCounter_[name_]++; //##########
  canvasName << "canvas" << setfill('0') << setw(3) << imageCounter_;
  myCanvas_->SetName(canvasName.str().c_str());
  TView* myView = myCanvas->GetView();
  if (myView) {
    TView* newView = myCanvas_->GetView();
    if (newView) {
      double min[3], max[3];
      Int_t irep;
      newView->SetView(myView->GetLongitude(),
		       myView->GetLatitude(),
		       myView->GetPsi(), irep);
      myView->GetRange(min, max);
      newView->SetRange(min, max);
    }
  }
}