コード例 #1
0
ファイル: mime_type_handler.cpp プロジェクト: K-3D/k3d
	k3d::bool_t test_type(const k3d::string_t& TestToken, const k3d::string_t& TestType, const k3d::string_t& Data, k3d::string_t& DataType)
	{
		if(Data.substr(0, TestToken.size()) != TestToken)
			return false;

		DataType = TestType;

		k3d::log() << info << "Identified data as " << DataType << " using " << get_factory().name() << std::endl;
		return true;
	}
コード例 #2
0
ファイル: bitmap_importer.cpp プロジェクト: K-3D/k3d
	bool read_file(const k3d::filesystem::path& Path, k3d::bitmap& Bitmap)
	{
		try
		{
			k3d::log() << info << "Reading " << Path.native_console_string() << " using " << get_factory().name() << std::endl;
			boost::gil::read_and_convert_image(Path.native_filesystem_string(), Bitmap, boost::gil::jpeg_tag());
			return true;
		}
		catch(std::exception& e)
		{
			k3d::log() << error << k3d_file_reference << ": caught exception: " << e.what() << std::endl;
			return false;
		}
		catch(...)
		{
			k3d::log() << error << k3d_file_reference << ": caught unknown exception" << std::endl;
			return false;
		}
	}
コード例 #3
0
ファイル: bridge.hpp プロジェクト: haueck/ros1_bridge
Bridge2to1Handles
create_bridge_from_2_to_1(
  rclcpp::node::Node::SharedPtr ros2_node,
  ros::NodeHandle ros1_node,
  const std::string & ros2_type_name,
  const std::string & ros2_topic_name,
  size_t subscriber_queue_size,
  const std::string & ros1_type_name,
  const std::string & ros1_topic_name,
  size_t publisher_queue_size)
{
  auto factory = get_factory(ros1_type_name, ros2_type_name);
  auto ros1_pub = factory->create_ros1_publisher(
    ros1_node, ros1_topic_name, publisher_queue_size);

  auto ros2_sub = factory->create_ros2_subscriber(
    ros2_node, ros2_topic_name, subscriber_queue_size, ros1_pub);

  Bridge2to1Handles handles;
  handles.ros2_subscriber = ros2_sub;
  handles.ros1_publisher = ros1_pub;
  return handles;
}
コード例 #4
0
ファイル: sun_light.cpp プロジェクト: AwesomeDoesIt/k3d
	k3d::iplugin_factory& factory()
	{
		return get_factory();
	}
コード例 #5
0
ファイル: panel.cpp プロジェクト: AwesomeDoesIt/k3d
	const k3d::string_t panel_type()
	{
		return get_factory().name();
	}
コード例 #6
0
ファイル: mime_type_handler.cpp プロジェクト: K-3D/k3d
	const k3d::bool_t test_type(const k3d::string_t& TestExtension, const k3d::string_t& TestType, const k3d::filesystem::path& File, k3d::string_t& FileType)
	{
		if(TestExtension != k3d::filesystem::extension(File).lowercase().raw())
			return false;

		FileType = TestType;

		k3d::log() << info << "Identified " << File.native_console_string() << " as " << FileType << " using " << get_factory().name() << std::endl;
		return true;
	}