MeshLib
 
Loading...
Searching...
No Matches
MRPrecisePredicates2.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRVector2.h"
4#include "MRId.h"
5#include <array>
6#include <functional>
7
8namespace MR
9{
10
13
16MRMESH_API bool ccw( const Vector2i & a, const Vector2i & b );
17
20inline bool ccw( const Vector2i & a, const Vector2i & b, const Vector2i & c )
21 { return ccw( a - c, b - c ); }
22
24{
26 Vector2i pt;
27};
28
30MRMESH_API bool ccw( const std::array<PreciseVertCoords2, 3> & vs );
32
34{
35 bool doIntersect = false;
36 bool cIsLeftFromAB = false;
37
38 explicit operator bool() const { return doIntersect; }
39};
40
44 const std::array<PreciseVertCoords2, 4> & vs );
45
47using ConvertToIntVector2 = std::function<Vector2i( const Vector2f& )>;
49using ConvertToFloatVector2 = std::function<Vector2f( const Vector2i& )>;
56
60 const Vector2i& a, const Vector2i& b, const Vector2i& c, const Vector2i& d );
61
65 const Vector2f& a, const Vector2f& b, const Vector2f& c, const Vector2f& d,
66 CoordinateConverters2 converters );
67
69
70} // namespace MR
int VertId
Definition MRDotNet/MRMeshFwd.h:51
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
MRMESH_API bool ccw(const Vector2i &a, const Vector2i &b)
Definition MRCameraOrientationPlugin.h:7
MRMESH_API SegmentSegmentIntersectResult doSegmentSegmentIntersect(const std::array< PreciseVertCoords2, 4 > &vs)
MRMESH_API Vector2i findSegmentSegmentIntersectionPrecise(const Vector2i &a, const Vector2i &b, const Vector2i &c, const Vector2i &d)
std::function< Vector2i(const Vector2f &)> ConvertToIntVector2
float-to-int coordinate converter
Definition MRPrecisePredicates2.h:47
std::function< Vector2f(const Vector2i &)> ConvertToFloatVector2
int-to-float coordinate converter
Definition MRPrecisePredicates2.h:49
this struct contains coordinate converters float-int-float
Definition MRPrecisePredicates2.h:52
ConvertToFloatVector2 toFloat
Definition MRPrecisePredicates2.h:54
ConvertToIntVector2 toInt
Definition MRPrecisePredicates2.h:53
Definition MRPrecisePredicates2.h:24
Vector2i pt
integer coordinates of the vertex
Definition MRPrecisePredicates2.h:26
VertId id
unique id of the vertex (in both contours)
Definition MRPrecisePredicates2.h:25
Definition MRPrecisePredicates2.h:34
bool doIntersect
whether the segments intersect
Definition MRPrecisePredicates2.h:35
bool cIsLeftFromAB
whether the directed line AB has C point at the left
Definition MRPrecisePredicates2.h:36