本文整理汇总了C++中coordinates函数的典型用法代码示例。如果您正苦于以下问题:C++ coordinates函数的具体用法?C++ coordinates怎么用?C++ coordinates使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了coordinates函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: clearLCD
void eHealthDisplayClass::initECGScreen(void)
{
clearLCD();
delay(200);
timePrevious = 0;
timePreviousMeassure = 0;
time = 0;
countPrevious = 0;
//ECG LOGO
line(20, 49, 21, 49, 1); line(22, 49, 24, 55, 1);
line(24, 55, 28, 45, 1); line(28, 45, 29, 49, 1);
line(29, 49, 32, 49, 1); delay(100);
//LETRAS POR PANTALLA
coordinates(42, 52); writeLCD("ECG");
coordinates(100, 52); writeLCD( "cpm");
delay(150);
timePreviousMeassure = millis();
count = 0;
printHeart(1);
x = 8;
}
开发者ID:ishiikurisu,项目名称:clube_dudu,代码行数:25,代码来源:eHealthDisplay.cpp
示例2: test_spherical
void test_spherical()
{
typedef typename bg::coordinate_type<P>::type ct;
std::vector<P> v;
v.push_back(bg::make<P>( 179.73, 71.56)); // east
v.push_back(bg::make<P>( 177.47, 71.23)); // less east
v.push_back(bg::make<P>(-178.78, 70.78)); // further east, = west, this is the most right point
// Sort on coordinates in order x,y,z
std::sort(v.begin(), v.end(), bg::less<P>());
std::string s = coordinates(v);
BOOST_CHECK_EQUAL(s, "(177.47, 71.23)(179.73, 71.56)(-178.78, 70.78)");
// Sort ascending on only x-coordinate
std::sort(v.begin(), v.end(), bg::less<P, 0>());
s = coordinates(v);
BOOST_CHECK_EQUAL(s, "(177.47, 71.23)(179.73, 71.56)(-178.78, 70.78)");
// Sort ascending on only x-coordinate, but override with std-comparison,
// (so this is the normal sorting behaviour that would have been used
// if it would not have been spherical)
std::sort(v.begin(), v.end(), bg::less<P, 0, std::less<ct> >());
s = coordinates(v);
BOOST_CHECK_EQUAL(s, "(-178.78, 70.78)(177.47, 71.23)(179.73, 71.56)");
}
开发者ID:avasopht,项目名称:boost_1_55_0-llvm,代码行数:26,代码来源:compare.cpp
示例3: p
void ConvexPolygon::projectOnPlane(
const Eigen::Affine3f& pose, Eigen::Affine3f& output)
{
Eigen::Vector3f p(pose.translation());
Eigen::Vector3f output_p;
projectOnPlane(p, output_p);
// ROS_INFO("[ConvexPolygon::projectOnPlane] p: [%f, %f, %f]",
// p[0], p[1], p[2]);
// ROS_INFO("[ConvexPolygon::projectOnPlane] output_p: [%f, %f, %f]",
// output_p[0], output_p[1], output_p[2]);
Eigen::Quaternionf rot;
rot.setFromTwoVectors(pose.rotation() * Eigen::Vector3f::UnitZ(),
coordinates().rotation() * Eigen::Vector3f::UnitZ());
Eigen::Quaternionf coords_rot(coordinates().rotation());
Eigen::Quaternionf pose_rot(pose.rotation());
// ROS_INFO("[ConvexPolygon::projectOnPlane] rot: [%f, %f, %f, %f]",
// rot.x(), rot.y(), rot.z(), rot.w());
// ROS_INFO("[ConvexPolygon::projectOnPlane] coords_rot: [%f, %f, %f, %f]",
// coords_rot.x(), coords_rot.y(), coords_rot.z(), coords_rot.w());
// ROS_INFO("[ConvexPolygon::projectOnPlane] pose_rot: [%f, %f, %f, %f]",
// pose_rot.x(), pose_rot.y(), pose_rot.z(), pose_rot.w());
// ROS_INFO("[ConvexPolygon::projectOnPlane] normal: [%f, %f, %f]", normal_[0], normal_[1], normal_[2]);
// Eigen::Affine3f::Identity() *
// output.translation() = Eigen::Translation3f(output_p);
// output.rotation() = rot * pose.rotation();
//output = Eigen::Translation3f(output_p) * rot * pose.rotation();
output = Eigen::Affine3f(rot * pose.rotation());
output.pretranslate(output_p);
// Eigen::Vector3f projected_point = output * Eigen::Vector3f(0, 0, 0);
// ROS_INFO("[ConvexPolygon::projectOnPlane] output: [%f, %f, %f]",
// projected_point[0], projected_point[1], projected_point[2]);
}
开发者ID:knorth55,项目名称:jsk_recognition,代码行数:32,代码来源:convex_polygon.cpp
示例4: delay
void eHealthDisplayClass::printValuesScreen(void)
{
delay(100);
//Prints the current value of diastolic pressure.
if (pulse != eHealth.getBPM()) {
pulse = eHealth.getBPM();
clearSpace(70, 40, 90, 47);
coordinates(70,47); Serial.print(pulse);
delay(10);
}
//Stores the current value of skin conductance.
float conductance = eHealth.getSkinConductance();
delay(20);
//If conductance == -1, the sensor is no connected.
if ( conductance == -1 ) {
coordinates(70,35); Serial.print(F("NOCN")); //No connected message.
delay(10);
}
else {
coordinates(70,35); Serial.print(conductance,2);
delay(10);
}
if (oxygen != eHealth.getOxygenSaturation())
{
oxygen = eHealth.getOxygenSaturation();
clearSpace(70, 15, 90, 22);
coordinates(70, 22); Serial.print(oxygen);
delay(10);
}
//Prints the current value of temperature.
coordinates(70,9); Serial.print(eHealth.getTemperature(),2);
delay(10);
//If no changes in position, don't refresh the screen.
if (bodyPosition != eHealth.getBodyPosition()) {
bodyPosition = eHealth.getBodyPosition();
clearSpace(95, 34, 117, 50); // Clear the previous position.
if (bodyPosition == 1) supinePosition();
else if (bodyPosition == 2) leftLateralPosition();
else if (bodyPosition == 3) rigthLateralPosition();
else if (bodyPosition == 5) standPosition();
else pronePosition();
}
delay(10);
}
开发者ID:ishiikurisu,项目名称:clube_dudu,代码行数:54,代码来源:eHealthDisplay.cpp
示例5: TEST_F
TEST_F(BodyTest, PreBrouwerOblateDeserializationSuccess) {
EXPECT_FALSE(oblate_body_.is_massless());
EXPECT_TRUE(oblate_body_.is_oblate());
// Serialize post-Brouwer.
serialization::Body post_brouwer_body;
oblate_body_.WriteToMessage(&post_brouwer_body);
serialization::MassiveBody const& post_brouwer_massive_body =
post_brouwer_body.massive_body();
serialization::RotatingBody const& post_brouwer_rotating_body =
post_brouwer_massive_body.GetExtension(
serialization::RotatingBody::rotating_body);
serialization::OblateBody const& post_brouwer_oblate_body =
post_brouwer_rotating_body.GetExtension(
serialization::OblateBody::oblate_body);
// Construct explicitly an equivalent pre-Brouwer message.
serialization::Body pre_brouwer_body;
serialization::MassiveBody* pre_brouwer_massive_body =
pre_brouwer_body.mutable_massive_body();
pre_brouwer_massive_body->mutable_gravitational_parameter()->CopyFrom(
post_brouwer_massive_body.gravitational_parameter());
serialization::PreBrouwerOblateBody* pre_brouwer_oblate_body =
pre_brouwer_massive_body->MutableExtension(
serialization::PreBrouwerOblateBody::pre_brouwer_oblate_body);
pre_brouwer_oblate_body->mutable_frame()->CopyFrom(
post_brouwer_rotating_body.frame());
pre_brouwer_oblate_body->mutable_j2()->CopyFrom(
post_brouwer_oblate_body.j2());
pre_brouwer_oblate_body->mutable_axis()->mutable_frame()->CopyFrom(
post_brouwer_rotating_body.angular_velocity().frame());
auto const normalized_angular_velocity = Normalize(angular_velocity_);
auto* const pre_brouwer_axis_r3_element =
pre_brouwer_oblate_body->mutable_axis()->mutable_vector();
pre_brouwer_axis_r3_element->mutable_x()->set_double_(
normalized_angular_velocity.coordinates().x);
pre_brouwer_axis_r3_element->mutable_y()->set_double_(
normalized_angular_velocity.coordinates().y);
pre_brouwer_axis_r3_element->mutable_z()->set_double_(
normalized_angular_velocity.coordinates().z);
// Deserialize both.
auto const post_brouwer = Body::ReadFromMessage(post_brouwer_body);
auto const pre_brouwer = Body::ReadFromMessage(pre_brouwer_body);
auto const* const cast_post_brouwer =
dynamic_cast<OblateBody<World> const*>(&*post_brouwer);
auto const* const cast_pre_brouwer =
dynamic_cast<OblateBody<World> const*>(&*pre_brouwer);
EXPECT_EQ(cast_post_brouwer->mass(), cast_pre_brouwer->mass());
EXPECT_EQ(cast_post_brouwer->axis(), cast_pre_brouwer->axis());
EXPECT_EQ(cast_post_brouwer->j2(), cast_pre_brouwer->j2());
}
开发者ID:Wavechaser,项目名称:Principia,代码行数:52,代码来源:body_test.cpp
示例6: pixel
void eHealthDisplayClass::printECGScreen(void)
{
for (int j=0; j<45; j++){
pixel(8,j,0);
}
delay(20);
if (millis()-timePreviousMeassure > 10000){
countsPerMinute = 6*count;
timePreviousMeassure = millis();
count = 0;
//Clear space
coordinates(95, 52); backspace();
coordinates(90, 52); backspace();
coordinates(85, 52); backspace();
coordinates(80, 52); backspace();
writeLcdDec(countsPerMinute);
delay(20);
}
delay(10);
printHeart(1);
// Input 1
valRead = map(analogRead(0), 0, 1023, 5, 45);
pixel (x, valRead, 1);
if(x>12){
line(x-1, prevRead, x, valRead, 1);
}
//Hearth blink
if(valRead> 30)
{
count=count+1;
printHeart(0);
delay(200);
}
//Wave refresh
for (int j = 5; j<45; j++){
pixel(x+1,j,0);
}
//Previous value
prevRead = valRead;
x++;
if (x == 120) x = 8;
}
开发者ID:ishiikurisu,项目名称:clube_dudu,代码行数:51,代码来源:eHealthDisplay.cpp
示例7: buildMesh
Teuchos::RCP<panzer_stk_classic::STK_Interface> buildMesh(int elemX,int elemY)
{
typedef panzer_stk_classic::STK_Interface::SolutionFieldType VariableField;
typedef panzer_stk_classic::STK_Interface::VectorFieldType CoordinateField;
RCP<Teuchos::ParameterList> pl = rcp(new Teuchos::ParameterList);
pl->set("X Blocks",2);
pl->set("Y Blocks",1);
pl->set("X Elements",elemX);
pl->set("Y Elements",elemY);
panzer_stk_classic::SquareQuadMeshFactory factory;
factory.setParameterList(pl);
RCP<panzer_stk_classic::STK_Interface> mesh = factory.buildUncommitedMesh(MPI_COMM_WORLD);
// add in some fields
mesh->addSolutionField("dog","eblock-0_0");
mesh->addSolutionField("dog","eblock-1_0");
factory.completeMeshConstruction(*mesh,MPI_COMM_WORLD);
VariableField * field = mesh->getMetaData()->get_field<VariableField>("dog");
CoordinateField * cField = mesh->getMetaData()->get_field<CoordinateField>("coordinates");
TEUCHOS_ASSERT(field!=0);
TEUCHOS_ASSERT(cField!=0);
// fill the fields with data
const std::vector<stk_classic::mesh::Bucket*> nodeData
= mesh->getBulkData()->buckets(mesh->getNodeRank());
for(std::size_t b=0; b<nodeData.size(); ++b) {
stk_classic::mesh::Bucket * bucket = nodeData[b];
// build all buckets
for(stk_classic::mesh::Bucket::iterator itr=bucket->begin();
itr!=bucket->end(); ++itr) {
stk_classic::mesh::EntityArray<CoordinateField> coordinates(*cField,*itr);
stk_classic::mesh::EntityArray<VariableField> dog_array(*field,*itr);
double x = coordinates(0);
double y = coordinates(1);
dog_array() = 4.0*x*x+y;
}
}
if(mesh->isWritable())
mesh->writeToExodus("output.exo");
return mesh;
}
开发者ID:crtrott,项目名称:Trilinos,代码行数:51,代码来源:gs_evaluators.cpp
示例8: updateData
void FChart3d::Update()
{
double MaxX = DataMap3d->AddressZ.GetSizeX();
double MaxY = DataMap3d->AddressZ.GetSizeY();
if(DataMap3d->Data->IsEmply() || DataMap3d->AddressZ.IsEmpty())
{
Surface3d->setMesh(3, 3);
Surface3d->setDomain(0, 1, 0 , 1);
Surface3d->create();
updateData();
updateGL();
return;
}
double MaxZ = GetMaxZ();
setTitle(DataMap3d->TitleGraf.isEmpty() ? "3D Map" : DataMap3d->TitleGraf);
setRotation(30,0,15);
setScale(MaxZ / MaxX, MaxZ / MaxY, 1);
setShift(0,0,0); // Deslocamento
setZoom(0.5);
Surface3d->setMesh(MaxX+1, MaxY+1);
Surface3d->setDomain(0, MaxX-1, 0 ,MaxY-1);
Surface3d->create();
for (unsigned i=0; i!=coordinates()->axes.size(); ++i)
{
coordinates()->axes[i].setMajors(4);
coordinates()->axes[i].setMinors(2);
}
coordinates()->setAutoScale(true);
double Tic = (coordinates()->second() - coordinates()->first()).length() / MaxZ;
Tic = Tic * 0.5;
coordinates()->setTicLength(Tic,0.6*Tic);
coordinates()->axes[X1].setLabelString("x-axis");
coordinates()->axes[Y1].setLabelString("y-axis");
//coordinates()->axes[Z1].setLabelString(QChar(0x38f)); // Omega - see http://www.unicode.org/charts/
//setCoordinateStyle(BOX);
updateData();
updateGL();
}
开发者ID:rafaelfassi,项目名称:fassichip,代码行数:53,代码来源:fchart3d.cpp
示例9: coordinates
void coordinates(node *p, double lengthsum, long *tipy, double *tipmax,
node *start, boolean njoin)
{
/* establishes coordinates of nodes */
node *q, *first, *last;
if (p->tip) {
p->xcoord = (long)(over * lengthsum + 0.5);
p->ycoord = *tipy;
p->ymin = *tipy;
p->ymax = *tipy;
(*tipy) += down;
if (lengthsum > *tipmax)
*tipmax = lengthsum;
return;
}
q = p->next;
do {
if (q->back)
coordinates(q->back, lengthsum + q->v, tipy,tipmax, start, njoin);
q = q->next;
} while ((p == start || p != q) && (p != start || p->next != q));
first = p->next->back;
q = p;
while (q->next != p && q->next->back) /* is this right ? */
q = q->next;
last = q->back;
p->xcoord = (long)(over * lengthsum + 0.5);
if (p == start && p->back)
p->ycoord = p->next->next->back->ycoord;
else
p->ycoord = (first->ycoord + last->ycoord) / 2;
p->ymin = first->ymin;
p->ymax = last->ymax;
} /* coordinates */
开发者ID:Chrisss50,项目名称:ViralToolBox,代码行数:35,代码来源:dist.c
示例10: IMP_UNUSED
double EnvelopeFitRestraint::unprotected_evaluate(
IMP::DerivativeAccumulator *accum) const {
IMP_UNUSED(accum);
// get the XYZs
IMP::algebra::Vector3Ds coordinates(ps_.size());
for (unsigned int i = 0; i < ps_.size(); i++) {
coordinates[i] = core::XYZ(ps_[i]).get_coordinates();
}
// align
algebra::Transformation3Ds map_transforms = pca_aligner_->align(coordinates);
// filter and score, save best scoring only (or none if penetrating)
bool best_found = false;
IMP::algebra::Transformation3D best_trans;
double best_score = -std::numeric_limits<double>::max();
for (unsigned int j = 0; j < map_transforms.size(); j++) {
double score = envelope_score_->score(coordinates, map_transforms[j]);
if (score > best_score) {
best_score = score;
best_trans = map_transforms[j];
best_found = true;
}
}
if (best_found)
const_cast<EnvelopeFitRestraint *>(this)->transformation_ = best_trans;
else // store identity trans
const_cast<EnvelopeFitRestraint *>(this)->transformation_ =
algebra::Transformation3D(algebra::Vector3D(0, 0, 0));
return -best_score;
}
开发者ID:newtonjoo,项目名称:imp,代码行数:34,代码来源:EnvelopeFitRestraint.cpp
示例11: coordinates
void coordinates(node *p, double lengthsum, long *tipy, double *tipmax)
{ /* establishes coordinates of nodes */
node *q, *first, *last;
if (p->tip) {
p->xcoord = lengthsum;
p->ycoord = *tipy;
p->ymin = *tipy;
p->ymax = *tipy;
(*tipy) += down;
if (lengthsum > (*tipmax))
(*tipmax) = lengthsum;
return;
}
q = p->next;
do {
coordinates(q->back, lengthsum + q->v, tipy,tipmax);
q = q->next;
} while ((p == curtree.start || p != q) &&
(p != curtree.start || p->next != q));
first = p->next->back;
q = p;
while (q->next != p)
q = q->next;
last = q->back;
p->xcoord = lengthsum;
if (p == curtree.start)
p->ycoord = p->next->next->back->ycoord;
else
p->ycoord = (first->ycoord + last->ycoord) / 2;
p->ymin = first->ymin;
p->ymax = last->ymax;
} /* coordinates */
开发者ID:Chrisss50,项目名称:ViralToolBox,代码行数:33,代码来源:contml.c
示例12: createBoundingBoxesForElementsInElementBlocks
inline void createBoundingBoxesForElementsInElementBlocks(const stk::mesh::BulkData &bulk, FlaotBoxVector& domainBoxes)
{
stk::mesh::EntityVector elements;
stk::mesh::get_selected_entities(bulk.mesh_meta_data().locally_owned_part(), bulk.buckets(stk::topology::ELEM_RANK), elements);
size_t numberBoundingBoxes = elements.size();
domainBoxes.resize(numberBoundingBoxes);
stk::mesh::FieldBase const * coords = bulk.mesh_meta_data().coordinate_field();
std::vector<double> boxCoordinates(6);
for(size_t i=0;i<elements.size();++i)
{
unsigned num_nodes = bulk.num_nodes(elements[i]);
std::vector<double> coordinates(3*num_nodes,0);
const stk::mesh::Entity* nodes = bulk.begin_nodes(elements[i]);
for(unsigned j=0;j<num_nodes;++j)
{
double* data = static_cast<double*>(stk::mesh::field_data(*coords, nodes[j]));
coordinates[3*j] = data[0];
coordinates[3*j+1] = data[1];
coordinates[3*j+2] = data[2];
}
findBoundingBoxCoordinates(coordinates, boxCoordinates);
unsigned id = bulk.identifier(elements[i]);
Ident domainBoxId(id, bulk.parallel_rank());
domainBoxes[i] = std::make_pair(FloatBox(boxCoordinates[0], boxCoordinates[1], boxCoordinates[2],
boxCoordinates[3], boxCoordinates[4], boxCoordinates[5]),
domainBoxId);
}
}
开发者ID:trilinos,项目名称:Trilinos,代码行数:33,代码来源:MeshUtilsForBoundingVolumes.hpp
示例13: iterator
void FoursquareModel::parseFile( const QByteArray& file )
{
QScriptValue data;
QScriptEngine engine;
// Qt requires parentheses around JSON
data = engine.evaluate( '(' + QString::fromUtf8( file ) + ')' );
data = data.property("response");
// Parse if any result exists
if ( data.property( "venues" ).isArray() ) {
QScriptValueIterator iterator( data.property( "venues" ) );
// Add items to the list
QList<AbstractDataPluginItem*> items;
do {
iterator.next();
QString id = iterator.value().property( "id" ).toString();
QString name = iterator.value().property( "name" ).toString();
QString category = iterator.value().property( "categories" ).property( 0 ).property( "name" ).toString();
QString address = iterator.value().property( "location" ).property( "address" ).toString();
QString city = iterator.value().property( "location" ).property( "city" ).toString();
QString country = iterator.value().property( "location" ).property( "country" ).toString();
double latitude = iterator.value().property( "location" ).property( "lat" ).toString().toDouble();
double longitude = iterator.value().property( "location" ).property( "lng" ).toString().toDouble();
int usersCount = iterator.value().property( "stats" ).property( "usersCount" ).toInteger();
QScriptValue categoryIcon = iterator.value().property( "categories" ).property( 0 ).property( "icon" );
QString iconUrl;
QString largeIconUrl;
if ( categoryIcon.isValid() ) {
iconUrl = categoryIcon.property( "prefix" ).toString()
+ "32" // That's the icon size hardcoded
+ categoryIcon.property( "name" ).toString();
largeIconUrl = categoryIcon.property( "prefix" ).toString()
+ "64" // Larger icon
+ categoryIcon.property( "name" ).toString();
}
if( !itemExists( id ) ) {
GeoDataCoordinates coordinates( longitude, latitude, 0.0, GeoDataCoordinates::Degree );
FoursquareItem *item = new FoursquareItem( this );
item->setId( id );
item->setCoordinate( coordinates );
item->setTarget( "earth" );
item->setName( name );
item->setCategory( category );
item->setAddress( address );
item->setCity( city );
item->setCountry( country );
item->setUsersCount( usersCount );
item->setCategoryIconUrl( iconUrl );
item->setCategoryLargeIconUrl( largeIconUrl );
items << item;
}
}
while ( iterator.hasNext() );
addItemsToList( items );
}
}
开发者ID:Earthwings,项目名称:marble,代码行数:60,代码来源:FoursquareModel.cpp
示例14: coordinates
void ImagePropertiesGPSTab::setMetadata(const DMetadata& meta, const KUrl& url)
{
double lat, lng;
const bool haveCoordinates = meta.getGPSLatitudeNumber(&lat) && meta.getGPSLongitudeNumber(&lng);
if (haveCoordinates)
{
double alt;
const bool haveAlt = meta.getGPSAltitude(&alt);
KGeoMap::GeoCoordinates coordinates(lat, lng);
if (haveAlt)
{
coordinates.setAlt(alt);
}
GPSImageInfo gpsInfo;
gpsInfo.coordinates = coordinates;
gpsInfo.dateTime = meta.getImageDateTime();
gpsInfo.rating = meta.getImageRating();
gpsInfo.url = url;
setGPSInfoList(GPSImageInfo::List() << gpsInfo);
}
else
{
clearGPSInfo();
}
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:29,代码来源:imagepropertiesgpstab.cpp
示例15: coordinates
void coordinates(node *p, long *tipy, double f, long *fartemp)
{
/* establishes coordinates of nodes */
/* used in dollop, dolpenny, dolmove, & move */
node *q, *first, *last;
if (p->tip) {
p->xcoord = 0;
p->ycoord = *tipy;
p->ymin = *tipy;
p->ymax = *tipy;
*tipy += down;
return;
}
q = p->next;
do {
coordinates(q->back, tipy, f, fartemp);
q = q->next;
} while (p != q);
first = p->next->back;
q = p->next;
while (q->next != p)
q = q->next;
last = q->back;
p->xcoord = (last->ymax - first->ymin) * f;
p->ycoord = (first->ycoord + last->ycoord) / 2;
p->ymin = first->ymin;
p->ymax = last->ymax;
if (p->xcoord > *fartemp)
*fartemp = p->xcoord;
} /* coordinates */
开发者ID:Chrisss50,项目名称:ViralToolBox,代码行数:31,代码来源:disc.c
示例16: polygons
json QgsMultiPolygon::asJsonObject( int precision ) const
{
json polygons( json::array( ) );
for ( const QgsAbstractGeometry *geom : qgis::as_const( mGeometries ) )
{
if ( qgsgeometry_cast<const QgsPolygon *>( geom ) )
{
json coordinates( json::array( ) );
const QgsPolygon *polygon = static_cast<const QgsPolygon *>( geom );
std::unique_ptr< QgsLineString > exteriorLineString( polygon->exteriorRing()->curveToLine() );
QgsPointSequence exteriorPts;
exteriorLineString->points( exteriorPts );
coordinates.push_back( QgsGeometryUtils::pointsToJson( exteriorPts, precision ) );
std::unique_ptr< QgsLineString > interiorLineString;
for ( int i = 0, n = polygon->numInteriorRings(); i < n; ++i )
{
interiorLineString.reset( polygon->interiorRing( i )->curveToLine() );
QgsPointSequence interiorPts;
interiorLineString->points( interiorPts );
coordinates.push_back( QgsGeometryUtils::pointsToJson( interiorPts, precision ) );
}
polygons.push_back( coordinates );
}
}
return
{
{ "type", "MultiPolygon" },
{ "coordinates", polygons }
};
}
开发者ID:alexbruy,项目名称:QGIS,代码行数:32,代码来源:qgsmultipolygon.cpp
示例17: assert
std::vector<double> PottsMeshWriter<SPACE_DIM>::GetNextNode()
{
if (mpMesh)
{
// Sanity check
assert(this->mNumNodes == mpMesh->GetNumNodes());
std::vector<double> coordinates(SPACE_DIM+1);
// Get the node coordinates using the node iterator (thus skipping deleted nodes)
for (unsigned j=0; j<SPACE_DIM; j++)
{
coordinates[j] = (*(mpIters->pNodeIter))->GetPoint()[j];
}
coordinates[SPACE_DIM] = (*(mpIters->pNodeIter))->IsBoundaryNode();
++(*(mpIters->pNodeIter));
return coordinates;
}
else
{
return AbstractMeshWriter<SPACE_DIM,SPACE_DIM>::GetNextNode();
}
}
开发者ID:Chaste,项目名称:Chaste,代码行数:25,代码来源:PottsMeshWriter.cpp
示例18: axis
boost::optional< coordinates > great_circle::arc::intersection_with( const arc& rhs ) const
{
if (!may_intersect(rhs)) { return boost::optional< coordinates >(); }
if( equal_( axis(), rhs.axis() ) || equal_( axis(), -rhs.axis() ) ) { return boost::optional< coordinates >(); }
Eigen::Vector3d cross = axis().cross( rhs.axis() );
if( is_between_( *this, cross ) && is_between_( rhs, cross ) )
{
snark::range_bearing_elevation a( cross ); // quick and dirty, quite excessive
return coordinates( a.e(), a.b() );
}
if( is_between_( *this, -cross ) && is_between_( rhs, -cross ) )
{
snark::range_bearing_elevation a( -cross ); // quick and dirty, quite excessive
return coordinates( a.e(), a.b() );
}
return boost::optional< coordinates >();
}
开发者ID:AhmedMahmoud65,项目名称:snark,代码行数:17,代码来源:great_circle.cpp
示例19: at
Eigen::Vector2d great_circle::arc::tangent_in_navigation_frame_at( double angle ) const
{
const Eigen::Vector3d& v = at( angle );
const Eigen::Vector3d& n = snark::spherical::to_navigation_frame( coordinates( v ), angle_axis_.axis().cross( v ) );
Eigen::Vector2d projection( n.x(), n.y() ); //Eigen::Vector2d projection( v.y(), v.z() ); //Eigen::Vector2d projection( v.z(), v.y() );
projection.normalize();
return projection;
}
开发者ID:WangFei-DUT,项目名称:snark,代码行数:8,代码来源:great_circle.cpp
示例20: coordinates
void InternalCoordinatesTest::size()
{
chemkit::InternalCoordinates coordinates(1);
QCOMPARE(coordinates.size(), size_t(1));
chemkit::InternalCoordinates newCoordinates(coordinates);
QCOMPARE(newCoordinates.size(), size_t(1));
}
开发者ID:NabilNoaman,项目名称:chemkit,代码行数:8,代码来源:internalcoordinatestest.cpp
注:本文中的coordinates函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论