summaryrefslogtreecommitdiff
path: root/include/svx/framelink.hxx
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2018-10-22 10:33:03 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2018-10-24 15:45:36 +0200
commit9328368c45f0e8763de2de31343ce5a72dbc1b05 (patch)
tree56d3b04f304bbb3eb517ba9f749d086d7d2f34fd /include/svx/framelink.hxx
parent86192438d16ec160d6b59d08735e770ee05ac113 (diff)
Reorganize FrameBorderPrimitive creation
Step1: Basic concept, move stuff to svx and new SdrFrameBorderPrimitive2D Step2: Adapt all creators/usages to use SdrFrameBorderData/SdrFrameBorderPrimitive2D, check functionality Step3: Re-implement mergre of BorderLinePrimitive2D during decomposition of SdrFrameBorderPrimitive2D to keep the number of primitives low from the start, make merge optional (not urgently needed) Step4: Migrate and isolate all helper methods and classes involved in geometry creation of border lines to the implementation (.cxx) of the new primitive Change-Id: I840b6765439bd995f2c57ef36315427b1f0f3e21 Reviewed-on: https://gerrit.libreoffice.org/62247 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'include/svx/framelink.hxx')
-rw-r--r--include/svx/framelink.hxx108
1 files changed, 0 insertions, 108 deletions
diff --git a/include/svx/framelink.hxx b/include/svx/framelink.hxx
index 9b532a2d0d29..fa629fc24ad2 100644
--- a/include/svx/framelink.hxx
+++ b/include/svx/framelink.hxx
@@ -200,114 +200,6 @@ public:
inline bool operator>( const Style& rL, const Style& rR ) { return rR.operator<(rL); }
-// Drawing functions
-class SAL_WARN_UNUSED SVX_DLLPUBLIC StyleVectorCombination
-{
-private:
- struct OffsetAndHalfWidthAndColor
- {
- double mfOffset;
- double mfHalfWidth;
- Color maColor;
-
- OffsetAndHalfWidthAndColor(double offset, double halfWidth, Color color) :
- mfOffset(offset),
- mfHalfWidth(halfWidth),
- maColor(color)
- {}
- };
-
- double mfRefModeOffset;
- basegfx::B2DVector maB2DVector;
- double mfAngle;
- std::vector< OffsetAndHalfWidthAndColor > maOffsets;
-
-public:
- StyleVectorCombination(
- const Style& rStyle,
- const basegfx::B2DVector& rB2DVector,
- const double fAngle,
- bool bMirrored,
- const Color* pForceColor);
-
- double getRefModeOffset() const { return mfRefModeOffset; }
- const basegfx::B2DVector& getB2DVector() const { return maB2DVector; }
- double getAngle() const { return mfAngle; }
- bool empty() const { return maOffsets.empty(); }
- size_t size() const { return maOffsets.size(); }
- bool operator<( const StyleVectorCombination& rOther) const { return mfAngle < rOther.mfAngle; }
-
- void getColorAndOffsetAndHalfWidth(size_t nIndex, Color& rColor, double& rfOffset, double& rfHalfWidth) const;
-};
-
-class SAL_WARN_UNUSED SVX_DLLPUBLIC StyleVectorTable
-{
-private:
- std::vector< StyleVectorCombination > maEntries;
-
-public:
- StyleVectorTable()
- : maEntries()
- {
- }
-
- void add(
- const Style& rStyle,
- const basegfx::B2DVector& rMyVector,
- const basegfx::B2DVector& rOtherVector,
- bool bMirrored);
-
- void sort();
-
- bool empty() const { return maEntries.empty(); }
- const std::vector< StyleVectorCombination >& getEntries() const{ return maEntries; }
-};
-
-/**
- * Helper method to create the correct drawinglayer::primitive2d::BorderLinePrimitive2D
- * for the given data, especially the correct drawinglayer::primitive2d::BorderLine entries
- * including the correctly solved/created LineStartEnd extends
- *
- * rTarget : Here the evtl. created BorderLinePrimitive2D will be appended
- * rOrigin : StartPoint of the Borderline
- * rX : Vector of the Borderline
- * rBorder : svx::frame::Style of the of the Borderline
- * rStartStyleVectorTable : All other Borderlines which have to be taken into account because
- * they have the same StartPoint as the current Borderline. These will be used to calculate
- * the correct LineStartEnd extends tor the BorderLinePrimitive2D. The definition should be
- * built up using svx::frame::StyleVectorTable and StyleVectorTable::add and includes:
- * rStyle : the svx::frame::Style of one other BorderLine
- * rMyVector : the Vector of the *new* to-be-defined BorderLine, identical to rX
- * rOtherVector: the Vector of one other BorderLine (may be, but does not need to be normalized),
- * always *pointing away* from the common StartPoint rOrigin
- * bMirrored : define if rStyle of one other BorderLine shall be mirrored (e.g. bottom-right edges)
- * With multiple BorderLines the definitions have to be CounterClockWise. This will be
- * ensured by StyleVectorTable sorting the entries, but knowing this may allow more efficient
- * data creation.
- * rEndStyleVectorTable: All other BorderLines that have the same EndPoint. There are differences to
- * the Start definitions:
- * - do not forget to consequently use -rX for rMyVector
- * - definitions have to be ClockWise for the EndBorderLines, will be ensured by sorting
- *
- * If you take all this into account, you will gett correctly extended BorderLinePrimitive2D
- * representations for the new to be defined BorderLine. That extensions will overlap nicely
- * with the corresponding BorderLines and take all multiple line definitions in the ::Style into
- * account.
- * The internal solver is *not limited* to ::Style(s) with three parts (Left/Gap/Right), this is
- * just due to svx::frame::Style's definitions. A new solver based on this one can be created
- * anytime using more mulötiple borders based on the more flexible
- * std::vector< drawinglayer::primitive2d::BorderLine > if needed.
- */
-SVX_DLLPUBLIC void CreateBorderPrimitives(
- drawinglayer::primitive2d::Primitive2DContainer& rTarget, /// target for created primitives
- const basegfx::B2DPoint& rOrigin, /// start point of borderline
- const basegfx::B2DVector& rX, /// X-Axis of borderline with length
- const Style& rBorder, /// Style of borderline
- const StyleVectorTable& rStartStyleVectorTable, /// Styles and vectors (pointing away) at borderline start, ccw
- const StyleVectorTable& rEndStyleVectorTable, /// Styles and vectors (pointing away) at borderline end, cw
- const Color* pForceColor /// If specified, overrides frame border color.
-);
-
}
}