Debian Codegraph @

svx/inc/sdr/contact/viewcontactofe3d.hxx

raw
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
22 #include <svx/obj3d.hxx>
23 #include <svx/sdr/contact/viewcontactofsdrobj.hxx>
24 #include <drawinglayer/primitive3d/baseprimitive3d.hxx>
25
26 namespace sdr::contact
27 {
28 class ViewContactOfE3d : public ViewContactOfSdrObj
29 {
30 protected:
31 // Create an Object-Specific ViewObjectContact, set ViewContact and
32 // ObjectContact. Always needs to return something.
33 virtual ViewObjectContact&
34 CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
35
36 public:
37 // basic constructor, used from E3dObject.
38 explicit ViewContactOfE3d(E3dObject& rObj);
39 virtual ~ViewContactOfE3d() override;
40
41 // access to E3dObject
42 const E3dObject& GetE3dObject() const { return static_cast<const E3dObject&>(GetSdrObject()); }
43
44 // public helpers
45 drawinglayer::primitive2d::Primitive2DContainer impCreateWithGivenPrimitive3DContainer(
46 const drawinglayer::primitive3d::Primitive3DContainer& rxContent3D) const;
47
48 // primitive stuff
49
50 protected:
51 // This method is responsible for creating the graphical visualisation data which is
52 // stored in mxViewIndependentPrimitive3DContainer, but without object transformation
53 virtual drawinglayer::primitive3d::Primitive3DContainer
54 createViewIndependentPrimitive3DContainer() const = 0;
55
56 // This method is responsible for creating the graphical visualisation data derived ONLY from
57 // the model data. The default implementation will try to create a 3D to 2D embedding (will work
58 // when scene is known) which can then be used for 2D processing concerning ranges
59 virtual void createViewIndependentPrimitive2DSequence(
60 drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const override;
61
62 public:
63 // access to the local primitive without the object's local 3D transform. This is e.g. needed
64 // to get the not-yet transformed BoundVolume for e.g. interactions
65 drawinglayer::primitive3d::Primitive3DContainer const& getVIP3DSWithoutObjectTransform() const;
66
67 // access to the local primitive. This will ensure that the list is
68 // current in comparing the local list content with a fresh created incarnation. It will
69 // use getVIP3DSWithoutObjectTransform and embed to 3d transform primitive when object's
70 // local 3d transform is used
71 drawinglayer::primitive3d::Primitive3DContainer getViewIndependentPrimitive3DContainer() const;
72
73 private:
74 // Primitive3DContainer of the ViewContact. This contains all necessary information
75 // for the graphical visualisation and needs to be supported by all 3D VCs which
76 // can be visualized. It does NOT contain the object transformation to be able to
77 // buffer for all possible usages
78 drawinglayer::primitive3d::Primitive3DContainer mxViewIndependentPrimitive3DContainer;
79 };
80 }
81
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */