37 class MinimalDephInViewExtractor :
public BaseProcessor3D
45 virtual void processBasePrimitive3D(
const primitive3d::BasePrimitive3D& rCandidate)
override;
48 explicit MinimalDephInViewExtractor(
const geometry::ViewInformation3D& rViewInformation)
49 : BaseProcessor3D(rViewInformation),
59 void MinimalDephInViewExtractor::processBasePrimitive3D(
const primitive3d::BasePrimitive3D& rCandidate)
62 switch(rCandidate.getPrimitive3DID())
67 const primitive3d::TransformPrimitive3D& rPrimitive =
static_cast< const primitive3d::TransformPrimitive3D&
>(rCandidate);
68 const geometry::ViewInformation3D aLastViewInformation3D(getViewInformation3D());
71 const geometry::ViewInformation3D aNewViewInformation3D(
72 aLastViewInformation3D.getObjectTransformation() * rPrimitive.getTransformation(),
73 aLastViewInformation3D.getOrientation(),
74 aLastViewInformation3D.getProjection(),
75 aLastViewInformation3D.getDeviceToView(),
76 aLastViewInformation3D.getViewTime(),
77 aLastViewInformation3D.getExtendedInformationSequence());
78 updateViewInformation(aNewViewInformation3D);
81 process(rPrimitive.getChildren());
84 updateViewInformation(aLastViewInformation3D);
90 const primitive3d::PolygonHairlinePrimitive3D& rPrimitive =
static_cast< const primitive3d::PolygonHairlinePrimitive3D&
>(rCandidate);
109 const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive =
static_cast< const primitive3d::PolyPolygonMaterialPrimitive3D&
>(rCandidate);
111 const sal_uInt32 nPolyCount(rPolyPolygon.
count());
113 for(sal_uInt32
a(0);
a < nPolyCount;
a++)
116 const sal_uInt32
nCount(aPolygon.count());
118 for(sal_uInt32 b(0); b <
nCount; b++)
120 const basegfx::B3DPoint aPointInView(getViewInformation3D().getObjectToView() * aPolygon.getB3DPoint(b));
134 process(rCandidate.get3DDecomposition(getViewInformation3D()));
155 double fRetval(DBL_MAX);
157 if(!aPrimitives.empty())
176 while(pParentScene && pParentScene != pScene)
178 aInBetweenSceneMatrix = pParentScene->
GetTransform() * aInBetweenSceneMatrix;
192 drawinglayer::processor3d::MinimalDephInViewExtractor aExtractor(aNewViewInformation3D);
193 aExtractor.process(aPrimitives);
194 fRetval = aExtractor.getMinimalDepth();
const basegfx::B3DHomMatrix & GetTransform() const
virtual E3dScene * getRootE3dSceneFromE3dObject() const
E3dScene * getParentE3dSceneFromE3dObject() const
sdr::contact::ViewContact & GetViewContact() const
B3DPolygon const & getB3DPolygon(sal_uInt32 nIndex) const
B3DPoint const & getB3DPoint(sal_uInt32 nIndex) const
#define PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D
#define PRIMITIVE3D_ID_POLYGONHAIRLINEPRIMITIVE3D
#define PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D
double getMinimalDepthInViewCoordinates(const E3dCompoundObject &rObject)
support extracting the minimal depth of a 3d object in its scene