source: trunk/source/graphics_reps/src/G4NURBStube.cc @ 1140

Last change on this file since 1140 was 1058, checked in by garnier, 15 years ago

file release beta

File size: 4.1 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// $Id: G4NURBStube.cc,v 1.8 2006/06/29 19:06:52 gunter Exp $
28// GEANT4 tag $Name: geant4-09-02-ref-02 $
29//
30//
31// Olivier Crumeyrolle  12 September 1996
32
33// Tube builder implementation
34// OC 090796
35
36#include "G4NURBStube.hh"
37
38G4NURBStube::G4NURBStube(G4double r, G4double R, G4double DZ)
39  : G4NURBS( 2, 3,  // linear along U, quadratic along V
40             5, 9,  // rectangle along U, circle along V
41             Regular,     // the knot vector along U will be generated
42             RegularRep ) // knot vector for the circle also
43{
44  // define control points
45
46  const G4double sr2o2 = std::sqrt(2.)/2.;
47
48  CP(mpCtrlPts[ 0] ,  r, 0,  DZ, 1 );
49  CP(mpCtrlPts[ 1] ,  R, 0,  DZ, 1 );
50  CP(mpCtrlPts[ 2] ,  R, 0, -DZ, 1 );
51  CP(mpCtrlPts[ 3] ,  r, 0, -DZ, 1 );
52  CP(mpCtrlPts[ 4] ,  r, 0,  DZ, 1 );
53
54  CP(mpCtrlPts[ 5] ,  r, r,  DZ, 1 , sr2o2);
55  CP(mpCtrlPts[ 6] ,  R, R,  DZ, 1 , sr2o2);
56  CP(mpCtrlPts[ 7] ,  R, R, -DZ, 1 , sr2o2);
57  CP(mpCtrlPts[ 8] ,  r, r, -DZ, 1 , sr2o2);
58  CP(mpCtrlPts[ 9] ,  r, r,  DZ, 1 , sr2o2);
59
60  CP(mpCtrlPts[10] ,  0, r,  DZ, 1 );
61  CP(mpCtrlPts[11] ,  0, R,  DZ, 1 );
62  CP(mpCtrlPts[12] ,  0, R, -DZ, 1 );
63  CP(mpCtrlPts[13] ,  0, r, -DZ, 1 );
64  CP(mpCtrlPts[14] ,  0, r,  DZ, 1 );
65
66  CP(mpCtrlPts[15] , -r, r,  DZ, 1 , sr2o2);
67  CP(mpCtrlPts[16] , -R, R,  DZ, 1 , sr2o2);
68  CP(mpCtrlPts[17] , -R, R, -DZ, 1 , sr2o2);
69  CP(mpCtrlPts[18] , -r, r, -DZ, 1 , sr2o2);
70  CP(mpCtrlPts[19] , -r, r,  DZ, 1 , sr2o2);
71
72  CP(mpCtrlPts[20] , -r, 0,  DZ, 1 );
73  CP(mpCtrlPts[21] , -R, 0,  DZ, 1 );
74  CP(mpCtrlPts[22] , -R, 0, -DZ, 1 );
75  CP(mpCtrlPts[23] , -r, 0, -DZ, 1 );
76  CP(mpCtrlPts[24] , -r, 0,  DZ, 1 );
77
78  CP(mpCtrlPts[25] , -r,-r,  DZ, 1 , sr2o2);
79  CP(mpCtrlPts[26] , -R,-R,  DZ, 1 , sr2o2);
80  CP(mpCtrlPts[27] , -R,-R, -DZ, 1 , sr2o2);
81  CP(mpCtrlPts[28] , -r,-r, -DZ, 1 , sr2o2);
82  CP(mpCtrlPts[29] , -r,-R,  DZ, 1 , sr2o2);
83
84  CP(mpCtrlPts[30] ,  0,-r,  DZ, 1 );
85  CP(mpCtrlPts[31] ,  0,-R,  DZ, 1 );
86  CP(mpCtrlPts[32] ,  0,-R, -DZ, 1 );
87  CP(mpCtrlPts[33] ,  0,-r, -DZ, 1 );
88  CP(mpCtrlPts[34] ,  0,-r,  DZ, 1 );
89
90  CP(mpCtrlPts[35] ,  r,-r,  DZ, 1 , sr2o2);
91  CP(mpCtrlPts[36] ,  R,-R,  DZ, 1 , sr2o2);
92  CP(mpCtrlPts[37] ,  R,-R, -DZ, 1 , sr2o2);
93  CP(mpCtrlPts[38] ,  r,-r, -DZ, 1 , sr2o2);
94  CP(mpCtrlPts[39] ,  r,-r,  DZ, 1 , sr2o2);
95
96  CP(mpCtrlPts[40] ,  r, 0,  DZ, 1 );
97  CP(mpCtrlPts[41] ,  R, 0,  DZ, 1 );
98  CP(mpCtrlPts[42] ,  R, 0, -DZ, 1 );
99  CP(mpCtrlPts[43] ,  r, 0, -DZ, 1 );
100  CP(mpCtrlPts[44] ,  r, 0,  DZ, 1 );
101}
102
103const char* G4NURBStube::Whoami() const
104{
105  return "Tube";
106}
Note: See TracBrowser for help on using the repository browser.