xref: /AOO41X/main/drawinglayer/source/primitive3d/polypolygonprimitive3d.cxx (revision 464702f4578bd67db020a330afd07883930c5e07)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_drawinglayer.hxx"
26 
27 #include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
28 #include <basegfx/polygon/b3dpolypolygontools.hxx>
29 #include <basegfx/tools/canvastools.hxx>
30 #include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
31 
32 //////////////////////////////////////////////////////////////////////////////
33 
34 using namespace com::sun::star;
35 
36 //////////////////////////////////////////////////////////////////////////////
37 
38 namespace drawinglayer
39 {
40     namespace primitive3d
41     {
PolyPolygonMaterialPrimitive3D(const basegfx::B3DPolyPolygon & rPolyPolygon,const attribute::MaterialAttribute3D & rMaterial,bool bDoubleSided)42         PolyPolygonMaterialPrimitive3D::PolyPolygonMaterialPrimitive3D(
43             const basegfx::B3DPolyPolygon& rPolyPolygon,
44             const attribute::MaterialAttribute3D& rMaterial,
45             bool bDoubleSided)
46         :   BasePrimitive3D(),
47             maPolyPolygon(rPolyPolygon),
48             maMaterial(rMaterial),
49             mbDoubleSided(bDoubleSided)
50         {
51         }
52 
operator ==(const BasePrimitive3D & rPrimitive) const53         bool PolyPolygonMaterialPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
54         {
55             if(BasePrimitive3D::operator==(rPrimitive))
56             {
57                 const PolyPolygonMaterialPrimitive3D& rCompare = (PolyPolygonMaterialPrimitive3D&)rPrimitive;
58 
59                 return (getB3DPolyPolygon() == rCompare.getB3DPolyPolygon()
60                     && getMaterial() == rCompare.getMaterial()
61                     && getDoubleSided() == rCompare.getDoubleSided());
62             }
63 
64             return false;
65         }
66 
getB3DRange(const geometry::ViewInformation3D &) const67         basegfx::B3DRange PolyPolygonMaterialPrimitive3D::getB3DRange(const geometry::ViewInformation3D& /*rViewInformation*/) const
68         {
69             return basegfx::tools::getRange(getB3DPolyPolygon());
70         }
71 
72         // provide unique ID
73         ImplPrimitrive3DIDBlock(PolyPolygonMaterialPrimitive3D, PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D)
74 
75     } // end of namespace primitive3d
76 } // end of namespace drawinglayer
77 
78 //////////////////////////////////////////////////////////////////////////////
79 // eof
80