Exemplo n.º 1
0
int main()
{

    std::vector<std::string> words, phrases;
    //words.push_back(" ");
    words.push_back("testing");
    words.push_back("a few things");
    words.push_back("see if they work");
    words.push_back("good");
    //phrases.push_back(" ");
    phrases.push_back("another set");
    phrases.push_back("of words");
    std::vector<std::string> framed, horizontal, vertical;
/*    
    framed = frame(words);
    horizontal = hcat(framed, phrases);
    vertical = vcat(framed, phrases);
    for(const auto &ref:framed)
	std::cout << ref << std::endl;
    std::cout << std::endl;
    for(const auto &ref:horizontal)
	std::cout << ref << std::endl;
    std::cout << std::endl;
    for(const auto &ref:vertical)
	std::cout << ref << std::endl;
*/
    horizontal = hcat(words,phrases);
    for(const auto &ref:horizontal)
	std::cout << ref << std::endl;
}
Exemplo n.º 2
0
int main()
{
    std::vector<std::string> vec;
    vec.push_back("This sentence");
    vec.push_back("So will this");
    vec.push_back("And this");
    vec.push_back("This too");
    Picture p = vec;
    Picture q = frame(p);
    reframe(q, '*', '*', '*');
    Picture r = hcat(p, q);
    Picture s = vcat(q, r);
    std::cout << r << std::endl;
    std::cout << "\n\n\n\n\n\n\n\n\n" << std::endl;
    std::cout << frame(hcat(s, vcat(r, q))) << std::endl;
}
Exemplo n.º 3
0
int main(){

    std::vector<std::string> pic1;
    pic1.push_back("Some tests with");
    pic1.push_back("this framing suite");
    pic1.push_back("we are building as");
    pic1.push_back("an exercise");
    pic1 = frame(pic1);

    std::vector<std::string> pic2;
    pic2.push_back("haha man I");
    pic2.push_back("enjoy coding");
    pic2.push_back("quite a lot!");
    pic2 = frame(pic2);

    std::cout << std::endl;
    std::cout << "Picture 1:" << std::endl;
    std::cout << std::endl;
    printPic(pic1);
    std::cout << std::endl;
    std::cout << "Picture 2:" << std::endl;
    std::cout << std::endl;
    printPic(pic2);
    std::cout << std::endl;
    std::cout << "Vertical concatenation:" << std::endl;
    std::cout << std::endl;
    printPic(vcat(pic1,pic2));
    std::cout << std::endl;
    std::cout << "Horizontal concatenation:" << std::endl;
    std::cout << std::endl;
    printPic(hcat(pic1,pic2));
    std::cout << std::endl;

    return 0;
}
Exemplo n.º 4
0
bool RobotBrainServiceService::start(int argc, char* argv[])
{
  char adapterStr[255];

  //Create the adapter
  int port = RobotBrainObjects::RobotBrainPort;
  bool connected = false;

  while(!connected)
    {
      try
        {
          LINFO("Trying Port:%d", port);
          sprintf(adapterStr, "default -p %i", port);
          itsAdapter = communicator()->createObjectAdapterWithEndpoints("SeaBee3SimulatorAdapter",
                                                                        adapterStr);
          connected = true;
        }
      catch(Ice::SocketException)
        {
          port++;
        }
    }

  //Create the manager and its objects
  itsMgr = new ModelManager("SeaBee3SimulatorServiceManager");

  nub::ref<OutputFrameSeries> ofs(new OutputFrameSeries(*itsMgr));
  itsMgr->addSubComponent(ofs);


  LINFO("Starting SeaBee3 Simulator");
  nub::ref<SeaBee3Simulator> subSim(new SeaBee3Simulator(*itsMgr, "SeaBee3Simulator", "SeaBee3Simulator"));
  itsMgr->addSubComponent(subSim);
  subSim->init(communicator(), itsAdapter);

  itsMgr->parseCommandLine((const int)argc, (const char**)argv, "", 0, 0);

  itsAdapter->activate();

  itsMgr->start();

  while(1){
    Layout<PixRGB<byte> > outDisp;

    subSim->simLoop();
    Image<PixRGB<byte> > forwardCam = flipVertic(subSim->getFrame(1));
    Image<PixRGB<byte> > downwardCam = flipVertic(subSim->getFrame(2));

    outDisp = vcat(outDisp, hcat(forwardCam, downwardCam));

    ofs->writeRgbLayout(outDisp, "subSim", FrameInfo("subSim", SRC_POS));

    handle_keys(ofs, subSim);
  }


  return true;
}
Exemplo n.º 5
0
int main()
{
	std::vector<std::string> test;
	std::string s;

	while(std::getline(std::cin,s))
	{
		test.push_back(s);
	}

	std::vector<std::string> result = vcat(hcat(test,frame(test)),hcat(frame(test),test));

	for(std::vector<std::string>::const_iterator i=result.begin(),e=result.end();i!=e;++i)
	{
		std::cout << *i << std::endl;
	}

	return 0;
}