Files
libreoffice/drawinglayer/source/primitive3d/polypolygonprimitive3d.cxx

70 lines
2.6 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
2006-05-12 10:54:47 +00:00
#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
#include <basegfx/polygon/b3dpolypolygontools.hxx>
#include <basegfx/utils/canvastools.hxx>
2007-03-06 11:36:13 +00:00
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
2006-10-19 09:40:02 +00:00
using namespace com::sun::star;
2006-05-12 10:54:47 +00:00
namespace drawinglayer
{
2006-08-09 15:51:16 +00:00
namespace primitive3d
2006-05-12 10:54:47 +00:00
{
2006-10-19 09:40:02 +00:00
PolyPolygonMaterialPrimitive3D::PolyPolygonMaterialPrimitive3D(
2006-08-09 15:51:16 +00:00
const basegfx::B3DPolyPolygon& rPolyPolygon,
2006-10-19 09:40:02 +00:00
const attribute::MaterialAttribute3D& rMaterial,
2006-08-09 15:51:16 +00:00
bool bDoubleSided)
2006-10-19 09:40:02 +00:00
: BasePrimitive3D(),
2006-08-09 15:51:16 +00:00
maPolyPolygon(rPolyPolygon),
2006-05-12 10:54:47 +00:00
maMaterial(rMaterial),
mbDoubleSided(bDoubleSided)
{
}
2006-10-19 09:40:02 +00:00
bool PolyPolygonMaterialPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
2006-05-12 10:54:47 +00:00
{
2006-10-19 09:40:02 +00:00
if(BasePrimitive3D::operator==(rPrimitive))
2006-05-12 10:54:47 +00:00
{
const PolyPolygonMaterialPrimitive3D& rCompare = static_cast<const PolyPolygonMaterialPrimitive3D&>(rPrimitive);
2006-05-12 10:54:47 +00:00
2006-10-19 09:40:02 +00:00
return (getB3DPolyPolygon() == rCompare.getB3DPolyPolygon()
&& getMaterial() == rCompare.getMaterial()
&& getDoubleSided() == rCompare.getDoubleSided());
2006-05-12 10:54:47 +00:00
}
return false;
}
basegfx::B3DRange PolyPolygonMaterialPrimitive3D::getB3DRange(const geometry::ViewInformation3D& /*rViewInformation*/) const
2006-05-12 10:54:47 +00:00
{
return basegfx::utils::getRange(getB3DPolyPolygon());
2006-05-12 10:54:47 +00:00
}
// provide unique ID
ImplPrimitive3DIDBlock(PolyPolygonMaterialPrimitive3D, PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D)
2006-08-09 15:51:16 +00:00
} // end of namespace primitive3d
2006-05-12 10:54:47 +00:00
} // end of namespace drawinglayer
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */