2024-08-25 04:08:24 +00:00
|
|
|
#include <QPoint>
|
|
|
|
#include <QPointF>
|
|
|
|
#include <QVector2D>
|
|
|
|
#include <QVector3D>
|
|
|
|
#include <QVector4D>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qvector2d.h"
|
|
|
|
#include "gen_qvector2d.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QVector2D* QVector2D_new() {
|
|
|
|
return new QVector2D();
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
QVector2D* QVector2D_new2(int param1) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QVector2D(static_cast<Qt::Initialization>(param1));
|
|
|
|
}
|
|
|
|
|
|
|
|
QVector2D* QVector2D_new3(float xpos, float ypos) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QVector2D(static_cast<float>(xpos), static_cast<float>(ypos));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QVector2D* QVector2D_new4(QPoint* point) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QVector2D(*point);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QVector2D* QVector2D_new5(QPointF* point) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QVector2D(*point);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QVector2D* QVector2D_new6(QVector3D* vector) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QVector2D(*vector);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QVector2D* QVector2D_new7(QVector4D* vector) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QVector2D(*vector);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QVector2D* QVector2D_new8(QVector2D* param1) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QVector2D(*param1);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QVector2D_IsNull(const QVector2D* self) {
|
|
|
|
return self->isNull();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector2D_X(const QVector2D* self) {
|
|
|
|
return self->x();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector2D_Y(const QVector2D* self) {
|
|
|
|
return self->y();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QVector2D_SetX(QVector2D* self, float x) {
|
|
|
|
self->setX(static_cast<float>(x));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QVector2D_SetY(QVector2D* self, float y) {
|
|
|
|
self->setY(static_cast<float>(y));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector2D_OperatorSubscript(const QVector2D* self, int i) {
|
|
|
|
return self->operator[](static_cast<int>(i));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector2D_Length(const QVector2D* self) {
|
|
|
|
return self->length();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector2D_LengthSquared(const QVector2D* self) {
|
|
|
|
return self->lengthSquared();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVector2D* QVector2D_Normalized(const QVector2D* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVector2D(self->normalized());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QVector2D_Normalize(QVector2D* self) {
|
|
|
|
self->normalize();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector2D_DistanceToPoint(const QVector2D* self, QVector2D* point) {
|
|
|
|
return self->distanceToPoint(*point);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector2D_DistanceToLine(const QVector2D* self, QVector2D* point, QVector2D* direction) {
|
|
|
|
return self->distanceToLine(*point, *direction);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QVector2D* QVector2D_OperatorPlusAssign(QVector2D* self, QVector2D* vector) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QVector2D& _ret = self->operator+=(*vector);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return &_ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QVector2D* QVector2D_OperatorMinusAssign(QVector2D* self, QVector2D* vector) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QVector2D& _ret = self->operator-=(*vector);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return &_ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QVector2D* QVector2D_OperatorMultiplyAssign(QVector2D* self, float factor) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QVector2D& _ret = self->operator*=(static_cast<float>(factor));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return &_ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QVector2D* QVector2D_OperatorMultiplyAssignWithVector(QVector2D* self, QVector2D* vector) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QVector2D& _ret = self->operator*=(*vector);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return &_ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QVector2D* QVector2D_OperatorDivideAssign(QVector2D* self, float divisor) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QVector2D& _ret = self->operator/=(static_cast<float>(divisor));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return &_ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QVector2D* QVector2D_OperatorDivideAssignWithVector(QVector2D* self, QVector2D* vector) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QVector2D& _ret = self->operator/=(*vector);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return &_ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
float QVector2D_DotProduct(QVector2D* v1, QVector2D* v2) {
|
|
|
|
return QVector2D::dotProduct(*v1, *v2);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVector3D* QVector2D_ToVector3D(const QVector2D* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVector3D(self->toVector3D());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVector4D* QVector2D_ToVector4D(const QVector2D* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVector4D(self->toVector4D());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QPoint* QVector2D_ToPoint(const QVector2D* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QPoint(self->toPoint());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QPointF* QVector2D_ToPointF(const QVector2D* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QPointF(self->toPointF());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QVector2D_Delete(QVector2D* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|