FLImaging 7.4.14.3
FLPoint4.h
1#pragma once
2
3#include "FLPoint3.h"
4
6namespace FLImaging
7{
9 namespace Foundation
10 {
11 template<typename Ty>
12 class FL_EXPORT CFLGeometry3DQuaternion;
13
14 template<typename Ty>
15 class FL_EXPORT CMatrix;
16
22 template<typename Ty>
23 class FL_EXPORT CFLPoint4 : public CFLPoint3<Ty>
24 {
25 public:
30 Ty w;
31
37
42 virtual ~CFLPoint4();
43
57 virtual void Get(Ty& tX, Ty& tY, Ty& tZ, Ty& tW) const;
58
66 virtual double GetMagnitude() const override;
67
75 virtual double GetSquareMagnitude() const override;
76
94 virtual const CResult Offset(double x, double y, double z, double w);
95
113 virtual const CResult Offset(float x, float y, float z, float w);
114
132 virtual const CResult Offset(int32_t x, int32_t y, int32_t z, int32_t w);
133
151 virtual const CResult Offset(int64_t x, int64_t y, int64_t z, int64_t w);
152
164 virtual const CResult Offset(const CFLPoint4<double>& flp4);
165
177 virtual const CResult Offset(const CFLPoint4<float>& flp4);
178
190 virtual const CResult Offset(const CFLPoint4<double>* pFlp4);
191
203 virtual const CResult Offset(const CFLPoint4<float>* pFlp4);
204
216 virtual const CResult Add(const CFLPoint4<Ty>& rhs);
217
235 virtual const CResult Add(Ty tX, Ty tY, Ty tZ, Ty tW);
236
248 virtual const CResult Subtract(const CFLPoint4<Ty>& rhs);
249
267 virtual const CResult Subtract(Ty tX, Ty tY, Ty tZ, Ty tW);
268
286 virtual const CResult Multiply(double f64MulX, double f64MulY, double f64MulZ, double f64MulW);
287
305 virtual const CResult Multiply(float f32MulX, float f32MulY, float f32MulZ, float f32MulW);
306
324 virtual const CResult Multiply(int32_t i32MulX, int32_t i32MulY, int32_t i32MulZ, int32_t i32MulW);
325
343 virtual const CResult Multiply(int64_t i64MulX, int64_t i64MulY, int64_t i64MulZ, int64_t i64MulW);
344
356 virtual const CResult Multiply(const CFLPoint4<double>& flp4);
357
369 virtual const CResult Multiply(const CFLPoint4<float>& flp4);
370
382 virtual const CResult Multiply(const CFLPoint4<double>* pFlp4);
383
395 virtual const CResult Multiply(const CFLPoint4<float>* pFlp4);
396
408 virtual const CResult Multiply(double f64Scalar);
409
421 virtual const CResult Multiply(float f32Scalar);
422
434 virtual const CResult Multiply(int32_t i32Scalar);
435
447 virtual const CResult Multiply(int64_t i64Scalar);
448
460 virtual const CResult Divide(double f64Scalar);
461
473 virtual const CResult Divide(float f32Scalar);
474
486 virtual const CResult Divide(int32_t i32Scalar);
487
499 virtual const CResult Divide(int64_t i64Scalar);
500
514 virtual const CResult MatMul(const CMatrix<float>& mat4x4) override;
515
529 virtual const CResult MatMul(const CMatrix<double>& mat4x4) override;
530
544 virtual const CResult MatMul(const CMatrix<float>* pMat4x4) override;
545
559 virtual const CResult MatMul(const CMatrix<double>* pMat4x4) override;
560
561
573 virtual const CResult Normalize();
574
585
597 virtual CFLPoint4<double> GetUnitVector(const CFLPoint4<double>& flp4Target) const;
598
610 virtual CFLPoint4<double> GetUnitVector(const CFLPoint4<double>* pFlp4Target) const;
611
612 virtual void Clear() override;
613
614 virtual EFigureDeclType GetDeclType() const override;
615
616 virtual bool IsValid() const override;
617 virtual bool IsFigureValid() const override;
618
619 virtual const CResult MakeFigureInvalid() override;
620
622 virtual bool IsSpecEqual(const CFLFigure* pFlfRhs, EFigureSpecCompareType eSpecType = EFigureSpecCompareType_Coordinates) const override;
623
633 virtual const CFLPoint4<Ty>& operator=(const CFLPoint4<Ty>& flp4);
634
646 virtual bool operator==(const CFLPoint4<float>& flp4) const;
647
659 virtual bool operator==(const CFLPoint4<double>& flp4) const;
660
672 virtual bool operator!=(const CFLPoint4<float>& flp4) const;
673
685 virtual bool operator!=(const CFLPoint4<double>& flp4) const;
686
698 virtual const CFLPoint4<Ty>& operator+=(const double& value);
699
711 virtual const CFLPoint4<Ty>& operator+=(const CFLPoint4<double>& flp4);
712
724 virtual const CFLPoint4<Ty>& operator-=(const double& value);
725
737 virtual const CFLPoint4<Ty>& operator-=(const CFLPoint4<double>& flp4);
738
750 virtual const CFLPoint4<Ty>& operator*=(const double& value);
751
763 virtual const CFLPoint4<Ty>& operator*=(const CFLPoint4<double>& flp4);
764
776 virtual const CFLPoint4<Ty>& operator/=(const double& value);
777
789 virtual const CFLPoint4<Ty>& operator/=(const CFLPoint4<double>& flp4);
790
802 virtual CFLPoint4<double> operator+(const double& value) const;
803
816
828 virtual CFLPoint4<double> operator-(const double& value) const;
829
842
854 CFLPoint4<double> operator*(const double& value) const;
855
868
880 virtual CFLPoint4<double> operator/(const double& value) const;
881
894
906
907 //Friend operator
909 // Arithmetic operator
910
924 friend CFLPoint4<double> operator+(const int32_t& value, const CFLPoint4<Ty>& point)
925 {
926 CFLPoint4<double> t(point);
927 t += value;
928 return t;
929 }
930
944 friend CFLPoint4<double> operator+(const int64_t& value, const CFLPoint4<Ty>& point)
945 {
946 CFLPoint4<double> t(point);
947 t += value;
948 return t;
949 }
950
964 friend CFLPoint4<double> operator+(const float& value, const CFLPoint4<Ty>& point)
965 {
966 CFLPoint4<double> t(point);
967 t += value;
968 return t;
969 }
970
984 friend CFLPoint4<double> operator+(const double& value, const CFLPoint4<Ty>& point)
985 {
986 CFLPoint4<double> t(point);
987 t += value;
988 return t;
989 }
990
1004 friend CFLPoint4<double> operator-(const int32_t& value, const CFLPoint4<Ty>& point)
1005 {
1006 CFLPoint4<double> t(point);
1007 t *= -1.;
1008 t += value;
1009 return t;
1010 }
1011
1025 friend CFLPoint4<double> operator-(const int64_t& value, const CFLPoint4<Ty>& point)
1026 {
1027 CFLPoint4<double> t(point);
1028 t *= -1.;
1029 t += value;
1030 return t;
1031 }
1032
1046 friend CFLPoint4<double> operator-(const float& value, const CFLPoint4<Ty>& point)
1047 {
1048 CFLPoint4<double> t(point);
1049 t *= -1.;
1050 t += value;
1051 return t;
1052 }
1053
1067 friend CFLPoint4<double> operator-(const double& value, const CFLPoint4<Ty>& point)
1068 {
1069 CFLPoint4<double> t(point);
1070 t *= -1.;
1071 t += value;
1072 return t;
1073 }
1074
1088 friend CFLPoint4<double> operator*(const int32_t& value, const CFLPoint4<Ty>& point)
1089 {
1090 CFLPoint4<double> t(point);
1091 t *= value;
1092 return t;
1093 }
1094
1108 friend CFLPoint4<double> operator*(const int64_t& value, const CFLPoint4<Ty>& point)
1109 {
1110 CFLPoint4<double> t(point);
1111 t *= value;
1112 return t;
1113 }
1114
1128 friend CFLPoint4<double> operator*(const float& value, const CFLPoint4<Ty>& point)
1129 {
1130 CFLPoint4<double> t(point);
1131 t *= value;
1132 return t;
1133 }
1134
1148 friend CFLPoint4<double> operator*(const double& value, const CFLPoint4<Ty>& point)
1149 {
1150 CFLPoint4<double> t(point);
1151 t *= value;
1152 return t;
1153 }
1154
1168 friend CFLPoint4<double> operator/(const int32_t& value, const CFLPoint4<Ty>& point)
1169 {
1170 CFLPoint4<double> t((double)value / (double)point.x, (double)value / (double)point.y, (double)value / (double)point.z, (double)value / (double)point.w);
1171 return t;
1172 }
1173
1187 friend CFLPoint4<double> operator/(const int64_t& value, const CFLPoint4<Ty>& point)
1188 {
1189 CFLPoint4<double> t((double)value / (double)point.x, (double)value / (double)point.y, (double)value / (double)point.z, (double)value / (double)point.w);
1190 return t;
1191 }
1192
1206 friend CFLPoint4<double> operator/(const float& value, const CFLPoint4<Ty>& point)
1207 {
1208 CFLPoint4<double> t((double)value / (double)point.x, (double)value / (double)point.y, (double)value / (double)point.z, (double)value / (double)point.w);
1209 return t;
1210 }
1211
1225 friend CFLPoint4<double> operator/(const double& value, const CFLPoint4<Ty>& point)
1226 {
1227 CFLPoint4<double> t((double)value / (double)point.x, (double)value / (double)point.y, (double)value / (double)point.z, (double)value / (double)point.w);
1228 return t;
1229 }
1231
1232
1233 virtual const CResult Set(const CFLFigure& flf) override;
1234 virtual const CResult Set(const CFLFigure* pFlf) override;
1235
1253 virtual const CResult Set(double x, double y, double z, double w);
1254
1272 virtual const CResult Set(float x, float y, float z, float w);
1273
1291 virtual const CResult Set(int32_t x, int32_t y, int32_t z, int32_t w);
1292
1310 virtual const CResult Set(int64_t x, int64_t y, int64_t z, int64_t w);
1311
1327 virtual const CResult Set(const CFLPoint3<double>& flp3, double w = 0.);
1328
1344 virtual const CResult Set(const CFLPoint3<float>& flp3, float w = 0.);
1345
1346
1362 virtual const CResult Set(const CFLPoint3<double>* pFlp3, double w = 0.);
1363
1379 virtual const CResult Set(const CFLPoint3<float>* pFlp3, float w = 0.f);
1380
1392 virtual const CResult Set(const CFLPoint4<double>& flp4);
1393
1405 virtual const CResult Set(const CFLPoint4<float>& flp4);
1406
1418 virtual const CResult Set(const CFLPoint4<double>* pFlp4);
1419
1431 virtual const CResult Set(const CFLPoint4<float>* pFlp4);
1432
1446 virtual const CResult Set(const CFLGeometry3DQuaternion<double>& quat);
1447
1461 virtual const CResult Set(const CFLGeometry3DQuaternion<float>& quat);
1462
1476 virtual const CResult Set(const CFLGeometry3DQuaternion<double>* pQuat);
1477
1491 virtual const CResult Set(const CFLGeometry3DQuaternion<float>* pQuat);
1492
1493
1506
1518 CFLPoint4(const CFLFigure* pFlf);
1519
1533 CFLPoint4(double x, double y, double z, double w);
1534
1548 CFLPoint4(float x, float y, float z, float w);
1549
1563 CFLPoint4(int32_t x, int32_t y, int32_t z, int32_t w);
1564
1578 CFLPoint4(int64_t x, int64_t y, int64_t z, int64_t w);
1579
1591 CFLPoint4(const CFLPoint3<double>& flp3, double w = 0.);
1592
1604 CFLPoint4(const CFLPoint3<float>& flp3, float w = 0.f);
1605
1617 CFLPoint4(const CFLPoint3<double>* pFlp3, double w = 0.);
1618
1630 CFLPoint4(const CFLPoint3<float>* pFlp3, float w = 0.f);
1631
1642
1653
1654
1665
1676
1687
1698
1709
1720
1721 Base::ECPUInstructionType m_eCPUInstruction;
1722 SupportToDuplicateObject(CFLPoint4<Ty>, *this);
1723 DeclareGetClassType();
1724 };
1725
1726 typedef CFLPoint4<float> CFLPoint4F;
1727 typedef CFLPoint4<double> CFLPoint4D;
1728 }
1729}
FLImaging module execution result object.
Definition ResultsDef.h:1676
A base class of classes representing figures.
Definition FLFigure.h:27
virtual bool IsSpecEqual(const CFLFigure &flfRhs, EFigureSpecCompareType eSpecType=EFigureSpecCompareType_Coordinates) const
A class representing quaternion.
Definition FLGeometry3DQuaternion.h:25
float z
Definition FLPoint3.h:45
A class representing a point with 4 elements.
Definition FLPoint4.h:24
virtual const CResult Set(const CFLGeometry3DQuaternion< double > *pQuat)
virtual double GetSquareMagnitude() const override
CFLPoint4(int32_t x, int32_t y, int32_t z, int32_t w)
virtual CFLPoint4< double > operator+(const double &value) const
Offset operator[offset].
friend CFLPoint4< double > operator/(const int32_t &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:1168
virtual const CResult Set(const CFLGeometry3DQuaternion< double > &quat)
CFLPoint4(const CFLGeometry3DQuaternion< float > &quat)
CFLPoint4(const CFLPoint3< float > &flp3, float w=0.f)
virtual const CResult Divide(float f32Scalar)
virtual const CFLPoint4< Ty > & operator+=(const double &value)
Offset operator[offset].
virtual EFigureDeclType GetDeclType() const override
virtual const CResult Offset(double x, double y, double z, double w)
friend CFLPoint4< double > operator-(const float &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:1046
virtual const CResult Multiply(double f64MulX, double f64MulY, double f64MulZ, double f64MulW)
CFLPoint4(const CFLPoint4< float > *pFlp4)
CFLPoint4(const CFLPoint4< float > &flp4)
virtual const CResult Divide(int64_t i64Scalar)
virtual const CResult Offset(const CFLPoint4< float > *pFlp4)
virtual const CResult Multiply(float f32Scalar)
CFLPoint4(double x, double y, double z, double w)
CFLPoint4(const CFLGeometry3DQuaternion< float > *pQuat)
virtual const CResult Set(const CFLPoint4< double > &flp4)
CFLPoint4(float x, float y, float z, float w)
friend CFLPoint4< double > operator+(const int64_t &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:944
virtual const CResult MakeFigureInvalid() override
Make the figure invalid. (For example, set the coordinates of the point to invalid x,...
CFLPoint4(const CFLPoint3< double > *pFlp3, double w=0.)
virtual const CFLPoint4< Ty > & operator+=(const CFLPoint4< double > &flp4)
Offset operator[offset].
virtual const CResult Set(const CFLGeometry3DQuaternion< float > *pQuat)
CFLPoint4(const CFLPoint4< double > *pFlp4)
virtual bool IsValid() const override
virtual const CResult Subtract(Ty tX, Ty tY, Ty tZ, Ty tW)
virtual const CResult Set(const CFLPoint3< float > &flp3, float w=0.)
virtual const CResult Offset(int64_t x, int64_t y, int64_t z, int64_t w)
CFLPoint4(const CFLGeometry3DQuaternion< double > *pQuat)
virtual const CResult Set(const CFLPoint3< float > *pFlp3, float w=0.f)
CFLPoint4(const CFLPoint3< double > &flp3, double w=0.)
CFLPoint4(int64_t x, int64_t y, int64_t z, int64_t w)
virtual CFLPoint4< double > operator-(const CFLPoint4< double > &flp4) const
Offset operator[offset].
virtual const CResult Subtract(const CFLPoint4< Ty > &rhs)
virtual double GetMagnitude() const override
virtual const CResult Set(const CFLGeometry3DQuaternion< float > &quat)
CFLPoint4(const CFLPoint3< float > *pFlp3, float w=0.f)
CFLPoint4(const CFLFigure &flf)
initialization constructor
virtual const CResult Offset(int32_t x, int32_t y, int32_t z, int32_t w)
virtual const CResult Set(double x, double y, double z, double w)
virtual bool operator!=(const CFLPoint4< double > &flp4) const
Comparison operator.
virtual const CResult Offset(float x, float y, float z, float w)
virtual const CResult Multiply(const CFLPoint4< double > &flp4)
virtual const CResult Normalize()
Function to set this the unit vector from the origin to this
virtual const CResult Set(const CFLPoint4< double > *pFlp4)
friend CFLPoint4< double > operator/(const int64_t &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:1187
virtual const CResult Set(int64_t x, int64_t y, int64_t z, int64_t w)
CFLPoint4(const CFLFigure *pFlf)
initialization constructor
friend CFLPoint4< double > operator/(const float &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:1206
virtual const CFLPoint4< Ty > & operator-=(const CFLPoint4< double > &flp4)
Offset operator[offset].
friend CFLPoint4< double > operator*(const int32_t &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:1088
virtual const CFLPoint4< Ty > & operator=(const CFLPoint4< Ty > &flp4)
virtual const CResult Divide(int32_t i32Scalar)
float w
Definition FLPoint4.h:30
virtual const CResult MatMul(const CMatrix< float > *pMat4x4) override
virtual const CResult Set(int32_t x, int32_t y, int32_t z, int32_t w)
virtual const CResult Set(const CFLFigure &flf) override
virtual const CResult Offset(const CFLPoint4< double > &flp4)
CFLPoint4< Ty > operator-() const
An operator that returns a point with the signs of x, y, z and w values inverted.
CFLPoint4< double > operator*(const double &value) const
An operator that multiplies the x and y values of the object by a parameter.
CFLPoint4< double > operator*(const CFLPoint4< double > &flp4) const
An operator that multiplies the x and y values of the object by a parameter.
virtual bool operator==(const CFLPoint4< float > &flp4) const
Comparison operator.
virtual const CResult MatMul(const CMatrix< double > &mat4x4) override
virtual const CResult Add(const CFLPoint4< Ty > &rhs)
virtual const CResult Set(float x, float y, float z, float w)
virtual CFLPoint4< double > operator/(const CFLPoint4< double > &flp4) const
An operator that divides the x, y, z, w values of the object into parameters.
virtual const CFLPoint4< Ty > & operator-=(const double &value)
Offset operator[offset].
virtual const CFLPoint4< Ty > & operator*=(const CFLPoint4< double > &flp4)
An operator that multiplies the x and y values of the object by a parameter.
virtual CFLPoint4< double > operator+(const CFLPoint4< double > &flp4) const
Offset operator[offset].
virtual bool operator==(const CFLPoint4< double > &flp4) const
Comparison operator.
friend CFLPoint4< double > operator+(const float &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:964
friend CFLPoint4< double > operator*(const float &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:1128
virtual const CResult Set(const CFLPoint3< double > *pFlp3, double w=0.)
friend CFLPoint4< double > operator-(const int64_t &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:1025
virtual const CResult Multiply(int32_t i32Scalar)
virtual const CResult Multiply(int64_t i64Scalar)
virtual CFLPoint4< double > operator/(const double &value) const
An operator that divides the x, y, z, w values of the object into parameters.
friend CFLPoint4< double > operator-(const int32_t &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:1004
friend CFLPoint4< double > operator*(const int64_t &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:1108
virtual bool operator!=(const CFLPoint4< float > &flp4) const
Comparison operator.
virtual CFLPoint4< double > GetUnitVector() const
Function to get the unit vector from the origin to this
virtual const CResult Multiply(double f64Scalar)
CFLPoint4(const CFLPoint4< double > &flp4)
friend CFLPoint4< double > operator/(const double &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:1225
virtual const CResult Set(const CFLPoint3< double > &flp3, double w=0.)
virtual const CResult Offset(const CFLPoint4< double > *pFlp4)
virtual const CResult Multiply(const CFLPoint4< float > *pFlp4)
virtual const CResult Set(const CFLPoint4< float > &flp4)
friend CFLPoint4< double > operator-(const double &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:1067
virtual const CResult Multiply(const CFLPoint4< float > &flp4)
virtual const CResult Multiply(int64_t i64MulX, int64_t i64MulY, int64_t i64MulZ, int64_t i64MulW)
virtual const CResult MatMul(const CMatrix< double > *pMat4x4) override
CFLPoint4(const CFLGeometry3DQuaternion< double > &quat)
virtual void Clear() override
Clear an object's variable.
virtual const CResult Multiply(const CFLPoint4< double > *pFlp4)
virtual const CResult Set(const CFLPoint4< float > *pFlp4)
friend CFLPoint4< double > operator*(const double &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:1148
virtual const CResult Multiply(float f32MulX, float f32MulY, float f32MulZ, float f32MulW)
virtual CFLPoint4< double > operator-(const double &value) const
Offset operator[offset].
virtual const CResult Divide(double f64Scalar)
friend CFLPoint4< double > operator+(const double &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:984
friend CFLPoint4< double > operator+(const int32_t &value, const CFLPoint4< Ty > &point)
Offset operator[offset].
Definition FLPoint4.h:924
virtual const CResult Set(const CFLFigure *pFlf) override
virtual const CFLPoint4< Ty > & operator/=(const double &value)
An operator that divides the x, y, z, w values of the object into parameters.
virtual bool IsFigureValid() const override
virtual const CFLPoint4< Ty > & operator/=(const CFLPoint4< double > &flp4)
An operator that divides the x, y, z, w values of the object into parameters.
virtual const CResult MatMul(const CMatrix< float > &mat4x4) override
virtual bool IsSpecEqual(const CFLFigure *pFlfRhs, EFigureSpecCompareType eSpecType=EFigureSpecCompareType_Coordinates) const override
virtual CFLPoint4< double > GetUnitVector(const CFLPoint4< double > *pFlp4Target) const
A function that calculates the unit vector from that object to the parameter object.
virtual CFLPoint4< double > GetUnitVector(const CFLPoint4< double > &flp4Target) const
A function that calculates the unit vector from that object to the parameter object.
virtual const CResult Offset(const CFLPoint4< float > &flp4)
virtual const CResult Multiply(int32_t i32MulX, int32_t i32MulY, int32_t i32MulZ, int32_t i32MulW)
virtual void Get(Ty &tX, Ty &tY, Ty &tZ, Ty &tW) const
virtual const CFLPoint4< Ty > & operator*=(const double &value)
An operator that multiplies the x and y values of the object by a parameter.
virtual const CResult Add(Ty tX, Ty tY, Ty tZ, Ty tW)
float y
Definition FLPoint.h:36
float x
Definition FLPoint.h:30
A class representing matrix.
Definition Matrix.h:79
ECPUInstructionType
CPU instruction type.
Definition DefinitionsBase.h:2044
Definition AlgorithmBase.h:16
EFigureDeclType
Declare type of figure.
Definition DefinitionsFigure.h:33
EFigureSpecCompareType
Definition DefinitionsFigure.h:3513
@ EFigureSpecCompareType_Coordinates
Definition DefinitionsFigure.h:3518