SequenceStatus GestureSeqRecorder::registerSequence(midasMode mode, sequence seq, CommandData seqResponse, std::string name)
{
    sequenceInfo seqInfo;
    seqInfo.seq = seq;
    seqInfo.sequenceResponse = seqResponse;
    seqInfo.sequenceName = name;
    SequenceStatus status = checkLegalRegister(mode, seqInfo);
    if (status != SequenceStatus::SUCCESS)
    {
        return status;
    }

    sequenceList *seqList = (*seqMapPerMode)[mode];
    seqList->push_back(seqInfo);

    seqList = NULL;

    std::vector<int> ids;
    std::vector<PoseLength> lengths;
    sequence::iterator it;

    for (it = seq.begin(); it != seq.end(); ++it)
    {
        ids.push_back(it->type);
        lengths.push_back(it->poseLen);
    }

    std::vector<sequenceImageSet> images = imageManager.formSequenceSetFromIds(ids, lengths);

    gestureSignaller.emitRegisterSequence(seqInfo.id, QString(seqInfo.sequenceName.c_str()), images);

    return SequenceStatus::SUCCESS;
}
  bool
  operator > (const sequence<Iter2, Comp2>& seq) const
  {
    return std::lexicographical_compare (seq.begin(), seq.end(),
					 begin(), end(),
					 compare);
  }
Beispiel #3
0
/*
 * Helper for element and docuemnt constructors to insert sequence
 * of atomic values. Returns true if node was actually inserted.
 * In this case left pointer is changed to the last inserted indirection.
 * In any case at_vals sequence is cleared.
 */
static inline bool
process_atomic_values(xptr& left, const xptr& parent, sequence& at_vals) {
    if (at_vals.size() > 0)
    {
        executor_globals::tmp_op_str_buf.clear();
        tuple_cell tcc;
        sequence::iterator it = at_vals.begin();
        do {
            tcc = tuple_cell::make_sure_light_atomic((*it).cells[0]);
            tcc = cast(tcc, xs_string);
            executor_globals::tmp_op_str_buf.append(tcc);
            it++;
        }
        while (it != at_vals.end());

        at_vals.clear();
        if(executor_globals::tmp_op_str_buf.get_size() > 0) {
            insert_text(indirectionDereferenceCP(left),
                        XNULL,
                        indirectionDereferenceCP(parent),
                        text_source_strbuf(&(executor_globals::tmp_op_str_buf)));
            left = get_last_mo_inderection();
            return true;
        }
    }
    return false;
}