LibreOffice Module cppcanvas (master) 1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
cppcanvas::internal::CachedPrimitiveBase Class Referenceabstract

Base class providing cached re-rendering, if XCanvas returns XCachedPrimitive. More...

#include <cachedprimitivebase.hxx>

Inheritance diagram for cppcanvas::internal::CachedPrimitiveBase:
[legend]
Collaboration diagram for cppcanvas::internal::CachedPrimitiveBase:
[legend]

Public Member Functions

 CachedPrimitiveBase (CanvasSharedPtr xCanvas, bool bOnlyRedrawWithSameTransform)
 Constructor. More...
 
 CachedPrimitiveBase (const CachedPrimitiveBase &)=delete
 
const CachedPrimitiveBaseoperator= (const CachedPrimitiveBase &)=delete
 
virtual bool render (const ::basegfx::B2DHomMatrix &rTransformation) const override
 Render this action to the associated canvas. More...
 
- Public Member Functions inherited from cppcanvas::internal::Action
virtual ~Action ()
 
virtual bool render (const ::basegfx::B2DHomMatrix &rTransformation) const =0
 Render this action to the associated canvas. More...
 
virtual bool renderSubset (const ::basegfx::B2DHomMatrix &rTransformation, const Subset &rSubset) const =0
 Render the given part of the action to the associated canvas. More...
 
virtual ::basegfx::B2DRange getBounds (const ::basegfx::B2DHomMatrix &rTransformation) const =0
 Query bounds of this action on the associated canvas. More...
 
virtual ::basegfx::B2DRange getBounds (const ::basegfx::B2DHomMatrix &rTransformation, const Subset &rSubset) const =0
 Query bounds for the given part of the action on the associated canvas. More...
 
virtual sal_Int32 getActionCount () const =0
 Query action count. More...
 

Protected Member Functions

virtual bool render (const ::basegfx::B2DHomMatrix &rTransformation) const=0
 Render this action to the associated canvas. More...
 

Private Member Functions

virtual bool renderPrimitive (css::uno::Reference< css::rendering::XCachedPrimitive > &rCachedPrimitive, const ::basegfx::B2DHomMatrix &rTransformation) const =0
 

Private Attributes

CanvasSharedPtr mpCanvas
 
css::uno::Reference< css::rendering::XCachedPrimitive > mxCachedPrimitive
 
mutable::basegfx::B2DHomMatrix maLastTransformation
 
const bool mbOnlyRedrawWithSameTransform
 

Detailed Description

Base class providing cached re-rendering, if XCanvas returns XCachedPrimitive.

Derive from this class and implement private render() method to perform the actual primitive rendering. Return cached primitive into given reference. Next time this class' public render() method gets called, the cached representation is taken.

Definition at line 46 of file cachedprimitivebase.hxx.

Constructor & Destructor Documentation

◆ CachedPrimitiveBase() [1/2]

cppcanvas::internal::CachedPrimitiveBase::CachedPrimitiveBase ( CanvasSharedPtr  xCanvas,
bool  bOnlyRedrawWithSameTransform 
)

Constructor.

Parameters
rCanvasCanvas on which this primitive is to appear
bOnlyRedrawWithSameTransformWhen true, this class only reuses the cached primitive, if the overall transformation stays the same. Otherwise, repaints are always performed via the cached primitive.

Definition at line 35 of file cachedprimitivebase.cxx.

◆ CachedPrimitiveBase() [2/2]

cppcanvas::internal::CachedPrimitiveBase::CachedPrimitiveBase ( const CachedPrimitiveBase )
delete

Member Function Documentation

◆ operator=()

const CachedPrimitiveBase & cppcanvas::internal::CachedPrimitiveBase::operator= ( const CachedPrimitiveBase )
delete

◆ render() [1/2]

bool cppcanvas::internal::CachedPrimitiveBase::render ( const ::basegfx::B2DHomMatrix rTransformation) const
overridevirtual

Render this action to the associated canvas.

Parameters
rTransformationTransformation matrix to apply before rendering
Returns
true, if rendering was successful. If rendering failed, false is returned.

Implements cppcanvas::internal::Action.

Definition at line 44 of file cachedprimitivebase.cxx.

References maLastTransformation, mbOnlyRedrawWithSameTransform, mpCanvas, mxCachedPrimitive, renderPrimitive(), and SAL_INFO.

◆ render() [2/2]

virtual bool cppcanvas::internal::Action::render ( const ::basegfx::B2DHomMatrix rTransformation) const
protectedvirtual

Render this action to the associated canvas.

Parameters
rTransformationTransformation matrix to apply before rendering
Returns
true, if rendering was successful. If rendering failed, false is returned.

Implements cppcanvas::internal::Action.

◆ renderPrimitive()

virtual bool cppcanvas::internal::CachedPrimitiveBase::renderPrimitive ( css::uno::Reference< css::rendering::XCachedPrimitive > &  rCachedPrimitive,
const ::basegfx::B2DHomMatrix rTransformation 
) const
privatepure virtual

Referenced by render().

Member Data Documentation

◆ maLastTransformation

mutable::basegfx::B2DHomMatrix cppcanvas::internal::CachedPrimitiveBase::maLastTransformation
private

Definition at line 77 of file cachedprimitivebase.hxx.

Referenced by render().

◆ mbOnlyRedrawWithSameTransform

const bool cppcanvas::internal::CachedPrimitiveBase::mbOnlyRedrawWithSameTransform
private

Definition at line 78 of file cachedprimitivebase.hxx.

Referenced by render().

◆ mpCanvas

CanvasSharedPtr cppcanvas::internal::CachedPrimitiveBase::mpCanvas
private

Definition at line 75 of file cachedprimitivebase.hxx.

Referenced by render().

◆ mxCachedPrimitive

css::uno::Reference< css::rendering::XCachedPrimitive > cppcanvas::internal::CachedPrimitiveBase::mxCachedPrimitive
mutableprivate

Definition at line 76 of file cachedprimitivebase.hxx.

Referenced by render().


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