LibreOffice Module drawinglayer (master) 1
zbufferprocessor3d.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#include <memory>
25
26namespace basegfx {
27 class BZPixelRaster;
28}
29
31 class SdrSceneAttribute;
32 class SdrLightingAttribute;
33 class MaterialAttribute3D;
34}
35
36
39
41 {
48 {
49 private:
52
54 std::unique_ptr<ZBufferRasterConverter3D> mpZBufferRasterConverter3D;
55
56 /* AA value. Defines how many oversamples will be used in X and Y. Values 0, 1
57 will switch it off while e.g. 2 will use 2x2 pixels for each pixel to create
58 */
59 sal_uInt16 mnAntiAlialize;
60
61 /* remembered RasterPrimitive3D's which need to be painted back to front
62 for transparent 3D parts
63 */
64 mutable std::vector< RasterPrimitive3D > maRasterPrimitive3Ds;
65
66 sal_uInt32 mnStartLine;
67 sal_uInt32 mnStopLine;
68
69 // rasterconversions for filled and non-filled polygons
70
71 virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const override;
72 virtual void rasterconvertB3DPolyPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolyPolygon& rFill) const override;
73
74 public:
76 const geometry::ViewInformation3D& rViewInformation3D,
77 const attribute::SdrSceneAttribute& rSdrSceneAttribute,
78 const attribute::SdrLightingAttribute& rSdrLightingAttribute,
79 const basegfx::B2DRange& rVisiblePart,
80 sal_uInt16 nAntiAlialize,
81 double fFullViewSizeX,
82 double fFullViewSizeY,
83 basegfx::BZPixelRaster& rBZPixelRaster,
84 sal_uInt32 nStartLine,
85 sal_uInt32 nStopLine);
86 virtual ~ZBufferProcessor3D() override;
87
88 void finish();
89 };
90
91}
92
93/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This 3D renderer derived from DefaultProcessor3D renders all fed primitives to a 2D raster bitmap usi...
std::unique_ptr< ZBufferRasterConverter3D > mpZBufferRasterConverter3D
The raster converter for Z-Buffer.
ZBufferProcessor3D(const geometry::ViewInformation3D &rViewInformation3D, const attribute::SdrSceneAttribute &rSdrSceneAttribute, const attribute::SdrLightingAttribute &rSdrLightingAttribute, const basegfx::B2DRange &rVisiblePart, sal_uInt16 nAntiAlialize, double fFullViewSizeX, double fFullViewSizeY, basegfx::BZPixelRaster &rBZPixelRaster, sal_uInt32 nStartLine, sal_uInt32 nStopLine)
virtual void rasterconvertB3DPolyPolygon(const attribute::MaterialAttribute3D &rMaterial, const basegfx::B3DPolyPolygon &rFill) const override
virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D &rMaterial, const basegfx::B3DPolygon &rHairline) const override
basegfx::B3DHomMatrix maInvEyeToView
inverse of EyeToView for rasterconversion with evtl. Phong shading
std::vector< RasterPrimitive3D > maRasterPrimitive3Ds