LibreOffice Module drawinglayer (master) 1
Public Member Functions | Private Attributes | List of all members
drawinglayer::primitive2d::CropPrimitive2D Class Referencefinal

CropPrimitive2D class. More...

#include <cropprimitive2d.hxx>

Inheritance diagram for drawinglayer::primitive2d::CropPrimitive2D:
[legend]
Collaboration diagram for drawinglayer::primitive2d::CropPrimitive2D:
[legend]

Public Member Functions

 CropPrimitive2D (Primitive2DContainer &&aChildren, basegfx::B2DHomMatrix aTransformation, double fCropLeft, double fCropTop, double fCropRight, double fCropBottom)
 constructor More...
 
const basegfx::B2DHomMatrixgetTransformation () 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 Primitive2DContainergetChildren () 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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CropPrimitive2D()

drawinglayer::primitive2d::CropPrimitive2D::CropPrimitive2D ( Primitive2DContainer &&  aChildren,
basegfx::B2DHomMatrix  aTransformation,
double  fCropLeft,
double  fCropTop,
double  fCropRight,
double  fCropBottom 
)

constructor

Definition at line 35 of file cropprimitive2d.cxx.

References maTransformation.

Member Function Documentation

◆ get2DDecomposition()

void drawinglayer::primitive2d::CropPrimitive2D::get2DDecomposition ( Primitive2DDecompositionVisitor rVisitor,
const geometry::ViewInformation2D rViewInformation 
) const
overridevirtual

◆ getCropBottom()

double drawinglayer::primitive2d::CropPrimitive2D::getCropBottom ( ) const
inline

Definition at line 79 of file cropprimitive2d.hxx.

References mfCropBottom.

Referenced by get2DDecomposition(), and operator==().

◆ getCropLeft()

double drawinglayer::primitive2d::CropPrimitive2D::getCropLeft ( ) const
inline

Definition at line 76 of file cropprimitive2d.hxx.

References mfCropLeft.

Referenced by get2DDecomposition(), and operator==().

◆ getCropRight()

double drawinglayer::primitive2d::CropPrimitive2D::getCropRight ( ) const
inline

Definition at line 78 of file cropprimitive2d.hxx.

References mfCropRight.

Referenced by get2DDecomposition(), and operator==().

◆ getCropTop()

double drawinglayer::primitive2d::CropPrimitive2D::getCropTop ( ) const
inline

Definition at line 77 of file cropprimitive2d.hxx.

References mfCropTop.

Referenced by get2DDecomposition(), and operator==().

◆ getPrimitive2DID()

sal_uInt32 drawinglayer::primitive2d::CropPrimitive2D::getPrimitive2DID ( ) const
overridevirtual

provide unique ID

Reimplemented from drawinglayer::primitive2d::GroupPrimitive2D.

Definition at line 149 of file cropprimitive2d.cxx.

References PRIMITIVE2D_ID_CROPPRIMITIVE2D.

◆ getTransformation()

const basegfx::B2DHomMatrix & drawinglayer::primitive2d::CropPrimitive2D::getTransformation ( ) const
inline

data read access

Definition at line 75 of file cropprimitive2d.hxx.

References maTransformation.

Referenced by get2DDecomposition(), and operator==().

◆ operator==()

bool drawinglayer::primitive2d::CropPrimitive2D::operator== ( const BasePrimitive2D rPrimitive) const
overridevirtual

compare operator

Reimplemented from drawinglayer::primitive2d::GroupPrimitive2D.

Definition at line 51 of file cropprimitive2d.cxx.

References getCropBottom(), getCropLeft(), getCropRight(), getCropTop(), and getTransformation().

Member Data Documentation

◆ maTransformation

basegfx::B2DHomMatrix drawinglayer::primitive2d::CropPrimitive2D::maTransformation
private

Definition at line 56 of file cropprimitive2d.hxx.

Referenced by getTransformation().

◆ mfCropBottom

double drawinglayer::primitive2d::CropPrimitive2D::mfCropBottom
private

Definition at line 62 of file cropprimitive2d.hxx.

Referenced by getCropBottom().

◆ mfCropLeft

double drawinglayer::primitive2d::CropPrimitive2D::mfCropLeft
private

Definition at line 59 of file cropprimitive2d.hxx.

Referenced by getCropLeft().

◆ mfCropRight

double drawinglayer::primitive2d::CropPrimitive2D::mfCropRight
private

Definition at line 61 of file cropprimitive2d.hxx.

Referenced by getCropRight().

◆ mfCropTop

double drawinglayer::primitive2d::CropPrimitive2D::mfCropTop
private

Definition at line 60 of file cropprimitive2d.hxx.

Referenced by getCropTop().


The documentation for this class was generated from the following files: