1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
5 * $RCSfile: baseprocessor3d.cxx,v $
9 * last change: $Author: aw $ $Date: 2008-06-24 15:31:09 $
11 * The Contents of this file are made available subject to
12 * the terms of GNU Lesser General Public License Version 2.1.
15 * GNU Lesser General Public License Version 2.1
16 * =============================================
17 * Copyright 2005 by Sun Microsystems, Inc.
18 * 901 San Antonio Road, Palo Alto, CA 94303, USA
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License version 2.1, as published by the Free Software Foundation.
24 * This library is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * Lesser General Public License for more details.
29 * You should have received a copy of the GNU Lesser General Public
30 * License along with this library; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
34 ************************************************************************/
36 // MARKER(update_precomp.py): autogen include statement, do not remove
37 #include "precompiled_drawinglayer.hxx"
39 #include <drawinglayer/processor3d/baseprocessor3d.hxx>
41 //////////////////////////////////////////////////////////////////////////////
43 using namespace com::sun::star
;
45 //////////////////////////////////////////////////////////////////////////////
47 namespace drawinglayer
51 void BaseProcessor3D::processBasePrimitive3D(const primitive3d::BasePrimitive3D
& /*rCandidate*/)
55 BaseProcessor3D::BaseProcessor3D(const geometry::ViewInformation3D
& rViewInformation
)
56 : maViewInformation3D(rViewInformation
)
60 BaseProcessor3D::~BaseProcessor3D()
64 void BaseProcessor3D::process(const primitive3d::Primitive3DSequence
& rSource
)
66 if(rSource
.hasElements())
68 const sal_Int32
nCount(rSource
.getLength());
70 for(sal_Int32
a(0L); a
< nCount
; a
++)
73 const primitive3d::Primitive3DReference
xReference(rSource
[a
]);
77 // try to cast to BasePrimitive3D implementation
78 const primitive3d::BasePrimitive3D
* pBasePrimitive
= dynamic_cast< const primitive3d::BasePrimitive3D
* >(xReference
.get());
82 processBasePrimitive3D(*pBasePrimitive
);
86 // unknown implementation, use UNO API call instead and process recursively
87 const uno::Sequence
< beans::PropertyValue
>& rViewParameters(getViewInformation3D().getViewInformationSequence());
88 process(xReference
->getDecomposition(rViewParameters
));
94 } // end of namespace processor3d
95 } // end of namespace drawinglayer
97 //////////////////////////////////////////////////////////////////////////////
99 namespace drawinglayer
101 namespace processor3d
103 CollectingProcessor3D::CollectingProcessor3D(const geometry::ViewInformation3D
& rViewInformation
)
104 : BaseProcessor3D(rViewInformation
),
105 maPrimitive3DSequence()
109 CollectingProcessor3D::~CollectingProcessor3D()
113 void CollectingProcessor3D::process(const primitive3d::Primitive3DSequence
& rSource
)
116 primitive3d::appendPrimitive3DSequenceToPrimitive3DSequence(maPrimitive3DSequence
, rSource
);
118 } // end of namespace processor3d
119 } // end of namespace drawinglayer
121 //////////////////////////////////////////////////////////////////////////////