diff options
Diffstat (limited to 'drawinglayer/source/primitive3d')
12 files changed, 270 insertions, 223 deletions
diff --git a/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx b/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx new file mode 100644 index 000000000000..e94eeb99f764 --- /dev/null +++ b/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: hittestprimitive3d.cxx,v $ + * + * $Revision: 1.1.2.1 $ + * + * last change: $Author: aw $ $Date: 2008/09/25 17:12:14 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_drawinglayer.hxx" + +#include <drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx> +#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx> + +////////////////////////////////////////////////////////////////////////////// + +using namespace com::sun::star; + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive3d + { + HiddenGeometryPrimitive3D::HiddenGeometryPrimitive3D( + const Primitive3DSequence& rChildren) + : GroupPrimitive3D(rChildren) + { + } + + basegfx::B3DRange HiddenGeometryPrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const + { + return getB3DRangeFromPrimitive3DSequence(getChildren(), rViewInformation); + } + + Primitive3DSequence HiddenGeometryPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + { + // return empty sequence + return Primitive3DSequence(); + } + + // provide unique ID + ImplPrimitrive3DIDBlock(HiddenGeometryPrimitive3D, PRIMITIVE3D_ID_HIDDENGEOMETRYPRIMITIVE3D) + + } // end of namespace primitive3d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/primitive3d/hittestprimitive3d.cxx b/drawinglayer/source/primitive3d/hittestprimitive3d.cxx deleted file mode 100644 index 5c6d9b6008ae..000000000000 --- a/drawinglayer/source/primitive3d/hittestprimitive3d.cxx +++ /dev/null @@ -1,68 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_drawinglayer.hxx" - -#include <drawinglayer/primitive3d/hittestprimitive3d.hxx> -#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx> - -////////////////////////////////////////////////////////////////////////////// - -using namespace com::sun::star; - -////////////////////////////////////////////////////////////////////////////// - -namespace drawinglayer -{ - namespace primitive3d - { - HitTestPrimitive3D::HitTestPrimitive3D( - const Primitive3DSequence& rChildren) - : GroupPrimitive3D(rChildren) - { - } - - basegfx::B3DRange HitTestPrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const - { - return getB3DRangeFromPrimitive3DSequence(getChildren(), rViewInformation); - } - - Primitive3DSequence HitTestPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const - { - // return empty sequence - return Primitive3DSequence(); - } - - // provide unique ID - ImplPrimitrive3DIDBlock(HitTestPrimitive3D, PRIMITIVE3D_ID_HITTESTPRIMITIVE3D) - - } // end of namespace primitive3d -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// -// eof diff --git a/drawinglayer/source/primitive3d/makefile.mk b/drawinglayer/source/primitive3d/makefile.mk index dfae99b81066..afad990c0e28 100644 --- a/drawinglayer/source/primitive3d/makefile.mk +++ b/drawinglayer/source/primitive3d/makefile.mk @@ -40,7 +40,7 @@ SLOFILES= \ $(SLO)$/baseprimitive3d.obj \ $(SLO)$/groupprimitive3d.obj \ $(SLO)$/hatchtextureprimitive3d.obj \ - $(SLO)$/hittestprimitive3d.obj \ + $(SLO)$/hiddengeometryprimitive3d.obj \ $(SLO)$/modifiedcolorprimitive3d.obj \ $(SLO)$/polypolygonprimitive3d.obj \ $(SLO)$/polygonprimitive3d.obj \ diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx index 7bad5e0c97f7..7b5f183575b2 100644 --- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx @@ -57,7 +57,7 @@ namespace drawinglayer // may exclusively change static data, use mutex ::osl::Mutex m_mutex; - if(nSegments != nLineTubeSegments || rMaterial != aLineMaterial) + if(nSegments != nLineTubeSegments || !(rMaterial == aLineMaterial)) { nLineTubeSegments = nSegments; aLineMaterial = rMaterial; @@ -118,7 +118,7 @@ namespace drawinglayer // may exclusively change static data, use mutex ::osl::Mutex m_mutex; - if(nSegments != nLineCapSegments || rMaterial != aLineMaterial) + if(nSegments != nLineCapSegments || !(rMaterial == aLineMaterial)) { nLineCapSegments = nSegments; aLineMaterial = rMaterial; diff --git a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx index 4be87617b825..6dcea7b0d759 100644 --- a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx @@ -35,8 +35,9 @@ #include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx> #include <basegfx/tools/canvastools.hxx> #include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx> -#include <drawinglayer/primitive3d/hittestprimitive3d.hxx> -#include <drawinglayer/attribute/sdrattribute.hxx> +#include <drawinglayer/attribute/sdrfillattribute.hxx> +#include <drawinglayer/attribute/sdrlineattribute.hxx> +#include <drawinglayer/attribute/sdrshadowattribute.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -55,7 +56,7 @@ namespace drawinglayer basegfx::B3DPolyPolygon aFill(basegfx::tools::createCubeFillPolyPolygonFromB3DRange(aUnitRange)); // normal creation - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { if(::com::sun::star::drawing::NormalsKind_SPECIFIC == getSdr3DObjectAttribute().getNormalsKind() || ::com::sun::star::drawing::NormalsKind_SPHERE == getSdr3DObjectAttribute().getNormalsKind()) @@ -73,7 +74,7 @@ namespace drawinglayer } // texture coordinates - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { // handle texture coordinates X const bool bParallelX(::com::sun::star::drawing::TextureProjectionMode_PARALLEL == getSdr3DObjectAttribute().getTextureProjectionX()); @@ -145,7 +146,7 @@ namespace drawinglayer a3DPolyPolygonVector.push_back(basegfx::B3DPolyPolygon(aFill.getB3DPolygon(a))); } - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { // add fill aRetval = create3DPolyPolygonFillPrimitives( @@ -153,39 +154,33 @@ namespace drawinglayer getTransform(), getTextureSize(), getSdr3DObjectAttribute(), - *getSdrLFSAttribute().getFill(), + getSdrLFSAttribute().getFill(), getSdrLFSAttribute().getFillFloatTransGradient()); } else { // create simplified 3d hit test geometry - const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0); - - aRetval = create3DPolyPolygonFillPrimitives( + aRetval = createHiddenGeometryPrimitives3D( a3DPolyPolygonVector, getTransform(), getTextureSize(), - getSdr3DObjectAttribute(), - aSimplifiedFillAttribute, - 0); - - // encapsulate in HitTestPrimitive3D and add - const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval)); - aRetval = Primitive3DSequence(&xRef, 1L); + getSdr3DObjectAttribute()); } // add line - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { basegfx::B3DPolyPolygon aLine(basegfx::tools::createCubePolyPolygonFromB3DRange(aUnitRange)); - const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aLine, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives( + aLine, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines); } // add shadow - if(getSdrLFSAttribute().getShadow() && aRetval.hasElements()) + if(!getSdrLFSAttribute().getShadow().isDefault() && aRetval.hasElements()) { - const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); + const Primitive3DSequence aShadow(createShadowPrimitive3D( + aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow); } @@ -195,7 +190,7 @@ namespace drawinglayer SdrCubePrimitive3D::SdrCubePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute) : SdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute) { diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx index b6badf9d1f18..471d18ed846e 100644 --- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx +++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx @@ -31,14 +31,11 @@ #include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx> #include <basegfx/polygon/b3dpolygon.hxx> #include <drawinglayer/attribute/strokeattribute.hxx> -#include <drawinglayer/attribute/sdrattribute.hxx> #include <drawinglayer/primitive3d/baseprimitive3d.hxx> #include <drawinglayer/primitive3d/polygonprimitive3d.hxx> #include <basegfx/polygon/b3dpolypolygon.hxx> #include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx> -#include <drawinglayer/attribute/sdrattribute.hxx> #include <vcl/vclenum.hxx> -#include <drawinglayer/attribute/fillattribute.hxx> #include <drawinglayer/attribute/fillbitmapattribute.hxx> #include <drawinglayer/attribute/sdrfillbitmapattribute.hxx> #include <vcl/bmpacc.hxx> @@ -47,8 +44,12 @@ #include <drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx> #include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx> #include <drawinglayer/primitive3d/shadowprimitive3d.hxx> -#include <drawinglayer/attribute/sdrattribute3d.hxx> #include <basegfx/range/b2drange.hxx> +#include <drawinglayer/attribute/sdrlineattribute.hxx> +#include <drawinglayer/attribute/sdrobjectattribute3d.hxx> +#include <drawinglayer/attribute/sdrfillattribute.hxx> +#include <drawinglayer/attribute/sdrshadowattribute.hxx> +#include <drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -167,8 +168,8 @@ namespace drawinglayer if(0.0 != rLine.getTransparence()) { - // create UnifiedAlphaTexturePrimitive3D, add created primitives and exchange - const Primitive3DReference xRef(new UnifiedAlphaTexturePrimitive3D(rLine.getTransparence(), aRetval)); + // create UnifiedTransparenceTexturePrimitive3D, add created primitives and exchange + const Primitive3DReference xRef(new UnifiedTransparenceTexturePrimitive3D(rLine.getTransparence(), aRetval)); aRetval = Primitive3DSequence(&xRef, 1L); } @@ -181,7 +182,7 @@ namespace drawinglayer const basegfx::B2DVector& rTextureSize, const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute, const attribute::SdrFillAttribute& rFill, - const attribute::FillGradientAttribute* pFillGradient) + const attribute::FillGradientAttribute& rFillGradient) { Primitive3DSequence aRetval; @@ -209,27 +210,45 @@ namespace drawinglayer } // look for and evtl. build texture sub-group primitive - if(rFill.isGradient() || rFill.isHatch() || rFill.isBitmap()) + if(!rFill.getGradient().isDefault() + || !rFill.getHatch().isDefault() + || !rFill.getBitmap().isDefault()) { bool bModulate(::com::sun::star::drawing::TextureMode_MODULATE == aSdr3DObjectAttribute.getTextureMode()); bool bFilter(aSdr3DObjectAttribute.getTextureFilter()); - BasePrimitive3D* pNewTexturePrimitive3D = 0L; + BasePrimitive3D* pNewTexturePrimitive3D = 0; - if(rFill.isGradient()) + if(!rFill.getGradient().isDefault()) { // create gradientTexture3D with sublist, add to local aRetval - pNewTexturePrimitive3D = new GradientTexturePrimitive3D(*rFill.getGradient(), aRetval, rTextureSize, bModulate, bFilter); + pNewTexturePrimitive3D = new GradientTexturePrimitive3D( + rFill.getGradient(), + aRetval, + rTextureSize, + bModulate, + bFilter); } - else if(rFill.isHatch()) + else if(!rFill.getHatch().isDefault()) { // create hatchTexture3D with sublist, add to local aRetval - pNewTexturePrimitive3D = new HatchTexturePrimitive3D(*rFill.getHatch(), aRetval, rTextureSize, bModulate, bFilter); + pNewTexturePrimitive3D = new HatchTexturePrimitive3D( + rFill.getHatch(), + aRetval, + rTextureSize, + bModulate, + bFilter); } - else // if(rFill.isBitmap()) + else // if(!rFill.getBitmap().isDefault()) { // create bitmapTexture3D with sublist, add to local aRetval basegfx::B2DRange aTexRange(0.0, 0.0, rTextureSize.getX(), rTextureSize.getY()); - pNewTexturePrimitive3D = new BitmapTexturePrimitive3D(rFill.getBitmap()->getFillBitmapAttribute(aTexRange), aRetval, rTextureSize, bModulate, bFilter); + + pNewTexturePrimitive3D = new BitmapTexturePrimitive3D( + rFill.getBitmap().getFillBitmapAttribute(aTexRange), + aRetval, + rTextureSize, + bModulate, + bFilter); } // exchange aRetval content with texture group @@ -247,14 +266,14 @@ namespace drawinglayer if(0.0 != rFill.getTransparence()) { - // create UnifiedAlphaTexturePrimitive3D with sublist and exchange - const Primitive3DReference xRef(new UnifiedAlphaTexturePrimitive3D(rFill.getTransparence(), aRetval)); + // create UnifiedTransparenceTexturePrimitive3D with sublist and exchange + const Primitive3DReference xRef(new UnifiedTransparenceTexturePrimitive3D(rFill.getTransparence(), aRetval)); aRetval = Primitive3DSequence(&xRef, 1L); } - else if(pFillGradient) + else if(!rFillGradient.isDefault()) { - // create AlphaTexturePrimitive3D with sublist and exchange - const Primitive3DReference xRef(new AlphaTexturePrimitive3D(*pFillGradient, aRetval, rTextureSize)); + // create TransparenceTexturePrimitive3D with sublist and exchange + const Primitive3DReference xRef(new TransparenceTexturePrimitive3D(rFillGradient, aRetval, rTextureSize)); aRetval = Primitive3DSequence(&xRef, 1L); } } @@ -284,6 +303,35 @@ namespace drawinglayer return Primitive3DSequence(); } } + + Primitive3DSequence createHiddenGeometryPrimitives3D( + const ::std::vector< basegfx::B3DPolyPolygon >& r3DPolyPolygonVector, + const basegfx::B3DHomMatrix& rObjectTransform, + const basegfx::B2DVector& rTextureSize, + const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute) + { + // create hidden sub-geometry which can be used for HitTest + // and BoundRect calculations, but will not be visualized + const attribute::SdrFillAttribute aSimplifiedFillAttribute( + 0.0, + basegfx::BColor(), + attribute::FillGradientAttribute(), + attribute::FillHatchAttribute(), + attribute::SdrFillBitmapAttribute()); + + const Primitive3DReference aHidden( + new HiddenGeometryPrimitive3D( + create3DPolyPolygonFillPrimitives( + r3DPolyPolygonVector, + rObjectTransform, + rTextureSize, + aSdr3DObjectAttribute, + aSimplifiedFillAttribute, + attribute::FillGradientAttribute()))); + + return Primitive3DSequence(&aHidden, 1); + } + } // end of namespace primitive3d } // end of namespace drawinglayer diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx index b6a8621f7d8b..2485d467b7f4 100644 --- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx @@ -36,8 +36,9 @@ #include <basegfx/tools/canvastools.hxx> #include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx> #include <drawinglayer/geometry/viewinformation3d.hxx> -#include <drawinglayer/primitive3d/hittestprimitive3d.hxx> -#include <drawinglayer/attribute/sdrattribute.hxx> +#include <drawinglayer/attribute/sdrfillattribute.hxx> +#include <drawinglayer/attribute/sdrlineattribute.hxx> +#include <drawinglayer/attribute/sdrshadowattribute.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -68,7 +69,7 @@ namespace drawinglayer double fRelativeTextureWidth(1.0); basegfx::B2DHomMatrix aTexTransform; - if(getSdrLFSAttribute().getFill() && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY)) + if(!getSdrLFSAttribute().getFill().isDefault() && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY)) { const basegfx::B2DPolygon aFirstPolygon(maCorrectedPolyPolygon.getB2DPolygon(0L)); const double fFrontLength(basegfx::tools::getLength(aFirstPolygon)); @@ -98,7 +99,7 @@ namespace drawinglayer const basegfx::B3DRange aRange(getRangeFrom3DGeometry(aFill)); // normal creation - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { if(::com::sun::star::drawing::NormalsKind_SPHERE == eNormalsKind) { @@ -116,7 +117,7 @@ namespace drawinglayer } // texture coordinates - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { applyTextureTo3DGeometry( getSdr3DObjectAttribute().getTextureProjectionX(), @@ -126,7 +127,7 @@ namespace drawinglayer getTextureSize()); } - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { // add fill aRetval = create3DPolyPolygonFillPrimitives( @@ -134,29 +135,21 @@ namespace drawinglayer getTransform(), getTextureSize(), getSdr3DObjectAttribute(), - *getSdrLFSAttribute().getFill(), + getSdrLFSAttribute().getFill(), getSdrLFSAttribute().getFillFloatTransGradient()); } else { // create simplified 3d hit test geometry - const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0); - - aRetval = create3DPolyPolygonFillPrimitives( + aRetval = createHiddenGeometryPrimitives3D( aFill, getTransform(), getTextureSize(), - getSdr3DObjectAttribute(), - aSimplifiedFillAttribute, - 0); - - // encapsulate in HitTestPrimitive3D and add - const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval)); - aRetval = Primitive3DSequence(&xRef, 1L); + getSdr3DObjectAttribute()); } // add line - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { if(getSdr3DObjectAttribute().getReducedLineGeometry()) { @@ -341,7 +334,8 @@ namespace drawinglayer if(aNewLineGeometry.count()) { - const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aNewLineGeometry, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives( + aNewLineGeometry, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines); } } @@ -352,19 +346,22 @@ namespace drawinglayer const basegfx::B3DPolyPolygon aVerLine(extractVerticalLinesFromSlice(rSliceVector)); // add horizontal lines - const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives(aHorLine, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives( + aHorLine, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aHorLines); // add vertical lines - const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives(aVerLine, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives( + aVerLine, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aVerLines); } } // add shadow - if(getSdrLFSAttribute().getShadow() && aRetval.hasElements()) + if(!getSdrLFSAttribute().getShadow().isDefault() && aRetval.hasElements()) { - const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); + const Primitive3DSequence aShadow(createShadowPrimitive3D( + aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow); } } @@ -401,7 +398,7 @@ namespace drawinglayer SdrExtrudePrimitive3D::SdrExtrudePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute, const basegfx::B2DPolyPolygon& rPolyPolygon, double fDepth, diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx index 16cee3fbf86a..d2ca2f5786bc 100644 --- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx @@ -36,8 +36,9 @@ #include <basegfx/tools/canvastools.hxx> #include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx> #include <drawinglayer/geometry/viewinformation3d.hxx> -#include <drawinglayer/primitive3d/hittestprimitive3d.hxx> -#include <drawinglayer/attribute/sdrattribute.hxx> +#include <drawinglayer/attribute/sdrfillattribute.hxx> +#include <drawinglayer/attribute/sdrlineattribute.hxx> +#include <drawinglayer/attribute/sdrshadowattribute.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -69,7 +70,8 @@ namespace drawinglayer const bool bCreateTextureCoordiantesY(::com::sun::star::drawing::TextureProjectionMode_OBJECTSPECIFIC == getSdr3DObjectAttribute().getTextureProjectionY()); basegfx::B2DHomMatrix aTexTransform; - if(getSdrLFSAttribute().getFill() && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY)) + if(!getSdrLFSAttribute().getFill().isDefault() + && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY)) { aTexTransform.set(0, 0, 0.0); aTexTransform.set(0, 1, 1.0); @@ -91,7 +93,7 @@ namespace drawinglayer const basegfx::B3DRange aRange(getRangeFrom3DGeometry(aFill)); // normal creation - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { if(::com::sun::star::drawing::NormalsKind_SPHERE == eNormalsKind) { @@ -109,7 +111,7 @@ namespace drawinglayer } // texture coordinates - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { applyTextureTo3DGeometry( getSdr3DObjectAttribute().getTextureProjectionX(), @@ -119,7 +121,7 @@ namespace drawinglayer getTextureSize()); } - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { // add fill aRetval = create3DPolyPolygonFillPrimitives( @@ -127,29 +129,21 @@ namespace drawinglayer getTransform(), getTextureSize(), getSdr3DObjectAttribute(), - *getSdrLFSAttribute().getFill(), + getSdrLFSAttribute().getFill(), getSdrLFSAttribute().getFillFloatTransGradient()); } else { // create simplified 3d hit test geometry - const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0); - - aRetval = create3DPolyPolygonFillPrimitives( + aRetval = createHiddenGeometryPrimitives3D( aFill, getTransform(), getTextureSize(), - getSdr3DObjectAttribute(), - aSimplifiedFillAttribute, - 0); - - // encapsulate in HitTestPrimitive3D and add - const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval)); - aRetval = Primitive3DSequence(&xRef, 1L); + getSdr3DObjectAttribute()); } // add line - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { if(getSdr3DObjectAttribute().getReducedLineGeometry()) { @@ -183,7 +177,8 @@ namespace drawinglayer if(aNewLineGeometry.count()) { - const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aNewLineGeometry, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives( + aNewLineGeometry, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines); } } @@ -194,19 +189,23 @@ namespace drawinglayer const basegfx::B3DPolyPolygon aVerLine(extractVerticalLinesFromSlice(rSliceVector)); // add horizontal lines - const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives(aHorLine, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives( + aHorLine, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aHorLines); // add vertical lines - const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives(aVerLine, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives( + aVerLine, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aVerLines); } } // add shadow - if(getSdrLFSAttribute().getShadow() && aRetval.hasElements()) + if(!getSdrLFSAttribute().getShadow().isDefault() + && aRetval.hasElements()) { - const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); + const Primitive3DSequence aShadow(createShadowPrimitive3D( + aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow); } } @@ -254,7 +253,7 @@ namespace drawinglayer SdrLathePrimitive3D::SdrLathePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute, const basegfx::B2DPolyPolygon& rPolyPolygon, sal_uInt32 nHorizontalSegments, diff --git a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx index 6f6d2a106ac0..825bd6ee4671 100644 --- a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx @@ -32,8 +32,9 @@ #include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx> #include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx> #include <basegfx/polygon/b3dpolypolygontools.hxx> -#include <drawinglayer/attribute/sdrattribute.hxx> -#include <drawinglayer/primitive3d/hittestprimitive3d.hxx> +#include <drawinglayer/attribute/sdrfillattribute.hxx> +#include <drawinglayer/attribute/sdrlineattribute.hxx> +#include <drawinglayer/attribute/sdrshadowattribute.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -58,7 +59,7 @@ namespace drawinglayer const basegfx::B3DRange aRange(getRangeFrom3DGeometry(aFill)); // #i98295# normal creation - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { if(::com::sun::star::drawing::NormalsKind_SPHERE == getSdr3DObjectAttribute().getNormalsKind()) { @@ -76,7 +77,7 @@ namespace drawinglayer } // #i98314# texture coordinates - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { applyTextureTo3DGeometry( getSdr3DObjectAttribute().getTextureProjectionX(), @@ -86,7 +87,7 @@ namespace drawinglayer getTextureSize()); } - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { // add fill aRetval = create3DPolyPolygonFillPrimitives( @@ -94,41 +95,36 @@ namespace drawinglayer getTransform(), getTextureSize(), getSdr3DObjectAttribute(), - *getSdrLFSAttribute().getFill(), + getSdrLFSAttribute().getFill(), getSdrLFSAttribute().getFillFloatTransGradient()); } else { // create simplified 3d hit test geometry - const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0); - - aRetval = create3DPolyPolygonFillPrimitives( + aRetval = createHiddenGeometryPrimitives3D( aFill, getTransform(), getTextureSize(), - getSdr3DObjectAttribute(), - aSimplifiedFillAttribute, - 0); - - // encapsulate in HitTestPrimitive3D and add - const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval)); - aRetval = Primitive3DSequence(&xRef, 1L); + getSdr3DObjectAttribute()); } // add line - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { basegfx::B3DPolyPolygon aLine(getPolyPolygon3D()); aLine.clearNormals(); aLine.clearTextureCoordinates(); - const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aLine, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives( + aLine, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines); } // add shadow - if(getSdrLFSAttribute().getShadow() && aRetval.hasElements()) + if(!getSdrLFSAttribute().getShadow().isDefault() + && aRetval.hasElements()) { - const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); + const Primitive3DSequence aShadow(createShadowPrimitive3D( + aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow); } } @@ -140,7 +136,7 @@ namespace drawinglayer const basegfx::B3DPolyPolygon& rPolyPolygon3D, const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute) : SdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute), maPolyPolygon3D(rPolyPolygon3D) @@ -173,11 +169,11 @@ namespace drawinglayer aRetval = basegfx::tools::getRange(getPolyPolygon3D()); aRetval.transform(getTransform()); - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { - const attribute::SdrLineAttribute& rLine = *getSdrLFSAttribute().getLine(); + const attribute::SdrLineAttribute& rLine = getSdrLFSAttribute().getLine(); - if(rLine.isVisible() && !basegfx::fTools::equalZero(rLine.getWidth())) + if(!rLine.isDefault() && !basegfx::fTools::equalZero(rLine.getWidth())) { // expand by half LineWidth as tube radius aRetval.grow(rLine.getWidth() / 2.0); diff --git a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx index 3d8ff55024ff..e5f722126d42 100644 --- a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx @@ -29,9 +29,9 @@ #include "precompiled_drawinglayer.hxx" #include <drawinglayer/primitive3d/sdrprimitive3d.hxx> -#include <drawinglayer/attribute/sdrattribute.hxx> #include <basegfx/polygon/b3dpolypolygontools.hxx> #include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx> +#include <drawinglayer/attribute/sdrlineattribute.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -48,11 +48,11 @@ namespace drawinglayer basegfx::B3DRange aUnitRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0); aUnitRange.transform(getTransform()); - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { - const attribute::SdrLineAttribute& rLine = *getSdrLFSAttribute().getLine(); + const attribute::SdrLineAttribute& rLine = getSdrLFSAttribute().getLine(); - if(rLine.isVisible() && !basegfx::fTools::equalZero(rLine.getWidth())) + if(!rLine.isDefault() && !basegfx::fTools::equalZero(rLine.getWidth())) { // expand by hald LineWidth as tube radius aUnitRange.grow(rLine.getWidth() / 2.0); @@ -75,11 +75,11 @@ namespace drawinglayer aRetval.transform(getTransform()); - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { - const attribute::SdrLineAttribute& rLine = *getSdrLFSAttribute().getLine(); + const attribute::SdrLineAttribute& rLine = getSdrLFSAttribute().getLine(); - if(rLine.isVisible() && !basegfx::fTools::equalZero(rLine.getWidth())) + if(!rLine.isDefault() && !basegfx::fTools::equalZero(rLine.getWidth())) { // expand by half LineWidth as tube radius aRetval.grow(rLine.getWidth() / 2.0); @@ -93,7 +93,7 @@ namespace drawinglayer SdrPrimitive3D::SdrPrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute) : BufferedDecompositionPrimitive3D(), maTransform(rTransform), diff --git a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx index a2c8f4c0cc03..b10b4ad6164b 100644 --- a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx @@ -35,8 +35,9 @@ #include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx> #include <basegfx/tools/canvastools.hxx> #include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx> -#include <drawinglayer/primitive3d/hittestprimitive3d.hxx> -#include <drawinglayer/attribute/sdrattribute.hxx> +#include <drawinglayer/attribute/sdrfillattribute.hxx> +#include <drawinglayer/attribute/sdrlineattribute.hxx> +#include <drawinglayer/attribute/sdrshadowattribute.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -60,7 +61,7 @@ namespace drawinglayer getHorizontalSegments(), getVerticalSegments(), bCreateNormals)); // normal inversion - if(getSdrLFSAttribute().getFill() + if(!getSdrLFSAttribute().getFill().isDefault() && bCreateNormals && getSdr3DObjectAttribute().getNormalsInvert() && aFill.areNormalsUsed()) @@ -70,7 +71,7 @@ namespace drawinglayer } // texture coordinates - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { // handle texture coordinates X const bool bParallelX(::com::sun::star::drawing::TextureProjectionMode_PARALLEL == getSdr3DObjectAttribute().getTextureProjectionX()); @@ -134,7 +135,7 @@ namespace drawinglayer a3DPolyPolygonVector.push_back(basegfx::B3DPolyPolygon(aFill.getB3DPolygon(a))); } - if(getSdrLFSAttribute().getFill()) + if(!getSdrLFSAttribute().getFill().isDefault()) { // add fill aRetval = create3DPolyPolygonFillPrimitives( @@ -142,39 +143,34 @@ namespace drawinglayer getTransform(), getTextureSize(), getSdr3DObjectAttribute(), - *getSdrLFSAttribute().getFill(), + getSdrLFSAttribute().getFill(), getSdrLFSAttribute().getFillFloatTransGradient()); } else { // create simplified 3d hit test geometry - const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0); - - aRetval = create3DPolyPolygonFillPrimitives( + aRetval = createHiddenGeometryPrimitives3D( a3DPolyPolygonVector, getTransform(), getTextureSize(), - getSdr3DObjectAttribute(), - aSimplifiedFillAttribute, - 0); - - // encapsulate in HitTestPrimitive3D and add - const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval)); - aRetval = Primitive3DSequence(&xRef, 1L); + getSdr3DObjectAttribute()); } // add line - if(getSdrLFSAttribute().getLine()) + if(!getSdrLFSAttribute().getLine().isDefault()) { basegfx::B3DPolyPolygon aSphere(basegfx::tools::createSpherePolyPolygonFromB3DRange(aUnitRange, getHorizontalSegments(), getVerticalSegments())); - const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aSphere, getTransform(), *getSdrLFSAttribute().getLine())); + const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives( + aSphere, getTransform(), getSdrLFSAttribute().getLine())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines); } // add shadow - if(getSdrLFSAttribute().getShadow() && aRetval.hasElements()) + if(!getSdrLFSAttribute().getShadow().isDefault() + && aRetval.hasElements()) { - const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); + const Primitive3DSequence aShadow(createShadowPrimitive3D( + aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D())); appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow); } @@ -184,7 +180,7 @@ namespace drawinglayer SdrSpherePrimitive3D::SdrSpherePrimitive3D( const basegfx::B3DHomMatrix& rTransform, const basegfx::B2DVector& rTextureSize, - const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute, + const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute, const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute, sal_uInt32 nHorizontalSegments, sal_uInt32 nVerticalSegments) diff --git a/drawinglayer/source/primitive3d/textureprimitive3d.cxx b/drawinglayer/source/primitive3d/textureprimitive3d.cxx index 1e3e803cea38..d10fc52b8bb2 100644 --- a/drawinglayer/source/primitive3d/textureprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/textureprimitive3d.cxx @@ -30,6 +30,7 @@ #include <drawinglayer/primitive3d/textureprimitive3d.hxx> #include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx> +#include <basegfx/color/bcolor.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -73,7 +74,7 @@ namespace drawinglayer { namespace primitive3d { - UnifiedAlphaTexturePrimitive3D::UnifiedAlphaTexturePrimitive3D( + UnifiedTransparenceTexturePrimitive3D::UnifiedTransparenceTexturePrimitive3D( double fTransparence, const Primitive3DSequence& rChildren) : TexturePrimitive3D(rChildren, basegfx::B2DVector(), false, false), @@ -81,11 +82,11 @@ namespace drawinglayer { } - bool UnifiedAlphaTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const + bool UnifiedTransparenceTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const { if(TexturePrimitive3D::operator==(rPrimitive)) { - const UnifiedAlphaTexturePrimitive3D& rCompare = (UnifiedAlphaTexturePrimitive3D&)rPrimitive; + const UnifiedTransparenceTexturePrimitive3D& rCompare = (UnifiedTransparenceTexturePrimitive3D&)rPrimitive; return (getTransparence() == rCompare.getTransparence()); } @@ -93,7 +94,14 @@ namespace drawinglayer return false; } - Primitive3DSequence UnifiedAlphaTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const + basegfx::B3DRange UnifiedTransparenceTexturePrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const + { + // do not use the fallback to decomposition here since for a correct BoundRect we also + // need invisible (1.0 == getTransparence()) geometry; these would be deleted in the decomposition + return getB3DRangeFromPrimitive3DSequence(getChildren(), rViewInformation); + } + + Primitive3DSequence UnifiedTransparenceTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const { if(0.0 == getTransparence()) { @@ -102,10 +110,10 @@ namespace drawinglayer } else if(getTransparence() > 0.0 && getTransparence() < 1.0) { - // create AlphaTexturePrimitive3D with fixed transparence as replacement + // create TransparenceTexturePrimitive3D with fixed transparence as replacement const basegfx::BColor aGray(getTransparence(), getTransparence(), getTransparence()); const attribute::FillGradientAttribute aFillGradient(attribute::GRADIENTSTYLE_LINEAR, 0.0, 0.0, 0.0, 0.0, aGray, aGray, 1); - const Primitive3DReference xRef(new AlphaTexturePrimitive3D(aFillGradient, getChildren(), getTextureSize())); + const Primitive3DReference xRef(new TransparenceTexturePrimitive3D(aFillGradient, getChildren(), getTextureSize())); return Primitive3DSequence(&xRef, 1L); } else @@ -116,7 +124,7 @@ namespace drawinglayer } // provide unique ID - ImplPrimitrive3DIDBlock(UnifiedAlphaTexturePrimitive3D, PRIMITIVE3D_ID_UNIFIEDALPHATEXTUREPRIMITIVE3D) + ImplPrimitrive3DIDBlock(UnifiedTransparenceTexturePrimitive3D, PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D) } // end of namespace primitive3d } // end of namespace drawinglayer @@ -196,7 +204,7 @@ namespace drawinglayer { namespace primitive3d { - AlphaTexturePrimitive3D::AlphaTexturePrimitive3D( + TransparenceTexturePrimitive3D::TransparenceTexturePrimitive3D( const attribute::FillGradientAttribute& rGradient, const Primitive3DSequence& rChildren, const basegfx::B2DVector& rTextureSize) @@ -204,13 +212,13 @@ namespace drawinglayer { } - bool AlphaTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const + bool TransparenceTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const { return (GradientTexturePrimitive3D::operator==(rPrimitive)); } // provide unique ID - ImplPrimitrive3DIDBlock(AlphaTexturePrimitive3D, PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D) + ImplPrimitrive3DIDBlock(TransparenceTexturePrimitive3D, PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D) } // end of namespace primitive3d } // end of namespace drawinglayer |