1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: objfac3d.cxx,v $
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 /*************************************************************************
48 \************************************************************************/
50 static BOOL bInit
= FALSE
;
52 E3dObjFactory::E3dObjFactory()
56 SdrObjFactory::InsertMakeObjectHdl(LINK(this, E3dObjFactory
, MakeObject
));
61 /*************************************************************************
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();
86 case E3D_POLYGONOBJ_ID
:
87 pObjFactory
->pNewObj
= new E3dPolygonObj();
90 pObjFactory
->pNewObj
= new E3dCubeObj();
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);
99 case E3D_EXTRUDEOBJ_ID
:
100 pObjFactory
->pNewObj
= new E3dExtrudeObj();
102 case E3D_LATHEOBJ_ID
:
103 pObjFactory
->pNewObj
= new E3dLatheObj();
105 case E3D_COMPOUNDOBJ_ID
:
106 pObjFactory
->pNewObj
= new E3dCompoundObject();