LibreOffice Module drawinglayer (master) 1
|
BasePrimitive2D class. More...
#include <baseprimitive2d.hxx>
Public Member Functions | |
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 Member Functions | |
BasePrimitive2D (const BasePrimitive2D &)=delete | |
BasePrimitive2D & | operator= (const BasePrimitive2D &)=delete |
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 |
BasePrimitive2D class.
Baseclass for all C++ implementations of css::graphic::XPrimitive2D
This class is strongly virtual due to the lack of getPrimitiveID() implementation. This is by purpose, this base class shall not be incarnated and be used directly as a XPrimitive2D.
It is noncopyable to make clear that a primitive is a read-only instance and copying or changing values is not intended. The idea is to hold all data needed for visualisation of this primitive in unchangeable form.
It is derived from cppu::BaseMutex to have a Mutex at hand; in a base implementation this may not be needed, but e.g. when buffering at last decomposition in a local member, multiple threads may try to decompose at the same time, so locking is needed to avoid race conditions seen from the UNO object implementation.
A method to get a simplified representation is provided by get2DDecomposition. The default implementation returns an empty sequence. The idea is that processors using this primitive and do not know it, may get the decomposition and process these instead. An example is e.g. a fat line, who's decomposition may contain the geometric representation of that line using filled polygon primitives. When the renderer knows how to handle fat lines, he may process this primitive directly; if not he can use the decomposition. With this functionality, renderers may operate by knowing only a small set of primitives.
When a primitive does not implement get2DDecomposition, it is called a 'Basic Primitive' and belongs to the set of primitives which a processor should be able to handle. Practice will define this minimal sets of primitives. When defined and the concept is proved, unique UNO APIs may be defined/implemented for these set to allow more intense work with primitives using UNO.
Current Basic 2D Primitives are:
UPDATE: MetafilePrimitive2D (VCL Metafile) is taken off this list since it is implemented with the integration of CWS aw078 into DV300m69.
All other implemented primitives have a defined decomposition and can thus be decomposed down to this small set.
A renderer implementing support for this minimal set of primitives can completely render primitive-based visualisations. Of course, he also has to take states into account which are represented by GroupPrimitive2D derivations, see groupprimitive2d.hxx
To support getting the geometric BoundRect, getB2DRange is used. The default implementation will use the get2DDecomposition result and merge a range from the entries. Thus, an implementation is only necessary for the Basic Primitives, but of course speedups are possible (and are used) by implementing the method at higher-level primitives.
For primitive identification, getPrimitiveID is used currently in this implementations to allow a fast switch/case processing. This needs a unique identifier mechanism which currently uses defines (see drawinglayer_primitivetypes2d.hxx). For UNO primitive API it will be needed to add a unique descriptor (Name?) later to the API.
This base implementation provides mappings from the methods from XPrimitive2D (getDecomposition/getRange) to the appropriate methods in the C++ implementations (get2DDecomposition/getB2DRange). The PropertyValue ViewParameters is converted to the appropriate C++ implementation class ViewInformation2D.
This base class does not implement any buffering; e.g. buffering the decomposition and/or the range. These may be buffered anytime since the definition is that the primitive is read-only and thus unchangeable. This implies that the decomposition and/or getting the range will lead to the same result as last time, under the precondition that the parameter ViewInformation2D is the same as the last one. This is usually the case for view-independent primitives which are defined by not using ViewInformation2D in their get2DDecomposition/getB2DRange implementations.
Definition at line 120 of file baseprimitive2d.hxx.
|
privatedelete |
drawinglayer::primitive2d::BasePrimitive2D::BasePrimitive2D | ( | ) |
Definition at line 32 of file baseprimitive2d.cxx.
|
overridevirtual |
Definition at line 34 of file baseprimitive2d.cxx.
|
virtual |
Reimplemented in drawinglayer::primitive2d::BitmapPrimitive2D, drawinglayer::primitive2d::GroupPrimitive2D, and drawinglayer::primitive2d::PatternFillPrimitive2D.
Definition at line 99 of file baseprimitive2d.cxx.
|
virtual |
The default implementation will return an empty sequence.
Reimplemented in drawinglayer::primitive2d::CropPrimitive2D, drawinglayer::primitive2d::TextEffectPrimitive2D, drawinglayer::primitive2d::AnimatedSwitchPrimitive2D, drawinglayer::primitive2d::AnimatedBlinkPrimitive2D, drawinglayer::primitive2d::AnimatedInterpolatePrimitive2D, drawinglayer::primitive2d::BackgroundColorPrimitive2D, drawinglayer::primitive2d::BufferedDecompositionGroupPrimitive2D, drawinglayer::primitive2d::BufferedDecompositionPrimitive2D, drawinglayer::primitive2d::ControlPrimitive2D, drawinglayer::primitive2d::FillHatchPrimitive2D, drawinglayer::primitive2d::GlowPrimitive2D, drawinglayer::primitive2d::GridPrimitive2D, drawinglayer::primitive2d::GroupPrimitive2D, drawinglayer::primitive2d::HelplinePrimitive2D, drawinglayer::primitive2d::HiddenGeometryPrimitive2D, drawinglayer::primitive2d::PatternFillPrimitive2D, drawinglayer::primitive2d::SingleLinePrimitive2D, drawinglayer::primitive2d::LineRectanglePrimitive2D, drawinglayer::primitive2d::PolygonMarkerPrimitive2D, drawinglayer::primitive2d::FilledRectanglePrimitive2D, drawinglayer::primitive2d::DiscreteMetricDependentPrimitive2D, drawinglayer::primitive2d::ViewportDependentPrimitive2D, drawinglayer::primitive2d::ViewTransformationDependentPrimitive2D, drawinglayer::primitive2d::ObjectAndViewTransformationDependentPrimitive2D, drawinglayer::primitive2d::ScenePrimitive2D, drawinglayer::primitive2d::ShadowPrimitive2D, drawinglayer::primitive2d::SoftEdgePrimitive2D, and drawinglayer::primitive2d::UnifiedTransparencePrimitive2D.
Definition at line 77 of file baseprimitive2d.cxx.
Referenced by drawinglayer::Primitive2dXmlDump::decomposeAndWrite(), getB2DRange(), getDecomposition(), and drawinglayer::processor2d::BaseProcessor2D::process().
|
virtual |
The default implementation will use getDecomposition results to create the range.
Reimplemented in drawinglayer::primitive2d::TextEffectPrimitive2D, drawinglayer::primitive2d::WallpaperBitmapPrimitive2D, drawinglayer::primitive2d::BackgroundColorPrimitive2D, drawinglayer::primitive2d::BitmapPrimitive2D, drawinglayer::primitive2d::ControlPrimitive2D, drawinglayer::primitive2d::DiscreteShadowPrimitive2D, drawinglayer::primitive2d::Embedded3DPrimitive2D, drawinglayer::primitive2d::EpsPrimitive2D, drawinglayer::primitive2d::FillGradientPrimitive2D, drawinglayer::primitive2d::FillGraphicPrimitive2D, drawinglayer::primitive2d::FillHatchPrimitive2D, drawinglayer::primitive2d::GlowPrimitive2D, drawinglayer::primitive2d::GraphicPrimitive2D, drawinglayer::primitive2d::GridPrimitive2D, drawinglayer::primitive2d::HiddenGeometryPrimitive2D, drawinglayer::primitive2d::MarkerArrayPrimitive2D, drawinglayer::primitive2d::MaskPrimitive2D, drawinglayer::primitive2d::MediaPrimitive2D, drawinglayer::primitive2d::MetafilePrimitive2D, drawinglayer::primitive2d::PagePreviewPrimitive2D, drawinglayer::primitive2d::PatternFillPrimitive2D, drawinglayer::primitive2d::PointArrayPrimitive2D, drawinglayer::primitive2d::PolygonHairlinePrimitive2D, drawinglayer::primitive2d::SingleLinePrimitive2D, drawinglayer::primitive2d::LineRectanglePrimitive2D, drawinglayer::primitive2d::PolygonMarkerPrimitive2D, drawinglayer::primitive2d::PolygonStrokeArrowPrimitive2D, drawinglayer::primitive2d::PolygonStrokePrimitive2D, drawinglayer::primitive2d::PolygonWavePrimitive2D, drawinglayer::primitive2d::PolyPolygonColorPrimitive2D, drawinglayer::primitive2d::FilledRectanglePrimitive2D, drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D, drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D, drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D, drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D, drawinglayer::primitive2d::ScenePrimitive2D, drawinglayer::primitive2d::ShadowPrimitive2D, drawinglayer::primitive2d::SoftEdgePrimitive2D, drawinglayer::primitive2d::SvgLinearGradientPrimitive2D, drawinglayer::primitive2d::SvgRadialGradientPrimitive2D, drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D, drawinglayer::primitive2d::TextSimplePortionPrimitive2D, drawinglayer::primitive2d::TransformPrimitive2D, and drawinglayer::primitive2d::UnifiedTransparencePrimitive2D.
Definition at line 70 of file baseprimitive2d.cxx.
References get2DDecomposition().
Referenced by drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D::create2DDecomposition(), drawinglayer::primitive2d::PolyPolygonGraphicPrimitive2D::create2DDecomposition(), drawinglayer::primitive2d::PolyPolygonHatchPrimitive2D::create2DDecomposition(), drawinglayer::primitive2d::PolygonStrokeArrowPrimitive2D::getB2DRange(), drawinglayer::primitive2d::PolygonStrokePrimitive2D::getB2DRange(), drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D::getB2DRange(), getRange(), drawinglayer::processor2d::ContourExtractor2D::processBasePrimitive2D(), drawinglayer::processor2d::HitTestProcessor2D::processBasePrimitive2D(), drawinglayer::processor2d::VclMetafileProcessor2D::processStructureTagPrimitive2D(), and drawinglayer::processor2d::VclMetafileProcessor2D::processTransparencePrimitive2D().
Primitive2DContainer drawinglayer::primitive2d::BasePrimitive2D::getDecomposition | ( | const css::uno::Sequence< css::beans::PropertyValue > & | rViewParameters | ) |
The getDecomposition implementation for UNO API will use getDecomposition from this implementation.
It will construct a ViewInformation2D from the ViewParameters for that purpose
Definition at line 84 of file baseprimitive2d.cxx.
References drawinglayer::geometry::createViewInformation2D(), and get2DDecomposition().
|
pure virtual |
provide unique ID for fast identifying of known primitive implementations in renderers.
These use the defines from drawinglayer_primitivetypes2d.hxx to define unique IDs.
Implemented in drawinglayer::primitive2d::CropPrimitive2D, drawinglayer::primitive2d::TextEffectPrimitive2D, drawinglayer::primitive2d::TextLinePrimitive2D, drawinglayer::primitive2d::TextCharacterStrikeoutPrimitive2D, drawinglayer::primitive2d::TextGeometryStrikeoutPrimitive2D, drawinglayer::primitive2d::WallpaperBitmapPrimitive2D, drawinglayer::primitive2d::AnimatedSwitchPrimitive2D, drawinglayer::primitive2d::AnimatedBlinkPrimitive2D, drawinglayer::primitive2d::AnimatedInterpolatePrimitive2D, drawinglayer::primitive2d::BackgroundColorPrimitive2D, drawinglayer::primitive2d::BitmapPrimitive2D, drawinglayer::primitive2d::BorderLinePrimitive2D, drawinglayer::primitive2d::ControlPrimitive2D, drawinglayer::primitive2d::DiscreteBitmapPrimitive2D, drawinglayer::primitive2d::DiscreteShadowPrimitive2D, drawinglayer::primitive2d::Embedded3DPrimitive2D, drawinglayer::primitive2d::EpsPrimitive2D, drawinglayer::primitive2d::FillGradientPrimitive2D, drawinglayer::primitive2d::FillGraphicPrimitive2D, drawinglayer::primitive2d::FillHatchPrimitive2D, drawinglayer::primitive2d::GlowPrimitive2D, drawinglayer::primitive2d::GraphicPrimitive2D, drawinglayer::primitive2d::GridPrimitive2D, drawinglayer::primitive2d::GroupPrimitive2D, drawinglayer::primitive2d::HelplinePrimitive2D, drawinglayer::primitive2d::HiddenGeometryPrimitive2D, drawinglayer::primitive2d::InvertPrimitive2D, drawinglayer::primitive2d::MarkerArrayPrimitive2D, drawinglayer::primitive2d::MaskPrimitive2D, drawinglayer::primitive2d::MediaPrimitive2D, drawinglayer::primitive2d::MetafilePrimitive2D, drawinglayer::primitive2d::ModifiedColorPrimitive2D, drawinglayer::primitive2d::ObjectInfoPrimitive2D, drawinglayer::primitive2d::PageHierarchyPrimitive2D, drawinglayer::primitive2d::PagePreviewPrimitive2D, drawinglayer::primitive2d::PatternFillPrimitive2D, drawinglayer::primitive2d::PointArrayPrimitive2D, drawinglayer::primitive2d::PolygonHairlinePrimitive2D, drawinglayer::primitive2d::SingleLinePrimitive2D, drawinglayer::primitive2d::LineRectanglePrimitive2D, drawinglayer::primitive2d::PolygonMarkerPrimitive2D, drawinglayer::primitive2d::PolygonStrokeArrowPrimitive2D, drawinglayer::primitive2d::PolygonStrokePrimitive2D, drawinglayer::primitive2d::PolygonWavePrimitive2D, drawinglayer::primitive2d::PolyPolygonColorPrimitive2D, drawinglayer::primitive2d::FilledRectanglePrimitive2D, drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D, drawinglayer::primitive2d::PolyPolygonGraphicPrimitive2D, drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D, drawinglayer::primitive2d::PolyPolygonHatchPrimitive2D, drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D, drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D, drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D, drawinglayer::primitive2d::ScenePrimitive2D, drawinglayer::primitive2d::ShadowPrimitive2D, drawinglayer::primitive2d::SoftEdgePrimitive2D, drawinglayer::primitive2d::StructureTagPrimitive2D, drawinglayer::primitive2d::SvgLinearGradientPrimitive2D, drawinglayer::primitive2d::SvgRadialGradientPrimitive2D, drawinglayer::primitive2d::SvgLinearAtomPrimitive2D, drawinglayer::primitive2d::SvgRadialAtomPrimitive2D, drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D, drawinglayer::primitive2d::TextHierarchyLinePrimitive2D, drawinglayer::primitive2d::TextHierarchyBulletPrimitive2D, drawinglayer::primitive2d::TextHierarchyParagraphPrimitive2D, drawinglayer::primitive2d::TextHierarchyBlockPrimitive2D, drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D, drawinglayer::primitive2d::TextHierarchyEditPrimitive2D, drawinglayer::primitive2d::TextSimplePortionPrimitive2D, drawinglayer::primitive2d::TransformPrimitive2D, drawinglayer::primitive2d::TransparencePrimitive2D, drawinglayer::primitive2d::UnifiedTransparencePrimitive2D, and drawinglayer::primitive2d::WrongSpellPrimitive2D.
References getRange().
Referenced by drawinglayer::Primitive2dXmlDump::decomposeAndWrite(), operator==(), drawinglayer::processor2d::VclMetafileProcessor2D::processBasePrimitive2D(), drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(), drawinglayer::processor2d::CairoPixelProcessor2D::processBasePrimitive2D(), drawinglayer::processor2d::ContourExtractor2D::processBasePrimitive2D(), drawinglayer::processor2d::D2DPixelProcessor2D::processBasePrimitive2D(), drawinglayer::processor2d::HitTestProcessor2D::processBasePrimitive2D(), drawinglayer::processor2d::LineGeometryExtractor2D::processBasePrimitive2D(), drawinglayer::processor2d::ObjectInfoPrimitiveExtractor2D::processBasePrimitive2D(), drawinglayer::processor2d::TextAsPolygonExtractor2D::processBasePrimitive2D(), and drawinglayer::processor2d::VclPixelProcessor2D::processUnifiedTransparencePrimitive2D().
css::geometry::RealRectangle2D drawinglayer::primitive2d::BasePrimitive2D::getRange | ( | const css::uno::Sequence< css::beans::PropertyValue > & | rViewParameters | ) |
The getRange implementation for UNO API will use getRange from this implementation.
It will construct a ViewInformation2D from the ViewParameters for that purpose
Definition at line 93 of file baseprimitive2d.cxx.
References drawinglayer::geometry::createViewInformation2D(), getB2DRange(), and basegfx::unotools::rectangle2DFromB2DRectangle().
Referenced by drawinglayer::primitive2d::WallpaperBitmapPrimitive2D::create2DDecomposition(), and drawinglayer::primitive2d::PolyPolygonGraphicPrimitive2D::create2DDecomposition().
|
inline |
Definition at line 136 of file baseprimitive2d.hxx.
References operator==().
|
privatedelete |
References operator==().
|
virtual |
the ==operator is mainly needed to allow testing newly-created primitives against their last incarnation which buffers/holds the made decompositions.
The default implementation uses getPrimitive2DID()-calls to test if it's the same ID at last. Overridden implementations are then based on this implementation
Reimplemented in drawinglayer::primitive2d::CropPrimitive2D, drawinglayer::primitive2d::TextEffectPrimitive2D, drawinglayer::primitive2d::TextLinePrimitive2D, drawinglayer::primitive2d::BaseTextStrikeoutPrimitive2D, drawinglayer::primitive2d::TextCharacterStrikeoutPrimitive2D, drawinglayer::primitive2d::TextGeometryStrikeoutPrimitive2D, drawinglayer::primitive2d::WallpaperBitmapPrimitive2D, drawinglayer::primitive2d::AnimatedSwitchPrimitive2D, drawinglayer::primitive2d::BackgroundColorPrimitive2D, drawinglayer::primitive2d::BitmapPrimitive2D, drawinglayer::primitive2d::BorderLinePrimitive2D, drawinglayer::primitive2d::ControlPrimitive2D, drawinglayer::primitive2d::DiscreteBitmapPrimitive2D, drawinglayer::primitive2d::DiscreteShadowPrimitive2D, drawinglayer::primitive2d::Embedded3DPrimitive2D, drawinglayer::primitive2d::EpsPrimitive2D, drawinglayer::primitive2d::FillGradientPrimitive2D, drawinglayer::primitive2d::FillGraphicPrimitive2D, drawinglayer::primitive2d::FillHatchPrimitive2D, drawinglayer::primitive2d::GlowPrimitive2D, drawinglayer::primitive2d::GraphicPrimitive2D, drawinglayer::primitive2d::GridPrimitive2D, drawinglayer::primitive2d::GroupPrimitive2D, drawinglayer::primitive2d::HelplinePrimitive2D, drawinglayer::primitive2d::MarkerArrayPrimitive2D, drawinglayer::primitive2d::MaskPrimitive2D, drawinglayer::primitive2d::MediaPrimitive2D, drawinglayer::primitive2d::MetafilePrimitive2D, drawinglayer::primitive2d::ModifiedColorPrimitive2D, drawinglayer::primitive2d::ObjectInfoPrimitive2D, drawinglayer::primitive2d::PagePreviewPrimitive2D, drawinglayer::primitive2d::PatternFillPrimitive2D, drawinglayer::primitive2d::PointArrayPrimitive2D, drawinglayer::primitive2d::PolygonHairlinePrimitive2D, drawinglayer::primitive2d::SingleLinePrimitive2D, drawinglayer::primitive2d::LineRectanglePrimitive2D, drawinglayer::primitive2d::PolygonMarkerPrimitive2D, drawinglayer::primitive2d::PolygonStrokeArrowPrimitive2D, drawinglayer::primitive2d::PolygonStrokePrimitive2D, drawinglayer::primitive2d::PolygonWavePrimitive2D, drawinglayer::primitive2d::PolyPolygonColorPrimitive2D, drawinglayer::primitive2d::FilledRectanglePrimitive2D, drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D, drawinglayer::primitive2d::PolyPolygonGraphicPrimitive2D, drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D, drawinglayer::primitive2d::PolyPolygonHatchPrimitive2D, drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D, drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D, drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D, drawinglayer::primitive2d::ScenePrimitive2D, drawinglayer::primitive2d::ShadowPrimitive2D, drawinglayer::primitive2d::SoftEdgePrimitive2D, drawinglayer::primitive2d::StructureTagPrimitive2D, drawinglayer::primitive2d::SvgLinearGradientPrimitive2D, drawinglayer::primitive2d::SvgRadialGradientPrimitive2D, drawinglayer::primitive2d::SvgLinearAtomPrimitive2D, drawinglayer::primitive2d::SvgRadialAtomPrimitive2D, drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D, drawinglayer::primitive2d::TextHierarchyParagraphPrimitive2D, drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D, drawinglayer::primitive2d::TextSimplePortionPrimitive2D, drawinglayer::primitive2d::TransformPrimitive2D, drawinglayer::primitive2d::TransparencePrimitive2D, drawinglayer::primitive2d::UnifiedTransparencePrimitive2D, and drawinglayer::primitive2d::WrongSpellPrimitive2D.
Definition at line 36 of file baseprimitive2d.cxx.
References getPrimitive2DID().