void kpoBaseApp::modelCloudAnalyzed(kpoCloudDescription od) { std::cout << "modelCloudAnalyzed()" << std::endl; Cloud *keypoints = new Cloud(); pcl::copyPointCloud(od.keypoints, *keypoints); Cloud::Ptr keypoints_ptr(keypoints); DescriptorCloud *descriptors = new DescriptorCloud(); pcl::copyPointCloud(od.descriptors, *descriptors); DescriptorCloud::Ptr descriptors_ptr(descriptors); RFCloud *reference_frames= new RFCloud(); pcl::copyPointCloud(od.reference_frames, *reference_frames); RFCloud::Ptr reference_frames_ptr(reference_frames); kpoMatcherThread *matcher = new kpoMatcherThread(keypoints_ptr, descriptors_ptr, reference_frames_ptr); boost::shared_ptr<kpoMatcherThread> matcher_thread(matcher); matcher_thread->object_id = od.object_id; matcher_thread->filename = od.filename; MatchCallback f = boost::bind (&kpoBaseApp::matchesFound, this, _1, _2, _3); matcher_thread->setMatchCallback(f); #pragma omp critical(dataupdate) { matcher_threads.push_back(matcher_thread); } }
ErrorCode MatchDocument(DocID doc_id, const char* doc_str) { // DNode_t* lazy_node = lazy_list->head.next; // // while ((lazy_node = lazy_list->head.next) != &(lazy_list->tail)) { // lazyStart((QueryDescriptor*) (lazy_node->data)); //// cir_queue_insert(cirq_busy_queries, lazy_node->data); ////#ifndef THREAD_ENABLE //// lazyStart(0); ////#endif // lazy_nodes[((QueryDescriptor*) (lazy_node->data))->queryId] = 0; // delete_node(lazy_node); // } DNode_t* lazy_node = lazy_list->head.next, *tmp; while (lazy_node != &(lazy_list->tail)) { tmp = lazy_node->next; lazyStart((QueryDescriptor*) (lazy_node->data)); lazy_nodes[((QueryDescriptor*) (lazy_node->data))->queryId] = 0; delete_node(lazy_node); lazy_node = tmp; } #ifdef THREAD_ENABLE waitTillFull(&cirq_free_segments); #endif docCount++; char *doc_buf = (char *) cir_queue_remove(&cirq_free_docs); strcpy(doc_buf, doc_str); DocumentDescriptor *desc = newDocumentDescriptor(); desc->docId = doc_id; desc->document = doc_buf; cir_queue_insert(&cirq_busy_docs, desc); #ifndef THREAD_ENABLE matcher_thread(0); #endif return EC_SUCCESS; }