Line data Source code
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 : #ifndef INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFE3D_HXX
21 : #define INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFE3D_HXX
22 :
23 : #include <svx/sdr/contact/viewcontactofsdrobj.hxx>
24 : #include <drawinglayer/primitive3d/baseprimitive3d.hxx>
25 :
26 :
27 : // predeclarations
28 :
29 : namespace sdr { namespace contact {
30 : class ViewContactOfE3dScene;
31 : }}
32 :
33 : namespace drawinglayer { namespace attribute {
34 : class SdrLineAttribute;
35 : }}
36 :
37 : namespace basegfx {
38 : class BColor;
39 : class B3DHomMatrix;
40 : }
41 :
42 : class E3dObject;
43 :
44 :
45 :
46 : namespace sdr
47 : {
48 : namespace contact
49 : {
50 : class ViewContactOfE3d : public ViewContactOfSdrObj
51 : {
52 : protected:
53 : // Create a Object-Specific ViewObjectContact, set ViewContact and
54 : // ObjectContact. Always needs to return something.
55 : virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) SAL_OVERRIDE;
56 :
57 : public:
58 : // basic constructor, used from E3dObject.
59 : explicit ViewContactOfE3d(E3dObject& rObj);
60 : virtual ~ViewContactOfE3d();
61 :
62 : // access to E3dObject
63 0 : E3dObject& GetE3dObject() const
64 : {
65 0 : return (E3dObject&)GetSdrObject();
66 : }
67 :
68 : // public helpers
69 : drawinglayer::primitive2d::Primitive2DSequence impCreateWithGivenPrimitive3DSequence(
70 : const drawinglayer::primitive3d::Primitive3DSequence& rxContent3D) const;
71 :
72 :
73 : // primitive stuff
74 :
75 : protected:
76 : // Primitive3DSequence of the ViewContact. This contains all necessary information
77 : // for the graphical visualisation and needs to be supported by all 3D VCs which
78 : // can be visualized. It does NOT contain the object transformation to be able to
79 : // buffer for all possible usages
80 : drawinglayer::primitive3d::Primitive3DSequence mxViewIndependentPrimitive3DSequence;
81 :
82 : // This method is responsible for creating the graphical visualisation data which is
83 : // stored in mxViewIndependentPrimitive3DSequence, but without object transformation
84 : virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const = 0;
85 :
86 : // This method is responsible for creating the graphical visualisation data derived ONLY from
87 : // the model data. The default implementation will try to create a 3D to 2D embedding (will work
88 : // when scene is known) which can then be used for 2D processing concerning ranges
89 : virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const SAL_OVERRIDE;
90 :
91 : public:
92 : // access to the local primitive without the object's local 3D transform. This is e.g. needed
93 : // to get the not-yet transformed BoundVolume for e.g. interactions
94 : drawinglayer::primitive3d::Primitive3DSequence getVIP3DSWithoutObjectTransform() const;
95 :
96 : // access to the local primitive. This will ensure that the list is
97 : // current in comparing the local list content with a fresh created incarnation. It will
98 : // use getVIP3DSWithoutObjectTransform and embed to 3d transform primitive when object's
99 : // local 3d transform is used
100 : drawinglayer::primitive3d::Primitive3DSequence getViewIndependentPrimitive3DSequence() const;
101 : };
102 : } // end of namespace contact
103 : } // end of namespace sdr
104 :
105 :
106 :
107 : #endif // INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFE3D_HXX
108 :
109 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|