fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / svx / source / engine3d / cube3d.cxx
blob4677662f7539f4a5d63e1e6938a4a723e0a2c016
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/svdstr.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);
37 TYPEINIT1(E3dCubeObj, E3dCompoundObject);
39 E3dCubeObj::E3dCubeObj(E3dDefaultAttributes& rDefault, basegfx::B3DPoint aPos, const basegfx::B3DVector& r3DSize)
40 : E3dCompoundObject(rDefault)
42 // Set Defaults
43 SetDefaultAttributes(rDefault);
45 aCubePos = aPos; // position centre or left, bottom, back (dependent on bPosIsCenter)
46 aCubeSize = r3DSize;
49 E3dCubeObj::E3dCubeObj()
50 : E3dCompoundObject()
52 // Set Defaults
53 E3dDefaultAttributes aDefault;
54 SetDefaultAttributes(aDefault);
57 void E3dCubeObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault)
59 aCubePos = rDefault.GetDefaultCubePos();
60 aCubeSize = rDefault.GetDefaultCubeSize();
61 nSideFlags = rDefault.GetDefaultCubeSideFlags();
62 bPosIsCenter = rDefault.GetDefaultCubePosIsCenter();
65 sal_uInt16 E3dCubeObj::GetObjIdentifier() const
67 return E3D_CUBEOBJ_ID;
70 // Convert the object into a group object consisting of 6 polygons
72 SdrObject *E3dCubeObj::DoConvertToPolyObj(bool /*bBezier*/, bool /*bAddText*/) const
74 return NULL;
77 E3dCubeObj* E3dCubeObj::Clone() const
79 return CloneHelper< E3dCubeObj >();
82 // Set local parameters with geometry re-creating
84 void E3dCubeObj::SetCubePos(const basegfx::B3DPoint& rNew)
86 if(aCubePos != rNew)
88 aCubePos = rNew;
89 ActionChanged();
93 void E3dCubeObj::SetCubeSize(const basegfx::B3DVector& rNew)
95 if(aCubeSize != rNew)
97 aCubeSize = rNew;
98 ActionChanged();
102 void E3dCubeObj::SetPosIsCenter(bool bNew)
104 if(bPosIsCenter != bNew)
106 bPosIsCenter = bNew;
107 ActionChanged();
111 // Get the name of the object (singular)
113 OUString E3dCubeObj::TakeObjNameSingul() const
115 OUStringBuffer sName(ImpGetResStr(STR_ObjNameSingulCube3d));
117 OUString aName(GetName());
118 if (!aName.isEmpty())
120 sName.append(' ');
121 sName.append('\'');
122 sName.append(aName);
123 sName.append('\'');
125 return sName.makeStringAndClear();
128 // Get the name of the object (plural)
130 OUString E3dCubeObj::TakeObjNamePlural() const
132 return ImpGetResStr(STR_ObjNamePluralCube3d);
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */