summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-12-15 10:31:06 +0200
committerNoel Grandin <noel@peralex.com>2015-12-15 10:42:52 +0200
commit4463da0488099b52959544923407b15d73d3e172 (patch)
treec0fd9ada0bfdf2d3925fc1c94bac3782d332ef5a /drawinglayer
parent00ea9e5e4ef2f20353c881ec5844ed3862897239 (diff)
use vector as container for Primitive3DReference
rather than uno::Sequence, since we modify this container a lot and uno::Sequence is expensive to update Change-Id: Id5bc5171cbc4b90b243e6dda6d572f21b3bdf00d
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx8
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx10
-rw-r--r--drawinglayer/source/primitive3d/baseprimitive3d.cxx80
-rw-r--r--drawinglayer/source/primitive3d/groupprimitive3d.cxx6
-rw-r--r--drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx22
-rw-r--r--drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx8
-rw-r--r--drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx2
-rw-r--r--drawinglayer/source/primitive3d/polygonprimitive3d.cxx6
-rw-r--r--drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx56
-rw-r--r--drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx14
-rw-r--r--drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx34
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx28
-rw-r--r--drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx28
-rw-r--r--drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx14
-rw-r--r--drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx14
-rw-r--r--drawinglayer/source/primitive3d/shadowprimitive3d.cxx2
-rw-r--r--drawinglayer/source/primitive3d/textureprimitive3d.cxx18
-rw-r--r--drawinglayer/source/primitive3d/transformprimitive3d.cxx4
-rw-r--r--drawinglayer/source/processor2d/hittestprocessor2d.cxx7
-rw-r--r--drawinglayer/source/processor3d/baseprocessor3d.cxx11
-rw-r--r--drawinglayer/source/processor3d/cutfindprocessor3d.cxx8
-rw-r--r--drawinglayer/source/processor3d/defaultprocessor3d.cxx16
-rw-r--r--drawinglayer/source/processor3d/geometry2dextractor.cxx8
23 files changed, 226 insertions, 178 deletions
diff --git a/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx b/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx
index 284b91c0f4b7..91dee61e97bc 100644
--- a/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx
@@ -43,7 +43,7 @@ namespace drawinglayer
osl::MutexGuard aGuard( m_aMutex );
// create on demand
- if(!mbShadow3DChecked && getChildren3D().hasElements())
+ if(!mbShadow3DChecked && !getChildren3D().empty())
{
// create shadow extraction processor
processor3d::Shadow3DExtractingProcessor aShadowProcessor(
@@ -77,7 +77,7 @@ namespace drawinglayer
}
Embedded3DPrimitive2D::Embedded3DPrimitive2D(
- const primitive3d::Primitive3DSequence& rxChildren3D,
+ const primitive3d::Primitive3DContainer& rxChildren3D,
const basegfx::B2DHomMatrix& rObjectTransformation,
const geometry::ViewInformation3D& rViewInformation3D,
const basegfx::B3DVector& rLightNormal,
@@ -103,7 +103,7 @@ namespace drawinglayer
{
const Embedded3DPrimitive2D& rCompare = static_cast< const Embedded3DPrimitive2D& >(rPrimitive);
- return (primitive3d::arePrimitive3DSequencesEqual(getChildren3D(), rCompare.getChildren3D())
+ return (getChildren3D() == rCompare.getChildren3D()
&& getObjectTransformation() == rCompare.getObjectTransformation()
&& getViewInformation3D() == rCompare.getViewInformation3D()
&& getLightNormal() == rCompare.getLightNormal()
@@ -119,7 +119,7 @@ namespace drawinglayer
if(maB2DRange.isEmpty())
{
// use the 3d transformation stack to create a projection of the 3D range
- basegfx::B3DRange a3DRange(primitive3d::getB3DRangeFromPrimitive3DSequence(getChildren3D(), getViewInformation3D()));
+ basegfx::B3DRange a3DRange(getChildren3D().getB3DRange(getViewInformation3D()));
a3DRange.transform(getViewInformation3D().getObjectToView());
// create 2d range from projected 3d and transform with scene's object transformation
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index 5aaf906826ac..eddb89228822 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -48,11 +48,11 @@ namespace drawinglayer
::osl::MutexGuard aGuard( m_aMutex );
// create on demand
- if(!mbShadow3DChecked && getChildren3D().hasElements())
+ if(!mbShadow3DChecked && !getChildren3D().empty())
{
basegfx::B3DVector aLightNormal;
const double fShadowSlant(getSdrSceneAttribute().getShadowSlant());
- const basegfx::B3DRange aScene3DRange(primitive3d::getB3DRangeFromPrimitive3DSequence(getChildren3D(), getViewInformation3D()));
+ const basegfx::B3DRange aScene3DRange(getChildren3D().getB3DRange(getViewInformation3D()));
if(maSdrLightingAttribute.getLightVector().size())
{
@@ -320,7 +320,7 @@ namespace drawinglayer
Primitive2DContainer aRetval;
// create 2D projected geometry from 3D geometry
- if(getChildren3D().hasElements())
+ if(!getChildren3D().empty())
{
// create 2D geometry extraction processor
processor3d::Geometry2DExtractingProcessor aGeometryProcessor(
@@ -393,7 +393,7 @@ namespace drawinglayer
}
ScenePrimitive2D::ScenePrimitive2D(
- const primitive3d::Primitive3DSequence& rxChildren3D,
+ const primitive3d::Primitive3DContainer& rxChildren3D,
const attribute::SdrSceneAttribute& rSdrSceneAttribute,
const attribute::SdrLightingAttribute& rSdrLightingAttribute,
const basegfx::B2DHomMatrix& rObjectTransformation,
@@ -419,7 +419,7 @@ namespace drawinglayer
{
const ScenePrimitive2D& rCompare = static_cast<const ScenePrimitive2D&>(rPrimitive);
- return (primitive3d::arePrimitive3DSequencesEqual(getChildren3D(), rCompare.getChildren3D())
+ return (getChildren3D() == rCompare.getChildren3D()
&& getSdrSceneAttribute() == rCompare.getSdrSceneAttribute()
&& getSdrLightingAttribute() == rCompare.getSdrLightingAttribute()
&& getObjectTransformation() == rCompare.getObjectTransformation()
diff --git a/drawinglayer/source/primitive3d/baseprimitive3d.cxx b/drawinglayer/source/primitive3d/baseprimitive3d.cxx
index a0fc5d2b6e72..20c49750300e 100644
--- a/drawinglayer/source/primitive3d/baseprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/baseprimitive3d.cxx
@@ -20,6 +20,7 @@
#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
#include <basegfx/tools/canvastools.hxx>
+#include <comphelper/sequence.hxx>
@@ -47,18 +48,18 @@ namespace drawinglayer
basegfx::B3DRange BasePrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const
{
- return getB3DRangeFromPrimitive3DSequence(get3DDecomposition(rViewInformation), rViewInformation);
+ return get3DDecomposition(rViewInformation).getB3DRange(rViewInformation);
}
- Primitive3DSequence BasePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ Primitive3DContainer BasePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
- return Primitive3DSequence();
+ return Primitive3DContainer();
}
Primitive3DSequence SAL_CALL BasePrimitive3D::getDecomposition( const uno::Sequence< beans::PropertyValue >& rViewParameters ) throw ( uno::RuntimeException, std::exception )
{
const geometry::ViewInformation3D aViewInformation(rViewParameters);
- return get3DDecomposition(aViewInformation);
+ return comphelper::containerToSequence(get3DDecomposition(aViewInformation));
}
css::geometry::RealRectangle3D SAL_CALL BasePrimitive3D::getRange( const uno::Sequence< beans::PropertyValue >& rViewParameters ) throw ( uno::RuntimeException, std::exception )
@@ -75,9 +76,9 @@ namespace drawinglayer
{
namespace primitive3d
{
- Primitive3DSequence BufferedDecompositionPrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ Primitive3DContainer BufferedDecompositionPrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
- return Primitive3DSequence();
+ return Primitive3DContainer();
}
BufferedDecompositionPrimitive3D::BufferedDecompositionPrimitive3D()
@@ -86,13 +87,13 @@ namespace drawinglayer
{
}
- Primitive3DSequence BufferedDecompositionPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const
+ Primitive3DContainer BufferedDecompositionPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const
{
::osl::MutexGuard aGuard( m_aMutex );
- if(!getBuffered3DDecomposition().hasElements())
+ if(getBuffered3DDecomposition().empty())
{
- const Primitive3DSequence aNewSequence(create3DDecomposition(rViewInformation));
+ const Primitive3DContainer aNewSequence(create3DDecomposition(rViewInformation));
const_cast< BufferedDecompositionPrimitive3D* >(this)->setBuffered3DDecomposition(aNewSequence);
}
@@ -134,18 +135,18 @@ namespace drawinglayer
return aRetval;
}
- // get range3D from a given Primitive3DSequence
- basegfx::B3DRange getB3DRangeFromPrimitive3DSequence(const Primitive3DSequence& rCandidate, const geometry::ViewInformation3D& aViewInformation)
+ // get range3D from a given Primitive3DContainer
+ basegfx::B3DRange Primitive3DContainer::getB3DRange(const geometry::ViewInformation3D& aViewInformation) const
{
basegfx::B3DRange aRetval;
- if(rCandidate.hasElements())
+ if(!empty())
{
- const sal_Int32 nCount(rCandidate.getLength());
+ const size_t nCount(size());
- for(sal_Int32 a(0L); a < nCount; a++)
+ for(size_t a(0L); a < nCount; a++)
{
- aRetval.expand(getB3DRangeFromPrimitive3DReference(rCandidate[a], aViewInformation));
+ aRetval.expand(getB3DRangeFromPrimitive3DReference((*this)[a], aViewInformation));
}
}
@@ -215,8 +216,40 @@ namespace drawinglayer
return true;
}
+ bool Primitive3DContainer::operator==(const Primitive3DContainer& rB) const
+ {
+ const bool bAHasElements(!empty());
+
+ if(bAHasElements != !rB.empty())
+ {
+ return false;
+ }
+
+ if(!bAHasElements)
+ {
+ return true;
+ }
+
+ const size_t nCount(size());
+
+ if(nCount != rB.size())
+ {
+ return false;
+ }
+
+ for(size_t a(0L); a < nCount; a++)
+ {
+ if(!arePrimitive3DReferencesEqual((*this)[a], rB[a]))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
// concatenate sequence
- void appendPrimitive3DSequenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DSequence& rSource)
+ void appendPrimitive3DContainerToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DSequence& rSource)
{
if(rSource.hasElements())
{
@@ -249,6 +282,21 @@ namespace drawinglayer
}
}
+ void Primitive3DContainer::append(const Primitive3DContainer& rSource)
+ {
+ insert(end(), rSource.begin(), rSource.end());
+ }
+
+ void Primitive3DContainer::append(Primitive3DContainer&& rSource)
+ {
+ size_t n = size();
+ resize(n + rSource.size());
+ for (size_t i = 0; i<rSource.size(); ++i)
+ {
+ (*this)[n + i] = std::move( rSource[i] );
+ }
+ }
+
// concatenate single Primitive3D
void appendPrimitive3DReferenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DReference& rSource)
{
diff --git a/drawinglayer/source/primitive3d/groupprimitive3d.cxx b/drawinglayer/source/primitive3d/groupprimitive3d.cxx
index 029ddf73fdeb..fc266ae825da 100644
--- a/drawinglayer/source/primitive3d/groupprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/groupprimitive3d.cxx
@@ -30,7 +30,7 @@ namespace drawinglayer
{
namespace primitive3d
{
- GroupPrimitive3D::GroupPrimitive3D( const Primitive3DSequence& rChildren )
+ GroupPrimitive3D::GroupPrimitive3D( const Primitive3DContainer& rChildren )
: BasePrimitive3D(),
maChildren(rChildren)
{
@@ -46,14 +46,14 @@ namespace drawinglayer
{
const GroupPrimitive3D& rCompare = static_cast< const GroupPrimitive3D& >(rPrimitive);
- return (arePrimitive3DSequencesEqual(getChildren(), rCompare.getChildren()));
+ return getChildren() == rCompare.getChildren();
}
return false;
}
/// default: just return children, so all renderers not supporting group will use it's content
- Primitive3DSequence GroupPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ Primitive3DContainer GroupPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
return getChildren();
}
diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
index c191db51b19f..d3cf9fd28d91 100644
--- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
@@ -40,17 +40,17 @@ namespace drawinglayer
{
namespace primitive3d
{
- Primitive3DSequence HatchTexturePrimitive3D::impCreate3DDecomposition() const
+ Primitive3DContainer HatchTexturePrimitive3D::impCreate3DDecomposition() const
{
- Primitive3DSequence aRetval;
+ Primitive3DContainer aRetval;
- if(getChildren().hasElements())
+ if(!getChildren().empty())
{
- const Primitive3DSequence aSource(getChildren());
- const sal_uInt32 nSourceCount(aSource.getLength());
+ const Primitive3DContainer aSource(getChildren());
+ const size_t nSourceCount(aSource.size());
std::vector< Primitive3DReference > aDestination;
- for(sal_uInt32 a(0); a < nSourceCount; a++)
+ for(size_t a(0); a < nSourceCount; a++)
{
// get reference
const Primitive3DReference xReference(aSource[a]);
@@ -265,7 +265,7 @@ namespace drawinglayer
// prepare return value
const sal_uInt32 nDestSize(aDestination.size());
- aRetval.realloc(nDestSize);
+ aRetval.resize(nDestSize);
for(sal_uInt32 b(0); b < nDestSize; b++)
{
@@ -278,7 +278,7 @@ namespace drawinglayer
HatchTexturePrimitive3D::HatchTexturePrimitive3D(
const attribute::FillHatchAttribute& rHatch,
- const Primitive3DSequence& rChildren,
+ const Primitive3DContainer& rChildren,
const basegfx::B2DVector& rTextureSize,
bool bModulate,
bool bFilter)
@@ -300,13 +300,13 @@ namespace drawinglayer
return false;
}
- Primitive3DSequence HatchTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ Primitive3DContainer HatchTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
::osl::MutexGuard aGuard( m_aMutex );
- if(!getBuffered3DDecomposition().hasElements())
+ if(getBuffered3DDecomposition().empty())
{
- const Primitive3DSequence aNewSequence(impCreate3DDecomposition());
+ const Primitive3DContainer aNewSequence(impCreate3DDecomposition());
const_cast< HatchTexturePrimitive3D* >(this)->setBuffered3DDecomposition(aNewSequence);
}
diff --git a/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx b/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx
index cfa4e8fd0af2..69ccb85b3d58 100644
--- a/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx
@@ -31,20 +31,20 @@ namespace drawinglayer
namespace primitive3d
{
HiddenGeometryPrimitive3D::HiddenGeometryPrimitive3D(
- const Primitive3DSequence& rChildren)
+ const Primitive3DContainer& rChildren)
: GroupPrimitive3D(rChildren)
{
}
basegfx::B3DRange HiddenGeometryPrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const
{
- return getB3DRangeFromPrimitive3DSequence(getChildren(), rViewInformation);
+ return getChildren().getB3DRange(rViewInformation);
}
- Primitive3DSequence HiddenGeometryPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ Primitive3DContainer HiddenGeometryPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
// return empty sequence
- return Primitive3DSequence();
+ return Primitive3DContainer();
}
// provide unique ID
diff --git a/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx b/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx
index c74dba780178..06ded39f8939 100644
--- a/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx
@@ -31,7 +31,7 @@ namespace drawinglayer
namespace primitive3d
{
ModifiedColorPrimitive3D::ModifiedColorPrimitive3D(
- const Primitive3DSequence& rChildren,
+ const Primitive3DContainer& rChildren,
const basegfx::BColorModifierSharedPtr& rColorModifier)
: GroupPrimitive3D(rChildren),
maColorModifier(rColorModifier)
diff --git a/drawinglayer/source/primitive3d/polygonprimitive3d.cxx b/drawinglayer/source/primitive3d/polygonprimitive3d.cxx
index 1367d0a3fe5a..b7930bbe8947 100644
--- a/drawinglayer/source/primitive3d/polygonprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygonprimitive3d.cxx
@@ -73,9 +73,9 @@ namespace drawinglayer
{
namespace primitive3d
{
- Primitive3DSequence PolygonStrokePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ Primitive3DContainer PolygonStrokePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
- Primitive3DSequence aRetval;
+ Primitive3DContainer aRetval;
if(getB3DPolygon().count())
{
@@ -92,7 +92,7 @@ namespace drawinglayer
}
// prepare result
- aRetval.realloc(aHairLinePolyPolygon.count());
+ aRetval.resize(aHairLinePolyPolygon.count());
if(getLineAttribute().getWidth())
{
diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
index bbef152697d9..74cc5937b4bf 100644
--- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
@@ -40,7 +40,7 @@ namespace drawinglayer
{
private:
// data for buffered tube primitives
- Primitive3DSequence m_aLineTubeList;
+ Primitive3DContainer m_aLineTubeList;
sal_uInt32 m_nLineTubeSegments;
attribute::MaterialAttribute3D m_aLineMaterial;
::osl::Mutex m_aMutex;
@@ -50,7 +50,7 @@ namespace drawinglayer
{
}
- Primitive3DSequence getLineTubeSegments(
+ Primitive3DContainer getLineTubeSegments(
sal_uInt32 nSegments,
const attribute::MaterialAttribute3D& rMaterial)
{
@@ -61,10 +61,10 @@ namespace drawinglayer
{
m_nLineTubeSegments = nSegments;
m_aLineMaterial = rMaterial;
- m_aLineTubeList = Primitive3DSequence();
+ m_aLineTubeList = Primitive3DContainer();
}
- if (!m_aLineTubeList.hasElements() && m_nLineTubeSegments != 0)
+ if (m_aLineTubeList.empty() && m_nLineTubeSegments != 0)
{
const basegfx::B3DPoint aLeft(0.0, 0.0, 0.0);
const basegfx::B3DPoint aRight(1.0, 0.0, 0.0);
@@ -72,7 +72,7 @@ namespace drawinglayer
basegfx::B3DPoint aLastRight(1.0, 1.0, 0.0);
basegfx::B3DHomMatrix aRot;
aRot.rotate(F_2PI / (double)m_nLineTubeSegments, 0.0, 0.0);
- m_aLineTubeList.realloc(m_nLineTubeSegments);
+ m_aLineTubeList.resize(m_nLineTubeSegments);
for(sal_uInt32 a = 0; a < m_nLineTubeSegments; ++a)
{
@@ -109,7 +109,7 @@ namespace drawinglayer
struct theTubeBuffer :
public rtl::Static< TubeBuffer, theTubeBuffer > {};
- Primitive3DSequence getLineTubeSegments(
+ Primitive3DContainer getLineTubeSegments(
sal_uInt32 nSegments,
const attribute::MaterialAttribute3D& rMaterial)
{
@@ -122,7 +122,7 @@ namespace drawinglayer
{
private:
// data for buffered cap primitives
- Primitive3DSequence m_aLineCapList;
+ Primitive3DContainer m_aLineCapList;
sal_uInt32 m_nLineCapSegments;
attribute::MaterialAttribute3D m_aLineMaterial;
::osl::Mutex m_aMutex;
@@ -131,7 +131,7 @@ namespace drawinglayer
: m_nLineCapSegments(0)
{
}
- Primitive3DSequence getLineCapSegments(
+ Primitive3DContainer getLineCapSegments(
sal_uInt32 nSegments,
const attribute::MaterialAttribute3D& rMaterial)
{
@@ -142,16 +142,16 @@ namespace drawinglayer
{
m_nLineCapSegments = nSegments;
m_aLineMaterial = rMaterial;
- m_aLineCapList = Primitive3DSequence();
+ m_aLineCapList = Primitive3DContainer();
}
- if (!m_aLineCapList.hasElements() && m_nLineCapSegments != 0)
+ if (m_aLineCapList.empty() && m_nLineCapSegments != 0)
{
const basegfx::B3DPoint aNull(0.0, 0.0, 0.0);
basegfx::B3DPoint aLast(0.0, 1.0, 0.0);
basegfx::B3DHomMatrix aRot;
aRot.rotate(F_2PI / (double)m_nLineCapSegments, 0.0, 0.0);
- m_aLineCapList.realloc(m_nLineCapSegments);
+ m_aLineCapList.resize(m_nLineCapSegments);
for(sal_uInt32 a = 0; a < m_nLineCapSegments; ++a)
{
@@ -184,7 +184,7 @@ namespace drawinglayer
struct theCapBuffer :
public rtl::Static< CapBuffer, theCapBuffer > {};
- Primitive3DSequence getLineCapSegments(
+ Primitive3DContainer getLineCapSegments(
sal_uInt32 nSegments,
const attribute::MaterialAttribute3D& rMaterial)
{
@@ -197,7 +197,7 @@ namespace drawinglayer
{
private:
// data for buffered capround primitives
- Primitive3DSequence m_aLineCapRoundList;
+ Primitive3DContainer m_aLineCapRoundList;
sal_uInt32 m_nLineCapRoundSegments;
attribute::MaterialAttribute3D m_aLineMaterial;
::osl::Mutex m_aMutex;
@@ -206,7 +206,7 @@ namespace drawinglayer
: m_nLineCapRoundSegments(0)
{
}
- Primitive3DSequence getLineCapRoundSegments(
+ Primitive3DContainer getLineCapRoundSegments(
sal_uInt32 nSegments,
const attribute::MaterialAttribute3D& rMaterial)
{
@@ -217,10 +217,10 @@ namespace drawinglayer
{
m_nLineCapRoundSegments = nSegments;
m_aLineMaterial = rMaterial;
- m_aLineCapRoundList = Primitive3DSequence();
+ m_aLineCapRoundList = Primitive3DContainer();
}
- if (!m_aLineCapRoundList.hasElements() && m_nLineCapRoundSegments)
+ if (m_aLineCapRoundList.empty() && m_nLineCapRoundSegments)
{
// calculate new horizontal segments
sal_uInt32 nVerSeg(nSegments / 2);
@@ -251,7 +251,7 @@ namespace drawinglayer
aSphere.transformNormals(aSphereTrans);
// realloc for primitives and create based on polygon snippets
- m_aLineCapRoundList.realloc(nCount);
+ m_aLineCapRoundList.resize(nCount);
for (sal_uInt32 a = 0; a < nCount; ++a)
{
@@ -277,7 +277,7 @@ namespace drawinglayer
public rtl::Static< CapRoundBuffer, theCapRoundBuffer > {};
- Primitive3DSequence getLineCapRoundSegments(
+ Primitive3DContainer getLineCapRoundSegments(
sal_uInt32 nSegments,
const attribute::MaterialAttribute3D& rMaterial)
{
@@ -286,7 +286,7 @@ namespace drawinglayer
return rTheBuffer.getLineCapRoundSegments(nSegments, rMaterial);
}
- Primitive3DSequence getLineJoinSegments(
+ Primitive3DContainer getLineJoinSegments(
sal_uInt32 nSegments,
const attribute::MaterialAttribute3D& rMaterial,
double fAngle,
@@ -496,7 +496,7 @@ namespace drawinglayer
}
}
- Primitive3DSequence aRetval(aResultVector.size());
+ Primitive3DContainer aRetval(aResultVector.size());
for(size_t a(0); a < aResultVector.size(); a++)
{
@@ -535,7 +535,7 @@ namespace drawinglayer
{
namespace primitive3d
{
- Primitive3DSequence PolygonTubePrimitive3D::impCreate3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ Primitive3DContainer PolygonTubePrimitive3D::impCreate3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
const sal_uInt32 nPointCount(getB3DPolygon().count());
std::vector< BasePrimitive3D* > aResultVector;
@@ -608,7 +608,7 @@ namespace drawinglayer
if(bNoLineJoin || (!bClosed && bFirst))
{
// line start edge, build transformed primitiveVector3D
- Primitive3DSequence aSequence;
+ Primitive3DContainer aSequence;
if(bLineCapRound && bFirst)
{
@@ -633,7 +633,7 @@ namespace drawinglayer
{
// line connect non-parallel, aBack, aForw, use getLineJoin()
const double fAngle(acos(aBack.scalar(aForw) / (fForwLen * aBack.getLength()))); // 0.0 .. F_PI2
- Primitive3DSequence aNewList(
+ Primitive3DContainer aNewList(
getLineJoinSegments(
nSegments,
aMaterial,
@@ -696,7 +696,7 @@ namespace drawinglayer
aBackCapTrans.translate(aCurr.getX(), aCurr.getY(), aCurr.getZ());
// get primitiveVector3D
- Primitive3DSequence aSequence;
+ Primitive3DContainer aSequence;
if(bLineCapRound && bLast)
{
@@ -730,7 +730,7 @@ namespace drawinglayer
}
// prepare return value
- Primitive3DSequence aRetval(aResultVector.size());
+ Primitive3DContainer aRetval(aResultVector.size());
for(size_t a(0); a < aResultVector.size(); a++)
{
@@ -773,13 +773,13 @@ namespace drawinglayer
return false;
}
- Primitive3DSequence PolygonTubePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const
+ Primitive3DContainer PolygonTubePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const
{
::osl::MutexGuard aGuard( m_aMutex );
- if(!getLast3DDecomposition().hasElements())
+ if(getLast3DDecomposition().empty())
{
- const Primitive3DSequence aNewSequence(impCreate3DDecomposition(rViewInformation));
+ const Primitive3DContainer aNewSequence(impCreate3DDecomposition(rViewInformation));
const_cast< PolygonTubePrimitive3D* >(this)->setLast3DDecomposition(aNewSequence);
}
diff --git a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
index 86a8b2454df6..54a0cd980541 100644
--- a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
@@ -38,10 +38,10 @@ namespace drawinglayer
{
namespace primitive3d
{
- Primitive3DSequence SdrCubePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ Primitive3DContainer SdrCubePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
const basegfx::B3DRange aUnitRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
- Primitive3DSequence aRetval;
+ Primitive3DContainer aRetval;
basegfx::B3DPolyPolygon aFill(basegfx::tools::createCubeFillPolyPolygonFromB3DRange(aUnitRange));
// normal creation
@@ -160,17 +160,17 @@ namespace drawinglayer
if(!getSdrLFSAttribute().getLine().isDefault())
{
basegfx::B3DPolyPolygon aLine(basegfx::tools::createCubePolyPolygonFromB3DRange(aUnitRange));
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ const Primitive3DContainer aLines(create3DPolyPolygonLinePrimitives(
aLine, getTransform(), getSdrLFSAttribute().getLine()));
- appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
+ aRetval.append(aLines);
}
// add shadow
- if(!getSdrLFSAttribute().getShadow().isDefault() && aRetval.hasElements())
+ if(!getSdrLFSAttribute().getShadow().isDefault() && !aRetval.empty())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ const Primitive3DContainer aShadow(createShadowPrimitive3D(
aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
- appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
+ aRetval.append(aShadow);
}
return aRetval;
diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
index da802ddd7b86..08be61105710 100644
--- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
@@ -133,7 +133,7 @@ namespace drawinglayer
}
}
- Primitive3DSequence create3DPolyPolygonLinePrimitives(
+ Primitive3DContainer create3DPolyPolygonLinePrimitives(
const basegfx::B3DPolyPolygon& rUnitPolyPolygon,
const basegfx::B3DHomMatrix& rObjectTransform,
const attribute::SdrLineAttribute& rLine)
@@ -147,7 +147,7 @@ namespace drawinglayer
const attribute::StrokeAttribute aStrokeAttribute(rLine.getDotDashArray(), rLine.getFullDotDashLen());
// create primitives
- Primitive3DSequence aRetval(aScaledPolyPolygon.count());
+ Primitive3DContainer aRetval(aScaledPolyPolygon.count());
for(sal_uInt32 a(0L); a < aScaledPolyPolygon.count(); a++)
{
@@ -159,13 +159,13 @@ namespace drawinglayer
{
// create UnifiedTransparenceTexturePrimitive3D, add created primitives and exchange
const Primitive3DReference xRef(new UnifiedTransparenceTexturePrimitive3D(rLine.getTransparence(), aRetval));
- aRetval = Primitive3DSequence(&xRef, 1L);
+ aRetval = { xRef };
}
return aRetval;
}
- Primitive3DSequence create3DPolyPolygonFillPrimitives(
+ Primitive3DContainer create3DPolyPolygonFillPrimitives(
const ::std::vector< basegfx::B3DPolyPolygon >& r3DPolyPolygonVector,
const basegfx::B3DHomMatrix& rObjectTransform,
const basegfx::B2DVector& rTextureSize,
@@ -173,12 +173,12 @@ namespace drawinglayer
const attribute::SdrFillAttribute& rFill,
const attribute::FillGradientAttribute& rFillGradient)
{
- Primitive3DSequence aRetval;
+ Primitive3DContainer aRetval;
if(r3DPolyPolygonVector.size())
{
// create list of simple fill primitives
- aRetval.realloc(r3DPolyPolygonVector.size());
+ aRetval.resize(r3DPolyPolygonVector.size());
for(size_t a(0); a < r3DPolyPolygonVector.size(); a++)
{
@@ -242,7 +242,7 @@ namespace drawinglayer
// exchange aRetval content with texture group
const Primitive3DReference xRef(pNewTexturePrimitive3D);
- aRetval = Primitive3DSequence(&xRef, 1L);
+ aRetval = { xRef };
if(css::drawing::TextureKind2_LUMINANCE == aSdr3DObjectAttribute.getTextureKind())
{
@@ -254,7 +254,7 @@ namespace drawinglayer
aRetval,
aBColorModifier));
- aRetval = Primitive3DSequence(&xRef2, 1L);
+ aRetval = { xRef2 };
}
}
@@ -262,26 +262,26 @@ namespace drawinglayer
{
// create UnifiedTransparenceTexturePrimitive3D with sublist and exchange
const Primitive3DReference xRef(new UnifiedTransparenceTexturePrimitive3D(rFill.getTransparence(), aRetval));
- aRetval = Primitive3DSequence(&xRef, 1L);
+ aRetval = { xRef };
}
else if(!rFillGradient.isDefault())
{
// create TransparenceTexturePrimitive3D with sublist and exchange
const Primitive3DReference xRef(new TransparenceTexturePrimitive3D(rFillGradient, aRetval, rTextureSize));
- aRetval = Primitive3DSequence(&xRef, 1L);
+ aRetval = { xRef };
}
}
return aRetval;
}
- Primitive3DSequence createShadowPrimitive3D(
- const Primitive3DSequence& rSource,
+ Primitive3DContainer createShadowPrimitive3D(
+ const Primitive3DContainer& rSource,
const attribute::SdrShadowAttribute& rShadow,
bool bShadow3D)
{
// create Shadow primitives. Uses already created primitives
- if(rSource.hasElements() && !basegfx::fTools::moreOrEqual(rShadow.getTransparence(), 1.0))
+ if(!rSource.empty() && !basegfx::fTools::moreOrEqual(rShadow.getTransparence(), 1.0))
{
// prepare new list for shadow geometry
basegfx::B2DHomMatrix aShadowOffset;
@@ -290,15 +290,15 @@ namespace drawinglayer
// create shadow primitive and add primitives
const Primitive3DReference xRef(new ShadowPrimitive3D(aShadowOffset, rShadow.getColor(), rShadow.getTransparence(), bShadow3D, rSource));
- return Primitive3DSequence(&xRef, 1L);
+ return { xRef };
}
else
{
- return Primitive3DSequence();
+ return Primitive3DContainer();
}
}
- Primitive3DSequence createHiddenGeometryPrimitives3D(
+ Primitive3DContainer createHiddenGeometryPrimitives3D(
const ::std::vector< basegfx::B3DPolyPolygon >& r3DPolyPolygonVector,
const basegfx::B3DHomMatrix& rObjectTransform,
const basegfx::B2DVector& rTextureSize,
@@ -323,7 +323,7 @@ namespace drawinglayer
aSimplifiedFillAttribute,
attribute::FillGradientAttribute())));
- return Primitive3DSequence(&aHidden, 1);
+ return { aHidden };
}
} // end of namespace primitive3d
diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
index 46b865451fc8..153046fd388a 100644
--- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
@@ -39,9 +39,9 @@ namespace drawinglayer
{
namespace primitive3d
{
- Primitive3DSequence SdrExtrudePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const
+ Primitive3DContainer SdrExtrudePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const
{
- Primitive3DSequence aRetval;
+ Primitive3DContainer aRetval;
// get slices
const Slice3DVector& rSliceVector = getSlices();
@@ -322,9 +322,9 @@ namespace drawinglayer
if(aNewLineGeometry.count())
{
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ const Primitive3DContainer aLines(create3DPolyPolygonLinePrimitives(
aNewLineGeometry, getTransform(), getSdrLFSAttribute().getLine()));
- appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
+ aRetval.append(aLines);
}
}
else
@@ -334,23 +334,23 @@ namespace drawinglayer
const basegfx::B3DPolyPolygon aVerLine(extractVerticalLinesFromSlice(rSliceVector));
// add horizontal lines
- const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives(
+ const Primitive3DContainer aHorLines(create3DPolyPolygonLinePrimitives(
aHorLine, getTransform(), getSdrLFSAttribute().getLine()));
- appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aHorLines);
+ aRetval.append(aHorLines);
// add vertical lines
- const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives(
+ const Primitive3DContainer aVerLines(create3DPolyPolygonLinePrimitives(
aVerLine, getTransform(), getSdrLFSAttribute().getLine()));
- appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aVerLines);
+ aRetval.append(aVerLines);
}
}
// add shadow
- if(!getSdrLFSAttribute().getShadow().isDefault() && aRetval.hasElements())
+ if(!getSdrLFSAttribute().getShadow().isDefault() && !aRetval.empty())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ const Primitive3DContainer aShadow(createShadowPrimitive3D(
aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
- appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
+ aRetval.append(aShadow);
}
}
@@ -482,18 +482,18 @@ namespace drawinglayer
return get3DRangeFromSlices(getSlices());
}
- Primitive3DSequence SdrExtrudePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const
+ Primitive3DContainer SdrExtrudePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const
{
if(getSdr3DObjectAttribute().getReducedLineGeometry())
{
if(!mpLastRLGViewInformation ||
- (getBuffered3DDecomposition().hasElements()
+ (!getBuffered3DDecomposition().empty()
&& *mpLastRLGViewInformation != rViewInformation))
{
// conditions of last local decomposition with reduced lines have changed. Remember
// new one and clear current decompositiopn
SdrExtrudePrimitive3D* pThat = const_cast< SdrExtrudePrimitive3D* >(this);
- pThat->setBuffered3DDecomposition(Primitive3DSequence());
+ pThat->setBuffered3DDecomposition(Primitive3DContainer());
delete pThat->mpLastRLGViewInformation;
pThat->mpLastRLGViewInformation = new geometry::ViewInformation3D(rViewInformation);
}
diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
index 2f2d62118c71..d49427d092b9 100644
--- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
@@ -39,9 +39,9 @@ namespace drawinglayer
{
namespace primitive3d
{
- Primitive3DSequence SdrLathePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const
+ Primitive3DContainer SdrLathePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const
{
- Primitive3DSequence aRetval;
+ Primitive3DContainer aRetval;
// get slices
const Slice3DVector& rSliceVector = getSlices();
@@ -166,9 +166,9 @@ namespace drawinglayer
if(aNewLineGeometry.count())
{
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ const Primitive3DContainer aLines(create3DPolyPolygonLinePrimitives(
aNewLineGeometry, getTransform(), getSdrLFSAttribute().getLine()));
- appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
+ aRetval.append(aLines);
}
}
else
@@ -178,24 +178,24 @@ namespace drawinglayer
const basegfx::B3DPolyPolygon aVerLine(extractVerticalLinesFromSlice(rSliceVector));
// add horizontal lines
- const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives(
+ const Primitive3DContainer aHorLines(create3DPolyPolygonLinePrimitives(
aHorLine, getTransform(), getSdrLFSAttribute().getLine()));
- appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aHorLines);
+ aRetval.append(aHorLines);
// add vertical lines
- const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives(
+ const Primitive3DContainer aVerLines(create3DPolyPolygonLinePrimitives(
aVerLine, getTransform(), getSdrLFSAttribute().getLine()));
- appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aVerLines);
+ aRetval.append(aVerLines);
}
}
// add shadow
if(!getSdrLFSAttribute().getShadow().isDefault()
- && aRetval.hasElements())
+ && !aRetval.empty())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ const Primitive3DContainer aShadow(createShadowPrimitive3D(
aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
- appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
+ aRetval.append(aShadow);
}
}
@@ -344,18 +344,18 @@ namespace drawinglayer
return get3DRangeFromSlices(getSlices());
}
- Primitive3DSequence SdrLathePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const
+ Primitive3DContainer SdrLathePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const
{
if(getSdr3DObjectAttribute().getReducedLineGeometry())
{
if(!mpLastRLGViewInformation ||
- (getBuffered3DDecomposition().hasElements()
+ (!getBuffered3DDecomposition().empty()
&& *mpLastRLGViewInformation != rViewInformation))
{
// conditions of last local decomposition with reduced lines have changed. Remember
// new one and clear current decompositiopn
SdrLathePrimitive3D* pThat = const_cast< SdrLathePrimitive3D* >(this);
- pThat->setBuffered3DDecomposition(Primitive3DSequence());
+ pThat->setBuffered3DDecomposition(Primitive3DContainer());
delete pThat->mpLastRLGViewInformation;
pThat->mpLastRLGViewInformation = new geometry::ViewInformation3D(rViewInformation);
}
diff --git a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx
index 285de36f55a9..214a4344d292 100644
--- a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx
@@ -35,9 +35,9 @@ namespace drawinglayer
{
namespace primitive3d
{
- Primitive3DSequence SdrPolyPolygonPrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ Primitive3DContainer SdrPolyPolygonPrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
- Primitive3DSequence aRetval;
+ Primitive3DContainer aRetval;
if(getPolyPolygon3D().count())
{
@@ -103,18 +103,18 @@ namespace drawinglayer
basegfx::B3DPolyPolygon aLine(getPolyPolygon3D());
aLine.clearNormals();
aLine.clearTextureCoordinates();
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ const Primitive3DContainer aLines(create3DPolyPolygonLinePrimitives(
aLine, getTransform(), getSdrLFSAttribute().getLine()));
- appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
+ aRetval.append(aLines);
}
// add shadow
if(!getSdrLFSAttribute().getShadow().isDefault()
- && aRetval.hasElements())
+ && !aRetval.empty())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ const Primitive3DContainer aShadow(createShadowPrimitive3D(
aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
- appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
+ aRetval.append(aShadow);
}
}
diff --git a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
index e9d39e48f922..66a667982d98 100644
--- a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
@@ -38,9 +38,9 @@ namespace drawinglayer
{
namespace primitive3d
{
- Primitive3DSequence SdrSpherePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ Primitive3DContainer SdrSpherePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
- Primitive3DSequence aRetval;
+ Primitive3DContainer aRetval;
const basegfx::B3DRange aUnitRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
const bool bCreateNormals(css::drawing::NormalsKind_SPECIFIC == getSdr3DObjectAttribute().getNormalsKind()
|| css::drawing::NormalsKind_SPHERE == getSdr3DObjectAttribute().getNormalsKind());
@@ -149,18 +149,18 @@ namespace drawinglayer
if(!getSdrLFSAttribute().getLine().isDefault())
{
basegfx::B3DPolyPolygon aSphere(basegfx::tools::createSpherePolyPolygonFromB3DRange(aUnitRange, getHorizontalSegments(), getVerticalSegments()));
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ const Primitive3DContainer aLines(create3DPolyPolygonLinePrimitives(
aSphere, getTransform(), getSdrLFSAttribute().getLine()));
- appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
+ aRetval.append(aLines);
}
// add shadow
if(!getSdrLFSAttribute().getShadow().isDefault()
- && aRetval.hasElements())
+ && !aRetval.empty())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ const Primitive3DContainer aShadow(createShadowPrimitive3D(
aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
- appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
+ aRetval.append(aShadow);
}
return aRetval;
diff --git a/drawinglayer/source/primitive3d/shadowprimitive3d.cxx b/drawinglayer/source/primitive3d/shadowprimitive3d.cxx
index 782170daf46d..d99c39ae4a93 100644
--- a/drawinglayer/source/primitive3d/shadowprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/shadowprimitive3d.cxx
@@ -35,7 +35,7 @@ namespace drawinglayer
const basegfx::BColor& rShadowColor,
double fShadowTransparence,
bool bShadow3D,
- const Primitive3DSequence& rChildren)
+ const Primitive3DContainer& rChildren)
: GroupPrimitive3D(rChildren),
maShadowTransform(rShadowTransform),
maShadowColor(rShadowColor),
diff --git a/drawinglayer/source/primitive3d/textureprimitive3d.cxx b/drawinglayer/source/primitive3d/textureprimitive3d.cxx
index 674e76846c57..53587ac10817 100644
--- a/drawinglayer/source/primitive3d/textureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/textureprimitive3d.cxx
@@ -32,7 +32,7 @@ namespace drawinglayer
namespace primitive3d
{
TexturePrimitive3D::TexturePrimitive3D(
- const Primitive3DSequence& rChildren,
+ const Primitive3DContainer& rChildren,
const basegfx::B2DVector& rTextureSize,
bool bModulate, bool bFilter)
: GroupPrimitive3D(rChildren),
@@ -65,7 +65,7 @@ namespace drawinglayer
{
UnifiedTransparenceTexturePrimitive3D::UnifiedTransparenceTexturePrimitive3D(
double fTransparence,
- const Primitive3DSequence& rChildren)
+ const Primitive3DContainer& rChildren)
: TexturePrimitive3D(rChildren, basegfx::B2DVector(), false, false),
mfTransparence(fTransparence)
{
@@ -87,10 +87,10 @@ namespace drawinglayer
{
// 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);
+ return getChildren().getB3DRange(rViewInformation);
}
- Primitive3DSequence UnifiedTransparenceTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ Primitive3DContainer UnifiedTransparenceTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
if(0.0 == getTransparence())
{
@@ -103,12 +103,12 @@ namespace drawinglayer
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 TransparenceTexturePrimitive3D(aFillGradient, getChildren(), getTextureSize()));
- return Primitive3DSequence(&xRef, 1L);
+ return { xRef };
}
else
{
// completely transparent or invalid definition, add nothing
- return Primitive3DSequence();
+ return Primitive3DContainer();
}
}
@@ -126,7 +126,7 @@ namespace drawinglayer
{
GradientTexturePrimitive3D::GradientTexturePrimitive3D(
const attribute::FillGradientAttribute& rGradient,
- const Primitive3DSequence& rChildren,
+ const Primitive3DContainer& rChildren,
const basegfx::B2DVector& rTextureSize,
bool bModulate,
bool bFilter)
@@ -161,7 +161,7 @@ namespace drawinglayer
{
BitmapTexturePrimitive3D::BitmapTexturePrimitive3D(
const attribute::FillGraphicAttribute& rFillGraphicAttribute,
- const Primitive3DSequence& rChildren,
+ const Primitive3DContainer& rChildren,
const basegfx::B2DVector& rTextureSize,
bool bModulate, bool bFilter)
: TexturePrimitive3D(rChildren, rTextureSize, bModulate, bFilter),
@@ -195,7 +195,7 @@ namespace drawinglayer
{
TransparenceTexturePrimitive3D::TransparenceTexturePrimitive3D(
const attribute::FillGradientAttribute& rGradient,
- const Primitive3DSequence& rChildren,
+ const Primitive3DContainer& rChildren,
const basegfx::B2DVector& rTextureSize)
: GradientTexturePrimitive3D(rGradient, rChildren, rTextureSize, false, false)
{
diff --git a/drawinglayer/source/primitive3d/transformprimitive3d.cxx b/drawinglayer/source/primitive3d/transformprimitive3d.cxx
index 8f155418730e..f0351dace8da 100644
--- a/drawinglayer/source/primitive3d/transformprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/transformprimitive3d.cxx
@@ -33,7 +33,7 @@ namespace drawinglayer
{
TransformPrimitive3D::TransformPrimitive3D(
const basegfx::B3DHomMatrix& rTransformation,
- const Primitive3DSequence& rChildren)
+ const Primitive3DContainer& rChildren)
: GroupPrimitive3D(rChildren),
maTransformation(rTransformation)
{
@@ -53,7 +53,7 @@ namespace drawinglayer
basegfx::B3DRange TransformPrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const
{
- basegfx::B3DRange aRetval(getB3DRangeFromPrimitive3DSequence(getChildren(), rViewInformation));
+ basegfx::B3DRange aRetval(getChildren().getB3DRange(rViewInformation));
aRetval.transform(getTransformation());
return aRetval;
}
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index cda04f3df7a8..190778e2ae39 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -183,14 +183,13 @@ namespace drawinglayer
if(!aFront.equal(aBack))
{
- const primitive3d::Primitive3DSequence& rPrimitives = rCandidate.getChildren3D();
+ const primitive3d::Primitive3DContainer& rPrimitives = rCandidate.getChildren3D();
- if(rPrimitives.hasElements())
+ if(!rPrimitives.empty())
{
// make BoundVolume empty and overlapping test for speedup
const basegfx::B3DRange aObjectRange(
- drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(
- rPrimitives, rObjectViewInformation3D));
+ rPrimitives.getB3DRange(rObjectViewInformation3D));
if(!aObjectRange.isEmpty())
{
diff --git a/drawinglayer/source/processor3d/baseprocessor3d.cxx b/drawinglayer/source/processor3d/baseprocessor3d.cxx
index c6d92b1b000e..29832785ee54 100644
--- a/drawinglayer/source/processor3d/baseprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/baseprocessor3d.cxx
@@ -18,6 +18,7 @@
*/
#include <drawinglayer/processor3d/baseprocessor3d.hxx>
+#include <comphelper/sequence.hxx>
@@ -42,13 +43,13 @@ namespace drawinglayer
{
}
- void BaseProcessor3D::process(const primitive3d::Primitive3DSequence& rSource)
+ void BaseProcessor3D::process(const primitive3d::Primitive3DContainer& rSource)
{
- if(rSource.hasElements())
+ if(!rSource.empty())
{
- const sal_Int32 nCount(rSource.getLength());
+ const size_t nCount(rSource.size());
- for(sal_Int32 a(0L); a < nCount; a++)
+ for(size_t a(0L); a < nCount; a++)
{
// get reference
const primitive3d::Primitive3DReference xReference(rSource[a]);
@@ -66,7 +67,7 @@ namespace drawinglayer
{
// unknown implementation, use UNO API call instead and process recursively
const uno::Sequence< beans::PropertyValue >& rViewParameters(getViewInformation3D().getViewInformationSequence());
- process(xReference->getDecomposition(rViewParameters));
+ process(comphelper::sequenceToContainer<primitive3d::Primitive3DContainer>(xReference->getDecomposition(rViewParameters)));
}
}
}
diff --git a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx
index 0daeb529cd76..6a1fc2a3b950 100644
--- a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx
@@ -120,9 +120,9 @@ namespace drawinglayer
// so force this primitive to process its children directly if the switch is set
// (which is the default). Else, ignore invisible content
const primitive3d::HiddenGeometryPrimitive3D& rHiddenGeometry(static_cast< const primitive3d::HiddenGeometryPrimitive3D& >(rCandidate));
- const primitive3d::Primitive3DSequence& rChildren = rHiddenGeometry.getChildren();
+ const primitive3d::Primitive3DContainer& rChildren = rHiddenGeometry.getChildren();
- if(rChildren.hasElements())
+ if(!rChildren.empty())
{
if(getUseInvisiblePrimitiveContent())
{
@@ -135,9 +135,9 @@ namespace drawinglayer
case PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D :
{
const primitive3d::UnifiedTransparenceTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::UnifiedTransparenceTexturePrimitive3D& >(rCandidate);
- const primitive3d::Primitive3DSequence rChildren = rPrimitive.getChildren();
+ const primitive3d::Primitive3DContainer rChildren = rPrimitive.getChildren();
- if(rChildren.getLength())
+ if(rChildren.size())
{
if(1.0 <= rPrimitive.getTransparence())
{
diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
index 38b53d00d045..0f572e71b415 100644
--- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
@@ -49,9 +49,9 @@ namespace drawinglayer
{
void DefaultProcessor3D::impRenderGradientTexturePrimitive3D(const primitive3d::GradientTexturePrimitive3D& rPrimitive, bool bTransparence)
{
- const primitive3d::Primitive3DSequence& rSubSequence = rPrimitive.getChildren();
+ const primitive3d::Primitive3DContainer& rSubSequence = rPrimitive.getChildren();
- if(rSubSequence.hasElements())
+ if(!rSubSequence.empty())
{
// rescue values
const bool bOldModulate(getModulate()); mbModulate = rPrimitive.getModulate();
@@ -212,9 +212,9 @@ namespace drawinglayer
void DefaultProcessor3D::impRenderHatchTexturePrimitive3D(const primitive3d::HatchTexturePrimitive3D& rPrimitive)
{
- const primitive3d::Primitive3DSequence& rSubSequence = rPrimitive.getChildren();
+ const primitive3d::Primitive3DContainer& rSubSequence = rPrimitive.getChildren();
- if(rSubSequence.hasElements())
+ if(!rSubSequence.empty())
{
// rescue values
const bool bOldModulate(getModulate()); mbModulate = rPrimitive.getModulate();
@@ -253,9 +253,9 @@ namespace drawinglayer
void DefaultProcessor3D::impRenderBitmapTexturePrimitive3D(const primitive3d::BitmapTexturePrimitive3D& rPrimitive)
{
- const primitive3d::Primitive3DSequence& rSubSequence = rPrimitive.getChildren();
+ const primitive3d::Primitive3DContainer& rSubSequence = rPrimitive.getChildren();
- if(rSubSequence.hasElements())
+ if(!rSubSequence.empty())
{
// rescue values
const bool bOldModulate(getModulate()); mbModulate = rPrimitive.getModulate();
@@ -304,9 +304,9 @@ namespace drawinglayer
void DefaultProcessor3D::impRenderModifiedColorPrimitive3D(const primitive3d::ModifiedColorPrimitive3D& rModifiedCandidate)
{
- const primitive3d::Primitive3DSequence& rSubSequence = rModifiedCandidate.getChildren();
+ const primitive3d::Primitive3DContainer& rSubSequence = rModifiedCandidate.getChildren();
- if(rSubSequence.hasElements())
+ if(!rSubSequence.empty())
{
// put modifier on stack
maBColorModifierStack.push(rModifiedCandidate.getColorModifier());
diff --git a/drawinglayer/source/processor3d/geometry2dextractor.cxx b/drawinglayer/source/processor3d/geometry2dextractor.cxx
index f7155b1dc335..db304fd6e8ef 100644
--- a/drawinglayer/source/processor3d/geometry2dextractor.cxx
+++ b/drawinglayer/source/processor3d/geometry2dextractor.cxx
@@ -73,9 +73,9 @@ namespace drawinglayer
{
// ModifiedColorPrimitive3D; push, process and pop
const primitive3d::ModifiedColorPrimitive3D& rModifiedCandidate = static_cast< const primitive3d::ModifiedColorPrimitive3D& >(rCandidate);
- const primitive3d::Primitive3DSequence& rSubSequence = rModifiedCandidate.getChildren();
+ const primitive3d::Primitive3DContainer& rSubSequence = rModifiedCandidate.getChildren();
- if(rSubSequence.hasElements())
+ if(!rSubSequence.empty())
{
maBColorModifierStack.push(rModifiedCandidate.getColorModifier());
process(rModifiedCandidate.getChildren());
@@ -121,9 +121,9 @@ namespace drawinglayer
{
// TexturePrimitive3D: Process children, do not try to decompose
const primitive3d::TexturePrimitive3D& rTexturePrimitive = static_cast< const primitive3d::TexturePrimitive3D& >(rCandidate);
- const primitive3d::Primitive3DSequence aChildren(rTexturePrimitive.getChildren());
+ const primitive3d::Primitive3DContainer aChildren(rTexturePrimitive.getChildren());
- if(aChildren.hasElements())
+ if(!aChildren.empty())
{
process(aChildren);
}