// @(#)root/g3d:$Id: TView3D.cxx 23816 2008-05-13 10:28:21Z brun $ // Author: Rene Brun, Nenad Buncic, Evgueni Tcherniaev, Olivier Couet 18/08/95 /************************************************************************* * 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. * *************************************************************************/ #include "TVirtualPad.h" #include "TView3D.h" #include "TAxis3D.h" #include "TPolyLine3D.h" #include "TVirtualX.h" #include "TROOT.h" #include "TClass.h" #include "TList.h" #include "TPluginManager.h" #include "TMath.h" // Remove when TView3Der3DPad fix in ExecuteRotateView() is removed #include "TVirtualViewer3D.h" ClassImp(TView3D) //const Int_t kPerspective = BIT(14); const Int_t kCARTESIAN = 1; const Int_t kPOLAR = 2; const Double_t kRad = 3.14159265358979323846/180.0; //______________________________________________________________________________ /* Begin_Html <center><h2>The 3D view class</h2></center> This package was originally written by Evgueni Tcherniaev from IHEP/Protvino. <p> The original Fortran implementation was adapted to HIGZ/PAW by Olivier Couet and Evgueni Tcherniaev. <p> This View class is a subset of the original system. It has been converted to a C++ class by Rene Brun. <p> TView3D creates a 3-D view in the current pad. In this 3D view Lego and Surface plots can be drawn and also 3D polyline and markers. Most of the time a TView3D is created automatically when a 3D object needs to be painted in a pad (for instance a Lego or a Surface plot). <p> In some case a TView3D should be explicitly. For instance to paint a 3D simple scene composed of simple objects like polylines and polymarkers. The following macro gives an example: End_Html Begin_Macro(source) { c1 = new TCanvas("c1","PolyLine3D & PolyMarker3D Window",200,10,500,500); // Creating a view TView3D *view = TView::CreateView(1); view->SetRange(5,5,5,25,25,25); // Create a first PolyLine3D TPolyLine3D *pl3d1 = new TPolyLine3D(5); pl3d1->SetPoint(0, 10, 10, 10); pl3d1->SetPoint(1, 15, 15, 10); pl3d1->SetPoint(2, 20, 15, 15); pl3d1->SetPoint(3, 20, 20, 20); pl3d1->SetPoint(4, 10, 10, 20); // Create a first PolyMarker3D TPolyMarker3D *pm3d1 = new TPolyMarker3D(12); pm3d1->SetPoint(0, 10, 10, 10); pm3d1->SetPoint(1, 11, 15, 11); pm3d1->SetPoint(2, 12, 15, 9); pm3d1->SetPoint(3, 13, 17, 20); pm3d1->SetPoint(4, 14, 16, 15); pm3d1->SetPoint(5, 15, 20, 15); pm3d1->SetPoint(6, 16, 18, 10); pm3d1->SetPoint(7, 17, 15, 10); pm3d1->SetPoint(8, 18, 22, 15); pm3d1->SetPoint(9, 19, 28, 25); pm3d1->SetPoint(10, 20, 12, 15); pm3d1->SetPoint(11, 21, 12, 15); pm3d1->SetMarkerSize(2); pm3d1->SetMarkerColor(4); pm3d1->SetMarkerStyle(2); // Draw pl3d1->Draw(); pm3d1->Draw(); }