Import Geant4 5.1.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
cvs log $Id: History,v 1.45 2002/11/27 12:24:19 johna Exp $
|
||||
cvs log $Id: History,v 1.46 2003/04/03 15:31:22 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,7 +17,10 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
27th November 2002 John Allison (greps-V04-01-05)
|
||||
3rd April 2003 G.Cosmo (greps-V05-00-00)
|
||||
- Cleared trivial pedantic warnings.
|
||||
|
||||
27th November 2002 J.Allison (greps-V04-01-05)
|
||||
- Small revison of G4Scale and improvements in G4VMarker class description.
|
||||
|
||||
Nov 20, 2002, G.Cosmo (greps-V04-01-04)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4AttDef.hh,v 1.3 2002/10/24 14:35:14 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
|
||||
#ifndef G4ATTDEF_HH
|
||||
#define G4ATTDEF_HH
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4AttDefStore.hh,v 1.3 2002/11/20 14:18:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
|
||||
#ifndef G4ATTDEFSTORE_HH
|
||||
#define G4ATTDEFSTORE_HH
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4AttValue.hh,v 1.3 2002/10/24 14:35:20 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
|
||||
#ifndef G4ATTVALUE_HH
|
||||
#define G4ATTVALUE_HH
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Circle.hh,v 1.6 2001/07/11 10:01:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 17/11/96.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Color.hh,v 1.4 2001/07/11 10:01:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 20th October 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Colour.hh,v 1.7 2002/10/23 12:03:38 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 20th October 1996
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBS.hh,v 1.6 2001/07/11 10:01:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBS.hh,v 1.7 2003/04/03 15:31:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
|
||||
@@ -33,9 +33,6 @@
|
||||
// Class Description:
|
||||
// Base class for shapes with NURBS drawing style.
|
||||
// See documentation in graphics_reps/doc for details.
|
||||
// Class Description - End:
|
||||
|
||||
|
||||
|
||||
#ifndef __C_G4NURBS__
|
||||
#define __C_G4NURBS__ 1
|
||||
@@ -43,25 +40,15 @@
|
||||
#include "globals.hh"
|
||||
#include "G4VVisPrim.hh"
|
||||
|
||||
// HP's CC compiler :
|
||||
// it's recommended that you include G4NURBS.hh BEFORE any other includes,
|
||||
// at least before iostream.h
|
||||
|
||||
// checked for CC, xlC, g++, cxx
|
||||
// * a friendness problem with DEC's cxx, fixed by __C_G4NURBS_FFIX__ *
|
||||
//#if defined(__DECCXX) || defined(WIN32) i.e., always defined.
|
||||
#define __C_G4NURBS_FFIX__ 1
|
||||
//#endif
|
||||
|
||||
// The internal floating point type is G4Float, defined line 162
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4Point3D.hh"
|
||||
#include "G4Vector3D.hh"
|
||||
|
||||
class G4NURBS : public G4VVisPrim {
|
||||
public:
|
||||
class G4NURBS : public G4VVisPrim
|
||||
{
|
||||
public:
|
||||
// NO public constructor. A G4NURBS must be builded with a child class.
|
||||
// Pure virtual function Whoami so one can't instanciate G4NURBS at all.
|
||||
|
||||
@@ -82,7 +69,8 @@ public:
|
||||
// and we want the user to be well-manered.
|
||||
// However internally this typed enum is not as easy to use as it
|
||||
// could be (we can't ++). "t_" means it's a kind of local type.
|
||||
enum t_direction {
|
||||
enum t_direction
|
||||
{
|
||||
U = 0,
|
||||
V = 1,
|
||||
DMask = 1, // NofD : Number of Directions
|
||||
@@ -157,9 +145,11 @@ public:
|
||||
G4float GetfloatKnot(t_direction in_dir, t_indKnot in_index) const;
|
||||
G4double GetdoubleKnot(t_direction in_dir, t_indKnot in_index) const;
|
||||
t_floatCtrlPt* GetfloatCtrlPt(t_indCtrlPt in_onedimindex) const;
|
||||
t_floatCtrlPt* GetfloatCtrlPt(t_inddCtrlPt in_Uindex, t_inddCtrlPt in_Vindex) const;
|
||||
t_floatCtrlPt* GetfloatCtrlPt(t_inddCtrlPt in_Uindex,
|
||||
t_inddCtrlPt in_Vindex) const;
|
||||
t_doubleCtrlPt* GetdoubleCtrlPt(t_indCtrlPt in_onedimindex) const;
|
||||
t_doubleCtrlPt* GetdoubleCtrlPt(t_inddCtrlPt in_Uindex, t_inddCtrlPt in_Vindex) const;
|
||||
t_doubleCtrlPt* GetdoubleCtrlPt(t_inddCtrlPt in_Uindex,
|
||||
t_inddCtrlPt in_Vindex) const;
|
||||
|
||||
// complete copy functions
|
||||
// the user don't control the allocation and the copy process
|
||||
@@ -171,13 +161,14 @@ public:
|
||||
G4double* GetdoubleAllCtrlPts() const;
|
||||
|
||||
// the iterators need that, the user does not
|
||||
protected:
|
||||
|
||||
protected:
|
||||
// internal type for reel numbers
|
||||
// ( Float is defined in templates.hh and is
|
||||
// under the control of HIGH_PRECISION )
|
||||
typedef Float G4Float;
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
// internal type for order, derivate from t_index
|
||||
typedef t_index t_order;
|
||||
@@ -185,7 +176,7 @@ public:
|
||||
// internal type for knot
|
||||
typedef G4Float t_Knot;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
// internal types for the control points
|
||||
typedef G4Float t_Coord;
|
||||
@@ -195,7 +186,7 @@ protected:
|
||||
// type for ref counting
|
||||
//typedef unsigned int t_refcount;
|
||||
|
||||
public:
|
||||
public:
|
||||
// iterators for an .... iterative access to knots and control points
|
||||
|
||||
// errors are reported on G4cerr
|
||||
@@ -219,9 +210,11 @@ public:
|
||||
// while (my_iterator.pick(my_float_p++));
|
||||
// that's all! my_array contain all the U knots.
|
||||
|
||||
class KnotsIterator {
|
||||
class KnotsIterator
|
||||
{
|
||||
public:
|
||||
KnotsIterator(const G4NURBS & in_rNurb, t_direction in_dir, t_indKnot in_startIndex = 0);
|
||||
KnotsIterator(const G4NURBS & in_rNurb, t_direction in_dir,
|
||||
t_indKnot in_startIndex = 0);
|
||||
G4bool pick(G4double * inout_pDbl);
|
||||
G4bool pick(G4float * inout_pFlt);
|
||||
//~KnotsIterator();
|
||||
@@ -234,15 +227,18 @@ public:
|
||||
|
||||
// the CtrlPtsCoordsIterator. Works like the knots' one :
|
||||
// G4float * my_array, * my_float_p;
|
||||
// my_float_p = my_array = new float [my_nurb.GettotalnbrCtrlPts()*G4NURBS::NofC*sizeof(float)];
|
||||
// my_float_p = my_array =
|
||||
// new float [my_nurb.GettotalnbrCtrlPts()*G4NURBS::NofC*sizeof(float)];
|
||||
// G4NURBS::CtrlPtsCoordsIterator my_iterator(my_nurb);
|
||||
// while (my_iterator.pick(my_float_p++));
|
||||
// after the while statement; my_float_p point just after the array
|
||||
// Remember ctrlpts are given U index increasing first
|
||||
|
||||
class CtrlPtsCoordsIterator {
|
||||
class CtrlPtsCoordsIterator
|
||||
{
|
||||
public:
|
||||
CtrlPtsCoordsIterator(const G4NURBS & in_rNurb, t_indCtrlPt in_startCtrlPtIndex = 0);
|
||||
CtrlPtsCoordsIterator(const G4NURBS & in_rNurb,
|
||||
t_indCtrlPt in_startCtrlPtIndex = 0);
|
||||
G4bool pick(G4double * inout_pDbl);
|
||||
G4bool pick(G4float * inout_pFlt);
|
||||
//~CtrlPtsCoordsIterator();
|
||||
@@ -254,7 +250,8 @@ public:
|
||||
|
||||
// this iterator work CtrlPt by CtrlPt
|
||||
// see the << overload for an example
|
||||
class CtrlPtsIterator {
|
||||
class CtrlPtsIterator
|
||||
{
|
||||
public:
|
||||
CtrlPtsIterator(const G4NURBS & in_rNurb, t_indCtrlPt in_startIndex = 0);
|
||||
G4bool pick(t_doubleCtrlPt * inout_pDblCtrlPt);
|
||||
@@ -268,10 +265,11 @@ public:
|
||||
|
||||
// Q: a directional Iterator to extract one col/row of CtrlPts ?
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
// little structure containing data for each direction
|
||||
struct t_Dir {
|
||||
struct t_Dir
|
||||
{
|
||||
t_order order;
|
||||
t_inddCtrlPt nbrCtrlPts;
|
||||
t_indKnot nbrKnots;
|
||||
@@ -294,7 +292,7 @@ protected:
|
||||
G4NURBS (t_order in_Uorder, t_order in_Vorder,
|
||||
t_inddCtrlPt in_UnbrCtrlPts, t_inddCtrlPt in_VnbrCtrlPts,
|
||||
t_CtrlPt * in_pCtrlPts,
|
||||
t_Knot * in_pUKnots = NULL, t_Knot * in_pVKnots = NULL,
|
||||
t_Knot * in_pUKnots = 0, t_Knot * in_pVKnots = 0,
|
||||
t_CheckFlag in_CheckFlag = check );
|
||||
|
||||
// NB: the minimal NURBS is order 1, 2 knots, => 1 control points
|
||||
@@ -316,13 +314,13 @@ protected:
|
||||
// (in particular how avoid out of range access)
|
||||
// without class types for arrays.
|
||||
|
||||
#ifdef __C_G4NURBS_FFIX__
|
||||
public:
|
||||
#endif
|
||||
public:
|
||||
|
||||
// knots vector generation flag
|
||||
enum t_KnotVectorGenFlag {
|
||||
UserDefined, // The user will fill the array (in the child constructor for instance).
|
||||
enum t_KnotVectorGenFlag
|
||||
{
|
||||
UserDefined, // The user will fill the array (in the child constructor
|
||||
// for instance).
|
||||
|
||||
Regular, // First and last knot repeated order time
|
||||
// other knots regularly spaced, unrepeated.
|
||||
@@ -333,9 +331,7 @@ public:
|
||||
// Typically used for "circular" knots vector and alikes.
|
||||
}; //t_KnotVectorGenFlag
|
||||
|
||||
#ifdef __C_G4NURBS_FFIX__
|
||||
protected:
|
||||
#endif
|
||||
protected:
|
||||
|
||||
// external representation for t_KnotVectorGenFlag
|
||||
// as a << overload.
|
||||
@@ -385,20 +381,19 @@ protected:
|
||||
// used just as knots vector container)
|
||||
// Return true if succesfull.
|
||||
// ALWAYS allocate the knots array.
|
||||
// (return false and do nothing if it already exists (ie != NULL))
|
||||
// (return false and do nothing if it already exists (ie != 0))
|
||||
// Always fail if order + nbrCtrlPt != nbrKnots
|
||||
static G4bool MakeKnotVector(t_Dir & inout_dirdat, t_KnotVectorGenFlag in_KVGFlag);
|
||||
static G4bool MakeKnotVector(t_Dir * p_inoutdirdat, t_KnotVectorGenFlag in_KVGFlag);
|
||||
// the second is just an alias, cf further
|
||||
static G4bool MakeKnotVector(t_Dir & inout_dirdat,
|
||||
t_KnotVectorGenFlag in_KVGFlag);
|
||||
static G4bool MakeKnotVector(t_Dir * p_inoutdirdat,
|
||||
t_KnotVectorGenFlag in_KVGFlag);
|
||||
|
||||
// others building functions ?
|
||||
// revolve ?
|
||||
// partial revolve ?
|
||||
static void CP(G4NURBS::t_CtrlPt & rcp, t_Coord x, t_Coord y,
|
||||
t_Coord z, t_Coord w);
|
||||
static void CP(G4NURBS::t_CtrlPt & rcp, t_Coord x, t_Coord y,
|
||||
t_Coord z, t_Coord w, G4Float factor);
|
||||
|
||||
static void CP(G4NURBS::t_CtrlPt & rcp, t_Coord x, t_Coord y, t_Coord z, t_Coord w);
|
||||
static void CP(G4NURBS::t_CtrlPt & rcp, t_Coord x, t_Coord y, t_Coord z, t_Coord w, G4Float factor);
|
||||
|
||||
private:
|
||||
private:
|
||||
// check function used internally by constructors.
|
||||
// no returned value because all errors reported are fatals.
|
||||
// (assume order + nbrCtrlPts == nbrKnots
|
||||
@@ -412,14 +407,16 @@ private:
|
||||
};
|
||||
|
||||
// external representation for t_KnotVectorGenFlag
|
||||
G4std::ostream & operator << (G4std::ostream & inout_OutStream, G4NURBS::t_KnotVectorGenFlag in_KVGFlag);
|
||||
G4std::ostream & operator << (G4std::ostream & inout_OutStream,
|
||||
G4NURBS::t_KnotVectorGenFlag in_KVGFlag);
|
||||
|
||||
|
||||
// << overload to dump a nurbs
|
||||
// writted with public access functions
|
||||
// do not depends on protected part
|
||||
|
||||
G4std::ostream & operator << (G4std::ostream & inout_outStream, const G4NURBS & in_kNurb);
|
||||
G4std::ostream & operator << (G4std::ostream & inout_outStream,
|
||||
const G4NURBS & in_kNurb);
|
||||
|
||||
/***********************************************************************
|
||||
* *
|
||||
@@ -478,13 +475,15 @@ inline char G4NURBS::Tochar(G4NURBS::t_direction in_dir) {
|
||||
//( Ctrl Pts are stored U increasing first )
|
||||
// no check.
|
||||
inline G4NURBS::t_indCtrlPt
|
||||
G4NURBS::To1d(t_inddCtrlPt in_Uindex, t_inddCtrlPt in_Vindex) const {
|
||||
G4NURBS::To1d(t_inddCtrlPt in_Uindex, t_inddCtrlPt in_Vindex) const
|
||||
{
|
||||
return in_Uindex + in_Vindex*m[U].nbrCtrlPts;
|
||||
}
|
||||
|
||||
// return a float copy
|
||||
inline G4NURBS::t_floatCtrlPt*
|
||||
G4NURBS::TofloatCtrlPt(const t_CtrlPt & in_krcp) {
|
||||
G4NURBS::TofloatCtrlPt(const t_CtrlPt & in_krcp)
|
||||
{
|
||||
G4NURBS::t_floatCtrlPt * pcopy = new G4NURBS::t_floatCtrlPt [1];
|
||||
for (G4int indCoord = X; indCoord < NofC; indCoord++)
|
||||
(*pcopy)[indCoord] = (G4float)in_krcp[indCoord];
|
||||
@@ -493,7 +492,8 @@ G4NURBS::TofloatCtrlPt(const t_CtrlPt & in_krcp) {
|
||||
|
||||
// return a double copy
|
||||
inline G4NURBS::t_doubleCtrlPt*
|
||||
G4NURBS::TodoubleCtrlPt(const t_CtrlPt & in_krcp) {
|
||||
G4NURBS::TodoubleCtrlPt(const t_CtrlPt & in_krcp)
|
||||
{
|
||||
G4NURBS::t_doubleCtrlPt * pcopy = new G4NURBS::t_doubleCtrlPt [1];
|
||||
for (G4int indCoord = X; indCoord < NofC; indCoord++)
|
||||
(*pcopy)[indCoord] = (G4double)in_krcp[indCoord];
|
||||
@@ -501,7 +501,9 @@ G4NURBS::TodoubleCtrlPt(const t_CtrlPt & in_krcp) {
|
||||
}
|
||||
|
||||
// MakeKnotVector alias
|
||||
inline G4bool G4NURBS::MakeKnotVector(G4NURBS::t_Dir * p_inoutdirdat, G4NURBS::t_KnotVectorGenFlag in_KVGFlag) {
|
||||
inline G4bool G4NURBS::MakeKnotVector(G4NURBS::t_Dir * p_inoutdirdat,
|
||||
G4NURBS::t_KnotVectorGenFlag in_KVGFlag)
|
||||
{
|
||||
return MakeKnotVector(*p_inoutdirdat, in_KVGFlag);
|
||||
}
|
||||
|
||||
@@ -513,7 +515,8 @@ inline G4bool G4NURBS::MakeKnotVector(G4NURBS::t_Dir * p_inoutdirdat, G4NURBS::t
|
||||
***********************************************************************/
|
||||
|
||||
inline void G4NURBS::CP(G4NURBS::t_CtrlPt & rcp,
|
||||
t_Coord x, t_Coord y, t_Coord z, t_Coord w) {
|
||||
t_Coord x, t_Coord y, t_Coord z, t_Coord w)
|
||||
{
|
||||
rcp[G4NURBS::X]=x;
|
||||
rcp[G4NURBS::Y]=y;
|
||||
rcp[G4NURBS::Z]=z;
|
||||
@@ -521,7 +524,9 @@ inline void G4NURBS::CP(G4NURBS::t_CtrlPt & rcp,
|
||||
}
|
||||
|
||||
// with a common factor
|
||||
inline void G4NURBS::CP(G4NURBS::t_CtrlPt & rcp, t_Coord x, t_Coord y, t_Coord z, t_Coord w, G4Float factor) {
|
||||
inline void G4NURBS::CP(G4NURBS::t_CtrlPt & rcp, t_Coord x,
|
||||
t_Coord y, t_Coord z, t_Coord w, G4Float factor)
|
||||
{
|
||||
rcp[G4NURBS::X]=factor*x;
|
||||
rcp[G4NURBS::Y]=factor*y;
|
||||
rcp[G4NURBS::Z]=factor*z;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBSbox.hh,v 1.6 2001/07/11 10:01:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBSbox.hh,v 1.7 2003/04/03 15:31:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -33,22 +33,20 @@
|
||||
// Class Description:
|
||||
// Box builder prototype for NURBS.
|
||||
// See documentation in graphics_reps/doc for details.
|
||||
// Class Description - End:
|
||||
|
||||
#ifndef __C_G4NURBSbox__
|
||||
#define __C_G4NURBSbox__ 1
|
||||
|
||||
#include "G4NURBS.hh"
|
||||
|
||||
#ifndef __C_G4NURBSbox__
|
||||
|
||||
#define __C_G4NURBSbox__ 1
|
||||
|
||||
class G4NURBSbox : public G4NURBS
|
||||
{
|
||||
public:
|
||||
G4NURBSbox(G4double DX, G4double DY, G4double DZ);
|
||||
virtual G4Visible& operator = (const G4Visible& right);
|
||||
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
|
||||
const char* Whoami() const;
|
||||
};
|
||||
class G4NURBSbox : public G4NURBS
|
||||
{
|
||||
public:
|
||||
G4NURBSbox(G4double DX, G4double DY, G4double DZ);
|
||||
virtual G4Visible& operator = (const G4Visible& right);
|
||||
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
|
||||
const char* Whoami() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
// end of __C_G4NURBSbox__
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBScylinder.hh,v 1.6 2001/07/11 10:01:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBScylinder.hh,v 1.7 2003/04/03 15:31:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -33,23 +33,20 @@
|
||||
// Class Description:
|
||||
// Cylinder builder prototype for NURBS.
|
||||
// See documentation in graphics_reps/doc for details.
|
||||
// Class Description - End:
|
||||
|
||||
#ifndef __C_G4NURBScylinder__
|
||||
#define __C_G4NURBScylinder__ 1
|
||||
|
||||
#include "G4NURBS.hh"
|
||||
|
||||
#ifndef __C_G4NURBScylinder__
|
||||
|
||||
#define __C_G4NURBScylinder__ 1
|
||||
|
||||
class G4NURBScylinder : public G4NURBS
|
||||
{
|
||||
public:
|
||||
G4NURBScylinder(G4double R, G4double DZ);
|
||||
virtual G4Visible& operator = (const G4Visible& right);
|
||||
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
|
||||
const char* Whoami() const;
|
||||
};
|
||||
class G4NURBScylinder : public G4NURBS
|
||||
{
|
||||
public:
|
||||
G4NURBScylinder(G4double R, G4double DZ);
|
||||
virtual G4Visible& operator = (const G4Visible& right);
|
||||
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
|
||||
const char* Whoami() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
// end of __C_G4NURBScylinder__
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBShexahedron.hh,v 1.6 2001/07/11 10:01:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBShexahedron.hh,v 1.7 2003/04/03 15:31:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
// Hexa hedron builder prototype
|
||||
// OC 17 9 96
|
||||
@@ -30,45 +30,35 @@
|
||||
// Class Description:
|
||||
// Hexa hedron builder prototype for NURBS.
|
||||
// See documentation in graphics_reps/doc for details.
|
||||
// Class Description - End:
|
||||
|
||||
|
||||
#include "G4NURBS.hh"
|
||||
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
|
||||
#ifndef __C_G4NURBShexahedron__
|
||||
|
||||
#define __C_G4NURBShexahedron__ 1
|
||||
|
||||
class G4NURBShexahedron : public G4NURBS
|
||||
{
|
||||
|
||||
// imagine the hexahedron is just a box, then
|
||||
// the eight corners must be given in the following order :
|
||||
// DX DY -DZ
|
||||
// -DX DY -DZ
|
||||
// -DX -DY -DZ
|
||||
// DX -DY -DZ
|
||||
// DX DY DZ
|
||||
// -DX DY DZ
|
||||
// -DX -DY DZ
|
||||
// DX -DY DZ
|
||||
// (ie, with Oz pointing to you, Ox on the right, Oy on the top:
|
||||
// from the rear, from the upper right corner to the lower one
|
||||
// in anticlockwise sens, then the same for front side)
|
||||
#include "G4NURBS.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
public:
|
||||
G4NURBShexahedron(const G4ThreeVector Corners [8]);
|
||||
virtual G4Visible& operator = (const G4Visible& right);
|
||||
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
|
||||
const char* Whoami() const;
|
||||
};
|
||||
class G4NURBShexahedron : public G4NURBS
|
||||
{
|
||||
// imagine the hexahedron is just a box, then
|
||||
// the eight corners must be given in the following order :
|
||||
// DX DY -DZ
|
||||
// -DX DY -DZ
|
||||
// -DX -DY -DZ
|
||||
// DX -DY -DZ
|
||||
// DX DY DZ
|
||||
// -DX DY DZ
|
||||
// -DX -DY DZ
|
||||
// DX -DY DZ
|
||||
// (ie, with Oz pointing to you, Ox on the right, Oy on the top:
|
||||
// from the rear, from the upper right corner to the lower one
|
||||
// in anticlockwise sens, then the same for front side)
|
||||
|
||||
public:
|
||||
G4NURBShexahedron(const G4ThreeVector Corners [8]);
|
||||
virtual G4Visible& operator = (const G4Visible& right);
|
||||
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
|
||||
const char* Whoami() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
// end of __C_G4NURBShexahedron__
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBStube.hh,v 1.6 2001/07/11 10:01:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBStube.hh,v 1.7 2003/04/03 15:31:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -33,22 +33,19 @@
|
||||
// Class Description:
|
||||
// Tube builder prototype for NURBS.
|
||||
// See documentation in graphics_reps/doc for details.
|
||||
// Class Description - End:
|
||||
|
||||
#ifndef __C_G4NURBStube__
|
||||
#define __C_G4NURBStube__ 1
|
||||
|
||||
#include "G4NURBS.hh"
|
||||
|
||||
#ifndef __C_G4NURBStube__
|
||||
|
||||
#define __C_G4NURBStube__ 1
|
||||
|
||||
class G4NURBStube : public G4NURBS
|
||||
{
|
||||
public:
|
||||
G4NURBStube(G4double RMIN, G4double RMAX, G4double DZ);
|
||||
virtual G4Visible& operator = (const G4Visible& right);
|
||||
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
|
||||
const char* Whoami() const;
|
||||
};
|
||||
|
||||
class G4NURBStube : public G4NURBS
|
||||
{
|
||||
public:
|
||||
G4NURBStube(G4double RMIN, G4double RMAX, G4double DZ);
|
||||
virtual G4Visible& operator = (const G4Visible& right);
|
||||
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
|
||||
const char* Whoami() const;
|
||||
};
|
||||
#endif
|
||||
// end of __C_G4NURBStube__
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBStubesector.hh,v 1.5 2001/07/11 10:01:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBStubesector.hh,v 1.6 2003/04/03 15:31:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -33,47 +33,36 @@
|
||||
// Class Description:
|
||||
// Tubesector builder prototype for NURBS.
|
||||
// See documentation in graphics_reps/doc for details.
|
||||
// Class Description - End:
|
||||
|
||||
|
||||
#ifndef __C_G4NURBStubesector__
|
||||
#define __C_G4NURBStubesector__ 1
|
||||
|
||||
#include "G4NURBS.hh"
|
||||
|
||||
#ifndef __C_G4NURBStubesector__
|
||||
class G4NURBStubesector : public G4NURBS
|
||||
{
|
||||
public:
|
||||
// angle in radians
|
||||
|
||||
#define __C_G4NURBStubesector__ 1
|
||||
// If PHI2 smaller (or equal) than PHI1 , it is incremented
|
||||
// by 2pi as necessary to become strictly greater.
|
||||
|
||||
class G4NURBStubesector : public G4NURBS
|
||||
{
|
||||
public:
|
||||
// angle in radians
|
||||
|
||||
// If PHI2 smaller (or equal) than PHI1 , it is incremented
|
||||
// by 2pi as necessary to become strictly greater.
|
||||
|
||||
// Except that, you can use any value for the arguments,
|
||||
// it's the renderer or you that will have troubles.
|
||||
|
||||
G4NURBStubesector(G4double RMIN, G4double RMAX,
|
||||
G4double DZ, G4double PHI1, G4double PHI2);
|
||||
virtual ~G4NURBStubesector();
|
||||
virtual G4Visible& operator = (const G4Visible& right);
|
||||
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
|
||||
virtual const char* Whoami() const;
|
||||
|
||||
protected:
|
||||
char * mpwhoami;
|
||||
|
||||
private:
|
||||
static t_inddCtrlPt DecideNbrCtrlPts(G4double PHI1, G4double PHI2);
|
||||
};
|
||||
// Except that, you can use any value for the arguments,
|
||||
// it's the renderer or you that will have troubles.
|
||||
|
||||
G4NURBStubesector(G4double RMIN, G4double RMAX,
|
||||
G4double DZ, G4double PHI1, G4double PHI2);
|
||||
virtual ~G4NURBStubesector();
|
||||
virtual G4Visible& operator = (const G4Visible& right);
|
||||
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
|
||||
virtual const char* Whoami() const;
|
||||
|
||||
protected:
|
||||
char * mpwhoami;
|
||||
|
||||
private:
|
||||
static t_inddCtrlPt DecideNbrCtrlPts(G4double PHI1, G4double PHI2);
|
||||
};
|
||||
|
||||
#endif
|
||||
// end of __C_G4NURBStubesector__
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PlacedPolyhedron.hh,v 1.9 2001/07/11 10:01:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
|
||||
|
||||
// Class Description:
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Point3DList.hh,v 1.10 2001/08/20 23:28:42 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison July 1995
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Polyhedron.hh,v 1.10 2001/07/11 10:01:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
|
||||
#ifndef G4POLYHEDRON_HH
|
||||
#define G4POLYHEDRON_HH
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Polyline.hh,v 1.9 2001/08/20 23:28:43 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison July 1995
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Polymarker.hh,v 1.7 2001/07/11 10:01:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison November 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Polymarker.icc,v 1.3 2001/07/11 10:01:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison November 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Scale.hh,v 1.5 2002/11/27 12:24:01 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 21st July 2001.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Scale.icc,v 1.2 2001/07/24 21:41:42 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 21st July 2001.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Square.hh,v 1.5 2001/07/11 10:01:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 17/11/96.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Square.icc,v 1.3 2001/07/11 10:01:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 17/11/96.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Text.hh,v 1.7 2001/07/11 10:01:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 17/11/96.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Text.icc,v 1.3 2001/07/11 10:01:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 17/11/96.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VMarker.hh,v 1.8 2002/11/27 12:23:20 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// G4VMarker - base class for markers - circles, squares, etc.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VMarker.icc,v 1.6 2001/07/11 10:01:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VVisPrim.hh,v 1.8 2001/07/11 10:01:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison August 1995
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisAttributes.hh,v 1.10 2002/11/20 14:18:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 23rd October 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisAttributes.icc,v 1.5 2002/10/24 14:36:40 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 18th November 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisExtent.hh,v 1.6 2001/07/24 21:39:43 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// A.Walkden 28/11/95
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Visible.hh,v 1.7 2001/07/11 10:01:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 30th October 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Visible.icc,v 1.4 2001/07/11 10:01:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 30th October 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: HepPolyhedron.h,v 1.12 2002/11/20 14:18:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// Class Description:
|
||||
|
||||
@@ -780,7 +780,7 @@ void BooleanProcessor::caseII(ExtEdge & edge1, ExtEdge & edge2)
|
||||
insertEdge(edge2);
|
||||
}
|
||||
|
||||
void BooleanProcessor::caseIE(ExtEdge & edge1, ExtEdge & edge2)
|
||||
void BooleanProcessor::caseIE(ExtEdge &, ExtEdge &)
|
||||
/***********************************************************************
|
||||
* *
|
||||
* Name: BooleanProcessor::caseIE Date: 19.01.00 *
|
||||
@@ -796,7 +796,7 @@ void BooleanProcessor::caseIE(ExtEdge & edge1, ExtEdge & edge2)
|
||||
<< HepStd::endl;
|
||||
}
|
||||
|
||||
void BooleanProcessor::caseEE(ExtEdge & edge1, ExtEdge & edge2)
|
||||
void BooleanProcessor::caseEE(ExtEdge &, ExtEdge &)
|
||||
/***********************************************************************
|
||||
* *
|
||||
* Name: BooleanProcessor::caseEE Date: 19.01.00 *
|
||||
@@ -890,7 +890,7 @@ void BooleanProcessor::invertNewEdges(int iface)
|
||||
}
|
||||
}
|
||||
|
||||
void BooleanProcessor::checkDoubleEdges(int iface)
|
||||
void BooleanProcessor::checkDoubleEdges(int)
|
||||
/***********************************************************************
|
||||
* *
|
||||
* Name: BooleanProcessor::checkDoubleEdges Date: 04.02.00 *
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4AttDefStore.cc,v 1.2 2002/10/28 11:13:08 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
|
||||
#include "G4AttDefStore.hh"
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Circle.cc,v 1.4 2001/07/11 10:01:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Colour.cc,v 1.4 2001/07/11 10:01:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 20th October 1996
|
||||
|
||||
+508
-520
File diff suppressed because it is too large
Load Diff
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBSbox.cc,v 1.4 2001/07/11 10:01:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBSbox.cc,v 1.5 2003/04/03 15:31:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -32,64 +32,53 @@
|
||||
|
||||
#include "G4NURBSbox.hh"
|
||||
|
||||
G4NURBSbox::G4NURBSbox(G4double DX, G4double DY, G4double DZ)
|
||||
:
|
||||
G4NURBS (
|
||||
2, 2, // linear along U and V
|
||||
4, 5 // line with two 90 degrees folds along U
|
||||
// rectangle along V (3 folds)
|
||||
)
|
||||
// let's it Generate regular knots vector
|
||||
// (note we are calling the second constructor)
|
||||
{
|
||||
t_indCtrlPt i = 0;
|
||||
G4NURBSbox::G4NURBSbox(G4double DX, G4double DY, G4double DZ)
|
||||
: G4NURBS ( 2, 2, // linear along U and V
|
||||
4, 5 ) // line with two 90 degrees folds along U
|
||||
// rectangle along V (3 folds)
|
||||
{
|
||||
// let's it Generate regular knots vector
|
||||
// (note we are calling the second constructor)
|
||||
|
||||
t_indCtrlPt i = 0;
|
||||
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[i++], DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX,-DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX,-DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY,-DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[i++], DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY,-DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
G4Visible & G4NURBSbox::operator = (const G4Visible &right) {
|
||||
G4Visible & G4NURBSbox::operator = (const G4Visible &right)
|
||||
{
|
||||
return G4Visible::operator = (right);
|
||||
}
|
||||
|
||||
G4VVisPrim & G4NURBSbox::operator = (const G4VVisPrim &right) {
|
||||
G4VVisPrim & G4NURBSbox::operator = (const G4VVisPrim &right)
|
||||
{
|
||||
return G4VVisPrim::operator = (right);
|
||||
}
|
||||
|
||||
const char* G4NURBSbox::Whoami() const
|
||||
{
|
||||
return "Box (as a folded piece)";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const char* G4NURBSbox::Whoami() const
|
||||
{
|
||||
return "Box (as a folded piece)";
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBScylinder.cc,v 1.4 2001/07/11 10:01:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBScylinder.cc,v 1.5 2003/04/03 15:31:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -32,104 +32,91 @@
|
||||
|
||||
#include "G4NURBScylinder.hh"
|
||||
|
||||
// for sqrt
|
||||
//#include <math.h>
|
||||
// math.h included in template.hh included in globals.hh included in
|
||||
// G4NURBS.hh included in G4NURBScylinder.hh
|
||||
|
||||
// the cylinder constructor use the first G4NURBS constructor
|
||||
// look in G4NURBStube if you want to see how to use the second one.
|
||||
|
||||
G4NURBScylinder::G4NURBScylinder(G4double R, G4double DZ)
|
||||
:
|
||||
G4NURBS (
|
||||
2, 3, // linear along U, quadratic along V
|
||||
4, 9, // half rectangle along U, circle along V
|
||||
(new t_CtrlPt [ 4 * 9 ]), // the array for CtrlPts
|
||||
NULL, // the knot vector along U will be generated
|
||||
(new t_Knot [ 3 + 9 ]) // knot vector for the circle
|
||||
)
|
||||
{
|
||||
// define the V knot vector
|
||||
m[V].pKnots[ 0] = 0;
|
||||
m[V].pKnots[ 1] = 0;
|
||||
m[V].pKnots[ 2] = 0;
|
||||
m[V].pKnots[ 3] = 0.25;
|
||||
m[V].pKnots[ 4] = 0.25;
|
||||
m[V].pKnots[ 5] = 0.5;
|
||||
m[V].pKnots[ 6] = 0.5;
|
||||
m[V].pKnots[ 7] = 0.75;
|
||||
m[V].pKnots[ 8] = 0.75;
|
||||
m[V].pKnots[ 9] = 1;
|
||||
m[V].pKnots[10] = 1;
|
||||
m[V].pKnots[11] = 1;
|
||||
G4NURBScylinder::G4NURBScylinder(G4double R, G4double DZ)
|
||||
: G4NURBS ( 2, 3, // linear along U, quadratic along V
|
||||
4, 9, // half rectangle along U, circle along V
|
||||
(new t_CtrlPt [ 4 * 9 ]), // the array for CtrlPts
|
||||
0, // the knot vector along U will be generated
|
||||
(new t_Knot [ 3 + 9 ]) ) // knot vector for the circle
|
||||
{
|
||||
// define the V knot vector
|
||||
m[V].pKnots[ 0] = 0;
|
||||
m[V].pKnots[ 1] = 0;
|
||||
m[V].pKnots[ 2] = 0;
|
||||
m[V].pKnots[ 3] = 0.25;
|
||||
m[V].pKnots[ 4] = 0.25;
|
||||
m[V].pKnots[ 5] = 0.5;
|
||||
m[V].pKnots[ 6] = 0.5;
|
||||
m[V].pKnots[ 7] = 0.75;
|
||||
m[V].pKnots[ 8] = 0.75;
|
||||
m[V].pKnots[ 9] = 1;
|
||||
m[V].pKnots[10] = 1;
|
||||
m[V].pKnots[11] = 1;
|
||||
|
||||
// define control points
|
||||
// define control points
|
||||
|
||||
const G4double sr2o2 = sqrt(2.)/2. ;
|
||||
const G4double sr2o2 = sqrt(2.)/2. ;
|
||||
|
||||
CP(mpCtrlPts[ 0] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 1] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 2] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 3] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 0] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 1] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 2] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 3] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[ 4] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 5] , R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 6] , R, R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 7] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 4] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 5] , R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 6] , R, R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 7] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[ 8] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 9] , 0, R, DZ, 1 );
|
||||
CP(mpCtrlPts[10] , 0, R, -DZ, 1 );
|
||||
CP(mpCtrlPts[11] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 8] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 9] , 0, R, DZ, 1 );
|
||||
CP(mpCtrlPts[10] , 0, R, -DZ, 1 );
|
||||
CP(mpCtrlPts[11] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[12] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[13] , -R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[14] , -R, R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[15] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[12] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[13] , -R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[14] , -R, R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[15] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[16] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[17] , -R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[18] , -R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[19] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[16] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[17] , -R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[18] , -R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[19] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[20] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[21] , -R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[22] , -R,-R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[23] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[20] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[21] , -R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[22] , -R,-R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[23] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[24] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[25] , 0, -R, DZ, 1 );
|
||||
CP(mpCtrlPts[26] , 0, -R,-DZ, 1 );
|
||||
CP(mpCtrlPts[27] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[24] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[25] , 0, -R, DZ, 1 );
|
||||
CP(mpCtrlPts[26] , 0, -R,-DZ, 1 );
|
||||
CP(mpCtrlPts[27] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[28] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[29] , R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[30] , R,-R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[31] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[28] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[29] , R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[30] , R,-R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[31] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[32] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[33] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[34] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[35] , 0, 0, -DZ, 1 );
|
||||
|
||||
}
|
||||
CP(mpCtrlPts[32] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[33] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[34] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[35] , 0, 0, -DZ, 1 );
|
||||
}
|
||||
|
||||
G4Visible & G4NURBScylinder::operator = (const G4Visible &right) {
|
||||
G4Visible & G4NURBScylinder::operator = (const G4Visible &right)
|
||||
{
|
||||
return G4Visible::operator = (right);
|
||||
}
|
||||
|
||||
G4VVisPrim & G4NURBScylinder::operator = (const G4VVisPrim &right) {
|
||||
G4VVisPrim & G4NURBScylinder::operator = (const G4VVisPrim &right)
|
||||
{
|
||||
return G4VVisPrim::operator = (right);
|
||||
}
|
||||
|
||||
const char* G4NURBScylinder::Whoami() const
|
||||
{
|
||||
return "Cylinder";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const char* G4NURBScylinder::Whoami() const
|
||||
{
|
||||
return "Cylinder";
|
||||
}
|
||||
|
||||
@@ -21,71 +21,56 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBShexahedron.cc,v 1.4 2001/07/11 10:01:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBShexahedron.cc,v 1.5 2003/04/03 15:31:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
// hexahedron implementation
|
||||
// OC 17 9 96
|
||||
|
||||
#include "G4NURBShexahedron.hh"
|
||||
|
||||
G4NURBShexahedron::G4NURBShexahedron(const G4ThreeVector c [8])
|
||||
:
|
||||
G4NURBS (
|
||||
2, 2, // linear along U and V
|
||||
5, 4 // Square x polyline
|
||||
)
|
||||
// let's it Generate regular knots vector
|
||||
{
|
||||
// we need to define control points, indeed
|
||||
G4NURBShexahedron::G4NURBShexahedron(const G4ThreeVector c [8])
|
||||
: G4NURBS( 2, 2, // linear along U and V
|
||||
5, 4 ) // Square x polyline
|
||||
{
|
||||
// let's it Generate regular knots vector
|
||||
|
||||
CP(mpCtrlPts[To1d(0,0)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,0)] , c[1].x(), c[1].y(), c[1].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,0)] , c[1].x(), c[1].y(), c[1].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,0)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,0)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
|
||||
CP(mpCtrlPts[To1d(0,0)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,0)] , c[1].x(), c[1].y(), c[1].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,0)] , c[1].x(), c[1].y(), c[1].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,0)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,0)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(0,1)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,1)] , c[1].x(), c[1].y(), c[1].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,1)] , c[2].x(), c[2].y(), c[2].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,1)] , c[3].x(), c[3].y(), c[3].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,1)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
|
||||
CP(mpCtrlPts[To1d(0,2)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,2)] , c[5].x(), c[5].y(), c[5].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,2)] , c[6].x(), c[6].y(), c[6].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,2)] , c[7].x(), c[7].y(), c[7].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,2)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
|
||||
CP(mpCtrlPts[To1d(0,1)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,1)] , c[1].x(), c[1].y(), c[1].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,1)] , c[2].x(), c[2].y(), c[2].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,1)] , c[3].x(), c[3].y(), c[3].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,1)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(0,3)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,3)] , c[5].x(), c[5].y(), c[5].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,3)] , c[5].x(), c[5].y(), c[5].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,3)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,3)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
}
|
||||
|
||||
|
||||
CP(mpCtrlPts[To1d(0,2)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,2)] , c[5].x(), c[5].y(), c[5].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,2)] , c[6].x(), c[6].y(), c[6].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,2)] , c[7].x(), c[7].y(), c[7].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,2)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
|
||||
|
||||
CP(mpCtrlPts[To1d(0,3)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,3)] , c[5].x(), c[5].y(), c[5].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,3)] , c[5].x(), c[5].y(), c[5].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,3)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,3)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
G4Visible & G4NURBShexahedron::operator = (const G4Visible &right) {
|
||||
G4Visible & G4NURBShexahedron::operator = (const G4Visible &right)
|
||||
{
|
||||
return G4Visible::operator = (right);
|
||||
}
|
||||
|
||||
G4VVisPrim & G4NURBShexahedron::operator = (const G4VVisPrim &right) {
|
||||
G4VVisPrim & G4NURBShexahedron::operator = (const G4VVisPrim &right)
|
||||
{
|
||||
return G4VVisPrim::operator = (right);
|
||||
}
|
||||
|
||||
const char* G4NURBShexahedron::Whoami() const
|
||||
{
|
||||
return "Hexahedron";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const char* G4NURBShexahedron::Whoami() const
|
||||
{
|
||||
return "Hexahedron";
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBStube.cc,v 1.4 2001/07/11 10:01:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBStube.cc,v 1.5 2003/04/03 15:31:07 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -32,94 +32,82 @@
|
||||
|
||||
#include "G4NURBStube.hh"
|
||||
|
||||
// for sqrt
|
||||
//#include <math.h>
|
||||
// cf cylinder
|
||||
G4NURBStube::G4NURBStube(G4double r, G4double R, G4double DZ)
|
||||
: G4NURBS( 2, 3, // linear along U, quadratic along V
|
||||
5, 9, // rectangle along U, circle along V
|
||||
Regular, // the knot vector along U will be generated
|
||||
RegularRep ) // knot vector for the circle also
|
||||
{
|
||||
// define control points
|
||||
|
||||
G4NURBStube::G4NURBStube(G4double r, G4double R, G4double DZ)
|
||||
:
|
||||
G4NURBS (
|
||||
2, 3, // linear along U, quadratic along V
|
||||
5, 9, // rectangle along U, circle along V
|
||||
Regular, // the knot vector along U will be generated
|
||||
RegularRep // knot vector for the circle also
|
||||
)
|
||||
{
|
||||
// define control points
|
||||
const G4double sr2o2 = sqrt(2.)/2.;
|
||||
|
||||
const G4double sr2o2 = sqrt(2.)/2.;
|
||||
CP(mpCtrlPts[ 0] , r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 1] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 2] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 3] , r, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 4] , r, 0, DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[ 0] , r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 1] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 2] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 3] , r, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 4] , r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 5] , r, r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 6] , R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 7] , R, R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 8] , r, r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 9] , r, r, DZ, 1 , sr2o2);
|
||||
|
||||
CP(mpCtrlPts[ 5] , r, r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 6] , R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 7] , R, R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 8] , r, r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 9] , r, r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[10] , 0, r, DZ, 1 );
|
||||
CP(mpCtrlPts[11] , 0, R, DZ, 1 );
|
||||
CP(mpCtrlPts[12] , 0, R, -DZ, 1 );
|
||||
CP(mpCtrlPts[13] , 0, r, -DZ, 1 );
|
||||
CP(mpCtrlPts[14] , 0, r, DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[10] , 0, r, DZ, 1 );
|
||||
CP(mpCtrlPts[11] , 0, R, DZ, 1 );
|
||||
CP(mpCtrlPts[12] , 0, R, -DZ, 1 );
|
||||
CP(mpCtrlPts[13] , 0, r, -DZ, 1 );
|
||||
CP(mpCtrlPts[14] , 0, r, DZ, 1 );
|
||||
CP(mpCtrlPts[15] , -r, r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[16] , -R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[17] , -R, R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[18] , -r, r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[19] , -r, r, DZ, 1 , sr2o2);
|
||||
|
||||
CP(mpCtrlPts[15] , -r, r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[16] , -R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[17] , -R, R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[18] , -r, r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[19] , -r, r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[20] , -r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[21] , -R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[22] , -R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[23] , -r, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[24] , -r, 0, DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[20] , -r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[21] , -R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[22] , -R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[23] , -r, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[24] , -r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[25] , -r,-r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[26] , -R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[27] , -R,-R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[28] , -r,-r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[29] , -r,-R, DZ, 1 , sr2o2);
|
||||
|
||||
CP(mpCtrlPts[25] , -r,-r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[26] , -R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[27] , -R,-R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[28] , -r,-r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[29] , -r,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[30] , 0,-r, DZ, 1 );
|
||||
CP(mpCtrlPts[31] , 0,-R, DZ, 1 );
|
||||
CP(mpCtrlPts[32] , 0,-R, -DZ, 1 );
|
||||
CP(mpCtrlPts[33] , 0,-r, -DZ, 1 );
|
||||
CP(mpCtrlPts[34] , 0,-r, DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[30] , 0,-r, DZ, 1 );
|
||||
CP(mpCtrlPts[31] , 0,-R, DZ, 1 );
|
||||
CP(mpCtrlPts[32] , 0,-R, -DZ, 1 );
|
||||
CP(mpCtrlPts[33] , 0,-r, -DZ, 1 );
|
||||
CP(mpCtrlPts[34] , 0,-r, DZ, 1 );
|
||||
CP(mpCtrlPts[35] , r,-r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[36] , R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[37] , R,-R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[38] , r,-r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[39] , r,-r, DZ, 1 , sr2o2);
|
||||
|
||||
CP(mpCtrlPts[35] , r,-r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[36] , R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[37] , R,-R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[38] , r,-r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[39] , r,-r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[40] , r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[41] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[42] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[43] , r, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[44] , r, 0, DZ, 1 );
|
||||
}
|
||||
|
||||
CP(mpCtrlPts[40] , r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[41] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[42] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[43] , r, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[44] , r, 0, DZ, 1 );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
G4Visible & G4NURBStube::operator = (const G4Visible &right) {
|
||||
G4Visible & G4NURBStube::operator = (const G4Visible &right)
|
||||
{
|
||||
return G4Visible::operator = (right);
|
||||
}
|
||||
|
||||
G4VVisPrim & G4NURBStube::operator = (const G4VVisPrim &right) {
|
||||
G4VVisPrim & G4NURBStube::operator = (const G4VVisPrim &right)
|
||||
{
|
||||
return G4VVisPrim::operator = (right);
|
||||
}
|
||||
|
||||
const char* G4NURBStube::Whoami() const
|
||||
{
|
||||
return "Tube";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const char* G4NURBStube::Whoami() const
|
||||
{
|
||||
return "Tube";
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBStubesector.cc,v 1.5 2001/07/11 10:01:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBStubesector.cc,v 1.6 2003/04/03 15:31:07 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -31,207 +31,193 @@
|
||||
// OC 290896
|
||||
|
||||
#include "G4NURBStubesector.hh"
|
||||
|
||||
// for sqrt
|
||||
//#include <math.h>
|
||||
// cf cylinder
|
||||
|
||||
// for G4std::ostrstream
|
||||
#include "g4std/strstream"
|
||||
|
||||
G4NURBStubesector::G4NURBStubesector(G4double r, G4double R,
|
||||
G4double DZ, G4double PHI1, G4double PHI2)
|
||||
: G4NURBS( 2, 3, // linear along U, quadratic along V
|
||||
5, DecideNbrCtrlPts(PHI1, PHI2),
|
||||
// rectangle along U, required stuff along V
|
||||
// we must use a static function which
|
||||
// take the two angles because the
|
||||
// mother constructor is initialised
|
||||
// before everything
|
||||
Regular, // the knot vector along U will be generated
|
||||
RegularRep ) // circular like knot vector also
|
||||
{
|
||||
// check angles
|
||||
G4double deltaPHI = PHI2-PHI1;
|
||||
while (deltaPHI <= 0) { PHI2 += 2*M_PI; deltaPHI += 2*M_PI; };
|
||||
|
||||
G4NURBStubesector::G4NURBStubesector(G4double r, G4double R, G4double DZ, G4double PHI1, G4double PHI2)
|
||||
:
|
||||
G4NURBS (
|
||||
2, 3, // linear along U, quadratic along V
|
||||
5, DecideNbrCtrlPts(PHI1, PHI2),
|
||||
// rectangle along U, required stuff along V
|
||||
// we must use a static function which
|
||||
// take the two angles because the
|
||||
// mother constructor is initialised
|
||||
// before everything
|
||||
Regular, // the knot vector along U will be generated
|
||||
RegularRep // circular like knot vector also
|
||||
)
|
||||
{
|
||||
G4int f = (int)floor(deltaPHI / (M_PI_2)); //number of pi/2 arcs
|
||||
|
||||
// check angles
|
||||
G4double deltaPHI = PHI2-PHI1;
|
||||
while (deltaPHI <= 0) { PHI2 += 2*M_PI; deltaPHI += 2*M_PI; };
|
||||
const G4double mr = (r+R)/2;
|
||||
|
||||
G4int f = (int)floor(deltaPHI / (M_PI_2)); //number of pi/2 arcs
|
||||
|
||||
const G4double mr = (r+R)/2;
|
||||
|
||||
const G4double cp1 = cos(PHI1);
|
||||
const G4double sp1 = sin(PHI1);
|
||||
const G4double cp2 = cos(PHI2);
|
||||
const G4double sp2 = sin(PHI2);
|
||||
|
||||
|
||||
// define control points
|
||||
CP(mpCtrlPts[ 0] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 1] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 2] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 3] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 4] , cp1*mr, sp1*mr, 0, 1 );
|
||||
|
||||
CP(mpCtrlPts[ 5] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 6] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 7] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 8] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 9] , cp1*mr, sp1*mr, 0, 1 );
|
||||
|
||||
CP(mpCtrlPts[10] , cp1*r, sp1*r, DZ, 1 );
|
||||
CP(mpCtrlPts[11] , cp1*R, sp1*R, DZ, 1 );
|
||||
CP(mpCtrlPts[12] , cp1*R, sp1*R, -DZ, 1 );
|
||||
CP(mpCtrlPts[13] , cp1*r, sp1*r, -DZ, 1 );
|
||||
CP(mpCtrlPts[14] , cp1*r, sp1*r, DZ, 1 );
|
||||
|
||||
t_indCtrlPt i = 15;
|
||||
G4double srcAngle = PHI1;
|
||||
G4double deltaAngleo2;
|
||||
|
||||
G4double destAngle = M_PI_2 + PHI1;
|
||||
|
||||
for(; f > 0; f--)
|
||||
{
|
||||
|
||||
// the first arc CP is already Done
|
||||
|
||||
deltaAngleo2 = (destAngle - srcAngle) / 2;
|
||||
const G4double csa = cos(srcAngle);
|
||||
const G4double ssa = sin(srcAngle);
|
||||
const G4double tdao2 = tan(deltaAngleo2);
|
||||
|
||||
// to calculate the intermediate CP :
|
||||
// rotate by srcAngle the (1, tdao2) point
|
||||
const t_Coord x = csa - ssa*tdao2;
|
||||
const t_Coord y = ssa + csa*tdao2;
|
||||
|
||||
// weight of the CP
|
||||
const G4Float weight = (cos(deltaAngleo2));
|
||||
|
||||
// initialization. postfix ++ because i initialized to 15
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
|
||||
// end CP (which is the first CP of the next arc)
|
||||
const G4double cda = cos(destAngle);
|
||||
const G4double sda = sin(destAngle);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*R, sda*R, DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*R, sda*R, -DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, -DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, DZ, 1);
|
||||
|
||||
// prepare next arc
|
||||
srcAngle = destAngle;
|
||||
destAngle += M_PI_2;
|
||||
};
|
||||
const G4double cp1 = cos(PHI1);
|
||||
const G4double sp1 = sin(PHI1);
|
||||
const G4double cp2 = cos(PHI2);
|
||||
const G4double sp2 = sin(PHI2);
|
||||
|
||||
|
||||
|
||||
// f == 0, final Arc
|
||||
// could be handled in the loops
|
||||
// define control points
|
||||
CP(mpCtrlPts[ 0] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 1] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 2] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 3] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 4] , cp1*mr, sp1*mr, 0, 1 );
|
||||
|
||||
destAngle = PHI2;
|
||||
deltaAngleo2 = (destAngle - srcAngle) / 2;
|
||||
const G4double csa = cos(srcAngle);
|
||||
const G4double ssa = sin(srcAngle);
|
||||
const G4double tdao2 = tan(deltaAngleo2);
|
||||
CP(mpCtrlPts[ 5] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 6] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 7] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 8] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 9] , cp1*mr, sp1*mr, 0, 1 );
|
||||
|
||||
// to calculate the intermediate CP :
|
||||
// rotate by srcAngle the (1, tdao2) point
|
||||
const t_Coord x = csa - ssa*tdao2;
|
||||
const t_Coord y = ssa + csa*tdao2;
|
||||
CP(mpCtrlPts[10] , cp1*r, sp1*r, DZ, 1 );
|
||||
CP(mpCtrlPts[11] , cp1*R, sp1*R, DZ, 1 );
|
||||
CP(mpCtrlPts[12] , cp1*R, sp1*R, -DZ, 1 );
|
||||
CP(mpCtrlPts[13] , cp1*r, sp1*r, -DZ, 1 );
|
||||
CP(mpCtrlPts[14] , cp1*r, sp1*r, DZ, 1 );
|
||||
|
||||
// weight of the CP
|
||||
const G4Float weight = (cos(deltaAngleo2));
|
||||
t_indCtrlPt i = 15;
|
||||
G4double srcAngle = PHI1;
|
||||
G4double deltaAngleo2;
|
||||
|
||||
// initialization.
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
G4double destAngle = M_PI_2 + PHI1;
|
||||
|
||||
// end CP
|
||||
const G4double cda = cos(destAngle);
|
||||
const G4double sda = sin(destAngle);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*R, sda*R, DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*R, sda*R, -DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, -DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, DZ, 1);
|
||||
for(; f > 0; f--)
|
||||
{
|
||||
// the first arc CP is already Done
|
||||
|
||||
deltaAngleo2 = (destAngle - srcAngle) / 2;
|
||||
const G4double csa = cos(srcAngle);
|
||||
const G4double ssa = sin(srcAngle);
|
||||
const G4double tdao2 = tan(deltaAngleo2);
|
||||
|
||||
/**/ if (i != (mtotnbrCtrlPts - 10) )
|
||||
{ G4cerr
|
||||
<< "\nERROR: G4NURBStubesector::G4NURBStubesector: wrong index,"
|
||||
<< i << " instead of " << (mtotnbrCtrlPts - 10)
|
||||
<< "\n\tIt sounds very strange. The tubesector won't be correct. Have a nice debuging!"
|
||||
<< G4endl;
|
||||
};
|
||||
// to calculate the intermediate CP :
|
||||
// rotate by srcAngle the (1, tdao2) point
|
||||
const t_Coord x = csa - ssa*tdao2;
|
||||
const t_Coord y = ssa + csa*tdao2;
|
||||
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
|
||||
// weight of the CP
|
||||
const G4Float weight = (cos(deltaAngleo2));
|
||||
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
// initialization. postfix ++ because i initialized to 15
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
|
||||
// possible to put a DZ DZ -DZ -DZ DZ column to scratch to a line instead of a point
|
||||
// end CP (which is the first CP of the next arc)
|
||||
const G4double cda = cos(destAngle);
|
||||
const G4double sda = sin(destAngle);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*R, sda*R, DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*R, sda*R, -DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, -DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, DZ, 1);
|
||||
|
||||
// creating the nurbs identity
|
||||
mpwhoami = new char [200];
|
||||
G4std::ostrstream tmpstr(mpwhoami, 200);
|
||||
tmpstr << "Tubs" << " \tPHI1=" << PHI1 << " ; PHI2=" << PHI2 << '\0';
|
||||
// could be more sophisticated, reallocating
|
||||
// mpwhoami to the exact length
|
||||
|
||||
}
|
||||
// prepare next arc
|
||||
srcAngle = destAngle;
|
||||
destAngle += M_PI_2;
|
||||
}
|
||||
|
||||
// f == 0, final Arc
|
||||
// could be handled in the loops
|
||||
|
||||
G4Visible & G4NURBStubesector::operator = (const G4Visible &right) {
|
||||
destAngle = PHI2;
|
||||
deltaAngleo2 = (destAngle - srcAngle) / 2;
|
||||
const G4double csa = cos(srcAngle);
|
||||
const G4double ssa = sin(srcAngle);
|
||||
const G4double tdao2 = tan(deltaAngleo2);
|
||||
|
||||
// to calculate the intermediate CP :
|
||||
// rotate by srcAngle the (1, tdao2) point
|
||||
const t_Coord x = csa - ssa*tdao2;
|
||||
const t_Coord y = ssa + csa*tdao2;
|
||||
|
||||
// weight of the CP
|
||||
const G4Float weight = (cos(deltaAngleo2));
|
||||
|
||||
// initialization.
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
|
||||
// end CP
|
||||
const G4double cda = cos(destAngle);
|
||||
const G4double sda = sin(destAngle);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*R, sda*R, DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*R, sda*R, -DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, -DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, DZ, 1);
|
||||
|
||||
if (i != (mtotnbrCtrlPts - 10) )
|
||||
{
|
||||
G4cerr << "\nERROR: G4NURBStubesector::G4NURBStubesector: wrong index,"
|
||||
<< i << " instead of " << (mtotnbrCtrlPts - 10)
|
||||
<< "\n\tThe tubesector won't be correct."
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
|
||||
// possible to put a DZ DZ -DZ -DZ DZ column to scratch
|
||||
// to a line instead of a point
|
||||
|
||||
// creating the nurbs identity
|
||||
mpwhoami = new char [200];
|
||||
G4std::ostrstream tmpstr(mpwhoami, 200);
|
||||
tmpstr << "Tubs" << " \tPHI1=" << PHI1 << " ; PHI2=" << PHI2 << '\0';
|
||||
// could be more sophisticated, reallocating
|
||||
// mpwhoami to the exact length
|
||||
}
|
||||
|
||||
G4Visible & G4NURBStubesector::operator = (const G4Visible &right)
|
||||
{
|
||||
return G4Visible::operator = (right);
|
||||
}
|
||||
|
||||
G4VVisPrim & G4NURBStubesector::operator = (const G4VVisPrim &right) {
|
||||
G4VVisPrim & G4NURBStubesector::operator = (const G4VVisPrim &right)
|
||||
{
|
||||
return G4VVisPrim::operator = (right);
|
||||
}
|
||||
|
||||
const char* G4NURBStubesector::Whoami() const
|
||||
{
|
||||
return mpwhoami;
|
||||
}
|
||||
const char* G4NURBStubesector::Whoami() const
|
||||
{
|
||||
return mpwhoami;
|
||||
}
|
||||
|
||||
G4NURBStubesector::~G4NURBStubesector()
|
||||
{
|
||||
if (mpwhoami) { delete [] mpwhoami; mpwhoami = NULL; };
|
||||
}
|
||||
G4NURBStubesector::~G4NURBStubesector()
|
||||
{
|
||||
if (mpwhoami) { delete [] mpwhoami; mpwhoami = 0; }
|
||||
}
|
||||
|
||||
G4NURBStubesector::t_inddCtrlPt
|
||||
G4NURBStubesector::DecideNbrCtrlPts(G4double PHI1, G4double PHI2)
|
||||
{
|
||||
// check angles
|
||||
G4double deltaPHI = PHI2-PHI1;
|
||||
while (deltaPHI <= 0) { PHI2 += 2*M_PI; deltaPHI += 2*M_PI; }
|
||||
G4double k = deltaPHI / (M_PI_2);
|
||||
|
||||
G4NURBStubesector::t_inddCtrlPt G4NURBStubesector::DecideNbrCtrlPts(G4double PHI1, G4double PHI2)
|
||||
{
|
||||
// check angles
|
||||
G4double deltaPHI = PHI2-PHI1;
|
||||
while (deltaPHI <= 0) { PHI2 += 2*M_PI; deltaPHI += 2*M_PI; };
|
||||
G4double k = deltaPHI / (M_PI_2);
|
||||
// G4cerr << " k " << k << G4endl;
|
||||
// G4cerr << " fk " << floor(k) << G4endl;
|
||||
// G4cerr << " ifk " << ((int)(floor(k))) << G4endl;
|
||||
// G4cerr << " n " << (2*((int)(floor(k))) + 7) << G4endl;
|
||||
|
||||
// G4cerr << " k " << k << G4endl;
|
||||
// G4cerr << " fk " << floor(k) << G4endl;
|
||||
// G4cerr << " ifk " << ((int)(floor(k))) << G4endl;
|
||||
// G4cerr << " n " << (2*((int)(floor(k))) + 7) << G4endl;
|
||||
|
||||
return ( 2*((int)(floor(k))) + 7 );
|
||||
}
|
||||
return ( 2*((int)(floor(k))) + 7 );
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PlacedPolyhedron.cc,v 1.3 2001/07/11 10:01:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
|
||||
#include "G4PlacedPolyhedron.hh"
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Point3DList.cc,v 1.5 2001/07/11 10:01:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison July 1995
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Polyhedron.cc,v 1.11 2001/07/11 10:01:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4Polyhedron.cc,v 1.12 2003/04/03 15:31:07 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
|
||||
#include "G4Polyhedron.hh"
|
||||
|
||||
@@ -30,7 +30,9 @@ G4Polyhedron::G4Polyhedron () {}
|
||||
|
||||
G4Polyhedron::~G4Polyhedron () {}
|
||||
|
||||
G4Polyhedron::G4Polyhedron (const G4Polyhedron& from) {
|
||||
G4Polyhedron::G4Polyhedron (const G4Polyhedron& from)
|
||||
: HepPolyhedron(from), G4VVisPrim(from)
|
||||
{
|
||||
*this = from;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Polyline.cc,v 1.7 2001/08/14 18:24:58 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison July 1995
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Polymarker.cc,v 1.7 2001/07/11 10:01:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison November 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Scale.cc,v 1.6 2002/11/27 12:24:01 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 21st July 2001
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Square.cc,v 1.3 2001/07/11 10:01:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Text.cc,v 1.6 2001/07/11 10:01:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 17/11/96.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VMarker.cc,v 1.7 2001/07/11 10:01:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VVisPrim.cc,v 1.7 2001/07/11 10:01:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison August 1995
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisAttributes.cc,v 1.8 2002/11/20 14:18:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 23rd October 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisExtent.cc,v 1.6 2001/07/24 21:39:50 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// A.Walkden 28/11/95
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Visible.cc,v 1.4 2001/07/11 10:01:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 30th October 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: HepPolyhedron.cc,v 1.12 2002/11/20 14:18:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user