Adjust includes
[LibreOffice.git] / svx / source / engine3d / cube3d.cxx
blob4dfe5ba4ea12270083c24ce38e0aef559d22e326
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <svx/strings.hrc>
22 #include <svdglob.hxx>
23 #include <svx/cube3d.hxx>
24 #include <svx/globl3d.hxx>
25 #include <basegfx/point/b3dpoint.hxx>
26 #include <basegfx/polygon/b3dpolygon.hxx>
27 #include <sdr/contact/viewcontactofe3dcube.hxx>
30 // DrawContact section
32 sdr::contact::ViewContact* E3dCubeObj::CreateObjectSpecificViewContact()
34 return new sdr::contact::ViewContactOfE3dCube(*this);
38 E3dCubeObj::E3dCubeObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoint& aPos, const basegfx::B3DVector& r3DSize)
39 : E3dCompoundObject(rDefault)
41 // Set Defaults
42 SetDefaultAttributes(rDefault);
44 aCubePos = aPos; // position centre or left, bottom, back (dependent on bPosIsCenter)
45 aCubeSize = r3DSize;
48 E3dCubeObj::E3dCubeObj()
49 : E3dCompoundObject()
51 // Set Defaults
52 E3dDefaultAttributes aDefault;
53 SetDefaultAttributes(aDefault);
56 void E3dCubeObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault)
58 aCubePos = rDefault.GetDefaultCubePos();
59 aCubeSize = rDefault.GetDefaultCubeSize();
60 bPosIsCenter = rDefault.GetDefaultCubePosIsCenter();
63 sal_uInt16 E3dCubeObj::GetObjIdentifier() const
65 return E3D_CUBEOBJ_ID;
68 // Convert the object into a group object consisting of 6 polygons
70 SdrObject *E3dCubeObj::DoConvertToPolyObj(bool /*bBezier*/, bool /*bAddText*/) const
72 return nullptr;
75 E3dCubeObj* E3dCubeObj::Clone() const
77 return CloneHelper< E3dCubeObj >();
80 // Set local parameters with geometry re-creating
82 void E3dCubeObj::SetCubePos(const basegfx::B3DPoint& rNew)
84 if(aCubePos != rNew)
86 aCubePos = rNew;
87 ActionChanged();
91 void E3dCubeObj::SetCubeSize(const basegfx::B3DVector& rNew)
93 if(aCubeSize != rNew)
95 aCubeSize = rNew;
96 ActionChanged();
100 void E3dCubeObj::SetPosIsCenter(bool bNew)
102 if(bPosIsCenter != bNew)
104 bPosIsCenter = bNew;
105 ActionChanged();
109 // Get the name of the object (singular)
111 OUString E3dCubeObj::TakeObjNameSingul() const
113 OUStringBuffer sName(ImpGetResStr(STR_ObjNameSingulCube3d));
115 OUString aName(GetName());
116 if (!aName.isEmpty())
118 sName.append(' ');
119 sName.append('\'');
120 sName.append(aName);
121 sName.append('\'');
123 return sName.makeStringAndClear();
126 // Get the name of the object (plural)
128 OUString E3dCubeObj::TakeObjNamePlural() const
130 return ImpGetResStr(STR_ObjNamePluralCube3d);
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */