summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-26 15:39:26 +0200
committerNoel Grandin <noel@peralex.com>2015-03-27 08:33:44 +0200
commit9bccd26037188f20fec244bede3022900d1b96fa (patch)
tree4751478fa7608813568c5a3c5777d0b87117110c /include
parenta1d10eb8d7ee73d901041fdf550d2196a63c9d1d (diff)
convert CUTFLAG_ constants to enum class
Change-Id: I98dc5488954a4d46f7e0158790a4c3dabebfc1b3
Diffstat (limited to 'include')
-rw-r--r--include/basegfx/polygon/b2dpolygontools.hxx32
1 files changed, 19 insertions, 13 deletions
diff --git a/include/basegfx/polygon/b2dpolygontools.hxx b/include/basegfx/polygon/b2dpolygontools.hxx
index 0fb90cb744ee..dc0cf11f9d6b 100644
--- a/include/basegfx/polygon/b2dpolygontools.hxx
+++ b/include/basegfx/polygon/b2dpolygontools.hxx
@@ -29,9 +29,27 @@
#include <com/sun/star/drawing/FlagSequence.hpp>
#include <vector>
#include <basegfx/basegfxdllapi.h>
+#include <o3tl/typed_flags_set.hxx>
+// Definitions for the cut flags used from the findCut methods
+enum class CutFlagValue
+{
+ NONE = 0x0000,
+ LINE = 0x0001,
+ START1 = 0x0002,
+ START2 = 0x0004,
+ END1 = 0x0008,
+ END2 = 0x0010,
+ ALL = LINE|START1|START2|END1|END2,
+ DEFAULT = LINE|START2|END2,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<CutFlagValue> : is_typed_flags<CutFlagValue, 0x1f> {};
+}
+
namespace basegfx
{
// predefinitions
@@ -123,24 +141,12 @@ namespace basegfx
// #i37443# Subdivide all contained curves.
BASEGFX_DLLPUBLIC B2DPolygon adaptiveSubdivideByCount(const B2DPolygon& rCandidate, sal_uInt32 nCount = 0L);
- // Definitions for the cut flags used from the findCut methods
- typedef sal_uInt16 CutFlagValue;
-
- #define CUTFLAG_NONE (0x0000)
- #define CUTFLAG_LINE (0x0001)
- #define CUTFLAG_START1 (0x0002)
- #define CUTFLAG_START2 (0x0004)
- #define CUTFLAG_END1 (0x0008)
- #define CUTFLAG_END2 (0x0010)
- #define CUTFLAG_ALL (CUTFLAG_LINE|CUTFLAG_START1|CUTFLAG_START2|CUTFLAG_END1|CUTFLAG_END2)
- #define CUTFLAG_DEFAULT (CUTFLAG_LINE|CUTFLAG_START2|CUTFLAG_END2)
-
// This version works with two points and vectors to define the
// edges for the cut test.
BASEGFX_DLLPUBLIC CutFlagValue findCut(
const B2DPoint& rEdge1Start, const B2DVector& rEdge1Delta,
const B2DPoint& rEdge2Start, const B2DVector& rEdge2Delta,
- CutFlagValue aCutFlags = CUTFLAG_DEFAULT,
+ CutFlagValue aCutFlags = CutFlagValue::DEFAULT,
double* pCut1 = 0L, double* pCut2 = 0L);
// test if point is on the given edge in range ]0.0..1.0[ without