当前位置: 首页>>代码示例>>C++>>正文


C++ GLText::leaveTextInputMode方法代码示例

本文整理汇总了C++中GLText::leaveTextInputMode方法的典型用法代码示例。如果您正苦于以下问题:C++ GLText::leaveTextInputMode方法的具体用法?C++ GLText::leaveTextInputMode怎么用?C++ GLText::leaveTextInputMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GLText的用法示例。


在下文中一共展示了GLText::leaveTextInputMode方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: drawInfo

void drawInfo()
{
	if ( visibleInfo )
	{
		GLText text;	
		text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_12);
		text.enterTextInputMode();
		text.draw("####### SUBJECT #######");
		text.draw("#");
		text.draw("# Name: " +parameters.find("SubjectName"));
		text.draw("# IOD: " +stringify<double>(interoculardistance));
		text.draw("#");
		text.draw("# trial: " +stringify<double>(trialNumber));
		text.draw("#");
		text.draw("#######################");
		
		text.draw(" ");
		text.draw(" ");
		text.draw("Press ENTER to start.");

		text.leaveTextInputMode();
	}

	if ( expFinished )
	{
		GLText text2;	
		text2.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_12);
		text2.enterTextInputMode();
		text2.draw("The experiment is finished.");
		text2.leaveTextInputMode();
	}

}
开发者ID:guendas,项目名称:cncsvision,代码行数:33,代码来源:spring15-armlength-adj.cpp

示例2: drawInfo

void drawInfo()
{
	if ( headCalibrationDone!=3 )
	{
    GLText text;
    text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite, GLUT_BITMAP_HELVETICA_18);
    text.enterTextInputMode();
    if ( passiveMode )
    text.draw( "Passive"  );
    else
    text.draw(" Active " );
    if ( orthographicMode )
    text.draw(" Ortho " );
    else
    text.draw( "Perspective " );
    
    string row1 = stringify< Eigen::Matrix<double,1,4> >( objectPassiveTransformation.matrix().row(0) );
    string row2 = stringify< Eigen::Matrix<double,1,4> >( objectPassiveTransformation.matrix().row(1) );
    string row3 = stringify< Eigen::Matrix<double,1,4> >( objectPassiveTransformation.matrix().row(2) );
    
    text.draw( row1 );
    text.draw( row2 );
    text.draw( row3 );
    text.draw( stringify<int> (factors["Rotation"]) );
	text.draw( stringify< Eigen::Vector3d >(projPointEyeRight) );
    text.draw( stringify<int>(instantPlaneSlant));
	text.leaveTextInputMode();
	}
}
开发者ID:guendas,项目名称:cncsvision,代码行数:29,代码来源:expGiovanniRotationYawPassive.cpp

示例3: drawStimulus

void drawStimulus()
{
	if (fingerCalibrationDone==3 && checkHandAtStart && isStimulusDrawn)
	{
	
	glLoadIdentity();

	// ###### draw rotated stimulus (adjusted) ######
	glTranslated(0.0,0,trial.getCurrent().first["AbsDepth"] + jitter);

	firstD = trial.getCurrent().second->getCurrentStaircase()->getState();

	if( !allVisibleFingers && !moveToPartIV)
		drawNoFingers();
	
	if(fingersShown)
		drawFingers();

	if(!pause)
	{
	
		if(part == 1 && started)
		{
			drawLetter(condition); // draw L or P
			if(moveToPartII)
				part += 1;
		} else if (part == 2)
		{
			drawCross();
			if(moveToPartIII)
				part += 1;
		} else if (part == 3)
		{
			drawTrial(firstD); // draw first triple of rods
			if(moveToPartIV)
				part += 1;
		} else if (part == 4)
		{
			drawBlack();
		}
	} else 
	{
		GLText text;	
		text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glRed,GLUT_BITMAP_TIMES_ROMAN_24);
		text.enterTextInputMode();
		for(int i=0;i<13;i++)
		text.draw("");
		text.draw("                                                           BREAK");
		text.leaveTextInputMode();
		timer.stop();
	}
		

	glLoadIdentity();

	}
}
开发者ID:guendas,项目名称:cncsvision,代码行数:57,代码来源:fall13-staircasePointing.cpp

示例4: drawCross

void drawCross()
{
	GLText text;	
	text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glRed,GLUT_BITMAP_TIMES_ROMAN_24);
	text.enterTextInputMode();
	for(int i=0;i<13;i++)
		text.draw("");
	text.draw("                                                             +");
	text.leaveTextInputMode();
}
开发者ID:guendas,项目名称:cncsvision,代码行数:10,代码来源:fall13-staircasePointing.cpp

示例5: drawLetter

void drawLetter(int letter)
{
	if (letter <= 0) // vision (L)
	{
		GLText text;	
		text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glRed,GLUT_BITMAP_TIMES_ROMAN_24);
		text.enterTextInputMode();
		for(int i=0;i<13;i++)
			text.draw("");    
		text.draw("                                                             L");
		text.leaveTextInputMode();
	} else // pointing
	{
		GLText text;	
		text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glRed,GLUT_BITMAP_TIMES_ROMAN_24);
		text.enterTextInputMode();
		for(int i=0;i<13;i++)
			text.draw("");
		text.draw("                                                             P");
		text.leaveTextInputMode();
	}
}
开发者ID:guendas,项目名称:cncsvision,代码行数:22,代码来源:fall13-staircasePointing.cpp

示例6: drawInfo

void drawInfo()
{
	glDisable(GL_COLOR_MATERIAL);
	glDisable(GL_BLEND);
	glDisable(GL_LIGHTING);

	GLText text;

	text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_18);

//	text.init(640,480,glWhite,GLUT_BITMAP_HELVETICA_12);

	text.enterTextInputMode();

	glColor3fv(glWhite);
	text.draw("# stim height: ");// +stringify<double>(stimulus_height));

	text.leaveTextInputMode();
}
开发者ID:guendas,项目名称:cncsvision,代码行数:19,代码来源:testBrown2.cpp

示例7: drawInfo

void drawInfo()
{
    if ( !infoDrawn )
        return;
    GLText text;
    text.init(SCREEN_WIDTH, SCREEN_HEIGHT,glWhite);
    text.enterTextInputMode();
    string strfactors;
    for ( map<string,double>::iterator iter = factors.begin(); iter!=factors.end(); ++iter)
    {
        text.draw( (iter->first) + "= " + util::stringify<int>( (int )(iter->second)) );
    }
    switch ( headCalibrationDone )
    {
    case 0:
    {
        if ( allVisibleHead )
            text.draw("OK! Press SPACEBAR");
        else
            text.draw("---");
    }
    break;
    case 1:
    case 2:
    {
        text.draw( "EL " + stringify<int>(eyeLeft.x() ) + " " + stringify<int>(eyeLeft.y() ) + " " + stringify<int>(eyeLeft.z()) );
        text.draw( "ER " + stringify<int>(eyeRight.x() ) + " " + stringify<int>(eyeRight.y() ) + " " + stringify<int>(eyeRight.z()) );
        text.draw("EC " + stringify<int>(cyclopeanEye.x())+" " + stringify<int>(cyclopeanEye.y())+" " + stringify<int>(cyclopeanEye.z()));
        text.draw("Dist " + stringify<int>(cyclopeanEye.z()-focalDistance+60.0));
        text.draw(" ");
        text.draw( "PITCH " + stringify<int>(toDegrees(headEyeCoords.getPitch())));
        text.draw( "YAW " + stringify<int>(toDegrees(headEyeCoords.getYaw())));
        text.draw( "ROLL " + stringify<int>(toDegrees(headEyeCoords.getRoll())));
    }
    break;
    }
    text.leaveTextInputMode();
}
开发者ID:guendas,项目名称:cncsvision,代码行数:38,代码来源:expDprimeTMSoverMT.cpp

示例8: drawInfo

void drawInfo()
{
	GLText text;	
	text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_12);
	text.enterTextInputMode();

	text.draw("-----------LINEAR ACTUATORS-----------");
	text.draw("Press 7 to toggle motors");
	text.draw("Motor: " + stringify<int>(which_axis%2));		
	text.draw(" ");
	text.draw("Press w to increase desired position, or s to decrease desired position");
	text.draw("Then press 8 to move");
	text.draw(" ");
	text.draw("desired position = " + stringify<double>(phi_distance));
	text.draw(" ");
	text.draw("-----------STEPPER-----------");
	text.draw("Press q to increase desired theta, or a to decrease desired theta");
	text.draw("Then press 5 to move");
	text.draw(" ");
	text.draw("desired theta = " + stringify<double>(step_theta));
	text.draw(" ");

	text.leaveTextInputMode();
}
开发者ID:guendas,项目名称:cncsvision,代码行数:24,代码来源:testspring15-phidgets2.cpp

示例9: drawInfo

/*** INFO ***/
void drawInfo()
{
	if ( visibleInfo )
	{
		GLText text;	
		text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_12);
		text.enterTextInputMode();

		glColor3fv(glWhite);
		if(experiment)
			text.draw("####### SUBJECT #######");
		if(training)
			text.draw("####### THIS IS JUST A TRAINING #######");
		text.draw("#");
		text.draw("# Name: " +parameters.find("SubjectName"));
		text.draw("# IOD: " +stringify<double>(interoculardistance));
		text.draw("#");
		text.draw("# trial: " +stringify<double>(trialNumber));
		text.draw("#");
		text.draw("#######################\n\n");
		text.draw(" ");

		// check if mirror is calibrated
		if ( abs(mirrorAlignment - 45.0) < 0.2 )
			glColor3fv(glGreen);
		else
			glColor3fv(glRed);
		text.draw("# Mirror Alignment = " +stringify<double>(mirrorAlignment));

		// check if monitor is calibrated
		if ( screenAlignmentY < 89.0 )
			glColor3fv(glRed);
		else
			glColor3fv(glGreen);
		text.draw("# Screen Alignment Y = " +stringify<double>(screenAlignmentY));

		if ( abs(screenAlignmentZ) < 89.4 )
			glColor3fv(glRed);
		else
			glColor3fv(glGreen);
		text.draw("# Screen Alignment Z = " +stringify<double>(screenAlignmentZ));

		glColor3fv(glWhite);
		// X and Z coords of simulated fixation
		text.draw("# Fixation Z = " +stringify<double>(markers.at(screen1).p.x()-120.0)+ " [mm]");
		text.draw("# Fixation X = " +stringify<double>(markers.at(screen1).p.z()+363.0)+ " [mm]");
		text.draw(" ");

		glColor3fv(glWhite); 
		text.draw(" " );
		text.draw("time: " +stringify<int>(timer.getElapsedTimeInMilliSec()));
		text.draw("experiment = " +stringify<int> (experiment));
		text.draw("training = " +stringify<int> (training));
		text.draw("isTrialDone = " +stringify<int> (isTrialDone));
		text.draw("stimulus = " +stringify<int> (stimulus));

		text.leaveTextInputMode();
	}

	if ( expFinished )
	{
		GLText text2;	
		text2.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_12);
		text2.enterTextInputMode();
		text2.draw("The experiment is finished.");
		text2.leaveTextInputMode();
	}
}
开发者ID:guendas,项目名称:cncsvision,代码行数:69,代码来源:summer15-disparity_motionMono_3rods_perceptual.cpp

示例10: drawInfo


//.........这里部分代码省略.........
			text.draw("Press F to record position of right object (use straw).");
		}
		if ( objectsForward && (startPosCalibration==4) && (fingerCalibrationDone==2) && allVisibleFingers) 
		{
			text.draw("Press F to begin!");
		}
		text.draw("#########################################");
		text.draw(" ");

		text.draw("####### SUBJECT #######");
		text.draw("#");
		text.draw("# Name: " +parameters.find("SubjectName"));
		text.draw("#");
		text.draw("# Trial: " +stringify<int>(trialNumber));
		text.draw("#");
		text.draw("#######################");
		text.draw("StartPosCalibration = " + stringify<int>(startPosCalibration) );
		text.draw("FingerCalibration = " + stringify<int>(fingerCalibrationDone) );
		text.draw(" ");
        
		text.draw("Calibration Platform Markers" );
		if ( isVisible(markers[15].p) )
			glColor3fv(glGreen);
		else
			glColor3fv(glRed);
		text.draw("Thumb Calibration Point (15) "+stringify< Eigen::Matrix<double,1,3> >(markers[15].p.transpose())+ " [mm]" );

		if ( isVisible(markers[16].p) )
			glColor3fv(glGreen);
		else
			glColor3fv(glRed);
		text.draw("Index Calibration Point (16) "+stringify< Eigen::Matrix<double,1,3> >(markers[16].p.transpose())+ " [mm]" );

		if ( isVisible(markers[10].p) )
			glColor3fv(glGreen);
		else
			glColor3fv(glRed);
		text.draw("Straw Marker (10) "+stringify< Eigen::Matrix<double,1,3> >(markers[10].p.transpose())+ " [mm]" );

		glColor3fv(glWhite);
		text.draw(" ");
		text.draw("Thumb" );
		if ( isVisible(markers[20].p) && isVisible(markers[21].p) && isVisible(markers[22].p) )
			glColor3fv(glGreen);
		else
			glColor3fv(glRed);
		text.draw("Marker "+ stringify<int>(20)+stringify< Eigen::Matrix<double,1,3> > (markers[20].p.transpose())+ " [mm]" );
		text.draw("Marker "+ stringify<int>(21)+stringify< Eigen::Matrix<double,1,3> > (markers[21].p.transpose())+ " [mm]" );
		text.draw("Marker "+ stringify<int>(22)+stringify< Eigen::Matrix<double,1,3> > (markers[22].p.transpose())+ " [mm]" );

		glColor3fv(glWhite);
		text.draw(" ");
		text.draw("Index" );
		if ( isVisible(markers[19].p) && isVisible(markers[23].p) && isVisible(markers[24].p) )
			glColor3fv(glGreen);
		else
			glColor3fv(glRed);
		text.draw("Marker "+ stringify<int>(11)+stringify< Eigen::Matrix<double,1,3> > (markers[19].p.transpose())+ " [mm]" );
		text.draw("Marker "+ stringify<int>(12)+stringify< Eigen::Matrix<double,1,3> > (markers[23].p.transpose())+ " [mm]" );
		text.draw("Marker "+ stringify<int>(13)+stringify< Eigen::Matrix<double,1,3> > (markers[24].p.transpose())+ " [mm]" );

		glColor3fv(glGreen);
        text.draw(" ");
		text.draw("Index= " +stringify< Eigen::Matrix<double,1,3> >(index.transpose()));
		text.draw("Thumb= " +stringify< Eigen::Matrix<double,1,3> >(thumb.transpose()));
        text.draw(" ");
		text.draw("Trial= " + stringify<int>(trialNumber));
		text.draw("Frame= " + stringify<double>(frameNumber));
        text.draw("Timer= " + stringify<int>(timer.getElapsedTimeInMilliSec()) );
        text.draw(" ");
		
		text.draw("Target Object : " + stringify<int>(currentObj));
		if (handAtStart)
		{
			glColor3fv(glGreen);
			text.draw("Hand at start.");
		}
		else
		{
			glColor3fv(glWhite);
			text.draw("Hand in flight.");
		}

		text.draw(" ");

		
		if(reachedObject)
		{
            glColor3fv(glGreen);
			text.draw("Object Reached!");
		}
		else
		{
			glColor3fv(glRed);
			text.draw("Distance to object= " + stringify<double>(grip_distanceToTarget));
		}

		text.leaveTextInputMode();
    }
}
开发者ID:guendas,项目名称:cncsvision,代码行数:101,代码来源:summer14-platoGraspRovereto.cpp

示例11: drawInfo


//.........这里部分代码省略.........
			if ( allVisiblePlatform3 )
				glColor3fv(glGreen);
			else
				glColor3fv(glRed);
			text.draw("Platform Three "
				+stringify< Eigen::Matrix<double,1,3> > (markers[8].p.transpose())+ " [mm]\n"
				+stringify< Eigen::Matrix<double,1,3> > (markers[11].p.transpose())+ " [mm]\n"
				+stringify< Eigen::Matrix<double,1,3> > (markers[12].p.transpose())+ " [mm]" );
			if ( isVisible(markers[1].p) )
				glColor3fv(glGreen);
			else
				glColor3fv(glRed);
			text.draw("Index Marker " + stringify<int>(1)
				+stringify< Eigen::Matrix<double,1,3> > (markers[1].p.transpose())+ " [mm]" );
			if ( isVisible(markers[2].p) )
				glColor3fv(glGreen);
			else
				glColor3fv(glRed);
			text.draw("Thumb Marker " + stringify<int>(2)
				+stringify< Eigen::Matrix<double,1,3> > (markers[2].p.transpose())+ " [mm]" );
			
            /////// Only displayed during calibration ////////
            glColor3fv(glWhite);
			if (fingerCalibration!=7){

				glColor3fv(glWhite);
				text.draw(" " );
				text.draw("Index" );
				if ( isVisible(markers[13].p) && isVisible(markers[14].p) && isVisible(markers[16].p) )
					glColor3fv(glGreen);
				else
					glColor3fv(glRed);
				text.draw("Marker " + stringify<int>(13)
					+stringify< Eigen::Matrix<double,1,3> > (markers[13].p.transpose())+ " [mm]" );
				text.draw("Marker " + stringify<int>(14)
					+stringify< Eigen::Matrix<double,1,3> > (markers[14].p.transpose())+ " [mm]" );
				text.draw("Marker " + stringify<int>(16)
					+stringify< Eigen::Matrix<double,1,3> > (markers[16].p.transpose())+ " [mm]" );

				glColor3fv(glWhite);
				text.draw(" " );
				text.draw("Thumb" );
				if ( isVisible(markers[15].p) && isVisible(markers[17].p) && isVisible(markers[18].p) )
					glColor3fv(glGreen);
				else
					glColor3fv(glRed);
				text.draw("Marker " + stringify<int>(15)
					+stringify< Eigen::Matrix<double,1,3> > (markers[15].p.transpose())+ " [mm]" );
				text.draw("Marker " + stringify<int>(17)
					+stringify< Eigen::Matrix<double,1,3> > (markers[17].p.transpose())+ " [mm]" );
				text.draw("Marker " + stringify<int>(18)
					+stringify< Eigen::Matrix<double,1,3> > (markers[18].p.transpose())+ " [mm]" );
			}
            
            /////// Index and Thumb Positions ////////
			glColor3fv(glWhite);
			text.draw("--------------------");
			if (allVisibleIndex)
				glColor3fv(glGreen);
			else
				glColor3fv(glRed);
			text.draw("Index= " +stringify< Eigen::Matrix<double,1,3> >(index.transpose()));
			if (allVisibleThumb)
				glColor3fv(glGreen);
			else
				glColor3fv(glRed);
			text.draw("Thumb= " +stringify< Eigen::Matrix<double,1,3> >(thumb.transpose()));
			glColor3fv(glWhite);
			text.draw("--------------------");
            
            /////// Extra Info ////////
			glColor3fv(glGreen);
			text.draw("Timer= " + stringify<int>(timer.getElapsedTimeInMilliSec()) );
			text.draw("Frame= " + stringify<int>(frameN));
			glColor3fv(glWhite);
			text.draw("--------------------");
			glColor3fv(glGreen);
			text.draw("Distance To Object = " + stringify<double>(distanceGripCenterToObject));
			text.draw("Distance To Start = " + stringify<double>(distanceGripCenterToHome));
			//text.draw("Object Size Check = " + stringify<double>(distanceBetweenSurfaces));
			glColor3fv(glWhite);
			if(handAtStart){
				text.draw("Hand is in starting position.");
			}
			if(started){
				text.draw("Grasp in progress...");
			}
			if(reachedObject){
				text.draw("Object reached!");
			}
            if (training){
                text.draw("TRAINING MODE");
            }
		}
		text.leaveTextInputMode();
		glEnable(GL_COLOR_MATERIAL);
		glEnable(GL_BLEND);
		glEnable(GL_LIGHTING);
	}
}
开发者ID:guendas,项目名称:cncsvision,代码行数:101,代码来源:summer15-evan-moreIllusions.cpp

示例12: drawInfo


//.........这里部分代码省略.........
	text.draw("#######################");
	text.draw("HeadCalibration= " + stringify<int>(headCalibrationDone) );
	text.draw("FingerCalibration= " + stringify<int>(fingerCalibrationDone) );

	glColor3fv(glWhite);
	text.draw("Calibration Platform" );

	if ( isVisible(markers[1].p) && isVisible(markers[2].p) )
		glColor3fv(glGreen);
	else
		glColor3fv(glRed);
	text.draw("Marker "+ stringify<int>(1)+stringify< Eigen::Matrix<double,1,3> > (markers[1].p.transpose())+ " [mm]" );
	text.draw("Marker "+ stringify<int>(2)+stringify< Eigen::Matrix<double,1,3> > (markers[2].p.transpose())+ " [mm]" );
	text.draw("Marker "+ stringify<int>(4)+stringify< Eigen::Matrix<double,1,3> > (markers[4].p.transpose())+ " [mm]" );
	
	glColor3fv(glWhite);
	text.draw("Marker "+ stringify<int>(3)+stringify< Eigen::Matrix<double,1,3> > (markers[3].p.transpose())+ " [mm]" );

	glColor3fv(glWhite);
	text.draw(" " );
	text.draw("Mirror" );

	if ( isVisible(markers[5].p) && isVisible(markers[6].p) && isVisible(markers[7].p) )
		glColor3fv(glGreen);
	else
		glColor3fv(glRed);
	text.draw("Marker "+ stringify<int>(5)+stringify< Eigen::Matrix<double,1,3> > (markers[5].p.transpose())+ " [mm]" );
	text.draw("Marker "+ stringify<int>(6)+stringify< Eigen::Matrix<double,1,3> > (markers[6].p.transpose())+ " [mm]" );
	text.draw("Marker "+ stringify<int>(7)+stringify< Eigen::Matrix<double,1,3> > (markers[7].p.transpose())+ " [mm]" );
	text.draw("Marker "+ stringify<int>(8)+stringify< Eigen::Matrix<double,1,3> > (markers[8].p.transpose())+ " [mm]" );

	glColor3fv(glWhite);
	text.draw(" " );
	text.draw("Index" );

	if ( isVisible(markers[13].p) && isVisible(markers[14].p) && isVisible(markers[16].p) )
		glColor3fv(glGreen);
	else
		glColor3fv(glRed);
	text.draw("Marker "+ stringify<int>(13)+stringify< Eigen::Matrix<double,1,3> > (markers[13].p.transpose())+ " [mm]" );
	text.draw("Marker "+ stringify<int>(14)+stringify< Eigen::Matrix<double,1,3> > (markers[14].p.transpose())+ " [mm]" );
	text.draw("Marker "+ stringify<int>(16)+stringify< Eigen::Matrix<double,1,3> > (markers[16].p.transpose())+ " [mm]" );

	glColor3fv(glWhite);
	text.draw(" " );
	text.draw("Thumb" );

	if ( isVisible(markers[15].p) && isVisible(markers[17].p) && isVisible(markers[18].p) )
		glColor3fv(glGreen);
	else
		glColor3fv(glRed);
	text.draw("Marker "+ stringify<int>(15)+stringify< Eigen::Matrix<double,1,3> > (markers[15].p.transpose())+ " [mm]" );
	text.draw("Marker "+ stringify<int>(17)+stringify< Eigen::Matrix<double,1,3> > (markers[17].p.transpose())+ " [mm]" );
	text.draw("Marker "+ stringify<int>(18)+stringify< Eigen::Matrix<double,1,3> > (markers[18].p.transpose())+ " [mm]" );

	glColor3fv(glWhite);

	text.draw("Alignment(X,Y)= " +stringify<double>(alignmentX)+","+stringify<double>(alignmentY));
	text.draw("Index= " +stringify< Eigen::Matrix<double,1,3> >(index.transpose()));
	text.draw("Thumb= " +stringify< Eigen::Matrix<double,1,3> >(thumb.transpose()));
	text.draw("Timer= " + stringify<int>(timer.getElapsedTimeInMilliSec()) );
	text.draw("Frame= " + stringify<int>(frameN));
	text.draw("Training= " + stringify<int>(training));
	glColor3fv(glRed);
	text.draw("CurSize= " + stringify<int>(trial[round].getCurrent()["Size"]));	
	text.leaveTextInputMode();
	}else
	{

	glDisable(GL_COLOR_MATERIAL);
	glDisable(GL_BLEND);
	glDisable(GL_LIGHTING);
	GLText text1;

	if ( gameMode )
		text1.init(SCREEN_WIDTH,SCREEN_HEIGHT,glBlue,GLUT_BITMAP_HELVETICA_18);
	else
		text1.init(640,480,glBlue,GLUT_BITMAP_HELVETICA_12);
	text1.enterTextInputMode();

	text1.draw("                                                                                                                                                                                   Round= " + stringify<int>(round));
	text1.draw("  ");
	text1.draw("                                                                                                                                                                                   #-NOW-#");

	if(training)
		text1.draw("                                                                                                                                                                                   Training");
	else
		text1.draw("                                                                                                                                                                                   Catch");
	text1.draw("                                                                                                                                                                                   Trial= " + stringify<int>(trialNumber));

	text1.draw("                                                                                                                                                                                   SizeNow= " + stringify<int>(sizeNow));
	text1.draw("  ");
	text1.draw("                                                                                                                                                                                   #-NEXT-#");
	glColor3fv(glRed);
	text1.draw("                                                                                                                                                                                   SizeNext= " + stringify<int>(sizeNext));


	text1.leaveTextInputMode();
	}
}
开发者ID:guendas,项目名称:cncsvision,代码行数:101,代码来源:spring14-weight.cpp

示例13: drawInfo

/**
 * @brief drawInfo
 */
void drawInfo()
{   if ( infoDraw )
    {   glDisable(GL_COLOR_MATERIAL);
        glDisable(GL_BLEND);
        glDisable(GL_LIGHTING);
        GLText text;
        if ( gameMode )
            text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_18);
        else
            text.init(640,480,glWhite,GLUT_BITMAP_HELVETICA_12);
        text.enterTextInputMode();
        text.draw("Marker5= " + stringify<Eigen::Matrix<double,1,3> >(markers.at(5).p.transpose()) );
        switch ( headCalibrationDone )
        {
        case 0:
        {   if ( allVisibleHead )
                text.draw("==== Head Calibration OK ==== Press Spacebar to continue");
            else
                text.draw("Be visible with the head and glasses");
        }
        break;
        case 1:
        case 2:
        {   if ( allVisiblePatch )
                text.draw("Cyclopean(x,y,z)= " + stringify<int>((eyeRight.x()+eyeLeft.x())/2)+", "+ stringify<int>((eyeRight.y()+eyeLeft.y())/2)+", "+ stringify<int>((eyeRight.z()+eyeLeft.z())/2)+", " );
            else
                text.draw("Be visible with the patch");
        }
        break;
        case 3:  // When the head calibration is done then calibrate the fingers
        {   switch ( fingerCalibrationDone )
            {
            case 0:
                text.draw("Press F to record platform markers");
                break;
            case 1:
                text.draw("Move INDEX on platform markers to record ghost finger tips, then press F");
                break;
			case 2:
                text.draw("Move THUMB on platform markers to record ghost finger tips, then press F");
                break;
			case 3:
                text.draw("Move BOTH INDEX AND THUMB to rigidbody tip, then press F");
				break;
            }
        }
        break;
        }
        if ( headCalibrationDone==3 && fingerCalibrationDone==4 )
        {   text.draw("Trial mode " + stringify<int>(trialMode ));
            text.draw("ThumbProjectedInside " + stringify<int>(thumbProjectedInside));
            text.draw("DrawingTrialFrame= " + stringify<int>(drawingTrialFrame));
            text.draw("TrialFrame= " + stringify<int>(trialFrame));
            text.draw("IsDrawing?= " + stringify<int>(isDrawing));
            text.draw("VisualRod= " + stringify<Eigen::Matrix<double,1,3> >(visualStimCenter.transpose()) );
            text.draw("Index= " + stringify< Eigen::Matrix<double,1,3> >(indexCoords.getP1().p ));
            text.draw("Thumb= " + stringify< Eigen::Matrix<double,1,3> >(thumbCoords.getP1().p ));
            text.draw("GlobTime= " + stringify<int>(globalTimer.getElapsedTimeInMilliSec()));
            text.draw("TrialTimer= " + stringify<int>(trialTimer.getElapsedTimeInMilliSec()));
			text.draw("FingersTime= " + stringify<int>(fingersTimer.getElapsedTimeInMilliSec()));
        }
        //text.draw("Gain=" + stringify<double>(factors.getCurrent().at("Gain")));
        text.leaveTextInputMode();
    }
}
开发者ID:guendas,项目名称:cncsvision,代码行数:68,代码来源:expChiaraVirtual_Pilot.cpp

示例14: drawInfo


//.........这里部分代码省略.........
				break;
		}

		text.draw("# IOD: " +stringify<double>(interoculardistance));

		// check if mirror is calibrated
		if ( abs(mirrorAlignment - 45.0) < 0.2 )
			glColor3fv(glGreen);
		else
			glColor3fv(glRed);
		text.draw("# Mirror Alignment = " +stringify<double>(mirrorAlignment));

		// check if monitor is calibrated
		if ( screenAlignmentY < 89.0 )
			glColor3fv(glRed);
		else
			glColor3fv(glGreen);
		text.draw("# Screen Alignment Y = " +stringify<double>(screenAlignmentY));
		if ( abs(screenAlignmentZ) < 89.0 )
			glColor3fv(glRed);
		else
			glColor3fv(glGreen);
		text.draw("# Screen Alignment Z = " +stringify<double>(screenAlignmentZ));
		glColor3fv(glWhite);
		// X and Z coords of simulated fixation
		text.draw("# Fixation Z = " +stringify<double>(markers[19].p.x()-120.0)+ " [mm]");
		text.draw("# Fixation X = " +stringify<double>(markers[19].p.z()+363.0)+ " [mm]");
		text.draw(" ");

		glColor3fv(glWhite);
		text.draw("Calibration Platform" );
		
		if ( isVisible(markers[1].p) && isVisible(markers[2].p) )
			glColor3fv(glGreen);
		else
			glColor3fv(glRed);
		
		text.draw("Marker "+ stringify<int>(1)+stringify< Eigen::Matrix<double,1,3> > (markers[1].p.transpose())+ " [mm]" );
		text.draw("Marker "+ stringify<int>(2)+stringify< Eigen::Matrix<double,1,3> > (markers[2].p.transpose())+ " [mm]" );

		if ( isVisible(markers[3].p) )
			glColor3fv(glGreen);
		else
			glColor3fv(glRed);
		text.draw("Marker "+ stringify<int>(3)+stringify< Eigen::Matrix<double,1,3> > (markers[3].p.transpose())+ " [mm]" );
		text.draw("Marker "+ stringify<int>(4)+stringify< Eigen::Matrix<double,1,3> > (markers[4].p.transpose())+ " [mm]" );

		glColor3fv(glWhite);
		text.draw(" " );
		text.draw("Index" );

		if ( isVisible(markers[13].p) && isVisible(markers[14].p) && isVisible(markers[16].p) )
			glColor3fv(glGreen);
		else
			glColor3fv(glRed);
		text.draw("Marker "+ stringify<int>(13)+stringify< Eigen::Matrix<double,1,3> > (markers[13].p.transpose())+ " [mm]" );
		text.draw("Marker "+ stringify<int>(14)+stringify< Eigen::Matrix<double,1,3> > (markers[14].p.transpose())+ " [mm]" );
		text.draw("Marker "+ stringify<int>(16)+stringify< Eigen::Matrix<double,1,3> > (markers[16].p.transpose())+ " [mm]" );

		glColor3fv(glWhite); 
		text.draw(" " );
		text.draw("Thumb" );

		if ( isVisible(markers[15].p) && isVisible(markers[17].p) && isVisible(markers[18].p) )
			glColor3fv(glGreen);
		else
			glColor3fv(glRed);
		text.draw("Marker "+ stringify<int>(15)+stringify< Eigen::Matrix<double,1,3> > (markers[15].p.transpose())+ " [mm]" );
		text.draw("Marker "+ stringify<int>(17)+stringify< Eigen::Matrix<double,1,3> > (markers[17].p.transpose())+ " [mm]" );
		text.draw("Marker "+ stringify<int>(18)+stringify< Eigen::Matrix<double,1,3> > (markers[18].p.transpose())+ " [mm]" );

		if ( allVisibleObject )
			glColor3fv(glGreen);
		else
			glColor3fv(glRed);
		text.draw(" " );
		text.draw("Marker "+ stringify<int>(11)+stringify< Eigen::Matrix<double,1,3> > (markers[11].p.transpose())+ " [mm]" );
		text.draw("Marker "+ stringify<int>(12)+stringify< Eigen::Matrix<double,1,3> > (markers[12].p.transpose())+ " [mm]" );
		text.draw("Marker "+ stringify<int>(8)+stringify< Eigen::Matrix<double,1,3> > (markers[8].p.transpose())+ " [mm]" );

		glColor3fv(glWhite); 
		text.draw(" " );
		text.draw("Index = " +stringify< Eigen::Matrix<double,1,3> > (ind.transpose()));
		text.draw("Thumb = " +stringify< Eigen::Matrix<double,1,3> > (thu.transpose()));
		text.draw("Platform Orientation = " + stringify<double>(platformXZtheta));
		text.draw("test = " +stringify< Eigen::Matrix<double,1,3> > (test.transpose()));

		text.leaveTextInputMode();
	}

	if ( expFinished )
	{
		GLText text2;	
		text2.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_12);
		text2.enterTextInputMode();
		text2.draw("The experiment is finished.");
		text2.leaveTextInputMode();
	}

}
开发者ID:guendas,项目名称:cncsvision,代码行数:101,代码来源:spring15-calibration-oneFpress.cpp


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