From ee561904ed13203515b52d73dce24ac202db7a93 Mon Sep 17 00:00:00 2001 From: Frank Gaede <frank.gaede@desy.de> Date: Wed, 15 Jul 2015 14:57:14 +0000 Subject: [PATCH] added methods length_along_u/v() to ISurface --- DDRec/include/DDRec/Surface.h | 14 ++++++++++++-- DDRec/src/Surface.cpp | 3 ++- DDSurfaces/include/DDSurfaces/ISurface.h | 10 ++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/DDRec/include/DDRec/Surface.h b/DDRec/include/DDRec/Surface.h index dde289f82..166060873 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 0259ffd4a..e73253aea 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 824d37fbf..5c37a7cc2 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 ; + } ; //============================================================================================== -- GitLab