Version 7.1.7.1, tag libreoffice-7.1.7.1
[LibreOffice.git] / svx / source / engine3d / objfac3d.cxx
blobdb626f6494633ca585c028113749c37c8daef7e1
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 .
20 #include <svx/svdobjkind.hxx>
21 #include <svx/cube3d.hxx>
22 #include <svx/sphere3d.hxx>
23 #include <extrud3d.hxx>
24 #include <svx/lathe3d.hxx>
25 #include <polygn3d.hxx>
26 #include <svx/objfac3d.hxx>
27 #include <svx/svdobj.hxx>
28 #include <svx/scene3d.hxx>
30 static bool bInit = false;
32 E3dObjFactory::E3dObjFactory()
34 if ( !bInit )
36 SdrObjFactory::InsertMakeObjectHdl(LINK(this, E3dObjFactory, MakeObject));
37 bInit = true;
41 E3dObjFactory::~E3dObjFactory()
45 // Generate chart internal objects
47 IMPL_STATIC_LINK( E3dObjFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* )
49 if ( aParams.nInventor == SdrInventor::E3d )
51 switch ( aParams.nObjIdentifier )
53 case E3D_SCENE_ID:
54 return new E3dScene(aParams.rSdrModel);
55 case E3D_POLYGONOBJ_ID :
56 return new E3dPolygonObj(aParams.rSdrModel);
57 case E3D_CUBEOBJ_ID :
58 return new E3dCubeObj(aParams.rSdrModel);
59 case E3D_SPHEREOBJ_ID:
60 return new E3dSphereObj(aParams.rSdrModel);
61 case E3D_EXTRUDEOBJ_ID:
62 return new E3dExtrudeObj(aParams.rSdrModel);
63 case E3D_LATHEOBJ_ID:
64 return new E3dLatheObj(aParams.rSdrModel);
65 case E3D_COMPOUNDOBJ_ID:
66 return new E3dCompoundObject(aParams.rSdrModel);
67 default:
68 break;
71 return nullptr;
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */