Exemplo n.º 1
0
	virtual void generateStyles()
	{
		Style nodeStyle = Style();
		Style nodeStyleDefault = Style();
		nodeStyleDefault.color = Color(1.0f, 0.0f, 0.0f, 1.0f);
		nodeStyleDefault.width = 2.0;
		nodeStyleDefault.icon_image = (getInputDirectory() / "icons/fast-food-24.png").string();
		nodeStyleDefault.icon_width = 24.0;
		nodeStyleDefault.icon_height = 24.0;

		// height and width set
		nodeStyle = nodeStyleDefault;
		styles[CachedString("point_00")] = nodeStyle;
		// width not set
		nodeStyle.icon_width = -1.0;
		styles[CachedString("point_01")] = nodeStyle;
		// width and height not set
		nodeStyle.icon_height = -1.0;
		styles[CachedString("point_02")] = nodeStyle;
		// height not set
		nodeStyle = nodeStyleDefault;
		nodeStyle.icon_height = -1.0;
		styles[CachedString("point_10")] = nodeStyle;
		// width zero
		nodeStyle = nodeStyleDefault;
		nodeStyle.icon_width = 0.0;
		styles[CachedString("point_11")] = nodeStyle;
		// height zero
		nodeStyle = nodeStyleDefault;
		nodeStyle.icon_height = 0.0;
		styles[CachedString("point_12")] = nodeStyle;
		// different size
		nodeStyle = nodeStyleDefault;
		nodeStyle.icon_width = 32.0;
		nodeStyle.icon_height = 24.0;
		styles[CachedString("point_20")] = nodeStyle;
		// different icons
		nodeStyle = nodeStyleDefault;
		nodeStyleDefault.icon_image = (getInputDirectory() / "icons/beer-24.png").string();
		styles[CachedString("point_21")] = nodeStyle;
		nodeStyle = nodeStyleDefault;
		nodeStyleDefault.icon_image = (getInputDirectory() / "icons/airport-24.png").string();
		styles[CachedString("point_22")] = nodeStyle;
	}
Exemplo n.º 2
0
	/**
	 * \param input path to the geodata file that is used as source.
	 */
	feature_test(const char* input)
	{
		path testData = getInputDirectory() / input;
		BOOST_TEST_MESSAGE("Loading data: " << testData.string());
		BOOST_CHECK(boost::filesystem::exists(testData));

		data = boost::make_shared<Geodata>();
		data->load(testData.string());
		renderer = boost::make_shared<Renderer>(data);
	}
Exemplo n.º 3
0
	// setup
	test_requestManage()
	{
		DefaultConfig = TestConfig::Create()
		->add<int>(opt::server::max_queue_size, 1)
		->add<int>(opt::server::prerender_level, 0)
		->add<string>(opt::server::path_to_geodata, 	(getInputDirectory() / "karlsruhe_big.carte").string());

		Statistic::Init(DefaultConfig);
		
		shared_ptr<Geodata> geodata = boost::make_shared<Geodata>();
		BOOST_CHECK(boost::filesystem::exists(DefaultConfig->get<string>(opt::server::path_to_geodata)));
		geodata->load(DefaultConfig->get<string>(opt::server::path_to_geodata));
		cache = boost::make_shared<Cache>(DefaultConfig);
		ssm = boost::make_shared<StylesheetManager>(DefaultConfig);
		shared_ptr<Renderer> renderer = boost::make_shared<Renderer>(geodata);
		req_manager = boost::make_shared<RequestManager>(DefaultConfig, geodata, renderer, cache, ssm);
		server = boost::make_shared<HttpServer>(DefaultConfig, req_manager);
		ssm->startStylesheetObserving(req_manager);
		boost::this_thread::sleep(boost::posix_time::milliseconds(2000));
	}