summaryrefslogtreecommitdiff
path: root/include/basegfx
diff options
context:
space:
mode:
Diffstat (limited to 'include/basegfx')
-rw-r--r--include/basegfx/polygon/b2dpolypolygontools.hxx20
-rw-r--r--include/basegfx/tools/tools.hxx25
2 files changed, 45 insertions, 0 deletions
diff --git a/include/basegfx/polygon/b2dpolypolygontools.hxx b/include/basegfx/polygon/b2dpolypolygontools.hxx
index 1d138a03b5b7..59f03ff3a63d 100644
--- a/include/basegfx/polygon/b2dpolypolygontools.hxx
+++ b/include/basegfx/polygon/b2dpolypolygontools.hxx
@@ -220,6 +220,26 @@ namespace basegfx
// #i76891# Try to remove existing curve segments if they are simply edges
BASEGFX_DLLPUBLIC B2DPolyPolygon simplifyCurveSegments(const B2DPolyPolygon& rCandidate);
+ /** Creates polypolygon for seven-segment display number
+
+ This function takes an integer number between 0 and 9 and
+ convert it into the well-known seven-segment display
+ number (like most digital clocks show their numbers). The
+ digit will exactly fit the unit rectangle. The polypolygon
+ will be a line polygon, i.e. if you need the segment parts
+ to have width, use createAreaGeometry() on the result.
+
+ @param cNumber
+ Number from '0' to '9' as ASCII char, or '-', 'E' and '.'
+ to convert to 7 segment code
+
+ @param bLitSegments
+ When true, return a polygon containing the segments that
+ are 'lit' for the given number. Return un-lit segments
+ otherwise.
+ */
+ B2DPolyPolygon createSevenSegmentPolyPolygon(sal_Char cNumber, bool bLitSegments=true);
+
/** snap some polygon coordinates to discrete coordinates
This method allows to snap some polygon points to discrete (integer) values
diff --git a/include/basegfx/tools/tools.hxx b/include/basegfx/tools/tools.hxx
index c1fa0940ae35..c9af12b73fcd 100644
--- a/include/basegfx/tools/tools.hxx
+++ b/include/basegfx/tools/tools.hxx
@@ -27,6 +27,7 @@ namespace basegfx
{
class B2DPoint;
class B2DRange;
+ class B2DPolyPolygon;
namespace tools
{
@@ -94,6 +95,30 @@ namespace basegfx
::basegfx::B2DPoint& io_rRightBottom,
const ::basegfx::B2DRange& rFitTarget );
+ /** Creates polypolygon with the given number as seven-segment
+ digits
+
+ @param fVal
+ Value to convert
+
+ @param nTotalDigits
+ Total number of digits to display. If less is needed for
+ given number, fill space with blanks.
+
+ @param nDecPlaces
+ Decimal places to show. When 0, display as integer. When
+ negative, fill given number of before-the-decimal point
+ with zero.
+
+ @param bLitSegments
+ When true, return a polygon containing the segments that
+ are 'lit' for the given number. Return un-lit segments
+ otherwise.
+ */
+ BASEGFX_DLLPUBLIC B2DPolyPolygon number2PolyPolygon(double fVal,
+ sal_Int32 nTotalDigits,
+ sal_Int32 nDecPlaces,
+ bool bLitSegments=true);
}
}