MeshLib C Docs
Loading...
Searching...
No Matches
MRVector2.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMisc/common.h>
4#include <MRCMisc/exports.h>
5
6#include <stdbool.h>
7#include <stddef.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13typedef struct MR_NoInit MR_NoInit; // Defined in `#include <MRCMesh/MRMeshFwd.h>`.
14typedef struct MR_std_istream MR_std_istream; // Defined in `#include <MRCMisc/iostream.h>`.
15typedef struct MR_std_ostream MR_std_ostream; // Defined in `#include <MRCMisc/iostream.h>`.
16
17
20typedef struct MR_Vector2b
21{
22 bool x;
23 bool y;
25
28typedef struct MR_Vector2i
29{
30 int x;
31 int y;
33
41
44typedef struct MR_Vector2f
45{
46 float x;
47 float y;
49
52typedef struct MR_Vector2d
53{
54 double x;
55 double y;
57
61
64
69
73
76
79
82
85
89MRC_API const bool *MR_Vector2b_index_const(const MR_Vector2b *_this, int e);
90
95
99
103
108
113
114// NOTE: We use `std::declval()` in the operators below because libclang 18 in our binding generator is bugged and chokes on decltyping `a.x` and such. TODO fix this when we update libclang.
119
123
128
133
137
141
144
150
156
161
166
172
178
182
185
190
194
197
200
203
206
209
212
216MRC_API const int *MR_Vector2i_index_const(const MR_Vector2i *_this, int e);
217
222
226
230
235
240
245
250
251// NOTE: We use `std::declval()` in the operators below because libclang 18 in our binding generator is bugged and chokes on decltyping `a.x` and such. TODO fix this when we update libclang.
256
260
265
270
274
278
281
287
293
298
303
309
315
319
322
327
331
334
337
340
343
346
349
354
359
363
367
372
377
382
387
388// NOTE: We use `std::declval()` in the operators below because libclang 18 in our binding generator is bugged and chokes on decltyping `a.x` and such. TODO fix this when we update libclang.
393
397
402
407
411
415
418
424
430
435
440
446
452
456
459
464
468
471
474
477
480
483
486
490MRC_API const float *MR_Vector2f_index_const(const MR_Vector2f *_this, int e);
491
496
500
504
508
513
518
522
527
532
533// NOTE: We use `std::declval()` in the operators below because libclang 18 in our binding generator is bugged and chokes on decltyping `a.x` and such. TODO fix this when we update libclang.
538
542
547
552
556
560
563
569
575
580
585
591
597
601
604
609
613
616
619
622
625
628
631
635MRC_API const double *MR_Vector2d_index_const(const MR_Vector2d *_this, int e);
636
640MRC_API double *MR_Vector2d_index(MR_Vector2d *_this, int e);
641
645
649
653
658
663
667
672
677
678// NOTE: We use `std::declval()` in the operators below because libclang 18 in our binding generator is bugged and chokes on decltyping `a.x` and such. TODO fix this when we update libclang.
683
687
692
697
701
705
708
714
720
725
730
736
742
747MRC_API float MR_cross(const MR_Vector2f *a, const MR_Vector2f *b);
748
754
760
766
772
778
779#ifdef __cplusplus
780} // extern "C"
781#endif
struct MR_NoInit MR_NoInit
Definition MRBox.h:15
struct MR_std_ostream MR_std_ostream
Definition MRCtm.h:31
struct MR_std_istream MR_std_istream
Definition MRCtm.h:28
MRC_API bool MR_not_equal_MR_Vector2f(const MR_Vector2f *a, const MR_Vector2f *b)
MRC_API MR_Vector2i MR_Vector2i_Construct_1(const MR_NoInit *_1)
MRC_API MR_Vector2d * MR_mul_assign_MR_Vector2d_double(MR_Vector2d *a, double b)
MRC_API MR_Vector2f MR_Vector2f_plusX(void)
Generated from method MR::Vector2f::plusX.
MRC_API MR_Vector2i MR_Vector2i_plusX(void)
Generated from method MR::Vector2i::plusX.
MRC_API float MR_Vector2f_lengthSq(const MR_Vector2f *_this)
MRC_API bool MR_Vector2f_isFinite(const MR_Vector2f *_this)
MRC_API MR_Vector2f MR_neg_MR_Vector2f(const MR_Vector2f *a)
MRC_API MR_std_istream * MR_input_MR_Vector2f(MR_std_istream *s, MR_Vector2f *vec)
MRC_API MR_Vector2i * MR_div_assign_MR_Vector2i_int(MR_Vector2i *a, int b)
MRC_API double * MR_Vector2d_index(MR_Vector2d *_this, int e)
MRC_API MR_Vector2i * MR_mul_assign_MR_Vector2i_int(MR_Vector2i *a, int b)
MRC_API MR_Vector2i MR_Vector2i_Construct_2(int x, int y)
Generated from constructor MR::Vector2i::Vector2i.
MRC_API const MR_Vector2d * MR_pos_MR_Vector2d(const MR_Vector2d *a)
MRC_API MR_Vector2f MR_Vector2f_diagonal(float a)
Generated from method MR::Vector2f::diagonal.
MRC_API MR_Vector2i MR_Vector2i_furthestBasisVector(const MR_Vector2i *_this)
MRC_API const float * MR_Vector2f_index_const(const MR_Vector2f *_this, int e)
MRC_API MR_Vector2f MR_Vector2f_furthestBasisVector(const MR_Vector2f *_this)
MRC_API MR_Vector2i64 * MR_sub_assign_MR_Vector2i64(MR_Vector2i64 *a, const MR_Vector2i64 *b)
MRC_API MR_Vector2i64 MR_Vector2i64_perpendicular(const MR_Vector2i64 *_this)
MRC_API MR_Vector2b MR_Vector2b_Construct_2(bool x, bool y)
Generated from constructor MR::Vector2b::Vector2b.
MRC_API MR_int64_t * MR_Vector2i64_index(MR_Vector2i64 *_this, int e)
MRC_API MR_Vector2i MR_add_MR_Vector2b(const MR_Vector2b *a, const MR_Vector2b *b)
MRC_API MR_Vector2d MR_Vector2d_plusY(void)
Generated from method MR::Vector2d::plusY.
MRC_API MR_Vector2d MR_mul_MR_Vector2d_double(const MR_Vector2d *b, double a)
MRC_API MR_Vector2f MR_mul_float_MR_Vector2f(float a, const MR_Vector2f *b)
MRC_API MR_Vector2d MR_Vector2d_DefaultConstruct(void)
Constructs an empty (default-constructed) instance.
MRC_API MR_Vector2i * MR_Vector2i_DefaultConstructArray(size_t num_elems)
MRC_API MR_Vector2f * MR_mul_assign_MR_Vector2f_float(MR_Vector2f *a, float b)
MRC_API bool MR_equal_MR_Vector2i64(const MR_Vector2i64 *a, const MR_Vector2i64 *b)
MRC_API MR_Vector2i64 * MR_mul_assign_MR_Vector2i64_int64_t(MR_Vector2i64 *a, MR_int64_t b)
MRC_API MR_Vector2b * MR_add_assign_MR_Vector2b(MR_Vector2b *a, const MR_Vector2b *b)
MRC_API MR_Vector2d * MR_sub_assign_MR_Vector2d(MR_Vector2d *a, const MR_Vector2d *b)
MRC_API MR_Vector2i64 MR_Vector2i64_minusX(void)
Generated from method MR::Vector2i64::minusX.
MRC_API MR_Vector2i MR_sub_MR_Vector2b(const MR_Vector2b *a, const MR_Vector2b *b)
MRC_API MR_Vector2d MR_mul_double_MR_Vector2d(double a, const MR_Vector2d *b)
MRC_API bool MR_not_equal_MR_Vector2i64(const MR_Vector2i64 *a, const MR_Vector2i64 *b)
MRC_API MR_std_istream * MR_input_MR_Vector2i(MR_std_istream *s, MR_Vector2i *vec)
MRC_API MR_Vector2f MR_Vector2f_minusY(void)
Generated from method MR::Vector2f::minusY.
MRC_API bool MR_not_equal_MR_Vector2b(const MR_Vector2b *a, const MR_Vector2b *b)
MRC_API MR_Vector2d MR_div_MR_Vector2d_double(MR_Vector2d b, double a)
Generated from function MR::operator/.
MRC_API MR_Vector2f MR_mul_MR_Vector2f_float(const MR_Vector2f *b, float a)
MRC_API MR_Vector2d MR_Vector2d_Construct_2(double x, double y)
Generated from constructor MR::Vector2d::Vector2d.
MRC_API MR_Vector2i64 MR_Vector2i64_Construct_2(MR_int64_t x, MR_int64_t y)
Generated from constructor MR::Vector2i64::Vector2i64.
MRC_API MR_Vector2i MR_Vector2i_plusY(void)
Generated from method MR::Vector2i::plusY.
MRC_API bool MR_equal_MR_Vector2i(const MR_Vector2i *a, const MR_Vector2i *b)
MRC_API const MR_Vector2f * MR_pos_MR_Vector2f(const MR_Vector2f *a)
struct MR_Vector2i64 MR_Vector2i64
MRC_API MR_Vector2d MR_Vector2d_diagonal(double a)
Generated from method MR::Vector2d::diagonal.
MRC_API MR_Vector2i MR_mul_bool_MR_Vector2b(bool a, const MR_Vector2b *b)
MRC_API MR_Vector2d MR_Vector2d_minusX(void)
Generated from method MR::Vector2d::minusX.
MRC_API float MR_Vector2f_length(const MR_Vector2f *_this)
MRC_API MR_int64_t MR_dot_int64_t_MR_Vector2i64(const MR_Vector2i64 *a, const MR_Vector2i64 *b)
MRC_API bool * MR_Vector2b_index(MR_Vector2b *_this, int e)
MRC_API MR_Vector2d * MR_div_assign_MR_Vector2d_double(MR_Vector2d *a, double b)
MRC_API MR_Vector2f MR_Vector2f_normalized(const MR_Vector2f *_this)
MRC_API bool MR_equal_MR_Vector2b(const MR_Vector2b *a, const MR_Vector2b *b)
MRC_API MR_Vector2i64 * MR_div_assign_MR_Vector2i64_int64_t(MR_Vector2i64 *a, MR_int64_t b)
MRC_API MR_int64_t MR_Vector2i64_lengthSq(const MR_Vector2i64 *_this)
MRC_API MR_Vector2b * MR_Vector2b_DefaultConstructArray(size_t num_elems)
MRC_API double MR_Vector2d_lengthSq(const MR_Vector2d *_this)
MRC_API MR_Vector2f MR_sub_MR_Vector2f(const MR_Vector2f *a, const MR_Vector2f *b)
MRC_API MR_Vector2i64 MR_mul_int64_t_MR_Vector2i64(MR_int64_t a, const MR_Vector2i64 *b)
MRC_API const MR_int64_t * MR_Vector2i64_index_const(const MR_Vector2i64 *_this, int e)
MRC_API MR_Vector2f * MR_sub_assign_MR_Vector2f(MR_Vector2f *a, const MR_Vector2f *b)
MRC_API bool MR_not_equal_MR_Vector2d(const MR_Vector2d *a, const MR_Vector2d *b)
MRC_API int MR_dot_int_MR_Vector2i(const MR_Vector2i *a, const MR_Vector2i *b)
MRC_API const int * MR_Vector2i_Get_elements(void)
MRC_API const MR_Vector2i64 * MR_pos_MR_Vector2i64(const MR_Vector2i64 *a)
MRC_API MR_Vector2b MR_Vector2b_diagonal(bool a)
Generated from method MR::Vector2b::diagonal.
MRC_API MR_Vector2f * MR_div_assign_MR_Vector2f_float(MR_Vector2f *a, float b)
MRC_API MR_Vector2i64 MR_mul_MR_Vector2i64_int64_t(const MR_Vector2i64 *b, MR_int64_t a)
MRC_API const bool * MR_Vector2b_index_const(const MR_Vector2b *_this, int e)
MRC_API MR_Vector2i * MR_add_assign_MR_Vector2i(MR_Vector2i *a, const MR_Vector2i *b)
MRC_API MR_Vector2f MR_Vector2f_perpendicular(const MR_Vector2f *_this)
MRC_API bool MR_not_equal_MR_Vector2i(const MR_Vector2i *a, const MR_Vector2i *b)
MRC_API MR_Vector2d MR_Vector2d_minusY(void)
Generated from method MR::Vector2d::minusY.
MRC_API MR_Vector2i MR_Vector2i_perpendicular(const MR_Vector2i *_this)
MRC_API MR_Vector2d MR_sub_MR_Vector2d(const MR_Vector2d *a, const MR_Vector2d *b)
MRC_API float MR_dot_float_MR_Vector2f(const MR_Vector2f *a, const MR_Vector2f *b)
MRC_API MR_std_ostream * MR_print_MR_Vector2i64(MR_std_ostream *s, const MR_Vector2i64 *vec)
MRC_API MR_Vector2i MR_div_MR_Vector2i_int(MR_Vector2i b, int a)
Generated from function MR::operator/.
MRC_API int * MR_Vector2i_index(MR_Vector2i *_this, int e)
MRC_API MR_Vector2i64 MR_sub_MR_Vector2i64(const MR_Vector2i64 *a, const MR_Vector2i64 *b)
MRC_API const int * MR_Vector2f_Get_elements(void)
struct MR_Vector2f MR_Vector2f
MRC_API MR_Vector2i MR_mul_MR_Vector2b_bool(const MR_Vector2b *b, bool a)
MRC_API int MR_Vector2i_lengthSq(const MR_Vector2i *_this)
MRC_API MR_Vector2f MR_div_MR_Vector2f_float(MR_Vector2f b, float a)
Generated from function MR::operator/.
MRC_API MR_Vector2f MR_Vector2f_plusY(void)
Generated from method MR::Vector2f::plusY.
MRC_API MR_Vector2f * MR_Vector2f_DefaultConstructArray(size_t num_elems)
MRC_API MR_Vector2f MR_Vector2f_Construct_1(const MR_NoInit *_1)
MRC_API MR_Vector2i64 MR_div_MR_Vector2i64_int64_t(MR_Vector2i64 b, MR_int64_t a)
Generated from function MR::operator/.
MRC_API MR_Vector2i MR_Vector2i_DefaultConstruct(void)
Constructs an empty (default-constructed) instance.
MRC_API MR_Vector2i64 MR_Vector2i64_plusY(void)
Generated from method MR::Vector2i64::plusY.
MRC_API MR_Vector2d MR_Vector2d_Construct_1(const MR_NoInit *_1)
MRC_API const int * MR_Vector2i64_Get_elements(void)
MRC_API MR_Vector2b MR_Vector2b_plusY(void)
Generated from method MR::Vector2b::plusY.
MRC_API MR_std_ostream * MR_print_MR_Vector2b(MR_std_ostream *s, const MR_Vector2b *vec)
MRC_API MR_Vector2i MR_mul_int_MR_Vector2i(int a, const MR_Vector2i *b)
MRC_API MR_std_istream * MR_input_MR_Vector2d(MR_std_istream *s, MR_Vector2d *vec)
MRC_API MR_Vector2f MR_Vector2f_Construct_2(float x, float y)
Generated from constructor MR::Vector2f::Vector2f.
MRC_API MR_Vector2i64 MR_Vector2i64_Construct_1(const MR_NoInit *_1)
struct MR_Vector2d MR_Vector2d
MRC_API MR_std_ostream * MR_print_MR_Vector2i(MR_std_ostream *s, const MR_Vector2i *vec)
MRC_API bool MR_Vector2b_lengthSq(const MR_Vector2b *_this)
MRC_API MR_Vector2d MR_neg_MR_Vector2d(const MR_Vector2d *a)
MRC_API MR_Vector2f MR_Vector2f_DefaultConstruct(void)
Constructs an empty (default-constructed) instance.
MRC_API const int * MR_Vector2i_index_const(const MR_Vector2i *_this, int e)
MRC_API const double * MR_Vector2d_index_const(const MR_Vector2d *_this, int e)
MRC_API MR_Vector2i64 MR_Vector2i64_furthestBasisVector(const MR_Vector2i64 *_this)
MRC_API MR_Vector2b * MR_sub_assign_MR_Vector2b(MR_Vector2b *a, const MR_Vector2b *b)
MRC_API MR_Vector2b MR_Vector2b_Construct_1(const MR_NoInit *_1)
MRC_API MR_Vector2d MR_Vector2d_plusX(void)
Generated from method MR::Vector2d::plusX.
MRC_API double MR_dot_double_MR_Vector2d(const MR_Vector2d *a, const MR_Vector2d *b)
MRC_API MR_std_istream * MR_input_MR_Vector2i64(MR_std_istream *s, MR_Vector2i64 *vec)
MRC_API MR_Vector2i64 * MR_add_assign_MR_Vector2i64(MR_Vector2i64 *a, const MR_Vector2i64 *b)
MRC_API MR_Vector2f * MR_add_assign_MR_Vector2f(MR_Vector2f *a, const MR_Vector2f *b)
MRC_API const MR_Vector2b * MR_pos_MR_Vector2b(const MR_Vector2b *a)
MRC_API bool MR_equal_MR_Vector2f(const MR_Vector2f *a, const MR_Vector2f *b)
MRC_API MR_Vector2i MR_add_MR_Vector2i(const MR_Vector2i *a, const MR_Vector2i *b)
MRC_API MR_Vector2b * MR_div_assign_MR_Vector2b_bool(MR_Vector2b *a, bool b)
MRC_API MR_Vector2i64 MR_Vector2i64_plusX(void)
Generated from method MR::Vector2i64::plusX.
MRC_API MR_std_ostream * MR_print_MR_Vector2f(MR_std_ostream *s, const MR_Vector2f *vec)
MRC_API MR_std_istream * MR_input_MR_Vector2b(MR_std_istream *s, MR_Vector2b *vec)
MRC_API MR_Vector2i64 MR_Vector2i64_DefaultConstruct(void)
Constructs an empty (default-constructed) instance.
MRC_API MR_Vector2f MR_add_MR_Vector2f(const MR_Vector2f *a, const MR_Vector2f *b)
MRC_API MR_Vector2i MR_mul_MR_Vector2i_int(const MR_Vector2i *b, int a)
MRC_API MR_Vector2d MR_add_MR_Vector2d(const MR_Vector2d *a, const MR_Vector2d *b)
MRC_API float MR_cross(const MR_Vector2f *a, const MR_Vector2f *b)
MRC_API MR_Vector2d MR_Vector2d_normalized(const MR_Vector2d *_this)
MRC_API float * MR_Vector2f_index(MR_Vector2f *_this, int e)
MRC_API MR_Vector2i64 MR_neg_MR_Vector2i64(const MR_Vector2i64 *a)
MRC_API MR_Vector2i MR_Vector2i_diagonal(int a)
Generated from method MR::Vector2i::diagonal.
MRC_API MR_Vector2i64 MR_Vector2i64_diagonal(MR_int64_t a)
Generated from method MR::Vector2i64::diagonal.
MRC_API MR_Vector2d * MR_Vector2d_DefaultConstructArray(size_t num_elems)
MRC_API MR_Vector2i MR_sub_MR_Vector2i(const MR_Vector2i *a, const MR_Vector2i *b)
MRC_API MR_Vector2i MR_div_MR_Vector2b_bool(MR_Vector2b b, bool a)
Generated from function MR::operator/.
MRC_API MR_std_ostream * MR_print_MR_Vector2d(MR_std_ostream *s, const MR_Vector2d *vec)
struct MR_Vector2i MR_Vector2i
MRC_API MR_Vector2d MR_Vector2d_furthestBasisVector(const MR_Vector2d *_this)
MRC_API MR_Vector2i * MR_sub_assign_MR_Vector2i(MR_Vector2i *a, const MR_Vector2i *b)
MRC_API MR_Vector2b MR_Vector2b_plusX(void)
Generated from method MR::Vector2b::plusX.
MRC_API MR_Vector2d * MR_add_assign_MR_Vector2d(MR_Vector2d *a, const MR_Vector2d *b)
MRC_API MR_Vector2i MR_Vector2i_minusX(void)
Generated from method MR::Vector2i::minusX.
MRC_API MR_Vector2i MR_Vector2i_minusY(void)
Generated from method MR::Vector2i::minusY.
MRC_API MR_Vector2i MR_neg_MR_Vector2b(const MR_Vector2b *a)
MRC_API MR_Vector2b * MR_mul_assign_MR_Vector2b_bool(MR_Vector2b *a, bool b)
MRC_API const int * MR_Vector2b_Get_elements(void)
MRC_API bool MR_equal_MR_Vector2d(const MR_Vector2d *a, const MR_Vector2d *b)
MRC_API bool MR_Vector2d_isFinite(const MR_Vector2d *_this)
MRC_API MR_Vector2i MR_neg_MR_Vector2i(const MR_Vector2i *a)
MRC_API double MR_Vector2d_length(const MR_Vector2d *_this)
MRC_API MR_Vector2i64 * MR_Vector2i64_DefaultConstructArray(size_t num_elems)
MRC_API double MR_Vector2i_length(const MR_Vector2i *_this)
MRC_API MR_Vector2i64 MR_Vector2i64_minusY(void)
Generated from method MR::Vector2i64::minusY.
MRC_API MR_Vector2b MR_Vector2b_DefaultConstruct(void)
Constructs an empty (default-constructed) instance.
MRC_API const MR_Vector2i * MR_pos_MR_Vector2i(const MR_Vector2i *a)
MRC_API int MR_dot_bool_MR_Vector2b(const MR_Vector2b *a, const MR_Vector2b *b)
MRC_API double MR_Vector2i64_length(const MR_Vector2i64 *_this)
MRC_API MR_Vector2i64 MR_add_MR_Vector2i64(const MR_Vector2i64 *a, const MR_Vector2i64 *b)
struct MR_Vector2b MR_Vector2b
MRC_API MR_Vector2f MR_Vector2f_minusX(void)
Generated from method MR::Vector2f::minusX.
MRC_API MR_Vector2d MR_Vector2d_perpendicular(const MR_Vector2d *_this)
MRC_API double MR_Vector2b_length(const MR_Vector2b *_this)
MRC_API const int * MR_Vector2d_Get_elements(void)
int64_t MR_int64_t
Definition common.h:17
#define MRC_API
Definition exports.h:11
Definition MRVector2.h:21
bool y
Definition MRVector2.h:23
bool x
Definition MRVector2.h:22
Definition MRVector2.h:53
double y
Definition MRVector2.h:55
double x
Definition MRVector2.h:54
Definition MRVector2.h:45
float x
Definition MRVector2.h:46
float y
Definition MRVector2.h:47
Definition MRVector2.h:37
MR_int64_t x
Definition MRVector2.h:38
MR_int64_t y
Definition MRVector2.h:39
Definition MRVector2.h:29
int y
Definition MRVector2.h:31
int x
Definition MRVector2.h:30