G4ProjectedSurface Class Reference

#include <G4ProjectedSurface.hh>

Inheritance diagram for G4ProjectedSurface:

G4Surface G4STEPEntity

Public Member Functions

 G4ProjectedSurface ()
virtual ~G4ProjectedSurface ()
void CalcBBox ()
G4Vector3D SurfaceNormal (const G4Point3D &Pt) const

Protected Attributes

G4ControlPointsctl_points

Static Protected Attributes

static G4int Splits = 0

Friends

class G4BSplineSurface
void CopySurface (G4ProjectedSurface &proj)

Detailed Description

Definition at line 44 of file G4ProjectedSurface.hh.


Constructor & Destructor Documentation

G4ProjectedSurface::G4ProjectedSurface (  ) 

Definition at line 40 of file G4ProjectedSurface.cc.

References G4Surface::distance.

00041   : G4Surface(), ctl_points(0), dir(0), u_knots(0), v_knots(0),
00042     projected_list(0), bezier_list(0), new_knots(0), ord(0),
00043     lower(0), upper(0), oslo_m(0)
00044 {
00045   distance = 0;
00046   order[0] = order[1] = 0;
00047 }

G4ProjectedSurface::~G4ProjectedSurface (  )  [virtual]

Definition at line 50 of file G4ProjectedSurface.cc.

References G4Surface::bbox, ctl_points, and G4OsloMatrix::GetNextNode().

00051 {
00052   delete u_knots;
00053   delete v_knots;
00054   delete ctl_points;
00055   
00056   G4OsloMatrix* temp_oslo;
00057   if(oslo_m!=(G4OsloMatrix*)0)
00058   {
00059     while(oslo_m->GetNextNode() != oslo_m)
00060     {
00061       temp_oslo = oslo_m;
00062       oslo_m    = oslo_m->GetNextNode();
00063       
00064       delete temp_oslo;
00065     }
00066     
00067     delete oslo_m;
00068   }
00069   
00070   delete bbox;
00071 }


Member Function Documentation

void G4ProjectedSurface::CalcBBox (  )  [virtual]

Reimplemented from G4Surface.

Definition at line 100 of file G4ProjectedSurface.cc.

References G4Surface::bbox, ctl_points, G4ControlPoints::Get3D(), G4ControlPoints::GetCols(), and G4ControlPoints::GetRows().

00101 {
00102   // Finds the bounds of the 2D-projected nurb iow
00103   // calculates the bounds for a bounding rectangle
00104   // to the surface. The bounding rectangle is used
00105   // for a preliminary check of intersection.
00106   
00107   // Loop to search the whole control point mesh
00108   // for the minimum and maximum values for x and y.
00109   G4double box_minx,box_miny,box_maxx,box_maxy;
00110   box_minx = kInfinity;
00111   box_miny = kInfinity;
00112   box_maxx  = -kInfinity;
00113   box_maxy  = -kInfinity;
00114     
00115   G4double bminx,bminy,bmaxx,bmaxy,tmpx,tmpy;
00116   bminx = box_minx; bminy = box_miny;
00117   bmaxx = box_maxx; bmaxy = box_maxy;       
00118 
00119   for(register G4int a = ctl_points->GetRows()-1; a>=0;a--)
00120     for(register G4int b = ctl_points->GetCols()-1; b>=0;b--)
00121     {       
00122 /* L. Broglia
00123       G4Point2d& tmp = (G4Point2d&)ctl_points->get(a,b);
00124 */
00125       G4Point3D tmp = ctl_points->Get3D(a,b);
00126 
00127       tmpx = tmp.x(); tmpy = tmp.y();
00128       if(bminx > tmpx) box_minx=tmpx;
00129       if(bmaxx < tmpx) box_maxx=tmpx;   
00130       if(bminy > tmpy) box_miny=tmpy;   
00131       if(bmaxy < tmpy) box_maxy=tmpy;
00132     }
00133     
00134   G4Point3D box_min(box_minx,box_miny,0.);
00135   G4Point3D box_max(box_maxx,box_maxy,0.);
00136 
00137   delete bbox;
00138   bbox = new G4BoundingBox3D(box_min, box_max);
00139 }

G4Vector3D G4ProjectedSurface::SurfaceNormal ( const G4Point3D Pt  )  const [inline, virtual]

Implements G4Surface.

Definition at line 38 of file G4ProjectedSurface.icc.

00039 {
00040   return G4Vector3D(0,0,0);
00041 }


Friends And Related Function Documentation

void CopySurface ( G4ProjectedSurface proj  )  [friend]

friend class G4BSplineSurface [friend]

Definition at line 46 of file G4ProjectedSurface.hh.


Field Documentation

G4ControlPoints* G4ProjectedSurface::ctl_points [protected]

Definition at line 110 of file G4ProjectedSurface.hh.

Referenced by CalcBBox(), and ~G4ProjectedSurface().

G4int G4ProjectedSurface::Splits = 0 [static, protected]

Definition at line 109 of file G4ProjectedSurface.hh.


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:00 2013 for Geant4 by  doxygen 1.4.7