summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-11-08 22:11:33 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-11-08 22:17:48 -0500
commit9229170920ab770624415c4330da57af5b1b5398 (patch)
treef919af4ad0ca25a297b2aae6518c13280f5ad50e
parenta305869e99a73626534a921c36eb352cd74582a5 (diff)
Unindent.
Change-Id: I98b5a0b91c92e58bae3caa69a4ed35c72dc839dd
-rw-r--r--include/svx/sdr/contact/objectcontactofobjlistpainter.hxx165
-rw-r--r--include/svx/sdr/contact/viewcontactofe3d.hxx117
-rw-r--r--include/svx/sdr/contact/viewcontactofe3dscene.hxx131
-rw-r--r--include/svx/sdr/contact/viewcontactofpageobj.hxx53
-rw-r--r--include/svx/sdr/contact/viewcontactofsdrmediaobj.hxx65
-rw-r--r--include/svx/sdr/contact/viewcontactofsdrrectobj.hxx41
-rw-r--r--include/svx/sdr/contact/viewcontactoftextobj.hxx33
-rw-r--r--include/svx/sdr/contact/viewcontactofvirtobj.hxx52
-rw-r--r--include/svx/sdr/contact/viewobjectcontactofpageobj.hxx45
-rw-r--r--include/svx/sdr/contact/viewobjectcontactredirector.hxx49
-rw-r--r--svx/source/sdr/contact/objectcontactofobjlistpainter.cxx281
-rw-r--r--svx/source/sdr/contact/viewcontactofe3d.cxx270
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dscene.cxx699
-rw-r--r--svx/source/sdr/contact/viewcontactofpageobj.cxx83
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx90
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrrectobj.cxx109
-rw-r--r--svx/source/sdr/contact/viewcontactoftextobj.cxx25
-rw-r--r--svx/source/sdr/contact/viewcontactofvirtobj.cxx141
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofpageobj.cxx544
-rw-r--r--svx/source/sdr/contact/viewobjectcontactredirector.cxx34
20 files changed, 1423 insertions, 1604 deletions
diff --git a/include/svx/sdr/contact/objectcontactofobjlistpainter.hxx b/include/svx/sdr/contact/objectcontactofobjlistpainter.hxx
index 7489cfffe131..9ff322ff7e33 100644
--- a/include/svx/sdr/contact/objectcontactofobjlistpainter.hxx
+++ b/include/svx/sdr/contact/objectcontactofobjlistpainter.hxx
@@ -24,119 +24,96 @@
#include <svx/svxdllapi.h>
#include <svx/svdpage.hxx>
-
-// predeclarations
-
class SdrPage;
class SdrObject;
+namespace sdr { namespace contact {
-
-namespace sdr
+class SVX_DLLPUBLIC ObjectContactPainter : public ObjectContact
{
- namespace contact
- {
- class SVX_DLLPUBLIC ObjectContactPainter : public ObjectContact
- {
- protected:
- // Hierarchy access methods
- virtual sal_uInt32 GetPaintObjectCount() const = 0;
- virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const = 0;
-
- public:
- // basic constructor/destructor
- ObjectContactPainter();
- virtual ~ObjectContactPainter();
- };
- } // end of namespace contact
-} // end of namespace sdr
-
-
-
-namespace sdr
-{
- namespace contact
- {
- // typedef for transferring SdrObject
- typedef ::std::vector< SdrObject* > SdrObjectVector;
+protected:
+ // Hierarchy access methods
+ virtual sal_uInt32 GetPaintObjectCount() const = 0;
+ virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const = 0;
- class SVX_DLLPUBLIC ObjectContactOfObjListPainter : public ObjectContactPainter
- {
- protected:
- // Target OutputDevice
- OutputDevice& mrTargetOutputDevice;
+public:
+ // basic constructor/destructor
+ ObjectContactPainter();
+ virtual ~ObjectContactPainter();
+};
- // Set StartPoint for next run, also given in constructor
- SdrObjectVector maStartObjects;
+// typedef for transferring SdrObject
+typedef ::std::vector< SdrObject* > SdrObjectVector;
- // the processed page which is the base e.g. for PageNumberFields
- const SdrPage* mpProcessedPage;
+class SVX_DLLPUBLIC ObjectContactOfObjListPainter : public ObjectContactPainter
+{
+protected:
+ // Target OutputDevice
+ OutputDevice& mrTargetOutputDevice;
- // Hierarchy access methods
- virtual sal_uInt32 GetPaintObjectCount() const SAL_OVERRIDE;
- virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const SAL_OVERRIDE;
+ // Set StartPoint for next run, also given in constructor
+ SdrObjectVector maStartObjects;
- public:
- // basic constructor/destructor
- ObjectContactOfObjListPainter(
- OutputDevice& rTargetDevice,
- const SdrObjectVector& rObjects,
- const SdrPage* pProcessedPage);
- virtual ~ObjectContactOfObjListPainter();
+ // the processed page which is the base e.g. for PageNumberFields
+ const SdrPage* mpProcessedPage;
- // Process the whole displaying
- virtual void ProcessDisplay(DisplayInfo& rDisplayInfo) SAL_OVERRIDE;
+ // Hierarchy access methods
+ virtual sal_uInt32 GetPaintObjectCount() const SAL_OVERRIDE;
+ virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const SAL_OVERRIDE;
- // VirtualDevice? Default is false
- virtual bool isOutputToVirtualDevice() const SAL_OVERRIDE;
+public:
+ // basic constructor/destructor
+ ObjectContactOfObjListPainter(
+ OutputDevice& rTargetDevice,
+ const SdrObjectVector& rObjects,
+ const SdrPage* pProcessedPage);
+ virtual ~ObjectContactOfObjListPainter();
- // recording MetaFile? Default is false
- virtual bool isOutputToRecordingMetaFile() const SAL_OVERRIDE;
+ // Process the whole displaying
+ virtual void ProcessDisplay(DisplayInfo& rDisplayInfo) SAL_OVERRIDE;
- // pdf export? Default is false
- virtual bool isOutputToPDFFile() const SAL_OVERRIDE;
+ // VirtualDevice? Default is false
+ virtual bool isOutputToVirtualDevice() const SAL_OVERRIDE;
- // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
- virtual OutputDevice* TryToGetOutputDevice() const SAL_OVERRIDE;
- };
- } // end of namespace contact
-} // end of namespace sdr
+ // recording MetaFile? Default is false
+ virtual bool isOutputToRecordingMetaFile() const SAL_OVERRIDE;
+ // pdf export? Default is false
+ virtual bool isOutputToPDFFile() const SAL_OVERRIDE;
+ // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
+ virtual OutputDevice* TryToGetOutputDevice() const SAL_OVERRIDE;
+};
-namespace sdr
+class ObjectContactOfPagePainter : public ObjectContactPainter
{
- namespace contact
- {
- class ObjectContactOfPagePainter : public ObjectContactPainter
- {
- protected:
- // the original ObjectContact this painter is working on
- ObjectContact& mrOriginalObjectContact;
-
- // Set StartPoint for next run, also given in constructor
- SdrPageWeakRef mxStartPage;
-
- // Hierarchy access methods
- virtual sal_uInt32 GetPaintObjectCount() const SAL_OVERRIDE;
- virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const SAL_OVERRIDE;
-
- public:
- // basic constructor
- ObjectContactOfPagePainter(
- const SdrPage* pPage,
- ObjectContact& rOriginalObjectContact);
- virtual ~ObjectContactOfPagePainter();
-
- // set another page
- void SetStartPage(const SdrPage* pPage);
- const SdrPage* GetStartPage() const { return mxStartPage.get(); }
-
- // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
- virtual OutputDevice* TryToGetOutputDevice() const SAL_OVERRIDE;
- };
- } // end of namespace contact
-} // end of namespace sdr
+protected:
+ // the original ObjectContact this painter is working on
+ ObjectContact& mrOriginalObjectContact;
+
+ // Set StartPoint for next run, also given in constructor
+ SdrPageWeakRef mxStartPage;
+
+ // Hierarchy access methods
+ virtual sal_uInt32 GetPaintObjectCount() const SAL_OVERRIDE;
+ virtual ViewContact& GetPaintObjectViewContact(sal_uInt32 nIndex) const SAL_OVERRIDE;
+
+public:
+ // basic constructor
+ ObjectContactOfPagePainter(
+ const SdrPage* pPage,
+ ObjectContact& rOriginalObjectContact);
+ virtual ~ObjectContactOfPagePainter();
+
+ // set another page
+ void SetStartPage(const SdrPage* pPage);
+ const SdrPage* GetStartPage() const { return mxStartPage.get(); }
+
+ // access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
+ virtual OutputDevice* TryToGetOutputDevice() const SAL_OVERRIDE;
+};
+
+}}
diff --git a/include/svx/sdr/contact/viewcontactofe3d.hxx b/include/svx/sdr/contact/viewcontactofe3d.hxx
index d30c3006a7dc..e59e1576dfaa 100644
--- a/include/svx/sdr/contact/viewcontactofe3d.hxx
+++ b/include/svx/sdr/contact/viewcontactofe3d.hxx
@@ -24,13 +24,6 @@
#include <svx/sdr/contact/viewcontactofsdrobj.hxx>
#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
-
-// predeclarations
-
-namespace sdr { namespace contact {
- class ViewContactOfE3dScene;
-}}
-
namespace drawinglayer { namespace attribute {
class SdrLineAttribute;
}}
@@ -40,66 +33,64 @@ namespace basegfx {
class B3DHomMatrix;
}
+namespace sdr { namespace contact {
+class ViewContactOfE3dScene;
-namespace sdr
+class ViewContactOfE3d : public ViewContactOfSdrObj
{
- namespace contact
+protected:
+ // Create a Object-Specific ViewObjectContact, set ViewContact and
+ // ObjectContact. Always needs to return something.
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) SAL_OVERRIDE;
+
+public:
+ // basic constructor, used from E3dObject.
+ explicit ViewContactOfE3d(E3dObject& rObj);
+ virtual ~ViewContactOfE3d();
+
+ // access to E3dObject
+ const E3dObject& GetE3dObject() const
{
- class ViewContactOfE3d : public ViewContactOfSdrObj
- {
- protected:
- // Create a Object-Specific ViewObjectContact, set ViewContact and
- // ObjectContact. Always needs to return something.
- virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) SAL_OVERRIDE;
-
- public:
- // basic constructor, used from E3dObject.
- explicit ViewContactOfE3d(E3dObject& rObj);
- virtual ~ViewContactOfE3d();
-
- // access to E3dObject
- const E3dObject& GetE3dObject() const
- {
- return static_cast<const E3dObject&>(GetSdrObject());
- }
-
- // public helpers
- drawinglayer::primitive2d::Primitive2DSequence impCreateWithGivenPrimitive3DSequence(
- const drawinglayer::primitive3d::Primitive3DSequence& rxContent3D) const;
-
-
- // primitive stuff
-
- protected:
- // Primitive3DSequence of the ViewContact. This contains all necessary information
- // for the graphical visualisation and needs to be supported by all 3D VCs which
- // can be visualized. It does NOT contain the object transformation to be able to
- // buffer for all possible usages
- drawinglayer::primitive3d::Primitive3DSequence mxViewIndependentPrimitive3DSequence;
-
- // This method is responsible for creating the graphical visualisation data which is
- // stored in mxViewIndependentPrimitive3DSequence, but without object transformation
- virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const = 0;
-
- // This method is responsible for creating the graphical visualisation data derived ONLY from
- // the model data. The default implementation will try to create a 3D to 2D embedding (will work
- // when scene is known) which can then be used for 2D processing concerning ranges
- virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const SAL_OVERRIDE;
-
- public:
- // access to the local primitive without the object's local 3D transform. This is e.g. needed
- // to get the not-yet transformed BoundVolume for e.g. interactions
- drawinglayer::primitive3d::Primitive3DSequence getVIP3DSWithoutObjectTransform() const;
-
- // access to the local primitive. This will ensure that the list is
- // current in comparing the local list content with a fresh created incarnation. It will
- // use getVIP3DSWithoutObjectTransform and embed to 3d transform primitive when object's
- // local 3d transform is used
- drawinglayer::primitive3d::Primitive3DSequence getViewIndependentPrimitive3DSequence() const;
- };
- } // end of namespace contact
-} // end of namespace sdr
+ return static_cast<const E3dObject&>(GetSdrObject());
+ }
+
+ // public helpers
+ drawinglayer::primitive2d::Primitive2DSequence impCreateWithGivenPrimitive3DSequence(
+ const drawinglayer::primitive3d::Primitive3DSequence& rxContent3D) const;
+
+
+ // primitive stuff
+
+protected:
+ // Primitive3DSequence of the ViewContact. This contains all necessary information
+ // for the graphical visualisation and needs to be supported by all 3D VCs which
+ // can be visualized. It does NOT contain the object transformation to be able to
+ // buffer for all possible usages
+ drawinglayer::primitive3d::Primitive3DSequence mxViewIndependentPrimitive3DSequence;
+
+ // This method is responsible for creating the graphical visualisation data which is
+ // stored in mxViewIndependentPrimitive3DSequence, but without object transformation
+ virtual drawinglayer::primitive3d::Primitive3DSequence createViewIndependentPrimitive3DSequence() const = 0;
+
+ // This method is responsible for creating the graphical visualisation data derived ONLY from
+ // the model data. The default implementation will try to create a 3D to 2D embedding (will work
+ // when scene is known) which can then be used for 2D processing concerning ranges
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const SAL_OVERRIDE;
+
+public:
+ // access to the local primitive without the object's local 3D transform. This is e.g. needed
+ // to get the not-yet transformed BoundVolume for e.g. interactions
+ drawinglayer::primitive3d::Primitive3DSequence getVIP3DSWithoutObjectTransform() const;
+
+ // access to the local primitive. This will ensure that the list is
+ // current in comparing the local list content with a fresh created incarnation. It will
+ // use getVIP3DSWithoutObjectTransform and embed to 3d transform primitive when object's
+ // local 3d transform is used
+ drawinglayer::primitive3d::Primitive3DSequence getViewIndependentPrimitive3DSequence() const;
+};
+
+}}
diff --git a/include/svx/sdr/contact/viewcontactofe3dscene.hxx b/include/svx/sdr/contact/viewcontactofe3dscene.hxx
index dca13e268269..ac47997c4a4e 100644
--- a/include/svx/sdr/contact/viewcontactofe3dscene.hxx
+++ b/include/svx/sdr/contact/viewcontactofe3dscene.hxx
@@ -28,85 +28,76 @@
#include <drawinglayer/geometry/viewinformation3d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
-
-// predeclarations
-
namespace basegfx {
class B3DRange;
}
+namespace sdr { namespace contact {
-
-namespace sdr
+class SVX_DLLPUBLIC ViewContactOfE3dScene : public ViewContactOfSdrObj
{
- namespace contact
+protected:
+ // Create a Object-Specific ViewObjectContact, set ViewContact and
+ // ObjectContact. Always needs to return something. Default is to create
+ // a standard ViewObjectContact containing the given ObjectContact and *this
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) SAL_OVERRIDE;
+
+public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfE3dScene(E3dScene& rScene);
+
+ // access to SdrObject
+ const E3dScene& GetE3dScene() const
{
- class SVX_DLLPUBLIC ViewContactOfE3dScene : public ViewContactOfSdrObj
- {
- protected:
- // Create a Object-Specific ViewObjectContact, set ViewContact and
- // ObjectContact. Always needs to return something. Default is to create
- // a standard ViewObjectContact containing the given ObjectContact and *this
- virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) SAL_OVERRIDE;
-
- public:
- // basic constructor, used from SdrObject.
- explicit ViewContactOfE3dScene(E3dScene& rScene);
-
- // access to SdrObject
- const E3dScene& GetE3dScene() const
- {
- return static_cast<const E3dScene&>(GetSdrObject());
- }
-
- // React on changes of the object of this ViewContact
- virtual void ActionChanged() SAL_OVERRIDE;
-
- // access to ViewInformation3D and ObjectTransformation
- const drawinglayer::geometry::ViewInformation3D& getViewInformation3D(const ::basegfx::B3DRange& rContentRange) const;
- const drawinglayer::geometry::ViewInformation3D& getViewInformation3D() const;
- const basegfx::B2DHomMatrix& getObjectTransformation() const;
-
- // attribute providers
- const drawinglayer::attribute::SdrSceneAttribute& getSdrSceneAttribute() const;
- const drawinglayer::attribute::SdrLightingAttribute& getSdrLightingAttribute() const;
-
- // scene primitive creators. If pLayerVisibility is given, a visibility test with the LayerID and the
- // given SetOfByte is done.
- drawinglayer::primitive2d::Primitive2DSequence createScenePrimitive2DSequence(const SetOfByte* pLayerVisibility) const;
-
- // helpers to get the sequence of all contained 3D primitives and its range,
- // regardless of layer or visibility constraints and using a neutral ViewInformation3D
- drawinglayer::primitive3d::Primitive3DSequence getAllPrimitive3DSequence() const;
- basegfx::B3DRange getAllContentRange3D() const;
-
- protected:
- // the 3d transformation stack
- drawinglayer::geometry::ViewInformation3D maViewInformation3D;
-
- // the object transformation
- basegfx::B2DHomMatrix maObjectTransformation;
-
- // attributes
- drawinglayer::attribute::SdrSceneAttribute maSdrSceneAttribute;
- drawinglayer::attribute::SdrLightingAttribute maSdrLightingAttribute;
-
- // create methods for ViewInformation3D and ObjectTransformation
- void createViewInformation3D(const ::basegfx::B3DRange& rContentRange);
- void createObjectTransformation();
-
- // attribute creators
- void createSdrSceneAttribute();
- void createSdrLightingAttribute();
-
- // This method is responsible for creating the graphical visualisation data
- // ONLY based on model data
- virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const SAL_OVERRIDE;
- };
- } // end of namespace contact
-} // end of namespace sdr
+ return static_cast<const E3dScene&>(GetSdrObject());
+ }
+
+ // React on changes of the object of this ViewContact
+ virtual void ActionChanged() SAL_OVERRIDE;
+
+ // access to ViewInformation3D and ObjectTransformation
+ const drawinglayer::geometry::ViewInformation3D& getViewInformation3D(const ::basegfx::B3DRange& rContentRange) const;
+ const drawinglayer::geometry::ViewInformation3D& getViewInformation3D() const;
+ const basegfx::B2DHomMatrix& getObjectTransformation() const;
+
+ // attribute providers
+ const drawinglayer::attribute::SdrSceneAttribute& getSdrSceneAttribute() const;
+ const drawinglayer::attribute::SdrLightingAttribute& getSdrLightingAttribute() const;
+
+ // scene primitive creators. If pLayerVisibility is given, a visibility test with the LayerID and the
+ // given SetOfByte is done.
+ drawinglayer::primitive2d::Primitive2DSequence createScenePrimitive2DSequence(const SetOfByte* pLayerVisibility) const;
+
+ // helpers to get the sequence of all contained 3D primitives and its range,
+ // regardless of layer or visibility constraints and using a neutral ViewInformation3D
+ drawinglayer::primitive3d::Primitive3DSequence getAllPrimitive3DSequence() const;
+ basegfx::B3DRange getAllContentRange3D() const;
+
+protected:
+ // the 3d transformation stack
+ drawinglayer::geometry::ViewInformation3D maViewInformation3D;
+
+ // the object transformation
+ basegfx::B2DHomMatrix maObjectTransformation;
+
+ // attributes
+ drawinglayer::attribute::SdrSceneAttribute maSdrSceneAttribute;
+ drawinglayer::attribute::SdrLightingAttribute maSdrLightingAttribute;
+
+ // create methods for ViewInformation3D and ObjectTransformation
+ void createViewInformation3D(const ::basegfx::B3DRange& rContentRange);
+ void createObjectTransformation();
+
+ // attribute creators
+ void createSdrSceneAttribute();
+ void createSdrLightingAttribute();
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const SAL_OVERRIDE;
+};
+}}
#endif // INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFE3DSCENE_HXX
diff --git a/include/svx/sdr/contact/viewcontactofpageobj.hxx b/include/svx/sdr/contact/viewcontactofpageobj.hxx
index a495f091542c..d4a5d5177d62 100644
--- a/include/svx/sdr/contact/viewcontactofpageobj.hxx
+++ b/include/svx/sdr/contact/viewcontactofpageobj.hxx
@@ -24,42 +24,35 @@
#include <svx/svxdllapi.h>
#include <svx/svdopage.hxx>
-
-// predeclarations
-
class SdrPage;
+namespace sdr { namespace contact {
-
-namespace sdr
+class SVX_DLLPUBLIC ViewContactOfPageObj : public ViewContactOfSdrObj
{
- namespace contact
+protected:
+ // Create a Object-Specific ViewObjectContact, set ViewContact and
+ // ObjectContact. Always needs to return something.
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) SAL_OVERRIDE;
+
+ // create graphical visualisation data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const SAL_OVERRIDE;
+public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfPageObj(SdrPageObj& rPageObj);
+ virtual ~ViewContactOfPageObj();
+
+ // #WIP# React on changes of the object of this ViewContact
+ virtual void ActionChanged() SAL_OVERRIDE;
+
+ // access to SdrObject
+ const SdrPageObj& GetPageObj() const
{
- class SVX_DLLPUBLIC ViewContactOfPageObj : public ViewContactOfSdrObj
- {
- protected:
- // Create a Object-Specific ViewObjectContact, set ViewContact and
- // ObjectContact. Always needs to return something.
- virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) SAL_OVERRIDE;
-
- // create graphical visualisation data
- virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const SAL_OVERRIDE;
- public:
- // basic constructor, used from SdrObject.
- explicit ViewContactOfPageObj(SdrPageObj& rPageObj);
- virtual ~ViewContactOfPageObj();
-
- // #WIP# React on changes of the object of this ViewContact
- virtual void ActionChanged() SAL_OVERRIDE;
+ return static_cast<const SdrPageObj&>(GetSdrObject());
+ }
+};
- // access to SdrObject
- const SdrPageObj& GetPageObj() const
- {
- return static_cast<const SdrPageObj&>(GetSdrObject());
- }
- };
- } // end of namespace contact
-} // end of namespace sdr
+}}
diff --git a/include/svx/sdr/contact/viewcontactofsdrmediaobj.hxx b/include/svx/sdr/contact/viewcontactofsdrmediaobj.hxx
index 223eff49c9b4..07b82f51f46c 100644
--- a/include/svx/sdr/contact/viewcontactofsdrmediaobj.hxx
+++ b/include/svx/sdr/contact/viewcontactofsdrmediaobj.hxx
@@ -25,56 +25,49 @@
#include <svx/svdomedia.hxx>
#include <tools/gen.hxx>
-
-// predeclarations
-
namespace avmedia { class MediaItem; }
+namespace sdr { namespace contact {
-
-namespace sdr
+class SVX_DLLPUBLIC ViewContactOfSdrMediaObj : public ViewContactOfSdrObj
{
- namespace contact
- {
- class SVX_DLLPUBLIC ViewContactOfSdrMediaObj : public ViewContactOfSdrObj
- {
- friend class ViewObjectContactOfSdrMediaObj;
+ friend class ViewObjectContactOfSdrMediaObj;
+
+public:
- public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfSdrMediaObj( SdrMediaObj& rMediaObj );
+ virtual ~ViewContactOfSdrMediaObj();
- // basic constructor, used from SdrObject.
- explicit ViewContactOfSdrMediaObj( SdrMediaObj& rMediaObj );
- virtual ~ViewContactOfSdrMediaObj();
+public:
- public:
+ // access to SdrMediaObj
+ const SdrMediaObj& GetSdrMediaObj() const
+ {
+ return static_cast<const SdrMediaObj&>(GetSdrObject());
+ }
- // access to SdrMediaObj
- const SdrMediaObj& GetSdrMediaObj() const
- {
- return static_cast<const SdrMediaObj&>(GetSdrObject());
- }
+ Size getPreferredSize() const;
- Size getPreferredSize() const;
+ void updateMediaItem( ::avmedia::MediaItem& rItem ) const;
+ void executeMediaItem( const ::avmedia::MediaItem& rItem );
- void updateMediaItem( ::avmedia::MediaItem& rItem ) const;
- void executeMediaItem( const ::avmedia::MediaItem& rItem );
+protected:
- protected:
+ // Create a Object-Specific ViewObjectContact, set ViewContact and
+ // ObjectContact. Always needs to return something.
+ virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) SAL_OVERRIDE;
- // Create a Object-Specific ViewObjectContact, set ViewContact and
- // ObjectContact. Always needs to return something.
- virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) SAL_OVERRIDE;
+ // get notified if some properties have changed
+ virtual void mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState );
- // get notified if some properties have changed
- virtual void mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState );
+protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const SAL_OVERRIDE;
+};
- protected:
- // This method is responsible for creating the graphical visualisation data
- // ONLY based on model data
- virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const SAL_OVERRIDE;
- };
- } // end of namespace contact
-} // end of namespace sdr
+}}
diff --git a/include/svx/sdr/contact/viewcontactofsdrrectobj.hxx b/include/svx/sdr/contact/viewcontactofsdrrectobj.hxx
index 9bad53a0d0d1..2b6e02e848e8 100644
--- a/include/svx/sdr/contact/viewcontactofsdrrectobj.hxx
+++ b/include/svx/sdr/contact/viewcontactofsdrrectobj.hxx
@@ -23,34 +23,29 @@
#include <svx/sdr/contact/viewcontactoftextobj.hxx>
#include <svx/svdorect.hxx>
+namespace sdr { namespace contact {
-namespace sdr
+class ViewContactOfSdrRectObj : public ViewContactOfTextObj
{
- namespace contact
+protected:
+ // internal access to SdrRectObj
+ const SdrRectObj& GetRectObj() const
{
- class ViewContactOfSdrRectObj : public ViewContactOfTextObj
- {
- protected:
- // internal access to SdrRectObj
- const SdrRectObj& GetRectObj() const
- {
- return static_cast<const SdrRectObj&>(GetSdrObject());
- }
-
- public:
- // basic constructor, used from SdrObject.
- explicit ViewContactOfSdrRectObj(SdrRectObj& rTextObj);
- virtual ~ViewContactOfSdrRectObj();
-
- protected:
- // This method is responsible for creating the graphical visualisation data
- // ONLY based on model data
- virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const SAL_OVERRIDE;
- };
- } // end of namespace contact
-} // end of namespace sdr
+ return static_cast<const SdrRectObj&>(GetSdrObject());
+ }
+public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfSdrRectObj(SdrRectObj& rTextObj);
+ virtual ~ViewContactOfSdrRectObj();
+protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const SAL_OVERRIDE;
+};
+
+}}
#endif // INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFSDRRECTOBJ_HXX
diff --git a/include/svx/sdr/contact/viewcontactoftextobj.hxx b/include/svx/sdr/contact/viewcontactoftextobj.hxx
index fb07c4c52cc4..56c472285938 100644
--- a/include/svx/sdr/contact/viewcontactoftextobj.hxx
+++ b/include/svx/sdr/contact/viewcontactoftextobj.hxx
@@ -21,31 +21,24 @@
#define INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFTEXTOBJ_HXX
#include <svx/sdr/contact/viewcontactofsdrobj.hxx>
-#include <svx/svdotext.hxx>
+class SdrTextObj;
-namespace sdr
+namespace sdr { namespace contact {
+
+class ViewContactOfTextObj : public ViewContactOfSdrObj
{
- namespace contact
- {
- class ViewContactOfTextObj : public ViewContactOfSdrObj
- {
- protected:
- // internal access to SdrTextObj
- const SdrTextObj& GetTextObj() const
- {
- return static_cast<const SdrTextObj&>(GetSdrObject());
- }
-
- public:
- // basic constructor, used from SdrObject.
- explicit ViewContactOfTextObj(SdrTextObj& rTextObj);
- virtual ~ViewContactOfTextObj();
- };
- } // end of namespace contact
-} // end of namespace sdr
+protected:
+ // internal access to SdrTextObj
+ const SdrTextObj& GetTextObj() const;
+public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfTextObj(SdrTextObj& rTextObj);
+ virtual ~ViewContactOfTextObj();
+};
+}}
#endif // INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFTEXTOBJ_HXX
diff --git a/include/svx/sdr/contact/viewcontactofvirtobj.hxx b/include/svx/sdr/contact/viewcontactofvirtobj.hxx
index dd8eb218e5a6..b9cef1c2736b 100644
--- a/include/svx/sdr/contact/viewcontactofvirtobj.hxx
+++ b/include/svx/sdr/contact/viewcontactofvirtobj.hxx
@@ -22,40 +22,32 @@
#include <svx/sdr/contact/viewcontactofsdrobj.hxx>
-
-// predeclarations
class SdrVirtObj;
+namespace sdr { namespace contact {
-
-namespace sdr
+class SVX_DLLPUBLIC ViewContactOfVirtObj : public ViewContactOfSdrObj
{
- namespace contact
- {
- class SVX_DLLPUBLIC ViewContactOfVirtObj : public ViewContactOfSdrObj
- {
- protected:
- // internal access to SdrObject. Iplementation in *.cxx to avoid
- // including SdrVirtObj here.
- SdrVirtObj& GetVirtObj() const;
-
- public:
- // basic constructor, used from SdrObject.
- explicit ViewContactOfVirtObj(SdrVirtObj& rObj);
- virtual ~ViewContactOfVirtObj();
-
- // Access to possible sub-hierarchy
- virtual sal_uInt32 GetObjectCount() const SAL_OVERRIDE;
-
- protected:
- // This method is responsible for creating the graphical visualisation data
- // ONLY based on model data
- virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const SAL_OVERRIDE;
- };
- } // end of namespace contact
-} // end of namespace sdr
-
-
+protected:
+ // internal access to SdrObject. Iplementation in *.cxx to avoid
+ // including SdrVirtObj here.
+ SdrVirtObj& GetVirtObj() const;
+
+public:
+ // basic constructor, used from SdrObject.
+ explicit ViewContactOfVirtObj(SdrVirtObj& rObj);
+ virtual ~ViewContactOfVirtObj();
+
+ // Access to possible sub-hierarchy
+ virtual sal_uInt32 GetObjectCount() const SAL_OVERRIDE;
+
+protected:
+ // This method is responsible for creating the graphical visualisation data
+ // ONLY based on model data
+ virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const SAL_OVERRIDE;
+};
+
+}}
#endif // INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFVIRTOBJ_HXX
diff --git a/include/svx/sdr/contact/viewobjectcontactofpageobj.hxx b/include/svx/sdr/contact/viewobjectcontactofpageobj.hxx
index 1074ce651f03..129d4355e68a 100644
--- a/include/svx/sdr/contact/viewobjectcontactofpageobj.hxx
+++ b/include/svx/sdr/contact/viewobjectcontactofpageobj.hxx
@@ -22,39 +22,30 @@
#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
-
-// predeclarations
+class SdrPage;
namespace sdr { namespace contact {
- class PagePrimitiveExtractor;
-}}
-class SdrPage;
+class PagePrimitiveExtractor;
+class SVX_DLLPUBLIC ViewObjectContactOfPageObj : public ViewObjectContactOfSdrObj
+{
+private:
+ // the page painter helper
+ PagePrimitiveExtractor* mpExtractor;
+protected:
+ // This method is responsible for creating the graphical visualisation data which is
+ // stored/cached in the local primitive.
+ // This method will not handle included hierarchies and not check geometric visibility.
+ virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const SAL_OVERRIDE;
-namespace sdr
-{
- namespace contact
- {
- class SVX_DLLPUBLIC ViewObjectContactOfPageObj : public ViewObjectContactOfSdrObj
- {
- private:
- // the page painter helper
- PagePrimitiveExtractor* mpExtractor;
-
- protected:
- // This method is responsible for creating the graphical visualisation data which is
- // stored/cached in the local primitive.
- // This method will not handle included hierarchies and not check geometric visibility.
- virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const SAL_OVERRIDE;
-
- public:
- ViewObjectContactOfPageObj(ObjectContact& rObjectContact, ViewContact& rViewContact);
- virtual ~ViewObjectContactOfPageObj();
- };
- } // end of namespace contact
-} // end of namespace sdr
+public:
+ ViewObjectContactOfPageObj(ObjectContact& rObjectContact, ViewContact& rViewContact);
+ virtual ~ViewObjectContactOfPageObj();
+};
+
+}}
diff --git a/include/svx/sdr/contact/viewobjectcontactredirector.hxx b/include/svx/sdr/contact/viewobjectcontactredirector.hxx
index 40f4e617413d..84b168946122 100644
--- a/include/svx/sdr/contact/viewobjectcontactredirector.hxx
+++ b/include/svx/sdr/contact/viewobjectcontactredirector.hxx
@@ -23,43 +23,32 @@
#include <svx/svxdllapi.h>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-
-// predeclarations
-
namespace sdr { namespace contact {
- class DisplayInfo;
- class ViewObjectContact;
-}}
+class DisplayInfo;
+class ViewObjectContact;
-
-namespace sdr
+// This class provides a mechanism to redirect the paint mechanism for all or
+// single ViewObjectContacts. An own derivation may be set at single ViewContacts
+// or at the ObjectContact for redirecting all. If both is used, the one at single
+// objects will have priority.
+class SVX_DLLPUBLIC ViewObjectContactRedirector
{
- namespace contact
- {
- // This class provides a mechanism to redirect the paint mechanism for all or
- // single ViewObjectContacts. An own derivation may be set at single ViewContacts
- // or at the ObjectContact for redirecting all. If both is used, the one at single
- // objects will have priority.
- class SVX_DLLPUBLIC ViewObjectContactRedirector
- {
- public:
- // basic constructor.
- ViewObjectContactRedirector();
-
- // The destructor.
- virtual ~ViewObjectContactRedirector();
+public:
+ // basic constructor.
+ ViewObjectContactRedirector();
- // all default implementations just call the same methods at the original. To do something
- // different, overload the method and at least do what the method does.
- virtual drawinglayer::primitive2d::Primitive2DSequence createRedirectedPrimitive2DSequence(
- const sdr::contact::ViewObjectContact& rOriginal,
- const sdr::contact::DisplayInfo& rDisplayInfo);
- };
- } // end of namespace contact
-} // end of namespace sdr
+ // The destructor.
+ virtual ~ViewObjectContactRedirector();
+ // all default implementations just call the same methods at the original. To do something
+ // different, overload the method and at least do what the method does.
+ virtual drawinglayer::primitive2d::Primitive2DSequence createRedirectedPrimitive2DSequence(
+ const sdr::contact::ViewObjectContact& rOriginal,
+ const sdr::contact::DisplayInfo& rDisplayInfo);
+};
+}}
#endif // INCLUDED_SVX_SDR_CONTACT_VIEWOBJECTCONTACTREDIRECTOR_HXX
diff --git a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
index eadd8a77dbef..63cfbd507041 100644
--- a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
+++ b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
@@ -29,186 +29,167 @@
#include <svx/unoapi.hxx>
#include <boost/scoped_ptr.hpp>
+namespace sdr { namespace contact {
-namespace sdr
+ObjectContactPainter::ObjectContactPainter()
{
- namespace contact
- {
- ObjectContactPainter::ObjectContactPainter()
- {
- }
+}
- // The destructor.
- ObjectContactPainter::~ObjectContactPainter()
- {
- }
- } // end of namespace contact
-} // end of namespace sdr
+// The destructor.
+ObjectContactPainter::~ObjectContactPainter()
+{
+}
+
+sal_uInt32 ObjectContactOfObjListPainter::GetPaintObjectCount() const
+{
+ return maStartObjects.size();
+}
+ViewContact& ObjectContactOfObjListPainter::GetPaintObjectViewContact(sal_uInt32 nIndex) const
+{
+ const SdrObject* pObj = maStartObjects[nIndex];
+ DBG_ASSERT(pObj, "ObjectContactOfObjListPainter: Corrupt SdrObjectVector (!)");
+ return pObj->GetViewContact();
+}
+
+ObjectContactOfObjListPainter::ObjectContactOfObjListPainter(
+ OutputDevice& rTargetDevice,
+ const SdrObjectVector& rObjects,
+ const SdrPage* pProcessedPage)
+: ObjectContactPainter(),
+ mrTargetOutputDevice(rTargetDevice),
+ maStartObjects(rObjects),
+ mpProcessedPage(pProcessedPage)
+{
+}
+ObjectContactOfObjListPainter::~ObjectContactOfObjListPainter()
+{
+}
-namespace sdr
+// Process the whole displaying
+void ObjectContactOfObjListPainter::ProcessDisplay(DisplayInfo& rDisplayInfo)
{
- namespace contact
+ const sal_uInt32 nCount(GetPaintObjectCount());
+
+ if(nCount)
{
- sal_uInt32 ObjectContactOfObjListPainter::GetPaintObjectCount() const
- {
- return maStartObjects.size();
- }
+ OutputDevice* pTargetDevice = TryToGetOutputDevice();
- ViewContact& ObjectContactOfObjListPainter::GetPaintObjectViewContact(sal_uInt32 nIndex) const
+ if(pTargetDevice)
{
- const SdrObject* pObj = maStartObjects[nIndex];
- DBG_ASSERT(pObj, "ObjectContactOfObjListPainter: Corrupt SdrObjectVector (!)");
- return pObj->GetViewContact();
- }
+ // update current ViewInformation2D at the ObjectContact
+ const GDIMetaFile* pMetaFile = pTargetDevice->GetConnectMetaFile();
+ const bool bOutputToRecordingMetaFile(pMetaFile && pMetaFile->IsRecord() && !pMetaFile->IsPause());
+ basegfx::B2DRange aViewRange;
- ObjectContactOfObjListPainter::ObjectContactOfObjListPainter(
- OutputDevice& rTargetDevice,
- const SdrObjectVector& rObjects,
- const SdrPage* pProcessedPage)
- : ObjectContactPainter(),
- mrTargetOutputDevice(rTargetDevice),
- maStartObjects(rObjects),
- mpProcessedPage(pProcessedPage)
- {
- }
+ // create ViewRange
+ if(!bOutputToRecordingMetaFile)
+ {
+ // use visible pixels, but transform to world coordinates
+ const Size aOutputSizePixel(pTargetDevice->GetOutputSizePixel());
+ aViewRange = ::basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
+ aViewRange.transform(pTargetDevice->GetInverseViewTransformation());
+ }
- ObjectContactOfObjListPainter::~ObjectContactOfObjListPainter()
- {
- }
+ // upate local ViewInformation2D
+ const drawinglayer::geometry::ViewInformation2D aNewViewInformation2D(
+ basegfx::B2DHomMatrix(),
+ pTargetDevice->GetViewTransformation(),
+ aViewRange,
+ GetXDrawPageForSdrPage(const_cast< SdrPage* >(mpProcessedPage)),
+ 0.0,
+ com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>());
+ updateViewInformation2D(aNewViewInformation2D);
- // Process the whole displaying
- void ObjectContactOfObjListPainter::ProcessDisplay(DisplayInfo& rDisplayInfo)
- {
- const sal_uInt32 nCount(GetPaintObjectCount());
+ // collect primitive data in a sequence; this will already use the updated ViewInformation2D
+ drawinglayer::primitive2d::Primitive2DSequence xPrimitiveSequence;
- if(nCount)
+ for(sal_uInt32 a(0L); a < nCount; a++)
{
- OutputDevice* pTargetDevice = TryToGetOutputDevice();
+ const ViewObjectContact& rViewObjectContact = GetPaintObjectViewContact(a).GetViewObjectContact(*this);
- if(pTargetDevice)
- {
- // update current ViewInformation2D at the ObjectContact
- const GDIMetaFile* pMetaFile = pTargetDevice->GetConnectMetaFile();
- const bool bOutputToRecordingMetaFile(pMetaFile && pMetaFile->IsRecord() && !pMetaFile->IsPause());
- basegfx::B2DRange aViewRange;
-
- // create ViewRange
- if(!bOutputToRecordingMetaFile)
- {
- // use visible pixels, but transform to world coordinates
- const Size aOutputSizePixel(pTargetDevice->GetOutputSizePixel());
- aViewRange = ::basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
- aViewRange.transform(pTargetDevice->GetInverseViewTransformation());
- }
-
- // upate local ViewInformation2D
- const drawinglayer::geometry::ViewInformation2D aNewViewInformation2D(
- basegfx::B2DHomMatrix(),
- pTargetDevice->GetViewTransformation(),
- aViewRange,
- GetXDrawPageForSdrPage(const_cast< SdrPage* >(mpProcessedPage)),
- 0.0,
- com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>());
- updateViewInformation2D(aNewViewInformation2D);
-
- // collect primitive data in a sequence; this will already use the updated ViewInformation2D
- drawinglayer::primitive2d::Primitive2DSequence xPrimitiveSequence;
-
- for(sal_uInt32 a(0L); a < nCount; a++)
- {
- const ViewObjectContact& rViewObjectContact = GetPaintObjectViewContact(a).GetViewObjectContact(*this);
-
- drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xPrimitiveSequence,
- rViewObjectContact.getPrimitive2DSequenceHierarchy(rDisplayInfo));
- }
-
- // if there is something to show, use a vclProcessor to render it
- if(xPrimitiveSequence.hasElements())
- {
- boost::scoped_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(drawinglayer::processor2d::createProcessor2DFromOutputDevice(
- *pTargetDevice,
- getViewInformation2D()));
-
- if(pProcessor2D)
- {
- pProcessor2D->process(xPrimitiveSequence);
- }
- }
- }
+ drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xPrimitiveSequence,
+ rViewObjectContact.getPrimitive2DSequenceHierarchy(rDisplayInfo));
}
- }
- // VirtualDevice?
- bool ObjectContactOfObjListPainter::isOutputToVirtualDevice() const
- {
- return (OUTDEV_VIRDEV == mrTargetOutputDevice.GetOutDevType());
- }
+ // if there is something to show, use a vclProcessor to render it
+ if(xPrimitiveSequence.hasElements())
+ {
+ boost::scoped_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(drawinglayer::processor2d::createProcessor2DFromOutputDevice(
+ *pTargetDevice,
+ getViewInformation2D()));
- // recording MetaFile?
- bool ObjectContactOfObjListPainter::isOutputToRecordingMetaFile() const
- {
- GDIMetaFile* pMetaFile = mrTargetOutputDevice.GetConnectMetaFile();
- return (pMetaFile && pMetaFile->IsRecord() && !pMetaFile->IsPause());
+ if(pProcessor2D)
+ {
+ pProcessor2D->process(xPrimitiveSequence);
+ }
+ }
}
+ }
+}
- // pdf export?
- bool ObjectContactOfObjListPainter::isOutputToPDFFile() const
- {
- return (0 != mrTargetOutputDevice.GetPDFWriter());
- }
+// VirtualDevice?
+bool ObjectContactOfObjListPainter::isOutputToVirtualDevice() const
+{
+ return (OUTDEV_VIRDEV == mrTargetOutputDevice.GetOutDevType());
+}
- OutputDevice* ObjectContactOfObjListPainter::TryToGetOutputDevice() const
- {
- return &mrTargetOutputDevice;
- }
- } // end of namespace contact
-} // end of namespace sdr
+// recording MetaFile?
+bool ObjectContactOfObjListPainter::isOutputToRecordingMetaFile() const
+{
+ GDIMetaFile* pMetaFile = mrTargetOutputDevice.GetConnectMetaFile();
+ return (pMetaFile && pMetaFile->IsRecord() && !pMetaFile->IsPause());
+}
+// pdf export?
+bool ObjectContactOfObjListPainter::isOutputToPDFFile() const
+{
+ return (0 != mrTargetOutputDevice.GetPDFWriter());
+}
+OutputDevice* ObjectContactOfObjListPainter::TryToGetOutputDevice() const
+{
+ return &mrTargetOutputDevice;
+}
-namespace sdr
+sal_uInt32 ObjectContactOfPagePainter::GetPaintObjectCount() const
{
- namespace contact
- {
- sal_uInt32 ObjectContactOfPagePainter::GetPaintObjectCount() const
- {
- return (GetStartPage() ? 1L : 0L);
- }
+ return (GetStartPage() ? 1L : 0L);
+}
- ViewContact& ObjectContactOfPagePainter::GetPaintObjectViewContact(sal_uInt32 /*nIndex*/) const
- {
- DBG_ASSERT(GetStartPage(), "ObjectContactOfPagePainter::GetPaintObjectViewContact: no StartPage set (!)");
- return GetStartPage()->GetViewContact();
- }
+ViewContact& ObjectContactOfPagePainter::GetPaintObjectViewContact(sal_uInt32 /*nIndex*/) const
+{
+ DBG_ASSERT(GetStartPage(), "ObjectContactOfPagePainter::GetPaintObjectViewContact: no StartPage set (!)");
+ return GetStartPage()->GetViewContact();
+}
+
+ObjectContactOfPagePainter::ObjectContactOfPagePainter(
+ const SdrPage* pPage,
+ ObjectContact& rOriginalObjectContact)
+: ObjectContactPainter(),
+ mrOriginalObjectContact(rOriginalObjectContact),
+ mxStartPage(const_cast< SdrPage* >(pPage)) // no SdrPageWeakRef available to hold a const SdrPage*
+{
+}
- ObjectContactOfPagePainter::ObjectContactOfPagePainter(
- const SdrPage* pPage,
- ObjectContact& rOriginalObjectContact)
- : ObjectContactPainter(),
- mrOriginalObjectContact(rOriginalObjectContact),
- mxStartPage(const_cast< SdrPage* >(pPage)) // no SdrPageWeakRef available to hold a const SdrPage*
- {
- }
+ObjectContactOfPagePainter::~ObjectContactOfPagePainter()
+{
+}
- ObjectContactOfPagePainter::~ObjectContactOfPagePainter()
- {
- }
+void ObjectContactOfPagePainter::SetStartPage(const SdrPage* pPage)
+{
+ if(pPage != GetStartPage())
+ {
+ mxStartPage.reset(const_cast< SdrPage* >(pPage)); // no SdrPageWeakRef available to hold a const SdrPage*
+ }
+}
- void ObjectContactOfPagePainter::SetStartPage(const SdrPage* pPage)
- {
- if(pPage != GetStartPage())
- {
- mxStartPage.reset(const_cast< SdrPage* >(pPage)); // no SdrPageWeakRef available to hold a const SdrPage*
- }
- }
+OutputDevice* ObjectContactOfPagePainter::TryToGetOutputDevice() const
+{
+ return mrOriginalObjectContact.TryToGetOutputDevice();
+}
- OutputDevice* ObjectContactOfPagePainter::TryToGetOutputDevice() const
- {
- return mrOriginalObjectContact.TryToGetOutputDevice();
- }
- } // end of namespace contact
-} // end of namespace sdr
+}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/contact/viewcontactofe3d.cxx b/svx/source/sdr/contact/viewcontactofe3d.cxx
index 810a9eca9496..e5d9f689e5df 100644
--- a/svx/source/sdr/contact/viewcontactofe3d.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3d.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <svx/sdr/contact/viewcontactofe3d.hxx>
#include <sdr/contact/viewobjectcontactofe3d.hxx>
#include <svx/obj3d.hxx>
@@ -30,173 +29,168 @@
#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
#include <drawinglayer/attribute/sdrlineattribute.hxx>
+namespace {
-
-namespace
+const sdr::contact::ViewContactOfE3dScene* tryToFindVCOfE3DScene(
+ const sdr::contact::ViewContact& rCandidate,
+ basegfx::B3DHomMatrix& o_rInBetweenObjectTransform)
{
- const sdr::contact::ViewContactOfE3dScene* tryToFindVCOfE3DScene(
- const sdr::contact::ViewContact& rCandidate,
- basegfx::B3DHomMatrix& o_rInBetweenObjectTransform)
+ const sdr::contact::ViewContactOfE3dScene* pSceneParent =
+ dynamic_cast< const sdr::contact::ViewContactOfE3dScene* >(rCandidate.GetParentContact());
+
+ if(pSceneParent)
{
- const sdr::contact::ViewContactOfE3dScene* pSceneParent =
- dynamic_cast< const sdr::contact::ViewContactOfE3dScene* >(rCandidate.GetParentContact());
+ // each 3d object (including in-between scenes) should have a scene as parent
+ const sdr::contact::ViewContactOfE3dScene* pSceneParentParent =
+ dynamic_cast< const sdr::contact::ViewContactOfE3dScene* >(pSceneParent->GetParentContact());
- if(pSceneParent)
+ if(pSceneParentParent)
{
- // each 3d object (including in-between scenes) should have a scene as parent
- const sdr::contact::ViewContactOfE3dScene* pSceneParentParent =
- dynamic_cast< const sdr::contact::ViewContactOfE3dScene* >(pSceneParent->GetParentContact());
-
- if(pSceneParentParent)
- {
- // the parent scene of rCandidate is a in-between scene, call recursively and collect
- // the in-between scene's object transformation part in o_rInBetweenObjectTransform
- const basegfx::B3DHomMatrix& rSceneParentTransform = pSceneParent->GetE3dScene().GetTransform();
- o_rInBetweenObjectTransform = rSceneParentTransform * o_rInBetweenObjectTransform;
- return tryToFindVCOfE3DScene(*pSceneParent, o_rInBetweenObjectTransform);
- }
- else
- {
- // the parent scene is the outmost scene
- return pSceneParent;
- }
+ // the parent scene of rCandidate is a in-between scene, call recursively and collect
+ // the in-between scene's object transformation part in o_rInBetweenObjectTransform
+ const basegfx::B3DHomMatrix& rSceneParentTransform = pSceneParent->GetE3dScene().GetTransform();
+ o_rInBetweenObjectTransform = rSceneParentTransform * o_rInBetweenObjectTransform;
+ return tryToFindVCOfE3DScene(*pSceneParent, o_rInBetweenObjectTransform);
+ }
+ else
+ {
+ // the parent scene is the outmost scene
+ return pSceneParent;
}
-
- // object hierarchy structure is incorrect; no result
- return 0;
}
-} // end of anonymous namespace
+ // object hierarchy structure is incorrect; no result
+ return 0;
+}
+} // end of anonymous namespace
+
+namespace sdr { namespace contact {
-namespace sdr
+drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3d::impCreateWithGivenPrimitive3DSequence(
+ const drawinglayer::primitive3d::Primitive3DSequence& rxContent3D) const
{
- namespace contact
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
+
+ if(rxContent3D.hasElements())
{
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3d::impCreateWithGivenPrimitive3DSequence(
- const drawinglayer::primitive3d::Primitive3DSequence& rxContent3D) const
+ // try to get the outmost ViewObjectContactOfE3dScene for this single 3d object,
+ // the ones on the way there are grouping scenes. Collect the in-between scene's
+ // transformations to build a correct object transformation for the embedded
+ // object
+ basegfx::B3DHomMatrix aInBetweenObjectTransform;
+ const ViewContactOfE3dScene* pVCOfE3DScene = tryToFindVCOfE3DScene(*this, aInBetweenObjectTransform);
+
+ if(pVCOfE3DScene)
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ basegfx::B3DVector aLightNormal;
+ const double fShadowSlant(pVCOfE3DScene->getSdrSceneAttribute().getShadowSlant());
+ const basegfx::B3DRange& rAllContentRange = pVCOfE3DScene->getAllContentRange3D();
+ drawinglayer::geometry::ViewInformation3D aViewInformation3D(pVCOfE3DScene->getViewInformation3D());
- if(rxContent3D.hasElements())
+ if(pVCOfE3DScene->getSdrLightingAttribute().getLightVector().size())
{
- // try to get the outmost ViewObjectContactOfE3dScene for this single 3d object,
- // the ones on the way there are grouping scenes. Collect the in-between scene's
- // transformations to build a correct object transformation for the embedded
- // object
- basegfx::B3DHomMatrix aInBetweenObjectTransform;
- const ViewContactOfE3dScene* pVCOfE3DScene = tryToFindVCOfE3DScene(*this, aInBetweenObjectTransform);
-
- if(pVCOfE3DScene)
- {
- basegfx::B3DVector aLightNormal;
- const double fShadowSlant(pVCOfE3DScene->getSdrSceneAttribute().getShadowSlant());
- const basegfx::B3DRange& rAllContentRange = pVCOfE3DScene->getAllContentRange3D();
- drawinglayer::geometry::ViewInformation3D aViewInformation3D(pVCOfE3DScene->getViewInformation3D());
-
- if(pVCOfE3DScene->getSdrLightingAttribute().getLightVector().size())
- {
- // get light normal from first light and normalize
- aLightNormal = pVCOfE3DScene->getSdrLightingAttribute().getLightVector()[0].getDirection();
- aLightNormal.normalize();
- }
-
- if(!aInBetweenObjectTransform.isIdentity())
- {
- // if aInBetweenObjectTransform is used, create combined ViewInformation3D which
- // contains the correct object transformation for the embedded 3d object
- aViewInformation3D = drawinglayer::geometry::ViewInformation3D(
- aViewInformation3D.getObjectTransformation() * aInBetweenObjectTransform,
- aViewInformation3D.getOrientation(),
- aViewInformation3D.getProjection(),
- aViewInformation3D.getDeviceToView(),
- aViewInformation3D.getViewTime(),
- aViewInformation3D.getExtendedInformationSequence());
- }
-
- // create embedded 2d primitive and add. LightNormal and ShadowSlant are needed for evtl.
- // 3D shadow extraction for correct B2DRange calculation (shadow is part of the object)
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::Embedded3DPrimitive2D(
- rxContent3D,
- pVCOfE3DScene->getObjectTransformation(),
- aViewInformation3D,
- aLightNormal,
- fShadowSlant,
- rAllContentRange));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
+ // get light normal from first light and normalize
+ aLightNormal = pVCOfE3DScene->getSdrLightingAttribute().getLightVector()[0].getDirection();
+ aLightNormal.normalize();
}
- return xRetval;
- }
+ if(!aInBetweenObjectTransform.isIdentity())
+ {
+ // if aInBetweenObjectTransform is used, create combined ViewInformation3D which
+ // contains the correct object transformation for the embedded 3d object
+ aViewInformation3D = drawinglayer::geometry::ViewInformation3D(
+ aViewInformation3D.getObjectTransformation() * aInBetweenObjectTransform,
+ aViewInformation3D.getOrientation(),
+ aViewInformation3D.getProjection(),
+ aViewInformation3D.getDeviceToView(),
+ aViewInformation3D.getViewTime(),
+ aViewInformation3D.getExtendedInformationSequence());
+ }
- ViewContactOfE3d::ViewContactOfE3d(E3dObject& rSdrObject)
- : ViewContactOfSdrObj(rSdrObject)
- {
+ // create embedded 2d primitive and add. LightNormal and ShadowSlant are needed for evtl.
+ // 3D shadow extraction for correct B2DRange calculation (shadow is part of the object)
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::Embedded3DPrimitive2D(
+ rxContent3D,
+ pVCOfE3DScene->getObjectTransformation(),
+ aViewInformation3D,
+ aLightNormal,
+ fShadowSlant,
+ rAllContentRange));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+ }
- ViewContactOfE3d::~ViewContactOfE3d()
- {
- }
+ return xRetval;
+}
- drawinglayer::primitive3d::Primitive3DSequence ViewContactOfE3d::getVIP3DSWithoutObjectTransform() const
- {
- // local up-to-date checks. Create new list and compare.
- drawinglayer::primitive3d::Primitive3DSequence xNew(createViewIndependentPrimitive3DSequence());
+ViewContactOfE3d::ViewContactOfE3d(E3dObject& rSdrObject)
+: ViewContactOfSdrObj(rSdrObject)
+{
+}
- if(!drawinglayer::primitive3d::arePrimitive3DSequencesEqual(mxViewIndependentPrimitive3DSequence, xNew))
- {
- // has changed, copy content
- const_cast< ViewContactOfE3d* >(this)->mxViewIndependentPrimitive3DSequence = xNew;
- }
+ViewContactOfE3d::~ViewContactOfE3d()
+{
+}
- // return current Primitive2DSequence
- return mxViewIndependentPrimitive3DSequence;
- }
+drawinglayer::primitive3d::Primitive3DSequence ViewContactOfE3d::getVIP3DSWithoutObjectTransform() const
+{
+ // local up-to-date checks. Create new list and compare.
+ drawinglayer::primitive3d::Primitive3DSequence xNew(createViewIndependentPrimitive3DSequence());
- drawinglayer::primitive3d::Primitive3DSequence ViewContactOfE3d::getViewIndependentPrimitive3DSequence() const
- {
- // get sequence without object transform
- drawinglayer::primitive3d::Primitive3DSequence xRetval(getVIP3DSWithoutObjectTransform());
+ if(!drawinglayer::primitive3d::arePrimitive3DSequencesEqual(mxViewIndependentPrimitive3DSequence, xNew))
+ {
+ // has changed, copy content
+ const_cast< ViewContactOfE3d* >(this)->mxViewIndependentPrimitive3DSequence = xNew;
+ }
- if(xRetval.hasElements())
- {
- // add object transform if it's used
- const basegfx::B3DHomMatrix& rObjectTransform(GetE3dObject().GetTransform());
-
- if(!rObjectTransform.isIdentity())
- {
- const drawinglayer::primitive3d::Primitive3DReference xReference(
- new drawinglayer::primitive3d::TransformPrimitive3D(
- rObjectTransform,
- xRetval));
-
- xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
- }
- }
+ // return current Primitive2DSequence
+ return mxViewIndependentPrimitive3DSequence;
+}
- // return current Primitive2DSequence
- return xRetval;
- }
+drawinglayer::primitive3d::Primitive3DSequence ViewContactOfE3d::getViewIndependentPrimitive3DSequence() const
+{
+ // get sequence without object transform
+ drawinglayer::primitive3d::Primitive3DSequence xRetval(getVIP3DSWithoutObjectTransform());
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3d::createViewIndependentPrimitive2DSequence() const
- {
- // also need to create a 2D embedding when the view-independent part is requested,
- // see view-dependent part in ViewObjectContactOfE3d::createPrimitive2DSequence
- // get 3d primitive vector, isPrimitiveVisible() is done in 3d creator
- return impCreateWithGivenPrimitive3DSequence(getViewIndependentPrimitive3DSequence());
- }
+ if(xRetval.hasElements())
+ {
+ // add object transform if it's used
+ const basegfx::B3DHomMatrix& rObjectTransform(GetE3dObject().GetTransform());
- ViewObjectContact& ViewContactOfE3d::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
+ if(!rObjectTransform.isIdentity())
{
- ViewObjectContact* pRetval = new ViewObjectContactOfE3d(rObjectContact, *this);
- DBG_ASSERT(pRetval, "ViewContactOfE3d::CreateObjectSpecificViewObjectContact() failed (!)");
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::TransformPrimitive3D(
+ rObjectTransform,
+ xRetval));
- return *pRetval;
+ xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
}
- } // end of namespace contact
-} // end of namespace sdr
+ }
+
+ // return current Primitive2DSequence
+ return xRetval;
+}
+
+drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3d::createViewIndependentPrimitive2DSequence() const
+{
+ // also need to create a 2D embedding when the view-independent part is requested,
+ // see view-dependent part in ViewObjectContactOfE3d::createPrimitive2DSequence
+ // get 3d primitive vector, isPrimitiveVisible() is done in 3d creator
+ return impCreateWithGivenPrimitive3DSequence(getViewIndependentPrimitive3DSequence());
+}
+
+ViewObjectContact& ViewContactOfE3d::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
+{
+ ViewObjectContact* pRetval = new ViewObjectContactOfE3d(rObjectContact, *this);
+ DBG_ASSERT(pRetval, "ViewContactOfE3d::CreateObjectSpecificViewObjectContact() failed (!)");
+
+ return *pRetval;
+}
+
+}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/contact/viewcontactofe3dscene.cxx b/svx/source/sdr/contact/viewcontactofe3dscene.cxx
index 9a80884d28ff..dfd4e660fd28 100644
--- a/svx/source/sdr/contact/viewcontactofe3dscene.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dscene.cxx
@@ -34,437 +34,430 @@
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
-
-
using namespace com::sun::star;
+namespace {
-
-namespace
+// pActiveVC is only true if ghosted is still activated and maybe needs to be switched off in this path
+void createSubPrimitive3DVector(
+ const sdr::contact::ViewContact& rCandidate,
+ drawinglayer::primitive3d::Primitive3DSequence& o_rAllTarget,
+ drawinglayer::primitive3d::Primitive3DSequence* o_pVisibleTarget,
+ const SetOfByte* pVisibleLayerSet,
+ const bool bTestSelectedVisibility)
{
- // pActiveVC is only true if ghosted is still activated and maybe needs to be switched off in this path
- void createSubPrimitive3DVector(
- const sdr::contact::ViewContact& rCandidate,
- drawinglayer::primitive3d::Primitive3DSequence& o_rAllTarget,
- drawinglayer::primitive3d::Primitive3DSequence* o_pVisibleTarget,
- const SetOfByte* pVisibleLayerSet,
- const bool bTestSelectedVisibility)
+ const sdr::contact::ViewContactOfE3dScene* pViewContactOfE3dScene = dynamic_cast< const sdr::contact::ViewContactOfE3dScene* >(&rCandidate);
+
+ if(pViewContactOfE3dScene)
{
- const sdr::contact::ViewContactOfE3dScene* pViewContactOfE3dScene = dynamic_cast< const sdr::contact::ViewContactOfE3dScene* >(&rCandidate);
+ const sal_uInt32 nChildrenCount(rCandidate.GetObjectCount());
- if(pViewContactOfE3dScene)
+ if(nChildrenCount)
{
- const sal_uInt32 nChildrenCount(rCandidate.GetObjectCount());
+ // provide new collection sequences
+ drawinglayer::primitive3d::Primitive3DSequence aNewAllTarget;
+ drawinglayer::primitive3d::Primitive3DSequence aNewVisibleTarget;
- if(nChildrenCount)
+ // add children recursively
+ for(sal_uInt32 a(0L); a < nChildrenCount; a++)
{
- // provide new collection sequences
- drawinglayer::primitive3d::Primitive3DSequence aNewAllTarget;
- drawinglayer::primitive3d::Primitive3DSequence aNewVisibleTarget;
-
- // add children recursively
- for(sal_uInt32 a(0L); a < nChildrenCount; a++)
- {
- createSubPrimitive3DVector(
- rCandidate.GetViewContact(a),
- aNewAllTarget,
- o_pVisibleTarget ? &aNewVisibleTarget : 0,
- pVisibleLayerSet,
- bTestSelectedVisibility);
- }
+ createSubPrimitive3DVector(
+ rCandidate.GetViewContact(a),
+ aNewAllTarget,
+ o_pVisibleTarget ? &aNewVisibleTarget : 0,
+ pVisibleLayerSet,
+ bTestSelectedVisibility);
+ }
- // create transform primitive for the created content combining content and transformtion
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::TransformPrimitive3D(
- pViewContactOfE3dScene->GetE3dScene().GetTransform(),
- aNewAllTarget));
+ // create transform primitive for the created content combining content and transformtion
+ const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::TransformPrimitive3D(
+ pViewContactOfE3dScene->GetE3dScene().GetTransform(),
+ aNewAllTarget));
- // add created content to all target
- drawinglayer::primitive3d::appendPrimitive3DReferenceToPrimitive3DSequence(o_rAllTarget, xReference);
+ // add created content to all target
+ drawinglayer::primitive3d::appendPrimitive3DReferenceToPrimitive3DSequence(o_rAllTarget, xReference);
- // add created content to visibiel target if exists
- if(o_pVisibleTarget)
- {
- drawinglayer::primitive3d::appendPrimitive3DReferenceToPrimitive3DSequence(*o_pVisibleTarget, xReference);
- }
+ // add created content to visibiel target if exists
+ if(o_pVisibleTarget)
+ {
+ drawinglayer::primitive3d::appendPrimitive3DReferenceToPrimitive3DSequence(*o_pVisibleTarget, xReference);
}
}
- else
+ }
+ else
+ {
+ // access view independent representation of rCandidate
+ const sdr::contact::ViewContactOfE3d* pViewContactOfE3d = dynamic_cast< const sdr::contact::ViewContactOfE3d* >(&rCandidate);
+
+ if(pViewContactOfE3d)
{
- // access view independent representation of rCandidate
- const sdr::contact::ViewContactOfE3d* pViewContactOfE3d = dynamic_cast< const sdr::contact::ViewContactOfE3d* >(&rCandidate);
+ drawinglayer::primitive3d::Primitive3DSequence xPrimitive3DSeq(pViewContactOfE3d->getViewIndependentPrimitive3DSequence());
- if(pViewContactOfE3d)
+ if(xPrimitive3DSeq.hasElements())
{
- drawinglayer::primitive3d::Primitive3DSequence xPrimitive3DSeq(pViewContactOfE3d->getViewIndependentPrimitive3DSequence());
+ // add to all target vector
+ drawinglayer::primitive3d::appendPrimitive3DSequenceToPrimitive3DSequence(o_rAllTarget, xPrimitive3DSeq);
- if(xPrimitive3DSeq.hasElements())
+ if(o_pVisibleTarget)
{
- // add to all target vector
- drawinglayer::primitive3d::appendPrimitive3DSequenceToPrimitive3DSequence(o_rAllTarget, xPrimitive3DSeq);
+ // test visibility. Primitive is visible when both tests are true (AND)
+ bool bVisible(true);
+
+ if(pVisibleLayerSet)
+ {
+ // test layer visibility
+ const E3dObject& rE3dObject = pViewContactOfE3d->GetE3dObject();
+ const SdrLayerID aLayerID(rE3dObject.GetLayer());
+
+ bVisible = pVisibleLayerSet->IsSet(aLayerID);
+ }
+
+ if(bVisible && bTestSelectedVisibility)
+ {
+ // test selected visibility (see 3D View's DrawMarkedObj implementation)
+ const E3dObject& rE3dObject = pViewContactOfE3d->GetE3dObject();
- if(o_pVisibleTarget)
+ bVisible = rE3dObject.GetSelected();
+ }
+
+ if(bVisible && o_pVisibleTarget)
{
- // test visibility. Primitive is visible when both tests are true (AND)
- bool bVisible(true);
-
- if(pVisibleLayerSet)
- {
- // test layer visibility
- const E3dObject& rE3dObject = pViewContactOfE3d->GetE3dObject();
- const SdrLayerID aLayerID(rE3dObject.GetLayer());
-
- bVisible = pVisibleLayerSet->IsSet(aLayerID);
- }
-
- if(bVisible && bTestSelectedVisibility)
- {
- // test selected visibility (see 3D View's DrawMarkedObj implementation)
- const E3dObject& rE3dObject = pViewContactOfE3d->GetE3dObject();
-
- bVisible = rE3dObject.GetSelected();
- }
-
- if(bVisible && o_pVisibleTarget)
- {
- // add to visible target vector
- drawinglayer::primitive3d::appendPrimitive3DSequenceToPrimitive3DSequence(*o_pVisibleTarget, xPrimitive3DSeq);
- }
+ // add to visible target vector
+ drawinglayer::primitive3d::appendPrimitive3DSequenceToPrimitive3DSequence(*o_pVisibleTarget, xPrimitive3DSeq);
}
}
}
}
}
-} // end of anonymous namespace
+}
+
+}
+namespace sdr { namespace contact {
+// Create a Object-Specific ViewObjectContact, set ViewContact and
+// ObjectContact. Always needs to return something.
+ViewObjectContact& ViewContactOfE3dScene::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
+{
+ ViewObjectContact* pRetval = new ViewObjectContactOfE3dScene(rObjectContact, *this);
+ DBG_ASSERT(pRetval, "ViewContactOfE3dScene::CreateObjectSpecificViewObjectContact() failed (!)");
+
+ return *pRetval;
+}
+
+ViewContactOfE3dScene::ViewContactOfE3dScene(E3dScene& rScene)
+: ViewContactOfSdrObj(rScene),
+ maViewInformation3D(),
+ maObjectTransformation(),
+ maSdrSceneAttribute(),
+ maSdrLightingAttribute()
+{
+}
-namespace sdr
+void ViewContactOfE3dScene::createViewInformation3D(const basegfx::B3DRange& rContentRange)
{
- namespace contact
+ basegfx::B3DHomMatrix aTransformation;
+ basegfx::B3DHomMatrix aOrientation;
+ basegfx::B3DHomMatrix aProjection;
+ basegfx::B3DHomMatrix aDeviceToView;
+
+ // create transformation (scene as group's transformation)
+ // For historical reasons, the outmost scene's transformation is handles as part of the
+ // view transformation. This means that the BoundRect of the contained 3D Objects is
+ // without that transformation and makes it necessary to NOT add the first scene to the
+ // Primitive3DSequence of contained objects.
{
- // Create a Object-Specific ViewObjectContact, set ViewContact and
- // ObjectContact. Always needs to return something.
- ViewObjectContact& ViewContactOfE3dScene::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
- {
- ViewObjectContact* pRetval = new ViewObjectContactOfE3dScene(rObjectContact, *this);
- DBG_ASSERT(pRetval, "ViewContactOfE3dScene::CreateObjectSpecificViewObjectContact() failed (!)");
+ aTransformation = GetE3dScene().GetTransform();
+ }
- return *pRetval;
- }
+ // create orientation (world to camera coordinate system)
+ {
+ // calculate orientation from VRP, VPN and VUV
+ const B3dCamera& rSceneCamera = GetE3dScene().GetCameraSet();
+ const basegfx::B3DPoint aVRP(rSceneCamera.GetVRP());
+ const basegfx::B3DVector aVPN(rSceneCamera.GetVRP());
+ const basegfx::B3DVector aVUV(rSceneCamera.GetVUV());
- ViewContactOfE3dScene::ViewContactOfE3dScene(E3dScene& rScene)
- : ViewContactOfSdrObj(rScene),
- maViewInformation3D(),
- maObjectTransformation(),
- maSdrSceneAttribute(),
- maSdrLightingAttribute()
- {
- }
+ aOrientation.orientation(aVRP, aVPN, aVUV);
+ }
- void ViewContactOfE3dScene::createViewInformation3D(const basegfx::B3DRange& rContentRange)
- {
- basegfx::B3DHomMatrix aTransformation;
- basegfx::B3DHomMatrix aOrientation;
- basegfx::B3DHomMatrix aProjection;
- basegfx::B3DHomMatrix aDeviceToView;
-
- // create transformation (scene as group's transformation)
- // For historical reasons, the outmost scene's transformation is handles as part of the
- // view transformation. This means that the BoundRect of the contained 3D Objects is
- // without that transformation and makes it necessary to NOT add the first scene to the
- // Primitive3DSequence of contained objects.
- {
- aTransformation = GetE3dScene().GetTransform();
- }
+ // create projection (camera coordinate system to relative 2d where X,Y and Z are [0.0 .. 1.0])
+ {
+ const basegfx::B3DHomMatrix aWorldToCamera(aOrientation * aTransformation);
+ basegfx::B3DRange aCameraRange(rContentRange);
+ aCameraRange.transform(aWorldToCamera);
- // create orientation (world to camera coordinate system)
- {
- // calculate orientation from VRP, VPN and VUV
- const B3dCamera& rSceneCamera = GetE3dScene().GetCameraSet();
- const basegfx::B3DPoint aVRP(rSceneCamera.GetVRP());
- const basegfx::B3DVector aVPN(rSceneCamera.GetVRP());
- const basegfx::B3DVector aVUV(rSceneCamera.GetVUV());
+ // remember Z-Values, but change orientation
+ const double fMinZ(-aCameraRange.getMaxZ());
+ const double fMaxZ(-aCameraRange.getMinZ());
- aOrientation.orientation(aVRP, aVPN, aVUV);
- }
+ // construct temporary matrix from world to device. Use unit values here to measure expansion
+ basegfx::B3DHomMatrix aWorldToDevice(aWorldToCamera);
+ const drawinglayer::attribute::SdrSceneAttribute& rSdrSceneAttribute = getSdrSceneAttribute();
- // create projection (camera coordinate system to relative 2d where X,Y and Z are [0.0 .. 1.0])
- {
- const basegfx::B3DHomMatrix aWorldToCamera(aOrientation * aTransformation);
- basegfx::B3DRange aCameraRange(rContentRange);
- aCameraRange.transform(aWorldToCamera);
+ if(::com::sun::star::drawing::ProjectionMode_PERSPECTIVE == rSdrSceneAttribute.getProjectionMode())
+ {
+ aWorldToDevice.frustum(-1.0, 1.0, -1.0, 1.0, fMinZ, fMaxZ);
+ }
+ else
+ {
+ aWorldToDevice.ortho(-1.0, 1.0, -1.0, 1.0, fMinZ, fMaxZ);
+ }
- // remember Z-Values, but change orientation
- const double fMinZ(-aCameraRange.getMaxZ());
- const double fMaxZ(-aCameraRange.getMinZ());
+ // create B3DRange in device. This will create the real used ranges
+ // in camera space. Do not use the Z-Values, though.
+ basegfx::B3DRange aDeviceRange(rContentRange);
+ aDeviceRange.transform(aWorldToDevice);
- // construct temporary matrix from world to device. Use unit values here to measure expansion
- basegfx::B3DHomMatrix aWorldToDevice(aWorldToCamera);
- const drawinglayer::attribute::SdrSceneAttribute& rSdrSceneAttribute = getSdrSceneAttribute();
+ // set projection
+ if(::com::sun::star::drawing::ProjectionMode_PERSPECTIVE == rSdrSceneAttribute.getProjectionMode())
+ {
+ aProjection.frustum(
+ aDeviceRange.getMinX(), aDeviceRange.getMaxX(),
+ aDeviceRange.getMinY(), aDeviceRange.getMaxY(),
+ fMinZ, fMaxZ);
+ }
+ else
+ {
+ aProjection.ortho(
+ aDeviceRange.getMinX(), aDeviceRange.getMaxX(),
+ aDeviceRange.getMinY(), aDeviceRange.getMaxY(),
+ fMinZ, fMaxZ);
+ }
+ }
- if(::com::sun::star::drawing::ProjectionMode_PERSPECTIVE == rSdrSceneAttribute.getProjectionMode())
- {
- aWorldToDevice.frustum(-1.0, 1.0, -1.0, 1.0, fMinZ, fMaxZ);
- }
- else
- {
- aWorldToDevice.ortho(-1.0, 1.0, -1.0, 1.0, fMinZ, fMaxZ);
- }
+ // create device to view transform
+ {
+ // create standard deviceToView projection for geometry
+ // input is [-1.0 .. 1.0] in X,Y and Z. bring to [0.0 .. 1.0]. Also
+ // necessary to flip Y due to screen orientation
+ // Z is not needed, but will also be brought to [0.0 .. 1.0]
+ aDeviceToView.scale(0.5, -0.5, 0.5);
+ aDeviceToView.translate(0.5, 0.5, 0.5);
+ }
- // create B3DRange in device. This will create the real used ranges
- // in camera space. Do not use the Z-Values, though.
- basegfx::B3DRange aDeviceRange(rContentRange);
- aDeviceRange.transform(aWorldToDevice);
+ const uno::Sequence< beans::PropertyValue > aEmptyProperties;
+ maViewInformation3D = drawinglayer::geometry::ViewInformation3D(
+ aTransformation, aOrientation, aProjection,
+ aDeviceToView, 0.0, aEmptyProperties);
+}
- // set projection
- if(::com::sun::star::drawing::ProjectionMode_PERSPECTIVE == rSdrSceneAttribute.getProjectionMode())
- {
- aProjection.frustum(
- aDeviceRange.getMinX(), aDeviceRange.getMaxX(),
- aDeviceRange.getMinY(), aDeviceRange.getMaxY(),
- fMinZ, fMaxZ);
- }
- else
- {
- aProjection.ortho(
- aDeviceRange.getMinX(), aDeviceRange.getMaxX(),
- aDeviceRange.getMinY(), aDeviceRange.getMaxY(),
- fMinZ, fMaxZ);
- }
- }
+void ViewContactOfE3dScene::createObjectTransformation()
+{
+ // create 2d Object Transformation from relative point in 2d scene to world
+ Rectangle aRectangle = GetE3dScene().GetSnapRect();
+ // Hack for calc, transform position of object according
+ // to current zoom so as objects relative position to grid
+ // appears stable
+ aRectangle += GetE3dScene().GetGridOffset();
+ maObjectTransformation.set(0, 0, aRectangle.getWidth());
+ maObjectTransformation.set(1, 1, aRectangle.getHeight());
+ maObjectTransformation.set(0, 2, aRectangle.Left());
+ maObjectTransformation.set(1, 2, aRectangle.Top());
+}
+
+void ViewContactOfE3dScene::createSdrSceneAttribute()
+{
+ const SfxItemSet& rItemSet = GetE3dScene().GetMergedItemSet();
+ maSdrSceneAttribute = drawinglayer::primitive2d::createNewSdrSceneAttribute(rItemSet);
+}
- // create device to view transform
- {
- // create standard deviceToView projection for geometry
- // input is [-1.0 .. 1.0] in X,Y and Z. bring to [0.0 .. 1.0]. Also
- // necessary to flip Y due to screen orientation
- // Z is not needed, but will also be brought to [0.0 .. 1.0]
- aDeviceToView.scale(0.5, -0.5, 0.5);
- aDeviceToView.translate(0.5, 0.5, 0.5);
- }
+void ViewContactOfE3dScene::createSdrLightingAttribute()
+{
+ const SfxItemSet& rItemSet = GetE3dScene().GetMergedItemSet();
+ maSdrLightingAttribute = drawinglayer::primitive2d::createNewSdrLightingAttribute(rItemSet);
+}
- const uno::Sequence< beans::PropertyValue > aEmptyProperties;
- maViewInformation3D = drawinglayer::geometry::ViewInformation3D(
- aTransformation, aOrientation, aProjection,
- aDeviceToView, 0.0, aEmptyProperties);
- }
+drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3dScene::createScenePrimitive2DSequence(
+ const SetOfByte* pLayerVisibility) const
+{
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ const sal_uInt32 nChildrenCount(GetObjectCount());
- void ViewContactOfE3dScene::createObjectTransformation()
+ if(nChildrenCount)
+ {
+ // create 3d scene primitive with visible content tested against rLayerVisibility
+ drawinglayer::primitive3d::Primitive3DSequence aAllSequence;
+ drawinglayer::primitive3d::Primitive3DSequence aVisibleSequence;
+ const bool bTestLayerVisibility(0 != pLayerVisibility);
+ const bool bTestSelectedVisibility(GetE3dScene().GetDrawOnlySelected());
+ const bool bTestVisibility(bTestLayerVisibility || bTestSelectedVisibility);
+
+ // add children recursively. Do NOT start with (*this), this would create
+ // a 3D transformPrimitive for the start scene. While this is theoretically not
+ // a bad thing, for historical reasons the transformation of the outmost scene
+ // is seen as part of the ViewTransformation (see text in createViewInformation3D)
+ for(sal_uInt32 a(0L); a < nChildrenCount; a++)
{
- // create 2d Object Transformation from relative point in 2d scene to world
- Rectangle aRectangle = GetE3dScene().GetSnapRect();
- // Hack for calc, transform position of object according
- // to current zoom so as objects relative position to grid
- // appears stable
- aRectangle += GetE3dScene().GetGridOffset();
- maObjectTransformation.set(0, 0, aRectangle.getWidth());
- maObjectTransformation.set(1, 1, aRectangle.getHeight());
- maObjectTransformation.set(0, 2, aRectangle.Left());
- maObjectTransformation.set(1, 2, aRectangle.Top());
+ createSubPrimitive3DVector(
+ GetViewContact(a),
+ aAllSequence,
+ bTestLayerVisibility ? &aVisibleSequence : 0,
+ bTestLayerVisibility ? pLayerVisibility : 0,
+ bTestSelectedVisibility);
}
- void ViewContactOfE3dScene::createSdrSceneAttribute()
- {
- const SfxItemSet& rItemSet = GetE3dScene().GetMergedItemSet();
- maSdrSceneAttribute = drawinglayer::primitive2d::createNewSdrSceneAttribute(rItemSet);
- }
+ const sal_uInt32 nAllSize(aAllSequence.hasElements() ? aAllSequence.getLength() : 0);
+ const sal_uInt32 nVisibleSize(aVisibleSequence.hasElements() ? aVisibleSequence.getLength() : 0);
- void ViewContactOfE3dScene::createSdrLightingAttribute()
+ if((bTestVisibility && nVisibleSize) || nAllSize)
{
- const SfxItemSet& rItemSet = GetE3dScene().GetMergedItemSet();
- maSdrLightingAttribute = drawinglayer::primitive2d::createNewSdrLightingAttribute(rItemSet);
+ // for getting the 3D range using getB3DRangeFromPrimitive3DSequence a ViewInformation3D
+ // needs to be given for evtl. decompositions. At the same time createViewInformation3D
+ // currently is based on creating the target-ViewInformation3D using a given range. To
+ // get the true range, use a neutral ViewInformation3D here. This leaves all matrices
+ // on identity and the time on 0.0.
+ const uno::Sequence< beans::PropertyValue > aEmptyProperties;
+ const drawinglayer::geometry::ViewInformation3D aNeutralViewInformation3D(aEmptyProperties);
+ const basegfx::B3DRange aContentRange(
+ drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(aAllSequence, aNeutralViewInformation3D));
+
+ // create 2d primitive 3dscene with generated sub-list from collector
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::ScenePrimitive2D(
+ bTestVisibility ? aVisibleSequence : aAllSequence,
+ getSdrSceneAttribute(),
+ getSdrLightingAttribute(),
+ getObjectTransformation(),
+ getViewInformation3D(aContentRange)));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+ }
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3dScene::createScenePrimitive2DSequence(
- const SetOfByte* pLayerVisibility) const
- {
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
- const sal_uInt32 nChildrenCount(GetObjectCount());
-
- if(nChildrenCount)
- {
- // create 3d scene primitive with visible content tested against rLayerVisibility
- drawinglayer::primitive3d::Primitive3DSequence aAllSequence;
- drawinglayer::primitive3d::Primitive3DSequence aVisibleSequence;
- const bool bTestLayerVisibility(0 != pLayerVisibility);
- const bool bTestSelectedVisibility(GetE3dScene().GetDrawOnlySelected());
- const bool bTestVisibility(bTestLayerVisibility || bTestSelectedVisibility);
-
- // add children recursively. Do NOT start with (*this), this would create
- // a 3D transformPrimitive for the start scene. While this is theoretically not
- // a bad thing, for historical reasons the transformation of the outmost scene
- // is seen as part of the ViewTransformation (see text in createViewInformation3D)
- for(sal_uInt32 a(0L); a < nChildrenCount; a++)
- {
- createSubPrimitive3DVector(
- GetViewContact(a),
- aAllSequence,
- bTestLayerVisibility ? &aVisibleSequence : 0,
- bTestLayerVisibility ? pLayerVisibility : 0,
- bTestSelectedVisibility);
- }
+ // always append an invisible outline for the cases where no visible content exists
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, getObjectTransformation()));
- const sal_uInt32 nAllSize(aAllSequence.hasElements() ? aAllSequence.getLength() : 0);
- const sal_uInt32 nVisibleSize(aVisibleSequence.hasElements() ? aVisibleSequence.getLength() : 0);
+ return xRetval;
+}
- if((bTestVisibility && nVisibleSize) || nAllSize)
- {
- // for getting the 3D range using getB3DRangeFromPrimitive3DSequence a ViewInformation3D
- // needs to be given for evtl. decompositions. At the same time createViewInformation3D
- // currently is based on creating the target-ViewInformation3D using a given range. To
- // get the true range, use a neutral ViewInformation3D here. This leaves all matrices
- // on identity and the time on 0.0.
- const uno::Sequence< beans::PropertyValue > aEmptyProperties;
- const drawinglayer::geometry::ViewInformation3D aNeutralViewInformation3D(aEmptyProperties);
- const basegfx::B3DRange aContentRange(
- drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(aAllSequence, aNeutralViewInformation3D));
-
- // create 2d primitive 3dscene with generated sub-list from collector
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::ScenePrimitive2D(
- bTestVisibility ? aVisibleSequence : aAllSequence,
- getSdrSceneAttribute(),
- getSdrLightingAttribute(),
- getObjectTransformation(),
- getViewInformation3D(aContentRange)));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
+drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3dScene::createViewIndependentPrimitive2DSequence() const
+{
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
- // always append an invisible outline for the cases where no visible content exists
- drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
- drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
- false, getObjectTransformation()));
+ if(GetObjectCount())
+ {
+ // create a default ScenePrimitive2D (without visibility test of members)
+ xRetval = createScenePrimitive2DSequence(0);
+ }
- return xRetval;
- }
+ return xRetval;
+}
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3dScene::createViewIndependentPrimitive2DSequence() const
- {
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
+void ViewContactOfE3dScene::ActionChanged()
+{
+ // call parent
+ ViewContactOfSdrObj::ActionChanged();
- if(GetObjectCount())
- {
- // create a default ScenePrimitive2D (without visibility test of members)
- xRetval = createScenePrimitive2DSequence(0);
- }
+ // mark locally cached values as invalid
+ maViewInformation3D = drawinglayer::geometry::ViewInformation3D();
+ maObjectTransformation.identity();
+ maSdrSceneAttribute = drawinglayer::attribute::SdrSceneAttribute();
+ maSdrLightingAttribute = drawinglayer::attribute::SdrLightingAttribute();
+}
- return xRetval;
- }
+const drawinglayer::geometry::ViewInformation3D& ViewContactOfE3dScene::getViewInformation3D() const
+{
+ if(maViewInformation3D.isDefault())
+ {
+ // this version will create the content range on demand locally and thus is less
+ // performant than the other one. Since the information is buffered the planned
+ // behaviour is that the version with the given range is used initially.
+ basegfx::B3DRange aContentRange(getAllContentRange3D());
- void ViewContactOfE3dScene::ActionChanged()
+ if(aContentRange.isEmpty())
{
- // call parent
- ViewContactOfSdrObj::ActionChanged();
-
- // mark locally cached values as invalid
- maViewInformation3D = drawinglayer::geometry::ViewInformation3D();
- maObjectTransformation.identity();
- maSdrSceneAttribute = drawinglayer::attribute::SdrSceneAttribute();
- maSdrLightingAttribute = drawinglayer::attribute::SdrLightingAttribute();
+ // empty scene, no 3d action should be necessary. Prepare some
+ // fallback size
+ OSL_FAIL("No need to get ViewInformation3D from an empty scene (!)");
+ aContentRange.expand(basegfx::B3DPoint(-100.0, -100.0, -100.0));
+ aContentRange.expand(basegfx::B3DPoint( 100.0, 100.0, 100.0));
}
- const drawinglayer::geometry::ViewInformation3D& ViewContactOfE3dScene::getViewInformation3D() const
- {
- if(maViewInformation3D.isDefault())
- {
- // this version will create the content range on demand locally and thus is less
- // performant than the other one. Since the information is buffered the planned
- // behaviour is that the version with the given range is used initially.
- basegfx::B3DRange aContentRange(getAllContentRange3D());
-
- if(aContentRange.isEmpty())
- {
- // empty scene, no 3d action should be necessary. Prepare some
- // fallback size
- OSL_FAIL("No need to get ViewInformation3D from an empty scene (!)");
- aContentRange.expand(basegfx::B3DPoint(-100.0, -100.0, -100.0));
- aContentRange.expand(basegfx::B3DPoint( 100.0, 100.0, 100.0));
- }
-
- const_cast < ViewContactOfE3dScene* >(this)->createViewInformation3D(aContentRange);
- }
+ const_cast < ViewContactOfE3dScene* >(this)->createViewInformation3D(aContentRange);
+ }
- return maViewInformation3D;
- }
+ return maViewInformation3D;
+}
- const drawinglayer::geometry::ViewInformation3D& ViewContactOfE3dScene::getViewInformation3D(const basegfx::B3DRange& rContentRange) const
- {
- if(maViewInformation3D.isDefault())
- {
- const_cast < ViewContactOfE3dScene* >(this)->createViewInformation3D(rContentRange);
- }
+const drawinglayer::geometry::ViewInformation3D& ViewContactOfE3dScene::getViewInformation3D(const basegfx::B3DRange& rContentRange) const
+{
+ if(maViewInformation3D.isDefault())
+ {
+ const_cast < ViewContactOfE3dScene* >(this)->createViewInformation3D(rContentRange);
+ }
- return maViewInformation3D;
- }
+ return maViewInformation3D;
+}
- const basegfx::B2DHomMatrix& ViewContactOfE3dScene::getObjectTransformation() const
- {
- if(maObjectTransformation.isIdentity())
- {
- const_cast < ViewContactOfE3dScene* >(this)->createObjectTransformation();
- }
+const basegfx::B2DHomMatrix& ViewContactOfE3dScene::getObjectTransformation() const
+{
+ if(maObjectTransformation.isIdentity())
+ {
+ const_cast < ViewContactOfE3dScene* >(this)->createObjectTransformation();
+ }
- return maObjectTransformation;
- }
+ return maObjectTransformation;
+}
- const drawinglayer::attribute::SdrSceneAttribute& ViewContactOfE3dScene::getSdrSceneAttribute() const
- {
- if(maSdrSceneAttribute.isDefault())
- {
- const_cast < ViewContactOfE3dScene* >(this)->createSdrSceneAttribute();
- }
+const drawinglayer::attribute::SdrSceneAttribute& ViewContactOfE3dScene::getSdrSceneAttribute() const
+{
+ if(maSdrSceneAttribute.isDefault())
+ {
+ const_cast < ViewContactOfE3dScene* >(this)->createSdrSceneAttribute();
+ }
- return maSdrSceneAttribute;
- }
+ return maSdrSceneAttribute;
+}
- const drawinglayer::attribute::SdrLightingAttribute& ViewContactOfE3dScene::getSdrLightingAttribute() const
- {
- if(maSdrLightingAttribute.isDefault())
- {
- const_cast < ViewContactOfE3dScene* >(this)->createSdrLightingAttribute();
- }
+const drawinglayer::attribute::SdrLightingAttribute& ViewContactOfE3dScene::getSdrLightingAttribute() const
+{
+ if(maSdrLightingAttribute.isDefault())
+ {
+ const_cast < ViewContactOfE3dScene* >(this)->createSdrLightingAttribute();
+ }
- return maSdrLightingAttribute;
- }
+ return maSdrLightingAttribute;
+}
- drawinglayer::primitive3d::Primitive3DSequence ViewContactOfE3dScene::getAllPrimitive3DSequence() const
- {
- drawinglayer::primitive3d::Primitive3DSequence aAllPrimitive3DSequence;
- const sal_uInt32 nChildrenCount(GetObjectCount());
+drawinglayer::primitive3d::Primitive3DSequence ViewContactOfE3dScene::getAllPrimitive3DSequence() const
+{
+ drawinglayer::primitive3d::Primitive3DSequence aAllPrimitive3DSequence;
+ const sal_uInt32 nChildrenCount(GetObjectCount());
+
+ // add children recursively. Do NOT start with (*this), this would create
+ // a 3D transformPrimitive for the start scene. While this is theoretically not
+ // a bad thing, for historical reasons the transformation of the outmost scene
+ // is seen as part of the ViewTransformation (see text in createViewInformation3D)
+ for(sal_uInt32 a(0L); a < nChildrenCount; a++)
+ {
+ createSubPrimitive3DVector(GetViewContact(a), aAllPrimitive3DSequence, 0, 0, false);
+ }
- // add children recursively. Do NOT start with (*this), this would create
- // a 3D transformPrimitive for the start scene. While this is theoretically not
- // a bad thing, for historical reasons the transformation of the outmost scene
- // is seen as part of the ViewTransformation (see text in createViewInformation3D)
- for(sal_uInt32 a(0L); a < nChildrenCount; a++)
- {
- createSubPrimitive3DVector(GetViewContact(a), aAllPrimitive3DSequence, 0, 0, false);
- }
+ return aAllPrimitive3DSequence;
+}
- return aAllPrimitive3DSequence;
- }
+basegfx::B3DRange ViewContactOfE3dScene::getAllContentRange3D() const
+{
+ const drawinglayer::primitive3d::Primitive3DSequence xAllSequence(getAllPrimitive3DSequence());
+ basegfx::B3DRange aAllContentRange3D;
- basegfx::B3DRange ViewContactOfE3dScene::getAllContentRange3D() const
- {
- const drawinglayer::primitive3d::Primitive3DSequence xAllSequence(getAllPrimitive3DSequence());
- basegfx::B3DRange aAllContentRange3D;
+ if(xAllSequence.hasElements())
+ {
+ // for getting the 3D range using getB3DRangeFromPrimitive3DSequence a ViewInformation3D
+ // needs to be given for evtl. decompositions. Use a neutral ViewInformation3D here. This
+ // leaves all matrices on identity and the time on 0.0.
+ const uno::Sequence< beans::PropertyValue > aEmptyProperties;
+ const drawinglayer::geometry::ViewInformation3D aNeutralViewInformation3D(aEmptyProperties);
- if(xAllSequence.hasElements())
- {
- // for getting the 3D range using getB3DRangeFromPrimitive3DSequence a ViewInformation3D
- // needs to be given for evtl. decompositions. Use a neutral ViewInformation3D here. This
- // leaves all matrices on identity and the time on 0.0.
- const uno::Sequence< beans::PropertyValue > aEmptyProperties;
- const drawinglayer::geometry::ViewInformation3D aNeutralViewInformation3D(aEmptyProperties);
+ aAllContentRange3D = drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(xAllSequence, aNeutralViewInformation3D);
+ }
- aAllContentRange3D = drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(xAllSequence, aNeutralViewInformation3D);
- }
+ return aAllContentRange3D;
+}
- return aAllContentRange3D;
- }
- } // end of namespace contact
-} // end of namespace sdr
+}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/contact/viewcontactofpageobj.cxx b/svx/source/sdr/contact/viewcontactofpageobj.cxx
index ec7ae8eca5ca..4e5614d6d7c6 100644
--- a/svx/source/sdr/contact/viewcontactofpageobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofpageobj.cxx
@@ -29,60 +29,55 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+namespace sdr { namespace contact {
-
-namespace sdr
+ViewObjectContact& ViewContactOfPageObj::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
{
- namespace contact
- {
- ViewObjectContact& ViewContactOfPageObj::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
- {
- ViewObjectContact* pRetval = new ViewObjectContactOfPageObj(rObjectContact, *this);
- return *pRetval;
- }
+ ViewObjectContact* pRetval = new ViewObjectContactOfPageObj(rObjectContact, *this);
+ return *pRetval;
+}
- ViewContactOfPageObj::ViewContactOfPageObj(SdrPageObj& rPageObj)
- : ViewContactOfSdrObj(rPageObj)
- {
- }
+ViewContactOfPageObj::ViewContactOfPageObj(SdrPageObj& rPageObj)
+: ViewContactOfSdrObj(rPageObj)
+{
+}
- ViewContactOfPageObj::~ViewContactOfPageObj()
- {
- }
+ViewContactOfPageObj::~ViewContactOfPageObj()
+{
+}
- // #i35972# React on changes of the object of this ViewContact
- void ViewContactOfPageObj::ActionChanged()
- {
- static bool bIsInActionChange(false);
+// #i35972# React on changes of the object of this ViewContact
+void ViewContactOfPageObj::ActionChanged()
+{
+ static bool bIsInActionChange(false);
- if(!bIsInActionChange)
- {
- // set recursion flag, see description in *.hxx
- bIsInActionChange = true;
+ if(!bIsInActionChange)
+ {
+ // set recursion flag, see description in *.hxx
+ bIsInActionChange = true;
- // call parent
- ViewContactOfSdrObj::ActionChanged();
+ // call parent
+ ViewContactOfSdrObj::ActionChanged();
- // reset recursion flag, see description in *.hxx
- bIsInActionChange = false;
- }
- }
+ // reset recursion flag, see description in *.hxx
+ bIsInActionChange = false;
+ }
+}
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfPageObj::createViewIndependentPrimitive2DSequence() const
- {
- // ceate graphical visualisation data. Since this is the view-independent version which should not be used,
- // create a replacement graphic visualisation here. Use GetLastBoundRect to access the model data directly
- // which is aOutRect for SdrPageObj.
- const Rectangle aModelRectangle(GetPageObj().GetLastBoundRect());
- const basegfx::B2DRange aModelRange(aModelRectangle.Left(), aModelRectangle.Top(), aModelRectangle.Right(), aModelRectangle.Bottom());
- const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aModelRange));
- const basegfx::BColor aYellow(1.0, 1.0, 0.0);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aYellow));
+drawinglayer::primitive2d::Primitive2DSequence ViewContactOfPageObj::createViewIndependentPrimitive2DSequence() const
+{
+ // ceate graphical visualisation data. Since this is the view-independent version which should not be used,
+ // create a replacement graphic visualisation here. Use GetLastBoundRect to access the model data directly
+ // which is aOutRect for SdrPageObj.
+ const Rectangle aModelRectangle(GetPageObj().GetLastBoundRect());
+ const basegfx::B2DRange aModelRange(aModelRectangle.Left(), aModelRectangle.Top(), aModelRectangle.Right(), aModelRectangle.Bottom());
+ const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aModelRange));
+ const basegfx::BColor aYellow(1.0, 1.0, 0.0);
+ const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aYellow));
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+}
- } // end of namespace contact
-} // end of namespace sdr
+}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
index 75460eca4a3b..214a871b14d1 100644
--- a/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
@@ -26,30 +26,20 @@
namespace sdr { namespace contact {
-
-// - ViewContactOfSdrMediaObj -
-
-
ViewContactOfSdrMediaObj::ViewContactOfSdrMediaObj( SdrMediaObj& rMediaObj ) :
ViewContactOfSdrObj( rMediaObj )
{
}
-
-
ViewContactOfSdrMediaObj::~ViewContactOfSdrMediaObj()
{
}
-
-
ViewObjectContact& ViewContactOfSdrMediaObj::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
{
return *( new ViewObjectContactOfSdrMediaObj( rObjectContact, *this, static_cast< SdrMediaObj& >( GetSdrObject() ).getMediaProperties() ) );
}
-
-
Size ViewContactOfSdrMediaObj::getPreferredSize() const
{
// #i71805# Since we may have a whole bunch of VOCs here, make a loop
@@ -70,8 +60,6 @@ Size ViewContactOfSdrMediaObj::getPreferredSize() const
return Size();
}
-
-
void ViewContactOfSdrMediaObj::updateMediaItem( ::avmedia::MediaItem& rItem ) const
{
// #i71805# Since we may have a whole bunch of VOCs here, make a loop
@@ -88,8 +76,6 @@ void ViewContactOfSdrMediaObj::updateMediaItem( ::avmedia::MediaItem& rItem ) co
}
}
-
-
void ViewContactOfSdrMediaObj::executeMediaItem( const ::avmedia::MediaItem& rItem )
{
const sal_uInt32 nCount(getViewObjectContactCount());
@@ -105,53 +91,45 @@ void ViewContactOfSdrMediaObj::executeMediaItem( const ::avmedia::MediaItem& rIt
}
}
-
-
void ViewContactOfSdrMediaObj::mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState )
{
static_cast< SdrMediaObj& >(GetSdrObject()).mediaPropertiesChanged(rNewState);
}
-}} // end of namespace sdr::contact
-
-namespace sdr
+drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrMediaObj::createViewIndependentPrimitive2DSequence() const
{
- namespace contact
- {
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrMediaObj::createViewIndependentPrimitive2DSequence() const
- {
- // create range using the model data directly. This is in SdrTextObj::aRect which i will access using
- // GetGeoRect() to not trigger any calculations. It's the unrotated geometry which is okay for MediaObjects ATM.
- Rectangle aRectangle(GetSdrMediaObj().GetGeoRect());
- // Hack for calc, transform position of object according
- // to current zoom so as objects relative position to grid
- // appears stable
- aRectangle += GetSdrMediaObj().GetGridOffset();
- const basegfx::B2DRange aRange(
- aRectangle.Left(), aRectangle.Top(),
- aRectangle.Right(), aRectangle.Bottom());
-
- // create object transform
- basegfx::B2DHomMatrix aTransform;
- aTransform.set(0, 0, aRange.getWidth());
- aTransform.set(1, 1, aRange.getHeight());
- aTransform.set(0, 2, aRange.getMinX());
- aTransform.set(1, 2, aRange.getMinY());
-
- // create media primitive. Always create primitives to allow the
- // decomposition of MediaPrimitive2D to create needed invisible elements for HitTest
- // and/or BoundRect
- const basegfx::BColor aBackgroundColor(67.0 / 255.0, 67.0 / 255.0, 67.0 / 255.0);
- const OUString& rURL(GetSdrMediaObj().getURL());
- const sal_uInt32 nPixelBorder(4L);
- const drawinglayer::primitive2d::Primitive2DReference xRetval(
- new drawinglayer::primitive2d::MediaPrimitive2D(
- aTransform, rURL, aBackgroundColor, nPixelBorder,
- GetSdrMediaObj().getSnapshot()));
-
- return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
- }
- } // end of namespace contact
-} // end of namespace sdr
+ // create range using the model data directly. This is in SdrTextObj::aRect which i will access using
+ // GetGeoRect() to not trigger any calculations. It's the unrotated geometry which is okay for MediaObjects ATM.
+ Rectangle aRectangle(GetSdrMediaObj().GetGeoRect());
+ // Hack for calc, transform position of object according
+ // to current zoom so as objects relative position to grid
+ // appears stable
+ aRectangle += GetSdrMediaObj().GetGridOffset();
+ const basegfx::B2DRange aRange(
+ aRectangle.Left(), aRectangle.Top(),
+ aRectangle.Right(), aRectangle.Bottom());
+
+ // create object transform
+ basegfx::B2DHomMatrix aTransform;
+ aTransform.set(0, 0, aRange.getWidth());
+ aTransform.set(1, 1, aRange.getHeight());
+ aTransform.set(0, 2, aRange.getMinX());
+ aTransform.set(1, 2, aRange.getMinY());
+
+ // create media primitive. Always create primitives to allow the
+ // decomposition of MediaPrimitive2D to create needed invisible elements for HitTest
+ // and/or BoundRect
+ const basegfx::BColor aBackgroundColor(67.0 / 255.0, 67.0 / 255.0, 67.0 / 255.0);
+ const OUString& rURL(GetSdrMediaObj().getURL());
+ const sal_uInt32 nPixelBorder(4L);
+ const drawinglayer::primitive2d::Primitive2DReference xRetval(
+ new drawinglayer::primitive2d::MediaPrimitive2D(
+ aTransform, rURL, aBackgroundColor, nPixelBorder,
+ GetSdrMediaObj().getSnapshot()));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
+}
+
+}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
index a1c2e1bd8636..80ded95ec15a 100644
--- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <svx/sdr/contact/viewcontactofsdrrectobj.hxx>
#include <svx/svdorect.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
@@ -27,73 +26,69 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <svx/svdmodel.hxx>
+namespace sdr { namespace contact {
+ViewContactOfSdrRectObj::ViewContactOfSdrRectObj(SdrRectObj& rRectObj)
+: ViewContactOfTextObj(rRectObj)
+{
+}
-namespace sdr
+ViewContactOfSdrRectObj::~ViewContactOfSdrRectObj()
{
- namespace contact
- {
- ViewContactOfSdrRectObj::ViewContactOfSdrRectObj(SdrRectObj& rRectObj)
- : ViewContactOfTextObj(rRectObj)
- {
- }
+}
- ViewContactOfSdrRectObj::~ViewContactOfSdrRectObj()
- {
- }
+drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrRectObj::createViewIndependentPrimitive2DSequence() const
+{
+ const SfxItemSet& rItemSet = GetRectObj().GetMergedItemSet();
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetRectObj().getText(0),
+ false));
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrRectObj::createViewIndependentPrimitive2DSequence() const
- {
- const SfxItemSet& rItemSet = GetRectObj().GetMergedItemSet();
- const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
- drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
- rItemSet,
- GetRectObj().getText(0),
- false));
+ // take unrotated snap rect (direct model data) for position and size
+ Rectangle rRectangle = GetRectObj().GetGeoRect();
+ // Hack for calc, transform position of object according
+ // to current zoom so as objects relative position to grid
+ // appears stable
+ rRectangle += GetRectObj().GetGridOffset();
+ const ::basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom() );
- // take unrotated snap rect (direct model data) for position and size
- Rectangle rRectangle = GetRectObj().GetGeoRect();
- // Hack for calc, transform position of object according
- // to current zoom so as objects relative position to grid
- // appears stable
- rRectangle += GetRectObj().GetGridOffset();
- const ::basegfx::B2DRange aObjectRange(
- rRectangle.Left(), rRectangle.Top(),
- rRectangle.Right(), rRectangle.Bottom() );
+ const GeoStat& rGeoStat(GetRectObj().GetGeoStat());
- const GeoStat& rGeoStat(GetRectObj().GetGeoStat());
+ // fill object matrix
+ basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(),
+ rGeoStat.nShearAngle ? tan((36000 - rGeoStat.nShearAngle) * F_PI18000) : 0.0,
+ rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle) * F_PI18000 : 0.0,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
- // fill object matrix
- basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- rGeoStat.nShearAngle ? tan((36000 - rGeoStat.nShearAngle) * F_PI18000) : 0.0,
- rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
+ // calculate corner radius
+ sal_uInt32 nCornerRadius((static_cast<const SdrMetricItem&>(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue());
+ double fCornerRadiusX;
+ double fCornerRadiusY;
+ drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY);
- // calculate corner radius
- sal_uInt32 nCornerRadius((static_cast<const SdrMetricItem&>(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue());
- double fCornerRadiusX;
- double fCornerRadiusY;
- drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY);
+ // #i105856# use knowledge about pickthrough from the model
+ const bool bPickThroughTransparentTextFrames(
+ GetRectObj().GetModel() && GetRectObj().GetModel()->IsPickThroughTransparentTextFrames());
- // #i105856# use knowledge about pickthrough from the model
- const bool bPickThroughTransparentTextFrames(
- GetRectObj().GetModel() && GetRectObj().GetModel()->IsPickThroughTransparentTextFrames());
+ // create primitive. Always create primitives to allow the decomposition of
+ // SdrRectanglePrimitive2D to create needed invisible elements for HitTest and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrRectanglePrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ fCornerRadiusX,
+ fCornerRadiusY,
+ // #i105856# use fill for HitTest when TextFrame and not PickThrough
+ GetRectObj().IsTextFrame() && !bPickThroughTransparentTextFrames));
- // create primitive. Always create primitives to allow the decomposition of
- // SdrRectanglePrimitive2D to create needed invisible elements for HitTest and/or BoundRect
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::SdrRectanglePrimitive2D(
- aObjectMatrix,
- aAttribute,
- fCornerRadiusX,
- fCornerRadiusY,
- // #i105856# use fill for HitTest when TextFrame and not PickThrough
- GetRectObj().IsTextFrame() && !bPickThroughTransparentTextFrames));
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+}
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- } // end of namespace contact
-} // end of namespace sdr
+}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/contact/viewcontactoftextobj.cxx b/svx/source/sdr/contact/viewcontactoftextobj.cxx
index e35c3bdf51af..7b6913b3198f 100644
--- a/svx/source/sdr/contact/viewcontactoftextobj.cxx
+++ b/svx/source/sdr/contact/viewcontactoftextobj.cxx
@@ -20,21 +20,22 @@
#include <svx/sdr/contact/viewcontactoftextobj.hxx>
#include <svx/svdotext.hxx>
+namespace sdr { namespace contact {
+const SdrTextObj& ViewContactOfTextObj::GetTextObj() const
+{
+ return static_cast<const SdrTextObj&>(GetSdrObject());
+}
+
+ViewContactOfTextObj::ViewContactOfTextObj(SdrTextObj& rTextObj)
+: ViewContactOfSdrObj(rTextObj)
+{
+}
-namespace sdr
+ViewContactOfTextObj::~ViewContactOfTextObj()
{
- namespace contact
- {
- ViewContactOfTextObj::ViewContactOfTextObj(SdrTextObj& rTextObj)
- : ViewContactOfSdrObj(rTextObj)
- {
- }
+}
- ViewContactOfTextObj::~ViewContactOfTextObj()
- {
- }
- } // end of namespace contact
-} // end of namespace sdr
+}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/contact/viewcontactofvirtobj.cxx b/svx/source/sdr/contact/viewcontactofvirtobj.cxx
index e75a2dcfb1ca..90997fe7bfa1 100644
--- a/svx/source/sdr/contact/viewcontactofvirtobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofvirtobj.cxx
@@ -25,81 +25,78 @@
#include <vcl/outdev.hxx>
#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+namespace sdr { namespace contact {
+ViewContactOfVirtObj::ViewContactOfVirtObj(SdrVirtObj& rObj)
+: ViewContactOfSdrObj(rObj)
+{
+}
+
+ViewContactOfVirtObj::~ViewContactOfVirtObj()
+{
+}
-namespace sdr
+SdrVirtObj& ViewContactOfVirtObj::GetVirtObj() const
{
- namespace contact
+ return static_cast<SdrVirtObj&>(mrObject);
+}
+
+// Access to possible sub-hierarchy
+sal_uInt32 ViewContactOfVirtObj::GetObjectCount() const
+{
+ // Here, SdrVirtObj's need to return 0L to show that they have no
+ // sub-hierarchy, even when they are group objects. This is necessary
+ // to avoid that the same VOCs will be added to the draw hierarchy
+ // twice which leads to problems.
+
+ // This solution is only a first solution to get things running. Later
+ // this needs to be replaced with creating real VOCs for the objects
+ // referenced by virtual objects to avoid the 'trick' of setting the
+ // offset for painting at the destination OutputDevive.
+
+ // As can be seen, with primitives, the problem will be solved using
+ // a transformPrimitive, so this solution can stay with primitives.
+ return 0L;
+}
+
+drawinglayer::primitive2d::Primitive2DSequence ViewContactOfVirtObj::createViewIndependentPrimitive2DSequence() const
+{
+ // create displacement transformation if we have content
+ basegfx::B2DHomMatrix aObjectMatrix;
+ Point aAnchor(GetVirtObj().GetAnchorPos());
+
+ if(aAnchor.X() || aAnchor.Y())
{
- ViewContactOfVirtObj::ViewContactOfVirtObj(SdrVirtObj& rObj)
- : ViewContactOfSdrObj(rObj)
- {
- }
-
- ViewContactOfVirtObj::~ViewContactOfVirtObj()
- {
- }
-
- SdrVirtObj& ViewContactOfVirtObj::GetVirtObj() const
- {
- return static_cast<SdrVirtObj&>(mrObject);
- }
-
- // Access to possible sub-hierarchy
- sal_uInt32 ViewContactOfVirtObj::GetObjectCount() const
- {
- // Here, SdrVirtObj's need to return 0L to show that they have no
- // sub-hierarchy, even when they are group objects. This is necessary
- // to avoid that the same VOCs will be added to the draw hierarchy
- // twice which leads to problems.
-
- // This solution is only a first solution to get things running. Later
- // this needs to be replaced with creating real VOCs for the objects
- // referenced by virtual objects to avoid the 'trick' of setting the
- // offset for painting at the destination OutputDevive.
-
- // As can be seen, with primitives, the problem will be solved using
- // a transformPrimitive, so this solution can stay with primitives.
- return 0L;
- }
-
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfVirtObj::createViewIndependentPrimitive2DSequence() const
- {
- // create displacement transformation if we have content
- basegfx::B2DHomMatrix aObjectMatrix;
- Point aAnchor(GetVirtObj().GetAnchorPos());
-
- if(aAnchor.X() || aAnchor.Y())
- {
- aObjectMatrix.set(0, 2, aAnchor.X());
- aObjectMatrix.set(1, 2, aAnchor.Y());
- }
-
- // use method from referenced object to get the Primitive2DSequence
- const drawinglayer::primitive2d::Primitive2DSequence xSequenceVirtual(
- GetVirtObj().GetReferencedObj().GetViewContact().getViewIndependentPrimitive2DSequence());
-
- if(xSequenceVirtual.hasElements())
- {
- // create transform primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::TransformPrimitive2D(
- aObjectMatrix,
- xSequenceVirtual));
-
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- else
- {
- // always append an invisible outline for the cases where no visible content exists
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
- false, aObjectMatrix));
-
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
- } // end of namespace contact
-} // end of namespace sdr
+ aObjectMatrix.set(0, 2, aAnchor.X());
+ aObjectMatrix.set(1, 2, aAnchor.Y());
+ }
+
+ // use method from referenced object to get the Primitive2DSequence
+ const drawinglayer::primitive2d::Primitive2DSequence xSequenceVirtual(
+ GetVirtObj().GetReferencedObj().GetViewContact().getViewIndependentPrimitive2DSequence());
+
+ if(xSequenceVirtual.hasElements())
+ {
+ // create transform primitive
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ aObjectMatrix,
+ xSequenceVirtual));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
+ else
+ {
+ // always append an invisible outline for the cases where no visible content exists
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aObjectMatrix));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
+}
+
+}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+
diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
index b5b9f01b37f5..8e65fb02a58f 100644
--- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
@@ -17,13 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
-#include <svtools/colorcfg.hxx>
-
#include <svx/sdr/contact/viewobjectcontactofpageobj.hxx>
#include <svx/sdr/contact/viewcontactofpageobj.hxx>
#include <svx/svdopage.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
+#include <svtools/colorcfg.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
@@ -34,310 +32,296 @@
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+using namespace com::sun::star;
+namespace sdr { namespace contact {
-using namespace com::sun::star;
+class PagePrimitiveExtractor : public ObjectContactOfPagePainter, public Timer
+{
+private:
+ // the ViewObjectContactOfPageObj using this painter
+ ViewObjectContactOfPageObj& mrViewObjectContactOfPageObj;
+
+public:
+ // basic constructor/destructor
+ explicit PagePrimitiveExtractor(ViewObjectContactOfPageObj& rVOC);
+ virtual ~PagePrimitiveExtractor();
+
+ // LazyInvalidate request. Supported here to not automatically
+ // invalidate the second interaction state all the time at the
+ // original OC
+ virtual void setLazyInvalidate(ViewObjectContact& rVOC) SAL_OVERRIDE;
+
+ // From baseclass Timer, the timeout call triggered by the LazyInvalidate mechanism
+ virtual void Timeout() SAL_OVERRIDE;
+
+ // get primitive visualization
+ drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceForPage(const DisplayInfo& rDisplayInfo);
+
+ // Own reaction on changes which will be forwarded to the OC of the owner-VOC
+ virtual void InvalidatePartOfView(const basegfx::B2DRange& rRange) const SAL_OVERRIDE;
+
+ // forward access to SdrPageView of ViewObjectContactOfPageObj
+ virtual bool isOutputToPrinter() const SAL_OVERRIDE;
+ virtual bool isOutputToWindow() const SAL_OVERRIDE;
+ virtual bool isOutputToVirtualDevice() const SAL_OVERRIDE;
+ virtual bool isOutputToRecordingMetaFile() const SAL_OVERRIDE;
+ virtual bool isOutputToPDFFile() const SAL_OVERRIDE;
+ virtual bool isDrawModeGray() const SAL_OVERRIDE;
+ virtual bool isDrawModeBlackWhite() const SAL_OVERRIDE;
+ virtual bool isDrawModeHighContrast() const SAL_OVERRIDE;
+ virtual SdrPageView* TryToGetSdrPageView() const SAL_OVERRIDE;
+ virtual OutputDevice* TryToGetOutputDevice() const SAL_OVERRIDE;
+};
+
+PagePrimitiveExtractor::PagePrimitiveExtractor(
+ ViewObjectContactOfPageObj& rVOC)
+: ObjectContactOfPagePainter(0, rVOC.GetObjectContact()),
+ mrViewObjectContactOfPageObj(rVOC)
+{
+ // make this renderer a preview renderer
+ setPreviewRenderer(true);
+ // init timer
+ SetTimeout(1);
+ Stop();
+}
+PagePrimitiveExtractor::~PagePrimitiveExtractor()
+{
+ // execute missing LazyInvalidates and stop timer
+ Timeout();
+}
+
+void PagePrimitiveExtractor::setLazyInvalidate(ViewObjectContact& /*rVOC*/)
+{
+ // do NOT call parent, but remember that something is to do by
+ // starting the LazyInvalidateTimer
+ Start();
+}
-namespace sdr
+// From baseclass Timer, the timeout call triggered by the LazyInvalidate mechanism
+void PagePrimitiveExtractor::Timeout()
{
- namespace contact
+ // stop the timer
+ Stop();
+
+ // invalidate all LazyInvalidate VOCs new situations
+ const sal_uInt32 nVOCCount(getViewObjectContactCount());
+
+ for(sal_uInt32 a(0); a < nVOCCount; a++)
{
- class PagePrimitiveExtractor : public ObjectContactOfPagePainter, public Timer
- {
- private:
- // the ViewObjectContactOfPageObj using this painter
- ViewObjectContactOfPageObj& mrViewObjectContactOfPageObj;
-
- public:
- // basic constructor/destructor
- explicit PagePrimitiveExtractor(ViewObjectContactOfPageObj& rVOC);
- virtual ~PagePrimitiveExtractor();
-
- // LazyInvalidate request. Supported here to not automatically
- // invalidate the second interaction state all the time at the
- // original OC
- virtual void setLazyInvalidate(ViewObjectContact& rVOC) SAL_OVERRIDE;
-
- // From baseclass Timer, the timeout call triggered by the LazyInvalidate mechanism
- virtual void Timeout() SAL_OVERRIDE;
-
- // get primitive visualization
- drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceForPage(const DisplayInfo& rDisplayInfo);
-
- // Own reaction on changes which will be forwarded to the OC of the owner-VOC
- virtual void InvalidatePartOfView(const basegfx::B2DRange& rRange) const SAL_OVERRIDE;
-
- // forward access to SdrPageView of ViewObjectContactOfPageObj
- virtual bool isOutputToPrinter() const SAL_OVERRIDE;
- virtual bool isOutputToWindow() const SAL_OVERRIDE;
- virtual bool isOutputToVirtualDevice() const SAL_OVERRIDE;
- virtual bool isOutputToRecordingMetaFile() const SAL_OVERRIDE;
- virtual bool isOutputToPDFFile() const SAL_OVERRIDE;
- virtual bool isDrawModeGray() const SAL_OVERRIDE;
- virtual bool isDrawModeBlackWhite() const SAL_OVERRIDE;
- virtual bool isDrawModeHighContrast() const SAL_OVERRIDE;
- virtual SdrPageView* TryToGetSdrPageView() const SAL_OVERRIDE;
- virtual OutputDevice* TryToGetOutputDevice() const SAL_OVERRIDE;
- };
-
- PagePrimitiveExtractor::PagePrimitiveExtractor(
- ViewObjectContactOfPageObj& rVOC)
- : ObjectContactOfPagePainter(0, rVOC.GetObjectContact()),
- mrViewObjectContactOfPageObj(rVOC)
- {
- // make this renderer a preview renderer
- setPreviewRenderer(true);
+ ViewObjectContact* pCandidate = getViewObjectContact(a);
+ pCandidate->triggerLazyInvalidate();
+ }
+}
- // init timer
- SetTimeout(1);
- Stop();
- }
+drawinglayer::primitive2d::Primitive2DSequence PagePrimitiveExtractor::createPrimitive2DSequenceForPage(const DisplayInfo& /*rDisplayInfo*/)
+{
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ const SdrPage* pStartPage = GetStartPage();
+
+ if(pStartPage)
+ {
+ // update own ViewInformation2D for visualized page
+ const drawinglayer::geometry::ViewInformation2D& rOriginalViewInformation = mrViewObjectContactOfPageObj.GetObjectContact().getViewInformation2D();
+ const drawinglayer::geometry::ViewInformation2D aNewViewInformation2D(
+ rOriginalViewInformation.getObjectTransformation(),
+ rOriginalViewInformation.getViewTransformation(),
+
+ // #i101075# use empty range for page content here to force
+ // the content not to be physically clipped in any way. This
+ // would be possible, but would require the internal transformation
+ // which maps between the page visualisation object and the page
+ // content, including the aspect ratios (for details see in
+ // PagePreviewPrimitive2D::create2DDecomposition)
+ basegfx::B2DRange(),
+
+ GetXDrawPageForSdrPage(const_cast< SdrPage* >(pStartPage)),
+ 0.0, // no time; page previews are not animated
+ rOriginalViewInformation.getExtendedInformationSequence());
+ updateViewInformation2D(aNewViewInformation2D);
+
+ // create copy of DisplayInfo to set PagePainting
+ DisplayInfo aDisplayInfo;
+
+ // get page's VOC
+ ViewObjectContact& rDrawPageVOContact = pStartPage->GetViewContact().GetViewObjectContact(*this);
+
+ // get whole Primitive2DSequence
+ xRetval = rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo);
+ }
+
+ return xRetval;
+}
+
+void PagePrimitiveExtractor::InvalidatePartOfView(const basegfx::B2DRange& rRange) const
+{
+ // an invalidate is called at this view, this needs to be translated to an invalidate
+ // for the using VOC. Coordinates are in page coordinate system.
+ const SdrPage* pStartPage = GetStartPage();
+
+ if(pStartPage && !rRange.isEmpty())
+ {
+ const basegfx::B2DRange aPageRange(0.0, 0.0, (double)pStartPage->GetWdt(), (double)pStartPage->GetHgt());
- PagePrimitiveExtractor::~PagePrimitiveExtractor()
+ if(rRange.overlaps(aPageRange))
{
- // execute missing LazyInvalidates and stop timer
- Timeout();
+ // if object on the page is inside or overlapping with page, create ActionChanged() for
+ // involved VOC
+ mrViewObjectContactOfPageObj.ActionChanged();
}
+ }
+}
+
+// forward access to SdrPageView to VOCOfPageObj
+bool PagePrimitiveExtractor::isOutputToPrinter() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToPrinter(); }
+bool PagePrimitiveExtractor::isOutputToWindow() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToWindow(); }
+bool PagePrimitiveExtractor::isOutputToVirtualDevice() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToVirtualDevice(); }
+bool PagePrimitiveExtractor::isOutputToRecordingMetaFile() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToRecordingMetaFile(); }
+bool PagePrimitiveExtractor::isOutputToPDFFile() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToPDFFile(); }
+bool PagePrimitiveExtractor::isDrawModeGray() const { return mrViewObjectContactOfPageObj.GetObjectContact().isDrawModeGray(); }
+bool PagePrimitiveExtractor::isDrawModeBlackWhite() const { return mrViewObjectContactOfPageObj.GetObjectContact().isDrawModeBlackWhite(); }
+bool PagePrimitiveExtractor::isDrawModeHighContrast() const { return mrViewObjectContactOfPageObj.GetObjectContact().isDrawModeHighContrast(); }
+SdrPageView* PagePrimitiveExtractor::TryToGetSdrPageView() const { return mrViewObjectContactOfPageObj.GetObjectContact().TryToGetSdrPageView(); }
+OutputDevice* PagePrimitiveExtractor::TryToGetOutputDevice() const { return mrViewObjectContactOfPageObj.GetObjectContact().TryToGetOutputDevice(); }
+
+drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfPageObj::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
+{
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ const SdrPageObj& rPageObject((static_cast< ViewContactOfPageObj& >(GetViewContact())).GetPageObj());
+ const SdrPage* pPage = rPageObject.GetReferencedPage();
+ const svtools::ColorConfig aColorConfig;
- void PagePrimitiveExtractor::setLazyInvalidate(ViewObjectContact& /*rVOC*/)
+ // get PageObject's geometry
+ basegfx::B2DHomMatrix aPageObjectTransform;
+ {
+ const Rectangle aPageObjectModelData(rPageObject.GetLastBoundRect());
+ const basegfx::B2DRange aPageObjectBound(
+ aPageObjectModelData.Left(), aPageObjectModelData.Top(),
+ aPageObjectModelData.Right(), aPageObjectModelData.Bottom());
+
+ aPageObjectTransform.set(0, 0, aPageObjectBound.getWidth());
+ aPageObjectTransform.set(1, 1, aPageObjectBound.getHeight());
+ aPageObjectTransform.set(0, 2, aPageObjectBound.getMinX());
+ aPageObjectTransform.set(1, 2, aPageObjectBound.getMinY());
+ }
+
+ // #i102637# add gray frame also when printing and page exists (handout pages)
+ const bool bCreateGrayFrame(!GetObjectContact().isOutputToPrinter() || pPage);
+
+ // get displayed page's content. This is the uscaled page content
+ if(mpExtractor && pPage)
+ {
+ // get displayed page's geometry
+ drawinglayer::primitive2d::Primitive2DSequence xPageContent;
+ const Size aPageSize(pPage->GetSize());
+ const double fPageWidth(aPageSize.getWidth());
+ const double fPageHeight(aPageSize.getHeight());
+
+ // The case that a PageObject contains another PageObject which visualizes the
+ // same page again would lead to a recursion. Limit that recursion depth to one
+ // by using a local static bool
+ static bool bInCreatePrimitive2D(false);
+
+ if(bInCreatePrimitive2D)
{
- // do NOT call parent, but remember that something is to do by
- // starting the LazyInvalidateTimer
- Start();
+ // Recursion is possible. Create a replacement primitive
+ xPageContent.realloc(2);
+ const Color aDocColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
+ const Color aBorderColor(aColorConfig.GetColorValue(svtools::DOCBOUNDARIES).nColor);
+ const basegfx::B2DRange aPageBound(0.0, 0.0, fPageWidth, fPageHeight);
+ const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aPageBound));
+
+ // add replacement fill
+ xPageContent[0L] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aOutline), aDocColor.getBColor()));
+
+ // add replacement border
+ xPageContent[1L] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aBorderColor.getBColor()));
}
-
- // From baseclass Timer, the timeout call triggered by the LazyInvalidate mechanism
- void PagePrimitiveExtractor::Timeout()
+ else
{
- // stop the timer
- Stop();
+ // set recursion flag
+ bInCreatePrimitive2D = true;
- // invalidate all LazyInvalidate VOCs new situations
- const sal_uInt32 nVOCCount(getViewObjectContactCount());
+ // init extractor, guarantee existence, set page there
+ mpExtractor->SetStartPage(pPage);
- for(sal_uInt32 a(0); a < nVOCCount; a++)
- {
- ViewObjectContact* pCandidate = getViewObjectContact(a);
- pCandidate->triggerLazyInvalidate();
- }
- }
+ // #i105548# also need to copy the VOCRedirector for sub-content creation
+ mpExtractor->SetViewObjectContactRedirector(GetObjectContact().GetViewObjectContactRedirector());
- drawinglayer::primitive2d::Primitive2DSequence PagePrimitiveExtractor::createPrimitive2DSequenceForPage(const DisplayInfo& /*rDisplayInfo*/)
- {
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
- const SdrPage* pStartPage = GetStartPage();
-
- if(pStartPage)
- {
- // update own ViewInformation2D for visualized page
- const drawinglayer::geometry::ViewInformation2D& rOriginalViewInformation = mrViewObjectContactOfPageObj.GetObjectContact().getViewInformation2D();
- const drawinglayer::geometry::ViewInformation2D aNewViewInformation2D(
- rOriginalViewInformation.getObjectTransformation(),
- rOriginalViewInformation.getViewTransformation(),
-
- // #i101075# use empty range for page content here to force
- // the content not to be physically clipped in any way. This
- // would be possible, but would require the internal transformation
- // which maps between the page visualisation object and the page
- // content, including the aspect ratios (for details see in
- // PagePreviewPrimitive2D::create2DDecomposition)
- basegfx::B2DRange(),
-
- GetXDrawPageForSdrPage(const_cast< SdrPage* >(pStartPage)),
- 0.0, // no time; page previews are not animated
- rOriginalViewInformation.getExtendedInformationSequence());
- updateViewInformation2D(aNewViewInformation2D);
-
- // create copy of DisplayInfo to set PagePainting
- DisplayInfo aDisplayInfo;
-
- // get page's VOC
- ViewObjectContact& rDrawPageVOContact = pStartPage->GetViewContact().GetViewObjectContact(*this);
-
- // get whole Primitive2DSequence
- xRetval = rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo);
- }
-
- return xRetval;
+ // create page content
+ xPageContent = mpExtractor->createPrimitive2DSequenceForPage(rDisplayInfo);
+
+ // #i105548# reset VOCRedirector to not accidentially have a pointer to a
+ // temporary class, so calls to it are avoided safely
+ mpExtractor->SetViewObjectContactRedirector(0);
+
+ // reset recursion flag
+ bInCreatePrimitive2D = false;
}
- void PagePrimitiveExtractor::InvalidatePartOfView(const basegfx::B2DRange& rRange) const
+ // prepare retval
+ if(xPageContent.hasElements())
{
- // an invalidate is called at this view, this needs to be translated to an invalidate
- // for the using VOC. Coordinates are in page coordinate system.
- const SdrPage* pStartPage = GetStartPage();
-
- if(pStartPage && !rRange.isEmpty())
- {
- const basegfx::B2DRange aPageRange(0.0, 0.0, (double)pStartPage->GetWdt(), (double)pStartPage->GetHgt());
-
- if(rRange.overlaps(aPageRange))
- {
- // if object on the page is inside or overlapping with page, create ActionChanged() for
- // involved VOC
- mrViewObjectContactOfPageObj.ActionChanged();
- }
- }
+ const uno::Reference< drawing::XDrawPage > xDrawPage(GetXDrawPageForSdrPage(const_cast< SdrPage*>(pPage)));
+ const drawinglayer::primitive2d::Primitive2DReference xPagePreview(new drawinglayer::primitive2d::PagePreviewPrimitive2D(
+ xDrawPage, aPageObjectTransform, fPageWidth, fPageHeight, xPageContent, true));
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xPagePreview, 1);
}
+ }
+ else if(bCreateGrayFrame)
+ {
+ // #i105146# no content, but frame display. To make hitting the page preview objects
+ // on the handout page more simple, add hidden fill geometry
+ const drawinglayer::primitive2d::Primitive2DReference xFrameHit(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false,
+ aPageObjectTransform));
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xFrameHit, 1);
+ }
+
+ // add a gray outline frame, except not when printing
+ if(bCreateGrayFrame)
+ {
+ const Color aFrameColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES).nColor);
+ basegfx::B2DPolygon aOwnOutline(basegfx::tools::createUnitPolygon());
+ aOwnOutline.transform(aPageObjectTransform);
- // forward access to SdrPageView to VOCOfPageObj
- bool PagePrimitiveExtractor::isOutputToPrinter() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToPrinter(); }
- bool PagePrimitiveExtractor::isOutputToWindow() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToWindow(); }
- bool PagePrimitiveExtractor::isOutputToVirtualDevice() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToVirtualDevice(); }
- bool PagePrimitiveExtractor::isOutputToRecordingMetaFile() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToRecordingMetaFile(); }
- bool PagePrimitiveExtractor::isOutputToPDFFile() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToPDFFile(); }
- bool PagePrimitiveExtractor::isDrawModeGray() const { return mrViewObjectContactOfPageObj.GetObjectContact().isDrawModeGray(); }
- bool PagePrimitiveExtractor::isDrawModeBlackWhite() const { return mrViewObjectContactOfPageObj.GetObjectContact().isDrawModeBlackWhite(); }
- bool PagePrimitiveExtractor::isDrawModeHighContrast() const { return mrViewObjectContactOfPageObj.GetObjectContact().isDrawModeHighContrast(); }
- SdrPageView* PagePrimitiveExtractor::TryToGetSdrPageView() const { return mrViewObjectContactOfPageObj.GetObjectContact().TryToGetSdrPageView(); }
- OutputDevice* PagePrimitiveExtractor::TryToGetOutputDevice() const { return mrViewObjectContactOfPageObj.GetObjectContact().TryToGetOutputDevice(); }
- } // end of namespace contact
-} // end of namespace sdr
+ const drawinglayer::primitive2d::Primitive2DReference xGrayFrame(
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOwnOutline, aFrameColor.getBColor()));
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xGrayFrame);
+ }
+ return xRetval;
+}
-namespace sdr
+ViewObjectContactOfPageObj::ViewObjectContactOfPageObj(ObjectContact& rObjectContact, ViewContact& rViewContact)
+: ViewObjectContactOfSdrObj(rObjectContact, rViewContact),
+ mpExtractor(new PagePrimitiveExtractor(*this))
{
- namespace contact
- {
- drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfPageObj::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
- {
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
- const SdrPageObj& rPageObject((static_cast< ViewContactOfPageObj& >(GetViewContact())).GetPageObj());
- const SdrPage* pPage = rPageObject.GetReferencedPage();
- const svtools::ColorConfig aColorConfig;
-
- // get PageObject's geometry
- basegfx::B2DHomMatrix aPageObjectTransform;
- {
- const Rectangle aPageObjectModelData(rPageObject.GetLastBoundRect());
- const basegfx::B2DRange aPageObjectBound(
- aPageObjectModelData.Left(), aPageObjectModelData.Top(),
- aPageObjectModelData.Right(), aPageObjectModelData.Bottom());
-
- aPageObjectTransform.set(0, 0, aPageObjectBound.getWidth());
- aPageObjectTransform.set(1, 1, aPageObjectBound.getHeight());
- aPageObjectTransform.set(0, 2, aPageObjectBound.getMinX());
- aPageObjectTransform.set(1, 2, aPageObjectBound.getMinY());
- }
-
- // #i102637# add gray frame also when printing and page exists (handout pages)
- const bool bCreateGrayFrame(!GetObjectContact().isOutputToPrinter() || pPage);
-
- // get displayed page's content. This is the uscaled page content
- if(mpExtractor && pPage)
- {
- // get displayed page's geometry
- drawinglayer::primitive2d::Primitive2DSequence xPageContent;
- const Size aPageSize(pPage->GetSize());
- const double fPageWidth(aPageSize.getWidth());
- const double fPageHeight(aPageSize.getHeight());
-
- // The case that a PageObject contains another PageObject which visualizes the
- // same page again would lead to a recursion. Limit that recursion depth to one
- // by using a local static bool
- static bool bInCreatePrimitive2D(false);
-
- if(bInCreatePrimitive2D)
- {
- // Recursion is possible. Create a replacement primitive
- xPageContent.realloc(2);
- const Color aDocColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
- const Color aBorderColor(aColorConfig.GetColorValue(svtools::DOCBOUNDARIES).nColor);
- const basegfx::B2DRange aPageBound(0.0, 0.0, fPageWidth, fPageHeight);
- const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aPageBound));
-
- // add replacement fill
- xPageContent[0L] = drawinglayer::primitive2d::Primitive2DReference(
- new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aOutline), aDocColor.getBColor()));
-
- // add replacement border
- xPageContent[1L] = drawinglayer::primitive2d::Primitive2DReference(
- new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aBorderColor.getBColor()));
- }
- else
- {
- // set recursion flag
- bInCreatePrimitive2D = true;
-
- // init extractor, guarantee existence, set page there
- mpExtractor->SetStartPage(pPage);
-
- // #i105548# also need to copy the VOCRedirector for sub-content creation
- mpExtractor->SetViewObjectContactRedirector(GetObjectContact().GetViewObjectContactRedirector());
-
- // create page content
- xPageContent = mpExtractor->createPrimitive2DSequenceForPage(rDisplayInfo);
-
- // #i105548# reset VOCRedirector to not accidentially have a pointer to a
- // temporary class, so calls to it are avoided safely
- mpExtractor->SetViewObjectContactRedirector(0);
-
- // reset recursion flag
- bInCreatePrimitive2D = false;
- }
-
- // prepare retval
- if(xPageContent.hasElements())
- {
- const uno::Reference< drawing::XDrawPage > xDrawPage(GetXDrawPageForSdrPage(const_cast< SdrPage*>(pPage)));
- const drawinglayer::primitive2d::Primitive2DReference xPagePreview(new drawinglayer::primitive2d::PagePreviewPrimitive2D(
- xDrawPage, aPageObjectTransform, fPageWidth, fPageHeight, xPageContent, true));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xPagePreview, 1);
- }
- }
- else if(bCreateGrayFrame)
- {
- // #i105146# no content, but frame display. To make hitting the page preview objects
- // on the handout page more simple, add hidden fill geometry
- const drawinglayer::primitive2d::Primitive2DReference xFrameHit(
- drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
- false,
- aPageObjectTransform));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xFrameHit, 1);
- }
-
- // add a gray outline frame, except not when printing
- if(bCreateGrayFrame)
- {
- const Color aFrameColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES).nColor);
- basegfx::B2DPolygon aOwnOutline(basegfx::tools::createUnitPolygon());
- aOwnOutline.transform(aPageObjectTransform);
-
- const drawinglayer::primitive2d::Primitive2DReference xGrayFrame(
- new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOwnOutline, aFrameColor.getBColor()));
-
- drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xGrayFrame);
- }
-
- return xRetval;
- }
-
- ViewObjectContactOfPageObj::ViewObjectContactOfPageObj(ObjectContact& rObjectContact, ViewContact& rViewContact)
- : ViewObjectContactOfSdrObj(rObjectContact, rViewContact),
- mpExtractor(new PagePrimitiveExtractor(*this))
- {
- }
+}
- ViewObjectContactOfPageObj::~ViewObjectContactOfPageObj()
- {
- // delete the helper OC
- if(mpExtractor)
- {
- // remember candidate and reset own pointer to avoid action when createPrimitive2DSequence()
- // would be called for any reason
- PagePrimitiveExtractor* pCandidate = mpExtractor;
- mpExtractor = 0;
-
- // also reset the StartPage to avoid ActionChanged() forwardings in the
- // PagePrimitiveExtractor::InvalidatePartOfView() implementation
- pCandidate->SetStartPage(0);
- delete pCandidate;
- }
- }
- } // end of namespace contact
-} // end of namespace sdr
+ViewObjectContactOfPageObj::~ViewObjectContactOfPageObj()
+{
+ // delete the helper OC
+ if(mpExtractor)
+ {
+ // remember candidate and reset own pointer to avoid action when createPrimitive2DSequence()
+ // would be called for any reason
+ PagePrimitiveExtractor* pCandidate = mpExtractor;
+ mpExtractor = 0;
+
+ // also reset the StartPage to avoid ActionChanged() forwardings in the
+ // PagePrimitiveExtractor::InvalidatePartOfView() implementation
+ pCandidate->SetStartPage(0);
+ delete pCandidate;
+ }
+}
+
+}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/contact/viewobjectcontactredirector.cxx b/svx/source/sdr/contact/viewobjectcontactredirector.cxx
index 375e0fb4da80..47110839f069 100644
--- a/svx/source/sdr/contact/viewobjectcontactredirector.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactredirector.cxx
@@ -21,29 +21,25 @@
#include <svx/sdr/contact/viewobjectcontact.hxx>
#include <svx/sdr/contact/viewcontact.hxx>
+namespace sdr { namespace contact {
+// basic constructor.
+ViewObjectContactRedirector::ViewObjectContactRedirector()
+{
+}
-namespace sdr
+// The destructor.
+ViewObjectContactRedirector::~ViewObjectContactRedirector()
{
- namespace contact
- {
- // basic constructor.
- ViewObjectContactRedirector::ViewObjectContactRedirector()
- {
- }
+}
- // The destructor.
- ViewObjectContactRedirector::~ViewObjectContactRedirector()
- {
- }
+drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactRedirector::createRedirectedPrimitive2DSequence(
+ const sdr::contact::ViewObjectContact& rOriginal,
+ const sdr::contact::DisplayInfo& rDisplayInfo)
+{
+ return rOriginal.createPrimitive2DSequence(rDisplayInfo);
+}
- drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactRedirector::createRedirectedPrimitive2DSequence(
- const sdr::contact::ViewObjectContact& rOriginal,
- const sdr::contact::DisplayInfo& rDisplayInfo)
- {
- return rOriginal.createPrimitive2DSequence(rDisplayInfo);
- }
- } // end of namespace contact
-} // end of namespace sdr
+}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */