• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ set_location函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中set_location函数的典型用法代码示例。如果您正苦于以下问题:C++ set_location函数的具体用法?C++ set_location怎么用?C++ set_location使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了set_location函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:rzr,项目名称:gnome-initial-setup,代码行数:33,代码来源:cc-timezone-map.c


示例3:

void GameScene_02::addBall()
{
    auto ball = Ball::create();
    this->addChild(ball);
    ball->set_location(visibleSize/2);
    balls->pushBack(ball);
}
开发者ID:huajianxing01,项目名称:BreakTheBricks,代码行数:7,代码来源:GameScene_02.cpp


示例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);
}
开发者ID:tlively,项目名称:cs51-final,代码行数:47,代码来源:test.c


示例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_);
		}
	}
}
开发者ID:aelthwin,项目名称:Battle-for-Wesnoth--Zombie-Edition,代码行数:59,代码来源:button.cpp


示例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") ;
}
开发者ID:ClockworkSoul,项目名称:MortalRemains,代码行数:9,代码来源:conf_A.c


示例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");
}
开发者ID:Hobbitron,项目名称:tmi2_fluffos_v3,代码行数:9,代码来源:networkboard.c


示例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();
}
开发者ID:Martin9295,项目名称:wesnoth,代码行数:10,代码来源:palette_manager.cpp


示例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");
}
开发者ID:ClockworkSoul,项目名称:MortalRemains,代码行数:10,代码来源:MS_board.c


示例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);
}
开发者ID:fcanderson,项目名称:opensim-core,代码行数:13,代码来源:ContactGeometry.cpp


示例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);
}
开发者ID:primetime00,项目名称:chromecontroller,代码行数:12,代码来源:rEngine.cpp


示例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);
}
开发者ID:Distrotech,项目名称:evolution,代码行数:53,代码来源:e-cal-model-calendar.c


示例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" }));
开发者ID:ClockworkSoul,项目名称:MortalRemains,代码行数:12,代码来源:necro_board.c


示例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));
}
开发者ID:Annovae,项目名称:desmume,代码行数:12,代码来源:file_info.cpp


示例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);
}
开发者ID:yin-nadie,项目名称:zebu,代码行数:29,代码来源:location.c


示例16: location

	void combo_drag::process(events::pump_info& /*info*/)
	{
		if (drag_ == RETURN)
		{
			SDL_Rect loc = location();
			int x_diff = loc.x - old_location_.x;
			int y_diff = loc.y - old_location_.y;
			const float length = std::sqrt(static_cast<float>(x_diff*x_diff + y_diff*y_diff));

			if (length > RETURN_SPEED)
			{
				loc.x -= static_cast<Sint16>(x_diff*(RETURN_SPEED/length));
				loc.y -= static_cast<Sint16>(y_diff*(RETURN_SPEED/length));
				set_location(loc);
			}
			else
			{
				drag_ = NONE;
				set_location(old_location_);
			}
		}
	}
开发者ID:Martin9295,项目名称:wesnoth,代码行数:22,代码来源:combo_drag.cpp


示例17: cal_model_calendar_fill_component_from_values

static void
cal_model_calendar_fill_component_from_values (ECalModel *model,
					       ECalModelComponent *comp_data,
					       GHashTable *values)
{
	g_return_if_fail (E_IS_CAL_MODEL_CALENDAR (model));
	g_return_if_fail (comp_data != NULL);
	g_return_if_fail (values != NULL);

	set_dtend (model, comp_data, e_cal_model_util_get_value (values, E_CAL_MODEL_CALENDAR_FIELD_DTEND));
	set_location (comp_data, e_cal_model_util_get_value (values, E_CAL_MODEL_CALENDAR_FIELD_LOCATION));
	set_transparency (comp_data, e_cal_model_util_get_value (values, E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY));
}
开发者ID:Distrotech,项目名称:evolution,代码行数:13,代码来源:e-cal-model-calendar.c


示例18: 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){
			label_ = font::make_text_ellipsis(label_, font_size, w, false);
		}
	}

	if (type_ != TYPE_IMAGE){
		textRect_ = font::draw_text(NULL, screen_area(), font_size,
		                            font::BUTTON_COLOUR, 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_);
		}
	}
}
开发者ID:Yossarian,项目名称:WesnothAddonServer,代码行数:50,代码来源:button.cpp


示例19: zoom_window_update

int zoom_window_update(void *closure, int sxn, int syn, int button)
{
    struct zoom_window *zw = closure;

    if (zw->mode == 1) {
	i_prompt_buttons(_("1. corner"), _("2. corner"), _("Quit"));
	zw->next_mode = 2;
    }

    G_debug(2, "button = %d x = %d y = %d", button, sxn, syn);

    if (button == 3)
	return 1;

    if (zw->mode == 2 && button == 2) {
	double x1 = D_d_to_u_col(zw->sxo);
	double y1 = D_d_to_u_row(zw->syo);
	double x2 = D_d_to_u_col(sxn);
	double y2 = D_d_to_u_row(syn);

	G_debug(2, "x1 = %f x2 = %f y1 = %f y2 = %f", x1, x2, y1, y2);

	window.north = y1 > y2 ? y1 : y2;
	window.south = y1 < y2 ? y1 : y2;
	window.west = x1 < x2 ? x1 : x2;
	window.east = x1 > x2 ? x1 : x2;

	G_debug(2, "w = %f e = %f n = %f s = %f", window.west, window.east,
		window.north, window.south);

	G_adjust_Cell_head(&window, 0, 0);
	G_put_window(&window);
	G_set_window(&window);

	display_redraw();

	i_prompt_buttons(_("1. corner"), _("1. corner"), _("Quit"));
	zw->next_mode = 1;
    }

    zw->sxo = sxn;
    zw->syo = syn;
    zw->mode = zw->next_mode;

    set_mode(zw->mode == 2 ? MOUSE_BOX : MOUSE_POINT);
    set_location(zw->sxo, zw->syo);

    return 0;
}
开发者ID:imincik,项目名称:pkg-grass,代码行数:49,代码来源:zoom.c


示例20: set_location

void editor_palette<Item>::adjust_size(const SDL_Rect& target)
{
	palette_x_ = target.x;
	palette_y_ = target.y;
	const int space_for_items = target.h;
	const int items_fitting = (space_for_items / item_space_) * item_width_;
	nitems_ = std::min(items_fitting, nmax_items_);
	if (num_visible_items() != nitems_) {
		buttons_.resize(nitems_, gui::tristate_button(gui_.video(), this));
	}
	set_location(target);
	set_dirty(true);
	gui_.video().clear_help_string(help_handle_);
	help_handle_ = gui_.video().set_help_string(get_help_string());
}
开发者ID:GregoryLundberg,项目名称:wesnoth,代码行数:15,代码来源:editor_palettes.cpp



注:本文中的set_location函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ set_log_level函数代码示例发布时间:2022-05-30
下一篇:
C++ set_listen函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap