本文整理汇总了C++中set_location函数的典型用法代码示例。如果您正苦于以下问题:C++ set_location函数的具体用法?C++ set_location怎么用?C++ set_location使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_location函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update_coordinates
/*
* Updates our gps coordinate structure with the newest buffer
* data.
*/
void update_coordinates(char *buffer, uint32_t index)
{
char *latitude = get_latitude();
char *longitude = get_longitude();
char *altitude = get_altitude();
index = index%BUFFERSIZE;
// skip the time
index = _skip_data(buffer, index);
index = set_location(buffer, index, latitude, 10);
index = set_location(buffer, index, longitude, 11);
// skip the fix
index = _skip_data(buffer, index);
//sendIndex(index);
//index = (index+2)%BUFFERSIZE;
// get satalites tracked
index = set_satellites_tracked(buffer, index);
//sendIndex(index);
//sendIndex(index);
// skip Horizontal dilution of position
index = _skip_data(buffer, index);
// altitude
index = set_location(buffer, index, altitude, 15);
}
开发者ID:krishnamannem,项目名称:spacegoldfish---IEEE-project---Google-Space-Balloon-Challenge,代码行数:35,代码来源:gpsParser.c
示例2: cc_timezone_map_set_timezone
gboolean
cc_timezone_map_set_timezone (CcTimezoneMap *map,
const gchar *timezone)
{
GPtrArray *locations;
guint i;
char *real_tz;
gboolean ret;
real_tz = tz_info_get_clean_name (map->priv->tzdb, timezone);
locations = tz_get_locations (map->priv->tzdb);
ret = FALSE;
for (i = 0; i < locations->len; i++)
{
TzLocation *loc = locations->pdata[i];
if (!g_strcmp0 (loc->zone, real_tz ? real_tz : timezone))
{
set_location (map, loc);
ret = TRUE;
break;
}
}
if (ret)
gtk_widget_queue_draw (GTK_WIDGET (map));
g_free (real_tz);
return ret;
}
示例3:
void GameScene_02::addBall()
{
auto ball = Ball::create();
this->addChild(ball);
ball->set_location(visibleSize/2);
balls->pushBack(ball);
}
示例4: test_physics
void test_physics(){
printf("testing physics\n");
world_handle hello_world = new_world();
//tests movement, set/get velocity, set/get location(position)
po_vector center;
center.x = 1.0;
center.y = 1.0;
po_circle circle2 = create_circ(center, 1.0);
po_geometry geo_circle2 = create_geom_circ(circle2, 1.0);
po_handle circle02 = add_object (hello_world, &geo_circle2, 20.0, 1.0, 0.0);
po_vector location = get_position(circle02);
center.x = 0.0;
center.y = 0.0;
po_circle circle1 = create_circ(center, 5.0);
po_geometry geo_circle1 = create_geom_circ(circle1, 1.0);
po_handle circle01 = add_object (hello_world, &geo_circle1, 50.0, 0.0, 0.0);
set_velocity(circle02,-1.0,0.0);
po_vector velocity = get_velocity(circle02);
update(hello_world,3);
po_vector pos02 = get_position(circle02);
po_vector pos01 = get_position(circle01);
assert(pos02.x == 17.0);
assert(pos02.y == 1.0);
assert(pos01.x == 50.0);
assert(pos01.y == 0.0);
set_location(circle01, 0.0, 0.0);
set_velocity(circle01, -7.76,1.7);
set_location(circle02, 20.0, 0.0);
set_velocity(circle02, -9.0,2.0);
update(hello_world,1);
po_vector pos002 = get_position(circle02);
po_vector pos001 = get_position(circle01);
assert( pos002.x == 11.0);
assert( pos002.y == 2.0);
assert(fabs(pos001.x - -7.76) <= EPSILON);
assert(fabs(pos001.y - 1.7)<= EPSILON);
}
示例5: location
void button::calculate_size()
{
if (type_ == TYPE_IMAGE){
SDL_Rect loc_image = location();
loc_image.h = image_->h;
loc_image.w = image_->w;
set_location(loc_image);
return;
}
SDL_Rect const &loc = location();
bool change_size = loc.h == 0 || loc.w == 0;
if (!change_size) {
unsigned w = loc.w - (type_ == TYPE_PRESS ? horizontal_padding : checkbox_horizontal_padding + base_width_);
if (type_ != TYPE_IMAGE)
{
int fs = font_size;
int style = TTF_STYLE_NORMAL;
std::string::const_iterator i_beg = label_.begin(), i_end = label_.end(),
i = font::parse_markup(i_beg, i_end, &fs, NULL, &style);
if (i != i_end) {
std::string tmp(i, i_end);
label_.erase(i - i_beg, i_end - i_beg);
label_ += font::make_text_ellipsis(tmp, fs, w, style);
}
}
}
if (type_ != TYPE_IMAGE){
textRect_ = font::draw_text(NULL, screen_area(), font_size,
font::BUTTON_COLOR, label_, 0, 0);
}
if (!change_size)
return;
#ifdef USE_TINY_GUI
set_height(textRect_.h+vertical_padding);
#else
set_height(std::max(textRect_.h+vertical_padding,base_height_));
#endif
if(type_ == TYPE_PRESS) {
#ifdef USE_TINY_GUI
set_width(textRect_.w + horizontal_padding);
#else
if(spacing_ == MINIMUM_SPACE) {
set_width(textRect_.w + horizontal_padding);
} else {
set_width(std::max(textRect_.w+horizontal_padding,base_width_));
}
#endif
} else {
if(label_.empty()) {
set_width(base_width_);
} else {
set_width(checkbox_horizontal_padding + textRect_.w + base_width_);
}
}
}
示例6: create
void create()
{
bboard::create();
set_attic_dir ("/d/Conf/data/attic") ;
set_save_dir("/d/Conf/data") ;
set_save_file("conf_A");
set_location("/d/Conf/room/room_A") ;
set ("short.text", "Resolutions and Amendments Board") ;
}
示例7: create
void create()
{
bboard::create();
set_attic_dir ("/d/TMI/data/attic") ;
set_save_dir("/d/TMI/data") ;
set_save_file("network");
set_location("/d/TMI/rooms/networkroom");
set ("short.text","The network board");
}
示例8: scroll_top
void palette_manager::adjust_size()
{
scroll_top();
const SDL_Rect& rect = gui_.palette_area();
set_location(rect);
palette_start_ = rect.y;
bg_register(rect);
active_palette().adjust_size(rect);
set_dirty();
}
示例9: create
void create()
{
bboard::create();
set_attic_dir(BASE+"data/attic");
set_save_dir(BASE+"data");
set_save_file("MS");
set_location(FLOOR_1("entrance.c"));
set("author", "cyanide");
set("short.text", "a brand new posting board");
}
示例10: ModelComponent
//_____________________________________________________________________________
// Convienience constructor.
ContactGeometry::ContactGeometry(const Vec3& location, const Vec3& orientation,
PhysicalFrame& body) : ModelComponent()
{
setNull();
constructProperties();
_body = &body;
set_body_name(body.getName());
set_location(location);
set_orientation(orientation);
}
示例11: testInfoSet
void rEngine::testInfoSet(unsigned int id)
{
auto infoset = new rProtos::InfoSet();
infoset->set_id(id);
infoset->set_name("RyanBox");
infoset->set_location("Bathroom");
auto ret = mProcessor->createMessage(99);
ret->set_allocated_infoset(infoset);
BOOST_LOG_TRIVIAL(debug) << "Sending info set with id " << id ;
if (convertMessageToVectorData(ret))
mTestClient->Send(mByteData);
}
示例12: cal_model_calendar_set_value_at
static void
cal_model_calendar_set_value_at (ETableModel *etm,
gint col,
gint row,
gconstpointer value)
{
ECalModelComponent *comp_data;
ECalObjModType mod = E_CAL_OBJ_MOD_ALL;
ECalComponent *comp;
ECalModelCalendar *model = (ECalModelCalendar *) etm;
g_return_if_fail (E_IS_CAL_MODEL_CALENDAR (model));
g_return_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST);
g_return_if_fail (row >= 0 && row < e_table_model_row_count (etm));
if (col < E_CAL_MODEL_FIELD_LAST) {
table_model_parent_interface->set_value_at (etm, col, row, value);
return;
}
comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), row);
if (!comp_data)
return;
comp = e_cal_component_new_from_icalcomponent (icalcomponent_new_clone (comp_data->icalcomp));
if (!comp) {
return;
}
/* ask about mod type */
if (e_cal_component_is_instance (comp)) {
if (!e_cal_dialogs_recur_component (comp_data->client, comp, &mod, NULL, FALSE)) {
g_object_unref (comp);
return;
}
}
switch (col) {
case E_CAL_MODEL_CALENDAR_FIELD_DTEND :
set_dtend ((ECalModel *) model, comp_data, value);
break;
case E_CAL_MODEL_CALENDAR_FIELD_LOCATION :
set_location (comp_data, value);
break;
case E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY :
set_transparency (comp_data, value);
break;
}
e_cal_model_modify_component (E_CAL_MODEL (model), comp_data, mod);
g_object_unref (comp);
}
示例13: create
void create()
{
monolith::create();
set_attic_dir("/d/Dark/data/attic");
set_save_dir("/d/Dark/data");
set_save_file("necro_board");
set_location("/d/Dark/Prime/wiz/necro_room");
set ("short.text", "Great Basalt Monolith");
set ("long.text",
"this is a black monolith. You can post on it. For information on how to\n"+
"use it, type \"help monolith\".\n");
set("id",({ "monolith" }));
示例14: meta_remove_all
void file_info::copy(const file_info * src)
{
meta_remove_all();
info_remove_all();
set_location(src->get_location());
set_length(src->get_length());
int n;
for(n=0;n<src->meta_get_count();n++)
meta_add(src->meta_enum_name(n),src->meta_enum_value(n));
for(n=0;n<src->info_get_count();n++)
info_set(src->info_enum_name(n),src->info_enum_value(n));
}
示例15: main
int main(int argc, char *argv[])
{
struct zz_tree tree;
struct zz_node *n1, *n2, *n3, *n4, *n5, *n6;
zz_tree_init(&tree, sizeof(struct node_with_location));
n1 = zz_node(&tree, TOK_FOO, zz_null);
set_location(n1, 1);
n2 = zz_node(&tree, TOK_BAR, zz_int(-314));
set_location(n2, 2);
n3 = zz_node(&tree, TOK_BAZ, zz_uint(314));
set_location(n3, 3);
n4 = zz_node(&tree, TOK_FOO, zz_double(0.5));
set_location(n4, 5);
n5 = zz_node(&tree, TOK_BAR, zz_string("314"));
set_location(n5, 8);
n6 = zz_node(&tree, TOK_BAZ, zz_pointer(&tree));
set_location(n6, 13);
assert(get_location(n1) == 1);
assert(get_location(n2) == 2);
assert(get_location(n3) == 3);
assert(get_location(n4) == 5);
assert(get_location(n5) == 8);
assert(get_location(n6) == 13);
exit(EXIT_SUCCESS);
}