CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
point_f.h
1
2#ifndef _aspose_system_drawing_point_f_h_
3#define _aspose_system_drawing_point_f_h_
4
5#include "fwd.h"
6#include <system/string.h>
7#include <system/boxed_value.h>
8
9namespace System { namespace Drawing {
13 class ASPOSECPP_SHARED_CLASS PointF
14 {
15 public:
17 ASPOSECPP_SHARED_API PointF();
21 ASPOSECPP_SHARED_API PointF(float x, float y);
26 ASPOSECPP_SHARED_API PointF(const SizeF& size);
27
31 inline bool get_IsEmpty() const { return (m_x == 0.0f && m_y == 0.0f); }
32
34 inline float get_X() const { return m_x; }
36 inline float get_Y() const { return m_y; }
37
40 inline void set_X(float value) { m_x = value; }
43 inline void set_Y(float value) { m_y = value; }
44
49 ASPOSECPP_SHARED_API bool Equals(const PointF& point) const;
50
57 static ASPOSECPP_SHARED_API PointF Add(const PointF& point, const SizeF& size);
58
65 static ASPOSECPP_SHARED_API PointF Subtract(const PointF& point, const SizeF& size);
66
73 static ASPOSECPP_SHARED_API PointF Add(const PointF& point, const Size& size);
74
81 static ASPOSECPP_SHARED_API PointF Subtract(const PointF& point, const Size& size);
82
89 friend ASPOSECPP_SHARED_API PointF operator+(const PointF& point, const SizeF& size);
96 friend ASPOSECPP_SHARED_API PointF operator-(const PointF& point, const SizeF& size);
97
104 friend ASPOSECPP_SHARED_API PointF operator+(const PointF& point, const Size& size);
111 friend ASPOSECPP_SHARED_API PointF operator-(const PointF& point, const Size& size);
112
118 friend ASPOSECPP_SHARED_API bool operator==(const PointF& point1, const PointF& point2);
124 friend ASPOSECPP_SHARED_API bool operator!=(const PointF& point1, const PointF& point2);
125
128 friend ASPOSECPP_SHARED_API bool operator<(const PointF& point1, const PointF& point2);
129
131 static const ASPOSECPP_SHARED_API PointF Empty;
132
134 int GetHashCode() const { return (int)((int)m_x ^ (((int)m_y << 13) | ((int)m_y >> 19))); }
135
138 System::String ToString() const { return String::Format(u"{{X={0}, Y={1}}}", m_x, m_y); }
139
141 bool IsNull() const { return false; }
142
143 // To solve this:
144 // auto enumerator_0 = (bbox)->GetEnumerator();
145 // System::Drawing::PointF e_0;
146 // while (enumerator_0->MoveNext() && ((e_0 = enumerator_0->get_Current()) || true))
148 explicit operator bool() { return true; }
149
150 private:
152 float m_x;
154 float m_y;
155 };
156
161 inline std::ostream& operator<<(std::ostream& stream, const PointF& point)
162 {
163 stream << point.ToString();
164 return stream;
165 }
166
171 inline std::wostream& operator<<(std::wostream& stream, const PointF& point)
172 {
173 stream << point.ToString();
174 return stream;
175 }
176
177}} // namespace System::Drawing
178
179
180namespace System
181{
183
185 template<> struct IsBoxable<Drawing::PointF> : std::true_type {};
186
188 template <>
189 class BoxedValue<System::Drawing::PointF> : public DefaultBoxedValue<System::Drawing::PointF>
190 {
191 public:
195 : DefaultBoxedValue<System::Drawing::PointF>(value)
196 {}
197 };
198
200}
201
202#endif // _aspose_system_drawing_point_f_h_
BoxedValue(const T &value)
Constructs an object that represents the specified value boxed.
Definition: boxed_value.h:192
Represents a pair of single-precision floating point X and Y coordinates of a point on a 2-dimensiona...
Definition: point_f.h:14
friend PointF operator+(const PointF &point, const Size &size)
Adds the width and height values of the specified Size object to the X and Y coordinates values of th...
static PointF Add(const PointF &point, const Size &size)
Adds the width and height values of the specified Size object to the X and Y coordinates values of th...
friend PointF operator-(const PointF &point, const Size &size)
Subtracts the width and height values of the specified Size object from the X and Y coordinates value...
friend PointF operator-(const PointF &point, const SizeF &size)
Subtracts the width and height values of the specified SizeF object from the X and Y coordinates valu...
static PointF Subtract(const PointF &point, const Size &size)
Subtracts the width and height values of the specified Size object from the X and Y coordinates value...
static const PointF Empty
An empty instance of PointF class whose X and Y coordinates values are 0.
Definition: point_f.h:131
static PointF Add(const PointF &point, const SizeF &size)
Adds the width and height values of the specified SizeF object to the X and Y coordinates values of t...
PointF(float x, float y)
Constructs a new PointF object and initializes it with the specified values.
friend bool operator<(const PointF &point1, const PointF &point2)
Always throws InvalidOperationException.
friend PointF operator+(const PointF &point, const SizeF &size)
Adds the width and height values of the specified SizeF object to the X and Y coordinates values of t...
bool get_IsEmpty() const
Determines if both X and Y coordinates values are equal to 0.
Definition: point_f.h:31
float get_X() const
Returns the value of X coordinate represented by the current object.
Definition: point_f.h:34
PointF(const SizeF &size)
Constructs a new PointF object and initializes its X and Y coordinates values with the values of widt...
void set_X(float value)
Sets the value of X coordinate represented by the current object.
Definition: point_f.h:40
bool IsNull() const
Always returns false.
Definition: point_f.h:141
bool Equals(const PointF &point) const
Determines if the current object and the specified object are equal, i.e. represent the same pair of ...
System::String ToString() const
Returns the string representation of the pair of X and Y coordinates values represented by the curren...
Definition: point_f.h:138
friend bool operator!=(const PointF &point1, const PointF &point2)
Determines if the specified PointF objects are not equal, i.e. represent the distinct pairs of X and ...
float get_Y() const
Returns the value of Y coordinate represented by the current object.
Definition: point_f.h:36
void set_Y(float value)
Sets the value of Y coordinate represented by the current object.
Definition: point_f.h:43
friend bool operator==(const PointF &point1, const PointF &point2)
Determines if the specified PointF objects are equal, i.e. represent the same pair of X and Y coordin...
PointF()
Constructs a new PointF object and initializes its X and Y coordinates values with 0.
int GetHashCode() const
Returns a hash code for the current object.
Definition: point_f.h:134
static PointF Subtract(const PointF &point, const SizeF &size)
Subtracts the width and height values of the specified SizeF object from the X and Y coordinates valu...
Represents a pair of single-precision floating point values that represent width and height of an ima...
Definition: size_f.h:14
Represents a pair of integer values that represent width and height of an image. This type should be ...
Definition: size.h:14
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
static String Format(const SharedPtr< IFormatProvider > &fp, const String &format, const Args &... args)
Formats string in C# style.
Definition: string.h:1405
std::ostream & operator<<(std::ostream &stream, Color color)
Insert data into the stream using UTF-8 encoding.
Definition: color.h:427
Definition: db_command.h:9