Samchon Framework for CPP
1.0.0
|
A geometry coordinates (point) More...
#include <GeometryPoint.hpp>
Public Member Functions | |
GeometryPoint () | |
Default Constructor. More... | |
GeometryPoint (int uid) | |
Construct from uid. More... | |
GeometryPoint (int uid, double longitude, double latitude) | |
Construct from uid and geometry coordinates. More... | |
virtual auto | key () const -> string override |
Get a key that can identify the Entity uniquely. More... | |
auto | calcDistance (const GeometryPoint &point) const -> double |
Calculate distance between target Branch. More... | |
virtual auto | TAG () const -> string |
A tag name when represented by XML. More... | |
auto | toXML () const -> shared_ptr< XML > override |
Get an XML object represents the Entity. More... | |
auto | toString () const -> string |
Convert the Branch to String. More... | |
![]() | |
Entity () | |
Default Constructor. More... | |
virtual void | construct (std::shared_ptr< library::XML >)=0 |
Construct data of the Entity from an XML object. More... | |
Protected Attributes | |
int | uid |
An unique id for uniqueness. More... | |
double | longitude |
The longitude; coordinates X. More... | |
double | latitude |
The latitude, coordinates Y. More... | |
|
inline |
Default Constructor.
Definition at line 59 of file GeometryPoint.hpp.
|
inline |
Construct from uid.
Geometry coordinates, longitude and latitude will have a random value between
Definition at line 71 of file GeometryPoint.hpp.
References samchon::library::Math::random().
|
inline |
Construct from uid and geometry coordinates.
longitude | Longitude, a coordinate of the geometry point |
latitude | Latitude, a coordinate of the geometry point |
Definition at line 86 of file GeometryPoint.hpp.
|
inlineoverridevirtual |
Get a key that can identify the Entity uniquely.
If identifier of the Entity is not atomic value, returns a string represents the composite identifier. If identifier of the Entity is not string, converts the identifier to string and returns the string.
Reimplemented from samchon::protocol::Entity.
Definition at line 106 of file GeometryPoint.hpp.
|
inline |
Calculate distance between target Branch.
Referenced from http://thesunrises.tistory.com/958 (Geometry points to killometers)
branch | The target Branch to calculate |
Definition at line 117 of file GeometryPoint.hpp.
References samchon::library::Math::degree_to_radian(), and samchon::library::Math::radian_to_degree().
|
inlinevirtual |
A tag name when represented by XML.
Implements samchon::protocol::Entity.
Definition at line 141 of file GeometryPoint.hpp.
|
inlineoverridevirtual |
Get an XML object represents the Entity.
Returns an XML object that can represents the Entity containing member variables into properties.
A member variable (not object, but atomic value like number, string or date) is categorized as a property within the framework of entity side. Thus, when overriding a toXML() method and archiving member variables to an XML object to return, puts each variable to be a property belongs to only an XML object.
Don't archive the member variable of atomic value to XML::value causing enormouse creation of XML objects to number of member variables. An Entity must be represented by only an XML instance (tag).
Standard Usage | Non-standard usage abusing value |
---|---|
<memberList> <member id='jhnam88' name='Jeongho+Nam' birthdate='1988-03-11' /> <member id='master' name='Administartor' birthdate='2011-07-28' /> </memberList> | <member> <id>jhnam88</id> <name>Jeongho+Nam</name> <birthdate>1988-03-11</birthdate> </member> |
Reimplemented from samchon::protocol::Entity.
Definition at line 146 of file GeometryPoint.hpp.
|
inline |
Convert the Branch to String.
Have of form of tab and enter delimeters for Excel.
{$uid} {$longitude} {$latitude}
Definition at line 164 of file GeometryPoint.hpp.
References samchon::library::StringUtil::substitute().
|
protected |
An unique id for uniqueness.
Definition at line 40 of file GeometryPoint.hpp.
|
protected |
The longitude; coordinates X.
Definition at line 45 of file GeometryPoint.hpp.
|
protected |
The latitude, coordinates Y.
Definition at line 50 of file GeometryPoint.hpp.