LibreOffice Module svx (master)  1
e3dcompoundproperties.cxx
Go to the documentation of this file.
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 
21 #include <svl/itemset.hxx>
22 #include <svx/obj3d.hxx>
23 #include <svx/scene3d.hxx>
24 
25 
26 namespace sdr
27 {
28  namespace properties
29  {
31  : E3dProperties(rObj)
32  {
33  }
34 
36  : E3dProperties(rProps, rObj)
37  {
38  }
39 
41  {
42  }
43 
44  std::unique_ptr<BaseProperties> E3dCompoundProperties::Clone(SdrObject& rObj) const
45  {
46  return std::unique_ptr<BaseProperties>(new E3dCompoundProperties(*this, rObj));
47  }
48 
50  {
51  // include Items of scene this object belongs to
52  const E3dCompoundObject& rObj = static_cast<const E3dCompoundObject&>(GetSdrObject());
53  E3dScene* pScene(rObj.getRootE3dSceneFromE3dObject());
54 
55  if(nullptr != pScene)
56  {
57  // force ItemSet
59 
60  // add filtered scene properties (SDRATTR_3DSCENE_) to local itemset
62  aSet.Put(pScene->GetProperties().GetObjectItemSet());
63  mpItemSet->Put(aSet);
64  }
65 
66  // call parent
68  }
69 
70  void E3dCompoundProperties::SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems)
71  {
72  // Set scene specific items at scene
73  E3dCompoundObject& rObj = static_cast<E3dCompoundObject&>(GetSdrObject());
74  E3dScene* pScene(rObj.getRootE3dSceneFromE3dObject());
75 
76  if(nullptr != pScene)
77  {
78  // force ItemSet
80 
81  // Generate filtered scene properties (SDRATTR_3DSCENE_) itemset
83  aSet.Put(rSet);
84 
85  if(bClearAllItems)
86  {
87  pScene->GetProperties().ClearObjectItem();
88  }
89 
90  if(aSet.Count())
91  {
92  pScene->GetProperties().SetObjectItemSet(aSet);
93  }
94  }
95 
96  // call parent. This will set items on local object, too.
97  E3dProperties::SetMergedItemSet(rSet, bClearAllItems);
98  }
99 
100  void E3dCompoundProperties::PostItemChange(const sal_uInt16 nWhich)
101  {
102  // call parent
104 
105  // handle value change
106  E3dCompoundObject& rObj = static_cast<E3dCompoundObject&>(GetSdrObject());
107 
108  switch(nWhich)
109  {
110  // #i28528#
111  // Added extra Item (Bool) for chart2 to be able to show reduced line geometry
113  {
114  rObj.ActionChanged();
115  break;
116  }
118  {
119  rObj.ActionChanged();
120  break;
121  }
123  {
124  rObj.ActionChanged();
125  break;
126  }
128  {
129  rObj.ActionChanged();
130  break;
131  }
133  {
134  rObj.ActionChanged();
135  break;
136  }
138  {
139  rObj.ActionChanged();
140  break;
141  }
142  }
143  }
144  } // end of namespace properties
145 } // end of namespace sdr
146 
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define SDRATTR_3DOBJ_NORMALS_KIND
Definition: svddef.hxx:330
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
virtual void PostItemChange(const sal_uInt16 nWhich) override
#define SDRATTR_3DOBJ_DOUBLE_SIDED
Definition: svddef.hxx:329
virtual const SfxItemSet & GetObjectItemSet() const override
std::unique_ptr< SfxItemSet > mpItemSet
virtual const SfxItemSet & GetMergedItemSet() const
Definition: properties.cxx:72
virtual void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: properties.cxx:78
virtual const SfxItemSet & GetMergedItemSet() const override
virtual void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false) override
#define SDRATTR_3DOBJ_NORMALS_INVERT
Definition: svddef.hxx:331
#define SDRATTR_3DOBJ_TEXTURE_PROJ_Y
Definition: svddef.hxx:333
void ActionChanged() const
Definition: svdobj.cxx:283
#define SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY
Definition: svddef.hxx:353
Abstract DrawObject.
Definition: svdobj.hxx:312
#define SDRATTR_3DOBJ_TEXTURE_PROJ_X
Definition: svddef.hxx:332
virtual void PostItemChange(const sal_uInt16 nWhich) override
const SdrObject & GetSdrObject() const
Definition: properties.cxx:62
virtual E3dScene * getRootE3dSceneFromE3dObject() const
Definition: obj3d.cxx:287