本文整理汇总了C++中CoordinatesExtractor2::init方法的典型用法代码示例。如果您正苦于以下问题:C++ CoordinatesExtractor2::init方法的具体用法?C++ CoordinatesExtractor2::init怎么用?C++ CoordinatesExtractor2::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CoordinatesExtractor2
的用法示例。
在下文中一共展示了CoordinatesExtractor2::init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleKeypress
void handleKeypress(unsigned char key, int x, int y)
{
switch (key)
{ //Quit program
case 'q':
case 27:
{
optotrak.stopCollection();
Sleep(1000);
exit(0);
}
break;
case 'i':
infoDrawn=!infoDrawn;
break;
case ' ':
{
// Here we record the head shape - coordinates of eyes and markers, but centered in (0,0,0)
if ( headCalibrationDone==0 && allVisiblePatch )
{
headEyeCoords.init(markers[17].p,markers[18].p, markers[1].p,markers[2].p,markers[3].p,interoculardistance );
headCalibrationDone=1;
beepOk();
break;
}
// Second calibration, you must look a fixed fixation point
if ( headCalibrationDone==1 && allVisiblePatch)
{
headEyeCoords.init( headEyeCoords.getP1().p,headEyeCoords.getP2().p, markers[1].p, markers[2].p,markers[3].p,interoculardistance );
headCalibrationDone=2;
beepOk();
break;
}
if ( headCalibrationDone==2 && allVisiblePatch )
{ headEyeCoords.init( headEyeCoords.getP1().p,headEyeCoords.getP2().p, markers[1].p, markers[2].p,markers[3].p,interoculardistance );
beepOk();
break;
}
}
break;
// Enter key: press to make the final calibration
case 13:
{
if ( canCalibrate && headCalibrationDone == 2 && allVisiblePatch )
{
headEyeCoords.init( headEyeCoords.getP1().p,headEyeCoords.getP2().p, markers[1].p, markers[2].p,markers[3].p,interoculardistance );
headCalibrationDone=3;
infoDrawn=false;
for (int i=0; i<3; i++)
beepOk();
}
}
break;
}
}
示例2: handleKeypress
void handleKeypress(unsigned char key, int x, int y)
{ switch (key)
{ //Quit program
case 'q':
case 27:
{
plato_stop();
exit(0);
}
break;
case ' ':
{ // Here we record the head shape - coordinates of eyes and markers, but centered in (0,0,0)
if ( headCalibrationDone==0 && allVisibleHead )
{ headEyeCoords.init(markers.at(17).p,markers.at(18).p, markers.at(1).p,markers.at(2).p,markers.at(3).p,interoculardistance );
headCalibrationDone=1;
beepOk();
break;
}
if ( headCalibrationDone==1 && allVisiblePatch )
{
headCalibrationDone=3;
RoveretoMotorFunctions::moveObjectAbsolute( platformCalibration, rodTipHome, 3500);
beepOk();
}
}
break;
case 'i':
infoDraw=!infoDraw;
break;
case 'f':
case 'F':
{
if (headCalibrationDone < 3 )
break;
// Here we record the finger tip physical markers
if ( allVisiblePlatform && (fingerCalibrationDone==0) )
{ platformIndex=markers.at(16).p;
platformThumb=markers.at(15).p;
fingerCalibrationDone=1;
beepOk();
break;
}
// Calibrate the index first
if ( (fingerCalibrationDone==1) && allVisibleIndex )
{
indexCoords.init(platformIndex, markers.at(7).p, markers.at(8).p, markers.at(9).p );
rigidStartIndex.setRigidBody(markers.at(7).p-platformIndex,markers.at(8).p-platformIndex,markers.at(9).p-platformIndex);
fingerCalibrationDone=2;
beepOk();
break;
}
// Calibrate the thumb then
if ( (fingerCalibrationDone==2) && allVisibleThumb )
{
rigidStartThumb.setRigidBody(markers.at(11).p-platformThumb,markers.at(12).p-platformThumb,markers.at(13).p-platformThumb);
thumbCoords.init(platformThumb, markers.at(11).p, markers.at(12).p, markers.at(13).p);
fingerCalibrationDone=3;
beepOk();
break;
}
if ( fingerCalibrationDone==3 && allVisibleFingers )
{
fingerCalibrationDone=4;
infoDraw=false;
paintGL();
physicalRigidBodyTip = indexCoords.getP1().p;
trialMode = HANDONSTARTMODE;
fingerDistance = (indexCoords.getP1().p-thumbCoords.getP1().p).norm();
moveStimulusObject(visualStimCenter,3500);
beepTrial();
trialFrame=0;
drawingTrialFrame=0;
globalTimer.start();
plato_write(PLATO_LEFT_RIGHT_OPEN);
break;
}
}
break;
}
}
示例3: handleKeypress
void handleKeypress(unsigned char key, int x, int y)
{ switch (key)
{ //Quit program
case 'q':
case 27:
{ exit(0);
}
break;
case ' ':
{ // Here we record the head shape - coordinates of eyes and markers, but centered in (0,0,0)
if ( headCalibrationDone==0 && allVisibleHead )
{
headEyeCoords.init(markers.at(18).p-Vector3d(ChinRestWidth,0,0),markers.at(18).p, markers.at(1).p,markers.at(2).p,markers.at(3).p,interoculardistance );
headCalibrationDone=1;
beepOk();
break;
}
if ( headCalibrationDone==1 && allVisiblePatch )
{
headCalibrationDone=3;
beepOk();
}
}
break;
case 'i':
infoDraw=!infoDraw;
break;
case 'f':
case 'F':
{ // Here we record the finger tip physical markers
if ( allVisiblePlatform && (fingerCalibrationDone==0) )
{
platformIndex=markers.at(16).p;
platformThumb=markers.at(15).p;
fingerCalibrationDone=1;
beepOk();
break;
}
if ( (fingerCalibrationDone==1) && allVisibleFingers )
{
thumbCoords.init(platformThumb, markers.at(11).p, markers.at(12).p, markers.at(13).p);
indexCoords.init(platformIndex, markers.at(7).p, markers.at(8).p, markers.at(9).p );
fingerCalibrationDone=2;
// XXX sposto l'oggetto a home per permettere le dita di calibrarsi
// TriesteMotorFunctions::homeObject(3500); //// XXX commentato: A TS no servi
beepOk();
break;
}
if ( fingerCalibrationDone==2 && allVisibleFingers )
{ infoDraw=false;
drawGLScene();
physicalRigidBodyTip = indexCoords.getP1().p;
fingerCalibrationDone=3;
switch ( block.at("Phase") )
{
case 0:
{
cerr << "Key 721 case 0" << endl;
factors = trial.getNext();
deltaXRods = mathcommon::unifRand(str2num<double>(parameters.find("DeltaXMin")),str2num<double>(parameters.find("DeltaXMax")));
initStimulus(factors.at("StimulusHeight"),deltaXRods,factors.at("RelDepth"));
// moveMonitorAbsolute(factors.at("Distances"),homeFocalDistance,SCREENSPEED);
initProjectionScreen(factors.at("Distances"));
visualRodCenter = Vector3d(0,0,factors.at("Distances"));
hapticRodCenter = rodAway; // keep it away
// moveRod(rodAway,RODSPEED);
cerr << "Key 730 case 0" << endl;
}
beepOk();
break;
case 2:
{ factors = trial.getNext();
deltaXRods = mathcommon::unifRand(str2num<double>(parameters.find("DeltaXMin")),str2num<double>(parameters.find("DeltaXMax")));
initStimulus(factors.at("StimulusHeight"),deltaXRods,factors.at("RelDepth"));
// moveMonitorAbsolute(factors.at("Distances"),homeFocalDistance,SCREENSPEED);
initProjectionScreen(factors.at("Distances"));
visualRodCenter = Vector3d(0,0,factors.at("Distances"));
hapticRodCenter = rodAway; // keep it away
// moveRod(rodAway,RODSPEED);
}
break;
case 1:
{
cerr << "Key 735 case 1" << endl;
double zadaptmin = str2num<double>(parameters.find("AdaptZMin"));
double zadaptmax = str2num<double>(parameters.find("AdaptZMax"));
if (str2num<int>(parameters.find("AdaptMoveMonitor"))==1)
visualRodCenter = Vector3d(0,0,mathcommon::unifRand(zadaptmin,zadaptmax));
else
visualRodCenter = Vector3d(0,0,(zadaptmax+zadaptmin)/2);
if ( str2num<int>(parameters.find("AdaptHapticFeedback"))==1 )
hapticRodCenter = visualRodCenter - Vector3d(0,0,adaptOffsets.at(block1TrialNumber));
else
hapticRodCenter = rodAway;
initProjectionScreen( visualRodCenter.z() );
//.........这里部分代码省略.........