本文整理汇总了C++中Datum::addElement方法的典型用法代码示例。如果您正苦于以下问题:C++ Datum::addElement方法的具体用法?C++ Datum::addElement怎么用?C++ Datum::addElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Datum
的用法示例。
在下文中一共展示了Datum::addElement方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getCurrentAnnounceDrawData
Datum FrameListStimulus::getCurrentAnnounceDrawData() {
boost::mutex::scoped_lock locker(stim_lock);
Datum announceData = BaseFrameListStimulus::getCurrentAnnounceDrawData();
announceData.addElement(STIM_TYPE, "frame_list");
announceData.addElement(STIMULUS_GROUP, stimulusGroup->getTag());
return announceData;
}
示例2: getCurrentAnnounceDrawData
// override of RectangleStimulus announce method -- allows trigger info to also be announced
Datum FixationPoint::getCurrentAnnounceDrawData() {
//if (VERBOSE_EYE_CALIBRATORS> 1) mprintf("getting announce DRAW data for fixation point stimulus %s",tag );
Datum announceData = RectangleStimulus::getCurrentAnnounceDrawData();
announceData.addElement(STIM_TYPE,STIM_TYPE_POINT);
// stuff from the trigger that is not in rectangle stimulus ...
announceData.addElement("center_x", (double)(*centerx));
announceData.addElement("center_y", (double)(*centery));
announceData.addElement("width", (double)(*width));
return (announceData);
}
示例3: getCurrentAnnounceDrawData
Datum DynamicRandomDots::getCurrentAnnounceDrawData() {
boost::mutex::scoped_lock locker(stim_lock);
Datum announceData = StandardDynamicStimulus::getCurrentAnnounceDrawData();
announceData.addElement(STIM_TYPE, "dynamic_random_dots");
announceData.addElement("field_radius", fieldRadius);
announceData.addElement("field_center_x", fieldCenterX);
announceData.addElement("field_center_y", fieldCenterY);
announceData.addElement("num_dots", (long)numDots);
announceData.addElement("dot_size", dotSize);
announceData.addElement(STIM_COLOR_R, colorR);
announceData.addElement(STIM_COLOR_G, colorG);
announceData.addElement(STIM_COLOR_B, colorB);
announceData.addElement("alpha_multiplier", alpha);
announceData.addElement("direction", direction->getValue().getFloat());
announceData.addElement("speed", speed->getValue().getFloat());
return announceData;
}
示例4: getCurrentAnnounceDrawData
Datum BaseFrameListStimulus::getCurrentAnnounceDrawData() {
Datum announceData = StandardDynamicStimulus::getCurrentAnnounceDrawData();
if (stimulusGroup) {
announceData.addElement(STIMULUS_GROUP, stimulusGroup->getTag());
}
announceData.addElement(LOOP, loop->getValue());
announceData.addElement("playing", Datum(isPlaying()));
int frameNumber = getFrameNumber();
announceData.addElement("current_frame", Datum((long)frameNumber));
Datum currentStimulusAnnounceData(0L);
if ((frameNumber >= 0) && (frameNumber < getNumFrames())) {
currentStimulusAnnounceData = getStimulusForFrame(frameNumber)->getCurrentAnnounceDrawData();
}
announceData.addElement("current_stimulus", currentStimulusAnnounceData);
return announceData;
}
示例5: getAnnounceData
Datum StimulusDisplay::getAnnounceData(bool updateIsExplicit) {
Datum stimAnnounce;
if (!shouldAnnounceStimuli(updateIsExplicit)) {
// No stim announcements, so just report the number of stimuli drawn
stimAnnounce = Datum(long(stimAnnouncements.size()));
} else {
stimAnnounce = Datum(M_LIST, int(stimAnnouncements.size()));
for (size_t i = 0; i < stimAnnouncements.size(); i++) {
stimAnnounce.addElement(stimAnnouncements[i]);
}
}
return stimAnnounce;
}
示例6: getCurrentAnnounceDrawData
Datum MovingDots::getCurrentAnnounceDrawData() {
boost::mutex::scoped_lock locker(stim_lock);
Datum announceData = StandardDynamicStimulus::getCurrentAnnounceDrawData();
announceData.addElement(STIM_TYPE, "moving_dots");
announceData.addElement(FIELD_RADIUS, currentFieldRadius);
announceData.addElement(FIELD_CENTER_X, fieldCenterX->getValue().getFloat());
announceData.addElement(FIELD_CENTER_Y, fieldCenterY->getValue().getFloat());
announceData.addElement(DOT_DENSITY, dotDensity->getValue().getFloat());
announceData.addElement(DOT_SIZE, dotSize->getValue().getFloat());
announceData.addElement(STIM_COLOR_R, red->getValue().getFloat());
announceData.addElement(STIM_COLOR_G, green->getValue().getFloat());
announceData.addElement(STIM_COLOR_B, blue->getValue().getFloat());
announceData.addElement(ALPHA_MULTIPLIER, alpha->getValue().getFloat());
announceData.addElement(DIRECTION, direction->getValue().getFloat());
announceData.addElement(SPEED, currentSpeed);
announceData.addElement(COHERENCE, currentCoherence);
announceData.addElement(LIFETIME, currentLifetime);
announceData.addElement("num_dots", long(currentNumDots));
announceData.addElement(RAND_SEED, randSeed);
if (announceDots->getValue().getBool()) {
Datum dotsData(reinterpret_cast<char *>(&(dotPositions[0])), dotPositions.size() * sizeof(GLfloat));
announceData.addElement("dots", dotsData);
}
return announceData;
}