Update ooo320-m1
[ooovba.git] / svx / source / engine3d / objfac3d.cxx
blob70b46cf4f85bcd275042a9270151fceebd32a8ea
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: objfac3d.cxx,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
33 #include <svx/svdpage.hxx>
34 #include "globl3d.hxx"
35 #include <svx/polysc3d.hxx>
36 #include <svx/cube3d.hxx>
37 #include <svx/sphere3d.hxx>
38 #include <svx/extrud3d.hxx>
39 #include <svx/lathe3d.hxx>
40 #include <svx/polygn3d.hxx>
41 #include "objfac3d.hxx"
42 #include <svx/svdobj.hxx>
44 /*************************************************************************
46 |* Konstruktor
48 \************************************************************************/
50 static BOOL bInit = FALSE;
52 E3dObjFactory::E3dObjFactory()
54 if ( !bInit )
56 SdrObjFactory::InsertMakeObjectHdl(LINK(this, E3dObjFactory, MakeObject));
57 bInit = TRUE;
61 /*************************************************************************
63 |* Destruktor
65 \************************************************************************/
67 E3dObjFactory::~E3dObjFactory()
71 /*************************************************************************
73 |* Chart-interne Objekte erzeugen
75 \************************************************************************/
77 IMPL_LINK( E3dObjFactory, MakeObject, SdrObjFactory*, pObjFactory)
79 if ( pObjFactory->nInventor == E3dInventor )
81 switch ( pObjFactory->nIdentifier )
83 case E3D_POLYSCENE_ID:
84 pObjFactory->pNewObj = new E3dPolyScene();
85 break;
86 case E3D_POLYGONOBJ_ID :
87 pObjFactory->pNewObj = new E3dPolygonObj();
88 break;
89 case E3D_CUBEOBJ_ID :
90 pObjFactory->pNewObj = new E3dCubeObj();
91 break;
92 case E3D_SPHEREOBJ_ID:
93 // FG: ruft den dummy constructor, da dieser Aufruf nur beim Laden von Dokumenten erfolgt.
94 // die wirkliche Anzahkl Segmente wird aber erst nach dem Laden der Member festgelegt.
95 // dies hat zur Folge das die erste Kugel gleich wieder zerstoert wird, obwohl sie nie
96 // gebraucht worden ist.
97 pObjFactory->pNewObj = new E3dSphereObj(123);
98 break;
99 case E3D_EXTRUDEOBJ_ID:
100 pObjFactory->pNewObj = new E3dExtrudeObj();
101 break;
102 case E3D_LATHEOBJ_ID:
103 pObjFactory->pNewObj = new E3dLatheObj();
104 break;
105 case E3D_COMPOUNDOBJ_ID:
106 pObjFactory->pNewObj = new E3dCompoundObject();
107 break;
110 return 0;