Kaydet (Commit) 92291709 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Unindent.

Change-Id: I98b5a0b91c92e58bae3caa69a4ed35c72dc839dd
üst a305869e
......@@ -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;
};
}}
......
......@@ -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;
};
}}
......
......@@ -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
......
......@@ -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
}}
......
......@@ -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
}}
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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();
};
}}
......
......@@ -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
......
......@@ -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: */
......@@ -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: */
......@@ -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: */
......@@ -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: */
......@@ -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: */
......@@ -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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment