void StimulusGroupReferenceNode::unload(shared_ptr<StimulusDisplay> display){ int index_value = getIndexValue(); int nelements = stimulus_nodes->getNElements(); if(index_value >=0 && index_value < nelements ){ (stimulus_nodes->getElement(index_value))->unload(display); } }
void StimulusGroupReferenceNode::addToDisplay(shared_ptr<StimulusDisplay> display){ int index_value = getIndexValue(); int nelements = stimulus_nodes->getNElements(); if(index_value >=0 && index_value < nelements ){ display->addStimulusNode(stimulus_nodes->getElement(index_value)); } }
void StimulusGroupReferenceNode::announceStimulusDraw(MWTime time){ int index_value = getIndexValue(); int nelements = stimulus_nodes->getNElements(); if(index_value >=0 && index_value < nelements ){ (stimulus_nodes->getElement(index_value))->announceStimulusDraw(time); } }
int StimulusGroupReferenceNode::getDeferred(){ int index_value = getIndexValue(); int nelements = stimulus_nodes->getNElements(); if(index_value >=0 && index_value < nelements ){ return (stimulus_nodes->getElement(index_value))->getDeferred(); } return Stimulus::nondeferred_load; }
int StructuredScript::Objects::IndexObject::rank(){ auto target = dynamic_cast<IIndexTarget *>(target_.get()); if (target == nullptr) return -1; auto indexValue = target->getIndexValue(value_)->base(); return dynamic_cast<IPrimitiveObject *>(indexValue.get())->rank(); }
shared_ptr<Stimulus> StimulusGroupReferenceNode::getStimulus() { int index_value = getIndexValue(); int nelements = stimulus_nodes->getNElements(); if(index_value >=0 && index_value < nelements ){ return (stimulus_nodes->getElement(index_value))->getStimulus(); } return shared_ptr<Stimulus>(); }
StructuredScript::Interfaces::Any::Ptr StructuredScript::Objects::IndexObject::clone(IStorage *storage, IExceptionManager *exception, INode *expr){ auto target = dynamic_cast<IIndexTarget *>(target_.get()); if (target == nullptr){ return Query::ExceptionManager::setAndReturnObject(exception, PrimitiveFactory::createString(Query::ExceptionManager::combine( "Bad index object while copying!", expr))); } return target->getIndexValue(value_); }
bool StimulusGroupReferenceNode::isLoaded(){ int index_value = getIndexValue(); int nelements = stimulus_nodes->getNElements(); if(index_value >=0 && index_value < nelements ){ return (stimulus_nodes->getElement(index_value))->isLoaded(); } return false; }
void parseIndexFile(int maptype) { FILE *iniFptr = NULL; struct stat fileData; char line[300]; char * strkey = NULL; char fileName[256] = "\0"; /* * 0 - kwrd Map * 1 - SHA1 Map * 2 - name Map */ if(maptype == 0) { // Insert into kwrd Map strcpy(fileName,kwrdIndexFileName); } else if(maptype == 1) { // Insert into SHA1 Map strcpy(fileName,sha1IndexFileName); } else if(maptype == 2) { //Insert into Filename Map strcpy(fileName,fileNameIndexFileName); } /* * Parse Index File */ if(stat(fileName,&fileData) < 0) { //The specified ini file does not exist iniFptr = fopen(fileName,"w"); fclose(iniFptr); } if((iniFptr = fopen(fileName,"r")) == NULL) { printf("\nError opening ini file: %s\n",fileName); exit(0); } while(fgets(line,sizeof(line),iniFptr) != NULL) { if(strcmp(line,"\n") != 0) { //This is not a section, these are key value pairs strkey = getIndexKey(line); if(strkey != NULL) getIndexValue(strkey); populateIndexMap(indexkey,indexvalue,maptype); } } fclose(iniFptr); }
StructuredScript::Interfaces::Any::Ptr StructuredScript::Objects::IndexObject::evaluateRightUnary(const std::string &value, IStorage *storage, IExceptionManager *exception, INode *expr){ auto target = dynamic_cast<IIndexTarget *>(target_.get()); if (target == nullptr){ return Query::ExceptionManager::setAndReturnObject(exception, PrimitiveFactory::createString(Query::ExceptionManager::combine( "'" + value + "': Bad index object!", expr))); } auto indexValue = target->getIndexValue(value_)->base(); return indexValue->evaluateRightUnary(value, storage, exception, expr); }
Datum StimulusGroupReferenceNode::getCurrentAnnounceDrawData(){ int index_value = getIndexValue(); int nelements = stimulus_nodes->getNElements(); if(index_value >=0 && index_value < nelements ){ return (stimulus_nodes->getElement(index_value))->getCurrentAnnounceDrawData(); } else { Datum undef; return undef; } }
std::string StructuredScript::Objects::IndexObject::str(IStorage *storage, IExceptionManager *exception, INode *expr){ auto target = dynamic_cast<IIndexTarget *>(target_.get()); if (target == nullptr){ Query::ExceptionManager::set(exception, PrimitiveFactory::createString(Query::ExceptionManager::combine( "Bad index object while converting to string!", expr))); return ""; } return target->getIndexValue(value_)->str(storage, exception, expr); }
// set the "frozen" state of the node void StimulusGroupReferenceNode::setFrozen(bool _frozen){ int index_value = getIndexValue(); int nelements = stimulus_nodes->getNElements(); if(index_value >=0 && index_value < nelements ){ shared_ptr<StimulusNode> node = stimulus_nodes->getElement(index_value); if(_frozen){ node->freeze(); } else { node->thaw(); } } }
void EffectCanvas::OnLeftMouseDown(wxMouseEvent& event) { int index; float value; getIndexValue(index, value, event); prevIndex = index; change = new ChangeEffectDraw(effect->inst, effect->timeline, effect->type); change->update(prevIndex, index, value * 254.0f); Refresh(); if (!HasCapture()) { CaptureMouse(); } //event.Skip(); }
void EffectCanvas::OnMouseMove(wxMouseEvent& event) { if (!event.m_leftDown || !HasCapture()) { event.Skip(); return; } int index; float value; getIndexValue(index, value, event); change->update(prevIndex, index, value * 254.0f); prevIndex = index; Refresh(); //event.Skip(); }
StructuredScript::Interfaces::Any::Ptr StructuredScript::Objects::IndexObject::base(){ auto target = dynamic_cast<IIndexTarget *>(target_.get()); return (target == nullptr) ? nullptr : target->getIndexValue(value_); }
ahm::PropertyValue * getIndexValue(ahm::Property* pProperty, iop::int32 index) { return pProperty ? getIndexValue(pProperty->value(), index) : 0; }