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_VIEWCONTACTOFE3DSCENE_HXX
21 : #define INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFE3DSCENE_HXX
22 :
23 : #include <svx/scene3d.hxx>
24 : #include <svx/sdr/contact/viewcontactofsdrobj.hxx>
25 : #include <drawinglayer/primitive3d/baseprimitive3d.hxx>
26 : #include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
27 : #include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
28 : #include <drawinglayer/geometry/viewinformation3d.hxx>
29 : #include <basegfx/matrix/b2dhommatrix.hxx>
30 :
31 : namespace basegfx {
32 : class B3DRange;
33 : }
34 :
35 : namespace sdr { namespace contact {
36 :
37 2546 : class SVX_DLLPUBLIC ViewContactOfE3dScene : public ViewContactOfSdrObj
38 : {
39 : protected:
40 : // Create a Object-Specific ViewObjectContact, set ViewContact and
41 : // ObjectContact. Always needs to return something. Default is to create
42 : // a standard ViewObjectContact containing the given ObjectContact and *this
43 : virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) SAL_OVERRIDE;
44 :
45 : public:
46 : // basic constructor, used from SdrObject.
47 : explicit ViewContactOfE3dScene(E3dScene& rScene);
48 :
49 : // access to SdrObject
50 7788 : const E3dScene& GetE3dScene() const
51 : {
52 7788 : return static_cast<const E3dScene&>(GetSdrObject());
53 : }
54 :
55 : // React on changes of the object of this ViewContact
56 : virtual void ActionChanged() SAL_OVERRIDE;
57 :
58 : // access to ViewInformation3D and ObjectTransformation
59 : const drawinglayer::geometry::ViewInformation3D& getViewInformation3D(const ::basegfx::B3DRange& rContentRange) const;
60 : const drawinglayer::geometry::ViewInformation3D& getViewInformation3D() const;
61 : const basegfx::B2DHomMatrix& getObjectTransformation() const;
62 :
63 : // attribute providers
64 : const drawinglayer::attribute::SdrSceneAttribute& getSdrSceneAttribute() const;
65 : const drawinglayer::attribute::SdrLightingAttribute& getSdrLightingAttribute() const;
66 :
67 : // scene primitive creators. If pLayerVisibility is given, a visibility test with the LayerID and the
68 : // given SetOfByte is done.
69 : drawinglayer::primitive2d::Primitive2DSequence createScenePrimitive2DSequence(const SetOfByte* pLayerVisibility) const;
70 :
71 : // helpers to get the sequence of all contained 3D primitives and its range,
72 : // regardless of layer or visibility constraints and using a neutral ViewInformation3D
73 : drawinglayer::primitive3d::Primitive3DSequence getAllPrimitive3DSequence() const;
74 : basegfx::B3DRange getAllContentRange3D() const;
75 :
76 : protected:
77 : // the 3d transformation stack
78 : drawinglayer::geometry::ViewInformation3D maViewInformation3D;
79 :
80 : // the object transformation
81 : basegfx::B2DHomMatrix maObjectTransformation;
82 :
83 : // attributes
84 : drawinglayer::attribute::SdrSceneAttribute maSdrSceneAttribute;
85 : drawinglayer::attribute::SdrLightingAttribute maSdrLightingAttribute;
86 :
87 : // create methods for ViewInformation3D and ObjectTransformation
88 : void createViewInformation3D(const ::basegfx::B3DRange& rContentRange);
89 : void createObjectTransformation();
90 :
91 : // attribute creators
92 : void createSdrSceneAttribute();
93 : void createSdrLightingAttribute();
94 :
95 : // This method is responsible for creating the graphical visualisation data
96 : // ONLY based on model data
97 : virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const SAL_OVERRIDE;
98 : };
99 :
100 : }}
101 :
102 : #endif // INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFE3DSCENE_HXX
103 :
104 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|