calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / drawinglayer / source / attribute / sdrlightattribute3d.cxx
blob511590f5ffd4b1a0fedf4371840ab34f87683c37
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #include <drawinglayer/attribute/sdrlightattribute3d.hxx>
21 #include <basegfx/color/bcolor.hxx>
22 #include <basegfx/vector/b3dvector.hxx>
25 namespace drawinglayer::attribute
27 class ImpSdr3DLightAttribute
29 public:
30 // 3D light attribute definitions
31 basegfx::BColor maColor;
32 basegfx::B3DVector maDirection;
34 bool mbSpecular : 1;
36 ImpSdr3DLightAttribute(
37 const basegfx::BColor& rColor,
38 const basegfx::B3DVector& rDirection,
39 bool bSpecular)
40 : maColor(rColor),
41 maDirection(rDirection),
42 mbSpecular(bSpecular)
46 // data read access
47 const basegfx::BColor& getColor() const { return maColor; }
48 const basegfx::B3DVector& getDirection() const { return maDirection; }
49 bool getSpecular() const { return mbSpecular; }
51 bool operator==(const ImpSdr3DLightAttribute& rCandidate) const
53 return (getColor() == rCandidate.getColor()
54 && getDirection() == rCandidate.getDirection()
55 && getSpecular() == rCandidate.getSpecular());
59 Sdr3DLightAttribute::Sdr3DLightAttribute(
60 const basegfx::BColor& rColor,
61 const basegfx::B3DVector& rDirection,
62 bool bSpecular)
63 : mpSdr3DLightAttribute(ImpSdr3DLightAttribute(
64 rColor, rDirection, bSpecular))
68 Sdr3DLightAttribute::Sdr3DLightAttribute(const Sdr3DLightAttribute&) = default;
70 Sdr3DLightAttribute::~Sdr3DLightAttribute() = default;
72 Sdr3DLightAttribute& Sdr3DLightAttribute::operator=(const Sdr3DLightAttribute&) = default;
74 bool Sdr3DLightAttribute::operator==(const Sdr3DLightAttribute& rCandidate) const
76 return rCandidate.mpSdr3DLightAttribute == mpSdr3DLightAttribute;
79 const basegfx::BColor& Sdr3DLightAttribute::getColor() const
81 return mpSdr3DLightAttribute->getColor();
84 const basegfx::B3DVector& Sdr3DLightAttribute::getDirection() const
86 return mpSdr3DLightAttribute->getDirection();
89 bool Sdr3DLightAttribute::getSpecular() const
91 return mpSdr3DLightAttribute->getSpecular();
94 } // end of namespace
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */