/src/libreoffice/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
Line | Count | Source |
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 | | #include <sdr/contact/viewobjectcontactofe3d.hxx> |
21 | | #include <sdr/contact/viewcontactofe3d.hxx> |
22 | | #include <basegfx/color/bcolor.hxx> |
23 | | #include <drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx> |
24 | | |
25 | | namespace sdr::contact |
26 | | { |
27 | | ViewObjectContactOfE3d::ViewObjectContactOfE3d(ObjectContact& rObjectContact, ViewContact& rViewContact) |
28 | 0 | : ViewObjectContactOfSdrObj(rObjectContact, rViewContact) |
29 | 0 | { |
30 | 0 | } |
31 | | |
32 | | ViewObjectContactOfE3d::~ViewObjectContactOfE3d() |
33 | 0 | { |
34 | 0 | } |
35 | | |
36 | | drawinglayer::primitive3d::Primitive3DContainer ViewObjectContactOfE3d::getPrimitive3DContainer(const DisplayInfo& rDisplayInfo) const |
37 | 0 | { |
38 | | // get the view-independent Primitive from the viewContact |
39 | 0 | const ViewContactOfE3d& rViewContactOfE3d(dynamic_cast< const ViewContactOfE3d& >(GetViewContact())); |
40 | 0 | drawinglayer::primitive3d::Primitive3DContainer xRetval(rViewContactOfE3d.getViewIndependentPrimitive3DContainer()); |
41 | | |
42 | | // handle ghosted |
43 | 0 | if(isPrimitiveGhosted(rDisplayInfo)) |
44 | 0 | { |
45 | 0 | ::basegfx::BColor aRGBWhite(1.0, 1.0, 1.0); |
46 | 0 | ::basegfx::BColorModifierSharedPtr aBColorModifier = |
47 | 0 | std::make_shared<basegfx::BColorModifier_interpolate>( |
48 | 0 | aRGBWhite, |
49 | 0 | 0.5); |
50 | 0 | drawinglayer::primitive3d::Primitive3DReference xReference( |
51 | 0 | new drawinglayer::primitive3d::ModifiedColorPrimitive3D( |
52 | 0 | xRetval, |
53 | 0 | std::move(aBColorModifier))); |
54 | |
|
55 | 0 | xRetval = { xReference }; |
56 | 0 | } |
57 | |
|
58 | 0 | return xRetval; |
59 | 0 | } |
60 | | |
61 | | void ViewObjectContactOfE3d::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const |
62 | 0 | { |
63 | 0 | const ViewContactOfE3d& rViewContact = static_cast< const ViewContactOfE3d& >(GetViewContact()); |
64 | | |
65 | | // get 3d primitive vector, isPrimitiveVisible() is done in 3d creator |
66 | 0 | rVisitor.visit(rViewContact.impCreateWithGivenPrimitive3DContainer(getPrimitive3DContainer(rDisplayInfo))); |
67 | 0 | } |
68 | | |
69 | | |
70 | | } // end of namespace |
71 | | |
72 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |