コード例 #1
0
ファイル: StimulusNode.cpp プロジェクト: BramVerhoef/mworks
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);
	}  
}
コード例 #2
0
ファイル: StimulusNode.cpp プロジェクト: BramVerhoef/mworks
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));
	}
}
コード例 #3
0
ファイル: StimulusNode.cpp プロジェクト: BramVerhoef/mworks
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);
	}
}
コード例 #4
0
ファイル: StimulusNode.cpp プロジェクト: BramVerhoef/mworks
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;
}
コード例 #5
0
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();
}
コード例 #6
0
ファイル: StimulusNode.cpp プロジェクト: BramVerhoef/mworks
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>();
}
コード例 #7
0
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_);
}
コード例 #8
0
ファイル: StimulusNode.cpp プロジェクト: BramVerhoef/mworks
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;
}
コード例 #9
0
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);
}
コード例 #10
0
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);
}
コード例 #11
0
ファイル: StimulusNode.cpp プロジェクト: BramVerhoef/mworks
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;
	}
}
コード例 #12
0
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);
}
コード例 #13
0
ファイル: StimulusNode.cpp プロジェクト: BramVerhoef/mworks
// 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();
        }
	}
}
コード例 #14
0
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();
}
コード例 #15
0
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();
}
コード例 #16
0
StructuredScript::Interfaces::Any::Ptr StructuredScript::Objects::IndexObject::base(){
	auto target = dynamic_cast<IIndexTarget *>(target_.get());
	return (target == nullptr) ? nullptr : target->getIndexValue(value_);
}
コード例 #17
0
ahm::PropertyValue * getIndexValue(ahm::Property* pProperty, iop::int32 index) {
    return pProperty ? getIndexValue(pProperty->value(), index) : 0;
}