1*f6e50924SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*f6e50924SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*f6e50924SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*f6e50924SAndrew Rist * distributed with this work for additional information 6*f6e50924SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*f6e50924SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*f6e50924SAndrew Rist * "License"); you may not use this file except in compliance 9*f6e50924SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*f6e50924SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*f6e50924SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*f6e50924SAndrew Rist * software distributed under the License is distributed on an 15*f6e50924SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*f6e50924SAndrew Rist * KIND, either express or implied. See the License for the 17*f6e50924SAndrew Rist * specific language governing permissions and limitations 18*f6e50924SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*f6e50924SAndrew Rist *************************************************************/ 21*f6e50924SAndrew Rist 22*f6e50924SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_svx.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "svx/svdstr.hrc" 28cdf0e10cSrcweir #include "svx/svdglob.hxx" 29cdf0e10cSrcweir #include <svx/cube3d.hxx> 30cdf0e10cSrcweir #include "svx/globl3d.hxx" 31cdf0e10cSrcweir #include <basegfx/point/b3dpoint.hxx> 32cdf0e10cSrcweir #include <basegfx/polygon/b3dpolygon.hxx> 33cdf0e10cSrcweir #include <svx/sdr/contact/viewcontactofe3dcube.hxx> 34cdf0e10cSrcweir 35cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 36cdf0e10cSrcweir // #110094# DrawContact section 37cdf0e10cSrcweir 38cdf0e10cSrcweir sdr::contact::ViewContact* E3dCubeObj::CreateObjectSpecificViewContact() 39cdf0e10cSrcweir { 40cdf0e10cSrcweir return new sdr::contact::ViewContactOfE3dCube(*this); 41cdf0e10cSrcweir } 42cdf0e10cSrcweir 43cdf0e10cSrcweir TYPEINIT1(E3dCubeObj, E3dCompoundObject); 44cdf0e10cSrcweir 45cdf0e10cSrcweir /************************************************************************* 46cdf0e10cSrcweir |* 47cdf0e10cSrcweir |* Konstruktor: | 48cdf0e10cSrcweir |* 3D-Quader erzeugen; aPos: Zentrum oder links, unten, hinten |__ 49cdf0e10cSrcweir |* (abhaengig von bPosIsCenter) / 50cdf0e10cSrcweir |* 51cdf0e10cSrcweir \************************************************************************/ 52cdf0e10cSrcweir 53cdf0e10cSrcweir E3dCubeObj::E3dCubeObj(E3dDefaultAttributes& rDefault, basegfx::B3DPoint aPos, const basegfx::B3DVector& r3DSize) 54cdf0e10cSrcweir : E3dCompoundObject(rDefault) 55cdf0e10cSrcweir { 56cdf0e10cSrcweir // Defaults setzen 57cdf0e10cSrcweir SetDefaultAttributes(rDefault); 58cdf0e10cSrcweir 59cdf0e10cSrcweir // uebergebene drueberbuegeln 60cdf0e10cSrcweir aCubePos = aPos; 61cdf0e10cSrcweir aCubeSize = r3DSize; 62cdf0e10cSrcweir } 63cdf0e10cSrcweir 64cdf0e10cSrcweir E3dCubeObj::E3dCubeObj() 65cdf0e10cSrcweir : E3dCompoundObject() 66cdf0e10cSrcweir { 67cdf0e10cSrcweir // Defaults setzen 68cdf0e10cSrcweir E3dDefaultAttributes aDefault; 69cdf0e10cSrcweir SetDefaultAttributes(aDefault); 70cdf0e10cSrcweir } 71cdf0e10cSrcweir 72cdf0e10cSrcweir void E3dCubeObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault) 73cdf0e10cSrcweir { 74cdf0e10cSrcweir aCubePos = rDefault.GetDefaultCubePos(); 75cdf0e10cSrcweir aCubeSize = rDefault.GetDefaultCubeSize(); 76cdf0e10cSrcweir nSideFlags = rDefault.GetDefaultCubeSideFlags(); 77cdf0e10cSrcweir bPosIsCenter = rDefault.GetDefaultCubePosIsCenter(); 78cdf0e10cSrcweir } 79cdf0e10cSrcweir 80cdf0e10cSrcweir /************************************************************************* 81cdf0e10cSrcweir |* 82cdf0e10cSrcweir |* Identifier zurueckgeben 83cdf0e10cSrcweir |* 84cdf0e10cSrcweir \************************************************************************/ 85cdf0e10cSrcweir 86cdf0e10cSrcweir sal_uInt16 E3dCubeObj::GetObjIdentifier() const 87cdf0e10cSrcweir { 88cdf0e10cSrcweir return E3D_CUBEOBJ_ID; 89cdf0e10cSrcweir } 90cdf0e10cSrcweir 91cdf0e10cSrcweir /************************************************************************* 92cdf0e10cSrcweir |* 93cdf0e10cSrcweir |* Wandle das Objekt in ein Gruppenobjekt bestehend aus 6 Polygonen 94cdf0e10cSrcweir |* 95cdf0e10cSrcweir \************************************************************************/ 96cdf0e10cSrcweir 97a5258243SPedro Giffuni SdrObject *E3dCubeObj::DoConvertToPolyObj(sal_Bool /*bBezier*/, bool /*bAddText*/) const 98cdf0e10cSrcweir { 99cdf0e10cSrcweir return NULL; 100cdf0e10cSrcweir } 101cdf0e10cSrcweir 102cdf0e10cSrcweir /************************************************************************* 103cdf0e10cSrcweir |* 104cdf0e10cSrcweir |* Zuweisungsoperator 105cdf0e10cSrcweir |* 106cdf0e10cSrcweir \************************************************************************/ 107cdf0e10cSrcweir 108cdf0e10cSrcweir void E3dCubeObj::operator=(const SdrObject& rObj) 109cdf0e10cSrcweir { 110cdf0e10cSrcweir // erstmal alle Childs kopieren 111cdf0e10cSrcweir E3dCompoundObject::operator=(rObj); 112cdf0e10cSrcweir 113cdf0e10cSrcweir // weitere Parameter kopieren 114cdf0e10cSrcweir const E3dCubeObj& r3DObj = (const E3dCubeObj&)rObj; 115cdf0e10cSrcweir 116cdf0e10cSrcweir aCubePos = r3DObj.aCubePos; 117cdf0e10cSrcweir aCubeSize = r3DObj.aCubeSize; 118cdf0e10cSrcweir bPosIsCenter = r3DObj.bPosIsCenter; 119cdf0e10cSrcweir nSideFlags = r3DObj.nSideFlags; 120cdf0e10cSrcweir } 121cdf0e10cSrcweir 122cdf0e10cSrcweir /************************************************************************* 123cdf0e10cSrcweir |* 124cdf0e10cSrcweir |* Lokale Parameter setzen mit Geometrieneuerzeugung 125cdf0e10cSrcweir |* 126cdf0e10cSrcweir \************************************************************************/ 127cdf0e10cSrcweir 128cdf0e10cSrcweir void E3dCubeObj::SetCubePos(const basegfx::B3DPoint& rNew) 129cdf0e10cSrcweir { 130cdf0e10cSrcweir if(aCubePos != rNew) 131cdf0e10cSrcweir { 132cdf0e10cSrcweir aCubePos = rNew; 133cdf0e10cSrcweir ActionChanged(); 134cdf0e10cSrcweir } 135cdf0e10cSrcweir } 136cdf0e10cSrcweir 137cdf0e10cSrcweir void E3dCubeObj::SetCubeSize(const basegfx::B3DVector& rNew) 138cdf0e10cSrcweir { 139cdf0e10cSrcweir if(aCubeSize != rNew) 140cdf0e10cSrcweir { 141cdf0e10cSrcweir aCubeSize = rNew; 142cdf0e10cSrcweir ActionChanged(); 143cdf0e10cSrcweir } 144cdf0e10cSrcweir } 145cdf0e10cSrcweir 146cdf0e10cSrcweir void E3dCubeObj::SetPosIsCenter(sal_Bool bNew) 147cdf0e10cSrcweir { 148cdf0e10cSrcweir if(bPosIsCenter != bNew) 149cdf0e10cSrcweir { 150cdf0e10cSrcweir bPosIsCenter = bNew; 151cdf0e10cSrcweir ActionChanged(); 152cdf0e10cSrcweir } 153cdf0e10cSrcweir } 154cdf0e10cSrcweir 155cdf0e10cSrcweir void E3dCubeObj::SetSideFlags(sal_uInt16 nNew) 156cdf0e10cSrcweir { 157cdf0e10cSrcweir if(nSideFlags != nNew) 158cdf0e10cSrcweir { 159cdf0e10cSrcweir nSideFlags = nNew; 160cdf0e10cSrcweir ActionChanged(); 161cdf0e10cSrcweir } 162cdf0e10cSrcweir } 163cdf0e10cSrcweir 164cdf0e10cSrcweir /************************************************************************* 165cdf0e10cSrcweir |* 166cdf0e10cSrcweir |* Get the name of the object (singular) 167cdf0e10cSrcweir |* 168cdf0e10cSrcweir \************************************************************************/ 169cdf0e10cSrcweir 170cdf0e10cSrcweir void E3dCubeObj::TakeObjNameSingul(XubString& rName) const 171cdf0e10cSrcweir { 172cdf0e10cSrcweir rName=ImpGetResStr(STR_ObjNameSingulCube3d); 173cdf0e10cSrcweir 174cdf0e10cSrcweir String aName( GetName() ); 175cdf0e10cSrcweir if(aName.Len()) 176cdf0e10cSrcweir { 177cdf0e10cSrcweir rName += sal_Unicode(' '); 178cdf0e10cSrcweir rName += sal_Unicode('\''); 179cdf0e10cSrcweir rName += aName; 180cdf0e10cSrcweir rName += sal_Unicode('\''); 181cdf0e10cSrcweir } 182cdf0e10cSrcweir } 183cdf0e10cSrcweir 184cdf0e10cSrcweir /************************************************************************* 185cdf0e10cSrcweir |* 186cdf0e10cSrcweir |* Get the name of the object (plural) 187cdf0e10cSrcweir |* 188cdf0e10cSrcweir \************************************************************************/ 189cdf0e10cSrcweir 190cdf0e10cSrcweir void E3dCubeObj::TakeObjNamePlural(XubString& rName) const 191cdf0e10cSrcweir { 192cdf0e10cSrcweir rName=ImpGetResStr(STR_ObjNamePluralCube3d); 193cdf0e10cSrcweir } 194cdf0e10cSrcweir 195cdf0e10cSrcweir // eof 196