LibreOffice Module svx (master)  1
cube3d.hxx
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 
20 #ifndef INCLUDED_SVX_CUBE3D_HXX
21 #define INCLUDED_SVX_CUBE3D_HXX
22 
25 #include <rtl/ustring.hxx>
26 #include <sal/types.h>
27 #include <svx/obj3d.hxx>
28 #include <svx/svxdllapi.h>
29 
30 namespace sdr { namespace contact { class ViewContact; } }
31 
32 class E3dDefaultAttributes;
33 
34 /*************************************************************************
35 |*
36 |* |
37 |* Create a 3D cuboid; aPos: Center or left, bottom, behind |__
38 |* (depending on bPosIsCenter) /
39 |* nSideFlags indicates, if only some of the cuboid surfaces can
40 |* be created; the corresponding bits are defined in the enum.
41 |* The flag bDblSided indicates whether the created surfaces are
42 |* two-sided (which only makes sense if not all of the surfaces were
43 |* created).
44 |*
45 \************************************************************************/
46 
48 {
49  // Parameter
52 
53  // BOOLeans
54  bool bPosIsCenter : 1;
55 
56  void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
57  virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
58 
59 private:
60  // protected destructor - due to final, make private
61  virtual ~E3dCubeObj() override;
62 
63 public:
64  E3dCubeObj(SdrModel& rSdrModel,
65  const E3dDefaultAttributes& rDefault,
66  const basegfx::B3DPoint& aPos,
67  const basegfx::B3DVector& r3DSize);
68  E3dCubeObj(SdrModel& rSdrModel);
69 
70  virtual sal_uInt16 GetObjIdentifier() const override;
71  virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
72 
73  virtual E3dCubeObj* CloneSdrObject(SdrModel& rTargetModel) const override;
74 
75  // implemented mainly for the purposes of Clone()
76  E3dCubeObj& operator=(const E3dCubeObj& rObj);
77 
78  // Set local parameters with geometry recreation
79  void SetCubePos(const basegfx::B3DPoint& rNew);
80  const basegfx::B3DPoint& GetCubePos() const { return aCubePos; }
81 
82  void SetCubeSize(const basegfx::B3DVector& rNew);
83  const basegfx::B3DVector& GetCubeSize() const { return aCubeSize; }
84 
85  void SetPosIsCenter(bool bNew);
86  bool GetPosIsCenter() const { return bPosIsCenter; }
87 
88  // TakeObjName...() is for the display in the UI, for example "3 frames selected".
89  virtual OUString TakeObjNameSingul() const override;
90  virtual OUString TakeObjNamePlural() const override;
91 };
92 
93 #endif // INCLUDED_SVX_CUBE3D_HXX
94 
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString TakeObjNameSingul() const override
Definition: obj3d.cxx:361
virtual sal_uInt16 GetObjIdentifier() const override
Definition: obj3d.cxx:544
basegfx::B3DVector aCubeSize
Definition: cube3d.hxx:51
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const
Definition: svdobj.cxx:2524
const basegfx::B3DPoint & GetCubePos() const
Definition: cube3d.hxx:80
const basegfx::B3DVector & GetCubeSize() const
Definition: cube3d.hxx:83
E3dCompoundObject & operator=(const E3dCompoundObject &rObj)
Definition: obj3d.cxx:597
bool GetPosIsCenter() const
Definition: cube3d.hxx:86
#define SAL_WARN_UNUSED
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact()
Definition: svdobj.cxx:239
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
basegfx::B3DPoint aCubePos
Definition: cube3d.hxx:50
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
Definition: svdobj.hxx:114
virtual E3dCompoundObject * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: obj3d.cxx:592
virtual OUString TakeObjNamePlural() const override
Definition: obj3d.cxx:377