G4NURBStube.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // 
00030 // Olivier Crumeyrolle  12 September 1996
00031 
00032 // Tube builder implementation
00033 // OC 090796
00034 
00035 #include "G4NURBStube.hh"
00036 
00037 G4NURBStube::G4NURBStube(G4double r, G4double R, G4double DZ)
00038   : G4NURBS( 2, 3,  // linear along U, quadratic along V
00039              5, 9,  // rectangle along U, circle along V
00040              Regular,     // the knot vector along U will be generated
00041              RegularRep ) // knot vector for the circle also
00042 {
00043   // define control points
00044 
00045   const G4double sr2o2 = std::sqrt(2.)/2.;
00046 
00047   CP(mpCtrlPts[ 0] ,  r, 0,  DZ, 1 );
00048   CP(mpCtrlPts[ 1] ,  R, 0,  DZ, 1 );
00049   CP(mpCtrlPts[ 2] ,  R, 0, -DZ, 1 );
00050   CP(mpCtrlPts[ 3] ,  r, 0, -DZ, 1 );
00051   CP(mpCtrlPts[ 4] ,  r, 0,  DZ, 1 );
00052 
00053   CP(mpCtrlPts[ 5] ,  r, r,  DZ, 1 , sr2o2);
00054   CP(mpCtrlPts[ 6] ,  R, R,  DZ, 1 , sr2o2);
00055   CP(mpCtrlPts[ 7] ,  R, R, -DZ, 1 , sr2o2);
00056   CP(mpCtrlPts[ 8] ,  r, r, -DZ, 1 , sr2o2);
00057   CP(mpCtrlPts[ 9] ,  r, r,  DZ, 1 , sr2o2);
00058 
00059   CP(mpCtrlPts[10] ,  0, r,  DZ, 1 );
00060   CP(mpCtrlPts[11] ,  0, R,  DZ, 1 );
00061   CP(mpCtrlPts[12] ,  0, R, -DZ, 1 );
00062   CP(mpCtrlPts[13] ,  0, r, -DZ, 1 );
00063   CP(mpCtrlPts[14] ,  0, r,  DZ, 1 );
00064 
00065   CP(mpCtrlPts[15] , -r, r,  DZ, 1 , sr2o2);
00066   CP(mpCtrlPts[16] , -R, R,  DZ, 1 , sr2o2);
00067   CP(mpCtrlPts[17] , -R, R, -DZ, 1 , sr2o2);
00068   CP(mpCtrlPts[18] , -r, r, -DZ, 1 , sr2o2);
00069   CP(mpCtrlPts[19] , -r, r,  DZ, 1 , sr2o2);
00070 
00071   CP(mpCtrlPts[20] , -r, 0,  DZ, 1 );
00072   CP(mpCtrlPts[21] , -R, 0,  DZ, 1 );
00073   CP(mpCtrlPts[22] , -R, 0, -DZ, 1 );
00074   CP(mpCtrlPts[23] , -r, 0, -DZ, 1 );
00075   CP(mpCtrlPts[24] , -r, 0,  DZ, 1 );
00076 
00077   CP(mpCtrlPts[25] , -r,-r,  DZ, 1 , sr2o2);
00078   CP(mpCtrlPts[26] , -R,-R,  DZ, 1 , sr2o2);
00079   CP(mpCtrlPts[27] , -R,-R, -DZ, 1 , sr2o2);
00080   CP(mpCtrlPts[28] , -r,-r, -DZ, 1 , sr2o2);
00081   CP(mpCtrlPts[29] , -r,-R,  DZ, 1 , sr2o2);
00082 
00083   CP(mpCtrlPts[30] ,  0,-r,  DZ, 1 );
00084   CP(mpCtrlPts[31] ,  0,-R,  DZ, 1 );
00085   CP(mpCtrlPts[32] ,  0,-R, -DZ, 1 );
00086   CP(mpCtrlPts[33] ,  0,-r, -DZ, 1 );
00087   CP(mpCtrlPts[34] ,  0,-r,  DZ, 1 );
00088 
00089   CP(mpCtrlPts[35] ,  r,-r,  DZ, 1 , sr2o2);
00090   CP(mpCtrlPts[36] ,  R,-R,  DZ, 1 , sr2o2);
00091   CP(mpCtrlPts[37] ,  R,-R, -DZ, 1 , sr2o2);
00092   CP(mpCtrlPts[38] ,  r,-r, -DZ, 1 , sr2o2);
00093   CP(mpCtrlPts[39] ,  r,-r,  DZ, 1 , sr2o2);
00094 
00095   CP(mpCtrlPts[40] ,  r, 0,  DZ, 1 );
00096   CP(mpCtrlPts[41] ,  R, 0,  DZ, 1 );
00097   CP(mpCtrlPts[42] ,  R, 0, -DZ, 1 );
00098   CP(mpCtrlPts[43] ,  r, 0, -DZ, 1 );
00099   CP(mpCtrlPts[44] ,  r, 0,  DZ, 1 );
00100 }
00101 
00102 const char* G4NURBStube::Whoami() const
00103 {
00104   return "Tube";
00105 }

Generated on Mon May 27 17:49:08 2013 for Geant4 by  doxygen 1.4.7