1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_ZBUFFERPROCESSOR3D_HXX
21 #define INCLUDED_DRAWINGLAYER_PROCESSOR3D_ZBUFFERPROCESSOR3D_HXX
23 #include <drawinglayer/processor3d/defaultprocessor3d.hxx>
24 #include <basegfx/matrix/b3dhommatrix.hxx>
31 namespace drawinglayer
{
33 class SdrSceneAttribute
;
34 class SdrLightingAttribute
;
35 class MaterialAttribute3D
;
39 class ZBufferRasterConverter3D
;
40 class RasterPrimitive3D
;
42 namespace drawinglayer
47 This 3D renderer derived from DefaultProcessor3D renders all fed primitives to a 2D
48 raster bitmap using a Z-Buffer based approach. It is able to supersample and to handle
51 class ZBufferProcessor3D
: public DefaultProcessor3D
54 /// inverse of EyeToView for rasterconversion with evtl. Phong shading
55 basegfx::B3DHomMatrix maInvEyeToView
;
57 /// The raster converter for Z-Buffer
58 std::unique_ptr
<ZBufferRasterConverter3D
> mpZBufferRasterConverter3D
;
60 /* AA value. Defines how many oversamples will be used in X and Y. Values 0, 1
61 will switch it off while e.g. 2 will use 2x2 pixels for each pixel to create
63 sal_uInt16 mnAntiAlialize
;
65 /* remembered RasterPrimitive3D's which need to be painted back to front
66 for transparent 3D parts
68 std::unique_ptr
<std::vector
< RasterPrimitive3D
>> mpRasterPrimitive3Ds
;
70 sal_uInt32 mnStartLine
;
71 sal_uInt32 mnStopLine
;
73 // rasterconversions for filled and non-filled polygons
75 virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D
& rMaterial
, const basegfx::B3DPolygon
& rHairline
) const override
;
76 virtual void rasterconvertB3DPolyPolygon(const attribute::MaterialAttribute3D
& rMaterial
, const basegfx::B3DPolyPolygon
& rFill
) const override
;
80 const geometry::ViewInformation3D
& rViewInformation3D
,
81 const attribute::SdrSceneAttribute
& rSdrSceneAttribute
,
82 const attribute::SdrLightingAttribute
& rSdrLightingAttribute
,
83 const basegfx::B2DRange
& rVisiblePart
,
84 sal_uInt16 nAntiAlialize
,
85 double fFullViewSizeX
,
86 double fFullViewSizeY
,
87 basegfx::BZPixelRaster
& rBZPixelRaster
,
88 sal_uInt32 nStartLine
,
89 sal_uInt32 nStopLine
);
90 virtual ~ZBufferProcessor3D() override
;
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */