Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <drawinglayer/processor3d/baseprocessor3d.hxx>
30 : :
31 : : //////////////////////////////////////////////////////////////////////////////
32 : :
33 : : using namespace com::sun::star;
34 : :
35 : : //////////////////////////////////////////////////////////////////////////////
36 : :
37 : : namespace drawinglayer
38 : : {
39 : : namespace processor3d
40 : : {
41 : 0 : void BaseProcessor3D::processBasePrimitive3D(const primitive3d::BasePrimitive3D& /*rCandidate*/)
42 : : {
43 : 0 : }
44 : :
45 : 30 : BaseProcessor3D::BaseProcessor3D(const geometry::ViewInformation3D& rViewInformation)
46 : 30 : : maViewInformation3D(rViewInformation)
47 : : {
48 : 30 : }
49 : :
50 : 30 : BaseProcessor3D::~BaseProcessor3D()
51 : : {
52 [ - + ]: 30 : }
53 : :
54 : 1660 : void BaseProcessor3D::process(const primitive3d::Primitive3DSequence& rSource)
55 : : {
56 [ + + ]: 1660 : if(rSource.hasElements())
57 : : {
58 : 1548 : const sal_Int32 nCount(rSource.getLength());
59 : :
60 [ + + ]: 5188 : for(sal_Int32 a(0L); a < nCount; a++)
61 : : {
62 : : // get reference
63 : 3640 : const primitive3d::Primitive3DReference xReference(rSource[a]);
64 : :
65 [ + - ]: 3640 : if(xReference.is())
66 : : {
67 : : // try to cast to BasePrimitive3D implementation
68 [ + - ][ - + ]: 3640 : const primitive3d::BasePrimitive3D* pBasePrimitive = dynamic_cast< const primitive3d::BasePrimitive3D* >(xReference.get());
69 : :
70 [ + - ]: 3640 : if(pBasePrimitive)
71 : : {
72 [ + - ]: 3640 : processBasePrimitive3D(*pBasePrimitive);
73 : : }
74 : : else
75 : : {
76 : : // unknown implementation, use UNO API call instead and process recursively
77 [ # # ]: 0 : const uno::Sequence< beans::PropertyValue >& rViewParameters(getViewInformation3D().getViewInformationSequence());
78 [ # # ][ # # ]: 0 : process(xReference->getDecomposition(rViewParameters));
[ # # ][ # # ]
79 : : }
80 : : }
81 : 3640 : }
82 : : }
83 : 1660 : }
84 : : } // end of namespace processor3d
85 : : } // end of namespace drawinglayer
86 : :
87 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|