本文整理汇总了C++中Tag::getLatitude方法的典型用法代码示例。如果您正苦于以下问题:C++ Tag::getLatitude方法的具体用法?C++ Tag::getLatitude怎么用?C++ Tag::getLatitude使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tag
的用法示例。
在下文中一共展示了Tag::getLatitude方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: filtrate
bool FShapePolygon::filtrate(const Tag &mark)
{
if (m_points.size() == 0) return false;
QPolygonF polygon;
for (int i = 0; i < m_points.size(); i++)
{
polygon << m_points.at(i);
}
polygon << m_points.at(0);
return polygon.containsPoint(QPointF(mark.getLatitude(), mark.getLongitude()), Qt::OddEvenFill);
}
示例2: atRegion
bool Region::atRegion(const Tag& point)
{
if (m_points.size() == 0) return false;
QPolygonF polygon;
for (int i=0;i<m_points.size();i++)
{
polygon << QPointF(m_points.at(i).getLatitude(),m_points.at(i).getLongitude());
}
polygon << QPointF(m_points.at(0).getLatitude(),m_points.at(0).getLongitude());
return polygon.containsPoint(QPointF(point.getLatitude(),point.getLongitude()), Qt::OddEvenFill);
}
示例3: testLoadTagsResponse
void Test_DoublePrecisionJSON::testLoadTagsResponse(){
LoadTagsResponseJSON response;
response.setData(TEST_LIST);
response.setErrno(SUCCESS);
qDebug() << response.getJson();
QByteArray json = response.getJson();
response.setData(QList<Tag>());
response.parseJson(json);
Tag resultTag = response.getData()[0];
QCOMPARE(TEST_TAG.getLatitude(), resultTag.getLatitude());
QCOMPARE(TEST_TAG.getLongitude(), resultTag.getLongitude());
QCOMPARE(TEST_TAG.getAltitude(), resultTag.getAltitude());
}
示例4: testFilterDefaultResponse
void Test_DoublePrecisionJSON::testFilterDefaultResponse(){
FilterDefaultResponseJSON response;
response.setTags(TEST_LIST);
qDebug() << response.getJson();
QByteArray json = response.getJson();
response.setTags(QList<Tag>());
response.parseJson(json);
Tag resultTag = response.getTags()[0];
QCOMPARE(TEST_TAG.getLatitude(), resultTag.getLatitude());
QCOMPARE(TEST_TAG.getLongitude(), resultTag.getLongitude());
QCOMPARE(TEST_TAG.getAltitude(), resultTag.getAltitude());
}
示例5: getJson
QByteArray WriteTagRequestJSON::getJson() const
{
QJson::Serializer serializer;
QVariantMap request;
Tag mark = m_tags.at(0);
Channel channel = m_channels.at(0);
request.insert("auth_token", m_token);
request.insert("channel", channel.getName());
request.insert("title", mark.getLabel().isEmpty()? "New mark":mark.getLabel());
request.insert("link", mark.getUrl());
request.insert("description", mark.getDescription());
request.insert("latitude", mark.getLatitude());
request.insert("altitude", mark.getAltitude());
request.insert("longitude", mark.getLongitude());
request.insert("time", mark.getTime().toString("dd MM yyyy HH:mm:ss.zzz"));
return serializer.serialize(request);
}
示例6: getJson
QByteArray LoadTagsResponseJSON::getJson() const
{
QJson::Serializer serializer;
serializer.setDoublePrecision(DOUBLE_PRECISION_RESPONSE);
QVariantMap obj, rss, jchannel;
QVariantList jchannels;
QVariantList jtags;
QVariantMap channel;
obj["errno"]= m_errno;
if (m_errno == SUCCESS){
for(int j=0; j<m_tags.size(); j++)
{
Tag tag = m_tags.at(j);
QVariantMap jtag;
jtag["title"] = tag.getLabel();
jtag["link"] = tag.getUrl();
jtag["description"] = tag.getDescription();
jtag["latitude"] = tag.getLatitude();
jtag["altitude"] = tag.getAltitude();
jtag["longitude"] = tag.getLongitude();
jtag["user"] = tag.getUser().getLogin();
jtag["pubDate"] = tag.getTime().toString("dd MM yyyy HH:mm:ss.zzz");
jtags.append(jtag);
}
channel["items"] = jtags;
// channel["name"] = m_channels.at(i).getName();
jchannels.append(channel);
jchannel["items"] = jchannels;
rss["channels"] = jchannel;
obj["rss"] = rss;
}
return serializer.serialize(obj);
}