LibreOffice Module drawinglayer (master) 1
|
CropPrimitive2D class. More...
#include <cropprimitive2d.hxx>
Public Member Functions | |
CropPrimitive2D (Primitive2DContainer &&aChildren, basegfx::B2DHomMatrix aTransformation, double fCropLeft, double fCropTop, double fCropRight, double fCropBottom) | |
constructor More... | |
const basegfx::B2DHomMatrix & | getTransformation () const |
data read access More... | |
double | getCropLeft () const |
double | getCropTop () const |
double | getCropRight () const |
double | getCropBottom () const |
virtual bool | operator== (const BasePrimitive2D &rPrimitive) const override |
compare operator More... | |
virtual void | get2DDecomposition (Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override |
local decomposition More... | |
virtual sal_uInt32 | getPrimitive2DID () const override |
provide unique ID More... | |
Public Member Functions inherited from drawinglayer::primitive2d::GroupPrimitive2D | |
GroupPrimitive2D (Primitive2DContainer &&aChildren) | |
constructor More... | |
const Primitive2DContainer & | getChildren () const |
data read access More... | |
void | getChildren (Primitive2DDecompositionVisitor &rVisitor) const |
virtual bool | operator== (const BasePrimitive2D &rPrimitive) const override |
compare operator More... | |
virtual void | get2DDecomposition (Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override |
local decomposition. Implementation will just return children More... | |
virtual sal_uInt32 | getPrimitive2DID () const override |
provide unique ID More... | |
virtual sal_Int64 | estimateUsage () override |
Public Member Functions inherited from drawinglayer::primitive2d::BasePrimitive2D | |
BasePrimitive2D () | |
virtual | ~BasePrimitive2D () override |
virtual bool | operator== (const BasePrimitive2D &rPrimitive) const |
the ==operator is mainly needed to allow testing newly-created primitives against their last incarnation which buffers/holds the made decompositions. More... | |
bool | operator!= (const BasePrimitive2D &rPrimitive) const |
virtual basegfx::B2DRange | getB2DRange (const geometry::ViewInformation2D &rViewInformation) const |
The default implementation will use getDecomposition results to create the range. More... | |
virtual sal_uInt32 | getPrimitive2DID () const =0 |
provide unique ID for fast identifying of known primitive implementations in renderers. More... | |
virtual void | get2DDecomposition (Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const |
The default implementation will return an empty sequence. More... | |
Primitive2DContainer | getDecomposition (const css::uno::Sequence< css::beans::PropertyValue > &rViewParameters) |
The getDecomposition implementation for UNO API will use getDecomposition from this implementation. More... | |
css::geometry::RealRectangle2D | getRange (const css::uno::Sequence< css::beans::PropertyValue > &rViewParameters) |
The getRange implementation for UNO API will use getRange from this implementation. More... | |
virtual sal_Int64 | estimateUsage () |
Public Member Functions inherited from salhelper::SimpleReferenceObject | |
SimpleReferenceObject () | |
void | acquire () |
void | release () |
Private Attributes | |
basegfx::B2DHomMatrix | maTransformation |
double | mfCropLeft |
double | mfCropTop |
double | mfCropRight |
double | mfCropBottom |
Additional Inherited Members | |
Static Public Member Functions inherited from salhelper::SimpleReferenceObject | |
static void * | operator new (std::size_t nSize) |
static void * | operator new (std::size_t nSize, std::nothrow_t const &rNothrow) |
static void | operator delete (void *pPtr) |
static void | operator delete (void *pPtr, std::nothrow_t const &rNothrow) |
Protected Member Functions inherited from salhelper::SimpleReferenceObject | |
virtual | ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE |
Protected Attributes inherited from salhelper::SimpleReferenceObject | |
oslInterlockedCount | m_nCount |
CropPrimitive2D class.
Caution: Due to old constraints (old core definitions) the crop distances describe how the uncropped content is defined relative to the current object size. This means that maTransformation describes the current object size (the part of the object visible with the crop applied). To get the original size and orientation of the uncropped content it is necessary to calc back from the current situation (maTransformation) using the crop values to get to the uncropped original content.
Thus a transformation has to be calculated which will be applied to the already existing content to get it to the uncropped state and then this is masked with the current state (mask polygon created from unit polygon and maTransformation).
At least in this primitive the units of the crop values are already in the local coordinate system; in the core these distances are defined relative to the object content size (PrefMapMode and PrefSize of the content)...
Of course this is a primitive, so feel free to just ignore all that stuff and use the automatically generated decomposition. Sigh.
Definition at line 52 of file cropprimitive2d.hxx.
drawinglayer::primitive2d::CropPrimitive2D::CropPrimitive2D | ( | Primitive2DContainer && | aChildren, |
basegfx::B2DHomMatrix | aTransformation, | ||
double | fCropLeft, | ||
double | fCropTop, | ||
double | fCropRight, | ||
double | fCropBottom | ||
) |
|
overridevirtual |
local decomposition
Reimplemented from drawinglayer::primitive2d::GroupPrimitive2D.
Definition at line 67 of file cropprimitive2d.cxx.
References basegfx::absolute(), basegfx::utils::createScaleTranslateB2DHomMatrix(), basegfx::utils::createUnitPolygon(), basegfx::Tuple2D< typename TYPE >::equalZero(), basegfx::fTools::equalZero(), drawinglayer::primitive2d::GroupPrimitive2D::getChildren(), getCropBottom(), getCropLeft(), getCropRight(), getCropTop(), basegfx::B2DRange::getMinimum(), basegfx::B2DRange::getRange(), getTransformation(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), basegfx::B2DHomMatrix::invert(), basegfx::Range2D< typename TYPE, typename TRAITS >::isInside(), basegfx::Range2D< typename TYPE, typename TRAITS >::overlaps(), basegfx::B2DPolyPolygon::transform(), and drawinglayer::primitive2d::Primitive2DDecompositionVisitor::visit().
|
inline |
Definition at line 79 of file cropprimitive2d.hxx.
References mfCropBottom.
Referenced by get2DDecomposition(), and operator==().
|
inline |
Definition at line 76 of file cropprimitive2d.hxx.
References mfCropLeft.
Referenced by get2DDecomposition(), and operator==().
|
inline |
Definition at line 78 of file cropprimitive2d.hxx.
References mfCropRight.
Referenced by get2DDecomposition(), and operator==().
|
inline |
Definition at line 77 of file cropprimitive2d.hxx.
References mfCropTop.
Referenced by get2DDecomposition(), and operator==().
|
overridevirtual |
provide unique ID
Reimplemented from drawinglayer::primitive2d::GroupPrimitive2D.
Definition at line 149 of file cropprimitive2d.cxx.
References PRIMITIVE2D_ID_CROPPRIMITIVE2D.
|
inline |
data read access
Definition at line 75 of file cropprimitive2d.hxx.
References maTransformation.
Referenced by get2DDecomposition(), and operator==().
|
overridevirtual |
compare operator
Reimplemented from drawinglayer::primitive2d::GroupPrimitive2D.
Definition at line 51 of file cropprimitive2d.cxx.
References getCropBottom(), getCropLeft(), getCropRight(), getCropTop(), and getTransformation().
|
private |
Definition at line 56 of file cropprimitive2d.hxx.
Referenced by getTransformation().
|
private |
Definition at line 62 of file cropprimitive2d.hxx.
Referenced by getCropBottom().
|
private |
Definition at line 59 of file cropprimitive2d.hxx.
Referenced by getCropLeft().
|
private |
Definition at line 61 of file cropprimitive2d.hxx.
Referenced by getCropRight().
|
private |
Definition at line 60 of file cropprimitive2d.hxx.
Referenced by getCropTop().