LibreOffice Module drawinglayer (master) 1
cropprimitive2d.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
24
25
27 {
52 class CropPrimitive2D final : public GroupPrimitive2D
53 {
54 private:
55 // the transformation already applied to the child geometry
57
58 // the crop offsets relative to the range of the unrotated content
59 double mfCropLeft;
60 double mfCropTop;
63
64 public:
67 Primitive2DContainer&& aChildren,
68 basegfx::B2DHomMatrix aTransformation,
69 double fCropLeft,
70 double fCropTop,
71 double fCropRight,
72 double fCropBottom);
73
76 double getCropLeft() const { return mfCropLeft; }
77 double getCropTop() const { return mfCropTop; }
78 double getCropRight() const { return mfCropRight; }
79 double getCropBottom() const { return mfCropBottom; }
80
82 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
83
85 virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
86
88 virtual sal_uInt32 getPrimitive2DID() const override;
89 };
90
91} // end of namespace drawinglayer::primitive2d
92
93/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void get2DDecomposition(Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override
local decomposition
const basegfx::B2DHomMatrix & getTransformation() const
data read access
virtual sal_uInt32 getPrimitive2DID() const override
provide unique ID
CropPrimitive2D(Primitive2DContainer &&aChildren, basegfx::B2DHomMatrix aTransformation, double fCropLeft, double fCropTop, double fCropRight, double fCropBottom)
constructor
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
compare operator