diff --git a/DDRec/include/DDRec/Surface.h b/DDRec/include/DDRec/Surface.h index dde289f82dc70db8a6ebc0f9473f6e93a33ac5a5..166060873e0038e7a4077aac85e4181752302b06 100644 --- a/DDRec/include/DDRec/Surface.h +++ b/DDRec/include/DDRec/Surface.h @@ -195,12 +195,12 @@ namespace DD4hep { /** The length of the surface along direction u at the origin. For 'regular' boundaries, like rectangles, * this can be used to speed up the computation of inSideBounds. */ - double length_along_u() const ; + virtual double length_along_u() const ; /** The length of the surface along direction v at the origin. For 'regular' boundaries, like rectangles, * this can be used to speed up the computation of inSideBounds. */ - double length_along_v() const ; + virtual double length_along_v() const ; @@ -455,6 +455,16 @@ namespace DD4hep { /** Get Origin of local coordinate system of the associated volume */ virtual Vector3D volumeOrigin() const ; + /** The length of the surface along direction u at the origin. For 'regular' boundaries, like rectangles, + * this can be used to speed up the computation of inSideBounds. + */ + virtual double length_along_u() const ; + + /** The length of the surface along direction v at the origin. For 'regular' boundaries, like rectangles, + * this can be used to speed up the computation of inSideBounds. + */ + virtual double length_along_v() const ; + //--------------------------------------------------- /** Get vertices constraining the surface for drawing ( might not be exact boundaries) - * at most nMax points are returned. diff --git a/DDRec/src/Surface.cpp b/DDRec/src/Surface.cpp index 0259ffd4a33fe29a245d5018378fb6ff3a3da4f4..e73253aeaf24483d4b8d4a3235f14677968181a6 100644 --- a/DDRec/src/Surface.cpp +++ b/DDRec/src/Surface.cpp @@ -411,7 +411,8 @@ namespace DD4hep { const Vector3D& Surface::origin() const { return _o ;} double Surface::innerThickness() const { return _volSurf.innerThickness() ; } double Surface::outerThickness() const { return _volSurf.outerThickness() ; } - + double Surface::length_along_u() const { return _volSurf.length_along_u() ; } + double Surface::length_along_v() const { return _volSurf.length_along_v() ; } /** Thickness of outer material */ diff --git a/DDSurfaces/include/DDSurfaces/ISurface.h b/DDSurfaces/include/DDSurfaces/ISurface.h index 824d37fbfe5725f414ca83244d8e6a8404e29fdf..5c37a7cc21e0e90427d3c149bb5e9b38b9d14dd4 100644 --- a/DDSurfaces/include/DDSurfaces/ISurface.h +++ b/DDSurfaces/include/DDSurfaces/ISurface.h @@ -72,6 +72,16 @@ namespace DDSurfaces { /** Distance to surface */ virtual double distance(const Vector3D& point ) const =0 ; + /** The length of the surface along direction u at the origin. For 'regular' boundaries, like rectangles, + * this can be used to speed up the computation of inSideBounds. + */ + virtual double length_along_u() const=0 ; + + /** The length of the surface along direction v at the origin. For 'regular' boundaries, like rectangles, + * this can be used to speed up the computation of inSideBounds. + */ + virtual double length_along_v() const=0 ; + } ; //==============================================================================================