42 : ord(0), k_index(0), param(0.), Rational(0)
47 order[0] = 0; order[1] = 0;
54 : dir(0), ord(0), k_index(0), param(0.), Rational(0)
58 order[0] = 0; order[1] = 0;
66 : dir(0), ord(0), k_index(0), param(0.), Rational(0)
70 order[0] = u+1; order[1] = v+1;
101 FindIntersections(rayref);
143G4Point3D G4BSplineSurface::FinalIntersection()
147 while ( bezier_list.
GetSize() > 0 &&
169 AddHit(bez_ptr->
GetU(), bez_ptr->
GetV());
248 result = BSEvaluate();
274 for(
register int a = ctl_points->
GetRows()-1; a>=0;a--)
275 for(
register int b = ctl_points->
GetCols()-1; b>=0;b--)
278 if((box_min.
x()) > (tmp.
x())) box_min.
setX(tmp.
x());
279 if((box_min.
y()) > (tmp.
y())) box_min.
setY(tmp.
y());
280 if((box_min.
z()) > (tmp.
z())) box_min.
setZ(tmp.
z());
281 if((box_max.
x()) < (tmp.
x())) box_max.
setX(tmp.
x());
282 if((box_max.
y()) < (tmp.
y())) box_max.
setY(tmp.
y());
283 if((box_max.
z()) < (tmp.
z())) box_max.
setZ(tmp.
z());
293 proj_srf->PutOrder(0,GetOrder(0));
294 proj_srf->PutOrder(1,GetOrder(1));
304 ProjectNURBSurfaceTo2D(plane1, plane2, proj_srf);
310void G4BSplineSurface::FindIntersections(
const G4Ray& rayref)
319 while(projected_list.
GetSize() > 0)
332 proj_srf->ConvertToBezier(projected_list, bezier_list);
357 bez_ptr->CalcDistance(rayref.
GetStart());
363 if (first_hit == Hit) first_hit = (
G4UVHit*)0;
385 G4double TestDistance = TestPoint.distance2(AveragePoint);
410void G4BSplineSurface::ProjectNURBSurfaceTo2D
423 register int rows = ctl_points->
GetRows();
424 register int cols = ctl_points->
GetCols();
426 for (
register int i=0; i< rows; i++)
427 for(
register int j=0; j < cols;j++)
438 psrfcoords.
setX(( srfcoords.
x() * plane1.
a
439 +srfcoords.
y() * plane1.
b
440 +srfcoords.
z() * plane1.
c
441 -srfcoords.
w() * plane1.
d));
442 psrfcoords.
setY(( srfcoords.
x() * plane2.
a
443 +srfcoords.
y() * plane2.
b
444 +srfcoords.
z() * plane2.
c
445 -srfcoords.
w() * plane2.
d));
453 psrfcoords.
setX(( srfcoords.
x() * plane1.
a
454 +srfcoords.
y() * plane1.
b
455 +srfcoords.
z() * plane1.
c
458 psrfcoords.
setY(( srfcoords.
x() * plane2.
a
459 +srfcoords.
y() * plane2.
b
460 +srfcoords.
z() * plane2.
c
475 return crv->
GetRat(i, k_index);
477 register int j = k_index;
479 while ( j > (k_index - ord + 1))
483 k1 = tmp_knots->
GetKnot((j + ord - 1));
510 return InternalEvalCrv(0, crv);
517 register int row_size = ctl_points->
GetRows();
528 register int point_type = tmp->
GetType();
546 for ( i = 0; i < row_size; i++)
549 G4PointRat rtr_pt = InternalEvalCrv(i, curves);
550 diff_curve->
put(0,i,rtr_pt);
568 G4PointRat rat_result(InternalEvalCrv(0, diff_curve));
573 result.
setX(rat_result.x()/rat_result.w());
574 result.
setY(rat_result.y()/rat_result.w());
575 result.
setZ(rat_result.z()/rat_result.w());
580 for ( i = 0; i < row_size; i++)
584 G4Point3D rtr_pt = (InternalEvalCrv(i, curves)).pt();
585 diff_curve->
put(0,i,rtr_pt);
602 result = (InternalEvalCrv(0, diff_curve)).pt();
645 return PointDistance;
HepGeom::Point3D< G4double > G4Point3D
const G4Point3D PINFINITY(kInfinity, kInfinity, kInfinity)
G4double ClosestDistanceToPoint(const G4Point3D &)
virtual ~G4BSplineSurface()
G4int Intersect(const G4Ray &)
void SetAveragePoint(G4Point3D p)
G4double UAverage() const
G4Point3D AveragePoint() const
G4double VAverage() const
G4int BIntersect(G4SurfaceList &)
G4int GetTestResult() const
G4Point3D Get3D(G4int i, G4int j) const
G4double ClosestDistanceToPoint(const G4Point3D &)
G4PointRat & GetRat(G4int i, G4int j) const
void put(G4int i, G4int j, const G4Point3D &tmp)
G4double GetKnot(G4int knot_number) const
G4int GetKnotIndex(G4double k_value, G4int order) const
G4int GetType(void) const
G4ControlPoints * ctl_points
const G4Plane & GetPlane(G4int number_of_plane) const
const G4Vector3D & GetDir() const
const G4Point3D & GetStart() const
void MoveToFirst(G4Surface *srf)
void AddSurface(G4Surface *srf)
const G4Surface * GetLastSurface() const
const G4Surface * GetNext() const
void RemoveSurface(G4Surface *srf)
void SetActive(G4int act)
G4double GetDistance() const