37#include <officecfg/Office/Common.hxx>
38#include <svx/strings.hrc>
65 const double fLapLeft(rRange.
getMinX() + fDistance);
66 double fLapRight(rRange.
getMinX() + (rRange.
getWidth() * 0.5) - fDistance);
67 const double fLapTop(rRange.
getMinY() - fDistance);
68 const double fLapBottom(fLapTop + (fDistance * 2.0));
69 const double fExtendedTextWidth(fTextWidth + (fDistance * 3.0));
71 if(0.0 != fExtendedTextWidth && fLapLeft + fExtendedTextWidth < fLapRight)
73 fLapRight = fLapLeft + fExtendedTextWidth;
119 double mfDiscreteDistance;
120 double mfDiscreteGap;
128 OverlayDiagramPrimitive(
130 double fDiscreteDistance,
132 Color const & rColor);
137void OverlayDiagramPrimitive::create2DDecomposition(
145 aRange.transform(maTransformation);
148 const double fInnerDistance(mfDiscreteDistance * getDiscreteUnit());
149 const double fOuterDistance((mfDiscreteDistance + mfDiscreteGap) * getDiscreteUnit());
150 bool bCreateLap(
true);
152 double fTextWidth(0.0);
158 const OUString
aName(
SvxResId(RID_STR_DATANAV_EDIT_ELEMENT));
161 std::vector<double> aDXArray;
175 for (
auto const& elem : aTarget)
177 aTextAsPolyPolygon.
append(elem);
184 aTextTransform.
translate(aTextRange.getMinX(), aTextRange.getMinY());
185 const double fTargetTextHeight((mfDiscreteDistance + mfDiscreteGap - 2.0) * getDiscreteUnit());
186 const double fTextScale(fTargetTextHeight / aTextRange.getHeight());
187 aTextTransform.
scale(fTextScale, fTextScale);
189 aRange.getMinX() + (fInnerDistance * 2.0),
190 aRange.getMinY() + fTargetTextHeight + (fOuterDistance - fInnerDistance) - (2.0 * getDiscreteUnit()));
191 aTextAsPolyPolygon.
transform(aTextTransform);
194 fTextWidth = aTextRange.getWidth() * fTextScale;
195 const double fLapLeft(aRange.getMinX() + fInnerDistance);
196 const double fLapRight(aRange.getMinX() + (aRange.getWidth() * 0.5) - fInnerDistance);
201 if(fTextWidth + (4.0 * getDiscreteUnit()) > fLapRight - fLapLeft)
207 createRoundedPolygon(
215 createRoundedPolygon(
221 Color aFillColor(maColor);
222 Color aLineColor(maColor);
224 aFillColor.IncreaseLuminance(10);
225 aLineColor.DecreaseLuminance(30);
228 aLineColor.getBColor(),
229 1.0 * getDiscreteUnit());
232 rContainer.push_back(
235 aFillColor.getBColor()));
239 rContainer.push_back(
241 std::move(aPolyPolygon),
246 const double fLapLeft(aRange.getMinX() + fInnerDistance);
247 const double fLapRight(aRange.getMinX() + (aRange.getWidth() * 0.5) - fInnerDistance);
248 const double fLapUp(aRange.getMinY() - ((mfDiscreteDistance + mfDiscreteDistance * 0.666) * getDiscreteUnit()));
249 const double fLapDown(aRange.getMinY() - ((mfDiscreteDistance + mfDiscreteDistance * 0.333) * getDiscreteUnit()));
258 rContainer.push_back(
260 std::move(aPolygonLapUp),
264 rContainer.push_back(
266 std::move(aPolygonLapDown),
268 std::move(aStrokeAttribute)));
272 if(bCreateLap && 0 != aTextAsPolyPolygon.
count())
274 rContainer.push_back(
276 std::move(aTextAsPolyPolygon),
277 aLineColor.getBColor()));
281OverlayDiagramPrimitive::OverlayDiagramPrimitive(
283 double fDiscreteDistance,
285 Color const & rColor)
286:
drawinglayer::primitive2d::DiscreteMetricDependentPrimitive2D()
288, mfDiscreteDistance(fDiscreteDistance)
289, mfDiscreteGap(fDiscreteGap)
294sal_uInt32 OverlayDiagramPrimitive::getPrimitive2DID()
const
309 explicit OverlayDiagramFrame(
311 Color const & rColor);
314OverlayDiagramFrame::OverlayDiagramFrame(
317:
sdr::overlay::OverlayObject(rColor)
327 if ( !officecfg::Office::Common::Misc::ExperimentalMode::get() )
328 return aReturnContainer;
330 if (getOverlayManager())
333 new OverlayDiagramPrimitive(
340 return aReturnContainer;
345namespace svx {
namespace diagram {
383 std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(
384 new OverlayDiagramFrame(
390 std::move(pNewOverlayObject),
405: mbUseDiagramThemeData(false)
406, mbUseDiagramModelData(true)
407, mbForceThemePtrRecreation(false)
415 rTarget.mp_DiagramHelper.reset(
this);
423 rTarget.TRGetBaseGeometry(aTransformation, aPolyPolygon);
426 rHdlList.
AddHdl(std::move(pHdl));
const StyleSettings & GetStyleSettings() const
const AllSettings & GetSettings() const
SdrMarkView * GetView() const
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
void insertNewlyCreatedOverlayObjectForSdrHdl(std::unique_ptr< sdr::overlay::OverlayObject > pOverlayObject, const sdr::contact::ObjectContact &rObjectContact, sdr::overlay::OverlayManager &rOverlayManager)
bool areMarkHandlesHidden() const
sal_uInt32 PageWindowCount() const
SdrPageWindow * GetPageWindow(sal_uInt32 nIndex) const
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
SdrPaintWindow & GetPaintWindow() const
const sdr::contact::ObjectContact & GetObjectContact() const
SdrPageView * GetSdrPageView() const
OutputDevice & GetOutputDevice() const
bool OutputToWindow() const
const Color & GetHighlightColor() const
void translate(double fX, double fY)
void scale(double fX, double fY)
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void transform(const basegfx::B2DHomMatrix &rMatrix)
B2DRange getB2DRange() const
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
virtual sal_uInt32 getPrimitive2DID() const=0
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &rViewInformation) const=0
void getTextOutlines(basegfx::B2DPolyPolygonVector &, const OUString &rText, sal_uInt32 nIndex, sal_uInt32 nLength, const ::std::vector< double > &rDXArray, const ::std::vector< sal_Bool > &rKashidaArray) const
virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence()
virtual void CreateB2dIAObject() override
DiagramFrameHdl(const basegfx::B2DHomMatrix &rTransformation)
static void clicked(const Point &rPnt)
basegfx::B2DHomMatrix maTransformation
void anchorToSdrObjGroup(SdrObjGroup &rTarget)
virtual ~IDiagramHelper()
static void AddAdditionalVisualization(const SdrObjGroup &rTarget, SdrHdlList &rHdlList)
OUString SvxResId(TranslateId aId)
B2DPolygon createPolygonFromEllipseSegment(const B2DPoint &rCenter, double fRadiusX, double fRadiusY, double fStart, double fEnd)
::std::vector< B2DPolyPolygon > B2DPolyPolygonVector
bool dispatchCommand(const OUString &rCommand, const uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Sequence< css::beans::PropertyValue > &rArguments, const uno::Reference< css::frame::XDispatchResultListener > &rListener)
basegfx::B2DHomMatrix maTransformation
#define PRIMITIVE2D_ID_OVERLAYDIAGRAMPRIMITIVE2D