예제 #1
0
void crossing1() {
  GlobalPoint startingPos(-7.79082,-47.6418,9.18163);
  GlobalVector startingDir(-0.553982,-5.09198,1.02212);

  GlobalPoint  pos(-2.95456,-48.2127,3.1033);
  
  double rho = 0.00223254;
  
  Surface::RotationType rot(0.995292,0.0969201,0.000255868,
			    8.57131e-06,0.00255196,-0.999997,
			    -0.0969205,0.995289,0.00253912);
  
  std::cout << rot << std::endl;

  Plane plane(pos,rot);

  HelixBarrelPlaneCrossingByCircle precise(startingPos, startingDir, rho,alongMomentum);
  bool cross; double s;
  std::tie(cross,s) = precise.pathLength(plane);

  HelixBarrelPlaneCrossing2OrderLocal crossing(startingPos, startingDir, rho, plane);


  std::cout << plane.toLocal(GlobalPoint(precise.position(s))) << " " <<  plane.toLocal(GlobalVector(precise.direction(s))) << std::endl;
  std::cout << HelixBarrelPlaneCrossing2OrderLocal::positionOnly(startingPos, startingDir, rho, plane) << ' ';
  std::cout << crossing.position() << ' ' << crossing.direction() << std::endl;

  LocalPoint thePos; LocalVector theDir;
  std::tie(thePos,theDir) = secondOrderAccurate(startingPos, startingDir, rho, plane);

  std::cout << thePos << ' ' << theDir << std::endl;
}
예제 #2
0
void crossing2() {
  GlobalPoint startingPos(-8.12604,-50.829,9.82116);   
  GlobalVector startingDir(-0.517536,-5.09581,1.02212);

  GlobalPoint  pos(-2.96723,-51.4573,14.8322);
  
  Surface::RotationType rot(0.995041,0.0994701,0.000124443,
			    0.000108324,-0.00233467,0.999997,
			    0.0994701,-0.995038,-0.00233387);
  std::cout << rot << std::endl;
  
  Plane plane(pos,rot);
  
  double rho = 0.00223254;
  
  HelixBarrelPlaneCrossingByCircle precise(startingPos, startingDir, rho,alongMomentum);
  bool cross; double s;
  std::tie(cross,s) = precise.pathLength(plane);

  HelixBarrelPlaneCrossing2OrderLocal crossing(startingPos, startingDir, rho, plane);

  std::cout << plane.toLocal(GlobalPoint(precise.position(s))) << " " <<  plane.toLocal(GlobalVector(precise.direction(s))) << std::endl;
  std::cout << HelixBarrelPlaneCrossing2OrderLocal::positionOnly(startingPos, startingDir, rho, plane) << ' ';
  std::cout << crossing.position() << ' ' << crossing.direction() << std::endl;

  LocalPoint thePos; LocalVector theDir;
  std::tie(thePos,theDir) = secondOrderAccurate(startingPos, startingDir, rho, plane);

  std::cout << thePos << ' ' << theDir << std::endl;



}
예제 #3
0
	void SimpleGui::redoLayout() {

		if(!autoLayout) return;
		ofVec2f startingPos(0,0);
		float winHeight = ofGetHeight();
		float guiY = gui->getAbsolutePosition().y;
		ofRectangle r;
		for(int i = 0; i < gui->getNumChildren(); i++) {
			Control *c = gui->getChild(i);
			if(!c->active) continue;
			if(c->type=="column") {
				startingPos.y = 0;
				startingPos.x += SIMPLE_GUI_WIDTH+AUTO_LAYOUT_PADDING;
			} else {
				if(c->type=="simplegui") {
					SimpleGui *s = (SimpleGui*)c;
					s->redoLayout();
					if(startingPos.y>0) startingPos.y -= AUTO_LAYOUT_PADDING/2;
				}
				c->position(startingPos.x, startingPos.y);
				if(guiY+c->y+c->height>winHeight) {
					startingPos.y = 0;
					startingPos.x += SIMPLE_GUI_WIDTH+AUTO_LAYOUT_PADDING;
					c->position(startingPos.x, startingPos.y);
				}


				startingPos.y += c->height + AUTO_LAYOUT_PADDING;
				r.growToInclude(*c);
			}
		}
		width = r.width;
		height = r.height;
	}
예제 #4
0
파일: main.cpp 프로젝트: Sour/Game
void main()
{
	populateBoard();
	startingPos(4, 4);
	gameLoop();
}