예제 #1
0
void ARIntens::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.GetCount() == 0)
	{
		// create a list of string ...

		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail(( "S,type,,r;F,value,-1.0,o"));
		CreateListOfTPLs(ltpls,lstrs);
	}

	TagParameterList * rtpl = 0;
	int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);

	if (ret>=0 && rtpl)
	{
		// we found a match!
		if (ret == 0)
		{
			// then, we now the match for
			// the first ParameterList
			// w, h, ml, mt, mr, mb
			GuidoPos pos = rtpl->GetHeadPosition();

			TagParameterString * tps = TagParameterString::cast(rtpl->GetNext(pos));
			assert(tps);

			mIntensText = tps->getValue();

			TagParameterFloat * tpf = TagParameterFloat::cast(rtpl->GetNext(pos));
			assert(tpf);

			if (tpf->pflag != TagParameter::NOTSET)
			{
				value = tpf->getValue();
			}
		}

		delete rtpl;
	}
	else
	{
		// failure
	}

	tpl.RemoveAll();
}
예제 #2
0
void ARSpace::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.GetCount() == 0)
	{

		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail( ( "U,dd,,r"));
		CreateListOfTPLs(ltpls,lstrs);

	}
	TagParameterList * rtpl = NULL;
	int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);

	if (ret>=0 && rtpl)
	{
		// we found a match!
		if (ret == 0)
		{
			// then, we now the match for
			// the first ParameterList
			// w, h, ml, mt, mr, mb
			GuidoPos pos = rtpl->GetHeadPosition();

			TagParameterFloat * tpf = TagParameterFloat::cast(rtpl->GetNext(pos));
			assert(tpf);

			val = tpf->getValue();
		}
		delete rtpl;

	}
	else
	{
		// failure.
	}
	tpl.RemoveAll();
	
}
예제 #3
0
void ARGlissando::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.GetCount() == 0)
	{
		ListOfStrings lstrs; // (1); std::vector test impl
		
		lstrs.AddTail( "U,dx1,0,o;U,dy1,0,o;"
			"U,dx2,0,o;U,dy2,0,o;"
			"S,fill,false,o;U,thickness,0.3,o"
			//";S,lineStyle,line,o"
            );
		
		CreateListOfTPLs(ltpls,lstrs);
	}

	TagParameterList * rtpl = 0;
	int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);
	if (ret>=0 && rtpl)
	{
		// we found a match!
		if (ret == 0)
		{
			TagParameterFloat *f = TagParameterFloat::cast(rtpl->RemoveHead());
            fDx1 = f->getValue();
            delete f;

			f = TagParameterFloat::cast(rtpl->RemoveHead());
            fDy1 = f->getValue();
            delete f;

			f = TagParameterFloat::cast(rtpl->RemoveHead());
            fDx2 = f->getValue();
            delete f;

			f = TagParameterFloat::cast(rtpl->RemoveHead());
            fDy2 = f->getValue();
            delete f;

            TagParameterString *s = TagParameterString::cast(rtpl->RemoveHead());
            s->getBool(fFill);
            delete s;

			f = TagParameterFloat::cast(rtpl->RemoveHead());
            fThickness = f->getValue();
            delete f;

			/*s = TagParameterString::cast(rtpl->RemoveHead());
			string wavyLine("wavy");
			if (wavyLine == s->getValue())
				fWavy = true;*/
		}

		delete rtpl;
	}
	else
	{
		// failure
	}

	tpl.RemoveAll();

	return;
}
예제 #4
0
void ARTuplet::setTagParameterList(TagParameterList & tpl)
{
	if (ltpls.GetCount() == 0)
	{
		// create a list of string ...

		ListOfStrings lstrs; // (1); std::vector test impl
		lstrs.AddTail(("S,format,,r;S,position,above,o;U,dy1,0,o;U,dy2,0,o;F,lineThickness,0.08,o;S,bold,,o;F,textSize,1,o;S,dispNote,,o"));
		CreateListOfTPLs(ltpls,lstrs);
	}

	TagParameterList * rtpl = 0;
	int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);

	if (ret >= 0 && rtpl)
	{
		// we found a match!
		if (ret == 0)
		{
			// then, we now the match for
			// the first ParameterList
			// w, h, ml, mt, mr, mb
			GuidoPos pos = rtpl->GetHeadPosition();

			TagParameterString *tps = TagParameterString::cast(rtpl->GetNext(pos));
			assert(tps);

			if (tps->TagIsSet()) {
				fTupletFormat = tps->getValue();
				parseTupletFormatString();
			}

            tps = TagParameterString::cast(rtpl->GetNext(pos));
            fPosition = tps->getValue();
			fPositionIsSet = true;

            TagParameterFloat *tpf = TagParameterFloat::cast(rtpl->GetNext(pos));
            fDy1 = tpf->getValue();
            if (tpf->TagIsSet())
                fDy1TagIsSet = true;

			tpf = TagParameterFloat::cast(rtpl->GetNext(pos));
            fDy2 = tpf->getValue();
            if (tpf->TagIsSet())
                fDy2TagIsSet = true;

            tpf = TagParameterFloat::cast(rtpl->GetNext(pos));
            fLineThickness = tpf->getValue() * LSPACE;

            tps = TagParameterString::cast(rtpl->GetNext(pos));
            tps->getBool(fTextBold);

            tpf = TagParameterFloat::cast(rtpl->GetNext(pos));
            fTextSize = tpf->getValue();

            tps = TagParameterString::cast(rtpl->GetNext(pos));
            fDispNote = tps->getValue();
		}

		delete rtpl;
	}
	else
	{
		// failure
	}

	tpl.RemoveAll();
}