LibreOffice Module drawinglayer (master) 1
|
HitTestProcessor2D class. More...
#include <hittestprocessor2d.hxx>
Public Member Functions | |
HitTestProcessor2D (const geometry::ViewInformation2D &rViewInformation, const basegfx::B2DPoint &rLogicHitPosition, const basegfx::B2DVector &rLogicHitTolerancePerAxis, bool bHitTextOnly) | |
virtual | ~HitTestProcessor2D () override |
void | collectHitStack (bool bCollect) |
switch on collecting primitives for a found hit on maHitStack, default is off More... | |
const primitive2d::Primitive2DContainer & | getHitStack () const |
get HitStack of primitives, first is the one that created the hit, last is the top-most More... | |
const basegfx::B2DPoint & | getDiscreteHitPosition () const |
data read access More... | |
const basegfx::B2DVector & | getDiscreteHitTolerance () const |
bool | getCollectHitStack () const |
bool | getHit () const |
bool | getHitTextOnly () const |
Public Member Functions inherited from drawinglayer::processor2d::BaseProcessor2D | |
BaseProcessor2D (geometry::ViewInformation2D aViewInformation) | |
constructor/destructor More... | |
virtual | ~BaseProcessor2D () |
void | process (const primitive2d::Primitive2DContainer &rSource) |
the central processing method More... | |
const geometry::ViewInformation2D & | getViewInformation2D () const |
data read access More... | |
Public Member Functions inherited from drawinglayer::primitive2d::Primitive2DDecompositionVisitor | |
virtual void | visit (const Primitive2DReference &)=0 |
virtual void | visit (const Primitive2DContainer &)=0 |
virtual void | visit (Primitive2DContainer &&)=0 |
virtual | ~Primitive2DDecompositionVisitor () |
Private Member Functions | |
void | processBasePrimitive2D (const primitive2d::BasePrimitive2D &rCandidate) override |
tooling methods More... | |
bool | checkHairlineHitWithTolerance (const basegfx::B2DPolygon &rPolygon, const basegfx::B2DVector &rDiscreteHitTolerancePerAxis) const |
bool | checkFillHitWithTolerance (const basegfx::B2DPolyPolygon &rPolyPolygon, const basegfx::B2DVector &rDiscreteHitTolerancePerAxis) const |
void | check3DHit (const primitive2d::ScenePrimitive2D &rCandidate) |
Private Attributes | |
basegfx::B2DPoint | maDiscreteHitPosition |
discrete HitTest position More... | |
basegfx::B2DVector | maDiscreteHitTolerancePerAxis |
discrete HitTolerance More... | |
primitive2d::Primitive2DContainer | maHitStack |
stack of HitPrimitives, taken care of during HitTest run More... | |
bool | mbCollectHitStack: 1 |
flag if HitStack shall be collected as part of the result, default is false More... | |
bool | mbHit: 1 |
Boolean to flag if a hit was found. If yes, fast exit is taken. More... | |
bool | mbHitTextOnly: 1 |
flag to concentrate on text hits only More... | |
Additional Inherited Members | |
Protected Member Functions inherited from drawinglayer::processor2d::BaseProcessor2D | |
void | updateViewInformation (const geometry::ViewInformation2D &rViewInformation2D) |
virtual void | processBasePrimitive2D (const primitive2d::BasePrimitive2D &rCandidate) |
void | process (const primitive2d::BasePrimitive2D &rCandidate) |
virtual void | visit (const primitive2d::Primitive2DReference &) override final |
virtual void | visit (const primitive2d::Primitive2DContainer &) override final |
virtual void | visit (primitive2d::Primitive2DContainer &&) override final |
HitTestProcessor2D class.
This processor implements a HitTest with the fed primitives, given tolerance and extras
Definition at line 38 of file hittestprocessor2d.hxx.
drawinglayer::processor2d::HitTestProcessor2D::HitTestProcessor2D | ( | const geometry::ViewInformation2D & | rViewInformation, |
const basegfx::B2DPoint & | rLogicHitPosition, | ||
const basegfx::B2DVector & | rLogicHitTolerancePerAxis, | ||
bool | bHitTextOnly | ||
) |
Definition at line 42 of file hittestprocessor2d.cxx.
References basegfx::Tuple2D< typename TYPE >::equalZero(), drawinglayer::geometry::ViewInformation2D::getObjectToViewTransformation(), drawinglayer::processor2d::BaseProcessor2D::getViewInformation2D(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), maDiscreteHitPosition, maDiscreteHitTolerancePerAxis, basegfx::Tuple2D< typename TYPE >::setX(), and basegfx::Tuple2D< typename TYPE >::setY().
|
overridevirtual |
Definition at line 69 of file hittestprocessor2d.cxx.
|
private |
Definition at line 146 of file hittestprocessor2d.cxx.
References checkHairlineHitWithTolerance(), basegfx::utils::createUnitPolygon(), basegfx::B3DTuple::equal(), drawinglayer::primitive3d::Primitive3DContainer::getB3DRange(), drawinglayer::primitive2d::ScenePrimitive2D::getChildren3D(), drawinglayer::processor3d::CutFindProcessor::getCutPoints(), getDiscreteHitPosition(), getDiscreteHitTolerance(), getHit(), drawinglayer::geometry::ViewInformation3D::getObjectToView(), drawinglayer::primitive2d::ScenePrimitive2D::getObjectTransformation(), drawinglayer::processor2d::BaseProcessor2D::getViewInformation2D(), drawinglayer::primitive2d::ScenePrimitive2D::getViewInformation3D(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), basegfx::B2DHomMatrix::invert(), basegfx::B3DHomMatrix::invert(), basegfx::B3DRange::isEmpty(), mbHit, basegfx::B3DRange::overlaps(), drawinglayer::processor3d::BaseProcessor3D::process(), basegfx::B2DPolygon::transform(), and drawinglayer::primitive2d::ScenePrimitive2D::tryToCheckLastVisualisationDirectHit().
Referenced by processBasePrimitive2D().
|
private |
Definition at line 101 of file hittestprocessor2d.cxx.
References basegfx::B2DPolyPolygon::getB2DRange(), getDiscreteHitPosition(), drawinglayer::processor2d::BaseProcessor2D::getViewInformation2D(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), basegfx::Range2D< typename TYPE, typename TRAITS >::grow(), basegfx::utils::isInEpsilonRange(), basegfx::utils::isInside(), basegfx::Range2D< typename TYPE, typename TRAITS >::isInside(), and basegfx::B2DPolyPolygon::transform().
Referenced by processBasePrimitive2D().
|
private |
Definition at line 73 of file hittestprocessor2d.cxx.
References basegfx::B2DPolygon::getB2DRange(), getDiscreteHitPosition(), drawinglayer::processor2d::BaseProcessor2D::getViewInformation2D(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), basegfx::Range2D< typename TYPE, typename TRAITS >::grow(), basegfx::utils::isInEpsilonRange(), basegfx::Range2D< typename TYPE, typename TRAITS >::isInside(), and basegfx::B2DPolygon::transform().
Referenced by check3DHit(), and processBasePrimitive2D().
|
inline |
switch on collecting primitives for a found hit on maHitStack, default is off
Definition at line 78 of file hittestprocessor2d.hxx.
|
inline |
Definition at line 87 of file hittestprocessor2d.hxx.
Referenced by processBasePrimitive2D().
|
inline |
data read access
Definition at line 85 of file hittestprocessor2d.hxx.
Referenced by check3DHit(), checkFillHitWithTolerance(), checkHairlineHitWithTolerance(), and processBasePrimitive2D().
|
inline |
Definition at line 86 of file hittestprocessor2d.hxx.
Referenced by check3DHit(), and processBasePrimitive2D().
|
inline |
Definition at line 88 of file hittestprocessor2d.hxx.
Referenced by check3DHit(), and processBasePrimitive2D().
|
inline |
get HitStack of primitives, first is the one that created the hit, last is the top-most
Definition at line 82 of file hittestprocessor2d.hxx.
|
inline |
Definition at line 89 of file hittestprocessor2d.hxx.
Referenced by processBasePrimitive2D().
|
overrideprivatevirtual |
tooling methods
push candidate to HitStack to create it. This only happens when a hit is found and creating the HitStack was requested (see collectHitStack)
Reimplemented from drawinglayer::processor2d::BaseProcessor2D.
Definition at line 219 of file hittestprocessor2d.cxx.
References a, aDistance, drawinglayer::primitive2d::Primitive2DContainer::append(), check3DHit(), checkFillHitWithTolerance(), checkHairlineHitWithTolerance(), basegfx::utils::createPolygonFromRect(), basegfx::fround(), BitmapEx::GetAlpha(), drawinglayer::primitive2d::PolygonHairlinePrimitive2D::getB2DPolygon(), drawinglayer::primitive2d::PolygonMarkerPrimitive2D::getB2DPolygon(), drawinglayer::primitive2d::PolygonStrokePrimitive2D::getB2DPolygon(), drawinglayer::primitive2d::PolyPolygonColorPrimitive2D::getB2DPolyPolygon(), drawinglayer::primitive2d::BasePrimitive2D::getB2DRange(), drawinglayer::primitive2d::BitmapPrimitive2D::getBitmap(), drawinglayer::primitive2d::GroupPrimitive2D::getChildren(), getCollectHitStack(), getDiscreteHitPosition(), getDiscreteHitTolerance(), getHit(), getHitTextOnly(), drawinglayer::primitive2d::PolygonStrokePrimitive2D::getLineAttribute(), drawinglayer::attribute::LineAttribute::getLineJoin(), drawinglayer::primitive2d::MaskPrimitive2D::getMask(), drawinglayer::primitive2d::PointArrayPrimitive2D::getPositions(), drawinglayer::primitive2d::BasePrimitive2D::getPrimitive2DID(), BitmapEx::GetSizePixel(), drawinglayer::primitive2d::BitmapPrimitive2D::getTransform(), drawinglayer::primitive2d::TransformPrimitive2D::getTransformation(), drawinglayer::processor2d::BaseProcessor2D::getViewInformation2D(), drawinglayer::primitive2d::PolygonWavePrimitive2D::getWaveHeight(), drawinglayer::attribute::LineAttribute::getWidth(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), Size::Height(), basegfx::B2DHomMatrix::invert(), comphelper::LibreOfficeKit::isActive(), basegfx::Range2D< typename TYPE, typename TRAITS >::isEmpty(), basegfx::Range2D< typename TYPE, typename TRAITS >::isInside(), maHitStack, mbHit, basegfx::Miter, basegfx::fTools::more(), nCount, PRIMITIVE2D_ID_BITMAPPRIMITIVE2D, PRIMITIVE2D_ID_CONTROLPRIMITIVE2D, PRIMITIVE2D_ID_FILLGRADIENTPRIMITIVE2D, PRIMITIVE2D_ID_FILLGRAPHICPRIMITIVE2D, PRIMITIVE2D_ID_FILLHATCHPRIMITIVE2D, PRIMITIVE2D_ID_GRIDPRIMITIVE2D, PRIMITIVE2D_ID_HELPLINEPRIMITIVE2D, PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D, PRIMITIVE2D_ID_MARKERARRAYPRIMITIVE2D, PRIMITIVE2D_ID_MASKPRIMITIVE2D, PRIMITIVE2D_ID_MEDIAPRIMITIVE2D, PRIMITIVE2D_ID_METAFILEPRIMITIVE2D, PRIMITIVE2D_ID_PAGEPREVIEWPRIMITIVE2D, PRIMITIVE2D_ID_POINTARRAYPRIMITIVE2D, PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D, PRIMITIVE2D_ID_POLYGONMARKERPRIMITIVE2D, PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D, PRIMITIVE2D_ID_POLYGONWAVEPRIMITIVE2D, PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D, PRIMITIVE2D_ID_SCENEPRIMITIVE2D, PRIMITIVE2D_ID_SHADOWPRIMITIVE2D, PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D, PRIMITIVE2D_ID_TEXTSIMPLEPORTIONPRIMITIVE2D, PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D, PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D, PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D, drawinglayer::processor2d::BaseProcessor2D::process(), drawinglayer::geometry::ViewInformation2D::setObjectTransformation(), drawinglayer::processor2d::BaseProcessor2D::updateViewInformation(), and Size::Width().
|
private |
discrete HitTest position
Definition at line 42 of file hittestprocessor2d.hxx.
Referenced by HitTestProcessor2D().
|
private |
discrete HitTolerance
Definition at line 45 of file hittestprocessor2d.hxx.
Referenced by HitTestProcessor2D().
|
private |
stack of HitPrimitives, taken care of during HitTest run
Definition at line 48 of file hittestprocessor2d.hxx.
Referenced by processBasePrimitive2D().
|
private |
flag if HitStack shall be collected as part of the result, default is false
Definition at line 51 of file hittestprocessor2d.hxx.
|
private |
Boolean to flag if a hit was found. If yes, fast exit is taken.
Definition at line 54 of file hittestprocessor2d.hxx.
Referenced by check3DHit(), and processBasePrimitive2D().
|
private |
flag to concentrate on text hits only
Definition at line 57 of file hittestprocessor2d.hxx.